@autobe/agent 0.18.0 → 0.20.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/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +8 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +10 -5
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
- package/lib/agent/src/factory/consentFunctionCall.js +213 -0
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +79 -19
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +41 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +45 -31
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +25 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +15 -12
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +33 -44
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +10 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -45
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +14 -14
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +24 -31
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +27 -26
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +36 -29
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +31 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1571 -1144
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +24 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +6 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +12 -14
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +103 -71
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +147 -116
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +401 -233
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +362 -178
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +97 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +60 -66
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +19 -30
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +38 -35
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +39 -26
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +15 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +7 -9
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +38 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +61 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +68 -24
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +59 -57
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +17 -13
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +287 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +46 -49
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +7 -0
- package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +12 -29
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +76 -45
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +15 -9
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -7
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +25 -20
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +36 -27
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/agent/src/orchestrate/{internal/IProgress.js → realize/structures/IAutoBeRealizeCorrectApplication.js} +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +17 -16
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +97 -49
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +3 -3
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +17 -4
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +18 -9
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +138 -23
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +7 -6
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/agent/src/orchestrate/{realize/structures/IAutoBeRealizeCoderApplication.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
- package/lib/agent/src/utils/executeCachedBatch.js +23 -0
- package/lib/agent/src/utils/executeCachedBatch.js.map +1 -0
- package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
- package/lib/agent/src/utils/predicateStateMessage.js +87 -0
- package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +4799 -2637
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +8 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +97 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +75 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +7 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +9 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +8 -6
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +7 -6
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +18 -3
- package/src/AutoBeMockAgent.ts +13 -15
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +129 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +108 -20
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +53 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +68 -47
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +33 -21
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +21 -10
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +18 -40
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +15 -8
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -47
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -29
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +37 -30
- package/src/orchestrate/interface/orchestrateInterface.ts +53 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +142 -32
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +8 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +82 -74
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +51 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +174 -56
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +149 -63
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +101 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +77 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +61 -66
- package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
- package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
- package/src/orchestrate/prisma/orchestratePrisma.ts +17 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +8 -19
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +37 -18
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +57 -59
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +20 -14
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +294 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +62 -57
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +71 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +109 -86
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +22 -13
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +28 -24
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -74
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +37 -28
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
- package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +116 -60
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +18 -8
- package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
- package/src/orchestrate/test/orchestrateTestScenario.ts +179 -36
- package/src/orchestrate/test/orchestrateTestWrite.ts +18 -19
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +7 -6
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
- package/src/utils/executeCachedBatch.ts +15 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +0 -46
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
- package/lib/agent/src/utils/pipe.d.ts +0 -5
- package/lib/agent/src/utils/pipe.js +0 -14
- package/lib/agent/src/utils/pipe.js.map +0 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -4
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/internal/compile.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/utils/pipe.d.ts +0 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +0 -53
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/internal/compile.ts +0 -84
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
- package/src/utils/pipe.ts +0 -39
- /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
|
@@ -4,13 +4,15 @@ import {
|
|
|
4
4
|
AutoBeAnalyzeScenarioEvent,
|
|
5
5
|
AutoBeAnalyzeWriteEvent,
|
|
6
6
|
AutoBeAssistantMessageHistory,
|
|
7
|
+
AutoBeProgressEventBase,
|
|
7
8
|
} from "@autobe/interface";
|
|
8
9
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
9
10
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
13
|
-
import {
|
|
15
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
14
16
|
import { orchestrateAnalyzeReview } from "./orchestrateAnalyzeReview";
|
|
15
17
|
import { orchestrateAnalyzeScenario } from "./orchestrateAnalyzeScenario";
|
|
16
18
|
import { orchestrateAnalyzeWrite } from "./orchestrateAnalyzeWrite";
|
|
@@ -26,6 +28,7 @@ export const orchestrateAnalyze =
|
|
|
26
28
|
|
|
27
29
|
ctx.dispatch({
|
|
28
30
|
type: "analyzeStart",
|
|
31
|
+
id: v7(),
|
|
29
32
|
reason: props.reason,
|
|
30
33
|
step,
|
|
31
34
|
created_at: startTime.toISOString(),
|
|
@@ -39,46 +42,55 @@ export const orchestrateAnalyze =
|
|
|
39
42
|
else ctx.dispatch(scenario);
|
|
40
43
|
|
|
41
44
|
// write documents
|
|
42
|
-
const writeProgress:
|
|
45
|
+
const writeProgress: AutoBeProgressEventBase = {
|
|
43
46
|
total: scenario.files.length,
|
|
44
47
|
completed: 0,
|
|
45
48
|
};
|
|
46
|
-
const fileList: AutoBeAnalyzeFile[] = await
|
|
47
|
-
scenario.files.map(async (
|
|
49
|
+
const fileList: AutoBeAnalyzeFile[] = await executeCachedBatch(
|
|
50
|
+
scenario.files.map((file) => async (promptCacheKey) => {
|
|
48
51
|
const event: AutoBeAnalyzeWriteEvent = await orchestrateAnalyzeWrite(
|
|
49
52
|
ctx,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
{
|
|
54
|
+
scenario,
|
|
55
|
+
file,
|
|
56
|
+
progress: writeProgress,
|
|
57
|
+
promptCacheKey,
|
|
58
|
+
},
|
|
53
59
|
);
|
|
54
60
|
return event.file;
|
|
55
61
|
}),
|
|
56
62
|
);
|
|
57
63
|
|
|
58
64
|
// review documents
|
|
59
|
-
const reviewProgress:
|
|
65
|
+
const reviewProgress: AutoBeProgressEventBase = {
|
|
60
66
|
total: fileList.length,
|
|
61
67
|
completed: 0,
|
|
62
68
|
};
|
|
63
|
-
const newFiles: AutoBeAnalyzeFile[] = await
|
|
64
|
-
fileList.map(async (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const newFiles: AutoBeAnalyzeFile[] = await executeCachedBatch(
|
|
70
|
+
fileList.map((file) => async (promptCacheKey) => {
|
|
71
|
+
try {
|
|
72
|
+
const event: AutoBeAnalyzeReviewEvent =
|
|
73
|
+
await orchestrateAnalyzeReview(ctx, {
|
|
74
|
+
scenario,
|
|
75
|
+
allFiles: fileList, // all files
|
|
76
|
+
myFile: file,
|
|
77
|
+
progress: reviewProgress,
|
|
78
|
+
promptCacheKey,
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
...event.file,
|
|
82
|
+
content: event.content,
|
|
83
|
+
};
|
|
84
|
+
} catch {
|
|
85
|
+
return file;
|
|
86
|
+
}
|
|
76
87
|
}),
|
|
77
88
|
);
|
|
78
89
|
|
|
79
90
|
// Complete the analysis
|
|
80
91
|
return ctx.dispatch({
|
|
81
92
|
type: "analyzeComplete",
|
|
93
|
+
id: v7(),
|
|
82
94
|
roles: scenario.roles,
|
|
83
95
|
prefix: scenario.prefix,
|
|
84
96
|
files: newFiles,
|
|
@@ -2,24 +2,28 @@ import { IAgenticaController } from "@agentica/core";
|
|
|
2
2
|
import {
|
|
3
3
|
AutoBeAnalyzeReviewEvent,
|
|
4
4
|
AutoBeAnalyzeScenarioEvent,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
13
|
-
import {
|
|
14
|
-
import { transformAnalyzeReviewerHistories } from "./histories/transformAnalyzeReviewerHistories";
|
|
15
|
+
import { transformAnalyzeReviewHistories } from "./histories/transformAnalyzeReviewHistories";
|
|
15
16
|
import { IAutoBeAnalyzeReviewApplication } from "./structures/IAutoBeAnalyzeReviewApplication";
|
|
16
17
|
|
|
17
18
|
export const orchestrateAnalyzeReview = async <Model extends ILlmSchema.Model>(
|
|
18
19
|
ctx: AutoBeContext<Model>,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
props: {
|
|
21
|
+
scenario: AutoBeAnalyzeScenarioEvent;
|
|
22
|
+
allFiles: AutoBeAnalyzeFile[];
|
|
23
|
+
myFile: AutoBeAnalyzeFile;
|
|
24
|
+
progress: AutoBeProgressEventBase;
|
|
25
|
+
promptCacheKey: string;
|
|
26
|
+
},
|
|
23
27
|
): Promise<AutoBeAnalyzeReviewEvent> => {
|
|
24
28
|
const pointer: IPointer<IAutoBeAnalyzeReviewApplication.IProps | null> = {
|
|
25
29
|
value: null,
|
|
@@ -31,9 +35,15 @@ export const orchestrateAnalyzeReview = async <Model extends ILlmSchema.Model>(
|
|
|
31
35
|
pointer,
|
|
32
36
|
}),
|
|
33
37
|
histories: [
|
|
34
|
-
...
|
|
38
|
+
...transformAnalyzeReviewHistories(
|
|
39
|
+
ctx,
|
|
40
|
+
props.scenario,
|
|
41
|
+
props.allFiles,
|
|
42
|
+
props.myFile,
|
|
43
|
+
),
|
|
35
44
|
],
|
|
36
45
|
enforceFunctionCall: true,
|
|
46
|
+
promptCacheKey: props.promptCacheKey,
|
|
37
47
|
message: "Review the requirement document",
|
|
38
48
|
});
|
|
39
49
|
if (pointer.value === null)
|
|
@@ -41,13 +51,14 @@ export const orchestrateAnalyzeReview = async <Model extends ILlmSchema.Model>(
|
|
|
41
51
|
|
|
42
52
|
const event: AutoBeAnalyzeReviewEvent = {
|
|
43
53
|
type: "analyzeReview",
|
|
44
|
-
|
|
54
|
+
id: v7(),
|
|
55
|
+
file: props.myFile,
|
|
45
56
|
plan: pointer.value.plan,
|
|
46
57
|
review: pointer.value.review,
|
|
47
58
|
content: pointer.value.content,
|
|
48
59
|
tokenUsage,
|
|
49
|
-
total: progress.total,
|
|
50
|
-
completed: ++progress.completed,
|
|
60
|
+
total: props.progress.total,
|
|
61
|
+
completed: ++props.progress.completed,
|
|
51
62
|
step: (ctx.state().analyze?.step ?? -1) + 1,
|
|
52
63
|
created_at: new Date().toISOString(),
|
|
53
64
|
};
|
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
AutoBeAnalyzeScenarioEvent,
|
|
7
7
|
AutoBeAssistantMessageHistory,
|
|
8
8
|
} from "@autobe/interface";
|
|
9
|
+
import { StringUtil } from "@autobe/utils";
|
|
9
10
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
10
11
|
import { IPointer } from "tstl";
|
|
11
12
|
import typia from "typia";
|
|
12
|
-
import {
|
|
13
|
+
import { v7 } from "uuid";
|
|
13
14
|
|
|
14
15
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
15
16
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -29,25 +30,23 @@ export const orchestrateAnalyzeScenario = async <
|
|
|
29
30
|
source: "analyzeScenario",
|
|
30
31
|
controller: createController<Model>({
|
|
31
32
|
model: ctx.model,
|
|
32
|
-
|
|
33
|
-
preExecute: (props: IAutoBeAnalyzeScenarioApplication.IProps) =>
|
|
34
|
-
(pointer.value = props),
|
|
33
|
+
build: (value) => (pointer.value = value),
|
|
35
34
|
}),
|
|
36
35
|
histories: transformAnalyzeSceHistories(ctx),
|
|
37
36
|
enforceFunctionCall: false,
|
|
38
|
-
message:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
message: StringUtil.trim`
|
|
38
|
+
Design a complete list of documents and user roles for this project.
|
|
39
|
+
Define user roles that can authenticate via API and create appropriate documentation files.
|
|
40
|
+
You must respect the number of documents specified by the user.
|
|
41
|
+
Note that the user's locale is in ${ctx.locale}.
|
|
42
|
+
`,
|
|
44
43
|
});
|
|
45
44
|
if (histories.at(-1)?.type === "assistantMessage")
|
|
46
45
|
return {
|
|
47
46
|
...(histories.at(-1)! as AgenticaAssistantMessageHistory),
|
|
48
47
|
created_at: start.toISOString(),
|
|
49
48
|
completed_at: new Date().toISOString(),
|
|
50
|
-
id:
|
|
49
|
+
id: v7(),
|
|
51
50
|
} satisfies AutoBeAssistantMessageHistory;
|
|
52
51
|
else if (pointer.value === null) {
|
|
53
52
|
// unreachable
|
|
@@ -55,6 +54,7 @@ export const orchestrateAnalyzeScenario = async <
|
|
|
55
54
|
}
|
|
56
55
|
return {
|
|
57
56
|
type: "analyzeScenario",
|
|
57
|
+
id: v7(),
|
|
58
58
|
prefix: pointer.value.prefix,
|
|
59
59
|
language: pointer.value.language,
|
|
60
60
|
roles: pointer.value.roles,
|
|
@@ -65,33 +65,9 @@ export const orchestrateAnalyzeScenario = async <
|
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
class AutoBeAnalyzeScenarioApplication
|
|
69
|
-
implements IAutoBeAnalyzeScenarioApplication
|
|
70
|
-
{
|
|
71
|
-
/**
|
|
72
|
-
* Compose project structure with roles and files.
|
|
73
|
-
*
|
|
74
|
-
* Design a list of roles and initial documents that you need to create for
|
|
75
|
-
* that requirement. Roles define team member responsibilities, while files
|
|
76
|
-
* define the documentation structure. These are managed separately. If you
|
|
77
|
-
* determine from the conversation that the user's requirements have not been
|
|
78
|
-
* fully gathered, you must stop the analysis and continue collecting the
|
|
79
|
-
* remaining requirements. In this case, you do not need to generate any files
|
|
80
|
-
* or roles. Simply pass an empty array to `input.files` and `input.roles`.
|
|
81
|
-
*
|
|
82
|
-
* @param input Prefix, roles, and files
|
|
83
|
-
* @returns
|
|
84
|
-
*/
|
|
85
|
-
compose(input: IAutoBeAnalyzeScenarioApplication.IProps): void {
|
|
86
|
-
input;
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
68
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
92
69
|
model: Model;
|
|
93
|
-
|
|
94
|
-
preExecute: (input: IAutoBeAnalyzeScenarioApplication.IProps) => void;
|
|
70
|
+
build: (value: IAutoBeAnalyzeScenarioApplication.IProps) => void;
|
|
95
71
|
}): IAgenticaController.IClass<Model> {
|
|
96
72
|
assertSchemaModel(props.model);
|
|
97
73
|
const application: ILlmApplication<Model> = collection[
|
|
@@ -103,19 +79,21 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
103
79
|
application,
|
|
104
80
|
execute: {
|
|
105
81
|
compose: (input) => {
|
|
106
|
-
props.
|
|
107
|
-
return props.execute.compose(input);
|
|
82
|
+
props.build(input);
|
|
108
83
|
},
|
|
109
84
|
} satisfies IAutoBeAnalyzeScenarioApplication,
|
|
110
85
|
};
|
|
111
86
|
}
|
|
112
87
|
|
|
113
88
|
const claude = typia.llm.application<
|
|
114
|
-
|
|
89
|
+
IAutoBeAnalyzeScenarioApplication,
|
|
115
90
|
"claude"
|
|
116
91
|
>();
|
|
117
92
|
const collection = {
|
|
118
|
-
chatgpt: typia.llm.application<
|
|
93
|
+
chatgpt: typia.llm.application<
|
|
94
|
+
IAutoBeAnalyzeScenarioApplication,
|
|
95
|
+
"chatgpt"
|
|
96
|
+
>(),
|
|
119
97
|
claude,
|
|
120
98
|
llama: claude,
|
|
121
99
|
deepseek: claude,
|
|
@@ -2,11 +2,13 @@ import { IAgenticaController } from "@agentica/core";
|
|
|
2
2
|
import {
|
|
3
3
|
AutoBeAnalyzeScenarioEvent,
|
|
4
4
|
AutoBeAnalyzeWriteEvent,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
@@ -15,31 +17,36 @@ import { IAutoBeAnalyzeWriteApplication } from "./structures/IAutoBeAnalyzeWrite
|
|
|
15
17
|
|
|
16
18
|
export const orchestrateAnalyzeWrite = async <Model extends ILlmSchema.Model>(
|
|
17
19
|
ctx: AutoBeContext<Model>,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
props: {
|
|
21
|
+
scenario: AutoBeAnalyzeScenarioEvent;
|
|
22
|
+
file: AutoBeAnalyzeFile.Scenario;
|
|
23
|
+
progress: AutoBeProgressEventBase;
|
|
24
|
+
promptCacheKey: string;
|
|
23
25
|
},
|
|
24
26
|
): Promise<AutoBeAnalyzeWriteEvent> => {
|
|
27
|
+
const { scenario, file, progress, promptCacheKey } = props;
|
|
25
28
|
const pointer: IPointer<IAutoBeAnalyzeWriteApplication.IProps | null> = {
|
|
26
29
|
value: null,
|
|
27
30
|
};
|
|
28
|
-
const { tokenUsage } = await ctx.conversate({
|
|
31
|
+
const { histories, tokenUsage } = await ctx.conversate({
|
|
29
32
|
source: "analyzeWrite",
|
|
30
33
|
controller: createController<Model>({
|
|
31
34
|
model: ctx.model,
|
|
32
35
|
pointer,
|
|
33
36
|
}),
|
|
34
|
-
histories: transformAnalyzeWriteHistories(scenario, file),
|
|
37
|
+
histories: transformAnalyzeWriteHistories(ctx, scenario, file),
|
|
35
38
|
enforceFunctionCall: true,
|
|
39
|
+
promptCacheKey,
|
|
36
40
|
message: "Write requirement analysis report.",
|
|
37
41
|
});
|
|
38
|
-
if (pointer.value === null)
|
|
42
|
+
if (pointer.value === null) {
|
|
43
|
+
console.log(JSON.stringify(histories, null, 2));
|
|
39
44
|
throw new Error("The Analyze Agent failed to create the document.");
|
|
45
|
+
}
|
|
40
46
|
|
|
41
47
|
const event: AutoBeAnalyzeWriteEvent = {
|
|
42
48
|
type: "analyzeWrite",
|
|
49
|
+
id: v7(),
|
|
43
50
|
file: {
|
|
44
51
|
...file,
|
|
45
52
|
content: pointer.value.content,
|
|
@@ -12,9 +12,10 @@ export interface IAutoBeAnalyzeReviewApplication {
|
|
|
12
12
|
* - Adding missing business processes and workflows
|
|
13
13
|
* - Ensuring proper document structure and completeness
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* DO: Output the actual document content that will be saved.
|
|
16
|
+
* DO NOT: Output review comments or analysis of the document.
|
|
17
|
+
*
|
|
18
|
+
* Note: Any text output becomes part of the final document.
|
|
18
19
|
*
|
|
19
20
|
* @param props - The properties containing the document to enhance along with
|
|
20
21
|
* plan and review criteria for guidance
|
|
@@ -41,14 +42,12 @@ export namespace IAutoBeAnalyzeReviewApplication {
|
|
|
41
42
|
*
|
|
42
43
|
* Critical review points:
|
|
43
44
|
*
|
|
44
|
-
* -
|
|
45
|
-
* -
|
|
46
|
-
* -
|
|
47
|
-
* - Focus on business requirements and user scenarios
|
|
48
|
-
* -
|
|
49
|
-
*
|
|
50
|
-
* - Business model and authentication requirements must be described in
|
|
51
|
-
* natural language
|
|
45
|
+
* - DO: Use double quotes for ALL labels in Mermaid diagrams
|
|
46
|
+
* - DO NOT: Use spaces between brackets and quotes in Mermaid
|
|
47
|
+
* - DO: Make requirements specific and measurable in natural language
|
|
48
|
+
* - DO: Focus on business requirements and user scenarios
|
|
49
|
+
* - DO NOT: Accept documents containing database schemas or API specifications
|
|
50
|
+
* - DO: Describe business model and authentication requirements in natural language
|
|
52
51
|
*/
|
|
53
52
|
review: string;
|
|
54
53
|
|
|
@@ -70,10 +69,11 @@ export namespace IAutoBeAnalyzeReviewApplication {
|
|
|
70
69
|
/**
|
|
71
70
|
* The actual markdown document content that incorporates review feedback.
|
|
72
71
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
72
|
+
* This field contains a COMPLETE MARKDOWN DOCUMENT that has already
|
|
73
|
+
* incorporated the review criteria and plan requirements.
|
|
74
|
+
*
|
|
75
|
+
* DO: Treat this as the final, production-ready document.
|
|
76
|
+
* DO NOT: Treat this as raw input to be reviewed.
|
|
77
77
|
*
|
|
78
78
|
* This content represents:
|
|
79
79
|
* - A fully-formed markdown document (.md file)
|
|
@@ -92,7 +92,7 @@ export namespace IAutoBeAnalyzeReviewApplication {
|
|
|
92
92
|
* - Appropriate level of detail for backend implementation
|
|
93
93
|
* - Proper document linking (descriptive text, not raw filenames)
|
|
94
94
|
*
|
|
95
|
-
*
|
|
95
|
+
* The enhancer outputs the document itself:
|
|
96
96
|
*
|
|
97
97
|
* - If content is provided, it represents the actual document
|
|
98
98
|
* - The enhancer outputs the enhanced version AS the document itself
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AutoBeAnalyzeRole, CamelPattern } from "@autobe/interface";
|
|
2
2
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
3
|
+
import { tags } from "typia";
|
|
3
4
|
|
|
4
5
|
export interface IAutoBeAnalyzeScenarioApplication {
|
|
5
6
|
/**
|
|
@@ -28,7 +29,7 @@ export namespace IAutoBeAnalyzeScenarioApplication {
|
|
|
28
29
|
* Prefix for file names and variable names. This will be used for
|
|
29
30
|
* organizing documentation files.
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
+
* DO: Use camelCase naming convention.
|
|
32
33
|
*/
|
|
33
34
|
prefix: string & CamelPattern;
|
|
34
35
|
|
|
@@ -64,9 +65,8 @@ export namespace IAutoBeAnalyzeScenarioApplication {
|
|
|
64
65
|
* - Service overview and business model description
|
|
65
66
|
* - User roles and permission requirements (described in natural language)
|
|
66
67
|
* - Business logic and validation rules
|
|
67
|
-
* -
|
|
68
|
-
*
|
|
69
|
-
* - All requirements must be written in natural language for clarity
|
|
68
|
+
* - DO NOT: Include database schemas, ERD, or API specifications
|
|
69
|
+
* - DO: Write all requirements in natural language for clarity
|
|
70
70
|
*
|
|
71
71
|
* Generate files based on actual requirements gathered from conversation.
|
|
72
72
|
* Do not create unnecessary documentation - only generate what is needed to
|
|
@@ -80,6 +80,6 @@ export namespace IAutoBeAnalyzeScenarioApplication {
|
|
|
80
80
|
* user does not specify a number, generate a sufficient number of documents
|
|
81
81
|
* to adequately support the service.
|
|
82
82
|
*/
|
|
83
|
-
files: Array<AutoBeAnalyzeFile.Scenario>;
|
|
83
|
+
files: Array<AutoBeAnalyzeFile.Scenario> & tags.MinItems<1>;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
AutoBePrismaHistory,
|
|
5
5
|
IAutoBePrismaCompileResult,
|
|
6
6
|
} from "@autobe/interface";
|
|
7
|
-
import {
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
8
|
+
import { v7 } from "uuid";
|
|
8
9
|
|
|
9
10
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
10
11
|
|
|
@@ -17,59 +18,58 @@ export const transformInterfaceAssetHistories = (
|
|
|
17
18
|
const prisma: AutoBePrismaHistory = state.prisma!;
|
|
18
19
|
return [
|
|
19
20
|
{
|
|
20
|
-
id:
|
|
21
|
+
id: v7(),
|
|
21
22
|
created_at: new Date().toISOString(),
|
|
22
23
|
type: "assistantMessage",
|
|
23
|
-
text:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"```",
|
|
40
|
-
].join("\n"),
|
|
24
|
+
text: StringUtil.trim`
|
|
25
|
+
Requirement analysis and Prisma DB schema generation are ready.
|
|
26
|
+
|
|
27
|
+
Call the provided tool function to generate the OpenAPI document
|
|
28
|
+
referencing below requirement analysis and Prisma DB schema.
|
|
29
|
+
|
|
30
|
+
## User Request
|
|
31
|
+
|
|
32
|
+
${analyze.reason}
|
|
33
|
+
|
|
34
|
+
## Requirement Analysis Report
|
|
35
|
+
|
|
36
|
+
\`\`\`json
|
|
37
|
+
${JSON.stringify(analyze.files)}
|
|
38
|
+
\`\`\`
|
|
39
|
+
`,
|
|
41
40
|
},
|
|
42
41
|
{
|
|
43
|
-
id:
|
|
42
|
+
id: v7(),
|
|
44
43
|
created_at: new Date().toISOString(),
|
|
45
44
|
type: "assistantMessage",
|
|
46
|
-
text:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
text: StringUtil.trim`
|
|
46
|
+
Database schema and entity relationship diagrams are ready.
|
|
47
|
+
You should also look at this and consider logic including membership/login and token issuance.
|
|
48
|
+
You can use table's name to define role in operations.
|
|
49
|
+
|
|
50
|
+
## Critical Schema Verification Instructions
|
|
51
|
+
|
|
52
|
+
**IMPORTANT**: When generating API operations and descriptions:
|
|
53
|
+
1. ONLY reference fields that ACTUALLY EXIST in the Prisma schema below
|
|
54
|
+
2. NEVER assume common fields like \`deleted_at\`, \`created_by\`, \`updated_by\`, \`is_deleted\` exist
|
|
55
|
+
3. For DELETE operations:
|
|
56
|
+
- If schema HAS soft delete fields (e.g., \`deleted_at\`), describe soft delete behavior
|
|
57
|
+
- If schema LACKS soft delete fields, describe hard delete behavior
|
|
58
|
+
4. Verify EVERY field reference against the actual schema before including in descriptions
|
|
59
|
+
|
|
60
|
+
## Prisma DB Schema
|
|
61
|
+
|
|
62
|
+
\`\`\`json
|
|
63
|
+
${JSON.stringify(prisma.schemas)}
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
## Entity Relationship Diagrams
|
|
67
|
+
\`\`\`json
|
|
68
|
+
${JSON.stringify(
|
|
69
69
|
(prisma.compiled as IAutoBePrismaCompileResult.ISuccess).diagrams,
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
)}
|
|
71
|
+
\`\`\`
|
|
72
|
+
`,
|
|
73
73
|
},
|
|
74
74
|
];
|
|
75
75
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeAnalyzeRole } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -15,26 +16,25 @@ export const transformInterfaceAuthorizationsHistories = (
|
|
|
15
16
|
return [
|
|
16
17
|
{
|
|
17
18
|
type: "systemMessage",
|
|
18
|
-
id:
|
|
19
|
+
id: v7(),
|
|
19
20
|
created_at: new Date().toISOString(),
|
|
20
21
|
text: AutoBeSystemPromptConstant.INTERFACE_AUTHORIZATION,
|
|
21
22
|
},
|
|
22
23
|
...transformInterfaceAssetHistories(state),
|
|
23
24
|
{
|
|
24
25
|
type: "assistantMessage",
|
|
25
|
-
id:
|
|
26
|
+
id: v7(),
|
|
26
27
|
created_at: new Date().toISOString(),
|
|
27
|
-
text:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
JSON.stringify(role)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
].join("\n"),
|
|
28
|
+
text: StringUtil.trim`
|
|
29
|
+
You have to make API operations for the given role:
|
|
30
|
+
|
|
31
|
+
## Role
|
|
32
|
+
|
|
33
|
+
\`\`\`json
|
|
34
|
+
${JSON.stringify(role)}
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
`,
|
|
38
38
|
},
|
|
39
39
|
];
|
|
40
40
|
};
|