@autobe/agent 0.18.0 → 0.19.1
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 +5 -0
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +7 -2
- 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/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 +212 -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 +71 -14
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
- 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 +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -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 +1565 -1142
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
- 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 +135 -124
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
- 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 +59 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -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 +11 -17
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -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 +6 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
- 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 +2 -2
- 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 +278 -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 +12 -20
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
- 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/realize/structures/{IAutoBeRealizeCoderApplication.js → 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/histories/transformTestCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.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 +95 -50
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- 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/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.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/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +3036 -1648
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- 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/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -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/compile.d.ts +3 -3
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- 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 +6 -5
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +14 -0
- package/src/AutoBeMockAgent.ts +9 -11
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +128 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +99 -14
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
- 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 +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
- 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 +62 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -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 +9 -16
- package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
- package/src/orchestrate/realize/internal/compile.ts +28 -45
- package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
- 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/histories/transformTestScenarioHistories.ts +110 -59
- package/src/orchestrate/test/orchestrateTest.ts +12 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- 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/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/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.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/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- 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
|
@@ -2,13 +2,13 @@ import { IAgenticaController } from "@agentica/core";
|
|
|
2
2
|
import {
|
|
3
3
|
AutoBeInterfaceOperationsReviewEvent,
|
|
4
4
|
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
7
8
|
import { IPointer } from "tstl";
|
|
8
9
|
import typia from "typia";
|
|
9
10
|
|
|
10
11
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
|
-
import { IProgress } from "../internal/IProgress";
|
|
12
12
|
import { transformInterfaceOperationsReviewHistories } from "./histories/transformInterfaceOperationsReviewHistories";
|
|
13
13
|
import { IAutoBeInterfaceOperationsReviewApplication } from "./structures/IAutoBeInterfaceOperationsReviewApplication";
|
|
14
14
|
|
|
@@ -17,39 +17,56 @@ export async function orchestrateInterfaceOperationsReview<
|
|
|
17
17
|
>(
|
|
18
18
|
ctx: AutoBeContext<Model>,
|
|
19
19
|
operations: AutoBeOpenApi.IOperation[],
|
|
20
|
-
progress:
|
|
20
|
+
progress: AutoBeProgressEventBase,
|
|
21
21
|
): Promise<AutoBeOpenApi.IOperation[]> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
try {
|
|
23
|
+
const pointer: IPointer<IAutoBeInterfaceOperationsReviewApplication.IProps | null> =
|
|
24
|
+
{
|
|
25
|
+
value: null,
|
|
26
|
+
};
|
|
27
|
+
const { tokenUsage } = await ctx.conversate({
|
|
28
|
+
source: "interfaceOperationsReview",
|
|
29
|
+
histories: transformInterfaceOperationsReviewHistories(ctx, operations),
|
|
30
|
+
controller: createReviewController({
|
|
31
|
+
model: ctx.model,
|
|
32
|
+
build: (next: IAutoBeInterfaceOperationsReviewApplication.IProps) => {
|
|
33
|
+
pointer.value = next;
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
enforceFunctionCall: false,
|
|
37
|
+
message: "Review the operations",
|
|
38
|
+
});
|
|
39
|
+
if (pointer.value === null) {
|
|
40
|
+
console.error("Failed to review operations.");
|
|
41
|
+
progress.completed += operations.length;
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const content: AutoBeOpenApi.IOperation[] = pointer.value.content.map(
|
|
46
|
+
(op) => ({
|
|
47
|
+
...op,
|
|
48
|
+
authorizationType: null,
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
ctx.dispatch({
|
|
53
|
+
type: "interfaceOperationsReview",
|
|
54
|
+
operations: content,
|
|
55
|
+
review: pointer.value.review,
|
|
56
|
+
plan: pointer.value.plan,
|
|
57
|
+
content,
|
|
58
|
+
tokenUsage,
|
|
59
|
+
created_at: new Date().toISOString(),
|
|
60
|
+
step: ctx.state().analyze?.step ?? 0,
|
|
61
|
+
total: progress.total,
|
|
62
|
+
completed: ++progress.completed,
|
|
63
|
+
} satisfies AutoBeInterfaceOperationsReviewEvent);
|
|
64
|
+
return content;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error("Error occurred during interface operations review:", error);
|
|
67
|
+
++progress.completed;
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
53
70
|
}
|
|
54
71
|
|
|
55
72
|
function createReviewController<Model extends ILlmSchema.Model>(props: {
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
AutoBeInterfaceSchemasEvent,
|
|
4
|
+
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
6
|
+
} from "@autobe/interface";
|
|
7
|
+
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
4
8
|
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
5
9
|
import { IPointer } from "tstl";
|
|
6
|
-
import typia from "typia";
|
|
10
|
+
import typia, { tags } from "typia";
|
|
7
11
|
|
|
8
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
13
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
10
14
|
import { divideArray } from "../../utils/divideArray";
|
|
11
|
-
import { IProgress } from "../internal/IProgress";
|
|
12
15
|
import { transformInterfaceSchemaHistories } from "./histories/transformInterfaceSchemaHistories";
|
|
13
16
|
import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
|
|
14
17
|
import { IAutoBeInterfaceSchemaApplication } from "./structures/IAutoBeInterfaceSchemaApplication";
|
|
18
|
+
import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
|
|
15
19
|
|
|
16
20
|
export async function orchestrateInterfaceSchemas<
|
|
17
21
|
Model extends ILlmSchema.Model,
|
|
18
22
|
>(
|
|
19
23
|
ctx: AutoBeContext<Model>,
|
|
20
24
|
operations: AutoBeOpenApi.IOperation[],
|
|
21
|
-
capacity: number =
|
|
25
|
+
capacity: number = 8,
|
|
22
26
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
23
27
|
const typeNames: Set<string> = new Set();
|
|
24
28
|
for (const op of operations) {
|
|
@@ -29,29 +33,40 @@ export async function orchestrateInterfaceSchemas<
|
|
|
29
33
|
array: Array.from(typeNames),
|
|
30
34
|
capacity,
|
|
31
35
|
});
|
|
32
|
-
const progress:
|
|
36
|
+
const progress: AutoBeProgressEventBase = {
|
|
33
37
|
total: typeNames.size,
|
|
34
38
|
completed: 0,
|
|
35
39
|
};
|
|
36
|
-
const reviewProgress:
|
|
40
|
+
const reviewProgress: AutoBeProgressEventBase = {
|
|
37
41
|
total: matrix.length,
|
|
38
42
|
completed: 0,
|
|
39
43
|
};
|
|
40
|
-
const
|
|
44
|
+
const roles: string[] =
|
|
45
|
+
ctx.state().analyze?.roles.map((role) => role.name) ?? [];
|
|
46
|
+
|
|
47
|
+
const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
48
|
+
roles.length > 0
|
|
49
|
+
? {
|
|
50
|
+
IAuthorizationToken: authTokenSchema,
|
|
51
|
+
}
|
|
52
|
+
: {};
|
|
41
53
|
for (const y of await Promise.all(
|
|
42
54
|
matrix.map(async (it) => {
|
|
43
55
|
const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
44
56
|
await divideAndConquer(ctx, operations, it, 3, progress);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
58
|
+
await orchestrateInterfaceSchemasReview(
|
|
59
|
+
ctx,
|
|
60
|
+
operations,
|
|
61
|
+
row,
|
|
62
|
+
reviewProgress,
|
|
63
|
+
);
|
|
64
|
+
return { ...row, ...newbie };
|
|
51
65
|
}),
|
|
52
66
|
)) {
|
|
53
67
|
Object.assign(x, y);
|
|
54
68
|
}
|
|
69
|
+
if (x.IAuthorizationToken) x.IAuthorizationToken = authTokenSchema;
|
|
55
70
|
return x;
|
|
56
71
|
}
|
|
57
72
|
|
|
@@ -60,7 +75,7 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
|
|
|
60
75
|
operations: AutoBeOpenApi.IOperation[],
|
|
61
76
|
typeNames: string[],
|
|
62
77
|
retry: number,
|
|
63
|
-
progress:
|
|
78
|
+
progress: AutoBeProgressEventBase,
|
|
64
79
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
65
80
|
const remained: Set<string> = new Set(typeNames);
|
|
66
81
|
const schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
|
|
@@ -81,7 +96,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
81
96
|
operations: AutoBeOpenApi.IOperation[],
|
|
82
97
|
oldbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
|
|
83
98
|
remained: Set<string>,
|
|
84
|
-
progress:
|
|
99
|
+
progress: AutoBeProgressEventBase,
|
|
85
100
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
86
101
|
const already: string[] = Object.keys(oldbie);
|
|
87
102
|
const pointer: IPointer<Record<
|
|
@@ -134,10 +149,10 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
134
149
|
type: "interfaceSchemas",
|
|
135
150
|
schemas,
|
|
136
151
|
tokenUsage,
|
|
137
|
-
completed: (progress.completed += Object.keys(schemas).
|
|
138
|
-
|
|
152
|
+
completed: (progress.completed += Object.keys(schemas).length),
|
|
153
|
+
total: (progress.total += Object.keys(schemas).filter(
|
|
154
|
+
(k) => remained.has(k) === false,
|
|
139
155
|
).length),
|
|
140
|
-
total: progress.total,
|
|
141
156
|
step: ctx.state().prisma?.step ?? 0,
|
|
142
157
|
created_at: new Date().toISOString(),
|
|
143
158
|
} satisfies AutoBeInterfaceSchemasEvent);
|
|
@@ -156,9 +171,34 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
156
171
|
}): IAgenticaController.IClass<Model> {
|
|
157
172
|
assertSchemaModel(props.model);
|
|
158
173
|
|
|
174
|
+
const validate = (
|
|
175
|
+
next: unknown,
|
|
176
|
+
): IValidation<IAutoBeInterfaceSchemaApplication.IProps> => {
|
|
177
|
+
const result: IValidation<IAutoBeInterfaceSchemaApplication.IProps> =
|
|
178
|
+
typia.validate<IAutoBeInterfaceSchemaApplication.IProps>(next);
|
|
179
|
+
if (result.success === false) return result;
|
|
180
|
+
|
|
181
|
+
// Check all IAuthorized types
|
|
182
|
+
const errors: IValidation.IError[] = [];
|
|
183
|
+
validateAuthorizationSchema({
|
|
184
|
+
errors,
|
|
185
|
+
schemas: result.data.schemas,
|
|
186
|
+
path: "$input.schemas",
|
|
187
|
+
});
|
|
188
|
+
if (errors.length !== 0)
|
|
189
|
+
return {
|
|
190
|
+
success: false,
|
|
191
|
+
errors,
|
|
192
|
+
data: next,
|
|
193
|
+
};
|
|
194
|
+
return result;
|
|
195
|
+
};
|
|
196
|
+
|
|
159
197
|
const application: ILlmApplication<Model> = collection[
|
|
160
|
-
props.model
|
|
161
|
-
]
|
|
198
|
+
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
199
|
+
](
|
|
200
|
+
validate,
|
|
201
|
+
) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
162
202
|
return {
|
|
163
203
|
protocol: "class",
|
|
164
204
|
name: "interface",
|
|
@@ -171,17 +211,71 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
171
211
|
};
|
|
172
212
|
}
|
|
173
213
|
|
|
174
|
-
const claude = typia.llm.application<
|
|
175
|
-
IAutoBeInterfaceSchemaApplication,
|
|
176
|
-
"claude"
|
|
177
|
-
>();
|
|
178
214
|
const collection = {
|
|
179
|
-
chatgpt:
|
|
180
|
-
IAutoBeInterfaceSchemaApplication,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
215
|
+
chatgpt: (validate: Validator) =>
|
|
216
|
+
typia.llm.application<IAutoBeInterfaceSchemaApplication, "chatgpt">({
|
|
217
|
+
validate: {
|
|
218
|
+
makeComponents: validate,
|
|
219
|
+
},
|
|
220
|
+
}),
|
|
221
|
+
claude: (validate: Validator) =>
|
|
222
|
+
typia.llm.application<IAutoBeInterfaceSchemaApplication, "claude">({
|
|
223
|
+
validate: {
|
|
224
|
+
makeComponents: validate,
|
|
225
|
+
},
|
|
226
|
+
}),
|
|
187
227
|
};
|
|
228
|
+
|
|
229
|
+
type Validator = (
|
|
230
|
+
input: unknown,
|
|
231
|
+
) => IValidation<IAutoBeInterfaceSchemaApplication.IProps>;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Authorization token response structure.
|
|
235
|
+
*
|
|
236
|
+
* This interface defines the structure of the authorization token response
|
|
237
|
+
* returned after successful user authentication. It contains both access and
|
|
238
|
+
* refresh tokens along with their expiration information.
|
|
239
|
+
*
|
|
240
|
+
* This token structure is automatically included in API schemas when the system
|
|
241
|
+
* detects authorization roles in the requirements analysis phase. It provides a
|
|
242
|
+
* standard format for JWT-based authentication across the generated backend
|
|
243
|
+
* applications.
|
|
244
|
+
*/
|
|
245
|
+
interface IAuthorizationToken {
|
|
246
|
+
/**
|
|
247
|
+
* JWT access token for authenticated requests.
|
|
248
|
+
*
|
|
249
|
+
* This token should be included in the Authorization header for subsequent
|
|
250
|
+
* authenticated API requests as `Bearer {token}`.
|
|
251
|
+
*/
|
|
252
|
+
access: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Refresh token for obtaining new access tokens.
|
|
256
|
+
*
|
|
257
|
+
* This token can be used to request new access tokens when the current access
|
|
258
|
+
* token expires, extending the user's session.
|
|
259
|
+
*/
|
|
260
|
+
refresh: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Access token expiration timestamp.
|
|
264
|
+
*
|
|
265
|
+
* ISO 8601 date-time string indicating when the access token will expire and
|
|
266
|
+
* can no longer be used for authentication.
|
|
267
|
+
*/
|
|
268
|
+
expired_at: string & tags.Format<"date-time">;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Refresh token expiration timestamp.
|
|
272
|
+
*
|
|
273
|
+
* ISO 8601 date-time string indicating the latest time until which the
|
|
274
|
+
* refresh token can be used to obtain new access tokens.
|
|
275
|
+
*/
|
|
276
|
+
refreshable_until: string & tags.Format<"date-time">;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const authTokenSchema: AutoBeOpenApi.IJsonSchemaDescriptive =
|
|
280
|
+
typia.json.schema<IAuthorizationToken>().components.schemas!
|
|
281
|
+
.IAuthorizationToken as AutoBeOpenApi.IJsonSchemaDescriptive;
|
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
AutoBeOpenApi,
|
|
5
5
|
} from "@autobe/interface";
|
|
6
6
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
7
|
+
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
7
8
|
import { IPointer } from "tstl";
|
|
8
9
|
import typia from "typia";
|
|
9
10
|
|
|
10
11
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
|
+
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
11
13
|
import { transformInterfaceSchemasReviewHistories } from "./histories/transformInterfaceSchemasReviewHistories";
|
|
12
14
|
import { IAutoBeInterfaceSchemasReviewApplication } from "./structures/IAutobeInterfaceSchemasReviewApplication";
|
|
15
|
+
import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
|
|
13
16
|
|
|
14
17
|
export async function orchestrateInterfaceSchemasReview<
|
|
15
18
|
Model extends ILlmSchema.Model,
|
|
@@ -22,42 +25,56 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
22
25
|
>,
|
|
23
26
|
progress: { total: number; completed: number },
|
|
24
27
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
try {
|
|
29
|
+
const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
|
|
30
|
+
{
|
|
31
|
+
value: null,
|
|
32
|
+
};
|
|
33
|
+
const { tokenUsage } = await ctx.conversate({
|
|
34
|
+
source: "interfaceSchemasReview",
|
|
35
|
+
controller: createController({
|
|
36
|
+
model: ctx.model,
|
|
37
|
+
pointer,
|
|
38
|
+
schemas,
|
|
39
|
+
}),
|
|
40
|
+
histories: transformInterfaceSchemasReviewHistories(
|
|
41
|
+
ctx.state(),
|
|
42
|
+
operations,
|
|
43
|
+
schemas,
|
|
44
|
+
),
|
|
45
|
+
enforceFunctionCall: true,
|
|
46
|
+
message: "Review type schemas.",
|
|
47
|
+
});
|
|
48
|
+
if (pointer.value === null) {
|
|
49
|
+
console.error("Failed to extract review information.");
|
|
50
|
+
++progress.completed;
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
const content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
55
|
+
(
|
|
56
|
+
OpenApiV3_1Emender.convertComponents({
|
|
57
|
+
schemas: pointer.value.content,
|
|
58
|
+
}) as AutoBeOpenApi.IComponents
|
|
59
|
+
).schemas ?? {};
|
|
60
|
+
ctx.dispatch({
|
|
61
|
+
type: "interfaceSchemasReview",
|
|
62
|
+
schemas: schemas,
|
|
63
|
+
review: pointer.value.review,
|
|
64
|
+
plan: pointer.value.plan,
|
|
65
|
+
content,
|
|
66
|
+
tokenUsage,
|
|
67
|
+
step: ctx.state().analyze?.step ?? 0,
|
|
68
|
+
total: progress.total,
|
|
69
|
+
completed: ++progress.completed,
|
|
70
|
+
created_at: new Date().toISOString(),
|
|
71
|
+
} satisfies AutoBeInterfaceSchemasReviewEvent);
|
|
72
|
+
return content;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error("Error occurred during interface schemas review:", error);
|
|
75
|
+
++progress.completed;
|
|
76
|
+
return {};
|
|
77
|
+
}
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
@@ -68,6 +85,8 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
68
85
|
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
69
86
|
>;
|
|
70
87
|
}): IAgenticaController.IClass<Model> {
|
|
88
|
+
assertSchemaModel(props.model);
|
|
89
|
+
|
|
71
90
|
const validate = (
|
|
72
91
|
next: unknown,
|
|
73
92
|
): IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> => {
|
|
@@ -76,37 +95,24 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
76
95
|
if (result.success === false) return result;
|
|
77
96
|
|
|
78
97
|
const errors: IValidation.IError[] = [];
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
);
|
|
86
|
-
errors.push({
|
|
87
|
-
path: `$input.content`,
|
|
88
|
-
expected: `Content must not be empty. If it's at a level that can't be fixed, please create a schema instead to meet the requirements.`,
|
|
89
|
-
value: result.data.content,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (errors.length > 0) {
|
|
98
|
+
validateAuthorizationSchema({
|
|
99
|
+
errors,
|
|
100
|
+
schemas: result.data.content,
|
|
101
|
+
path: "$input.content",
|
|
102
|
+
});
|
|
103
|
+
if (errors.length !== 0)
|
|
94
104
|
return {
|
|
95
105
|
success: false,
|
|
96
106
|
errors,
|
|
97
|
-
data:
|
|
107
|
+
data: next,
|
|
98
108
|
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
109
|
return result;
|
|
102
110
|
};
|
|
103
|
-
|
|
104
111
|
const application: ILlmApplication<Model> = collection[
|
|
105
112
|
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
106
113
|
](
|
|
107
114
|
validate,
|
|
108
115
|
) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
109
|
-
|
|
110
116
|
return {
|
|
111
117
|
protocol: "class",
|
|
112
118
|
name: "Reviewer",
|
|
@@ -118,12 +124,6 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
118
124
|
} satisfies IAutoBeInterfaceSchemasReviewApplication,
|
|
119
125
|
};
|
|
120
126
|
}
|
|
121
|
-
const claude = (validate: Validator) =>
|
|
122
|
-
typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
|
|
123
|
-
validate: {
|
|
124
|
-
review: validate,
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
127
|
|
|
128
128
|
const collection = {
|
|
129
129
|
chatgpt: (validate: Validator) =>
|
|
@@ -132,10 +132,12 @@ const collection = {
|
|
|
132
132
|
review: validate,
|
|
133
133
|
},
|
|
134
134
|
}),
|
|
135
|
-
claude
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
claude: (validate: Validator) =>
|
|
136
|
+
typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
|
|
137
|
+
validate: {
|
|
138
|
+
review: validate,
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
139
141
|
};
|
|
140
142
|
|
|
141
143
|
type Validator = (
|
|
@@ -20,6 +20,45 @@ export interface IAutoBeInterfaceComplementApplication {
|
|
|
20
20
|
}
|
|
21
21
|
export namespace IAutoBeInterfaceComplementApplication {
|
|
22
22
|
export interface IProps {
|
|
23
|
+
/**
|
|
24
|
+
* TypeScript draft code for complement schema definitions.
|
|
25
|
+
*
|
|
26
|
+
* This property contains TypeScript interface definitions for missing schema
|
|
27
|
+
* types that were referenced but not defined in the initial schema generation.
|
|
28
|
+
* Similar to the main schema draft, this serves as a preliminary TypeScript
|
|
29
|
+
* representation before converting to JSON Schema format.
|
|
30
|
+
*
|
|
31
|
+
* The draft helps ensure that complementary schemas maintain consistency with
|
|
32
|
+
* the existing type system and follow the same conventions as the primary schemas.
|
|
33
|
+
*
|
|
34
|
+
* This draft typically includes:
|
|
35
|
+
* - Missing entity interfaces referenced via $ref
|
|
36
|
+
* - Nested object types used within other schemas
|
|
37
|
+
* - Shared utility types or enumerations
|
|
38
|
+
* - Any transitively referenced types
|
|
39
|
+
*
|
|
40
|
+
* The final schemas in the `schemas` property should be validated against and
|
|
41
|
+
* derived from this TypeScript draft to ensure type safety and consistency
|
|
42
|
+
* across the entire API specification.
|
|
43
|
+
*
|
|
44
|
+
* Example complement draft:
|
|
45
|
+
* ```typescript
|
|
46
|
+
* interface IUserProfile {
|
|
47
|
+
* id: string;
|
|
48
|
+
* userId: string;
|
|
49
|
+
* displayName: string;
|
|
50
|
+
* avatarUrl?: string;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* interface IAddress {
|
|
54
|
+
* street: string;
|
|
55
|
+
* city: string;
|
|
56
|
+
* postalCode: string;
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
draft: string;
|
|
61
|
+
|
|
23
62
|
/**
|
|
24
63
|
* A collection of missing schema definitions that need to be added to the
|
|
25
64
|
* OpenAPI document's `components.schemas` section.
|
|
@@ -5,10 +5,10 @@ export interface IAutoBeInterfaceGroupApplication {
|
|
|
5
5
|
* Generate logical groups for organizing API endpoint creation based on
|
|
6
6
|
* Prisma schema structure.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* structure, table prefixes) rather than arbitrary business domains.
|
|
10
|
-
*
|
|
11
|
-
* all requirements.
|
|
8
|
+
* DO: Derive groups from Prisma schema organization (namespaces, file
|
|
9
|
+
* structure, table prefixes) rather than arbitrary business domains.
|
|
10
|
+
* DO: Create new groups only when existing schema structure cannot adequately
|
|
11
|
+
* cover all requirements.
|
|
12
12
|
*
|
|
13
13
|
* @param props Properties containing the groups to be created for API
|
|
14
14
|
* organization
|
|
@@ -21,8 +21,8 @@ export namespace IAutoBeInterfaceGroupApplication {
|
|
|
21
21
|
/**
|
|
22
22
|
* Array of API endpoint groups for organizing development.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* DO: Organize groups around existing Prisma schema structure.
|
|
25
|
+
* DO: Provide complete coverage of all entities and requirements without
|
|
26
26
|
* overlap.
|
|
27
27
|
*/
|
|
28
28
|
groups: IGroup[] & tags.MinItems<1>;
|
|
@@ -34,10 +34,11 @@ export namespace IAutoBeInterfaceGroupApplication {
|
|
|
34
34
|
*
|
|
35
35
|
* **SCHEMA-BASED GROUP REQUIREMENTS:**
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* and
|
|
37
|
+
* DO: Derive groups from the Prisma schema structure rather than arbitrary
|
|
38
|
+
* business domain names.
|
|
39
|
+
*
|
|
40
|
+
* This ensures consistency with the underlying data model and prevents
|
|
41
|
+
* misalignment between API organization and database structure.
|
|
41
42
|
*
|
|
42
43
|
* **Primary Group Sources (in order of priority):**
|
|
43
44
|
*
|
|
@@ -51,12 +52,11 @@ export namespace IAutoBeInterfaceGroupApplication {
|
|
|
51
52
|
*
|
|
52
53
|
* **Group Creation Guidelines:**
|
|
53
54
|
*
|
|
54
|
-
* - Each group
|
|
55
|
+
* - Each group covers specific Prisma schema entities without overlap
|
|
55
56
|
* - Size groups appropriately for manageable endpoint generation cycles
|
|
56
57
|
* - Maintain clear boundaries based on schema organization
|
|
57
58
|
* - Ensure complete coverage of all database entities and requirements
|
|
58
|
-
* - Related database tables within the same schema area
|
|
59
|
-
* together
|
|
59
|
+
* - Related database tables within the same schema area are grouped together
|
|
60
60
|
*
|
|
61
61
|
* **When to Create Schema-Independent Groups:**
|
|
62
62
|
*
|
|
@@ -71,14 +71,14 @@ export namespace IAutoBeInterfaceGroupApplication {
|
|
|
71
71
|
* **Naming Standards:**
|
|
72
72
|
*
|
|
73
73
|
* - Use PascalCase format (e.g., "Shopping", "BBS", "UserManagement")
|
|
74
|
-
* - Names
|
|
74
|
+
* - Names directly reflect Prisma schema structure
|
|
75
75
|
* - Keep names concise and schema-derived
|
|
76
76
|
* - Avoid arbitrary business domain names
|
|
77
77
|
* - Maintain consistency with schema organization
|
|
78
78
|
*
|
|
79
79
|
* **Quality Requirements:**
|
|
80
80
|
*
|
|
81
|
-
* - Groups collectively
|
|
81
|
+
* - Groups collectively cover ALL entities and requirements
|
|
82
82
|
* - Each database entity belongs to exactly one group
|
|
83
83
|
* - Clear mapping to specific Prisma schema elements
|
|
84
84
|
* - Balance group sizes within schema constraints
|
|
@@ -88,7 +88,7 @@ export namespace IAutoBeInterfaceGroupApplication {
|
|
|
88
88
|
/**
|
|
89
89
|
* Unique identifier name derived from Prisma schema structure.
|
|
90
90
|
*
|
|
91
|
-
*
|
|
91
|
+
* DO: Correspond to schema namespaces, file names, table prefixes, or
|
|
92
92
|
* organizational annotations rather than arbitrary business domain names.
|
|
93
93
|
*/
|
|
94
94
|
name: string & tags.MinLength<1>;
|