@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
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
IAutoBeTypeScriptCompileResult,
|
|
10
10
|
} from "@autobe/interface";
|
|
11
11
|
import { ILlmSchema } from "@samchon/openapi";
|
|
12
|
+
import { v4 } from "uuid";
|
|
12
13
|
|
|
13
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
15
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
15
|
-
import {
|
|
16
|
-
import { getAutoBeRealizeGenerated } from "../../factory/getAutoBeRealizeGenerated";
|
|
16
|
+
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
17
17
|
import { compile } from "./internal/compile";
|
|
18
18
|
import { orchestrateRealizeAuthorization } from "./orchestrateRealizeAuthorization";
|
|
19
19
|
import { orchestrateRealizeCorrect } from "./orchestrateRealizeCorrect";
|
|
@@ -26,13 +26,25 @@ export const orchestrateRealize =
|
|
|
26
26
|
async (
|
|
27
27
|
props: IAutoBeApplicationProps,
|
|
28
28
|
): Promise<AutoBeAssistantMessageHistory | AutoBeRealizeHistory> => {
|
|
29
|
+
// PREDICATION
|
|
29
30
|
const operations: AutoBeOpenApi.IOperation[] | undefined =
|
|
30
31
|
ctx.state().interface?.document.operations;
|
|
31
|
-
if (!operations)
|
|
32
|
+
if (!operations)
|
|
32
33
|
throw new Error("Can't do realize agent because operations are nothing.");
|
|
33
|
-
}
|
|
34
34
|
|
|
35
35
|
const start: Date = new Date();
|
|
36
|
+
const predicate: string | null = predicateStateMessage(
|
|
37
|
+
ctx.state(),
|
|
38
|
+
"realize",
|
|
39
|
+
);
|
|
40
|
+
if (predicate !== null)
|
|
41
|
+
return ctx.assistantMessage({
|
|
42
|
+
type: "assistantMessage",
|
|
43
|
+
id: v4(),
|
|
44
|
+
created_at: start.toISOString(),
|
|
45
|
+
text: predicate,
|
|
46
|
+
completed_at: new Date().toISOString(),
|
|
47
|
+
});
|
|
36
48
|
ctx.dispatch({
|
|
37
49
|
type: "realizeStart",
|
|
38
50
|
created_at: start.toISOString(),
|
|
@@ -40,35 +52,53 @@ export const orchestrateRealize =
|
|
|
40
52
|
step: ctx.state().test?.step ?? 0,
|
|
41
53
|
});
|
|
42
54
|
|
|
55
|
+
// AUTHORIZATIONS
|
|
43
56
|
const authorizations: AutoBeRealizeAuthorization[] =
|
|
44
57
|
await orchestrateRealizeAuthorization(ctx);
|
|
45
58
|
|
|
59
|
+
// SCENARIOS
|
|
46
60
|
const scenarios: IAutoBeRealizeScenarioApplication.IProps[] =
|
|
47
|
-
operations.map((operation) =>
|
|
61
|
+
operations.map((operation) => {
|
|
62
|
+
const authorization = authorizations.find(
|
|
63
|
+
(el) => el.role.name === operation.authorizationRole,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return orchestrateRealizeScenario(ctx, operation, authorization);
|
|
67
|
+
});
|
|
48
68
|
|
|
49
69
|
const writeProgress = { total: scenarios.length, completed: 0 };
|
|
50
70
|
const writeEvents: AutoBeRealizeWriteEvent[] = await Promise.all(
|
|
51
71
|
scenarios.map(async (scenario) => {
|
|
52
|
-
const code = orchestrateRealizeWrite(
|
|
53
|
-
|
|
54
|
-
scenario.decoratorEvent ?? null,
|
|
72
|
+
const code = orchestrateRealizeWrite(ctx, {
|
|
73
|
+
totalAuthorizations: authorizations,
|
|
74
|
+
authorization: scenario.decoratorEvent ?? null,
|
|
55
75
|
scenario,
|
|
56
|
-
writeProgress,
|
|
57
|
-
);
|
|
76
|
+
progress: writeProgress,
|
|
77
|
+
});
|
|
58
78
|
return code;
|
|
59
79
|
}),
|
|
60
80
|
);
|
|
61
81
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
82
|
+
const functions: AutoBeRealizeFunction[] = Object.entries(
|
|
83
|
+
Object.fromEntries(
|
|
84
|
+
writeEvents.map((event) => [event.location, event.content]),
|
|
85
|
+
),
|
|
86
|
+
).map(([location, content]) => {
|
|
87
|
+
const scenario = scenarios.find((el) => el.location === location)!;
|
|
88
|
+
return {
|
|
89
|
+
location,
|
|
90
|
+
content,
|
|
91
|
+
endpoint: {
|
|
92
|
+
method: scenario.operation.method,
|
|
93
|
+
path: scenario.operation.path,
|
|
94
|
+
},
|
|
95
|
+
name: scenario.functionName,
|
|
96
|
+
};
|
|
69
97
|
});
|
|
70
98
|
|
|
71
|
-
|
|
99
|
+
let compilation = await compile(ctx, { authorizations, functions });
|
|
100
|
+
|
|
101
|
+
if (compilation.type !== "success") {
|
|
72
102
|
const MAX_CORRECTION_ATTEMPTS = 3 as const;
|
|
73
103
|
|
|
74
104
|
const reviewProgress = {
|
|
@@ -77,65 +107,54 @@ export const orchestrateRealize =
|
|
|
77
107
|
};
|
|
78
108
|
|
|
79
109
|
for (let attempt = 0; attempt < MAX_CORRECTION_ATTEMPTS; attempt++) {
|
|
80
|
-
if (
|
|
81
|
-
const failedFiles: Record<string, string> =
|
|
82
|
-
|
|
110
|
+
if (compilation.type === "failure") {
|
|
111
|
+
const failedFiles: Record<string, string> = Object.fromEntries(
|
|
112
|
+
compilation.type === "failure"
|
|
113
|
+
? compilation.diagnostics.map((d) => [d.file, d.code])
|
|
114
|
+
: [],
|
|
115
|
+
);
|
|
83
116
|
|
|
84
117
|
reviewProgress.total += Object.keys(failedFiles).length;
|
|
85
|
-
const
|
|
86
|
-
finalCompilationResult.result;
|
|
118
|
+
const failure: IAutoBeTypeScriptCompileResult.IFailure = compilation;
|
|
87
119
|
|
|
88
120
|
await Promise.all(
|
|
89
121
|
Object.entries(failedFiles).map(async ([location, content]) => {
|
|
90
122
|
const diagnostic:
|
|
91
123
|
| IAutoBeTypeScriptCompileResult.IDiagnostic
|
|
92
|
-
| undefined =
|
|
124
|
+
| undefined = failure.diagnostics.find(
|
|
93
125
|
(el) => el.file === location,
|
|
94
126
|
);
|
|
95
127
|
|
|
96
128
|
const scenario = scenarios.find((el) => el.location === location);
|
|
97
129
|
if (diagnostic && scenario) {
|
|
98
|
-
const correctEvent = await orchestrateRealizeCorrect(
|
|
99
|
-
|
|
100
|
-
scenario.decoratorEvent ?? null,
|
|
130
|
+
const correctEvent = await orchestrateRealizeCorrect(ctx, {
|
|
131
|
+
totalAuthorizations: authorizations,
|
|
132
|
+
authorization: scenario.decoratorEvent ?? null,
|
|
101
133
|
scenario,
|
|
102
|
-
content,
|
|
134
|
+
code: content,
|
|
103
135
|
diagnostic,
|
|
104
|
-
reviewProgress,
|
|
136
|
+
progress: reviewProgress,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const corrected = functions.find(
|
|
140
|
+
(el) => el.location === correctEvent.location,
|
|
105
141
|
);
|
|
106
142
|
|
|
107
|
-
|
|
143
|
+
if (corrected) {
|
|
144
|
+
corrected.content = correctEvent.content;
|
|
145
|
+
}
|
|
108
146
|
}
|
|
109
147
|
}),
|
|
110
148
|
);
|
|
111
149
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
providers,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
if (finalCompilationResult.type === "success") {
|
|
150
|
+
compilation = await compile(ctx, { authorizations, functions });
|
|
151
|
+
if (compilation.type === "success") {
|
|
118
152
|
break;
|
|
119
153
|
}
|
|
120
154
|
}
|
|
121
155
|
}
|
|
122
156
|
}
|
|
123
157
|
|
|
124
|
-
const functions: AutoBeRealizeFunction[] = Object.entries(providers).map(
|
|
125
|
-
([location, content]) => {
|
|
126
|
-
const scenario = scenarios.find((el) => el.location === location)!;
|
|
127
|
-
return {
|
|
128
|
-
location,
|
|
129
|
-
content,
|
|
130
|
-
endpoint: {
|
|
131
|
-
method: scenario.operation.method,
|
|
132
|
-
path: scenario.operation.path,
|
|
133
|
-
},
|
|
134
|
-
name: scenario.functionName,
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
);
|
|
138
|
-
|
|
139
158
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
140
159
|
const controllers: Record<string, string> =
|
|
141
160
|
await compiler.realize.controller({
|
|
@@ -150,22 +169,7 @@ export const orchestrateRealize =
|
|
|
150
169
|
functions,
|
|
151
170
|
authorizations,
|
|
152
171
|
controllers,
|
|
153
|
-
compiled: await
|
|
154
|
-
files: {
|
|
155
|
-
...(await getAutoBeGenerated(
|
|
156
|
-
compiler,
|
|
157
|
-
ctx.state(),
|
|
158
|
-
ctx.histories(),
|
|
159
|
-
ctx.usage(),
|
|
160
|
-
)),
|
|
161
|
-
...(await getAutoBeRealizeGenerated({
|
|
162
|
-
document: ctx.state().interface!.document,
|
|
163
|
-
authorizations,
|
|
164
|
-
functions,
|
|
165
|
-
compiler,
|
|
166
|
-
})),
|
|
167
|
-
},
|
|
168
|
-
}),
|
|
172
|
+
compiled: await compile(ctx, { authorizations, functions }),
|
|
169
173
|
step: ctx.state().analyze?.step ?? 0,
|
|
170
174
|
elapsed: new Date().getTime() - start.getTime(),
|
|
171
175
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import {
|
|
3
3
|
AutoBeAnalyzeRole,
|
|
4
|
+
AutoBeProgressEventBase,
|
|
4
5
|
AutoBeRealizeAuthorization,
|
|
5
6
|
AutoBeRealizeAuthorizationWriteEvent,
|
|
6
7
|
IAutoBeCompiler,
|
|
@@ -11,7 +12,6 @@ import typia from "typia";
|
|
|
11
12
|
|
|
12
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
13
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
14
|
-
import { IProgress } from "../internal/IProgress";
|
|
15
15
|
import { transformRealizeAuthorizationHistories } from "./histories/transformRealizeAuthorization";
|
|
16
16
|
import { orchestrateRealizeAuthorizationCorrect } from "./orchestrateRealizeAuthorizationCorrect";
|
|
17
17
|
import { IAutoBeRealizeAuthorizationApplication } from "./structures/IAutoBeRealizeAuthorizationApplication";
|
|
@@ -34,7 +34,7 @@ export async function orchestrateRealizeAuthorization<
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
const roles: AutoBeAnalyzeRole[] = ctx.state().analyze?.roles ?? [];
|
|
37
|
-
const progress:
|
|
37
|
+
const progress: AutoBeProgressEventBase = {
|
|
38
38
|
total: roles.length,
|
|
39
39
|
completed: 0,
|
|
40
40
|
};
|
|
@@ -63,7 +63,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
63
63
|
ctx: AutoBeContext<Model>,
|
|
64
64
|
role: AutoBeAnalyzeRole,
|
|
65
65
|
templateFiles: Record<string, string>,
|
|
66
|
-
progress:
|
|
66
|
+
progress: AutoBeProgressEventBase,
|
|
67
67
|
): Promise<AutoBeRealizeAuthorization> {
|
|
68
68
|
const pointer: IPointer<IAutoBeRealizeAuthorizationApplication.IProps | null> =
|
|
69
69
|
{
|
|
@@ -12,21 +12,24 @@ import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
|
12
12
|
import { getTestScenarioArtifacts } from "../test/compile/getTestScenarioArtifacts";
|
|
13
13
|
import { IAutoBeTestScenarioArtifacts } from "../test/structures/IAutoBeTestScenarioArtifacts";
|
|
14
14
|
import { transformRealizeCorrectHistories } from "./histories/transformRealizeCorrectHistories";
|
|
15
|
-
import { IAutoBeRealizeCorrectApplication } from "./structures/
|
|
15
|
+
import { IAutoBeRealizeCorrectApplication } from "./structures/IAutoBeRealizeCorrectApplication";
|
|
16
16
|
import { IAutoBeRealizeScenarioApplication } from "./structures/IAutoBeRealizeScenarioApplication";
|
|
17
17
|
import { replaceImportStatements } from "./utils/replaceImportStatements";
|
|
18
18
|
|
|
19
19
|
export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
20
20
|
ctx: AutoBeContext<Model>,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
props: {
|
|
22
|
+
authorization: AutoBeRealizeAuthorization | null;
|
|
23
|
+
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
24
|
+
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
25
|
+
code: string;
|
|
26
|
+
diagnostic: IAutoBeTypeScriptCompileResult.IDiagnostic;
|
|
27
|
+
progress: IProgress;
|
|
28
|
+
},
|
|
26
29
|
): Promise<AutoBeRealizeCorrectEvent> {
|
|
27
30
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
28
31
|
await getTestScenarioArtifacts(ctx, {
|
|
29
|
-
endpoint: scenario.operation,
|
|
32
|
+
endpoint: props.scenario.operation,
|
|
30
33
|
dependencies: [],
|
|
31
34
|
});
|
|
32
35
|
|
|
@@ -43,11 +46,12 @@ export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
|
43
46
|
}),
|
|
44
47
|
histories: transformRealizeCorrectHistories({
|
|
45
48
|
state: ctx.state(),
|
|
46
|
-
scenario,
|
|
49
|
+
scenario: props.scenario,
|
|
47
50
|
artifacts,
|
|
48
|
-
authorization,
|
|
49
|
-
code,
|
|
50
|
-
diagnostic,
|
|
51
|
+
authorization: props.authorization,
|
|
52
|
+
code: props.code,
|
|
53
|
+
diagnostic: props.diagnostic,
|
|
54
|
+
totalAuthorizations: props.totalAuthorizations,
|
|
51
55
|
}),
|
|
52
56
|
enforceFunctionCall: true,
|
|
53
57
|
message: [
|
|
@@ -62,16 +66,16 @@ export async function orchestrateRealizeCorrect<Model extends ILlmSchema.Model>(
|
|
|
62
66
|
pointer.value.implementationCode = await replaceImportStatements(ctx)(
|
|
63
67
|
artifacts,
|
|
64
68
|
pointer.value.implementationCode,
|
|
65
|
-
authorization?.payload.name,
|
|
69
|
+
props.authorization?.payload.name,
|
|
66
70
|
);
|
|
67
71
|
|
|
68
72
|
const event: AutoBeRealizeCorrectEvent = {
|
|
69
73
|
type: "realizeCorrect",
|
|
70
|
-
location: scenario.location,
|
|
74
|
+
location: props.scenario.location,
|
|
71
75
|
content: pointer.value.implementationCode,
|
|
72
76
|
tokenUsage,
|
|
73
|
-
completed: ++progress.completed,
|
|
74
|
-
total: progress.total,
|
|
77
|
+
completed: ++props.progress.completed,
|
|
78
|
+
total: props.progress.total,
|
|
75
79
|
step: ctx.state().analyze?.step ?? 0,
|
|
76
80
|
created_at: new Date().toISOString(),
|
|
77
81
|
};
|
|
@@ -17,13 +17,16 @@ import { replaceImportStatements } from "./utils/replaceImportStatements";
|
|
|
17
17
|
|
|
18
18
|
export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
19
19
|
ctx: AutoBeContext<Model>,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
props: {
|
|
21
|
+
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
22
|
+
authorization: AutoBeRealizeAuthorization | null;
|
|
23
|
+
scenario: IAutoBeRealizeScenarioApplication.IProps;
|
|
24
|
+
progress: IProgress;
|
|
25
|
+
},
|
|
23
26
|
): Promise<AutoBeRealizeWriteEvent> {
|
|
24
27
|
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
25
28
|
await getTestScenarioArtifacts(ctx, {
|
|
26
|
-
endpoint: scenario.operation,
|
|
29
|
+
endpoint: props.scenario.operation,
|
|
27
30
|
dependencies: [],
|
|
28
31
|
});
|
|
29
32
|
const pointer: IPointer<IAutoBeRealizeWriteApplication.IProps | null> = {
|
|
@@ -33,9 +36,10 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
33
36
|
source: "realizeWrite",
|
|
34
37
|
histories: transformRealizeWriteHistories({
|
|
35
38
|
state: ctx.state(),
|
|
36
|
-
scenario,
|
|
39
|
+
scenario: props.scenario,
|
|
37
40
|
artifacts,
|
|
38
|
-
authorization,
|
|
41
|
+
authorization: props.authorization,
|
|
42
|
+
totalAuthorizations: props.totalAuthorizations,
|
|
39
43
|
}),
|
|
40
44
|
controller: createController({
|
|
41
45
|
model: ctx.model,
|
|
@@ -47,11 +51,15 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
47
51
|
message: [
|
|
48
52
|
`Write complete, production-ready TypeScript code that strictly follows these rules:`,
|
|
49
53
|
"",
|
|
50
|
-
`
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
`
|
|
54
|
+
`DO NOT:`,
|
|
55
|
+
`- Use the native \`Date\` type anywhere`,
|
|
56
|
+
`- Use \`as\` for type assertions`,
|
|
57
|
+
``,
|
|
58
|
+
`DO:`,
|
|
59
|
+
`- Write all date/datetime values as \`string & tags.Format<'date-time'>\``,
|
|
60
|
+
`- Generate UUIDs using \`v4()\` and type as \`string & tags.Format<'uuid'>\``,
|
|
61
|
+
`- Resolve types properly without assertions`,
|
|
62
|
+
`- Type all functions with clear parameter and return types`,
|
|
55
63
|
`6. Do not skip validations or default values where necessary.`,
|
|
56
64
|
`7. Follow functional, immutable, and consistent code structure.`,
|
|
57
65
|
"",
|
|
@@ -63,16 +71,16 @@ export async function orchestrateRealizeWrite<Model extends ILlmSchema.Model>(
|
|
|
63
71
|
pointer.value.implementationCode = await replaceImportStatements(ctx)(
|
|
64
72
|
artifacts,
|
|
65
73
|
pointer.value.implementationCode,
|
|
66
|
-
authorization?.payload.name,
|
|
74
|
+
props.authorization?.payload.name,
|
|
67
75
|
);
|
|
68
76
|
|
|
69
77
|
const event: AutoBeRealizeWriteEvent = {
|
|
70
78
|
type: "realizeWrite",
|
|
71
|
-
location: scenario.location,
|
|
79
|
+
location: props.scenario.location,
|
|
72
80
|
content: pointer.value.implementationCode,
|
|
73
81
|
tokenUsage,
|
|
74
|
-
completed: ++progress.completed,
|
|
75
|
-
total: progress.total,
|
|
82
|
+
completed: ++props.progress.completed,
|
|
83
|
+
total: props.progress.total,
|
|
76
84
|
step: ctx.state().analyze?.step ?? 0,
|
|
77
85
|
created_at: new Date().toISOString(),
|
|
78
86
|
};
|
|
@@ -41,7 +41,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
41
41
|
* called by the decorator to verify JWT tokens and return authenticated
|
|
42
42
|
* user information for the specified role.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
44
|
+
* DO: Use camelCase naming convention.
|
|
45
45
|
*/
|
|
46
46
|
name: string & CamelPattern;
|
|
47
47
|
|
|
@@ -64,7 +64,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
64
64
|
* authorize users for the specific role, injecting the authenticated user
|
|
65
65
|
* payload as a method parameter.
|
|
66
66
|
*
|
|
67
|
-
*
|
|
67
|
+
* DO: Use PascalCase naming convention.
|
|
68
68
|
*/
|
|
69
69
|
name: string & PascalPattern;
|
|
70
70
|
|
|
@@ -86,7 +86,7 @@ export namespace IAutoBeRealizeAuthorizationApplication {
|
|
|
86
86
|
* authenticated user data that will be injected into Controller methods
|
|
87
87
|
* when using the decorator.
|
|
88
88
|
*
|
|
89
|
-
*
|
|
89
|
+
* DO: Use PascalCase naming convention.
|
|
90
90
|
*/
|
|
91
91
|
name: string & PascalPattern;
|
|
92
92
|
|
|
@@ -13,16 +13,18 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
13
13
|
* function according to the Realize Coder Agent specification. Before
|
|
14
14
|
* writing the actual code, think through the logic and structure.
|
|
15
15
|
*
|
|
16
|
-
* The plan
|
|
16
|
+
* The plan follows a SCHEMA-FIRST APPROACH:
|
|
17
17
|
*
|
|
18
|
-
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION
|
|
18
|
+
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
* DO:
|
|
21
|
+
* - Examine the actual Prisma schema model definition
|
|
22
|
+
* - List EVERY field that exists in the model with exact types
|
|
23
|
+
* - Explicitly note fields that DO NOT exist
|
|
24
|
+
*
|
|
25
|
+
* DO NOT:
|
|
26
|
+
* - Assume common fields exist without verification
|
|
27
|
+
* - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active without checking
|
|
26
28
|
*
|
|
27
29
|
* 📋 STEP 2 - FIELD INVENTORY:
|
|
28
30
|
*
|
|
@@ -158,8 +160,9 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
158
160
|
* Draft WITHOUT using native Date type.
|
|
159
161
|
*
|
|
160
162
|
* This is the initial drafting phase where you outline the basic skeleton
|
|
161
|
-
* of the function.
|
|
162
|
-
*
|
|
163
|
+
* of the function.
|
|
164
|
+
*
|
|
165
|
+
* DO NOT: Use the native Date type.
|
|
163
166
|
*
|
|
164
167
|
* - The function signature must correctly include `user`, `parameters`, and
|
|
165
168
|
* `body` arguments.
|
|
@@ -168,13 +171,13 @@ export namespace IAutoBeRealizeWriteApplication {
|
|
|
168
171
|
* - Mark any incomplete or missing parts clearly with placeholders (e.g.,
|
|
169
172
|
* comments or temporary values).
|
|
170
173
|
*
|
|
171
|
-
*
|
|
174
|
+
* Import rules:
|
|
172
175
|
*
|
|
173
|
-
*
|
|
174
|
-
* -
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
176
|
+
* DO NOT:
|
|
177
|
+
* - Add any new import statements manually
|
|
178
|
+
* - Write import statements directly (this causes compile errors)
|
|
179
|
+
*
|
|
180
|
+
* Note: All necessary imports are provided globally or by the system automatically.
|
|
178
181
|
*
|
|
179
182
|
* ✅ Requirements:
|
|
180
183
|
*
|
|
@@ -46,6 +46,12 @@ export function replaceImportStatements<Model extends ILlmSchema.Model>(
|
|
|
46
46
|
.replace(
|
|
47
47
|
/import\s*{\s*toISOStringSafe\s*}\s*from\s*["']\.\.\/util\/toISOStringSafe["']\s*;?\s*/gm,
|
|
48
48
|
"",
|
|
49
|
+
)
|
|
50
|
+
// Remove JWT import if it exists (to prevent duplication)
|
|
51
|
+
.replace(/import\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm, "")
|
|
52
|
+
.replace(
|
|
53
|
+
/import\s*\*\s*as\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm,
|
|
54
|
+
"",
|
|
49
55
|
);
|
|
50
56
|
|
|
51
57
|
// Remove any existing API structure imports
|
|
@@ -81,6 +87,7 @@ export function replaceImportStatements<Model extends ILlmSchema.Model>(
|
|
|
81
87
|
|
|
82
88
|
// Build the standard imports
|
|
83
89
|
const imports = [
|
|
90
|
+
'import jwt from "jsonwebtoken";',
|
|
84
91
|
'import { MyGlobal } from "../MyGlobal";',
|
|
85
92
|
'import typia, { tags } from "typia";',
|
|
86
93
|
'import { Prisma } from "@prisma/client";',
|