@ymdvsymd/tornado 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/bin/tornado.js +1198 -596
- package/package.json +1 -1
- package/sdk/parallel-runner.mjs +46 -0
- package/sdk/parallel-runner.mts +70 -0
package/bin/tornado.js
CHANGED
|
@@ -669,6 +669,9 @@ _M0DTP36mizchi7tornado5types10AgentEvent5Usage.prototype.$tag = 8;
|
|
|
669
669
|
function _M0TPC13ref3RefGdE(param0) {
|
|
670
670
|
this.val = param0;
|
|
671
671
|
}
|
|
672
|
+
function _M0TPC13ref3RefGbE(param0) {
|
|
673
|
+
this.val = param0;
|
|
674
|
+
}
|
|
672
675
|
function _M0DTP36mizchi7tornado5types11AgentStatus4Idle() {}
|
|
673
676
|
_M0DTP36mizchi7tornado5types11AgentStatus4Idle.prototype.$tag = 0;
|
|
674
677
|
function _M0DTP36mizchi7tornado5types11AgentStatus7Running() {}
|
|
@@ -688,9 +691,6 @@ function _M0TP36mizchi7tornado5types11AgentResult(param0, param1, param2) {
|
|
|
688
691
|
this.status = param1;
|
|
689
692
|
this.error = param2;
|
|
690
693
|
}
|
|
691
|
-
function _M0TPC13ref3RefGbE(param0) {
|
|
692
|
-
this.val = param0;
|
|
693
|
-
}
|
|
694
694
|
function _M0TP36mizchi7tornado5agent12BoxedBackend(param0) {
|
|
695
695
|
this.inner = param0;
|
|
696
696
|
}
|
|
@@ -777,7 +777,7 @@ function _M0TPC13ref3RefGORP36mizchi7tornado5types9AgentKindE(param0) {
|
|
|
777
777
|
function _M0TPC13ref3RefGOiE(param0) {
|
|
778
778
|
this.val = param0;
|
|
779
779
|
}
|
|
780
|
-
function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, param3, param4, param5, param6, param7, param8) {
|
|
780
|
+
function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9) {
|
|
781
781
|
this._0 = param0;
|
|
782
782
|
this._1 = param1;
|
|
783
783
|
this._2 = param2;
|
|
@@ -787,6 +787,7 @@ function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, para
|
|
|
787
787
|
this._6 = param6;
|
|
788
788
|
this._7 = param7;
|
|
789
789
|
this._8 = param8;
|
|
790
|
+
this._9 = param9;
|
|
790
791
|
}
|
|
791
792
|
_M0DTP36mizchi7tornado3cli10CliCommand3Run.prototype.$tag = 0;
|
|
792
793
|
function _M0DTP36mizchi7tornado3cli10CliCommand8Validate(param0) {
|
|
@@ -935,6 +936,13 @@ const _M0FP46mizchi7tornado3cmd3app14js__exec__sync = (command) => {
|
|
|
935
936
|
return '';
|
|
936
937
|
}
|
|
937
938
|
};
|
|
939
|
+
const _M0FP46mizchi7tornado3cmd3app22js__append__file__sync = (path, content) => {
|
|
940
|
+
const fs = require('fs');
|
|
941
|
+
fs.appendFileSync(path, content, 'utf-8');
|
|
942
|
+
};
|
|
943
|
+
const _M0FP46mizchi7tornado3cmd3app18js__get__log__file = () => {
|
|
944
|
+
return globalThis.__tornado_log_file || "";
|
|
945
|
+
};
|
|
938
946
|
const _M0FP46mizchi7tornado3cmd3app18js__now__timestamp = () => {
|
|
939
947
|
const d = new Date();
|
|
940
948
|
const h = String(d.getHours()).padStart(2, '0');
|
|
@@ -1045,6 +1053,9 @@ const _M0FP46mizchi7tornado3cmd3app25js__start__stdin__watcher = () => {
|
|
|
1045
1053
|
watcher.unref();
|
|
1046
1054
|
process.on('exit', () => { try { watcher.kill(); } catch {} });
|
|
1047
1055
|
};
|
|
1056
|
+
const _M0FP46mizchi7tornado3cmd3app18js__set__log__file = (path) => {
|
|
1057
|
+
globalThis.__tornado_log_file = path;
|
|
1058
|
+
};
|
|
1048
1059
|
const _M0FP078mizchi_2fllm_2fanthropic_2fAnthropicProvider_24as_24_40mizchi_2fllm_2eProvider = { method_0: _M0IP36mizchi3llm9anthropic17AnthropicProviderP26mizchi3llm8Provider6stream, method_1: _M0IP36mizchi3llm9anthropic17AnthropicProviderP26mizchi3llm8Provider4name };
|
|
1049
1060
|
const _M0FP088mizchi_2ftornado_2fagent_2fMockBackend_24as_24_40mizchi_2ftornado_2fagent_2eAgentBackend = { method_0: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend3run, method_1: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend4name, method_2: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend16set__session__id, method_3: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend16get__session__id };
|
|
1050
1061
|
const _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger = { method_0: _M0IPB13StringBuilderPB6Logger13write__string, method_1: _M0IP016_24default__implPB6Logger16write__substringGRPB13StringBuilderE, method_2: _M0IPB13StringBuilderPB6Logger11write__view, method_3: _M0IPB13StringBuilderPB6Logger11write__char };
|
|
@@ -1063,68 +1074,68 @@ const _M0FPC17strconv17parse__scientificN8exp__numS241 = $0L;
|
|
|
1063
1074
|
const _M0FPC17strconv13parse__numberN11exp__numberS222 = $0L;
|
|
1064
1075
|
const _M0FPC17strconv12double__info = new _M0TPC17strconv9FloatInfo(52, 11, -1023);
|
|
1065
1076
|
const _M0FPC17strconv6powtab = [1, 3, 6, 9, 13, 16, 19, 23, 26, 29, 33, 36, 39, 43, 46, 49, 53, 56, 59];
|
|
1066
|
-
const
|
|
1067
|
-
const
|
|
1068
|
-
const
|
|
1069
|
-
const
|
|
1070
|
-
const
|
|
1071
|
-
const
|
|
1072
|
-
const
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1075
|
-
const
|
|
1076
|
-
const
|
|
1077
|
-
const
|
|
1078
|
-
const
|
|
1079
|
-
const
|
|
1080
|
-
const
|
|
1081
|
-
const
|
|
1082
|
-
const
|
|
1083
|
-
const
|
|
1084
|
-
const
|
|
1085
|
-
const
|
|
1086
|
-
const
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1089
|
-
const
|
|
1090
|
-
const
|
|
1091
|
-
const
|
|
1092
|
-
const
|
|
1093
|
-
const
|
|
1094
|
-
const
|
|
1095
|
-
const
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1098
|
-
const
|
|
1099
|
-
const
|
|
1100
|
-
const
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1103
|
-
const
|
|
1104
|
-
const
|
|
1105
|
-
const
|
|
1106
|
-
const
|
|
1107
|
-
const
|
|
1108
|
-
const
|
|
1109
|
-
const
|
|
1110
|
-
const
|
|
1111
|
-
const
|
|
1112
|
-
const
|
|
1113
|
-
const
|
|
1114
|
-
const
|
|
1115
|
-
const
|
|
1116
|
-
const
|
|
1117
|
-
const
|
|
1118
|
-
const
|
|
1119
|
-
const
|
|
1120
|
-
const
|
|
1121
|
-
const
|
|
1122
|
-
const
|
|
1123
|
-
const
|
|
1124
|
-
const
|
|
1125
|
-
const
|
|
1126
|
-
const
|
|
1127
|
-
const _M0FPC17strconv19left__shift__cheats = [
|
|
1077
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1349 = { _0: 0, _1: "" };
|
|
1078
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1350 = { _0: 1, _1: "5" };
|
|
1079
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1351 = { _0: 1, _1: "25" };
|
|
1080
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1352 = { _0: 1, _1: "125" };
|
|
1081
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1353 = { _0: 2, _1: "625" };
|
|
1082
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1354 = { _0: 2, _1: "3125" };
|
|
1083
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1355 = { _0: 2, _1: "15625" };
|
|
1084
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1356 = { _0: 3, _1: "78125" };
|
|
1085
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1357 = { _0: 3, _1: "390625" };
|
|
1086
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1358 = { _0: 3, _1: "1953125" };
|
|
1087
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1359 = { _0: 4, _1: "9765625" };
|
|
1088
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1360 = { _0: 4, _1: "48828125" };
|
|
1089
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1361 = { _0: 4, _1: "244140625" };
|
|
1090
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1362 = { _0: 4, _1: "1220703125" };
|
|
1091
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1363 = { _0: 5, _1: "6103515625" };
|
|
1092
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1364 = { _0: 5, _1: "30517578125" };
|
|
1093
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1365 = { _0: 5, _1: "152587890625" };
|
|
1094
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1366 = { _0: 6, _1: "762939453125" };
|
|
1095
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1367 = { _0: 6, _1: "3814697265625" };
|
|
1096
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1368 = { _0: 6, _1: "19073486328125" };
|
|
1097
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1369 = { _0: 7, _1: "95367431640625" };
|
|
1098
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1370 = { _0: 7, _1: "476837158203125" };
|
|
1099
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1371 = { _0: 7, _1: "2384185791015625" };
|
|
1100
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1372 = { _0: 7, _1: "11920928955078125" };
|
|
1101
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1373 = { _0: 8, _1: "59604644775390625" };
|
|
1102
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1374 = { _0: 8, _1: "298023223876953125" };
|
|
1103
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1375 = { _0: 8, _1: "1490116119384765625" };
|
|
1104
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1376 = { _0: 9, _1: "7450580596923828125" };
|
|
1105
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1377 = { _0: 9, _1: "37252902984619140625" };
|
|
1106
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1378 = { _0: 9, _1: "186264514923095703125" };
|
|
1107
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1379 = { _0: 10, _1: "931322574615478515625" };
|
|
1108
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1380 = { _0: 10, _1: "4656612873077392578125" };
|
|
1109
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1381 = { _0: 10, _1: "23283064365386962890625" };
|
|
1110
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1382 = { _0: 10, _1: "116415321826934814453125" };
|
|
1111
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1383 = { _0: 11, _1: "582076609134674072265625" };
|
|
1112
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1384 = { _0: 11, _1: "2910383045673370361328125" };
|
|
1113
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1385 = { _0: 11, _1: "14551915228366851806640625" };
|
|
1114
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1386 = { _0: 12, _1: "72759576141834259033203125" };
|
|
1115
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1387 = { _0: 12, _1: "363797880709171295166015625" };
|
|
1116
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1388 = { _0: 12, _1: "1818989403545856475830078125" };
|
|
1117
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1389 = { _0: 13, _1: "9094947017729282379150390625" };
|
|
1118
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1390 = { _0: 13, _1: "45474735088646411895751953125" };
|
|
1119
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1391 = { _0: 13, _1: "227373675443232059478759765625" };
|
|
1120
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1392 = { _0: 13, _1: "1136868377216160297393798828125" };
|
|
1121
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1393 = { _0: 14, _1: "5684341886080801486968994140625" };
|
|
1122
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1394 = { _0: 14, _1: "28421709430404007434844970703125" };
|
|
1123
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1395 = { _0: 14, _1: "142108547152020037174224853515625" };
|
|
1124
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1396 = { _0: 15, _1: "710542735760100185871124267578125" };
|
|
1125
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1397 = { _0: 15, _1: "3552713678800500929355621337890625" };
|
|
1126
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1398 = { _0: 15, _1: "17763568394002504646778106689453125" };
|
|
1127
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1399 = { _0: 16, _1: "88817841970012523233890533447265625" };
|
|
1128
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1400 = { _0: 16, _1: "444089209850062616169452667236328125" };
|
|
1129
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1401 = { _0: 16, _1: "2220446049250313080847263336181640625" };
|
|
1130
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1402 = { _0: 16, _1: "11102230246251565404236316680908203125" };
|
|
1131
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1403 = { _0: 17, _1: "55511151231257827021181583404541015625" };
|
|
1132
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1404 = { _0: 17, _1: "277555756156289135105907917022705078125" };
|
|
1133
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1405 = { _0: 17, _1: "1387778780781445675529539585113525390625" };
|
|
1134
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1406 = { _0: 18, _1: "6938893903907228377647697925567626953125" };
|
|
1135
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1407 = { _0: 18, _1: "34694469519536141888238489627838134765625" };
|
|
1136
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1408 = { _0: 18, _1: "173472347597680709441192448139190673828125" };
|
|
1137
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1409 = { _0: 19, _1: "867361737988403547205962240695953369140625" };
|
|
1138
|
+
const _M0FPC17strconv19left__shift__cheats = [_M0FPC17strconv34left__shift__cheats_2etuple_2f1349, _M0FPC17strconv34left__shift__cheats_2etuple_2f1350, _M0FPC17strconv34left__shift__cheats_2etuple_2f1351, _M0FPC17strconv34left__shift__cheats_2etuple_2f1352, _M0FPC17strconv34left__shift__cheats_2etuple_2f1353, _M0FPC17strconv34left__shift__cheats_2etuple_2f1354, _M0FPC17strconv34left__shift__cheats_2etuple_2f1355, _M0FPC17strconv34left__shift__cheats_2etuple_2f1356, _M0FPC17strconv34left__shift__cheats_2etuple_2f1357, _M0FPC17strconv34left__shift__cheats_2etuple_2f1358, _M0FPC17strconv34left__shift__cheats_2etuple_2f1359, _M0FPC17strconv34left__shift__cheats_2etuple_2f1360, _M0FPC17strconv34left__shift__cheats_2etuple_2f1361, _M0FPC17strconv34left__shift__cheats_2etuple_2f1362, _M0FPC17strconv34left__shift__cheats_2etuple_2f1363, _M0FPC17strconv34left__shift__cheats_2etuple_2f1364, _M0FPC17strconv34left__shift__cheats_2etuple_2f1365, _M0FPC17strconv34left__shift__cheats_2etuple_2f1366, _M0FPC17strconv34left__shift__cheats_2etuple_2f1367, _M0FPC17strconv34left__shift__cheats_2etuple_2f1368, _M0FPC17strconv34left__shift__cheats_2etuple_2f1369, _M0FPC17strconv34left__shift__cheats_2etuple_2f1370, _M0FPC17strconv34left__shift__cheats_2etuple_2f1371, _M0FPC17strconv34left__shift__cheats_2etuple_2f1372, _M0FPC17strconv34left__shift__cheats_2etuple_2f1373, _M0FPC17strconv34left__shift__cheats_2etuple_2f1374, _M0FPC17strconv34left__shift__cheats_2etuple_2f1375, _M0FPC17strconv34left__shift__cheats_2etuple_2f1376, _M0FPC17strconv34left__shift__cheats_2etuple_2f1377, _M0FPC17strconv34left__shift__cheats_2etuple_2f1378, _M0FPC17strconv34left__shift__cheats_2etuple_2f1379, _M0FPC17strconv34left__shift__cheats_2etuple_2f1380, _M0FPC17strconv34left__shift__cheats_2etuple_2f1381, _M0FPC17strconv34left__shift__cheats_2etuple_2f1382, _M0FPC17strconv34left__shift__cheats_2etuple_2f1383, _M0FPC17strconv34left__shift__cheats_2etuple_2f1384, _M0FPC17strconv34left__shift__cheats_2etuple_2f1385, _M0FPC17strconv34left__shift__cheats_2etuple_2f1386, _M0FPC17strconv34left__shift__cheats_2etuple_2f1387, _M0FPC17strconv34left__shift__cheats_2etuple_2f1388, _M0FPC17strconv34left__shift__cheats_2etuple_2f1389, _M0FPC17strconv34left__shift__cheats_2etuple_2f1390, _M0FPC17strconv34left__shift__cheats_2etuple_2f1391, _M0FPC17strconv34left__shift__cheats_2etuple_2f1392, _M0FPC17strconv34left__shift__cheats_2etuple_2f1393, _M0FPC17strconv34left__shift__cheats_2etuple_2f1394, _M0FPC17strconv34left__shift__cheats_2etuple_2f1395, _M0FPC17strconv34left__shift__cheats_2etuple_2f1396, _M0FPC17strconv34left__shift__cheats_2etuple_2f1397, _M0FPC17strconv34left__shift__cheats_2etuple_2f1398, _M0FPC17strconv34left__shift__cheats_2etuple_2f1399, _M0FPC17strconv34left__shift__cheats_2etuple_2f1400, _M0FPC17strconv34left__shift__cheats_2etuple_2f1401, _M0FPC17strconv34left__shift__cheats_2etuple_2f1402, _M0FPC17strconv34left__shift__cheats_2etuple_2f1403, _M0FPC17strconv34left__shift__cheats_2etuple_2f1404, _M0FPC17strconv34left__shift__cheats_2etuple_2f1405, _M0FPC17strconv34left__shift__cheats_2etuple_2f1406, _M0FPC17strconv34left__shift__cheats_2etuple_2f1407, _M0FPC17strconv34left__shift__cheats_2etuple_2f1408, _M0FPC17strconv34left__shift__cheats_2etuple_2f1409];
|
|
1128
1139
|
const _M0FPC17strconv10int__pow10 = [$1L, $10L, $100L, $1000L, $10000L, $100000L, $1000000L, $10000000L, $100000000L, $1000000000L, $10000000000L, $100000000000L, $1000000000000L, $10000000000000L, $100000000000000L, $1000000000000000L];
|
|
1129
1140
|
const _M0FPC17strconv25max__exponent__fast__path = $22L;
|
|
1130
1141
|
const _M0FPC17strconv5table = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 1e+21, 1e+22, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
@@ -1137,14 +1148,14 @@ const _M0FP26mizchi3llm25default__anthropic__model = "claude-sonnet-4-20250514";
|
|
|
1137
1148
|
const _M0FP36mizchi7tornado6config19valid__agent__kinds = ["claude-code", "codex", "api", "mock"];
|
|
1138
1149
|
const _M0FP36mizchi7tornado6config19valid__agent__roles = ["dev", "builder", "review", "orchestrator", "planner", "verifier"];
|
|
1139
1150
|
const _M0FP46mizchi7tornado3cmd3app13session__file = ".tornado/session.json";
|
|
1140
|
-
const
|
|
1141
|
-
const
|
|
1151
|
+
const _M0FPB33brute__force__find_2econstr_2f426 = 0;
|
|
1152
|
+
const _M0FPB43boyer__moore__horspool__find_2econstr_2f412 = 0;
|
|
1142
1153
|
const _M0FPB4seed = _M0FPB12random__seed();
|
|
1143
1154
|
const _M0FPC16double13neg__infinity = _M0MPC15int645Int6423reinterpret__as__double($_4503599627370496L);
|
|
1144
1155
|
const _M0FPC16double14not__a__number = _M0MPC15int645Int6423reinterpret__as__double($9221120237041090561L);
|
|
1145
1156
|
const _M0FPC16double8infinity = _M0MPC15int645Int6423reinterpret__as__double($9218868437227405312L);
|
|
1146
1157
|
const _M0FPC17strconv25max__mantissa__fast__path = _M0IPC16uint646UInt64PB3Shl3shl($2L, 52);
|
|
1147
|
-
const
|
|
1158
|
+
const _M0FPC17strconv28checked__mul_2econstr_2f1826 = $0L;
|
|
1148
1159
|
function _M0FPC15abort5abortGRPC16string10StringViewE(msg) {
|
|
1149
1160
|
return $panic();
|
|
1150
1161
|
}
|
|
@@ -1246,6 +1257,24 @@ function _M0MPC15array5Array2atGcE(self, index) {
|
|
|
1246
1257
|
return $panic();
|
|
1247
1258
|
}
|
|
1248
1259
|
}
|
|
1260
|
+
function _M0MPC15array5Array2atGRP36mizchi7tornado6review17ReviewPerspectiveE(self, index) {
|
|
1261
|
+
const len = self.length;
|
|
1262
|
+
if (index >= 0 && index < len) {
|
|
1263
|
+
$bound_check(self, index);
|
|
1264
|
+
return self[index];
|
|
1265
|
+
} else {
|
|
1266
|
+
return $panic();
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
function _M0MPC15array5Array2atGRP36mizchi7tornado5ralph19VerifierPerspectiveE(self, index) {
|
|
1270
|
+
const len = self.length;
|
|
1271
|
+
if (index >= 0 && index < len) {
|
|
1272
|
+
$bound_check(self, index);
|
|
1273
|
+
return self[index];
|
|
1274
|
+
} else {
|
|
1275
|
+
return $panic();
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1249
1278
|
function _M0MPB13SourceLocRepr5parse(repr) {
|
|
1250
1279
|
const _bind = new _M0TPC16string10StringView(repr, 0, repr.length);
|
|
1251
1280
|
const _data = _M0MPC16string10StringView4data(_bind);
|
|
@@ -1839,6 +1868,11 @@ function _M0IP016_24default__implPB4Show10to__stringGRPB9SourceLocE(self) {
|
|
|
1839
1868
|
_M0IPB9SourceLocPB4Show6output(self, { self: logger, method_table: _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1840
1869
|
return _M0MPB13StringBuilder10to__string(logger);
|
|
1841
1870
|
}
|
|
1871
|
+
function _M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(self) {
|
|
1872
|
+
const logger = _M0MPB13StringBuilder11new_2einner(0);
|
|
1873
|
+
_M0IP36mizchi7tornado5ralph19VerifierPerspectivePB4Show6output(self, { self: logger, method_table: _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1874
|
+
return _M0MPB13StringBuilder10to__string(logger);
|
|
1875
|
+
}
|
|
1842
1876
|
function _M0MPB4Iter4nextGUssEE(self) {
|
|
1843
1877
|
const _func = self;
|
|
1844
1878
|
return _func();
|
|
@@ -2326,7 +2360,7 @@ function _M0FPB28boyer__moore__horspool__find(haystack, needle) {
|
|
|
2326
2360
|
return undefined;
|
|
2327
2361
|
}
|
|
2328
2362
|
} else {
|
|
2329
|
-
return
|
|
2363
|
+
return _M0FPB43boyer__moore__horspool__find_2econstr_2f412;
|
|
2330
2364
|
}
|
|
2331
2365
|
}
|
|
2332
2366
|
function _M0FPB18brute__force__find(haystack, needle) {
|
|
@@ -2373,7 +2407,7 @@ function _M0FPB18brute__force__find(haystack, needle) {
|
|
|
2373
2407
|
return undefined;
|
|
2374
2408
|
}
|
|
2375
2409
|
} else {
|
|
2376
|
-
return
|
|
2410
|
+
return _M0FPB33brute__force__find_2econstr_2f426;
|
|
2377
2411
|
}
|
|
2378
2412
|
}
|
|
2379
2413
|
function _M0MPC16string10StringView4find(self, str) {
|
|
@@ -6684,7 +6718,7 @@ function _M0MPC17strconv7Decimal16to__double__priv(self) {
|
|
|
6684
6718
|
}
|
|
6685
6719
|
function _M0FPC17strconv12checked__mul(a, b) {
|
|
6686
6720
|
if (_M0IPC16uint646UInt64PB2Eq5equal(a, $0L) || _M0IPC16uint646UInt64PB2Eq5equal(b, $0L)) {
|
|
6687
|
-
return
|
|
6721
|
+
return _M0FPC17strconv28checked__mul_2econstr_2f1826;
|
|
6688
6722
|
}
|
|
6689
6723
|
if (_M0IPC16uint646UInt64PB2Eq5equal(a, $1L)) {
|
|
6690
6724
|
return b;
|
|
@@ -9564,6 +9598,149 @@ function _M0FP36mizchi7tornado5agent25parse__sdk__result__event(map, on_output)
|
|
|
9564
9598
|
return;
|
|
9565
9599
|
}
|
|
9566
9600
|
}
|
|
9601
|
+
function _M0MP36mizchi7tornado5agent16OutputLineBuffer4push(self, chunk, on_line) {
|
|
9602
|
+
_M0IPB13StringBuilderPB6Logger13write__string(self.buf, chunk);
|
|
9603
|
+
const content = _M0MPB13StringBuilder10to__string(self.buf);
|
|
9604
|
+
const last_nl = new _M0TPC13ref3RefGiE(-1);
|
|
9605
|
+
const _bind = 0;
|
|
9606
|
+
const _bind$2 = content.length;
|
|
9607
|
+
let _tmp = _bind;
|
|
9608
|
+
while (true) {
|
|
9609
|
+
const i = _tmp;
|
|
9610
|
+
if (i < _bind$2) {
|
|
9611
|
+
$bound_check(content, i);
|
|
9612
|
+
if (_M0IPC16uint166UInt16PB2Eq5equal(content.charCodeAt(i), 10 & 65535)) {
|
|
9613
|
+
last_nl.val = i;
|
|
9614
|
+
}
|
|
9615
|
+
_tmp = i + 1 | 0;
|
|
9616
|
+
continue;
|
|
9617
|
+
} else {
|
|
9618
|
+
break;
|
|
9619
|
+
}
|
|
9620
|
+
}
|
|
9621
|
+
if (last_nl.val < 0) {
|
|
9622
|
+
return undefined;
|
|
9623
|
+
}
|
|
9624
|
+
const complete = content.substring(0, last_nl.val);
|
|
9625
|
+
const remainder = (last_nl.val + 1 | 0) < content.length ? content.substring(last_nl.val + 1 | 0, content.length) : "";
|
|
9626
|
+
_M0MPB13StringBuilder5reset(self.buf);
|
|
9627
|
+
_M0IPB13StringBuilderPB6Logger13write__string(self.buf, remainder);
|
|
9628
|
+
const _bind$3 = "\n";
|
|
9629
|
+
const _it = _M0MPC16string6String5split(complete, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length));
|
|
9630
|
+
while (true) {
|
|
9631
|
+
let line;
|
|
9632
|
+
_L: {
|
|
9633
|
+
const _bind$4 = _M0MPB4Iter4nextGUssEE(_it);
|
|
9634
|
+
if (_bind$4 === undefined) {
|
|
9635
|
+
return;
|
|
9636
|
+
} else {
|
|
9637
|
+
const _Some = _bind$4;
|
|
9638
|
+
const _line = _Some;
|
|
9639
|
+
line = _line;
|
|
9640
|
+
break _L;
|
|
9641
|
+
}
|
|
9642
|
+
}
|
|
9643
|
+
const s = _M0IPC16string10StringViewPB4Show10to__string(line);
|
|
9644
|
+
let stripped;
|
|
9645
|
+
const _bind$4 = "\r";
|
|
9646
|
+
if (_M0MPC16string6String11has__suffix(s, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length))) {
|
|
9647
|
+
stripped = s.substring(0, s.length - 1 | 0);
|
|
9648
|
+
} else {
|
|
9649
|
+
stripped = s;
|
|
9650
|
+
}
|
|
9651
|
+
on_line(stripped);
|
|
9652
|
+
continue;
|
|
9653
|
+
}
|
|
9654
|
+
}
|
|
9655
|
+
function _M0FP36mizchi7tornado5agent25parse__sdk__stream__event(event, buf, line_buf, on_output) {
|
|
9656
|
+
let event_type;
|
|
9657
|
+
_L: {
|
|
9658
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(event, "type");
|
|
9659
|
+
if (_bind === undefined) {
|
|
9660
|
+
return;
|
|
9661
|
+
} else {
|
|
9662
|
+
const _Some = _bind;
|
|
9663
|
+
const _x = _Some;
|
|
9664
|
+
if (_x.$tag === 4) {
|
|
9665
|
+
const _String = _x;
|
|
9666
|
+
const _event_type = _String._0;
|
|
9667
|
+
event_type = _event_type;
|
|
9668
|
+
break _L;
|
|
9669
|
+
} else {
|
|
9670
|
+
return;
|
|
9671
|
+
}
|
|
9672
|
+
}
|
|
9673
|
+
}
|
|
9674
|
+
switch (event_type) {
|
|
9675
|
+
case "content_block_start": {
|
|
9676
|
+
_M0FP36mizchi7tornado5agent28parse__content__block__start(event, on_output);
|
|
9677
|
+
return;
|
|
9678
|
+
}
|
|
9679
|
+
case "content_block_delta": {
|
|
9680
|
+
let delta;
|
|
9681
|
+
_L$2: {
|
|
9682
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(event, "delta");
|
|
9683
|
+
if (_bind === undefined) {
|
|
9684
|
+
return;
|
|
9685
|
+
} else {
|
|
9686
|
+
const _Some = _bind;
|
|
9687
|
+
const _x = _Some;
|
|
9688
|
+
if (_x.$tag === 6) {
|
|
9689
|
+
const _Object = _x;
|
|
9690
|
+
const _delta = _Object._0;
|
|
9691
|
+
delta = _delta;
|
|
9692
|
+
break _L$2;
|
|
9693
|
+
} else {
|
|
9694
|
+
return;
|
|
9695
|
+
}
|
|
9696
|
+
}
|
|
9697
|
+
}
|
|
9698
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(delta, "type");
|
|
9699
|
+
if (_bind === undefined) {
|
|
9700
|
+
return;
|
|
9701
|
+
} else {
|
|
9702
|
+
const _Some = _bind;
|
|
9703
|
+
const _x = _Some;
|
|
9704
|
+
if (_x.$tag === 4) {
|
|
9705
|
+
const _String = _x;
|
|
9706
|
+
const _x$2 = _String._0;
|
|
9707
|
+
if (_x$2 === "text_delta") {
|
|
9708
|
+
let text;
|
|
9709
|
+
_L$3: {
|
|
9710
|
+
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(delta, "text");
|
|
9711
|
+
if (_bind$2 === undefined) {
|
|
9712
|
+
return;
|
|
9713
|
+
} else {
|
|
9714
|
+
const _Some$2 = _bind$2;
|
|
9715
|
+
const _x$3 = _Some$2;
|
|
9716
|
+
if (_x$3.$tag === 4) {
|
|
9717
|
+
const _String$2 = _x$3;
|
|
9718
|
+
const _text = _String$2._0;
|
|
9719
|
+
text = _text;
|
|
9720
|
+
break _L$3;
|
|
9721
|
+
} else {
|
|
9722
|
+
return;
|
|
9723
|
+
}
|
|
9724
|
+
}
|
|
9725
|
+
}
|
|
9726
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, text);
|
|
9727
|
+
_M0MP36mizchi7tornado5agent16OutputLineBuffer4push(line_buf, text, (line) => {
|
|
9728
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent10OutputLine(line));
|
|
9729
|
+
});
|
|
9730
|
+
return;
|
|
9731
|
+
} else {
|
|
9732
|
+
return;
|
|
9733
|
+
}
|
|
9734
|
+
} else {
|
|
9735
|
+
return;
|
|
9736
|
+
}
|
|
9737
|
+
}
|
|
9738
|
+
}
|
|
9739
|
+
default: {
|
|
9740
|
+
return;
|
|
9741
|
+
}
|
|
9742
|
+
}
|
|
9743
|
+
}
|
|
9567
9744
|
function _M0FP36mizchi7tornado5agent20parse__system__event(map, on_output) {
|
|
9568
9745
|
let subtype;
|
|
9569
9746
|
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "subtype");
|
|
@@ -9866,150 +10043,121 @@ function _M0FP36mizchi7tornado5agent19parse__tool__result(map, on_output) {
|
|
|
9866
10043
|
return;
|
|
9867
10044
|
}
|
|
9868
10045
|
}
|
|
9869
|
-
function
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
let _tmp = _bind;
|
|
9876
|
-
while (true) {
|
|
9877
|
-
const i = _tmp;
|
|
9878
|
-
if (i < _bind$2) {
|
|
9879
|
-
$bound_check(content, i);
|
|
9880
|
-
if (_M0IPC16uint166UInt16PB2Eq5equal(content.charCodeAt(i), 10 & 65535)) {
|
|
9881
|
-
last_nl.val = i;
|
|
9882
|
-
}
|
|
9883
|
-
_tmp = i + 1 | 0;
|
|
9884
|
-
continue;
|
|
9885
|
-
} else {
|
|
9886
|
-
break;
|
|
9887
|
-
}
|
|
9888
|
-
}
|
|
9889
|
-
if (last_nl.val < 0) {
|
|
9890
|
-
return undefined;
|
|
9891
|
-
}
|
|
9892
|
-
const complete = content.substring(0, last_nl.val);
|
|
9893
|
-
const remainder = (last_nl.val + 1 | 0) < content.length ? content.substring(last_nl.val + 1 | 0, content.length) : "";
|
|
9894
|
-
_M0MPB13StringBuilder5reset(self.buf);
|
|
9895
|
-
_M0IPB13StringBuilderPB6Logger13write__string(self.buf, remainder);
|
|
9896
|
-
const _bind$3 = "\n";
|
|
9897
|
-
const _it = _M0MPC16string6String5split(complete, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length));
|
|
9898
|
-
while (true) {
|
|
9899
|
-
let line;
|
|
9900
|
-
_L: {
|
|
9901
|
-
const _bind$4 = _M0MPB4Iter4nextGUssEE(_it);
|
|
9902
|
-
if (_bind$4 === undefined) {
|
|
9903
|
-
return;
|
|
10046
|
+
function _M0FP36mizchi7tornado5agent23parse__sdk__event__json(map, buf, line_buf, error_buf, on_output, on_session_id) {
|
|
10047
|
+
let sid;
|
|
10048
|
+
_L: {
|
|
10049
|
+
_L$2: {
|
|
10050
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "session_id");
|
|
10051
|
+
if (_bind === undefined) {
|
|
9904
10052
|
} else {
|
|
9905
|
-
const _Some = _bind
|
|
9906
|
-
const
|
|
9907
|
-
|
|
9908
|
-
|
|
10053
|
+
const _Some = _bind;
|
|
10054
|
+
const _x = _Some;
|
|
10055
|
+
if (_x.$tag === 4) {
|
|
10056
|
+
const _String = _x;
|
|
10057
|
+
const _sid = _String._0;
|
|
10058
|
+
sid = _sid;
|
|
10059
|
+
break _L$2;
|
|
10060
|
+
}
|
|
9909
10061
|
}
|
|
10062
|
+
break _L;
|
|
9910
10063
|
}
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
const _bind$4 = "\r";
|
|
9914
|
-
if (_M0MPC16string6String11has__suffix(s, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length))) {
|
|
9915
|
-
stripped = s.substring(0, s.length - 1 | 0);
|
|
9916
|
-
} else {
|
|
9917
|
-
stripped = s;
|
|
10064
|
+
if (!_M0MPC16string6String9is__empty(sid)) {
|
|
10065
|
+
on_session_id(sid);
|
|
9918
10066
|
}
|
|
9919
|
-
on_line(stripped);
|
|
9920
|
-
continue;
|
|
9921
10067
|
}
|
|
9922
|
-
}
|
|
9923
|
-
function _M0MP36mizchi7tornado5agent17SubprocessBackend20parse__stream__event(_self, event, buf, line_buf, on_output) {
|
|
9924
10068
|
let event_type;
|
|
9925
|
-
_L: {
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
} else {
|
|
9930
|
-
const _Some = _bind;
|
|
9931
|
-
const _x = _Some;
|
|
9932
|
-
if (_x.$tag === 4) {
|
|
9933
|
-
const _String = _x;
|
|
9934
|
-
const _event_type = _String._0;
|
|
9935
|
-
event_type = _event_type;
|
|
9936
|
-
break _L;
|
|
10069
|
+
_L$2: {
|
|
10070
|
+
_L$3: {
|
|
10071
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "type");
|
|
10072
|
+
if (_bind === undefined) {
|
|
9937
10073
|
} else {
|
|
9938
|
-
|
|
10074
|
+
const _Some = _bind;
|
|
10075
|
+
const _x = _Some;
|
|
10076
|
+
if (_x.$tag === 4) {
|
|
10077
|
+
const _String = _x;
|
|
10078
|
+
const _event_type = _String._0;
|
|
10079
|
+
event_type = _event_type;
|
|
10080
|
+
break _L$3;
|
|
10081
|
+
}
|
|
9939
10082
|
}
|
|
10083
|
+
break _L$2;
|
|
9940
10084
|
}
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
10085
|
+
switch (event_type) {
|
|
10086
|
+
case "system": {
|
|
10087
|
+
_M0FP36mizchi7tornado5agent20parse__system__event(map, on_output);
|
|
10088
|
+
break;
|
|
10089
|
+
}
|
|
10090
|
+
case "assistant": {
|
|
10091
|
+
_M0FP36mizchi7tornado5agent18parse__tool__calls(map, on_output);
|
|
10092
|
+
break;
|
|
10093
|
+
}
|
|
10094
|
+
case "stream_event": {
|
|
10095
|
+
let event;
|
|
10096
|
+
_L$4: {
|
|
10097
|
+
_L$5: {
|
|
10098
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "event");
|
|
10099
|
+
if (_bind === undefined) {
|
|
10100
|
+
} else {
|
|
10101
|
+
const _Some = _bind;
|
|
10102
|
+
const _x = _Some;
|
|
10103
|
+
if (_x.$tag === 6) {
|
|
10104
|
+
const _Object = _x;
|
|
10105
|
+
const _event = _Object._0;
|
|
10106
|
+
event = _event;
|
|
10107
|
+
break _L$5;
|
|
10108
|
+
}
|
|
10109
|
+
}
|
|
10110
|
+
break _L$4;
|
|
10111
|
+
}
|
|
10112
|
+
_M0FP36mizchi7tornado5agent25parse__sdk__stream__event(event, buf, line_buf, on_output);
|
|
10113
|
+
}
|
|
10114
|
+
break;
|
|
10115
|
+
}
|
|
10116
|
+
case "tool_result": {
|
|
10117
|
+
_M0FP36mizchi7tornado5agent19parse__tool__result(map, on_output);
|
|
10118
|
+
break;
|
|
10119
|
+
}
|
|
10120
|
+
case "content_block_start": {
|
|
10121
|
+
_M0FP36mizchi7tornado5agent28parse__content__block__start(map, on_output);
|
|
10122
|
+
break;
|
|
10123
|
+
}
|
|
10124
|
+
case "result": {
|
|
10125
|
+
_M0FP36mizchi7tornado5agent25parse__sdk__result__event(map, on_output);
|
|
10126
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "is_error");
|
|
9951
10127
|
if (_bind === undefined) {
|
|
9952
|
-
return;
|
|
9953
10128
|
} else {
|
|
9954
10129
|
const _Some = _bind;
|
|
9955
10130
|
const _x = _Some;
|
|
9956
|
-
if (_x.$tag ===
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
return;
|
|
9963
|
-
}
|
|
9964
|
-
}
|
|
9965
|
-
}
|
|
9966
|
-
const _bind = _M0MPB3Map3getGsRPB4JsonE(delta, "type");
|
|
9967
|
-
if (_bind === undefined) {
|
|
9968
|
-
return;
|
|
9969
|
-
} else {
|
|
9970
|
-
const _Some = _bind;
|
|
9971
|
-
const _x = _Some;
|
|
9972
|
-
if (_x.$tag === 4) {
|
|
9973
|
-
const _String = _x;
|
|
9974
|
-
const _x$2 = _String._0;
|
|
9975
|
-
if (_x$2 === "text_delta") {
|
|
9976
|
-
let text;
|
|
9977
|
-
_L$3: {
|
|
9978
|
-
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(delta, "text");
|
|
9979
|
-
if (_bind$2 === undefined) {
|
|
9980
|
-
return;
|
|
9981
|
-
} else {
|
|
9982
|
-
const _Some$2 = _bind$2;
|
|
9983
|
-
const _x$3 = _Some$2;
|
|
9984
|
-
if (_x$3.$tag === 4) {
|
|
9985
|
-
const _String$2 = _x$3;
|
|
9986
|
-
const _text = _String$2._0;
|
|
9987
|
-
text = _text;
|
|
9988
|
-
break _L$3;
|
|
10131
|
+
if (_x.$tag === 1) {
|
|
10132
|
+
let err_msg;
|
|
10133
|
+
_L$5: {
|
|
10134
|
+
_L$6: {
|
|
10135
|
+
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(map, "result");
|
|
10136
|
+
if (_bind$2 === undefined) {
|
|
9989
10137
|
} else {
|
|
9990
|
-
|
|
10138
|
+
const _Some$2 = _bind$2;
|
|
10139
|
+
const _x$2 = _Some$2;
|
|
10140
|
+
if (_x$2.$tag === 4) {
|
|
10141
|
+
const _String = _x$2;
|
|
10142
|
+
const _err_msg = _String._0;
|
|
10143
|
+
err_msg = _err_msg;
|
|
10144
|
+
break _L$6;
|
|
10145
|
+
}
|
|
9991
10146
|
}
|
|
10147
|
+
break _L$5;
|
|
9992
10148
|
}
|
|
10149
|
+
_M0IPB13StringBuilderPB6Logger13write__string(error_buf, err_msg);
|
|
9993
10150
|
}
|
|
9994
|
-
|
|
9995
|
-
_M0MP36mizchi7tornado5agent16OutputLineBuffer4push(line_buf, text, (line) => {
|
|
9996
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent10OutputLine(line));
|
|
9997
|
-
});
|
|
9998
|
-
return;
|
|
9999
|
-
} else {
|
|
10000
|
-
return;
|
|
10151
|
+
return true;
|
|
10001
10152
|
}
|
|
10002
|
-
} else {
|
|
10003
|
-
return;
|
|
10004
10153
|
}
|
|
10154
|
+
break;
|
|
10005
10155
|
}
|
|
10006
10156
|
}
|
|
10007
|
-
default: {
|
|
10008
|
-
return;
|
|
10009
|
-
}
|
|
10010
10157
|
}
|
|
10158
|
+
return false;
|
|
10011
10159
|
}
|
|
10012
|
-
function
|
|
10160
|
+
function _M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, on_session_id) {
|
|
10013
10161
|
let json;
|
|
10014
10162
|
let _try_err;
|
|
10015
10163
|
_L: {
|
|
@@ -10029,167 +10177,44 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend17parse__sdk__event(self,
|
|
|
10029
10177
|
}
|
|
10030
10178
|
let map;
|
|
10031
10179
|
_L$2: {
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
map = _map;
|
|
10037
|
-
break _L$3;
|
|
10038
|
-
}
|
|
10180
|
+
if (json.$tag === 6) {
|
|
10181
|
+
const _Object = json;
|
|
10182
|
+
const _map = _Object._0;
|
|
10183
|
+
map = _map;
|
|
10039
10184
|
break _L$2;
|
|
10040
|
-
}
|
|
10041
|
-
|
|
10042
|
-
_L$4: {
|
|
10043
|
-
_L$5: {
|
|
10044
|
-
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "session_id");
|
|
10045
|
-
if (_bind === undefined) {
|
|
10046
|
-
} else {
|
|
10047
|
-
const _Some = _bind;
|
|
10048
|
-
const _x = _Some;
|
|
10049
|
-
if (_x.$tag === 4) {
|
|
10050
|
-
const _String = _x;
|
|
10051
|
-
const _sid = _String._0;
|
|
10052
|
-
sid = _sid;
|
|
10053
|
-
break _L$5;
|
|
10054
|
-
}
|
|
10055
|
-
}
|
|
10056
|
-
break _L$4;
|
|
10057
|
-
}
|
|
10058
|
-
if (!_M0MPC16string6String9is__empty(sid) && _M0IP016_24default__implPB2Eq10not__equalGsE(self.session_id, sid)) {
|
|
10059
|
-
self.session_id = sid;
|
|
10060
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent9SessionId(sid));
|
|
10061
|
-
}
|
|
10062
|
-
}
|
|
10063
|
-
let event_type;
|
|
10064
|
-
_L$5: {
|
|
10065
|
-
_L$6: {
|
|
10066
|
-
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "type");
|
|
10067
|
-
if (_bind === undefined) {
|
|
10068
|
-
} else {
|
|
10069
|
-
const _Some = _bind;
|
|
10070
|
-
const _x = _Some;
|
|
10071
|
-
if (_x.$tag === 4) {
|
|
10072
|
-
const _String = _x;
|
|
10073
|
-
const _event_type = _String._0;
|
|
10074
|
-
event_type = _event_type;
|
|
10075
|
-
break _L$6;
|
|
10076
|
-
}
|
|
10077
|
-
}
|
|
10078
|
-
break _L$5;
|
|
10079
|
-
}
|
|
10080
|
-
switch (event_type) {
|
|
10081
|
-
case "system": {
|
|
10082
|
-
_M0FP36mizchi7tornado5agent20parse__system__event(map, on_output);
|
|
10083
|
-
break;
|
|
10084
|
-
}
|
|
10085
|
-
case "assistant": {
|
|
10086
|
-
_M0FP36mizchi7tornado5agent18parse__tool__calls(map, on_output);
|
|
10087
|
-
break;
|
|
10088
|
-
}
|
|
10089
|
-
case "stream_event": {
|
|
10090
|
-
let event;
|
|
10091
|
-
_L$7: {
|
|
10092
|
-
_L$8: {
|
|
10093
|
-
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "event");
|
|
10094
|
-
if (_bind === undefined) {
|
|
10095
|
-
} else {
|
|
10096
|
-
const _Some = _bind;
|
|
10097
|
-
const _x = _Some;
|
|
10098
|
-
if (_x.$tag === 6) {
|
|
10099
|
-
const _Object = _x;
|
|
10100
|
-
const _event = _Object._0;
|
|
10101
|
-
event = _event;
|
|
10102
|
-
break _L$8;
|
|
10103
|
-
}
|
|
10104
|
-
}
|
|
10105
|
-
break _L$7;
|
|
10106
|
-
}
|
|
10107
|
-
_M0MP36mizchi7tornado5agent17SubprocessBackend20parse__stream__event(self, event, buf, line_buf, on_output);
|
|
10108
|
-
}
|
|
10109
|
-
break;
|
|
10110
|
-
}
|
|
10111
|
-
case "tool_result": {
|
|
10112
|
-
_M0FP36mizchi7tornado5agent19parse__tool__result(map, on_output);
|
|
10113
|
-
break;
|
|
10114
|
-
}
|
|
10115
|
-
case "content_block_start": {
|
|
10116
|
-
_M0FP36mizchi7tornado5agent28parse__content__block__start(map, on_output);
|
|
10117
|
-
break;
|
|
10118
|
-
}
|
|
10119
|
-
case "result": {
|
|
10120
|
-
_M0FP36mizchi7tornado5agent25parse__sdk__result__event(map, on_output);
|
|
10121
|
-
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "is_error");
|
|
10122
|
-
if (_bind === undefined) {
|
|
10123
|
-
} else {
|
|
10124
|
-
const _Some = _bind;
|
|
10125
|
-
const _x = _Some;
|
|
10126
|
-
if (_x.$tag === 1) {
|
|
10127
|
-
let err_msg;
|
|
10128
|
-
_L$8: {
|
|
10129
|
-
_L$9: {
|
|
10130
|
-
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(map, "result");
|
|
10131
|
-
if (_bind$2 === undefined) {
|
|
10132
|
-
} else {
|
|
10133
|
-
const _Some$2 = _bind$2;
|
|
10134
|
-
const _x$2 = _Some$2;
|
|
10135
|
-
if (_x$2.$tag === 4) {
|
|
10136
|
-
const _String = _x$2;
|
|
10137
|
-
const _err_msg = _String._0;
|
|
10138
|
-
err_msg = _err_msg;
|
|
10139
|
-
break _L$9;
|
|
10140
|
-
}
|
|
10141
|
-
}
|
|
10142
|
-
break _L$8;
|
|
10143
|
-
}
|
|
10144
|
-
_M0IPB13StringBuilderPB6Logger13write__string(error_buf, err_msg);
|
|
10145
|
-
}
|
|
10146
|
-
return true;
|
|
10147
|
-
}
|
|
10148
|
-
}
|
|
10149
|
-
break;
|
|
10150
|
-
}
|
|
10151
|
-
}
|
|
10185
|
+
} else {
|
|
10186
|
+
return false;
|
|
10152
10187
|
}
|
|
10153
10188
|
}
|
|
10154
|
-
return
|
|
10189
|
+
return _M0FP36mizchi7tornado5agent23parse__sdk__event__json(map, buf, line_buf, error_buf, on_output, on_session_id);
|
|
10155
10190
|
}
|
|
10156
|
-
function
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
}
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
}
|
|
10169
|
-
const opts_json = _M0MPC14json4Json17stringify_2einner(_M0MPC14json4Json6object(opts), false, 0, undefined);
|
|
10170
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent4Info(`Launching: Claude${!_M0MPC16string6String9is__empty(self.session_id) ? ` (resume: ${_M0IPC16string6StringPB4Show10to__string(self.session_id)})` : " (new session)"}`));
|
|
10171
|
-
const raw_output = _M0FP36mizchi7tornado5agent16run__claude__sdk(opts_json);
|
|
10172
|
-
const _bind$2 = "ERROR:";
|
|
10173
|
-
if (_M0MPC16string6String11has__prefix(raw_output, new _M0TPC16string10StringView(_bind$2, 0, _bind$2.length))) {
|
|
10174
|
-
const err = raw_output;
|
|
10175
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10176
|
-
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10177
|
-
}
|
|
10191
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend17parse__sdk__event(self, line, buf, line_buf, error_buf, on_output) {
|
|
10192
|
+
return _M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, (sid) => {
|
|
10193
|
+
if (_M0IP016_24default__implPB2Eq10not__equalGsE(self.session_id, sid)) {
|
|
10194
|
+
self.session_id = sid;
|
|
10195
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent9SessionId(sid));
|
|
10196
|
+
return;
|
|
10197
|
+
} else {
|
|
10198
|
+
return;
|
|
10199
|
+
}
|
|
10200
|
+
});
|
|
10201
|
+
}
|
|
10202
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output) {
|
|
10178
10203
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10179
10204
|
const line_buf = _M0MP36mizchi7tornado5agent16OutputLineBuffer3new();
|
|
10180
10205
|
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10181
10206
|
const error_buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10182
|
-
const _bind
|
|
10183
|
-
const lines = _M0MPC16string6String5split(raw_output, new _M0TPC16string10StringView(_bind
|
|
10207
|
+
const _bind = "\n";
|
|
10208
|
+
const lines = _M0MPC16string6String5split(raw_output, new _M0TPC16string10StringView(_bind, 0, _bind.length));
|
|
10184
10209
|
const _it = lines;
|
|
10185
10210
|
while (true) {
|
|
10186
10211
|
let line_view;
|
|
10187
10212
|
_L: {
|
|
10188
|
-
const _bind$
|
|
10189
|
-
if (_bind$
|
|
10213
|
+
const _bind$2 = _M0MPB4Iter4nextGUssEE(_it);
|
|
10214
|
+
if (_bind$2 === undefined) {
|
|
10190
10215
|
break;
|
|
10191
10216
|
} else {
|
|
10192
|
-
const _Some = _bind$
|
|
10217
|
+
const _Some = _bind$2;
|
|
10193
10218
|
const _line_view = _Some;
|
|
10194
10219
|
line_view = _line_view;
|
|
10195
10220
|
break _L;
|
|
@@ -10217,6 +10242,30 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self,
|
|
|
10217
10242
|
return new _M0TP36mizchi7tornado5types11AgentResult(content, _M0DTP36mizchi7tornado5types11AgentStatus9Completed__, undefined);
|
|
10218
10243
|
}
|
|
10219
10244
|
}
|
|
10245
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output) {
|
|
10246
|
+
const _bind = [];
|
|
10247
|
+
const opts = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind, 0, 0));
|
|
10248
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "prompt", _M0IPC16string6StringPB6ToJson8to__json(task));
|
|
10249
|
+
if (!_M0MPC16string6String9is__empty(system_prompt)) {
|
|
10250
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "systemPrompt", _M0IPC16string6StringPB6ToJson8to__json(system_prompt));
|
|
10251
|
+
}
|
|
10252
|
+
if (!_M0MPC16string6String9is__empty(self.model)) {
|
|
10253
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "model", _M0IPC16string6StringPB6ToJson8to__json(self.model));
|
|
10254
|
+
}
|
|
10255
|
+
if (!_M0MPC16string6String9is__empty(self.session_id)) {
|
|
10256
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "sessionId", _M0IPC16string6StringPB6ToJson8to__json(self.session_id));
|
|
10257
|
+
}
|
|
10258
|
+
const opts_json = _M0MPC14json4Json17stringify_2einner(_M0MPC14json4Json6object(opts), false, 0, undefined);
|
|
10259
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent4Info(`Launching: Claude${!_M0MPC16string6String9is__empty(self.session_id) ? ` (resume: ${_M0IPC16string6StringPB4Show10to__string(self.session_id)})` : " (new session)"}`));
|
|
10260
|
+
const raw_output = _M0FP36mizchi7tornado5agent16run__claude__sdk(opts_json);
|
|
10261
|
+
const _bind$2 = "ERROR:";
|
|
10262
|
+
if (_M0MPC16string6String11has__prefix(raw_output, new _M0TPC16string10StringView(_bind$2, 0, _bind$2.length))) {
|
|
10263
|
+
const err = raw_output;
|
|
10264
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10265
|
+
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10266
|
+
}
|
|
10267
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output);
|
|
10268
|
+
}
|
|
10220
10269
|
function _M0FP36mizchi7tornado5agent15run__codex__sdk(opts_json) {
|
|
10221
10270
|
return _M0FP36mizchi7tornado5agent12js__run__sdk("codex-runner.mjs", opts_json);
|
|
10222
10271
|
}
|
|
@@ -10239,89 +10288,277 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task,
|
|
|
10239
10288
|
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10240
10289
|
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10241
10290
|
}
|
|
10291
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output);
|
|
10292
|
+
}
|
|
10293
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend3run(self, task, system_prompt, on_output) {
|
|
10294
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(_M0DTP36mizchi7tornado5types11AgentStatus7Running__));
|
|
10295
|
+
const _bind = self.kind;
|
|
10296
|
+
switch (_bind) {
|
|
10297
|
+
case 0: {
|
|
10298
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output);
|
|
10299
|
+
}
|
|
10300
|
+
case 1: {
|
|
10301
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task, system_prompt, on_output);
|
|
10302
|
+
}
|
|
10303
|
+
default: {
|
|
10304
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output);
|
|
10305
|
+
}
|
|
10306
|
+
}
|
|
10307
|
+
}
|
|
10308
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend4name(self) {
|
|
10309
|
+
const _bind = self.kind;
|
|
10310
|
+
switch (_bind) {
|
|
10311
|
+
case 0: {
|
|
10312
|
+
return "claude-code";
|
|
10313
|
+
}
|
|
10314
|
+
case 1: {
|
|
10315
|
+
return "codex";
|
|
10316
|
+
}
|
|
10317
|
+
default: {
|
|
10318
|
+
return "subprocess";
|
|
10319
|
+
}
|
|
10320
|
+
}
|
|
10321
|
+
}
|
|
10322
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16set__session__id(self, sid) {
|
|
10323
|
+
self.session_id = sid;
|
|
10324
|
+
}
|
|
10325
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16get__session__id(self) {
|
|
10326
|
+
return self.session_id;
|
|
10327
|
+
}
|
|
10328
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend3new(backend) {
|
|
10329
|
+
return new _M0TP36mizchi7tornado5agent12BoxedBackend(backend);
|
|
10330
|
+
}
|
|
10331
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend5boxed(self) {
|
|
10332
|
+
return _M0MP36mizchi7tornado5agent12BoxedBackend3new({ self: self, method_table: _M0FP094mizchi_2ftornado_2fagent_2fSubprocessBackend_24as_24_40mizchi_2ftornado_2fagent_2eAgentBackend });
|
|
10333
|
+
}
|
|
10334
|
+
function _M0FP36mizchi7tornado5agent18run__parallel__sdk(opts_json) {
|
|
10335
|
+
return _M0FP36mizchi7tornado5agent12js__run__sdk("parallel-runner.mjs", opts_json);
|
|
10336
|
+
}
|
|
10337
|
+
function _M0FP36mizchi7tornado5agent14failed__result(err) {
|
|
10338
|
+
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10339
|
+
}
|
|
10340
|
+
function _M0FP36mizchi7tornado5agent20parse__jsonl__result(jsonl, on_output) {
|
|
10341
|
+
const _bind = "ERROR:";
|
|
10342
|
+
if (_M0MPC16string6String11has__prefix(jsonl, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
10343
|
+
const err = jsonl;
|
|
10344
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10345
|
+
return _M0FP36mizchi7tornado5agent14failed__result(err);
|
|
10346
|
+
}
|
|
10242
10347
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10243
10348
|
const line_buf = _M0MP36mizchi7tornado5agent16OutputLineBuffer3new();
|
|
10244
|
-
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10245
10349
|
const error_buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10246
|
-
const
|
|
10247
|
-
const
|
|
10248
|
-
const _it =
|
|
10350
|
+
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10351
|
+
const _bind$2 = "\n";
|
|
10352
|
+
const _it = _M0MPC16string6String5split(jsonl, new _M0TPC16string10StringView(_bind$2, 0, _bind$2.length));
|
|
10249
10353
|
while (true) {
|
|
10250
10354
|
let line_view;
|
|
10251
10355
|
_L: {
|
|
10252
|
-
const _bind$
|
|
10253
|
-
if (_bind$
|
|
10356
|
+
const _bind$3 = _M0MPB4Iter4nextGUssEE(_it);
|
|
10357
|
+
if (_bind$3 === undefined) {
|
|
10254
10358
|
break;
|
|
10255
10359
|
} else {
|
|
10256
|
-
const _Some = _bind$
|
|
10360
|
+
const _Some = _bind$3;
|
|
10257
10361
|
const _line_view = _Some;
|
|
10258
10362
|
line_view = _line_view;
|
|
10259
10363
|
break _L;
|
|
10260
10364
|
}
|
|
10261
10365
|
}
|
|
10262
|
-
const line = _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(line_view), undefined));
|
|
10263
|
-
if (_M0MPC16string6String9is__empty(line)) {
|
|
10366
|
+
const line = _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(line_view), undefined));
|
|
10367
|
+
if (_M0MPC16string6String9is__empty(line)) {
|
|
10368
|
+
continue;
|
|
10369
|
+
}
|
|
10370
|
+
if (_M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, (sid) => {
|
|
10371
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent9SessionId(sid));
|
|
10372
|
+
})) {
|
|
10373
|
+
has_error.val = true;
|
|
10374
|
+
}
|
|
10375
|
+
continue;
|
|
10376
|
+
}
|
|
10377
|
+
_M0MP36mizchi7tornado5agent16OutputLineBuffer5flush(line_buf, (line) => {
|
|
10378
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent10OutputLine(line));
|
|
10379
|
+
});
|
|
10380
|
+
const content = _M0MPB13StringBuilder10to__string(buf);
|
|
10381
|
+
if (has_error.val) {
|
|
10382
|
+
const err = _M0MPB13StringBuilder10to__string(error_buf);
|
|
10383
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10384
|
+
return new _M0TP36mizchi7tornado5types11AgentResult(content, new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10385
|
+
} else {
|
|
10386
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(_M0DTP36mizchi7tornado5types11AgentStatus9Completed__));
|
|
10387
|
+
return new _M0TP36mizchi7tornado5types11AgentResult(content, _M0DTP36mizchi7tornado5types11AgentStatus9Completed__, undefined);
|
|
10388
|
+
}
|
|
10389
|
+
}
|
|
10390
|
+
function _M0FP36mizchi7tornado5agent25replicate__failed__result(count, err) {
|
|
10391
|
+
const results = [];
|
|
10392
|
+
const _bind = 0;
|
|
10393
|
+
let _tmp = _bind;
|
|
10394
|
+
while (true) {
|
|
10395
|
+
const _ = _tmp;
|
|
10396
|
+
if (_ < count) {
|
|
10397
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err));
|
|
10398
|
+
_tmp = _ + 1 | 0;
|
|
10399
|
+
continue;
|
|
10400
|
+
} else {
|
|
10401
|
+
break;
|
|
10402
|
+
}
|
|
10403
|
+
}
|
|
10404
|
+
return results;
|
|
10405
|
+
}
|
|
10406
|
+
function _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend(runner, tasks, on_output, model) {
|
|
10407
|
+
const _bind = [];
|
|
10408
|
+
const opts = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind, 0, 0));
|
|
10409
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "runner", _M0IPC16string6StringPB6ToJson8to__json(runner));
|
|
10410
|
+
const task_opts = [];
|
|
10411
|
+
const _bind$2 = tasks.length;
|
|
10412
|
+
let _tmp = 0;
|
|
10413
|
+
while (true) {
|
|
10414
|
+
const _ = _tmp;
|
|
10415
|
+
if (_ < _bind$2) {
|
|
10416
|
+
const task = tasks[_];
|
|
10417
|
+
let prompt;
|
|
10418
|
+
let system_prompt;
|
|
10419
|
+
_L: {
|
|
10420
|
+
const _prompt = task._0;
|
|
10421
|
+
const _system_prompt = task._1;
|
|
10422
|
+
prompt = _prompt;
|
|
10423
|
+
system_prompt = _system_prompt;
|
|
10424
|
+
break _L;
|
|
10425
|
+
}
|
|
10426
|
+
const _bind$3 = [];
|
|
10427
|
+
const task_json = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind$3, 0, 0));
|
|
10428
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "prompt", _M0IPC16string6StringPB6ToJson8to__json(prompt));
|
|
10429
|
+
if (!_M0MPC16string6String9is__empty(system_prompt)) {
|
|
10430
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "systemPrompt", _M0IPC16string6StringPB6ToJson8to__json(system_prompt));
|
|
10431
|
+
}
|
|
10432
|
+
if (!_M0MPC16string6String9is__empty(model)) {
|
|
10433
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "model", _M0IPC16string6StringPB6ToJson8to__json(model));
|
|
10434
|
+
}
|
|
10435
|
+
_M0MPC15array5Array4pushGsE(task_opts, _M0MPC14json4Json6object(task_json));
|
|
10436
|
+
_tmp = _ + 1 | 0;
|
|
10437
|
+
continue;
|
|
10438
|
+
} else {
|
|
10439
|
+
break;
|
|
10440
|
+
}
|
|
10441
|
+
}
|
|
10442
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "tasks", _M0MPC14json4Json5array(task_opts));
|
|
10443
|
+
const raw_output = _M0FP36mizchi7tornado5agent18run__parallel__sdk(_M0MPC14json4Json17stringify_2einner(_M0MPC14json4Json6object(opts), false, 0, undefined));
|
|
10444
|
+
const _bind$3 = "ERROR:";
|
|
10445
|
+
if (_M0MPC16string6String11has__prefix(raw_output, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length))) {
|
|
10446
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, raw_output);
|
|
10447
|
+
}
|
|
10448
|
+
let parsed;
|
|
10449
|
+
let _try_err;
|
|
10450
|
+
_L: {
|
|
10451
|
+
_L$2: {
|
|
10452
|
+
const _bind$4 = _M0FPC14json13parse_2einner(new _M0TPC16string10StringView(raw_output, 0, raw_output.length), 1024);
|
|
10453
|
+
if (_bind$4.$tag === 1) {
|
|
10454
|
+
const _ok = _bind$4;
|
|
10455
|
+
parsed = _ok._0;
|
|
10456
|
+
} else {
|
|
10457
|
+
const _err = _bind$4;
|
|
10458
|
+
_try_err = _err._0;
|
|
10459
|
+
break _L$2;
|
|
10460
|
+
}
|
|
10461
|
+
break _L;
|
|
10462
|
+
}
|
|
10463
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, "ERROR: failed to parse parallel SDK output");
|
|
10464
|
+
}
|
|
10465
|
+
let results_json;
|
|
10466
|
+
_L$2: {
|
|
10467
|
+
if (parsed.$tag === 5) {
|
|
10468
|
+
const _Array = parsed;
|
|
10469
|
+
const _results_json = _Array._0;
|
|
10470
|
+
results_json = _results_json;
|
|
10471
|
+
break _L$2;
|
|
10472
|
+
} else {
|
|
10473
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, "ERROR: invalid parallel SDK output shape");
|
|
10474
|
+
}
|
|
10475
|
+
}
|
|
10476
|
+
const results = [];
|
|
10477
|
+
const _bind$4 = results_json.length;
|
|
10478
|
+
let _tmp$2 = 0;
|
|
10479
|
+
while (true) {
|
|
10480
|
+
const _ = _tmp$2;
|
|
10481
|
+
if (_ < _bind$4) {
|
|
10482
|
+
const entry = results_json[_];
|
|
10483
|
+
let jsonl;
|
|
10484
|
+
_L$3: {
|
|
10485
|
+
_L$4: {
|
|
10486
|
+
if (entry.$tag === 4) {
|
|
10487
|
+
const _String = entry;
|
|
10488
|
+
const _jsonl = _String._0;
|
|
10489
|
+
jsonl = _jsonl;
|
|
10490
|
+
break _L$4;
|
|
10491
|
+
} else {
|
|
10492
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed("ERROR: invalid parallel SDK result entry"), "ERROR: invalid parallel SDK result entry"));
|
|
10493
|
+
}
|
|
10494
|
+
break _L$3;
|
|
10495
|
+
}
|
|
10496
|
+
_M0MPC15array5Array4pushGsE(results, _M0FP36mizchi7tornado5agent20parse__jsonl__result(jsonl, on_output));
|
|
10497
|
+
}
|
|
10498
|
+
_tmp$2 = _ + 1 | 0;
|
|
10264
10499
|
continue;
|
|
10500
|
+
} else {
|
|
10501
|
+
break;
|
|
10265
10502
|
}
|
|
10266
|
-
if (_M0MP36mizchi7tornado5agent17SubprocessBackend17parse__sdk__event(self, line, buf, line_buf, error_buf, on_output)) {
|
|
10267
|
-
has_error.val = true;
|
|
10268
|
-
}
|
|
10269
|
-
continue;
|
|
10270
10503
|
}
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
return new _M0TP36mizchi7tornado5types11AgentResult(content, new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10279
|
-
} else {
|
|
10280
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(_M0DTP36mizchi7tornado5types11AgentStatus9Completed__));
|
|
10281
|
-
return new _M0TP36mizchi7tornado5types11AgentResult(content, _M0DTP36mizchi7tornado5types11AgentStatus9Completed__, undefined);
|
|
10504
|
+
while (true) {
|
|
10505
|
+
if (results.length < tasks.length) {
|
|
10506
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed("ERROR: missing parallel SDK result"), "ERROR: missing parallel SDK result"));
|
|
10507
|
+
continue;
|
|
10508
|
+
} else {
|
|
10509
|
+
break;
|
|
10510
|
+
}
|
|
10282
10511
|
}
|
|
10512
|
+
return results;
|
|
10283
10513
|
}
|
|
10284
|
-
function
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10514
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend3run(self, task, system_prompt, on_output) {
|
|
10515
|
+
const _tmp = self.inner;
|
|
10516
|
+
return _tmp.method_table.method_0(_tmp.self, task, system_prompt, on_output);
|
|
10517
|
+
}
|
|
10518
|
+
function _M0FP36mizchi7tornado5agent25run__parallel__sequential(backend, tasks, on_output) {
|
|
10519
|
+
const results = [];
|
|
10520
|
+
const _bind = tasks.length;
|
|
10521
|
+
let _tmp = 0;
|
|
10522
|
+
while (true) {
|
|
10523
|
+
const _ = _tmp;
|
|
10524
|
+
if (_ < _bind) {
|
|
10525
|
+
const task = tasks[_];
|
|
10526
|
+
let prompt;
|
|
10527
|
+
let system_prompt;
|
|
10528
|
+
_L: {
|
|
10529
|
+
const _prompt = task._0;
|
|
10530
|
+
const _system_prompt = task._1;
|
|
10531
|
+
prompt = _prompt;
|
|
10532
|
+
system_prompt = _system_prompt;
|
|
10533
|
+
break _L;
|
|
10534
|
+
}
|
|
10535
|
+
_M0MPC15array5Array4pushGsE(results, _M0MP36mizchi7tornado5agent12BoxedBackend3run(backend, prompt, system_prompt, on_output));
|
|
10536
|
+
_tmp = _ + 1 | 0;
|
|
10537
|
+
continue;
|
|
10538
|
+
} else {
|
|
10539
|
+
break;
|
|
10296
10540
|
}
|
|
10297
10541
|
}
|
|
10542
|
+
return results;
|
|
10298
10543
|
}
|
|
10299
|
-
function
|
|
10300
|
-
const
|
|
10544
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend4name(self) {
|
|
10545
|
+
const _tmp = self.inner;
|
|
10546
|
+
return _tmp.method_table.method_1(_tmp.self);
|
|
10547
|
+
}
|
|
10548
|
+
function _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_output, model) {
|
|
10549
|
+
const _bind = _M0MP36mizchi7tornado5agent12BoxedBackend4name(backend);
|
|
10301
10550
|
switch (_bind) {
|
|
10302
|
-
case
|
|
10303
|
-
return "claude
|
|
10551
|
+
case "claude-code": {
|
|
10552
|
+
return _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend("claude", tasks, on_output, model);
|
|
10304
10553
|
}
|
|
10305
|
-
case
|
|
10306
|
-
return "codex";
|
|
10554
|
+
case "codex": {
|
|
10555
|
+
return _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend("codex", tasks, on_output, model);
|
|
10307
10556
|
}
|
|
10308
10557
|
default: {
|
|
10309
|
-
return
|
|
10558
|
+
return _M0FP36mizchi7tornado5agent25run__parallel__sequential(backend, tasks, on_output);
|
|
10310
10559
|
}
|
|
10311
10560
|
}
|
|
10312
10561
|
}
|
|
10313
|
-
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16set__session__id(self, sid) {
|
|
10314
|
-
self.session_id = sid;
|
|
10315
|
-
}
|
|
10316
|
-
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16get__session__id(self) {
|
|
10317
|
-
return self.session_id;
|
|
10318
|
-
}
|
|
10319
|
-
function _M0MP36mizchi7tornado5agent12BoxedBackend3new(backend) {
|
|
10320
|
-
return new _M0TP36mizchi7tornado5agent12BoxedBackend(backend);
|
|
10321
|
-
}
|
|
10322
|
-
function _M0MP36mizchi7tornado5agent17SubprocessBackend5boxed(self) {
|
|
10323
|
-
return _M0MP36mizchi7tornado5agent12BoxedBackend3new({ self: self, method_table: _M0FP094mizchi_2ftornado_2fagent_2fSubprocessBackend_24as_24_40mizchi_2ftornado_2fagent_2eAgentBackend });
|
|
10324
|
-
}
|
|
10325
10562
|
function _M0MP36mizchi7tornado5agent11MockBackend11new_2einner(default_response) {
|
|
10326
10563
|
const _bind = [];
|
|
10327
10564
|
return new _M0TP36mizchi7tornado5agent11MockBackend(_M0MPB3Map11from__arrayGssE(new _M0TPB9ArrayViewGUssEE(_bind, 0, 0)), default_response, []);
|
|
@@ -10485,10 +10722,6 @@ function _M0IP36mizchi7tornado5agent10ApiBackendP36mizchi7tornado5agent12AgentBa
|
|
|
10485
10722
|
function _M0IP36mizchi7tornado5agent10ApiBackendP36mizchi7tornado5agent12AgentBackend16get__session__id(_self) {
|
|
10486
10723
|
return "";
|
|
10487
10724
|
}
|
|
10488
|
-
function _M0MP36mizchi7tornado5agent12BoxedBackend3run(self, task, system_prompt, on_output) {
|
|
10489
|
-
const _tmp = self.inner;
|
|
10490
|
-
return _tmp.method_table.method_0(_tmp.self, task, system_prompt, on_output);
|
|
10491
|
-
}
|
|
10492
10725
|
function _M0MP36mizchi7tornado5agent12BoxedBackend16set__session__id(self, session_id) {
|
|
10493
10726
|
const _tmp = self.inner;
|
|
10494
10727
|
_tmp.method_table.method_2(_tmp.self, session_id);
|
|
@@ -10920,6 +11153,7 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
10920
11153
|
const rlm = new _M0TPC13ref3RefGbE(false);
|
|
10921
11154
|
const ralph = new _M0TPC13ref3RefGbE(false);
|
|
10922
11155
|
const lang = new _M0TPC13ref3RefGOsE(undefined);
|
|
11156
|
+
const log_path = new _M0TPC13ref3RefGOsE(undefined);
|
|
10923
11157
|
const warnings = [];
|
|
10924
11158
|
const i = new _M0TPC13ref3RefGiE(0);
|
|
10925
11159
|
const len = args.length;
|
|
@@ -11056,14 +11290,42 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11056
11290
|
}
|
|
11057
11291
|
continue;
|
|
11058
11292
|
}
|
|
11059
|
-
const _bind$6 = "--";
|
|
11293
|
+
const _bind$6 = "--log=";
|
|
11060
11294
|
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$6, 0, _bind$6.length))) {
|
|
11295
|
+
const path = _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(token, "--log=".length, undefined));
|
|
11296
|
+
if (_M0MPC16string6String9is__empty(path)) {
|
|
11297
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11298
|
+
} else {
|
|
11299
|
+
log_path.val = path;
|
|
11300
|
+
}
|
|
11301
|
+
i.val = i.val + 1 | 0;
|
|
11302
|
+
continue;
|
|
11303
|
+
}
|
|
11304
|
+
if (token === "--log") {
|
|
11305
|
+
if ((i.val + 1 | 0) < len) {
|
|
11306
|
+
const path = _M0MPC15array5Array2atGsE(args, i.val + 1 | 0);
|
|
11307
|
+
const _bind$7 = "--";
|
|
11308
|
+
if (_M0MPC16string6String11has__prefix(path, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11309
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11310
|
+
i.val = i.val + 1 | 0;
|
|
11311
|
+
} else {
|
|
11312
|
+
log_path.val = path;
|
|
11313
|
+
i.val = i.val + 2 | 0;
|
|
11314
|
+
}
|
|
11315
|
+
} else {
|
|
11316
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11317
|
+
i.val = i.val + 1 | 0;
|
|
11318
|
+
}
|
|
11319
|
+
continue;
|
|
11320
|
+
}
|
|
11321
|
+
const _bind$7 = "--";
|
|
11322
|
+
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11061
11323
|
_M0MPC15array5Array4pushGsE(warnings, `Unknown option: ${_M0IPC16string6StringPB4Show10to__string(token)}`);
|
|
11062
11324
|
i.val = i.val + 1 | 0;
|
|
11063
11325
|
continue;
|
|
11064
11326
|
}
|
|
11065
|
-
const _bind$
|
|
11066
|
-
if (_bind$
|
|
11327
|
+
const _bind$8 = plan_path.val;
|
|
11328
|
+
if (_bind$8 === undefined) {
|
|
11067
11329
|
if (file_exists(token)) {
|
|
11068
11330
|
plan_path.val = token;
|
|
11069
11331
|
} else {
|
|
@@ -11078,11 +11340,11 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11078
11340
|
break;
|
|
11079
11341
|
}
|
|
11080
11342
|
}
|
|
11081
|
-
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, review_interval.val, rlm.val, ralph.val, lang.val, warnings);
|
|
11343
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, review_interval.val, rlm.val, ralph.val, lang.val, log_path.val, warnings);
|
|
11082
11344
|
}
|
|
11083
11345
|
function _M0FP36mizchi7tornado3cli16parse__cli__args(args, file_exists) {
|
|
11084
11346
|
if (args.length < 2) {
|
|
11085
|
-
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, []);
|
|
11347
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, undefined, []);
|
|
11086
11348
|
}
|
|
11087
11349
|
const first = _M0MPC15array5Array2atGsE(args, 1);
|
|
11088
11350
|
_L: {
|
|
@@ -11542,10 +11804,114 @@ function _M0FP36mizchi7tornado7display20format__tool__result(name, output) {
|
|
|
11542
11804
|
}
|
|
11543
11805
|
}
|
|
11544
11806
|
}
|
|
11807
|
+
function _M0FP36mizchi7tornado7prompts24code__quality__checklist(lang) {
|
|
11808
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11809
|
+
if (lang === "ja") {
|
|
11810
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: コード品質\n");
|
|
11811
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11812
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 可読性と命名規約\n");
|
|
11813
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 関心の分離\n");
|
|
11814
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- エラーハンドリングの網羅性\n");
|
|
11815
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- テストカバレッジと正確性\n");
|
|
11816
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- コードの重複と不必要な複雑さ\n");
|
|
11817
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API 設計と公開インターフェースの明確さ\n");
|
|
11818
|
+
} else {
|
|
11819
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Code Quality\n");
|
|
11820
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11821
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Readability and naming conventions\n");
|
|
11822
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Proper separation of concerns\n");
|
|
11823
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Error handling completeness\n");
|
|
11824
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Test coverage and correctness\n");
|
|
11825
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Code duplication and unnecessary complexity\n");
|
|
11826
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API design and public interface clarity\n");
|
|
11827
|
+
}
|
|
11828
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11829
|
+
}
|
|
11830
|
+
function _M0FP36mizchi7tornado7prompts22performance__checklist(lang) {
|
|
11831
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11832
|
+
if (lang === "ja") {
|
|
11833
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: パフォーマンス\n");
|
|
11834
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11835
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- アルゴリズムの計算量(時間・空間)\n");
|
|
11836
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 不要なメモリ確保やコピー\n");
|
|
11837
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 クエリや冗長な I/O\n");
|
|
11838
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- キャッシュの活用機会\n");
|
|
11839
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- ホットパスの最適化\n");
|
|
11840
|
+
} else {
|
|
11841
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Performance\n");
|
|
11842
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11843
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Algorithmic complexity (time and space)\n");
|
|
11844
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Unnecessary allocations or copies\n");
|
|
11845
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 queries or redundant I/O\n");
|
|
11846
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Caching opportunities\n");
|
|
11847
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Hot path optimization\n");
|
|
11848
|
+
}
|
|
11849
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11850
|
+
}
|
|
11851
|
+
function _M0FP36mizchi7tornado7prompts19security__checklist(lang) {
|
|
11852
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11853
|
+
if (lang === "ja") {
|
|
11854
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: セキュリティ\n");
|
|
11855
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11856
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 入力値のバリデーションとサニタイズ\n");
|
|
11857
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- インジェクション脆弱性(コマンド、SQL、XSS)\n");
|
|
11858
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 認証・認可の不備\n");
|
|
11859
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 機密データの露出(シークレット、トークン、個人情報)\n");
|
|
11860
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 依存関係の安全性\n");
|
|
11861
|
+
} else {
|
|
11862
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Security\n");
|
|
11863
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11864
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Input validation and sanitization\n");
|
|
11865
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Injection vulnerabilities (command, SQL, XSS)\n");
|
|
11866
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Authentication and authorization gaps\n");
|
|
11867
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Sensitive data exposure (secrets, tokens, PII)\n");
|
|
11868
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Dependency safety\n");
|
|
11869
|
+
}
|
|
11870
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11871
|
+
}
|
|
11872
|
+
function _M0IP36mizchi7tornado5ralph19VerifierPerspectivePB4Show6output(_x_335, _x_336) {
|
|
11873
|
+
switch (_x_335) {
|
|
11874
|
+
case 0: {
|
|
11875
|
+
_x_336.method_table.method_0(_x_336.self, "CodeQuality");
|
|
11876
|
+
return;
|
|
11877
|
+
}
|
|
11878
|
+
case 1: {
|
|
11879
|
+
_x_336.method_table.method_0(_x_336.self, "Performance");
|
|
11880
|
+
return;
|
|
11881
|
+
}
|
|
11882
|
+
case 2: {
|
|
11883
|
+
_x_336.method_table.method_0(_x_336.self, "Security");
|
|
11884
|
+
return;
|
|
11885
|
+
}
|
|
11886
|
+
default: {
|
|
11887
|
+
_x_336.method_table.method_0(_x_336.self, "GoalAlignment");
|
|
11888
|
+
return;
|
|
11889
|
+
}
|
|
11890
|
+
}
|
|
11891
|
+
}
|
|
11545
11892
|
function _M0MP36mizchi7tornado5ralph13VerifierAgent11new_2einner(agent_id, lang) {
|
|
11546
11893
|
return new _M0TP36mizchi7tornado5ralph13VerifierAgent(agent_id, lang);
|
|
11547
11894
|
}
|
|
11548
|
-
function
|
|
11895
|
+
function _M0FP36mizchi7tornado5ralph26goal__alignment__checklist(lang) {
|
|
11896
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11897
|
+
if (lang === "ja") {
|
|
11898
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: ゴール整合性\n");
|
|
11899
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11900
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 出力はマイルストーンで定義された目標を達成しているか\n");
|
|
11901
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- すべてのタスク出力に一貫性があるか\n");
|
|
11902
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 当該 Wave のタスクに不足している成果物や未完了の実装がないか(他 Wave の作業は検証対象外)\n");
|
|
11903
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 全体の方向性がプロジェクトの意図と一致しているか\n");
|
|
11904
|
+
} else {
|
|
11905
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Goal Alignment\n");
|
|
11906
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11907
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Does the output achieve the stated milestone goal?\n");
|
|
11908
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Are all task outputs consistent with each other?\n");
|
|
11909
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Are there missing deliverables or incomplete implementations for this wave's tasks? (Work from other waves is out of scope)\n");
|
|
11910
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Does the overall direction match the project's intent?\n");
|
|
11911
|
+
}
|
|
11912
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11913
|
+
}
|
|
11914
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent26build__perspective__prompt(self, perspective, milestone, wave, wave_results, project_context) {
|
|
11549
11915
|
const lang_instruction = self.lang === "ja" ? "Respond in Japanese." : "Respond in English.";
|
|
11550
11916
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11551
11917
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, "You are a Verifier agent. ");
|
|
@@ -11582,7 +11948,25 @@ function _M0MP36mizchi7tornado5ralph13VerifierAgent21build__verify__prompt(self,
|
|
|
11582
11948
|
break;
|
|
11583
11949
|
}
|
|
11584
11950
|
}
|
|
11585
|
-
|
|
11951
|
+
switch (perspective) {
|
|
11952
|
+
case 0: {
|
|
11953
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts24code__quality__checklist(self.lang));
|
|
11954
|
+
break;
|
|
11955
|
+
}
|
|
11956
|
+
case 1: {
|
|
11957
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts22performance__checklist(self.lang));
|
|
11958
|
+
break;
|
|
11959
|
+
}
|
|
11960
|
+
case 2: {
|
|
11961
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts19security__checklist(self.lang));
|
|
11962
|
+
break;
|
|
11963
|
+
}
|
|
11964
|
+
default: {
|
|
11965
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado5ralph26goal__alignment__checklist(self.lang));
|
|
11966
|
+
}
|
|
11967
|
+
}
|
|
11968
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "\n## Instructions\nVerify ONLY the tasks listed in the Wave Results section above.\nThe milestone goal may contain supplementary context referencing work from other waves.\nDo NOT flag incomplete implementations or missing deliverables that belong to other waves.\nFocus your review exclusively on the current wave's output.\n\n");
|
|
11969
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "\n## Output Format\nUse exactly one of these tags:\n- <wave_approved> if all tasks pass verification\n- <needs_rework>task_id: reason</needs_rework> for tasks that need fixes\n- <milestone_failed>reason</milestone_failed> if the milestone cannot be achieved\n");
|
|
11586
11970
|
return _M0MPB13StringBuilder10to__string(buf);
|
|
11587
11971
|
}
|
|
11588
11972
|
function _M0FP36mizchi7tornado5ralph15find__substring(haystack, needle) {
|
|
@@ -11732,64 +12116,195 @@ function _M0FP36mizchi7tornado5ralph12split__lines(s) {
|
|
|
11732
12116
|
_M0IPB13StringBuilderPB6Logger11write__char(buf, ch);
|
|
11733
12117
|
}
|
|
11734
12118
|
}
|
|
11735
|
-
continue;
|
|
11736
|
-
}
|
|
11737
|
-
const remaining = _M0MPB13StringBuilder10to__string(buf);
|
|
11738
|
-
if (!_M0MPC16string6String9is__empty(remaining)) {
|
|
11739
|
-
_M0MPC15array5Array4pushGsE(lines, remaining);
|
|
12119
|
+
continue;
|
|
12120
|
+
}
|
|
12121
|
+
const remaining = _M0MPB13StringBuilder10to__string(buf);
|
|
12122
|
+
if (!_M0MPC16string6String9is__empty(remaining)) {
|
|
12123
|
+
_M0MPC15array5Array4pushGsE(lines, remaining);
|
|
12124
|
+
}
|
|
12125
|
+
return lines;
|
|
12126
|
+
}
|
|
12127
|
+
function _M0FP36mizchi7tornado5ralph20split__rework__items(s) {
|
|
12128
|
+
const items = [];
|
|
12129
|
+
const lines = _M0FP36mizchi7tornado5ralph12split__lines(s);
|
|
12130
|
+
const _bind = lines.length;
|
|
12131
|
+
let _tmp = 0;
|
|
12132
|
+
while (true) {
|
|
12133
|
+
const _ = _tmp;
|
|
12134
|
+
if (_ < _bind) {
|
|
12135
|
+
const line = lines[_];
|
|
12136
|
+
const trimmed = _M0FP36mizchi7tornado5ralph4trim(line);
|
|
12137
|
+
if (!_M0MPC16string6String9is__empty(trimmed)) {
|
|
12138
|
+
_M0MPC15array5Array4pushGsE(items, trimmed);
|
|
12139
|
+
}
|
|
12140
|
+
_tmp = _ + 1 | 0;
|
|
12141
|
+
continue;
|
|
12142
|
+
} else {
|
|
12143
|
+
break;
|
|
12144
|
+
}
|
|
12145
|
+
}
|
|
12146
|
+
if (_M0MPC15array5Array9is__emptyGsE(items)) {
|
|
12147
|
+
_M0MPC15array5Array4pushGsE(items, s);
|
|
12148
|
+
}
|
|
12149
|
+
return items;
|
|
12150
|
+
}
|
|
12151
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent14parse__verdict(_self, output) {
|
|
12152
|
+
const failed_content = _M0FP36mizchi7tornado5ralph12extract__tag(output, "milestone_failed");
|
|
12153
|
+
if (!_M0MPC16string6String9is__empty(failed_content)) {
|
|
12154
|
+
return new _M0DTP36mizchi7tornado5types15VerifierVerdict15MilestoneFailed(failed_content);
|
|
12155
|
+
}
|
|
12156
|
+
const rework_content = _M0FP36mizchi7tornado5ralph12extract__tag(output, "needs_rework");
|
|
12157
|
+
if (!_M0MPC16string6String9is__empty(rework_content)) {
|
|
12158
|
+
const items = _M0FP36mizchi7tornado5ralph20split__rework__items(rework_content);
|
|
12159
|
+
return new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework(items);
|
|
12160
|
+
}
|
|
12161
|
+
const _bind = "<wave_approved>";
|
|
12162
|
+
if (_M0MPC16string6String8contains(output, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
12163
|
+
return _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__;
|
|
12164
|
+
}
|
|
12165
|
+
return _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__;
|
|
12166
|
+
}
|
|
12167
|
+
function _M0FP36mizchi7tornado5ralph24inject__perspective__tag(item, perspective) {
|
|
12168
|
+
const tag = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] `;
|
|
12169
|
+
const colon_idx = _M0FP36mizchi7tornado5ralph15find__substring(item, ": ");
|
|
12170
|
+
if (colon_idx >= 0) {
|
|
12171
|
+
const prefix = _M0FP36mizchi7tornado5ralph9substring(item, 0, colon_idx + 2 | 0);
|
|
12172
|
+
const suffix = _M0FP36mizchi7tornado5ralph9substring(item, colon_idx + 2 | 0, _M0MPC16string6String9to__array(item).length);
|
|
12173
|
+
return `${prefix}${tag}${suffix}`;
|
|
12174
|
+
} else {
|
|
12175
|
+
const space_idx = _M0FP36mizchi7tornado5ralph15find__substring(item, " ");
|
|
12176
|
+
if (space_idx > 0) {
|
|
12177
|
+
const prefix = _M0FP36mizchi7tornado5ralph9substring(item, 0, space_idx);
|
|
12178
|
+
const _bind = "-";
|
|
12179
|
+
if (_M0MPC16string6String8contains(prefix, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
12180
|
+
const suffix = _M0FP36mizchi7tornado5ralph9substring(item, space_idx + 1 | 0, _M0MPC16string6String9to__array(item).length);
|
|
12181
|
+
return `${prefix} ${tag}${suffix}`;
|
|
12182
|
+
} else {
|
|
12183
|
+
return `${tag}${item}`;
|
|
12184
|
+
}
|
|
12185
|
+
} else {
|
|
12186
|
+
return `${tag}${item}`;
|
|
12187
|
+
}
|
|
12188
|
+
}
|
|
12189
|
+
}
|
|
12190
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent15merge__verdicts(_self, verdicts) {
|
|
12191
|
+
const items = [];
|
|
12192
|
+
const _bind = verdicts.length;
|
|
12193
|
+
let _tmp = 0;
|
|
12194
|
+
while (true) {
|
|
12195
|
+
const _ = _tmp;
|
|
12196
|
+
if (_ < _bind) {
|
|
12197
|
+
const verdict = verdicts[_];
|
|
12198
|
+
let rework_items;
|
|
12199
|
+
_L: {
|
|
12200
|
+
_L$2: {
|
|
12201
|
+
let reason;
|
|
12202
|
+
_L$3: {
|
|
12203
|
+
_L$4: {
|
|
12204
|
+
const _bind$2 = verdict._1;
|
|
12205
|
+
switch (_bind$2.$tag) {
|
|
12206
|
+
case 2: {
|
|
12207
|
+
const _MilestoneFailed = _bind$2;
|
|
12208
|
+
const _reason = _MilestoneFailed._0;
|
|
12209
|
+
reason = _reason;
|
|
12210
|
+
break _L$4;
|
|
12211
|
+
}
|
|
12212
|
+
case 1: {
|
|
12213
|
+
const _NeedsRework = _bind$2;
|
|
12214
|
+
const _rework_items = _NeedsRework._0;
|
|
12215
|
+
rework_items = _rework_items;
|
|
12216
|
+
break _L$2;
|
|
12217
|
+
}
|
|
12218
|
+
}
|
|
12219
|
+
break _L$3;
|
|
12220
|
+
}
|
|
12221
|
+
return new _M0DTP36mizchi7tornado5types15VerifierVerdict15MilestoneFailed(reason);
|
|
12222
|
+
}
|
|
12223
|
+
break _L;
|
|
12224
|
+
}
|
|
12225
|
+
const _bind$2 = rework_items.length;
|
|
12226
|
+
let _tmp$2 = 0;
|
|
12227
|
+
while (true) {
|
|
12228
|
+
const _$2 = _tmp$2;
|
|
12229
|
+
if (_$2 < _bind$2) {
|
|
12230
|
+
const item = rework_items[_$2];
|
|
12231
|
+
_M0MPC15array5Array4pushGsE(items, _M0FP36mizchi7tornado5ralph24inject__perspective__tag(item, verdict._0));
|
|
12232
|
+
_tmp$2 = _$2 + 1 | 0;
|
|
12233
|
+
continue;
|
|
12234
|
+
} else {
|
|
12235
|
+
break;
|
|
12236
|
+
}
|
|
12237
|
+
}
|
|
12238
|
+
}
|
|
12239
|
+
_tmp = _ + 1 | 0;
|
|
12240
|
+
continue;
|
|
12241
|
+
} else {
|
|
12242
|
+
break;
|
|
12243
|
+
}
|
|
11740
12244
|
}
|
|
11741
|
-
return
|
|
12245
|
+
return _M0MPC15array5Array9is__emptyGsE(items) ? _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__ : new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework(items);
|
|
11742
12246
|
}
|
|
11743
|
-
function
|
|
11744
|
-
const
|
|
11745
|
-
const
|
|
11746
|
-
const _bind =
|
|
12247
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent14verify_2einner(self, milestone, wave, wave_results, backend, project_context, on_event) {
|
|
12248
|
+
const perspectives = [0, 1, 2, 3];
|
|
12249
|
+
const tasks = [];
|
|
12250
|
+
const _bind = perspectives.length;
|
|
11747
12251
|
let _tmp = 0;
|
|
11748
12252
|
while (true) {
|
|
11749
12253
|
const _ = _tmp;
|
|
11750
12254
|
if (_ < _bind) {
|
|
11751
|
-
const
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
}
|
|
12255
|
+
const perspective = perspectives[_];
|
|
12256
|
+
on_event(new _M0DTP36mizchi7tornado5types10AgentEvent4Info(`Verifying perspective: ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}`));
|
|
12257
|
+
const prompt = _M0MP36mizchi7tornado5ralph13VerifierAgent26build__perspective__prompt(self, perspective, milestone, wave, wave_results, project_context);
|
|
12258
|
+
const system_prompt = `You are a verification agent focusing on ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}. Be concise and actionable.`;
|
|
12259
|
+
_M0MPC15array5Array4pushGsE(tasks, { _0: prompt, _1: system_prompt });
|
|
11756
12260
|
_tmp = _ + 1 | 0;
|
|
11757
12261
|
continue;
|
|
11758
12262
|
} else {
|
|
11759
12263
|
break;
|
|
11760
12264
|
}
|
|
11761
12265
|
}
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
|
|
12266
|
+
const results = _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_event, "");
|
|
12267
|
+
const perspective_verdicts = [];
|
|
12268
|
+
const _bind$2 = 0;
|
|
12269
|
+
const _bind$3 = perspectives.length;
|
|
12270
|
+
let _tmp$2 = _bind$2;
|
|
12271
|
+
while (true) {
|
|
12272
|
+
const i = _tmp$2;
|
|
12273
|
+
if (i < _bind$3) {
|
|
12274
|
+
const perspective = _M0MPC15array5Array2atGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspectives, i);
|
|
12275
|
+
const result = _M0MPC15array5Array2atGsE(results, i);
|
|
12276
|
+
let verdict;
|
|
12277
|
+
let err;
|
|
12278
|
+
_L: {
|
|
12279
|
+
_L$2: {
|
|
12280
|
+
const _bind$4 = result.status;
|
|
12281
|
+
switch (_bind$4.$tag) {
|
|
12282
|
+
case 3: {
|
|
12283
|
+
const _Failed = _bind$4;
|
|
12284
|
+
const _err = _Failed._0;
|
|
12285
|
+
err = _err;
|
|
12286
|
+
break _L$2;
|
|
12287
|
+
}
|
|
12288
|
+
case 2: {
|
|
12289
|
+
verdict = _M0MP36mizchi7tornado5ralph13VerifierAgent14parse__verdict(self, result.content);
|
|
12290
|
+
break;
|
|
12291
|
+
}
|
|
12292
|
+
default: {
|
|
12293
|
+
verdict = new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework([`[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] Verification failed: unexpected verifier status`]);
|
|
12294
|
+
}
|
|
12295
|
+
}
|
|
12296
|
+
break _L;
|
|
12297
|
+
}
|
|
12298
|
+
verdict = new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework([`[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] Verification failed: ${err}`]);
|
|
12299
|
+
}
|
|
12300
|
+
_M0MPC15array5Array4pushGsE(perspective_verdicts, { _0: perspective, _1: verdict });
|
|
12301
|
+
_tmp$2 = i + 1 | 0;
|
|
12302
|
+
continue;
|
|
12303
|
+
} else {
|
|
12304
|
+
break;
|
|
12305
|
+
}
|
|
11792
12306
|
}
|
|
12307
|
+
return _M0MP36mizchi7tornado5ralph13VerifierAgent15merge__verdicts(self, perspective_verdicts);
|
|
11793
12308
|
}
|
|
11794
12309
|
function _M0FP36mizchi7tornado5ralph15find__agent__id(config, role) {
|
|
11795
12310
|
const _bind = config.agents;
|
|
@@ -12165,8 +12680,74 @@ function _M0MP36mizchi7tornado5ralph16MilestoneManager16get__wave__tasks(_self,
|
|
|
12165
12680
|
}
|
|
12166
12681
|
return result;
|
|
12167
12682
|
}
|
|
12168
|
-
function
|
|
12683
|
+
function _M0FP36mizchi7tornado5ralph29strip__task__feedback__prefix(item, task_id) {
|
|
12684
|
+
const colon_prefix = `${task_id}:`;
|
|
12685
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(colon_prefix, 0, colon_prefix.length))) {
|
|
12686
|
+
return _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(item, colon_prefix.length, undefined)), undefined));
|
|
12687
|
+
}
|
|
12688
|
+
const space_prefix = `${task_id} `;
|
|
12689
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(space_prefix, 0, space_prefix.length))) {
|
|
12690
|
+
return _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(item, space_prefix.length, undefined)), undefined));
|
|
12691
|
+
}
|
|
12692
|
+
return item;
|
|
12693
|
+
}
|
|
12694
|
+
function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, wave, feedback) {
|
|
12169
12695
|
const tasks = _M0MP36mizchi7tornado5ralph16MilestoneManager16get__wave__tasks(self.milestone_manager, milestone, wave);
|
|
12696
|
+
const matched_any = new _M0TPC13ref3RefGbE(false);
|
|
12697
|
+
const _bind = feedback.length;
|
|
12698
|
+
let _tmp = 0;
|
|
12699
|
+
while (true) {
|
|
12700
|
+
const _ = _tmp;
|
|
12701
|
+
if (_ < _bind) {
|
|
12702
|
+
const item = feedback[_];
|
|
12703
|
+
const _bind$2 = tasks.length;
|
|
12704
|
+
let _tmp$2 = 0;
|
|
12705
|
+
while (true) {
|
|
12706
|
+
const _$2 = _tmp$2;
|
|
12707
|
+
if (_$2 < _bind$2) {
|
|
12708
|
+
const task = tasks[_$2];
|
|
12709
|
+
let _tmp$3;
|
|
12710
|
+
const _bind$3 = `${task.id}:`;
|
|
12711
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length))) {
|
|
12712
|
+
_tmp$3 = true;
|
|
12713
|
+
} else {
|
|
12714
|
+
const _bind$4 = `${task.id} `;
|
|
12715
|
+
_tmp$3 = _M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length));
|
|
12716
|
+
}
|
|
12717
|
+
if (_tmp$3) {
|
|
12718
|
+
task.status = _M0DTP36mizchi7tornado5types10TaskStatus7Pending__;
|
|
12719
|
+
matched_any.val = true;
|
|
12720
|
+
}
|
|
12721
|
+
_tmp$2 = _$2 + 1 | 0;
|
|
12722
|
+
continue;
|
|
12723
|
+
} else {
|
|
12724
|
+
break;
|
|
12725
|
+
}
|
|
12726
|
+
}
|
|
12727
|
+
_tmp = _ + 1 | 0;
|
|
12728
|
+
continue;
|
|
12729
|
+
} else {
|
|
12730
|
+
break;
|
|
12731
|
+
}
|
|
12732
|
+
}
|
|
12733
|
+
if (!matched_any.val && !_M0MPC15array5Array9is__emptyGsE(feedback)) {
|
|
12734
|
+
const _bind$2 = tasks.length;
|
|
12735
|
+
let _tmp$2 = 0;
|
|
12736
|
+
while (true) {
|
|
12737
|
+
const _ = _tmp$2;
|
|
12738
|
+
if (_ < _bind$2) {
|
|
12739
|
+
const task = tasks[_];
|
|
12740
|
+
const _bind$3 = task.status;
|
|
12741
|
+
if (_bind$3.$tag === 2) {
|
|
12742
|
+
task.status = _M0DTP36mizchi7tornado5types10TaskStatus7Pending__;
|
|
12743
|
+
}
|
|
12744
|
+
_tmp$2 = _ + 1 | 0;
|
|
12745
|
+
continue;
|
|
12746
|
+
} else {
|
|
12747
|
+
break;
|
|
12748
|
+
}
|
|
12749
|
+
}
|
|
12750
|
+
}
|
|
12170
12751
|
const builder_id = _M0FP36mizchi7tornado5ralph15find__agent__id(self.config, 0);
|
|
12171
12752
|
let builder_backend;
|
|
12172
12753
|
let id;
|
|
@@ -12196,16 +12777,16 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12196
12777
|
}
|
|
12197
12778
|
}
|
|
12198
12779
|
const bid = _M0MPC16option6Option6unwrapGsE(builder_id);
|
|
12199
|
-
const _bind = tasks.length;
|
|
12200
|
-
let _tmp = 0;
|
|
12780
|
+
const _bind$2 = tasks.length;
|
|
12781
|
+
let _tmp$2 = 0;
|
|
12201
12782
|
while (true) {
|
|
12202
|
-
const _ = _tmp;
|
|
12203
|
-
if (_ < _bind) {
|
|
12783
|
+
const _ = _tmp$2;
|
|
12784
|
+
if (_ < _bind$2) {
|
|
12204
12785
|
const task = tasks[_];
|
|
12205
12786
|
_L$3: {
|
|
12206
12787
|
_L$4: {
|
|
12207
|
-
const _bind$
|
|
12208
|
-
switch (_bind$
|
|
12788
|
+
const _bind$3 = task.status;
|
|
12789
|
+
switch (_bind$3.$tag) {
|
|
12209
12790
|
case 3: {
|
|
12210
12791
|
break _L$4;
|
|
12211
12792
|
}
|
|
@@ -12216,12 +12797,42 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12216
12797
|
break _L$3;
|
|
12217
12798
|
}
|
|
12218
12799
|
task.status = new _M0DTP36mizchi7tornado5types10TaskStatus10InProgress(bid);
|
|
12219
|
-
const
|
|
12800
|
+
const task_feedback = _M0MPB13StringBuilder11new_2einner(0);
|
|
12801
|
+
const _bind$3 = feedback.length;
|
|
12802
|
+
let _tmp$3 = 0;
|
|
12803
|
+
while (true) {
|
|
12804
|
+
const _$2 = _tmp$3;
|
|
12805
|
+
if (_$2 < _bind$3) {
|
|
12806
|
+
const item = feedback[_$2];
|
|
12807
|
+
let _tmp$4;
|
|
12808
|
+
const _bind$4 = `${task.id}:`;
|
|
12809
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length))) {
|
|
12810
|
+
_tmp$4 = true;
|
|
12811
|
+
} else {
|
|
12812
|
+
const _bind$5 = `${task.id} `;
|
|
12813
|
+
_tmp$4 = _M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$5, 0, _bind$5.length));
|
|
12814
|
+
}
|
|
12815
|
+
if (_tmp$4) {
|
|
12816
|
+
const task_feedback_item = _M0FP36mizchi7tornado5ralph29strip__task__feedback__prefix(item, task.id);
|
|
12817
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, "- ");
|
|
12818
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, task_feedback_item);
|
|
12819
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, "\n");
|
|
12820
|
+
}
|
|
12821
|
+
_tmp$3 = _$2 + 1 | 0;
|
|
12822
|
+
continue;
|
|
12823
|
+
} else {
|
|
12824
|
+
break;
|
|
12825
|
+
}
|
|
12826
|
+
}
|
|
12827
|
+
const task_feedback_str = _M0MPB13StringBuilder10to__string(task_feedback);
|
|
12828
|
+
const feedback_str = _M0MPC16string6String9is__empty(task_feedback_str) ? _M0MPB4Iter4foldGssE(_M0MPC15array5Array4iterGRP36mizchi7tornado5types11AgentConfigE(feedback), "", (acc, item) => `${acc}- ${item}\n`) : task_feedback_str;
|
|
12829
|
+
const rework_prompt = `${task.description}\n\nFeedback from verifier:\n${feedback_str}`;
|
|
12830
|
+
_M0FP36mizchi7tornado5ralph10emit__info(self, `Reworking task ${_M0IPC16string6StringPB4Show10to__string(task.id)}`);
|
|
12220
12831
|
const result = _M0MP36mizchi7tornado5agent12BoxedBackend3run(backend, rework_prompt, "", (e) => {
|
|
12221
12832
|
_M0FP36mizchi7tornado5ralph13handle__event(self, bid, e);
|
|
12222
12833
|
});
|
|
12223
|
-
const _bind$
|
|
12224
|
-
if (_bind$
|
|
12834
|
+
const _bind$4 = result.status;
|
|
12835
|
+
if (_bind$4.$tag === 2) {
|
|
12225
12836
|
task.status = _M0DTP36mizchi7tornado5types10TaskStatus4Done__;
|
|
12226
12837
|
task.result = result.content;
|
|
12227
12838
|
} else {
|
|
@@ -12230,7 +12841,7 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12230
12841
|
task.result = result.content;
|
|
12231
12842
|
}
|
|
12232
12843
|
}
|
|
12233
|
-
_tmp = _ + 1 | 0;
|
|
12844
|
+
_tmp$2 = _ + 1 | 0;
|
|
12234
12845
|
continue;
|
|
12235
12846
|
} else {
|
|
12236
12847
|
break;
|
|
@@ -13020,18 +13631,18 @@ function _M0MP36mizchi7tornado5ralph16MilestoneManager8to__json(self) {
|
|
|
13020
13631
|
}
|
|
13021
13632
|
return `{\"milestones\":[${_M0FP36mizchi7tornado5ralph13join__strings(parts, ",")}]}`;
|
|
13022
13633
|
}
|
|
13023
|
-
function _M0IP36mizchi7tornado6review17ReviewPerspectivePB4Show6output(
|
|
13024
|
-
switch (
|
|
13634
|
+
function _M0IP36mizchi7tornado6review17ReviewPerspectivePB4Show6output(_x_73, _x_74) {
|
|
13635
|
+
switch (_x_73) {
|
|
13025
13636
|
case 0: {
|
|
13026
|
-
|
|
13637
|
+
_x_74.method_table.method_0(_x_74.self, "CodeQuality");
|
|
13027
13638
|
return;
|
|
13028
13639
|
}
|
|
13029
13640
|
case 1: {
|
|
13030
|
-
|
|
13641
|
+
_x_74.method_table.method_0(_x_74.self, "Performance");
|
|
13031
13642
|
return;
|
|
13032
13643
|
}
|
|
13033
13644
|
default: {
|
|
13034
|
-
|
|
13645
|
+
_x_74.method_table.method_0(_x_74.self, "Security");
|
|
13035
13646
|
return;
|
|
13036
13647
|
}
|
|
13037
13648
|
}
|
|
@@ -13071,71 +13682,17 @@ function _M0MP36mizchi7tornado6review11ReviewAgent13build__prompt(self, perspect
|
|
|
13071
13682
|
}
|
|
13072
13683
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, agent_output);
|
|
13073
13684
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, "\n\n");
|
|
13074
|
-
|
|
13075
|
-
|
|
13076
|
-
|
|
13077
|
-
|
|
13078
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
13079
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 可読性と命名規約\n");
|
|
13080
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 関心の分離\n");
|
|
13081
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- エラーハンドリングの網羅性\n");
|
|
13082
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- テストカバレッジと正確性\n");
|
|
13083
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- コードの重複と不必要な複雑さ\n");
|
|
13084
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API 設計と公開インターフェースの明確さ\n");
|
|
13085
|
-
break;
|
|
13086
|
-
}
|
|
13087
|
-
case 1: {
|
|
13088
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: パフォーマンス\n");
|
|
13089
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
13090
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- アルゴリズムの計算量(時間・空間)\n");
|
|
13091
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 不要なメモリ確保やコピー\n");
|
|
13092
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 クエリや冗長な I/O\n");
|
|
13093
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- キャッシュの活用機会\n");
|
|
13094
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- ホットパスの最適化\n");
|
|
13095
|
-
break;
|
|
13096
|
-
}
|
|
13097
|
-
default: {
|
|
13098
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: セキュリティ\n");
|
|
13099
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
13100
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 入力値のバリデーションとサニタイズ\n");
|
|
13101
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- インジェクション脆弱性(コマンド、SQL、XSS)\n");
|
|
13102
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 認証・認可の不備\n");
|
|
13103
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 機密データの露出(シークレット、トークン、個人情報)\n");
|
|
13104
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 依存関係の安全性\n");
|
|
13105
|
-
}
|
|
13685
|
+
switch (perspective) {
|
|
13686
|
+
case 0: {
|
|
13687
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts24code__quality__checklist(self.lang));
|
|
13688
|
+
break;
|
|
13106
13689
|
}
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Proper separation of concerns\n");
|
|
13114
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Error handling completeness\n");
|
|
13115
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Test coverage and correctness\n");
|
|
13116
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Code duplication and unnecessary complexity\n");
|
|
13117
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API design and public interface clarity\n");
|
|
13118
|
-
break;
|
|
13119
|
-
}
|
|
13120
|
-
case 1: {
|
|
13121
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Performance\n");
|
|
13122
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
13123
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Algorithmic complexity (time and space)\n");
|
|
13124
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Unnecessary allocations or copies\n");
|
|
13125
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 queries or redundant I/O\n");
|
|
13126
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Caching opportunities\n");
|
|
13127
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Hot path optimization\n");
|
|
13128
|
-
break;
|
|
13129
|
-
}
|
|
13130
|
-
default: {
|
|
13131
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Security\n");
|
|
13132
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
13133
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Input validation and sanitization\n");
|
|
13134
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Injection vulnerabilities (command, SQL, XSS)\n");
|
|
13135
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Authentication and authorization gaps\n");
|
|
13136
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Sensitive data exposure (secrets, tokens, PII)\n");
|
|
13137
|
-
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Dependency safety\n");
|
|
13138
|
-
}
|
|
13690
|
+
case 1: {
|
|
13691
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts22performance__checklist(self.lang));
|
|
13692
|
+
break;
|
|
13693
|
+
}
|
|
13694
|
+
default: {
|
|
13695
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts19security__checklist(self.lang));
|
|
13139
13696
|
}
|
|
13140
13697
|
}
|
|
13141
13698
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, "\n\n");
|
|
@@ -13255,88 +13812,102 @@ function _M0MP36mizchi7tornado6review11ReviewAgent14parse__verdict(_self, output
|
|
|
13255
13812
|
}
|
|
13256
13813
|
return _M0DTP36mizchi7tornado5types13ReviewVerdict8Approved__;
|
|
13257
13814
|
}
|
|
13258
|
-
function
|
|
13259
|
-
|
|
13260
|
-
const prompt = _M0MP36mizchi7tornado6review11ReviewAgent13build__prompt(self, perspective, task.description, task_output, context);
|
|
13261
|
-
const system = self.lang === "ja" ? `あなたは ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)} に焦点を当てたコードレビュアーです。簡潔かつ具体的に指摘してください。問題の修正は行わず、TODO リストとして書き出してください。` : `You are a code reviewer focusing on ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}. Be concise and actionable. Do NOT fix issues — list them as TODOs.`;
|
|
13262
|
-
const output = _M0MP36mizchi7tornado5agent12BoxedBackend3run(backend, prompt, system, on_event);
|
|
13263
|
-
let verdict;
|
|
13264
|
-
let err;
|
|
13265
|
-
_L: {
|
|
13266
|
-
_L$2: {
|
|
13267
|
-
const _bind = output.status;
|
|
13268
|
-
if (_bind.$tag === 3) {
|
|
13269
|
-
const _Failed = _bind;
|
|
13270
|
-
const _err = _Failed._0;
|
|
13271
|
-
err = _err;
|
|
13272
|
-
break _L$2;
|
|
13273
|
-
} else {
|
|
13274
|
-
verdict = _M0MP36mizchi7tornado6review11ReviewAgent14parse__verdict(self, output.content);
|
|
13275
|
-
}
|
|
13276
|
-
break _L;
|
|
13277
|
-
}
|
|
13278
|
-
verdict = new _M0DTP36mizchi7tornado5types13ReviewVerdict8Rejected(`Review backend failed: ${_M0IPC16string6StringPB4Show10to__string(err)}`);
|
|
13279
|
-
}
|
|
13280
|
-
return new _M0TP36mizchi7tornado5types12ReviewResult(self.reviewer_id, verdict, output.content, "");
|
|
13815
|
+
function _M0MP36mizchi7tornado6review11ReviewAgent21build__system__prompt(self, perspective) {
|
|
13816
|
+
return self.lang === "ja" ? `あなたは ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)} に焦点を当てたコードレビュアーです。簡潔かつ具体的に指摘してください。問題の修正は行わず、TODO リストとして書き出してください。` : `You are a code reviewer focusing on ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}. Be concise and actionable. Do NOT fix issues — list them as TODOs.`;
|
|
13281
13817
|
}
|
|
13282
13818
|
function _M0MP36mizchi7tornado6review11ReviewAgent14review_2einner(self, task, backend, context, on_event) {
|
|
13283
|
-
const
|
|
13284
|
-
const summaries = _M0MPB13StringBuilder11new_2einner(0);
|
|
13285
|
-
const rejected_reason = new _M0TPC13ref3RefGOsE(undefined);
|
|
13819
|
+
const task_output = _M0MPC16option6Option10unwrap__orGsE(task.result, "");
|
|
13286
13820
|
const perspectives = _M0MP36mizchi7tornado6review11ReviewAgent12perspectives(self);
|
|
13821
|
+
const tasks = [];
|
|
13287
13822
|
const _bind = perspectives.length;
|
|
13288
13823
|
let _tmp = 0;
|
|
13289
13824
|
while (true) {
|
|
13290
13825
|
const _ = _tmp;
|
|
13291
13826
|
if (_ < _bind) {
|
|
13292
13827
|
const perspective = perspectives[_];
|
|
13293
|
-
|
|
13828
|
+
_M0MPC15array5Array4pushGsE(tasks, { _0: _M0MP36mizchi7tornado6review11ReviewAgent13build__prompt(self, perspective, task.description, task_output, context), _1: _M0MP36mizchi7tornado6review11ReviewAgent21build__system__prompt(self, perspective) });
|
|
13829
|
+
_tmp = _ + 1 | 0;
|
|
13830
|
+
continue;
|
|
13831
|
+
} else {
|
|
13832
|
+
break;
|
|
13833
|
+
}
|
|
13834
|
+
}
|
|
13835
|
+
const outputs = _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_event, "");
|
|
13836
|
+
const all_items = [];
|
|
13837
|
+
const summaries = _M0MPB13StringBuilder11new_2einner(0);
|
|
13838
|
+
const rejected_reason = new _M0TPC13ref3RefGOsE(undefined);
|
|
13839
|
+
const _bind$2 = 0;
|
|
13840
|
+
const _bind$3 = perspectives.length;
|
|
13841
|
+
let _tmp$2 = _bind$2;
|
|
13842
|
+
while (true) {
|
|
13843
|
+
const i = _tmp$2;
|
|
13844
|
+
if (i < _bind$3) {
|
|
13845
|
+
const perspective = _M0MPC15array5Array2atGRP36mizchi7tornado6review17ReviewPerspectiveE(perspectives, i);
|
|
13846
|
+
const output = _M0MPC15array5Array2atGsE(outputs, i);
|
|
13294
13847
|
_M0IPB13StringBuilderPB6Logger13write__string(summaries, `### ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}\n`);
|
|
13295
|
-
_M0IPB13StringBuilderPB6Logger13write__string(summaries,
|
|
13848
|
+
_M0IPB13StringBuilderPB6Logger13write__string(summaries, output.content);
|
|
13296
13849
|
_M0IPB13StringBuilderPB6Logger13write__string(summaries, "\n\n");
|
|
13297
|
-
let
|
|
13850
|
+
let verdict;
|
|
13851
|
+
let err;
|
|
13298
13852
|
_L: {
|
|
13299
13853
|
_L$2: {
|
|
13854
|
+
const _bind$4 = output.status;
|
|
13855
|
+
if (_bind$4.$tag === 3) {
|
|
13856
|
+
const _Failed = _bind$4;
|
|
13857
|
+
const _err = _Failed._0;
|
|
13858
|
+
err = _err;
|
|
13859
|
+
break _L$2;
|
|
13860
|
+
} else {
|
|
13861
|
+
verdict = _M0MP36mizchi7tornado6review11ReviewAgent14parse__verdict(self, output.content);
|
|
13862
|
+
}
|
|
13863
|
+
break _L;
|
|
13864
|
+
}
|
|
13865
|
+
verdict = new _M0DTP36mizchi7tornado5types13ReviewVerdict8Rejected(`Review backend failed: ${_M0IPC16string6StringPB4Show10to__string(err)}`);
|
|
13866
|
+
}
|
|
13867
|
+
let items;
|
|
13868
|
+
_L$2: {
|
|
13869
|
+
_L$3: {
|
|
13300
13870
|
let reason;
|
|
13301
|
-
_L$
|
|
13302
|
-
_L$
|
|
13303
|
-
|
|
13304
|
-
switch (_bind$2.$tag) {
|
|
13871
|
+
_L$4: {
|
|
13872
|
+
_L$5: {
|
|
13873
|
+
switch (verdict.$tag) {
|
|
13305
13874
|
case 2: {
|
|
13306
|
-
const _Rejected =
|
|
13875
|
+
const _Rejected = verdict;
|
|
13307
13876
|
const _reason = _Rejected._0;
|
|
13308
13877
|
reason = _reason;
|
|
13309
|
-
break _L$
|
|
13878
|
+
break _L$5;
|
|
13310
13879
|
}
|
|
13311
13880
|
case 1: {
|
|
13312
|
-
const _NeedsChanges =
|
|
13881
|
+
const _NeedsChanges = verdict;
|
|
13313
13882
|
const _items = _NeedsChanges._0;
|
|
13314
13883
|
items = _items;
|
|
13315
|
-
break _L$
|
|
13884
|
+
break _L$3;
|
|
13316
13885
|
}
|
|
13317
13886
|
}
|
|
13318
|
-
break _L$
|
|
13887
|
+
break _L$4;
|
|
13888
|
+
}
|
|
13889
|
+
const _bind$4 = rejected_reason.val;
|
|
13890
|
+
if (_bind$4 === undefined) {
|
|
13891
|
+
rejected_reason.val = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(reason)}`;
|
|
13319
13892
|
}
|
|
13320
|
-
rejected_reason.val = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(reason)}`;
|
|
13321
|
-
break;
|
|
13322
13893
|
}
|
|
13323
|
-
break _L;
|
|
13894
|
+
break _L$2;
|
|
13324
13895
|
}
|
|
13325
|
-
const _bind$
|
|
13326
|
-
let _tmp$
|
|
13896
|
+
const _bind$4 = items.length;
|
|
13897
|
+
let _tmp$3 = 0;
|
|
13327
13898
|
while (true) {
|
|
13328
|
-
const _
|
|
13329
|
-
if (_
|
|
13330
|
-
const item = items[_
|
|
13899
|
+
const _ = _tmp$3;
|
|
13900
|
+
if (_ < _bind$4) {
|
|
13901
|
+
const item = items[_];
|
|
13331
13902
|
_M0MPC15array5Array4pushGsE(all_items, `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(item)}`);
|
|
13332
|
-
_tmp$
|
|
13903
|
+
_tmp$3 = _ + 1 | 0;
|
|
13333
13904
|
continue;
|
|
13334
13905
|
} else {
|
|
13335
13906
|
break;
|
|
13336
13907
|
}
|
|
13337
13908
|
}
|
|
13338
13909
|
}
|
|
13339
|
-
_tmp =
|
|
13910
|
+
_tmp$2 = i + 1 | 0;
|
|
13340
13911
|
continue;
|
|
13341
13912
|
} else {
|
|
13342
13913
|
break;
|
|
@@ -13346,11 +13917,11 @@ function _M0MP36mizchi7tornado6review11ReviewAgent14review_2einner(self, task, b
|
|
|
13346
13917
|
let reason;
|
|
13347
13918
|
_L: {
|
|
13348
13919
|
_L$2: {
|
|
13349
|
-
const _bind$
|
|
13350
|
-
if (_bind$
|
|
13920
|
+
const _bind$4 = rejected_reason.val;
|
|
13921
|
+
if (_bind$4 === undefined) {
|
|
13351
13922
|
verdict = _M0MPC15array5Array9is__emptyGsE(all_items) ? _M0DTP36mizchi7tornado5types13ReviewVerdict8Approved__ : new _M0DTP36mizchi7tornado5types13ReviewVerdict12NeedsChanges(all_items);
|
|
13352
13923
|
} else {
|
|
13353
|
-
const _Some = _bind$
|
|
13924
|
+
const _Some = _bind$4;
|
|
13354
13925
|
const _reason = _Some;
|
|
13355
13926
|
reason = _reason;
|
|
13356
13927
|
break _L$2;
|
|
@@ -13495,6 +14066,12 @@ function _M0FP46mizchi7tornado3cmd3app23build__plan__file__task(plan_path, revie
|
|
|
13495
14066
|
}
|
|
13496
14067
|
return _M0MPB13StringBuilder10to__string(buf);
|
|
13497
14068
|
}
|
|
14069
|
+
function _M0FP46mizchi7tornado3cmd3app18append__file__sync(path, content) {
|
|
14070
|
+
_M0FP46mizchi7tornado3cmd3app22js__append__file__sync(path, content);
|
|
14071
|
+
}
|
|
14072
|
+
function _M0FP46mizchi7tornado3cmd3app14get__log__file() {
|
|
14073
|
+
return _M0FP46mizchi7tornado3cmd3app18js__get__log__file();
|
|
14074
|
+
}
|
|
13498
14075
|
function _M0FP46mizchi7tornado3cmd3app14now__timestamp() {
|
|
13499
14076
|
return _M0FP46mizchi7tornado3cmd3app18js__now__timestamp();
|
|
13500
14077
|
}
|
|
@@ -13528,9 +14105,14 @@ function _M0FP46mizchi7tornado3cmd3app3log(level, msg) {
|
|
|
13528
14105
|
}
|
|
13529
14106
|
if (_M0MPC16string6String9is__empty(color)) {
|
|
13530
14107
|
_M0FPB7printlnGsE(`[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}`);
|
|
13531
|
-
return;
|
|
13532
14108
|
} else {
|
|
13533
14109
|
_M0FPB7printlnGsE(`${_M0IPC16string6StringPB4Show10to__string(color)}[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\u001b[0m`);
|
|
14110
|
+
}
|
|
14111
|
+
const log_file = _M0FP46mizchi7tornado3cmd3app14get__log__file();
|
|
14112
|
+
if (!_M0MPC16string6String9is__empty(log_file)) {
|
|
14113
|
+
_M0FP46mizchi7tornado3cmd3app18append__file__sync(log_file, `[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\n`);
|
|
14114
|
+
return;
|
|
14115
|
+
} else {
|
|
13534
14116
|
return;
|
|
13535
14117
|
}
|
|
13536
14118
|
}
|
|
@@ -15135,19 +15717,23 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15135
15717
|
}
|
|
15136
15718
|
}
|
|
15137
15719
|
}
|
|
15720
|
+
function _M0FP46mizchi7tornado3cmd3app14set__log__file(path) {
|
|
15721
|
+
_M0FP46mizchi7tornado3cmd3app18js__set__log__file(path);
|
|
15722
|
+
}
|
|
15138
15723
|
(() => {
|
|
15139
15724
|
const args = _M0FP36mizchi1x3sys14get__cli__args();
|
|
15140
15725
|
const command = _M0FP36mizchi7tornado3cli16parse__cli__args(args, _M0FP46mizchi7tornado3cmd3app18is__existing__file);
|
|
15141
15726
|
let path;
|
|
15142
15727
|
_L: {
|
|
15143
15728
|
let cli_lang;
|
|
15144
|
-
let rlm;
|
|
15145
|
-
let review_kind;
|
|
15146
|
-
let plan_path;
|
|
15147
|
-
let config_path;
|
|
15148
|
-
let dev_kind;
|
|
15149
|
-
let review_interval;
|
|
15150
15729
|
let ralph;
|
|
15730
|
+
let review_interval;
|
|
15731
|
+
let dev_kind;
|
|
15732
|
+
let config_path;
|
|
15733
|
+
let plan_path;
|
|
15734
|
+
let review_kind;
|
|
15735
|
+
let rlm;
|
|
15736
|
+
let log_path;
|
|
15151
15737
|
let warnings;
|
|
15152
15738
|
_L$2: {
|
|
15153
15739
|
switch (command.$tag) {
|
|
@@ -15160,16 +15746,18 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15160
15746
|
const _review_interval = _Run._4;
|
|
15161
15747
|
const _rlm = _Run._5;
|
|
15162
15748
|
const _ralph = _Run._6;
|
|
15749
|
+
const _log_path = _Run._8;
|
|
15163
15750
|
const _cli_lang = _Run._7;
|
|
15164
|
-
const _warnings = _Run.
|
|
15751
|
+
const _warnings = _Run._9;
|
|
15165
15752
|
cli_lang = _cli_lang;
|
|
15166
|
-
rlm = _rlm;
|
|
15167
|
-
review_kind = _review_kind;
|
|
15168
|
-
plan_path = _plan_path;
|
|
15169
|
-
config_path = _config_path;
|
|
15170
|
-
dev_kind = _dev_kind;
|
|
15171
|
-
review_interval = _review_interval;
|
|
15172
15753
|
ralph = _ralph;
|
|
15754
|
+
review_interval = _review_interval;
|
|
15755
|
+
dev_kind = _dev_kind;
|
|
15756
|
+
config_path = _config_path;
|
|
15757
|
+
plan_path = _plan_path;
|
|
15758
|
+
review_kind = _review_kind;
|
|
15759
|
+
rlm = _rlm;
|
|
15760
|
+
log_path = _log_path;
|
|
15173
15761
|
warnings = _warnings;
|
|
15174
15762
|
break _L$2;
|
|
15175
15763
|
}
|
|
@@ -15199,6 +15787,20 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15199
15787
|
}
|
|
15200
15788
|
}
|
|
15201
15789
|
const lang = _M0FP46mizchi7tornado3cmd3app13resolve__lang(cli_lang);
|
|
15790
|
+
let path$2;
|
|
15791
|
+
_L$3: {
|
|
15792
|
+
_L$4: {
|
|
15793
|
+
if (log_path === undefined) {
|
|
15794
|
+
} else {
|
|
15795
|
+
const _Some = log_path;
|
|
15796
|
+
const _path = _Some;
|
|
15797
|
+
path$2 = _path;
|
|
15798
|
+
break _L$4;
|
|
15799
|
+
}
|
|
15800
|
+
break _L$3;
|
|
15801
|
+
}
|
|
15802
|
+
_M0FP46mizchi7tornado3cmd3app14set__log__file(path$2);
|
|
15803
|
+
}
|
|
15202
15804
|
if (ralph) {
|
|
15203
15805
|
_M0FP46mizchi7tornado3cmd3app10run__ralph(config_path, lang, dev_kind, review_kind);
|
|
15204
15806
|
return;
|