@autobe/agent 0.25.3 → 0.25.5
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 +2 -0
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -1
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/factory/consentFunctionCall.js +2 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +2 -0
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/supportMistral.d.ts +4 -0
- package/lib/factory/supportMistral.js +112 -0
- package/lib/factory/supportMistral.js.map +1 -0
- package/lib/index.mjs +1997 -1422
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +1 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +370 -275
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +370 -275
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +304 -221
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +303 -220
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +17 -22
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +372 -277
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +322 -350
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/utils/validateEmptyCode.d.ts +8 -0
- package/lib/utils/validateEmptyCode.js +35 -0
- package/lib/utils/validateEmptyCode.js.map +1 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +2 -0
- package/src/AutoBeMockAgent.ts +1 -1
- package/src/factory/consentFunctionCall.ts +3 -0
- package/src/factory/createAutoBeContext.ts +2 -0
- package/src/factory/supportMistral.ts +122 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +52 -10
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +58 -17
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +51 -15
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +46 -12
- package/src/orchestrate/test/orchestrateTestCorrect.ts +17 -24
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +57 -10
- package/src/orchestrate/test/orchestrateTestWrite.ts +41 -10
- package/src/utils/validateEmptyCode.ts +41 -0
|
@@ -47,11 +47,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.orchestrateRealizeCorrectCasting = void 0;
|
|
49
49
|
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
|
|
50
51
|
const utils_1 = require("@autobe/utils");
|
|
51
52
|
const typia_1 = __importDefault(require("typia"));
|
|
52
53
|
const uuid_1 = require("uuid");
|
|
53
54
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
55
|
const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
|
|
56
|
+
const validateEmptyCode_1 = require("../../utils/validateEmptyCode");
|
|
55
57
|
const transformRealizeCorrectCastingHistories_1 = require("./histories/transformRealizeCorrectCastingHistories");
|
|
56
58
|
const compileRealizeFiles_1 = require("./internal/compileRealizeFiles");
|
|
57
59
|
const getRealizeWriteCodeTemplate_1 = require("./utils/getRealizeWriteCodeTemplate");
|
|
@@ -101,6 +103,7 @@ const correct = (ctx, scenarios, authorizations, functions, failures, progress,
|
|
|
101
103
|
]),
|
|
102
104
|
controller: createController({
|
|
103
105
|
model: ctx.model,
|
|
106
|
+
functionName: scenario.functionName,
|
|
104
107
|
then: (next) => {
|
|
105
108
|
pointer.value = next;
|
|
106
109
|
},
|
|
@@ -274,7 +277,75 @@ const filterRelevantDiagnostics = (diagnostics, functionLocations) => {
|
|
|
274
277
|
};
|
|
275
278
|
const createController = (props) => {
|
|
276
279
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
277
|
-
const
|
|
280
|
+
const validate = (input) => {
|
|
281
|
+
const result = (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
282
|
+
path: _path + ".think",
|
|
283
|
+
expected: "string",
|
|
284
|
+
value: input.think
|
|
285
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
286
|
+
path: _path + ".draft",
|
|
287
|
+
expected: "string",
|
|
288
|
+
value: input.draft
|
|
289
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
290
|
+
path: _path + ".revise",
|
|
291
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
292
|
+
value: input.revise
|
|
293
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
294
|
+
path: _path + ".revise",
|
|
295
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
296
|
+
value: input.revise
|
|
297
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
298
|
+
path: _path + ".review",
|
|
299
|
+
expected: "string",
|
|
300
|
+
value: input.review
|
|
301
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
302
|
+
path: _path + ".final",
|
|
303
|
+
expected: "(null | string)",
|
|
304
|
+
value: input.final
|
|
305
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
306
|
+
if (false === __is(input)) {
|
|
307
|
+
errors = [];
|
|
308
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
309
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
310
|
+
path: _path + "",
|
|
311
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
312
|
+
value: input
|
|
313
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
314
|
+
path: _path + "",
|
|
315
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
316
|
+
value: input
|
|
317
|
+
}))(input, "$input", true);
|
|
318
|
+
const success = 0 === errors.length;
|
|
319
|
+
return success ? {
|
|
320
|
+
success,
|
|
321
|
+
data: input
|
|
322
|
+
} : {
|
|
323
|
+
success,
|
|
324
|
+
errors,
|
|
325
|
+
data: input
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
success: true,
|
|
330
|
+
data: input
|
|
331
|
+
};
|
|
332
|
+
}; })()(input);
|
|
333
|
+
if (result.success === false)
|
|
334
|
+
return result;
|
|
335
|
+
const errors = (0, validateEmptyCode_1.validateEmptyCode)({
|
|
336
|
+
functionName: props.functionName,
|
|
337
|
+
draft: result.data.draft,
|
|
338
|
+
revise: result.data.revise,
|
|
339
|
+
});
|
|
340
|
+
return errors.length
|
|
341
|
+
? {
|
|
342
|
+
success: false,
|
|
343
|
+
errors,
|
|
344
|
+
data: result.data,
|
|
345
|
+
}
|
|
346
|
+
: result;
|
|
347
|
+
};
|
|
348
|
+
const application = collection[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
278
349
|
return {
|
|
279
350
|
protocol: "class",
|
|
280
351
|
name: "correctInvalidRequest",
|
|
@@ -290,297 +361,321 @@ const createController = (props) => {
|
|
|
290
361
|
};
|
|
291
362
|
};
|
|
292
363
|
const collection = {
|
|
293
|
-
chatgpt: {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
364
|
+
chatgpt: (validate) => (() => {
|
|
365
|
+
const application = {
|
|
366
|
+
model: "chatgpt",
|
|
367
|
+
options: {
|
|
368
|
+
reference: true,
|
|
369
|
+
strict: false,
|
|
370
|
+
separate: null
|
|
371
|
+
},
|
|
372
|
+
functions: [
|
|
373
|
+
{
|
|
374
|
+
name: "rewrite",
|
|
375
|
+
parameters: {
|
|
376
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Review and finalization of type casting corrections.\n> \n> Contains the review of applied corrections and the final code with all\n> type casting issues resolved while preserving type safety and validation\n> intent.",
|
|
377
|
+
type: "object",
|
|
378
|
+
properties: {
|
|
379
|
+
think: {
|
|
380
|
+
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal\n type conversion, etc.)\n- Whether nullable or undefined types are involved\n- If Date to string conversions are needed\n- The chosen fix strategy for the specific error type",
|
|
381
|
+
type: "string"
|
|
382
|
+
},
|
|
383
|
+
draft: {
|
|
384
|
+
description: "Draft correction with initial type casting fixes.\n\nThe code after applying the first round of fixes:\n\n- Satisfies patterns for tag stripping\n- Date.toISOString() conversions where needed\n- Nullable type narrowing checks\n- Literal type assertions\n- Optional chaining result handling",
|
|
385
|
+
type: "string"
|
|
386
|
+
},
|
|
387
|
+
revise: {
|
|
388
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
389
|
+
}
|
|
314
390
|
},
|
|
315
|
-
|
|
316
|
-
|
|
391
|
+
required: [
|
|
392
|
+
"think",
|
|
393
|
+
"draft",
|
|
394
|
+
"revise"
|
|
395
|
+
],
|
|
396
|
+
additionalProperties: false,
|
|
397
|
+
$defs: {
|
|
398
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
399
|
+
type: "object",
|
|
400
|
+
properties: {
|
|
401
|
+
review: {
|
|
402
|
+
description: "Review of the type casting correction patterns applied.\n\nExplains which correction strategies were used:\n\n- Which satisfies patterns were applied for tag issues\n- Where typia.assert or assertGuard was used\n- How Date conversions were handled\n- What nullable type narrowing was applied\n- How literal type conversions were resolved\n- Confirmation that all type casting issues are resolved",
|
|
403
|
+
type: "string"
|
|
404
|
+
},
|
|
405
|
+
final: {
|
|
406
|
+
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic. When the draft\nalready successfully resolves all type casting issues with no problems\nfound during review, this value can be null, indicating no further\nrefinements are necessary.\n\nA `null` value signifies the draft corrections were already optimal and\nrequire no additional modifications.",
|
|
407
|
+
anyOf: [
|
|
408
|
+
{
|
|
409
|
+
type: "null"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
type: "string"
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
required: [
|
|
418
|
+
"review",
|
|
419
|
+
"final"
|
|
420
|
+
]
|
|
421
|
+
}
|
|
317
422
|
}
|
|
318
423
|
},
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
424
|
+
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
425
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
426
|
+
path: _path + ".think",
|
|
427
|
+
expected: "string",
|
|
428
|
+
value: input.think
|
|
429
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
430
|
+
path: _path + ".draft",
|
|
431
|
+
expected: "string",
|
|
432
|
+
value: input.draft
|
|
433
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
434
|
+
path: _path + ".revise",
|
|
435
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
436
|
+
value: input.revise
|
|
437
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
438
|
+
path: _path + ".revise",
|
|
439
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
440
|
+
value: input.revise
|
|
441
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
442
|
+
path: _path + ".review",
|
|
443
|
+
expected: "string",
|
|
444
|
+
value: input.review
|
|
445
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
446
|
+
path: _path + ".final",
|
|
447
|
+
expected: "(null | string)",
|
|
448
|
+
value: input.final
|
|
449
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
450
|
+
if (false === __is(input)) {
|
|
451
|
+
errors = [];
|
|
452
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
453
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
454
|
+
path: _path + "",
|
|
455
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
456
|
+
value: input
|
|
457
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
458
|
+
path: _path + "",
|
|
459
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
460
|
+
value: input
|
|
461
|
+
}))(input, "$input", true);
|
|
462
|
+
const success = 0 === errors.length;
|
|
463
|
+
return success ? {
|
|
464
|
+
success,
|
|
465
|
+
data: input
|
|
466
|
+
} : {
|
|
467
|
+
success,
|
|
468
|
+
errors,
|
|
469
|
+
data: input
|
|
470
|
+
};
|
|
349
471
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
353
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
354
|
-
path: _path + ".think",
|
|
355
|
-
expected: "string",
|
|
356
|
-
value: input.think
|
|
357
|
-
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
358
|
-
path: _path + ".draft",
|
|
359
|
-
expected: "string",
|
|
360
|
-
value: input.draft
|
|
361
|
-
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
362
|
-
path: _path + ".revise",
|
|
363
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
364
|
-
value: input.revise
|
|
365
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
366
|
-
path: _path + ".revise",
|
|
367
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
368
|
-
value: input.revise
|
|
369
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
370
|
-
path: _path + ".review",
|
|
371
|
-
expected: "string",
|
|
372
|
-
value: input.review
|
|
373
|
-
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
374
|
-
path: _path + ".final",
|
|
375
|
-
expected: "(null | string)",
|
|
376
|
-
value: input.final
|
|
377
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
378
|
-
if (false === __is(input)) {
|
|
379
|
-
errors = [];
|
|
380
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
381
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
382
|
-
path: _path + "",
|
|
383
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
384
|
-
value: input
|
|
385
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
386
|
-
path: _path + "",
|
|
387
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
388
|
-
value: input
|
|
389
|
-
}))(input, "$input", true);
|
|
390
|
-
const success = 0 === errors.length;
|
|
391
|
-
return success ? {
|
|
392
|
-
success,
|
|
393
|
-
data: input
|
|
394
|
-
} : {
|
|
395
|
-
success,
|
|
396
|
-
errors,
|
|
472
|
+
return {
|
|
473
|
+
success: true,
|
|
397
474
|
data: input
|
|
398
475
|
};
|
|
399
|
-
}
|
|
400
|
-
return {
|
|
401
|
-
success: true,
|
|
402
|
-
data: input
|
|
403
|
-
};
|
|
404
|
-
}; })()
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
name: "reject",
|
|
408
|
-
parameters: {
|
|
409
|
-
type: "object",
|
|
410
|
-
properties: {},
|
|
411
|
-
additionalProperties: false,
|
|
412
|
-
required: [],
|
|
413
|
-
$defs: {}
|
|
476
|
+
}; })()
|
|
414
477
|
},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
errors
|
|
478
|
+
{
|
|
479
|
+
name: "reject",
|
|
480
|
+
parameters: {
|
|
481
|
+
type: "object",
|
|
482
|
+
properties: {},
|
|
483
|
+
additionalProperties: false,
|
|
484
|
+
required: [],
|
|
485
|
+
$defs: {}
|
|
486
|
+
},
|
|
487
|
+
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type\ncasting issues (e.g., missing imports, syntax errors, undefined variables),\nindicating the error should be handled by a different agent.",
|
|
488
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
489
|
+
if (false === __is(input)) {
|
|
490
|
+
errors = [];
|
|
491
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
492
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
493
|
+
const success = 0 === errors.length;
|
|
494
|
+
return success ? {
|
|
495
|
+
success,
|
|
496
|
+
data: input
|
|
497
|
+
} : {
|
|
498
|
+
success,
|
|
499
|
+
errors,
|
|
500
|
+
data: input
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
success: true,
|
|
428
505
|
data: input
|
|
429
506
|
};
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
507
|
+
}; })()
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
};
|
|
511
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
|
|
512
|
+
validate: {
|
|
513
|
+
rewrite: validate,
|
|
514
|
+
reject: () => ({
|
|
515
|
+
success: true,
|
|
516
|
+
data: undefined,
|
|
517
|
+
}),
|
|
518
|
+
},
|
|
519
|
+
}), { equals: false }));
|
|
520
|
+
return application;
|
|
521
|
+
})(),
|
|
522
|
+
claude: (validate) => (() => {
|
|
523
|
+
const application = {
|
|
524
|
+
model: "claude",
|
|
525
|
+
options: {
|
|
526
|
+
reference: true,
|
|
527
|
+
separate: null
|
|
528
|
+
},
|
|
529
|
+
functions: [
|
|
530
|
+
{
|
|
531
|
+
name: "rewrite",
|
|
532
|
+
parameters: {
|
|
533
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
534
|
+
type: "object",
|
|
535
|
+
properties: {
|
|
536
|
+
think: {
|
|
537
|
+
description: "Initial analysis of the type casting or assignment error.\n\nContains the agent's analysis of the specific type mismatch pattern:\n\n- Type of casting error (tag incompatibility, nullable assignment, literal\n type conversion, etc.)\n- Whether nullable or undefined types are involved\n- If Date to string conversions are needed\n- The chosen fix strategy for the specific error type",
|
|
538
|
+
type: "string"
|
|
539
|
+
},
|
|
540
|
+
draft: {
|
|
541
|
+
description: "Draft correction with initial type casting fixes.\n\nThe code after applying the first round of fixes:\n\n- Satisfies patterns for tag stripping\n- Date.toISOString() conversions where needed\n- Nullable type narrowing checks\n- Literal type assertions\n- Optional chaining result handling",
|
|
542
|
+
type: "string"
|
|
543
|
+
},
|
|
544
|
+
revise: {
|
|
545
|
+
description: "Review and finalization of type casting corrections.\n\nContains the review of applied corrections and the final code with all\ntype casting issues resolved while preserving type safety and validation\nintent.",
|
|
546
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
547
|
+
}
|
|
459
548
|
},
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
549
|
+
required: [
|
|
550
|
+
"think",
|
|
551
|
+
"draft",
|
|
552
|
+
"revise"
|
|
553
|
+
],
|
|
554
|
+
additionalProperties: false,
|
|
555
|
+
$defs: {
|
|
556
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
557
|
+
type: "object",
|
|
558
|
+
properties: {
|
|
559
|
+
review: {
|
|
560
|
+
description: "Review of the type casting correction patterns applied.\n\nExplains which correction strategies were used:\n\n- Which satisfies patterns were applied for tag issues\n- Where typia.assert or assertGuard was used\n- How Date conversions were handled\n- What nullable type narrowing was applied\n- How literal type conversions were resolved\n- Confirmation that all type casting issues are resolved",
|
|
561
|
+
type: "string"
|
|
562
|
+
},
|
|
563
|
+
final: {
|
|
564
|
+
description: "Final corrected code with all type casting issues resolved.\n\nThe complete code ready for TypeScript compilation, with all type casting\nand assignment errors properly fixed using appropriate patterns while\nmaintaining type safety and the original validation logic. When the draft\nalready successfully resolves all type casting issues with no problems\nfound during review, this value can be null, indicating no further\nrefinements are necessary.\n\nA `null` value signifies the draft corrections were already optimal and\nrequire no additional modifications.",
|
|
565
|
+
oneOf: [
|
|
566
|
+
{
|
|
567
|
+
type: "null"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
type: "string"
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
required: [
|
|
576
|
+
"review",
|
|
577
|
+
"final"
|
|
578
|
+
]
|
|
579
|
+
}
|
|
463
580
|
}
|
|
464
581
|
},
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
582
|
+
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
583
|
+
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
584
|
+
path: _path + ".think",
|
|
585
|
+
expected: "string",
|
|
586
|
+
value: input.think
|
|
587
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
588
|
+
path: _path + ".draft",
|
|
589
|
+
expected: "string",
|
|
590
|
+
value: input.draft
|
|
591
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
592
|
+
path: _path + ".revise",
|
|
593
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
594
|
+
value: input.revise
|
|
595
|
+
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
596
|
+
path: _path + ".revise",
|
|
597
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
598
|
+
value: input.revise
|
|
599
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
600
|
+
path: _path + ".review",
|
|
601
|
+
expected: "string",
|
|
602
|
+
value: input.review
|
|
603
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
604
|
+
path: _path + ".final",
|
|
605
|
+
expected: "(null | string)",
|
|
606
|
+
value: input.final
|
|
607
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
608
|
+
if (false === __is(input)) {
|
|
609
|
+
errors = [];
|
|
610
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
611
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
612
|
+
path: _path + "",
|
|
613
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
614
|
+
value: input
|
|
615
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
616
|
+
path: _path + "",
|
|
617
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
618
|
+
value: input
|
|
619
|
+
}))(input, "$input", true);
|
|
620
|
+
const success = 0 === errors.length;
|
|
621
|
+
return success ? {
|
|
622
|
+
success,
|
|
623
|
+
data: input
|
|
624
|
+
} : {
|
|
625
|
+
success,
|
|
626
|
+
errors,
|
|
627
|
+
data: input
|
|
628
|
+
};
|
|
495
629
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
description: "Rewrite function to fix type casting and assignment errors.\n\nThis function is called when the agent detects any type casting or\nassignment related compilation error patterns.\n\nThe agent applies various fix strategies based on the error type:\n\n- **Typia tag incompatibilities**: Uses `satisfies ... as ...` pattern to\n strip incompatible tags, or `typia.assert<T>()` as a last resort\n- **Date conversions**: Uses `.toISOString()` method for Date to string\n conversions\n- **Nullable type narrowing**: Applies exhaustive checks (e.g., !== null &&\n !== undefined)\n- **typia.assert vs assertGuard**: Uses assert for value assignment,\n assertGuard for type narrowing\n- **Literal type conversions**: Uses `typia.assert<T>()` for runtime\n validation\n- **Optional chaining results**: Uses `=== true` or `??` operators\n- **\"No overlap\" errors**: Removes redundant comparisons",
|
|
499
|
-
validate: (() => { const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise)); const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.think || _report(_exceptionable, {
|
|
500
|
-
path: _path + ".think",
|
|
501
|
-
expected: "string",
|
|
502
|
-
value: input.think
|
|
503
|
-
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
504
|
-
path: _path + ".draft",
|
|
505
|
-
expected: "string",
|
|
506
|
-
value: input.draft
|
|
507
|
-
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
508
|
-
path: _path + ".revise",
|
|
509
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
510
|
-
value: input.revise
|
|
511
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
512
|
-
path: _path + ".revise",
|
|
513
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
514
|
-
value: input.revise
|
|
515
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.review || _report(_exceptionable, {
|
|
516
|
-
path: _path + ".review",
|
|
517
|
-
expected: "string",
|
|
518
|
-
value: input.review
|
|
519
|
-
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
520
|
-
path: _path + ".final",
|
|
521
|
-
expected: "(null | string)",
|
|
522
|
-
value: input.final
|
|
523
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
524
|
-
if (false === __is(input)) {
|
|
525
|
-
errors = [];
|
|
526
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
527
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
528
|
-
path: _path + "",
|
|
529
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
530
|
-
value: input
|
|
531
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
532
|
-
path: _path + "",
|
|
533
|
-
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
534
|
-
value: input
|
|
535
|
-
}))(input, "$input", true);
|
|
536
|
-
const success = 0 === errors.length;
|
|
537
|
-
return success ? {
|
|
538
|
-
success,
|
|
539
|
-
data: input
|
|
540
|
-
} : {
|
|
541
|
-
success,
|
|
542
|
-
errors,
|
|
630
|
+
return {
|
|
631
|
+
success: true,
|
|
543
632
|
data: input
|
|
544
633
|
};
|
|
545
|
-
}
|
|
546
|
-
return {
|
|
547
|
-
success: true,
|
|
548
|
-
data: input
|
|
549
|
-
};
|
|
550
|
-
}; })()
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
name: "reject",
|
|
554
|
-
parameters: {
|
|
555
|
-
type: "object",
|
|
556
|
-
properties: {},
|
|
557
|
-
additionalProperties: false,
|
|
558
|
-
required: [],
|
|
559
|
-
$defs: {}
|
|
634
|
+
}; })()
|
|
560
635
|
},
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
errors
|
|
636
|
+
{
|
|
637
|
+
name: "reject",
|
|
638
|
+
parameters: {
|
|
639
|
+
type: "object",
|
|
640
|
+
properties: {},
|
|
641
|
+
additionalProperties: false,
|
|
642
|
+
required: [],
|
|
643
|
+
$defs: {}
|
|
644
|
+
},
|
|
645
|
+
description: "Reject function when error is not related to type casting or assignment.\n\nThis function is called when the compilation error is unrelated to type\ncasting issues (e.g., missing imports, syntax errors, undefined variables),\nindicating the error should be handled by a different agent.",
|
|
646
|
+
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
647
|
+
if (false === __is(input)) {
|
|
648
|
+
errors = [];
|
|
649
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
650
|
+
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
651
|
+
const success = 0 === errors.length;
|
|
652
|
+
return success ? {
|
|
653
|
+
success,
|
|
654
|
+
data: input
|
|
655
|
+
} : {
|
|
656
|
+
success,
|
|
657
|
+
errors,
|
|
658
|
+
data: input
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
success: true,
|
|
574
663
|
data: input
|
|
575
664
|
};
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
665
|
+
}; })()
|
|
666
|
+
}
|
|
667
|
+
]
|
|
668
|
+
};
|
|
669
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
|
|
670
|
+
validate: {
|
|
671
|
+
rewrite: validate,
|
|
672
|
+
reject: () => ({
|
|
673
|
+
success: true,
|
|
674
|
+
data: undefined,
|
|
675
|
+
}),
|
|
676
|
+
},
|
|
677
|
+
}), { equals: false }));
|
|
678
|
+
return application;
|
|
679
|
+
})(),
|
|
585
680
|
};
|
|
586
681
|
//# sourceMappingURL=orchestRateRealizeCorrectCasting.js.map
|