@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,13 +2,14 @@ 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";
|
|
10
|
+
import { v7 } from "uuid";
|
|
9
11
|
|
|
10
12
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
11
|
-
import { IProgress } from "../internal/IProgress";
|
|
12
13
|
import { transformInterfaceOperationsReviewHistories } from "./histories/transformInterfaceOperationsReviewHistories";
|
|
13
14
|
import { IAutoBeInterfaceOperationsReviewApplication } from "./structures/IAutoBeInterfaceOperationsReviewApplication";
|
|
14
15
|
|
|
@@ -17,39 +18,57 @@ export async function orchestrateInterfaceOperationsReview<
|
|
|
17
18
|
>(
|
|
18
19
|
ctx: AutoBeContext<Model>,
|
|
19
20
|
operations: AutoBeOpenApi.IOperation[],
|
|
20
|
-
progress:
|
|
21
|
+
progress: AutoBeProgressEventBase,
|
|
21
22
|
): Promise<AutoBeOpenApi.IOperation[]> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
try {
|
|
24
|
+
const pointer: IPointer<IAutoBeInterfaceOperationsReviewApplication.IProps | null> =
|
|
25
|
+
{
|
|
26
|
+
value: null,
|
|
27
|
+
};
|
|
28
|
+
const { tokenUsage } = await ctx.conversate({
|
|
29
|
+
source: "interfaceOperationsReview",
|
|
30
|
+
histories: transformInterfaceOperationsReviewHistories(ctx, operations),
|
|
31
|
+
controller: createReviewController({
|
|
32
|
+
model: ctx.model,
|
|
33
|
+
build: (next: IAutoBeInterfaceOperationsReviewApplication.IProps) => {
|
|
34
|
+
pointer.value = next;
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
enforceFunctionCall: false,
|
|
38
|
+
message: "Review the operations",
|
|
39
|
+
});
|
|
40
|
+
if (pointer.value === null) {
|
|
41
|
+
console.error("Failed to review operations.");
|
|
42
|
+
progress.completed += operations.length;
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const content: AutoBeOpenApi.IOperation[] = pointer.value.content.map(
|
|
47
|
+
(op) => ({
|
|
48
|
+
...op,
|
|
49
|
+
authorizationType: null,
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
39
52
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
ctx.dispatch({
|
|
54
|
+
type: "interfaceOperationsReview",
|
|
55
|
+
id: v7(),
|
|
56
|
+
operations: content,
|
|
57
|
+
review: pointer.value.review,
|
|
58
|
+
plan: pointer.value.plan,
|
|
59
|
+
content,
|
|
60
|
+
tokenUsage,
|
|
61
|
+
created_at: new Date().toISOString(),
|
|
62
|
+
step: ctx.state().analyze?.step ?? 0,
|
|
63
|
+
total: progress.total,
|
|
64
|
+
completed: ++progress.completed,
|
|
65
|
+
} satisfies AutoBeInterfaceOperationsReviewEvent);
|
|
66
|
+
return content;
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error("Error occurred during interface operations review:", error);
|
|
69
|
+
++progress.completed;
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
53
72
|
}
|
|
54
73
|
|
|
55
74
|
function createReviewController<Model extends ILlmSchema.Model>(props: {
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
AutoBeInterfaceSchemasEvent,
|
|
4
|
+
AutoBeOpenApi,
|
|
5
|
+
AutoBeProgressEventBase,
|
|
6
|
+
} from "@autobe/interface";
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
8
|
+
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
4
9
|
import { OpenApiV3_1Emender } from "@samchon/openapi/lib/converters/OpenApiV3_1Emender";
|
|
5
10
|
import { IPointer } from "tstl";
|
|
6
|
-
import typia from "typia";
|
|
11
|
+
import typia, { tags } from "typia";
|
|
12
|
+
import { v7 } from "uuid";
|
|
7
13
|
|
|
8
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
9
15
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
10
16
|
import { divideArray } from "../../utils/divideArray";
|
|
11
|
-
import {
|
|
17
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
12
18
|
import { transformInterfaceSchemaHistories } from "./histories/transformInterfaceSchemaHistories";
|
|
13
19
|
import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
|
|
14
20
|
import { IAutoBeInterfaceSchemaApplication } from "./structures/IAutoBeInterfaceSchemaApplication";
|
|
21
|
+
import { validateAuthorizationSchema } from "./utils/validateAuthorizationSchema";
|
|
15
22
|
|
|
16
23
|
export async function orchestrateInterfaceSchemas<
|
|
17
24
|
Model extends ILlmSchema.Model,
|
|
18
25
|
>(
|
|
19
26
|
ctx: AutoBeContext<Model>,
|
|
20
27
|
operations: AutoBeOpenApi.IOperation[],
|
|
21
|
-
capacity: number =
|
|
28
|
+
capacity: number = 8,
|
|
22
29
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
23
30
|
const typeNames: Set<string> = new Set();
|
|
24
31
|
for (const op of operations) {
|
|
@@ -29,29 +36,47 @@ export async function orchestrateInterfaceSchemas<
|
|
|
29
36
|
array: Array.from(typeNames),
|
|
30
37
|
capacity,
|
|
31
38
|
});
|
|
32
|
-
const progress:
|
|
39
|
+
const progress: AutoBeProgressEventBase = {
|
|
33
40
|
total: typeNames.size,
|
|
34
41
|
completed: 0,
|
|
35
42
|
};
|
|
36
|
-
const reviewProgress:
|
|
43
|
+
const reviewProgress: AutoBeProgressEventBase = {
|
|
37
44
|
total: matrix.length,
|
|
38
45
|
completed: 0,
|
|
39
46
|
};
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
const roles: string[] =
|
|
48
|
+
ctx.state().analyze?.roles.map((role) => role.name) ?? [];
|
|
49
|
+
|
|
50
|
+
const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
51
|
+
roles.length > 0
|
|
52
|
+
? {
|
|
53
|
+
IAuthorizationToken: authTokenSchema,
|
|
54
|
+
}
|
|
55
|
+
: {};
|
|
56
|
+
for (const y of await executeCachedBatch(
|
|
57
|
+
matrix.map((it) => async (promptCacheKey) => {
|
|
43
58
|
const row: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
44
|
-
await divideAndConquer(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
await divideAndConquer(
|
|
60
|
+
ctx,
|
|
61
|
+
operations,
|
|
62
|
+
it,
|
|
63
|
+
3,
|
|
64
|
+
progress,
|
|
65
|
+
promptCacheKey,
|
|
66
|
+
);
|
|
67
|
+
const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
68
|
+
await orchestrateInterfaceSchemasReview(
|
|
69
|
+
ctx,
|
|
70
|
+
operations,
|
|
71
|
+
row,
|
|
72
|
+
reviewProgress,
|
|
73
|
+
);
|
|
74
|
+
return { ...row, ...newbie };
|
|
51
75
|
}),
|
|
52
76
|
)) {
|
|
53
77
|
Object.assign(x, y);
|
|
54
78
|
}
|
|
79
|
+
if (x.IAuthorizationToken) x.IAuthorizationToken = authTokenSchema;
|
|
55
80
|
return x;
|
|
56
81
|
}
|
|
57
82
|
|
|
@@ -60,14 +85,22 @@ async function divideAndConquer<Model extends ILlmSchema.Model>(
|
|
|
60
85
|
operations: AutoBeOpenApi.IOperation[],
|
|
61
86
|
typeNames: string[],
|
|
62
87
|
retry: number,
|
|
63
|
-
progress:
|
|
88
|
+
progress: AutoBeProgressEventBase,
|
|
89
|
+
promptCacheKey: string,
|
|
64
90
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
65
91
|
const remained: Set<string> = new Set(typeNames);
|
|
66
92
|
const schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
|
|
67
93
|
for (let i: number = 0; i < retry; ++i) {
|
|
68
94
|
if (remained.size === 0) break;
|
|
69
95
|
const newbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> =
|
|
70
|
-
await process(
|
|
96
|
+
await process(
|
|
97
|
+
ctx,
|
|
98
|
+
operations,
|
|
99
|
+
schemas,
|
|
100
|
+
remained,
|
|
101
|
+
progress,
|
|
102
|
+
promptCacheKey,
|
|
103
|
+
);
|
|
71
104
|
for (const key of Object.keys(newbie)) {
|
|
72
105
|
schemas[key] = newbie[key];
|
|
73
106
|
remained.delete(key);
|
|
@@ -81,7 +114,8 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
81
114
|
operations: AutoBeOpenApi.IOperation[],
|
|
82
115
|
oldbie: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
|
|
83
116
|
remained: Set<string>,
|
|
84
|
-
progress:
|
|
117
|
+
progress: AutoBeProgressEventBase,
|
|
118
|
+
promptCacheKey: string,
|
|
85
119
|
): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>> {
|
|
86
120
|
const already: string[] = Object.keys(oldbie);
|
|
87
121
|
const pointer: IPointer<Record<
|
|
@@ -102,25 +136,29 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
102
136
|
pointer,
|
|
103
137
|
}),
|
|
104
138
|
enforceFunctionCall: true,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
139
|
+
promptCacheKey,
|
|
140
|
+
message: StringUtil.trim`
|
|
141
|
+
Make type components please.
|
|
142
|
+
|
|
143
|
+
Here is the list of request/response bodies' type names from
|
|
144
|
+
OpenAPI operations. Make type components of them. If more object
|
|
145
|
+
types are required during making the components, please make them
|
|
146
|
+
too.
|
|
147
|
+
|
|
148
|
+
${Array.from(remained)
|
|
149
|
+
.map((k) => ` - \`${k}\``)
|
|
150
|
+
.join("\n")}${
|
|
151
|
+
already.length !== 0
|
|
152
|
+
? StringUtil.trim`
|
|
153
|
+
|
|
154
|
+
> By the way, here is the list of components schemas what you've
|
|
155
|
+
> already made. So, you don't need to make them again.
|
|
156
|
+
>
|
|
157
|
+
${already.map((k) => `> - \`${k}\``).join("\n")}
|
|
158
|
+
`
|
|
159
|
+
: ""
|
|
160
|
+
}
|
|
161
|
+
`,
|
|
124
162
|
});
|
|
125
163
|
if (pointer.value === null) throw new Error("Failed to create components.");
|
|
126
164
|
|
|
@@ -132,12 +170,13 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
132
170
|
).schemas ?? {};
|
|
133
171
|
ctx.dispatch({
|
|
134
172
|
type: "interfaceSchemas",
|
|
173
|
+
id: v7(),
|
|
135
174
|
schemas,
|
|
136
175
|
tokenUsage,
|
|
137
|
-
completed: (progress.completed += Object.keys(schemas).
|
|
138
|
-
|
|
176
|
+
completed: (progress.completed += Object.keys(schemas).length),
|
|
177
|
+
total: (progress.total += Object.keys(schemas).filter(
|
|
178
|
+
(k) => remained.has(k) === false,
|
|
139
179
|
).length),
|
|
140
|
-
total: progress.total,
|
|
141
180
|
step: ctx.state().prisma?.step ?? 0,
|
|
142
181
|
created_at: new Date().toISOString(),
|
|
143
182
|
} satisfies AutoBeInterfaceSchemasEvent);
|
|
@@ -156,9 +195,34 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
156
195
|
}): IAgenticaController.IClass<Model> {
|
|
157
196
|
assertSchemaModel(props.model);
|
|
158
197
|
|
|
198
|
+
const validate = (
|
|
199
|
+
next: unknown,
|
|
200
|
+
): IValidation<IAutoBeInterfaceSchemaApplication.IProps> => {
|
|
201
|
+
const result: IValidation<IAutoBeInterfaceSchemaApplication.IProps> =
|
|
202
|
+
typia.validate<IAutoBeInterfaceSchemaApplication.IProps>(next);
|
|
203
|
+
if (result.success === false) return result;
|
|
204
|
+
|
|
205
|
+
// Check all IAuthorized types
|
|
206
|
+
const errors: IValidation.IError[] = [];
|
|
207
|
+
validateAuthorizationSchema({
|
|
208
|
+
errors,
|
|
209
|
+
schemas: result.data.schemas,
|
|
210
|
+
path: "$input.schemas",
|
|
211
|
+
});
|
|
212
|
+
if (errors.length !== 0)
|
|
213
|
+
return {
|
|
214
|
+
success: false,
|
|
215
|
+
errors,
|
|
216
|
+
data: next,
|
|
217
|
+
};
|
|
218
|
+
return result;
|
|
219
|
+
};
|
|
220
|
+
|
|
159
221
|
const application: ILlmApplication<Model> = collection[
|
|
160
|
-
props.model
|
|
161
|
-
]
|
|
222
|
+
props.model === "chatgpt" ? "chatgpt" : "claude"
|
|
223
|
+
](
|
|
224
|
+
validate,
|
|
225
|
+
) satisfies ILlmApplication<any> as unknown as ILlmApplication<Model>;
|
|
162
226
|
return {
|
|
163
227
|
protocol: "class",
|
|
164
228
|
name: "interface",
|
|
@@ -171,17 +235,71 @@ function createController<Model extends ILlmSchema.Model>(props: {
|
|
|
171
235
|
};
|
|
172
236
|
}
|
|
173
237
|
|
|
174
|
-
const claude = typia.llm.application<
|
|
175
|
-
IAutoBeInterfaceSchemaApplication,
|
|
176
|
-
"claude"
|
|
177
|
-
>();
|
|
178
238
|
const collection = {
|
|
179
|
-
chatgpt:
|
|
180
|
-
IAutoBeInterfaceSchemaApplication,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
239
|
+
chatgpt: (validate: Validator) =>
|
|
240
|
+
typia.llm.application<IAutoBeInterfaceSchemaApplication, "chatgpt">({
|
|
241
|
+
validate: {
|
|
242
|
+
makeComponents: validate,
|
|
243
|
+
},
|
|
244
|
+
}),
|
|
245
|
+
claude: (validate: Validator) =>
|
|
246
|
+
typia.llm.application<IAutoBeInterfaceSchemaApplication, "claude">({
|
|
247
|
+
validate: {
|
|
248
|
+
makeComponents: validate,
|
|
249
|
+
},
|
|
250
|
+
}),
|
|
187
251
|
};
|
|
252
|
+
|
|
253
|
+
type Validator = (
|
|
254
|
+
input: unknown,
|
|
255
|
+
) => IValidation<IAutoBeInterfaceSchemaApplication.IProps>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Authorization token response structure.
|
|
259
|
+
*
|
|
260
|
+
* This interface defines the structure of the authorization token response
|
|
261
|
+
* returned after successful user authentication. It contains both access and
|
|
262
|
+
* refresh tokens along with their expiration information.
|
|
263
|
+
*
|
|
264
|
+
* This token structure is automatically included in API schemas when the system
|
|
265
|
+
* detects authorization roles in the requirements analysis phase. It provides a
|
|
266
|
+
* standard format for JWT-based authentication across the generated backend
|
|
267
|
+
* applications.
|
|
268
|
+
*/
|
|
269
|
+
interface IAuthorizationToken {
|
|
270
|
+
/**
|
|
271
|
+
* JWT access token for authenticated requests.
|
|
272
|
+
*
|
|
273
|
+
* This token should be included in the Authorization header for subsequent
|
|
274
|
+
* authenticated API requests as `Bearer {token}`.
|
|
275
|
+
*/
|
|
276
|
+
access: string;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Refresh token for obtaining new access tokens.
|
|
280
|
+
*
|
|
281
|
+
* This token can be used to request new access tokens when the current access
|
|
282
|
+
* token expires, extending the user's session.
|
|
283
|
+
*/
|
|
284
|
+
refresh: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Access token expiration timestamp.
|
|
288
|
+
*
|
|
289
|
+
* ISO 8601 date-time string indicating when the access token will expire and
|
|
290
|
+
* can no longer be used for authentication.
|
|
291
|
+
*/
|
|
292
|
+
expired_at: string & tags.Format<"date-time">;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Refresh token expiration timestamp.
|
|
296
|
+
*
|
|
297
|
+
* ISO 8601 date-time string indicating the latest time until which the
|
|
298
|
+
* refresh token can be used to obtain new access tokens.
|
|
299
|
+
*/
|
|
300
|
+
refreshable_until: string & tags.Format<"date-time">;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const authTokenSchema: AutoBeOpenApi.IJsonSchemaDescriptive =
|
|
304
|
+
typia.json.schema<IAuthorizationToken>().components.schemas!
|
|
305
|
+
.IAuthorizationToken as AutoBeOpenApi.IJsonSchemaDescriptive;
|