@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } 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,55 +16,55 @@ export const transformInterfaceComplementHistories = (
|
|
|
15
16
|
> => [
|
|
16
17
|
{
|
|
17
18
|
type: "systemMessage",
|
|
18
|
-
id:
|
|
19
|
+
id: v7(),
|
|
19
20
|
created_at: new Date().toISOString(),
|
|
20
21
|
text: AutoBeSystemPromptConstant.INTERFACE_OPERATION,
|
|
21
22
|
},
|
|
22
23
|
...transformInterfaceAssetHistories(state),
|
|
23
24
|
{
|
|
24
|
-
type: "
|
|
25
|
-
id:
|
|
25
|
+
type: "systemMessage",
|
|
26
|
+
id: v7(),
|
|
26
27
|
created_at: new Date().toISOString(),
|
|
27
|
-
text:
|
|
28
|
-
"Here is the OpenAPI operations what you AI have made:",
|
|
29
|
-
"",
|
|
30
|
-
"```json",
|
|
31
|
-
JSON.stringify(document.operations),
|
|
32
|
-
"```",
|
|
33
|
-
].join("\n"),
|
|
28
|
+
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA,
|
|
34
29
|
},
|
|
35
30
|
{
|
|
36
31
|
type: "systemMessage",
|
|
37
|
-
id:
|
|
32
|
+
id: v7(),
|
|
38
33
|
created_at: new Date().toISOString(),
|
|
39
|
-
text: AutoBeSystemPromptConstant.
|
|
34
|
+
text: AutoBeSystemPromptConstant.INTERFACE_COMPLEMENT,
|
|
40
35
|
},
|
|
41
36
|
{
|
|
42
37
|
type: "assistantMessage",
|
|
43
|
-
id:
|
|
38
|
+
id: v7(),
|
|
44
39
|
created_at: new Date().toISOString(),
|
|
45
|
-
text:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
JSON.stringify(document.
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
text: StringUtil.trim`
|
|
41
|
+
Here is the OpenAPI operations what you AI have made:
|
|
42
|
+
|
|
43
|
+
\`\`\`json
|
|
44
|
+
${JSON.stringify(document.operations)}
|
|
45
|
+
\`\`\`
|
|
46
|
+
`,
|
|
52
47
|
},
|
|
53
48
|
{
|
|
54
|
-
type: "
|
|
55
|
-
id:
|
|
49
|
+
type: "assistantMessage",
|
|
50
|
+
id: v7(),
|
|
56
51
|
created_at: new Date().toISOString(),
|
|
57
|
-
text:
|
|
52
|
+
text: StringUtil.trim`
|
|
53
|
+
Here is the OpenAPI schemas what you AI have made:
|
|
54
|
+
|
|
55
|
+
\`\`\`json
|
|
56
|
+
${JSON.stringify(document.components.schemas)}
|
|
57
|
+
\`\`\`
|
|
58
|
+
`,
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
type: "assistantMessage",
|
|
61
|
-
id:
|
|
62
|
+
id: v7(),
|
|
62
63
|
created_at: new Date().toISOString(),
|
|
63
|
-
text:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
text: StringUtil.trim`
|
|
65
|
+
You AI have missed below schema types:
|
|
66
|
+
|
|
67
|
+
${missed.map((s) => `- ${s}`).join("\n")}
|
|
68
|
+
`,
|
|
68
69
|
},
|
|
69
70
|
];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
3
|
import { AutoBeInterfaceGroup } from "@autobe/interface/src/histories/contents/AutoBeInterfaceGroup";
|
|
4
|
-
import {
|
|
4
|
+
import { StringUtil } from "@autobe/utils";
|
|
5
|
+
import { v7 } from "uuid";
|
|
5
6
|
|
|
6
7
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
8
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -16,46 +17,36 @@ export const transformInterfaceEndpointHistories = (
|
|
|
16
17
|
> => [
|
|
17
18
|
{
|
|
18
19
|
type: "systemMessage",
|
|
19
|
-
id:
|
|
20
|
+
id: v7(),
|
|
20
21
|
created_at: new Date().toISOString(),
|
|
21
22
|
text: AutoBeSystemPromptConstant.INTERFACE_ENDPOINT,
|
|
22
23
|
},
|
|
23
24
|
...transformInterfaceAssetHistories(state),
|
|
24
25
|
{
|
|
25
26
|
type: "assistantMessage",
|
|
26
|
-
id:
|
|
27
|
+
id: v7(),
|
|
27
28
|
created_at: new Date().toISOString(),
|
|
28
|
-
text:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
JSON.stringify(group)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
JSON.stringify(
|
|
29
|
+
text: StringUtil.trim`
|
|
30
|
+
Here is the target group for the endpoints:
|
|
31
|
+
|
|
32
|
+
\`\`\`json
|
|
33
|
+
${JSON.stringify(group)}
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
**IMPORTANT: DO NOT DUPLICATE EXISTING OPERATIONS**
|
|
37
|
+
|
|
38
|
+
These operations already exist. Do NOT create similar endpoints:
|
|
39
|
+
|
|
40
|
+
\`\`\`json
|
|
41
|
+
${JSON.stringify(
|
|
41
42
|
authorizations.map((op) => ({
|
|
42
43
|
path: op.path,
|
|
43
44
|
method: op.method,
|
|
44
45
|
name: op.name,
|
|
45
46
|
summary: op.summary,
|
|
46
47
|
})),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"```",
|
|
51
|
-
"",
|
|
52
|
-
"**DO NOT CREATE:**",
|
|
53
|
-
"- User creation endpoints (POST /users, POST /admins)",
|
|
54
|
-
"- Authentication endpoints (handled separately)",
|
|
55
|
-
"- Focus only on business data operations",
|
|
56
|
-
"",
|
|
57
|
-
"Create operations for DIFFERENT paths and DIFFERENT purposes only.",
|
|
58
|
-
"",
|
|
59
|
-
].join("\n"),
|
|
48
|
+
)}
|
|
49
|
+
\`\`\`
|
|
50
|
+
`,
|
|
60
51
|
},
|
|
61
52
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { v7 } from "uuid";
|
|
3
3
|
|
|
4
4
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
5
5
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -16,14 +16,14 @@ export const transformInterfaceGroupHistories = (
|
|
|
16
16
|
|
|
17
17
|
return [
|
|
18
18
|
{
|
|
19
|
-
id:
|
|
19
|
+
id: v7(),
|
|
20
20
|
created_at: new Date().toISOString(),
|
|
21
21
|
type: "systemMessage",
|
|
22
22
|
text: AutoBeSystemPromptConstant.INTERFACE_ENDPOINT,
|
|
23
23
|
},
|
|
24
24
|
...transformInterfaceAssetHistories(state),
|
|
25
25
|
{
|
|
26
|
-
id:
|
|
26
|
+
id: v7(),
|
|
27
27
|
created_at: new Date().toISOString(),
|
|
28
28
|
type: "systemMessage",
|
|
29
29
|
text: AutoBeSystemPromptConstant.INTERFACE_GROUP,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeAnalyzeHistory, AutoBeOpenApi } 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";
|
|
@@ -16,42 +17,42 @@ export const transformInterfaceOperationHistories = (
|
|
|
16
17
|
return [
|
|
17
18
|
{
|
|
18
19
|
type: "systemMessage",
|
|
19
|
-
id:
|
|
20
|
+
id: v7(),
|
|
20
21
|
created_at: new Date().toISOString(),
|
|
21
22
|
text: AutoBeSystemPromptConstant.INTERFACE_OPERATION,
|
|
22
23
|
},
|
|
23
24
|
...transformInterfaceAssetHistories(state),
|
|
24
25
|
{
|
|
25
26
|
type: "systemMessage",
|
|
26
|
-
id:
|
|
27
|
+
id: v7(),
|
|
27
28
|
created_at: new Date().toISOString(),
|
|
28
|
-
text:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
text: StringUtil.trim`
|
|
30
|
+
## Service Prefix
|
|
31
|
+
- Original: ${analyze.prefix}
|
|
32
|
+
- PascalCase for DTOs: ${analyze.prefix
|
|
32
33
|
.split(/[-_]/)
|
|
33
34
|
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
|
|
34
|
-
.join("")}
|
|
35
|
-
|
|
35
|
+
.join("")}
|
|
36
|
+
- Expected DTO pattern: I${analyze.prefix
|
|
36
37
|
.split(/[-_]/)
|
|
37
38
|
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
|
|
38
|
-
.join("")}{EntityName}
|
|
39
|
-
|
|
39
|
+
.join("")}{EntityName}
|
|
40
|
+
`,
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
43
|
type: "assistantMessage",
|
|
43
|
-
id:
|
|
44
|
+
id: v7(),
|
|
44
45
|
created_at: new Date().toISOString(),
|
|
45
|
-
text:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
JSON.stringify(endpoints)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
text: StringUtil.trim`
|
|
47
|
+
You have to make API operations for the given endpoints:
|
|
48
|
+
|
|
49
|
+
\`\`\`json
|
|
50
|
+
${JSON.stringify(endpoints)}
|
|
51
|
+
\`\`\`
|
|
52
|
+
|
|
53
|
+
If there is a content in the failure, it is to explain why it failed before.
|
|
54
|
+
Please supplement or modify the Operation accordingly.
|
|
55
|
+
`,
|
|
55
56
|
},
|
|
56
57
|
];
|
|
57
58
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IMicroAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
4
|
import { ILlmSchema } from "@samchon/openapi";
|
|
4
|
-
import {
|
|
5
|
+
import { v7 } from "uuid";
|
|
5
6
|
|
|
6
7
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
8
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
@@ -16,28 +17,28 @@ export function transformInterfaceOperationsReviewHistories<
|
|
|
16
17
|
return [
|
|
17
18
|
{
|
|
18
19
|
type: "systemMessage",
|
|
19
|
-
id:
|
|
20
|
+
id: v7(),
|
|
20
21
|
created_at: new Date().toISOString(),
|
|
21
22
|
text: AutoBeSystemPromptConstant.INTERFACE_OPERATION,
|
|
22
23
|
},
|
|
23
24
|
...transformInterfaceAssetHistories(ctx.state()),
|
|
24
25
|
{
|
|
25
26
|
type: "systemMessage",
|
|
26
|
-
id:
|
|
27
|
+
id: v7(),
|
|
27
28
|
created_at: new Date().toISOString(),
|
|
28
29
|
text: AutoBeSystemPromptConstant.INTERFACE_OPERATION_REVIEW,
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
type: "assistantMessage",
|
|
32
|
-
id:
|
|
33
|
+
id: v7(),
|
|
33
34
|
created_at: new Date().toISOString(),
|
|
34
|
-
text:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
JSON.stringify(operations
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
text: StringUtil.trim`
|
|
36
|
+
Review the following API operations:
|
|
37
|
+
|
|
38
|
+
\`\`\`json
|
|
39
|
+
${JSON.stringify(operations)}
|
|
40
|
+
\`\`\`
|
|
41
|
+
`,
|
|
41
42
|
},
|
|
42
43
|
];
|
|
43
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { v7 } from "uuid";
|
|
3
3
|
|
|
4
4
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ export const transformInterfacePrerequisiteHistories = (
|
|
|
11
11
|
if (state.analyze === null)
|
|
12
12
|
return [
|
|
13
13
|
{
|
|
14
|
-
id:
|
|
14
|
+
id: v7(),
|
|
15
15
|
created_at: new Date().toISOString(),
|
|
16
16
|
type: "systemMessage",
|
|
17
17
|
text: [
|
|
@@ -24,7 +24,7 @@ export const transformInterfacePrerequisiteHistories = (
|
|
|
24
24
|
else if (state.prisma === null)
|
|
25
25
|
return [
|
|
26
26
|
{
|
|
27
|
-
id:
|
|
27
|
+
id: v7(),
|
|
28
28
|
created_at: new Date().toISOString(),
|
|
29
29
|
type: "systemMessage",
|
|
30
30
|
text: [
|
|
@@ -37,7 +37,7 @@ export const transformInterfacePrerequisiteHistories = (
|
|
|
37
37
|
else if (state.analyze.step !== state.prisma.step)
|
|
38
38
|
return [
|
|
39
39
|
{
|
|
40
|
-
id:
|
|
40
|
+
id: v7(),
|
|
41
41
|
created_at: new Date().toISOString(),
|
|
42
42
|
type: "systemMessage",
|
|
43
43
|
text: [
|
|
@@ -51,7 +51,7 @@ export const transformInterfacePrerequisiteHistories = (
|
|
|
51
51
|
else if (state.prisma.compiled.type !== "success")
|
|
52
52
|
return [
|
|
53
53
|
{
|
|
54
|
-
id:
|
|
54
|
+
id: v7(),
|
|
55
55
|
created_at: new Date().toISOString(),
|
|
56
56
|
type: "systemMessage",
|
|
57
57
|
text: [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } 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";
|
|
@@ -14,21 +15,21 @@ export const transformInterfaceSchemaHistories = (
|
|
|
14
15
|
> => [
|
|
15
16
|
{
|
|
16
17
|
type: "systemMessage",
|
|
17
|
-
id:
|
|
18
|
+
id: v7(),
|
|
18
19
|
created_at: new Date().toISOString(),
|
|
19
20
|
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA,
|
|
20
21
|
},
|
|
21
22
|
...transformInterfaceAssetHistories(state),
|
|
22
23
|
{
|
|
23
24
|
type: "assistantMessage",
|
|
24
|
-
id:
|
|
25
|
+
id: v7(),
|
|
25
26
|
created_at: new Date().toISOString(),
|
|
26
|
-
text:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
JSON.stringify(operations)
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
text: StringUtil.trim`
|
|
28
|
+
Here is the list of API operations you have to implement its types:
|
|
29
|
+
|
|
30
|
+
\`\`\`json
|
|
31
|
+
${JSON.stringify(operations)}
|
|
32
|
+
\`\`\`
|
|
33
|
+
`,
|
|
33
34
|
},
|
|
34
35
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } 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";
|
|
@@ -19,45 +20,51 @@ export const transformInterfaceSchemasReviewHistories = (
|
|
|
19
20
|
return [
|
|
20
21
|
{
|
|
21
22
|
type: "systemMessage",
|
|
22
|
-
id:
|
|
23
|
+
id: v7(),
|
|
23
24
|
created_at: new Date().toISOString(),
|
|
24
|
-
text: AutoBeSystemPromptConstant.
|
|
25
|
+
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA,
|
|
25
26
|
},
|
|
26
27
|
...transformInterfaceAssetHistories(state),
|
|
28
|
+
{
|
|
29
|
+
type: "systemMessage",
|
|
30
|
+
id: v7(),
|
|
31
|
+
created_at: new Date().toISOString(),
|
|
32
|
+
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA_REVIEW,
|
|
33
|
+
},
|
|
27
34
|
{
|
|
28
35
|
type: "assistantMessage",
|
|
29
|
-
id:
|
|
36
|
+
id: v7(),
|
|
30
37
|
created_at: new Date().toISOString(),
|
|
31
|
-
text:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
JSON.stringify(operations
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
text: StringUtil.trim`
|
|
39
|
+
The Schema Agent has generated schemas for the following API operations.
|
|
40
|
+
These operations define what endpoints exist and what request/response types they use:
|
|
41
|
+
|
|
42
|
+
\`\`\`json
|
|
43
|
+
${JSON.stringify(operations)}
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
All schema types referenced in these operations (in requestBody and responses) must exist in the schemas.
|
|
47
|
+
`,
|
|
41
48
|
},
|
|
42
49
|
{
|
|
43
|
-
id:
|
|
50
|
+
id: v7(),
|
|
44
51
|
type: "assistantMessage",
|
|
45
52
|
created_at: new Date().toISOString(),
|
|
46
|
-
text:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
JSON.stringify(schemaDescriptive
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
text: StringUtil.trim`
|
|
54
|
+
Here are the schemas generated by the Schema Agent that need your review:
|
|
55
|
+
|
|
56
|
+
\`\`\`json
|
|
57
|
+
${JSON.stringify(schemaDescriptive)}
|
|
58
|
+
\`\`\`
|
|
59
|
+
|
|
60
|
+
Please review these schemas for:
|
|
61
|
+
1. Security vulnerabilities (passwords in responses, actor IDs in requests)
|
|
62
|
+
2. Missing entities or variants referenced by the operations
|
|
63
|
+
3. Type accuracy and format specifications
|
|
64
|
+
4. Alignment with Prisma schema and business requirements
|
|
65
|
+
|
|
66
|
+
Fix all critical issues and return the enhanced schemas in the content field.
|
|
67
|
+
`,
|
|
61
68
|
},
|
|
62
69
|
];
|
|
63
70
|
};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AutoBeAssistantMessageHistory,
|
|
3
|
+
AutoBeInterfaceAuthorization,
|
|
3
4
|
AutoBeInterfaceCompleteEvent,
|
|
4
5
|
AutoBeInterfaceGroupsEvent,
|
|
5
6
|
AutoBeInterfaceHistory,
|
|
6
7
|
AutoBeOpenApi,
|
|
7
8
|
} from "@autobe/interface";
|
|
9
|
+
import { AutoBeEndpointComparator } from "@autobe/utils";
|
|
8
10
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
+
import { HashMap, Pair } from "tstl";
|
|
12
|
+
import { v7 } from "uuid";
|
|
9
13
|
|
|
10
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
15
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
16
|
+
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
12
17
|
import { orchestrateInterfaceAuthorizations } from "./orchestrateInterfaceAuthorizations";
|
|
13
18
|
import { orchestrateInterfaceComplement } from "./orchestrateInterfaceComplement";
|
|
14
19
|
import { orchestrateInterfaceEndpoints } from "./orchestrateInterfaceEndpoints";
|
|
@@ -21,31 +26,65 @@ export const orchestrateInterface =
|
|
|
21
26
|
async (
|
|
22
27
|
props: IAutoBeApplicationProps,
|
|
23
28
|
): Promise<AutoBeAssistantMessageHistory | AutoBeInterfaceHistory> => {
|
|
24
|
-
//
|
|
29
|
+
// PREDICATION
|
|
25
30
|
const start: Date = new Date();
|
|
31
|
+
const predicate: string | null = predicateStateMessage(
|
|
32
|
+
ctx.state(),
|
|
33
|
+
"interface",
|
|
34
|
+
);
|
|
35
|
+
if (predicate !== null)
|
|
36
|
+
return ctx.assistantMessage({
|
|
37
|
+
type: "assistantMessage",
|
|
38
|
+
id: v7(),
|
|
39
|
+
created_at: start.toISOString(),
|
|
40
|
+
text: predicate,
|
|
41
|
+
completed_at: new Date().toISOString(),
|
|
42
|
+
});
|
|
26
43
|
ctx.dispatch({
|
|
27
44
|
type: "interfaceStart",
|
|
45
|
+
id: v7(),
|
|
28
46
|
created_at: start.toISOString(),
|
|
29
47
|
reason: props.reason,
|
|
30
48
|
step: ctx.state().analyze?.step ?? 0,
|
|
31
49
|
});
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
// ENDPOINTS
|
|
52
|
+
const init: AutoBeInterfaceGroupsEvent =
|
|
34
53
|
await orchestrateInterfaceGroups(ctx);
|
|
35
|
-
|
|
36
|
-
else ctx.dispatch(init);
|
|
54
|
+
ctx.dispatch(init);
|
|
37
55
|
|
|
38
56
|
// AUTHORIZATION
|
|
39
|
-
const authorizations:
|
|
57
|
+
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
40
58
|
await orchestrateInterfaceAuthorizations(ctx);
|
|
41
59
|
|
|
60
|
+
const authOperations = authorizations
|
|
61
|
+
.map((authorization) => authorization.operations)
|
|
62
|
+
.flat();
|
|
63
|
+
|
|
42
64
|
// ENDPOINTS & OPERATIONS
|
|
43
65
|
const endpoints: AutoBeOpenApi.IEndpoint[] =
|
|
44
|
-
await orchestrateInterfaceEndpoints(ctx, init.groups,
|
|
45
|
-
const
|
|
66
|
+
await orchestrateInterfaceEndpoints(ctx, init.groups, authOperations);
|
|
67
|
+
const firstOperations: AutoBeOpenApi.IOperation[] =
|
|
46
68
|
await orchestrateInterfaceOperations(ctx, endpoints);
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
const operations: AutoBeOpenApi.IOperation[] = new HashMap<
|
|
70
|
+
AutoBeOpenApi.IEndpoint,
|
|
71
|
+
AutoBeOpenApi.IOperation
|
|
72
|
+
>(
|
|
73
|
+
[...authOperations, ...firstOperations].map(
|
|
74
|
+
(o) =>
|
|
75
|
+
new Pair(
|
|
76
|
+
{
|
|
77
|
+
path: o.path,
|
|
78
|
+
method: o.method,
|
|
79
|
+
},
|
|
80
|
+
o, // early inserted be kept
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
AutoBeEndpointComparator.hashCode,
|
|
84
|
+
AutoBeEndpointComparator.equals,
|
|
85
|
+
)
|
|
86
|
+
.toJSON()
|
|
87
|
+
.map((it) => it.second);
|
|
49
88
|
|
|
50
89
|
// TYPE SCHEMAS
|
|
51
90
|
const document: AutoBeOpenApi.IDocument = {
|
|
@@ -55,15 +94,17 @@ export const orchestrateInterface =
|
|
|
55
94
|
schemas: await orchestrateInterfaceSchemas(ctx, operations),
|
|
56
95
|
},
|
|
57
96
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
document,
|
|
97
|
+
Object.assign(
|
|
98
|
+
document.components.schemas,
|
|
99
|
+
await orchestrateInterfaceComplement(ctx, document),
|
|
61
100
|
);
|
|
62
101
|
|
|
63
102
|
// DO COMPILE
|
|
64
103
|
return ctx.dispatch({
|
|
65
104
|
type: "interfaceComplete",
|
|
105
|
+
id: v7(),
|
|
66
106
|
document,
|
|
107
|
+
authorizations,
|
|
67
108
|
created_at: new Date().toISOString(),
|
|
68
109
|
elapsed: new Date().getTime() - start.getTime(),
|
|
69
110
|
step: ctx.state().analyze?.step ?? 0,
|