@autobe/agent 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeAgent.js +5 -0
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +2 -10
- package/lib/agent/src/AutoBeMockAgent.js +7 -2
- package/lib/agent/src/AutoBeMockAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +14 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +10 -0
- package/lib/agent/src/factory/consentFunctionCall.js +212 -0
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +71 -14
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js +4 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +16 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +8 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +7 -7
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +24 -37
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -3
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +1 -0
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +2 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +9 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +29 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +1565 -1142
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +22 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +11 -15
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +32 -26
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +135 -124
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +371 -209
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +185 -179
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +35 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +11 -17
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +13 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +6 -10
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +35 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +44 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +40 -3
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +5 -5
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +278 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +12 -20
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/internal/compile.js +9 -26
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +59 -42
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +6 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +17 -16
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -19
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeCoderApplication.js → IAutoBeRealizeCorrectApplication.js} +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +5 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +95 -50
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +12 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +4 -4
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +119 -16
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/agent/src/orchestrate/{internal/IProgress.js → test/structures/IAutoBeTestScenarioAuthorizationRole.js} +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/agent/src/utils/predicateStateMessage.d.ts +4 -0
- package/lib/agent/src/utils/predicateStateMessage.js +87 -0
- package/lib/agent/src/utils/predicateStateMessage.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +23 -29
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/factory/consentFunctionCall.d.ts +10 -0
- package/lib/index.mjs +3036 -1648
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +3 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +2 -3
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +16 -16
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +2 -3
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +16 -16
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +59 -14
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +37 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +46 -14
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +18 -24
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +7 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +3 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -2
- package/lib/orchestrate/realize/internal/compile.d.ts +3 -3
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +8 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +6 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +19 -16
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +2 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +6 -5
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +6 -0
- package/lib/utils/predicateStateMessage.d.ts +4 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +14 -0
- package/src/AutoBeMockAgent.ts +9 -11
- package/src/constants/AutoBeSystemPromptConstant.ts +23 -29
- package/src/context/AutoBeTokenUsageComponent.ts +20 -0
- package/src/factory/consentFunctionCall.ts +128 -0
- package/src/factory/createAgenticaHistory.ts +1 -0
- package/src/factory/createAutoBeContext.ts +99 -14
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts +11 -4
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +26 -4
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +19 -14
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +3 -3
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +8 -32
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +16 -16
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -10
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterface.ts +51 -12
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +126 -23
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +6 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +32 -27
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -32
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +127 -33
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +67 -65
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +16 -16
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +62 -14
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +38 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +47 -14
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +18 -24
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +41 -0
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +9 -16
- package/src/orchestrate/prisma/orchestratePrisma.ts +15 -6
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -19
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +15 -9
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +1 -1
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +19 -23
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +4 -2
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +285 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -27
- package/src/orchestrate/realize/internal/compile.ts +28 -45
- package/src/orchestrate/realize/orchestrateRealize.ts +71 -67
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +19 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +23 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +19 -16
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +7 -0
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +110 -59
- package/src/orchestrate/test/orchestrateTest.ts +12 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +155 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +6 -5
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +1 -1
- package/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.ts +7 -0
- package/src/utils/predicateStateMessage.ts +107 -0
- package/lib/agent/src/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/agent/src/orchestrate/internal/IProgress.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js +0 -213
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCoderHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js +0 -3
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeReviewApplication.js.map +0 -1
- package/lib/agent/src/utils/pipe.d.ts +0 -5
- package/lib/agent/src/utils/pipe.js +0 -14
- package/lib/agent/src/utils/pipe.js.map +0 -1
- package/lib/orchestrate/internal/IProgress.d.ts +0 -4
- package/lib/orchestrate/realize/histories/transformRealizeCoderHistories.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +0 -345
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +0 -56
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +0 -2
- package/lib/utils/pipe.d.ts +0 -5
- package/src/orchestrate/internal/IProgress.ts +0 -4
- package/src/orchestrate/realize/histories/transformRealizeCoderHistories.ts +0 -248
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +0 -358
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +0 -70
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +0 -2
- package/src/utils/pipe.ts +0 -39
- /package/lib/agent/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/lib/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.d.ts → IAutoBeRealizeCorrectApplication.d.ts} +0 -0
- /package/src/orchestrate/realize/structures/{IAutoBeRealizeReviewApplication.ts → IAutoBeRealizeCorrectApplication.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformRealizeWriteHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/histories/transformRealizeWriteHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;
|
|
1
|
+
{"version":3,"file":"transformRealizeWriteHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/histories/transformRealizeWriteHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAM1B,iHAA8G;AAEvG,MAAM,8BAA8B,GAAG,CAC5C,KAAa,EAGb,EAAE;;IACF,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CACjC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC;QACpC,EAAE,CAAC,OAAO,CAAC,QAAQ;QACnB,EAAE,CAAC,OAAO,CAAC,OAAO;KACnB,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC;IAExD,MAAM,WAAW,GAAa,EAA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;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,4BAA4B;gBAC5B,EAAE;gBACF,eAAe;gBACf,kFAAkF;gBAClF,mGAAmG;gBACnG,kHAAkH;gBAClH,4GAA4G;gBAC5G,EAAE;gBACF,2KAA2K;gBAC3K,EAAE;gBACF,qFAAqF;aACtF,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AArKW,QAAA,8BAA8B,kCAqKzC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AutoBeRealizeAuthorization,
|
|
1
|
+
import { AutoBeRealizeAuthorization, AutoBeRealizeFunction, IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
4
4
|
export declare function compile<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
|
|
5
5
|
authorizations: AutoBeRealizeAuthorization[];
|
|
6
|
-
|
|
7
|
-
}): Promise<IAutoBeTypeScriptCompileResult
|
|
6
|
+
functions: AutoBeRealizeFunction[];
|
|
7
|
+
}): Promise<IAutoBeTypeScriptCompileResult>;
|
|
@@ -15,15 +15,19 @@ function compile(ctx, props) {
|
|
|
15
15
|
var _a, _b, _c;
|
|
16
16
|
const prisma = (_a = ctx.state().prisma) === null || _a === void 0 ? void 0 : _a.compiled;
|
|
17
17
|
const payloads = Object.fromEntries(props.authorizations.map((el) => [el.payload.location, el.payload.content]));
|
|
18
|
-
const templateFiles = yield getTemplates(ctx);
|
|
19
|
-
const nodeModules = (prisma === null || prisma === void 0 ? void 0 : prisma.type) === "success" ? prisma.nodeModules : {};
|
|
20
18
|
const compiler = yield ctx.compiler();
|
|
19
|
+
const templateFiles = yield compiler.realize.getTemplate();
|
|
20
|
+
const nodeModules = (prisma === null || prisma === void 0 ? void 0 : prisma.type) === "success" ? prisma.nodeModules : {};
|
|
21
|
+
const filterTsFiles = (location) => location.endsWith(".ts");
|
|
22
|
+
const files = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, nodeModules), payloads), Object.fromEntries(Object.entries(yield ctx.files({ dbms: "sqlite" })).filter(([key]) => filterTsFiles(key)))), Object.fromEntries(Object.entries(templateFiles).filter(([key]) => filterTsFiles(key)))), Object.fromEntries(props.functions.map((el) => [el.location, el.content])));
|
|
21
23
|
const compiled = yield compiler.typescript.compile({
|
|
22
|
-
files:
|
|
24
|
+
files: files,
|
|
23
25
|
});
|
|
24
26
|
if (compiled.type === "success") {
|
|
25
27
|
return compiled;
|
|
26
28
|
}
|
|
29
|
+
else if (compiled.type === "failure") {
|
|
30
|
+
}
|
|
27
31
|
const event = {
|
|
28
32
|
type: "realizeValidate",
|
|
29
33
|
result: compiled,
|
|
@@ -33,29 +37,8 @@ function compile(ctx, props) {
|
|
|
33
37
|
step: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
34
38
|
created_at: new Date().toISOString(),
|
|
35
39
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Loads template files for the realize agent These files are essential for the
|
|
41
|
-
* realize coder to pass compilation
|
|
42
|
-
*
|
|
43
|
-
* @param ctx Context of agent
|
|
44
|
-
* @returns Template file infomations
|
|
45
|
-
*/
|
|
46
|
-
function getTemplates(ctx) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const compiler = yield ctx.compiler();
|
|
49
|
-
const templateFiles = yield compiler.realize.getTemplate();
|
|
50
|
-
const pathnames = ["src/MyGlobal.ts", "src/util/toISOStringSafe.ts"];
|
|
51
|
-
return pathnames.map((pathname) => {
|
|
52
|
-
return {
|
|
53
|
-
content: templateFiles[pathname],
|
|
54
|
-
result: "success",
|
|
55
|
-
location: pathname,
|
|
56
|
-
role: null, // template files doesn't have role.
|
|
57
|
-
};
|
|
58
|
-
});
|
|
40
|
+
ctx.dispatch(event);
|
|
41
|
+
return compiled;
|
|
59
42
|
});
|
|
60
43
|
}
|
|
61
44
|
//# sourceMappingURL=compile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/internal/compile.ts"],"names":[],"mappings":";;;;;;;;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/internal/compile.ts"],"names":[],"mappings":";;;;;;;;;;;AAUA,0BAwDC;AAxDD,SAAsB,OAAO,CAC3B,GAAyB,EACzB,KAGC;;;QAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,0CAAE,QAAQ,CAAC;QAC5C,MAAM,QAAQ,GAA2B,MAAM,CAAC,WAAW,CACzD,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAC5E,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3D,MAAM,WAAW,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzE,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,C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,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;YACpC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC;QACF,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAEpB,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA"}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.orchestrateRealize = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const uuid_1 = require("uuid");
|
|
14
|
+
const predicateStateMessage_1 = require("../../utils/predicateStateMessage");
|
|
15
15
|
const compile_1 = require("./internal/compile");
|
|
16
16
|
const orchestrateRealizeAuthorization_1 = require("./orchestrateRealizeAuthorization");
|
|
17
17
|
const orchestrateRealizeCorrect_1 = require("./orchestrateRealizeCorrect");
|
|
@@ -19,72 +19,96 @@ const orchestrateRealizeScenario_1 = require("./orchestrateRealizeScenario");
|
|
|
19
19
|
const orchestrateRealizeWrite_1 = require("./orchestrateRealizeWrite");
|
|
20
20
|
const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
21
|
var _a, _b, _c, _d, _e;
|
|
22
|
+
// PREDICATION
|
|
22
23
|
const operations = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document.operations;
|
|
23
|
-
if (!operations)
|
|
24
|
+
if (!operations)
|
|
24
25
|
throw new Error("Can't do realize agent because operations are nothing.");
|
|
25
|
-
}
|
|
26
26
|
const start = new Date();
|
|
27
|
+
const predicate = (0, predicateStateMessage_1.predicateStateMessage)(ctx.state(), "realize");
|
|
28
|
+
if (predicate !== null)
|
|
29
|
+
return ctx.assistantMessage({
|
|
30
|
+
type: "assistantMessage",
|
|
31
|
+
id: (0, uuid_1.v4)(),
|
|
32
|
+
created_at: start.toISOString(),
|
|
33
|
+
text: predicate,
|
|
34
|
+
completed_at: new Date().toISOString(),
|
|
35
|
+
});
|
|
27
36
|
ctx.dispatch({
|
|
28
37
|
type: "realizeStart",
|
|
29
38
|
created_at: start.toISOString(),
|
|
30
39
|
reason: props.reason,
|
|
31
40
|
step: (_c = (_b = ctx.state().test) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
32
41
|
});
|
|
42
|
+
// AUTHORIZATIONS
|
|
33
43
|
const authorizations = yield (0, orchestrateRealizeAuthorization_1.orchestrateRealizeAuthorization)(ctx);
|
|
34
|
-
|
|
44
|
+
// SCENARIOS
|
|
45
|
+
const scenarios = operations.map((operation) => {
|
|
46
|
+
const authorization = authorizations.find((el) => el.role.name === operation.authorizationRole);
|
|
47
|
+
return (0, orchestrateRealizeScenario_1.orchestrateRealizeScenario)(ctx, operation, authorization);
|
|
48
|
+
});
|
|
35
49
|
const writeProgress = { total: scenarios.length, completed: 0 };
|
|
36
50
|
const writeEvents = yield Promise.all(scenarios.map((scenario) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
51
|
var _a;
|
|
38
|
-
const code = (0, orchestrateRealizeWrite_1.orchestrateRealizeWrite)(ctx,
|
|
52
|
+
const code = (0, orchestrateRealizeWrite_1.orchestrateRealizeWrite)(ctx, {
|
|
53
|
+
totalAuthorizations: authorizations,
|
|
54
|
+
authorization: (_a = scenario.decoratorEvent) !== null && _a !== void 0 ? _a : null,
|
|
55
|
+
scenario,
|
|
56
|
+
progress: writeProgress,
|
|
57
|
+
});
|
|
39
58
|
return code;
|
|
40
59
|
})));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
const functions = Object.entries(Object.fromEntries(writeEvents.map((event) => [event.location, event.content]))).map(([location, content]) => {
|
|
61
|
+
const scenario = scenarios.find((el) => el.location === location);
|
|
62
|
+
return {
|
|
63
|
+
location,
|
|
64
|
+
content,
|
|
65
|
+
endpoint: {
|
|
66
|
+
method: scenario.operation.method,
|
|
67
|
+
path: scenario.operation.path,
|
|
68
|
+
},
|
|
69
|
+
name: scenario.functionName,
|
|
70
|
+
};
|
|
45
71
|
});
|
|
46
|
-
|
|
72
|
+
let compilation = yield (0, compile_1.compile)(ctx, { authorizations, functions });
|
|
73
|
+
if (compilation.type !== "success") {
|
|
47
74
|
const MAX_CORRECTION_ATTEMPTS = 3;
|
|
48
75
|
const reviewProgress = {
|
|
49
76
|
total: writeEvents.length,
|
|
50
77
|
completed: writeEvents.length,
|
|
51
78
|
};
|
|
52
79
|
for (let attempt = 0; attempt < MAX_CORRECTION_ATTEMPTS; attempt++) {
|
|
53
|
-
if (
|
|
54
|
-
const failedFiles =
|
|
80
|
+
if (compilation.type === "failure") {
|
|
81
|
+
const failedFiles = Object.fromEntries(compilation.type === "failure"
|
|
82
|
+
? compilation.diagnostics.map((d) => [d.file, d.code])
|
|
83
|
+
: []);
|
|
55
84
|
reviewProgress.total += Object.keys(failedFiles).length;
|
|
56
|
-
const
|
|
85
|
+
const failure = compilation;
|
|
57
86
|
yield Promise.all(Object.entries(failedFiles).map((_a) => __awaiter(void 0, [_a], void 0, function* ([location, content]) {
|
|
58
87
|
var _b;
|
|
59
|
-
const diagnostic =
|
|
88
|
+
const diagnostic = failure.diagnostics.find((el) => el.file === location);
|
|
60
89
|
const scenario = scenarios.find((el) => el.location === location);
|
|
61
90
|
if (diagnostic && scenario) {
|
|
62
|
-
const correctEvent = yield (0, orchestrateRealizeCorrect_1.orchestrateRealizeCorrect)(ctx,
|
|
63
|
-
|
|
91
|
+
const correctEvent = yield (0, orchestrateRealizeCorrect_1.orchestrateRealizeCorrect)(ctx, {
|
|
92
|
+
totalAuthorizations: authorizations,
|
|
93
|
+
authorization: (_b = scenario.decoratorEvent) !== null && _b !== void 0 ? _b : null,
|
|
94
|
+
scenario,
|
|
95
|
+
code: content,
|
|
96
|
+
diagnostic,
|
|
97
|
+
progress: reviewProgress,
|
|
98
|
+
});
|
|
99
|
+
const corrected = functions.find((el) => el.location === correctEvent.location);
|
|
100
|
+
if (corrected) {
|
|
101
|
+
corrected.content = correctEvent.content;
|
|
102
|
+
}
|
|
64
103
|
}
|
|
65
104
|
})));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
providers,
|
|
69
|
-
});
|
|
70
|
-
if (finalCompilationResult.type === "success") {
|
|
105
|
+
compilation = yield (0, compile_1.compile)(ctx, { authorizations, functions });
|
|
106
|
+
if (compilation.type === "success") {
|
|
71
107
|
break;
|
|
72
108
|
}
|
|
73
109
|
}
|
|
74
110
|
}
|
|
75
111
|
}
|
|
76
|
-
const functions = Object.entries(providers).map(([location, content]) => {
|
|
77
|
-
const scenario = scenarios.find((el) => el.location === location);
|
|
78
|
-
return {
|
|
79
|
-
location,
|
|
80
|
-
content,
|
|
81
|
-
endpoint: {
|
|
82
|
-
method: scenario.operation.method,
|
|
83
|
-
path: scenario.operation.path,
|
|
84
|
-
},
|
|
85
|
-
name: scenario.functionName,
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
112
|
const compiler = yield ctx.compiler();
|
|
89
113
|
const controllers = yield compiler.realize.controller({
|
|
90
114
|
document: ctx.state().interface.document,
|
|
@@ -97,14 +121,7 @@ const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0,
|
|
|
97
121
|
functions,
|
|
98
122
|
authorizations,
|
|
99
123
|
controllers,
|
|
100
|
-
compiled: yield
|
|
101
|
-
files: Object.assign(Object.assign({}, (yield (0, getAutoBeGenerated_1.getAutoBeGenerated)(compiler, ctx.state(), ctx.histories(), ctx.usage()))), (yield (0, getAutoBeRealizeGenerated_1.getAutoBeRealizeGenerated)({
|
|
102
|
-
document: ctx.state().interface.document,
|
|
103
|
-
authorizations,
|
|
104
|
-
functions,
|
|
105
|
-
compiler,
|
|
106
|
-
}))),
|
|
107
|
-
}),
|
|
124
|
+
compiled: yield (0, compile_1.compile)(ctx, { authorizations, functions }),
|
|
108
125
|
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
109
126
|
elapsed: new Date().getTime() - start.getTime(),
|
|
110
127
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,+BAA0B;AAI1B,6EAA0E;AAC1E,gDAA6C;AAC7C,uFAAoF;AACpF,2EAAwE;AACxE,6EAA0E;AAC1E,uEAAoE;AAG7D,MAAM,kBAAkB,GAC7B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EACiC,EAAE;;IACjE,cAAc;IACd,MAAM,UAAU,GACd,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC;IAC7C,IAAI,CAAC,UAAU;QACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAE5E,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAkB,IAAA,6CAAqB,EACpD,GAAG,CAAC,KAAK,EAAE,EACX,SAAS,CACV,CAAC;IACF,IAAI,SAAS,KAAK,IAAI;QACpB,OAAO,GAAG,CAAC,gBAAgB,CAAC;YAC1B,IAAI,EAAE,kBAAkB;YACxB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;YAC/B,IAAI,EAAE,SAAS;YACf,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACvC,CAAC,CAAC;IACL,GAAG,CAAC,QAAQ,CAAC;QACX,IAAI,EAAE,cAAc;QACpB,UAAU,EAA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C;IACH,CAAC;IAED,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvD,MAAM,WAAW,GACf,MAAM,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;QAChC,QAAQ,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,SAAU,CAAC,QAAQ;QACzC,SAAS;QACT,cAAc;KACf,CAAC,CAAC;IAEL,OAAO,GAAG,CAAC,QAAQ,CAAC;QAClB,IAAI,EAAE,iBAAiB;QACvB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,SAAS;QACT,cAAc;QACd,WAAW;QACX,QAAQ,EAAE,MAAM,IAAA,iBAAO,EAAC,GAAG,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;QAC3D,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;QACpC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAxJS,QAAA,kBAAkB,sBAwJ3B"}
|
|
@@ -188,7 +188,7 @@ const claude = {
|
|
|
188
188
|
type: "object",
|
|
189
189
|
properties: {
|
|
190
190
|
name: {
|
|
191
|
-
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\
|
|
191
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.",
|
|
192
192
|
type: "string",
|
|
193
193
|
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
194
194
|
},
|
|
@@ -206,7 +206,7 @@ const claude = {
|
|
|
206
206
|
type: "object",
|
|
207
207
|
properties: {
|
|
208
208
|
name: {
|
|
209
|
-
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\
|
|
209
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.",
|
|
210
210
|
type: "string",
|
|
211
211
|
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
212
212
|
},
|
|
@@ -224,7 +224,7 @@ const claude = {
|
|
|
224
224
|
type: "object",
|
|
225
225
|
properties: {
|
|
226
226
|
name: {
|
|
227
|
-
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\
|
|
227
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.",
|
|
228
228
|
type: "string",
|
|
229
229
|
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
230
230
|
},
|
|
@@ -367,7 +367,7 @@ const collection = {
|
|
|
367
367
|
type: "object",
|
|
368
368
|
properties: {
|
|
369
369
|
name: {
|
|
370
|
-
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\
|
|
370
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
|
|
371
371
|
type: "string"
|
|
372
372
|
},
|
|
373
373
|
content: {
|
|
@@ -384,7 +384,7 @@ const collection = {
|
|
|
384
384
|
type: "object",
|
|
385
385
|
properties: {
|
|
386
386
|
name: {
|
|
387
|
-
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\
|
|
387
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
388
388
|
type: "string"
|
|
389
389
|
},
|
|
390
390
|
content: {
|
|
@@ -401,7 +401,7 @@ const collection = {
|
|
|
401
401
|
type: "object",
|
|
402
402
|
properties: {
|
|
403
403
|
name: {
|
|
404
|
-
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\
|
|
404
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
405
405
|
type: "string"
|
|
406
406
|
},
|
|
407
407
|
content: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeAuthorization.js","sourceRoot":"","sources":["../../../../../src/orchestrate/realize/orchestrateRealizeAuthorization.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,0EAiCC;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeAuthorization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aAAa,EACb,aAAa,CACd,CAAC;IACJ,CAAC;CAAA;AAED,SAAS,gBAAgB,CAAiC,KAGzD;IACC,IAAA,qCAAiB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,WAAW,GAA2B,UAAU,CACpD,KAAK,CAAC,KAAK,CACwD,CAAC;IAEtE,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,kBAAkB;QACxB,WAAW;QACX,OAAO,EAAE;YACP,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;gBACxB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SAC+C;KACnD,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -163,7 +163,7 @@ const claude = {
|
|
|
163
163
|
type: "object",
|
|
164
164
|
properties: {
|
|
165
165
|
name: {
|
|
166
|
-
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\
|
|
166
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.",
|
|
167
167
|
type: "string",
|
|
168
168
|
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
169
169
|
},
|
|
@@ -181,7 +181,7 @@ const claude = {
|
|
|
181
181
|
type: "object",
|
|
182
182
|
properties: {
|
|
183
183
|
name: {
|
|
184
|
-
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\
|
|
184
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.",
|
|
185
185
|
type: "string",
|
|
186
186
|
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
187
187
|
},
|
|
@@ -199,7 +199,7 @@ const claude = {
|
|
|
199
199
|
type: "object",
|
|
200
200
|
properties: {
|
|
201
201
|
name: {
|
|
202
|
-
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\
|
|
202
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.",
|
|
203
203
|
type: "string",
|
|
204
204
|
pattern: "^[A-Z][a-zA-Z0-9]*$"
|
|
205
205
|
},
|
|
@@ -360,7 +360,7 @@ const collection = {
|
|
|
360
360
|
type: "object",
|
|
361
361
|
properties: {
|
|
362
362
|
name: {
|
|
363
|
-
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\
|
|
363
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.\n\nDO: Use camelCase naming convention.\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
|
|
364
364
|
type: "string"
|
|
365
365
|
},
|
|
366
366
|
content: {
|
|
@@ -377,7 +377,7 @@ const collection = {
|
|
|
377
377
|
type: "object",
|
|
378
378
|
properties: {
|
|
379
379
|
name: {
|
|
380
|
-
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\
|
|
380
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
381
381
|
type: "string"
|
|
382
382
|
},
|
|
383
383
|
content: {
|
|
@@ -394,7 +394,7 @@ const collection = {
|
|
|
394
394
|
type: "object",
|
|
395
395
|
properties: {
|
|
396
396
|
name: {
|
|
397
|
-
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\
|
|
397
|
+
description: "The name of the Payload type to be generated in {Role}Payload format\n(e.g., AdminPayload, UserPayload). This type defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator.\n\nDO: Use PascalCase naming convention.\n\n\n@pattern ^[A-Z][a-zA-Z0-9]*$",
|
|
398
398
|
type: "string"
|
|
399
399
|
},
|
|
400
400
|
content: {
|
|
@@ -2,7 +2,14 @@ import { AutoBeRealizeAuthorization, AutoBeRealizeCorrectEvent, IAutoBeTypeScrip
|
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
4
|
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
5
|
-
export declare function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>,
|
|
5
|
+
export declare function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
|
|
6
|
+
authorization: AutoBeRealizeAuthorization | null;
|
|
7
|
+
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
8
|
+
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
9
|
+
code: string;
|
|
10
|
+
diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic;
|
|
11
|
+
progress: IProgress;
|
|
12
|
+
}): Promise<AutoBeRealizeCorrectEvent>;
|
|
6
13
|
export interface IProgress {
|
|
7
14
|
total: number;
|
|
8
15
|
completed: number;
|
|
@@ -52,11 +52,11 @@ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
|
52
52
|
const getTestScenarioArtifacts_1 = require("../test/compile/getTestScenarioArtifacts");
|
|
53
53
|
const transformRealizeCorrectHistories_1 = require("./histories/transformRealizeCorrectHistories");
|
|
54
54
|
const replaceImportStatements_1 = require("./utils/replaceImportStatements");
|
|
55
|
-
function orchestrateRealizeCorrect(ctx,
|
|
55
|
+
function orchestrateRealizeCorrect(ctx, props) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
var _a, _b;
|
|
57
|
+
var _a, _b, _c;
|
|
58
58
|
const artifacts = yield (0, getTestScenarioArtifacts_1.getTestScenarioArtifacts)(ctx, {
|
|
59
|
-
endpoint: scenario.operation,
|
|
59
|
+
endpoint: props.scenario.operation,
|
|
60
60
|
dependencies: [],
|
|
61
61
|
});
|
|
62
62
|
const pointer = {
|
|
@@ -72,11 +72,12 @@ function orchestrateRealizeCorrect(ctx, authorization, scenario, code, diagnosti
|
|
|
72
72
|
}),
|
|
73
73
|
histories: (0, transformRealizeCorrectHistories_1.transformRealizeCorrectHistories)({
|
|
74
74
|
state: ctx.state(),
|
|
75
|
-
scenario,
|
|
75
|
+
scenario: props.scenario,
|
|
76
76
|
artifacts,
|
|
77
|
-
authorization,
|
|
78
|
-
code,
|
|
79
|
-
diagnostic,
|
|
77
|
+
authorization: props.authorization,
|
|
78
|
+
code: props.code,
|
|
79
|
+
diagnostic: props.diagnostic,
|
|
80
|
+
totalAuthorizations: props.totalAuthorizations,
|
|
80
81
|
}),
|
|
81
82
|
enforceFunctionCall: true,
|
|
82
83
|
message: [
|
|
@@ -86,15 +87,15 @@ function orchestrateRealizeCorrect(ctx, authorization, scenario, code, diagnosti
|
|
|
86
87
|
});
|
|
87
88
|
if (pointer.value === null)
|
|
88
89
|
throw new Error("Failed to correct implementation code.");
|
|
89
|
-
pointer.value.implementationCode = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx)(artifacts, pointer.value.implementationCode, authorization === null ||
|
|
90
|
+
pointer.value.implementationCode = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx)(artifacts, pointer.value.implementationCode, (_a = props.authorization) === null || _a === void 0 ? void 0 : _a.payload.name);
|
|
90
91
|
const event = {
|
|
91
92
|
type: "realizeCorrect",
|
|
92
|
-
location: scenario.location,
|
|
93
|
+
location: props.scenario.location,
|
|
93
94
|
content: pointer.value.implementationCode,
|
|
94
95
|
tokenUsage,
|
|
95
|
-
completed: ++progress.completed,
|
|
96
|
-
total: progress.total,
|
|
97
|
-
step: (
|
|
96
|
+
completed: ++props.progress.completed,
|
|
97
|
+
total: props.progress.total,
|
|
98
|
+
step: (_c = (_b = ctx.state().analyze) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
98
99
|
created_at: new Date().toISOString(),
|
|
99
100
|
};
|
|
100
101
|
ctx.dispatch(event);
|
|
@@ -133,7 +134,7 @@ const claude = {
|
|
|
133
134
|
type: "string"
|
|
134
135
|
},
|
|
135
136
|
plan: {
|
|
136
|
-
description: "Step 1.\n\n\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan
|
|
137
|
+
description: "Step 1.\n\n\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan follows a SCHEMA-FIRST APPROACH:\n\n\uD83D\uDCCB STEP 1 - PRISMA SCHEMA VERIFICATION:\n\nDO:\n- Examine the actual Prisma schema model definition\n- List EVERY field that exists in the model with exact types\n- Explicitly note fields that DO NOT exist\n\nDO NOT:\n- Assume common fields exist without verification\n- Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking\n\n\uD83D\uDCCB STEP 2 - FIELD INVENTORY:\n\n- List ONLY fields confirmed to exist in schema\n- Example: \"Verified fields in user model: id (String), email (String),\n created_at (DateTime), updated_at (DateTime)\"\n- Example: \"Fields that DO NOT exist: deleted_at, is_active, created_by\"\n\n\uD83D\uDCCB STEP 3 - FIELD ACCESS STRATEGY:\n\n- Plan which verified fields will be used in select, update, create\n operations\n- For complex operations with type errors, plan to use separate queries\n instead of nested operations\n\n\uD83D\uDCCB STEP 4 - TYPE COMPATIBILITY:\n\n- Plan DateTime to ISO string conversions using toISOStringSafe()\n- Plan handling of nullable vs required fields\n\n\uD83D\uDCCB STEP 5 - IMPLEMENTATION APPROACH:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update) using ONLY verified fields\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; always convert all dates\n using `toISOStringSafe()` and brand as `string &\n tags.Format<'date-time'>`. This rule applies throughout all phases.\n- Prefer `satisfies` for DTO conformance instead of unsafe `as` casts\n- Avoid weak typing such as `any`, `as any`, or `satisfies any`\n- Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where\n applicable\n\n\u2705 Example Structure:\n\n```ts\nexport async function doSomething(\n user: { id: string & tags.Format<\"uuid\">; type: string },\n parameters: IParams,\n body: IBody\n): Promise<IReturn> {\n const { id } = parameters;\n const { name } = body;\n const user = await MyGlobal.prisma.users.findFirst({ where: { id } });\n if (!user) throw new Error(\"User not found\");\n ...\n return result;\n}\n```\n\n\uD83D\uDD0D Feasibility Analysis Requirement:\n\n- Before generating any code, the agent **must analyze** whether the\n requested implementation is **feasible based on the given Prisma schema\n and DTO types**.\n- If required fields or relationships are **missing or incompatible**, the\n plan should explicitly state that the implementation is **not\n possible** with the current schema/DTO, and no code should be generated\n in later stages.\n- In such cases, only a detailed **comment in the `implementationCode`**\n should be returned explaining why the logic cannot be implemented.\n\n\uD83D\uDD25 Error Handling Plan:\n\nIf an error is expected or encountered during implementation:\n\n- Clearly document the error message(s) and TypeScript error codes.\n- Analyze the root cause (e.g., type mismatch, missing field, nullability\n issue).\n- Define concrete steps to resolve the issue, such as:\n\n - Adjusting type declarations or using Prisma-generated input types.\n - Using `?? undefined` to normalize nullable fields.\n - Applying correct relation handling (e.g., `connect` instead of direct\n foreign key assignment).\n - Ensuring all date fields use `.toISOString()` and proper branding.\n- Include fallback or workaround plans if a direct fix is complex.\n- If no error is present, simply omit this section.\n\nThis plan ensures the function will:\n\n- Respect the global architecture and coding conventions\n- Be safe, predictable, and aligned with upstream logic",
|
|
137
138
|
type: "string"
|
|
138
139
|
},
|
|
139
140
|
prisma_schemas: {
|
|
@@ -141,7 +142,7 @@ const claude = {
|
|
|
141
142
|
type: "string"
|
|
142
143
|
},
|
|
143
144
|
draft_without_date_type: {
|
|
144
|
-
description: "Step 3.\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function
|
|
145
|
+
description: "Step 3.\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\nDO NOT: Use the native Date type.\n\n- The function signature must correctly include `user`, `parameters`, and\n `body` arguments.\n- Design the main flow of business logic, such as DB fetches and early\n returns based on conditions.\n- Mark any incomplete or missing parts clearly with placeholders (e.g.,\n comments or temporary values).\n\nImport rules:\n\nDO NOT:\n- Add any new import statements manually\n- Write import statements directly (this causes compile errors)\n\nNote: All necessary imports are provided globally or by the system automatically.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- NEVER declare variables with `: Date` type\n- ALWAYS use `string & tags.Format<'date-time'>` for date values\n- Use `toISOStringSafe(new Date())` for current timestamps\n- Maintain a single-function structure; avoid using classes.",
|
|
145
146
|
type: "string"
|
|
146
147
|
},
|
|
147
148
|
review: {
|
|
@@ -248,7 +249,7 @@ const collection = {
|
|
|
248
249
|
type: "string"
|
|
249
250
|
},
|
|
250
251
|
plan: {
|
|
251
|
-
description: "Step 1.\n\n\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan
|
|
252
|
+
description: "Step 1.\n\n\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan follows a SCHEMA-FIRST APPROACH:\n\n\uD83D\uDCCB STEP 1 - PRISMA SCHEMA VERIFICATION:\n\nDO:\n- Examine the actual Prisma schema model definition\n- List EVERY field that exists in the model with exact types\n- Explicitly note fields that DO NOT exist\n\nDO NOT:\n- Assume common fields exist without verification\n- Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking\n\n\uD83D\uDCCB STEP 2 - FIELD INVENTORY:\n\n- List ONLY fields confirmed to exist in schema\n- Example: \"Verified fields in user model: id (String), email (String),\n created_at (DateTime), updated_at (DateTime)\"\n- Example: \"Fields that DO NOT exist: deleted_at, is_active, created_by\"\n\n\uD83D\uDCCB STEP 3 - FIELD ACCESS STRATEGY:\n\n- Plan which verified fields will be used in select, update, create\n operations\n- For complex operations with type errors, plan to use separate queries\n instead of nested operations\n\n\uD83D\uDCCB STEP 4 - TYPE COMPATIBILITY:\n\n- Plan DateTime to ISO string conversions using toISOStringSafe()\n- Plan handling of nullable vs required fields\n\n\uD83D\uDCCB STEP 5 - IMPLEMENTATION APPROACH:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update) using ONLY verified fields\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; always convert all dates\n using `toISOStringSafe()` and brand as `string &\n tags.Format<'date-time'>`. This rule applies throughout all phases.\n- Prefer `satisfies` for DTO conformance instead of unsafe `as` casts\n- Avoid weak typing such as `any`, `as any`, or `satisfies any`\n- Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where\n applicable\n\n\u2705 Example Structure:\n\n```ts\nexport async function doSomething(\n user: { id: string & tags.Format<\"uuid\">; type: string },\n parameters: IParams,\n body: IBody\n): Promise<IReturn> {\n const { id } = parameters;\n const { name } = body;\n const user = await MyGlobal.prisma.users.findFirst({ where: { id } });\n if (!user) throw new Error(\"User not found\");\n ...\n return result;\n}\n```\n\n\uD83D\uDD0D Feasibility Analysis Requirement:\n\n- Before generating any code, the agent **must analyze** whether the\n requested implementation is **feasible based on the given Prisma schema\n and DTO types**.\n- If required fields or relationships are **missing or incompatible**, the\n plan should explicitly state that the implementation is **not\n possible** with the current schema/DTO, and no code should be generated\n in later stages.\n- In such cases, only a detailed **comment in the `implementationCode`**\n should be returned explaining why the logic cannot be implemented.\n\n\uD83D\uDD25 Error Handling Plan:\n\nIf an error is expected or encountered during implementation:\n\n- Clearly document the error message(s) and TypeScript error codes.\n- Analyze the root cause (e.g., type mismatch, missing field, nullability\n issue).\n- Define concrete steps to resolve the issue, such as:\n\n - Adjusting type declarations or using Prisma-generated input types.\n - Using `?? undefined` to normalize nullable fields.\n - Applying correct relation handling (e.g., `connect` instead of direct\n foreign key assignment).\n - Ensuring all date fields use `.toISOString()` and proper branding.\n- Include fallback or workaround plans if a direct fix is complex.\n- If no error is present, simply omit this section.\n\nThis plan ensures the function will:\n\n- Respect the global architecture and coding conventions\n- Be safe, predictable, and aligned with upstream logic",
|
|
252
253
|
type: "string"
|
|
253
254
|
},
|
|
254
255
|
prisma_schemas: {
|
|
@@ -256,7 +257,7 @@ const collection = {
|
|
|
256
257
|
type: "string"
|
|
257
258
|
},
|
|
258
259
|
draft_without_date_type: {
|
|
259
|
-
description: "Step 3.\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function
|
|
260
|
+
description: "Step 3.\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\nDO NOT: Use the native Date type.\n\n- The function signature must correctly include `user`, `parameters`, and\n `body` arguments.\n- Design the main flow of business logic, such as DB fetches and early\n returns based on conditions.\n- Mark any incomplete or missing parts clearly with placeholders (e.g.,\n comments or temporary values).\n\nImport rules:\n\nDO NOT:\n- Add any new import statements manually\n- Write import statements directly (this causes compile errors)\n\nNote: All necessary imports are provided globally or by the system automatically.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- NEVER declare variables with `: Date` type\n- ALWAYS use `string & tags.Format<'date-time'>` for date values\n- Use `toISOStringSafe(new Date())` for current timestamps\n- Maintain a single-function structure; avoid using classes.",
|
|
260
261
|
type: "string"
|
|
261
262
|
},
|
|
262
263
|
review: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeCorrect.js","sourceRoot":"","sources":["../../../../../src/orchestrate/realize/orchestrateRealizeCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeCorrect.js","sourceRoot":"","sources":["../../../../../src/orchestrate/realize/orchestrateRealizeCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,8DAiEC;;AA5ED,kDAA0B;AAG1B,uEAAoE;AACpE,uFAAoF;AAEpF,mGAAgG;AAGhG,6EAA0E;AAE1E,SAAsB,yBAAyB,CAC7C,GAAyB,EACzB,KAOC;;;QAED,MAAM,SAAS,GACb,MAAM,IAAA,m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