@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
|
@@ -2,14 +2,19 @@ import { IAgenticaController } from "@agentica/core";
|
|
|
2
2
|
import {
|
|
3
3
|
AutoBeInterfaceSchemasReviewEvent,
|
|
4
4
|
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
8
|
+
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
7
9
|
import { IPointer } from "tstl";
|
|
8
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
9
12
|
|
|
10
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
|
+
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
11
15
|
import { transformInterfaceSchemasReviewHistories } from "./histories/transformInterfaceSchemasReviewHistories";
|
|
12
16
|
import { IAutoBeInterfaceSchemasReviewApplication } from "./structures/IAutobeInterfaceSchemasReviewApplication";
|
|
17
|
+
import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
|
|
13
18
|
|
|
14
19
|
export async function orchestrateInterfaceSchemasReview<
|
|
15
20
|
Model extends ILlmSchema.Model,
|
|
@@ -20,54 +25,73 @@ export async function orchestrateInterfaceSchemasReview<
|
|
|
20
25
|
string,
|
|
21
26
|
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
22
27
|
>,
|
|
23
|
-
progress:
|
|
28
|
+
progress: AutoBeProgressEventBase,
|
|
24
29
|
): 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
|
-
|
|
30
|
+
try {
|
|
31
|
+
const pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null> =
|
|
32
|
+
{
|
|
33
|
+
value: null,
|
|
34
|
+
};
|
|
35
|
+
const { tokenUsage } = await ctx.conversate({
|
|
36
|
+
source: "interfaceSchemasReview",
|
|
37
|
+
controller: createController({
|
|
38
|
+
model: ctx.model,
|
|
39
|
+
pointer,
|
|
40
|
+
operations,
|
|
41
|
+
schemas,
|
|
42
|
+
}),
|
|
43
|
+
histories: transformInterfaceSchemasReviewHistories(
|
|
44
|
+
ctx.state(),
|
|
45
|
+
operations,
|
|
46
|
+
schemas,
|
|
47
|
+
),
|
|
48
|
+
enforceFunctionCall: true,
|
|
49
|
+
message: "Review type schemas.",
|
|
50
|
+
});
|
|
51
|
+
if (pointer.value === null) {
|
|
52
|
+
console.error("Failed to extract review information.");
|
|
53
|
+
++progress.completed;
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
47
56
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
58
|
+
(
|
|
59
|
+
OpenApiV3_1Emender.convertComponents({
|
|
60
|
+
schemas: pointer.value.content,
|
|
61
|
+
}) as AutoBeOpenApi.IComponents
|
|
62
|
+
).schemas ?? {};
|
|
63
|
+
ctx.dispatch({
|
|
64
|
+
type: "interfaceSchemasReview",
|
|
65
|
+
id: v7(),
|
|
66
|
+
schemas: schemas,
|
|
67
|
+
review: pointer.value.review,
|
|
68
|
+
plan: pointer.value.plan,
|
|
69
|
+
content,
|
|
70
|
+
tokenUsage,
|
|
71
|
+
step: ctx.state().analyze?.step ?? 0,
|
|
72
|
+
total: progress.total,
|
|
73
|
+
completed: ++progress.completed,
|
|
74
|
+
created_at: new Date().toISOString(),
|
|
75
|
+
} satisfies AutoBeInterfaceSchemasReviewEvent);
|
|
76
|
+
return content;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error("Error occurred during interface schemas review:", error);
|
|
79
|
+
++progress.completed;
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
61
82
|
}
|
|
62
83
|
|
|
63
84
|
function createController<Model extends ILlmSchema.Model>(props: {
|
|
64
85
|
model: Model;
|
|
65
86
|
pointer: IPointer<IAutoBeInterfaceSchemasReviewApplication.IProps | null>;
|
|
87
|
+
operations: AutoBeOpenApi.IOperation[];
|
|
66
88
|
schemas: Record<
|
|
67
89
|
string,
|
|
68
90
|
AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>
|
|
69
91
|
>;
|
|
70
92
|
}): IAgenticaController.IClass<Model> {
|
|
93
|
+
assertSchemaModel(props.model);
|
|
94
|
+
|
|
71
95
|
const validate = (
|
|
72
96
|
next: unknown,
|
|
73
97
|
): IValidation<IAutoBeInterfaceSchemasReviewApplication.IProps> => {
|
|
@@ -76,27 +100,94 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
76
100
|
if (result.success === false) return result;
|
|
77
101
|
|
|
78
102
|
const errors: IValidation.IError[] = [];
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
validateAuthorizationSchema({
|
|
104
|
+
errors,
|
|
105
|
+
schemas: result.data.content,
|
|
106
|
+
path: "$input.content",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
Object.entries(result.data.content).forEach(
|
|
110
|
+
([tagName, jsonDescriptive]) => {
|
|
111
|
+
const index: AutoBeOpenApi.IOperation | undefined =
|
|
112
|
+
props.operations.find(
|
|
113
|
+
(op) =>
|
|
114
|
+
op.responseBody?.typeName === tagName &&
|
|
115
|
+
op.method === "patch" &&
|
|
116
|
+
op.name === "index",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
// The index API should return the `IPage<T>` type.
|
|
120
|
+
if (index) {
|
|
121
|
+
// First check if the schema has the correct object structure
|
|
122
|
+
if (
|
|
123
|
+
!("type" in jsonDescriptive) ||
|
|
124
|
+
jsonDescriptive.type !== "object"
|
|
125
|
+
) {
|
|
126
|
+
errors.push({
|
|
127
|
+
path: `$input.content.${tagName}`,
|
|
128
|
+
expected: `{ type: "object", properties: { ... } }`,
|
|
129
|
+
value: jsonDescriptive,
|
|
130
|
+
description: `IPage schema must have type: "object". Found: ${JSON.stringify(jsonDescriptive)}`,
|
|
131
|
+
});
|
|
132
|
+
} else if (!("properties" in jsonDescriptive)) {
|
|
133
|
+
errors.push({
|
|
134
|
+
path: `$input.content.${tagName}`,
|
|
135
|
+
expected: `Schema with "properties" field`,
|
|
136
|
+
value: jsonDescriptive,
|
|
137
|
+
description: `IPage schema must have a "properties" field containing "pagination" and "data" properties.`,
|
|
138
|
+
});
|
|
139
|
+
} else if (
|
|
140
|
+
typia.is<AutoBeOpenApi.IJsonSchema.IObject>(jsonDescriptive)
|
|
141
|
+
) {
|
|
142
|
+
jsonDescriptive.properties ??= {};
|
|
143
|
+
|
|
144
|
+
// Check pagination property
|
|
145
|
+
const pagination = jsonDescriptive.properties["pagination"];
|
|
146
|
+
if (!pagination || !("$ref" in pagination)) {
|
|
147
|
+
errors.push({
|
|
148
|
+
path: `$input.content.${tagName}.properties.pagination`,
|
|
149
|
+
expected: `{ $ref: "#/components/schemas/IPage.IPagination" }`,
|
|
150
|
+
value: pagination,
|
|
151
|
+
description: `IPage must have a "pagination" property with $ref to IPage.IPagination.`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
92
154
|
|
|
93
|
-
|
|
155
|
+
// Check data property
|
|
156
|
+
const data = jsonDescriptive.properties["data"];
|
|
157
|
+
if (!typia.is<AutoBeOpenApi.IJsonSchema.IArray>(data)) {
|
|
158
|
+
errors.push({
|
|
159
|
+
path: `$input.content.${tagName}.properties.data`,
|
|
160
|
+
expected: `AutoBeOpenApi.IJsonSchema.IArray`,
|
|
161
|
+
value: data,
|
|
162
|
+
description: `The 'data' property must be an array for the index operation.`,
|
|
163
|
+
});
|
|
164
|
+
} else {
|
|
165
|
+
// Check if array items have proper type reference (not 'any')
|
|
166
|
+
const arraySchema: AutoBeOpenApi.IJsonSchema.IArray = data;
|
|
167
|
+
if (
|
|
168
|
+
!arraySchema.items ||
|
|
169
|
+
!("$ref" in arraySchema.items) ||
|
|
170
|
+
arraySchema.items.$ref === "#/components/schemas/any"
|
|
171
|
+
) {
|
|
172
|
+
errors.push({
|
|
173
|
+
path: `$input.content.${tagName}.properties.data.items`,
|
|
174
|
+
expected: `Reference to a specific type (e.g., $ref to ISummary type)`,
|
|
175
|
+
value: arraySchema.items,
|
|
176
|
+
description: `The 'data' array must have a specific item type, not 'any[]'. Use a proper type reference like '{Entity}.ISummary' for paginated results.`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
if (errors.length !== 0)
|
|
94
186
|
return {
|
|
95
187
|
success: false,
|
|
96
188
|
errors,
|
|
97
|
-
data:
|
|
189
|
+
data: next,
|
|
98
190
|
};
|
|
99
|
-
}
|
|
100
191
|
|
|
101
192
|
return result;
|
|
102
193
|
};
|
|
@@ -106,7 +197,6 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
106
197
|
](
|
|
107
198
|
validate,
|
|
108
199
|
) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
109
|
-
|
|
110
200
|
return {
|
|
111
201
|
protocol: "class",
|
|
112
202
|
name: "Reviewer",
|
|
@@ -118,12 +208,6 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
118
208
|
} satisfies IAutoBeInterfaceSchemasReviewApplication,
|
|
119
209
|
};
|
|
120
210
|
}
|
|
121
|
-
const claude = (validate: Validator) =>
|
|
122
|
-
typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
|
|
123
|
-
validate: {
|
|
124
|
-
review: validate,
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
211
|
|
|
128
212
|
const collection = {
|
|
129
213
|
chatgpt: (validate: Validator) =>
|
|
@@ -132,10 +216,12 @@ const collection = {
|
|
|
132
216
|
review: validate,
|
|
133
217
|
},
|
|
134
218
|
}),
|
|
135
|
-
claude
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
219
|
+
claude: (validate: Validator) =>
|
|
220
|
+
typia.llm.application<IAutoBeInterfaceSchemasReviewApplication, "claude">({
|
|
221
|
+
validate: {
|
|
222
|
+
review: validate,
|
|
223
|
+
},
|
|
224
|
+
}),
|
|
139
225
|
};
|
|
140
226
|
|
|
141
227
|
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>;
|
|
@@ -23,7 +23,7 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
23
23
|
/**
|
|
24
24
|
* Array of API operations to generate.
|
|
25
25
|
*
|
|
26
|
-
* Each operation in this array
|
|
26
|
+
* Each operation in this array includes:
|
|
27
27
|
*
|
|
28
28
|
* - Specification: Detailed API specification with clear purpose and
|
|
29
29
|
* functionality
|
|
@@ -38,7 +38,7 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
38
38
|
* components.schemas
|
|
39
39
|
* - ResponseBody: With typeName referencing appropriate response type
|
|
40
40
|
*
|
|
41
|
-
* All operations
|
|
41
|
+
* All operations follow strict quality standards:
|
|
42
42
|
*
|
|
43
43
|
* 1. Detailed descriptions referencing Prisma schema comments
|
|
44
44
|
* 2. Accurate parameter definitions matching path parameters
|
|
@@ -66,11 +66,10 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
66
66
|
* reason and description fields, making it clear why the API was designed and
|
|
67
67
|
* how it should be used.
|
|
68
68
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* content-type
|
|
72
|
-
*
|
|
73
|
-
* instead of binary data formats.
|
|
69
|
+
* DO: Use object types for all request bodies and responses. DO: Reference
|
|
70
|
+
* named types defined in the components section. DO: Use `application/json`
|
|
71
|
+
* as the content-type. DO: Use `string & tags.Format<"uri">` in the schema
|
|
72
|
+
* for file upload/download operations instead of binary data formats.
|
|
74
73
|
*
|
|
75
74
|
* In OpenAPI, this might represent:
|
|
76
75
|
*
|
|
@@ -88,7 +87,49 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
88
87
|
* ```
|
|
89
88
|
*/
|
|
90
89
|
export interface IOperation
|
|
91
|
-
extends Omit<
|
|
90
|
+
extends Omit<
|
|
91
|
+
AutoBeOpenApi.IOperation,
|
|
92
|
+
"authorizationRole" | "authorizationType"
|
|
93
|
+
> {
|
|
94
|
+
/**
|
|
95
|
+
* Prisma schema models relevant to this operation.
|
|
96
|
+
*
|
|
97
|
+
* Contains the complete Prisma schema definitions for all entities involved
|
|
98
|
+
* in this operation, including their fields, relations, and database
|
|
99
|
+
* constraints. This enables comprehensive validation and schema-aware
|
|
100
|
+
* operation design.
|
|
101
|
+
*
|
|
102
|
+
* The schema information serves multiple critical purposes:
|
|
103
|
+
*
|
|
104
|
+
* - **Field Verification**: Ensures all referenced fields actually exist in
|
|
105
|
+
* the database schema and have the correct types
|
|
106
|
+
* - **Relationship Validation**: Confirms that entity relationships are
|
|
107
|
+
* properly defined and can support the operation's data access patterns
|
|
108
|
+
* - **Soft-Delete Detection**: For DELETE operations, identifies whether
|
|
109
|
+
* entities have soft-delete fields (deleted_at, is_deleted, etc.) to
|
|
110
|
+
* determine if the operation should perform logical deletion instead of
|
|
111
|
+
* physical removal
|
|
112
|
+
* - **Constraint Awareness**: Understands unique constraints, required
|
|
113
|
+
* fields, and default values to generate accurate request/response
|
|
114
|
+
* schemas
|
|
115
|
+
*
|
|
116
|
+
* Example content might include:
|
|
117
|
+
*
|
|
118
|
+
* ```prisma
|
|
119
|
+
* model User {
|
|
120
|
+
* id String @id @default(uuid())
|
|
121
|
+
* email String @unique
|
|
122
|
+
* name String
|
|
123
|
+
* deleted_at DateTime? // Indicates soft-delete capability
|
|
124
|
+
* posts Post[]
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* This schema context ensures operations are fully aligned with the actual
|
|
129
|
+
* database structure and business logic requirements.
|
|
130
|
+
*/
|
|
131
|
+
prisma_schemas: string;
|
|
132
|
+
|
|
92
133
|
/**
|
|
93
134
|
* Authorization roles required to access this API operation.
|
|
94
135
|
*
|
|
@@ -96,16 +137,47 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
96
137
|
* endpoint. Multiple roles can be specified to allow different types of
|
|
97
138
|
* users to access the same endpoint.
|
|
98
139
|
*
|
|
140
|
+
* ## ⚠️ CRITICAL: Role Multiplication Effect
|
|
141
|
+
*
|
|
142
|
+
* **EACH ROLE IN THIS ARRAY GENERATES A SEPARATE ENDPOINT**
|
|
143
|
+
*
|
|
144
|
+
* - If you specify `["admin", "moderator", "member"]`, this creates 3
|
|
145
|
+
* separate endpoints
|
|
146
|
+
* - Total generated endpoints = operations × average roles.length
|
|
147
|
+
* - Example: 100 operations with 3 roles each = 300 actual endpoints
|
|
148
|
+
*
|
|
149
|
+
* ## 🔴 AVOID OVER-GENERATION
|
|
150
|
+
*
|
|
151
|
+
* **DO NOT create role-specific endpoints when a public endpoint would
|
|
152
|
+
* suffice:**
|
|
153
|
+
*
|
|
154
|
+
* - ❌ BAD: Separate GET endpoints for admin, member, moderator to view the
|
|
155
|
+
* same public data
|
|
156
|
+
* - ✅ GOOD: Single public endpoint `[]` with role-based filtering in business
|
|
157
|
+
* logic
|
|
158
|
+
*
|
|
159
|
+
* **DO NOT enumerate all possible roles when the Prisma schema uses a
|
|
160
|
+
* single User table:**
|
|
161
|
+
*
|
|
162
|
+
* - If Prisma has a User table with role/permission fields, you likely only
|
|
163
|
+
* need `["user"]`
|
|
164
|
+
* - Avoid listing `["admin", "seller", "buyer", "moderator", ...]`
|
|
165
|
+
* unnecessarily
|
|
166
|
+
* - The actual role checking happens in business logic, not at the endpoint
|
|
167
|
+
* level
|
|
168
|
+
*
|
|
99
169
|
* ## Naming Convention
|
|
100
170
|
*
|
|
101
|
-
*
|
|
171
|
+
* DO: Use camelCase for all role names.
|
|
102
172
|
*
|
|
103
173
|
* ## Important Guidelines
|
|
104
174
|
*
|
|
105
175
|
* - Set to empty array `[]` for public endpoints that require no
|
|
106
176
|
* authentication
|
|
107
177
|
* - Set to array with role strings for role-restricted endpoints
|
|
108
|
-
* -
|
|
178
|
+
* - **MINIMIZE the number of roles per endpoint to prevent explosion**
|
|
179
|
+
* - Consider if the endpoint can be public with role-based filtering instead
|
|
180
|
+
* - The role names match exactly with the user type/role defined in the
|
|
109
181
|
* database
|
|
110
182
|
* - This will be used by the Realize Agent to generate appropriate decorator
|
|
111
183
|
* and authorization logic in the provider functions
|
|
@@ -114,11 +186,26 @@ export namespace IAutoBeInterfaceOperationApplication {
|
|
|
114
186
|
*
|
|
115
187
|
* ## Examples
|
|
116
188
|
*
|
|
117
|
-
* - `[]` - Public endpoint, no authentication required
|
|
118
|
-
*
|
|
119
|
-
* - `["
|
|
189
|
+
* - `[]` - Public endpoint, no authentication required (PREFERRED for read
|
|
190
|
+
* operations)
|
|
191
|
+
* - `["user"]` - Any authenticated user can access (PREFERRED for
|
|
192
|
+
* user-specific operations)
|
|
193
|
+
* - `["admin"]` - Only admin users can access (USE SPARINGLY)
|
|
120
194
|
* - `["admin", "moderator"]` - Both admin and moderator users can access
|
|
121
|
-
*
|
|
195
|
+
* (AVOID if possible)
|
|
196
|
+
* - `["seller"]` - Only seller users can access (ONLY if Seller is a separate
|
|
197
|
+
* table)
|
|
198
|
+
*
|
|
199
|
+
* ## Best Practices
|
|
200
|
+
*
|
|
201
|
+
* 1. **Start with public `[]` for all read operations** unless sensitive data
|
|
202
|
+
* is involved
|
|
203
|
+
* 2. **Use single role `["user"]` for authenticated operations** and handle
|
|
204
|
+
* permissions in business logic
|
|
205
|
+
* 3. **Only use multiple roles when absolutely necessary** for different
|
|
206
|
+
* business logic paths
|
|
207
|
+
* 4. **Remember: Fewer roles = Fewer endpoints = Better performance and
|
|
208
|
+
* maintainability**
|
|
122
209
|
*
|
|
123
210
|
* Note: The actual authentication/authorization implementation will be
|
|
124
211
|
* handled by decorators at the controller level, and the provider function
|
|
@@ -97,6 +97,82 @@ export namespace IAutoBeInterfaceOperationsReviewApplication {
|
|
|
97
97
|
* operations unchanged. These operations are validated and ready for schema
|
|
98
98
|
* generation and subsequent implementation phases.
|
|
99
99
|
*/
|
|
100
|
-
content:
|
|
100
|
+
content: IOperation[];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Operation of the Restful API.
|
|
105
|
+
*
|
|
106
|
+
* This interface defines a single API endpoint with its HTTP {@link method},
|
|
107
|
+
* {@link path}, {@link parameters path parameters},
|
|
108
|
+
* {@link requestBody request body}, and {@link responseBody} structure. It
|
|
109
|
+
* corresponds to an individual operation in the paths section of an OpenAPI
|
|
110
|
+
* document.
|
|
111
|
+
*
|
|
112
|
+
* Each operation requires a detailed explanation of its purpose through the
|
|
113
|
+
* reason and description fields, making it clear why the API was designed and
|
|
114
|
+
* how it should be used.
|
|
115
|
+
*
|
|
116
|
+
* All request bodies and responses for this operation must be object types
|
|
117
|
+
* and must reference named types defined in the components section. The
|
|
118
|
+
* content-type is always `application/json`. For file upload/download
|
|
119
|
+
* operations, use `string & tags.Format<"uri">` in the appropriate schema
|
|
120
|
+
* instead of binary data formats.
|
|
121
|
+
*
|
|
122
|
+
* In OpenAPI, this might represent:
|
|
123
|
+
*
|
|
124
|
+
* ```json
|
|
125
|
+
* {
|
|
126
|
+
* "/shoppings/customers/orders": {
|
|
127
|
+
* "post": {
|
|
128
|
+
* "description": "Create a new order application from shopping cart...",
|
|
129
|
+
* "parameters": [...],
|
|
130
|
+
* "requestBody": {...},
|
|
131
|
+
* "responses": {...}
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export interface IOperation
|
|
138
|
+
extends Omit<AutoBeOpenApi.IOperation, "authorizationType"> {
|
|
139
|
+
/**
|
|
140
|
+
* Prisma schema models relevant to this operation.
|
|
141
|
+
*
|
|
142
|
+
* Contains the complete Prisma schema definitions for all entities involved
|
|
143
|
+
* in this operation, including their fields, relations, and database
|
|
144
|
+
* constraints. This enables comprehensive validation and schema-aware
|
|
145
|
+
* operation design.
|
|
146
|
+
*
|
|
147
|
+
* The schema information serves multiple critical purposes:
|
|
148
|
+
*
|
|
149
|
+
* - **Field Verification**: Ensures all referenced fields actually exist in
|
|
150
|
+
* the database schema and have the correct types
|
|
151
|
+
* - **Relationship Validation**: Confirms that entity relationships are
|
|
152
|
+
* properly defined and can support the operation's data access patterns
|
|
153
|
+
* - **Soft-Delete Detection**: For DELETE operations, identifies whether
|
|
154
|
+
* entities have soft-delete fields (deleted_at, is_deleted, etc.) to
|
|
155
|
+
* determine if the operation should perform logical deletion instead of
|
|
156
|
+
* physical removal
|
|
157
|
+
* - **Constraint Awareness**: Understands unique constraints, required
|
|
158
|
+
* fields, and default values to generate accurate request/response
|
|
159
|
+
* schemas
|
|
160
|
+
*
|
|
161
|
+
* Example content might include:
|
|
162
|
+
*
|
|
163
|
+
* ```prisma
|
|
164
|
+
* model User {
|
|
165
|
+
* id String @id @default(uuid())
|
|
166
|
+
* email String @unique
|
|
167
|
+
* name String
|
|
168
|
+
* deleted_at DateTime? // Indicates soft-delete capability
|
|
169
|
+
* posts Post[]
|
|
170
|
+
* }
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* This schema context ensures operations are fully aligned with the actual
|
|
174
|
+
* database structure and business logic requirements.
|
|
175
|
+
*/
|
|
176
|
+
prisma_schemas: string;
|
|
101
177
|
}
|
|
102
178
|
}
|