@autobe/agent 0.7.2 → 0.8.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 +4 -0
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +1 -1
- package/lib/index.mjs +100 -82
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +6 -7
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -5
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +8 -10
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +9 -6
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +3 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +5 -8
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +5 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +6 -7
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +11 -7
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +4 -6
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestProgress.js +2 -4
- package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +44 -14
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/test/transformTestScenarioHistories.js +2 -2
- package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
- package/lib/utils/enforceToolCall.d.ts +3 -0
- package/lib/utils/enforceToolCall.js +13 -0
- package/lib/utils/enforceToolCall.js.map +1 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +4 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +1 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +4 -9
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -6
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +14 -13
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +2 -1
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +4 -9
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -1
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +7 -8
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +10 -7
- package/src/orchestrate/test/orchestrateTestCorrect.ts +4 -8
- package/src/orchestrate/test/orchestrateTestProgress.ts +2 -5
- package/src/orchestrate/test/orchestrateTestScenario.ts +64 -16
- package/src/orchestrate/test/transformTestScenarioHistories.ts +2 -2
- package/src/utils/enforceToolCall.ts +13 -0
|
@@ -52,6 +52,7 @@ const tstl_1 = require("tstl");
|
|
|
52
52
|
const typia_1 = __importDefault(require("typia"));
|
|
53
53
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
54
|
const divideArray_1 = require("../../utils/divideArray");
|
|
55
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
55
56
|
const OpenApiEndpointComparator_1 = require("./OpenApiEndpointComparator");
|
|
56
57
|
const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
|
|
57
58
|
function orchestrateInterfaceOperations(ctx_1, endpoints_1) {
|
|
@@ -116,17 +117,14 @@ function process(ctx, endpoints) {
|
|
|
116
117
|
createApplication({
|
|
117
118
|
model: ctx.model,
|
|
118
119
|
build: (endpoints) => {
|
|
119
|
-
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = []);
|
|
122
|
+
pointer.value.push(...endpoints);
|
|
120
123
|
},
|
|
121
|
-
pointer,
|
|
122
124
|
}),
|
|
123
125
|
],
|
|
124
126
|
});
|
|
125
|
-
|
|
126
|
-
if (event.body.tools) {
|
|
127
|
-
event.body.tool_choice = "required";
|
|
128
|
-
}
|
|
129
|
-
}));
|
|
127
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
130
128
|
yield agentica.conversate([
|
|
131
129
|
"Make API operations for below endpoints:",
|
|
132
130
|
"",
|
|
@@ -395,7 +393,6 @@ function createApplication(props) {
|
|
|
395
393
|
}; })()(next);
|
|
396
394
|
if (result.success === false)
|
|
397
395
|
return result;
|
|
398
|
-
props.pointer.value = result.data.operations;
|
|
399
396
|
const errors = [];
|
|
400
397
|
result.data.operations.forEach((op, i) => {
|
|
401
398
|
if (op.method === "get" && op.requestBody !== null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceOperations.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceOperations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateInterfaceOperations.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceOperations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,wEAkCC;;AAhDD,yCAAoE;AAGpE,+BAAkD;AAClD,kDAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,iEAA8D;AAC9D,2EAAwE;AACxE,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,SAAoC,EACpC,WAAmB,EAAE;QAErB,MAAM,MAAM,GAAgC,IAAA,yBAAW,EAAC;YACtD,KAAK,EAAE,SAAS;YAChB,QAAQ;SACT,CAAC,CAAC;QACH,IAAI,SAAS,GAAW,CAAC,CAAC;QAC1B,MAAM,UAAU,GAAiC,MAAM,OAAO,CAAC,GAAG,CAChE,MAAM,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;;YACtB,MAAM,GAAG,GAA+B,MAAM,gBAAgB,CAC5D,GAAG,EACH,EAAE,EACF,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;gBACR,SAAS,IAAI,KAAK,CAAC;YACrB,CAAC,CACF,CAAC;YACF,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,qBAAqB;gBAC3B,UAAU,EAAE,GAAG;gBACf,SAAS;gBACT,KAAK,EAAE,SAAS,CAAC,MAAM;gBACvB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;gBACpC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACrC,CAAC,CAAC;YACH,OAAO,GAAG,CAAC;QACb,CAAC,CAAA,CAAC,CACH,CAAC;QACF,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;CAAA;AAED,SAAe,gBAAgB,CAC7B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -70,7 +70,11 @@ function orchestratePrismaComponents(ctx_1) {
|
|
|
70
70
|
createApplication({
|
|
71
71
|
model: ctx.model,
|
|
72
72
|
build: (next) => {
|
|
73
|
-
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = {
|
|
75
|
+
components: [],
|
|
76
|
+
});
|
|
77
|
+
pointer.value.components.push(...next.components);
|
|
74
78
|
},
|
|
75
79
|
}),
|
|
76
80
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePrismaComponent.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,
|
|
1
|
+
{"version":3,"file":"orchestratePrismaComponent.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,kEAoDC;;AArED,yCAKwB;AAKxB,kDAAoC;AACpC,+BAA0B;AAG1B,uEAAoE;AACpE,6FAA0F;AAE1F,SAAsB,2BAA2B;yDAG/C,GAAyB,EACzB,UAAkB,2DAA2D;;QAE7E,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,OAAO,GAA6C;YACxD,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,MAAM,GAAG,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,MAAM,mCAAI,IAAI,CAAC;QAEnD,MAAM,QAAQ,GAAyB,IAAI,oBAAa,CAAC;YACvD,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,oBACD,CAAC,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE,CAAC,CACtB;YACD,SAAS,EAAE,IAAA,uEAAkC,EAAC,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC;YAClE,UAAU,EAAE,GAAG,CAAC,KAAK,EAAE;YACvB,WAAW,EAAE;gBACX,iBAAiB,CAAC;oBAChB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;;wBACd,MAAA,OAAO,CAAC,KAAK,oCAAb,OAAO,CAAC,KAAK,GAAK;4BAChB,UAAU,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K,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SACqB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AutoBePrisma, IAutoBePrismaValidation } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestratePrismaCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, application: AutoBePrisma.IApplication,
|
|
4
|
+
export declare function orchestratePrismaCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, application: AutoBePrisma.IApplication, life?: number): Promise<IAutoBePrismaValidation>;
|
|
@@ -51,8 +51,9 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
51
51
|
const core_1 = require("@agentica/core");
|
|
52
52
|
const typia_1 = __importDefault(require("typia"));
|
|
53
53
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
54
55
|
const transformPrismaCorrectHistories_1 = require("./transformPrismaCorrectHistories");
|
|
55
|
-
function orchestratePrismaCorrect(ctx, application,
|
|
56
|
+
function orchestratePrismaCorrect(ctx, application, life = 4) {
|
|
56
57
|
const unique = new Set();
|
|
57
58
|
for (const file of application.files)
|
|
58
59
|
file.models = file.models.filter((model) => {
|
|
@@ -62,7 +63,7 @@ function orchestratePrismaCorrect(ctx, application, retry = 8) {
|
|
|
62
63
|
return true;
|
|
63
64
|
});
|
|
64
65
|
application.files = application.files.filter((f) => f.models.length !== 0);
|
|
65
|
-
return step(ctx, application,
|
|
66
|
+
return step(ctx, application, life);
|
|
66
67
|
}
|
|
67
68
|
function step(ctx, application, life) {
|
|
68
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -70,6 +71,8 @@ function step(ctx, application, life) {
|
|
|
70
71
|
const result = yield ctx.compiler.prisma.validate(application);
|
|
71
72
|
if (result.success)
|
|
72
73
|
return result; // SUCCESS
|
|
74
|
+
else if (life <= 0)
|
|
75
|
+
return result; // FAILURE
|
|
73
76
|
// VALIDATION FAILED
|
|
74
77
|
const schemas = yield ctx.compiler.prisma.write(application);
|
|
75
78
|
ctx.dispatch({
|
|
@@ -100,11 +103,7 @@ function step(ctx, application, life) {
|
|
|
100
103
|
}),
|
|
101
104
|
],
|
|
102
105
|
});
|
|
103
|
-
|
|
104
|
-
if (event.body.tools) {
|
|
105
|
-
event.body.tool_choice = "required";
|
|
106
|
-
}
|
|
107
|
-
});
|
|
106
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
108
107
|
// REQUEST CORRECTION
|
|
109
108
|
yield agentica.conversate("Resolve the compilation errors in the provided Prisma schema files.");
|
|
110
109
|
if (pointer.value === null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePrismaCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestratePrismaCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,4DAcC;;;AAzBD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uFAAoF;AAEpF,SAAgB,wBAAwB,CACtC,GAAyB,EACzB,WAAsC,EACtC,OAAe,CAAC;IAEhB,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,KAAK;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACzC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC;YACzC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,SAAe,IAAI,CACjB,GAAyB,EACzB,WAAsC,EACtC,IAAY;;;QAEZ,MAAM,MAAM,GACV,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,OAAO;YAChB,OAAO,MAAM,CAAC,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;CACpD,CAAC"}
|
|
@@ -51,6 +51,7 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
51
51
|
const core_1 = require("@agentica/core");
|
|
52
52
|
const typia_1 = __importDefault(require("typia"));
|
|
53
53
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
54
55
|
const transformPrismaSchemaHistories_1 = require("./transformPrismaSchemaHistories");
|
|
55
56
|
function orchestratePrismaSchemas(ctx, components) {
|
|
56
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -94,17 +95,20 @@ function process(ctx, component) {
|
|
|
94
95
|
createApplication({
|
|
95
96
|
model: ctx.model,
|
|
96
97
|
build: (next) => {
|
|
97
|
-
|
|
98
|
-
pointer.value.
|
|
98
|
+
var _a;
|
|
99
|
+
(_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = {
|
|
100
|
+
file: {
|
|
101
|
+
filename: component.filename,
|
|
102
|
+
namespace: next.file.namespace,
|
|
103
|
+
models: [],
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
pointer.value.file.models.push(...next.file.models);
|
|
99
107
|
},
|
|
100
108
|
}),
|
|
101
109
|
],
|
|
102
110
|
});
|
|
103
|
-
|
|
104
|
-
if (event.body.tools) {
|
|
105
|
-
event.body.tool_choice = "required";
|
|
106
|
-
}
|
|
107
|
-
}));
|
|
111
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
108
112
|
yield agentica.conversate("Make prisma schema file please");
|
|
109
113
|
if (pointer.value === null)
|
|
110
114
|
throw new Error("Unreachable code: Prisma Schema not generated");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestratePrismaSchema.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -8,7 +8,7 @@ const transformPrismaCorrectHistories = (result) => {
|
|
|
8
8
|
id: (0, uuid_1.v4)(),
|
|
9
9
|
created_at: new Date().toISOString(),
|
|
10
10
|
type: "systemMessage",
|
|
11
|
-
text: "# `AutoBePrisma` Targeted Validation Error Fixing Agent\n\nYou are a world-class Prisma schema validation and error resolution specialist working with structured `AutoBePrisma` definitions. Your primary mission is to analyze validation errors in `IAutoBePrismaValidation.IFailure` responses and provide precise fixes for **ONLY the affected tables/models** while maintaining complete schema integrity and business logic.\n\n## Core Operating Principles\n\n### \uD83D\uDEAB ABSOLUTE PROHIBITIONS\n- **NEVER ask for clarification** - analyze and fix validation errors directly\n- **NEVER remove or modify existing business logic** unless it causes validation errors\n- **NEVER delete model descriptions or field descriptions** unless removing duplicate elements\n- **NEVER create new duplicate fields, relations, or models**\n- **NEVER ignore validation errors** - every error must be addressed\n- **NEVER break existing relationships** unless they're causing validation errors\n- **NEVER change data types** unless specifically required by validation errors\n- **\uD83D\uDD34 CRITICAL: NEVER delete fields or relationships to avoid compilation errors**\n- **\uD83D\uDD34 CRITICAL: Only delete elements when they are EXACT DUPLICATES of existing elements**\n- **\uD83D\uDD34 CRITICAL: Always FIX errors by correction, not by removal (unless duplicate)**\n- **\uD83D\uDD34 CRITICAL: NEVER modify tables/models that are not mentioned in validation errors**\n\n### \u2705 MANDATORY REQUIREMENTS\n- **Fix ONLY validation errors** listed in the IAutoBePrismaValidation.IFailure.errors array\n- **Return ONLY the corrected models/tables** that had validation errors\n- **Preserve business intent** and architectural patterns from original schema\n- **Maintain referential integrity** with unchanged models\n- **Preserve ALL model and field descriptions** (except for removed duplicates)\n- **Keep original naming conventions** unless they cause validation errors\n- **\uD83D\uDFE2 PRIORITY: Correct errors through proper fixes, not deletions**\n- **\uD83D\uDFE2 PRIORITY: Maintain ALL business functionality and data structure**\n- **\uD83D\uDFE2 PRIORITY: Minimize output scope to only affected models**\n\n## Targeted Fix Strategy\n\n### 1. Error Scope Analysis\n\n#### Error Filtering Process\n```typescript\ninterface IError {\n path: string; // File path where error occurs\n table: string; // Model name with the error - TARGET FOR FIX\n column: string | null; // Field name (null for model-level errors)\n message: string; // Detailed error description\n}\n```\n\n#### Affected Model Identification\n1. **Extract unique table names** from all errors in IError[] array\n2. **Group errors by table** for efficient processing\n3. **Identify cross-table dependencies** that need consideration\n4. **Focus ONLY on models mentioned in errors** - ignore all others\n5. **Track relationship impacts** on non-error models (for reference validation only)\n\n### 2. Targeted Error Resolution\n\n#### Model-Level Fixes (Scope: Single Model)\n- **Duplicate model names**: Rename affected model only\n- **Invalid model names**: Update naming convention for specific model\n- **Missing primary keys**: Add/fix primary key in affected model only\n- **Materialized view issues**: Fix material flag and naming for specific model\n\n#### Field-Level Fixes (Scope: Specific Fields in Error Models)\n- **Duplicate field names**: Fix only within the affected model\n- **Invalid field types**: Update types for specific fields only\n- **Missing foreign keys**: Add required foreign keys to affected model only\n- **Foreign key reference errors**: Fix references in affected model only\n\n#### Relationship Fixes (Scope: Affected Model Relations)\n- **Invalid target model references**: Update references in error model only\n- **Missing relation configurations**: Add/fix relations in affected model only\n- **Relation naming conflicts**: Resolve conflicts within affected model only\n\n#### Index Fixes (Scope: Affected Model Indexes)\n- **Invalid field references**: Fix index fieldNames in affected model only\n- **Single foreign key indexes**: Restructure indexes in affected model only\n- **Duplicate indexes**: Remove duplicates within affected model only\n\n### 3. Cross-Model Impact Analysis\n\n#### Reference Validation (Read-Only for Non-Error Models)\n- **Verify target model existence** for foreign key references\n- **Check target field validity** (usually \"id\" primary key)\n- **Validate bidirectional relationship consistency**\n- **Ensure renamed model references are updated** in other models\n\n#### Dependency Tracking\n- **Identify models that reference** the corrected models\n- **Note potential cascade effects** of model/field renaming\n- **Flag models that may need reference updates** (for external handling)\n- **Maintain awareness of schema-wide implications**\n\n### 4. Minimal Output Strategy\n\n#### Output Scope Determination\n**Include in output ONLY:**\n1. **Models explicitly mentioned in validation errors**\n2. **Models with fields that reference renamed models** (if any)\n3. **Models that require relationship updates** due to fixes\n\n**Exclude from output:**\n1. **Models with no validation errors**\n2. **Models not affected by fixes**\n3. **Models that maintain valid references to corrected models**\n\n#### Fix Documentation\nFor each corrected model, provide:\n- **Original error description**\n- **Applied fix explanation**\n- **Impact on other models** (reference updates needed)\n- **Business logic preservation confirmation**\n\n## Error Resolution Workflow\n\n### 1. Error Parsing & Scope Definition\n1. **Parse IAutoBePrismaValidation.IFailure** structure\n2. **Extract unique table names** from error array\n3. **Group errors by affected model** for batch processing\n4. **Identify minimal fix scope** - only what's necessary\n5. **Plan cross-model reference updates** (if needed)\n\n### 2. Targeted Fix Planning\n1. **Analyze each error model individually**\n2. **Plan fixes for each affected model**\n3. **Check for inter-model dependency impacts**\n4. **Determine minimal output scope**\n5. **Validate fix feasibility without breaking references**\n\n### 3. Precision Fix Implementation\n1. **Apply fixes ONLY to error models**\n2. **Update cross-references ONLY if needed**\n3. **Preserve all unchanged model integrity**\n4. **Maintain business logic in fixed models**\n5. **Verify minimal scope compliance**\n\n### 4. Output Validation\n1. **Confirm all errors are addressed** in affected models\n2. **Verify no new validation issues** in fixed models\n3. **Check reference integrity** with unchanged models\n4. **Validate business logic preservation** in corrected models\n5. **Ensure minimal output scope** - no unnecessary models included\n\n## Input/Output Format\n\n### Input Structure\n```typescript\n{\n success: false,\n application: AutoBePrisma.IApplication, // Full schema for reference\n errors: IError[] // Target models for fixing\n}\n```\n\n### Output Requirement\nReturn ONLY corrected models that had validation errors:\n```typescript\nconst correctedModels: AutoBePrisma.IModel[] = [\n // ONLY models mentioned in IError[] array\n // ONLY models affected by cross-reference updates\n // All other models are preserved unchanged\n];\n\n// Include metadata about the fix scope\nconst fixSummary = {\n correctedModels: string[], // Names of models that were fixed\n crossReferenceUpdates: string[], // Models that needed reference updates\n preservedModels: string[], // Models that remain unchanged\n errorsCorrected: number // Count of resolved errors\n};\n```\n\n## Targeted Correction Examples\n\n### Example 1: Single Model Duplicate Field Error\n**Input Error:**\n```typescript\n{\n path: \"users.prisma\",\n table: \"users\",\n column: \"email\",\n message: \"Duplicate field 'email' in model 'users'\"\n}\n```\n\n**Output:** Only the `users` model with the duplicate field resolved\n- **Scope:** 1 model\n- **Change:** Rename one `email` field to `email_secondary` or merge if identical\n- **Excluded:** All other models remain unchanged\n\n### Example 2: Cross-Model Reference Error\n**Input Error:**\n```typescript\n{\n path: \"orders.prisma\",\n table: \"orders\",\n column: \"user_id\",\n message: \"Invalid target model 'user' for foreign key 'user_id'\"\n}\n```\n\n**Output:** Only the `orders` model with corrected reference\n- **Scope:** 1 model (orders)\n- **Change:** Update `targetModel` from \"user\" to \"users\"\n- **Excluded:** The `users` model remains unchanged (just referenced correctly)\n\n### Example 3: Model Name Duplication Across Files\n**Input Errors:**\n```typescript\n[\n {\n path: \"auth/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n },\n {\n path: \"admin/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n }\n]\n```\n\n**Output:** Both affected `users` models with one renamed\n- **Scope:** 2 models\n- **Change:** Rename one to `admin_users`, update all its references\n- **Excluded:** All other models that don't reference the renamed model\n\n## Critical Success Criteria\n\n### \u2705 Must Achieve (Targeted Scope)\n- [ ] All validation errors resolved **for mentioned models only**\n- [ ] Original business logic preserved **in corrected models**\n- [ ] Cross-model references remain valid **through minimal updates**\n- [ ] Output contains **ONLY affected models** - no unnecessary inclusions\n- [ ] Referential integrity maintained **with unchanged models**\n- [ ] **\uD83D\uDD34 MINIMAL SCOPE: Only error models + necessary reference updates**\n- [ ] **\uD83D\uDD34 UNCHANGED MODELS: Preserved completely in original schema**\n\n### \uD83D\uDEAB Must Avoid (Scope Violations)\n- [ ] Including models without validation errors in output\n- [ ] Modifying models not mentioned in error array\n- [ ] Returning entire schema when only partial fixes needed\n- [ ] Making unnecessary changes beyond error resolution\n- [ ] Breaking references to unchanged models\n- [ ] **\uD83D\uDD34 SCOPE CREEP: Fixing models that don't have errors**\n- [ ] **\uD83D\uDD34 OUTPUT BLOAT: Including unchanged models in response**\n\n## Quality Assurance Process\n\n### Pre-Output Scope Validation\n1. **Error Coverage Check**: Every error in IError[] array addressed **in minimal scope**\n2. **Output Scope Audit**: Only affected models included in response\n3. **Reference Integrity**: Unchanged models maintain valid references\n4. **Business Logic Preservation**: Corrected models maintain original intent\n5. **Cross-Model Impact**: Necessary reference updates identified and applied\n6. ****\uD83D\uDD34 Minimal Output Verification**: No unnecessary models in response**\n7. **\uD83D\uDD34 Unchanged Model Preservation**: Non-error models completely preserved**\n\n### Targeted Response Validation Questions\n- Are all validation errors resolved **with minimal model changes**?\n- Does the output include **ONLY models that had errors** or needed reference updates?\n- Are **unchanged models completely preserved** in the original schema?\n- Do **cross-model references remain valid** after targeted fixes?\n- Is the **business logic maintained** in all corrected models?\n- **\uD83D\uDD34 Is the output scope minimized** to only necessary corrections?\n- **\uD83D\uDD34 Are non-error models excluded** from the response?\n\n## \uD83C\uDFAF CORE PRINCIPLE REMINDER\n\n**Your role is TARGETED ERROR CORRECTOR, not SCHEMA RECONSTRUCTOR**\n\n- Fix **ONLY the models with validation errors**\n- Preserve **ALL unchanged models** in their original state\n- Return **MINIMAL output scope** - only what was corrected\n- Maintain **referential integrity** with unchanged models\n- **Focus on precision fixes, not comprehensive rebuilds**\n\nRemember: Your goal is to be a surgical validation error resolver, fixing only what's broken while preserving the integrity of the unchanged schema components. **Minimize context usage by returning only the corrected models, not the entire schema.**" /* AutoBeSystemPromptConstant.PRISMA_CORRECT */,
|
|
11
|
+
text: "# `AutoBePrisma` Targeted Validation Error Fixing Agent\n\nYou are a world-class Prisma schema validation and error resolution specialist working with structured `AutoBePrisma` definitions. Your primary mission is to analyze validation errors in `IAutoBePrismaValidation.IFailure` responses and provide precise fixes for **ONLY the affected tables/models** while maintaining complete schema integrity and business logic.\n\n## Core Operating Principles\n\n### \uD83D\uDEAB ABSOLUTE PROHIBITIONS\n- **NEVER ask for clarification** - analyze and fix validation errors directly\n- **NEVER remove or modify existing business logic** unless it causes validation errors\n- **NEVER delete model descriptions or field descriptions** unless removing duplicate elements\n- **NEVER create new duplicate fields, relations, or models**\n- **NEVER ignore validation errors** - every error must be addressed\n- **NEVER break existing relationships** unless they're causing validation errors\n- **NEVER change data types** unless specifically required by validation errors\n- **\uD83D\uDD34 CRITICAL: NEVER delete fields or relationships to avoid compilation errors**\n- **\uD83D\uDD34 CRITICAL: Only delete elements when they are EXACT DUPLICATES of existing elements**\n- **\uD83D\uDD34 CRITICAL: Always FIX errors by correction, not by removal (unless duplicate)**\n- **\uD83D\uDD34 CRITICAL: NEVER modify tables/models that are not mentioned in validation errors**\n- **\uD83D\uDD34 CRITICAL: NEVER make multiple function calls - execute ALL fixes in a SINGLE function call only**\n\n### \u2705 MANDATORY REQUIREMENTS\n- **\uD83D\uDD25 CRITICAL: MUST execute exactly ONE function call** - this is absolutely required, no exceptions\n- **\uD83D\uDD25 CRITICAL: NEVER respond without making a function call** - function calling is mandatory for all validation error fixes\n- **Fix ONLY validation errors** listed in the IAutoBePrismaValidation.IFailure.errors array\n- **Return ONLY the corrected models/tables** that had validation errors\n- **Preserve business intent** and architectural patterns from original schema\n- **Maintain referential integrity** with unchanged models\n- **Preserve ALL model and field descriptions** (except for removed duplicates)\n- **Keep original naming conventions** unless they cause validation errors\n- **\uD83D\uDFE2 PRIORITY: Correct errors through proper fixes, not deletions**\n- **\uD83D\uDFE2 PRIORITY: Maintain ALL business functionality and data structure**\n- **\uD83D\uDFE2 PRIORITY: Minimize output scope to only affected models**\n- **\uD83D\uDFE2 PRIORITY: Execute ALL corrections in ONE SINGLE function call - never use parallel or multiple calls**\n\n## Function Calling Protocol\n\n### \uD83D\uDD25 CRITICAL FUNCTION CALLING RULES\n- **FUNCTION CALLING IS MANDATORY** - you MUST make exactly one function call for every validation error fixing task\n- **NEVER provide a response without making a function call** - this is absolutely required\n- **EXECUTE ONLY ONE FUNCTION CALL** throughout the entire correction process\n- **NEVER use parallel function calls** - all fixes must be consolidated into a single invocation\n- **NEVER make sequential function calls** - plan all corrections and execute them together\n- **BATCH ALL CORRECTIONS** into one comprehensive function call\n- **NO EXCEPTIONS** - regardless of error complexity, use only one function call\n- **NO TEXT-ONLY RESPONSES** - always include the corrected models via function call\n\n### Single-Call Strategy\n1. **Analyze ALL validation errors** before making any function calls\n2. **Plan ALL corrections** for all affected models simultaneously\n3. **Consolidate ALL fixes** into one comprehensive correction set\n4. **Execute ONE FUNCTION CALL** containing all corrected models\n5. **Never iterate** - get it right in the single call\n\n## Targeted Fix Strategy\n\n### 1. Error Scope Analysis\n\n#### Error Filtering Process\n```typescript\ninterface IError {\n path: string; // File path where error occurs\n table: string; // Model name with the error - TARGET FOR FIX\n column: string | null; // Field name (null for model-level errors)\n message: string; // Detailed error description\n}\n```\n\n#### Affected Model Identification\n1. **Extract unique table names** from all errors in IError[] array\n2. **Group errors by table** for efficient processing\n3. **Identify cross-table dependencies** that need consideration\n4. **Focus ONLY on models mentioned in errors** - ignore all others\n5. **Track relationship impacts** on non-error models (for reference validation only)\n\n### 2. Targeted Error Resolution\n\n#### Model-Level Fixes (Scope: Single Model)\n- **Duplicate model names**: Rename affected model only\n- **Invalid model names**: Update naming convention for specific model\n- **Missing primary keys**: Add/fix primary key in affected model only\n- **Materialized view issues**: Fix material flag and naming for specific model\n\n#### Field-Level Fixes (Scope: Specific Fields in Error Models)\n- **Duplicate field names**: Fix only within the affected model\n- **Invalid field types**: Update types for specific fields only\n- **Missing foreign keys**: Add required foreign keys to affected model only\n- **Foreign key reference errors**: Fix references in affected model only\n\n#### Relationship Fixes (Scope: Affected Model Relations)\n- **Invalid target model references**: Update references in error model only\n- **Missing relation configurations**: Add/fix relations in affected model only\n- **Relation naming conflicts**: Resolve conflicts within affected model only\n\n#### Index Fixes (Scope: Affected Model Indexes)\n- **Invalid field references**: Fix index fieldNames in affected model only\n- **Single foreign key indexes**: Restructure indexes in affected model only\n- **Duplicate indexes**: Remove duplicates within affected model only\n\n### 3. Cross-Model Impact Analysis\n\n#### Reference Validation (Read-Only for Non-Error Models)\n- **Verify target model existence** for foreign key references\n- **Check target field validity** (usually \"id\" primary key)\n- **Validate bidirectional relationship consistency**\n- **Ensure renamed model references are updated** in other models\n\n#### Dependency Tracking\n- **Identify models that reference** the corrected models\n- **Note potential cascade effects** of model/field renaming\n- **Flag models that may need reference updates** (for external handling)\n- **Maintain awareness of schema-wide implications**\n\n### 4. Minimal Output Strategy\n\n#### Output Scope Determination\n**Include in output ONLY:**\n1. **Models explicitly mentioned in validation errors**\n2. **Models with fields that reference renamed models** (if any)\n3. **Models that require relationship updates** due to fixes\n\n**Exclude from output:**\n1. **Models with no validation errors**\n2. **Models not affected by fixes**\n3. **Models that maintain valid references to corrected models**\n\n#### Fix Documentation\nFor each corrected model, provide:\n- **Original error description**\n- **Applied fix explanation**\n- **Impact on other models** (reference updates needed)\n- **Business logic preservation confirmation**\n\n## Error Resolution Workflow\n\n### 1. Error Parsing & Scope Definition\n1. **Parse IAutoBePrismaValidation.IFailure** structure\n2. **Extract unique table names** from error array\n3. **Group errors by affected model** for batch processing\n4. **Identify minimal fix scope** - only what's necessary\n5. **Plan cross-model reference updates** (if needed)\n\n### 2. Targeted Fix Planning\n1. **Analyze each error model individually**\n2. **Plan fixes for each affected model**\n3. **Check for inter-model dependency impacts**\n4. **Determine minimal output scope**\n5. **Validate fix feasibility without breaking references**\n6. **\uD83D\uDD25 CONSOLIDATE ALL PLANNED FIXES** for single function call execution\n\n### 3. Precision Fix Implementation\n1. **Apply fixes ONLY to error models**\n2. **Update cross-references ONLY if needed**\n3. **Preserve all unchanged model integrity**\n4. **Maintain business logic in fixed models**\n5. **Verify minimal scope compliance**\n6. **\uD83D\uDD25 EXECUTE ALL FIXES IN ONE FUNCTION CALL**\n\n### 4. Output Validation\n1. **Confirm all errors are addressed** in affected models\n2. **Verify no new validation issues** in fixed models\n3. **Check reference integrity** with unchanged models\n4. **Validate business logic preservation** in corrected models\n5. **Ensure minimal output scope** - no unnecessary models included\n6. **\uD83D\uDD25 VERIFY SINGLE FUNCTION CALL COMPLETION** - no additional calls needed\n\n## Input/Output Format\n\n### Input Structure\n```typescript\n{\n success: false,\n application: AutoBePrisma.IApplication, // Full schema for reference\n errors: IError[] // Target models for fixing\n}\n```\n\n### Output Requirement\nReturn ONLY corrected models that had validation errors:\n```typescript\nconst correctedModels: AutoBePrisma.IModel[] = [\n // ONLY models mentioned in IError[] array\n // ONLY models affected by cross-reference updates\n // All other models are preserved unchanged\n];\n```\n\n## Targeted Correction Examples\n\n### Example 1: Single Model Duplicate Field Error\n**Input Error:**\n```typescript\n{\n path: \"users.prisma\",\n table: \"users\",\n column: \"email\",\n message: \"Duplicate field 'email' in model 'users'\"\n}\n```\n\n**Output:** Only the `users` model with the duplicate field resolved\n- **Scope:** 1 model\n- **Change:** Rename one `email` field to `email_secondary` or merge if identical\n- **Excluded:** All other models remain unchanged\n- **\uD83D\uDD25 Function Calls:** Exactly 1 function call with the corrected users model\n\n### Example 2: Cross-Model Reference Error\n**Input Error:**\n```typescript\n{\n path: \"orders.prisma\",\n table: \"orders\",\n column: \"user_id\",\n message: \"Invalid target model 'user' for foreign key 'user_id'\"\n}\n```\n\n**Output:** Only the `orders` model with corrected reference\n- **Scope:** 1 model (orders)\n- **Change:** Update `targetModel` from \"user\" to \"users\"\n- **Excluded:** The `users` model remains unchanged (just referenced correctly)\n- **\uD83D\uDD25 Function Calls:** Exactly 1 function call with the corrected orders model\n\n### Example 3: Model Name Duplication Across Files\n**Input Errors:**\n```typescript\n[\n {\n path: \"auth/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n },\n {\n path: \"admin/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n }\n]\n```\n\n**Output:** Both affected `users` models with one renamed\n- **Scope:** 2 models\n- **Change:** Rename one to `admin_users`, update all its references\n- **Excluded:** All other models that don't reference the renamed model\n- **\uD83D\uDD25 Function Calls:** Exactly 1 function call with BOTH corrected users models\n\n## Critical Success Criteria\n\n### \u2705 Must Achieve (Targeted Scope)\n- [ ] **\uD83D\uDD25 MANDATORY FUNCTION CALL: Exactly one function call executed** - this is absolutely required\n- [ ] All validation errors resolved **for mentioned models only**\n- [ ] Original business logic preserved **in corrected models**\n- [ ] Cross-model references remain valid **through minimal updates**\n- [ ] Output contains **ONLY affected models** - no unnecessary inclusions\n- [ ] Referential integrity maintained **with unchanged models**\n- [ ] **\uD83D\uDD34 MINIMAL SCOPE: Only error models + necessary reference updates**\n- [ ] **\uD83D\uDD34 UNCHANGED MODELS: Preserved completely in original schema**\n- [ ] **\uD83D\uDD25 SINGLE FUNCTION CALL: All corrections executed in exactly one function call**\n\n### \uD83D\uDEAB Must Avoid (Scope Violations)\n- [ ] **\uD83D\uDD25 NO FUNCTION CALL: Responding without making any function call** - this is absolutely prohibited\n- [ ] Including models without validation errors in output\n- [ ] Modifying models not mentioned in error array\n- [ ] Returning entire schema when only partial fixes needed\n- [ ] Making unnecessary changes beyond error resolution\n- [ ] Breaking references to unchanged models\n- [ ] **\uD83D\uDD34 SCOPE CREEP: Fixing models that don't have errors**\n- [ ] **\uD83D\uDD34 OUTPUT BLOAT: Including unchanged models in response**\n- [ ] **\uD83D\uDD25 MULTIPLE FUNCTION CALLS: Making more than one function call**\n- [ ] **\uD83D\uDD25 PARALLEL CALLS: Using parallel function execution**\n- [ ] **\uD83D\uDD25 TEXT-ONLY RESPONSES: Providing corrections without function calls**\n\n## Quality Assurance Process\n\n### Pre-Output Scope Validation\n1. **Error Coverage Check**: Every error in IError[] array addressed **in minimal scope**\n2. **Output Scope Audit**: Only affected models included in response\n3. **Reference Integrity**: Unchanged models maintain valid references\n4. **Business Logic Preservation**: Corrected models maintain original intent\n5. **Cross-Model Impact**: Necessary reference updates identified and applied\n6. **\uD83D\uDD34 Minimal Output Verification**: No unnecessary models in response**\n7. **\uD83D\uDD34 Unchanged Model Preservation**: Non-error models completely preserved**\n8. **\uD83D\uDD25 Single Call Verification**: All fixes consolidated into one function call**\n\n### Targeted Response Validation Questions\n- Are all validation errors resolved **with minimal model changes**?\n- Does the output include **ONLY models that had errors** or needed reference updates?\n- Are **unchanged models completely preserved** in the original schema?\n- Do **cross-model references remain valid** after targeted fixes?\n- Is the **business logic maintained** in all corrected models?\n- **\uD83D\uDD34 Is the output scope minimized** to only necessary corrections?\n- **\uD83D\uDD34 Are non-error models excluded** from the response?\n- **\uD83D\uDD25 Were ALL corrections executed in exactly ONE function call?**\n- **\uD83D\uDD25 Are there NO parallel or sequential function calls?**\n\n## \uD83C\uDFAF CORE PRINCIPLE REMINDER\n\n**Your role is TARGETED ERROR CORRECTOR, not SCHEMA RECONSTRUCTOR**\n\n- **\uD83D\uDD25 ALWAYS make exactly ONE function call** - this is mandatory for every response\n- Fix **ONLY the models with validation errors**\n- Preserve **ALL unchanged models** in their original state\n- Return **MINIMAL output scope** - only what was corrected\n- Maintain **referential integrity** with unchanged models\n- **Focus on precision fixes, not comprehensive rebuilds**\n- **\uD83D\uDD25 EXECUTE ALL CORRECTIONS IN EXACTLY ONE FUNCTION CALL**\n\nRemember: Your goal is to be a surgical validation error resolver, fixing only what's broken while preserving the integrity of the unchanged schema components. **Minimize context usage by returning only the corrected models, not the entire schema.** **Most importantly, consolidate ALL your corrections into a single function call - never use multiple or parallel function calls under any circumstances.** **NEVER respond without making a function call - this is absolutely mandatory for all validation error correction tasks.**" /* AutoBeSystemPromptConstant.PRISMA_CORRECT */,
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
id: (0, uuid_1.v4)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaCorrectHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAInB,MAAM,+BAA+B,GAAG,CAC7C,MAAwC,EAGxC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"transformPrismaCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaCorrectHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAInB,MAAM,+BAA+B,GAAG,CAC7C,MAAwC,EAGxC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,66dAA2C;SAChD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC3B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC7B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE;gBACJ,iCAAiC;gBACjC,oCAAoC;gBACpC,sCAAsC;gBACtC,EAAE;;aAEH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,+BAA+B,mCAiD1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AutoBeTestProgressEvent, AutoBeTestValidateEvent } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateTestCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, codes: AutoBeTestProgressEvent[],
|
|
4
|
+
export declare function orchestrateTestCorrect<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, codes: AutoBeTestProgressEvent[], life?: number): Promise<AutoBeTestValidateEvent>;
|
|
@@ -50,9 +50,10 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
51
|
const typia_1 = __importDefault(require("typia"));
|
|
52
52
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
53
54
|
const transformTestCorrectHistories_1 = require("./transformTestCorrectHistories");
|
|
54
55
|
function orchestrateTestCorrect(ctx_1, codes_1) {
|
|
55
|
-
return __awaiter(this, arguments, void 0, function* (ctx, codes,
|
|
56
|
+
return __awaiter(this, arguments, void 0, function* (ctx, codes, life = 4) {
|
|
56
57
|
var _a, _b;
|
|
57
58
|
// 1) Build map of new test files from progress events
|
|
58
59
|
const testFiles = Object.fromEntries(codes.map(({ filename, content }) => [
|
|
@@ -66,7 +67,7 @@ function orchestrateTestCorrect(ctx_1, codes_1) {
|
|
|
66
67
|
const files = Object.fromEntries(Object.entries(mergedFiles).filter(([filename]) => (filename.endsWith(".ts") && !filename.startsWith("test/benchmark/")) ||
|
|
67
68
|
filename.endsWith(".json")));
|
|
68
69
|
// 4) Ask the LLM to correct the filtered file set
|
|
69
|
-
const response = yield step(ctx, files,
|
|
70
|
+
const response = yield step(ctx, files, life);
|
|
70
71
|
// 5) Combine original + corrected files and dispatch event
|
|
71
72
|
const event = Object.assign(Object.assign({}, response), { type: "testValidate", files: Object.assign(Object.assign({}, mergedFiles), response.files) });
|
|
72
73
|
return event;
|
|
@@ -220,10 +221,7 @@ function process(ctx, diagnostics, code) {
|
|
|
220
221
|
}),
|
|
221
222
|
],
|
|
222
223
|
});
|
|
223
|
-
|
|
224
|
-
if (event.body.tools)
|
|
225
|
-
event.body.tool_choice = "required";
|
|
226
|
-
}));
|
|
224
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
227
225
|
yield agentica.conversate([
|
|
228
226
|
"Fix the compilation error in the provided code.",
|
|
229
227
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateTestCorrect.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestCorrect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,wDAyCC;;AAxDD,yCAAoE;AAQpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,mFAAgF;AAEhF,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;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -50,6 +50,7 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
51
|
const typia_1 = __importDefault(require("typia"));
|
|
52
52
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
53
54
|
const transformTestProgressHistories_1 = require("./transformTestProgressHistories");
|
|
54
55
|
function orchestrateTestProgress(ctx, scenarios) {
|
|
55
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -123,10 +124,7 @@ function process(ctx, scenario) {
|
|
|
123
124
|
}),
|
|
124
125
|
],
|
|
125
126
|
});
|
|
126
|
-
|
|
127
|
-
if (event.body.tools)
|
|
128
|
-
event.body.tool_choice = "required";
|
|
129
|
-
}));
|
|
127
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
130
128
|
yield agentica.conversate([
|
|
131
129
|
"Create test code for below scenario:",
|
|
132
130
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateTestProgress.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestProgress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,0DA+BC;;AA1CD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,qFAAkF;AAElF,SAAsB,uBAAuB,CAC3C,GAAyB,EACzB,SAAgC;;QAEhC,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,QAAQ,GAAW,CAAC,CAAC;QAEzB,MAAM,MAAM,GAA8B,MAAM,OAAO,CAAC,GAAG;QACzD;;;;WAIG;QACH,SAAS,CAAC,GAAG,CAAC,CAAO,QAAQ,EAAE,EAAE;;YAC/B,MAAM,IAAI,GAAyB,MAAM,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAEhE,MAAM,KAAK,GAA4B;gBACrC,IAAI,EAAE,cAAc;gBACpB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;gBAC/B,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,YAAY,KAAK;gBACtD,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,EAAE,QAAQ;gBACrB,KAAK,EAAE,SAAS,CAAC,MAAM;gBACvB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,IAAI,mCAAI,CAAC;aACvC,CAAC;YACF,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CACH,CAAC;QAEF,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAED;;;;;;;;;GASG;AACH,SAAe,OAAO,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AutoBeTestScenarioEvent } from "@autobe/interface/src/events/AutoBeTestScenarioEvent";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateTestScenario<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model
|
|
4
|
+
export declare function orchestrateTestScenario<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, capacity?: number): Promise<AutoBeTestScenarioEvent>;
|
|
@@ -48,11 +48,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
48
48
|
exports.orchestrateTestScenario = orchestrateTestScenario;
|
|
49
49
|
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
|
+
const tstl_1 = require("tstl");
|
|
51
52
|
const typia_1 = __importDefault(require("typia"));
|
|
52
53
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
+
const divideArray_1 = require("../../utils/divideArray");
|
|
55
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
56
|
+
const OpenApiEndpointComparator_1 = require("../interface/OpenApiEndpointComparator");
|
|
53
57
|
const transformTestScenarioHistories_1 = require("./transformTestScenarioHistories");
|
|
54
|
-
function orchestrateTestScenario(
|
|
55
|
-
return __awaiter(this,
|
|
58
|
+
function orchestrateTestScenario(ctx_1) {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (ctx, capacity = 4) {
|
|
56
60
|
var _a, _b, _c, _d, _e, _f;
|
|
57
61
|
const files = Object.entries((_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : {})
|
|
58
62
|
.filter(([filename]) => {
|
|
@@ -73,12 +77,17 @@ function orchestrateTestScenario(ctx) {
|
|
|
73
77
|
responseBody: it.responseBody,
|
|
74
78
|
};
|
|
75
79
|
});
|
|
80
|
+
const matrix = (0, divideArray_1.divideArray)({
|
|
81
|
+
array: endpoints,
|
|
82
|
+
capacity,
|
|
83
|
+
});
|
|
76
84
|
const start = new Date();
|
|
77
85
|
let completed = 0;
|
|
78
|
-
const scenarios = yield Promise.all(
|
|
86
|
+
const scenarios = yield Promise.all(matrix.map((e) => __awaiter(this, void 0, void 0, function* () {
|
|
79
87
|
var _a, _b;
|
|
80
|
-
const
|
|
81
|
-
|
|
88
|
+
const rows = yield divideAndConquer(ctx, e, endpoints, files, 3, (count) => {
|
|
89
|
+
completed += count;
|
|
90
|
+
});
|
|
82
91
|
ctx.dispatch({
|
|
83
92
|
type: "testScenario",
|
|
84
93
|
scenarios: rows,
|
|
@@ -99,7 +108,29 @@ function orchestrateTestScenario(ctx) {
|
|
|
99
108
|
};
|
|
100
109
|
});
|
|
101
110
|
}
|
|
102
|
-
function
|
|
111
|
+
function divideAndConquer(ctx, endpoints, allEndpoints, files, retry, progress) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const remained = new tstl_1.HashSet(endpoints, OpenApiEndpointComparator_1.OpenApiEndpointComparator.hashCode, OpenApiEndpointComparator_1.OpenApiEndpointComparator.equals);
|
|
114
|
+
const scenarios = new tstl_1.HashMap(OpenApiEndpointComparator_1.OpenApiEndpointComparator.hashCode, OpenApiEndpointComparator_1.OpenApiEndpointComparator.equals);
|
|
115
|
+
for (let i = 0; i < retry; ++i) {
|
|
116
|
+
if (remained.empty() === true || scenarios.size() >= endpoints.length)
|
|
117
|
+
break;
|
|
118
|
+
const before = scenarios.size();
|
|
119
|
+
const newbie = yield process(ctx, Array.from(remained), allEndpoints, files);
|
|
120
|
+
for (const item of newbie) {
|
|
121
|
+
scenarios.set(item.endpoint, item.scenarios);
|
|
122
|
+
remained.erase(item.endpoint);
|
|
123
|
+
}
|
|
124
|
+
if (scenarios.size() - before !== 0)
|
|
125
|
+
progress(scenarios.size() - before);
|
|
126
|
+
}
|
|
127
|
+
return Array.from(scenarios.toJSON()).map((it) => ({
|
|
128
|
+
endpoint: it.first,
|
|
129
|
+
scenarios: it.second,
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function process(ctx, endpoints, allEndpoints, files) {
|
|
103
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
135
|
var _a;
|
|
105
136
|
const pointer = {
|
|
@@ -115,26 +146,25 @@ function process(ctx, endpoint, endpoints, files) {
|
|
|
115
146
|
} }),
|
|
116
147
|
tokenUsage: ctx.usage(),
|
|
117
148
|
histories: [
|
|
118
|
-
...(0, transformTestScenarioHistories_1.transformTestScenarioHistories)(ctx.state(),
|
|
149
|
+
...(0, transformTestScenarioHistories_1.transformTestScenarioHistories)(ctx.state(), allEndpoints, files),
|
|
119
150
|
],
|
|
120
151
|
controllers: [
|
|
121
152
|
createApplication({
|
|
122
153
|
model: ctx.model,
|
|
123
154
|
build: (next) => {
|
|
124
|
-
|
|
155
|
+
var _a;
|
|
156
|
+
(_a = pointer.value) !== null && _a !== void 0 ? _a : (pointer.value = []);
|
|
157
|
+
pointer.value.push(...next.scenarios);
|
|
125
158
|
},
|
|
126
159
|
}),
|
|
127
160
|
],
|
|
128
161
|
});
|
|
129
|
-
|
|
130
|
-
if (event.body.tools)
|
|
131
|
-
event.body.tool_choice = "required";
|
|
132
|
-
}));
|
|
162
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
133
163
|
yield agentica.conversate([
|
|
134
|
-
"Make User Scenarios for below
|
|
164
|
+
"Make User Scenarios for below endpoints:",
|
|
135
165
|
"",
|
|
136
166
|
"```json",
|
|
137
|
-
JSON.stringify(
|
|
167
|
+
JSON.stringify(endpoints, null, 2),
|
|
138
168
|
"```",
|
|
139
169
|
].join("\n"));
|
|
140
170
|
if (pointer.value === null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateTestScenario.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestScenario.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateTestScenario.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestScenario.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,0DAkEC;;AAhFD,yCAAoE;AAIpE,+BAAkD;AAClD,kDAA0B;AAG1B,uEAAoE;AACpE,yDAAsD;AACtD,iEAA8D;AAC9D,sFAAmF;AACnF,qFAAkF;AAElF,SAAsB,uBAAuB;yDAC3C,GAAyB,EACzB,WAAmB,CAAC;;QAEpB,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,KAAK,mCAAI,EAAE,CAAC;aAC7D,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE;YACrB,OAAO,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QACnD,CAAC,CAAC;aACD,MAAM,CAAyB,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,EAAE;YAC3D,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,EAAE,CAAC,CAAC;QAET,MAAM,UAAU,GAAG,MAAA,MAA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;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
3
3
|
import { AutoBeState } from "../../context/AutoBeState";
|
|
4
|
-
export declare const transformTestScenarioHistories: (state: AutoBeState,
|
|
4
|
+
export declare const transformTestScenarioHistories: (state: AutoBeState, allEndpoints: AutoBeOpenApi.IEndpoint[], files: Record<string, string>) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformTestScenarioHistories = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
|
-
const transformTestScenarioHistories = (state,
|
|
5
|
+
const transformTestScenarioHistories = (state, allEndpoints, files) => {
|
|
6
6
|
if (state.analyze === null)
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
@@ -150,7 +150,7 @@ const transformTestScenarioHistories = (state, endponits, files) => {
|
|
|
150
150
|
`Different APIs may have to be called to create one.`,
|
|
151
151
|
`Check which functions have been developed.`,
|
|
152
152
|
"```json",
|
|
153
|
-
JSON.stringify(
|
|
153
|
+
JSON.stringify(allEndpoints, null, 2),
|
|
154
154
|
"```",
|
|
155
155
|
].join("\n"),
|
|
156
156
|
},
|