@autobe/agent 0.25.7 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.js +3 -0
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +15 -12
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +26 -19
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/factory/consentFunctionCall.js +3 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +4 -1
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/getCommonPrompt.d.ts +2 -0
- package/lib/factory/getCommonPrompt.js +20 -0
- package/lib/factory/getCommonPrompt.js.map +1 -0
- package/lib/index.mjs +2636 -2258
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +6 -6
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +73 -73
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +9 -9
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +2 -17
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.d.ts +6 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js +58 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +1 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +8 -8
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +46 -20
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +5 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +51 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +11 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +81 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.js +24 -4
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +52 -52
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +57 -57
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +43 -43
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +4 -4
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +444 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +12 -0
- package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +66 -57
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +9 -6
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +22 -22
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +7 -7
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +101 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +97 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +44 -0
- package/lib/orchestrate/interface/structures/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaRenameApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +92 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +42 -1
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +94 -0
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +13 -13
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +8 -7
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +4 -4
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +4 -7
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +8 -18
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +8 -28
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +16 -280
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +2 -2
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +12 -12
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -9
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +43 -22
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +58 -46
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +2 -2
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +6 -6
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +5 -22
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +10 -10
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +5 -5
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +2 -2
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +1 -0
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +26 -26
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +2 -2
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.d.ts → IAutoBeTestScenarioAuthorizationActor.d.ts} +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.js → IAutoBeTestScenarioAuthorizationActor.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationActor.js.map +1 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +3 -0
- package/src/AutoBeMockAgent.ts +15 -12
- package/src/constants/AutoBeSystemPromptConstant.ts +26 -19
- package/src/factory/consentFunctionCall.ts +4 -0
- package/src/factory/createAutoBeContext.ts +5 -1
- package/src/factory/getCommonPrompt.ts +25 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +9 -9
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +1 -1
- package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +2 -20
- package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.ts +65 -0
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +45 -20
- package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +55 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +90 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +34 -14
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +18 -18
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +4 -4
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +5 -5
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +23 -23
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +4 -4
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +269 -0
- package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +88 -70
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +16 -8
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +26 -22
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +7 -7
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +108 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +104 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +45 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +99 -0
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +45 -3
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +110 -0
- package/src/orchestrate/interface/utils/OperationValidator.ts +1 -1
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +12 -12
- package/src/orchestrate/prisma/orchestratePrisma.ts +4 -4
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -4
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +7 -7
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +8 -7
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +4 -4
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +14 -28
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -30
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +20 -285
- package/src/orchestrate/realize/orchestrateRealize.ts +1 -1
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +9 -9
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +74 -60
- package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +86 -85
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +10 -7
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +2 -2
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +2 -2
- package/src/orchestrate/realize/utils/printErrorHints.ts +1 -1
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +6 -24
- package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +10 -10
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +12 -10
- package/src/orchestrate/test/orchestrateTestCorrect.ts +2 -0
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +1 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +30 -30
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +2 -2
- package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
- /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
|
@@ -16,6 +16,7 @@ import { AutoBeConfigConstant } from "../constants/AutoBeConfigConstant";
|
|
|
16
16
|
import { AutoBeSystemPromptConstant } from "../constants/AutoBeSystemPromptConstant";
|
|
17
17
|
import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
18
18
|
import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
19
|
+
import { getCommonPrompt } from "./getCommonPrompt";
|
|
19
20
|
import { supportMistral } from "./supportMistral";
|
|
20
21
|
|
|
21
22
|
export const consentFunctionCall = async (props: {
|
|
@@ -37,6 +38,9 @@ export const consentFunctionCall = async (props: {
|
|
|
37
38
|
executor: {
|
|
38
39
|
describe: null,
|
|
39
40
|
},
|
|
41
|
+
systemPrompt: {
|
|
42
|
+
common: () => getCommonPrompt(props.config),
|
|
43
|
+
},
|
|
40
44
|
},
|
|
41
45
|
histories: [
|
|
42
46
|
{
|
|
@@ -40,6 +40,7 @@ import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
|
40
40
|
import { AutoBeTimeoutError } from "../utils/AutoBeTimeoutError";
|
|
41
41
|
import { TimedConversation } from "../utils/TimedConversation";
|
|
42
42
|
import { consentFunctionCall } from "./consentFunctionCall";
|
|
43
|
+
import { getCommonPrompt } from "./getCommonPrompt";
|
|
43
44
|
import { getCriticalCompiler } from "./getCriticalCompiler";
|
|
44
45
|
import { supportMistral } from "./supportMistral";
|
|
45
46
|
|
|
@@ -101,6 +102,9 @@ export const createAutoBeContext = <Model extends ILlmSchema.Model>(props: {
|
|
|
101
102
|
executor: {
|
|
102
103
|
describe: null,
|
|
103
104
|
},
|
|
105
|
+
systemPrompt: {
|
|
106
|
+
common: () => getCommonPrompt(props.config),
|
|
107
|
+
},
|
|
104
108
|
},
|
|
105
109
|
histories: next.histories,
|
|
106
110
|
controllers: [next.controller],
|
|
@@ -311,7 +315,7 @@ const createDispatch = (props: {
|
|
|
311
315
|
type: "analyze",
|
|
312
316
|
id: v7(),
|
|
313
317
|
prefix: event.prefix,
|
|
314
|
-
|
|
318
|
+
actors: event.actors,
|
|
315
319
|
files: event.files,
|
|
316
320
|
created_at: analyzeStart?.created_at ?? new Date().toISOString(),
|
|
317
321
|
completed_at: event.created_at,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Singleton, is_node } from "tstl";
|
|
2
|
+
|
|
3
|
+
import { AutoBeSystemPromptConstant } from "../constants/AutoBeSystemPromptConstant";
|
|
4
|
+
import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
5
|
+
|
|
6
|
+
export const getCommonPrompt = (
|
|
7
|
+
config?: Pick<IAutoBeConfig, "locale" | "timezone"> | undefined,
|
|
8
|
+
) =>
|
|
9
|
+
AutoBeSystemPromptConstant.COMMON.replace(
|
|
10
|
+
"${locale}",
|
|
11
|
+
config?.locale ?? locale.get(),
|
|
12
|
+
)
|
|
13
|
+
.replace("${timezone}", config?.timezone ?? timezone.get())
|
|
14
|
+
.replace("${datetime}", new Date().toISOString());
|
|
15
|
+
|
|
16
|
+
const locale = new Singleton(() =>
|
|
17
|
+
is_node()
|
|
18
|
+
? // eslint-disable-next-line node/prefer-global/process
|
|
19
|
+
(process.env.LANG?.split(".")[0] ?? "en-US")
|
|
20
|
+
: navigator.language,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const timezone = new Singleton(
|
|
24
|
+
() => Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
25
|
+
);
|
|
@@ -53,14 +53,14 @@ export const transformAnalyzeWriteHistories = <Model extends ILlmSchema.Model>(
|
|
|
53
53
|
## Metadata
|
|
54
54
|
|
|
55
55
|
Prefix name of the service to create is ${props.scenario.prefix}
|
|
56
|
-
and here is the list of the
|
|
57
|
-
|
|
56
|
+
and here is the list of the actors to reference.
|
|
57
|
+
|
|
58
58
|
\`\`\`json
|
|
59
|
-
${JSON.stringify(props.scenario.
|
|
59
|
+
${JSON.stringify(props.scenario.actors)}
|
|
60
60
|
\`\`\`
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
Here is the entire list of the documents that would be published
|
|
63
|
-
in someday, and your
|
|
63
|
+
in someday, and your task is to write a document of them:
|
|
64
64
|
|
|
65
65
|
## The other documents that would be published in someday
|
|
66
66
|
|
|
@@ -35,8 +35,8 @@ export const orchestrateAnalyzeScenario = async <
|
|
|
35
35
|
histories: transformAnalyzeSceHistories(ctx),
|
|
36
36
|
enforceFunctionCall: false,
|
|
37
37
|
message: StringUtil.trim`
|
|
38
|
-
Design a complete list of documents and user
|
|
39
|
-
Define user
|
|
38
|
+
Design a complete list of documents and user actors for this project.
|
|
39
|
+
Define user actors that can authenticate via API and create appropriate documentation files.
|
|
40
40
|
You must respect the number of documents specified by the user.
|
|
41
41
|
Note that the user's locale is in ${ctx.locale}.
|
|
42
42
|
`,
|
|
@@ -57,7 +57,7 @@ export const orchestrateAnalyzeScenario = async <
|
|
|
57
57
|
id: v7(),
|
|
58
58
|
prefix: pointer.value.prefix,
|
|
59
59
|
language: pointer.value.language,
|
|
60
|
-
|
|
60
|
+
actors: pointer.value.actors,
|
|
61
61
|
files: pointer.value.files,
|
|
62
62
|
tokenUsage,
|
|
63
63
|
step: (ctx.state().analyze?.step ?? -1) + 1,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AutoBeAnalyzeActor, CamelCasePattern } from "@autobe/interface";
|
|
2
2
|
import { AutoBeAnalyzeFile } from "@autobe/interface/src/histories/contents/AutoBeAnalyzeFile";
|
|
3
3
|
import { tags } from "typia";
|
|
4
4
|
|
|
5
5
|
export interface IAutoBeAnalyzeScenarioApplication {
|
|
6
6
|
/**
|
|
7
|
-
* Compose project structure with
|
|
7
|
+
* Compose project structure with actors and files.
|
|
8
8
|
*
|
|
9
|
-
* Design a list of
|
|
10
|
-
* that requirement.
|
|
9
|
+
* Design a list of actors and initial documents that you need to create for
|
|
10
|
+
* that requirement. Actors define user types and their responsibilities, while files
|
|
11
11
|
* define the documentation structure. These are managed separately. If you
|
|
12
12
|
* determine from the conversation that the user's requirements have not been
|
|
13
13
|
* fully gathered, you must stop the analysis and continue collecting the
|
|
14
14
|
* remaining requirements. In this case, you do not need to generate any files
|
|
15
|
-
* or
|
|
15
|
+
* or actors. Simply pass an empty array to `input.files` and `input.actors`.
|
|
16
16
|
*
|
|
17
|
-
* @param input Prefix,
|
|
17
|
+
* @param input Prefix, actors, and files
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
20
|
compose(input: IAutoBeAnalyzeScenarioApplication.IProps): void;
|
|
@@ -33,8 +33,8 @@ export namespace IAutoBeAnalyzeScenarioApplication {
|
|
|
33
33
|
*/
|
|
34
34
|
prefix: string & CamelCasePattern;
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/** Actors to be assigned for the project */
|
|
37
|
+
actors: AutoBeAnalyzeActor[];
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Language for document content. When specified by the user, this takes
|
|
@@ -63,7 +63,7 @@ export namespace IAutoBeAnalyzeScenarioApplication {
|
|
|
63
63
|
* - User journey mapping and use case scenarios
|
|
64
64
|
* - Business rules and workflow definitions
|
|
65
65
|
* - Service overview and business model description
|
|
66
|
-
* - User
|
|
66
|
+
* - User actors and permission requirements (described in natural language)
|
|
67
67
|
* - Business logic and validation rules
|
|
68
68
|
* - DO NOT: Include database schemas, ERD, or API specifications
|
|
69
69
|
* - DO: Write all requirements in natural language for clarity
|
|
@@ -33,7 +33,7 @@ export namespace IAutoBeAnalyzeWriteApplication {
|
|
|
33
33
|
* Example plan structure:
|
|
34
34
|
*
|
|
35
35
|
* - Service overview with business model
|
|
36
|
-
* - User
|
|
36
|
+
* - User actors and authentication requirements
|
|
37
37
|
* - Functional requirements with EARS format
|
|
38
38
|
* - Non-functional requirements
|
|
39
39
|
* - Business requirements in natural language
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
3
|
import { v7 } from "uuid";
|
|
5
4
|
|
|
6
5
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
|
+
import { transformPreviousAndLatestCorrectHistories } from "./transformPreviousAndLatestCorrectHistories";
|
|
7
7
|
|
|
8
8
|
interface IFailure {
|
|
9
9
|
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
@@ -21,23 +21,5 @@ export const transformCommonCorrectCastingHistories = (
|
|
|
21
21
|
type: "systemMessage",
|
|
22
22
|
text: AutoBeSystemPromptConstant.COMMON_CORRECT_CASTING,
|
|
23
23
|
},
|
|
24
|
-
...failures
|
|
25
|
-
(f, i, array) =>
|
|
26
|
-
({
|
|
27
|
-
id: v7(),
|
|
28
|
-
created_at: new Date().toISOString(),
|
|
29
|
-
type: "assistantMessage",
|
|
30
|
-
text: StringUtil.trim`
|
|
31
|
-
# ${i === array.length - 1 ? "Latest Failure" : "Previous Failure"}
|
|
32
|
-
## Generated TypeScript Code
|
|
33
|
-
\`\`\`typescript
|
|
34
|
-
${f.script}
|
|
35
|
-
\`\`\`
|
|
36
|
-
## Compile Errors
|
|
37
|
-
\`\`\`json
|
|
38
|
-
${JSON.stringify(f.diagnostics)}
|
|
39
|
-
\`\`\`
|
|
40
|
-
`,
|
|
41
|
-
}) satisfies IAgenticaHistoryJson.IAssistantMessage,
|
|
42
|
-
),
|
|
24
|
+
...transformPreviousAndLatestCorrectHistories(failures),
|
|
43
25
|
];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
5
|
+
|
|
6
|
+
import { printErrorHints } from "../../realize/utils/printErrorHints";
|
|
7
|
+
|
|
8
|
+
export const transformPreviousAndLatestCorrectHistories = (
|
|
9
|
+
array: Array<{
|
|
10
|
+
script: string;
|
|
11
|
+
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
12
|
+
}>,
|
|
13
|
+
): IAgenticaHistoryJson.IAssistantMessage[] =>
|
|
14
|
+
array.map((failure, i) => ({
|
|
15
|
+
id: v7(),
|
|
16
|
+
type: "assistantMessage",
|
|
17
|
+
text: StringUtil.trim`
|
|
18
|
+
${
|
|
19
|
+
i === array.length - 1
|
|
20
|
+
? "# Latest Failure"
|
|
21
|
+
: StringUtil.trim`
|
|
22
|
+
# Previous Failure
|
|
23
|
+
|
|
24
|
+
This is the previous failure for your reference.
|
|
25
|
+
|
|
26
|
+
Never try to fix this previous failure code, but only
|
|
27
|
+
focus on the latest failure below. This is provided just
|
|
28
|
+
to give you context about your past mistakes.
|
|
29
|
+
|
|
30
|
+
If same mistake happens again, you must try to not
|
|
31
|
+
repeat the same mistake. Change your approach to fix
|
|
32
|
+
the issue.
|
|
33
|
+
`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
## Original Code
|
|
37
|
+
|
|
38
|
+
Here is the previous code you have to review and fix.
|
|
39
|
+
|
|
40
|
+
\`\`\`typescript
|
|
41
|
+
${failure.script}
|
|
42
|
+
\`\`\`
|
|
43
|
+
|
|
44
|
+
## Compilation Errors
|
|
45
|
+
|
|
46
|
+
Here are the compilation errors found in the code above.
|
|
47
|
+
|
|
48
|
+
\`\`\`json
|
|
49
|
+
${JSON.stringify(failure.diagnostics)}
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
## Error Annotated Code
|
|
53
|
+
|
|
54
|
+
Here is the error annotated code.
|
|
55
|
+
|
|
56
|
+
Please refer to the annotation for the location of the error.
|
|
57
|
+
|
|
58
|
+
By the way, note that, this code is only for reference purpose.
|
|
59
|
+
Never fix code from this error annotated code. You must fix
|
|
60
|
+
the original code above.
|
|
61
|
+
|
|
62
|
+
${printErrorHints(failure.script, failure.diagnostics)}
|
|
63
|
+
`,
|
|
64
|
+
created_at: new Date().toISOString(),
|
|
65
|
+
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { AutoBeAnalyzeActor, AutoBeAnalyzeHistory } from "@autobe/interface";
|
|
3
3
|
import { StringUtil } from "@autobe/utils";
|
|
4
4
|
import { v7 } from "uuid";
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHisto
|
|
|
9
9
|
|
|
10
10
|
export const transformInterfaceAuthorizationsHistories = (props: {
|
|
11
11
|
state: AutoBeState;
|
|
12
|
-
|
|
12
|
+
actor: AutoBeAnalyzeActor;
|
|
13
13
|
instruction: string;
|
|
14
14
|
}): Array<
|
|
15
15
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
@@ -52,22 +52,22 @@ export const transformInterfaceAuthorizationsHistories = (props: {
|
|
|
52
52
|
such as endpoint patterns, request/response formats, DTO schemas,
|
|
53
53
|
and operation specifications.
|
|
54
54
|
|
|
55
|
-
Follow these instructions when designing authorization operations for ${props.
|
|
55
|
+
Follow these instructions when designing authorization operations for ${props.actor.name}.
|
|
56
56
|
Carefully distinguish between:
|
|
57
57
|
- Suggestions or recommendations (consider these as guidance)
|
|
58
58
|
- Direct specifications or explicit commands (these must be followed exactly)
|
|
59
|
-
|
|
60
|
-
When instructions contain direct specifications or explicit design decisions,
|
|
59
|
+
|
|
60
|
+
When instructions contain direct specifications or explicit design decisions,
|
|
61
61
|
follow them precisely even if you believe you have better alternatives.
|
|
62
62
|
|
|
63
63
|
${props.instruction}
|
|
64
64
|
|
|
65
|
-
##
|
|
66
|
-
|
|
67
|
-
You have to make API operations for the given
|
|
65
|
+
## Actor
|
|
66
|
+
|
|
67
|
+
You have to make API operations for the given actor:
|
|
68
68
|
|
|
69
69
|
\`\`\`json
|
|
70
|
-
${JSON.stringify(props.
|
|
70
|
+
${JSON.stringify(props.actor)}
|
|
71
71
|
\`\`\`
|
|
72
72
|
`,
|
|
73
73
|
},
|
|
@@ -10,22 +10,29 @@ import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHisto
|
|
|
10
10
|
export const transformInterfaceSchemaHistories = (props: {
|
|
11
11
|
state: AutoBeState;
|
|
12
12
|
operations: AutoBeOpenApi.IOperation[];
|
|
13
|
+
typeNames: string[];
|
|
13
14
|
instruction: string;
|
|
14
15
|
}): Array<
|
|
15
16
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
16
|
-
> =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
> => {
|
|
18
|
+
const schemas: Set<string> = new Set();
|
|
19
|
+
for (const op of props.operations) {
|
|
20
|
+
if (op.requestBody) schemas.add(op.requestBody.typeName);
|
|
21
|
+
if (op.responseBody) schemas.add(op.responseBody.typeName);
|
|
22
|
+
}
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
type: "systemMessage",
|
|
26
|
+
id: v7(),
|
|
27
|
+
created_at: new Date().toISOString(),
|
|
28
|
+
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA,
|
|
29
|
+
},
|
|
30
|
+
...transformInterfaceAssetHistories(props.state),
|
|
31
|
+
{
|
|
32
|
+
type: "assistantMessage",
|
|
33
|
+
id: v7(),
|
|
34
|
+
created_at: new Date().toISOString(),
|
|
35
|
+
text: StringUtil.trim`
|
|
29
36
|
## API Design Instructions
|
|
30
37
|
|
|
31
38
|
The following API-specific instructions were extracted from
|
|
@@ -33,23 +40,41 @@ export const transformInterfaceSchemaHistories = (props: {
|
|
|
33
40
|
such as endpoint patterns, request/response formats, DTO schemas,
|
|
34
41
|
and operation specifications.
|
|
35
42
|
|
|
36
|
-
Follow these instructions when creating JSON schema components.
|
|
43
|
+
Follow these instructions when creating JSON schema components.
|
|
37
44
|
Carefully distinguish between:
|
|
38
45
|
- Suggestions or recommendations (consider these as guidance)
|
|
39
46
|
- Direct specifications or explicit commands (these must be followed exactly)
|
|
40
|
-
|
|
41
|
-
When instructions contain direct specifications or explicit design decisions,
|
|
47
|
+
|
|
48
|
+
When instructions contain direct specifications or explicit design decisions,
|
|
42
49
|
follow them precisely even if you believe you have better alternatives.
|
|
43
50
|
|
|
44
51
|
${props.instruction}
|
|
45
52
|
|
|
46
|
-
## Operations
|
|
53
|
+
## Operations (Filtered for Target Schemas)
|
|
54
|
+
|
|
55
|
+
Here is the list of API operations that directly use the schemas
|
|
56
|
+
you need to generate (via requestBody.typeName or responseBody.typeName).
|
|
47
57
|
|
|
48
|
-
|
|
58
|
+
These are the ONLY operations relevant to your current task - other
|
|
59
|
+
operations have been filtered out to reduce noise and improve focus:
|
|
49
60
|
|
|
50
61
|
\`\`\`json
|
|
51
62
|
${JSON.stringify(props.operations)}
|
|
52
63
|
\`\`\`
|
|
64
|
+
|
|
65
|
+
## Schemas
|
|
66
|
+
|
|
67
|
+
Here is the list of request/response bodies' type names from
|
|
68
|
+
OpenAPI operations.
|
|
69
|
+
|
|
70
|
+
Reference them when creating DTO schema components, especially
|
|
71
|
+
considering the DTO relationships.
|
|
72
|
+
|
|
73
|
+
${Array.from(schemas)
|
|
74
|
+
.map((k) => `- \`${k}\``)
|
|
75
|
+
.join("\n")}
|
|
76
|
+
|
|
53
77
|
`,
|
|
54
|
-
|
|
55
|
-
];
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
|
+
import { v7 } from "uuid";
|
|
4
|
+
|
|
5
|
+
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
|
+
|
|
7
|
+
export const transformInterfaceSchemaRenameHistories = (props: {
|
|
8
|
+
tableNames: string[];
|
|
9
|
+
typeNames: string[];
|
|
10
|
+
}): Array<
|
|
11
|
+
IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage
|
|
12
|
+
> => {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
type: "systemMessage",
|
|
16
|
+
id: v7(),
|
|
17
|
+
created_at: new Date().toISOString(),
|
|
18
|
+
text: AutoBeSystemPromptConstant.INTERFACE_SCHEMA_RENAME,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: "assistantMessage",
|
|
22
|
+
id: v7(),
|
|
23
|
+
created_at: new Date().toISOString(),
|
|
24
|
+
text: StringUtil.trim`
|
|
25
|
+
## Prisma Table Names
|
|
26
|
+
|
|
27
|
+
Here is the complete list of table names from the Prisma database schema.
|
|
28
|
+
Use these as the source of truth for determining correct DTO type names.
|
|
29
|
+
|
|
30
|
+
Each table name should be converted to a DTO type name by:
|
|
31
|
+
1. Converting from snake_case to PascalCase
|
|
32
|
+
2. Preserving ALL words from the table name
|
|
33
|
+
3. Adding "I" prefix for interface types
|
|
34
|
+
|
|
35
|
+
**Table Names:**
|
|
36
|
+
${props.tableNames.map((name) => `- \`${name}\``).join("\n")}
|
|
37
|
+
|
|
38
|
+
## Current DTO Type Names
|
|
39
|
+
|
|
40
|
+
Here is the list of existing DTO type names currently in the OpenAPI specification.
|
|
41
|
+
Analyze these to identify which ones violate the naming rules by omitting
|
|
42
|
+
intermediate words or service prefixes from their corresponding table names.
|
|
43
|
+
|
|
44
|
+
**Current Type Names:**
|
|
45
|
+
${props.typeNames.map((name) => `- \`${name}\``).join("\n")}
|
|
46
|
+
|
|
47
|
+
## Your Task
|
|
48
|
+
|
|
49
|
+
Compare the table names with the current type names to identify violations.
|
|
50
|
+
For each type name that incorrectly omits words from its table name,
|
|
51
|
+
provide a refactoring entry with the correct name that preserves all components.
|
|
52
|
+
`,
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
5
|
+
|
|
6
|
+
import { AutoBeState } from "../../../context/AutoBeState";
|
|
7
|
+
import { transformInterfaceAssetHistories } from "./transformInterfaceAssetHistories";
|
|
8
|
+
|
|
9
|
+
export const transformInterfaceSchemaReviewHistories = (props: {
|
|
10
|
+
state: AutoBeState;
|
|
11
|
+
systemPrompt: string;
|
|
12
|
+
instruction: string;
|
|
13
|
+
operations: AutoBeOpenApi.IOperation[];
|
|
14
|
+
everySchemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
15
|
+
reviewSchemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
16
|
+
}): Array<
|
|
17
|
+
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
18
|
+
> => {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
type: "systemMessage",
|
|
22
|
+
id: v7(),
|
|
23
|
+
created_at: new Date().toISOString(),
|
|
24
|
+
text: props.systemPrompt,
|
|
25
|
+
},
|
|
26
|
+
...transformInterfaceAssetHistories(props.state),
|
|
27
|
+
{
|
|
28
|
+
type: "assistantMessage",
|
|
29
|
+
id: v7(),
|
|
30
|
+
created_at: new Date().toISOString(),
|
|
31
|
+
text: StringUtil.trim`
|
|
32
|
+
## API Design Instructions
|
|
33
|
+
|
|
34
|
+
The following API-specific instructions were extracted from
|
|
35
|
+
the user's requirements. These focus on API interface design aspects
|
|
36
|
+
relevant to the review task.
|
|
37
|
+
|
|
38
|
+
Follow these instructions when reviewing and fixing schemas.
|
|
39
|
+
Carefully distinguish between:
|
|
40
|
+
- Suggestions or recommendations (consider these as guidance)
|
|
41
|
+
- Direct specifications or explicit commands (these must be followed exactly)
|
|
42
|
+
|
|
43
|
+
When instructions contain direct specifications or explicit design decisions,
|
|
44
|
+
follow them precisely even if you believe you have better alternatives.
|
|
45
|
+
|
|
46
|
+
${props.instruction}
|
|
47
|
+
|
|
48
|
+
## Schemas (Complete Set for Reference)
|
|
49
|
+
|
|
50
|
+
Here is the COMPLETE set of all schemas in the system for
|
|
51
|
+
reference context:
|
|
52
|
+
|
|
53
|
+
\`\`\`json
|
|
54
|
+
${JSON.stringify(props.everySchemas)}
|
|
55
|
+
\`\`\`
|
|
56
|
+
`,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: v7(),
|
|
60
|
+
type: "assistantMessage",
|
|
61
|
+
created_at: new Date().toISOString(),
|
|
62
|
+
text: StringUtil.trim`
|
|
63
|
+
## Schemas Needing Review
|
|
64
|
+
|
|
65
|
+
From the complete schema set above, here are the SPECIFIC schemas that need review:
|
|
66
|
+
|
|
67
|
+
\`\`\`json
|
|
68
|
+
${JSON.stringify(props.reviewSchemas)}
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
IMPORTANT: Only these ${Object.keys(props.reviewSchemas).length} schemas
|
|
72
|
+
need review and potential modification. The other schemas in
|
|
73
|
+
the full set are provided for reference only.
|
|
74
|
+
|
|
75
|
+
## Operations (Filtered for Target Schemas)
|
|
76
|
+
|
|
77
|
+
Here are the API operations that directly use the schemas under review.
|
|
78
|
+
These operations reference at least one of the target schemas via
|
|
79
|
+
requestBody.typeName or responseBody.typeName.
|
|
80
|
+
|
|
81
|
+
This FILTERED list helps you understand the exact usage context for
|
|
82
|
+
the schemas you're reviewing:
|
|
83
|
+
|
|
84
|
+
\`\`\`json
|
|
85
|
+
${JSON.stringify(props.operations)}
|
|
86
|
+
\`\`\`
|
|
87
|
+
`,
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
AutoBeAssistantMessageHistory,
|
|
3
3
|
AutoBeInterfaceAuthorization,
|
|
4
4
|
AutoBeInterfaceCompleteEvent,
|
|
5
|
-
|
|
5
|
+
AutoBeInterfaceGroupEvent,
|
|
6
6
|
AutoBeInterfaceHistory,
|
|
7
7
|
AutoBeOpenApi,
|
|
8
8
|
} from "@autobe/interface";
|
|
@@ -16,6 +16,7 @@ import { ILlmSchema } from "@samchon/openapi";
|
|
|
16
16
|
import { HashMap, Pair } from "tstl";
|
|
17
17
|
import { v7 } from "uuid";
|
|
18
18
|
|
|
19
|
+
import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
|
|
19
20
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
20
21
|
import { IAutoBeFacadeApplicationProps } from "../../context/IAutoBeFacadeApplicationProps";
|
|
21
22
|
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
@@ -25,8 +26,9 @@ import { orchestrateInterfaceEndpoints } from "./orchestrateInterfaceEndpoints";
|
|
|
25
26
|
import { orchestrateInterfaceGroups } from "./orchestrateInterfaceGroups";
|
|
26
27
|
import { orchestrateInterfaceOperations } from "./orchestrateInterfaceOperations";
|
|
27
28
|
import { orchestrateInterfacePrerequisites } from "./orchestrateInterfacePrerequisites";
|
|
29
|
+
import { orchestrateInterfaceSchemaRename } from "./orchestrateInterfaceSchemaRename";
|
|
30
|
+
import { orchestrateInterfaceSchemaReview } from "./orchestrateInterfaceSchemaReview";
|
|
28
31
|
import { orchestrateInterfaceSchemas } from "./orchestrateInterfaceSchemas";
|
|
29
|
-
import { orchestrateInterfaceSchemasReview } from "./orchestrateInterfaceSchemasReview";
|
|
30
32
|
import { JsonSchemaFactory } from "./utils/JsonSchemaFactory";
|
|
31
33
|
|
|
32
34
|
export const orchestrateInterface =
|
|
@@ -57,7 +59,7 @@ export const orchestrateInterface =
|
|
|
57
59
|
});
|
|
58
60
|
|
|
59
61
|
// ENDPOINTS
|
|
60
|
-
const init:
|
|
62
|
+
const init: AutoBeInterfaceGroupEvent = await orchestrateInterfaceGroups(
|
|
61
63
|
ctx,
|
|
62
64
|
{
|
|
63
65
|
instruction: props.instruction,
|
|
@@ -108,7 +110,7 @@ export const orchestrateInterface =
|
|
|
108
110
|
const document: AutoBeOpenApi.IDocument = {
|
|
109
111
|
operations,
|
|
110
112
|
components: {
|
|
111
|
-
|
|
113
|
+
authorizations: ctx.state().analyze?.actors ?? [],
|
|
112
114
|
schemas: await orchestrateInterfaceSchemas(ctx, {
|
|
113
115
|
instruction: props.instruction,
|
|
114
116
|
operations,
|
|
@@ -116,9 +118,11 @@ export const orchestrateInterface =
|
|
|
116
118
|
},
|
|
117
119
|
};
|
|
118
120
|
|
|
121
|
+
const assign = (
|
|
122
|
+
schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>,
|
|
123
|
+
) => Object.assign(document.components.schemas, schemas);
|
|
119
124
|
const complement = async () =>
|
|
120
|
-
|
|
121
|
-
document.components.schemas,
|
|
125
|
+
assign(
|
|
122
126
|
await orchestrateInterfaceComplement(ctx, {
|
|
123
127
|
instruction: props.instruction,
|
|
124
128
|
document,
|
|
@@ -126,16 +130,32 @@ export const orchestrateInterface =
|
|
|
126
130
|
);
|
|
127
131
|
await complement();
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
for (const config of [
|
|
134
|
+
{
|
|
135
|
+
type: "interfaceSchemaSecurityReview" as const,
|
|
136
|
+
systemPrompt:
|
|
137
|
+
AutoBeSystemPromptConstant.INTERFACE_SCHEMA_SECURITY_REVIEW,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: "interfaceSchemaRelationReview" as const,
|
|
141
|
+
systemPrompt:
|
|
142
|
+
AutoBeSystemPromptConstant.INTERFACE_SCHEMA_RELATION_REVIEW,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: "interfaceSchemaContentReview" as const,
|
|
146
|
+
systemPrompt:
|
|
147
|
+
AutoBeSystemPromptConstant.INTERFACE_SCHEMA_CONTENT_REVIEW,
|
|
148
|
+
},
|
|
149
|
+
])
|
|
150
|
+
assign(
|
|
151
|
+
await orchestrateInterfaceSchemaReview(ctx, config, {
|
|
152
|
+
instruction: props.instruction,
|
|
153
|
+
document,
|
|
154
|
+
}),
|
|
155
|
+
);
|
|
137
156
|
if (missedOpenApiSchemas(document).length !== 0) await complement();
|
|
138
157
|
|
|
158
|
+
await orchestrateInterfaceSchemaRename(ctx, document);
|
|
139
159
|
JsonSchemaFactory.finalize({
|
|
140
160
|
document,
|
|
141
161
|
application: ctx.state().prisma!.result.data,
|