@autobe/agent 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.d.ts +2 -1
- package/lib/AutoBeAgent.js +27 -7
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +2 -4
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -11
- package/lib/context/AutoBeContext.d.ts +4 -1
- package/lib/context/AutoBeTokenUsage.d.ts +1 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/context/assertSchemaModel.d.ts +1 -1
- package/lib/context/assertSchemaModel.js +4 -7
- package/lib/context/assertSchemaModel.js.map +1 -1
- package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
- package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
- package/lib/factory/createAutoBeContext.d.ts +2 -1
- package/lib/factory/createAutoBeContext.js +78 -27
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +24065 -12997
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +166 -87
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +639 -322
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +146 -76
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +17 -52
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +25 -22
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +7 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +168 -4
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
- package/lib/orchestrate/facade/createAutoBeFacadeController.js +1308 -0
- package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
- package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
- package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +15 -8
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +874 -49
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +1858 -67
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +251 -133
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +257 -135
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +341 -227
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +761 -49
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +911 -50
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +207 -4
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +109 -2
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +5 -3
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1904 -77
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +1858 -67
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +23 -23
- package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +391 -197
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1168 -591
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +1186 -600
- package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +6 -3
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +2 -1
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +362 -180
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +399 -199
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +133 -4
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +171 -7
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +132 -3
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +2 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +134 -3
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +169 -4
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +257 -4
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +283 -4
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +141 -3
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/utils/TokenUsageComputer.d.ts +5 -0
- package/lib/utils/TokenUsageComputer.js +29 -0
- package/lib/utils/TokenUsageComputer.js.map +1 -0
- package/package.json +10 -10
- package/src/AutoBeAgent.ts +40 -6
- package/src/AutoBeMockAgent.ts +2 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +11 -11
- package/src/context/AutoBeContext.ts +8 -0
- package/src/context/AutoBeTokenUsage.ts +1 -1
- package/src/context/assertSchemaModel.ts +5 -8
- package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
- package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
- package/src/factory/createAutoBeContext.ts +96 -36
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +9 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +15 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -11
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +19 -54
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +25 -22
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +8 -24
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +20 -3
- package/src/orchestrate/facade/createAutoBeFacadeController.ts +136 -0
- package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +17 -6
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -2
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +13 -2
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +16 -11
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +16 -13
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +19 -15
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +13 -2
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +16 -2
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +13 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +11 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +24 -16
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +13 -2
- package/src/orchestrate/prisma/orchestratePrisma.ts +2 -1
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +15 -10
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +9 -10
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +9 -11
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +2 -1
- package/src/orchestrate/realize/orchestrateRealize.ts +3 -2
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +15 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +15 -10
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +14 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +21 -6
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +13 -2
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +5 -1
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +1 -1
- package/src/orchestrate/test/orchestrateTest.ts +3 -2
- package/src/orchestrate/test/orchestrateTestCorrect.ts +14 -2
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +21 -3
- package/src/orchestrate/test/orchestrateTestScenario.ts +13 -2
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +13 -2
- package/src/orchestrate/test/orchestrateTestWrite.ts +13 -2
- package/src/utils/TokenUsageComputer.ts +35 -0
- package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
- package/lib/factory/createAutoBeApplication.js +0 -942
- package/lib/factory/createAutoBeApplication.js.map +0 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
- package/src/factory/createAutoBeApplication.ts +0 -123
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
- /package/lib/orchestrate/facade/{transformFacadeStateMessage.js → structures/transformFacadeStateMessage.js} +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
|
@@ -74,7 +74,7 @@ const correct = (ctx, factory, failures, script, event, life) => __awaiter(void
|
|
|
74
74
|
const pointer = {
|
|
75
75
|
value: null,
|
|
76
76
|
};
|
|
77
|
-
const { tokenUsage } = yield ctx.conversate({
|
|
77
|
+
const { metric, tokenUsage } = yield ctx.conversate({
|
|
78
78
|
source: factory.source,
|
|
79
79
|
histories: (0, transformCommonCorrectCastingHistories_1.transformCommonCorrectCastingHistories)([...failures, event].map((e) => ({
|
|
80
80
|
diagnostics: e.result
|
|
@@ -95,7 +95,7 @@ const correct = (ctx, factory, failures, script, event, life) => __awaiter(void
|
|
|
95
95
|
message: utils_1.StringUtil.trim `
|
|
96
96
|
Fix the TypeScript casting problems to resolve the compilation error.
|
|
97
97
|
|
|
98
|
-
You don't need to explain me anything, but just fix or give it up
|
|
98
|
+
You don't need to explain me anything, but just fix or give it up
|
|
99
99
|
immediately without any hesitation, explanation, and questions.
|
|
100
100
|
`,
|
|
101
101
|
});
|
|
@@ -109,6 +109,7 @@ const correct = (ctx, factory, failures, script, event, life) => __awaiter(void
|
|
|
109
109
|
draft: pointer.value.draft,
|
|
110
110
|
review: pointer.value.revise.review,
|
|
111
111
|
final: (_a = pointer.value.revise.final) !== null && _a !== void 0 ? _a : undefined,
|
|
112
|
+
metric,
|
|
112
113
|
tokenUsage,
|
|
113
114
|
}));
|
|
114
115
|
return yield predicate(ctx, factory, [...failures, event], script, yield factory.validate((_b = pointer.value.revise.final) !== null && _b !== void 0 ? _b : pointer.value.draft), life - 1);
|
|
@@ -183,7 +184,11 @@ const createController = (props) => {
|
|
|
183
184
|
}
|
|
184
185
|
: result;
|
|
185
186
|
};
|
|
186
|
-
const application = collection[props.model === "chatgpt"
|
|
187
|
+
const application = collection[props.model === "chatgpt"
|
|
188
|
+
? "chatgpt"
|
|
189
|
+
: props.model === "gemini"
|
|
190
|
+
? "gemini"
|
|
191
|
+
: "claude"](validate);
|
|
187
192
|
return {
|
|
188
193
|
protocol: "class",
|
|
189
194
|
name: "correctInvalidRequest",
|
|
@@ -211,7 +216,7 @@ const collection = {
|
|
|
211
216
|
{
|
|
212
217
|
name: "rewrite",
|
|
213
218
|
parameters: {
|
|
214
|
-
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}
|
|
219
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
215
220
|
type: "object",
|
|
216
221
|
properties: {
|
|
217
222
|
think: {
|
|
@@ -223,6 +228,7 @@ const collection = {
|
|
|
223
228
|
type: "string"
|
|
224
229
|
},
|
|
225
230
|
revise: {
|
|
231
|
+
description: "Review and finalization of type casting corrections.\n\nContains the review of applied corrections and the final code with all\ntype casting issues resolved while preserving type safety and validation\nintent.",
|
|
226
232
|
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
227
233
|
}
|
|
228
234
|
},
|
|
@@ -515,5 +521,163 @@ const collection = {
|
|
|
515
521
|
}), { equals: false }));
|
|
516
522
|
return application;
|
|
517
523
|
})(),
|
|
524
|
+
gemini: (validate) => (() => {
|
|
525
|
+
const application = {
|
|
526
|
+
model: "gemini",
|
|
527
|
+
options: {
|
|
528
|
+
reference: true,
|
|
529
|
+
separate: null
|
|
530
|
+
},
|
|
531
|
+
functions: [
|
|
532
|
+
{
|
|
533
|
+
name: "rewrite",
|
|
534
|
+
parameters: {
|
|
535
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
536
|
+
type: "object",
|
|
537
|
+
properties: {
|
|
538
|
+
think: {
|
|
539
|
+
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal\n type conversion, etc.)\n- Whether nullable or undefined types are involved\n- If Date to string conversions are needed\n- The chosen fix strategy for the specific error type",
|
|
540
|
+
type: "string"
|
|
541
|
+
},
|
|
542
|
+
draft: {
|
|
543
|
+
description: "Draft correction with initial type casting fixes.\n\nThe code after applying the first round of fixes:\n\n- Satisfies patterns for tag stripping\n- Date.toISOString() conversions where needed\n- Nullable type narrowing checks\n- Literal type assertions\n- Optional chaining result handling",
|
|
544
|
+
type: "string"
|
|
545
|
+
},
|
|
546
|
+
revise: {
|
|
547
|
+
description: "Review and finalization of type casting corrections.\n\nContains the review of applied corrections and the final code with all\ntype casting issues resolved while preserving type safety and validation\nintent.",
|
|
548
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
required: [
|
|
552
|
+
"think",
|
|
553
|
+
"draft",
|
|
554
|
+
"revise"
|
|
555
|
+
],
|
|
556
|
+
additionalProperties: false,
|
|
557
|
+
$defs: {
|
|
558
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
559
|
+
type: "object",
|
|
560
|
+
properties: {
|
|
561
|
+
review: {
|
|
562
|
+
description: "Review of the type casting correction patterns applied.\n\nExplains which correction strategies were used:\n\n- Which satisfies patterns were applied for tag issues\n- Where typia.assert or assertGuard was used\n- How Date conversions were handled\n- What nullable type narrowing was applied\n- How literal type conversions were resolved\n- Confirmation that all type casting issues are resolved",
|
|
563
|
+
type: "string"
|
|
564
|
+
},
|
|
565
|
+
final: {
|
|
566
|
+
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic. When the draft\nalready successfully resolves all type casting issues with no problems\nfound during review, this value can be null, indicating no further\nrefinements are necessary.\n\nA `null` value signifies the draft corrections were already optimal and\nrequire no additional modifications.",
|
|
567
|
+
anyOf: [
|
|
568
|
+
{
|
|
569
|
+
type: "null"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
type: "string"
|
|
573
|
+
}
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
required: [
|
|
578
|
+
"review",
|
|
579
|
+
"final"
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
585
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
586
|
+
path: _path + ".think",
|
|
587
|
+
expected: "string",
|
|
588
|
+
value: input.think
|
|
589
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
590
|
+
path: _path + ".draft",
|
|
591
|
+
expected: "string",
|
|
592
|
+
value: input.draft
|
|
593
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
594
|
+
path: _path + ".revise",
|
|
595
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
596
|
+
value: input.revise
|
|
597
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
598
|
+
path: _path + ".revise",
|
|
599
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
600
|
+
value: input.revise
|
|
601
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
602
|
+
path: _path + ".review",
|
|
603
|
+
expected: "string",
|
|
604
|
+
value: input.review
|
|
605
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
606
|
+
path: _path + ".final",
|
|
607
|
+
expected: "(null | string)",
|
|
608
|
+
value: input.final
|
|
609
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
610
|
+
if (false === __is(input)) {
|
|
611
|
+
errors = [];
|
|
612
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
613
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
614
|
+
path: _path + "",
|
|
615
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
616
|
+
value: input
|
|
617
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
618
|
+
path: _path + "",
|
|
619
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
620
|
+
value: input
|
|
621
|
+
}))(input, "$input", true);
|
|
622
|
+
const success = 0 === errors.length;
|
|
623
|
+
return success ? {
|
|
624
|
+
success,
|
|
625
|
+
data: input
|
|
626
|
+
} : {
|
|
627
|
+
success,
|
|
628
|
+
errors,
|
|
629
|
+
data: input
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
return {
|
|
633
|
+
success: true,
|
|
634
|
+
data: input
|
|
635
|
+
};
|
|
636
|
+
}; })()
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: "reject",
|
|
640
|
+
parameters: {
|
|
641
|
+
type: "object",
|
|
642
|
+
properties: {},
|
|
643
|
+
additionalProperties: false,
|
|
644
|
+
required: [],
|
|
645
|
+
$defs: {}
|
|
646
|
+
},
|
|
647
|
+
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type\ncasting issues (e.g., missing imports, syntax errors, undefined variables),\nindicating the error should be handled by a different agent.",
|
|
648
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
649
|
+
if (false === __is(input)) {
|
|
650
|
+
errors = [];
|
|
651
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
652
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
653
|
+
const success = 0 === errors.length;
|
|
654
|
+
return success ? {
|
|
655
|
+
success,
|
|
656
|
+
data: input
|
|
657
|
+
} : {
|
|
658
|
+
success,
|
|
659
|
+
errors,
|
|
660
|
+
data: input
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
return {
|
|
664
|
+
success: true,
|
|
665
|
+
data: input
|
|
666
|
+
};
|
|
667
|
+
}; })()
|
|
668
|
+
}
|
|
669
|
+
]
|
|
670
|
+
};
|
|
671
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
|
|
672
|
+
validate: {
|
|
673
|
+
rewrite: validate,
|
|
674
|
+
reject: () => ({
|
|
675
|
+
success: true,
|
|
676
|
+
data: undefined,
|
|
677
|
+
}),
|
|
678
|
+
},
|
|
679
|
+
}), { equals: false }));
|
|
680
|
+
return application;
|
|
681
|
+
})(),
|
|
518
682
|
};
|
|
519
683
|
//# sourceMappingURL=orchestrateCommonCorrectCasting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateCommonCorrectCasting.js","sourceRoot":"","sources":["../../../src/orchestrate/common/orchestrateCommonCorrectCasting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateCommonCorrectCasting.js","sourceRoot":"","sources":["../../../src/orchestrate/common/orchestrateCommonCorrectCasting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,yCAA2C;AAQ3C,kDAA0B;AAG1B,uEAAoE;AACpE,qEAAkE;AAClE,+GAA4G;AAsBrG,MAAM,+BAA+B,GAAG,CAK7C,GAAyB,EACzB,OAAmD,EACnD,MAAc,EACU,EAAE;IAC1B,MAAM,KAAK,GAAkB,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5D,OAAO,MAAM,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC,CAAA,CAAC;AAXW,QAAA,+BAA+B,mCAW1C;AAEF,MAAM,SAAS,GAAG,CAKhB,GAAyB,EACzB,OAAmD,EACnD,QAAyB,EACzB,MAAc,EACd,KAAoB,EACpB,IAAY,EACY,EAAE;IAC1B,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACpC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACpB,OAAO,MAAM,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAC0C;YACtE,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;oBACb,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,SAAS;iBAChB,CAAC;aACH;SACF;;QAAC;IACJ,MAAM,EAAE,CAAC,QAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAC0C;YACtE,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;oBACb,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,SAAS;iBAChB,CAAC;aACH;SACF;;QAAC;CACL,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
-
import { AutoBeContext } from "
|
|
4
|
-
export declare const
|
|
3
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
+
export declare const createAutoBeFacadeController: <Model extends ILlmSchema.Model>(props: {
|
|
5
5
|
model: Model;
|
|
6
6
|
context: AutoBeContext<Model>;
|
|
7
7
|
}) => IAgenticaController.IClass<Model>;
|