@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
|
@@ -1,44 +1,30 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
2
|
import { v7 } from "uuid";
|
|
5
3
|
|
|
6
4
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
-
import {
|
|
5
|
+
import { transformPreviousAndLatestCorrectHistories } from "../../common/histories/transformPreviousAndLatestCorrectHistories";
|
|
6
|
+
import { IAutoBeRealizeFunctionFailure } from "../structures/IAutoBeRealizeFunctionFailure";
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const transformRealizeCorrectCastingHistories = (
|
|
15
|
-
failures: IFailure[],
|
|
16
|
-
): Array<
|
|
8
|
+
export const transformRealizeCorrectCastingHistories = (props: {
|
|
9
|
+
failures: IAutoBeRealizeFunctionFailure[];
|
|
10
|
+
}): Array<
|
|
17
11
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
18
12
|
> => {
|
|
19
|
-
|
|
13
|
+
const histories: Array<
|
|
14
|
+
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
15
|
+
> = [
|
|
20
16
|
{
|
|
21
17
|
id: v7(),
|
|
22
18
|
created_at: new Date().toISOString(),
|
|
23
19
|
type: "systemMessage",
|
|
24
20
|
text: AutoBeSystemPromptConstant.COMMON_CORRECT_CASTING,
|
|
25
21
|
},
|
|
26
|
-
...
|
|
27
|
-
(f) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: "assistantMessage",
|
|
32
|
-
text: StringUtil.trim`
|
|
33
|
-
# Errors
|
|
34
|
-
|
|
35
|
-
This is a past code and an error with the code.
|
|
36
|
-
Please refer to the annotation for the location of the error.
|
|
37
|
-
|
|
38
|
-
${printErrorHints(f.script, f.diagnostics)}
|
|
39
|
-
\`\`\`
|
|
40
|
-
`,
|
|
41
|
-
}) satisfies IAgenticaHistoryJson.IAssistantMessage,
|
|
22
|
+
...transformPreviousAndLatestCorrectHistories(
|
|
23
|
+
props.failures.map((f) => ({
|
|
24
|
+
script: f.function.content,
|
|
25
|
+
diagnostics: f.diagnostics,
|
|
26
|
+
})),
|
|
42
27
|
),
|
|
43
28
|
];
|
|
29
|
+
return histories;
|
|
44
30
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeRealizeAuthorization } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
3
|
import { v7 } from "uuid";
|
|
5
4
|
|
|
6
5
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
6
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
7
|
+
import { transformPreviousAndLatestCorrectHistories } from "../../common/histories/transformPreviousAndLatestCorrectHistories";
|
|
8
8
|
import { IAutoBeRealizeFunctionFailure } from "../structures/IAutoBeRealizeFunctionFailure";
|
|
9
9
|
import { IAutoBeRealizeScenarioResult } from "../structures/IAutoBeRealizeScenarioResult";
|
|
10
|
-
import { printErrorHints } from "../utils/printErrorHints";
|
|
11
10
|
import { transformRealizeWriteHistories } from "./transformRealizeWriteHistories";
|
|
12
11
|
|
|
13
12
|
export function transformRealizeCorrectHistories(props: {
|
|
@@ -15,49 +14,33 @@ export function transformRealizeCorrectHistories(props: {
|
|
|
15
14
|
scenario: IAutoBeRealizeScenarioResult;
|
|
16
15
|
authorization: AutoBeRealizeAuthorization | null;
|
|
17
16
|
totalAuthorizations: AutoBeRealizeAuthorization[];
|
|
18
|
-
code: string;
|
|
19
17
|
dto: Record<string, string>;
|
|
20
18
|
failures: IAutoBeRealizeFunctionFailure[];
|
|
21
19
|
}): Array<
|
|
22
20
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
23
21
|
> {
|
|
24
|
-
|
|
22
|
+
const histories: Array<
|
|
23
|
+
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
24
|
+
> = [
|
|
25
25
|
...transformRealizeWriteHistories(props),
|
|
26
26
|
{
|
|
27
27
|
id: v7(),
|
|
28
28
|
created_at: new Date().toISOString(),
|
|
29
29
|
type: "systemMessage",
|
|
30
30
|
text: AutoBeSystemPromptConstant.COMMON_CORRECT_CASTING,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: v7(),
|
|
34
|
-
type: "assistantMessage",
|
|
35
|
-
text: StringUtil.trim`
|
|
36
|
-
Below is the code you made before. It's also something to review.
|
|
37
|
-
|
|
38
|
-
\`\`\`typescript
|
|
39
|
-
${props.code}
|
|
40
|
-
\`\`\`
|
|
41
|
-
`,
|
|
42
|
-
created_at: new Date().toISOString(),
|
|
43
|
-
},
|
|
44
|
-
...props.failures.map((f) => {
|
|
45
|
-
return {
|
|
46
|
-
id: v7(),
|
|
47
|
-
type: "assistantMessage",
|
|
48
|
-
text: StringUtil.trim`
|
|
49
|
-
This is a past code and an error with the code. Please refer to the annotation for the location of the error.
|
|
50
|
-
|
|
51
|
-
${printErrorHints(f.function.content, f.diagnostics)}
|
|
52
|
-
`,
|
|
53
|
-
created_at: new Date().toISOString(),
|
|
54
|
-
} satisfies IAgenticaHistoryJson.IAssistantMessage;
|
|
55
|
-
}),
|
|
31
|
+
} as IAgenticaHistoryJson.ISystemMessage,
|
|
56
32
|
{
|
|
57
33
|
id: v7(),
|
|
58
34
|
type: "systemMessage",
|
|
59
35
|
text: AutoBeSystemPromptConstant.REALIZE_CORRECT,
|
|
60
36
|
created_at: new Date().toISOString(),
|
|
61
|
-
},
|
|
37
|
+
} as IAgenticaHistoryJson.ISystemMessage,
|
|
38
|
+
...transformPreviousAndLatestCorrectHistories(
|
|
39
|
+
props.failures.map((f) => ({
|
|
40
|
+
script: f.function.content,
|
|
41
|
+
diagnostics: f.diagnostics,
|
|
42
|
+
})),
|
|
43
|
+
),
|
|
62
44
|
];
|
|
45
|
+
return histories;
|
|
63
46
|
}
|
|
@@ -1,294 +1,29 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
3
|
import { v7 } from "uuid";
|
|
5
4
|
|
|
5
|
+
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
|
+
|
|
6
7
|
export const transformRealizeWriteAuthorizationsHistories = (
|
|
7
8
|
operation: AutoBeOpenApi.IOperation,
|
|
8
|
-
|
|
9
|
+
payload: Record<string, string>,
|
|
9
10
|
): Array<IAgenticaHistoryJson.ISystemMessage> => {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Implementation Guidelines for Login:
|
|
24
|
-
|
|
25
|
-
### Login Operation Requirements
|
|
26
|
-
- This is a login endpoint that authenticates users
|
|
27
|
-
- Must validate credentials (username/email and password)
|
|
28
|
-
- Should return authentication tokens (access and refresh tokens)
|
|
29
|
-
- Must NOT require authentication decorator (this endpoint creates authentication)
|
|
30
|
-
- Should check if user exists and password matches
|
|
31
|
-
|
|
32
|
-
### MANDATORY: Use PasswordUtil for Password Verification
|
|
33
|
-
|
|
34
|
-
**CRITICAL**: You MUST use PasswordUtil utilities for password verification to ensure consistency with the join operation:
|
|
35
|
-
|
|
36
|
-
\`\`\`typescript
|
|
37
|
-
// Example: Password verification in login
|
|
38
|
-
const isValid = await PasswordUtil.verify(
|
|
39
|
-
body.password, // plain password from request
|
|
40
|
-
user.password_hash // hashed password from database
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
if (!isValid) {
|
|
44
|
-
throw new Error("Invalid credentials");
|
|
45
|
-
}
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
### JWT Token Generation
|
|
49
|
-
|
|
50
|
-
**NOTE**: The jsonwebtoken library is automatically imported as jwt. Use it to generate tokens with the EXACT payload structure:
|
|
51
|
-
|
|
52
|
-
**CRITICAL**: Use the predefined payload structures for consistency:
|
|
53
|
-
|
|
54
|
-
\`\`\`json
|
|
55
|
-
${JSON.stringify(payloads)}
|
|
56
|
-
\`\`\`
|
|
57
|
-
|
|
58
|
-
// JWT is already imported: import jwt from "jsonwebtoken";
|
|
59
|
-
|
|
60
|
-
// Generate access token with the EXACT payload structure for the user type
|
|
61
|
-
// DO NOT use type annotations like: const payload: MemberPayload = {...}
|
|
62
|
-
// Just create the payload object directly
|
|
63
|
-
|
|
64
|
-
const accessToken = jwt.sign(
|
|
65
|
-
{
|
|
66
|
-
userId: user.id,
|
|
67
|
-
email: user.email,
|
|
68
|
-
// ... other required fields from the payload structure above
|
|
69
|
-
},
|
|
70
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
71
|
-
{
|
|
72
|
-
expiresIn: '1h',
|
|
73
|
-
issuer: 'autobe' // MUST use 'autobe' as issuer
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Generate refresh token (optional)
|
|
78
|
-
const refreshToken = jwt.sign(
|
|
79
|
-
{
|
|
80
|
-
userId: user.id,
|
|
81
|
-
tokenType: 'refresh'
|
|
82
|
-
},
|
|
83
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
84
|
-
{
|
|
85
|
-
expiresIn: '7d',
|
|
86
|
-
issuer: 'autobe' // MUST use 'autobe' as issuer
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
// Decode tokens if needed (e.g., for verification)
|
|
91
|
-
const decoded = jwt.verify(token, MyGlobal.env.JWT_SECRET_KEY, {
|
|
92
|
-
issuer: 'autobe' // Verify issuer is 'autobe'
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
**DO NOT**:
|
|
96
|
-
- Implement your own password hashing logic
|
|
97
|
-
- Use bcrypt, argon2, or any other hashing library directly
|
|
98
|
-
- Try to hash and compare manually
|
|
99
|
-
|
|
100
|
-
**IMPORTANT**: Since this is a login operation, it must be publicly accessible without authentication.
|
|
101
|
-
`,
|
|
102
|
-
},
|
|
103
|
-
]
|
|
104
|
-
: [];
|
|
105
|
-
|
|
106
|
-
// Join (registration) operation 가이드
|
|
107
|
-
const joinGuide =
|
|
108
|
-
operation.authorizationType === "join"
|
|
109
|
-
? [
|
|
110
|
-
{
|
|
111
|
-
id: v7(),
|
|
112
|
-
created_at: new Date().toISOString(),
|
|
113
|
-
type: "systemMessage" as const,
|
|
114
|
-
text: StringUtil.trim`
|
|
115
|
-
# Authorization Type: Join (Registration)
|
|
116
|
-
|
|
117
|
-
This is a **join** operation for user registration.
|
|
118
|
-
|
|
119
|
-
## Implementation Guidelines for Join:
|
|
120
|
-
|
|
121
|
-
### Join (Registration) Operation Requirements
|
|
122
|
-
- This is a user registration endpoint
|
|
123
|
-
- Must validate all required user information
|
|
124
|
-
- Should check for duplicate accounts (email, username, etc.)
|
|
125
|
-
- Must hash passwords before storing (NEVER store plain passwords)
|
|
126
|
-
- Should create a new user record in the database
|
|
127
|
-
- Must NOT require authentication decorator (public endpoint)
|
|
128
|
-
|
|
129
|
-
### MANDATORY: Use PasswordUtil for Password Hashing
|
|
130
|
-
|
|
131
|
-
**CRITICAL**: You MUST use PasswordUtil utilities for password hashing to ensure consistency across all authentication operations:
|
|
132
|
-
|
|
133
|
-
\`\`\`typescript
|
|
134
|
-
// Example: Password hashing in join/registration
|
|
135
|
-
const hashedPassword = await PasswordUtil.hash(body.password);
|
|
136
|
-
|
|
137
|
-
// Store the hashed password in database
|
|
138
|
-
await MyGlobal.prisma.users.create({
|
|
139
|
-
data: {
|
|
140
|
-
email: body.email,
|
|
141
|
-
password_hash: hashedPassword, // Store the hash, never plain password
|
|
142
|
-
// ... other fields
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
\`\`\`
|
|
146
|
-
|
|
147
|
-
**DO NOT**:
|
|
148
|
-
- Store plain passwords in the database
|
|
149
|
-
- Use bcrypt, argon2, or any other hashing library directly
|
|
150
|
-
- Implement your own hashing logic
|
|
151
|
-
|
|
152
|
-
### JWT Token Generation After Registration
|
|
153
|
-
|
|
154
|
-
**NOTE**: The jsonwebtoken library is automatically imported as jwt. After successful registration, generate tokens with the EXACT payload structure:
|
|
155
|
-
|
|
156
|
-
**CRITICAL**: Use the predefined payload structures for consistency:
|
|
157
|
-
|
|
158
|
-
\`\`\`json
|
|
159
|
-
${JSON.stringify(payloads)}
|
|
160
|
-
\`\`\`
|
|
161
|
-
|
|
162
|
-
// JWT is already imported: import jwt from "jsonwebtoken";
|
|
163
|
-
|
|
164
|
-
// After creating the user, generate tokens with EXACT payload structure
|
|
165
|
-
// DO NOT use type annotations like: const payload: UserPayload = {...}
|
|
166
|
-
// Just create the payload object directly in jwt.sign()
|
|
167
|
-
|
|
168
|
-
const accessToken = jwt.sign(
|
|
169
|
-
{
|
|
170
|
-
userId: newUser.id,
|
|
171
|
-
email: newUser.email,
|
|
172
|
-
// ... other required fields from the payload structure above
|
|
173
|
-
},
|
|
174
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
175
|
-
{
|
|
176
|
-
expiresIn: '1h',
|
|
177
|
-
issuer: 'autobe' // MUST use 'autobe' as issuer
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
const refreshToken = jwt.sign(
|
|
182
|
-
{
|
|
183
|
-
userId: newUser.id,
|
|
184
|
-
tokenType: 'refresh'
|
|
185
|
-
},
|
|
186
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
187
|
-
{
|
|
188
|
-
expiresIn: '7d',
|
|
189
|
-
issuer: 'autobe' // MUST use 'autobe' as issuer
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
**IMPORTANT**: Since this is a registration operation, it must be publicly accessible. Always hash passwords before storing.
|
|
194
|
-
`,
|
|
195
|
-
},
|
|
196
|
-
]
|
|
197
|
-
: [];
|
|
198
|
-
|
|
199
|
-
// Refresh token operation 가이드
|
|
200
|
-
const refreshGuide =
|
|
201
|
-
operation.authorizationType === "refresh"
|
|
202
|
-
? [
|
|
203
|
-
{
|
|
204
|
-
id: v7(),
|
|
205
|
-
created_at: new Date().toISOString(),
|
|
206
|
-
type: "systemMessage" as const,
|
|
207
|
-
text: StringUtil.trim`
|
|
208
|
-
# Authorization Type: Refresh Token
|
|
209
|
-
|
|
210
|
-
This is a **refresh** token operation for renewing expired access tokens.
|
|
211
|
-
|
|
212
|
-
## Implementation Guidelines for Refresh:
|
|
213
|
-
|
|
214
|
-
### Refresh Token Operation Requirements
|
|
215
|
-
- This endpoint refreshes expired access tokens
|
|
216
|
-
- Must validate the refresh token first
|
|
217
|
-
- Should check if refresh token is not expired or revoked
|
|
218
|
-
- Must generate a new access token with THE SAME payload structure
|
|
219
|
-
- May also rotate the refresh token for security
|
|
220
|
-
- Should handle invalid/expired refresh tokens gracefully
|
|
221
|
-
- Typically requires the refresh token in request body or headers
|
|
222
|
-
- Must NOT require standard authentication (uses refresh token instead)
|
|
223
|
-
|
|
224
|
-
### CRITICAL: Refresh Token Implementation
|
|
225
|
-
|
|
226
|
-
**IMPORTANT**: When refreshing tokens, you MUST:
|
|
227
|
-
1. Decode and verify the refresh token
|
|
228
|
-
2. Extract the user information from the decoded token
|
|
229
|
-
3. Generate a new access token with THE SAME payload structure as the original
|
|
230
|
-
|
|
231
|
-
**CRITICAL**: Use the predefined payload structures for consistency:
|
|
232
|
-
|
|
233
|
-
\`\`\`json
|
|
234
|
-
${JSON.stringify(payloads)}
|
|
235
|
-
\`\`\`
|
|
236
|
-
|
|
237
|
-
// JWT is already imported: import jwt from "jsonwebtoken";
|
|
238
|
-
|
|
239
|
-
// Step 1: Verify and decode the refresh token
|
|
240
|
-
const decoded = jwt.verify(body.refreshToken, MyGlobal.env.JWT_SECRET_KEY, {
|
|
241
|
-
issuer: 'autobe'
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// Step 2: Get user data (from decoded token or database)
|
|
245
|
-
const user = await MyGlobal.prisma.users.findUnique({
|
|
246
|
-
where: { id: decoded.userId }
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
if (!user) {
|
|
250
|
-
throw new Error("User not found");
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Step 3: Generate new access token with SAME payload structure as login/join
|
|
254
|
-
const newAccessToken = jwt.sign(
|
|
255
|
-
{
|
|
256
|
-
userId: user.id,
|
|
257
|
-
email: user.email,
|
|
258
|
-
// ... other required fields from the payload structure above
|
|
259
|
-
// MUST match the structure used in login/join operations
|
|
260
|
-
},
|
|
261
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
262
|
-
{
|
|
263
|
-
expiresIn: '1h',
|
|
264
|
-
issuer: 'autobe'
|
|
265
|
-
}
|
|
266
|
-
);
|
|
267
|
-
|
|
268
|
-
// Optional: Rotate refresh token
|
|
269
|
-
const newRefreshToken = jwt.sign(
|
|
270
|
-
{
|
|
271
|
-
userId: user.id,
|
|
272
|
-
tokenType: 'refresh'
|
|
273
|
-
},
|
|
274
|
-
MyGlobal.env.JWT_SECRET_KEY,
|
|
275
|
-
{
|
|
276
|
-
expiresIn: '7d',
|
|
277
|
-
issuer: 'autobe'
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
**DO NOT**:
|
|
282
|
-
- Generate new access tokens with different payload structures
|
|
283
|
-
- Use random IDs like v4() in the payload
|
|
284
|
-
- Create tokens without verifying the refresh token first
|
|
285
|
-
- Use type annotations like: const payload: UserPayload = {...}
|
|
286
|
-
|
|
287
|
-
**IMPORTANT**: The new access token MUST have the same payload structure as the original token from login/join operations.
|
|
288
|
-
`,
|
|
289
|
-
},
|
|
290
|
-
]
|
|
291
|
-
: [];
|
|
11
|
+
if (operation.authorizationType === null) return [];
|
|
12
|
+
const text: string = PROMPTS[operation.authorizationType].replace(
|
|
13
|
+
"${PAYLOAD}",
|
|
14
|
+
JSON.stringify(payload),
|
|
15
|
+
);
|
|
16
|
+
const history: IAgenticaHistoryJson.ISystemMessage = {
|
|
17
|
+
id: v7(),
|
|
18
|
+
created_at: new Date().toISOString(),
|
|
19
|
+
type: "systemMessage" as const,
|
|
20
|
+
text,
|
|
21
|
+
};
|
|
22
|
+
return [history];
|
|
23
|
+
};
|
|
292
24
|
|
|
293
|
-
|
|
25
|
+
const PROMPTS = {
|
|
26
|
+
login: AutoBeSystemPromptConstant.REALIZE_MEMBERSHIP_LOGIN,
|
|
27
|
+
join: AutoBeSystemPromptConstant.REALIZE_MEMBERSHIP_JOIN,
|
|
28
|
+
refresh: AutoBeSystemPromptConstant.REALIZE_MEMBERSHIP_REFRESH,
|
|
294
29
|
};
|
|
@@ -17,9 +17,9 @@ import { IAutoBeFacadeApplicationProps } from "../../context/IAutoBeFacadeApplic
|
|
|
17
17
|
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
18
18
|
import { predicateStateMessage } from "../../utils/predicateStateMessage";
|
|
19
19
|
import { compileRealizeFiles } from "./internal/compileRealizeFiles";
|
|
20
|
-
import { orchestrateRealizeCorrectCasting } from "./orchestRateRealizeCorrectCasting";
|
|
21
20
|
import { orchestrateRealizeAuthorization } from "./orchestrateRealizeAuthorization";
|
|
22
21
|
import { orchestrateRealizeCorrect } from "./orchestrateRealizeCorrect";
|
|
22
|
+
import { orchestrateRealizeCorrectCasting } from "./orchestrateRealizeCorrectCasting";
|
|
23
23
|
import { orchestrateRealizeWrite } from "./orchestrateRealizeWrite";
|
|
24
24
|
import { IAutoBeRealizeScenarioResult } from "./structures/IAutoBeRealizeScenarioResult";
|
|
25
25
|
import { generateRealizeScenario } from "./utils/generateRealizeScenario";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
AutoBeAnalyzeActor,
|
|
4
4
|
AutoBeProgressEventBase,
|
|
5
5
|
AutoBeRealizeAuthorization,
|
|
6
6
|
AutoBeRealizeAuthorizationWriteEvent,
|
|
@@ -36,9 +36,9 @@ export async function orchestrateRealizeAuthorization<
|
|
|
36
36
|
created_at: new Date().toISOString(),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const actors: AutoBeAnalyzeActor[] = ctx.state().analyze?.actors ?? [];
|
|
40
40
|
const progress: AutoBeProgressEventBase = {
|
|
41
|
-
total:
|
|
41
|
+
total: actors.length,
|
|
42
42
|
completed: 0,
|
|
43
43
|
};
|
|
44
44
|
const templateFiles = await (
|
|
@@ -47,11 +47,11 @@ export async function orchestrateRealizeAuthorization<
|
|
|
47
47
|
dbms: "sqlite",
|
|
48
48
|
});
|
|
49
49
|
const authorizations: AutoBeRealizeAuthorization[] = await executeCachedBatch(
|
|
50
|
-
|
|
51
|
-
(
|
|
50
|
+
actors.map(
|
|
51
|
+
(a) => (promptCacheKey) =>
|
|
52
52
|
process(
|
|
53
53
|
ctx,
|
|
54
|
-
|
|
54
|
+
a,
|
|
55
55
|
InternalFileSystem.DEFAULT.map((el) => ({
|
|
56
56
|
[el]: templateFiles[el],
|
|
57
57
|
})).reduce((acc, cur) => Object.assign(acc, cur), {}),
|
|
@@ -71,7 +71,7 @@ export async function orchestrateRealizeAuthorization<
|
|
|
71
71
|
|
|
72
72
|
async function process<Model extends ILlmSchema.Model>(
|
|
73
73
|
ctx: AutoBeContext<Model>,
|
|
74
|
-
|
|
74
|
+
actor: AutoBeAnalyzeActor,
|
|
75
75
|
templateFiles: Record<string, string>,
|
|
76
76
|
progress: AutoBeProgressEventBase,
|
|
77
77
|
promptCacheKey: string,
|
|
@@ -82,7 +82,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
82
82
|
};
|
|
83
83
|
const { tokenUsage } = await ctx.conversate({
|
|
84
84
|
source: "realizeAuthorizationWrite",
|
|
85
|
-
histories: transformRealizeAuthorizationHistories(ctx,
|
|
85
|
+
histories: transformRealizeAuthorizationHistories(ctx, actor),
|
|
86
86
|
controller: createController({
|
|
87
87
|
model: ctx.model,
|
|
88
88
|
build: (next) => {
|
|
@@ -97,7 +97,7 @@ async function process<Model extends ILlmSchema.Model>(
|
|
|
97
97
|
|
|
98
98
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
99
99
|
const authorization: AutoBeRealizeAuthorization = {
|
|
100
|
-
|
|
100
|
+
actor: actor,
|
|
101
101
|
decorator: {
|
|
102
102
|
location: AuthorizationFileSystem.decoratorPath(
|
|
103
103
|
pointer.value.decorator.name,
|
|
@@ -29,13 +29,13 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
29
29
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
30
30
|
const providerContent: string = await compiler.typescript.beautify(
|
|
31
31
|
AutoBeRealizeAuthorizationReplaceImport.replaceProviderImport(
|
|
32
|
-
authorization.
|
|
32
|
+
authorization.actor.name,
|
|
33
33
|
authorization.provider.content,
|
|
34
34
|
),
|
|
35
35
|
);
|
|
36
36
|
const decoratorContent: string = await compiler.typescript.beautify(
|
|
37
37
|
AutoBeRealizeAuthorizationReplaceImport.replaceDecoratorImport(
|
|
38
|
-
authorization.
|
|
38
|
+
authorization.actor.name,
|
|
39
39
|
authorization.decorator.content,
|
|
40
40
|
),
|
|
41
41
|
);
|
|
@@ -116,7 +116,7 @@ export async function orchestrateRealizeAuthorizationCorrect<
|
|
|
116
116
|
pointer.value.payload.content,
|
|
117
117
|
),
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
actor: authorization.actor,
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
ctx.dispatch({
|