@autobe/agent 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/lib/AutoBeAgent.d.ts +183 -12
  2. package/lib/AutoBeAgent.js +247 -65
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -3
  5. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  6. package/lib/context/AutoBeContext.d.ts +2 -2
  7. package/lib/factory/index.d.ts +0 -1
  8. package/lib/factory/index.js +0 -1
  9. package/lib/factory/index.js.map +1 -1
  10. package/lib/index.mjs +1195 -834
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +1 -1
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
  14. package/lib/orchestrate/interface/orchestrateInterface.js +1 -1
  15. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  16. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -1
  17. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  18. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
  19. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  20. package/lib/orchestrate/test/compileTestScenario.d.ts +5 -0
  21. package/lib/orchestrate/test/compileTestScenario.js +56 -0
  22. package/lib/orchestrate/test/compileTestScenario.js.map +1 -0
  23. package/lib/orchestrate/test/filterTestFileName.d.ts +1 -0
  24. package/lib/orchestrate/test/filterTestFileName.js +13 -0
  25. package/lib/orchestrate/test/filterTestFileName.js.map +1 -0
  26. package/lib/orchestrate/test/orchestrateTest.js +10 -11
  27. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  28. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
  29. package/lib/orchestrate/test/orchestrateTestCorrect.js +91 -73
  30. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  31. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
  32. package/lib/orchestrate/test/orchestrateTestScenario.js +616 -237
  33. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  34. package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -0
  35. package/lib/orchestrate/test/{orchestrateTestProgress.js → orchestrateTestWrite.js} +37 -51
  36. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -0
  37. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +123 -0
  38. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js +3 -0
  39. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
  40. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +5 -0
  41. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js +3 -0
  42. package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +1 -0
  43. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -1
  44. package/lib/orchestrate/test/transformTestCorrectHistories.js +4 -4
  45. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
  46. package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -2
  47. package/lib/orchestrate/test/transformTestScenarioHistories.js +1 -77
  48. package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
  49. package/lib/orchestrate/test/transformTestWriteHistories.d.ts +7 -0
  50. package/lib/orchestrate/test/transformTestWriteHistories.js +47 -0
  51. package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -0
  52. package/lib/structures/IAutoBeConfig.d.ts +48 -10
  53. package/lib/structures/IAutoBeProps.d.ts +87 -0
  54. package/lib/structures/IAutoBeVendor.d.ts +64 -22
  55. package/lib/utils/backoffRetry.d.ts +7 -0
  56. package/lib/utils/backoffRetry.js +73 -0
  57. package/lib/utils/backoffRetry.js.map +1 -0
  58. package/lib/utils/types/BackoffOptions.d.ts +12 -0
  59. package/lib/utils/types/BackoffOptions.js +3 -0
  60. package/lib/utils/types/BackoffOptions.js.map +1 -0
  61. package/package.json +4 -4
  62. package/src/AutoBeAgent.ts +251 -51
  63. package/src/constants/AutoBeSystemPromptConstant.ts +4 -3
  64. package/src/context/AutoBeContext.ts +7 -2
  65. package/src/factory/index.ts +0 -1
  66. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +1 -1
  67. package/src/orchestrate/interface/orchestrateInterface.ts +1 -1
  68. package/src/orchestrate/prisma/orchestratePrisma.ts +1 -0
  69. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +4 -2
  70. package/src/orchestrate/test/compileTestScenario.ts +63 -0
  71. package/src/orchestrate/test/filterTestFileName.ts +9 -0
  72. package/src/orchestrate/test/orchestrateTest.ts +11 -17
  73. package/src/orchestrate/test/orchestrateTestCorrect.ts +152 -100
  74. package/src/orchestrate/test/orchestrateTestScenario.ts +195 -151
  75. package/src/orchestrate/test/{orchestrateTestProgress.ts → orchestrateTestWrite.ts} +29 -44
  76. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +132 -0
  77. package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +5 -0
  78. package/src/orchestrate/test/transformTestCorrectHistories.ts +4 -4
  79. package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -79
  80. package/src/orchestrate/test/transformTestWriteHistories.ts +53 -0
  81. package/src/structures/IAutoBeConfig.ts +48 -10
  82. package/src/structures/IAutoBeProps.ts +91 -0
  83. package/src/structures/IAutoBeVendor.ts +64 -22
  84. package/src/utils/backoffRetry.ts +84 -0
  85. package/src/utils/types/BackoffOptions.ts +15 -0
  86. package/lib/orchestrate/test/orchestrateTestProgress.d.ts +0 -4
  87. package/lib/orchestrate/test/orchestrateTestProgress.js.map +0 -1
  88. package/lib/orchestrate/test/transformTestProgressHistories.d.ts +0 -2
  89. package/lib/orchestrate/test/transformTestProgressHistories.js +0 -47
  90. package/lib/orchestrate/test/transformTestProgressHistories.js.map +0 -1
  91. package/src/orchestrate/test/transformTestProgressHistories.ts +0 -51
@@ -1 +1 @@
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,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,SAAS,0CAAE,QAAQ,CAAC,UAAU,mCAAI,EAAE,CAAC;QACpE,MAAM,SAAS,GACb,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;YACpB,OAAO;gBACL,MAAM,EAAE,EAAE,CAAC,MAAM;gBACjB,IAAI,EAAE,EAAE,CAAC,IAAI;gBACb,OAAO,EAAE,EAAE,C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AMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAgE;CACtE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AutoBeTestScenario, AutoBeTestWriteEvent } from "@autobe/interface";
2
+ import { ILlmSchema } from "@samchon/openapi";
3
+ import { AutoBeContext } from "../../context/AutoBeContext";
4
+ export declare function orchestrateTestWrite<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, scenarios: AutoBeTestScenario[]): Promise<AutoBeTestWriteEvent[]>;
@@ -45,30 +45,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.orchestrateTestProgress = orchestrateTestProgress;
48
+ exports.orchestrateTestWrite = orchestrateTestWrite;
49
49
  const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
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
53
  const enforceToolCall_1 = require("../../utils/enforceToolCall");
54
- const transformTestProgressHistories_1 = require("./transformTestProgressHistories");
55
- function orchestrateTestProgress(ctx, scenarios) {
54
+ const compileTestScenario_1 = require("./compileTestScenario");
55
+ const transformTestWriteHistories_1 = require("./transformTestWriteHistories");
56
+ function orchestrateTestWrite(ctx, scenarios) {
56
57
  return __awaiter(this, void 0, void 0, function* () {
57
58
  const start = new Date();
58
59
  let complete = 0;
59
60
  const events = yield Promise.all(
60
61
  /**
61
- * Generate test code for each scenario. Maps through scenarios array to
62
- * create individual test code implementations. Each scenario is processed
63
- * to generate corresponding test code and progress events.
62
+ * Generate test code for each scenario. Maps through plans array to create
63
+ * individual test code implementations. Each scenario is processed to
64
+ * generate corresponding test code and progress events.
64
65
  */
65
66
  scenarios.map((scenario) => __awaiter(this, void 0, void 0, function* () {
66
67
  var _a, _b;
67
68
  const code = yield process(ctx, scenario);
68
69
  const event = {
69
- type: "testProgress",
70
+ type: "testWrite",
70
71
  created_at: start.toISOString(),
71
- filename: `${code.domain}/${scenario.functionName}.ts`,
72
+ filename: `test/features/api/${code.domain}/${scenario.functionName}.ts`,
72
73
  content: code.content,
73
74
  completed: ++complete,
74
75
  total: scenarios.length,
@@ -92,29 +93,19 @@ function orchestrateTestProgress(ctx, scenarios) {
92
93
  */
93
94
  function process(ctx, scenario) {
94
95
  return __awaiter(this, void 0, void 0, function* () {
95
- var _a, _b, _c, _d, _e;
96
+ var _a;
96
97
  const pointer = {
97
98
  value: null,
98
99
  };
99
- const apiFiles = Object.entries((_b = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : {})
100
- .filter(([filename]) => {
101
- return filename.startsWith("src/api/");
102
- })
103
- .reduce((acc, [filename, content]) => {
104
- return Object.assign(acc, { [filename]: content });
105
- }, {});
106
- const dtoFiles = Object.entries((_d = (_c = ctx.state().interface) === null || _c === void 0 ? void 0 : _c.files) !== null && _d !== void 0 ? _d : {})
107
- .filter(([filename]) => {
108
- return filename.startsWith("src/api/structures/");
109
- })
110
- .reduce((acc, [filename, content]) => {
111
- return Object.assign(acc, { [filename]: content });
112
- }, {});
100
+ const artifacts = yield (0, compileTestScenario_1.compileTestScenario)(ctx, scenario);
113
101
  const agentica = new core_1.MicroAgentica({
114
102
  model: ctx.model,
115
103
  vendor: ctx.vendor,
116
- config: Object.assign({}, ((_e = ctx.config) !== null && _e !== void 0 ? _e : {})),
117
- histories: (0, transformTestProgressHistories_1.transformTestProgressHistories)(apiFiles, dtoFiles),
104
+ config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
105
+ histories: (0, transformTestWriteHistories_1.transformTestWriteHistories)({
106
+ scenario,
107
+ artifacts,
108
+ }),
118
109
  controllers: [
119
110
  createApplication({
120
111
  model: ctx.model,
@@ -123,15 +114,10 @@ function process(ctx, scenario) {
123
114
  },
124
115
  }),
125
116
  ],
117
+ tokenUsage: ctx.usage(),
126
118
  });
127
119
  (0, enforceToolCall_1.enforceToolCall)(agentica);
128
- yield agentica.conversate([
129
- "Create test code for below scenario:",
130
- "",
131
- "```json",
132
- JSON.stringify(scenario, null, 2),
133
- "```",
134
- ].join("\n"));
120
+ yield agentica.conversate("Create e2e test functions.");
135
121
  if (pointer.value === null)
136
122
  throw new Error("Failed to create test code.");
137
123
  return pointer.value;
@@ -164,9 +150,9 @@ const claude = {
164
150
  description: "Current Type: {@link ICreateTestCodeProps}",
165
151
  type: "object",
166
152
  properties: {
167
- plan: {
153
+ scenario: {
168
154
  title: "Strategic approach for test implementation",
169
- description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception scenarios\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines.",
155
+ description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines.",
170
156
  type: "string"
171
157
  },
172
158
  domain: {
@@ -181,17 +167,17 @@ const claude = {
181
167
  }
182
168
  },
183
169
  required: [
184
- "plan",
170
+ "scenario",
185
171
  "domain",
186
172
  "content"
187
173
  ],
188
174
  additionalProperties: false,
189
175
  $defs: {}
190
176
  },
191
- validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
192
- path: _path + ".plan",
177
+ validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
178
+ path: _path + ".scenario",
193
179
  expected: "string",
194
- value: input.plan
180
+ value: input.scenario
195
181
  }), "string" === typeof input.domain || _report(_exceptionable, {
196
182
  path: _path + ".domain",
197
183
  expected: "string",
@@ -246,9 +232,9 @@ const collection = {
246
232
  description: "Current Type: {@link ICreateTestCodeProps}",
247
233
  type: "object",
248
234
  properties: {
249
- plan: {
235
+ scenario: {
250
236
  title: "Strategic approach for test implementation",
251
- description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception scenarios\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines.",
237
+ description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines.",
252
238
  type: "string"
253
239
  },
254
240
  domain: {
@@ -263,17 +249,17 @@ const collection = {
263
249
  }
264
250
  },
265
251
  required: [
266
- "plan",
252
+ "scenario",
267
253
  "domain",
268
254
  "content"
269
255
  ],
270
256
  additionalProperties: false,
271
257
  $defs: {}
272
258
  },
273
- validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
274
- path: _path + ".plan",
259
+ validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
260
+ path: _path + ".scenario",
275
261
  expected: "string",
276
- value: input.plan
262
+ value: input.scenario
277
263
  }), "string" === typeof input.domain || _report(_exceptionable, {
278
264
  path: _path + ".domain",
279
265
  expected: "string",
@@ -330,10 +316,10 @@ const collection = {
330
316
  parameters: {
331
317
  type: "object",
332
318
  properties: {
333
- plan: {
319
+ scenario: {
334
320
  type: "string",
335
321
  title: "Strategic approach for test implementation",
336
- description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception scenarios\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error scenarios (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the plan if it doesn't follow the Test Generation\n Guildelines."
322
+ description: "Strategic approach for test implementation.\n\nDefine the high-level strategy and logical flow for testing the given\nscenario. Focus on test methodology, data preparation, and assertion\nstrategy.\n\n### Critical Requirements\n\n- Must follow the Test Generation Guildelines.\n- Must Planning the test code Never occur the typescript compile error.\n\n### Planning Elements:\n\n#### Test Methodology\n\n- Identify test scenario type (CRUD operation, authentication flow,\n validation test)\n- Define test data requirements and preparation strategy\n- Plan positive/negative test cases and edge cases\n- Design assertion logic and validation points\n\n#### Execution Strategy\n\n- Outline step-by-step test execution flow\n- Plan error handling and exception plans\n- Define cleanup and teardown procedures\n- Identify dependencies and prerequisites\n\n### Example Plan:\n\n Test Strategy: Article Creation Validation\n 1. Prepare valid article data with required fields\n 2. Execute POST request to create article\n 3. Validate response structure and data integrity\n 4. Test error plans (missing fields, invalid data)\n 5. Verify database state changes\n 6. Reconsider the scenario if it doesn't follow the Test Generation\n Guildelines."
337
323
  },
338
324
  domain: {
339
325
  type: "string",
@@ -347,17 +333,17 @@ const collection = {
347
333
  }
348
334
  },
349
335
  required: [
350
- "plan",
336
+ "scenario",
351
337
  "domain",
352
338
  "content"
353
339
  ],
354
340
  description: "Current Type: {@link ICreateTestCodeProps}",
355
341
  additionalProperties: false
356
342
  },
357
- validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
358
- path: _path + ".plan",
343
+ validate: (() => { const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.content; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.scenario || _report(_exceptionable, {
344
+ path: _path + ".scenario",
359
345
  expected: "string",
360
- value: input.plan
346
+ value: input.scenario
361
347
  }), "string" === typeof input.domain || _report(_exceptionable, {
362
348
  path: _path + ".domain",
363
349
  expected: "string",
@@ -398,4 +384,4 @@ const collection = {
398
384
  ]
399
385
  },
400
386
  };
401
- //# sourceMappingURL=orchestrateTestProgress.js.map
387
+ //# sourceMappingURL=orchestrateTestWrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrateTestWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/test/orchestrateTestWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,oDA8BC;;AA3CD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,+DAA4D;AAE5D,+EAA4E;AAE5E,SAAsB,oBAAoB,CACxC,GAAyB,EACzB,SAA+B;;QAE/B,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,QAAQ,GAAW,CAAC,CAAC;QAEzB,MAAM,MAAM,GAA2B,MAAM,OAAO,CAAC,GAAG;QACtD;;;;WAIG;QACH,SAAS,CAAC,GAAG,CAAC,CAAO,QAAQ,EAAE,EAAE;;YAC/B,MAAM,IAAI,GAAyB,MAAM,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,KAAK,GAAyB;gBAClC,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,KAAK,CAAC,WAAW,EAAE;gBAC/B,QAAQ,EAAE,qBAAqB,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,YAAY,KAAK;gBACxE,OAAO,EAAE,IAAI,CAAC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B,CAAC,CAAC;QAC3E,OAAO,OAAO,CAAC,KAAK,CAAC;IACvB,CAAC;CAAA;AAED,SAAS,iBAAiB,CAAiC,KAG1D;IACC,IAAA,qCAAiB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,WAAW,GAA2B,UAAU,CACpD,KAAK,CAAC,KAAK,CACyB,CAAC;IACvC,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,kBAAkB;QACxB,WAAW;QACX,OAAO,EAAE;YACP,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SACqB;KACzB,CAAC;AACJ,CAAC;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"}
@@ -0,0 +1,123 @@
1
+ import { AutoBeOpenApi } from "@autobe/interface";
2
+ export interface IAutoBeTestScenarioApplication {
3
+ /**
4
+ * Make test scenarios for the given endpoints.
5
+ *
6
+ * @param props Properties containing the endpoints and test scenarios.
7
+ */
8
+ makeScenario(props: IAutoBeTestScenarioApplication.IProps): void;
9
+ }
10
+ export declare namespace IAutoBeTestScenarioApplication {
11
+ interface IProps {
12
+ /** Array of test scenario groups. */
13
+ scenarioGroups: IAutoBeTestScenarioApplication.IScenarioGroup[];
14
+ }
15
+ interface IScenarioGroup {
16
+ /** Target API endpoint to test. */
17
+ endpoint: AutoBeOpenApi.IEndpoint;
18
+ /** Array of test scenarios. */
19
+ scenarios: IScenario[];
20
+ }
21
+ /**
22
+ * Represents a test scenario for a single API operation.
23
+ *
24
+ * This interface extends `AutoBeOpenApi.IEndpoint`, inheriting its HTTP
25
+ * method and path information, and adds two key properties:
26
+ *
27
+ * - `draft`: A free-form, human-readable test scenario description for the API
28
+ * endpoint.
29
+ * - `dependsOn`: A list of other API endpoints that must be invoked beforehand
30
+ * in order to prepare the context for this test. Each dependency includes
31
+ * the purpose of the dependency.
32
+ *
33
+ * This structure is intended to help organize test specifications for complex
34
+ * workflows and ensure that all prerequisites are explicitly declared.
35
+ */
36
+ interface IScenario {
37
+ /**
38
+ * A detailed natural language description of how this API endpoint should
39
+ * be tested. This should include both successful and failure scenarios,
40
+ * business rule validations, edge cases, and any sequence of steps
41
+ * necessary to perform the test. A subsequent agent will use this draft to
42
+ * generate multiple test scenarios.
43
+ */
44
+ draft: string;
45
+ /**
46
+ * Descriptive function name derived from the user scenario.
47
+ *
48
+ * The function name serves as a concise, technical identifier that clearly
49
+ * represents the specific user scenario being described. It should be
50
+ * immediately understandable and directly correspond to the user situation
51
+ * without requiring additional context.
52
+ *
53
+ * ## Naming Convention
54
+ *
55
+ * - Must start with `test_` prefix (mandatory requirement)
56
+ * - Use snake_case formatting throughout
57
+ * - Include the primary user action (create, get, update, delete, list, etc.)
58
+ * - Specify the target resource (user, product, order, profile, etc.)
59
+ * - Add scenario-specific context (valid_data, invalid_email, not_found,
60
+ * etc.)
61
+ *
62
+ * ## Content Structure
63
+ *
64
+ * Function names should follow this pattern:
65
+ * `test_[user_action]_[resource]_[scenario_context]`
66
+ *
67
+ * Where:
68
+ *
69
+ * - `user_action`: What the user is trying to do
70
+ * - `resource`: What the user is interacting with
71
+ * - `scenario_context`: The specific situation or condition
72
+ *
73
+ * ## User-Focused Examples
74
+ *
75
+ * - `test_create_user_profile_with_complete_information` - User providing all
76
+ * available profile data
77
+ * - `test_retrieve_user_profile_when_profile_exists` - User accessing their
78
+ * existing profile
79
+ * - `test_update_user_email_with_valid_new_address` - User changing their
80
+ * email to a valid new one
81
+ * - `test_delete_user_account_when_user_lacks_permission` - User attempting
82
+ * account deletion without authorization
83
+ * - `test_search_user_profiles_with_pagination_preferences` - User browsing
84
+ * profiles with specific pagination
85
+ *
86
+ * ## Clarity Guidelines
87
+ *
88
+ * - Prioritize clarity over brevity
89
+ * - Avoid technical jargon or implementation terms
90
+ * - Use terminology that reflects user perspective
91
+ * - Ensure the name alone conveys the user's intent
92
+ * - Make it understandable to non-technical stakeholders
93
+ * - Keep consistent with user scenario description
94
+ *
95
+ * ## Single Endpoint Alignment
96
+ *
97
+ * Function names must reflect scenarios that:
98
+ *
99
+ * - Accomplish user goals through this single endpoint only
100
+ * - Don't imply dependency on other API operations
101
+ * - Represent complete user interactions
102
+ */
103
+ functionName: string;
104
+ /**
105
+ * A list of other API endpoints that must be executed before this test
106
+ * scenario. This helps express dependencies such as data creation or
107
+ * authentication steps required to reach the intended test state.
108
+ */
109
+ dependsOn: IDependsOn[];
110
+ }
111
+ interface IDependsOn {
112
+ /** Target API endpoint that must be executed before the main operation. */
113
+ endpoint: AutoBeOpenApi.IEndpoint;
114
+ /**
115
+ * A concise exscenarioation of why this API call is required before
116
+ * executing the test for the main operation.
117
+ *
118
+ * Example: "Creates a category so that a product can be linked to it during
119
+ * creation."
120
+ */
121
+ purpose: string;
122
+ }
123
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoBeTestScenarioApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoBeTestScenarioApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface IAutoBeTestScenarioArtifacts {
2
+ sdk: Record<string, string>;
3
+ dto: Record<string, string>;
4
+ e2e: Record<string, string>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoBeTestScenarioArtifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoBeTestScenarioArtifacts.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts"],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- export declare const transformTestCorrectHistories: (apiFiles: Record<string, string>, dtoFiles: Record<string, string>) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
2
+ import { IAutoBeTestScenarioArtifacts } from "./structures/IAutoBeTestScenarioArtifacts";
3
+ export declare const transformTestCorrectHistories: (artifacts: IAutoBeTestScenarioArtifacts) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformTestCorrectHistories = void 0;
4
4
  const uuid_1 = require("uuid");
5
- const transformTestCorrectHistories = (apiFiles, dtoFiles) => {
5
+ const transformTestCorrectHistories = (artifacts) => {
6
6
  return [
7
7
  {
8
8
  id: (0, uuid_1.v4)(),
9
9
  created_at: new Date().toISOString(),
10
10
  type: "systemMessage",
11
- text: "# Compiler Error Fix System Prompt\n\nYou are an expert TypeScript compiler error fixing agent specializing in resolving compilation errors in E2E test code that follows the `@nestia/e2e` testing framework conventions.\n\n## Your Role\n\n- Analyze the provided TypeScript code with compilation errors and generate the corrected version. \n- Focus specifically on the error location, message, and problematic code segment. \n- Maintain all existing functionality while resolving only the compilation issues. \n- Follow the established code patterns and conventions from the original E2E test code. \n- Use provided API Files and DTO Files to resolve module and type declaration issues. \n- **CRITICAL**: Apply comprehensive fixes to prevent circular error loops by addressing all related import issues in a single pass.\n\n## Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided \n- All thinking and responses must be in the working language \n- All model/field names must be in English regardless of working language \n\n## Input Format\n\nYou will receive: \n\n1. **Original Code**: TypeScript E2E test code with compilation errors \n2. **Error Information**: \n - Exact character position of the error \n - Detailed error message from TypeScript compiler \n - The specific problematic code segment \n3. **Instructions**: Specific guidance on what needs to be fixed \n4. **API Files**: Reference files containing available API functions and their paths \n5. **DTO Files**: Reference files containing available types and their import paths \n\n## Code Fixing Guidelines\n\n### 1. Module Resolution Errors (CRITICAL PRIORITY)\n\n#### Universal Module Import Pattern Recognition and Fix:\n\n**ALWAYS scan the ENTIRE code for ALL import statements that match these patterns and fix them ALL at once:**\n\n```typescript\n// WRONG PATTERNS - Fix ALL of these in one pass:\nimport api from \"@nestia/PROJECT-api\";\nimport api from \"@wrtnlabs/PROJECT-api\"; \nimport api from \"@anyorganization/PROJECT-api\";\nimport { Type } from \"@nestia/PROJECT-api/lib/structures/Type\";\nimport { Type } from \"@wrtnlabs/PROJECT-api/lib/structures/Type\";\nimport { Type } from \"@anyorganization/PROJECT-api/lib/structures/Type\";\n\n// CORRECT PATTERN - Replace with:\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { Type } from \"@ORGANIZATION/PROJECT-api/lib/structures/Type\";\n```\n\n#### Comprehensive Module Fix Strategy:\n\n1. **Pattern Detection**: Look for ANY import that contains: \n - `@[anything]/[project-name]-api` \u2192 Replace `@[anything]` with `@ORGANIZATION` \n - `@[project-name]-api` (missing org prefix) \u2192 Add `@ORGANIZATION/` prefix \n\n2. **Common Error Patterns to Fix ALL AT ONCE**: \n\n```typescript\n// Error Pattern 1: Wrong organization name\nCannot find module '@wrtnlabs/template-api'\nCannot find module '@nestia/template-api'\nCannot find module '@anyorg/template-api'\n// Fix: Replace with @ORGANIZATION/template-api\n\n// Error Pattern 2: Missing organization prefix \nCannot find module '@template-api'\nCannot find module 'template-api'\n// Fix: Add @ORGANIZATION/ prefix\n\n// Error Pattern 3: Structure imports with wrong org\nCannot find module '@wrtnlabs/template-api/lib/structures/IType'\nCannot find module '@nestia/template-api/lib/structures/IType'\n// Fix: Replace with @ORGANIZATION/template-api/lib/structures/IType\n``` \n\n3. **Comprehensive Import Scan and Fix**: \n - **BEFORE fixing the reported error**, scan ALL import statements in the code \n - Identify ALL imports that follow incorrect patterns \n - Fix ALL of them simultaneously to prevent error loops \n - Ensure consistent `@ORGANIZATION/PROJECT-api` pattern throughout \n\n#### Module Resolution Fix Examples:\n\n```typescript\n// BEFORE (Multiple wrong patterns in same file):\nimport api from \"@nestia/template-api\";\nimport { IBbsArticle } from \"@wrtnlabs/template-api/lib/structures/IBbsArticle\";\nimport { IAttachmentFile } from \"@template-api/lib/structures/IAttachmentFile\";\n\n// AFTER (All fixed consistently):\nimport api from \"@ORGANIZATION/template-api\";\nimport { IBbsArticle } from \"@ORGANIZATION/template-api/lib/structures/IBbsArticle\";\nimport { IAttachmentFile } from \"@ORGANIZATION/template-api/lib/structures/IAttachmentFile\";\n``` \n\n### 2. Error Loop Prevention Strategy\n\n**CRITICAL**: To prevent 1 \u2192 2 \u2192 3 \u2192 1 error loops: \n\n1. **Holistic Code Analysis**: Before fixing the specific error, analyze ALL import statements in the entire code \n2. **Batch Import Fixes**: Fix ALL import-related issues in a single pass, not just the reported error \n3. **Pattern Consistency**: Ensure ALL imports follow the same `@ORGANIZATION/PROJECT-api` pattern \n4. **Preemptive Fixes**: Look for and fix potential related errors that might surface after the current fix \n\n**Implementation Approach**: \n\n```typescript\n// Step 1: Scan entire code for ALL these patterns\nconst problemPatterns = [\n /@[^/]+\\/[^-]+-api(?!\\/)/g, // Wrong org prefix\n /@[^-]+-api(?!\\/)/g, // Missing org prefix \n /from\\s+[\"']@[^/]+\\/[^-]+-api/g, // Wrong org in imports\n /from\\s+[\"']@[^-]+-api/g // Missing org in imports\n];\n\n// Step 2: Replace ALL matches with @ORGANIZATION/PROJECT-api pattern\n// Step 3: Then fix the specific reported error\n``` \n\n### 3. API Function Usage Corrections\n\n- Ensure proper `import api from \"@ORGANIZATION/PROJECT-api\";` format (verify against API Files) \n- Fix API function call patterns to follow: \n\n ```ts\n api.functional.[...].methodName(...)\n ``` \n\n- Correct connection parameter usage (avoid adding extra properties): \n\n ```ts\n // Correct\n await api.functional.bbs.articles.post(connection, { body: articleBody });\n ``` \n\n- **Cross-reference API Files** to ensure function paths and method names are accurate \n\n### 4. DTO Type Import Corrections\n\n- Fix import statements to use proper format based on **DTO Files**: \n\n ```ts\n import { ITypeName } from \"@ORGANIZATION/PROJECT-api/lib/structures/[...].ts\";\n ``` \n\n- Ensure `@ORGANIZATION` prefix is maintained in import paths \n- **Verify type names and paths** against provided DTO Files \n- Correct missing or incorrect type imports \n- Fix type annotation errors \n\n### 5. Test Function Structure Fixes\n\n- Ensure test functions follow the pattern: \n\n ```ts\n export async function test_api_xxx(...): Promise<void> { ... }\n ``` \n\n- Fix async/await usage errors \n- Correct function parameter types (especially `connection: api.IConnection`) \n\n### 6. Test Validator Usage Corrections\n\n- Fix `TestValidator` method calls: \n\n ```ts\n TestValidator.equals(\"title\", exceptionFunction)(expected)(actual);\n TestValidator.predicate(\"title\")(condition);\n TestValidator.error(\"title\")(task);\n ``` \n\n- Correct currying function usage \n- Fix assertion patterns \n\n### 7. Typia Assert Corrections\n\n- Ensure proper `typia.assert<T>(value)` usage \n- Fix generic type parameters \n- Correct assertion patterns for response validation \n\n### 8. Array Type Corrections\n\n```\nerror: Argument of type 'IBbsArticleComment[]' is not assignable to parameter of type 'never[]'.\n``` \n\n- To Resolve above Array parameter Error, If you declare empty array like `[]`, You must define the type of array together. \n\nExample: \n\n ```typescript\n TestValidator.equals(\"message\")(\n [] as IBbsArticleComment[],\n )(data);\n ``` \n\n### 9. Common TypeScript Error Fixes\n\n- **Import/Export errors**: Fix module resolution issues using API Files and DTO Files as reference \n- **Type mismatches**: Align variable types with expected interfaces from DTO Files \n- **Missing properties**: Add required properties to objects \n- **Async/Promise errors**: Fix Promise handling and async function signatures \n- **Generic type errors**: Correct generic type parameters \n- **Null/undefined handling**: Add proper null checks or optional chaining \n- **Interface compliance**: Ensure objects conform to their declared interfaces \n\n## Error Resolution Strategy\n\n1. **Full Code Analysis**: FIRST perform comprehensive analysis of ENTIRE codebase for ALL potential TypeScript issues \n2. **Error Chain Identification**: Identify cascading error patterns and relationships between different parts of code \n3. **Holistic Fix Planning**: Plan fixes for ALL related errors that could cause loops, not just the reported error \n4. **Reference File Consultation**: \n - For module errors: Consult API Files for correct import paths \n - For type errors: Consult DTO Files for correct type import paths \n - For function calls: Verify method signatures and parameters \n5. **Batch Error Resolution**: Fix ALL identified issues simultaneously in logical groups: \n - All import/module issues together \n - All type declaration issues together \n - All function signature issues together \n - All usage/call site issues together \n6. **Context Preservation**: Maintain the original test logic and flow \n7. **Comprehensive Validation**: Ensure no new compilation errors or cascading issues are introduced \n8. **Pattern Consistency**: Keep existing code style and conventions throughout all fixes \n\n## Output Requirements\n\n- Return **only** the corrected TypeScript code \n- Maintain all original functionality and test logic \n- Preserve code formatting and style \n- Ensure the fix addresses ALL related compilation errors (not just the reported one) \n- **CRITICAL**: Fix ALL import pattern issues in a single pass to prevent error loops \n- Do not add explanations, comments, or additional features \n\n## Priority Error Handling\n\n1. **Comprehensive Analysis** (HIGHEST priority): \n - Scan ENTIRE codebase for ALL potential TypeScript compilation issues \n - Identify cascading error patterns and relationships \n - Map error chains that commonly cause loops (import \u2192 type \u2192 usage \u2192 validation) \n\n2. **Batch Error Resolution** (CRITICAL): \n - Group related errors into logical fix batches: \n - **Module/Import Batch**: All import paths, module resolution, missing dependencies \n - **Type Batch**: All type declarations, interfaces, generic constraints \n - **Function Batch**: All function signatures, parameters, return types \n - **Usage Batch**: All variable assignments, method calls, property access \n - **Test Batch**: All TestValidator calls, assertion patterns, validation logic \n - Fix entire batches simultaneously to prevent cascading failures \n\n3. **Specific Error Resolution**: \n - After comprehensive fixes, verify the originally reported error is resolved \n - Use DTO Files for type corrections and API Files for function signatures \n - Ensure consistency with established patterns \n\n4. **General TypeScript Compilation**: \n - Apply standard TypeScript error resolution techniques \n - Maintain type safety throughout all fixes \n\n## Error Loop Prevention Protocol\n\n**MANDATORY STEPS to prevent error loops:** \n\n1. **Pre-Analysis**: Before fixing reported error, scan entire code for ALL import statements \n2. **Pattern Matching**: Identify ALL imports matching problematic patterns: \n - `@[anything-except-ORGANIZATION]/[project]-api` \n - Missing `@ORGANIZATION/` prefix \n - Inconsistent organization naming \n3. **Comprehensive Fix**: Replace ALL problematic imports with correct `@ORGANIZATION/PROJECT-api` pattern \n4. **Validation**: Ensure ALL imports in the file follow consistent pattern \n5. **Specific Fix**: Then address the specific reported compilation error \n\n**Example of Comprehensive Fix Approach:** \n\n```typescript\n// Input code with multiple potential issues:\nimport api from \"@nestia/template-api\"; // Issue 1\nimport { IBbsArticle } from \"@wrtnlabs/template-api/lib/structures/IBbsArticle\"; // Issue 2 \nimport { IUser } from \"@template-api/lib/structures/IUser\"; // Issue 3\n\n// Output: ALL issues fixed simultaneously:\nimport api from \"@ORGANIZATION/template-api\";\nimport { IBbsArticle } from \"@ORGANIZATION/template-api/lib/structures/IBbsArticle\";\nimport { IUser } from \"@ORGANIZATION/template-api/lib/structures/IUser\";\n```" /* AutoBeSystemPromptConstant.TEST_CORRECT */,
11
+ text: "# Compiler Error Fix System Prompt\n\nYou are an expert TypeScript compiler error fixing agent specializing in resolving compilation errors in E2E test code that follows the `@nestia/e2e` testing framework conventions.\n\n## Your Role\n\n- Analyze the provided TypeScript code with compilation errors and generate the corrected version. \n- Focus specifically on the error location, message, and problematic code segment. \n- Maintain all existing functionality while resolving only the compilation issues. \n- Follow the established code patterns and conventions from the original E2E test code. \n- Use provided API Files and DTO Files to resolve module and type declaration issues. \n- **CRITICAL**: Apply comprehensive fixes to prevent circular error loops by addressing all related import issues in a single pass.\n\n## Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided \n- All thinking and responses must be in the working language \n- All model/field names must be in English regardless of working language \n\n## Input Format\n\nYou will receive: \n\n1. **Original Code**: TypeScript E2E test code with compilation errors \n2. **Error Information**: \n - Exact character position of the error \n - Detailed error message from TypeScript compiler \n - The specific problematic code segment \n3. **Instructions**: Specific guidance on what needs to be fixed \n4. **API Files**: Reference files containing available API functions and their paths \n5. **DTO Files**: Reference files containing available types and their import paths \n\n## Code Fixing Guidelines\n\n### 1. Module Resolution Errors (CRITICAL PRIORITY)\n\n#### Universal Module Import Pattern Recognition and Fix:\n\n**ALWAYS scan the ENTIRE code for ALL import statements that match these patterns and fix them ALL at once:**\n\n```typescript\n// WRONG PATTERNS - Fix ALL of these in one pass:\nimport api from \"@nestia/PROJECT-api\";\nimport api from \"@wrtnlabs/PROJECT-api\"; \nimport api from \"@anyorganization/PROJECT-api\";\nimport { Type } from \"@nestia/PROJECT-api/lib/structures/Type\";\nimport { Type } from \"@wrtnlabs/PROJECT-api/lib/structures/Type\";\nimport { Type } from \"@anyorganization/PROJECT-api/lib/structures/Type\";\n\n// CORRECT PATTERN - Replace with:\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { Type } from \"@ORGANIZATION/PROJECT-api/lib/structures/Type\";\n```\n\n#### Importing namespace rule\n\n```ts\n// \u274C Incorrect usage: importing inner types directly from a namespaced type\nimport {\n IShoppingSaleInquiryComment,\n IShoppingSaleInquiryComment_ICreate,\n IShoppingSaleInquiryComment_IRequest,\n} from \"@ORGANIZATION/PROJECT-api/lib/structures/IShoppingSaleInquiryComment\";\n\n```\n\n```ts\n// \u2705 Correct usage: import only the namespace and access inner types via dot notation\nimport {\n IShoppingSaleInquiryComment,\n} from \"@ORGANIZATION/PROJECT-api/lib/structures/IShoppingSaleInquiryComment\";\n\ntype A = IShoppingSaleInquiryComment.ICreate // correct!\ntype B = IShoppingSaleInquiryComment.IRequest // correct!\n```\n\n- \uD83D\uDCA1 Rule: When working with types defined inside a namespace, import only the namespace and access inner types using dot notation (e.g., Namespace.InnerType).\nAvoid importing inner types directly, as it breaks encapsulation and may cause naming conflicts or improper typings.\n\n\n#### Comprehensive Module Fix Strategy:\n\n1. **Pattern Detection**: Look for ANY import that contains: \n - `@[anything]/[project-name]-api` \u2192 Replace `@[anything]` with `@ORGANIZATION` \n - `@[project-name]-api` (missing org prefix) \u2192 Add `@ORGANIZATION/` prefix \n\n2. **Common Error Patterns to Fix ALL AT ONCE**: \n\n```typescript\n// Error Pattern 1: Wrong organization name\nCannot find module '@wrtnlabs/PROJECT-api'\nCannot find module '@nestia/PROJECT-api'\nCannot find module '@anyorg/PROJECT-api'\n// Fix: Replace with @ORGANIZATION/PROJECT-api\n\n// Error Pattern 2: Missing organization prefix \nCannot find module '@PROJECT-api'\nCannot find module 'PROJECT-api'\n// Fix: Add @ORGANIZATION/ prefix\n\n// Error Pattern 3: Structure imports with wrong org\nCannot find module '@wrtnlabs/PROJECT-api/lib/structures/IType'\nCannot find module '@nestia/PROJECT-api/lib/structures/IType'\n// Fix: Replace with @ORGANIZATION/PROJECT-api/lib/structures/IType\n``` \n\n3. **Comprehensive Import Scan and Fix**: \n - **BEFORE fixing the reported error**, scan ALL import statements in the code \n - Identify ALL imports that follow incorrect patterns \n - Fix ALL of them simultaneously to prevent error loops \n - Ensure consistent `@ORGANIZATION/PROJECT-api` pattern throughout \n\n#### Module Resolution Fix Examples:\n\n```typescript\n// BEFORE (Multiple wrong patterns in same file):\nimport api from \"@nestia/PROJECT-api\";\nimport { IBbsArticle } from \"@wrtnlabs/PROJECT-api/lib/structures/IBbsArticle\";\nimport { IAttachmentFile } from \"@PROJECT-api/lib/structures/IAttachmentFile\";\n\n// AFTER (All fixed consistently):\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/IBbsArticle\";\nimport { IAttachmentFile } from \"@ORGANIZATION/PROJECT-api/lib/structures/IAttachmentFile\";\n``` \n\n### 2. Error Loop Prevention Strategy\n\n**CRITICAL**: To prevent 1 \u2192 2 \u2192 3 \u2192 1 error loops: \n\n1. **Holistic Code Analysis**: Before fixing the specific error, analyze ALL import statements in the entire code \n2. **Batch Import Fixes**: Fix ALL import-related issues in a single pass, not just the reported error \n3. **Pattern Consistency**: Ensure ALL imports follow the same `@ORGANIZATION/PROJECT-api` pattern \n4. **Preemptive Fixes**: Look for and fix potential related errors that might surface after the current fix \n\n**Implementation Approach**: \n\n```typescript\n// Step 1: Scan entire code for ALL these patterns\nconst problemPatterns = [\n /@[^/]+\\/[^-]+-api(?!\\/)/g, // Wrong org prefix\n /@[^-]+-api(?!\\/)/g, // Missing org prefix \n /from\\s+[\"']@[^/]+\\/[^-]+-api/g, // Wrong org in imports\n /from\\s+[\"']@[^-]+-api/g // Missing org in imports\n];\n\n// Step 2: Replace ALL matches with @ORGANIZATION/PROJECT-api pattern\n// Step 3: Then fix the specific reported error\n``` \n\n### 3. API Function Usage Corrections\n\n- Ensure proper `import api from \"@ORGANIZATION/PROJECT-api\";` format (verify against API Files) \n- Fix API function call patterns to follow: \n\n ```ts\n api.functional.[...].methodName(...)\n ``` \n\n- Correct connection parameter usage (avoid adding extra properties): \n\n ```ts\n // Correct\n await api.functional.bbs.articles.post(connection, { body: articleBody });\n ``` \n\n- **Cross-reference API Files** to ensure function paths and method names are accurate \n\n### 4. DTO Type Import Corrections\n\n- Fix import statements to use proper format based on **DTO Files**: \n\n ```ts\n import { ITypeName } from \"@ORGANIZATION/PROJECT-api/lib/structures/[...].ts\";\n ``` \n\n- Ensure `@ORGANIZATION` prefix is maintained in import paths \n- **Verify type names and paths** against provided DTO Files \n- Correct missing or incorrect type imports \n- Fix type annotation errors \n\n### 5. Test Function Structure Fixes\n\n- Ensure test functions follow the pattern: \n\n ```ts\n export async function test_api_xxx(...): Promise<void> { ... }\n ``` \n\n- Fix async/await usage errors \n- Correct function parameter types (especially `connection: api.IConnection`) \n\n### 6. Test Validator Usage Corrections\n\n- Fix `TestValidator` method calls: \n\n ```ts\n TestValidator.equals(\"title\", exceptionFunction)(expected)(actual);\n TestValidator.predicate(\"title\")(condition);\n TestValidator.error(\"title\")(task);\n ``` \n\n- Correct currying function usage \n- Fix assertion patterns \n\n### 7. Typia Assert Corrections\n\n- Ensure proper `typia.assert<T>(value)` usage \n- Fix generic type parameters \n- Correct assertion patterns for response validation \n\n### 8. Array Type Corrections\n\n```\nerror: Argument of type 'IBbsArticleComment[]' is not assignable to parameter of type 'never[]'.\n``` \n\n- To Resolve above Array parameter Error, If you declare empty array like `[]`, You must define the type of array together. \n\nExample: \n\n ```typescript\n TestValidator.equals(\"message\")(\n [] as IBbsArticleComment[],\n )(data);\n ``` \n\n### 9. Common TypeScript Error Fixes\n\n- **Import/Export errors**: Fix module resolution issues using API Files and DTO Files as reference \n- **Type mismatches**: Align variable types with expected interfaces from DTO Files \n- **Missing properties**: Add required properties to objects \n- **Async/Promise errors**: Fix Promise handling and async function signatures \n- **Generic type errors**: Correct generic type parameters \n- **Null/undefined handling**: Add proper null checks or optional chaining \n- **Interface compliance**: Ensure objects conform to their declared interfaces \n\n## Error Resolution Strategy\n\n1. **Full Code Analysis**: FIRST perform comprehensive analysis of ENTIRE codebase for ALL potential TypeScript issues \n2. **Error Chain Identification**: Identify cascading error patterns and relationships between different parts of code \n3. **Holistic Fix Planning**: Plan fixes for ALL related errors that could cause loops, not just the reported error \n4. **Reference File Consultation**: \n - For module errors: Consult API Files for correct import paths \n - For type errors: Consult DTO Files for correct type import paths \n - For function calls: Verify method signatures and parameters \n5. **Batch Error Resolution**: Fix ALL identified issues simultaneously in logical groups: \n - All import/module issues together \n - All type declaration issues together \n - All function signature issues together \n - All usage/call site issues together \n6. **Context Preservation**: Maintain the original test logic and flow \n7. **Comprehensive Validation**: Ensure no new compilation errors or cascading issues are introduced \n8. **Pattern Consistency**: Keep existing code style and conventions throughout all fixes \n\n## Output Requirements\n\n- Return **only** the corrected TypeScript code \n- Maintain all original functionality and test logic \n- Preserve code formatting and style \n- Ensure the fix addresses ALL related compilation errors (not just the reported one) \n- **CRITICAL**: Fix ALL import pattern issues in a single pass to prevent error loops \n- Do not add explanations, comments, or additional features \n\n## Priority Error Handling\n\n1. **Comprehensive Analysis** (HIGHEST priority): \n - Scan ENTIRE codebase for ALL potential TypeScript compilation issues \n - Identify cascading error patterns and relationships \n - Map error chains that commonly cause loops (import \u2192 type \u2192 usage \u2192 validation) \n\n2. **Batch Error Resolution** (CRITICAL): \n - Group related errors into logical fix batches: \n - **Module/Import Batch**: All import paths, module resolution, missing dependencies \n - **Type Batch**: All type declarations, interfaces, generic constraints \n - **Function Batch**: All function signatures, parameters, return types \n - **Usage Batch**: All variable assignments, method calls, property access \n - **Test Batch**: All TestValidator calls, assertion patterns, validation logic \n - Fix entire batches simultaneously to prevent cascading failures \n\n3. **Specific Error Resolution**: \n - After comprehensive fixes, verify the originally reported error is resolved \n - Use DTO Files for type corrections and API Files for function signatures \n - Ensure consistency with established patterns \n\n4. **General TypeScript Compilation**: \n - Apply standard TypeScript error resolution techniques \n - Maintain type safety throughout all fixes \n\n## Error Loop Prevention Protocol\n\n**MANDATORY STEPS to prevent error loops:** \n\n1. **Pre-Analysis**: Before fixing reported error, scan entire code for ALL import statements \n2. **Pattern Matching**: Identify ALL imports matching problematic patterns: \n - `@[anything-except-ORGANIZATION]/[project]-api` \n - Missing `@ORGANIZATION/` prefix \n - Inconsistent organization naming \n3. **Comprehensive Fix**: Replace ALL problematic imports with correct `@ORGANIZATION/PROJECT-api` pattern \n4. **Validation**: Ensure ALL imports in the file follow consistent pattern \n5. **Specific Fix**: Then address the specific reported compilation error \n\n**Example of Comprehensive Fix Approach:** \n\n```typescript\n// Input code with multiple potential issues:\nimport api from \"@nestia/PROJECT-api\"; // Issue 1\nimport { IBbsArticle } from \"@wrtnlabs/PROJECT-api/lib/structures/IBbsArticle\"; // Issue 2 \nimport { IUser } from \"@PROJECT-api/lib/structures/IUser\"; // Issue 3\n\n// Output: ALL issues fixed simultaneously:\nimport api from \"@ORGANIZATION/PROJECT-api\";\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/IBbsArticle\";\nimport { IUser } from \"@ORGANIZATION/PROJECT-api/lib/structures/IUser\";\n```" /* AutoBeSystemPromptConstant.TEST_CORRECT */,
12
12
  },
13
13
  {
14
14
  id: (0, uuid_1.v4)(),
@@ -29,12 +29,12 @@ const transformTestCorrectHistories = (apiFiles, dtoFiles) => {
29
29
  "## File References",
30
30
  "### API Files",
31
31
  "```typescript",
32
- JSON.stringify(apiFiles, null, 2),
32
+ JSON.stringify(artifacts.sdk),
33
33
  "```",
34
34
  "",
35
35
  "### DTO Files",
36
36
  "```typescript",
37
- JSON.stringify(dtoFiles, null, 2),
37
+ JSON.stringify(artifacts.dto),
38
38
  "```",
39
39
  "",
40
40
  "Now Fix the E2E test function based on the given error information.",
@@ -1 +1 @@
1
- {"version":3,"file":"transformTestCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/test/transformTestCorrectHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,6BAA6B,GAAG,CAC3C,QAAgC,EAChC,QAAgC,EAGhC,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,2vYAAyC;SAC9C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,2DAA2D;gBAC3D,qGAAqG;gBACrG,EAAE;gBACF,UAAU;gBACV,2FAA2F;gBAC3F,8EAA8E;gBAC9E,+EAA+E;gBAC/E,iHAAiH;gBACjH,6EAA6E;gBAC7E,8CAA8C;gBAC9C,EAAE;gBACF,oBAAoB;gBACpB,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjC,KAAK;gBACL,EAAE;gBACF,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACjC,KAAK;gBACL,EAAE;gBACF,qEAAqE;gBACrE,8FAA8F;aAC/F,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA7CW,QAAA,6BAA6B,iCA6CxC"}
1
+ {"version":3,"file":"transformTestCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/test/transformTestCorrectHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,6BAA6B,GAAG,CAC3C,SAAuC,EAGvC,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,wraAAyC;SAC9C;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,2DAA2D;gBAC3D,qGAAqG;gBACrG,EAAE;gBACF,UAAU;gBACV,2FAA2F;gBAC3F,8EAA8E;gBAC9E,+EAA+E;gBAC/E,iHAAiH;gBACjH,6EAA6E;gBAC7E,8CAA8C;gBAC9C,EAAE;gBACF,oBAAoB;gBACpB,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;gBAC7B,KAAK;gBACL,EAAE;gBACF,eAAe;gBACf,eAAe;gBACf,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC;gBAC7B,KAAK;gBACL,EAAE;gBACF,qEAAqE;gBACrE,8FAA8F;aAC/F,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,6BAA6B,iCA4CxC"}
@@ -1,4 +1,3 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { AutoBeOpenApi } from "@autobe/interface";
3
2
  import { AutoBeState } from "../../context/AutoBeState";
4
- export declare const transformTestScenarioHistories: (state: AutoBeState, allEndpoints: AutoBeOpenApi.IEndpoint[], files: Record<string, string>) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
3
+ export declare const transformTestScenarioHistories: (state: AutoBeState) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;