@ymdvsymd/tornado 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -4
- package/bin/tornado.js +1054 -523
- package/package.json +5 -5
- 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
|
}
|
|
@@ -1063,68 +1063,68 @@ const _M0FPC17strconv17parse__scientificN8exp__numS241 = $0L;
|
|
|
1063
1063
|
const _M0FPC17strconv13parse__numberN11exp__numberS222 = $0L;
|
|
1064
1064
|
const _M0FPC17strconv12double__info = new _M0TPC17strconv9FloatInfo(52, 11, -1023);
|
|
1065
1065
|
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 = [
|
|
1066
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1349 = { _0: 0, _1: "" };
|
|
1067
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1350 = { _0: 1, _1: "5" };
|
|
1068
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1351 = { _0: 1, _1: "25" };
|
|
1069
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1352 = { _0: 1, _1: "125" };
|
|
1070
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1353 = { _0: 2, _1: "625" };
|
|
1071
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1354 = { _0: 2, _1: "3125" };
|
|
1072
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1355 = { _0: 2, _1: "15625" };
|
|
1073
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1356 = { _0: 3, _1: "78125" };
|
|
1074
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1357 = { _0: 3, _1: "390625" };
|
|
1075
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1358 = { _0: 3, _1: "1953125" };
|
|
1076
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1359 = { _0: 4, _1: "9765625" };
|
|
1077
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1360 = { _0: 4, _1: "48828125" };
|
|
1078
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1361 = { _0: 4, _1: "244140625" };
|
|
1079
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1362 = { _0: 4, _1: "1220703125" };
|
|
1080
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1363 = { _0: 5, _1: "6103515625" };
|
|
1081
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1364 = { _0: 5, _1: "30517578125" };
|
|
1082
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1365 = { _0: 5, _1: "152587890625" };
|
|
1083
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1366 = { _0: 6, _1: "762939453125" };
|
|
1084
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1367 = { _0: 6, _1: "3814697265625" };
|
|
1085
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1368 = { _0: 6, _1: "19073486328125" };
|
|
1086
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1369 = { _0: 7, _1: "95367431640625" };
|
|
1087
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1370 = { _0: 7, _1: "476837158203125" };
|
|
1088
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1371 = { _0: 7, _1: "2384185791015625" };
|
|
1089
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1372 = { _0: 7, _1: "11920928955078125" };
|
|
1090
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1373 = { _0: 8, _1: "59604644775390625" };
|
|
1091
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1374 = { _0: 8, _1: "298023223876953125" };
|
|
1092
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1375 = { _0: 8, _1: "1490116119384765625" };
|
|
1093
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1376 = { _0: 9, _1: "7450580596923828125" };
|
|
1094
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1377 = { _0: 9, _1: "37252902984619140625" };
|
|
1095
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1378 = { _0: 9, _1: "186264514923095703125" };
|
|
1096
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1379 = { _0: 10, _1: "931322574615478515625" };
|
|
1097
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1380 = { _0: 10, _1: "4656612873077392578125" };
|
|
1098
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1381 = { _0: 10, _1: "23283064365386962890625" };
|
|
1099
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1382 = { _0: 10, _1: "116415321826934814453125" };
|
|
1100
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1383 = { _0: 11, _1: "582076609134674072265625" };
|
|
1101
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1384 = { _0: 11, _1: "2910383045673370361328125" };
|
|
1102
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1385 = { _0: 11, _1: "14551915228366851806640625" };
|
|
1103
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1386 = { _0: 12, _1: "72759576141834259033203125" };
|
|
1104
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1387 = { _0: 12, _1: "363797880709171295166015625" };
|
|
1105
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1388 = { _0: 12, _1: "1818989403545856475830078125" };
|
|
1106
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1389 = { _0: 13, _1: "9094947017729282379150390625" };
|
|
1107
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1390 = { _0: 13, _1: "45474735088646411895751953125" };
|
|
1108
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1391 = { _0: 13, _1: "227373675443232059478759765625" };
|
|
1109
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1392 = { _0: 13, _1: "1136868377216160297393798828125" };
|
|
1110
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1393 = { _0: 14, _1: "5684341886080801486968994140625" };
|
|
1111
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1394 = { _0: 14, _1: "28421709430404007434844970703125" };
|
|
1112
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1395 = { _0: 14, _1: "142108547152020037174224853515625" };
|
|
1113
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1396 = { _0: 15, _1: "710542735760100185871124267578125" };
|
|
1114
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1397 = { _0: 15, _1: "3552713678800500929355621337890625" };
|
|
1115
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1398 = { _0: 15, _1: "17763568394002504646778106689453125" };
|
|
1116
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1399 = { _0: 16, _1: "88817841970012523233890533447265625" };
|
|
1117
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1400 = { _0: 16, _1: "444089209850062616169452667236328125" };
|
|
1118
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1401 = { _0: 16, _1: "2220446049250313080847263336181640625" };
|
|
1119
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1402 = { _0: 16, _1: "11102230246251565404236316680908203125" };
|
|
1120
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1403 = { _0: 17, _1: "55511151231257827021181583404541015625" };
|
|
1121
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1404 = { _0: 17, _1: "277555756156289135105907917022705078125" };
|
|
1122
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1405 = { _0: 17, _1: "1387778780781445675529539585113525390625" };
|
|
1123
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1406 = { _0: 18, _1: "6938893903907228377647697925567626953125" };
|
|
1124
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1407 = { _0: 18, _1: "34694469519536141888238489627838134765625" };
|
|
1125
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1408 = { _0: 18, _1: "173472347597680709441192448139190673828125" };
|
|
1126
|
+
const _M0FPC17strconv34left__shift__cheats_2etuple_2f1409 = { _0: 19, _1: "867361737988403547205962240695953369140625" };
|
|
1127
|
+
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
1128
|
const _M0FPC17strconv10int__pow10 = [$1L, $10L, $100L, $1000L, $10000L, $100000L, $1000000L, $10000000L, $100000000L, $1000000000L, $10000000000L, $100000000000L, $1000000000000L, $10000000000000L, $100000000000000L, $1000000000000000L];
|
|
1129
1129
|
const _M0FPC17strconv25max__exponent__fast__path = $22L;
|
|
1130
1130
|
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 +1137,14 @@ const _M0FP26mizchi3llm25default__anthropic__model = "claude-sonnet-4-20250514";
|
|
|
1137
1137
|
const _M0FP36mizchi7tornado6config19valid__agent__kinds = ["claude-code", "codex", "api", "mock"];
|
|
1138
1138
|
const _M0FP36mizchi7tornado6config19valid__agent__roles = ["dev", "builder", "review", "orchestrator", "planner", "verifier"];
|
|
1139
1139
|
const _M0FP46mizchi7tornado3cmd3app13session__file = ".tornado/session.json";
|
|
1140
|
-
const
|
|
1141
|
-
const
|
|
1140
|
+
const _M0FPB33brute__force__find_2econstr_2f426 = 0;
|
|
1141
|
+
const _M0FPB43boyer__moore__horspool__find_2econstr_2f412 = 0;
|
|
1142
1142
|
const _M0FPB4seed = _M0FPB12random__seed();
|
|
1143
1143
|
const _M0FPC16double13neg__infinity = _M0MPC15int645Int6423reinterpret__as__double($_4503599627370496L);
|
|
1144
1144
|
const _M0FPC16double14not__a__number = _M0MPC15int645Int6423reinterpret__as__double($9221120237041090561L);
|
|
1145
1145
|
const _M0FPC16double8infinity = _M0MPC15int645Int6423reinterpret__as__double($9218868437227405312L);
|
|
1146
1146
|
const _M0FPC17strconv25max__mantissa__fast__path = _M0IPC16uint646UInt64PB3Shl3shl($2L, 52);
|
|
1147
|
-
const
|
|
1147
|
+
const _M0FPC17strconv28checked__mul_2econstr_2f1826 = $0L;
|
|
1148
1148
|
function _M0FPC15abort5abortGRPC16string10StringViewE(msg) {
|
|
1149
1149
|
return $panic();
|
|
1150
1150
|
}
|
|
@@ -1246,6 +1246,24 @@ function _M0MPC15array5Array2atGcE(self, index) {
|
|
|
1246
1246
|
return $panic();
|
|
1247
1247
|
}
|
|
1248
1248
|
}
|
|
1249
|
+
function _M0MPC15array5Array2atGRP36mizchi7tornado6review17ReviewPerspectiveE(self, index) {
|
|
1250
|
+
const len = self.length;
|
|
1251
|
+
if (index >= 0 && index < len) {
|
|
1252
|
+
$bound_check(self, index);
|
|
1253
|
+
return self[index];
|
|
1254
|
+
} else {
|
|
1255
|
+
return $panic();
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
function _M0MPC15array5Array2atGRP36mizchi7tornado5ralph19VerifierPerspectiveE(self, index) {
|
|
1259
|
+
const len = self.length;
|
|
1260
|
+
if (index >= 0 && index < len) {
|
|
1261
|
+
$bound_check(self, index);
|
|
1262
|
+
return self[index];
|
|
1263
|
+
} else {
|
|
1264
|
+
return $panic();
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1249
1267
|
function _M0MPB13SourceLocRepr5parse(repr) {
|
|
1250
1268
|
const _bind = new _M0TPC16string10StringView(repr, 0, repr.length);
|
|
1251
1269
|
const _data = _M0MPC16string10StringView4data(_bind);
|
|
@@ -1839,6 +1857,11 @@ function _M0IP016_24default__implPB4Show10to__stringGRPB9SourceLocE(self) {
|
|
|
1839
1857
|
_M0IPB9SourceLocPB4Show6output(self, { self: logger, method_table: _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1840
1858
|
return _M0MPB13StringBuilder10to__string(logger);
|
|
1841
1859
|
}
|
|
1860
|
+
function _M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(self) {
|
|
1861
|
+
const logger = _M0MPB13StringBuilder11new_2einner(0);
|
|
1862
|
+
_M0IP36mizchi7tornado5ralph19VerifierPerspectivePB4Show6output(self, { self: logger, method_table: _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1863
|
+
return _M0MPB13StringBuilder10to__string(logger);
|
|
1864
|
+
}
|
|
1842
1865
|
function _M0MPB4Iter4nextGUssEE(self) {
|
|
1843
1866
|
const _func = self;
|
|
1844
1867
|
return _func();
|
|
@@ -2326,7 +2349,7 @@ function _M0FPB28boyer__moore__horspool__find(haystack, needle) {
|
|
|
2326
2349
|
return undefined;
|
|
2327
2350
|
}
|
|
2328
2351
|
} else {
|
|
2329
|
-
return
|
|
2352
|
+
return _M0FPB43boyer__moore__horspool__find_2econstr_2f412;
|
|
2330
2353
|
}
|
|
2331
2354
|
}
|
|
2332
2355
|
function _M0FPB18brute__force__find(haystack, needle) {
|
|
@@ -2373,7 +2396,7 @@ function _M0FPB18brute__force__find(haystack, needle) {
|
|
|
2373
2396
|
return undefined;
|
|
2374
2397
|
}
|
|
2375
2398
|
} else {
|
|
2376
|
-
return
|
|
2399
|
+
return _M0FPB33brute__force__find_2econstr_2f426;
|
|
2377
2400
|
}
|
|
2378
2401
|
}
|
|
2379
2402
|
function _M0MPC16string10StringView4find(self, str) {
|
|
@@ -6684,7 +6707,7 @@ function _M0MPC17strconv7Decimal16to__double__priv(self) {
|
|
|
6684
6707
|
}
|
|
6685
6708
|
function _M0FPC17strconv12checked__mul(a, b) {
|
|
6686
6709
|
if (_M0IPC16uint646UInt64PB2Eq5equal(a, $0L) || _M0IPC16uint646UInt64PB2Eq5equal(b, $0L)) {
|
|
6687
|
-
return
|
|
6710
|
+
return _M0FPC17strconv28checked__mul_2econstr_2f1826;
|
|
6688
6711
|
}
|
|
6689
6712
|
if (_M0IPC16uint646UInt64PB2Eq5equal(a, $1L)) {
|
|
6690
6713
|
return b;
|
|
@@ -9564,6 +9587,149 @@ function _M0FP36mizchi7tornado5agent25parse__sdk__result__event(map, on_output)
|
|
|
9564
9587
|
return;
|
|
9565
9588
|
}
|
|
9566
9589
|
}
|
|
9590
|
+
function _M0MP36mizchi7tornado5agent16OutputLineBuffer4push(self, chunk, on_line) {
|
|
9591
|
+
_M0IPB13StringBuilderPB6Logger13write__string(self.buf, chunk);
|
|
9592
|
+
const content = _M0MPB13StringBuilder10to__string(self.buf);
|
|
9593
|
+
const last_nl = new _M0TPC13ref3RefGiE(-1);
|
|
9594
|
+
const _bind = 0;
|
|
9595
|
+
const _bind$2 = content.length;
|
|
9596
|
+
let _tmp = _bind;
|
|
9597
|
+
while (true) {
|
|
9598
|
+
const i = _tmp;
|
|
9599
|
+
if (i < _bind$2) {
|
|
9600
|
+
$bound_check(content, i);
|
|
9601
|
+
if (_M0IPC16uint166UInt16PB2Eq5equal(content.charCodeAt(i), 10 & 65535)) {
|
|
9602
|
+
last_nl.val = i;
|
|
9603
|
+
}
|
|
9604
|
+
_tmp = i + 1 | 0;
|
|
9605
|
+
continue;
|
|
9606
|
+
} else {
|
|
9607
|
+
break;
|
|
9608
|
+
}
|
|
9609
|
+
}
|
|
9610
|
+
if (last_nl.val < 0) {
|
|
9611
|
+
return undefined;
|
|
9612
|
+
}
|
|
9613
|
+
const complete = content.substring(0, last_nl.val);
|
|
9614
|
+
const remainder = (last_nl.val + 1 | 0) < content.length ? content.substring(last_nl.val + 1 | 0, content.length) : "";
|
|
9615
|
+
_M0MPB13StringBuilder5reset(self.buf);
|
|
9616
|
+
_M0IPB13StringBuilderPB6Logger13write__string(self.buf, remainder);
|
|
9617
|
+
const _bind$3 = "\n";
|
|
9618
|
+
const _it = _M0MPC16string6String5split(complete, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length));
|
|
9619
|
+
while (true) {
|
|
9620
|
+
let line;
|
|
9621
|
+
_L: {
|
|
9622
|
+
const _bind$4 = _M0MPB4Iter4nextGUssEE(_it);
|
|
9623
|
+
if (_bind$4 === undefined) {
|
|
9624
|
+
return;
|
|
9625
|
+
} else {
|
|
9626
|
+
const _Some = _bind$4;
|
|
9627
|
+
const _line = _Some;
|
|
9628
|
+
line = _line;
|
|
9629
|
+
break _L;
|
|
9630
|
+
}
|
|
9631
|
+
}
|
|
9632
|
+
const s = _M0IPC16string10StringViewPB4Show10to__string(line);
|
|
9633
|
+
let stripped;
|
|
9634
|
+
const _bind$4 = "\r";
|
|
9635
|
+
if (_M0MPC16string6String11has__suffix(s, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length))) {
|
|
9636
|
+
stripped = s.substring(0, s.length - 1 | 0);
|
|
9637
|
+
} else {
|
|
9638
|
+
stripped = s;
|
|
9639
|
+
}
|
|
9640
|
+
on_line(stripped);
|
|
9641
|
+
continue;
|
|
9642
|
+
}
|
|
9643
|
+
}
|
|
9644
|
+
function _M0FP36mizchi7tornado5agent25parse__sdk__stream__event(event, buf, line_buf, on_output) {
|
|
9645
|
+
let event_type;
|
|
9646
|
+
_L: {
|
|
9647
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(event, "type");
|
|
9648
|
+
if (_bind === undefined) {
|
|
9649
|
+
return;
|
|
9650
|
+
} else {
|
|
9651
|
+
const _Some = _bind;
|
|
9652
|
+
const _x = _Some;
|
|
9653
|
+
if (_x.$tag === 4) {
|
|
9654
|
+
const _String = _x;
|
|
9655
|
+
const _event_type = _String._0;
|
|
9656
|
+
event_type = _event_type;
|
|
9657
|
+
break _L;
|
|
9658
|
+
} else {
|
|
9659
|
+
return;
|
|
9660
|
+
}
|
|
9661
|
+
}
|
|
9662
|
+
}
|
|
9663
|
+
switch (event_type) {
|
|
9664
|
+
case "content_block_start": {
|
|
9665
|
+
_M0FP36mizchi7tornado5agent28parse__content__block__start(event, on_output);
|
|
9666
|
+
return;
|
|
9667
|
+
}
|
|
9668
|
+
case "content_block_delta": {
|
|
9669
|
+
let delta;
|
|
9670
|
+
_L$2: {
|
|
9671
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(event, "delta");
|
|
9672
|
+
if (_bind === undefined) {
|
|
9673
|
+
return;
|
|
9674
|
+
} else {
|
|
9675
|
+
const _Some = _bind;
|
|
9676
|
+
const _x = _Some;
|
|
9677
|
+
if (_x.$tag === 6) {
|
|
9678
|
+
const _Object = _x;
|
|
9679
|
+
const _delta = _Object._0;
|
|
9680
|
+
delta = _delta;
|
|
9681
|
+
break _L$2;
|
|
9682
|
+
} else {
|
|
9683
|
+
return;
|
|
9684
|
+
}
|
|
9685
|
+
}
|
|
9686
|
+
}
|
|
9687
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(delta, "type");
|
|
9688
|
+
if (_bind === undefined) {
|
|
9689
|
+
return;
|
|
9690
|
+
} else {
|
|
9691
|
+
const _Some = _bind;
|
|
9692
|
+
const _x = _Some;
|
|
9693
|
+
if (_x.$tag === 4) {
|
|
9694
|
+
const _String = _x;
|
|
9695
|
+
const _x$2 = _String._0;
|
|
9696
|
+
if (_x$2 === "text_delta") {
|
|
9697
|
+
let text;
|
|
9698
|
+
_L$3: {
|
|
9699
|
+
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(delta, "text");
|
|
9700
|
+
if (_bind$2 === undefined) {
|
|
9701
|
+
return;
|
|
9702
|
+
} else {
|
|
9703
|
+
const _Some$2 = _bind$2;
|
|
9704
|
+
const _x$3 = _Some$2;
|
|
9705
|
+
if (_x$3.$tag === 4) {
|
|
9706
|
+
const _String$2 = _x$3;
|
|
9707
|
+
const _text = _String$2._0;
|
|
9708
|
+
text = _text;
|
|
9709
|
+
break _L$3;
|
|
9710
|
+
} else {
|
|
9711
|
+
return;
|
|
9712
|
+
}
|
|
9713
|
+
}
|
|
9714
|
+
}
|
|
9715
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, text);
|
|
9716
|
+
_M0MP36mizchi7tornado5agent16OutputLineBuffer4push(line_buf, text, (line) => {
|
|
9717
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent10OutputLine(line));
|
|
9718
|
+
});
|
|
9719
|
+
return;
|
|
9720
|
+
} else {
|
|
9721
|
+
return;
|
|
9722
|
+
}
|
|
9723
|
+
} else {
|
|
9724
|
+
return;
|
|
9725
|
+
}
|
|
9726
|
+
}
|
|
9727
|
+
}
|
|
9728
|
+
default: {
|
|
9729
|
+
return;
|
|
9730
|
+
}
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9567
9733
|
function _M0FP36mizchi7tornado5agent20parse__system__event(map, on_output) {
|
|
9568
9734
|
let subtype;
|
|
9569
9735
|
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "subtype");
|
|
@@ -9866,150 +10032,121 @@ function _M0FP36mizchi7tornado5agent19parse__tool__result(map, on_output) {
|
|
|
9866
10032
|
return;
|
|
9867
10033
|
}
|
|
9868
10034
|
}
|
|
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;
|
|
10035
|
+
function _M0FP36mizchi7tornado5agent23parse__sdk__event__json(map, buf, line_buf, error_buf, on_output, on_session_id) {
|
|
10036
|
+
let sid;
|
|
10037
|
+
_L: {
|
|
10038
|
+
_L$2: {
|
|
10039
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "session_id");
|
|
10040
|
+
if (_bind === undefined) {
|
|
9904
10041
|
} else {
|
|
9905
|
-
const _Some = _bind
|
|
9906
|
-
const
|
|
9907
|
-
|
|
9908
|
-
|
|
10042
|
+
const _Some = _bind;
|
|
10043
|
+
const _x = _Some;
|
|
10044
|
+
if (_x.$tag === 4) {
|
|
10045
|
+
const _String = _x;
|
|
10046
|
+
const _sid = _String._0;
|
|
10047
|
+
sid = _sid;
|
|
10048
|
+
break _L$2;
|
|
10049
|
+
}
|
|
9909
10050
|
}
|
|
10051
|
+
break _L;
|
|
9910
10052
|
}
|
|
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;
|
|
10053
|
+
if (!_M0MPC16string6String9is__empty(sid)) {
|
|
10054
|
+
on_session_id(sid);
|
|
9918
10055
|
}
|
|
9919
|
-
on_line(stripped);
|
|
9920
|
-
continue;
|
|
9921
10056
|
}
|
|
9922
|
-
}
|
|
9923
|
-
function _M0MP36mizchi7tornado5agent17SubprocessBackend20parse__stream__event(_self, event, buf, line_buf, on_output) {
|
|
9924
10057
|
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;
|
|
10058
|
+
_L$2: {
|
|
10059
|
+
_L$3: {
|
|
10060
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "type");
|
|
10061
|
+
if (_bind === undefined) {
|
|
9937
10062
|
} else {
|
|
9938
|
-
|
|
10063
|
+
const _Some = _bind;
|
|
10064
|
+
const _x = _Some;
|
|
10065
|
+
if (_x.$tag === 4) {
|
|
10066
|
+
const _String = _x;
|
|
10067
|
+
const _event_type = _String._0;
|
|
10068
|
+
event_type = _event_type;
|
|
10069
|
+
break _L$3;
|
|
10070
|
+
}
|
|
9939
10071
|
}
|
|
10072
|
+
break _L$2;
|
|
9940
10073
|
}
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
10074
|
+
switch (event_type) {
|
|
10075
|
+
case "system": {
|
|
10076
|
+
_M0FP36mizchi7tornado5agent20parse__system__event(map, on_output);
|
|
10077
|
+
break;
|
|
10078
|
+
}
|
|
10079
|
+
case "assistant": {
|
|
10080
|
+
_M0FP36mizchi7tornado5agent18parse__tool__calls(map, on_output);
|
|
10081
|
+
break;
|
|
10082
|
+
}
|
|
10083
|
+
case "stream_event": {
|
|
10084
|
+
let event;
|
|
10085
|
+
_L$4: {
|
|
10086
|
+
_L$5: {
|
|
10087
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "event");
|
|
10088
|
+
if (_bind === undefined) {
|
|
10089
|
+
} else {
|
|
10090
|
+
const _Some = _bind;
|
|
10091
|
+
const _x = _Some;
|
|
10092
|
+
if (_x.$tag === 6) {
|
|
10093
|
+
const _Object = _x;
|
|
10094
|
+
const _event = _Object._0;
|
|
10095
|
+
event = _event;
|
|
10096
|
+
break _L$5;
|
|
10097
|
+
}
|
|
10098
|
+
}
|
|
10099
|
+
break _L$4;
|
|
10100
|
+
}
|
|
10101
|
+
_M0FP36mizchi7tornado5agent25parse__sdk__stream__event(event, buf, line_buf, on_output);
|
|
10102
|
+
}
|
|
10103
|
+
break;
|
|
10104
|
+
}
|
|
10105
|
+
case "tool_result": {
|
|
10106
|
+
_M0FP36mizchi7tornado5agent19parse__tool__result(map, on_output);
|
|
10107
|
+
break;
|
|
10108
|
+
}
|
|
10109
|
+
case "content_block_start": {
|
|
10110
|
+
_M0FP36mizchi7tornado5agent28parse__content__block__start(map, on_output);
|
|
10111
|
+
break;
|
|
10112
|
+
}
|
|
10113
|
+
case "result": {
|
|
10114
|
+
_M0FP36mizchi7tornado5agent25parse__sdk__result__event(map, on_output);
|
|
10115
|
+
const _bind = _M0MPB3Map3getGsRPB4JsonE(map, "is_error");
|
|
9951
10116
|
if (_bind === undefined) {
|
|
9952
|
-
return;
|
|
9953
10117
|
} else {
|
|
9954
10118
|
const _Some = _bind;
|
|
9955
10119
|
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;
|
|
10120
|
+
if (_x.$tag === 1) {
|
|
10121
|
+
let err_msg;
|
|
10122
|
+
_L$5: {
|
|
10123
|
+
_L$6: {
|
|
10124
|
+
const _bind$2 = _M0MPB3Map3getGsRPB4JsonE(map, "result");
|
|
10125
|
+
if (_bind$2 === undefined) {
|
|
9989
10126
|
} else {
|
|
9990
|
-
|
|
10127
|
+
const _Some$2 = _bind$2;
|
|
10128
|
+
const _x$2 = _Some$2;
|
|
10129
|
+
if (_x$2.$tag === 4) {
|
|
10130
|
+
const _String = _x$2;
|
|
10131
|
+
const _err_msg = _String._0;
|
|
10132
|
+
err_msg = _err_msg;
|
|
10133
|
+
break _L$6;
|
|
10134
|
+
}
|
|
9991
10135
|
}
|
|
10136
|
+
break _L$5;
|
|
9992
10137
|
}
|
|
10138
|
+
_M0IPB13StringBuilderPB6Logger13write__string(error_buf, err_msg);
|
|
9993
10139
|
}
|
|
9994
|
-
|
|
9995
|
-
_M0MP36mizchi7tornado5agent16OutputLineBuffer4push(line_buf, text, (line) => {
|
|
9996
|
-
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent10OutputLine(line));
|
|
9997
|
-
});
|
|
9998
|
-
return;
|
|
9999
|
-
} else {
|
|
10000
|
-
return;
|
|
10140
|
+
return true;
|
|
10001
10141
|
}
|
|
10002
|
-
} else {
|
|
10003
|
-
return;
|
|
10004
10142
|
}
|
|
10143
|
+
break;
|
|
10005
10144
|
}
|
|
10006
10145
|
}
|
|
10007
|
-
default: {
|
|
10008
|
-
return;
|
|
10009
|
-
}
|
|
10010
10146
|
}
|
|
10147
|
+
return false;
|
|
10011
10148
|
}
|
|
10012
|
-
function
|
|
10149
|
+
function _M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, on_session_id) {
|
|
10013
10150
|
let json;
|
|
10014
10151
|
let _try_err;
|
|
10015
10152
|
_L: {
|
|
@@ -10029,167 +10166,44 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend17parse__sdk__event(self,
|
|
|
10029
10166
|
}
|
|
10030
10167
|
let map;
|
|
10031
10168
|
_L$2: {
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
map = _map;
|
|
10037
|
-
break _L$3;
|
|
10038
|
-
}
|
|
10169
|
+
if (json.$tag === 6) {
|
|
10170
|
+
const _Object = json;
|
|
10171
|
+
const _map = _Object._0;
|
|
10172
|
+
map = _map;
|
|
10039
10173
|
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
|
-
}
|
|
10174
|
+
} else {
|
|
10175
|
+
return false;
|
|
10152
10176
|
}
|
|
10153
10177
|
}
|
|
10154
|
-
return
|
|
10178
|
+
return _M0FP36mizchi7tornado5agent23parse__sdk__event__json(map, buf, line_buf, error_buf, on_output, on_session_id);
|
|
10155
10179
|
}
|
|
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
|
-
}
|
|
10180
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend17parse__sdk__event(self, line, buf, line_buf, error_buf, on_output) {
|
|
10181
|
+
return _M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, (sid) => {
|
|
10182
|
+
if (_M0IP016_24default__implPB2Eq10not__equalGsE(self.session_id, sid)) {
|
|
10183
|
+
self.session_id = sid;
|
|
10184
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent9SessionId(sid));
|
|
10185
|
+
return;
|
|
10186
|
+
} else {
|
|
10187
|
+
return;
|
|
10188
|
+
}
|
|
10189
|
+
});
|
|
10190
|
+
}
|
|
10191
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output) {
|
|
10178
10192
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10179
10193
|
const line_buf = _M0MP36mizchi7tornado5agent16OutputLineBuffer3new();
|
|
10180
10194
|
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10181
10195
|
const error_buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10182
|
-
const _bind
|
|
10183
|
-
const lines = _M0MPC16string6String5split(raw_output, new _M0TPC16string10StringView(_bind
|
|
10196
|
+
const _bind = "\n";
|
|
10197
|
+
const lines = _M0MPC16string6String5split(raw_output, new _M0TPC16string10StringView(_bind, 0, _bind.length));
|
|
10184
10198
|
const _it = lines;
|
|
10185
10199
|
while (true) {
|
|
10186
10200
|
let line_view;
|
|
10187
10201
|
_L: {
|
|
10188
|
-
const _bind$
|
|
10189
|
-
if (_bind$
|
|
10202
|
+
const _bind$2 = _M0MPB4Iter4nextGUssEE(_it);
|
|
10203
|
+
if (_bind$2 === undefined) {
|
|
10190
10204
|
break;
|
|
10191
10205
|
} else {
|
|
10192
|
-
const _Some = _bind$
|
|
10206
|
+
const _Some = _bind$2;
|
|
10193
10207
|
const _line_view = _Some;
|
|
10194
10208
|
line_view = _line_view;
|
|
10195
10209
|
break _L;
|
|
@@ -10217,6 +10231,30 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self,
|
|
|
10217
10231
|
return new _M0TP36mizchi7tornado5types11AgentResult(content, _M0DTP36mizchi7tornado5types11AgentStatus9Completed__, undefined);
|
|
10218
10232
|
}
|
|
10219
10233
|
}
|
|
10234
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output) {
|
|
10235
|
+
const _bind = [];
|
|
10236
|
+
const opts = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind, 0, 0));
|
|
10237
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "prompt", _M0IPC16string6StringPB6ToJson8to__json(task));
|
|
10238
|
+
if (!_M0MPC16string6String9is__empty(system_prompt)) {
|
|
10239
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "systemPrompt", _M0IPC16string6StringPB6ToJson8to__json(system_prompt));
|
|
10240
|
+
}
|
|
10241
|
+
if (!_M0MPC16string6String9is__empty(self.model)) {
|
|
10242
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "model", _M0IPC16string6StringPB6ToJson8to__json(self.model));
|
|
10243
|
+
}
|
|
10244
|
+
if (!_M0MPC16string6String9is__empty(self.session_id)) {
|
|
10245
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "sessionId", _M0IPC16string6StringPB6ToJson8to__json(self.session_id));
|
|
10246
|
+
}
|
|
10247
|
+
const opts_json = _M0MPC14json4Json17stringify_2einner(_M0MPC14json4Json6object(opts), false, 0, undefined);
|
|
10248
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent4Info(`Launching: Claude${!_M0MPC16string6String9is__empty(self.session_id) ? ` (resume: ${_M0IPC16string6StringPB4Show10to__string(self.session_id)})` : " (new session)"}`));
|
|
10249
|
+
const raw_output = _M0FP36mizchi7tornado5agent16run__claude__sdk(opts_json);
|
|
10250
|
+
const _bind$2 = "ERROR:";
|
|
10251
|
+
if (_M0MPC16string6String11has__prefix(raw_output, new _M0TPC16string10StringView(_bind$2, 0, _bind$2.length))) {
|
|
10252
|
+
const err = raw_output;
|
|
10253
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10254
|
+
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10255
|
+
}
|
|
10256
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output);
|
|
10257
|
+
}
|
|
10220
10258
|
function _M0FP36mizchi7tornado5agent15run__codex__sdk(opts_json) {
|
|
10221
10259
|
return _M0FP36mizchi7tornado5agent12js__run__sdk("codex-runner.mjs", opts_json);
|
|
10222
10260
|
}
|
|
@@ -10239,21 +10277,76 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task,
|
|
|
10239
10277
|
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10240
10278
|
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10241
10279
|
}
|
|
10280
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend18parse__sdk__output(self, raw_output, on_output);
|
|
10281
|
+
}
|
|
10282
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend3run(self, task, system_prompt, on_output) {
|
|
10283
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(_M0DTP36mizchi7tornado5types11AgentStatus7Running__));
|
|
10284
|
+
const _bind = self.kind;
|
|
10285
|
+
switch (_bind) {
|
|
10286
|
+
case 0: {
|
|
10287
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output);
|
|
10288
|
+
}
|
|
10289
|
+
case 1: {
|
|
10290
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task, system_prompt, on_output);
|
|
10291
|
+
}
|
|
10292
|
+
default: {
|
|
10293
|
+
return _M0MP36mizchi7tornado5agent17SubprocessBackend17run__claude__code(self, task, system_prompt, on_output);
|
|
10294
|
+
}
|
|
10295
|
+
}
|
|
10296
|
+
}
|
|
10297
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend4name(self) {
|
|
10298
|
+
const _bind = self.kind;
|
|
10299
|
+
switch (_bind) {
|
|
10300
|
+
case 0: {
|
|
10301
|
+
return "claude-code";
|
|
10302
|
+
}
|
|
10303
|
+
case 1: {
|
|
10304
|
+
return "codex";
|
|
10305
|
+
}
|
|
10306
|
+
default: {
|
|
10307
|
+
return "subprocess";
|
|
10308
|
+
}
|
|
10309
|
+
}
|
|
10310
|
+
}
|
|
10311
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16set__session__id(self, sid) {
|
|
10312
|
+
self.session_id = sid;
|
|
10313
|
+
}
|
|
10314
|
+
function _M0IP36mizchi7tornado5agent17SubprocessBackendP36mizchi7tornado5agent12AgentBackend16get__session__id(self) {
|
|
10315
|
+
return self.session_id;
|
|
10316
|
+
}
|
|
10317
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend3new(backend) {
|
|
10318
|
+
return new _M0TP36mizchi7tornado5agent12BoxedBackend(backend);
|
|
10319
|
+
}
|
|
10320
|
+
function _M0MP36mizchi7tornado5agent17SubprocessBackend5boxed(self) {
|
|
10321
|
+
return _M0MP36mizchi7tornado5agent12BoxedBackend3new({ self: self, method_table: _M0FP094mizchi_2ftornado_2fagent_2fSubprocessBackend_24as_24_40mizchi_2ftornado_2fagent_2eAgentBackend });
|
|
10322
|
+
}
|
|
10323
|
+
function _M0FP36mizchi7tornado5agent18run__parallel__sdk(opts_json) {
|
|
10324
|
+
return _M0FP36mizchi7tornado5agent12js__run__sdk("parallel-runner.mjs", opts_json);
|
|
10325
|
+
}
|
|
10326
|
+
function _M0FP36mizchi7tornado5agent14failed__result(err) {
|
|
10327
|
+
return new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err);
|
|
10328
|
+
}
|
|
10329
|
+
function _M0FP36mizchi7tornado5agent20parse__jsonl__result(jsonl, on_output) {
|
|
10330
|
+
const _bind = "ERROR:";
|
|
10331
|
+
if (_M0MPC16string6String11has__prefix(jsonl, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
10332
|
+
const err = jsonl;
|
|
10333
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent12StatusChange(new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err)));
|
|
10334
|
+
return _M0FP36mizchi7tornado5agent14failed__result(err);
|
|
10335
|
+
}
|
|
10242
10336
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10243
10337
|
const line_buf = _M0MP36mizchi7tornado5agent16OutputLineBuffer3new();
|
|
10244
|
-
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10245
10338
|
const error_buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
10246
|
-
const
|
|
10247
|
-
const
|
|
10248
|
-
const _it =
|
|
10339
|
+
const has_error = new _M0TPC13ref3RefGbE(false);
|
|
10340
|
+
const _bind$2 = "\n";
|
|
10341
|
+
const _it = _M0MPC16string6String5split(jsonl, new _M0TPC16string10StringView(_bind$2, 0, _bind$2.length));
|
|
10249
10342
|
while (true) {
|
|
10250
10343
|
let line_view;
|
|
10251
10344
|
_L: {
|
|
10252
|
-
const _bind$
|
|
10253
|
-
if (_bind$
|
|
10345
|
+
const _bind$3 = _M0MPB4Iter4nextGUssEE(_it);
|
|
10346
|
+
if (_bind$3 === undefined) {
|
|
10254
10347
|
break;
|
|
10255
10348
|
} else {
|
|
10256
|
-
const _Some = _bind$
|
|
10349
|
+
const _Some = _bind$3;
|
|
10257
10350
|
const _line_view = _Some;
|
|
10258
10351
|
line_view = _line_view;
|
|
10259
10352
|
break _L;
|
|
@@ -10263,7 +10356,9 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task,
|
|
|
10263
10356
|
if (_M0MPC16string6String9is__empty(line)) {
|
|
10264
10357
|
continue;
|
|
10265
10358
|
}
|
|
10266
|
-
if (
|
|
10359
|
+
if (_M0FP36mizchi7tornado5agent23parse__sdk__event__line(line, buf, line_buf, error_buf, on_output, (sid) => {
|
|
10360
|
+
on_output(new _M0DTP36mizchi7tornado5types10AgentEvent9SessionId(sid));
|
|
10361
|
+
})) {
|
|
10267
10362
|
has_error.val = true;
|
|
10268
10363
|
}
|
|
10269
10364
|
continue;
|
|
@@ -10281,46 +10376,177 @@ function _M0MP36mizchi7tornado5agent17SubprocessBackend10run__codex(self, task,
|
|
|
10281
10376
|
return new _M0TP36mizchi7tornado5types11AgentResult(content, _M0DTP36mizchi7tornado5types11AgentStatus9Completed__, undefined);
|
|
10282
10377
|
}
|
|
10283
10378
|
}
|
|
10284
|
-
function
|
|
10285
|
-
|
|
10286
|
-
const _bind =
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10379
|
+
function _M0FP36mizchi7tornado5agent25replicate__failed__result(count, err) {
|
|
10380
|
+
const results = [];
|
|
10381
|
+
const _bind = 0;
|
|
10382
|
+
let _tmp = _bind;
|
|
10383
|
+
while (true) {
|
|
10384
|
+
const _ = _tmp;
|
|
10385
|
+
if (_ < count) {
|
|
10386
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed(err), err));
|
|
10387
|
+
_tmp = _ + 1 | 0;
|
|
10388
|
+
continue;
|
|
10389
|
+
} else {
|
|
10390
|
+
break;
|
|
10290
10391
|
}
|
|
10291
|
-
|
|
10292
|
-
|
|
10392
|
+
}
|
|
10393
|
+
return results;
|
|
10394
|
+
}
|
|
10395
|
+
function _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend(runner, tasks, on_output, model) {
|
|
10396
|
+
const _bind = [];
|
|
10397
|
+
const opts = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind, 0, 0));
|
|
10398
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "runner", _M0IPC16string6StringPB6ToJson8to__json(runner));
|
|
10399
|
+
const task_opts = [];
|
|
10400
|
+
const _bind$2 = tasks.length;
|
|
10401
|
+
let _tmp = 0;
|
|
10402
|
+
while (true) {
|
|
10403
|
+
const _ = _tmp;
|
|
10404
|
+
if (_ < _bind$2) {
|
|
10405
|
+
const task = tasks[_];
|
|
10406
|
+
let prompt;
|
|
10407
|
+
let system_prompt;
|
|
10408
|
+
_L: {
|
|
10409
|
+
const _prompt = task._0;
|
|
10410
|
+
const _system_prompt = task._1;
|
|
10411
|
+
prompt = _prompt;
|
|
10412
|
+
system_prompt = _system_prompt;
|
|
10413
|
+
break _L;
|
|
10414
|
+
}
|
|
10415
|
+
const _bind$3 = [];
|
|
10416
|
+
const task_json = _M0MPB3Map11from__arrayGsRPB4JsonE(new _M0TPB9ArrayViewGUsRPB4JsonEE(_bind$3, 0, 0));
|
|
10417
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "prompt", _M0IPC16string6StringPB6ToJson8to__json(prompt));
|
|
10418
|
+
if (!_M0MPC16string6String9is__empty(system_prompt)) {
|
|
10419
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "systemPrompt", _M0IPC16string6StringPB6ToJson8to__json(system_prompt));
|
|
10420
|
+
}
|
|
10421
|
+
if (!_M0MPC16string6String9is__empty(model)) {
|
|
10422
|
+
_M0MPB3Map3setGsRPB4JsonE(task_json, "model", _M0IPC16string6StringPB6ToJson8to__json(model));
|
|
10423
|
+
}
|
|
10424
|
+
_M0MPC15array5Array4pushGsE(task_opts, _M0MPC14json4Json6object(task_json));
|
|
10425
|
+
_tmp = _ + 1 | 0;
|
|
10426
|
+
continue;
|
|
10427
|
+
} else {
|
|
10428
|
+
break;
|
|
10293
10429
|
}
|
|
10294
|
-
|
|
10295
|
-
|
|
10430
|
+
}
|
|
10431
|
+
_M0MPB3Map3setGsRPB4JsonE(opts, "tasks", _M0MPC14json4Json5array(task_opts));
|
|
10432
|
+
const raw_output = _M0FP36mizchi7tornado5agent18run__parallel__sdk(_M0MPC14json4Json17stringify_2einner(_M0MPC14json4Json6object(opts), false, 0, undefined));
|
|
10433
|
+
const _bind$3 = "ERROR:";
|
|
10434
|
+
if (_M0MPC16string6String11has__prefix(raw_output, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length))) {
|
|
10435
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, raw_output);
|
|
10436
|
+
}
|
|
10437
|
+
let parsed;
|
|
10438
|
+
let _try_err;
|
|
10439
|
+
_L: {
|
|
10440
|
+
_L$2: {
|
|
10441
|
+
const _bind$4 = _M0FPC14json13parse_2einner(new _M0TPC16string10StringView(raw_output, 0, raw_output.length), 1024);
|
|
10442
|
+
if (_bind$4.$tag === 1) {
|
|
10443
|
+
const _ok = _bind$4;
|
|
10444
|
+
parsed = _ok._0;
|
|
10445
|
+
} else {
|
|
10446
|
+
const _err = _bind$4;
|
|
10447
|
+
_try_err = _err._0;
|
|
10448
|
+
break _L$2;
|
|
10449
|
+
}
|
|
10450
|
+
break _L;
|
|
10296
10451
|
}
|
|
10452
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, "ERROR: failed to parse parallel SDK output");
|
|
10297
10453
|
}
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10454
|
+
let results_json;
|
|
10455
|
+
_L$2: {
|
|
10456
|
+
if (parsed.$tag === 5) {
|
|
10457
|
+
const _Array = parsed;
|
|
10458
|
+
const _results_json = _Array._0;
|
|
10459
|
+
results_json = _results_json;
|
|
10460
|
+
break _L$2;
|
|
10461
|
+
} else {
|
|
10462
|
+
return _M0FP36mizchi7tornado5agent25replicate__failed__result(tasks.length, "ERROR: invalid parallel SDK output shape");
|
|
10304
10463
|
}
|
|
10305
|
-
|
|
10306
|
-
|
|
10464
|
+
}
|
|
10465
|
+
const results = [];
|
|
10466
|
+
const _bind$4 = results_json.length;
|
|
10467
|
+
let _tmp$2 = 0;
|
|
10468
|
+
while (true) {
|
|
10469
|
+
const _ = _tmp$2;
|
|
10470
|
+
if (_ < _bind$4) {
|
|
10471
|
+
const entry = results_json[_];
|
|
10472
|
+
let jsonl;
|
|
10473
|
+
_L$3: {
|
|
10474
|
+
_L$4: {
|
|
10475
|
+
if (entry.$tag === 4) {
|
|
10476
|
+
const _String = entry;
|
|
10477
|
+
const _jsonl = _String._0;
|
|
10478
|
+
jsonl = _jsonl;
|
|
10479
|
+
break _L$4;
|
|
10480
|
+
} else {
|
|
10481
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed("ERROR: invalid parallel SDK result entry"), "ERROR: invalid parallel SDK result entry"));
|
|
10482
|
+
}
|
|
10483
|
+
break _L$3;
|
|
10484
|
+
}
|
|
10485
|
+
_M0MPC15array5Array4pushGsE(results, _M0FP36mizchi7tornado5agent20parse__jsonl__result(jsonl, on_output));
|
|
10486
|
+
}
|
|
10487
|
+
_tmp$2 = _ + 1 | 0;
|
|
10488
|
+
continue;
|
|
10489
|
+
} else {
|
|
10490
|
+
break;
|
|
10307
10491
|
}
|
|
10308
|
-
|
|
10309
|
-
|
|
10492
|
+
}
|
|
10493
|
+
while (true) {
|
|
10494
|
+
if (results.length < tasks.length) {
|
|
10495
|
+
_M0MPC15array5Array4pushGsE(results, new _M0TP36mizchi7tornado5types11AgentResult("", new _M0DTP36mizchi7tornado5types11AgentStatus6Failed("ERROR: missing parallel SDK result"), "ERROR: missing parallel SDK result"));
|
|
10496
|
+
continue;
|
|
10497
|
+
} else {
|
|
10498
|
+
break;
|
|
10310
10499
|
}
|
|
10311
10500
|
}
|
|
10501
|
+
return results;
|
|
10312
10502
|
}
|
|
10313
|
-
function
|
|
10314
|
-
|
|
10503
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend3run(self, task, system_prompt, on_output) {
|
|
10504
|
+
const _tmp = self.inner;
|
|
10505
|
+
return _tmp.method_table.method_0(_tmp.self, task, system_prompt, on_output);
|
|
10315
10506
|
}
|
|
10316
|
-
function
|
|
10317
|
-
|
|
10507
|
+
function _M0FP36mizchi7tornado5agent25run__parallel__sequential(backend, tasks, on_output) {
|
|
10508
|
+
const results = [];
|
|
10509
|
+
const _bind = tasks.length;
|
|
10510
|
+
let _tmp = 0;
|
|
10511
|
+
while (true) {
|
|
10512
|
+
const _ = _tmp;
|
|
10513
|
+
if (_ < _bind) {
|
|
10514
|
+
const task = tasks[_];
|
|
10515
|
+
let prompt;
|
|
10516
|
+
let system_prompt;
|
|
10517
|
+
_L: {
|
|
10518
|
+
const _prompt = task._0;
|
|
10519
|
+
const _system_prompt = task._1;
|
|
10520
|
+
prompt = _prompt;
|
|
10521
|
+
system_prompt = _system_prompt;
|
|
10522
|
+
break _L;
|
|
10523
|
+
}
|
|
10524
|
+
_M0MPC15array5Array4pushGsE(results, _M0MP36mizchi7tornado5agent12BoxedBackend3run(backend, prompt, system_prompt, on_output));
|
|
10525
|
+
_tmp = _ + 1 | 0;
|
|
10526
|
+
continue;
|
|
10527
|
+
} else {
|
|
10528
|
+
break;
|
|
10529
|
+
}
|
|
10530
|
+
}
|
|
10531
|
+
return results;
|
|
10318
10532
|
}
|
|
10319
|
-
function
|
|
10320
|
-
|
|
10533
|
+
function _M0MP36mizchi7tornado5agent12BoxedBackend4name(self) {
|
|
10534
|
+
const _tmp = self.inner;
|
|
10535
|
+
return _tmp.method_table.method_1(_tmp.self);
|
|
10321
10536
|
}
|
|
10322
|
-
function
|
|
10323
|
-
|
|
10537
|
+
function _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_output, model) {
|
|
10538
|
+
const _bind = _M0MP36mizchi7tornado5agent12BoxedBackend4name(backend);
|
|
10539
|
+
switch (_bind) {
|
|
10540
|
+
case "claude-code": {
|
|
10541
|
+
return _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend("claude", tasks, on_output, model);
|
|
10542
|
+
}
|
|
10543
|
+
case "codex": {
|
|
10544
|
+
return _M0FP36mizchi7tornado5agent27run__parallel__sdk__backend("codex", tasks, on_output, model);
|
|
10545
|
+
}
|
|
10546
|
+
default: {
|
|
10547
|
+
return _M0FP36mizchi7tornado5agent25run__parallel__sequential(backend, tasks, on_output);
|
|
10548
|
+
}
|
|
10549
|
+
}
|
|
10324
10550
|
}
|
|
10325
10551
|
function _M0MP36mizchi7tornado5agent11MockBackend11new_2einner(default_response) {
|
|
10326
10552
|
const _bind = [];
|
|
@@ -10485,10 +10711,6 @@ function _M0IP36mizchi7tornado5agent10ApiBackendP36mizchi7tornado5agent12AgentBa
|
|
|
10485
10711
|
function _M0IP36mizchi7tornado5agent10ApiBackendP36mizchi7tornado5agent12AgentBackend16get__session__id(_self) {
|
|
10486
10712
|
return "";
|
|
10487
10713
|
}
|
|
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
10714
|
function _M0MP36mizchi7tornado5agent12BoxedBackend16set__session__id(self, session_id) {
|
|
10493
10715
|
const _tmp = self.inner;
|
|
10494
10716
|
_tmp.method_table.method_2(_tmp.self, session_id);
|
|
@@ -11534,18 +11756,122 @@ function _M0FP36mizchi7tornado7display20format__tool__result(name, output) {
|
|
|
11534
11756
|
case "Glob": {
|
|
11535
11757
|
return `Glob: ${_M0IPC16string6StringPB4Show10to__string(output)}`;
|
|
11536
11758
|
}
|
|
11537
|
-
case "Grep": {
|
|
11538
|
-
return `Grep: ${_M0IPC16string6StringPB4Show10to__string(output)}`;
|
|
11759
|
+
case "Grep": {
|
|
11760
|
+
return `Grep: ${_M0IPC16string6StringPB4Show10to__string(output)}`;
|
|
11761
|
+
}
|
|
11762
|
+
default: {
|
|
11763
|
+
return `${_M0IPC16string6StringPB4Show10to__string(name)}: ${_M0IPC16string6StringPB4Show10to__string(output)}`;
|
|
11764
|
+
}
|
|
11765
|
+
}
|
|
11766
|
+
}
|
|
11767
|
+
function _M0FP36mizchi7tornado7prompts24code__quality__checklist(lang) {
|
|
11768
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11769
|
+
if (lang === "ja") {
|
|
11770
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: コード品質\n");
|
|
11771
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11772
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 可読性と命名規約\n");
|
|
11773
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 関心の分離\n");
|
|
11774
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- エラーハンドリングの網羅性\n");
|
|
11775
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- テストカバレッジと正確性\n");
|
|
11776
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- コードの重複と不必要な複雑さ\n");
|
|
11777
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API 設計と公開インターフェースの明確さ\n");
|
|
11778
|
+
} else {
|
|
11779
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Code Quality\n");
|
|
11780
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11781
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Readability and naming conventions\n");
|
|
11782
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Proper separation of concerns\n");
|
|
11783
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Error handling completeness\n");
|
|
11784
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Test coverage and correctness\n");
|
|
11785
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Code duplication and unnecessary complexity\n");
|
|
11786
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- API design and public interface clarity\n");
|
|
11787
|
+
}
|
|
11788
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11789
|
+
}
|
|
11790
|
+
function _M0FP36mizchi7tornado7prompts22performance__checklist(lang) {
|
|
11791
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11792
|
+
if (lang === "ja") {
|
|
11793
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: パフォーマンス\n");
|
|
11794
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11795
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- アルゴリズムの計算量(時間・空間)\n");
|
|
11796
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 不要なメモリ確保やコピー\n");
|
|
11797
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 クエリや冗長な I/O\n");
|
|
11798
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- キャッシュの活用機会\n");
|
|
11799
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- ホットパスの最適化\n");
|
|
11800
|
+
} else {
|
|
11801
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Performance\n");
|
|
11802
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11803
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Algorithmic complexity (time and space)\n");
|
|
11804
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Unnecessary allocations or copies\n");
|
|
11805
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- N+1 queries or redundant I/O\n");
|
|
11806
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Caching opportunities\n");
|
|
11807
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Hot path optimization\n");
|
|
11808
|
+
}
|
|
11809
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11810
|
+
}
|
|
11811
|
+
function _M0FP36mizchi7tornado7prompts19security__checklist(lang) {
|
|
11812
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11813
|
+
if (lang === "ja") {
|
|
11814
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: セキュリティ\n");
|
|
11815
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11816
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 入力値のバリデーションとサニタイズ\n");
|
|
11817
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- インジェクション脆弱性(コマンド、SQL、XSS)\n");
|
|
11818
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 認証・認可の不備\n");
|
|
11819
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 機密データの露出(シークレット、トークン、個人情報)\n");
|
|
11820
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 依存関係の安全性\n");
|
|
11821
|
+
} else {
|
|
11822
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Security\n");
|
|
11823
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11824
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Input validation and sanitization\n");
|
|
11825
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Injection vulnerabilities (command, SQL, XSS)\n");
|
|
11826
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Authentication and authorization gaps\n");
|
|
11827
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Sensitive data exposure (secrets, tokens, PII)\n");
|
|
11828
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Dependency safety\n");
|
|
11829
|
+
}
|
|
11830
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11831
|
+
}
|
|
11832
|
+
function _M0IP36mizchi7tornado5ralph19VerifierPerspectivePB4Show6output(_x_335, _x_336) {
|
|
11833
|
+
switch (_x_335) {
|
|
11834
|
+
case 0: {
|
|
11835
|
+
_x_336.method_table.method_0(_x_336.self, "CodeQuality");
|
|
11836
|
+
return;
|
|
11837
|
+
}
|
|
11838
|
+
case 1: {
|
|
11839
|
+
_x_336.method_table.method_0(_x_336.self, "Performance");
|
|
11840
|
+
return;
|
|
11841
|
+
}
|
|
11842
|
+
case 2: {
|
|
11843
|
+
_x_336.method_table.method_0(_x_336.self, "Security");
|
|
11844
|
+
return;
|
|
11539
11845
|
}
|
|
11540
11846
|
default: {
|
|
11541
|
-
|
|
11847
|
+
_x_336.method_table.method_0(_x_336.self, "GoalAlignment");
|
|
11848
|
+
return;
|
|
11542
11849
|
}
|
|
11543
11850
|
}
|
|
11544
11851
|
}
|
|
11545
11852
|
function _M0MP36mizchi7tornado5ralph13VerifierAgent11new_2einner(agent_id, lang) {
|
|
11546
11853
|
return new _M0TP36mizchi7tornado5ralph13VerifierAgent(agent_id, lang);
|
|
11547
11854
|
}
|
|
11548
|
-
function
|
|
11855
|
+
function _M0FP36mizchi7tornado5ralph26goal__alignment__checklist(lang) {
|
|
11856
|
+
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11857
|
+
if (lang === "ja") {
|
|
11858
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## レビュー観点: ゴール整合性\n");
|
|
11859
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "以下の観点で評価してください:\n");
|
|
11860
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 出力はマイルストーンで定義された目標を達成しているか\n");
|
|
11861
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- すべてのタスク出力に一貫性があるか\n");
|
|
11862
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 当該 Wave のタスクに不足している成果物や未完了の実装がないか(他 Wave の作業は検証対象外)\n");
|
|
11863
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- 全体の方向性がプロジェクトの意図と一致しているか\n");
|
|
11864
|
+
} else {
|
|
11865
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "## Review Focus: Goal Alignment\n");
|
|
11866
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "Evaluate the following aspects:\n");
|
|
11867
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Does the output achieve the stated milestone goal?\n");
|
|
11868
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Are all task outputs consistent with each other?\n");
|
|
11869
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Are there missing deliverables or incomplete implementations for this wave's tasks? (Work from other waves is out of scope)\n");
|
|
11870
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, "- Does the overall direction match the project's intent?\n");
|
|
11871
|
+
}
|
|
11872
|
+
return _M0MPB13StringBuilder10to__string(buf);
|
|
11873
|
+
}
|
|
11874
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent26build__perspective__prompt(self, perspective, milestone, wave, wave_results, project_context) {
|
|
11549
11875
|
const lang_instruction = self.lang === "ja" ? "Respond in Japanese." : "Respond in English.";
|
|
11550
11876
|
const buf = _M0MPB13StringBuilder11new_2einner(0);
|
|
11551
11877
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, "You are a Verifier agent. ");
|
|
@@ -11582,7 +11908,25 @@ function _M0MP36mizchi7tornado5ralph13VerifierAgent21build__verify__prompt(self,
|
|
|
11582
11908
|
break;
|
|
11583
11909
|
}
|
|
11584
11910
|
}
|
|
11585
|
-
|
|
11911
|
+
switch (perspective) {
|
|
11912
|
+
case 0: {
|
|
11913
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts24code__quality__checklist(self.lang));
|
|
11914
|
+
break;
|
|
11915
|
+
}
|
|
11916
|
+
case 1: {
|
|
11917
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts22performance__checklist(self.lang));
|
|
11918
|
+
break;
|
|
11919
|
+
}
|
|
11920
|
+
case 2: {
|
|
11921
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts19security__checklist(self.lang));
|
|
11922
|
+
break;
|
|
11923
|
+
}
|
|
11924
|
+
default: {
|
|
11925
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado5ralph26goal__alignment__checklist(self.lang));
|
|
11926
|
+
}
|
|
11927
|
+
}
|
|
11928
|
+
_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");
|
|
11929
|
+
_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
11930
|
return _M0MPB13StringBuilder10to__string(buf);
|
|
11587
11931
|
}
|
|
11588
11932
|
function _M0FP36mizchi7tornado5ralph15find__substring(haystack, needle) {
|
|
@@ -11780,16 +12124,147 @@ function _M0MP36mizchi7tornado5ralph13VerifierAgent14parse__verdict(_self, outpu
|
|
|
11780
12124
|
}
|
|
11781
12125
|
return _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__;
|
|
11782
12126
|
}
|
|
11783
|
-
function
|
|
11784
|
-
const
|
|
11785
|
-
const
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
return
|
|
12127
|
+
function _M0FP36mizchi7tornado5ralph24inject__perspective__tag(item, perspective) {
|
|
12128
|
+
const tag = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] `;
|
|
12129
|
+
const colon_idx = _M0FP36mizchi7tornado5ralph15find__substring(item, ": ");
|
|
12130
|
+
if (colon_idx >= 0) {
|
|
12131
|
+
const prefix = _M0FP36mizchi7tornado5ralph9substring(item, 0, colon_idx + 2 | 0);
|
|
12132
|
+
const suffix = _M0FP36mizchi7tornado5ralph9substring(item, colon_idx + 2 | 0, _M0MPC16string6String9to__array(item).length);
|
|
12133
|
+
return `${prefix}${tag}${suffix}`;
|
|
11790
12134
|
} else {
|
|
11791
|
-
|
|
12135
|
+
const space_idx = _M0FP36mizchi7tornado5ralph15find__substring(item, " ");
|
|
12136
|
+
if (space_idx > 0) {
|
|
12137
|
+
const prefix = _M0FP36mizchi7tornado5ralph9substring(item, 0, space_idx);
|
|
12138
|
+
const _bind = "-";
|
|
12139
|
+
if (_M0MPC16string6String8contains(prefix, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
12140
|
+
const suffix = _M0FP36mizchi7tornado5ralph9substring(item, space_idx + 1 | 0, _M0MPC16string6String9to__array(item).length);
|
|
12141
|
+
return `${prefix} ${tag}${suffix}`;
|
|
12142
|
+
} else {
|
|
12143
|
+
return `${tag}${item}`;
|
|
12144
|
+
}
|
|
12145
|
+
} else {
|
|
12146
|
+
return `${tag}${item}`;
|
|
12147
|
+
}
|
|
12148
|
+
}
|
|
12149
|
+
}
|
|
12150
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent15merge__verdicts(_self, verdicts) {
|
|
12151
|
+
const items = [];
|
|
12152
|
+
const _bind = verdicts.length;
|
|
12153
|
+
let _tmp = 0;
|
|
12154
|
+
while (true) {
|
|
12155
|
+
const _ = _tmp;
|
|
12156
|
+
if (_ < _bind) {
|
|
12157
|
+
const verdict = verdicts[_];
|
|
12158
|
+
let rework_items;
|
|
12159
|
+
_L: {
|
|
12160
|
+
_L$2: {
|
|
12161
|
+
let reason;
|
|
12162
|
+
_L$3: {
|
|
12163
|
+
_L$4: {
|
|
12164
|
+
const _bind$2 = verdict._1;
|
|
12165
|
+
switch (_bind$2.$tag) {
|
|
12166
|
+
case 2: {
|
|
12167
|
+
const _MilestoneFailed = _bind$2;
|
|
12168
|
+
const _reason = _MilestoneFailed._0;
|
|
12169
|
+
reason = _reason;
|
|
12170
|
+
break _L$4;
|
|
12171
|
+
}
|
|
12172
|
+
case 1: {
|
|
12173
|
+
const _NeedsRework = _bind$2;
|
|
12174
|
+
const _rework_items = _NeedsRework._0;
|
|
12175
|
+
rework_items = _rework_items;
|
|
12176
|
+
break _L$2;
|
|
12177
|
+
}
|
|
12178
|
+
}
|
|
12179
|
+
break _L$3;
|
|
12180
|
+
}
|
|
12181
|
+
return new _M0DTP36mizchi7tornado5types15VerifierVerdict15MilestoneFailed(reason);
|
|
12182
|
+
}
|
|
12183
|
+
break _L;
|
|
12184
|
+
}
|
|
12185
|
+
const _bind$2 = rework_items.length;
|
|
12186
|
+
let _tmp$2 = 0;
|
|
12187
|
+
while (true) {
|
|
12188
|
+
const _$2 = _tmp$2;
|
|
12189
|
+
if (_$2 < _bind$2) {
|
|
12190
|
+
const item = rework_items[_$2];
|
|
12191
|
+
_M0MPC15array5Array4pushGsE(items, _M0FP36mizchi7tornado5ralph24inject__perspective__tag(item, verdict._0));
|
|
12192
|
+
_tmp$2 = _$2 + 1 | 0;
|
|
12193
|
+
continue;
|
|
12194
|
+
} else {
|
|
12195
|
+
break;
|
|
12196
|
+
}
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
_tmp = _ + 1 | 0;
|
|
12200
|
+
continue;
|
|
12201
|
+
} else {
|
|
12202
|
+
break;
|
|
12203
|
+
}
|
|
12204
|
+
}
|
|
12205
|
+
return _M0MPC15array5Array9is__emptyGsE(items) ? _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__ : new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework(items);
|
|
12206
|
+
}
|
|
12207
|
+
function _M0MP36mizchi7tornado5ralph13VerifierAgent14verify_2einner(self, milestone, wave, wave_results, backend, project_context, on_event) {
|
|
12208
|
+
const perspectives = [0, 1, 2, 3];
|
|
12209
|
+
const tasks = [];
|
|
12210
|
+
const _bind = perspectives.length;
|
|
12211
|
+
let _tmp = 0;
|
|
12212
|
+
while (true) {
|
|
12213
|
+
const _ = _tmp;
|
|
12214
|
+
if (_ < _bind) {
|
|
12215
|
+
const perspective = perspectives[_];
|
|
12216
|
+
on_event(new _M0DTP36mizchi7tornado5types10AgentEvent4Info(`Verifying perspective: ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}`));
|
|
12217
|
+
const prompt = _M0MP36mizchi7tornado5ralph13VerifierAgent26build__perspective__prompt(self, perspective, milestone, wave, wave_results, project_context);
|
|
12218
|
+
const system_prompt = `You are a verification agent focusing on ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}. Be concise and actionable.`;
|
|
12219
|
+
_M0MPC15array5Array4pushGsE(tasks, { _0: prompt, _1: system_prompt });
|
|
12220
|
+
_tmp = _ + 1 | 0;
|
|
12221
|
+
continue;
|
|
12222
|
+
} else {
|
|
12223
|
+
break;
|
|
12224
|
+
}
|
|
12225
|
+
}
|
|
12226
|
+
const results = _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_event, "");
|
|
12227
|
+
const perspective_verdicts = [];
|
|
12228
|
+
const _bind$2 = 0;
|
|
12229
|
+
const _bind$3 = perspectives.length;
|
|
12230
|
+
let _tmp$2 = _bind$2;
|
|
12231
|
+
while (true) {
|
|
12232
|
+
const i = _tmp$2;
|
|
12233
|
+
if (i < _bind$3) {
|
|
12234
|
+
const perspective = _M0MPC15array5Array2atGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspectives, i);
|
|
12235
|
+
const result = _M0MPC15array5Array2atGsE(results, i);
|
|
12236
|
+
let verdict;
|
|
12237
|
+
let err;
|
|
12238
|
+
_L: {
|
|
12239
|
+
_L$2: {
|
|
12240
|
+
const _bind$4 = result.status;
|
|
12241
|
+
switch (_bind$4.$tag) {
|
|
12242
|
+
case 3: {
|
|
12243
|
+
const _Failed = _bind$4;
|
|
12244
|
+
const _err = _Failed._0;
|
|
12245
|
+
err = _err;
|
|
12246
|
+
break _L$2;
|
|
12247
|
+
}
|
|
12248
|
+
case 2: {
|
|
12249
|
+
verdict = _M0MP36mizchi7tornado5ralph13VerifierAgent14parse__verdict(self, result.content);
|
|
12250
|
+
break;
|
|
12251
|
+
}
|
|
12252
|
+
default: {
|
|
12253
|
+
verdict = new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework([`[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] Verification failed: unexpected verifier status`]);
|
|
12254
|
+
}
|
|
12255
|
+
}
|
|
12256
|
+
break _L;
|
|
12257
|
+
}
|
|
12258
|
+
verdict = new _M0DTP36mizchi7tornado5types15VerifierVerdict11NeedsRework([`[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] Verification failed: ${err}`]);
|
|
12259
|
+
}
|
|
12260
|
+
_M0MPC15array5Array4pushGsE(perspective_verdicts, { _0: perspective, _1: verdict });
|
|
12261
|
+
_tmp$2 = i + 1 | 0;
|
|
12262
|
+
continue;
|
|
12263
|
+
} else {
|
|
12264
|
+
break;
|
|
12265
|
+
}
|
|
11792
12266
|
}
|
|
12267
|
+
return _M0MP36mizchi7tornado5ralph13VerifierAgent15merge__verdicts(self, perspective_verdicts);
|
|
11793
12268
|
}
|
|
11794
12269
|
function _M0FP36mizchi7tornado5ralph15find__agent__id(config, role) {
|
|
11795
12270
|
const _bind = config.agents;
|
|
@@ -12165,8 +12640,74 @@ function _M0MP36mizchi7tornado5ralph16MilestoneManager16get__wave__tasks(_self,
|
|
|
12165
12640
|
}
|
|
12166
12641
|
return result;
|
|
12167
12642
|
}
|
|
12168
|
-
function
|
|
12643
|
+
function _M0FP36mizchi7tornado5ralph29strip__task__feedback__prefix(item, task_id) {
|
|
12644
|
+
const colon_prefix = `${task_id}:`;
|
|
12645
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(colon_prefix, 0, colon_prefix.length))) {
|
|
12646
|
+
return _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(item, colon_prefix.length, undefined)), undefined));
|
|
12647
|
+
}
|
|
12648
|
+
const space_prefix = `${task_id} `;
|
|
12649
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(space_prefix, 0, space_prefix.length))) {
|
|
12650
|
+
return _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String4trim(_M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(item, space_prefix.length, undefined)), undefined));
|
|
12651
|
+
}
|
|
12652
|
+
return item;
|
|
12653
|
+
}
|
|
12654
|
+
function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, wave, feedback) {
|
|
12169
12655
|
const tasks = _M0MP36mizchi7tornado5ralph16MilestoneManager16get__wave__tasks(self.milestone_manager, milestone, wave);
|
|
12656
|
+
const matched_any = new _M0TPC13ref3RefGbE(false);
|
|
12657
|
+
const _bind = feedback.length;
|
|
12658
|
+
let _tmp = 0;
|
|
12659
|
+
while (true) {
|
|
12660
|
+
const _ = _tmp;
|
|
12661
|
+
if (_ < _bind) {
|
|
12662
|
+
const item = feedback[_];
|
|
12663
|
+
const _bind$2 = tasks.length;
|
|
12664
|
+
let _tmp$2 = 0;
|
|
12665
|
+
while (true) {
|
|
12666
|
+
const _$2 = _tmp$2;
|
|
12667
|
+
if (_$2 < _bind$2) {
|
|
12668
|
+
const task = tasks[_$2];
|
|
12669
|
+
let _tmp$3;
|
|
12670
|
+
const _bind$3 = `${task.id}:`;
|
|
12671
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$3, 0, _bind$3.length))) {
|
|
12672
|
+
_tmp$3 = true;
|
|
12673
|
+
} else {
|
|
12674
|
+
const _bind$4 = `${task.id} `;
|
|
12675
|
+
_tmp$3 = _M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length));
|
|
12676
|
+
}
|
|
12677
|
+
if (_tmp$3) {
|
|
12678
|
+
task.status = _M0DTP36mizchi7tornado5types10TaskStatus7Pending__;
|
|
12679
|
+
matched_any.val = true;
|
|
12680
|
+
}
|
|
12681
|
+
_tmp$2 = _$2 + 1 | 0;
|
|
12682
|
+
continue;
|
|
12683
|
+
} else {
|
|
12684
|
+
break;
|
|
12685
|
+
}
|
|
12686
|
+
}
|
|
12687
|
+
_tmp = _ + 1 | 0;
|
|
12688
|
+
continue;
|
|
12689
|
+
} else {
|
|
12690
|
+
break;
|
|
12691
|
+
}
|
|
12692
|
+
}
|
|
12693
|
+
if (!matched_any.val && !_M0MPC15array5Array9is__emptyGsE(feedback)) {
|
|
12694
|
+
const _bind$2 = tasks.length;
|
|
12695
|
+
let _tmp$2 = 0;
|
|
12696
|
+
while (true) {
|
|
12697
|
+
const _ = _tmp$2;
|
|
12698
|
+
if (_ < _bind$2) {
|
|
12699
|
+
const task = tasks[_];
|
|
12700
|
+
const _bind$3 = task.status;
|
|
12701
|
+
if (_bind$3.$tag === 2) {
|
|
12702
|
+
task.status = _M0DTP36mizchi7tornado5types10TaskStatus7Pending__;
|
|
12703
|
+
}
|
|
12704
|
+
_tmp$2 = _ + 1 | 0;
|
|
12705
|
+
continue;
|
|
12706
|
+
} else {
|
|
12707
|
+
break;
|
|
12708
|
+
}
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12170
12711
|
const builder_id = _M0FP36mizchi7tornado5ralph15find__agent__id(self.config, 0);
|
|
12171
12712
|
let builder_backend;
|
|
12172
12713
|
let id;
|
|
@@ -12196,16 +12737,16 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12196
12737
|
}
|
|
12197
12738
|
}
|
|
12198
12739
|
const bid = _M0MPC16option6Option6unwrapGsE(builder_id);
|
|
12199
|
-
const _bind = tasks.length;
|
|
12200
|
-
let _tmp = 0;
|
|
12740
|
+
const _bind$2 = tasks.length;
|
|
12741
|
+
let _tmp$2 = 0;
|
|
12201
12742
|
while (true) {
|
|
12202
|
-
const _ = _tmp;
|
|
12203
|
-
if (_ < _bind) {
|
|
12743
|
+
const _ = _tmp$2;
|
|
12744
|
+
if (_ < _bind$2) {
|
|
12204
12745
|
const task = tasks[_];
|
|
12205
12746
|
_L$3: {
|
|
12206
12747
|
_L$4: {
|
|
12207
|
-
const _bind$
|
|
12208
|
-
switch (_bind$
|
|
12748
|
+
const _bind$3 = task.status;
|
|
12749
|
+
switch (_bind$3.$tag) {
|
|
12209
12750
|
case 3: {
|
|
12210
12751
|
break _L$4;
|
|
12211
12752
|
}
|
|
@@ -12216,12 +12757,42 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12216
12757
|
break _L$3;
|
|
12217
12758
|
}
|
|
12218
12759
|
task.status = new _M0DTP36mizchi7tornado5types10TaskStatus10InProgress(bid);
|
|
12219
|
-
const
|
|
12760
|
+
const task_feedback = _M0MPB13StringBuilder11new_2einner(0);
|
|
12761
|
+
const _bind$3 = feedback.length;
|
|
12762
|
+
let _tmp$3 = 0;
|
|
12763
|
+
while (true) {
|
|
12764
|
+
const _$2 = _tmp$3;
|
|
12765
|
+
if (_$2 < _bind$3) {
|
|
12766
|
+
const item = feedback[_$2];
|
|
12767
|
+
let _tmp$4;
|
|
12768
|
+
const _bind$4 = `${task.id}:`;
|
|
12769
|
+
if (_M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$4, 0, _bind$4.length))) {
|
|
12770
|
+
_tmp$4 = true;
|
|
12771
|
+
} else {
|
|
12772
|
+
const _bind$5 = `${task.id} `;
|
|
12773
|
+
_tmp$4 = _M0MPC16string6String11has__prefix(item, new _M0TPC16string10StringView(_bind$5, 0, _bind$5.length));
|
|
12774
|
+
}
|
|
12775
|
+
if (_tmp$4) {
|
|
12776
|
+
const task_feedback_item = _M0FP36mizchi7tornado5ralph29strip__task__feedback__prefix(item, task.id);
|
|
12777
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, "- ");
|
|
12778
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, task_feedback_item);
|
|
12779
|
+
_M0IPB13StringBuilderPB6Logger13write__string(task_feedback, "\n");
|
|
12780
|
+
}
|
|
12781
|
+
_tmp$3 = _$2 + 1 | 0;
|
|
12782
|
+
continue;
|
|
12783
|
+
} else {
|
|
12784
|
+
break;
|
|
12785
|
+
}
|
|
12786
|
+
}
|
|
12787
|
+
const task_feedback_str = _M0MPB13StringBuilder10to__string(task_feedback);
|
|
12788
|
+
const feedback_str = _M0MPC16string6String9is__empty(task_feedback_str) ? _M0MPB4Iter4foldGssE(_M0MPC15array5Array4iterGRP36mizchi7tornado5types11AgentConfigE(feedback), "", (acc, item) => `${acc}- ${item}\n`) : task_feedback_str;
|
|
12789
|
+
const rework_prompt = `${task.description}\n\nFeedback from verifier:\n${feedback_str}`;
|
|
12790
|
+
_M0FP36mizchi7tornado5ralph10emit__info(self, `Reworking task ${_M0IPC16string6StringPB4Show10to__string(task.id)}`);
|
|
12220
12791
|
const result = _M0MP36mizchi7tornado5agent12BoxedBackend3run(backend, rework_prompt, "", (e) => {
|
|
12221
12792
|
_M0FP36mizchi7tornado5ralph13handle__event(self, bid, e);
|
|
12222
12793
|
});
|
|
12223
|
-
const _bind$
|
|
12224
|
-
if (_bind$
|
|
12794
|
+
const _bind$4 = result.status;
|
|
12795
|
+
if (_bind$4.$tag === 2) {
|
|
12225
12796
|
task.status = _M0DTP36mizchi7tornado5types10TaskStatus4Done__;
|
|
12226
12797
|
task.result = result.content;
|
|
12227
12798
|
} else {
|
|
@@ -12230,7 +12801,7 @@ function _M0MP36mizchi7tornado5ralph9RalphLoop13rework__tasks(self, milestone, w
|
|
|
12230
12801
|
task.result = result.content;
|
|
12231
12802
|
}
|
|
12232
12803
|
}
|
|
12233
|
-
_tmp = _ + 1 | 0;
|
|
12804
|
+
_tmp$2 = _ + 1 | 0;
|
|
12234
12805
|
continue;
|
|
12235
12806
|
} else {
|
|
12236
12807
|
break;
|
|
@@ -13020,18 +13591,18 @@ function _M0MP36mizchi7tornado5ralph16MilestoneManager8to__json(self) {
|
|
|
13020
13591
|
}
|
|
13021
13592
|
return `{\"milestones\":[${_M0FP36mizchi7tornado5ralph13join__strings(parts, ",")}]}`;
|
|
13022
13593
|
}
|
|
13023
|
-
function _M0IP36mizchi7tornado6review17ReviewPerspectivePB4Show6output(
|
|
13024
|
-
switch (
|
|
13594
|
+
function _M0IP36mizchi7tornado6review17ReviewPerspectivePB4Show6output(_x_73, _x_74) {
|
|
13595
|
+
switch (_x_73) {
|
|
13025
13596
|
case 0: {
|
|
13026
|
-
|
|
13597
|
+
_x_74.method_table.method_0(_x_74.self, "CodeQuality");
|
|
13027
13598
|
return;
|
|
13028
13599
|
}
|
|
13029
13600
|
case 1: {
|
|
13030
|
-
|
|
13601
|
+
_x_74.method_table.method_0(_x_74.self, "Performance");
|
|
13031
13602
|
return;
|
|
13032
13603
|
}
|
|
13033
13604
|
default: {
|
|
13034
|
-
|
|
13605
|
+
_x_74.method_table.method_0(_x_74.self, "Security");
|
|
13035
13606
|
return;
|
|
13036
13607
|
}
|
|
13037
13608
|
}
|
|
@@ -13071,71 +13642,17 @@ function _M0MP36mizchi7tornado6review11ReviewAgent13build__prompt(self, perspect
|
|
|
13071
13642
|
}
|
|
13072
13643
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, agent_output);
|
|
13073
13644
|
_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
|
-
}
|
|
13645
|
+
switch (perspective) {
|
|
13646
|
+
case 0: {
|
|
13647
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts24code__quality__checklist(self.lang));
|
|
13648
|
+
break;
|
|
13106
13649
|
}
|
|
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
|
-
}
|
|
13650
|
+
case 1: {
|
|
13651
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts22performance__checklist(self.lang));
|
|
13652
|
+
break;
|
|
13653
|
+
}
|
|
13654
|
+
default: {
|
|
13655
|
+
_M0IPB13StringBuilderPB6Logger13write__string(buf, _M0FP36mizchi7tornado7prompts19security__checklist(self.lang));
|
|
13139
13656
|
}
|
|
13140
13657
|
}
|
|
13141
13658
|
_M0IPB13StringBuilderPB6Logger13write__string(buf, "\n\n");
|
|
@@ -13255,88 +13772,102 @@ function _M0MP36mizchi7tornado6review11ReviewAgent14parse__verdict(_self, output
|
|
|
13255
13772
|
}
|
|
13256
13773
|
return _M0DTP36mizchi7tornado5types13ReviewVerdict8Approved__;
|
|
13257
13774
|
}
|
|
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, "");
|
|
13775
|
+
function _M0MP36mizchi7tornado6review11ReviewAgent21build__system__prompt(self, perspective) {
|
|
13776
|
+
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
13777
|
}
|
|
13282
13778
|
function _M0MP36mizchi7tornado6review11ReviewAgent14review_2einner(self, task, backend, context, on_event) {
|
|
13283
|
-
const
|
|
13284
|
-
const summaries = _M0MPB13StringBuilder11new_2einner(0);
|
|
13285
|
-
const rejected_reason = new _M0TPC13ref3RefGOsE(undefined);
|
|
13779
|
+
const task_output = _M0MPC16option6Option10unwrap__orGsE(task.result, "");
|
|
13286
13780
|
const perspectives = _M0MP36mizchi7tornado6review11ReviewAgent12perspectives(self);
|
|
13781
|
+
const tasks = [];
|
|
13287
13782
|
const _bind = perspectives.length;
|
|
13288
13783
|
let _tmp = 0;
|
|
13289
13784
|
while (true) {
|
|
13290
13785
|
const _ = _tmp;
|
|
13291
13786
|
if (_ < _bind) {
|
|
13292
13787
|
const perspective = perspectives[_];
|
|
13293
|
-
|
|
13788
|
+
_M0MPC15array5Array4pushGsE(tasks, { _0: _M0MP36mizchi7tornado6review11ReviewAgent13build__prompt(self, perspective, task.description, task_output, context), _1: _M0MP36mizchi7tornado6review11ReviewAgent21build__system__prompt(self, perspective) });
|
|
13789
|
+
_tmp = _ + 1 | 0;
|
|
13790
|
+
continue;
|
|
13791
|
+
} else {
|
|
13792
|
+
break;
|
|
13793
|
+
}
|
|
13794
|
+
}
|
|
13795
|
+
const outputs = _M0FP36mizchi7tornado5agent21run__parallel_2einner(backend, tasks, on_event, "");
|
|
13796
|
+
const all_items = [];
|
|
13797
|
+
const summaries = _M0MPB13StringBuilder11new_2einner(0);
|
|
13798
|
+
const rejected_reason = new _M0TPC13ref3RefGOsE(undefined);
|
|
13799
|
+
const _bind$2 = 0;
|
|
13800
|
+
const _bind$3 = perspectives.length;
|
|
13801
|
+
let _tmp$2 = _bind$2;
|
|
13802
|
+
while (true) {
|
|
13803
|
+
const i = _tmp$2;
|
|
13804
|
+
if (i < _bind$3) {
|
|
13805
|
+
const perspective = _M0MPC15array5Array2atGRP36mizchi7tornado6review17ReviewPerspectiveE(perspectives, i);
|
|
13806
|
+
const output = _M0MPC15array5Array2atGsE(outputs, i);
|
|
13294
13807
|
_M0IPB13StringBuilderPB6Logger13write__string(summaries, `### ${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}\n`);
|
|
13295
|
-
_M0IPB13StringBuilderPB6Logger13write__string(summaries,
|
|
13808
|
+
_M0IPB13StringBuilderPB6Logger13write__string(summaries, output.content);
|
|
13296
13809
|
_M0IPB13StringBuilderPB6Logger13write__string(summaries, "\n\n");
|
|
13297
|
-
let
|
|
13810
|
+
let verdict;
|
|
13811
|
+
let err;
|
|
13298
13812
|
_L: {
|
|
13299
13813
|
_L$2: {
|
|
13814
|
+
const _bind$4 = output.status;
|
|
13815
|
+
if (_bind$4.$tag === 3) {
|
|
13816
|
+
const _Failed = _bind$4;
|
|
13817
|
+
const _err = _Failed._0;
|
|
13818
|
+
err = _err;
|
|
13819
|
+
break _L$2;
|
|
13820
|
+
} else {
|
|
13821
|
+
verdict = _M0MP36mizchi7tornado6review11ReviewAgent14parse__verdict(self, output.content);
|
|
13822
|
+
}
|
|
13823
|
+
break _L;
|
|
13824
|
+
}
|
|
13825
|
+
verdict = new _M0DTP36mizchi7tornado5types13ReviewVerdict8Rejected(`Review backend failed: ${_M0IPC16string6StringPB4Show10to__string(err)}`);
|
|
13826
|
+
}
|
|
13827
|
+
let items;
|
|
13828
|
+
_L$2: {
|
|
13829
|
+
_L$3: {
|
|
13300
13830
|
let reason;
|
|
13301
|
-
_L$
|
|
13302
|
-
_L$
|
|
13303
|
-
|
|
13304
|
-
switch (_bind$2.$tag) {
|
|
13831
|
+
_L$4: {
|
|
13832
|
+
_L$5: {
|
|
13833
|
+
switch (verdict.$tag) {
|
|
13305
13834
|
case 2: {
|
|
13306
|
-
const _Rejected =
|
|
13835
|
+
const _Rejected = verdict;
|
|
13307
13836
|
const _reason = _Rejected._0;
|
|
13308
13837
|
reason = _reason;
|
|
13309
|
-
break _L$
|
|
13838
|
+
break _L$5;
|
|
13310
13839
|
}
|
|
13311
13840
|
case 1: {
|
|
13312
|
-
const _NeedsChanges =
|
|
13841
|
+
const _NeedsChanges = verdict;
|
|
13313
13842
|
const _items = _NeedsChanges._0;
|
|
13314
13843
|
items = _items;
|
|
13315
|
-
break _L$
|
|
13844
|
+
break _L$3;
|
|
13316
13845
|
}
|
|
13317
13846
|
}
|
|
13318
|
-
break _L$
|
|
13847
|
+
break _L$4;
|
|
13848
|
+
}
|
|
13849
|
+
const _bind$4 = rejected_reason.val;
|
|
13850
|
+
if (_bind$4 === undefined) {
|
|
13851
|
+
rejected_reason.val = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(reason)}`;
|
|
13319
13852
|
}
|
|
13320
|
-
rejected_reason.val = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(reason)}`;
|
|
13321
|
-
break;
|
|
13322
13853
|
}
|
|
13323
|
-
break _L;
|
|
13854
|
+
break _L$2;
|
|
13324
13855
|
}
|
|
13325
|
-
const _bind$
|
|
13326
|
-
let _tmp$
|
|
13856
|
+
const _bind$4 = items.length;
|
|
13857
|
+
let _tmp$3 = 0;
|
|
13327
13858
|
while (true) {
|
|
13328
|
-
const _
|
|
13329
|
-
if (_
|
|
13330
|
-
const item = items[_
|
|
13859
|
+
const _ = _tmp$3;
|
|
13860
|
+
if (_ < _bind$4) {
|
|
13861
|
+
const item = items[_];
|
|
13331
13862
|
_M0MPC15array5Array4pushGsE(all_items, `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado6review17ReviewPerspectiveE(perspective)}] ${_M0IPC16string6StringPB4Show10to__string(item)}`);
|
|
13332
|
-
_tmp$
|
|
13863
|
+
_tmp$3 = _ + 1 | 0;
|
|
13333
13864
|
continue;
|
|
13334
13865
|
} else {
|
|
13335
13866
|
break;
|
|
13336
13867
|
}
|
|
13337
13868
|
}
|
|
13338
13869
|
}
|
|
13339
|
-
_tmp =
|
|
13870
|
+
_tmp$2 = i + 1 | 0;
|
|
13340
13871
|
continue;
|
|
13341
13872
|
} else {
|
|
13342
13873
|
break;
|
|
@@ -13346,11 +13877,11 @@ function _M0MP36mizchi7tornado6review11ReviewAgent14review_2einner(self, task, b
|
|
|
13346
13877
|
let reason;
|
|
13347
13878
|
_L: {
|
|
13348
13879
|
_L$2: {
|
|
13349
|
-
const _bind$
|
|
13350
|
-
if (_bind$
|
|
13880
|
+
const _bind$4 = rejected_reason.val;
|
|
13881
|
+
if (_bind$4 === undefined) {
|
|
13351
13882
|
verdict = _M0MPC15array5Array9is__emptyGsE(all_items) ? _M0DTP36mizchi7tornado5types13ReviewVerdict8Approved__ : new _M0DTP36mizchi7tornado5types13ReviewVerdict12NeedsChanges(all_items);
|
|
13352
13883
|
} else {
|
|
13353
|
-
const _Some = _bind$
|
|
13884
|
+
const _Some = _bind$4;
|
|
13354
13885
|
const _reason = _Some;
|
|
13355
13886
|
reason = _reason;
|
|
13356
13887
|
break _L$2;
|