@ymdvsymd/tornado 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/tornado.js +91 -20
- package/package.json +1 -1
package/bin/tornado.js
CHANGED
|
@@ -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 };
|
|
@@ -11142,6 +11153,7 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11142
11153
|
const rlm = new _M0TPC13ref3RefGbE(false);
|
|
11143
11154
|
const ralph = new _M0TPC13ref3RefGbE(false);
|
|
11144
11155
|
const lang = new _M0TPC13ref3RefGOsE(undefined);
|
|
11156
|
+
const log_path = new _M0TPC13ref3RefGOsE(undefined);
|
|
11145
11157
|
const warnings = [];
|
|
11146
11158
|
const i = new _M0TPC13ref3RefGiE(0);
|
|
11147
11159
|
const len = args.length;
|
|
@@ -11278,14 +11290,42 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11278
11290
|
}
|
|
11279
11291
|
continue;
|
|
11280
11292
|
}
|
|
11281
|
-
const _bind$6 = "--";
|
|
11293
|
+
const _bind$6 = "--log=";
|
|
11282
11294
|
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$6, 0, _bind$6.length))) {
|
|
11295
|
+
const path = _M0IPC16string10StringViewPB4Show10to__string(_M0MPC16string6String12view_2einner(token, "--log=".length, undefined));
|
|
11296
|
+
if (_M0MPC16string6String9is__empty(path)) {
|
|
11297
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11298
|
+
} else {
|
|
11299
|
+
log_path.val = path;
|
|
11300
|
+
}
|
|
11301
|
+
i.val = i.val + 1 | 0;
|
|
11302
|
+
continue;
|
|
11303
|
+
}
|
|
11304
|
+
if (token === "--log") {
|
|
11305
|
+
if ((i.val + 1 | 0) < len) {
|
|
11306
|
+
const path = _M0MPC15array5Array2atGsE(args, i.val + 1 | 0);
|
|
11307
|
+
const _bind$7 = "--";
|
|
11308
|
+
if (_M0MPC16string6String11has__prefix(path, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11309
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11310
|
+
i.val = i.val + 1 | 0;
|
|
11311
|
+
} else {
|
|
11312
|
+
log_path.val = path;
|
|
11313
|
+
i.val = i.val + 2 | 0;
|
|
11314
|
+
}
|
|
11315
|
+
} else {
|
|
11316
|
+
_M0MPC15array5Array4pushGsE(warnings, "Missing value for --log");
|
|
11317
|
+
i.val = i.val + 1 | 0;
|
|
11318
|
+
}
|
|
11319
|
+
continue;
|
|
11320
|
+
}
|
|
11321
|
+
const _bind$7 = "--";
|
|
11322
|
+
if (_M0MPC16string6String11has__prefix(token, new _M0TPC16string10StringView(_bind$7, 0, _bind$7.length))) {
|
|
11283
11323
|
_M0MPC15array5Array4pushGsE(warnings, `Unknown option: ${_M0IPC16string6StringPB4Show10to__string(token)}`);
|
|
11284
11324
|
i.val = i.val + 1 | 0;
|
|
11285
11325
|
continue;
|
|
11286
11326
|
}
|
|
11287
|
-
const _bind$
|
|
11288
|
-
if (_bind$
|
|
11327
|
+
const _bind$8 = plan_path.val;
|
|
11328
|
+
if (_bind$8 === undefined) {
|
|
11289
11329
|
if (file_exists(token)) {
|
|
11290
11330
|
plan_path.val = token;
|
|
11291
11331
|
} else {
|
|
@@ -11300,11 +11340,11 @@ function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
|
11300
11340
|
break;
|
|
11301
11341
|
}
|
|
11302
11342
|
}
|
|
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);
|
|
11343
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, review_interval.val, rlm.val, ralph.val, lang.val, log_path.val, warnings);
|
|
11304
11344
|
}
|
|
11305
11345
|
function _M0FP36mizchi7tornado3cli16parse__cli__args(args, file_exists) {
|
|
11306
11346
|
if (args.length < 2) {
|
|
11307
|
-
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, []);
|
|
11347
|
+
return new _M0DTP36mizchi7tornado3cli10CliCommand3Run(undefined, undefined, undefined, undefined, undefined, false, false, undefined, undefined, []);
|
|
11308
11348
|
}
|
|
11309
11349
|
const first = _M0MPC15array5Array2atGsE(args, 1);
|
|
11310
11350
|
_L: {
|
|
@@ -14026,6 +14066,12 @@ function _M0FP46mizchi7tornado3cmd3app23build__plan__file__task(plan_path, revie
|
|
|
14026
14066
|
}
|
|
14027
14067
|
return _M0MPB13StringBuilder10to__string(buf);
|
|
14028
14068
|
}
|
|
14069
|
+
function _M0FP46mizchi7tornado3cmd3app18append__file__sync(path, content) {
|
|
14070
|
+
_M0FP46mizchi7tornado3cmd3app22js__append__file__sync(path, content);
|
|
14071
|
+
}
|
|
14072
|
+
function _M0FP46mizchi7tornado3cmd3app14get__log__file() {
|
|
14073
|
+
return _M0FP46mizchi7tornado3cmd3app18js__get__log__file();
|
|
14074
|
+
}
|
|
14029
14075
|
function _M0FP46mizchi7tornado3cmd3app14now__timestamp() {
|
|
14030
14076
|
return _M0FP46mizchi7tornado3cmd3app18js__now__timestamp();
|
|
14031
14077
|
}
|
|
@@ -14059,9 +14105,14 @@ function _M0FP46mizchi7tornado3cmd3app3log(level, msg) {
|
|
|
14059
14105
|
}
|
|
14060
14106
|
if (_M0MPC16string6String9is__empty(color)) {
|
|
14061
14107
|
_M0FPB7printlnGsE(`[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}`);
|
|
14062
|
-
return;
|
|
14063
14108
|
} else {
|
|
14064
14109
|
_M0FPB7printlnGsE(`${_M0IPC16string6StringPB4Show10to__string(color)}[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\u001b[0m`);
|
|
14110
|
+
}
|
|
14111
|
+
const log_file = _M0FP46mizchi7tornado3cmd3app14get__log__file();
|
|
14112
|
+
if (!_M0MPC16string6String9is__empty(log_file)) {
|
|
14113
|
+
_M0FP46mizchi7tornado3cmd3app18append__file__sync(log_file, `[${_M0IPC16string6StringPB4Show10to__string(ts)}] [${_M0IPC16string6StringPB4Show10to__string(level)}] ${_M0IPC16string6StringPB4Show10to__string(msg)}\n`);
|
|
14114
|
+
return;
|
|
14115
|
+
} else {
|
|
14065
14116
|
return;
|
|
14066
14117
|
}
|
|
14067
14118
|
}
|
|
@@ -15666,19 +15717,23 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15666
15717
|
}
|
|
15667
15718
|
}
|
|
15668
15719
|
}
|
|
15720
|
+
function _M0FP46mizchi7tornado3cmd3app14set__log__file(path) {
|
|
15721
|
+
_M0FP46mizchi7tornado3cmd3app18js__set__log__file(path);
|
|
15722
|
+
}
|
|
15669
15723
|
(() => {
|
|
15670
15724
|
const args = _M0FP36mizchi1x3sys14get__cli__args();
|
|
15671
15725
|
const command = _M0FP36mizchi7tornado3cli16parse__cli__args(args, _M0FP46mizchi7tornado3cmd3app18is__existing__file);
|
|
15672
15726
|
let path;
|
|
15673
15727
|
_L: {
|
|
15674
15728
|
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
15729
|
let ralph;
|
|
15730
|
+
let review_interval;
|
|
15731
|
+
let dev_kind;
|
|
15732
|
+
let config_path;
|
|
15733
|
+
let plan_path;
|
|
15734
|
+
let review_kind;
|
|
15735
|
+
let rlm;
|
|
15736
|
+
let log_path;
|
|
15682
15737
|
let warnings;
|
|
15683
15738
|
_L$2: {
|
|
15684
15739
|
switch (command.$tag) {
|
|
@@ -15691,16 +15746,18 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15691
15746
|
const _review_interval = _Run._4;
|
|
15692
15747
|
const _rlm = _Run._5;
|
|
15693
15748
|
const _ralph = _Run._6;
|
|
15749
|
+
const _log_path = _Run._8;
|
|
15694
15750
|
const _cli_lang = _Run._7;
|
|
15695
|
-
const _warnings = _Run.
|
|
15751
|
+
const _warnings = _Run._9;
|
|
15696
15752
|
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
15753
|
ralph = _ralph;
|
|
15754
|
+
review_interval = _review_interval;
|
|
15755
|
+
dev_kind = _dev_kind;
|
|
15756
|
+
config_path = _config_path;
|
|
15757
|
+
plan_path = _plan_path;
|
|
15758
|
+
review_kind = _review_kind;
|
|
15759
|
+
rlm = _rlm;
|
|
15760
|
+
log_path = _log_path;
|
|
15704
15761
|
warnings = _warnings;
|
|
15705
15762
|
break _L$2;
|
|
15706
15763
|
}
|
|
@@ -15730,6 +15787,20 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
15730
15787
|
}
|
|
15731
15788
|
}
|
|
15732
15789
|
const lang = _M0FP46mizchi7tornado3cmd3app13resolve__lang(cli_lang);
|
|
15790
|
+
let path$2;
|
|
15791
|
+
_L$3: {
|
|
15792
|
+
_L$4: {
|
|
15793
|
+
if (log_path === undefined) {
|
|
15794
|
+
} else {
|
|
15795
|
+
const _Some = log_path;
|
|
15796
|
+
const _path = _Some;
|
|
15797
|
+
path$2 = _path;
|
|
15798
|
+
break _L$4;
|
|
15799
|
+
}
|
|
15800
|
+
break _L$3;
|
|
15801
|
+
}
|
|
15802
|
+
_M0FP46mizchi7tornado3cmd3app14set__log__file(path$2);
|
|
15803
|
+
}
|
|
15733
15804
|
if (ralph) {
|
|
15734
15805
|
_M0FP46mizchi7tornado3cmd3app10run__ralph(config_path, lang, dev_kind, review_kind);
|
|
15735
15806
|
return;
|