@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
package/lib/index.mjs
CHANGED
|
@@ -467,7 +467,7 @@ function createController$q(props) {
|
|
|
467
467
|
};
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
const claude$
|
|
470
|
+
const claude$b = {
|
|
471
471
|
model: "claude",
|
|
472
472
|
options: {
|
|
473
473
|
reference: true,
|
|
@@ -628,10 +628,10 @@ const collection$s = {
|
|
|
628
628
|
})()
|
|
629
629
|
} ]
|
|
630
630
|
},
|
|
631
|
-
claude: claude$
|
|
632
|
-
llama: claude$
|
|
633
|
-
deepseek: claude$
|
|
634
|
-
3.1: claude$
|
|
631
|
+
claude: claude$b,
|
|
632
|
+
llama: claude$b,
|
|
633
|
+
deepseek: claude$b,
|
|
634
|
+
3.1: claude$b
|
|
635
635
|
};
|
|
636
636
|
|
|
637
637
|
function transformAnalyzeSceHistories(ctx, instruction) {
|
|
@@ -726,7 +726,7 @@ function createController$p(props) {
|
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
-
const claude$
|
|
729
|
+
const claude$a = {
|
|
730
730
|
model: "claude",
|
|
731
731
|
options: {
|
|
732
732
|
reference: true,
|
|
@@ -1355,10 +1355,10 @@ const collection$r = {
|
|
|
1355
1355
|
})()
|
|
1356
1356
|
} ]
|
|
1357
1357
|
},
|
|
1358
|
-
claude: claude$
|
|
1359
|
-
llama: claude$
|
|
1360
|
-
deepseek: claude$
|
|
1361
|
-
3.1: claude$
|
|
1358
|
+
claude: claude$a,
|
|
1359
|
+
llama: claude$a,
|
|
1360
|
+
deepseek: claude$a,
|
|
1361
|
+
3.1: claude$a
|
|
1362
1362
|
};
|
|
1363
1363
|
|
|
1364
1364
|
const orchestrateAnalyzeWrite = async (ctx, props) => {
|
|
@@ -1410,7 +1410,7 @@ function createController$o(props) {
|
|
|
1410
1410
|
};
|
|
1411
1411
|
}
|
|
1412
1412
|
|
|
1413
|
-
const claude$
|
|
1413
|
+
const claude$9 = {
|
|
1414
1414
|
model: "claude",
|
|
1415
1415
|
options: {
|
|
1416
1416
|
reference: true,
|
|
@@ -1555,10 +1555,10 @@ const collection$q = {
|
|
|
1555
1555
|
})()
|
|
1556
1556
|
} ]
|
|
1557
1557
|
},
|
|
1558
|
-
claude: claude$
|
|
1559
|
-
llama: claude$
|
|
1560
|
-
deepseek: claude$
|
|
1561
|
-
3.1: claude$
|
|
1558
|
+
claude: claude$9,
|
|
1559
|
+
llama: claude$9,
|
|
1560
|
+
deepseek: claude$9,
|
|
1561
|
+
3.1: claude$9
|
|
1562
1562
|
};
|
|
1563
1563
|
|
|
1564
1564
|
const orchestrateAnalyze = ctx => async props => {
|
|
@@ -8607,7 +8607,7 @@ function createController$l(props) {
|
|
|
8607
8607
|
};
|
|
8608
8608
|
}
|
|
8609
8609
|
|
|
8610
|
-
const claude$
|
|
8610
|
+
const claude$8 = {
|
|
8611
8611
|
model: "claude",
|
|
8612
8612
|
options: {
|
|
8613
8613
|
reference: true,
|
|
@@ -8854,10 +8854,10 @@ const collection$n = {
|
|
|
8854
8854
|
})()
|
|
8855
8855
|
} ]
|
|
8856
8856
|
},
|
|
8857
|
-
claude: claude$
|
|
8858
|
-
llama: claude$
|
|
8859
|
-
deepseek: claude$
|
|
8860
|
-
3.1: claude$
|
|
8857
|
+
claude: claude$8,
|
|
8858
|
+
llama: claude$8,
|
|
8859
|
+
deepseek: claude$8,
|
|
8860
|
+
3.1: claude$8
|
|
8861
8861
|
};
|
|
8862
8862
|
|
|
8863
8863
|
async function orchestrateInterfaceEndpoints(ctx, props) {
|
|
@@ -8931,7 +8931,7 @@ function createController$k(props) {
|
|
|
8931
8931
|
};
|
|
8932
8932
|
}
|
|
8933
8933
|
|
|
8934
|
-
const claude$
|
|
8934
|
+
const claude$7 = {
|
|
8935
8935
|
model: "claude",
|
|
8936
8936
|
options: {
|
|
8937
8937
|
reference: true,
|
|
@@ -9171,10 +9171,10 @@ const collection$m = {
|
|
|
9171
9171
|
})()
|
|
9172
9172
|
} ]
|
|
9173
9173
|
},
|
|
9174
|
-
claude: claude$
|
|
9175
|
-
llama: claude$
|
|
9176
|
-
deepseek: claude$
|
|
9177
|
-
3.1: claude$
|
|
9174
|
+
claude: claude$7,
|
|
9175
|
+
llama: claude$7,
|
|
9176
|
+
deepseek: claude$7,
|
|
9177
|
+
3.1: claude$7
|
|
9178
9178
|
};
|
|
9179
9179
|
|
|
9180
9180
|
const transformInterfaceCommonPrerequisiteHistories = state => {
|
|
@@ -9283,7 +9283,7 @@ function createController$j(props) {
|
|
|
9283
9283
|
};
|
|
9284
9284
|
}
|
|
9285
9285
|
|
|
9286
|
-
const claude$
|
|
9286
|
+
const claude$6 = {
|
|
9287
9287
|
model: "claude",
|
|
9288
9288
|
options: {
|
|
9289
9289
|
reference: true,
|
|
@@ -9523,10 +9523,10 @@ const chatgpt = {
|
|
|
9523
9523
|
|
|
9524
9524
|
const collection$l = {
|
|
9525
9525
|
chatgpt,
|
|
9526
|
-
claude: claude$
|
|
9527
|
-
llama: claude$
|
|
9528
|
-
deepseek: claude$
|
|
9529
|
-
3.1: claude$
|
|
9526
|
+
claude: claude$6,
|
|
9527
|
+
llama: claude$6,
|
|
9528
|
+
deepseek: claude$6,
|
|
9529
|
+
3.1: claude$6
|
|
9530
9530
|
};
|
|
9531
9531
|
|
|
9532
9532
|
function divideArray(props) {
|
|
@@ -21005,7 +21005,7 @@ function createController$e(props) {
|
|
|
21005
21005
|
};
|
|
21006
21006
|
}
|
|
21007
21007
|
|
|
21008
|
-
const claude$
|
|
21008
|
+
const claude$5 = {
|
|
21009
21009
|
model: "claude",
|
|
21010
21010
|
options: {
|
|
21011
21011
|
reference: true,
|
|
@@ -21387,10 +21387,10 @@ const collection$f = {
|
|
|
21387
21387
|
})()
|
|
21388
21388
|
} ]
|
|
21389
21389
|
},
|
|
21390
|
-
claude: claude$
|
|
21391
|
-
llama: claude$
|
|
21392
|
-
deepseek: claude$
|
|
21393
|
-
3.1: claude$
|
|
21390
|
+
claude: claude$5,
|
|
21391
|
+
llama: claude$5,
|
|
21392
|
+
deepseek: claude$5,
|
|
21393
|
+
3.1: claude$5
|
|
21394
21394
|
};
|
|
21395
21395
|
|
|
21396
21396
|
const transformPrismaCorrectHistories = result => [ {
|
|
@@ -21430,7 +21430,7 @@ function orchestratePrismaCorrect(ctx, application) {
|
|
|
21430
21430
|
return true;
|
|
21431
21431
|
});
|
|
21432
21432
|
application.files = application.files.filter(f => f.models.length !== 0);
|
|
21433
|
-
return iterate(ctx, application, Math.max(ctx.retry,
|
|
21433
|
+
return iterate(ctx, application, Math.max(ctx.retry, 8));
|
|
21434
21434
|
}
|
|
21435
21435
|
|
|
21436
21436
|
async function iterate(ctx, application, life) {
|
|
@@ -21551,7 +21551,7 @@ const getTableCount = failure => {
|
|
|
21551
21551
|
return unique.size;
|
|
21552
21552
|
};
|
|
21553
21553
|
|
|
21554
|
-
const claude$
|
|
21554
|
+
const claude$4 = {
|
|
21555
21555
|
model: "claude",
|
|
21556
21556
|
options: {
|
|
21557
21557
|
reference: true,
|
|
@@ -22650,10 +22650,10 @@ const collection$e = {
|
|
|
22650
22650
|
})()
|
|
22651
22651
|
} ]
|
|
22652
22652
|
},
|
|
22653
|
-
claude: claude$
|
|
22654
|
-
llama: claude$
|
|
22655
|
-
deepseek: claude$
|
|
22656
|
-
3.1: claude$
|
|
22653
|
+
claude: claude$4,
|
|
22654
|
+
llama: claude$4,
|
|
22655
|
+
deepseek: claude$4,
|
|
22656
|
+
3.1: claude$4
|
|
22657
22657
|
};
|
|
22658
22658
|
|
|
22659
22659
|
const transformPrismaReviewHistories = props => [ {
|
|
@@ -22783,7 +22783,7 @@ function createController$c(ctx, props) {
|
|
|
22783
22783
|
};
|
|
22784
22784
|
}
|
|
22785
22785
|
|
|
22786
|
-
const claude$
|
|
22786
|
+
const claude$3 = {
|
|
22787
22787
|
model: "claude",
|
|
22788
22788
|
options: {
|
|
22789
22789
|
reference: true,
|
|
@@ -23898,10 +23898,10 @@ const collection$d = {
|
|
|
23898
23898
|
})()
|
|
23899
23899
|
} ]
|
|
23900
23900
|
},
|
|
23901
|
-
claude: claude$
|
|
23902
|
-
llama: claude$
|
|
23903
|
-
deepseek: claude$
|
|
23904
|
-
3.1: claude$
|
|
23901
|
+
claude: claude$3,
|
|
23902
|
+
llama: claude$3,
|
|
23903
|
+
deepseek: claude$3,
|
|
23904
|
+
3.1: claude$3
|
|
23905
23905
|
};
|
|
23906
23906
|
|
|
23907
23907
|
const transformPrismaSchemaHistories = props => [ {
|
|
@@ -25614,6 +25614,34 @@ async function compileRealizeFiles(ctx, props) {
|
|
|
25614
25614
|
};
|
|
25615
25615
|
}
|
|
25616
25616
|
|
|
25617
|
+
const validateEmptyCode = props => {
|
|
25618
|
+
const errors = [];
|
|
25619
|
+
if (props.draft.includes(props.functionName) === false) errors.push({
|
|
25620
|
+
path: "$input.draft",
|
|
25621
|
+
expected: `string (including function named '${props.functionName}')`,
|
|
25622
|
+
value: props.draft,
|
|
25623
|
+
description: description(props.functionName)
|
|
25624
|
+
});
|
|
25625
|
+
if (props.revise.final !== null && props.revise.final.includes(props.functionName) === false) errors.push({
|
|
25626
|
+
path: "$input.revise.final",
|
|
25627
|
+
expected: `string (including function named '${props.functionName}')`,
|
|
25628
|
+
value: props.revise.final,
|
|
25629
|
+
description: description(props.functionName)
|
|
25630
|
+
});
|
|
25631
|
+
return errors;
|
|
25632
|
+
};
|
|
25633
|
+
|
|
25634
|
+
const description = func => StringUtil.trim`
|
|
25635
|
+
The function ${func} does not exist in the provided code snippet.
|
|
25636
|
+
|
|
25637
|
+
The first reason of the non-existence is that the code snippet is empty,
|
|
25638
|
+
and the second reason is that AI has written different function name
|
|
25639
|
+
by mistake.
|
|
25640
|
+
|
|
25641
|
+
Please make sure that the code snippet includes the function ${func}.
|
|
25642
|
+
Note that, you never have to write empty code or different function name.
|
|
25643
|
+
`;
|
|
25644
|
+
|
|
25617
25645
|
function printErrorHints(code, diagnostics) {
|
|
25618
25646
|
const lines = code.split("\n");
|
|
25619
25647
|
let cursor = 0;
|
|
@@ -25792,6 +25820,7 @@ const correct$4 = async (ctx, scenarios, authorizations, functions, failures, pr
|
|
|
25792
25820
|
} ]),
|
|
25793
25821
|
controller: createController$a({
|
|
25794
25822
|
model: ctx.model,
|
|
25823
|
+
functionName: scenario.functionName,
|
|
25795
25824
|
then: next => {
|
|
25796
25825
|
pointer.value = next;
|
|
25797
25826
|
},
|
|
@@ -25932,7 +25961,81 @@ const filterRelevantDiagnostics = (diagnostics, functionLocations) => diagnostic
|
|
|
25932
25961
|
|
|
25933
25962
|
const createController$a = props => {
|
|
25934
25963
|
assertSchemaModel(props.model);
|
|
25935
|
-
const
|
|
25964
|
+
const validate = input => {
|
|
25965
|
+
const result = (() => {
|
|
25966
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
25967
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
25968
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
25969
|
+
path: _path + ".think",
|
|
25970
|
+
expected: "string",
|
|
25971
|
+
value: input.think
|
|
25972
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
25973
|
+
path: _path + ".draft",
|
|
25974
|
+
expected: "string",
|
|
25975
|
+
value: input.draft
|
|
25976
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
25977
|
+
path: _path + ".revise",
|
|
25978
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
25979
|
+
value: input.revise
|
|
25980
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
25981
|
+
path: _path + ".revise",
|
|
25982
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
25983
|
+
value: input.revise
|
|
25984
|
+
}) ].every(flag => flag);
|
|
25985
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
25986
|
+
path: _path + ".review",
|
|
25987
|
+
expected: "string",
|
|
25988
|
+
value: input.review
|
|
25989
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
25990
|
+
path: _path + ".final",
|
|
25991
|
+
expected: "(null | string)",
|
|
25992
|
+
value: input.final
|
|
25993
|
+
}) ].every(flag => flag);
|
|
25994
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
25995
|
+
let errors;
|
|
25996
|
+
let _report;
|
|
25997
|
+
return input => {
|
|
25998
|
+
if (false === __is(input)) {
|
|
25999
|
+
errors = [];
|
|
26000
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
26001
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
26002
|
+
path: _path + "",
|
|
26003
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26004
|
+
value: input
|
|
26005
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
26006
|
+
path: _path + "",
|
|
26007
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26008
|
+
value: input
|
|
26009
|
+
}))(input, "$input", true);
|
|
26010
|
+
const success = 0 === errors.length;
|
|
26011
|
+
return success ? {
|
|
26012
|
+
success,
|
|
26013
|
+
data: input
|
|
26014
|
+
} : {
|
|
26015
|
+
success,
|
|
26016
|
+
errors,
|
|
26017
|
+
data: input
|
|
26018
|
+
};
|
|
26019
|
+
}
|
|
26020
|
+
return {
|
|
26021
|
+
success: true,
|
|
26022
|
+
data: input
|
|
26023
|
+
};
|
|
26024
|
+
};
|
|
26025
|
+
})()(input);
|
|
26026
|
+
if (result.success === false) return result;
|
|
26027
|
+
const errors = validateEmptyCode({
|
|
26028
|
+
functionName: props.functionName,
|
|
26029
|
+
draft: result.data.draft,
|
|
26030
|
+
revise: result.data.revise
|
|
26031
|
+
});
|
|
26032
|
+
return errors.length ? {
|
|
26033
|
+
success: false,
|
|
26034
|
+
errors,
|
|
26035
|
+
data: result.data
|
|
26036
|
+
} : result;
|
|
26037
|
+
};
|
|
26038
|
+
const application = collection$b[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
25936
26039
|
return {
|
|
25937
26040
|
protocol: "class",
|
|
25938
26041
|
name: "correctInvalidRequest",
|
|
@@ -25949,258 +26052,288 @@ const createController$a = props => {
|
|
|
25949
26052
|
};
|
|
25950
26053
|
|
|
25951
26054
|
const collection$b = {
|
|
25952
|
-
chatgpt: {
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25957
|
-
|
|
25958
|
-
|
|
25959
|
-
|
|
25960
|
-
|
|
25961
|
-
|
|
25962
|
-
|
|
25963
|
-
|
|
25964
|
-
|
|
25965
|
-
|
|
25966
|
-
|
|
25967
|
-
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25971
|
-
|
|
26055
|
+
chatgpt: validate => (() => {
|
|
26056
|
+
const application = {
|
|
26057
|
+
model: "chatgpt",
|
|
26058
|
+
options: {
|
|
26059
|
+
reference: true,
|
|
26060
|
+
strict: false,
|
|
26061
|
+
separate: null
|
|
26062
|
+
},
|
|
26063
|
+
functions: [ {
|
|
26064
|
+
name: "rewrite",
|
|
26065
|
+
parameters: {
|
|
26066
|
+
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.",
|
|
26067
|
+
type: "object",
|
|
26068
|
+
properties: {
|
|
26069
|
+
think: {
|
|
26070
|
+
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",
|
|
26071
|
+
type: "string"
|
|
26072
|
+
},
|
|
26073
|
+
draft: {
|
|
26074
|
+
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",
|
|
26075
|
+
type: "string"
|
|
26076
|
+
},
|
|
26077
|
+
revise: {
|
|
26078
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
26079
|
+
}
|
|
25972
26080
|
},
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
|
|
25976
|
-
|
|
25977
|
-
|
|
25978
|
-
|
|
25979
|
-
|
|
25980
|
-
|
|
25981
|
-
type: "object",
|
|
25982
|
-
properties: {
|
|
25983
|
-
review: {
|
|
25984
|
-
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",
|
|
25985
|
-
type: "string"
|
|
25986
|
-
},
|
|
25987
|
-
final: {
|
|
25988
|
-
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.",
|
|
25989
|
-
anyOf: [ {
|
|
25990
|
-
type: "null"
|
|
25991
|
-
}, {
|
|
26081
|
+
required: [ "think", "draft", "revise" ],
|
|
26082
|
+
additionalProperties: false,
|
|
26083
|
+
$defs: {
|
|
26084
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
26085
|
+
type: "object",
|
|
26086
|
+
properties: {
|
|
26087
|
+
review: {
|
|
26088
|
+
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",
|
|
25992
26089
|
type: "string"
|
|
25993
|
-
}
|
|
25994
|
-
|
|
25995
|
-
|
|
25996
|
-
|
|
26090
|
+
},
|
|
26091
|
+
final: {
|
|
26092
|
+
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.",
|
|
26093
|
+
anyOf: [ {
|
|
26094
|
+
type: "null"
|
|
26095
|
+
}, {
|
|
26096
|
+
type: "string"
|
|
26097
|
+
} ]
|
|
26098
|
+
}
|
|
26099
|
+
},
|
|
26100
|
+
required: [ "review", "final" ]
|
|
26101
|
+
}
|
|
25997
26102
|
}
|
|
25998
|
-
}
|
|
25999
|
-
|
|
26000
|
-
|
|
26001
|
-
|
|
26002
|
-
|
|
26003
|
-
|
|
26004
|
-
|
|
26005
|
-
|
|
26006
|
-
|
|
26007
|
-
|
|
26008
|
-
|
|
26009
|
-
|
|
26010
|
-
|
|
26011
|
-
|
|
26012
|
-
|
|
26013
|
-
|
|
26014
|
-
|
|
26015
|
-
|
|
26016
|
-
|
|
26017
|
-
|
|
26018
|
-
|
|
26019
|
-
|
|
26020
|
-
|
|
26021
|
-
|
|
26022
|
-
|
|
26023
|
-
|
|
26024
|
-
|
|
26025
|
-
|
|
26026
|
-
|
|
26027
|
-
|
|
26028
|
-
|
|
26029
|
-
|
|
26030
|
-
|
|
26031
|
-
|
|
26032
|
-
|
|
26033
|
-
|
|
26034
|
-
|
|
26035
|
-
|
|
26036
|
-
|
|
26037
|
-
|
|
26038
|
-
|
|
26039
|
-
|
|
26040
|
-
|
|
26041
|
-
|
|
26042
|
-
|
|
26043
|
-
|
|
26044
|
-
|
|
26045
|
-
|
|
26046
|
-
|
|
26047
|
-
|
|
26048
|
-
|
|
26049
|
-
|
|
26050
|
-
|
|
26051
|
-
|
|
26052
|
-
|
|
26103
|
+
},
|
|
26104
|
+
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',
|
|
26105
|
+
validate: (() => {
|
|
26106
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
26107
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
26108
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
26109
|
+
path: _path + ".think",
|
|
26110
|
+
expected: "string",
|
|
26111
|
+
value: input.think
|
|
26112
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
26113
|
+
path: _path + ".draft",
|
|
26114
|
+
expected: "string",
|
|
26115
|
+
value: input.draft
|
|
26116
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
26117
|
+
path: _path + ".revise",
|
|
26118
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
26119
|
+
value: input.revise
|
|
26120
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
26121
|
+
path: _path + ".revise",
|
|
26122
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
26123
|
+
value: input.revise
|
|
26124
|
+
}) ].every(flag => flag);
|
|
26125
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
26126
|
+
path: _path + ".review",
|
|
26127
|
+
expected: "string",
|
|
26128
|
+
value: input.review
|
|
26129
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
26130
|
+
path: _path + ".final",
|
|
26131
|
+
expected: "(null | string)",
|
|
26132
|
+
value: input.final
|
|
26133
|
+
}) ].every(flag => flag);
|
|
26134
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
26135
|
+
let errors;
|
|
26136
|
+
let _report;
|
|
26137
|
+
return input => {
|
|
26138
|
+
if (false === __is(input)) {
|
|
26139
|
+
errors = [];
|
|
26140
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
26141
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
26142
|
+
path: _path + "",
|
|
26143
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26144
|
+
value: input
|
|
26145
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
26146
|
+
path: _path + "",
|
|
26147
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26148
|
+
value: input
|
|
26149
|
+
}))(input, "$input", true);
|
|
26150
|
+
const success = 0 === errors.length;
|
|
26151
|
+
return success ? {
|
|
26152
|
+
success,
|
|
26153
|
+
data: input
|
|
26154
|
+
} : {
|
|
26155
|
+
success,
|
|
26156
|
+
errors,
|
|
26157
|
+
data: input
|
|
26158
|
+
};
|
|
26159
|
+
}
|
|
26160
|
+
return {
|
|
26161
|
+
success: true,
|
|
26053
26162
|
data: input
|
|
26054
26163
|
};
|
|
26055
|
-
}
|
|
26056
|
-
return {
|
|
26057
|
-
success: true,
|
|
26058
|
-
data: input
|
|
26059
26164
|
};
|
|
26060
|
-
}
|
|
26061
|
-
}
|
|
26062
|
-
|
|
26063
|
-
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
|
|
26067
|
-
|
|
26068
|
-
|
|
26069
|
-
|
|
26165
|
+
})()
|
|
26166
|
+
}, {
|
|
26167
|
+
name: "reject",
|
|
26168
|
+
parameters: {
|
|
26169
|
+
type: "object",
|
|
26170
|
+
properties: {},
|
|
26171
|
+
additionalProperties: false,
|
|
26172
|
+
required: [],
|
|
26173
|
+
$defs: {}
|
|
26174
|
+
},
|
|
26175
|
+
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.",
|
|
26176
|
+
validate: (() => input => ({
|
|
26177
|
+
success: true,
|
|
26178
|
+
data: input
|
|
26179
|
+
}))()
|
|
26180
|
+
} ]
|
|
26181
|
+
};
|
|
26182
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
26183
|
+
...{
|
|
26184
|
+
validate: {
|
|
26185
|
+
rewrite: validate,
|
|
26186
|
+
reject: () => ({
|
|
26187
|
+
success: true,
|
|
26188
|
+
data: undefined
|
|
26189
|
+
})
|
|
26190
|
+
}
|
|
26070
26191
|
},
|
|
26071
|
-
|
|
26072
|
-
|
|
26073
|
-
|
|
26074
|
-
|
|
26075
|
-
|
|
26076
|
-
|
|
26077
|
-
|
|
26078
|
-
|
|
26079
|
-
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26083
|
-
|
|
26084
|
-
|
|
26085
|
-
|
|
26086
|
-
|
|
26087
|
-
|
|
26088
|
-
|
|
26089
|
-
|
|
26090
|
-
|
|
26091
|
-
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
|
|
26095
|
-
|
|
26096
|
-
|
|
26192
|
+
equals: false
|
|
26193
|
+
});
|
|
26194
|
+
return application;
|
|
26195
|
+
})(),
|
|
26196
|
+
claude: validate => (() => {
|
|
26197
|
+
const application = {
|
|
26198
|
+
model: "claude",
|
|
26199
|
+
options: {
|
|
26200
|
+
reference: true,
|
|
26201
|
+
separate: null
|
|
26202
|
+
},
|
|
26203
|
+
functions: [ {
|
|
26204
|
+
name: "rewrite",
|
|
26205
|
+
parameters: {
|
|
26206
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
26207
|
+
type: "object",
|
|
26208
|
+
properties: {
|
|
26209
|
+
think: {
|
|
26210
|
+
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",
|
|
26211
|
+
type: "string"
|
|
26212
|
+
},
|
|
26213
|
+
draft: {
|
|
26214
|
+
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",
|
|
26215
|
+
type: "string"
|
|
26216
|
+
},
|
|
26217
|
+
revise: {
|
|
26218
|
+
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.",
|
|
26219
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
26220
|
+
}
|
|
26097
26221
|
},
|
|
26098
|
-
|
|
26099
|
-
|
|
26100
|
-
|
|
26101
|
-
|
|
26102
|
-
|
|
26103
|
-
|
|
26104
|
-
|
|
26105
|
-
|
|
26106
|
-
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
26107
|
-
type: "object",
|
|
26108
|
-
properties: {
|
|
26109
|
-
review: {
|
|
26110
|
-
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",
|
|
26111
|
-
type: "string"
|
|
26112
|
-
},
|
|
26113
|
-
final: {
|
|
26114
|
-
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.",
|
|
26115
|
-
oneOf: [ {
|
|
26116
|
-
type: "null"
|
|
26117
|
-
}, {
|
|
26222
|
+
required: [ "think", "draft", "revise" ],
|
|
26223
|
+
additionalProperties: false,
|
|
26224
|
+
$defs: {
|
|
26225
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
26226
|
+
type: "object",
|
|
26227
|
+
properties: {
|
|
26228
|
+
review: {
|
|
26229
|
+
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",
|
|
26118
26230
|
type: "string"
|
|
26119
|
-
}
|
|
26120
|
-
|
|
26121
|
-
|
|
26122
|
-
|
|
26231
|
+
},
|
|
26232
|
+
final: {
|
|
26233
|
+
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.",
|
|
26234
|
+
oneOf: [ {
|
|
26235
|
+
type: "null"
|
|
26236
|
+
}, {
|
|
26237
|
+
type: "string"
|
|
26238
|
+
} ]
|
|
26239
|
+
}
|
|
26240
|
+
},
|
|
26241
|
+
required: [ "review", "final" ]
|
|
26242
|
+
}
|
|
26123
26243
|
}
|
|
26124
|
-
}
|
|
26125
|
-
|
|
26126
|
-
|
|
26127
|
-
|
|
26128
|
-
|
|
26129
|
-
|
|
26130
|
-
|
|
26131
|
-
|
|
26132
|
-
|
|
26133
|
-
|
|
26134
|
-
|
|
26135
|
-
|
|
26136
|
-
|
|
26137
|
-
|
|
26138
|
-
|
|
26139
|
-
|
|
26140
|
-
|
|
26141
|
-
|
|
26142
|
-
|
|
26143
|
-
|
|
26144
|
-
|
|
26145
|
-
|
|
26146
|
-
|
|
26147
|
-
|
|
26148
|
-
|
|
26149
|
-
|
|
26150
|
-
|
|
26151
|
-
|
|
26152
|
-
|
|
26153
|
-
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
|
|
26170
|
-
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26174
|
-
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26244
|
+
},
|
|
26245
|
+
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',
|
|
26246
|
+
validate: (() => {
|
|
26247
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
26248
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
26249
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
26250
|
+
path: _path + ".think",
|
|
26251
|
+
expected: "string",
|
|
26252
|
+
value: input.think
|
|
26253
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
26254
|
+
path: _path + ".draft",
|
|
26255
|
+
expected: "string",
|
|
26256
|
+
value: input.draft
|
|
26257
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
26258
|
+
path: _path + ".revise",
|
|
26259
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
26260
|
+
value: input.revise
|
|
26261
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
26262
|
+
path: _path + ".revise",
|
|
26263
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
26264
|
+
value: input.revise
|
|
26265
|
+
}) ].every(flag => flag);
|
|
26266
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
26267
|
+
path: _path + ".review",
|
|
26268
|
+
expected: "string",
|
|
26269
|
+
value: input.review
|
|
26270
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
26271
|
+
path: _path + ".final",
|
|
26272
|
+
expected: "(null | string)",
|
|
26273
|
+
value: input.final
|
|
26274
|
+
}) ].every(flag => flag);
|
|
26275
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
26276
|
+
let errors;
|
|
26277
|
+
let _report;
|
|
26278
|
+
return input => {
|
|
26279
|
+
if (false === __is(input)) {
|
|
26280
|
+
errors = [];
|
|
26281
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
26282
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
26283
|
+
path: _path + "",
|
|
26284
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26285
|
+
value: input
|
|
26286
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
26287
|
+
path: _path + "",
|
|
26288
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
26289
|
+
value: input
|
|
26290
|
+
}))(input, "$input", true);
|
|
26291
|
+
const success = 0 === errors.length;
|
|
26292
|
+
return success ? {
|
|
26293
|
+
success,
|
|
26294
|
+
data: input
|
|
26295
|
+
} : {
|
|
26296
|
+
success,
|
|
26297
|
+
errors,
|
|
26298
|
+
data: input
|
|
26299
|
+
};
|
|
26300
|
+
}
|
|
26301
|
+
return {
|
|
26302
|
+
success: true,
|
|
26179
26303
|
data: input
|
|
26180
26304
|
};
|
|
26181
|
-
}
|
|
26182
|
-
return {
|
|
26183
|
-
success: true,
|
|
26184
|
-
data: input
|
|
26185
26305
|
};
|
|
26186
|
-
}
|
|
26187
|
-
}
|
|
26188
|
-
|
|
26189
|
-
|
|
26190
|
-
|
|
26191
|
-
|
|
26192
|
-
|
|
26193
|
-
|
|
26194
|
-
|
|
26195
|
-
|
|
26306
|
+
})()
|
|
26307
|
+
}, {
|
|
26308
|
+
name: "reject",
|
|
26309
|
+
parameters: {
|
|
26310
|
+
type: "object",
|
|
26311
|
+
properties: {},
|
|
26312
|
+
additionalProperties: false,
|
|
26313
|
+
required: [],
|
|
26314
|
+
$defs: {}
|
|
26315
|
+
},
|
|
26316
|
+
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.",
|
|
26317
|
+
validate: (() => input => ({
|
|
26318
|
+
success: true,
|
|
26319
|
+
data: input
|
|
26320
|
+
}))()
|
|
26321
|
+
} ]
|
|
26322
|
+
};
|
|
26323
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
26324
|
+
...{
|
|
26325
|
+
validate: {
|
|
26326
|
+
rewrite: validate,
|
|
26327
|
+
reject: () => ({
|
|
26328
|
+
success: true,
|
|
26329
|
+
data: undefined
|
|
26330
|
+
})
|
|
26331
|
+
}
|
|
26196
26332
|
},
|
|
26197
|
-
|
|
26198
|
-
|
|
26199
|
-
|
|
26200
|
-
|
|
26201
|
-
}))()
|
|
26202
|
-
} ]
|
|
26203
|
-
}
|
|
26333
|
+
equals: false
|
|
26334
|
+
});
|
|
26335
|
+
return application;
|
|
26336
|
+
})()
|
|
26204
26337
|
};
|
|
26205
26338
|
|
|
26206
26339
|
const transformRealizeAuthorizationHistories = (ctx, role) => [ {
|
|
@@ -26429,7 +26562,7 @@ function createController$9(props) {
|
|
|
26429
26562
|
};
|
|
26430
26563
|
}
|
|
26431
26564
|
|
|
26432
|
-
const claude$
|
|
26565
|
+
const claude$2 = {
|
|
26433
26566
|
model: "claude",
|
|
26434
26567
|
options: {
|
|
26435
26568
|
reference: true,
|
|
@@ -26816,10 +26949,10 @@ const collection$a = {
|
|
|
26816
26949
|
})()
|
|
26817
26950
|
} ]
|
|
26818
26951
|
},
|
|
26819
|
-
claude: claude$
|
|
26820
|
-
llama: claude$
|
|
26821
|
-
deepseek: claude$
|
|
26822
|
-
3.1: claude$
|
|
26952
|
+
claude: claude$2,
|
|
26953
|
+
llama: claude$2,
|
|
26954
|
+
deepseek: claude$2,
|
|
26955
|
+
3.1: claude$2
|
|
26823
26956
|
};
|
|
26824
26957
|
|
|
26825
26958
|
var InternalFileSystem;
|
|
@@ -26922,7 +27055,7 @@ function createController$8(props) {
|
|
|
26922
27055
|
};
|
|
26923
27056
|
}
|
|
26924
27057
|
|
|
26925
|
-
const claude$
|
|
27058
|
+
const claude$1 = {
|
|
26926
27059
|
model: "claude",
|
|
26927
27060
|
options: {
|
|
26928
27061
|
reference: true,
|
|
@@ -27277,10 +27410,10 @@ const collection$9 = {
|
|
|
27277
27410
|
})()
|
|
27278
27411
|
} ]
|
|
27279
27412
|
},
|
|
27280
|
-
claude: claude$
|
|
27281
|
-
llama: claude$
|
|
27282
|
-
deepseek: claude$
|
|
27283
|
-
3.1: claude$
|
|
27413
|
+
claude: claude$1,
|
|
27414
|
+
llama: claude$1,
|
|
27415
|
+
deepseek: claude$1,
|
|
27416
|
+
3.1: claude$1
|
|
27284
27417
|
};
|
|
27285
27418
|
|
|
27286
27419
|
function getRealizeWriteInputType(operation, authorization) {
|
|
@@ -27759,7 +27892,7 @@ async function orchestrateRealizeCorrect(ctx, scenarios, authorizations, functio
|
|
|
27759
27892
|
if (!location.startsWith("src/providers")) return;
|
|
27760
27893
|
if (!diagnosticsByFile[location]) {
|
|
27761
27894
|
const func = functions.find(f => f.location === location);
|
|
27762
|
-
if (
|
|
27895
|
+
if (func === undefined) {
|
|
27763
27896
|
return;
|
|
27764
27897
|
}
|
|
27765
27898
|
const failure = {
|
|
@@ -27819,6 +27952,7 @@ async function step(ctx, props) {
|
|
|
27819
27952
|
source: "realizeCorrect",
|
|
27820
27953
|
controller: createController$7({
|
|
27821
27954
|
model: ctx.model,
|
|
27955
|
+
functionName: props.scenario.functionName,
|
|
27822
27956
|
build: next => {
|
|
27823
27957
|
pointer.value = next;
|
|
27824
27958
|
}
|
|
@@ -27886,69 +28020,8 @@ async function step(ctx, props) {
|
|
|
27886
28020
|
|
|
27887
28021
|
function createController$7(props) {
|
|
27888
28022
|
assertSchemaModel(props.model);
|
|
27889
|
-
const
|
|
27890
|
-
|
|
27891
|
-
protocol: "class",
|
|
27892
|
-
name: "Write code",
|
|
27893
|
-
application,
|
|
27894
|
-
execute: {
|
|
27895
|
-
correct: next => {
|
|
27896
|
-
props.build(next);
|
|
27897
|
-
}
|
|
27898
|
-
}
|
|
27899
|
-
};
|
|
27900
|
-
}
|
|
27901
|
-
|
|
27902
|
-
const claude$3 = {
|
|
27903
|
-
model: "claude",
|
|
27904
|
-
options: {
|
|
27905
|
-
reference: true,
|
|
27906
|
-
separate: null
|
|
27907
|
-
},
|
|
27908
|
-
functions: [ {
|
|
27909
|
-
name: "correct",
|
|
27910
|
-
parameters: {
|
|
27911
|
-
description: " Three-phase correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeCorrectApplication.IProps}",
|
|
27912
|
-
type: "object",
|
|
27913
|
-
properties: {
|
|
27914
|
-
think: {
|
|
27915
|
-
description: "Initial error analysis and correction strategy.\n\nAnalyzes TypeScript compilation errors to understand:\n\n- Error patterns and root causes\n- Required fixes and their impact\n- Whether quick fixes or deep refactoring is needed\n- Prisma schema and API contract constraints",
|
|
27916
|
-
type: "string"
|
|
27917
|
-
},
|
|
27918
|
-
draft: {
|
|
27919
|
-
description: "First correction attempt.\n\nImplements the initial fixes identified in the think phase. For simple\nerrors (typos, missing imports), this may be the final solution. Complex\nerrors may require further refinement.",
|
|
27920
|
-
type: "string"
|
|
27921
|
-
},
|
|
27922
|
-
revise: {
|
|
27923
|
-
description: "Revision and finalization phase.\n\nReviews the draft corrections and produces the final, error-free code\nthat maintains all business requirements.",
|
|
27924
|
-
$ref: "#/$defs/IAutoBeRealizeCorrectApplication.IReviseProps"
|
|
27925
|
-
}
|
|
27926
|
-
},
|
|
27927
|
-
required: [ "think", "draft", "revise" ],
|
|
27928
|
-
additionalProperties: false,
|
|
27929
|
-
$defs: {
|
|
27930
|
-
"IAutoBeRealizeCorrectApplication.IReviseProps": {
|
|
27931
|
-
type: "object",
|
|
27932
|
-
properties: {
|
|
27933
|
-
review: {
|
|
27934
|
-
description: "Correction review and validation.\n\nAnalyzes the draft corrections to ensure:\n\n- All TypeScript errors are resolved\n- Business logic remains intact\n- AutoBE coding standards are maintained\n- No new errors are introduced\n- Performance and security are preserved",
|
|
27935
|
-
type: "string"
|
|
27936
|
-
},
|
|
27937
|
-
final: {
|
|
27938
|
-
description: "Final error-free implementation.\n\nThe complete, corrected code that passes all TypeScript compilation\nchecks.\n\nReturns `null` if the draft corrections are sufficient and need no\nfurther changes.",
|
|
27939
|
-
oneOf: [ {
|
|
27940
|
-
type: "null"
|
|
27941
|
-
}, {
|
|
27942
|
-
type: "string"
|
|
27943
|
-
} ]
|
|
27944
|
-
}
|
|
27945
|
-
},
|
|
27946
|
-
required: [ "review", "final" ]
|
|
27947
|
-
}
|
|
27948
|
-
}
|
|
27949
|
-
},
|
|
27950
|
-
description: "Systematically analyze and correct TypeScript compilation errors.\n\nImplements a three-phase workflow (think → draft → revise) that balances\nefficiency for simple errors with thoroughness for complex problems.",
|
|
27951
|
-
validate: (() => {
|
|
28023
|
+
const validate = input => {
|
|
28024
|
+
const result = (() => {
|
|
27952
28025
|
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
27953
28026
|
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
27954
28027
|
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
@@ -28008,127 +28081,279 @@ const claude$3 = {
|
|
|
28008
28081
|
data: input
|
|
28009
28082
|
};
|
|
28010
28083
|
};
|
|
28011
|
-
})()
|
|
28012
|
-
|
|
28013
|
-
|
|
28084
|
+
})()(input);
|
|
28085
|
+
if (result.success === false) return result;
|
|
28086
|
+
const errors = validateEmptyCode({
|
|
28087
|
+
functionName: props.functionName,
|
|
28088
|
+
draft: result.data.draft,
|
|
28089
|
+
revise: result.data.revise
|
|
28090
|
+
});
|
|
28091
|
+
return errors.length ? {
|
|
28092
|
+
success: false,
|
|
28093
|
+
errors,
|
|
28094
|
+
data: result.data
|
|
28095
|
+
} : result;
|
|
28096
|
+
};
|
|
28097
|
+
const application = collection$8[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
28098
|
+
return {
|
|
28099
|
+
protocol: "class",
|
|
28100
|
+
name: "Write code",
|
|
28101
|
+
application,
|
|
28102
|
+
execute: {
|
|
28103
|
+
correct: next => {
|
|
28104
|
+
props.build(next);
|
|
28105
|
+
}
|
|
28106
|
+
}
|
|
28107
|
+
};
|
|
28108
|
+
}
|
|
28014
28109
|
|
|
28015
28110
|
const collection$8 = {
|
|
28016
|
-
chatgpt: {
|
|
28017
|
-
|
|
28018
|
-
|
|
28019
|
-
|
|
28020
|
-
|
|
28021
|
-
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28025
|
-
|
|
28026
|
-
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28111
|
+
chatgpt: validate => (() => {
|
|
28112
|
+
const application = {
|
|
28113
|
+
model: "chatgpt",
|
|
28114
|
+
options: {
|
|
28115
|
+
reference: true,
|
|
28116
|
+
strict: false,
|
|
28117
|
+
separate: null
|
|
28118
|
+
},
|
|
28119
|
+
functions: [ {
|
|
28120
|
+
name: "correct",
|
|
28121
|
+
parameters: {
|
|
28122
|
+
description: " Three-phase correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeCorrectApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Revision and finalization phase.\n> \n> Reviews the draft corrections and produces the final, error-free code\n> that maintains all business requirements.",
|
|
28123
|
+
type: "object",
|
|
28124
|
+
properties: {
|
|
28125
|
+
think: {
|
|
28126
|
+
description: "Initial error analysis and correction strategy.\n\nAnalyzes TypeScript compilation errors to understand:\n\n- Error patterns and root causes\n- Required fixes and their impact\n- Whether quick fixes or deep refactoring is needed\n- Prisma schema and API contract constraints",
|
|
28127
|
+
type: "string"
|
|
28128
|
+
},
|
|
28129
|
+
draft: {
|
|
28130
|
+
description: "First correction attempt.\n\nImplements the initial fixes identified in the think phase. For simple\nerrors (typos, missing imports), this may be the final solution. Complex\nerrors may require further refinement.",
|
|
28131
|
+
type: "string"
|
|
28132
|
+
},
|
|
28133
|
+
revise: {
|
|
28134
|
+
$ref: "#/$defs/IAutoBeRealizeCorrectApplication.IReviseProps"
|
|
28135
|
+
}
|
|
28036
28136
|
},
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
|
|
28040
|
-
|
|
28041
|
-
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
type: "object",
|
|
28046
|
-
properties: {
|
|
28047
|
-
review: {
|
|
28048
|
-
description: "Correction review and validation.\n\nAnalyzes the draft corrections to ensure:\n\n- All TypeScript errors are resolved\n- Business logic remains intact\n- AutoBE coding standards are maintained\n- No new errors are introduced\n- Performance and security are preserved",
|
|
28049
|
-
type: "string"
|
|
28050
|
-
},
|
|
28051
|
-
final: {
|
|
28052
|
-
description: "Final error-free implementation.\n\nThe complete, corrected code that passes all TypeScript compilation\nchecks.\n\nReturns `null` if the draft corrections are sufficient and need no\nfurther changes.",
|
|
28053
|
-
anyOf: [ {
|
|
28054
|
-
type: "null"
|
|
28055
|
-
}, {
|
|
28137
|
+
required: [ "think", "draft", "revise" ],
|
|
28138
|
+
additionalProperties: false,
|
|
28139
|
+
$defs: {
|
|
28140
|
+
"IAutoBeRealizeCorrectApplication.IReviseProps": {
|
|
28141
|
+
type: "object",
|
|
28142
|
+
properties: {
|
|
28143
|
+
review: {
|
|
28144
|
+
description: "Correction review and validation.\n\nAnalyzes the draft corrections to ensure:\n\n- All TypeScript errors are resolved\n- Business logic remains intact\n- AutoBE coding standards are maintained\n- No new errors are introduced\n- Performance and security are preserved",
|
|
28056
28145
|
type: "string"
|
|
28057
|
-
}
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28146
|
+
},
|
|
28147
|
+
final: {
|
|
28148
|
+
description: "Final error-free implementation.\n\nThe complete, corrected code that passes all TypeScript compilation\nchecks.\n\nReturns `null` if the draft corrections are sufficient and need no\nfurther changes.",
|
|
28149
|
+
anyOf: [ {
|
|
28150
|
+
type: "null"
|
|
28151
|
+
}, {
|
|
28152
|
+
type: "string"
|
|
28153
|
+
} ]
|
|
28154
|
+
}
|
|
28155
|
+
},
|
|
28156
|
+
required: [ "review", "final" ]
|
|
28157
|
+
}
|
|
28061
28158
|
}
|
|
28159
|
+
},
|
|
28160
|
+
description: "Systematically analyze and correct TypeScript compilation errors.\n\nImplements a three-phase workflow (think → draft → revise) that balances\nefficiency for simple errors with thoroughness for complex problems.",
|
|
28161
|
+
validate: (() => {
|
|
28162
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28163
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28164
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
28165
|
+
path: _path + ".think",
|
|
28166
|
+
expected: "string",
|
|
28167
|
+
value: input.think
|
|
28168
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
28169
|
+
path: _path + ".draft",
|
|
28170
|
+
expected: "string",
|
|
28171
|
+
value: input.draft
|
|
28172
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
28173
|
+
path: _path + ".revise",
|
|
28174
|
+
expected: "IAutoBeRealizeCorrectApplication.IReviseProps",
|
|
28175
|
+
value: input.revise
|
|
28176
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
28177
|
+
path: _path + ".revise",
|
|
28178
|
+
expected: "IAutoBeRealizeCorrectApplication.IReviseProps",
|
|
28179
|
+
value: input.revise
|
|
28180
|
+
}) ].every(flag => flag);
|
|
28181
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
28182
|
+
path: _path + ".review",
|
|
28183
|
+
expected: "string",
|
|
28184
|
+
value: input.review
|
|
28185
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
28186
|
+
path: _path + ".final",
|
|
28187
|
+
expected: "(null | string)",
|
|
28188
|
+
value: input.final
|
|
28189
|
+
}) ].every(flag => flag);
|
|
28190
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
28191
|
+
let errors;
|
|
28192
|
+
let _report;
|
|
28193
|
+
return input => {
|
|
28194
|
+
if (false === __is(input)) {
|
|
28195
|
+
errors = [];
|
|
28196
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
28197
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
28198
|
+
path: _path + "",
|
|
28199
|
+
expected: "IAutoBeRealizeCorrectApplication.IProps",
|
|
28200
|
+
value: input
|
|
28201
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
28202
|
+
path: _path + "",
|
|
28203
|
+
expected: "IAutoBeRealizeCorrectApplication.IProps",
|
|
28204
|
+
value: input
|
|
28205
|
+
}))(input, "$input", true);
|
|
28206
|
+
const success = 0 === errors.length;
|
|
28207
|
+
return success ? {
|
|
28208
|
+
success,
|
|
28209
|
+
data: input
|
|
28210
|
+
} : {
|
|
28211
|
+
success,
|
|
28212
|
+
errors,
|
|
28213
|
+
data: input
|
|
28214
|
+
};
|
|
28215
|
+
}
|
|
28216
|
+
return {
|
|
28217
|
+
success: true,
|
|
28218
|
+
data: input
|
|
28219
|
+
};
|
|
28220
|
+
};
|
|
28221
|
+
})()
|
|
28222
|
+
} ]
|
|
28223
|
+
};
|
|
28224
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
28225
|
+
...{
|
|
28226
|
+
validate: {
|
|
28227
|
+
correct: validate
|
|
28062
28228
|
}
|
|
28063
28229
|
},
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
28068
|
-
|
|
28069
|
-
|
|
28070
|
-
|
|
28071
|
-
|
|
28072
|
-
|
|
28073
|
-
|
|
28074
|
-
|
|
28075
|
-
|
|
28076
|
-
|
|
28077
|
-
|
|
28078
|
-
|
|
28079
|
-
|
|
28080
|
-
|
|
28081
|
-
|
|
28082
|
-
|
|
28083
|
-
|
|
28084
|
-
|
|
28085
|
-
|
|
28086
|
-
|
|
28087
|
-
|
|
28088
|
-
|
|
28089
|
-
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
|
|
28096
|
-
|
|
28097
|
-
|
|
28098
|
-
|
|
28099
|
-
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
}
|
|
28115
|
-
|
|
28116
|
-
|
|
28230
|
+
equals: false
|
|
28231
|
+
});
|
|
28232
|
+
return application;
|
|
28233
|
+
})(),
|
|
28234
|
+
claude: validate => (() => {
|
|
28235
|
+
const application = {
|
|
28236
|
+
model: "claude",
|
|
28237
|
+
options: {
|
|
28238
|
+
reference: true,
|
|
28239
|
+
separate: null
|
|
28240
|
+
},
|
|
28241
|
+
functions: [ {
|
|
28242
|
+
name: "correct",
|
|
28243
|
+
parameters: {
|
|
28244
|
+
description: " Three-phase correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeCorrectApplication.IProps}",
|
|
28245
|
+
type: "object",
|
|
28246
|
+
properties: {
|
|
28247
|
+
think: {
|
|
28248
|
+
description: "Initial error analysis and correction strategy.\n\nAnalyzes TypeScript compilation errors to understand:\n\n- Error patterns and root causes\n- Required fixes and their impact\n- Whether quick fixes or deep refactoring is needed\n- Prisma schema and API contract constraints",
|
|
28249
|
+
type: "string"
|
|
28250
|
+
},
|
|
28251
|
+
draft: {
|
|
28252
|
+
description: "First correction attempt.\n\nImplements the initial fixes identified in the think phase. For simple\nerrors (typos, missing imports), this may be the final solution. Complex\nerrors may require further refinement.",
|
|
28253
|
+
type: "string"
|
|
28254
|
+
},
|
|
28255
|
+
revise: {
|
|
28256
|
+
description: "Revision and finalization phase.\n\nReviews the draft corrections and produces the final, error-free code\nthat maintains all business requirements.",
|
|
28257
|
+
$ref: "#/$defs/IAutoBeRealizeCorrectApplication.IReviseProps"
|
|
28258
|
+
}
|
|
28259
|
+
},
|
|
28260
|
+
required: [ "think", "draft", "revise" ],
|
|
28261
|
+
additionalProperties: false,
|
|
28262
|
+
$defs: {
|
|
28263
|
+
"IAutoBeRealizeCorrectApplication.IReviseProps": {
|
|
28264
|
+
type: "object",
|
|
28265
|
+
properties: {
|
|
28266
|
+
review: {
|
|
28267
|
+
description: "Correction review and validation.\n\nAnalyzes the draft corrections to ensure:\n\n- All TypeScript errors are resolved\n- Business logic remains intact\n- AutoBE coding standards are maintained\n- No new errors are introduced\n- Performance and security are preserved",
|
|
28268
|
+
type: "string"
|
|
28269
|
+
},
|
|
28270
|
+
final: {
|
|
28271
|
+
description: "Final error-free implementation.\n\nThe complete, corrected code that passes all TypeScript compilation\nchecks.\n\nReturns `null` if the draft corrections are sufficient and need no\nfurther changes.",
|
|
28272
|
+
oneOf: [ {
|
|
28273
|
+
type: "null"
|
|
28274
|
+
}, {
|
|
28275
|
+
type: "string"
|
|
28276
|
+
} ]
|
|
28277
|
+
}
|
|
28278
|
+
},
|
|
28279
|
+
required: [ "review", "final" ]
|
|
28280
|
+
}
|
|
28281
|
+
}
|
|
28282
|
+
},
|
|
28283
|
+
description: "Systematically analyze and correct TypeScript compilation errors.\n\nImplements a three-phase workflow (think → draft → revise) that balances\nefficiency for simple errors with thoroughness for complex problems.",
|
|
28284
|
+
validate: (() => {
|
|
28285
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28286
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28287
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
28288
|
+
path: _path + ".think",
|
|
28289
|
+
expected: "string",
|
|
28290
|
+
value: input.think
|
|
28291
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
28292
|
+
path: _path + ".draft",
|
|
28293
|
+
expected: "string",
|
|
28294
|
+
value: input.draft
|
|
28295
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
28296
|
+
path: _path + ".revise",
|
|
28297
|
+
expected: "IAutoBeRealizeCorrectApplication.IReviseProps",
|
|
28298
|
+
value: input.revise
|
|
28299
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
28300
|
+
path: _path + ".revise",
|
|
28301
|
+
expected: "IAutoBeRealizeCorrectApplication.IReviseProps",
|
|
28302
|
+
value: input.revise
|
|
28303
|
+
}) ].every(flag => flag);
|
|
28304
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
28305
|
+
path: _path + ".review",
|
|
28306
|
+
expected: "string",
|
|
28307
|
+
value: input.review
|
|
28308
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
28309
|
+
path: _path + ".final",
|
|
28310
|
+
expected: "(null | string)",
|
|
28311
|
+
value: input.final
|
|
28312
|
+
}) ].every(flag => flag);
|
|
28313
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
28314
|
+
let errors;
|
|
28315
|
+
let _report;
|
|
28316
|
+
return input => {
|
|
28317
|
+
if (false === __is(input)) {
|
|
28318
|
+
errors = [];
|
|
28319
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
28320
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
28321
|
+
path: _path + "",
|
|
28322
|
+
expected: "IAutoBeRealizeCorrectApplication.IProps",
|
|
28323
|
+
value: input
|
|
28324
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
28325
|
+
path: _path + "",
|
|
28326
|
+
expected: "IAutoBeRealizeCorrectApplication.IProps",
|
|
28327
|
+
value: input
|
|
28328
|
+
}))(input, "$input", true);
|
|
28329
|
+
const success = 0 === errors.length;
|
|
28330
|
+
return success ? {
|
|
28331
|
+
success,
|
|
28332
|
+
data: input
|
|
28333
|
+
} : {
|
|
28334
|
+
success,
|
|
28335
|
+
errors,
|
|
28336
|
+
data: input
|
|
28337
|
+
};
|
|
28338
|
+
}
|
|
28339
|
+
return {
|
|
28340
|
+
success: true,
|
|
28117
28341
|
data: input
|
|
28118
28342
|
};
|
|
28119
|
-
}
|
|
28120
|
-
return {
|
|
28121
|
-
success: true,
|
|
28122
|
-
data: input
|
|
28123
28343
|
};
|
|
28124
|
-
}
|
|
28125
|
-
}
|
|
28126
|
-
}
|
|
28127
|
-
|
|
28128
|
-
|
|
28129
|
-
|
|
28130
|
-
|
|
28131
|
-
|
|
28344
|
+
})()
|
|
28345
|
+
} ]
|
|
28346
|
+
};
|
|
28347
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
28348
|
+
...{
|
|
28349
|
+
validate: {
|
|
28350
|
+
correct: validate
|
|
28351
|
+
}
|
|
28352
|
+
},
|
|
28353
|
+
equals: false
|
|
28354
|
+
});
|
|
28355
|
+
return application;
|
|
28356
|
+
})()
|
|
28132
28357
|
};
|
|
28133
28358
|
|
|
28134
28359
|
async function orchestrateRealizeWrite(ctx, props) {
|
|
@@ -28147,6 +28372,7 @@ async function orchestrateRealizeWrite(ctx, props) {
|
|
|
28147
28372
|
}),
|
|
28148
28373
|
controller: createController$6({
|
|
28149
28374
|
model: ctx.model,
|
|
28375
|
+
functionName: props.scenario.functionName,
|
|
28150
28376
|
build: next => {
|
|
28151
28377
|
pointer.value = next;
|
|
28152
28378
|
}
|
|
@@ -28201,69 +28427,8 @@ async function orchestrateRealizeWrite(ctx, props) {
|
|
|
28201
28427
|
|
|
28202
28428
|
function createController$6(props) {
|
|
28203
28429
|
assertSchemaModel(props.model);
|
|
28204
|
-
const
|
|
28205
|
-
|
|
28206
|
-
protocol: "class",
|
|
28207
|
-
name: "Write code",
|
|
28208
|
-
application,
|
|
28209
|
-
execute: {
|
|
28210
|
-
write: next => {
|
|
28211
|
-
props.build(next);
|
|
28212
|
-
}
|
|
28213
|
-
}
|
|
28214
|
-
};
|
|
28215
|
-
}
|
|
28216
|
-
|
|
28217
|
-
const claude$2 = {
|
|
28218
|
-
model: "claude",
|
|
28219
|
-
options: {
|
|
28220
|
-
reference: true,
|
|
28221
|
-
separate: null
|
|
28222
|
-
},
|
|
28223
|
-
functions: [ {
|
|
28224
|
-
name: "write",
|
|
28225
|
-
parameters: {
|
|
28226
|
-
description: " Chain of Thinking properties for implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeWriteApplication.IProps}",
|
|
28227
|
-
type: "object",
|
|
28228
|
-
properties: {
|
|
28229
|
-
plan: {
|
|
28230
|
-
description: "Implementation plan and strategy.\n\nAnalyzes the provider function requirements, identifies related Prisma\nschemas, and outlines the implementation approach. Includes schema\nvalidation and API contract verification.",
|
|
28231
|
-
type: "string"
|
|
28232
|
-
},
|
|
28233
|
-
draft: {
|
|
28234
|
-
description: "Initial implementation draft.\n\nThe first complete implementation attempt based on the plan. May contain\nareas that need refinement in the review phase.",
|
|
28235
|
-
type: "string"
|
|
28236
|
-
},
|
|
28237
|
-
revise: {
|
|
28238
|
-
description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied.",
|
|
28239
|
-
$ref: "#/$defs/IAutoBeRealizeWriteApplication.IReviseProps"
|
|
28240
|
-
}
|
|
28241
|
-
},
|
|
28242
|
-
required: [ "plan", "draft", "revise" ],
|
|
28243
|
-
additionalProperties: false,
|
|
28244
|
-
$defs: {
|
|
28245
|
-
"IAutoBeRealizeWriteApplication.IReviseProps": {
|
|
28246
|
-
type: "object",
|
|
28247
|
-
properties: {
|
|
28248
|
-
review: {
|
|
28249
|
-
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
28250
|
-
type: "string"
|
|
28251
|
-
},
|
|
28252
|
-
final: {
|
|
28253
|
-
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
28254
|
-
oneOf: [ {
|
|
28255
|
-
type: "null"
|
|
28256
|
-
}, {
|
|
28257
|
-
type: "string"
|
|
28258
|
-
} ]
|
|
28259
|
-
}
|
|
28260
|
-
},
|
|
28261
|
-
required: [ "review", "final" ]
|
|
28262
|
-
}
|
|
28263
|
-
}
|
|
28264
|
-
},
|
|
28265
|
-
description: "Generate complete provider function implementation using Chain of Thinking.\n\nFollows a 3-phase process: plan → draft → revise.\n\nEnsures type safety, proper Prisma usage, and API contract compliance.",
|
|
28266
|
-
validate: (() => {
|
|
28430
|
+
const validate = input => {
|
|
28431
|
+
const result = (() => {
|
|
28267
28432
|
const _io0 = input => "string" === typeof input.plan && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28268
28433
|
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28269
28434
|
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.plan || _report(_exceptionable, {
|
|
@@ -28323,127 +28488,279 @@ const claude$2 = {
|
|
|
28323
28488
|
data: input
|
|
28324
28489
|
};
|
|
28325
28490
|
};
|
|
28326
|
-
})()
|
|
28327
|
-
|
|
28328
|
-
|
|
28491
|
+
})()(input);
|
|
28492
|
+
if (result.success === false) return result;
|
|
28493
|
+
const errors = validateEmptyCode({
|
|
28494
|
+
functionName: props.functionName,
|
|
28495
|
+
draft: result.data.draft,
|
|
28496
|
+
revise: result.data.revise
|
|
28497
|
+
});
|
|
28498
|
+
return errors.length ? {
|
|
28499
|
+
success: false,
|
|
28500
|
+
errors,
|
|
28501
|
+
data: result.data
|
|
28502
|
+
} : result;
|
|
28503
|
+
};
|
|
28504
|
+
const application = collection$7[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
28505
|
+
return {
|
|
28506
|
+
protocol: "class",
|
|
28507
|
+
name: "Write code",
|
|
28508
|
+
application,
|
|
28509
|
+
execute: {
|
|
28510
|
+
write: next => {
|
|
28511
|
+
props.build(next);
|
|
28512
|
+
}
|
|
28513
|
+
}
|
|
28514
|
+
};
|
|
28515
|
+
}
|
|
28329
28516
|
|
|
28330
28517
|
const collection$7 = {
|
|
28331
|
-
chatgpt: {
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
|
|
28338
|
-
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28518
|
+
chatgpt: validate => (() => {
|
|
28519
|
+
const application = {
|
|
28520
|
+
model: "chatgpt",
|
|
28521
|
+
options: {
|
|
28522
|
+
reference: true,
|
|
28523
|
+
strict: false,
|
|
28524
|
+
separate: null
|
|
28525
|
+
},
|
|
28526
|
+
functions: [ {
|
|
28527
|
+
name: "write",
|
|
28528
|
+
parameters: {
|
|
28529
|
+
description: " Chain of Thinking properties for implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeWriteApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Revision and finalization phase.\n> \n> Reviews the draft implementation and produces the final code with all\n> improvements and corrections applied.",
|
|
28530
|
+
type: "object",
|
|
28531
|
+
properties: {
|
|
28532
|
+
plan: {
|
|
28533
|
+
description: "Implementation plan and strategy.\n\nAnalyzes the provider function requirements, identifies related Prisma\nschemas, and outlines the implementation approach. Includes schema\nvalidation and API contract verification.",
|
|
28534
|
+
type: "string"
|
|
28535
|
+
},
|
|
28536
|
+
draft: {
|
|
28537
|
+
description: "Initial implementation draft.\n\nThe first complete implementation attempt based on the plan. May contain\nareas that need refinement in the review phase.",
|
|
28538
|
+
type: "string"
|
|
28539
|
+
},
|
|
28540
|
+
revise: {
|
|
28541
|
+
$ref: "#/$defs/IAutoBeRealizeWriteApplication.IReviseProps"
|
|
28542
|
+
}
|
|
28351
28543
|
},
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
type: "object",
|
|
28361
|
-
properties: {
|
|
28362
|
-
review: {
|
|
28363
|
-
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
28364
|
-
type: "string"
|
|
28365
|
-
},
|
|
28366
|
-
final: {
|
|
28367
|
-
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
28368
|
-
anyOf: [ {
|
|
28369
|
-
type: "null"
|
|
28370
|
-
}, {
|
|
28544
|
+
required: [ "plan", "draft", "revise" ],
|
|
28545
|
+
additionalProperties: false,
|
|
28546
|
+
$defs: {
|
|
28547
|
+
"IAutoBeRealizeWriteApplication.IReviseProps": {
|
|
28548
|
+
type: "object",
|
|
28549
|
+
properties: {
|
|
28550
|
+
review: {
|
|
28551
|
+
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
28371
28552
|
type: "string"
|
|
28372
|
-
}
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28553
|
+
},
|
|
28554
|
+
final: {
|
|
28555
|
+
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
28556
|
+
anyOf: [ {
|
|
28557
|
+
type: "null"
|
|
28558
|
+
}, {
|
|
28559
|
+
type: "string"
|
|
28560
|
+
} ]
|
|
28561
|
+
}
|
|
28562
|
+
},
|
|
28563
|
+
required: [ "review", "final" ]
|
|
28564
|
+
}
|
|
28376
28565
|
}
|
|
28566
|
+
},
|
|
28567
|
+
description: "Generate complete provider function implementation using Chain of Thinking.\n\nFollows a 3-phase process: plan → draft → revise.\n\nEnsures type safety, proper Prisma usage, and API contract compliance.",
|
|
28568
|
+
validate: (() => {
|
|
28569
|
+
const _io0 = input => "string" === typeof input.plan && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28570
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28571
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.plan || _report(_exceptionable, {
|
|
28572
|
+
path: _path + ".plan",
|
|
28573
|
+
expected: "string",
|
|
28574
|
+
value: input.plan
|
|
28575
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
28576
|
+
path: _path + ".draft",
|
|
28577
|
+
expected: "string",
|
|
28578
|
+
value: input.draft
|
|
28579
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
28580
|
+
path: _path + ".revise",
|
|
28581
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
28582
|
+
value: input.revise
|
|
28583
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
28584
|
+
path: _path + ".revise",
|
|
28585
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
28586
|
+
value: input.revise
|
|
28587
|
+
}) ].every(flag => flag);
|
|
28588
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
28589
|
+
path: _path + ".review",
|
|
28590
|
+
expected: "string",
|
|
28591
|
+
value: input.review
|
|
28592
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
28593
|
+
path: _path + ".final",
|
|
28594
|
+
expected: "(null | string)",
|
|
28595
|
+
value: input.final
|
|
28596
|
+
}) ].every(flag => flag);
|
|
28597
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
28598
|
+
let errors;
|
|
28599
|
+
let _report;
|
|
28600
|
+
return input => {
|
|
28601
|
+
if (false === __is(input)) {
|
|
28602
|
+
errors = [];
|
|
28603
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
28604
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
28605
|
+
path: _path + "",
|
|
28606
|
+
expected: "IAutoBeRealizeWriteApplication.IProps",
|
|
28607
|
+
value: input
|
|
28608
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
28609
|
+
path: _path + "",
|
|
28610
|
+
expected: "IAutoBeRealizeWriteApplication.IProps",
|
|
28611
|
+
value: input
|
|
28612
|
+
}))(input, "$input", true);
|
|
28613
|
+
const success = 0 === errors.length;
|
|
28614
|
+
return success ? {
|
|
28615
|
+
success,
|
|
28616
|
+
data: input
|
|
28617
|
+
} : {
|
|
28618
|
+
success,
|
|
28619
|
+
errors,
|
|
28620
|
+
data: input
|
|
28621
|
+
};
|
|
28622
|
+
}
|
|
28623
|
+
return {
|
|
28624
|
+
success: true,
|
|
28625
|
+
data: input
|
|
28626
|
+
};
|
|
28627
|
+
};
|
|
28628
|
+
})()
|
|
28629
|
+
} ]
|
|
28630
|
+
};
|
|
28631
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
28632
|
+
...{
|
|
28633
|
+
validate: {
|
|
28634
|
+
write: validate
|
|
28377
28635
|
}
|
|
28378
28636
|
},
|
|
28379
|
-
|
|
28380
|
-
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
|
|
28391
|
-
|
|
28392
|
-
|
|
28393
|
-
|
|
28394
|
-
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28399
|
-
|
|
28400
|
-
|
|
28401
|
-
|
|
28402
|
-
|
|
28403
|
-
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28409
|
-
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
}
|
|
28430
|
-
|
|
28431
|
-
|
|
28637
|
+
equals: false
|
|
28638
|
+
});
|
|
28639
|
+
return application;
|
|
28640
|
+
})(),
|
|
28641
|
+
claude: validate => (() => {
|
|
28642
|
+
const application = {
|
|
28643
|
+
model: "claude",
|
|
28644
|
+
options: {
|
|
28645
|
+
reference: true,
|
|
28646
|
+
separate: null
|
|
28647
|
+
},
|
|
28648
|
+
functions: [ {
|
|
28649
|
+
name: "write",
|
|
28650
|
+
parameters: {
|
|
28651
|
+
description: " Chain of Thinking properties for implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeRealizeWriteApplication.IProps}",
|
|
28652
|
+
type: "object",
|
|
28653
|
+
properties: {
|
|
28654
|
+
plan: {
|
|
28655
|
+
description: "Implementation plan and strategy.\n\nAnalyzes the provider function requirements, identifies related Prisma\nschemas, and outlines the implementation approach. Includes schema\nvalidation and API contract verification.",
|
|
28656
|
+
type: "string"
|
|
28657
|
+
},
|
|
28658
|
+
draft: {
|
|
28659
|
+
description: "Initial implementation draft.\n\nThe first complete implementation attempt based on the plan. May contain\nareas that need refinement in the review phase.",
|
|
28660
|
+
type: "string"
|
|
28661
|
+
},
|
|
28662
|
+
revise: {
|
|
28663
|
+
description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied.",
|
|
28664
|
+
$ref: "#/$defs/IAutoBeRealizeWriteApplication.IReviseProps"
|
|
28665
|
+
}
|
|
28666
|
+
},
|
|
28667
|
+
required: [ "plan", "draft", "revise" ],
|
|
28668
|
+
additionalProperties: false,
|
|
28669
|
+
$defs: {
|
|
28670
|
+
"IAutoBeRealizeWriteApplication.IReviseProps": {
|
|
28671
|
+
type: "object",
|
|
28672
|
+
properties: {
|
|
28673
|
+
review: {
|
|
28674
|
+
description: "Review and improvement suggestions.\n\nIdentifies areas for improvement in the draft code, including:\n\n- Type safety enhancements\n- Prisma query optimizations\n- Null/undefined handling corrections\n- Authentication/authorization improvements\n- Error handling refinements",
|
|
28675
|
+
type: "string"
|
|
28676
|
+
},
|
|
28677
|
+
final: {
|
|
28678
|
+
description: "Final implementation code.\n\nThe complete, production-ready implementation with all review suggestions\napplied.\n\nReturns `null` if the draft is already perfect and needs no changes.",
|
|
28679
|
+
oneOf: [ {
|
|
28680
|
+
type: "null"
|
|
28681
|
+
}, {
|
|
28682
|
+
type: "string"
|
|
28683
|
+
} ]
|
|
28684
|
+
}
|
|
28685
|
+
},
|
|
28686
|
+
required: [ "review", "final" ]
|
|
28687
|
+
}
|
|
28688
|
+
}
|
|
28689
|
+
},
|
|
28690
|
+
description: "Generate complete provider function implementation using Chain of Thinking.\n\nFollows a 3-phase process: plan → draft → revise.\n\nEnsures type safety, proper Prisma usage, and API contract compliance.",
|
|
28691
|
+
validate: (() => {
|
|
28692
|
+
const _io0 = input => "string" === typeof input.plan && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28693
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28694
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.plan || _report(_exceptionable, {
|
|
28695
|
+
path: _path + ".plan",
|
|
28696
|
+
expected: "string",
|
|
28697
|
+
value: input.plan
|
|
28698
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
28699
|
+
path: _path + ".draft",
|
|
28700
|
+
expected: "string",
|
|
28701
|
+
value: input.draft
|
|
28702
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
28703
|
+
path: _path + ".revise",
|
|
28704
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
28705
|
+
value: input.revise
|
|
28706
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
28707
|
+
path: _path + ".revise",
|
|
28708
|
+
expected: "IAutoBeRealizeWriteApplication.IReviseProps",
|
|
28709
|
+
value: input.revise
|
|
28710
|
+
}) ].every(flag => flag);
|
|
28711
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
28712
|
+
path: _path + ".review",
|
|
28713
|
+
expected: "string",
|
|
28714
|
+
value: input.review
|
|
28715
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
28716
|
+
path: _path + ".final",
|
|
28717
|
+
expected: "(null | string)",
|
|
28718
|
+
value: input.final
|
|
28719
|
+
}) ].every(flag => flag);
|
|
28720
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
28721
|
+
let errors;
|
|
28722
|
+
let _report;
|
|
28723
|
+
return input => {
|
|
28724
|
+
if (false === __is(input)) {
|
|
28725
|
+
errors = [];
|
|
28726
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
28727
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
28728
|
+
path: _path + "",
|
|
28729
|
+
expected: "IAutoBeRealizeWriteApplication.IProps",
|
|
28730
|
+
value: input
|
|
28731
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
28732
|
+
path: _path + "",
|
|
28733
|
+
expected: "IAutoBeRealizeWriteApplication.IProps",
|
|
28734
|
+
value: input
|
|
28735
|
+
}))(input, "$input", true);
|
|
28736
|
+
const success = 0 === errors.length;
|
|
28737
|
+
return success ? {
|
|
28738
|
+
success,
|
|
28739
|
+
data: input
|
|
28740
|
+
} : {
|
|
28741
|
+
success,
|
|
28742
|
+
errors,
|
|
28743
|
+
data: input
|
|
28744
|
+
};
|
|
28745
|
+
}
|
|
28746
|
+
return {
|
|
28747
|
+
success: true,
|
|
28432
28748
|
data: input
|
|
28433
28749
|
};
|
|
28434
|
-
}
|
|
28435
|
-
return {
|
|
28436
|
-
success: true,
|
|
28437
|
-
data: input
|
|
28438
28750
|
};
|
|
28439
|
-
}
|
|
28440
|
-
}
|
|
28441
|
-
}
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28751
|
+
})()
|
|
28752
|
+
} ]
|
|
28753
|
+
};
|
|
28754
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
28755
|
+
...{
|
|
28756
|
+
validate: {
|
|
28757
|
+
write: validate
|
|
28758
|
+
}
|
|
28759
|
+
},
|
|
28760
|
+
equals: false
|
|
28761
|
+
});
|
|
28762
|
+
return application;
|
|
28763
|
+
})()
|
|
28447
28764
|
};
|
|
28448
28765
|
|
|
28449
28766
|
function generateRealizeScenario(ctx, operation, authorizations) {
|
|
@@ -28621,6 +28938,7 @@ const correct$2 = async (ctx, factory, failures, script, event, life) => {
|
|
|
28621
28938
|
}))),
|
|
28622
28939
|
controller: createController$5({
|
|
28623
28940
|
model: ctx.model,
|
|
28941
|
+
functionName: factory.functionName,
|
|
28624
28942
|
then: next => {
|
|
28625
28943
|
pointer.value = next;
|
|
28626
28944
|
},
|
|
@@ -28650,7 +28968,81 @@ const correct$2 = async (ctx, factory, failures, script, event, life) => {
|
|
|
28650
28968
|
|
|
28651
28969
|
const createController$5 = props => {
|
|
28652
28970
|
assertSchemaModel(props.model);
|
|
28653
|
-
const
|
|
28971
|
+
const validate = input => {
|
|
28972
|
+
const result = (() => {
|
|
28973
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
28974
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
28975
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
28976
|
+
path: _path + ".think",
|
|
28977
|
+
expected: "string",
|
|
28978
|
+
value: input.think
|
|
28979
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
28980
|
+
path: _path + ".draft",
|
|
28981
|
+
expected: "string",
|
|
28982
|
+
value: input.draft
|
|
28983
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
28984
|
+
path: _path + ".revise",
|
|
28985
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
28986
|
+
value: input.revise
|
|
28987
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
28988
|
+
path: _path + ".revise",
|
|
28989
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
28990
|
+
value: input.revise
|
|
28991
|
+
}) ].every(flag => flag);
|
|
28992
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
28993
|
+
path: _path + ".review",
|
|
28994
|
+
expected: "string",
|
|
28995
|
+
value: input.review
|
|
28996
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
28997
|
+
path: _path + ".final",
|
|
28998
|
+
expected: "(null | string)",
|
|
28999
|
+
value: input.final
|
|
29000
|
+
}) ].every(flag => flag);
|
|
29001
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
29002
|
+
let errors;
|
|
29003
|
+
let _report;
|
|
29004
|
+
return input => {
|
|
29005
|
+
if (false === __is(input)) {
|
|
29006
|
+
errors = [];
|
|
29007
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
29008
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
29009
|
+
path: _path + "",
|
|
29010
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29011
|
+
value: input
|
|
29012
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
29013
|
+
path: _path + "",
|
|
29014
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29015
|
+
value: input
|
|
29016
|
+
}))(input, "$input", true);
|
|
29017
|
+
const success = 0 === errors.length;
|
|
29018
|
+
return success ? {
|
|
29019
|
+
success,
|
|
29020
|
+
data: input
|
|
29021
|
+
} : {
|
|
29022
|
+
success,
|
|
29023
|
+
errors,
|
|
29024
|
+
data: input
|
|
29025
|
+
};
|
|
29026
|
+
}
|
|
29027
|
+
return {
|
|
29028
|
+
success: true,
|
|
29029
|
+
data: input
|
|
29030
|
+
};
|
|
29031
|
+
};
|
|
29032
|
+
})()(input);
|
|
29033
|
+
if (result.success === false) return result;
|
|
29034
|
+
const errors = validateEmptyCode({
|
|
29035
|
+
functionName: props.functionName,
|
|
29036
|
+
draft: result.data.draft,
|
|
29037
|
+
revise: result.data.revise
|
|
29038
|
+
});
|
|
29039
|
+
return errors.length ? {
|
|
29040
|
+
success: false,
|
|
29041
|
+
errors,
|
|
29042
|
+
data: result.data
|
|
29043
|
+
} : result;
|
|
29044
|
+
};
|
|
29045
|
+
const application = collection$6[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
28654
29046
|
return {
|
|
28655
29047
|
protocol: "class",
|
|
28656
29048
|
name: "correctInvalidRequest",
|
|
@@ -28667,258 +29059,288 @@ const createController$5 = props => {
|
|
|
28667
29059
|
};
|
|
28668
29060
|
|
|
28669
29061
|
const collection$6 = {
|
|
28670
|
-
chatgpt: {
|
|
28671
|
-
|
|
28672
|
-
|
|
28673
|
-
|
|
28674
|
-
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
|
|
28680
|
-
|
|
28681
|
-
|
|
28682
|
-
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
28686
|
-
|
|
28687
|
-
|
|
28688
|
-
|
|
28689
|
-
|
|
29062
|
+
chatgpt: validate => (() => {
|
|
29063
|
+
const application = {
|
|
29064
|
+
model: "chatgpt",
|
|
29065
|
+
options: {
|
|
29066
|
+
reference: true,
|
|
29067
|
+
strict: false,
|
|
29068
|
+
separate: null
|
|
29069
|
+
},
|
|
29070
|
+
functions: [ {
|
|
29071
|
+
name: "rewrite",
|
|
29072
|
+
parameters: {
|
|
29073
|
+
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.",
|
|
29074
|
+
type: "object",
|
|
29075
|
+
properties: {
|
|
29076
|
+
think: {
|
|
29077
|
+
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",
|
|
29078
|
+
type: "string"
|
|
29079
|
+
},
|
|
29080
|
+
draft: {
|
|
29081
|
+
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",
|
|
29082
|
+
type: "string"
|
|
29083
|
+
},
|
|
29084
|
+
revise: {
|
|
29085
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
29086
|
+
}
|
|
28690
29087
|
},
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
type: "object",
|
|
28700
|
-
properties: {
|
|
28701
|
-
review: {
|
|
28702
|
-
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",
|
|
28703
|
-
type: "string"
|
|
28704
|
-
},
|
|
28705
|
-
final: {
|
|
28706
|
-
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.",
|
|
28707
|
-
anyOf: [ {
|
|
28708
|
-
type: "null"
|
|
28709
|
-
}, {
|
|
29088
|
+
required: [ "think", "draft", "revise" ],
|
|
29089
|
+
additionalProperties: false,
|
|
29090
|
+
$defs: {
|
|
29091
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
29092
|
+
type: "object",
|
|
29093
|
+
properties: {
|
|
29094
|
+
review: {
|
|
29095
|
+
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",
|
|
28710
29096
|
type: "string"
|
|
28711
|
-
}
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
29097
|
+
},
|
|
29098
|
+
final: {
|
|
29099
|
+
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.",
|
|
29100
|
+
anyOf: [ {
|
|
29101
|
+
type: "null"
|
|
29102
|
+
}, {
|
|
29103
|
+
type: "string"
|
|
29104
|
+
} ]
|
|
29105
|
+
}
|
|
29106
|
+
},
|
|
29107
|
+
required: [ "review", "final" ]
|
|
29108
|
+
}
|
|
28715
29109
|
}
|
|
28716
|
-
}
|
|
28717
|
-
|
|
28718
|
-
|
|
28719
|
-
|
|
28720
|
-
|
|
28721
|
-
|
|
28722
|
-
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
|
|
28739
|
-
|
|
28740
|
-
|
|
28741
|
-
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28751
|
-
|
|
28752
|
-
|
|
28753
|
-
|
|
28754
|
-
|
|
28755
|
-
|
|
28756
|
-
|
|
28757
|
-
|
|
28758
|
-
|
|
28759
|
-
|
|
28760
|
-
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
|
|
28764
|
-
|
|
28765
|
-
|
|
28766
|
-
|
|
28767
|
-
|
|
28768
|
-
|
|
28769
|
-
|
|
28770
|
-
|
|
29110
|
+
},
|
|
29111
|
+
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',
|
|
29112
|
+
validate: (() => {
|
|
29113
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
29114
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
29115
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
29116
|
+
path: _path + ".think",
|
|
29117
|
+
expected: "string",
|
|
29118
|
+
value: input.think
|
|
29119
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
29120
|
+
path: _path + ".draft",
|
|
29121
|
+
expected: "string",
|
|
29122
|
+
value: input.draft
|
|
29123
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
29124
|
+
path: _path + ".revise",
|
|
29125
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
29126
|
+
value: input.revise
|
|
29127
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
29128
|
+
path: _path + ".revise",
|
|
29129
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
29130
|
+
value: input.revise
|
|
29131
|
+
}) ].every(flag => flag);
|
|
29132
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
29133
|
+
path: _path + ".review",
|
|
29134
|
+
expected: "string",
|
|
29135
|
+
value: input.review
|
|
29136
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
29137
|
+
path: _path + ".final",
|
|
29138
|
+
expected: "(null | string)",
|
|
29139
|
+
value: input.final
|
|
29140
|
+
}) ].every(flag => flag);
|
|
29141
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
29142
|
+
let errors;
|
|
29143
|
+
let _report;
|
|
29144
|
+
return input => {
|
|
29145
|
+
if (false === __is(input)) {
|
|
29146
|
+
errors = [];
|
|
29147
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
29148
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
29149
|
+
path: _path + "",
|
|
29150
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29151
|
+
value: input
|
|
29152
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
29153
|
+
path: _path + "",
|
|
29154
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29155
|
+
value: input
|
|
29156
|
+
}))(input, "$input", true);
|
|
29157
|
+
const success = 0 === errors.length;
|
|
29158
|
+
return success ? {
|
|
29159
|
+
success,
|
|
29160
|
+
data: input
|
|
29161
|
+
} : {
|
|
29162
|
+
success,
|
|
29163
|
+
errors,
|
|
29164
|
+
data: input
|
|
29165
|
+
};
|
|
29166
|
+
}
|
|
29167
|
+
return {
|
|
29168
|
+
success: true,
|
|
28771
29169
|
data: input
|
|
28772
29170
|
};
|
|
28773
|
-
}
|
|
28774
|
-
return {
|
|
28775
|
-
success: true,
|
|
28776
|
-
data: input
|
|
28777
29171
|
};
|
|
28778
|
-
}
|
|
28779
|
-
}
|
|
28780
|
-
|
|
28781
|
-
|
|
28782
|
-
|
|
28783
|
-
|
|
28784
|
-
|
|
28785
|
-
|
|
28786
|
-
|
|
28787
|
-
|
|
29172
|
+
})()
|
|
29173
|
+
}, {
|
|
29174
|
+
name: "reject",
|
|
29175
|
+
parameters: {
|
|
29176
|
+
type: "object",
|
|
29177
|
+
properties: {},
|
|
29178
|
+
additionalProperties: false,
|
|
29179
|
+
required: [],
|
|
29180
|
+
$defs: {}
|
|
29181
|
+
},
|
|
29182
|
+
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.",
|
|
29183
|
+
validate: (() => input => ({
|
|
29184
|
+
success: true,
|
|
29185
|
+
data: input
|
|
29186
|
+
}))()
|
|
29187
|
+
} ]
|
|
29188
|
+
};
|
|
29189
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
29190
|
+
...{
|
|
29191
|
+
validate: {
|
|
29192
|
+
rewrite: validate,
|
|
29193
|
+
reject: () => ({
|
|
29194
|
+
success: true,
|
|
29195
|
+
data: undefined
|
|
29196
|
+
})
|
|
29197
|
+
}
|
|
28788
29198
|
},
|
|
28789
|
-
|
|
28790
|
-
|
|
28791
|
-
|
|
28792
|
-
|
|
28793
|
-
|
|
28794
|
-
|
|
28795
|
-
|
|
28796
|
-
|
|
28797
|
-
|
|
28798
|
-
|
|
28799
|
-
|
|
28800
|
-
|
|
28801
|
-
|
|
28802
|
-
|
|
28803
|
-
|
|
28804
|
-
|
|
28805
|
-
|
|
28806
|
-
|
|
28807
|
-
|
|
28808
|
-
|
|
28809
|
-
|
|
28810
|
-
|
|
28811
|
-
|
|
28812
|
-
|
|
28813
|
-
|
|
28814
|
-
|
|
29199
|
+
equals: false
|
|
29200
|
+
});
|
|
29201
|
+
return application;
|
|
29202
|
+
})(),
|
|
29203
|
+
claude: validate => (() => {
|
|
29204
|
+
const application = {
|
|
29205
|
+
model: "claude",
|
|
29206
|
+
options: {
|
|
29207
|
+
reference: true,
|
|
29208
|
+
separate: null
|
|
29209
|
+
},
|
|
29210
|
+
functions: [ {
|
|
29211
|
+
name: "rewrite",
|
|
29212
|
+
parameters: {
|
|
29213
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nCurrent Type: {@link IAutoBeCommonCorrectCastingApplication.IProps}",
|
|
29214
|
+
type: "object",
|
|
29215
|
+
properties: {
|
|
29216
|
+
think: {
|
|
29217
|
+
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",
|
|
29218
|
+
type: "string"
|
|
29219
|
+
},
|
|
29220
|
+
draft: {
|
|
29221
|
+
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",
|
|
29222
|
+
type: "string"
|
|
29223
|
+
},
|
|
29224
|
+
revise: {
|
|
29225
|
+
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.",
|
|
29226
|
+
$ref: "#/$defs/IAutoBeCommonCorrectCastingApplication.IReviseProps"
|
|
29227
|
+
}
|
|
28815
29228
|
},
|
|
28816
|
-
|
|
28817
|
-
|
|
28818
|
-
|
|
28819
|
-
|
|
28820
|
-
|
|
28821
|
-
|
|
28822
|
-
|
|
28823
|
-
|
|
28824
|
-
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
28825
|
-
type: "object",
|
|
28826
|
-
properties: {
|
|
28827
|
-
review: {
|
|
28828
|
-
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",
|
|
28829
|
-
type: "string"
|
|
28830
|
-
},
|
|
28831
|
-
final: {
|
|
28832
|
-
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.",
|
|
28833
|
-
oneOf: [ {
|
|
28834
|
-
type: "null"
|
|
28835
|
-
}, {
|
|
29229
|
+
required: [ "think", "draft", "revise" ],
|
|
29230
|
+
additionalProperties: false,
|
|
29231
|
+
$defs: {
|
|
29232
|
+
"IAutoBeCommonCorrectCastingApplication.IReviseProps": {
|
|
29233
|
+
type: "object",
|
|
29234
|
+
properties: {
|
|
29235
|
+
review: {
|
|
29236
|
+
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",
|
|
28836
29237
|
type: "string"
|
|
28837
|
-
}
|
|
28838
|
-
|
|
28839
|
-
|
|
28840
|
-
|
|
29238
|
+
},
|
|
29239
|
+
final: {
|
|
29240
|
+
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.",
|
|
29241
|
+
oneOf: [ {
|
|
29242
|
+
type: "null"
|
|
29243
|
+
}, {
|
|
29244
|
+
type: "string"
|
|
29245
|
+
} ]
|
|
29246
|
+
}
|
|
29247
|
+
},
|
|
29248
|
+
required: [ "review", "final" ]
|
|
29249
|
+
}
|
|
28841
29250
|
}
|
|
28842
|
-
}
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
28846
|
-
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
|
|
28856
|
-
|
|
28857
|
-
|
|
28858
|
-
|
|
28859
|
-
|
|
28860
|
-
|
|
28861
|
-
|
|
28862
|
-
|
|
28863
|
-
|
|
28864
|
-
|
|
28865
|
-
|
|
28866
|
-
|
|
28867
|
-
|
|
28868
|
-
|
|
28869
|
-
|
|
28870
|
-
|
|
28871
|
-
|
|
28872
|
-
|
|
28873
|
-
|
|
28874
|
-
|
|
28875
|
-
|
|
28876
|
-
|
|
28877
|
-
|
|
28878
|
-
|
|
28879
|
-
|
|
28880
|
-
|
|
28881
|
-
|
|
28882
|
-
|
|
28883
|
-
|
|
28884
|
-
|
|
28885
|
-
|
|
28886
|
-
|
|
28887
|
-
|
|
28888
|
-
|
|
28889
|
-
|
|
28890
|
-
|
|
28891
|
-
|
|
28892
|
-
|
|
28893
|
-
|
|
28894
|
-
|
|
28895
|
-
|
|
28896
|
-
|
|
29251
|
+
},
|
|
29252
|
+
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',
|
|
29253
|
+
validate: (() => {
|
|
29254
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
29255
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
29256
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
29257
|
+
path: _path + ".think",
|
|
29258
|
+
expected: "string",
|
|
29259
|
+
value: input.think
|
|
29260
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
29261
|
+
path: _path + ".draft",
|
|
29262
|
+
expected: "string",
|
|
29263
|
+
value: input.draft
|
|
29264
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
29265
|
+
path: _path + ".revise",
|
|
29266
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
29267
|
+
value: input.revise
|
|
29268
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
29269
|
+
path: _path + ".revise",
|
|
29270
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IReviseProps",
|
|
29271
|
+
value: input.revise
|
|
29272
|
+
}) ].every(flag => flag);
|
|
29273
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
29274
|
+
path: _path + ".review",
|
|
29275
|
+
expected: "string",
|
|
29276
|
+
value: input.review
|
|
29277
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
29278
|
+
path: _path + ".final",
|
|
29279
|
+
expected: "(null | string)",
|
|
29280
|
+
value: input.final
|
|
29281
|
+
}) ].every(flag => flag);
|
|
29282
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
29283
|
+
let errors;
|
|
29284
|
+
let _report;
|
|
29285
|
+
return input => {
|
|
29286
|
+
if (false === __is(input)) {
|
|
29287
|
+
errors = [];
|
|
29288
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
29289
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
29290
|
+
path: _path + "",
|
|
29291
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29292
|
+
value: input
|
|
29293
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
29294
|
+
path: _path + "",
|
|
29295
|
+
expected: "IAutoBeCommonCorrectCastingApplication.IProps",
|
|
29296
|
+
value: input
|
|
29297
|
+
}))(input, "$input", true);
|
|
29298
|
+
const success = 0 === errors.length;
|
|
29299
|
+
return success ? {
|
|
29300
|
+
success,
|
|
29301
|
+
data: input
|
|
29302
|
+
} : {
|
|
29303
|
+
success,
|
|
29304
|
+
errors,
|
|
29305
|
+
data: input
|
|
29306
|
+
};
|
|
29307
|
+
}
|
|
29308
|
+
return {
|
|
29309
|
+
success: true,
|
|
28897
29310
|
data: input
|
|
28898
29311
|
};
|
|
28899
|
-
}
|
|
28900
|
-
return {
|
|
28901
|
-
success: true,
|
|
28902
|
-
data: input
|
|
28903
29312
|
};
|
|
28904
|
-
}
|
|
28905
|
-
}
|
|
28906
|
-
|
|
28907
|
-
|
|
28908
|
-
|
|
28909
|
-
|
|
28910
|
-
|
|
28911
|
-
|
|
28912
|
-
|
|
28913
|
-
|
|
29313
|
+
})()
|
|
29314
|
+
}, {
|
|
29315
|
+
name: "reject",
|
|
29316
|
+
parameters: {
|
|
29317
|
+
type: "object",
|
|
29318
|
+
properties: {},
|
|
29319
|
+
additionalProperties: false,
|
|
29320
|
+
required: [],
|
|
29321
|
+
$defs: {}
|
|
29322
|
+
},
|
|
29323
|
+
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.",
|
|
29324
|
+
validate: (() => input => ({
|
|
29325
|
+
success: true,
|
|
29326
|
+
data: input
|
|
29327
|
+
}))()
|
|
29328
|
+
} ]
|
|
29329
|
+
};
|
|
29330
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
29331
|
+
...{
|
|
29332
|
+
validate: {
|
|
29333
|
+
rewrite: validate,
|
|
29334
|
+
reject: () => ({
|
|
29335
|
+
success: true,
|
|
29336
|
+
data: undefined
|
|
29337
|
+
})
|
|
29338
|
+
}
|
|
28914
29339
|
},
|
|
28915
|
-
|
|
28916
|
-
|
|
28917
|
-
|
|
28918
|
-
|
|
28919
|
-
}))()
|
|
28920
|
-
} ]
|
|
28921
|
-
}
|
|
29340
|
+
equals: false
|
|
29341
|
+
});
|
|
29342
|
+
return application;
|
|
29343
|
+
})()
|
|
28922
29344
|
};
|
|
28923
29345
|
|
|
28924
29346
|
const getTestImportStatements = document => {
|
|
@@ -29253,6 +29675,7 @@ const correct$1 = async (ctx, compile, write, event, life) => {
|
|
|
29253
29675
|
histories: await transformTestCorrectInvalidRequestHistories(null, event.result.diagnostics),
|
|
29254
29676
|
controller: createController$4({
|
|
29255
29677
|
model: ctx.model,
|
|
29678
|
+
functionName: write.scenario.functionName,
|
|
29256
29679
|
then: next => {
|
|
29257
29680
|
pointer.value = next;
|
|
29258
29681
|
},
|
|
@@ -29300,7 +29723,81 @@ const correct$1 = async (ctx, compile, write, event, life) => {
|
|
|
29300
29723
|
|
|
29301
29724
|
const createController$4 = props => {
|
|
29302
29725
|
assertSchemaModel(props.model);
|
|
29303
|
-
const
|
|
29726
|
+
const validate = input => {
|
|
29727
|
+
const result = (() => {
|
|
29728
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
29729
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
29730
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
29731
|
+
path: _path + ".think",
|
|
29732
|
+
expected: "string",
|
|
29733
|
+
value: input.think
|
|
29734
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
29735
|
+
path: _path + ".draft",
|
|
29736
|
+
expected: "string",
|
|
29737
|
+
value: input.draft
|
|
29738
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
29739
|
+
path: _path + ".revise",
|
|
29740
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
29741
|
+
value: input.revise
|
|
29742
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
29743
|
+
path: _path + ".revise",
|
|
29744
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
29745
|
+
value: input.revise
|
|
29746
|
+
}) ].every(flag => flag);
|
|
29747
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
29748
|
+
path: _path + ".review",
|
|
29749
|
+
expected: "string",
|
|
29750
|
+
value: input.review
|
|
29751
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
29752
|
+
path: _path + ".final",
|
|
29753
|
+
expected: "(null | string)",
|
|
29754
|
+
value: input.final
|
|
29755
|
+
}) ].every(flag => flag);
|
|
29756
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
29757
|
+
let errors;
|
|
29758
|
+
let _report;
|
|
29759
|
+
return input => {
|
|
29760
|
+
if (false === __is(input)) {
|
|
29761
|
+
errors = [];
|
|
29762
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
29763
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
29764
|
+
path: _path + "",
|
|
29765
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
29766
|
+
value: input
|
|
29767
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
29768
|
+
path: _path + "",
|
|
29769
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
29770
|
+
value: input
|
|
29771
|
+
}))(input, "$input", true);
|
|
29772
|
+
const success = 0 === errors.length;
|
|
29773
|
+
return success ? {
|
|
29774
|
+
success,
|
|
29775
|
+
data: input
|
|
29776
|
+
} : {
|
|
29777
|
+
success,
|
|
29778
|
+
errors,
|
|
29779
|
+
data: input
|
|
29780
|
+
};
|
|
29781
|
+
}
|
|
29782
|
+
return {
|
|
29783
|
+
success: true,
|
|
29784
|
+
data: input
|
|
29785
|
+
};
|
|
29786
|
+
};
|
|
29787
|
+
})()(input);
|
|
29788
|
+
if (result.success === false) return result;
|
|
29789
|
+
const errors = validateEmptyCode({
|
|
29790
|
+
functionName: props.functionName,
|
|
29791
|
+
draft: result.data.draft,
|
|
29792
|
+
revise: result.data.revise
|
|
29793
|
+
});
|
|
29794
|
+
return errors.length ? {
|
|
29795
|
+
success: false,
|
|
29796
|
+
errors,
|
|
29797
|
+
data: result.data
|
|
29798
|
+
} : result;
|
|
29799
|
+
};
|
|
29800
|
+
const application = collection$5[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
29304
29801
|
return {
|
|
29305
29802
|
protocol: "class",
|
|
29306
29803
|
name: "correctInvalidRequest",
|
|
@@ -29317,260 +29814,290 @@ const createController$4 = props => {
|
|
|
29317
29814
|
};
|
|
29318
29815
|
|
|
29319
29816
|
const collection$5 = {
|
|
29320
|
-
chatgpt: {
|
|
29321
|
-
|
|
29322
|
-
|
|
29323
|
-
|
|
29324
|
-
|
|
29325
|
-
|
|
29326
|
-
|
|
29327
|
-
|
|
29328
|
-
|
|
29329
|
-
|
|
29330
|
-
|
|
29331
|
-
|
|
29332
|
-
|
|
29333
|
-
|
|
29334
|
-
|
|
29335
|
-
|
|
29336
|
-
|
|
29337
|
-
|
|
29338
|
-
|
|
29339
|
-
|
|
29817
|
+
chatgpt: validate => (() => {
|
|
29818
|
+
const application = {
|
|
29819
|
+
model: "chatgpt",
|
|
29820
|
+
options: {
|
|
29821
|
+
reference: true,
|
|
29822
|
+
strict: false,
|
|
29823
|
+
separate: null
|
|
29824
|
+
},
|
|
29825
|
+
functions: [ {
|
|
29826
|
+
name: "rewrite",
|
|
29827
|
+
parameters: {
|
|
29828
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeTestCorrectInvalidRequestApplication.IProps} type:\n\n> Properties for the rewrite function containing the analysis and correction\n> workflow.\n> \n> This follows a three-phase approach: think → draft → revise, ensuring\n> systematic removal of invalid type testing code while maintaining the\n> integrity of valid E2E tests.\n\n### Description of {@link revise} property:\n\n> Review and finalization phase.\n> \n> Contains the review of changes made and the final cleaned code that\n> should compile without the invalid API request errors. This ensures the\n> correction is complete and accurate.",
|
|
29829
|
+
type: "object",
|
|
29830
|
+
properties: {
|
|
29831
|
+
think: {
|
|
29832
|
+
description: "Initial analysis phase.\n\nContains the agent's analysis of what specific invalid request pattern\nwas found in the code and how it's causing the compilation error. This\nshould identify:\n\n- The exact pattern (as any, satisfies, TestValidator.error, etc.)\n- Line numbers and locations of violations\n- The TypeScript error codes being triggered\n- Why this constitutes invalid type testing\n\nExample: \"Detected TestValidator.error() call at line 45 with 'as any'\ncasting on request body containing deliberately wrong types (number for\nemail field). This is causing TS2345 compilation error.\"",
|
|
29833
|
+
type: "string"
|
|
29834
|
+
},
|
|
29835
|
+
draft: {
|
|
29836
|
+
description: "Draft correction phase.\n\nThe initial corrected code with the problematic API request sections\ncompletely removed while preserving all valid test code.\n\nRules for drafting:\n\n- Remove entire test functions containing type violations\n- Do not comment out code - delete it completely\n- Preserve test suite structure and valid tests\n- Maintain proper indentation and formatting\n- Keep imports that are still needed by remaining code",
|
|
29837
|
+
type: "string"
|
|
29838
|
+
},
|
|
29839
|
+
revise: {
|
|
29840
|
+
$ref: "#/$defs/IAutoBeTestCorrectInvalidRequestApplication.IReviseProps"
|
|
29841
|
+
}
|
|
29340
29842
|
},
|
|
29341
|
-
|
|
29342
|
-
|
|
29343
|
-
|
|
29344
|
-
|
|
29345
|
-
|
|
29346
|
-
|
|
29347
|
-
|
|
29348
|
-
|
|
29349
|
-
|
|
29350
|
-
type: "object",
|
|
29351
|
-
properties: {
|
|
29352
|
-
review: {
|
|
29353
|
-
description: 'Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: "Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected."',
|
|
29354
|
-
type: "string"
|
|
29355
|
-
},
|
|
29356
|
-
final: {
|
|
29357
|
-
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
29358
|
-
anyOf: [ {
|
|
29359
|
-
type: "null"
|
|
29360
|
-
}, {
|
|
29843
|
+
required: [ "think", "draft", "revise" ],
|
|
29844
|
+
additionalProperties: false,
|
|
29845
|
+
$defs: {
|
|
29846
|
+
"IAutoBeTestCorrectInvalidRequestApplication.IReviseProps": {
|
|
29847
|
+
description: "Properties for the revision phase of the correction process.\n\nThis phase ensures that the removal was complete and the remaining code is\nvalid and compilable.",
|
|
29848
|
+
type: "object",
|
|
29849
|
+
properties: {
|
|
29850
|
+
review: {
|
|
29851
|
+
description: 'Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: "Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected."',
|
|
29361
29852
|
type: "string"
|
|
29362
|
-
}
|
|
29363
|
-
|
|
29364
|
-
|
|
29365
|
-
|
|
29853
|
+
},
|
|
29854
|
+
final: {
|
|
29855
|
+
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
29856
|
+
anyOf: [ {
|
|
29857
|
+
type: "null"
|
|
29858
|
+
}, {
|
|
29859
|
+
type: "string"
|
|
29860
|
+
} ]
|
|
29861
|
+
}
|
|
29862
|
+
},
|
|
29863
|
+
required: [ "review", "final" ]
|
|
29864
|
+
}
|
|
29366
29865
|
}
|
|
29367
|
-
}
|
|
29368
|
-
|
|
29369
|
-
|
|
29370
|
-
|
|
29371
|
-
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
29376
|
-
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
|
|
29384
|
-
|
|
29385
|
-
|
|
29386
|
-
|
|
29387
|
-
|
|
29388
|
-
|
|
29389
|
-
|
|
29390
|
-
|
|
29391
|
-
|
|
29392
|
-
|
|
29393
|
-
|
|
29394
|
-
|
|
29395
|
-
|
|
29396
|
-
|
|
29397
|
-
|
|
29398
|
-
|
|
29399
|
-
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29409
|
-
|
|
29410
|
-
|
|
29411
|
-
|
|
29412
|
-
|
|
29413
|
-
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29421
|
-
|
|
29866
|
+
},
|
|
29867
|
+
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
29868
|
+
validate: (() => {
|
|
29869
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
29870
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
29871
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
29872
|
+
path: _path + ".think",
|
|
29873
|
+
expected: "string",
|
|
29874
|
+
value: input.think
|
|
29875
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
29876
|
+
path: _path + ".draft",
|
|
29877
|
+
expected: "string",
|
|
29878
|
+
value: input.draft
|
|
29879
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
29880
|
+
path: _path + ".revise",
|
|
29881
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
29882
|
+
value: input.revise
|
|
29883
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
29884
|
+
path: _path + ".revise",
|
|
29885
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
29886
|
+
value: input.revise
|
|
29887
|
+
}) ].every(flag => flag);
|
|
29888
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
29889
|
+
path: _path + ".review",
|
|
29890
|
+
expected: "string",
|
|
29891
|
+
value: input.review
|
|
29892
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
29893
|
+
path: _path + ".final",
|
|
29894
|
+
expected: "(null | string)",
|
|
29895
|
+
value: input.final
|
|
29896
|
+
}) ].every(flag => flag);
|
|
29897
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
29898
|
+
let errors;
|
|
29899
|
+
let _report;
|
|
29900
|
+
return input => {
|
|
29901
|
+
if (false === __is(input)) {
|
|
29902
|
+
errors = [];
|
|
29903
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
29904
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
29905
|
+
path: _path + "",
|
|
29906
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
29907
|
+
value: input
|
|
29908
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
29909
|
+
path: _path + "",
|
|
29910
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
29911
|
+
value: input
|
|
29912
|
+
}))(input, "$input", true);
|
|
29913
|
+
const success = 0 === errors.length;
|
|
29914
|
+
return success ? {
|
|
29915
|
+
success,
|
|
29916
|
+
data: input
|
|
29917
|
+
} : {
|
|
29918
|
+
success,
|
|
29919
|
+
errors,
|
|
29920
|
+
data: input
|
|
29921
|
+
};
|
|
29922
|
+
}
|
|
29923
|
+
return {
|
|
29924
|
+
success: true,
|
|
29422
29925
|
data: input
|
|
29423
29926
|
};
|
|
29424
|
-
}
|
|
29425
|
-
return {
|
|
29426
|
-
success: true,
|
|
29427
|
-
data: input
|
|
29428
29927
|
};
|
|
29429
|
-
}
|
|
29430
|
-
}
|
|
29431
|
-
|
|
29432
|
-
|
|
29433
|
-
|
|
29434
|
-
|
|
29435
|
-
|
|
29436
|
-
|
|
29437
|
-
|
|
29438
|
-
|
|
29928
|
+
})()
|
|
29929
|
+
}, {
|
|
29930
|
+
name: "reject",
|
|
29931
|
+
parameters: {
|
|
29932
|
+
type: "object",
|
|
29933
|
+
properties: {},
|
|
29934
|
+
additionalProperties: false,
|
|
29935
|
+
required: [],
|
|
29936
|
+
$defs: {}
|
|
29937
|
+
},
|
|
29938
|
+
description: "Reject function when no invalid type API requests are detected.\n\nThis function is called when the compilation error is not related to\ninvalid API request types, indicating the agent should not intervene.\n\nCommon scenarios for rejection:\n\n- Syntax errors unrelated to type violations\n- Legitimate type mismatches that need fixing (not deletion)\n- Framework-specific compilation issues\n- Configuration or environment problems\n\nWhen called, this indicates that another specialized agent should handle\nthe compilation error, as it's outside this agent's domain.",
|
|
29939
|
+
validate: (() => input => ({
|
|
29940
|
+
success: true,
|
|
29941
|
+
data: input
|
|
29942
|
+
}))()
|
|
29943
|
+
} ]
|
|
29944
|
+
};
|
|
29945
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
29946
|
+
...{
|
|
29947
|
+
validate: {
|
|
29948
|
+
rewrite: validate,
|
|
29949
|
+
reject: () => ({
|
|
29950
|
+
success: true,
|
|
29951
|
+
data: undefined
|
|
29952
|
+
})
|
|
29953
|
+
}
|
|
29439
29954
|
},
|
|
29440
|
-
|
|
29441
|
-
|
|
29442
|
-
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
|
|
29446
|
-
|
|
29447
|
-
|
|
29448
|
-
|
|
29449
|
-
|
|
29450
|
-
|
|
29451
|
-
|
|
29452
|
-
|
|
29453
|
-
|
|
29454
|
-
|
|
29455
|
-
|
|
29456
|
-
|
|
29457
|
-
|
|
29458
|
-
|
|
29459
|
-
|
|
29460
|
-
|
|
29461
|
-
|
|
29462
|
-
|
|
29463
|
-
|
|
29464
|
-
|
|
29465
|
-
|
|
29955
|
+
equals: false
|
|
29956
|
+
});
|
|
29957
|
+
return application;
|
|
29958
|
+
})(),
|
|
29959
|
+
claude: validate => (() => {
|
|
29960
|
+
const application = {
|
|
29961
|
+
model: "claude",
|
|
29962
|
+
options: {
|
|
29963
|
+
reference: true,
|
|
29964
|
+
separate: null
|
|
29965
|
+
},
|
|
29966
|
+
functions: [ {
|
|
29967
|
+
name: "rewrite",
|
|
29968
|
+
parameters: {
|
|
29969
|
+
description: " - The analysis and correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeTestCorrectInvalidRequestApplication.IProps} type:\n\n> Properties for the rewrite function containing the analysis and correction\n> workflow.\n> \n> This follows a three-phase approach: think → draft → revise, ensuring\n> systematic removal of invalid type testing code while maintaining the\n> integrity of valid E2E tests.",
|
|
29970
|
+
type: "object",
|
|
29971
|
+
properties: {
|
|
29972
|
+
think: {
|
|
29973
|
+
description: "Initial analysis phase.\n\nContains the agent's analysis of what specific invalid request pattern\nwas found in the code and how it's causing the compilation error. This\nshould identify:\n\n- The exact pattern (as any, satisfies, TestValidator.error, etc.)\n- Line numbers and locations of violations\n- The TypeScript error codes being triggered\n- Why this constitutes invalid type testing\n\nExample: \"Detected TestValidator.error() call at line 45 with 'as any'\ncasting on request body containing deliberately wrong types (number for\nemail field). This is causing TS2345 compilation error.\"",
|
|
29974
|
+
type: "string"
|
|
29975
|
+
},
|
|
29976
|
+
draft: {
|
|
29977
|
+
description: "Draft correction phase.\n\nThe initial corrected code with the problematic API request sections\ncompletely removed while preserving all valid test code.\n\nRules for drafting:\n\n- Remove entire test functions containing type violations\n- Do not comment out code - delete it completely\n- Preserve test suite structure and valid tests\n- Maintain proper indentation and formatting\n- Keep imports that are still needed by remaining code",
|
|
29978
|
+
type: "string"
|
|
29979
|
+
},
|
|
29980
|
+
revise: {
|
|
29981
|
+
description: "Review and finalization phase.\n\nContains the review of changes made and the final cleaned code that\nshould compile without the invalid API request errors. This ensures the\ncorrection is complete and accurate.",
|
|
29982
|
+
$ref: "#/$defs/IAutoBeTestCorrectInvalidRequestApplication.IReviseProps"
|
|
29983
|
+
}
|
|
29466
29984
|
},
|
|
29467
|
-
|
|
29468
|
-
|
|
29469
|
-
|
|
29470
|
-
|
|
29471
|
-
|
|
29472
|
-
|
|
29473
|
-
|
|
29474
|
-
|
|
29475
|
-
|
|
29476
|
-
description: "Properties for the revision phase of the correction process.\n\nThis phase ensures that the removal was complete and the remaining code is\nvalid and compilable.",
|
|
29477
|
-
type: "object",
|
|
29478
|
-
properties: {
|
|
29479
|
-
review: {
|
|
29480
|
-
description: 'Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: "Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected."',
|
|
29481
|
-
type: "string"
|
|
29482
|
-
},
|
|
29483
|
-
final: {
|
|
29484
|
-
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
29485
|
-
oneOf: [ {
|
|
29486
|
-
type: "null"
|
|
29487
|
-
}, {
|
|
29985
|
+
required: [ "think", "draft", "revise" ],
|
|
29986
|
+
additionalProperties: false,
|
|
29987
|
+
$defs: {
|
|
29988
|
+
"IAutoBeTestCorrectInvalidRequestApplication.IReviseProps": {
|
|
29989
|
+
description: "Properties for the revision phase of the correction process.\n\nThis phase ensures that the removal was complete and the remaining code is\nvalid and compilable.",
|
|
29990
|
+
type: "object",
|
|
29991
|
+
properties: {
|
|
29992
|
+
review: {
|
|
29993
|
+
description: 'Review of the changes made.\n\nBrief explanation of what invalid API request code was removed and\nverification that valid test code was preserved. Should confirm:\n\n- Which patterns were found and removed\n- Line ranges that were deleted\n- Verification that valid tests remain intact\n- Confirmation that no partial fixes were applied\n\nExample: "Removed lines 43-52 containing TestValidator.error with invalid\ntype casting. Verified remaining tests are valid and unaffected."',
|
|
29488
29994
|
type: "string"
|
|
29489
|
-
}
|
|
29490
|
-
|
|
29491
|
-
|
|
29492
|
-
|
|
29995
|
+
},
|
|
29996
|
+
final: {
|
|
29997
|
+
description: "Final corrected code.\n\nThe complete, cleaned test code with all invalid API request sections\nremoved, ready for compilation. When the draft already successfully\nremoves all problematic code with no additional issues found during\nreview, this value can be null, indicating the draft deletion was\nsufficient and requires no further changes.\n\nThis code must:\n\n- Compile without TypeScript errors\n- Contain only valid business logic tests\n- Have no `as any` or similar type violations\n- Maintain the original file structure\n- Be production-ready E2E test code\n\nA null value indicates the draft successfully removed all invalid code\nand needs no additional modifications.",
|
|
29998
|
+
oneOf: [ {
|
|
29999
|
+
type: "null"
|
|
30000
|
+
}, {
|
|
30001
|
+
type: "string"
|
|
30002
|
+
} ]
|
|
30003
|
+
}
|
|
30004
|
+
},
|
|
30005
|
+
required: [ "review", "final" ]
|
|
30006
|
+
}
|
|
29493
30007
|
}
|
|
29494
|
-
}
|
|
29495
|
-
|
|
29496
|
-
|
|
29497
|
-
|
|
29498
|
-
|
|
29499
|
-
|
|
29500
|
-
|
|
29501
|
-
|
|
29502
|
-
|
|
29503
|
-
|
|
29504
|
-
|
|
29505
|
-
|
|
29506
|
-
|
|
29507
|
-
|
|
29508
|
-
|
|
29509
|
-
|
|
29510
|
-
|
|
29511
|
-
|
|
29512
|
-
|
|
29513
|
-
|
|
29514
|
-
|
|
29515
|
-
|
|
29516
|
-
|
|
29517
|
-
|
|
29518
|
-
|
|
29519
|
-
|
|
29520
|
-
|
|
29521
|
-
|
|
29522
|
-
|
|
29523
|
-
|
|
29524
|
-
|
|
29525
|
-
|
|
29526
|
-
|
|
29527
|
-
|
|
29528
|
-
|
|
29529
|
-
|
|
29530
|
-
|
|
29531
|
-
|
|
29532
|
-
|
|
29533
|
-
|
|
29534
|
-
|
|
29535
|
-
|
|
29536
|
-
|
|
29537
|
-
|
|
29538
|
-
|
|
29539
|
-
|
|
29540
|
-
|
|
29541
|
-
|
|
29542
|
-
|
|
29543
|
-
|
|
29544
|
-
|
|
29545
|
-
|
|
29546
|
-
|
|
29547
|
-
|
|
29548
|
-
|
|
30008
|
+
},
|
|
30009
|
+
description: "Rewrite function to remove code containing invalid type API requests.\n\nThis function is called when the agent detects code that attempts to send\nAPI requests with deliberately wrong types, causing TypeScript compilation\nerrors. The agent will remove the problematic code sections while\npreserving valid test code.\n\nCommon patterns that trigger this function:\n\n- TestValidator.error calls testing type violations\n- Missing required fields with type assertions\n- Wrong type assignments with satisfies operator\n- Nested type violations in complex objects\n- Partial type testing with invalid structures\n\nThe rationale for deletion:\n\n- Type validation is the server's responsibility, not E2E tests\n- TypeScript compiler should enforce type safety at compile time\n- Invalid type testing breaks the entire test suite compilation\n- E2E tests should focus on business logic, not type system violations",
|
|
30010
|
+
validate: (() => {
|
|
30011
|
+
const _io0 = input => "string" === typeof input.think && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
30012
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
30013
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.think || _report(_exceptionable, {
|
|
30014
|
+
path: _path + ".think",
|
|
30015
|
+
expected: "string",
|
|
30016
|
+
value: input.think
|
|
30017
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
30018
|
+
path: _path + ".draft",
|
|
30019
|
+
expected: "string",
|
|
30020
|
+
value: input.draft
|
|
30021
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
30022
|
+
path: _path + ".revise",
|
|
30023
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
30024
|
+
value: input.revise
|
|
30025
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
30026
|
+
path: _path + ".revise",
|
|
30027
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IReviseProps",
|
|
30028
|
+
value: input.revise
|
|
30029
|
+
}) ].every(flag => flag);
|
|
30030
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
30031
|
+
path: _path + ".review",
|
|
30032
|
+
expected: "string",
|
|
30033
|
+
value: input.review
|
|
30034
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
30035
|
+
path: _path + ".final",
|
|
30036
|
+
expected: "(null | string)",
|
|
30037
|
+
value: input.final
|
|
30038
|
+
}) ].every(flag => flag);
|
|
30039
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
30040
|
+
let errors;
|
|
30041
|
+
let _report;
|
|
30042
|
+
return input => {
|
|
30043
|
+
if (false === __is(input)) {
|
|
30044
|
+
errors = [];
|
|
30045
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
30046
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
30047
|
+
path: _path + "",
|
|
30048
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
30049
|
+
value: input
|
|
30050
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
30051
|
+
path: _path + "",
|
|
30052
|
+
expected: "IAutoBeTestCorrectInvalidRequestApplication.IProps",
|
|
30053
|
+
value: input
|
|
30054
|
+
}))(input, "$input", true);
|
|
30055
|
+
const success = 0 === errors.length;
|
|
30056
|
+
return success ? {
|
|
30057
|
+
success,
|
|
30058
|
+
data: input
|
|
30059
|
+
} : {
|
|
30060
|
+
success,
|
|
30061
|
+
errors,
|
|
30062
|
+
data: input
|
|
30063
|
+
};
|
|
30064
|
+
}
|
|
30065
|
+
return {
|
|
30066
|
+
success: true,
|
|
29549
30067
|
data: input
|
|
29550
30068
|
};
|
|
29551
|
-
}
|
|
29552
|
-
return {
|
|
29553
|
-
success: true,
|
|
29554
|
-
data: input
|
|
29555
30069
|
};
|
|
29556
|
-
}
|
|
29557
|
-
}
|
|
29558
|
-
|
|
29559
|
-
|
|
29560
|
-
|
|
29561
|
-
|
|
29562
|
-
|
|
29563
|
-
|
|
29564
|
-
|
|
29565
|
-
|
|
30070
|
+
})()
|
|
30071
|
+
}, {
|
|
30072
|
+
name: "reject",
|
|
30073
|
+
parameters: {
|
|
30074
|
+
type: "object",
|
|
30075
|
+
properties: {},
|
|
30076
|
+
additionalProperties: false,
|
|
30077
|
+
required: [],
|
|
30078
|
+
$defs: {}
|
|
30079
|
+
},
|
|
30080
|
+
description: "Reject function when no invalid type API requests are detected.\n\nThis function is called when the compilation error is not related to\ninvalid API request types, indicating the agent should not intervene.\n\nCommon scenarios for rejection:\n\n- Syntax errors unrelated to type violations\n- Legitimate type mismatches that need fixing (not deletion)\n- Framework-specific compilation issues\n- Configuration or environment problems\n\nWhen called, this indicates that another specialized agent should handle\nthe compilation error, as it's outside this agent's domain.",
|
|
30081
|
+
validate: (() => input => ({
|
|
30082
|
+
success: true,
|
|
30083
|
+
data: input
|
|
30084
|
+
}))()
|
|
30085
|
+
} ]
|
|
30086
|
+
};
|
|
30087
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
30088
|
+
...{
|
|
30089
|
+
validate: {
|
|
30090
|
+
rewrite: validate,
|
|
30091
|
+
reject: () => ({
|
|
30092
|
+
success: true,
|
|
30093
|
+
data: undefined
|
|
30094
|
+
})
|
|
30095
|
+
}
|
|
29566
30096
|
},
|
|
29567
|
-
|
|
29568
|
-
|
|
29569
|
-
|
|
29570
|
-
|
|
29571
|
-
}))()
|
|
29572
|
-
} ]
|
|
29573
|
-
}
|
|
30097
|
+
equals: false
|
|
30098
|
+
});
|
|
30099
|
+
return application;
|
|
30100
|
+
})()
|
|
29574
30101
|
};
|
|
29575
30102
|
|
|
29576
30103
|
const orchestrateTestCorrect = async (ctx, props) => {
|
|
@@ -29601,7 +30128,8 @@ const orchestrateTestCorrect = async (ctx, props) => {
|
|
|
29601
30128
|
final: next.final,
|
|
29602
30129
|
step: ctx.state().analyze?.step ?? 0
|
|
29603
30130
|
}),
|
|
29604
|
-
script: event => event.file.content
|
|
30131
|
+
script: event => event.file.content,
|
|
30132
|
+
functionName: w.scenario.functionName
|
|
29605
30133
|
}, x.file.content);
|
|
29606
30134
|
return await predicate(ctx, {
|
|
29607
30135
|
function: transformTestValidateEvent(y, w.artifacts),
|
|
@@ -29662,6 +30190,7 @@ const correct = async (ctx, props, life) => {
|
|
|
29662
30190
|
}),
|
|
29663
30191
|
controller: createController$3({
|
|
29664
30192
|
model: ctx.model,
|
|
30193
|
+
functionName: props.function.scenario.functionName,
|
|
29665
30194
|
failure: props.validate.result,
|
|
29666
30195
|
build: next => {
|
|
29667
30196
|
pointer.value = next;
|
|
@@ -29773,7 +30302,17 @@ const createController$3 = props => {
|
|
|
29773
30302
|
};
|
|
29774
30303
|
};
|
|
29775
30304
|
})()(input);
|
|
29776
|
-
return result;
|
|
30305
|
+
if (result.success === false) return result;
|
|
30306
|
+
const errors = validateEmptyCode({
|
|
30307
|
+
functionName: props.functionName,
|
|
30308
|
+
draft: result.data.draft,
|
|
30309
|
+
revise: result.data.revise
|
|
30310
|
+
});
|
|
30311
|
+
return errors.length ? {
|
|
30312
|
+
success: false,
|
|
30313
|
+
errors,
|
|
30314
|
+
data: result.data
|
|
30315
|
+
} : result;
|
|
29777
30316
|
};
|
|
29778
30317
|
const application = collection$4[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
29779
30318
|
return {
|
|
@@ -31987,6 +32526,7 @@ async function process(ctx, props) {
|
|
|
31987
32526
|
}),
|
|
31988
32527
|
controller: createController({
|
|
31989
32528
|
model: ctx.model,
|
|
32529
|
+
functionName: props.scenario.functionName,
|
|
31990
32530
|
build: next => {
|
|
31991
32531
|
next.domain = NamingConvention.snake(next.domain);
|
|
31992
32532
|
pointer.value = next;
|
|
@@ -32021,73 +32561,8 @@ async function process(ctx, props) {
|
|
|
32021
32561
|
|
|
32022
32562
|
function createController(props) {
|
|
32023
32563
|
assertSchemaModel(props.model);
|
|
32024
|
-
const
|
|
32025
|
-
|
|
32026
|
-
protocol: "class",
|
|
32027
|
-
name: "Create Test Code",
|
|
32028
|
-
application,
|
|
32029
|
-
execute: {
|
|
32030
|
-
write: next => {
|
|
32031
|
-
props.build(next);
|
|
32032
|
-
}
|
|
32033
|
-
}
|
|
32034
|
-
};
|
|
32035
|
-
}
|
|
32036
|
-
|
|
32037
|
-
const claude$1 = {
|
|
32038
|
-
model: "claude",
|
|
32039
|
-
options: {
|
|
32040
|
-
reference: true,
|
|
32041
|
-
separate: null
|
|
32042
|
-
},
|
|
32043
|
-
functions: [ {
|
|
32044
|
-
name: "write",
|
|
32045
|
-
parameters: {
|
|
32046
|
-
description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}",
|
|
32047
|
-
type: "object",
|
|
32048
|
-
properties: {
|
|
32049
|
-
scenario: {
|
|
32050
|
-
description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario → Strategic analysis → Detailed test plan",
|
|
32051
|
-
type: "string"
|
|
32052
|
-
},
|
|
32053
|
-
domain: {
|
|
32054
|
-
description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis → Domain identification → Test organization\nstructure",
|
|
32055
|
-
type: "string"
|
|
32056
|
-
},
|
|
32057
|
-
draft: {
|
|
32058
|
-
description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
|
|
32059
|
-
type: "string"
|
|
32060
|
-
},
|
|
32061
|
-
revise: {
|
|
32062
|
-
description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft → Review analysis → Final implementation",
|
|
32063
|
-
$ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
|
|
32064
|
-
}
|
|
32065
|
-
},
|
|
32066
|
-
required: [ "scenario", "domain", "draft", "revise" ],
|
|
32067
|
-
additionalProperties: false,
|
|
32068
|
-
$defs: {
|
|
32069
|
-
"IAutoBeTestWriteApplication.IReviseProps": {
|
|
32070
|
-
type: "object",
|
|
32071
|
-
properties: {
|
|
32072
|
-
review: {
|
|
32073
|
-
description: "Step 4: Code review and quality assessment.\n\n**🚨 TWO TYPES OF REVISIONS: FIX AND DELETE 🚨**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
|
|
32074
|
-
type: "string"
|
|
32075
|
-
},
|
|
32076
|
-
final: {
|
|
32077
|
-
description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback → Apply FIXES → Apply DELETIONS →\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
|
|
32078
|
-
oneOf: [ {
|
|
32079
|
-
type: "null"
|
|
32080
|
-
}, {
|
|
32081
|
-
type: "string"
|
|
32082
|
-
} ]
|
|
32083
|
-
}
|
|
32084
|
-
},
|
|
32085
|
-
required: [ "review", "final" ]
|
|
32086
|
-
}
|
|
32087
|
-
}
|
|
32088
|
-
},
|
|
32089
|
-
description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis → draft implementation → code review → final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
|
|
32090
|
-
validate: (() => {
|
|
32564
|
+
const validate = input => {
|
|
32565
|
+
const result = (() => {
|
|
32091
32566
|
const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
32092
32567
|
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
32093
32568
|
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.scenario || _report(_exceptionable, {
|
|
@@ -32151,249 +32626,295 @@ const claude$1 = {
|
|
|
32151
32626
|
data: input
|
|
32152
32627
|
};
|
|
32153
32628
|
};
|
|
32154
|
-
})()
|
|
32155
|
-
|
|
32156
|
-
|
|
32629
|
+
})()(input);
|
|
32630
|
+
if (result.success === false) return result;
|
|
32631
|
+
const errors = validateEmptyCode({
|
|
32632
|
+
functionName: props.functionName,
|
|
32633
|
+
draft: result.data.draft,
|
|
32634
|
+
revise: result.data.revise
|
|
32635
|
+
});
|
|
32636
|
+
return errors.length ? {
|
|
32637
|
+
success: false,
|
|
32638
|
+
errors,
|
|
32639
|
+
data: result.data
|
|
32640
|
+
} : result;
|
|
32641
|
+
};
|
|
32642
|
+
const application = collection$1[props.model === "chatgpt" ? "chatgpt" : "claude"](validate);
|
|
32643
|
+
return {
|
|
32644
|
+
protocol: "class",
|
|
32645
|
+
name: "Create Test Code",
|
|
32646
|
+
application,
|
|
32647
|
+
execute: {
|
|
32648
|
+
write: next => {
|
|
32649
|
+
props.build(next);
|
|
32650
|
+
}
|
|
32651
|
+
}
|
|
32652
|
+
};
|
|
32653
|
+
}
|
|
32157
32654
|
|
|
32158
32655
|
const collection$1 = {
|
|
32159
|
-
chatgpt: {
|
|
32160
|
-
|
|
32161
|
-
|
|
32162
|
-
|
|
32163
|
-
|
|
32164
|
-
|
|
32165
|
-
|
|
32166
|
-
|
|
32167
|
-
|
|
32168
|
-
|
|
32169
|
-
|
|
32170
|
-
|
|
32171
|
-
|
|
32172
|
-
|
|
32173
|
-
|
|
32174
|
-
|
|
32175
|
-
|
|
32176
|
-
|
|
32177
|
-
|
|
32178
|
-
|
|
32179
|
-
|
|
32180
|
-
|
|
32181
|
-
|
|
32182
|
-
|
|
32656
|
+
chatgpt: validate => (() => {
|
|
32657
|
+
const application = {
|
|
32658
|
+
model: "chatgpt",
|
|
32659
|
+
options: {
|
|
32660
|
+
reference: true,
|
|
32661
|
+
strict: false,
|
|
32662
|
+
separate: null
|
|
32663
|
+
},
|
|
32664
|
+
functions: [ {
|
|
32665
|
+
name: "write",
|
|
32666
|
+
parameters: {
|
|
32667
|
+
description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}\n\n### Description of {@link revise} property:\n\n> Steps 4-5: Code review and final refinement process.\n> \n> Contains the iterative improvement workflow that transforms the initial\n> draft into production-ready test code. The review phase identifies issues\n> to fix or code to delete, followed by the final phase that produces the\n> polished, production-ready test implementation.\n> \n> Workflow: Draft → Review analysis → Final implementation",
|
|
32668
|
+
type: "object",
|
|
32669
|
+
properties: {
|
|
32670
|
+
scenario: {
|
|
32671
|
+
description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario → Strategic analysis → Detailed test plan",
|
|
32672
|
+
type: "string"
|
|
32673
|
+
},
|
|
32674
|
+
domain: {
|
|
32675
|
+
description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis → Domain identification → Test organization\nstructure",
|
|
32676
|
+
type: "string"
|
|
32677
|
+
},
|
|
32678
|
+
draft: {
|
|
32679
|
+
description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
|
|
32680
|
+
type: "string"
|
|
32681
|
+
},
|
|
32682
|
+
revise: {
|
|
32683
|
+
$ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
|
|
32684
|
+
}
|
|
32183
32685
|
},
|
|
32184
|
-
|
|
32185
|
-
|
|
32186
|
-
|
|
32187
|
-
|
|
32188
|
-
|
|
32189
|
-
|
|
32190
|
-
|
|
32191
|
-
|
|
32192
|
-
type: "object",
|
|
32193
|
-
properties: {
|
|
32194
|
-
review: {
|
|
32195
|
-
description: "Step 4: Code review and quality assessment.\n\n**🚨 TWO TYPES OF REVISIONS: FIX AND DELETE 🚨**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
|
|
32196
|
-
type: "string"
|
|
32197
|
-
},
|
|
32198
|
-
final: {
|
|
32199
|
-
description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback → Apply FIXES → Apply DELETIONS →\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
|
|
32200
|
-
anyOf: [ {
|
|
32201
|
-
type: "null"
|
|
32202
|
-
}, {
|
|
32686
|
+
required: [ "scenario", "domain", "draft", "revise" ],
|
|
32687
|
+
additionalProperties: false,
|
|
32688
|
+
$defs: {
|
|
32689
|
+
"IAutoBeTestWriteApplication.IReviseProps": {
|
|
32690
|
+
type: "object",
|
|
32691
|
+
properties: {
|
|
32692
|
+
review: {
|
|
32693
|
+
description: "Step 4: Code review and quality assessment.\n\n**🚨 TWO TYPES OF REVISIONS: FIX AND DELETE 🚨**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
|
|
32203
32694
|
type: "string"
|
|
32204
|
-
}
|
|
32205
|
-
|
|
32206
|
-
|
|
32207
|
-
|
|
32695
|
+
},
|
|
32696
|
+
final: {
|
|
32697
|
+
description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback → Apply FIXES → Apply DELETIONS →\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
|
|
32698
|
+
anyOf: [ {
|
|
32699
|
+
type: "null"
|
|
32700
|
+
}, {
|
|
32701
|
+
type: "string"
|
|
32702
|
+
} ]
|
|
32703
|
+
}
|
|
32704
|
+
},
|
|
32705
|
+
required: [ "review", "final" ]
|
|
32706
|
+
}
|
|
32208
32707
|
}
|
|
32209
|
-
}
|
|
32210
|
-
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
|
|
32214
|
-
|
|
32215
|
-
|
|
32216
|
-
|
|
32217
|
-
|
|
32218
|
-
|
|
32219
|
-
|
|
32220
|
-
|
|
32221
|
-
|
|
32222
|
-
|
|
32223
|
-
|
|
32224
|
-
|
|
32225
|
-
|
|
32226
|
-
|
|
32227
|
-
|
|
32228
|
-
|
|
32229
|
-
|
|
32230
|
-
|
|
32231
|
-
|
|
32232
|
-
|
|
32233
|
-
|
|
32234
|
-
|
|
32235
|
-
|
|
32236
|
-
|
|
32237
|
-
|
|
32238
|
-
|
|
32239
|
-
|
|
32240
|
-
|
|
32241
|
-
|
|
32242
|
-
|
|
32243
|
-
|
|
32244
|
-
|
|
32245
|
-
|
|
32246
|
-
|
|
32247
|
-
|
|
32248
|
-
|
|
32249
|
-
|
|
32250
|
-
|
|
32251
|
-
|
|
32252
|
-
|
|
32253
|
-
|
|
32254
|
-
|
|
32255
|
-
|
|
32256
|
-
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
-
|
|
32260
|
-
|
|
32261
|
-
|
|
32262
|
-
|
|
32263
|
-
|
|
32264
|
-
|
|
32265
|
-
|
|
32266
|
-
|
|
32267
|
-
|
|
32708
|
+
},
|
|
32709
|
+
description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis → draft implementation → code review → final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
|
|
32710
|
+
validate: (() => {
|
|
32711
|
+
const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
32712
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
32713
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.scenario || _report(_exceptionable, {
|
|
32714
|
+
path: _path + ".scenario",
|
|
32715
|
+
expected: "string",
|
|
32716
|
+
value: input.scenario
|
|
32717
|
+
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
32718
|
+
path: _path + ".domain",
|
|
32719
|
+
expected: "string",
|
|
32720
|
+
value: input.domain
|
|
32721
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
32722
|
+
path: _path + ".draft",
|
|
32723
|
+
expected: "string",
|
|
32724
|
+
value: input.draft
|
|
32725
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
32726
|
+
path: _path + ".revise",
|
|
32727
|
+
expected: "IAutoBeTestWriteApplication.IReviseProps",
|
|
32728
|
+
value: input.revise
|
|
32729
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
32730
|
+
path: _path + ".revise",
|
|
32731
|
+
expected: "IAutoBeTestWriteApplication.IReviseProps",
|
|
32732
|
+
value: input.revise
|
|
32733
|
+
}) ].every(flag => flag);
|
|
32734
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
32735
|
+
path: _path + ".review",
|
|
32736
|
+
expected: "string",
|
|
32737
|
+
value: input.review
|
|
32738
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
32739
|
+
path: _path + ".final",
|
|
32740
|
+
expected: "(null | string)",
|
|
32741
|
+
value: input.final
|
|
32742
|
+
}) ].every(flag => flag);
|
|
32743
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
32744
|
+
let errors;
|
|
32745
|
+
let _report;
|
|
32746
|
+
return input => {
|
|
32747
|
+
if (false === __is(input)) {
|
|
32748
|
+
errors = [];
|
|
32749
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
32750
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
32751
|
+
path: _path + "",
|
|
32752
|
+
expected: "IAutoBeTestWriteApplication.IProps",
|
|
32753
|
+
value: input
|
|
32754
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
32755
|
+
path: _path + "",
|
|
32756
|
+
expected: "IAutoBeTestWriteApplication.IProps",
|
|
32757
|
+
value: input
|
|
32758
|
+
}))(input, "$input", true);
|
|
32759
|
+
const success = 0 === errors.length;
|
|
32760
|
+
return success ? {
|
|
32761
|
+
success,
|
|
32762
|
+
data: input
|
|
32763
|
+
} : {
|
|
32764
|
+
success,
|
|
32765
|
+
errors,
|
|
32766
|
+
data: input
|
|
32767
|
+
};
|
|
32768
|
+
}
|
|
32769
|
+
return {
|
|
32770
|
+
success: true,
|
|
32268
32771
|
data: input
|
|
32269
32772
|
};
|
|
32270
|
-
}
|
|
32271
|
-
return {
|
|
32272
|
-
success: true,
|
|
32273
|
-
data: input
|
|
32274
32773
|
};
|
|
32275
|
-
}
|
|
32276
|
-
}
|
|
32277
|
-
}
|
|
32278
|
-
|
|
32279
|
-
|
|
32280
|
-
|
|
32281
|
-
|
|
32282
|
-
|
|
32283
|
-
|
|
32284
|
-
|
|
32285
|
-
|
|
32286
|
-
|
|
32287
|
-
|
|
32288
|
-
|
|
32289
|
-
|
|
32290
|
-
|
|
32291
|
-
|
|
32292
|
-
|
|
32293
|
-
|
|
32294
|
-
|
|
32295
|
-
|
|
32296
|
-
|
|
32297
|
-
|
|
32298
|
-
},
|
|
32299
|
-
|
|
32300
|
-
|
|
32301
|
-
|
|
32302
|
-
|
|
32303
|
-
|
|
32304
|
-
|
|
32305
|
-
|
|
32774
|
+
})()
|
|
32775
|
+
} ]
|
|
32776
|
+
};
|
|
32777
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
32778
|
+
...{
|
|
32779
|
+
validate: {
|
|
32780
|
+
write: validate
|
|
32781
|
+
}
|
|
32782
|
+
},
|
|
32783
|
+
equals: false
|
|
32784
|
+
});
|
|
32785
|
+
return application;
|
|
32786
|
+
})(),
|
|
32787
|
+
claude: validate => (() => {
|
|
32788
|
+
const application = {
|
|
32789
|
+
model: "claude",
|
|
32790
|
+
options: {
|
|
32791
|
+
reference: true,
|
|
32792
|
+
separate: null
|
|
32793
|
+
},
|
|
32794
|
+
functions: [ {
|
|
32795
|
+
name: "write",
|
|
32796
|
+
parameters: {
|
|
32797
|
+
description: " Complete specification for test generation including scenario,\ndomain, and implementation steps\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IProps}",
|
|
32798
|
+
type: "object",
|
|
32799
|
+
properties: {
|
|
32800
|
+
scenario: {
|
|
32801
|
+
description: "Step 1: Strategic test planning and scenario analysis.\n\nAI analyzes the given test scenario and creates a comprehensive\nimplementation strategy. This planning phase is crucial for generating\nwell-structured, maintainable test code. The AI must define test\nmethodology, data preparation, execution flow, and validation logic\nbefore proceeding to code implementation.\n\nWorkflow: Input scenario → Strategic analysis → Detailed test plan",
|
|
32802
|
+
type: "string"
|
|
32803
|
+
},
|
|
32804
|
+
domain: {
|
|
32805
|
+
description: "Step 2: Functional domain classification for test organization.\n\nAI determines the appropriate domain category based on the scenario\nanalysis. This classification drives file structure, test categorization,\nand logical grouping. The domain must be a single, lowercase word in\nsnake_case format that represents the primary API resource.\n\nWorkflow: Scenario analysis → Domain identification → Test organization\nstructure",
|
|
32806
|
+
type: "string"
|
|
32807
|
+
},
|
|
32808
|
+
draft: {
|
|
32809
|
+
description: "Step 3: Initial TypeScript E2E test code implementation.\n\nAI generates the first working version of the test code based on the\nstrategic plan. This draft must be compilation-error-free and follow",
|
|
32810
|
+
type: "string"
|
|
32811
|
+
},
|
|
32812
|
+
revise: {
|
|
32813
|
+
description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft → Review analysis → Final implementation",
|
|
32814
|
+
$ref: "#/$defs/IAutoBeTestWriteApplication.IReviseProps"
|
|
32815
|
+
}
|
|
32306
32816
|
},
|
|
32307
|
-
|
|
32308
|
-
|
|
32309
|
-
|
|
32310
|
-
|
|
32311
|
-
|
|
32312
|
-
|
|
32817
|
+
required: [ "scenario", "domain", "draft", "revise" ],
|
|
32818
|
+
additionalProperties: false,
|
|
32819
|
+
$defs: {
|
|
32820
|
+
"IAutoBeTestWriteApplication.IReviseProps": {
|
|
32821
|
+
type: "object",
|
|
32822
|
+
properties: {
|
|
32823
|
+
review: {
|
|
32824
|
+
description: "Step 4: Code review and quality assessment.\n\n**🚨 TWO TYPES OF REVISIONS: FIX AND DELETE 🚨**\n\nAI performs a thorough review of the draft implementation for:\n\n**1. FIX - Improve existing code:**\n\n**Compilation & Syntax:**\n\n- TypeScript compilation errors and type mismatches\n- Syntax errors and missing semicolons/brackets\n- Correct function signatures and parameter types\n\n**Framework Compliance:**\n\n-",
|
|
32825
|
+
type: "string"
|
|
32826
|
+
},
|
|
32827
|
+
final: {
|
|
32828
|
+
description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback → Apply FIXES → Apply DELETIONS →\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is.",
|
|
32829
|
+
oneOf: [ {
|
|
32830
|
+
type: "null"
|
|
32831
|
+
}, {
|
|
32832
|
+
type: "string"
|
|
32833
|
+
} ]
|
|
32834
|
+
}
|
|
32313
32835
|
},
|
|
32314
|
-
|
|
32315
|
-
|
|
32316
|
-
nullable: true,
|
|
32317
|
-
description: "Step 5: Final production-ready test code.\n\nAI produces the final, polished version of the test code incorporating\nall review feedback. This code represents the completed test\nimplementation, ready for production deployment. When the draft code is\nalready perfect with no issues found during review, this value can be\nnull, indicating no revisions were necessary.\n\n**🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**\n\n- FIX all correctable issues identified in review\n- DELETE all prohibited code identified in review\n- If review found type error tests, they MUST be deleted in final\n- If review found code to DELETE, final MUST be different from draft\n- If review finds NO issues requiring changes, set to null\n\nAll identified issues must be resolved, and the code must meet the\nhighest quality standards. A null value indicates the draft code already\nmeets all requirements without modification.\n\nWorkflow: Review feedback → Apply FIXES → Apply DELETIONS →\nProduction-ready implementation (or null if no changes needed)\n\nThis is the ultimate deliverable that will be used in the actual test\nsuite when provided, otherwise the draft is used as-is."
|
|
32318
|
-
}
|
|
32319
|
-
},
|
|
32320
|
-
required: [ "review", "final" ],
|
|
32321
|
-
description: "Steps 4-5: Code review and final refinement process.\n\nContains the iterative improvement workflow that transforms the initial\ndraft into production-ready test code. The review phase identifies issues\nto fix or code to delete, followed by the final phase that produces the\npolished, production-ready test implementation.\n\nWorkflow: Draft → Review analysis → Final implementation\n\n------------------------------\n\nCurrent Type: {@link IAutoBeTestWriteApplication.IReviseProps}",
|
|
32322
|
-
additionalProperties: false
|
|
32836
|
+
required: [ "review", "final" ]
|
|
32837
|
+
}
|
|
32323
32838
|
}
|
|
32324
32839
|
},
|
|
32325
|
-
|
|
32326
|
-
|
|
32327
|
-
|
|
32328
|
-
|
|
32329
|
-
|
|
32330
|
-
|
|
32331
|
-
|
|
32332
|
-
|
|
32333
|
-
|
|
32334
|
-
|
|
32335
|
-
|
|
32336
|
-
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32343
|
-
|
|
32344
|
-
|
|
32345
|
-
|
|
32346
|
-
|
|
32347
|
-
|
|
32348
|
-
|
|
32349
|
-
|
|
32350
|
-
|
|
32351
|
-
|
|
32352
|
-
|
|
32353
|
-
|
|
32354
|
-
|
|
32355
|
-
|
|
32356
|
-
|
|
32357
|
-
|
|
32358
|
-
|
|
32359
|
-
|
|
32360
|
-
|
|
32361
|
-
|
|
32362
|
-
|
|
32363
|
-
|
|
32364
|
-
|
|
32365
|
-
|
|
32366
|
-
|
|
32367
|
-
|
|
32368
|
-
|
|
32369
|
-
|
|
32370
|
-
|
|
32371
|
-
|
|
32372
|
-
|
|
32373
|
-
|
|
32374
|
-
|
|
32375
|
-
|
|
32376
|
-
|
|
32377
|
-
|
|
32378
|
-
|
|
32379
|
-
|
|
32380
|
-
|
|
32381
|
-
|
|
32382
|
-
|
|
32383
|
-
|
|
32384
|
-
|
|
32385
|
-
|
|
32840
|
+
description: "Main entry point for AI Function Call - generates complete E2E test code.\n\nThe AI executes this function to perform the entire test generation\nworkflow: scenario analysis → draft implementation → code review → final\ncode production. This structured approach ensures high-quality,\ncompilation-error-free test code.",
|
|
32841
|
+
validate: (() => {
|
|
32842
|
+
const _io0 = input => "string" === typeof input.scenario && "string" === typeof input.domain && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io1(input.revise));
|
|
32843
|
+
const _io1 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final);
|
|
32844
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.scenario || _report(_exceptionable, {
|
|
32845
|
+
path: _path + ".scenario",
|
|
32846
|
+
expected: "string",
|
|
32847
|
+
value: input.scenario
|
|
32848
|
+
}), "string" === typeof input.domain || _report(_exceptionable, {
|
|
32849
|
+
path: _path + ".domain",
|
|
32850
|
+
expected: "string",
|
|
32851
|
+
value: input.domain
|
|
32852
|
+
}), "string" === typeof input.draft || _report(_exceptionable, {
|
|
32853
|
+
path: _path + ".draft",
|
|
32854
|
+
expected: "string",
|
|
32855
|
+
value: input.draft
|
|
32856
|
+
}), ("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
32857
|
+
path: _path + ".revise",
|
|
32858
|
+
expected: "IAutoBeTestWriteApplication.IReviseProps",
|
|
32859
|
+
value: input.revise
|
|
32860
|
+
})) && _vo1(input.revise, _path + ".revise", _exceptionable) || _report(_exceptionable, {
|
|
32861
|
+
path: _path + ".revise",
|
|
32862
|
+
expected: "IAutoBeTestWriteApplication.IReviseProps",
|
|
32863
|
+
value: input.revise
|
|
32864
|
+
}) ].every(flag => flag);
|
|
32865
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.review || _report(_exceptionable, {
|
|
32866
|
+
path: _path + ".review",
|
|
32867
|
+
expected: "string",
|
|
32868
|
+
value: input.review
|
|
32869
|
+
}), null === input.final || "string" === typeof input.final || _report(_exceptionable, {
|
|
32870
|
+
path: _path + ".final",
|
|
32871
|
+
expected: "(null | string)",
|
|
32872
|
+
value: input.final
|
|
32873
|
+
}) ].every(flag => flag);
|
|
32874
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
32875
|
+
let errors;
|
|
32876
|
+
let _report;
|
|
32877
|
+
return input => {
|
|
32878
|
+
if (false === __is(input)) {
|
|
32879
|
+
errors = [];
|
|
32880
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
32881
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
32882
|
+
path: _path + "",
|
|
32883
|
+
expected: "IAutoBeTestWriteApplication.IProps",
|
|
32884
|
+
value: input
|
|
32885
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
32886
|
+
path: _path + "",
|
|
32887
|
+
expected: "IAutoBeTestWriteApplication.IProps",
|
|
32888
|
+
value: input
|
|
32889
|
+
}))(input, "$input", true);
|
|
32890
|
+
const success = 0 === errors.length;
|
|
32891
|
+
return success ? {
|
|
32892
|
+
success,
|
|
32893
|
+
data: input
|
|
32894
|
+
} : {
|
|
32895
|
+
success,
|
|
32896
|
+
errors,
|
|
32897
|
+
data: input
|
|
32898
|
+
};
|
|
32899
|
+
}
|
|
32900
|
+
return {
|
|
32901
|
+
success: true,
|
|
32386
32902
|
data: input
|
|
32387
32903
|
};
|
|
32388
|
-
}
|
|
32389
|
-
return {
|
|
32390
|
-
success: true,
|
|
32391
|
-
data: input
|
|
32392
32904
|
};
|
|
32393
|
-
}
|
|
32394
|
-
}
|
|
32395
|
-
}
|
|
32396
|
-
|
|
32905
|
+
})()
|
|
32906
|
+
} ]
|
|
32907
|
+
};
|
|
32908
|
+
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, {
|
|
32909
|
+
...{
|
|
32910
|
+
validate: {
|
|
32911
|
+
write: validate
|
|
32912
|
+
}
|
|
32913
|
+
},
|
|
32914
|
+
equals: false
|
|
32915
|
+
});
|
|
32916
|
+
return application;
|
|
32917
|
+
})()
|
|
32397
32918
|
};
|
|
32398
32919
|
|
|
32399
32920
|
const orchestrateTest = ctx => async props => {
|
|
@@ -33361,6 +33882,57 @@ var TimedConversation;
|
|
|
33361
33882
|
};
|
|
33362
33883
|
})(TimedConversation || (TimedConversation = {}));
|
|
33363
33884
|
|
|
33885
|
+
const supportMistral = (agent, vendor) => {
|
|
33886
|
+
if (vendor.model.includes("mistral") || vendor.model.includes("devstral") || vendor.model.includes("codestral")) {
|
|
33887
|
+
agent.on("request", async e => {
|
|
33888
|
+
const newMessages = [];
|
|
33889
|
+
for (const m of e.body.messages) {
|
|
33890
|
+
newMessages.push(m);
|
|
33891
|
+
if (m.role === "tool") {
|
|
33892
|
+
m.tool_call_id = uuidToShortId(m.tool_call_id);
|
|
33893
|
+
newMessages.push({
|
|
33894
|
+
role: "assistant",
|
|
33895
|
+
content: "A tool has been called."
|
|
33896
|
+
});
|
|
33897
|
+
} else if (m.role === "assistant") {
|
|
33898
|
+
for (const call of m.tool_calls ?? []) call.id = uuidToShortId(call.id);
|
|
33899
|
+
}
|
|
33900
|
+
}
|
|
33901
|
+
e.body.messages = newMessages;
|
|
33902
|
+
});
|
|
33903
|
+
}
|
|
33904
|
+
};
|
|
33905
|
+
|
|
33906
|
+
const BASE62_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
33907
|
+
|
|
33908
|
+
function simpleHash(str) {
|
|
33909
|
+
let h1 = 3735928559;
|
|
33910
|
+
let h2 = 1103547991;
|
|
33911
|
+
for (let i = 0; i < str.length; i++) {
|
|
33912
|
+
const ch = str.charCodeAt(i);
|
|
33913
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
33914
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
33915
|
+
}
|
|
33916
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
33917
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
33918
|
+
return 4294967296 * (2097151 & h2) + (h1 >>> 0);
|
|
33919
|
+
}
|
|
33920
|
+
|
|
33921
|
+
function toBase62(num, length) {
|
|
33922
|
+
let result = "";
|
|
33923
|
+
let n = num;
|
|
33924
|
+
while (n > 0 && result.length < length) {
|
|
33925
|
+
result = BASE62_CHARS[n % 62] + result;
|
|
33926
|
+
n = Math.floor(n / 62);
|
|
33927
|
+
}
|
|
33928
|
+
return result.padStart(length, "0");
|
|
33929
|
+
}
|
|
33930
|
+
|
|
33931
|
+
function uuidToShortId(uuid) {
|
|
33932
|
+
const hash = simpleHash(uuid);
|
|
33933
|
+
return toBase62(hash, 9);
|
|
33934
|
+
}
|
|
33935
|
+
|
|
33364
33936
|
const consentFunctionCall = async props => {
|
|
33365
33937
|
const pointer = {
|
|
33366
33938
|
value: null
|
|
@@ -33485,6 +34057,7 @@ const consentFunctionCall = async props => {
|
|
|
33485
34057
|
};
|
|
33486
34058
|
})() ]
|
|
33487
34059
|
});
|
|
34060
|
+
supportMistral(agent, props.vendor);
|
|
33488
34061
|
const histories = await agent.conversate("Analyze and judge this assistant message please.");
|
|
33489
34062
|
if (pointer.value === null) {
|
|
33490
34063
|
const last = histories[histories.length - 1];
|
|
@@ -33594,6 +34167,7 @@ const createAutoBeContext = props => {
|
|
|
33594
34167
|
histories: next.histories,
|
|
33595
34168
|
controllers: [ next.controller ]
|
|
33596
34169
|
});
|
|
34170
|
+
supportMistral(agent, props.vendor);
|
|
33597
34171
|
agent.on("request", async event => {
|
|
33598
34172
|
if (next.enforceFunctionCall === true && event.body.tools) event.body.tool_choice = "required";
|
|
33599
34173
|
if (event.body.parallel_tool_calls !== undefined) delete event.body.parallel_tool_calls;
|
|
@@ -33964,6 +34538,7 @@ class AutoBeAgent extends AutoBeAgentBase {
|
|
|
33964
34538
|
context: this.context_
|
|
33965
34539
|
}) ]
|
|
33966
34540
|
});
|
|
34541
|
+
supportMistral(this.agentica_, props.vendor);
|
|
33967
34542
|
this.agentica_.getHistories().push(...this.histories_.map(history => createAgenticaHistory({
|
|
33968
34543
|
operations: this.agentica_.getOperations(),
|
|
33969
34544
|
history
|
|
@@ -34201,7 +34776,7 @@ const sleepMap = {
|
|
|
34201
34776
|
interfaceSchemasReview: 400,
|
|
34202
34777
|
interfaceComplement: 2e3,
|
|
34203
34778
|
interfaceComplete: 1e3,
|
|
34204
|
-
interfacePrerequisites:
|
|
34779
|
+
interfacePrerequisites: 400,
|
|
34205
34780
|
testStart: 1e3,
|
|
34206
34781
|
testScenarios: 40,
|
|
34207
34782
|
testScenariosReview: 40,
|