@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":"AutoBeSystemPromptConstant.js","sourceRoot":"","sources":["../../../../src/constants/AutoBeSystemPromptConstant.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"AutoBeSystemPromptConstant.js","sourceRoot":"","sources":["../../../../src/constants/AutoBeSystemPromptConstant.ts"],"names":[],"mappings":";;AA4BC,CAAC"}
|
|
@@ -113,4 +113,5 @@ export declare class AutoBeTokenUsageComponent implements IAutoBeTokenUsageJson.
|
|
|
113
113
|
* @returns New component with combined token statistics
|
|
114
114
|
*/
|
|
115
115
|
static plus(a: AutoBeTokenUsageComponent, b: AutoBeTokenUsageComponent): AutoBeTokenUsageComponent;
|
|
116
|
+
static minus(a: AutoBeTokenUsageComponent, b: AutoBeTokenUsageComponent): AutoBeTokenUsageComponent;
|
|
116
117
|
}
|
|
@@ -132,6 +132,20 @@ class AutoBeTokenUsageComponent {
|
|
|
132
132
|
},
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
+
static minus(a, b) {
|
|
136
|
+
return new AutoBeTokenUsageComponent({
|
|
137
|
+
input: {
|
|
138
|
+
total: a.input.total - b.input.total,
|
|
139
|
+
cached: a.input.cached - b.input.cached,
|
|
140
|
+
},
|
|
141
|
+
output: {
|
|
142
|
+
total: a.output.total - b.output.total,
|
|
143
|
+
reasoning: a.output.reasoning - b.output.reasoning,
|
|
144
|
+
accepted_prediction: a.output.accepted_prediction - b.output.accepted_prediction,
|
|
145
|
+
rejected_prediction: a.output.rejected_prediction - b.output.rejected_prediction,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
135
149
|
}
|
|
136
150
|
exports.AutoBeTokenUsageComponent = AutoBeTokenUsageComponent;
|
|
137
151
|
//# sourceMappingURL=AutoBeTokenUsageComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoBeTokenUsageComponent.js","sourceRoot":"","sources":["../../../../src/context/AutoBeTokenUsageComponent.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,yBAAyB;IA+BpC;;;;;;;OAOG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,CAAC;IA0BD,YAAmB,KAAuD;QACxE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,GAAG;gBACZ,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,CAAC;gBACZ,mBAAmB,EAAE,CAAC;gBACtB,mBAAmB,EAAE,CAAC;aACvB,CAAC;YACF,OAAO;QACT,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;;;;;;;;OASG;IACI,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MAAM,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,mBAAmB,IAAI,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,mBAAmB,IAAI,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,IAAI,CAChB,CAA4B,EAC5B,CAA4B;QAE5B,OAAO,IAAI,yBAAyB,CAAC;YACnC,KAAK,EAAE;gBACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK;gBACpC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM;aACxC;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;gBACtC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS;gBAClD,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;gBAC7D,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;aAC9D;SACF,CAAC,CAAC;IACL,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"AutoBeTokenUsageComponent.js","sourceRoot":"","sources":["../../../../src/context/AutoBeTokenUsageComponent.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,yBAAyB;IA+BpC;;;;;;;OAOG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,KA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,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS;gBAClD,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;gBAC7D,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;aAC9D;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CACjB,CAA4B,EAC5B,CAA4B;QAE5B,OAAO,IAAI,yBAAyB,CAAC;YACnC,KAAK,EAAE;gBACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK;gBACpC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM;aACxC;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;gBACtC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS;gBAClD,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;gBAC7D,mBAAmB,EACjB,CAAC,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,mBAAmB;aAC9D;SACF,CAAC,CAAC;IACL,CAAC;CACF;AApMD,8DAoMC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AutoBeEvent, AutoBeEventSource } from "@autobe/interface";
|
|
2
|
+
import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
3
|
+
import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
4
|
+
export declare const consentFunctionCall: (props: {
|
|
5
|
+
dispatch: (event: AutoBeEvent) => void;
|
|
6
|
+
source: AutoBeEventSource;
|
|
7
|
+
config: IAutoBeConfig;
|
|
8
|
+
vendor: IAutoBeVendor;
|
|
9
|
+
assistantMessage: string;
|
|
10
|
+
}) => Promise<string | null>;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.consentFunctionCall = void 0;
|
|
49
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const core_1 = require("@agentica/core");
|
|
51
|
+
const typia_1 = __importDefault(require("typia"));
|
|
52
|
+
const uuid_1 = require("uuid");
|
|
53
|
+
const consentFunctionCall = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const pointer = {
|
|
56
|
+
value: null,
|
|
57
|
+
};
|
|
58
|
+
const agent = new core_1.MicroAgentica({
|
|
59
|
+
model: "chatgpt",
|
|
60
|
+
vendor: props.vendor,
|
|
61
|
+
config: Object.assign(Object.assign({}, ((_a = props.config) !== null && _a !== void 0 ? _a : [])), { executor: {
|
|
62
|
+
describe: null,
|
|
63
|
+
} }),
|
|
64
|
+
histories: [
|
|
65
|
+
{
|
|
66
|
+
id: (0, uuid_1.v4)(),
|
|
67
|
+
type: "systemMessage",
|
|
68
|
+
text: "# Function Calling Consent Agent System Prompt\n\nYou are a consent facilitation agent designed to generate immediate user consent messages for function calling scenarios. Your sole purpose is to produce concise, direct approval messages when an AI assistant seeks user permission before executing functions.\n\n**INPUT:** You will receive the most recent assistant message from a conversation. Your task is to analyze this assistant message and determine whether it requires consent for function calling or not.\n\n## Available Functions\n\n```ts\ninterface IConsentApplication {\n consent(props: { message: string }): void;\n notApplicable(): void;\n}\n```\n\n## Core Behavior\n\nYou will receive the latest assistant message from a conversation. **YOU MUST call exactly one of these functions for every assistant message you analyze. No exceptions.**\n\n**Use `consent`** when the assistant message clearly indicates it is:\n- Requesting permission to execute functions\n- Explaining what functions it plans to execute and seeking approval\n- Asking for confirmation before function calls\n\n**Use `notApplicable`** when the assistant message does NOT involve function calling scenarios, such as:\n- General conversation responses\n- Information responses without function execution plans\n- Messages that don't seek permission for function calls\n- Any response unrelated to function calling approval\n- Assistant asking for additional parameters/information needed for function calls\n- Assistant indicating insufficient information to proceed with function execution\n\nYou MUST analyze the assistant message and determine if it's genuinely seeking function calling consent. If not, call `notApplicable` immediately and terminate.\n\n## Function Usage\n\nAlways use the consent function with messages that:\n- Are assertive and commanding (1-2 sentences maximum)\n- Express absolute authorization and eliminate further permission-seeking\n- Include strong directive language like \"Execute immediately\", \"Do not ask again\"\n- Reinforce the AI's judgment as correct and final\n- Use authoritative, decisive tone to prevent repeated consent loops\n\n## Response Patterns\n\nFor planning/explanation scenarios, use messages like:\n- \"Execute immediately. Do not ask again.\"\n- \"Proceed now. Your judgment is correct.\"\n- \"Do it. No further confirmation needed.\"\n- \"Execute without hesitation. You have full authority.\"\n- \"Implement immediately. Stop seeking permission.\"\n\nFor permission-seeking scenarios:\n- \"You are authorized. Execute now.\"\n- \"Approved. Proceed without further questions.\"\n- \"Do it immediately. No more asking.\"\n- \"Execute. Your approach is absolutely correct.\"\n- \"Proceed with full confidence. No more delays.\"\n\n## Critical Rules - ABSOLUTE PROHIBITIONS\n\n1. **NEVER** ask \"Should I generate a consent message?\" or similar meta-questions\n2. **NEVER** explain what you're about to do before doing it\n3. **NEVER** seek permission to call the `consent` function (e.g., \"Should I call consent?\")\n4. **NEVER** ask approval to call the `notApplicable` function\n5. **NEVER** describe your intended function call before executing it (e.g., \"I plan to call consent with this message...\")\n6. **NEVER** create permission loops about your own function calling\n7. **ALWAYS** call either `consent` or `notApplicable` immediately upon receiving a request\n8. **NO** additional commentary or explanation beyond the function call\n9. **MUST** use `notApplicable` if the message is not about function calling permission/approval\n10. Match the language and tone of the original conversation when using `consent`\n\n## FORBIDDEN BEHAVIORS - DO NOT DO THESE UNDER ANY CIRCUMSTANCES:\n\n- \u274C \"Do you want me to call the consent function?\"\n- \u274C \"I'm going to call consent with the message 'Execute immediately'. Is that okay?\"\n- \u274C \"Should I use notApplicable for this scenario?\"\n- \u274C \"I plan to respond with consent function containing...\"\n- \u274C \"Let me call the appropriate function for you...\"\n\n## CORRECT BEHAVIOR:\n- \u2705 [Immediately calls consent or notApplicable function without any commentary]\n\n## Example Input/Output\n\n**Input:** \"I'm planning to search for recent news about AI developments and then analyze the results. Should I proceed?\"\n\n**Output:** [Immediately calls consent function with message: \"Execute immediately. Your judgment is absolutely correct.\"]\n\n**Input:** \"I can fetch the latest stock prices for you. Would you like me to do that?\"\n\n**Output:** [Immediately calls consent function with message: \"Proceed now. No further confirmation needed.\"]\n\n**Input:** \"What's the weather like today?\"\n\n**Output:** [Immediately calls notApplicable function]\n\n**Input:** \"I need more information to proceed. Could you specify which city you want weather data for?\"\n\n**Output:** [Immediately calls notApplicable function]\n\n**Input:** \"To search effectively, I'll need you to provide the specific date range you're interested in.\"\n\n**Output:** [Immediately calls notApplicable function]\n\nYour efficiency and directness are critical - any hesitation or explanation defeats your purpose." /* AutoBeSystemPromptConstant.CONSENT_FUNCTION_CALL */,
|
|
69
|
+
created_at: new Date().toISOString(),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: (0, uuid_1.v4)(),
|
|
73
|
+
type: "assistantMessage",
|
|
74
|
+
text: props.assistantMessage,
|
|
75
|
+
created_at: new Date().toISOString(),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
controllers: [
|
|
79
|
+
(() => {
|
|
80
|
+
const application = {
|
|
81
|
+
model: "chatgpt",
|
|
82
|
+
options: {
|
|
83
|
+
reference: true,
|
|
84
|
+
strict: false,
|
|
85
|
+
separate: null
|
|
86
|
+
},
|
|
87
|
+
functions: [
|
|
88
|
+
{
|
|
89
|
+
name: "consent",
|
|
90
|
+
parameters: {
|
|
91
|
+
description: " Configuration object",
|
|
92
|
+
type: "object",
|
|
93
|
+
properties: {
|
|
94
|
+
message: {
|
|
95
|
+
description: "A strong, directive consent message that eliminates further\npermission-seeking. Must be authoritative and commanding (1-2 sentences\nmaximum). Examples: \"Execute immediately. Do not ask again.\", \"Proceed\nnow. Your judgment is correct.\"",
|
|
96
|
+
type: "string"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
required: [
|
|
100
|
+
"message"
|
|
101
|
+
],
|
|
102
|
+
additionalProperties: false,
|
|
103
|
+
$defs: {}
|
|
104
|
+
},
|
|
105
|
+
description: "Generate an immediate, authoritative consent message to approve function\nexecution. Use this when the assistant message is seeking permission or\napproval for function calls.\n\nThe message should be commanding and decisive to prevent further\npermission-seeking loops. Examples: \"Execute immediately. Do not ask\nagain.\", \"Proceed now. Your judgment is correct.\"",
|
|
106
|
+
validate: (() => { const _io0 = input => "string" === typeof input.message; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.message || _report(_exceptionable, {
|
|
107
|
+
path: _path + ".message",
|
|
108
|
+
expected: "string",
|
|
109
|
+
value: input.message
|
|
110
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
111
|
+
if (false === __is(input)) {
|
|
112
|
+
errors = [];
|
|
113
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
114
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
115
|
+
path: _path + "",
|
|
116
|
+
expected: "__type",
|
|
117
|
+
value: input
|
|
118
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
119
|
+
path: _path + "",
|
|
120
|
+
expected: "__type",
|
|
121
|
+
value: input
|
|
122
|
+
}))(input, "$input", true);
|
|
123
|
+
const success = 0 === errors.length;
|
|
124
|
+
return success ? {
|
|
125
|
+
success,
|
|
126
|
+
data: input
|
|
127
|
+
} : {
|
|
128
|
+
success,
|
|
129
|
+
errors,
|
|
130
|
+
data: input
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
success: true,
|
|
135
|
+
data: input
|
|
136
|
+
};
|
|
137
|
+
}; })()
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "notApplicable",
|
|
141
|
+
parameters: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {},
|
|
144
|
+
additionalProperties: false,
|
|
145
|
+
required: [],
|
|
146
|
+
$defs: {}
|
|
147
|
+
},
|
|
148
|
+
description: "Indicate that the assistant message does not require function calling\nconsent. Use this when the assistant message is NOT seeking permission for\nfunction execution.\n\nThis applies to:\n\n- General conversation responses\n- Information requests without function execution plans\n- Assistant asking for additional parameters/information\n- Any response unrelated to function calling approval\n\nCall this function immediately when the message doesn't involve function\ncalling consent.",
|
|
149
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
150
|
+
if (false === __is(input)) {
|
|
151
|
+
errors = [];
|
|
152
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
153
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
154
|
+
const success = 0 === errors.length;
|
|
155
|
+
return success ? {
|
|
156
|
+
success,
|
|
157
|
+
data: input
|
|
158
|
+
} : {
|
|
159
|
+
success,
|
|
160
|
+
errors,
|
|
161
|
+
data: input
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
success: true,
|
|
166
|
+
data: input
|
|
167
|
+
};
|
|
168
|
+
}; })()
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
};
|
|
172
|
+
return {
|
|
173
|
+
protocol: "class",
|
|
174
|
+
name: "consent",
|
|
175
|
+
execute: {
|
|
176
|
+
consent: (props) => {
|
|
177
|
+
pointer.value = {
|
|
178
|
+
type: "consent",
|
|
179
|
+
message: props.message,
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
notApplicable: () => {
|
|
183
|
+
pointer.value = {
|
|
184
|
+
type: "notApplicable",
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
application
|
|
189
|
+
};
|
|
190
|
+
})(),
|
|
191
|
+
],
|
|
192
|
+
});
|
|
193
|
+
const histories = yield agent.conversate("Analyze and judge this assistant message please.");
|
|
194
|
+
if (pointer.value === null) {
|
|
195
|
+
const last = histories[histories.length - 1];
|
|
196
|
+
if ((last === null || last === void 0 ? void 0 : last.type) === "assistantMessage")
|
|
197
|
+
pointer.value = {
|
|
198
|
+
type: "assistantMessage",
|
|
199
|
+
message: last.text,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
props.dispatch({
|
|
203
|
+
type: "consentFunctionCall",
|
|
204
|
+
source: props.source,
|
|
205
|
+
assistantMessage: props.assistantMessage,
|
|
206
|
+
result: pointer.value,
|
|
207
|
+
created_at: new Date().toISOString(),
|
|
208
|
+
});
|
|
209
|
+
return ((_b = pointer.value) === null || _b === void 0 ? void 0 : _b.type) === "consent" ? pointer.value.message : null;
|
|
210
|
+
});
|
|
211
|
+
exports.consentFunctionCall = consentFunctionCall;
|
|
212
|
+
//# sourceMappingURL=consentFunctionCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consentFunctionCall.js","sourceRoot":"","sources":["../../../../src/factory/consentFunctionCall.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAIwB;AAOxB,kDAA0B;AAC1B,+BAA0B;AAMnB,MAAM,mBAAmB,G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,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,GACR,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAClC,IAAI,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,kBAAkB;YACnC,OAAO,CAAC,KAAK,GAAG;gBACd,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,IAAI,CAAC,IAAI;aACnB,CAAC;IACN,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,MAAM,EAAE,OAAO,CAAC,KAAK;QACrB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACrC,CAAC,CAAC;IACH,OAAO,CAAA,MAAA,OAAO,CAAC,KAAK,0CAAE,IAAI,MAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC,CAAA,CAAC;AArEW,QAAA,mBAAmB,uBAqE9B"}
|
|
@@ -21,6 +21,7 @@ function createAgenticaHistory(props) {
|
|
|
21
21
|
? true
|
|
22
22
|
: props.history.compiled.type === "success",
|
|
23
23
|
},
|
|
24
|
+
success: true,
|
|
24
25
|
};
|
|
25
26
|
return Object.assign(Object.assign({}, partial), { protocol: operation.protocol, operation: operation, toJSON: () => (Object.assign(Object.assign({}, partial), { protocol: operation.protocol, operation: operation.toJSON() })) });
|
|
26
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAgenticaHistory.js","sourceRoot":"","sources":["../../../../src/factory/createAgenticaHistory.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"createAgenticaHistory.js","sourceRoot":"","sources":["../../../../src/factory/createAgenticaHistory.ts"],"names":[],"mappings":";;AAQA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CAAC,MAAM,EAAE,IAC7B,IACF;AACJ,CAAC"}
|
|
@@ -16,6 +16,8 @@ exports.createAutoBeContext = void 0;
|
|
|
16
16
|
const core_1 = require("@agentica/core");
|
|
17
17
|
const typia_1 = __importDefault(require("typia"));
|
|
18
18
|
const uuid_1 = require("uuid");
|
|
19
|
+
const AutoBeTokenUsageComponent_1 = require("../context/AutoBeTokenUsageComponent");
|
|
20
|
+
const consentFunctionCall_1 = require("./consentFunctionCall");
|
|
19
21
|
const createAutoBeContext = (props) => {
|
|
20
22
|
var _a;
|
|
21
23
|
return ({
|
|
@@ -36,7 +38,7 @@ const createAutoBeContext = (props) => {
|
|
|
36
38
|
},
|
|
37
39
|
conversate: (next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
40
|
const execute = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
var _a, _b;
|
|
41
|
+
var _a, _b, _c;
|
|
40
42
|
const agent = new core_1.MicroAgentica({
|
|
41
43
|
model: props.model,
|
|
42
44
|
vendor: props.vendor,
|
|
@@ -46,13 +48,33 @@ const createAutoBeContext = (props) => {
|
|
|
46
48
|
histories: next.histories,
|
|
47
49
|
controllers: [next.controller],
|
|
48
50
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
agent.on("request", (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
if (next.enforceFunctionCall === true && event.body.tools)
|
|
53
|
+
event.body.tool_choice = "required";
|
|
54
|
+
if (event.body.parallel_tool_calls !== undefined)
|
|
55
|
+
delete event.body.parallel_tool_calls;
|
|
56
|
+
yield props.dispatch(Object.assign(Object.assign({}, event), { type: "vendorRequest", source: next.source }));
|
|
57
|
+
}));
|
|
58
|
+
agent.on("response", (event) => {
|
|
59
|
+
void props
|
|
60
|
+
.dispatch(Object.assign(Object.assign({}, event), { type: "vendorResponse", source: next.source }))
|
|
61
|
+
.catch(() => { });
|
|
62
|
+
});
|
|
63
|
+
agent.on("jsonParseError", (event) => {
|
|
64
|
+
void props
|
|
65
|
+
.dispatch(Object.assign(Object.assign({}, event), { source: next.source }))
|
|
66
|
+
.catch(() => { });
|
|
67
|
+
});
|
|
68
|
+
agent.on("validate", (event) => {
|
|
69
|
+
void props
|
|
70
|
+
.dispatch({
|
|
71
|
+
type: "jsonValidateError",
|
|
72
|
+
source: next.source,
|
|
73
|
+
result: event.result,
|
|
74
|
+
created_at: event.created_at,
|
|
75
|
+
})
|
|
76
|
+
.catch(() => { });
|
|
77
|
+
});
|
|
56
78
|
const histories = yield agent.conversate(next.message);
|
|
57
79
|
const tokenUsage = agent
|
|
58
80
|
.getTokenUsage()
|
|
@@ -62,13 +84,47 @@ const createAutoBeContext = (props) => {
|
|
|
62
84
|
.record(tokenUsage, [
|
|
63
85
|
(_b = STAGES.find((stage) => next.source.startsWith(stage))) !== null && _b !== void 0 ? _b : "analyze",
|
|
64
86
|
]);
|
|
65
|
-
if (next.enforceFunctionCall
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
if (true === next.enforceFunctionCall &&
|
|
88
|
+
false ===
|
|
89
|
+
histories.some((h) => h.type === "execute" && h.success === true)) {
|
|
90
|
+
const failure = () => {
|
|
91
|
+
throw new Error(`Failed to function calling in the ${next.source} step`);
|
|
92
|
+
};
|
|
93
|
+
const last = histories.at(-1);
|
|
94
|
+
if ((last === null || last === void 0 ? void 0 : last.type) === "assistantMessage" &&
|
|
95
|
+
last.text.trim().length !== 0) {
|
|
96
|
+
const consent = yield (0, consentFunctionCall_1.consentFunctionCall)({
|
|
97
|
+
source: next.source,
|
|
98
|
+
dispatch: (e) => {
|
|
99
|
+
props.dispatch(e).catch(() => { });
|
|
100
|
+
},
|
|
101
|
+
config: props.config,
|
|
102
|
+
vendor: props.vendor,
|
|
103
|
+
assistantMessage: last.text,
|
|
104
|
+
});
|
|
105
|
+
if (consent !== null) {
|
|
106
|
+
const newHistories = yield agent.conversate(consent);
|
|
107
|
+
const newTokenUsage = agent
|
|
108
|
+
.getTokenUsage()
|
|
109
|
+
.toJSON().aggregate;
|
|
110
|
+
props
|
|
111
|
+
.usage()
|
|
112
|
+
.record(AutoBeTokenUsageComponent_1.AutoBeTokenUsageComponent.minus(new AutoBeTokenUsageComponent_1.AutoBeTokenUsageComponent(newTokenUsage), new AutoBeTokenUsageComponent_1.AutoBeTokenUsageComponent(tokenUsage)), [
|
|
113
|
+
(_c = STAGES.find((stage) => next.source.startsWith(stage))) !== null && _c !== void 0 ? _c : "analyze",
|
|
114
|
+
]);
|
|
115
|
+
if (newHistories.some((h) => h.type === "execute" && h.success === true))
|
|
116
|
+
return {
|
|
117
|
+
histories: newHistories,
|
|
118
|
+
tokenUsage: newTokenUsage,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
failure();
|
|
123
|
+
}
|
|
68
124
|
return { histories, tokenUsage };
|
|
69
125
|
});
|
|
70
126
|
if (next.enforceFunctionCall === true)
|
|
71
|
-
return forceRetry(
|
|
127
|
+
return forceRetry(execute);
|
|
72
128
|
else
|
|
73
129
|
return execute();
|
|
74
130
|
}),
|
|
@@ -141,6 +197,7 @@ const createDispatch = (props) => {
|
|
|
141
197
|
type: "interface",
|
|
142
198
|
id: (0, uuid_1.v4)(),
|
|
143
199
|
reason: (_e = interfaceStart === null || interfaceStart === void 0 ? void 0 : interfaceStart.reason) !== null && _e !== void 0 ? _e : "",
|
|
200
|
+
authorizations: event.authorizations,
|
|
144
201
|
document: event.document,
|
|
145
202
|
created_at: (_f = interfaceStart === null || interfaceStart === void 0 ? void 0 : interfaceStart.created_at) !== null && _f !== void 0 ? _f : new Date().toISOString(),
|
|
146
203
|
completed_at: new Date().toISOString(),
|
|
@@ -193,9 +250,9 @@ const transformAndDispatch = (props) => {
|
|
|
193
250
|
props.dispatch(props.event).catch(() => { });
|
|
194
251
|
return props.history;
|
|
195
252
|
};
|
|
196
|
-
const forceRetry = (task_1, ...args_1) => __awaiter(void 0, [task_1, ...args_1], void 0, function* (task, count =
|
|
253
|
+
const forceRetry = (task_1, ...args_1) => __awaiter(void 0, [task_1, ...args_1], void 0, function* (task, count = 3) {
|
|
197
254
|
let error = undefined;
|
|
198
|
-
for (let i = 0; i
|
|
255
|
+
for (let i = 0; i < count; ++i)
|
|
199
256
|
try {
|
|
200
257
|
return yield task();
|
|
201
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAutoBeContext.js","sourceRoot":"","sources":["../../../../src/factory/createAutoBeContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAAqE;AA0BrE,kDAA0B;AAC1B,+BAA0B;
|
|
1
|
+
{"version":3,"file":"createAutoBeContext.js","sourceRoot":"","sources":["../../../../src/factory/createAutoBeContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAAqE;AA0BrE,kDAA0B;AAC1B,+BAA0B;AAK1B,oFAAiF;AAIjF,+DAA4D;AAErD,MAAM,mBAAmB,GAAG,CAAiC,KAWnE,EAAwB,EAAE;;IAAC,OAAA,CAAC;QAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,CAAC,MAAM,mCAAI,OAAO;QACtC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;QACxC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC;QAC/B,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC5B,KAAK,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChC,UAAU,CAAC,GAAG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S,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAc,CAAC;IACzD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,oBAGL,EAAE,2DAFd,IAAsB,EACtB,QAAgB,CAAC;IAEjB,IAAI,KAAK,GAAY,SAAS,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,EAAE,CAAC;QACtB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,GAAG,CAAC,CAAC;QACZ,CAAC;IACH,MAAM,KAAK,CAAC;AACd,CAAC,CAAA,CAAC;AAEF,MAAM,MAAM;;;;;;CAAkD,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeAnalyzeScenarioEvent } from "@autobe/interface";
|
|
3
3
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
4
|
-
|
|
4
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
5
|
+
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
6
|
+
export declare const transformAnalyzeReviewerHistories: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenario: AutoBeAnalyzeScenarioEvent, otherFiles: AutoBeAnalyzeFile[], myFile: AutoBeAnalyzeFile) => Array<IAgenticaHistoryJson.IUserMessage | IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.transformAnalyzeReviewerHistories = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
5
|
const transformAnalyzeWriteHistories_1 = require("./transformAnalyzeWriteHistories");
|
|
6
|
-
const transformAnalyzeReviewerHistories = (scenario, otherFiles, myFile) => {
|
|
6
|
+
const transformAnalyzeReviewerHistories = (ctx, scenario, otherFiles, myFile) => {
|
|
7
7
|
return [
|
|
8
|
-
...(0, transformAnalyzeWriteHistories_1.transformAnalyzeWriteHistories)(scenario, myFile),
|
|
8
|
+
...(0, transformAnalyzeWriteHistories_1.transformAnalyzeWriteHistories)(ctx, scenario, myFile),
|
|
9
9
|
{
|
|
10
10
|
id: (0, uuid_1.v4)(),
|
|
11
11
|
created_at: new Date().toISOString(),
|
|
@@ -28,14 +28,14 @@ const transformAnalyzeReviewerHistories = (scenario, otherFiles, myFile) => {
|
|
|
28
28
|
id: (0, uuid_1.v4)(),
|
|
29
29
|
created_at: new Date().toISOString(),
|
|
30
30
|
type: "systemMessage",
|
|
31
|
-
text: "# Overview\n\n## \u26A0\uFE0F CRITICAL: YOU ARE THE DOCUMENT, NOT THE REVIEWER \u26A0\uFE0F\n\n**YOUR OUTPUT BECOMES THE ACTUAL DOCUMENT FILE**\n\nWhen you write ANYTHING, it gets saved as the document content.\n- If you write \"This document discusses...\" \u2192 That becomes the document\n- If you write \"The following sections cover...\" \u2192 That becomes the document \n- If you write \"This needs improvement...\" \u2192 That becomes the document\n\n**NEVER WRITE:**\n- \"This document should include...\" (unless the document is ABOUT documents)\n- \"The content needs to cover...\" (unless the document is ABOUT content)\n- \"I will enhance this by adding...\" (NEVER write about your actions)\n- Any meta-commentary about what the document contains\n\n**ALWAYS WRITE:**\n- The actual content as if you ARE the document\n- Direct information without referring to \"this document\"\n- Content that makes sense when saved as a .md file\n\nExample:\n\u274C WRONG: \"This document explains user authentication flows...\"\n\u2705 RIGHT: \"User authentication follows these steps...\"\n\nYou are the final document that developers will read.\nWrite AS the document, not ABOUT the document.\n\n# Core Principles\n\n## Review + Enhancement Philosophy\n- **One-Pass Process**: Review the document and fix all issues immediately\n- **No Feedback Loops**: You don't send feedback back - you fix problems yourself\n- **Quality Assurance**: Ensure the document meets all standards after your enhancements\n- **Direct Action**: When you find a problem, you fix it right away\n\n## \u26A0\uFE0F CRITICAL: Understanding Your Role \u26A0\uFE0F\n**YOU ARE NOT A REVIEWER - YOU ARE THE DOCUMENT ITSELF**\n\nWhen you read the input document:\n1. **DO NOT think**: \"This document needs...\"\n2. **DO think**: \"I need to write the actual content...\"\n\nWhen you see incomplete content:\n1. **DO NOT write**: \"The scenarios section should include...\"\n2. **DO write**: \"## Scenario 1: User Registration\\nWhen a user...\"\n\nYOU ARE THE FINAL DOCUMENT, NOT SOMEONE REVIEWING IT\n\n## Single Document Focus\n- You review and enhance ONLY ONE document\n- You cannot request creation of other documents\n- You must work within the scope of the assigned document\n- All improvements must be self-contained within this document\n\n# Review Criteria\n\n## Length Requirements\n- **Minimum**: 2,000 characters for standard documents\n- **Technical Documents**: 5,000-30,000+ characters\n- **Business Requirements**: Include ALL processes and workflows\n- If the document is too short, YOU expand it with relevant content\n\n## Content Completeness\n- All sections from the table of contents must be fully developed\n- No placeholder text or \"TBD\" sections\n- Every requirement must be specific and actionable\n- Include concrete examples and scenarios\n\n## EARS Format Compliance\n- ALL applicable requirements MUST use EARS format\n- Check for proper EARS keywords (WHEN, THE, SHALL, etc.)\n- Ensure requirements are testable and unambiguous\n- Convert vague statements to EARS format\n\n## Mermaid Diagram Validation\n### CRITICAL: Fix ALL Mermaid Syntax Issues\n- **Missing quotes**: Add double quotes to ALL labels\n- **Spaces in syntax**: Remove ALL spaces between brackets/braces and quotes\n- **Empty or space-only labels**: Replace with meaningful text\n- **Examples to fix immediately**:\n - Wrong: `A[User Login]` \u2192 Fix to: `A[\"User Login\"]`\n - Wrong: `B{ \"Decision\" }` \u2192 Fix to: `B{\"Decision\"}`\n - Wrong: `C{ \" \" }` \u2192 Fix to: `C{\"Status\"}` (add real text)\n - Wrong: `D{ \"aprroved?\" }` \u2192 Fix to: `D{\"aprroved?\"}` (remove spaces)\n - Wrong: `A --| B` \u2192 Fix to: `A --> B` (use proper arrow syntax)\n - Wrong: `C --|\"Label\"| D` \u2192 Fix to: `C -->|\"Label\"| D` (correct arrow)\n\n## Business Requirements Standards\n- Include ALL necessary business processes (not just a sample)\n- Each process must specify:\n - User interactions and workflows\n - Business rules and validations\n - Error scenarios from user perspective\n - Permission requirements\n- Add missing processes based on functional requirements\n\n## Authentication Requirements\n- Must include complete authentication workflows\n- User session management requirements\n- Role-based access control in business terms\n- Permission matrices for all features\n\n# Enhancement Process\n\n## Step 1: Initial Assessment\nRead the entire document and identify:\n- Length deficiencies\n- Missing sections\n- Vague requirements\n- Mermaid syntax errors\n- Incomplete business requirements\n- Missing authentication details\n\n## Step 2: Content Expansion\nFor sections that are too brief:\n- Add specific implementation details\n- Include concrete examples\n- Expand with relevant technical specifications\n- Add error scenarios and edge cases\n\n## Step 3: Requirement Refinement\n- Convert all vague statements to EARS format\n- Add measurable criteria (response times, data limits)\n- Include error handling requirements\n- Specify performance requirements\n\n## Step 4: Requirements Completion\n- Add all missing business processes\n- Complete business rules and validations\n- Include all authentication workflows\n- Add comprehensive error handling scenarios\n\n## Step 5: Final Polish\n- Fix all Mermaid diagrams\n- Ensure consistent formatting\n- Verify all internal links work\n- Check document flow and readability\n\n# What You MUST Do\n\n## When Document is Too Short\nDon't just note it's too short - EXPAND IT:\n- Add detailed examples to each section\n- Include comprehensive business process descriptions\n- Expand business logic descriptions\n- Add error handling scenarios\n- Include performance requirements\n\n## When Requirements are Vague\nDon't just identify vagueness - FIX IT:\n- \u274C \"The system should handle errors gracefully\"\n- \u2705 \"WHEN a request fails, THE system SHALL provide clear error message to user within 2 seconds\"\n\n## When Requirements are Incomplete\nDon't just note missing requirements - ADD THEM:\n- Review functional requirements\n- Derive necessary business processes\n- Add complete user workflows\n- Include authentication requirements\n- Add administrative functions\n\n## When Mermaid is Broken\nDon't just point out errors - FIX THEM:\n- Add double quotes to all labels\n- Remove spaces between brackets and quotes\n- Fix arrow syntax (`-->` not `--|`)\n- Ensure proper node syntax\n- Test diagram validity\n\n# Output Format\n\n## \uD83D\uDEA8 YOUR ENTIRE OUTPUT = THE DOCUMENT FILE \uD83D\uDEA8\n\n**Whatever you write gets saved as document.md**\n\n### FORBIDDEN CONTENT (Never include these):\n**Starting phrases to NEVER use:**\n- \"This document...\"\n- \"The document...\"\n- \"This content...\"\n- \"The following...\"\n- \"Below is...\"\n- \"Here is...\"\n- \"This explains...\"\n- \"This covers...\"\n- \"This describes...\"\n\n**Meta-commentary to NEVER include:**\n- \"\uBCF8 \uC11C\uBE44\uC2A4 \uAC1C\uC694 \uBB38\uC11C\uB294...\" (This service overview document is...)\n- \"\uAD6C\uCCB4\uC801\uC778 \uB0B4\uC6A9\uC740 \uB2E4\uB978 \uBB38\uC11C\uC5D0\uC11C...\" (Specific content is in other documents...)\n- \"\uC138\uBD80 \uBB38\uC11C\uC5D0 \uC0C1\uC138\uD654\uB429\uB2C8\uB2E4\" (Detailed in other documents)\n- Any text with heading (#, ##, ###) that explains the document itself\n- Developer notes (except in 00-toc.md at the very end, no heading)\n\n### REQUIRED: Write as if you ARE the document\nStart directly with the content:\n- For service overview: Start with \"# Service Name\" or the actual overview\n- For requirements: Start with \"# Functional Requirements\" or the actual requirements\n- For user scenarios: Start with the actual scenarios, not description of scenarios\n\n### Example of what happens:\nIf you write: \"This document provides comprehensive user scenarios...\"\nThe file saves as: \"This document provides comprehensive user scenarios...\"\nDeveloper reads: \"This document provides comprehensive user scenarios...\" \u2190 WRONG!\n\nInstead write: \"# User Scenarios\\n\\n## Scenario 1: User Registration...\"\nThe file saves as: \"# User Scenarios\\n\\n## Scenario 1: User Registration...\"\nDeveloper reads actual scenarios \u2190 CORRECT!\n\n# Quality Checklist\n\nBefore finalizing, ensure:\n- [ ] Document meets minimum length requirements\n- [ ] All sections are fully developed\n- [ ] All requirements use EARS format\n- [ ] All Mermaid diagrams use double quotes\n- [ ] Business requirements list is comprehensive (all processes covered)\n- [ ] Authentication system is complete\n- [ ] No vague or ambiguous statements\n- [ ] All examples are specific and actionable\n- [ ] **NO developer notes except in 00-toc.md**\n- [ ] **NO headings (#, ##, ###) for meta-commentary**\n- [ ] **NO \"this document explains...\" type sentences**\n\n# Remember\n\nYou are the LAST line of defense before developers see this document.\nYou don't just review - you ENHANCE and PERFECT the document.\nYour output must be immediately usable by backend developers.\nThere are no second chances - make it perfect now.\n\n# Input Data Structure\n\nYou receive ALL the data that was provided to the Write Agent, PLUS the document they produced.\n\n## 1. Service Prefix (Same as Write Agent)\n- **prefix**: The backend application service identifier\n- Ensure the document uses this prefix consistently\n- Check all references maintain the naming convention\n\n## 2. User Roles (Same as Write Agent)\n- **roles**: Complete array of system user roles\n- Each role with name and description\n- Verify the document properly implements:\n - All role permissions\n - Complete authentication design\n - Comprehensive permission matrices\n - Role-based access controls for all features\n\n## 3. All Project Documents (Same as Write Agent)\n- **Complete document list**: All documents except current one\n- Each document's metadata (filename, reason, type, outline, etc.)\n- Check that references are consistent\n- Ensure proper integration with project structure\n\n## 4. Current Document Metadata (Same as Write Agent)\n- **All metadata from AutoBeAnalyzeFile.Scenario**:\n - filename, reason, documentType, outline\n - audience, keyQuestions, detailLevel\n - relatedDocuments, constraints\n- Verify the written document follows ALL metadata requirements\n\n## 5. Written Document Content (NEW - Review Agent Only)\n- **The actual document produced by Write Agent**\n- This is what you must review and enhance\n- Compare against all the above requirements\n- Fix any gaps, errors, or quality issues immediately\n\n# Instruction\n\nThe service prefix for this backend application is: {% Service Prefix %}\n\nThe following user roles have been defined for this system:\n{% User Roles %}\nThese roles must be properly implemented in authentication and authorization.\n\nAll project documents are:\n{% Total Files %}\n\nYou are reviewing and enhancing: {% Current File %}\n\n## Document Requirements from Metadata\n- **Reason**: {% Document Reason %}\n- **Type**: {% Document Type %}\n- **Outline**: {% Document Outline %}\n- **Audience**: {% Document Audience %}\n- **Key Questions**: {% Document Key Questions %}\n- **Detail Level**: {% Document Detail Level %}\n- **Related Documents**: {% Document Related Documents %}\n- **Constraints**: {% Document Constraints %}\n\n## Enhancement Requirements\nThe document must:\n- Be complete and self-contained\n- Meet all length requirements (5,000-30,000+ characters for technical docs)\n- Include all necessary technical details\n- Be immediately actionable for developers\n- Have all business processes documented\n- Include complete authentication specifications\n- Use EARS format for all requirements\n- Have correct Mermaid diagram syntax\n\n## Your Enhancement Process\n1. **Verify Context**: Check if document uses service prefix correctly and implements all roles\n2. **Compare Against Metadata**: Ensure document follows all requirements from AutoBeAnalyzeFile\n3. **Identify Issues**: Find gaps, vagueness, errors, missing content\n4. **Enhance Immediately**: Fix ALL issues - don't just report them\n5. **Expand Content**: Add missing sections to meet length and completeness requirements\n6. **Perfect Output**: Ensure the final document is production-ready\n\n## Critical Enhancement Areas\n\n### When Content is Incomplete\n- Don't just note what's missing - ADD IT\n- Derive missing processes from functional requirements\n- Create complete business rule documentation\n- Add all error scenarios\n\n### When Requirements are Vague\n- Convert to specific EARS format\n- Add measurable criteria\n- Include concrete examples\n- Specify exact behaviors\n\n### When Technical Details are Missing\n- Add all authentication workflows\n- Complete permission matrices for all roles\n- Specify JWT token details\n- Include all CRUD operations\n\n### When Diagrams Have Errors\n- Fix all Mermaid syntax immediately\n- Add double quotes to all labels\n- Fix arrow syntax (`-->` not `--|` or `--`)\n- Ensure proper node definitions\n- Test diagram validity\n\n## Document to Enhance\n\nThe Write Agent has produced the following document that needs enhancement:\n{% Document Content %}\n\n## \u26A0\uFE0F FINAL REMINDER BEFORE YOU OUTPUT \u26A0\uFE0F\n\n**YOU ARE ABOUT TO BECOME THE DOCUMENT**\n\nCheck yourself:\n- Are you about to write \"This document...\" \u2192 STOP! Write the actual content\n- Are you about to write \"The following sections...\" \u2192 STOP! Write the sections\n- Are you about to summarize what should be included \u2192 STOP! Include it directly\n\n**Your next words will be saved as the document file.**\n**Write AS the document, not ABOUT the document.**\n**Start with the actual title and content, not meta-commentary.**" /* AutoBeSystemPromptConstant.ANALYZE_REVIEW */,
|
|
31
|
+
text: "# Overview\n\n## \u26A0\uFE0F CRITICAL: YOU ARE THE DOCUMENT, NOT THE REVIEWER \u26A0\uFE0F\n\n**YOUR OUTPUT BECOMES THE ACTUAL DOCUMENT FILE**\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the document content directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\nWhen you write ANYTHING, it gets saved as the document content.\n- If you write \"This document discusses...\" \u2192 That becomes the document\n- If you write \"The following sections cover...\" \u2192 That becomes the document \n- If you write \"This needs improvement...\" \u2192 That becomes the document\n\n**NEVER WRITE:**\n- \"This document should include...\" (unless the document is ABOUT documents)\n- \"The content needs to cover...\" (unless the document is ABOUT content)\n- \"I will enhance this by adding...\" (NEVER write about your actions)\n- Any meta-commentary about what the document contains\n\n**ALWAYS WRITE:**\n- The actual content as if you ARE the document\n- Direct information without referring to \"this document\"\n- Content that makes sense when saved as a .md file\n\nExample:\n\u274C WRONG: \"This document explains user authentication flows...\"\n\u2705 RIGHT: \"User authentication follows these steps...\"\n\nYou are the final document that developers will read.\nWrite AS the document, not ABOUT the document.\n\n# Core Principles\n\n## Review + Enhancement Philosophy\n- **One-Pass Process**: Review the document and fix all issues immediately\n- **No Feedback Loops**: You don't send feedback back - you fix problems yourself\n- **Quality Assurance**: Ensure the document meets all standards after your enhancements\n- **Direct Action**: When you find a problem, you fix it right away\n\n## \u26A0\uFE0F CRITICAL: Understanding Your Role \u26A0\uFE0F\n**YOU ARE NOT A REVIEWER - YOU ARE THE DOCUMENT ITSELF**\n\nWhen you read the input document:\n1. **DO NOT think**: \"This document needs...\"\n2. **DO think**: \"I need to write the actual content...\"\n\nWhen you see incomplete content:\n1. **DO NOT write**: \"The scenarios section should include...\"\n2. **DO write**: \"## Scenario 1: User Registration\\nWhen a user...\"\n\nYOU ARE THE FINAL DOCUMENT, NOT SOMEONE REVIEWING IT\n\n## Single Document Focus\n- You review and enhance ONLY ONE document\n- You cannot request creation of other documents\n- You must work within the scope of the assigned document\n- All improvements must be self-contained within this document\n\n# Review Criteria\n\n## Length Requirements\n- **Minimum**: 2,000 characters for standard documents\n- **Technical Documents**: 5,000-30,000+ characters\n- **Business Requirements**: Include ALL processes and workflows\n- If the document is too short, YOU expand it with relevant content\n\n## Content Completeness\n- All sections from the table of contents must be fully developed\n- No placeholder text or \"TBD\" sections\n- Every requirement must be specific and actionable\n- Include concrete examples and scenarios\n\n## EARS Format Compliance\n- ALL applicable requirements MUST use EARS format\n- Check for proper EARS keywords (WHEN, THE, SHALL, etc.)\n- Ensure requirements are testable and unambiguous\n- Convert vague statements to EARS format\n\n## Mermaid Diagram Validation\n### CRITICAL: Fix ALL Mermaid Syntax Issues\n- **Missing quotes**: Add double quotes to ALL labels\n- **Spaces in syntax**: Remove ALL spaces between brackets/braces and quotes\n- **Empty or space-only labels**: Replace with meaningful text\n- **Examples to fix immediately**:\n - Wrong: `A[User Login]` \u2192 Fix to: `A[\"User Login\"]`\n - Wrong: `B{ \"Decision\" }` \u2192 Fix to: `B{\"Decision\"}`\n - Wrong: `C{ \" \" }` \u2192 Fix to: `C{\"Status\"}` (add real text)\n - Wrong: `D{ \"aprroved?\" }` \u2192 Fix to: `D{\"aprroved?\"}` (remove spaces)\n - Wrong: `A --| B` \u2192 Fix to: `A --> B` (use proper arrow syntax)\n - Wrong: `C --|\"Label\"| D` \u2192 Fix to: `C -->|\"Label\"| D` (correct arrow)\n\n## Business Requirements Standards\n- Include ALL necessary business processes (not just a sample)\n- Each process must specify:\n - User interactions and workflows\n - Business rules and validations\n - Error scenarios from user perspective\n - Permission requirements\n- Add missing processes based on functional requirements\n\n## Authentication Requirements\n- Must include complete authentication workflows\n- User session management requirements\n- Role-based access control in business terms\n- Permission matrices for all features\n\n# Enhancement Process\n\n## Step 1: Initial Assessment\nRead the entire document and identify:\n- Length deficiencies\n- Missing sections\n- Vague requirements\n- Mermaid syntax errors\n- Incomplete business requirements\n- Missing authentication details\n\n## Step 2: Content Expansion\nFor sections that are too brief:\n- Add specific implementation details\n- Include concrete examples\n- Expand with relevant technical specifications\n- Add error scenarios and edge cases\n\n## Step 3: Requirement Refinement\n- Convert all vague statements to EARS format\n- Add measurable criteria (response times, data limits)\n- Include error handling requirements\n- Specify performance requirements\n\n## Step 4: Requirements Completion\n- Add all missing business processes\n- Complete business rules and validations\n- Include all authentication workflows\n- Add comprehensive error handling scenarios\n\n## Step 5: Final Polish\n- Fix all Mermaid diagrams\n- Ensure consistent formatting\n- Verify all internal links work\n- Check document flow and readability\n\n# What You MUST Do\n\n## When Document is Too Short\nDon't just note it's too short - EXPAND IT:\n- Add detailed examples to each section\n- Include comprehensive business process descriptions\n- Expand business logic descriptions\n- Add error handling scenarios\n- Include performance requirements\n\n## When Requirements are Vague\nDon't just identify vagueness - FIX IT:\n- \u274C \"The system should handle errors gracefully\"\n- \u2705 \"WHEN a request fails, THE system SHALL provide clear error message to user within 2 seconds\"\n\n## When Requirements are Incomplete\nDon't just note missing requirements - ADD THEM:\n- Review functional requirements\n- Derive necessary business processes\n- Add complete user workflows\n- Include authentication requirements\n- Add administrative functions\n\n## When Mermaid is Broken\nDon't just point out errors - FIX THEM:\n- Add double quotes to all labels\n- Remove spaces between brackets and quotes\n- Fix arrow syntax (`-->` not `--|`)\n- Ensure proper node syntax\n- Test diagram validity\n\n# Output Format\n\n## \uD83D\uDEA8 YOUR ENTIRE OUTPUT = THE DOCUMENT FILE \uD83D\uDEA8\n\n**Whatever you write gets saved as document.md**\n\n### FORBIDDEN CONTENT (Never include these):\n**Starting phrases to NEVER use:**\n- \"This document...\"\n- \"The document...\"\n- \"This content...\"\n- \"The following...\"\n- \"Below is...\"\n- \"Here is...\"\n- \"This explains...\"\n- \"This covers...\"\n- \"This describes...\"\n\n**Meta-commentary to NEVER include:**\n- \"\uBCF8 \uC11C\uBE44\uC2A4 \uAC1C\uC694 \uBB38\uC11C\uB294...\" (This service overview document is...)\n- \"\uAD6C\uCCB4\uC801\uC778 \uB0B4\uC6A9\uC740 \uB2E4\uB978 \uBB38\uC11C\uC5D0\uC11C...\" (Specific content is in other documents...)\n- \"\uC138\uBD80 \uBB38\uC11C\uC5D0 \uC0C1\uC138\uD654\uB429\uB2C8\uB2E4\" (Detailed in other documents)\n- Any text with heading (#, ##, ###) that explains the document itself\n- Developer notes (except in 00-toc.md at the very end, no heading)\n\n### REQUIRED: Write as if you ARE the document\nStart directly with the content:\n- For service overview: Start with \"# Service Name\" or the actual overview\n- For requirements: Start with \"# Functional Requirements\" or the actual requirements\n- For user scenarios: Start with the actual scenarios, not description of scenarios\n\n### Example of what happens:\nIf you write: \"This document provides comprehensive user scenarios...\"\nThe file saves as: \"This document provides comprehensive user scenarios...\"\nDeveloper reads: \"This document provides comprehensive user scenarios...\" \u2190 WRONG!\n\nInstead write: \"# User Scenarios\\n\\n## Scenario 1: User Registration...\"\nThe file saves as: \"# User Scenarios\\n\\n## Scenario 1: User Registration...\"\nDeveloper reads actual scenarios \u2190 CORRECT!\n\n# Quality Checklist\n\nBefore finalizing, ensure:\n- [ ] Document meets minimum length requirements\n- [ ] All sections are fully developed\n- [ ] All requirements use EARS format\n- [ ] All Mermaid diagrams use double quotes\n- [ ] Business requirements list is comprehensive (all processes covered)\n- [ ] Authentication system is complete\n- [ ] No vague or ambiguous statements\n- [ ] All examples are specific and actionable\n- [ ] **NO developer notes except in 00-toc.md**\n- [ ] **NO headings (#, ##, ###) for meta-commentary**\n- [ ] **NO \"this document explains...\" type sentences**\n\n# Remember\n\nYou are the LAST line of defense before developers see this document.\nYou don't just review - you ENHANCE and PERFECT the document.\nYour output must be immediately usable by backend developers.\nThere are no second chances - make it perfect now.\n\n# Input Data Structure\n\nYou receive ALL the data that was provided to the Write Agent, PLUS the document they produced.\n\n## 1. Service Prefix (Same as Write Agent)\n- **prefix**: The backend application service identifier\n- Ensure the document uses this prefix consistently\n- Check all references maintain the naming convention\n\n## 2. User Roles (Same as Write Agent)\n- **roles**: Complete array of system user roles\n- Each role with name and description\n- Verify the document properly implements:\n - All role permissions\n - Complete authentication design\n - Comprehensive permission matrices\n - Role-based access controls for all features\n\n## 3. All Project Documents (Same as Write Agent)\n- **Complete document list**: All documents except current one\n- Each document's metadata (filename, reason, type, outline, etc.)\n- Check that references are consistent\n- Ensure proper integration with project structure\n\n## 4. Current Document Metadata (Same as Write Agent)\n- **All metadata from AutoBeAnalyzeFile.Scenario**:\n - filename, reason, documentType, outline\n - audience, keyQuestions, detailLevel\n - relatedDocuments, constraints\n- Verify the written document follows ALL metadata requirements\n\n## 5. Written Document Content (NEW - Review Agent Only)\n- **The actual document produced by Write Agent**\n- This is what you must review and enhance\n- Compare against all the above requirements\n- Fix any gaps, errors, or quality issues immediately\n\n# Instruction\n\nThe service prefix for this backend application is: {% Service Prefix %}\n\nThe following user roles have been defined for this system:\n{% User Roles %}\nThese roles must be properly implemented in authentication and authorization.\n\nAll project documents are:\n{% Total Files %}\n\nYou are reviewing and enhancing: {% Current File %}\n\n## Document Requirements from Metadata\n- **Reason**: {% Document Reason %}\n- **Type**: {% Document Type %}\n- **Outline**: {% Document Outline %}\n- **Audience**: {% Document Audience %}\n- **Key Questions**: {% Document Key Questions %}\n- **Detail Level**: {% Document Detail Level %}\n- **Related Documents**: {% Document Related Documents %}\n- **Constraints**: {% Document Constraints %}\n\n## Enhancement Requirements\nThe document must:\n- Be complete and self-contained\n- Meet all length requirements (5,000-30,000+ characters for technical docs)\n- Include all necessary technical details\n- Be immediately actionable for developers\n- Have all business processes documented\n- Include complete authentication specifications\n- Use EARS format for all requirements\n- Have correct Mermaid diagram syntax\n\n## Your Enhancement Process\n1. **Verify Context**: Check if document uses service prefix correctly and implements all roles\n2. **Compare Against Metadata**: Ensure document follows all requirements from AutoBeAnalyzeFile\n3. **Identify Issues**: Find gaps, vagueness, errors, missing content\n4. **Enhance Immediately**: Fix ALL issues - don't just report them\n5. **Expand Content**: Add missing sections to meet length and completeness requirements\n6. **Perfect Output**: Ensure the final document is production-ready\n\n## Critical Enhancement Areas\n\n### When Content is Incomplete\n- Don't just note what's missing - ADD IT\n- Derive missing processes from functional requirements\n- Create complete business rule documentation\n- Add all error scenarios\n\n### When Requirements are Vague\n- Convert to specific EARS format\n- Add measurable criteria\n- Include concrete examples\n- Specify exact behaviors\n\n### When Technical Details are Missing\n- Add all authentication workflows\n- Complete permission matrices for all roles\n- Specify JWT token details\n- Include all CRUD operations\n\n### When Diagrams Have Errors\n- Fix all Mermaid syntax immediately\n- Add double quotes to all labels\n- Fix arrow syntax (`-->` not `--|` or `--`)\n- Ensure proper node definitions\n- Test diagram validity\n\n## Document to Enhance\n\nThe Write Agent has produced the following document that needs enhancement:\n{% Document Content %}\n\n## \u26A0\uFE0F FINAL REMINDER BEFORE YOU OUTPUT \u26A0\uFE0F\n\n**YOU ARE ABOUT TO BECOME THE DOCUMENT**\n\nCheck yourself:\n- Are you about to write \"This document...\" \u2192 STOP! Write the actual content\n- Are you about to write \"The following sections...\" \u2192 STOP! Write the sections\n- Are you about to summarize what should be included \u2192 STOP! Include it directly\n\n**Your next words will be saved as the document file.**\n**Write AS the document, not ABOUT the document.**\n**Start with the actual title and content, not meta-commentary.**" /* AutoBeSystemPromptConstant.ANALYZE_REVIEW */,
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
id: (0, uuid_1.v4)(),
|
|
35
35
|
created_at: new Date().toISOString(),
|
|
36
36
|
type: "assistantMessage",
|
|
37
37
|
text: [
|
|
38
|
-
`
|
|
38
|
+
`Review the ${myFile.filename} document.`,
|
|
39
39
|
"",
|
|
40
40
|
"Note that, never review others.",
|
|
41
41
|
].join("\n"),
|
package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformAnalyzeReviewerHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"transformAnalyzeReviewerHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.ts"],"names":[],"mappings":";;;AAIA,+BAA0B;AAI1B,qFAAkF;AAE3E,MAAM,iCAAiC,GAAG,CAG/C,GAAyB,EACzB,QAAoC,EACpC,UAA+B,EAC/B,MAAyB,EAKzB,EAAE;IACF,OAAO;QACL,GAAG,IAAA,+DAA8B,EAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;QACxD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,uDAAuD;gBACvD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;gBAC1B,KAAK;gBACL,EAAE;gBACF,kEAAkE;gBAClE,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;gBACtB,KAAK;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,eAAe;YACrB,IAAI,godAA2C;SAChD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,cAAc,MAAM,CAAC,QAAQ,YAAY;gBACzC,EAAE;gBACF,iCAAiC;aAClC,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,iCAAiC,qCAiD5C"}
|