@autobe/agent 0.9.2 → 0.10.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.js +11 -4
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -6
- package/lib/context/AutoBeTokenUsage.d.ts +15 -1
- package/lib/context/AutoBeTokenUsage.js +56 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +288 -643
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +5057 -7211
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +82 -319
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +95 -266
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +2 -2
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/index.d.ts +2 -2
- package/lib/orchestrate/index.js +4 -4
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -142
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +195 -199
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +75 -172
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +772 -1097
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +2 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +64 -175
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +552 -1073
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +571 -1119
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +8 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +11 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +109 -0
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +25 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +337 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +52 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +57 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.d.ts +80 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js +53 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +46 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js +37 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +127 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -0
- package/lib/orchestrate/test/compile/completeTestCode.d.ts +2 -0
- package/lib/orchestrate/test/compile/completeTestCode.js +21 -0
- package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/orchestrate/test/{filterTestFileName.js → compile/filterTestFileName.js} +1 -1
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +27 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
- package/lib/orchestrate/test/{compileTestScenario.js → compile/getTestScenarioArtifacts.js} +10 -5
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTest.js +14 -9
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +150 -448
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +272 -530
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js +139 -90
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
- package/lib/{utils/types/BackoffOptions.js → orchestrate/test/structures/IAutoBeTestFunction.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +14 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +112 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +3 -2
- package/lib/orchestrate/test/transformTestCorrectHistories.js +28 -67
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.d.ts +5 -4
- package/lib/orchestrate/test/transformTestWriteHistories.js +168 -43
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +11 -0
- package/lib/utils/backoffRetry.d.ts +4 -7
- package/lib/utils/backoffRetry.js +19 -37
- package/lib/utils/backoffRetry.js.map +1 -1
- package/lib/utils/forceRetry.d.ts +1 -0
- package/lib/{orchestrate/orchestrateRealize.js → utils/forceRetry.js} +15 -8
- package/lib/utils/forceRetry.js.map +1 -0
- package/package.json +8 -7
- package/src/AutoBeAgent.ts +17 -3
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -6
- package/src/context/AutoBeTokenUsage.ts +85 -1
- package/src/factory/createAutoBeApplication.ts +2 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +8 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -1
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +6 -5
- package/src/orchestrate/facade/transformFacadeStateMessage.ts +2 -1
- package/src/orchestrate/index.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +26 -23
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +6 -4
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +14 -11
- package/src/orchestrate/interface/transformInterfaceHistories.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +10 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +11 -5
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -8
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +169 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +156 -0
- package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +75 -0
- package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
- package/src/orchestrate/realize/orchestrateRealizeValidator.ts +64 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +36 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +136 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +35 -0
- package/src/orchestrate/test/{filterTestFileName.ts → compile/filterTestFileName.ts} +1 -1
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +24 -0
- package/src/orchestrate/test/{compileTestScenario.ts → compile/getTestScenarioArtifacts.ts} +16 -8
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +240 -0
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +316 -0
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -0
- package/src/orchestrate/test/orchestrateTest.ts +33 -16
- package/src/orchestrate/test/orchestrateTestCorrect.ts +109 -497
- package/src/orchestrate/test/orchestrateTestScenario.ts +102 -71
- package/src/orchestrate/test/orchestrateTestWrite.ts +55 -181
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +126 -0
- package/src/orchestrate/test/structures/IAutoBeTestFunction.ts +10 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +14 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +117 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteResult.ts +9 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +38 -71
- package/src/orchestrate/test/transformTestWriteHistories.ts +88 -46
- package/src/structures/IAutoBeConfig.ts +9 -0
- package/src/utils/backoffRetry.ts +25 -36
- package/src/utils/forceRetry.ts +13 -0
- package/lib/factory/invertOpenApiDocument.d.ts +0 -3
- package/lib/factory/invertOpenApiDocument.js +0 -51
- package/lib/factory/invertOpenApiDocument.js.map +0 -1
- package/lib/orchestrate/orchestrateRealize.d.ts +0 -5
- package/lib/orchestrate/orchestrateRealize.js.map +0 -1
- package/lib/orchestrate/test/compileTestScenario.d.ts +0 -5
- package/lib/orchestrate/test/compileTestScenario.js.map +0 -1
- package/lib/orchestrate/test/filterTestFileName.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -4
- package/lib/utils/StringUtil.js +0 -43
- package/lib/utils/StringUtil.js.map +0 -1
- package/lib/utils/types/BackoffOptions.d.ts +0 -12
- package/lib/utils/types/BackoffOptions.js.map +0 -1
- package/src/factory/invertOpenApiDocument.ts +0 -63
- package/src/orchestrate/orchestrateRealize.ts +0 -18
- package/src/utils/StringUtil.ts +0 -45
- package/src/utils/types/BackoffOptions.ts +0 -15
- /package/lib/orchestrate/test/{filterTestFileName.d.ts → compile/filterTestFileName.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePrismaSchema.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestratePrismaSchema.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,4DAgCC;;;AA7CD,yCAAoE;AAKpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uDAAoD;AACpD,qFAAkF;AAElF,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,UAAoD;;QAEpD,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAa,KAAK,CAAC,IAAI,CACvC,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAC7C,CAAC;QAEF,MAAM,KAAK,GAAW,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,GAAW,CAAC,CAAC;QAClB,OAAO,MAAM,OAAO,CAAC,GAAG,CACtB,UAAU,CAAC,GAAG,CAAC,CAAO,CAAC,EAAE,EAAE;;YACzB,MAAM,MAAM,GAA+B,MAAM,IAAA,uBAAU,EAAC,GAAG,EAAE,CAC/D,OAAO,CAAC,GAAG,EAAE;gBACX,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,YAAY;aACb,CAAC,CACH,CAAC;YACF,MAAM,KAAK,GAA6B;gBACtC,IAAI,EAAE,eAAe;gBACrB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;gBAC/B,IAAI,EAAE,M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AE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -61,6 +61,15 @@ const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
|
61
61
|
"For example:",
|
|
62
62
|
"",
|
|
63
63
|
"* `mv_shopping_daily_stats`",
|
|
64
|
+
"",
|
|
65
|
+
"## User Role Handling",
|
|
66
|
+
"",
|
|
67
|
+
"If the Requirement Analysis Report contains User Role information, **do not normalize** user roles into a single table.",
|
|
68
|
+
"Instead, create separate tables for each distinct role mentioned in the requirements.",
|
|
69
|
+
"",
|
|
70
|
+
"For example, if the requirements mention User, Admin, and Moderator roles:",
|
|
71
|
+
"",
|
|
72
|
+
"* Create separate tables: `User`, `Admin`, `Moderator` (or with prefix: `shopping_user`, `shopping_admin`, `shopping_moderator`)",
|
|
64
73
|
].join("\n"),
|
|
65
74
|
},
|
|
66
75
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,iiGAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,KAAK,CAAC,OAAO,CAAC,MAAM;gBACpB,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;gBACL,WAAW;gBACX,EAAE;gBACF,kCAAkC,MAAM,EAAE;gBAC1C,EAAE;gBACF,2FAA2F;gBAC3F,gDAAgD;gBAChD,kEAAkE;gBAClE,yHAAyH;gBACzH,EAAE;gBACF,mBAAmB;gBACnB,EAAE;gBACF,+DAA+D;gBAC/D,EAAE;gBACF,oBAAoB;gBACpB,2BAA2B;gBAC3B,EAAE;gBACF,uIAAuI;gBACvI,cAAc;gBACd,EAAE;gBACF,6BAA6B;
|
|
1
|
+
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,iiGAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,KAAK,CAAC,OAAO,CAAC,MAAM;gBACpB,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;gBACL,WAAW;gBACX,EAAE;gBACF,kCAAkC,MAAM,EAAE;gBAC1C,EAAE;gBACF,2FAA2F;gBAC3F,gDAAgD;gBAChD,kEAAkE;gBAClE,yHAAyH;gBACzH,EAAE;gBACF,mBAAmB;gBACnB,EAAE;gBACF,+DAA+D;gBAC/D,EAAE;gBACF,oBAAoB;gBACpB,2BAA2B;gBAC3B,EAAE;gBACF,uIAAuI;gBACvI,cAAc;gBACd,EAAE;gBACF,6BAA6B;gBAC7B,EAAE;gBACF,uBAAuB;gBACvB,EAAE;gBACF,yHAAyH;gBACzH,uFAAuF;gBACvF,EAAE;gBACF,4EAA4E;gBAC5E,EAAE;gBACF,kIAAkI;aACnI,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA5EW,QAAA,kCAAkC,sCA4E7C"}
|
|
@@ -48,6 +48,14 @@ const transformPrismaSchemaHistories = (analyze, component) => {
|
|
|
48
48
|
...component.tables.map((table) => ` - ${table}`),
|
|
49
49
|
` - Entire tables you can reference:`,
|
|
50
50
|
...component.entireTables.map((table) => ` - ${table}`),
|
|
51
|
+
"",
|
|
52
|
+
"## User Role Rules",
|
|
53
|
+
"",
|
|
54
|
+
"**CRITICAL**: For User Role tables (User, Admin, Moderator, etc.):",
|
|
55
|
+
"1. **Separate tables** - Each role = independent table (User, Admin, Moderator tables)",
|
|
56
|
+
"2. **No `role` field** - Never include role enum fields in any table",
|
|
57
|
+
"",
|
|
58
|
+
"You can use TPT (Table Per Type) pattern with FK relationships if needed, or completely separate tables.",
|
|
51
59
|
].join("\n"),
|
|
52
60
|
},
|
|
53
61
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaSchemaHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaSchemaHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAInB,MAAM,8BAA8B,GAAG,CAC5C,OAA6B,EAC7B,SAIC,EAGD,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,8oWAA0C;SAC/C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE;gBACJ,oCAAoC;gBACpC,wCAAwC;gBACxC,sCAAsC;gBACtC,EAAE;;aAEH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,OAAO,CAAC,MAAM;gBACd,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC7B,KAAK;gBACL,EAAE;gBACF,YAAY;gBACZ,EAAE;gBACF,wBAAwB,SAAS,CAAC,QAAQ,EAAE;gBAC5C,mCAAmC;gBACnC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC;gBACpD,sCAAsC;gBACtC,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"transformPrismaSchemaHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaSchemaHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAInB,MAAM,8BAA8B,GAAG,CAC5C,OAA6B,EAC7B,SAIC,EAGD,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,8oWAA0C;SAC/C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE;gBACJ,oCAAoC;gBACpC,wCAAwC;gBACxC,sCAAsC;gBACtC,EAAE;;aAEH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,OAAO,CAAC,MAAM;gBACd,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC7B,KAAK;gBACL,EAAE;gBACF,YAAY;gBACZ,EAAE;gBACF,wBAAwB,SAAS,CAAC,QAAQ,EAAE;gBAC5C,mCAAmC;gBACnC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC;gBACpD,sCAAsC;gBACtC,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE,CAAC;gBAC1D,EAAE;gBACF,oBAAoB;gBACpB,EAAE;gBACF,oEAAoE;gBACpE,wFAAwF;gBACxF,sEAAsE;gBACtE,EAAE;gBACF,0GAA0G;aAC3G,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,8BAA8B,kCAkEzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AutoBeAssistantMessageHistory, AutoBeRealizeHistory } from "@autobe/interface";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
+
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
5
|
+
export declare const orchestrateRealize: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) => (props: IAutoBeApplicationProps) => Promise<AutoBeAssistantMessageHistory | AutoBeRealizeHistory>;
|
|
6
|
+
export declare const FAILED: unique symbol;
|
|
7
|
+
export type FAILED = typeof FAILED;
|
|
8
|
+
export declare function pipe<A, B>(a: A, ab: (a: A) => Promise<B | FAILED>): Promise<B | FAILED>;
|
|
9
|
+
export declare function pipe<A, B, C>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>): Promise<C | FAILED>;
|
|
10
|
+
export declare function pipe<A, B, C, D>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>, cd: (c: C) => Promise<D | FAILED>): Promise<D | FAILED>;
|
|
11
|
+
export declare function pipe<A, B, C, D, E>(a: A, ab: (a: A) => Promise<B | FAILED>, bc: (b: B) => Promise<C | FAILED>, cd: (c: C) => Promise<D | FAILED>, de: (d: D) => Promise<E | FAILED>): Promise<E | FAILED>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FAILED = exports.orchestrateRealize = void 0;
|
|
13
|
+
exports.pipe = pipe;
|
|
14
|
+
const uuid_1 = require("uuid");
|
|
15
|
+
const orchestrateRealizeCoder_1 = require("./orchestrateRealizeCoder");
|
|
16
|
+
const orchestrateRealizeIntegrator_1 = require("./orchestrateRealizeIntegrator");
|
|
17
|
+
const orchestrateRealizePlanner_1 = require("./orchestrateRealizePlanner");
|
|
18
|
+
const orchestrateRealizeValidator_1 = require("./orchestrateRealizeValidator");
|
|
19
|
+
const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
|
+
props;
|
|
22
|
+
const ops = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document.operations;
|
|
23
|
+
if (!ops) {
|
|
24
|
+
throw new Error();
|
|
25
|
+
}
|
|
26
|
+
const codes = yield Promise.all(ops.map((op) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
return pipe(op, (op) => (0, orchestrateRealizePlanner_1.orchestrateRealizePlanner)(ctx, op), (p) => (0, orchestrateRealizeCoder_1.orchestrateRealizeCoder)(ctx, op, p));
|
|
28
|
+
})));
|
|
29
|
+
const vaildates = yield Promise.all(codes
|
|
30
|
+
.filter((el) => el !== exports.FAILED)
|
|
31
|
+
.map((c) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
return pipe(c, (c) => (0, orchestrateRealizeIntegrator_1.orchestrateRealizeIntegrator)(ctx, c), (i) => (0, orchestrateRealizeValidator_1.orchestrateRealizeValidator)(ctx, i));
|
|
33
|
+
})));
|
|
34
|
+
if (vaildates.length) {
|
|
35
|
+
if (vaildates.every((v) => v !== exports.FAILED)) {
|
|
36
|
+
const files = Object.assign(Object.assign({}, (_b = ctx.state().interface) === null || _b === void 0 ? void 0 : _b.files), vaildates
|
|
37
|
+
.map((v) => ({ [v.location]: v.content }))
|
|
38
|
+
.reduce((acc, cur) => Object.assign(acc, cur), {}));
|
|
39
|
+
const compiled = yield ctx.compiler.typescript.compile({ files });
|
|
40
|
+
const now = new Date().toISOString();
|
|
41
|
+
ctx.dispatch({
|
|
42
|
+
type: "realizeComplete",
|
|
43
|
+
compiled: compiled,
|
|
44
|
+
created_at: now,
|
|
45
|
+
files: files,
|
|
46
|
+
step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
id: (0, uuid_1.v4)(),
|
|
50
|
+
type: "realize",
|
|
51
|
+
completed_at: now,
|
|
52
|
+
created_at: now,
|
|
53
|
+
compiled,
|
|
54
|
+
files,
|
|
55
|
+
reason: props.reason,
|
|
56
|
+
step: (_f = (_e = ctx.state().analyze) === null || _e === void 0 ? void 0 : _e.step) !== null && _f !== void 0 ? _f : 0,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const total = codes.length;
|
|
61
|
+
const failedCount = codes.filter((code) => code === exports.FAILED).length;
|
|
62
|
+
const successCount = total - failedCount;
|
|
63
|
+
const now = new Date().toISOString();
|
|
64
|
+
ctx.dispatch({
|
|
65
|
+
type: "assistantMessage",
|
|
66
|
+
text: [
|
|
67
|
+
`Out of ${total} code blocks, ${successCount} succeeded, but ${failedCount} failed.`,
|
|
68
|
+
`The process has been stopped due to the failure. Please review the failed steps and try again.`,
|
|
69
|
+
].join("\n"),
|
|
70
|
+
created_at: now,
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
id: (0, uuid_1.v4)(),
|
|
74
|
+
type: "assistantMessage",
|
|
75
|
+
completed_at: now,
|
|
76
|
+
created_at: now,
|
|
77
|
+
text: [
|
|
78
|
+
`Out of ${total} code blocks, ${successCount} succeeded, but ${failedCount} failed.`,
|
|
79
|
+
`The process has been stopped due to the failure. Please review the failed steps and try again.`,
|
|
80
|
+
].join("\n"),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const now = new Date().toISOString();
|
|
85
|
+
ctx.dispatch({
|
|
86
|
+
type: "assistantMessage",
|
|
87
|
+
text: "Any codes can not be generated.",
|
|
88
|
+
created_at: now,
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
id: (0, uuid_1.v4)(),
|
|
92
|
+
type: "assistantMessage",
|
|
93
|
+
completed_at: now,
|
|
94
|
+
created_at: now,
|
|
95
|
+
text: "Any codes can not be generated.",
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
exports.orchestrateRealize = orchestrateRealize;
|
|
99
|
+
exports.FAILED = Symbol("FAILED");
|
|
100
|
+
function pipe(a, ...fns) {
|
|
101
|
+
return fns.reduce((prev, fn) => {
|
|
102
|
+
return prev.then((result) => {
|
|
103
|
+
if (result === exports.FAILED)
|
|
104
|
+
return exports.FAILED;
|
|
105
|
+
return fn(result);
|
|
106
|
+
});
|
|
107
|
+
}, Promise.resolve(a));
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=orchestrateRealize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;AA8JA,oBAUC;AAnKD,+BAA0B;AAI1B,uEAAoE;AACpE,iFAA8E;AAC9E,2EAAwE;AACxE,+EAGuC;AAGhC,MAAM,kBAAkB,GAC7B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EACiC,EAAE;;IACjE,KAAK,CAAC;IAEN,MAAM,GAAG,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,EAAE,CAAC;IACpB,CAAC;IAED,MAAM,KAAK,GAGL,MAAM,OAAO,CAAC,GAAG,CACrB,GAAG,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;QACnB,OAAA,IAAI,CACF,EAAE,EACF,CAAC,EAAE,EAAE,EAAE,CAAC,IAAA,qDAAyB,EAAC,GAAG,EAAE,EAAE,CAAC,EAC1C,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,iDAAuB,EAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAC3C,CAAA;MAAA,CACF,CACF,CAAC;IAEF,MAAM,SAAS,GAAwC,MAAM,OAAO,CAAC,GAAG,CACtE,KAAK;SACF,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,cAAM,CAAC;SAC7B,GAAG,CAAC,CAAO,CAAC,EAAE,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;IAEH,OAAO;QACL,EAAE,EAAE,IAAA,SAAE,GAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,YAAY,EAAE,GAAG;QACjB,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,iCAAiC;KACA,CAAC;AAC5C,CAAC,CAAA,CAAC;AA7GS,QAAA,kBAAkB,sBA6G3B;AAES,QAAA,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AA6BvC,SAAgB,IAAI,CAClB,CAAM,EACN,GAAG,GAAsC;IAEzC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1B,IAAI,MAAM,KAAK,cAAM;gBAAE,OAAO,cAAM,CAAC;YACrC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
+
import { FAILED } from "./orchestrateRealize";
|
|
5
|
+
import { RealizePlannerOutput } from "./orchestrateRealizePlanner";
|
|
6
|
+
import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoderApplication";
|
|
7
|
+
/**
|
|
8
|
+
* Generates a TypeScript function implementation based on the given plan.
|
|
9
|
+
*
|
|
10
|
+
* This function transforms the plan (function name, input/output schema,
|
|
11
|
+
* constraints, and scenarios) into a complete TypeScript function as a string.
|
|
12
|
+
* It is responsible only for producing the code logic, and does not handle
|
|
13
|
+
* imports, exports, or formatting.
|
|
14
|
+
*
|
|
15
|
+
* Import statements are handled separately and will be injected automatically.
|
|
16
|
+
* Any unused imports will be removed by tooling (e.g. eslint).
|
|
17
|
+
*
|
|
18
|
+
* Type annotations should be omitted whenever possible to favor TypeScript's
|
|
19
|
+
* type inference, unless explicit types are critical to correctness.
|
|
20
|
+
*
|
|
21
|
+
* @param ctx - AutoBE execution context
|
|
22
|
+
* @param props - Planning result describing what function to generate
|
|
23
|
+
* @returns The generated function name and TypeScript code
|
|
24
|
+
*/
|
|
25
|
+
export declare const orchestrateRealizeCoder: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation, props: RealizePlannerOutput) => Promise<IAutoBeRealizeCoderApplication.RealizeCoderOutput | FAILED>;
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.orchestrateRealizeCoder = void 0;
|
|
49
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const core_1 = require("@agentica/core");
|
|
51
|
+
const prettier_plugin_sort_imports_1 = __importDefault(require("@trivago/prettier-plugin-sort-imports"));
|
|
52
|
+
const prettier_1 = require("prettier");
|
|
53
|
+
const typia_1 = __importDefault(require("typia"));
|
|
54
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
55
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
56
|
+
const getTestScenarioArtifacts_1 = require("../test/compile/getTestScenarioArtifacts");
|
|
57
|
+
const orchestrateRealize_1 = require("./orchestrateRealize");
|
|
58
|
+
const transformRealizeCoderHistories_1 = require("./transformRealizeCoderHistories");
|
|
59
|
+
/**
|
|
60
|
+
* Generates a TypeScript function implementation based on the given plan.
|
|
61
|
+
*
|
|
62
|
+
* This function transforms the plan (function name, input/output schema,
|
|
63
|
+
* constraints, and scenarios) into a complete TypeScript function as a string.
|
|
64
|
+
* It is responsible only for producing the code logic, and does not handle
|
|
65
|
+
* imports, exports, or formatting.
|
|
66
|
+
*
|
|
67
|
+
* Import statements are handled separately and will be injected automatically.
|
|
68
|
+
* Any unused imports will be removed by tooling (e.g. eslint).
|
|
69
|
+
*
|
|
70
|
+
* Type annotations should be omitted whenever possible to favor TypeScript's
|
|
71
|
+
* type inference, unless explicit types are critical to correctness.
|
|
72
|
+
*
|
|
73
|
+
* @param ctx - AutoBE execution context
|
|
74
|
+
* @param props - Planning result describing what function to generate
|
|
75
|
+
* @returns The generated function name and TypeScript code
|
|
76
|
+
*/
|
|
77
|
+
const orchestrateRealizeCoder = (ctx, operation, props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
const artifacts = yield (0, getTestScenarioArtifacts_1.getTestScenarioArtifacts)(ctx, {
|
|
79
|
+
endpoint: {
|
|
80
|
+
method: operation.method,
|
|
81
|
+
path: operation.path,
|
|
82
|
+
},
|
|
83
|
+
dependencies: [],
|
|
84
|
+
});
|
|
85
|
+
const pointer = {
|
|
86
|
+
value: null,
|
|
87
|
+
};
|
|
88
|
+
const controller = createApplication({
|
|
89
|
+
model: ctx.model,
|
|
90
|
+
build: (props) => {
|
|
91
|
+
pointer.value = props.result;
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const agent = new core_1.MicroAgentica({
|
|
95
|
+
controllers: [controller],
|
|
96
|
+
model: ctx.model,
|
|
97
|
+
vendor: ctx.vendor,
|
|
98
|
+
config: Object.assign(Object.assign({}, ctx.config), { executor: {
|
|
99
|
+
describe: null,
|
|
100
|
+
} }),
|
|
101
|
+
histories: (0, transformRealizeCoderHistories_1.transformRealizeCoderHistories)(ctx.state(), props, artifacts),
|
|
102
|
+
});
|
|
103
|
+
(0, enforceToolCall_1.enforceToolCall)(agent);
|
|
104
|
+
yield agent.conversate("Write code.");
|
|
105
|
+
const tokenUsage = agent.getTokenUsage();
|
|
106
|
+
ctx.usage().record(tokenUsage, ["realize"]);
|
|
107
|
+
if (pointer.value === null) {
|
|
108
|
+
return orchestrateRealize_1.FAILED;
|
|
109
|
+
}
|
|
110
|
+
pointer.value.implementationCode = yield (0, prettier_1.format)(pointer.value.implementationCode, {
|
|
111
|
+
parser: "typescript",
|
|
112
|
+
plugins: [prettier_plugin_sort_imports_1.default, yield Promise.resolve().then(() => __importStar(require("prettier-plugin-jsdoc")))],
|
|
113
|
+
importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"],
|
|
114
|
+
importOrderSeparation: true,
|
|
115
|
+
importOrderSortSpecifiers: true,
|
|
116
|
+
importOrderParserPlugins: ["decorators-legacy", "typescript", "jsx"],
|
|
117
|
+
});
|
|
118
|
+
pointer.value.implementationCode = pointer.value.implementationCode
|
|
119
|
+
.replaceAll('import { MyGlobal } from "../MyGlobal";', "")
|
|
120
|
+
.replaceAll('import typia, { tags } from "typia";', "")
|
|
121
|
+
.replaceAll('import { Prisma } from "@prisma/client";', "")
|
|
122
|
+
.replaceAll('import { jwtDecode } from "./jwtDecode"', "");
|
|
123
|
+
pointer.value.implementationCode = [
|
|
124
|
+
'import { MyGlobal } from "../MyGlobal";',
|
|
125
|
+
'import typia, { tags } from "typia";',
|
|
126
|
+
'import { Prisma } from "@prisma/client";',
|
|
127
|
+
'import { jwtDecode } from "./jwtDecode"',
|
|
128
|
+
"",
|
|
129
|
+
pointer.value.implementationCode,
|
|
130
|
+
].join("\n");
|
|
131
|
+
return Object.assign(Object.assign({}, pointer.value), { functionName: props.functionName });
|
|
132
|
+
});
|
|
133
|
+
exports.orchestrateRealizeCoder = orchestrateRealizeCoder;
|
|
134
|
+
function createApplication(props) {
|
|
135
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
136
|
+
const application = collection[props.model];
|
|
137
|
+
return {
|
|
138
|
+
protocol: "class",
|
|
139
|
+
name: "Write code",
|
|
140
|
+
application,
|
|
141
|
+
execute: {
|
|
142
|
+
programing: (next) => {
|
|
143
|
+
props.build(next);
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const claude = {
|
|
149
|
+
model: "claude",
|
|
150
|
+
options: {
|
|
151
|
+
reference: true,
|
|
152
|
+
separate: null
|
|
153
|
+
},
|
|
154
|
+
functions: [
|
|
155
|
+
{
|
|
156
|
+
name: "programing",
|
|
157
|
+
parameters: {
|
|
158
|
+
description: "Current Type: {@link IAutoBeRealizeCoderApplication.IProps}",
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
result: {
|
|
162
|
+
$ref: "#/$defs/IAutoBeRealizeCoderApplication.RealizeCoderOutput"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
required: [
|
|
166
|
+
"result"
|
|
167
|
+
],
|
|
168
|
+
additionalProperties: false,
|
|
169
|
+
$defs: {
|
|
170
|
+
"IAutoBeRealizeCoderApplication.RealizeCoderOutput": {
|
|
171
|
+
description: "The result of the code generation step, representing a fully generated\nTypeScript function.",
|
|
172
|
+
type: "object",
|
|
173
|
+
properties: {
|
|
174
|
+
functionName: {
|
|
175
|
+
title: "The name of the function to be generated",
|
|
176
|
+
description: "The name of the function to be generated.\n\nThis name will be used as the function's identifier and as the export\nname in the provider file.",
|
|
177
|
+
type: "string"
|
|
178
|
+
},
|
|
179
|
+
implementationCode: {
|
|
180
|
+
title: "The raw TypeScript code string implementing the function",
|
|
181
|
+
description: "The raw TypeScript code string implementing the function.\n\n- The implementation must be valid TypeScript code.\n- It should focus solely on the logic of the function.\n- Import statements do **not** need to be included. They will be\n automatically inserted by the system.\n- Any unused imports will be automatically removed by eslint.\n- Type annotations (e.g. for parameters and return types) should be omitted\n if they can be inferred.",
|
|
182
|
+
type: "string"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
required: [
|
|
186
|
+
"functionName",
|
|
187
|
+
"implementationCode"
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
validate: (() => { const _io0 = input => "object" === typeof input.result && null !== input.result && _io1(input.result); const _io1 = input => "string" === typeof input.functionName && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.result && null !== input.result || _report(_exceptionable, {
|
|
193
|
+
path: _path + ".result",
|
|
194
|
+
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
195
|
+
value: input.result
|
|
196
|
+
})) && _vo1(input.result, _path + ".result", true && _exceptionable) || _report(_exceptionable, {
|
|
197
|
+
path: _path + ".result",
|
|
198
|
+
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
199
|
+
value: input.result
|
|
200
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.functionName || _report(_exceptionable, {
|
|
201
|
+
path: _path + ".functionName",
|
|
202
|
+
expected: "string",
|
|
203
|
+
value: input.functionName
|
|
204
|
+
}), "string" === typeof input.implementationCode || _report(_exceptionable, {
|
|
205
|
+
path: _path + ".implementationCode",
|
|
206
|
+
expected: "string",
|
|
207
|
+
value: input.implementationCode
|
|
208
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
209
|
+
if (false === __is(input)) {
|
|
210
|
+
errors = [];
|
|
211
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
212
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
213
|
+
path: _path + "",
|
|
214
|
+
expected: "IAutoBeRealizeCoderApplication.IProps",
|
|
215
|
+
value: input
|
|
216
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
217
|
+
path: _path + "",
|
|
218
|
+
expected: "IAutoBeRealizeCoderApplication.IProps",
|
|
219
|
+
value: input
|
|
220
|
+
}))(input, "$input", true);
|
|
221
|
+
const success = 0 === errors.length;
|
|
222
|
+
return success ? {
|
|
223
|
+
success,
|
|
224
|
+
data: input
|
|
225
|
+
} : {
|
|
226
|
+
success,
|
|
227
|
+
errors,
|
|
228
|
+
data: input
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
success: true,
|
|
233
|
+
data: input
|
|
234
|
+
};
|
|
235
|
+
}; })()
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
const collection = {
|
|
240
|
+
chatgpt: {
|
|
241
|
+
model: "chatgpt",
|
|
242
|
+
options: {
|
|
243
|
+
reference: true,
|
|
244
|
+
strict: false,
|
|
245
|
+
separate: null
|
|
246
|
+
},
|
|
247
|
+
functions: [
|
|
248
|
+
{
|
|
249
|
+
name: "programing",
|
|
250
|
+
parameters: {
|
|
251
|
+
description: "Current Type: {@link IAutoBeRealizeCoderApplication.IProps}",
|
|
252
|
+
type: "object",
|
|
253
|
+
properties: {
|
|
254
|
+
result: {
|
|
255
|
+
$ref: "#/$defs/IAutoBeRealizeCoderApplication.RealizeCoderOutput"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
required: [
|
|
259
|
+
"result"
|
|
260
|
+
],
|
|
261
|
+
additionalProperties: false,
|
|
262
|
+
$defs: {
|
|
263
|
+
"IAutoBeRealizeCoderApplication.RealizeCoderOutput": {
|
|
264
|
+
description: "The result of the code generation step, representing a fully generated\nTypeScript function.",
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
functionName: {
|
|
268
|
+
title: "The name of the function to be generated",
|
|
269
|
+
description: "The name of the function to be generated.\n\nThis name will be used as the function's identifier and as the export\nname in the provider file.",
|
|
270
|
+
type: "string"
|
|
271
|
+
},
|
|
272
|
+
implementationCode: {
|
|
273
|
+
title: "The raw TypeScript code string implementing the function",
|
|
274
|
+
description: "The raw TypeScript code string implementing the function.\n\n- The implementation must be valid TypeScript code.\n- It should focus solely on the logic of the function.\n- Import statements do **not** need to be included. They will be\n automatically inserted by the system.\n- Any unused imports will be automatically removed by eslint.\n- Type annotations (e.g. for parameters and return types) should be omitted\n if they can be inferred.",
|
|
275
|
+
type: "string"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
required: [
|
|
279
|
+
"functionName",
|
|
280
|
+
"implementationCode"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
validate: (() => { const _io0 = input => "object" === typeof input.result && null !== input.result && _io1(input.result); const _io1 = input => "string" === typeof input.functionName && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.result && null !== input.result || _report(_exceptionable, {
|
|
286
|
+
path: _path + ".result",
|
|
287
|
+
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
288
|
+
value: input.result
|
|
289
|
+
})) && _vo1(input.result, _path + ".result", true && _exceptionable) || _report(_exceptionable, {
|
|
290
|
+
path: _path + ".result",
|
|
291
|
+
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
292
|
+
value: input.result
|
|
293
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.functionName || _report(_exceptionable, {
|
|
294
|
+
path: _path + ".functionName",
|
|
295
|
+
expected: "string",
|
|
296
|
+
value: input.functionName
|
|
297
|
+
}), "string" === typeof input.implementationCode || _report(_exceptionable, {
|
|
298
|
+
path: _path + ".implementationCode",
|
|
299
|
+
expected: "string",
|
|
300
|
+
value: input.implementationCode
|
|
301
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
302
|
+
if (false === __is(input)) {
|
|
303
|
+
errors = [];
|
|
304
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
305
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
306
|
+
path: _path + "",
|
|
307
|
+
expected: "IAutoBeRealizeCoderApplication.IProps",
|
|
308
|
+
value: input
|
|
309
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
310
|
+
path: _path + "",
|
|
311
|
+
expected: "IAutoBeRealizeCoderApplication.IProps",
|
|
312
|
+
value: input
|
|
313
|
+
}))(input, "$input", true);
|
|
314
|
+
const success = 0 === errors.length;
|
|
315
|
+
return success ? {
|
|
316
|
+
success,
|
|
317
|
+
data: input
|
|
318
|
+
} : {
|
|
319
|
+
success,
|
|
320
|
+
errors,
|
|
321
|
+
data: input
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
success: true,
|
|
326
|
+
data: input
|
|
327
|
+
};
|
|
328
|
+
}; })()
|
|
329
|
+
}
|
|
330
|
+
]
|
|
331
|
+
},
|
|
332
|
+
claude,
|
|
333
|
+
llama: claude,
|
|
334
|
+
deepseek: claude,
|
|
335
|
+
"3.1": claude,
|
|
336
|
+
};
|
|
337
|
+
//# sourceMappingURL=orchestrateRealizeCoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeCoder.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeCoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAGpE,yGAA+D;AAC/D,uCAAkC;AAElC,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uFAAoF;AAEpF,6DAA8C;AAG9C,qFAAkF;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,uBAAuB,GAAG,CACrC,GAAyB,EACzB,SAAmC,EACnC,KAA2B,EAC0C,EAAE;IACvE,MAAM,SAAS,GACb,MAA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J,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
3
|
+
import { IAutoBeRealizeCoderApplication } from "./structures/IAutoBeRealizeCoderApplication";
|
|
4
|
+
/**
|
|
5
|
+
* The result of integrating the generated code into the actual application
|
|
6
|
+
* files (e.g., controller).
|
|
7
|
+
*/
|
|
8
|
+
export interface RealizeIntegratorOutput {
|
|
9
|
+
/**
|
|
10
|
+
* Indicates the result of the integration process.
|
|
11
|
+
*
|
|
12
|
+
* - "success": The function was correctly inserted, imported, and passed
|
|
13
|
+
* compilation.
|
|
14
|
+
* - "fail": The integration did not complete (e.g., target controller not
|
|
15
|
+
* found, syntax error).
|
|
16
|
+
* - "exception": An unexpected error occurred (e.g., I/O failure, invalid
|
|
17
|
+
* context state).
|
|
18
|
+
*/
|
|
19
|
+
result: "success" | "fail" | "exception";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Integrates the generated function into an appropriate controller file,
|
|
23
|
+
* handling insertion, import, and static validation.
|
|
24
|
+
*
|
|
25
|
+
* This function performs the following steps:
|
|
26
|
+
*
|
|
27
|
+
* 1. **Locate appropriate controller file**
|
|
28
|
+
*
|
|
29
|
+
* - Usually matches `*.controller.ts`
|
|
30
|
+
* - May be based on inferred target (e.g., from functionName or folder structure)
|
|
31
|
+
* 2. **Insert the generated function into the file content**
|
|
32
|
+
*
|
|
33
|
+
* - Ensures proper placement, such as inside a class or export block
|
|
34
|
+
* - May replace or append to existing function stubs
|
|
35
|
+
* 3. **Inject required imports automatically**
|
|
36
|
+
*
|
|
37
|
+
* - Identifies any missing imports (e.g., DTOs, utility functions)
|
|
38
|
+
* - Ensures imports are added without duplication
|
|
39
|
+
* 4. **Check for compile-time safety**
|
|
40
|
+
*
|
|
41
|
+
* - Ensures TypeScript type-checking passes
|
|
42
|
+
* - Verifies that Nestia-generated routers still function without error
|
|
43
|
+
* - If compilation fails or static types are invalid, marks result as `"fail"`
|
|
44
|
+
*
|
|
45
|
+
* ⚠️ Note: This step **must not rely on runtime execution**. It only guarantees
|
|
46
|
+
* static, structural validity (i.e., valid TypeScript).
|
|
47
|
+
*
|
|
48
|
+
* @param ctx - AutoBE context including current source files and settings
|
|
49
|
+
* @param props - Output from the code generation step to be integrated
|
|
50
|
+
* @returns Integration status, indicating success or failure of insertion
|
|
51
|
+
*/
|
|
52
|
+
export declare const orchestrateRealizeIntegrator: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: IAutoBeRealizeCoderApplication.RealizeCoderOutput) => Promise<RealizeIntegratorOutput>;
|