@ymdvsymd/tornado 0.6.1 → 0.7.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/bin/tornado.js +99 -23
- package/package.json +1 -1
package/bin/tornado.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
#\!/usr/bin/env node
|
|
2
2
|
function _M0DTPB4Json4Null() {}
|
|
3
3
|
_M0DTPB4Json4Null.prototype.$tag = 0;
|
|
4
4
|
const _M0DTPB4Json4Null__ = new _M0DTPB4Json4Null();
|
|
@@ -777,7 +777,7 @@ function _M0TPC13ref3RefGORP36mizchi7tornado5types9AgentKindE(param0) {
|
|
|
777
777
|
function _M0TPC13ref3RefGOiE(param0) {
|
|
778
778
|
this.val = param0;
|
|
779
779
|
}
|
|
780
|
-
function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, param3, param4, param5, param6, param7, param8) {
|
|
780
|
+
function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9) {
|
|
781
781
|
this._0 = param0;
|
|
782
782
|
this._1 = param1;
|
|
783
783
|
this._2 = param2;
|
|
@@ -787,6 +787,7 @@ function _M0DTP36mizchi7tornado3cli10CliCommand3Run(param0, param1, param2, para
|
|
|
787
787
|
this._6 = param6;
|
|
788
788
|
this._7 = param7;
|
|
789
789
|
this._8 = param8;
|
|
790
|
+
this._9 = param9;
|
|
790
791
|
}
|
|
791
792
|
_M0DTP36mizchi7tornado3cli10CliCommand3Run.prototype.$tag = 0;
|
|
792
793
|
function _M0DTP36mizchi7tornado3cli10CliCommand8Validate(param0) {
|
|
@@ -935,6 +936,13 @@ const _M0FP46mizchi7tornado3cmd3app14js__exec__sync = (command) => {
|
|
|
935
936
|
return '';
|
|
936
937
|
}
|
|
937
938
|
};
|
|
939
|
+
const _M0FP46mizchi7tornado3cmd3app22js__append__file__sync = (path, content) => {
|
|
940
|
+
const fs = require('fs');
|
|
941
|
+
fs.appendFileSync(path, content, 'utf-8');
|
|
942
|
+
};
|
|
943
|
+
const _M0FP46mizchi7tornado3cmd3app18js__get__log__file = () => {
|
|
944
|
+
return globalThis.__tornado_log_file || "";
|
|
945
|
+
};
|
|
938
946
|
const _M0FP46mizchi7tornado3cmd3app18js__now__timestamp = () => {
|
|
939
947
|
const d = new Date();
|
|
940
948
|
const h = String(d.getHours()).padStart(2, '0');
|
|
@@ -1045,6 +1053,9 @@ const _M0FP46mizchi7tornado3cmd3app25js__start__stdin__watcher = () => {
|
|
|
1045
1053
|
watcher.unref();
|
|
1046
1054
|
process.on('exit', () => { try { watcher.kill(); } catch {} });
|
|
1047
1055
|
};
|
|
1056
|
+
const _M0FP46mizchi7tornado3cmd3app18js__set__log__file = (path) => {
|
|
1057
|
+
globalThis.__tornado_log_file = path;
|
|
1058
|
+
};
|
|
1048
1059
|
const _M0FP078mizchi_2fllm_2fanthropic_2fAnthropicProvider_24as_24_40mizchi_2fllm_2eProvider = { method_0: _M0IP36mizchi3llm9anthropic17AnthropicProviderP26mizchi3llm8Provider6stream, method_1: _M0IP36mizchi3llm9anthropic17AnthropicProviderP26mizchi3llm8Provider4name };
|
|
1049
1060
|
const _M0FP088mizchi_2ftornado_2fagent_2fMockBackend_24as_24_40mizchi_2ftornado_2fagent_2eAgentBackend = { method_0: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend3run, method_1: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend4name, method_2: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend16set__session__id, method_3: _M0IP36mizchi7tornado5agent11MockBackendP36mizchi7tornado5agent12AgentBackend16get__session__id };
|
|
1050
1061
|
const _M0FP092moonbitlang_2fcore_2fbuiltin_2fStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger = { method_0: _M0IPB13StringBuilderPB6Logger13write__string, method_1: _M0IP016_24default__implPB6Logger16write__substringGRPB13StringBuilderE, method_2: _M0IPB13StringBuilderPB6Logger11write__view, method_3: _M0IPB13StringBuilderPB6Logger11write__char };
|
|
@@ -10625,7 +10636,12 @@ function _M0FP36mizchi7tornado5agent15create__backend(config) {
|
|
|
10625
10636
|
return _M0MP36mizchi7tornado5agent10ApiBackend5boxed(_M0MP36mizchi7tornado5agent10ApiBackend17anthropic_2einner(api_key, model$3));
|
|
10626
10637
|
}
|
|
10627
10638
|
default: {
|
|
10628
|
-
|
|
10639
|
+
const _bind$2 = config.role;
|
|
10640
|
+
if (_bind$2 === 4) {
|
|
10641
|
+
return _M0MP36mizchi7tornado5agent11MockBackend5boxed(_M0MP36mizchi7tornado5agent11MockBackend11new_2einner("<wave_approved>"));
|
|
10642
|
+
} else {
|
|
10643
|
+
return _M0MP36mizchi7tornado5agent11MockBackend5boxed(_M0MP36mizchi7tornado5agent11MockBackend11new_2einner("mock response"));
|
|
10644
|
+
}
|
|
10629
10645
|
}
|
|
10630
10646
|
}
|
|
10631
10647
|
}
|
|
@@ -11142,6 +11158,7 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11142
11158
|
const rlm = new _M0TPC13ref3RefGbE(false);
|
|
11143
11159
|
const ralph = new _M0TPC13ref3RefGbE(false);
|
|
11144
11160
|
const lang = new _M0TPC13ref3RefGOsE(undefined);
|
|
11161
|
+
const log_path = new _M0TPC13ref3RefGOsE(undefined);
|
|
11145
11162
|
const warnings = [];
|
|
11146
11163
|
const i = new _M0TPC13ref3RefGiE(0);
|
|
11147
11164
|
const len = args.length;
|
|
@@ -11278,14 +11295,42 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11278
11295
|
}
|
|
11279
11296
|
continue;
|
|
11280
11297
|
}
|
|
11281
|
-
const _bind$6 = "--";
|
|
11298
|
+
const _bind$6 = "--log=";
|
|
11282
11299
|
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$6, 0, _bind$6.length))) {
|
|
11300
|
+
const path = _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(token, "--log=".length, undefined));
|
|
11301
|
+
if (_M0MPC16string6String9is__empty(path)) {
|
|
11302
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11303
|
+
} else {
|
|
11304
|
+
log_path.val = path;
|
|
11305
|
+
}
|
|
11306
|
+
i.val = i.val + 1 | 0;
|
|
11307
|
+
continue;
|
|
11308
|
+
}
|
|
11309
|
+
if (token === "--log") {
|
|
11310
|
+
if ((i.val + 1 | 0) < len) {
|
|
11311
|
+
const path = _M0MPC15array5Array2atGsE(args, i.val + 1 | 0);
|
|
11312
|
+
const _bind$7 = "--";
|
|
11313
|
+
if (_M0MPC16string6String11has__prefix(path, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11314
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11315
|
+
i.val = i.val + 1 | 0;
|
|
11316
|
+
} else {
|
|
11317
|
+
log_path.val = path;
|
|
11318
|
+
i.val = i.val + 2 | 0;
|
|
11319
|
+
}
|
|
11320
|
+
} else {
|
|
11321
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11322
|
+
i.val = i.val + 1 | 0;
|
|
11323
|
+
}
|
|
11324
|
+
continue;
|
|
11325
|
+
}
|
|
11326
|
+
const _bind$7 = "--";
|
|
11327
|
+
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11283
11328
|
_M0MPC15array5Array4pushGsE(warnings, `Unknown option: ${_M0IPC16string6StringPB4Show10to__string(token)}`);
|
|
11284
11329
|
i.val = i.val + 1 | 0;
|
|
11285
11330
|
continue;
|
|
11286
11331
|
}
|
|
11287
|
-
const _bind$
|
|
11288
|
-
if (_bind$
|
|
11332
|
+
const _bind$8 = plan_path.val;
|
|
11333
|
+
if (_bind$8 === undefined) {
|
|
11289
11334
|
if (file_exists(token)) {
|
|
11290
11335
|
plan_path.val = token;
|
|
11291
11336
|
} else {
|
|
@@ -11300,11 +11345,11 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11300
11345
|
break;
|
|
11301
11346
|
}
|
|
11302
11347
|
}
|
|
11303
|
-
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, review_interval.val, rlm.val, ralph.val, lang.val, warnings);
|
|
11348
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, review_interval.val, rlm.val, ralph.val, lang.val, log_path.val, warnings);
|
|
11304
11349
|
}
|
|
11305
11350
|
function _M0FP36mizchi7tornado3cli16parse__cli__args(args, file_exists) {
|
|
11306
11351
|
if (args.length < 2) {
|
|
11307
|
-
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, []);
|
|
11352
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, undefined, []);
|
|
11308
11353
|
}
|
|
11309
11354
|
const first = _M0MPC15array5Array2atGsE(args, 1);
|
|
11310
11355
|
_L: {
|
|
@@ -12122,7 +12167,7 @@ function _M0MP36mizchi7tornado5ralph13VerifierAgent14parse__verdict(_self, outpu
|
|
|
12122
12167
|
if (_M0MPC16string6String8contains(output, new _M0TPC16string10StringView(_bind, 0, _bind.length))) {
|
|
12123
12168
|
return _M0DTP36mizchi7tornado5types15VerifierVerdict8Approved__;
|
|
12124
12169
|
}
|
|
12125
|
-
return
|
|
12170
|
+
return new _M0DTP36mizchi7tornado5types15VerifierVerdict15MilestoneFailed("Verifier output did not contain expected verdict tags");
|
|
12126
12171
|
}
|
|
12127
12172
|
function _M0FP36mizchi7tornado5ralph24inject__perspective__tag(item, perspective) {
|
|
12128
12173
|
const tag = `[${_M0IP016_24default__implPB4Show10to__stringGRP36mizchi7tornado5ralph19VerifierPerspectiveE(perspective)}] `;
|
|
@@ -14026,6 +14071,12 @@ function _M0FP46mizchi7tornado3cmd3app23build__plan__file__task(plan_path, revie
|
|
|
14026
14071
|
}
|
|
14027
14072
|
return _M0MPB13StringBuilder10to__string(buf);
|
|
14028
14073
|
}
|
|
14074
|
+
function _M0FP46mizchi7tornado3cmd3app18append__file__sync(path, content) {
|
|
14075
|
+
_M0FP46mizchi7tornado3cmd3app22js__append__file__sync(path, content);
|
|
14076
|
+
}
|
|
14077
|
+
function _M0FP46mizchi7tornado3cmd3app14get__log__file() {
|
|
14078
|
+
return _M0FP46mizchi7tornado3cmd3app18js__get__log__file();
|
|
14079
|
+
}
|
|
14029
14080
|
function _M0FP46mizchi7tornado3cmd3app14now__timestamp() {
|
|
14030
14081
|
return _M0FP46mizchi7tornado3cmd3app18js__now__timestamp();
|
|
14031
14082
|
}
|
|
@@ -14059,9 +14110,14 @@ function _M0FP46mizchi7tornado3cmd3app3log(level, msg) {
|
|
|
14059
14110
|
}
|
|
14060
14111
|
if (_M0MPC16string6String9is__empty(color)) {
|
|
14061
14112
|
_M0FPB7printlnGsE(`[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}`);
|
|
14062
|
-
return;
|
|
14063
14113
|
} else {
|
|
14064
14114
|
_M0FPB7printlnGsE(`${_M0IPC16string6StringPB4Show10to__string(color)}[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\u001b[0m`);
|
|
14115
|
+
}
|
|
14116
|
+
const log_file = _M0FP46mizchi7tornado3cmd3app14get__log__file();
|
|
14117
|
+
if (!_M0MPC16string6String9is__empty(log_file)) {
|
|
14118
|
+
_M0FP46mizchi7tornado3cmd3app18append__file__sync(log_file, `[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\n`);
|
|
14119
|
+
return;
|
|
14120
|
+
} else {
|
|
14065
14121
|
return;
|
|
14066
14122
|
}
|
|
14067
14123
|
}
|
|
@@ -15666,19 +15722,23 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15666
15722
|
}
|
|
15667
15723
|
}
|
|
15668
15724
|
}
|
|
15725
|
+
function _M0FP46mizchi7tornado3cmd3app14set__log__file(path) {
|
|
15726
|
+
_M0FP46mizchi7tornado3cmd3app18js__set__log__file(path);
|
|
15727
|
+
}
|
|
15669
15728
|
(() => {
|
|
15670
15729
|
const args = _M0FP36mizchi1x3sys14get__cli__args();
|
|
15671
15730
|
const command = _M0FP36mizchi7tornado3cli16parse__cli__args(args, _M0FP46mizchi7tornado3cmd3app18is__existing__file);
|
|
15672
15731
|
let path;
|
|
15673
15732
|
_L: {
|
|
15674
15733
|
let cli_lang;
|
|
15675
|
-
let rlm;
|
|
15676
|
-
let review_kind;
|
|
15677
|
-
let plan_path;
|
|
15678
|
-
let config_path;
|
|
15679
|
-
let dev_kind;
|
|
15680
|
-
let review_interval;
|
|
15681
15734
|
let ralph;
|
|
15735
|
+
let review_interval;
|
|
15736
|
+
let dev_kind;
|
|
15737
|
+
let config_path;
|
|
15738
|
+
let plan_path;
|
|
15739
|
+
let review_kind;
|
|
15740
|
+
let rlm;
|
|
15741
|
+
let log_path;
|
|
15682
15742
|
let warnings;
|
|
15683
15743
|
_L$2: {
|
|
15684
15744
|
switch (command.$tag) {
|
|
@@ -15691,16 +15751,18 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15691
15751
|
const _review_interval = _Run._4;
|
|
15692
15752
|
const _rlm = _Run._5;
|
|
15693
15753
|
const _ralph = _Run._6;
|
|
15754
|
+
const _log_path = _Run._8;
|
|
15694
15755
|
const _cli_lang = _Run._7;
|
|
15695
|
-
const _warnings = _Run.
|
|
15756
|
+
const _warnings = _Run._9;
|
|
15696
15757
|
cli_lang = _cli_lang;
|
|
15697
|
-
rlm = _rlm;
|
|
15698
|
-
review_kind = _review_kind;
|
|
15699
|
-
plan_path = _plan_path;
|
|
15700
|
-
config_path = _config_path;
|
|
15701
|
-
dev_kind = _dev_kind;
|
|
15702
|
-
review_interval = _review_interval;
|
|
15703
15758
|
ralph = _ralph;
|
|
15759
|
+
review_interval = _review_interval;
|
|
15760
|
+
dev_kind = _dev_kind;
|
|
15761
|
+
config_path = _config_path;
|
|
15762
|
+
plan_path = _plan_path;
|
|
15763
|
+
review_kind = _review_kind;
|
|
15764
|
+
rlm = _rlm;
|
|
15765
|
+
log_path = _log_path;
|
|
15704
15766
|
warnings = _warnings;
|
|
15705
15767
|
break _L$2;
|
|
15706
15768
|
}
|
|
@@ -15730,6 +15792,20 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15730
15792
|
}
|
|
15731
15793
|
}
|
|
15732
15794
|
const lang = _M0FP46mizchi7tornado3cmd3app13resolve__lang(cli_lang);
|
|
15795
|
+
let path$2;
|
|
15796
|
+
_L$3: {
|
|
15797
|
+
_L$4: {
|
|
15798
|
+
if (log_path === undefined) {
|
|
15799
|
+
} else {
|
|
15800
|
+
const _Some = log_path;
|
|
15801
|
+
const _path = _Some;
|
|
15802
|
+
path$2 = _path;
|
|
15803
|
+
break _L$4;
|
|
15804
|
+
}
|
|
15805
|
+
break _L$3;
|
|
15806
|
+
}
|
|
15807
|
+
_M0FP46mizchi7tornado3cmd3app14set__log__file(path$2);
|
|
15808
|
+
}
|
|
15733
15809
|
if (ralph) {
|
|
15734
15810
|
_M0FP46mizchi7tornado3cmd3app10run__ralph(config_path, lang, dev_kind, review_kind);
|
|
15735
15811
|
return;
|