@autobe/agent
Version:
AI backend server code generator
735 lines • 41.8 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.orchestrateAnalyzeWriteUnit = void 0;
const __typia_transform__isTypeUint32 = __importStar(require("typia/lib/internal/_isTypeUint32"));
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport"));
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize"));
const tstl_1 = require("tstl");
const typia_1 = __importDefault(require("typia"));
const uuid_1 = require("uuid");
const validateEnglishOnly_1 = require("../../utils/validateEnglishOnly");
const AutoBePreliminaryController_1 = require("../common/AutoBePreliminaryController");
const transformAnalyzeWriteUnitHistory_1 = require("./histories/transformAnalyzeWriteUnitHistory");
const orchestrateAnalyzeWriteUnit = (ctx, props) => __awaiter(void 0, void 0, void 0, function* () {
const counter = new tstl_1.Singleton(() => ++props.progress.completed);
const preliminary = new AutoBePreliminaryController_1.AutoBePreliminaryController({
application: {
version: "3.1",
components: {
schemas: {
"IAutoBeAnalyzeWriteUnitApplication.IProps": {
type: "object",
properties: {
thinking: {
oneOf: [
{
type: "null"
},
{
type: "string"
}
],
description: "Reasoning: what's missing (preliminary), what you're submitting (write),\nor why you're finalizing (complete)."
},
request: {
oneOf: [
{
$ref: "#/components/schemas/IAutoBePreliminaryComplete"
},
{
$ref: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections"
},
{
$ref: "#/components/schemas/IAutoBeAnalyzeWriteUnitApplication.IWrite"
}
],
discriminator: {
propertyName: "type",
mapping: {
complete: "#/components/schemas/IAutoBePreliminaryComplete",
getPreviousAnalysisSections: "#/components/schemas/IAutoBePreliminaryGetPreviousAnalysisSections",
write: "#/components/schemas/IAutoBeAnalyzeWriteUnitApplication.IWrite"
}
},
description: "Action to perform. Exhausted preliminary types are removed from the\nunion."
}
},
required: [
"request"
]
},
IAutoBePreliminaryComplete: {
type: "object",
properties: {
type: {
"const": "complete",
description: "Type discriminator for completion request."
}
},
required: [
"type"
],
description: "Finalize the write loop by accepting your most recent `write` as-is.\n\nAfter submitting a `write`, review it yourself thoroughly against the review\nchecklist in your instructions. If you find issues worth fixing, submit\nanother `write` with corrections. When you are satisfied with the quality,\ncall `complete` to finalize.\n\nYou have a maximum of 3 write attempts, but this is a safety cap \u2014 not a\ntarget to fill.\n\nOnly valid after at least one `write` submission \u2014 rejected otherwise."
},
IAutoBePreliminaryGetPreviousAnalysisSections: {
type: "object",
properties: {
type: {
"const": "getPreviousAnalysisSections",
description: "Type discriminator."
},
sectionIds: {
type: "array",
items: {
type: "integer",
minimum: 0
},
minItems: 1,
description: "Section IDs to retrieve from previous iteration. DO NOT request same IDs\nalready requested in previous calls."
}
},
required: [
"type",
"sectionIds"
],
description: "Request to retrieve analysis sections from the previous iteration by numeric\nID."
},
"IAutoBeAnalyzeWriteUnitApplication.IWrite": {
type: "object",
properties: {
type: {
"const": "write",
description: "Type discriminator for write submission."
},
moduleIndex: {
type: "number",
description: "Index of the parent module section (0-based)."
},
unitSections: {
type: "array",
items: {
$ref: "#/components/schemas/IAutoBeAnalyzeWriteUnitApplication.ISection"
},
description: "Unit sections (### level) grouping related functionality."
}
},
required: [
"type",
"moduleIndex",
"unitSections"
],
description: "Submit unit section structure within a module section."
},
"IAutoBeAnalyzeWriteUnitApplication.ISection": {
type: "object",
properties: {
title: {
type: "string",
description: "Title of the unit section (### level heading)."
},
purpose: {
type: "string",
description: "Brief purpose statement for this section's role within the parent module."
},
content: {
type: "string",
description: "Main body content: overview, context, and relationships to other\nsections."
},
keywords: {
type: "array",
items: {
type: "string"
},
description: "Keywords hinting at section topics to guide Section Agent generation."
}
},
required: [
"title",
"purpose",
"content",
"keywords"
],
description: "A single unit section."
}
}
},
functions: [
{
name: "process",
async: false,
parameters: [
{
name: "props",
required: true,
schema: {
$ref: "#/components/schemas/IAutoBeAnalyzeWriteUnitApplication.IProps"
}
}
],
description: "Create unit sections with titles, purposes, content, and keywords for a\nmodule."
}
]
},
source: SOURCE,
kinds: ["previousAnalysisSections", "complete"],
state: ctx.state(),
dispatch: (e) => ctx.dispatch(e),
});
const event = yield preliminary.orchestrate(ctx, (out) => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b;
const pointer = {
value: null,
};
const result = yield ctx.conversate(Object.assign({ source: SOURCE, controller: createController({
pointer,
preliminary,
}), enforceFunctionCall: true, promptCacheKey: props.promptCacheKey }, (0, transformAnalyzeWriteUnitHistory_1.transformAnalyzeWriteUnitHistory)(ctx, {
scenario: props.scenario,
file: props.file,
moduleEvent: props.moduleEvent,
moduleIndex: props.moduleIndex,
feedback: props.feedback,
preliminary,
})));
if (pointer.value === null)
return out(result)(null);
const event = {
type: SOURCE,
id: (0, uuid_1.v7)(),
moduleIndex: pointer.value.moduleIndex,
unitSections: pointer.value.unitSections,
acquisition: preliminary.getAcquisition(),
tokenUsage: result.tokenUsage,
metric: result.metric,
step: ((_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : -1) + 1,
total: props.progress.total,
completed: counter.get(),
retry: props.retry,
created_at: new Date().toISOString(),
};
return out(result)(event);
}));
ctx.dispatch(event);
return event;
});
exports.orchestrateAnalyzeWriteUnit = orchestrateAnalyzeWriteUnit;
function createController(props) {
const validate = (input) => {
var _a;
const result = (() => { const _io0 = input => (null === input.thinking || undefined === input.thinking || "string" === typeof input.thinking) && ("object" === typeof input.request && null !== input.request && _iu0(input.request)); const _io1 = input => "complete" === input.type; const _io2 = input => "getPreviousAnalysisSections" === input.type && (Array.isArray(input.sectionIds) && (1 <= input.sectionIds.length && input.sectionIds.every(elem => "number" === typeof elem && __typia_transform__isTypeUint32._isTypeUint32(elem)))); const _io3 = input => "write" === input.type && "number" === typeof input.moduleIndex && (Array.isArray(input.unitSections) && input.unitSections.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io4 = input => "string" === typeof input.title && "string" === typeof input.purpose && "string" === typeof input.content && (Array.isArray(input.keywords) && input.keywords.every(elem => "string" === typeof elem)); const _iu0 = input => (() => {
if ("complete" === input.type)
return _io1(input);
else if ("getPreviousAnalysisSections" === input.type)
return _io2(input);
else if ("write" === input.type)
return _io3(input);
else
return false;
})(); const _vo0 = (input, _path, _exceptionable = true) => [null === input.thinking || undefined === input.thinking || "string" === typeof input.thinking || _report(_exceptionable, {
path: _path + ".thinking",
expected: "(null | string | undefined)",
value: input.thinking
}), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, {
path: _path + ".request",
expected: "(IAutoBeAnalyzeWriteUnitApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections)",
value: input.request
})) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".request",
expected: "(IAutoBeAnalyzeWriteUnitApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections)",
value: input.request
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["complete" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"complete\"",
value: input.type
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["getPreviousAnalysisSections" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"getPreviousAnalysisSections\"",
value: input.type
}), (Array.isArray(input.sectionIds) || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)",
value: input.sectionIds
})) && ((1 <= input.sectionIds.length || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "Array<> & MinItems<1>",
value: input.sectionIds
})) && input.sectionIds.map((elem, _index4) => "number" === typeof elem && (__typia_transform__isTypeUint32._isTypeUint32(elem) || _report(_exceptionable, {
path: _path + ".sectionIds[" + _index4 + "]",
expected: "number & Type<\"uint32\">",
value: elem
})) || _report(_exceptionable, {
path: _path + ".sectionIds[" + _index4 + "]",
expected: "(number & Type<\"uint32\">)",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)",
value: input.sectionIds
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["write" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"write\"",
value: input.type
}), "number" === typeof input.moduleIndex || _report(_exceptionable, {
path: _path + ".moduleIndex",
expected: "number",
value: input.moduleIndex
}), (Array.isArray(input.unitSections) || _report(_exceptionable, {
path: _path + ".unitSections",
expected: "Array<IAutoBeAnalyzeWriteUnitApplication.ISection>",
value: input.unitSections
})) && input.unitSections.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".unitSections[" + _index5 + "]",
expected: "IAutoBeAnalyzeWriteUnitApplication.ISection",
value: elem
})) && _vo4(elem, _path + ".unitSections[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".unitSections[" + _index5 + "]",
expected: "IAutoBeAnalyzeWriteUnitApplication.ISection",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".unitSections",
expected: "Array<IAutoBeAnalyzeWriteUnitApplication.ISection>",
value: input.unitSections
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
path: _path + ".title",
expected: "string",
value: input.title
}), "string" === typeof input.purpose || _report(_exceptionable, {
path: _path + ".purpose",
expected: "string",
value: input.purpose
}), "string" === typeof input.content || _report(_exceptionable, {
path: _path + ".content",
expected: "string",
value: input.content
}), (Array.isArray(input.keywords) || _report(_exceptionable, {
path: _path + ".keywords",
expected: "Array<string>",
value: input.keywords
})) && input.keywords.map((elem, _index6) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".keywords[" + _index6 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".keywords",
expected: "Array<string>",
value: input.keywords
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
if ("complete" === input.type)
return _vo1(input, _path, true && _exceptionable);
else if ("getPreviousAnalysisSections" === input.type)
return _vo2(input, _path, true && _exceptionable);
else if ("write" === input.type)
return _vo3(input, _path, true && _exceptionable);
else
return _report(_exceptionable, {
path: _path,
expected: "(IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBeAnalyzeWriteUnitApplication.IWrite)",
value: input
});
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeAnalyzeWriteUnitApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeAnalyzeWriteUnitApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()(input);
if (result.success === false)
return result;
// Validate English-only content for complete requests
if (result.data.request.type === "write") {
const englishValidation = (0, validateEnglishOnly_1.validateUnitSectionContent)(result.data.request.unitSections);
if (!englishValidation.valid) {
return {
success: false,
errors: englishValidation.errors.map((error) => ({
path: "$input.request.unitSections",
expected: "English-only content (no Chinese, Korean, Japanese)",
value: error,
})),
data: result.data,
};
}
return result;
}
return props.preliminary.validate({
thinking: (_a = result.data.thinking) !== null && _a !== void 0 ? _a : "",
request: result.data.request,
});
};
const application = props.preliminary.fixApplication(__typia_transform__llmApplicationFinalize._llmApplicationFinalize({
functions: [
{
name: "process",
parameters: {
description: "Current Type: {@link IAutoBeAnalyzeWriteUnitApplication.IProps}",
type: "object",
properties: {
thinking: {
description: "Reasoning: what's missing (preliminary), what you're submitting (write),\nor why you're finalizing (complete).",
anyOf: [
{
type: "null"
},
{
type: "string"
}
]
},
request: {
description: "Action to perform. Exhausted preliminary types are removed from the\nunion.",
anyOf: [
{
$ref: "#/$defs/IAutoBePreliminaryComplete"
},
{
$ref: "#/$defs/IAutoBePreliminaryGetPreviousAnalysisSections"
},
{
$ref: "#/$defs/IAutoBeAnalyzeWriteUnitApplication.IWrite"
}
],
"x-discriminator": {
propertyName: "type",
mapping: {
complete: "#/$defs/IAutoBePreliminaryComplete",
getPreviousAnalysisSections: "#/$defs/IAutoBePreliminaryGetPreviousAnalysisSections",
write: "#/$defs/IAutoBeAnalyzeWriteUnitApplication.IWrite"
}
}
}
},
required: [
"request"
],
additionalProperties: false,
$defs: {
IAutoBePreliminaryComplete: {
description: "Finalize the write loop by accepting your most recent `write` as-is.\n\nAfter submitting a `write`, review it yourself thoroughly against the review\nchecklist in your instructions. If you find issues worth fixing, submit\nanother `write` with corrections. When you are satisfied with the quality,\ncall `complete` to finalize.\n\nYou have a maximum of 3 write attempts, but this is a safety cap \u2014 not a\ntarget to fill.\n\nOnly valid after at least one `write` submission \u2014 rejected otherwise.",
type: "object",
properties: {
type: {
description: "Type discriminator for completion request.",
type: "string",
"enum": [
"complete"
]
}
},
required: [
"type"
]
},
IAutoBePreliminaryGetPreviousAnalysisSections: {
description: "Request to retrieve analysis sections from the previous iteration by numeric\nID.",
type: "object",
properties: {
type: {
description: "Type discriminator.",
type: "string",
"enum": [
"getPreviousAnalysisSections"
]
},
sectionIds: {
description: "Section IDs to retrieve from previous iteration. DO NOT request same IDs\nalready requested in previous calls.",
type: "array",
items: {
type: "integer",
minimum: 0
},
minItems: 1
}
},
required: [
"type",
"sectionIds"
]
},
"IAutoBeAnalyzeWriteUnitApplication.IWrite": {
description: "Submit unit section structure within a module section.",
type: "object",
properties: {
type: {
description: "Type discriminator for write submission.",
type: "string",
"enum": [
"write"
]
},
moduleIndex: {
description: "Index of the parent module section (0-based).",
type: "number"
},
unitSections: {
description: "Unit sections (### level) grouping related functionality.",
type: "array",
items: {
$ref: "#/$defs/IAutoBeAnalyzeWriteUnitApplication.ISection"
}
}
},
required: [
"type",
"moduleIndex",
"unitSections"
]
},
"IAutoBeAnalyzeWriteUnitApplication.ISection": {
description: "A single unit section.",
type: "object",
properties: {
title: {
description: "Title of the unit section (### level heading).",
type: "string"
},
purpose: {
description: "Brief purpose statement for this section's role within the parent module.",
type: "string"
},
content: {
description: "Main body content: overview, context, and relationships to other\nsections.",
type: "string"
},
keywords: {
description: "Keywords hinting at section topics to guide Section Agent generation.",
type: "array",
items: {
type: "string"
}
}
},
required: [
"title",
"purpose",
"content",
"keywords"
]
}
}
},
description: "Create unit sections with titles, purposes, content, and keywords for a\nmodule.",
validate: (() => { const _io0 = input => (null === input.thinking || undefined === input.thinking || "string" === typeof input.thinking) && ("object" === typeof input.request && null !== input.request && _iu0(input.request)); const _io1 = input => "complete" === input.type; const _io2 = input => "getPreviousAnalysisSections" === input.type && (Array.isArray(input.sectionIds) && (1 <= input.sectionIds.length && input.sectionIds.every(elem => "number" === typeof elem && __typia_transform__isTypeUint32._isTypeUint32(elem)))); const _io3 = input => "write" === input.type && "number" === typeof input.moduleIndex && (Array.isArray(input.unitSections) && input.unitSections.every(elem => "object" === typeof elem && null !== elem && _io4(elem))); const _io4 = input => "string" === typeof input.title && "string" === typeof input.purpose && "string" === typeof input.content && (Array.isArray(input.keywords) && input.keywords.every(elem => "string" === typeof elem)); const _iu0 = input => (() => {
if ("complete" === input.type)
return _io1(input);
else if ("getPreviousAnalysisSections" === input.type)
return _io2(input);
else if ("write" === input.type)
return _io3(input);
else
return false;
})(); const _vo0 = (input, _path, _exceptionable = true) => [null === input.thinking || undefined === input.thinking || "string" === typeof input.thinking || _report(_exceptionable, {
path: _path + ".thinking",
expected: "(null | string | undefined)",
value: input.thinking
}), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, {
path: _path + ".request",
expected: "(IAutoBeAnalyzeWriteUnitApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections)",
value: input.request
})) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".request",
expected: "(IAutoBeAnalyzeWriteUnitApplication.IWrite | IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections)",
value: input.request
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["complete" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"complete\"",
value: input.type
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["getPreviousAnalysisSections" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"getPreviousAnalysisSections\"",
value: input.type
}), (Array.isArray(input.sectionIds) || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)",
value: input.sectionIds
})) && ((1 <= input.sectionIds.length || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "Array<> & MinItems<1>",
value: input.sectionIds
})) && input.sectionIds.map((elem, _index4) => "number" === typeof elem && (__typia_transform__isTypeUint32._isTypeUint32(elem) || _report(_exceptionable, {
path: _path + ".sectionIds[" + _index4 + "]",
expected: "number & Type<\"uint32\">",
value: elem
})) || _report(_exceptionable, {
path: _path + ".sectionIds[" + _index4 + "]",
expected: "(number & Type<\"uint32\">)",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".sectionIds",
expected: "(Array<number & Type<\"uint32\">> & MinItems<1>)",
value: input.sectionIds
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["write" === input.type || _report(_exceptionable, {
path: _path + ".type",
expected: "\"write\"",
value: input.type
}), "number" === typeof input.moduleIndex || _report(_exceptionable, {
path: _path + ".moduleIndex",
expected: "number",
value: input.moduleIndex
}), (Array.isArray(input.unitSections) || _report(_exceptionable, {
path: _path + ".unitSections",
expected: "Array<IAutoBeAnalyzeWriteUnitApplication.ISection>",
value: input.unitSections
})) && input.unitSections.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".unitSections[" + _index5 + "]",
expected: "IAutoBeAnalyzeWriteUnitApplication.ISection",
value: elem
})) && _vo4(elem, _path + ".unitSections[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".unitSections[" + _index5 + "]",
expected: "IAutoBeAnalyzeWriteUnitApplication.ISection",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".unitSections",
expected: "Array<IAutoBeAnalyzeWriteUnitApplication.ISection>",
value: input.unitSections
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
path: _path + ".title",
expected: "string",
value: input.title
}), "string" === typeof input.purpose || _report(_exceptionable, {
path: _path + ".purpose",
expected: "string",
value: input.purpose
}), "string" === typeof input.content || _report(_exceptionable, {
path: _path + ".content",
expected: "string",
value: input.content
}), (Array.isArray(input.keywords) || _report(_exceptionable, {
path: _path + ".keywords",
expected: "Array<string>",
value: input.keywords
})) && input.keywords.map((elem, _index6) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".keywords[" + _index6 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".keywords",
expected: "Array<string>",
value: input.keywords
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
if ("complete" === input.type)
return _vo1(input, _path, true && _exceptionable);
else if ("getPreviousAnalysisSections" === input.type)
return _vo2(input, _path, true && _exceptionable);
else if ("write" === input.type)
return _vo3(input, _path, true && _exceptionable);
else
return _report(_exceptionable, {
path: _path,
expected: "(IAutoBePreliminaryComplete | IAutoBePreliminaryGetPreviousAnalysisSections | IAutoBeAnalyzeWriteUnitApplication.IWrite)",
value: input
});
})(); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeAnalyzeWriteUnitApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeAnalyzeWriteUnitApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()
}
]
}, {
validate: {
process: validate,
},
}));
return {
protocol: "class",
name: SOURCE,
application,
execute: {
process: (input) => {
if (input.request.type === "write")
props.pointer.value = input.request;
},
},
};
}
const SOURCE = "analyzeWriteUnit";
//# sourceMappingURL=orchestrateAnalyzeWriteUnit.js.map