@mizchi/tornado 0.1.0 → 0.2.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 +610 -244
- package/package.json +8 -1
- package/sdk/agent-adapter.mjs +1 -0
- package/sdk/agent-adapter.mts +31 -0
- package/sdk/agent-runner.mjs +39 -0
- package/sdk/agent-runner.mts +56 -0
- package/sdk/agent-runner.test.mjs +69 -0
- package/sdk/claude-adapter.mjs +105 -0
- package/sdk/claude-adapter.mts +143 -0
- package/sdk/claude-runner.mjs +3 -87
- package/sdk/claude-runner.mts +4 -0
- package/sdk/codex-adapter.mjs +77 -0
- package/sdk/codex-adapter.mts +140 -0
- package/sdk/codex-normalizer.mjs +152 -0
- package/sdk/codex-normalizer.mts +190 -0
- package/sdk/codex-normalizer.test.mjs +126 -0
- package/sdk/codex-runner.mjs +3 -208
- package/sdk/codex-runner.mts +4 -0
- package/sdk/runner-io.mjs +8 -0
- package/sdk/runner-io.mts +12 -0
package/bin/tornado.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
const $64$moonbitlang$47$core$47$builtin$46$Json$Null = { $tag: 0, $name: "Null" };
|
|
3
3
|
const $64$moonbitlang$47$core$47$builtin$46$Json$True = { $tag: 1, $name: "True" };
|
|
4
4
|
const $64$moonbitlang$47$core$47$builtin$46$Json$False = { $tag: 2, $name: "False" };
|
|
@@ -559,6 +559,21 @@ function Result$Ok$16$(param0) {
|
|
|
559
559
|
}
|
|
560
560
|
Result$Ok$16$.prototype.$tag = 1;
|
|
561
561
|
Result$Ok$16$.prototype.$name = "Ok";
|
|
562
|
+
function $64$mizchi$47$tornado$47$cli$46$CliCommand$Run(param0, param1, param2, param3, param4) {
|
|
563
|
+
this._0 = param0;
|
|
564
|
+
this._1 = param1;
|
|
565
|
+
this._2 = param2;
|
|
566
|
+
this._3 = param3;
|
|
567
|
+
this._4 = param4;
|
|
568
|
+
}
|
|
569
|
+
$64$mizchi$47$tornado$47$cli$46$CliCommand$Run.prototype.$tag = 0;
|
|
570
|
+
$64$mizchi$47$tornado$47$cli$46$CliCommand$Run.prototype.$name = "Run";
|
|
571
|
+
function $64$mizchi$47$tornado$47$cli$46$CliCommand$Validate(param0) {
|
|
572
|
+
this._0 = param0;
|
|
573
|
+
}
|
|
574
|
+
$64$mizchi$47$tornado$47$cli$46$CliCommand$Validate.prototype.$tag = 1;
|
|
575
|
+
$64$mizchi$47$tornado$47$cli$46$CliCommand$Validate.prototype.$name = "Validate";
|
|
576
|
+
const $64$mizchi$47$tornado$47$cli$46$CliCommand$Help = { $tag: 2, $name: "Help" };
|
|
562
577
|
const $64$mizchi$47$tornado$47$types$46$ReviewVerdict$Approved = { $tag: 0, $name: "Approved" };
|
|
563
578
|
function $64$mizchi$47$tornado$47$types$46$ReviewVerdict$NeedsChanges(param0) {
|
|
564
579
|
this._0 = param0;
|
|
@@ -573,14 +588,6 @@ $64$mizchi$47$tornado$47$types$46$ReviewVerdict$Rejected.prototype.$name = "Reje
|
|
|
573
588
|
const _M0FP511moonbitlang1x3sys8internal3ffi24get__cli__args__internal = function() {
|
|
574
589
|
return process.argv.slice(1);
|
|
575
590
|
};
|
|
576
|
-
const _M0FP46mizchi7tornado3cmd3app14js__exec__sync = (command) => {
|
|
577
|
-
try {
|
|
578
|
-
const { execSync } = require('child_process');
|
|
579
|
-
return execSync(command, { encoding: 'utf-8', timeout: 10000 }).trim();
|
|
580
|
-
} catch (e) {
|
|
581
|
-
return '';
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
591
|
const _M0FP46mizchi7tornado3cmd3app20js__read__file__sync = (path) => {
|
|
585
592
|
try {
|
|
586
593
|
const fs = require('fs');
|
|
@@ -589,6 +596,21 @@ const _M0FP46mizchi7tornado3cmd3app20js__read__file__sync = (path) => {
|
|
|
589
596
|
return 'ERROR: ' + (e.message || String(e));
|
|
590
597
|
}
|
|
591
598
|
};
|
|
599
|
+
const _M0FP46mizchi7tornado3cmd3app18js__now__timestamp = () => {
|
|
600
|
+
const d = new Date();
|
|
601
|
+
const h = String(d.getHours()).padStart(2, '0');
|
|
602
|
+
const m = String(d.getMinutes()).padStart(2, '0');
|
|
603
|
+
const s = String(d.getSeconds()).padStart(2, '0');
|
|
604
|
+
return h + ':' + m + ':' + s;
|
|
605
|
+
};
|
|
606
|
+
const _M0FP46mizchi7tornado3cmd3app14js__exec__sync = (command) => {
|
|
607
|
+
try {
|
|
608
|
+
const { execSync } = require('child_process');
|
|
609
|
+
return execSync(command, { encoding: 'utf-8', timeout: 10000 }).trim();
|
|
610
|
+
} catch (e) {
|
|
611
|
+
return '';
|
|
612
|
+
}
|
|
613
|
+
};
|
|
592
614
|
const _M0FP46mizchi7tornado3cmd3app20js__check__interrupt = () => {
|
|
593
615
|
const fs = require('fs');
|
|
594
616
|
const file = '.tornado/interrupt.txt';
|
|
@@ -601,13 +623,6 @@ const _M0FP46mizchi7tornado3cmd3app20js__check__interrupt = () => {
|
|
|
601
623
|
} catch {}
|
|
602
624
|
return '';
|
|
603
625
|
};
|
|
604
|
-
const _M0FP46mizchi7tornado3cmd3app18js__now__timestamp = () => {
|
|
605
|
-
const d = new Date();
|
|
606
|
-
const h = String(d.getHours()).padStart(2, '0');
|
|
607
|
-
const m = String(d.getMinutes()).padStart(2, '0');
|
|
608
|
-
const s = String(d.getSeconds()).padStart(2, '0');
|
|
609
|
-
return h + ':' + m + ':' + s;
|
|
610
|
-
};
|
|
611
626
|
const _M0FP46mizchi7tornado3cmd3app16js__prompt__sync = (message) => {
|
|
612
627
|
const { execFileSync } = require('child_process');
|
|
613
628
|
try {
|
|
@@ -1522,6 +1537,16 @@ function _M0MP311moonbitlang4core6string10StringView6length(self) {
|
|
|
1522
1537
|
function _M0MP311moonbitlang4core6string10StringView13start__offset(self) {
|
|
1523
1538
|
return self.start;
|
|
1524
1539
|
}
|
|
1540
|
+
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP311moonbitlang4core7builtin7FailureE(self) {
|
|
1541
|
+
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1542
|
+
_M0IP311moonbitlang4core7builtin7FailureP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1543
|
+
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1544
|
+
}
|
|
1545
|
+
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGiE(self) {
|
|
1546
|
+
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1547
|
+
_M0IP311moonbitlang4core3int3IntP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1548
|
+
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1549
|
+
}
|
|
1525
1550
|
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP36mizchi7tornado5types9AgentKindE(self) {
|
|
1526
1551
|
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1527
1552
|
_M0IP36mizchi7tornado5types9AgentKindP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
@@ -1532,19 +1557,14 @@ function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGR
|
|
|
1532
1557
|
_M0IP36mizchi7tornado5types9AgentRoleP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1533
1558
|
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1534
1559
|
}
|
|
1535
|
-
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGiE(self) {
|
|
1536
|
-
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1537
|
-
_M0IP311moonbitlang4core3int3IntP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1538
|
-
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1539
|
-
}
|
|
1540
1560
|
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGdE(self) {
|
|
1541
1561
|
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1542
1562
|
_M0IP311moonbitlang4core6double6DoubleP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1543
1563
|
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1544
1564
|
}
|
|
1545
|
-
function
|
|
1565
|
+
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP311moonbitlang4core4json10ParseErrorE(self) {
|
|
1546
1566
|
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1547
|
-
|
|
1567
|
+
_M0IP311moonbitlang4core4json10ParseErrorP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1548
1568
|
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1549
1569
|
}
|
|
1550
1570
|
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP36mizchi7tornado5types11AgentStatusE(self) {
|
|
@@ -1557,11 +1577,6 @@ function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGR
|
|
|
1557
1577
|
_M0IP36mizchi7tornado6review17ReviewPerspectiveP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1558
1578
|
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1559
1579
|
}
|
|
1560
|
-
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP311moonbitlang4core4json10ParseErrorE(self) {
|
|
1561
|
-
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1562
|
-
_M0IP311moonbitlang4core4json10ParseErrorP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
1563
|
-
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(logger);
|
|
1564
|
-
}
|
|
1565
1580
|
function _M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGRP311moonbitlang4core7builtin9SourceLocE(self) {
|
|
1566
1581
|
const logger = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
1567
1582
|
_M0IP311moonbitlang4core7builtin9SourceLocP311moonbitlang4core7builtin4Show6output(self, { self: logger, method_table: _M0FP095_40moonbitlang_2fcore_2fbuiltin_2eStringBuilder_24as_24_40moonbitlang_2fcore_2fbuiltin_2eLogger });
|
|
@@ -1575,11 +1590,11 @@ function _M0MP311moonbitlang4core7builtin4Iter4nextGUsRP311moonbitlang4core7buil
|
|
|
1575
1590
|
const _func = self;
|
|
1576
1591
|
return _func();
|
|
1577
1592
|
}
|
|
1578
|
-
function
|
|
1593
|
+
function _M0MP311moonbitlang4core7builtin4Iter4nextGRP36mizchi7tornado5types11AgentConfigE(self) {
|
|
1579
1594
|
const _func = self;
|
|
1580
1595
|
return _func();
|
|
1581
1596
|
}
|
|
1582
|
-
function
|
|
1597
|
+
function _M0MP311moonbitlang4core7builtin4Iter4nextGsE(self) {
|
|
1583
1598
|
const _func = self;
|
|
1584
1599
|
return _func();
|
|
1585
1600
|
}
|
|
@@ -1612,10 +1627,10 @@ function _M0MP311moonbitlang4core7builtin4Iter3newGUssEE(f) {
|
|
|
1612
1627
|
function _M0MP311moonbitlang4core7builtin4Iter3newGUsRP311moonbitlang4core7builtin4JsonEE(f) {
|
|
1613
1628
|
return f;
|
|
1614
1629
|
}
|
|
1615
|
-
function
|
|
1630
|
+
function _M0MP311moonbitlang4core7builtin4Iter3newGRP36mizchi7tornado5types11AgentConfigE(f) {
|
|
1616
1631
|
return f;
|
|
1617
1632
|
}
|
|
1618
|
-
function
|
|
1633
|
+
function _M0MP311moonbitlang4core7builtin4Iter3newGsE(f) {
|
|
1619
1634
|
return f;
|
|
1620
1635
|
}
|
|
1621
1636
|
function _M0MP311moonbitlang4core7builtin4Iter3newGcE(f) {
|
|
@@ -1817,21 +1832,21 @@ function _M0MP311moonbitlang4core6string6String12view_2einner(self, start_offset
|
|
|
1817
1832
|
function _M0MP311moonbitlang4core5array9ArrayView6lengthGUssEE(self) {
|
|
1818
1833
|
return self.end - self.start | 0;
|
|
1819
1834
|
}
|
|
1835
|
+
function _M0MP311moonbitlang4core5array9ArrayView6lengthGUsbEE(self) {
|
|
1836
|
+
return self.end - self.start | 0;
|
|
1837
|
+
}
|
|
1820
1838
|
function _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP36mizchi7tornado5agent12BoxedBackendEE(self) {
|
|
1821
1839
|
return self.end - self.start | 0;
|
|
1822
1840
|
}
|
|
1823
1841
|
function _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP311moonbitlang4core7builtin4JsonEE(self) {
|
|
1824
1842
|
return self.end - self.start | 0;
|
|
1825
1843
|
}
|
|
1826
|
-
function
|
|
1844
|
+
function _M0MP311moonbitlang4core5array9ArrayView6lengthGRP36mizchi7tornado5types11AgentConfigE(self) {
|
|
1827
1845
|
return self.end - self.start | 0;
|
|
1828
1846
|
}
|
|
1829
1847
|
function _M0MP311moonbitlang4core5array9ArrayView6lengthGsE(self) {
|
|
1830
1848
|
return self.end - self.start | 0;
|
|
1831
1849
|
}
|
|
1832
|
-
function _M0MP311moonbitlang4core5array9ArrayView6lengthGRP36mizchi7tornado5types11AgentConfigE(self) {
|
|
1833
|
-
return self.end - self.start | 0;
|
|
1834
|
-
}
|
|
1835
1850
|
function _M0MP311moonbitlang4core5array9ArrayView6lengthGUsUsRP311moonbitlang4core7builtin13StringBuilderEEE(self) {
|
|
1836
1851
|
return self.end - self.start | 0;
|
|
1837
1852
|
}
|
|
@@ -2131,10 +2146,10 @@ function _M0MP311moonbitlang4core6string6String11has__prefix(self, str) {
|
|
|
2131
2146
|
function _M0MP311moonbitlang4core5array5Array4pushGsE(self, value) {
|
|
2132
2147
|
_M0MP311moonbitlang4core7builtin7JSArray4push(self, value);
|
|
2133
2148
|
}
|
|
2134
|
-
function
|
|
2149
|
+
function _M0MP311moonbitlang4core5array5Array4pushGRP36mizchi7tornado5types11AgentConfigE(self, value) {
|
|
2135
2150
|
_M0MP311moonbitlang4core7builtin7JSArray4push(self, value);
|
|
2136
2151
|
}
|
|
2137
|
-
function
|
|
2152
|
+
function _M0MP311moonbitlang4core5array5Array4pushGRP311moonbitlang4core4json10WriteFrameE(self, value) {
|
|
2138
2153
|
_M0MP311moonbitlang4core7builtin7JSArray4push(self, value);
|
|
2139
2154
|
}
|
|
2140
2155
|
function _M0MP311moonbitlang4core5array5Array4pushGRP26mizchi3llm7MessageE(self, value) {
|
|
@@ -2370,10 +2385,10 @@ function _M0IP311moonbitlang4core3int3IntP311moonbitlang4core7builtin4Show6outpu
|
|
|
2370
2385
|
function _M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(self) {
|
|
2371
2386
|
return self;
|
|
2372
2387
|
}
|
|
2373
|
-
function
|
|
2388
|
+
function _M0MP311moonbitlang4core5array9ArrayView4iterGRP36mizchi7tornado5types11AgentConfigE(self) {
|
|
2374
2389
|
const i = { val: 0 };
|
|
2375
|
-
return
|
|
2376
|
-
if (i.val <
|
|
2390
|
+
return _M0MP311moonbitlang4core7builtin4Iter3newGRP36mizchi7tornado5types11AgentConfigE(() => {
|
|
2391
|
+
if (i.val < _M0MP311moonbitlang4core5array9ArrayView6lengthGRP36mizchi7tornado5types11AgentConfigE(self)) {
|
|
2377
2392
|
const elem = self.buf[self.start + i.val | 0];
|
|
2378
2393
|
i.val = i.val + 1 | 0;
|
|
2379
2394
|
return elem;
|
|
@@ -2382,10 +2397,10 @@ function _M0MP311moonbitlang4core5array9ArrayView4iterGsE(self) {
|
|
|
2382
2397
|
}
|
|
2383
2398
|
});
|
|
2384
2399
|
}
|
|
2385
|
-
function
|
|
2400
|
+
function _M0MP311moonbitlang4core5array9ArrayView4iterGsE(self) {
|
|
2386
2401
|
const i = { val: 0 };
|
|
2387
|
-
return
|
|
2388
|
-
if (i.val <
|
|
2402
|
+
return _M0MP311moonbitlang4core7builtin4Iter3newGsE(() => {
|
|
2403
|
+
if (i.val < _M0MP311moonbitlang4core5array9ArrayView6lengthGsE(self)) {
|
|
2389
2404
|
const elem = self.buf[self.start + i.val | 0];
|
|
2390
2405
|
i.val = i.val + 1 | 0;
|
|
2391
2406
|
return elem;
|
|
@@ -2394,12 +2409,12 @@ function _M0MP311moonbitlang4core5array9ArrayView4iterGRP36mizchi7tornado5types1
|
|
|
2394
2409
|
}
|
|
2395
2410
|
});
|
|
2396
2411
|
}
|
|
2397
|
-
function _M0MP311moonbitlang4core5array5Array4iterGsE(self) {
|
|
2398
|
-
return _M0MP311moonbitlang4core5array9ArrayView4iterGsE({ buf: self, start: 0, end: self.length });
|
|
2399
|
-
}
|
|
2400
2412
|
function _M0MP311moonbitlang4core5array5Array4iterGRP36mizchi7tornado5types11AgentConfigE(self) {
|
|
2401
2413
|
return _M0MP311moonbitlang4core5array9ArrayView4iterGRP36mizchi7tornado5types11AgentConfigE({ buf: self, start: 0, end: self.length });
|
|
2402
2414
|
}
|
|
2415
|
+
function _M0MP311moonbitlang4core5array5Array4iterGsE(self) {
|
|
2416
|
+
return _M0MP311moonbitlang4core5array9ArrayView4iterGsE({ buf: self, start: 0, end: self.length });
|
|
2417
|
+
}
|
|
2403
2418
|
function _M0MP311moonbitlang4core5array13ReadOnlyArray2atGmE(self, index) {
|
|
2404
2419
|
$bound_check(self, index);
|
|
2405
2420
|
return self[index];
|
|
@@ -2427,7 +2442,7 @@ function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7bui
|
|
|
2427
2442
|
return _Some;
|
|
2428
2443
|
}
|
|
2429
2444
|
}
|
|
2430
|
-
function
|
|
2445
|
+
function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsbEE(self) {
|
|
2431
2446
|
if (self === undefined) {
|
|
2432
2447
|
return $panic();
|
|
2433
2448
|
} else {
|
|
@@ -2435,7 +2450,7 @@ function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7bui
|
|
|
2435
2450
|
return _Some;
|
|
2436
2451
|
}
|
|
2437
2452
|
}
|
|
2438
|
-
function
|
|
2453
|
+
function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsRP36mizchi7tornado5agent12BoxedBackendEE(self) {
|
|
2439
2454
|
if (self === undefined) {
|
|
2440
2455
|
return $panic();
|
|
2441
2456
|
} else {
|
|
@@ -2443,7 +2458,7 @@ function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7bui
|
|
|
2443
2458
|
return _Some;
|
|
2444
2459
|
}
|
|
2445
2460
|
}
|
|
2446
|
-
function
|
|
2461
|
+
function _M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsRP311moonbitlang4core7builtin4JsonEE(self) {
|
|
2447
2462
|
if (self === undefined) {
|
|
2448
2463
|
return $panic();
|
|
2449
2464
|
} else {
|
|
@@ -2506,7 +2521,7 @@ function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGssE(capacity) {
|
|
|
2506
2521
|
const _bind$4 = undefined;
|
|
2507
2522
|
return { entries: _bind$3, size: 0, capacity: capacity$2, capacity_mask: _bind, grow_at: _bind$2, head: _bind$4, tail: -1 };
|
|
2508
2523
|
}
|
|
2509
|
-
function
|
|
2524
|
+
function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsbE(capacity) {
|
|
2510
2525
|
const capacity$2 = _M0MP311moonbitlang4core3int3Int20next__power__of__two(capacity);
|
|
2511
2526
|
const _bind = capacity$2 - 1 | 0;
|
|
2512
2527
|
const _bind$2 = _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity$2);
|
|
@@ -2514,7 +2529,7 @@ function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP36mizchi7tornado5a
|
|
|
2514
2529
|
const _bind$4 = undefined;
|
|
2515
2530
|
return { entries: _bind$3, size: 0, capacity: capacity$2, capacity_mask: _bind, grow_at: _bind$2, head: _bind$4, tail: -1 };
|
|
2516
2531
|
}
|
|
2517
|
-
function
|
|
2532
|
+
function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP36mizchi7tornado5agent12BoxedBackendE(capacity) {
|
|
2518
2533
|
const capacity$2 = _M0MP311moonbitlang4core3int3Int20next__power__of__two(capacity);
|
|
2519
2534
|
const _bind = capacity$2 - 1 | 0;
|
|
2520
2535
|
const _bind$2 = _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity$2);
|
|
@@ -2522,7 +2537,7 @@ function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP311moonbitlang4cor
|
|
|
2522
2537
|
const _bind$4 = undefined;
|
|
2523
2538
|
return { entries: _bind$3, size: 0, capacity: capacity$2, capacity_mask: _bind, grow_at: _bind$2, head: _bind$4, tail: -1 };
|
|
2524
2539
|
}
|
|
2525
|
-
function
|
|
2540
|
+
function _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP311moonbitlang4core7builtin4JsonE(capacity) {
|
|
2526
2541
|
const capacity$2 = _M0MP311moonbitlang4core3int3Int20next__power__of__two(capacity);
|
|
2527
2542
|
const _bind = capacity$2 - 1 | 0;
|
|
2528
2543
|
const _bind$2 = _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity$2);
|
|
@@ -2553,14 +2568,14 @@ function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGssE(self, id
|
|
|
2553
2568
|
_tmp[idx] = entry;
|
|
2554
2569
|
self.size = self.size + 1 | 0;
|
|
2555
2570
|
}
|
|
2556
|
-
function
|
|
2571
|
+
function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsbE(self, idx, entry) {
|
|
2557
2572
|
const _bind = self.tail;
|
|
2558
2573
|
if (_bind === -1) {
|
|
2559
2574
|
self.head = entry;
|
|
2560
2575
|
} else {
|
|
2561
2576
|
const _tmp = self.entries;
|
|
2562
2577
|
$bound_check(_tmp, _bind);
|
|
2563
|
-
|
|
2578
|
+
_M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsbEE(_tmp[_bind]).next = entry;
|
|
2564
2579
|
}
|
|
2565
2580
|
self.tail = idx;
|
|
2566
2581
|
const _tmp = self.entries;
|
|
@@ -2568,14 +2583,14 @@ function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP36mizchi7
|
|
|
2568
2583
|
_tmp[idx] = entry;
|
|
2569
2584
|
self.size = self.size + 1 | 0;
|
|
2570
2585
|
}
|
|
2571
|
-
function
|
|
2586
|
+
function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP36mizchi7tornado5agent12BoxedBackendE(self, idx, entry) {
|
|
2572
2587
|
const _bind = self.tail;
|
|
2573
2588
|
if (_bind === -1) {
|
|
2574
2589
|
self.head = entry;
|
|
2575
2590
|
} else {
|
|
2576
2591
|
const _tmp = self.entries;
|
|
2577
2592
|
$bound_check(_tmp, _bind);
|
|
2578
|
-
|
|
2593
|
+
_M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsRP36mizchi7tornado5agent12BoxedBackendEE(_tmp[_bind]).next = entry;
|
|
2579
2594
|
}
|
|
2580
2595
|
self.tail = idx;
|
|
2581
2596
|
const _tmp = self.entries;
|
|
@@ -2583,14 +2598,14 @@ function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP311moonbi
|
|
|
2583
2598
|
_tmp[idx] = entry;
|
|
2584
2599
|
self.size = self.size + 1 | 0;
|
|
2585
2600
|
}
|
|
2586
|
-
function
|
|
2601
|
+
function _M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP311moonbitlang4core7builtin4JsonE(self, idx, entry) {
|
|
2587
2602
|
const _bind = self.tail;
|
|
2588
2603
|
if (_bind === -1) {
|
|
2589
2604
|
self.head = entry;
|
|
2590
2605
|
} else {
|
|
2591
2606
|
const _tmp = self.entries;
|
|
2592
2607
|
$bound_check(_tmp, _bind);
|
|
2593
|
-
|
|
2608
|
+
_M0MP311moonbitlang4core6option6Option6unwrapGRP311moonbitlang4core7builtin5EntryGsRP311moonbitlang4core7builtin4JsonEE(_tmp[_bind]).next = entry;
|
|
2594
2609
|
}
|
|
2595
2610
|
self.tail = idx;
|
|
2596
2611
|
const _tmp = self.entries;
|
|
@@ -2628,7 +2643,7 @@ function _M0MP311moonbitlang4core7builtin3Map10set__entryGssE(self, entry, new_i
|
|
|
2628
2643
|
return;
|
|
2629
2644
|
}
|
|
2630
2645
|
}
|
|
2631
|
-
function
|
|
2646
|
+
function _M0MP311moonbitlang4core7builtin3Map10set__entryGsbE(self, entry, new_idx) {
|
|
2632
2647
|
const _tmp = self.entries;
|
|
2633
2648
|
$bound_check(_tmp, new_idx);
|
|
2634
2649
|
_tmp[new_idx] = entry;
|
|
@@ -2643,7 +2658,7 @@ function _M0MP311moonbitlang4core7builtin3Map10set__entryGsRP36mizchi7tornado5ag
|
|
|
2643
2658
|
return;
|
|
2644
2659
|
}
|
|
2645
2660
|
}
|
|
2646
|
-
function
|
|
2661
|
+
function _M0MP311moonbitlang4core7builtin3Map10set__entryGsRP36mizchi7tornado5agent12BoxedBackendE(self, entry, new_idx) {
|
|
2647
2662
|
const _tmp = self.entries;
|
|
2648
2663
|
$bound_check(_tmp, new_idx);
|
|
2649
2664
|
_tmp[new_idx] = entry;
|
|
@@ -2658,7 +2673,7 @@ function _M0MP311moonbitlang4core7builtin3Map10set__entryGsRP311moonbitlang4core
|
|
|
2658
2673
|
return;
|
|
2659
2674
|
}
|
|
2660
2675
|
}
|
|
2661
|
-
function
|
|
2676
|
+
function _M0MP311moonbitlang4core7builtin3Map10set__entryGsRP311moonbitlang4core7builtin4JsonE(self, entry, new_idx) {
|
|
2662
2677
|
const _tmp = self.entries;
|
|
2663
2678
|
$bound_check(_tmp, new_idx);
|
|
2664
2679
|
_tmp[new_idx] = entry;
|
|
@@ -2721,7 +2736,7 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGssE(self, idx, entry)
|
|
|
2721
2736
|
}
|
|
2722
2737
|
}
|
|
2723
2738
|
}
|
|
2724
|
-
function
|
|
2739
|
+
function _M0MP311moonbitlang4core7builtin3Map10push__awayGsbE(self, idx, entry) {
|
|
2725
2740
|
let _tmp = entry.psl + 1 | 0;
|
|
2726
2741
|
let _tmp$2 = (idx + 1 | 0) & self.capacity_mask;
|
|
2727
2742
|
let _tmp$3 = entry;
|
|
@@ -2734,14 +2749,14 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP36mizchi7tornado5ag
|
|
|
2734
2749
|
const _bind = _tmp$4[idx$2];
|
|
2735
2750
|
if (_bind === undefined) {
|
|
2736
2751
|
entry$2.psl = psl;
|
|
2737
|
-
|
|
2752
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsbE(self, entry$2, idx$2);
|
|
2738
2753
|
break;
|
|
2739
2754
|
} else {
|
|
2740
2755
|
const _Some = _bind;
|
|
2741
2756
|
const _curr_entry = _Some;
|
|
2742
2757
|
if (psl > _curr_entry.psl) {
|
|
2743
2758
|
entry$2.psl = psl;
|
|
2744
|
-
|
|
2759
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsbE(self, entry$2, idx$2);
|
|
2745
2760
|
_tmp = _curr_entry.psl + 1 | 0;
|
|
2746
2761
|
_tmp$2 = (idx$2 + 1 | 0) & self.capacity_mask;
|
|
2747
2762
|
_tmp$3 = _curr_entry;
|
|
@@ -2754,7 +2769,7 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP36mizchi7tornado5ag
|
|
|
2754
2769
|
}
|
|
2755
2770
|
}
|
|
2756
2771
|
}
|
|
2757
|
-
function
|
|
2772
|
+
function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP36mizchi7tornado5agent12BoxedBackendE(self, idx, entry) {
|
|
2758
2773
|
let _tmp = entry.psl + 1 | 0;
|
|
2759
2774
|
let _tmp$2 = (idx + 1 | 0) & self.capacity_mask;
|
|
2760
2775
|
let _tmp$3 = entry;
|
|
@@ -2767,14 +2782,14 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP311moonbitlang4core
|
|
|
2767
2782
|
const _bind = _tmp$4[idx$2];
|
|
2768
2783
|
if (_bind === undefined) {
|
|
2769
2784
|
entry$2.psl = psl;
|
|
2770
|
-
|
|
2785
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsRP36mizchi7tornado5agent12BoxedBackendE(self, entry$2, idx$2);
|
|
2771
2786
|
break;
|
|
2772
2787
|
} else {
|
|
2773
2788
|
const _Some = _bind;
|
|
2774
2789
|
const _curr_entry = _Some;
|
|
2775
2790
|
if (psl > _curr_entry.psl) {
|
|
2776
2791
|
entry$2.psl = psl;
|
|
2777
|
-
|
|
2792
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsRP36mizchi7tornado5agent12BoxedBackendE(self, entry$2, idx$2);
|
|
2778
2793
|
_tmp = _curr_entry.psl + 1 | 0;
|
|
2779
2794
|
_tmp$2 = (idx$2 + 1 | 0) & self.capacity_mask;
|
|
2780
2795
|
_tmp$3 = _curr_entry;
|
|
@@ -2787,7 +2802,7 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP311moonbitlang4core
|
|
|
2787
2802
|
}
|
|
2788
2803
|
}
|
|
2789
2804
|
}
|
|
2790
|
-
function
|
|
2805
|
+
function _M0MP311moonbitlang4core7builtin3Map10push__awayGsRP311moonbitlang4core7builtin4JsonE(self, idx, entry) {
|
|
2791
2806
|
let _tmp = entry.psl + 1 | 0;
|
|
2792
2807
|
let _tmp$2 = (idx + 1 | 0) & self.capacity_mask;
|
|
2793
2808
|
let _tmp$3 = entry;
|
|
@@ -2800,14 +2815,14 @@ function _M0MP311moonbitlang4core7builtin3Map10push__awayGsbE(self, idx, entry)
|
|
|
2800
2815
|
const _bind = _tmp$4[idx$2];
|
|
2801
2816
|
if (_bind === undefined) {
|
|
2802
2817
|
entry$2.psl = psl;
|
|
2803
|
-
|
|
2818
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsRP311moonbitlang4core7builtin4JsonE(self, entry$2, idx$2);
|
|
2804
2819
|
break;
|
|
2805
2820
|
} else {
|
|
2806
2821
|
const _Some = _bind;
|
|
2807
2822
|
const _curr_entry = _Some;
|
|
2808
2823
|
if (psl > _curr_entry.psl) {
|
|
2809
2824
|
entry$2.psl = psl;
|
|
2810
|
-
|
|
2825
|
+
_M0MP311moonbitlang4core7builtin3Map10set__entryGsRP311moonbitlang4core7builtin4JsonE(self, entry$2, idx$2);
|
|
2811
2826
|
_tmp = _curr_entry.psl + 1 | 0;
|
|
2812
2827
|
_tmp$2 = (idx$2 + 1 | 0) & self.capacity_mask;
|
|
2813
2828
|
_tmp$3 = _curr_entry;
|
|
@@ -2901,7 +2916,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGssE(self, key, va
|
|
|
2901
2916
|
}
|
|
2902
2917
|
}
|
|
2903
2918
|
}
|
|
2904
|
-
function
|
|
2919
|
+
function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, value, hash) {
|
|
2905
2920
|
let _tmp = 0;
|
|
2906
2921
|
let _tmp$2 = hash & self.capacity_mask;
|
|
2907
2922
|
while (true) {
|
|
@@ -2912,7 +2927,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7torna
|
|
|
2912
2927
|
const _bind = _tmp$3[idx];
|
|
2913
2928
|
if (_bind === undefined) {
|
|
2914
2929
|
if (self.size >= self.grow_at) {
|
|
2915
|
-
|
|
2930
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsbE(self);
|
|
2916
2931
|
_tmp = 0;
|
|
2917
2932
|
_tmp$2 = hash & self.capacity_mask;
|
|
2918
2933
|
continue;
|
|
@@ -2920,7 +2935,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7torna
|
|
|
2920
2935
|
const _bind$2 = self.tail;
|
|
2921
2936
|
const _bind$3 = undefined;
|
|
2922
2937
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
2923
|
-
|
|
2938
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsbE(self, idx, entry);
|
|
2924
2939
|
return undefined;
|
|
2925
2940
|
} else {
|
|
2926
2941
|
const _Some = _bind;
|
|
@@ -2931,16 +2946,16 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7torna
|
|
|
2931
2946
|
}
|
|
2932
2947
|
if (psl > _curr_entry.psl) {
|
|
2933
2948
|
if (self.size >= self.grow_at) {
|
|
2934
|
-
|
|
2949
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsbE(self);
|
|
2935
2950
|
_tmp = 0;
|
|
2936
2951
|
_tmp$2 = hash & self.capacity_mask;
|
|
2937
2952
|
continue;
|
|
2938
2953
|
}
|
|
2939
|
-
|
|
2954
|
+
_M0MP311moonbitlang4core7builtin3Map10push__awayGsbE(self, idx, _curr_entry);
|
|
2940
2955
|
const _bind$2 = self.tail;
|
|
2941
2956
|
const _bind$3 = undefined;
|
|
2942
2957
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
2943
|
-
|
|
2958
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsbE(self, idx, entry);
|
|
2944
2959
|
return undefined;
|
|
2945
2960
|
}
|
|
2946
2961
|
_tmp = psl + 1 | 0;
|
|
@@ -2949,7 +2964,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7torna
|
|
|
2949
2964
|
}
|
|
2950
2965
|
}
|
|
2951
2966
|
}
|
|
2952
|
-
function
|
|
2967
|
+
function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7tornado5agent12BoxedBackendE(self, key, value, hash) {
|
|
2953
2968
|
let _tmp = 0;
|
|
2954
2969
|
let _tmp$2 = hash & self.capacity_mask;
|
|
2955
2970
|
while (true) {
|
|
@@ -2960,7 +2975,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang
|
|
|
2960
2975
|
const _bind = _tmp$3[idx];
|
|
2961
2976
|
if (_bind === undefined) {
|
|
2962
2977
|
if (self.size >= self.grow_at) {
|
|
2963
|
-
|
|
2978
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsRP36mizchi7tornado5agent12BoxedBackendE(self);
|
|
2964
2979
|
_tmp = 0;
|
|
2965
2980
|
_tmp$2 = hash & self.capacity_mask;
|
|
2966
2981
|
continue;
|
|
@@ -2968,7 +2983,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang
|
|
|
2968
2983
|
const _bind$2 = self.tail;
|
|
2969
2984
|
const _bind$3 = undefined;
|
|
2970
2985
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
2971
|
-
|
|
2986
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP36mizchi7tornado5agent12BoxedBackendE(self, idx, entry);
|
|
2972
2987
|
return undefined;
|
|
2973
2988
|
} else {
|
|
2974
2989
|
const _Some = _bind;
|
|
@@ -2979,16 +2994,16 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang
|
|
|
2979
2994
|
}
|
|
2980
2995
|
if (psl > _curr_entry.psl) {
|
|
2981
2996
|
if (self.size >= self.grow_at) {
|
|
2982
|
-
|
|
2997
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsRP36mizchi7tornado5agent12BoxedBackendE(self);
|
|
2983
2998
|
_tmp = 0;
|
|
2984
2999
|
_tmp$2 = hash & self.capacity_mask;
|
|
2985
3000
|
continue;
|
|
2986
3001
|
}
|
|
2987
|
-
|
|
3002
|
+
_M0MP311moonbitlang4core7builtin3Map10push__awayGsRP36mizchi7tornado5agent12BoxedBackendE(self, idx, _curr_entry);
|
|
2988
3003
|
const _bind$2 = self.tail;
|
|
2989
3004
|
const _bind$3 = undefined;
|
|
2990
3005
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
2991
|
-
|
|
3006
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP36mizchi7tornado5agent12BoxedBackendE(self, idx, entry);
|
|
2992
3007
|
return undefined;
|
|
2993
3008
|
}
|
|
2994
3009
|
_tmp = psl + 1 | 0;
|
|
@@ -2997,7 +3012,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang
|
|
|
2997
3012
|
}
|
|
2998
3013
|
}
|
|
2999
3014
|
}
|
|
3000
|
-
function
|
|
3015
|
+
function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang4core7builtin4JsonE(self, key, value, hash) {
|
|
3001
3016
|
let _tmp = 0;
|
|
3002
3017
|
let _tmp$2 = hash & self.capacity_mask;
|
|
3003
3018
|
while (true) {
|
|
@@ -3008,7 +3023,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, va
|
|
|
3008
3023
|
const _bind = _tmp$3[idx];
|
|
3009
3024
|
if (_bind === undefined) {
|
|
3010
3025
|
if (self.size >= self.grow_at) {
|
|
3011
|
-
|
|
3026
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsRP311moonbitlang4core7builtin4JsonE(self);
|
|
3012
3027
|
_tmp = 0;
|
|
3013
3028
|
_tmp$2 = hash & self.capacity_mask;
|
|
3014
3029
|
continue;
|
|
@@ -3016,7 +3031,7 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, va
|
|
|
3016
3031
|
const _bind$2 = self.tail;
|
|
3017
3032
|
const _bind$3 = undefined;
|
|
3018
3033
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
3019
|
-
|
|
3034
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP311moonbitlang4core7builtin4JsonE(self, idx, entry);
|
|
3020
3035
|
return undefined;
|
|
3021
3036
|
} else {
|
|
3022
3037
|
const _Some = _bind;
|
|
@@ -3027,16 +3042,16 @@ function _M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, va
|
|
|
3027
3042
|
}
|
|
3028
3043
|
if (psl > _curr_entry.psl) {
|
|
3029
3044
|
if (self.size >= self.grow_at) {
|
|
3030
|
-
|
|
3045
|
+
_M0MP311moonbitlang4core7builtin3Map4growGsRP311moonbitlang4core7builtin4JsonE(self);
|
|
3031
3046
|
_tmp = 0;
|
|
3032
3047
|
_tmp$2 = hash & self.capacity_mask;
|
|
3033
3048
|
continue;
|
|
3034
3049
|
}
|
|
3035
|
-
|
|
3050
|
+
_M0MP311moonbitlang4core7builtin3Map10push__awayGsRP311moonbitlang4core7builtin4JsonE(self, idx, _curr_entry);
|
|
3036
3051
|
const _bind$2 = self.tail;
|
|
3037
3052
|
const _bind$3 = undefined;
|
|
3038
3053
|
const entry = { prev: _bind$2, next: _bind$3, psl: psl, hash: hash, key: key, value: value };
|
|
3039
|
-
|
|
3054
|
+
_M0MP311moonbitlang4core7builtin3Map20add__entry__to__tailGsRP311moonbitlang4core7builtin4JsonE(self, idx, entry);
|
|
3040
3055
|
return undefined;
|
|
3041
3056
|
}
|
|
3042
3057
|
_tmp = psl + 1 | 0;
|
|
@@ -3121,7 +3136,7 @@ function _M0MP311moonbitlang4core7builtin3Map4growGssE(self) {
|
|
|
3121
3136
|
}
|
|
3122
3137
|
}
|
|
3123
3138
|
}
|
|
3124
|
-
function
|
|
3139
|
+
function _M0MP311moonbitlang4core7builtin3Map4growGsbE(self) {
|
|
3125
3140
|
const old_head = self.head;
|
|
3126
3141
|
const new_capacity = self.capacity << 1;
|
|
3127
3142
|
self.entries = $make_array_len_and_init(new_capacity, undefined);
|
|
@@ -3143,13 +3158,13 @@ function _M0MP311moonbitlang4core7builtin3Map4growGsRP36mizchi7tornado5agent12Bo
|
|
|
3143
3158
|
const _key = _x.key;
|
|
3144
3159
|
const _value = _x.value;
|
|
3145
3160
|
const _hash = _x.hash;
|
|
3146
|
-
|
|
3161
|
+
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, _key, _value, _hash);
|
|
3147
3162
|
_tmp = _next;
|
|
3148
3163
|
continue;
|
|
3149
3164
|
}
|
|
3150
3165
|
}
|
|
3151
3166
|
}
|
|
3152
|
-
function
|
|
3167
|
+
function _M0MP311moonbitlang4core7builtin3Map4growGsRP36mizchi7tornado5agent12BoxedBackendE(self) {
|
|
3153
3168
|
const old_head = self.head;
|
|
3154
3169
|
const new_capacity = self.capacity << 1;
|
|
3155
3170
|
self.entries = $make_array_len_and_init(new_capacity, undefined);
|
|
@@ -3171,13 +3186,13 @@ function _M0MP311moonbitlang4core7builtin3Map4growGsRP311moonbitlang4core7builti
|
|
|
3171
3186
|
const _key = _x.key;
|
|
3172
3187
|
const _value = _x.value;
|
|
3173
3188
|
const _hash = _x.hash;
|
|
3174
|
-
|
|
3189
|
+
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7tornado5agent12BoxedBackendE(self, _key, _value, _hash);
|
|
3175
3190
|
_tmp = _next;
|
|
3176
3191
|
continue;
|
|
3177
3192
|
}
|
|
3178
3193
|
}
|
|
3179
3194
|
}
|
|
3180
|
-
function
|
|
3195
|
+
function _M0MP311moonbitlang4core7builtin3Map4growGsRP311moonbitlang4core7builtin4JsonE(self) {
|
|
3181
3196
|
const old_head = self.head;
|
|
3182
3197
|
const new_capacity = self.capacity << 1;
|
|
3183
3198
|
self.entries = $make_array_len_and_init(new_capacity, undefined);
|
|
@@ -3199,7 +3214,7 @@ function _M0MP311moonbitlang4core7builtin3Map4growGsbE(self) {
|
|
|
3199
3214
|
const _key = _x.key;
|
|
3200
3215
|
const _value = _x.value;
|
|
3201
3216
|
const _hash = _x.hash;
|
|
3202
|
-
|
|
3217
|
+
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang4core7builtin4JsonE(self, _key, _value, _hash);
|
|
3203
3218
|
_tmp = _next;
|
|
3204
3219
|
continue;
|
|
3205
3220
|
}
|
|
@@ -3236,15 +3251,15 @@ function _M0MP311moonbitlang4core7builtin3Map4growGsUsRP311moonbitlang4core7buil
|
|
|
3236
3251
|
function _M0MP311moonbitlang4core7builtin3Map3setGssE(self, key, value) {
|
|
3237
3252
|
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGssE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3238
3253
|
}
|
|
3254
|
+
function _M0MP311moonbitlang4core7builtin3Map3setGsbE(self, key, value) {
|
|
3255
|
+
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3256
|
+
}
|
|
3239
3257
|
function _M0MP311moonbitlang4core7builtin3Map3setGsRP36mizchi7tornado5agent12BoxedBackendE(self, key, value) {
|
|
3240
3258
|
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP36mizchi7tornado5agent12BoxedBackendE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3241
3259
|
}
|
|
3242
3260
|
function _M0MP311moonbitlang4core7builtin3Map3setGsRP311moonbitlang4core7builtin4JsonE(self, key, value) {
|
|
3243
3261
|
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsRP311moonbitlang4core7builtin4JsonE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3244
3262
|
}
|
|
3245
|
-
function _M0MP311moonbitlang4core7builtin3Map3setGsbE(self, key, value) {
|
|
3246
|
-
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsbE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3247
|
-
}
|
|
3248
3263
|
function _M0MP311moonbitlang4core7builtin3Map3setGsUsRP311moonbitlang4core7builtin13StringBuilderEE(self, key, value) {
|
|
3249
3264
|
_M0MP311moonbitlang4core7builtin3Map15set__with__hashGsUsRP311moonbitlang4core7builtin13StringBuilderEE(self, key, value, _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key));
|
|
3250
3265
|
}
|
|
@@ -3270,20 +3285,20 @@ function _M0MP311moonbitlang4core7builtin3Map11from__arrayGssE(arr) {
|
|
|
3270
3285
|
}
|
|
3271
3286
|
return m;
|
|
3272
3287
|
}
|
|
3273
|
-
function
|
|
3274
|
-
const length =
|
|
3288
|
+
function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsbE(arr) {
|
|
3289
|
+
const length = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsbEE(arr);
|
|
3275
3290
|
let capacity = _M0MP311moonbitlang4core3int3Int20next__power__of__two(length);
|
|
3276
3291
|
if (length > _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity)) {
|
|
3277
3292
|
capacity = Math.imul(capacity, 2) | 0;
|
|
3278
3293
|
}
|
|
3279
|
-
const m =
|
|
3280
|
-
const _len =
|
|
3294
|
+
const m = _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsbE(capacity);
|
|
3295
|
+
const _len = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsbEE(arr);
|
|
3281
3296
|
let _tmp = 0;
|
|
3282
3297
|
while (true) {
|
|
3283
3298
|
const _i = _tmp;
|
|
3284
3299
|
if (_i < _len) {
|
|
3285
3300
|
const e = arr.buf[arr.start + _i | 0];
|
|
3286
|
-
|
|
3301
|
+
_M0MP311moonbitlang4core7builtin3Map3setGsbE(m, e._0, e._1);
|
|
3287
3302
|
_tmp = _i + 1 | 0;
|
|
3288
3303
|
continue;
|
|
3289
3304
|
} else {
|
|
@@ -3292,20 +3307,20 @@ function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsRP36mizchi7tornado5a
|
|
|
3292
3307
|
}
|
|
3293
3308
|
return m;
|
|
3294
3309
|
}
|
|
3295
|
-
function
|
|
3296
|
-
const length =
|
|
3310
|
+
function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsRP36mizchi7tornado5agent12BoxedBackendE(arr) {
|
|
3311
|
+
const length = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP36mizchi7tornado5agent12BoxedBackendEE(arr);
|
|
3297
3312
|
let capacity = _M0MP311moonbitlang4core3int3Int20next__power__of__two(length);
|
|
3298
3313
|
if (length > _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity)) {
|
|
3299
3314
|
capacity = Math.imul(capacity, 2) | 0;
|
|
3300
3315
|
}
|
|
3301
|
-
const m =
|
|
3302
|
-
const _len =
|
|
3316
|
+
const m = _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP36mizchi7tornado5agent12BoxedBackendE(capacity);
|
|
3317
|
+
const _len = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP36mizchi7tornado5agent12BoxedBackendEE(arr);
|
|
3303
3318
|
let _tmp = 0;
|
|
3304
3319
|
while (true) {
|
|
3305
3320
|
const _i = _tmp;
|
|
3306
3321
|
if (_i < _len) {
|
|
3307
3322
|
const e = arr.buf[arr.start + _i | 0];
|
|
3308
|
-
|
|
3323
|
+
_M0MP311moonbitlang4core7builtin3Map3setGsRP36mizchi7tornado5agent12BoxedBackendE(m, e._0, e._1);
|
|
3309
3324
|
_tmp = _i + 1 | 0;
|
|
3310
3325
|
continue;
|
|
3311
3326
|
} else {
|
|
@@ -3314,20 +3329,20 @@ function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsRP311moonbitlang4cor
|
|
|
3314
3329
|
}
|
|
3315
3330
|
return m;
|
|
3316
3331
|
}
|
|
3317
|
-
function
|
|
3318
|
-
const length =
|
|
3332
|
+
function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsRP311moonbitlang4core7builtin4JsonE(arr) {
|
|
3333
|
+
const length = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP311moonbitlang4core7builtin4JsonEE(arr);
|
|
3319
3334
|
let capacity = _M0MP311moonbitlang4core3int3Int20next__power__of__two(length);
|
|
3320
3335
|
if (length > _M0FP311moonbitlang4core7builtin21calc__grow__threshold(capacity)) {
|
|
3321
3336
|
capacity = Math.imul(capacity, 2) | 0;
|
|
3322
3337
|
}
|
|
3323
|
-
const m =
|
|
3324
|
-
const _len =
|
|
3338
|
+
const m = _M0MP311moonbitlang4core7builtin3Map11new_2einnerGsRP311moonbitlang4core7builtin4JsonE(capacity);
|
|
3339
|
+
const _len = _M0MP311moonbitlang4core5array9ArrayView6lengthGUsRP311moonbitlang4core7builtin4JsonEE(arr);
|
|
3325
3340
|
let _tmp = 0;
|
|
3326
3341
|
while (true) {
|
|
3327
3342
|
const _i = _tmp;
|
|
3328
3343
|
if (_i < _len) {
|
|
3329
3344
|
const e = arr.buf[arr.start + _i | 0];
|
|
3330
|
-
|
|
3345
|
+
_M0MP311moonbitlang4core7builtin3Map3setGsRP311moonbitlang4core7builtin4JsonE(m, e._0, e._1);
|
|
3331
3346
|
_tmp = _i + 1 | 0;
|
|
3332
3347
|
continue;
|
|
3333
3348
|
} else {
|
|
@@ -3358,7 +3373,7 @@ function _M0MP311moonbitlang4core7builtin3Map11from__arrayGsUsRP311moonbitlang4c
|
|
|
3358
3373
|
}
|
|
3359
3374
|
return m;
|
|
3360
3375
|
}
|
|
3361
|
-
function
|
|
3376
|
+
function _M0MP311moonbitlang4core7builtin3Map3getGsbE(self, key) {
|
|
3362
3377
|
const hash = _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key);
|
|
3363
3378
|
let _tmp = 0;
|
|
3364
3379
|
let _tmp$2 = hash & self.capacity_mask;
|
|
@@ -3369,7 +3384,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsRP36mizchi7tornado5agent12Box
|
|
|
3369
3384
|
$bound_check(_tmp$3, idx);
|
|
3370
3385
|
const _bind = _tmp$3[idx];
|
|
3371
3386
|
if (_bind === undefined) {
|
|
3372
|
-
return
|
|
3387
|
+
return -1;
|
|
3373
3388
|
} else {
|
|
3374
3389
|
const _Some = _bind;
|
|
3375
3390
|
const _entry = _Some;
|
|
@@ -3377,7 +3392,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsRP36mizchi7tornado5agent12Box
|
|
|
3377
3392
|
return _entry.value;
|
|
3378
3393
|
}
|
|
3379
3394
|
if (i > _entry.psl) {
|
|
3380
|
-
return
|
|
3395
|
+
return -1;
|
|
3381
3396
|
}
|
|
3382
3397
|
_tmp = i + 1 | 0;
|
|
3383
3398
|
_tmp$2 = (idx + 1 | 0) & self.capacity_mask;
|
|
@@ -3385,7 +3400,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsRP36mizchi7tornado5agent12Box
|
|
|
3385
3400
|
}
|
|
3386
3401
|
}
|
|
3387
3402
|
}
|
|
3388
|
-
function
|
|
3403
|
+
function _M0MP311moonbitlang4core7builtin3Map3getGsRP36mizchi7tornado5agent12BoxedBackendE(self, key) {
|
|
3389
3404
|
const hash = _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key);
|
|
3390
3405
|
let _tmp = 0;
|
|
3391
3406
|
let _tmp$2 = hash & self.capacity_mask;
|
|
@@ -3412,7 +3427,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsRP311moonbitlang4core7builtin
|
|
|
3412
3427
|
}
|
|
3413
3428
|
}
|
|
3414
3429
|
}
|
|
3415
|
-
function
|
|
3430
|
+
function _M0MP311moonbitlang4core7builtin3Map3getGsRP311moonbitlang4core7builtin4JsonE(self, key) {
|
|
3416
3431
|
const hash = _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key);
|
|
3417
3432
|
let _tmp = 0;
|
|
3418
3433
|
let _tmp$2 = hash & self.capacity_mask;
|
|
@@ -3439,7 +3454,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGssE(self, key) {
|
|
|
3439
3454
|
}
|
|
3440
3455
|
}
|
|
3441
3456
|
}
|
|
3442
|
-
function
|
|
3457
|
+
function _M0MP311moonbitlang4core7builtin3Map3getGssE(self, key) {
|
|
3443
3458
|
const hash = _M0IP016_24default__implP311moonbitlang4core7builtin4Hash4hashGsE(key);
|
|
3444
3459
|
let _tmp = 0;
|
|
3445
3460
|
let _tmp$2 = hash & self.capacity_mask;
|
|
@@ -3450,7 +3465,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsbE(self, key) {
|
|
|
3450
3465
|
$bound_check(_tmp$3, idx);
|
|
3451
3466
|
const _bind = _tmp$3[idx];
|
|
3452
3467
|
if (_bind === undefined) {
|
|
3453
|
-
return
|
|
3468
|
+
return undefined;
|
|
3454
3469
|
} else {
|
|
3455
3470
|
const _Some = _bind;
|
|
3456
3471
|
const _entry = _Some;
|
|
@@ -3458,7 +3473,7 @@ function _M0MP311moonbitlang4core7builtin3Map3getGsbE(self, key) {
|
|
|
3458
3473
|
return _entry.value;
|
|
3459
3474
|
}
|
|
3460
3475
|
if (i > _entry.psl) {
|
|
3461
|
-
return
|
|
3476
|
+
return undefined;
|
|
3462
3477
|
}
|
|
3463
3478
|
_tmp = i + 1 | 0;
|
|
3464
3479
|
_tmp$2 = (idx + 1 | 0) & self.capacity_mask;
|
|
@@ -10590,14 +10605,251 @@ function _M0MP36mizchi7tornado6config13ProjectConfig8validate(self) {
|
|
|
10590
10605
|
}
|
|
10591
10606
|
return errors;
|
|
10592
10607
|
}
|
|
10593
|
-
function
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10608
|
+
function _M0FP36mizchi7tornado3cli12drop__prefix(args, start) {
|
|
10609
|
+
const result = [];
|
|
10610
|
+
const len = args.length;
|
|
10611
|
+
const i = { val: start };
|
|
10612
|
+
while (true) {
|
|
10613
|
+
if (i.val < len) {
|
|
10614
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(result, _M0MP311moonbitlang4core5array5Array2atGsE(args, i.val));
|
|
10615
|
+
i.val = i.val + 1 | 0;
|
|
10616
|
+
continue;
|
|
10617
|
+
} else {
|
|
10618
|
+
break;
|
|
10619
|
+
}
|
|
10620
|
+
}
|
|
10621
|
+
return result;
|
|
10622
|
+
}
|
|
10623
|
+
function _M0FP36mizchi7tornado3cli18parse__kind__alias(raw) {
|
|
10624
|
+
_L: {
|
|
10625
|
+
switch (raw) {
|
|
10626
|
+
case "claude": {
|
|
10627
|
+
break _L;
|
|
10628
|
+
}
|
|
10629
|
+
case "claude-code": {
|
|
10630
|
+
break _L;
|
|
10631
|
+
}
|
|
10632
|
+
case "claudecode": {
|
|
10633
|
+
break _L;
|
|
10634
|
+
}
|
|
10635
|
+
case "codex": {
|
|
10636
|
+
return 1;
|
|
10637
|
+
}
|
|
10638
|
+
case "api": {
|
|
10639
|
+
return 2;
|
|
10640
|
+
}
|
|
10641
|
+
case "mock": {
|
|
10642
|
+
return 3;
|
|
10643
|
+
}
|
|
10644
|
+
default: {
|
|
10645
|
+
return undefined;
|
|
10646
|
+
}
|
|
10647
|
+
}
|
|
10648
|
+
}
|
|
10649
|
+
return 0;
|
|
10650
|
+
}
|
|
10651
|
+
function _M0FP36mizchi7tornado3cli16parse__run__args(args, file_exists) {
|
|
10652
|
+
const config_path = { val: undefined };
|
|
10653
|
+
const plan_path = { val: undefined };
|
|
10654
|
+
const dev_kind = { val: undefined };
|
|
10655
|
+
const review_kind = { val: undefined };
|
|
10656
|
+
const warnings = [];
|
|
10657
|
+
const i = { val: 0 };
|
|
10658
|
+
const len = args.length;
|
|
10659
|
+
while (true) {
|
|
10660
|
+
if (i.val < len) {
|
|
10661
|
+
const token = _M0MP311moonbitlang4core5array5Array2atGsE(args, i.val);
|
|
10662
|
+
const _bind = "--dev=";
|
|
10663
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(token, { str: _bind, start: 0, end: _bind.length })) {
|
|
10664
|
+
const raw = _M0IP311moonbitlang4core6string10StringViewP311moonbitlang4core7builtin4Show10to__string(_M0MP311moonbitlang4core6string6String12view_2einner(token, "--dev=".length, undefined));
|
|
10665
|
+
let kind;
|
|
10666
|
+
_L: {
|
|
10667
|
+
_L$2: {
|
|
10668
|
+
const _bind$2 = _M0FP36mizchi7tornado3cli18parse__kind__alias(raw);
|
|
10669
|
+
if (_bind$2 === undefined) {
|
|
10670
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, `Unknown --dev kind: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(raw)}`);
|
|
10671
|
+
} else {
|
|
10672
|
+
const _Some = _bind$2;
|
|
10673
|
+
const _kind = _Some;
|
|
10674
|
+
kind = _kind;
|
|
10675
|
+
break _L$2;
|
|
10676
|
+
}
|
|
10677
|
+
break _L;
|
|
10678
|
+
}
|
|
10679
|
+
dev_kind.val = kind;
|
|
10680
|
+
}
|
|
10681
|
+
i.val = i.val + 1 | 0;
|
|
10682
|
+
continue;
|
|
10683
|
+
}
|
|
10684
|
+
const _bind$2 = "--review=";
|
|
10685
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(token, { str: _bind$2, start: 0, end: _bind$2.length })) {
|
|
10686
|
+
const raw = _M0IP311moonbitlang4core6string10StringViewP311moonbitlang4core7builtin4Show10to__string(_M0MP311moonbitlang4core6string6String12view_2einner(token, "--review=".length, undefined));
|
|
10687
|
+
let kind;
|
|
10688
|
+
_L: {
|
|
10689
|
+
_L$2: {
|
|
10690
|
+
const _bind$3 = _M0FP36mizchi7tornado3cli18parse__kind__alias(raw);
|
|
10691
|
+
if (_bind$3 === undefined) {
|
|
10692
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, `Unknown --review kind: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(raw)}`);
|
|
10693
|
+
} else {
|
|
10694
|
+
const _Some = _bind$3;
|
|
10695
|
+
const _kind = _Some;
|
|
10696
|
+
kind = _kind;
|
|
10697
|
+
break _L$2;
|
|
10698
|
+
}
|
|
10699
|
+
break _L;
|
|
10700
|
+
}
|
|
10701
|
+
review_kind.val = kind;
|
|
10702
|
+
}
|
|
10703
|
+
i.val = i.val + 1 | 0;
|
|
10704
|
+
continue;
|
|
10705
|
+
}
|
|
10706
|
+
const _bind$3 = "--config=";
|
|
10707
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(token, { str: _bind$3, start: 0, end: _bind$3.length })) {
|
|
10708
|
+
const path = _M0IP311moonbitlang4core6string10StringViewP311moonbitlang4core7builtin4Show10to__string(_M0MP311moonbitlang4core6string6String12view_2einner(token, "--config=".length, undefined));
|
|
10709
|
+
if (_M0MP311moonbitlang4core6string6String9is__empty(path)) {
|
|
10710
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, "Missing value for --config");
|
|
10711
|
+
} else {
|
|
10712
|
+
config_path.val = path;
|
|
10713
|
+
}
|
|
10714
|
+
i.val = i.val + 1 | 0;
|
|
10715
|
+
continue;
|
|
10716
|
+
}
|
|
10717
|
+
if (token === "--config") {
|
|
10718
|
+
if ((i.val + 1 | 0) < len) {
|
|
10719
|
+
const path = _M0MP311moonbitlang4core5array5Array2atGsE(args, i.val + 1 | 0);
|
|
10720
|
+
const _bind$4 = "--";
|
|
10721
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(path, { str: _bind$4, start: 0, end: _bind$4.length })) {
|
|
10722
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, "Missing value for --config");
|
|
10723
|
+
i.val = i.val + 1 | 0;
|
|
10724
|
+
} else {
|
|
10725
|
+
config_path.val = path;
|
|
10726
|
+
i.val = i.val + 2 | 0;
|
|
10727
|
+
}
|
|
10728
|
+
} else {
|
|
10729
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, "Missing value for --config");
|
|
10730
|
+
i.val = i.val + 1 | 0;
|
|
10731
|
+
}
|
|
10732
|
+
continue;
|
|
10733
|
+
}
|
|
10734
|
+
const _bind$4 = "--";
|
|
10735
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(token, { str: _bind$4, start: 0, end: _bind$4.length })) {
|
|
10736
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, `Unknown option: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(token)}`);
|
|
10737
|
+
i.val = i.val + 1 | 0;
|
|
10738
|
+
continue;
|
|
10739
|
+
}
|
|
10740
|
+
const _bind$5 = plan_path.val;
|
|
10741
|
+
if (_bind$5 === undefined) {
|
|
10742
|
+
if (file_exists(token)) {
|
|
10743
|
+
plan_path.val = token;
|
|
10744
|
+
} else {
|
|
10745
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, `Positional argument must be an existing plan file: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(token)} (use --config=<path> for config)`);
|
|
10746
|
+
}
|
|
10747
|
+
} else {
|
|
10748
|
+
_M0MP311moonbitlang4core5array5Array4pushGsE(warnings, `Unexpected argument: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(token)}`);
|
|
10749
|
+
}
|
|
10750
|
+
i.val = i.val + 1 | 0;
|
|
10751
|
+
continue;
|
|
10752
|
+
} else {
|
|
10753
|
+
break;
|
|
10754
|
+
}
|
|
10755
|
+
}
|
|
10756
|
+
return new $64$mizchi$47$tornado$47$cli$46$CliCommand$Run(config_path.val, plan_path.val, dev_kind.val, review_kind.val, warnings);
|
|
10757
|
+
}
|
|
10758
|
+
function _M0FP36mizchi7tornado3cli16parse__cli__args(args, file_exists) {
|
|
10759
|
+
if (args.length < 2) {
|
|
10760
|
+
return new $64$mizchi$47$tornado$47$cli$46$CliCommand$Run(undefined, undefined, undefined, undefined, []);
|
|
10761
|
+
}
|
|
10762
|
+
const first = _M0MP311moonbitlang4core5array5Array2atGsE(args, 1);
|
|
10763
|
+
_L: {
|
|
10764
|
+
switch (first) {
|
|
10765
|
+
case "help": {
|
|
10766
|
+
break _L;
|
|
10767
|
+
}
|
|
10768
|
+
case "--help": {
|
|
10769
|
+
break _L;
|
|
10770
|
+
}
|
|
10771
|
+
case "-h": {
|
|
10772
|
+
break _L;
|
|
10773
|
+
}
|
|
10774
|
+
case "validate": {
|
|
10775
|
+
return args.length >= 3 ? new $64$mizchi$47$tornado$47$cli$46$CliCommand$Validate(_M0MP311moonbitlang4core5array5Array2atGsE(args, 2)) : new $64$mizchi$47$tornado$47$cli$46$CliCommand$Validate(undefined);
|
|
10776
|
+
}
|
|
10777
|
+
default: {
|
|
10778
|
+
return _M0FP36mizchi7tornado3cli16parse__run__args(_M0FP36mizchi7tornado3cli12drop__prefix(args, 1), file_exists);
|
|
10779
|
+
}
|
|
10780
|
+
}
|
|
10781
|
+
}
|
|
10782
|
+
return $64$mizchi$47$tornado$47$cli$46$CliCommand$Help;
|
|
10783
|
+
}
|
|
10784
|
+
function _M0FP36mizchi7tornado3cli30apply__kind__overrides_2einner(config, dev_kind, review_kind) {
|
|
10785
|
+
const agents = [];
|
|
10786
|
+
const _arr = config.agents;
|
|
10787
|
+
const _len = _arr.length;
|
|
10788
|
+
let _tmp = 0;
|
|
10789
|
+
while (true) {
|
|
10790
|
+
const _i = _tmp;
|
|
10791
|
+
if (_i < _len) {
|
|
10792
|
+
const agent = _arr[_i];
|
|
10793
|
+
const _bind = agent.role;
|
|
10794
|
+
let kind;
|
|
10795
|
+
switch (_bind) {
|
|
10796
|
+
case 0: {
|
|
10797
|
+
if (dev_kind === undefined) {
|
|
10798
|
+
kind = agent.kind;
|
|
10799
|
+
} else {
|
|
10800
|
+
const _Some = dev_kind;
|
|
10801
|
+
const _k = _Some;
|
|
10802
|
+
kind = _k;
|
|
10803
|
+
}
|
|
10804
|
+
break;
|
|
10805
|
+
}
|
|
10806
|
+
case 1: {
|
|
10807
|
+
if (review_kind === undefined) {
|
|
10808
|
+
kind = agent.kind;
|
|
10809
|
+
} else {
|
|
10810
|
+
const _Some = review_kind;
|
|
10811
|
+
const _k = _Some;
|
|
10812
|
+
kind = _k;
|
|
10813
|
+
}
|
|
10814
|
+
break;
|
|
10815
|
+
}
|
|
10816
|
+
default: {
|
|
10817
|
+
kind = agent.kind;
|
|
10818
|
+
}
|
|
10819
|
+
}
|
|
10820
|
+
_M0MP311moonbitlang4core5array5Array4pushGRP36mizchi7tornado5types11AgentConfigE(agents, { id: agent.id, kind: kind, role: agent.role, model: agent.model, system_prompt: agent.system_prompt, working_dir: agent.working_dir, max_iterations: agent.max_iterations });
|
|
10821
|
+
_tmp = _i + 1 | 0;
|
|
10822
|
+
continue;
|
|
10823
|
+
} else {
|
|
10824
|
+
break;
|
|
10825
|
+
}
|
|
10826
|
+
}
|
|
10827
|
+
return { project_dir: config.project_dir, review_dir: config.review_dir, max_review_cycles: config.max_review_cycles, agents: agents, parse_warnings: config.parse_warnings };
|
|
10828
|
+
}
|
|
10829
|
+
function _M0FP36mizchi7tornado3cli10kind__name(kind) {
|
|
10830
|
+
switch (kind) {
|
|
10831
|
+
case 0: {
|
|
10832
|
+
return "claude-code";
|
|
10833
|
+
}
|
|
10834
|
+
case 1: {
|
|
10835
|
+
return "codex";
|
|
10836
|
+
}
|
|
10837
|
+
case 2: {
|
|
10838
|
+
return "api";
|
|
10839
|
+
}
|
|
10840
|
+
default: {
|
|
10841
|
+
return "mock";
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
}
|
|
10845
|
+
function _M0FP36mizchi7tornado7display8truncate(s, max) {
|
|
10846
|
+
return s.length <= max ? s : `${_M0IP311moonbitlang4core6string10StringViewP311moonbitlang4core7builtin4Show10to__string(_M0MP311moonbitlang4core6string6String12view_2einner(s, 0, max))}...`;
|
|
10847
|
+
}
|
|
10848
|
+
function _M0FP36mizchi7tornado7display12count__lines(s) {
|
|
10849
|
+
if (_M0MP311moonbitlang4core6string6String9is__empty(s)) {
|
|
10850
|
+
return 0;
|
|
10851
|
+
}
|
|
10852
|
+
const count = { val: 1 };
|
|
10601
10853
|
const _it = _M0MP311moonbitlang4core6string6String4iter(s);
|
|
10602
10854
|
while (true) {
|
|
10603
10855
|
let c;
|
|
@@ -11219,15 +11471,60 @@ function _M0FP311moonbitlang1x3sys14get__cli__args() {
|
|
|
11219
11471
|
function _M0FP36mizchi1x3sys14get__cli__args() {
|
|
11220
11472
|
return _M0FP311moonbitlang1x3sys14get__cli__args();
|
|
11221
11473
|
}
|
|
11474
|
+
function _M0FP46mizchi7tornado3cmd3app16read__file__sync(path) {
|
|
11475
|
+
return _M0FP46mizchi7tornado3cmd3app20js__read__file__sync(path);
|
|
11476
|
+
}
|
|
11477
|
+
function _M0FP46mizchi7tornado3cmd3app18is__existing__file(path) {
|
|
11478
|
+
const content = _M0FP46mizchi7tornado3cmd3app16read__file__sync(path);
|
|
11479
|
+
const _bind = "ERROR:";
|
|
11480
|
+
return !_M0MP311moonbitlang4core6string6String11has__prefix(content, { str: _bind, start: 0, end: _bind.length });
|
|
11481
|
+
}
|
|
11482
|
+
function _M0FP46mizchi7tornado3cmd3app14now__timestamp() {
|
|
11483
|
+
return _M0FP46mizchi7tornado3cmd3app18js__now__timestamp();
|
|
11484
|
+
}
|
|
11485
|
+
function _M0FP46mizchi7tornado3cmd3app3log(level, msg) {
|
|
11486
|
+
const ts = _M0FP46mizchi7tornado3cmd3app14now__timestamp();
|
|
11487
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE(`[${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(ts)}] [${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(level)}] ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(msg)}`);
|
|
11488
|
+
}
|
|
11489
|
+
function _M0FP46mizchi7tornado3cmd3app16load__plan__task(plan_path) {
|
|
11490
|
+
let path;
|
|
11491
|
+
_L: {
|
|
11492
|
+
if (plan_path === undefined) {
|
|
11493
|
+
return undefined;
|
|
11494
|
+
} else {
|
|
11495
|
+
const _Some = plan_path;
|
|
11496
|
+
const _path = _Some;
|
|
11497
|
+
path = _path;
|
|
11498
|
+
break _L;
|
|
11499
|
+
}
|
|
11500
|
+
}
|
|
11501
|
+
const content = _M0FP46mizchi7tornado3cmd3app16read__file__sync(path);
|
|
11502
|
+
const _bind = "ERROR:";
|
|
11503
|
+
if (_M0MP311moonbitlang4core6string6String11has__prefix(content, { str: _bind, start: 0, end: _bind.length })) {
|
|
11504
|
+
_M0FP46mizchi7tornado3cmd3app3log("WARN", `Failed to read plan file ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(path)}: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(content)}`);
|
|
11505
|
+
return undefined;
|
|
11506
|
+
} else {
|
|
11507
|
+
if (_M0MP311moonbitlang4core6string6String9is__empty(_M0IP311moonbitlang4core6string10StringViewP311moonbitlang4core7builtin4Show10to__string(_M0MP311moonbitlang4core6string6String4trim(content, undefined)))) {
|
|
11508
|
+
_M0FP46mizchi7tornado3cmd3app3log("WARN", `Plan file is empty: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(path)}`);
|
|
11509
|
+
return undefined;
|
|
11510
|
+
} else {
|
|
11511
|
+
_M0FP46mizchi7tornado3cmd3app3log("BOOT", `Loaded plan file: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(path)}`);
|
|
11512
|
+
return content;
|
|
11513
|
+
}
|
|
11514
|
+
}
|
|
11515
|
+
}
|
|
11222
11516
|
function _M0FP46mizchi7tornado3cmd3app12print__usage() {
|
|
11223
11517
|
_M0FP311moonbitlang4core7builtin7printlnGsE("tornado - multi-agent development orchestrator");
|
|
11224
11518
|
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
11225
11519
|
_M0FP311moonbitlang4core7builtin7printlnGsE("Usage:");
|
|
11520
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado <plan.md> [--dev=codex] [--review=claude] # start from plan file");
|
|
11521
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado --config=tornado.json [--dev=codex] [--review=claude]");
|
|
11226
11522
|
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado # start with preset (dev:claude-code, review:codex)");
|
|
11227
|
-
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado
|
|
11228
|
-
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado run <config.json> # start with custom config");
|
|
11523
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado --dev=codex --review=claude");
|
|
11229
11524
|
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado validate <config> # validate config file");
|
|
11230
11525
|
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
11526
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE("Agent kind options: claude | claude-code | codex | api | mock");
|
|
11527
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
11231
11528
|
_M0FP311moonbitlang4core7builtin7printlnGsE("Autonomous heartbeat: dev runs → reviewer reviews →");
|
|
11232
11529
|
_M0FP311moonbitlang4core7builtin7printlnGsE("dev continues with next task → forever until Ctrl+C.");
|
|
11233
11530
|
_M0FP311moonbitlang4core7builtin7printlnGsE("Session auto-saved to .tornado/session.json for resume.");
|
|
@@ -11286,9 +11583,6 @@ function _M0FP46mizchi7tornado3cmd3app25build__continuation__task(prev_task, rev
|
|
|
11286
11583
|
_M0IP311moonbitlang4core7builtin13StringBuilderP311moonbitlang4core7builtin6Logger13write__string(buf, "Do not just describe what to do — actually do it.\n");
|
|
11287
11584
|
return _M0MP311moonbitlang4core7builtin13StringBuilder10to__string(buf);
|
|
11288
11585
|
}
|
|
11289
|
-
function _M0FP46mizchi7tornado3cmd3app16read__file__sync(path) {
|
|
11290
|
-
return _M0FP46mizchi7tornado3cmd3app20js__read__file__sync(path);
|
|
11291
|
-
}
|
|
11292
11586
|
function _M0FP46mizchi7tornado3cmd3app33build__initial__task__from__todos() {
|
|
11293
11587
|
const todo_files = ["TODO.md", "Agents-todo.md", "AGENTS-TODO.md", "agents-todo.md", "TODO", "todo.md"];
|
|
11294
11588
|
const buf = _M0MP311moonbitlang4core7builtin13StringBuilder11new_2einner(0);
|
|
@@ -11360,13 +11654,6 @@ function _M0FP46mizchi7tornado3cmd3app15find__agent__id(agents, role) {
|
|
|
11360
11654
|
}
|
|
11361
11655
|
return undefined;
|
|
11362
11656
|
}
|
|
11363
|
-
function _M0FP46mizchi7tornado3cmd3app14now__timestamp() {
|
|
11364
|
-
return _M0FP46mizchi7tornado3cmd3app18js__now__timestamp();
|
|
11365
|
-
}
|
|
11366
|
-
function _M0FP46mizchi7tornado3cmd3app3log(level, msg) {
|
|
11367
|
-
const ts = _M0FP46mizchi7tornado3cmd3app14now__timestamp();
|
|
11368
|
-
_M0FP311moonbitlang4core7builtin7printlnGsE(`[${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(ts)}] [${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(level)}] ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(msg)}`);
|
|
11369
|
-
}
|
|
11370
11657
|
function _M0FP46mizchi7tornado3cmd3app12load__config(config_path) {
|
|
11371
11658
|
let path;
|
|
11372
11659
|
_L: {
|
|
@@ -12078,11 +12365,40 @@ function _M0FP46mizchi7tornado3cmd3app9sleep__ms(ms) {
|
|
|
12078
12365
|
function _M0FP46mizchi7tornado3cmd3app21start__stdin__watcher() {
|
|
12079
12366
|
_M0FP46mizchi7tornado3cmd3app25js__start__stdin__watcher();
|
|
12080
12367
|
}
|
|
12081
|
-
function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path) {
|
|
12082
|
-
const
|
|
12368
|
+
function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path, initial_task, dev_kind, review_kind) {
|
|
12369
|
+
const loaded_config = _M0FP46mizchi7tornado3cmd3app12load__config(config_path);
|
|
12370
|
+
const config = _M0FP36mizchi7tornado3cli30apply__kind__overrides_2einner(loaded_config, dev_kind, review_kind);
|
|
12083
12371
|
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
12084
12372
|
_M0FP311moonbitlang4core7builtin7printlnGsE(" tornado - autonomous development orchestrator");
|
|
12085
12373
|
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
12374
|
+
let kind;
|
|
12375
|
+
_L: {
|
|
12376
|
+
_L$2: {
|
|
12377
|
+
if (dev_kind === undefined) {
|
|
12378
|
+
} else {
|
|
12379
|
+
const _Some = dev_kind;
|
|
12380
|
+
const _kind = _Some;
|
|
12381
|
+
kind = _kind;
|
|
12382
|
+
break _L$2;
|
|
12383
|
+
}
|
|
12384
|
+
break _L;
|
|
12385
|
+
}
|
|
12386
|
+
_M0FP46mizchi7tornado3cmd3app3log("BOOT", `Override: dev=${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(_M0FP36mizchi7tornado3cli10kind__name(kind))}`);
|
|
12387
|
+
}
|
|
12388
|
+
let kind$2;
|
|
12389
|
+
_L$2: {
|
|
12390
|
+
_L$3: {
|
|
12391
|
+
if (review_kind === undefined) {
|
|
12392
|
+
} else {
|
|
12393
|
+
const _Some = review_kind;
|
|
12394
|
+
const _kind = _Some;
|
|
12395
|
+
kind$2 = _kind;
|
|
12396
|
+
break _L$3;
|
|
12397
|
+
}
|
|
12398
|
+
break _L$2;
|
|
12399
|
+
}
|
|
12400
|
+
_M0FP46mizchi7tornado3cmd3app3log("BOOT", `Override: review=${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(_M0FP36mizchi7tornado3cli10kind__name(kind$2))}`);
|
|
12401
|
+
}
|
|
12086
12402
|
_M0FP46mizchi7tornado3cmd3app3log("BOOT", "Agents:");
|
|
12087
12403
|
const _arr = config.agents;
|
|
12088
12404
|
const _len = _arr.length;
|
|
@@ -12113,80 +12429,99 @@ function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path) {
|
|
|
12113
12429
|
const total_cache_read = { val: 0 };
|
|
12114
12430
|
const total_cache_write = { val: 0 };
|
|
12115
12431
|
const total_cost_usd = { val: 0 };
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
_L$
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
} else {
|
|
12122
|
-
const _Some = _bind$2;
|
|
12123
|
-
const _saved = _Some;
|
|
12124
|
-
saved = _saved;
|
|
12125
|
-
break _L$2;
|
|
12126
|
-
}
|
|
12127
|
-
break _L;
|
|
12128
|
-
}
|
|
12129
|
-
_M0FP46mizchi7tornado3cmd3app3log("RESUME", `Found saved session (iteration ${_M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGiE(saved.iteration)})`);
|
|
12130
|
-
_M0FP46mizchi7tornado3cmd3app3log("RESUME", ` Phase: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(saved.phase)}`);
|
|
12131
|
-
_M0FP46mizchi7tornado3cmd3app3log("RESUME", ` Task: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(_M0FP46mizchi7tornado3cmd3app8truncate(saved.task, 80))}`);
|
|
12132
|
-
const _it = _M0MP311moonbitlang4core7builtin3Map4iterGssE(saved.agent_sessions);
|
|
12133
|
-
while (true) {
|
|
12134
|
-
let entry;
|
|
12135
|
-
_L$3: {
|
|
12136
|
-
const _bind$2 = _M0MP311moonbitlang4core7builtin4Iter4nextGUssEE(_it);
|
|
12432
|
+
if (initial_task === undefined) {
|
|
12433
|
+
let saved;
|
|
12434
|
+
_L$3: {
|
|
12435
|
+
_L$4: {
|
|
12436
|
+
const _bind$2 = _M0FP46mizchi7tornado3cmd3app13load__session();
|
|
12137
12437
|
if (_bind$2 === undefined) {
|
|
12138
|
-
break;
|
|
12139
12438
|
} else {
|
|
12140
12439
|
const _Some = _bind$2;
|
|
12141
|
-
const
|
|
12142
|
-
|
|
12143
|
-
break _L$
|
|
12440
|
+
const _saved = _Some;
|
|
12441
|
+
saved = _saved;
|
|
12442
|
+
break _L$4;
|
|
12144
12443
|
}
|
|
12444
|
+
break _L$3;
|
|
12145
12445
|
}
|
|
12146
|
-
_M0FP46mizchi7tornado3cmd3app3log("RESUME", `
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12446
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", `Found saved session (iteration ${_M0IP016_24default__implP311moonbitlang4core7builtin4Show10to__stringGiE(saved.iteration)})`);
|
|
12447
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", ` Phase: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(saved.phase)}`);
|
|
12448
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", ` Task: ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(_M0FP46mizchi7tornado3cmd3app8truncate(saved.task, 80))}`);
|
|
12449
|
+
const _it = _M0MP311moonbitlang4core7builtin3Map4iterGssE(saved.agent_sessions);
|
|
12450
|
+
while (true) {
|
|
12451
|
+
let entry;
|
|
12452
|
+
_L$5: {
|
|
12453
|
+
const _bind$2 = _M0MP311moonbitlang4core7builtin4Iter4nextGUssEE(_it);
|
|
12454
|
+
if (_bind$2 === undefined) {
|
|
12455
|
+
break;
|
|
12456
|
+
} else {
|
|
12457
|
+
const _Some = _bind$2;
|
|
12458
|
+
const _entry = _Some;
|
|
12459
|
+
entry = _entry;
|
|
12460
|
+
break _L$5;
|
|
12461
|
+
}
|
|
12462
|
+
}
|
|
12463
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", ` Agent ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(entry._0)}: session ${_M0IP311moonbitlang4core6string6StringP311moonbitlang4core7builtin4Show10to__string(entry._1)}`);
|
|
12464
|
+
_M0MP311moonbitlang4core7builtin3Map3setGssE(agent_sessions, entry._0, entry._1);
|
|
12465
|
+
continue;
|
|
12466
|
+
}
|
|
12467
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
12468
|
+
const answer = _M0FP46mizchi7tornado3cmd3app12prompt__sync("Resume this session? [Y/n] ");
|
|
12469
|
+
if (answer === "n" || (answer === "N" || answer === "no")) {
|
|
12470
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", "Starting fresh");
|
|
12471
|
+
_M0FP46mizchi7tornado3cmd3app14clear__session();
|
|
12472
|
+
} else {
|
|
12473
|
+
_M0FP46mizchi7tornado3cmd3app3log("RESUME", "Resuming...");
|
|
12474
|
+
_M0FP46mizchi7tornado3cmd3app17restore__sessions(backends, agent_sessions);
|
|
12475
|
+
iteration.val = saved.iteration;
|
|
12476
|
+
last_review_summary.val = saved.review_summary;
|
|
12477
|
+
_L$5: {
|
|
12478
|
+
_L$6: {
|
|
12479
|
+
const _bind$2 = saved.phase;
|
|
12480
|
+
switch (_bind$2) {
|
|
12481
|
+
case "dev": {
|
|
12482
|
+
break _L$6;
|
|
12483
|
+
}
|
|
12484
|
+
case "review": {
|
|
12485
|
+
break _L$6;
|
|
12486
|
+
}
|
|
12487
|
+
default: {
|
|
12488
|
+
next_task.val = _M0FP46mizchi7tornado3cmd3app25build__continuation__task(saved.task, saved.review_summary);
|
|
12489
|
+
}
|
|
12172
12490
|
}
|
|
12491
|
+
break _L$5;
|
|
12173
12492
|
}
|
|
12174
|
-
|
|
12493
|
+
next_task.val = saved.task;
|
|
12175
12494
|
}
|
|
12176
|
-
next_task.val = saved.task;
|
|
12177
12495
|
}
|
|
12178
12496
|
}
|
|
12497
|
+
} else {
|
|
12498
|
+
_M0FP46mizchi7tornado3cmd3app3log("BOOT", "Plan file mode: skip session resume");
|
|
12179
12499
|
}
|
|
12180
12500
|
if (_M0MP311moonbitlang4core6string6String9is__empty(next_task.val)) {
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12184
|
-
|
|
12185
|
-
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
|
|
12189
|
-
|
|
12501
|
+
let task;
|
|
12502
|
+
_L$3: {
|
|
12503
|
+
_L$4: {
|
|
12504
|
+
if (initial_task === undefined) {
|
|
12505
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE("");
|
|
12506
|
+
next_task.val = _M0FP46mizchi7tornado3cmd3app12prompt__sync("task> ");
|
|
12507
|
+
if (next_task.val === "quit" || next_task.val === "exit") {
|
|
12508
|
+
_M0FP46mizchi7tornado3cmd3app3log("EXIT", "Bye.");
|
|
12509
|
+
return undefined;
|
|
12510
|
+
}
|
|
12511
|
+
if (_M0MP311moonbitlang4core6string6String9is__empty(next_task.val)) {
|
|
12512
|
+
next_task.val = _M0FP46mizchi7tornado3cmd3app33build__initial__task__from__todos();
|
|
12513
|
+
_M0FP46mizchi7tornado3cmd3app3log("HEARTBEAT", "No task specified. Starting from project TODO files.");
|
|
12514
|
+
}
|
|
12515
|
+
} else {
|
|
12516
|
+
const _Some = initial_task;
|
|
12517
|
+
const _task = _Some;
|
|
12518
|
+
task = _task;
|
|
12519
|
+
break _L$4;
|
|
12520
|
+
}
|
|
12521
|
+
break _L$3;
|
|
12522
|
+
}
|
|
12523
|
+
next_task.val = task;
|
|
12524
|
+
_M0FP46mizchi7tornado3cmd3app3log("HEARTBEAT", "Starting from provided plan file");
|
|
12190
12525
|
}
|
|
12191
12526
|
}
|
|
12192
12527
|
_M0FP46mizchi7tornado3cmd3app21start__stdin__watcher();
|
|
@@ -12233,8 +12568,8 @@ function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path) {
|
|
|
12233
12568
|
_M0FP46mizchi7tornado3cmd3app13save__session({ iteration: iteration.val, phase: "review", task: next_task.val, dev_output: dev_result, review_summary: last_review_summary.val, agent_sessions: agent_sessions });
|
|
12234
12569
|
let review_result;
|
|
12235
12570
|
let rid;
|
|
12236
|
-
_L$
|
|
12237
|
-
_L$
|
|
12571
|
+
_L$3: {
|
|
12572
|
+
_L$4: {
|
|
12238
12573
|
if (reviewer_id === undefined) {
|
|
12239
12574
|
_M0FP46mizchi7tornado3cmd3app3log("SKIP", "No reviewer configured");
|
|
12240
12575
|
review_result = new ReviewOutcome$Approved("");
|
|
@@ -12242,27 +12577,27 @@ function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path) {
|
|
|
12242
12577
|
const _Some = reviewer_id;
|
|
12243
12578
|
const _rid = _Some;
|
|
12244
12579
|
rid = _rid;
|
|
12245
|
-
break _L$
|
|
12580
|
+
break _L$4;
|
|
12246
12581
|
}
|
|
12247
|
-
break _L$
|
|
12582
|
+
break _L$3;
|
|
12248
12583
|
}
|
|
12249
12584
|
review_result = _M0FP46mizchi7tornado3cmd3app19run__review_2einner(dev_id, rid, backends, next_task.val, dev_result, config.max_review_cycles, agent_sessions, on_usage);
|
|
12250
12585
|
}
|
|
12251
12586
|
let reason;
|
|
12252
|
-
_L$
|
|
12253
|
-
_L$
|
|
12587
|
+
_L$4: {
|
|
12588
|
+
_L$5: {
|
|
12254
12589
|
let summary;
|
|
12255
|
-
_L$
|
|
12590
|
+
_L$6: {
|
|
12256
12591
|
if (review_result.$tag === 0) {
|
|
12257
12592
|
const _Approved = review_result;
|
|
12258
12593
|
const _summary = _Approved._0;
|
|
12259
12594
|
summary = _summary;
|
|
12260
|
-
break _L$
|
|
12595
|
+
break _L$6;
|
|
12261
12596
|
} else {
|
|
12262
12597
|
const _Rejected = review_result;
|
|
12263
12598
|
const _reason = _Rejected._0;
|
|
12264
12599
|
reason = _reason;
|
|
12265
|
-
break _L$
|
|
12600
|
+
break _L$5;
|
|
12266
12601
|
}
|
|
12267
12602
|
}
|
|
12268
12603
|
last_review_summary.val = summary;
|
|
@@ -12281,7 +12616,7 @@ function _M0FP46mizchi7tornado3cmd3app9run__repl(config_path) {
|
|
|
12281
12616
|
if (!_M0MP311moonbitlang4core6string6String9is__empty(post_dev_interrupt)) {
|
|
12282
12617
|
next_task.val = `${next_task.val}\n\n## Additional Instructions from User\n${post_dev_interrupt}`;
|
|
12283
12618
|
}
|
|
12284
|
-
break _L$
|
|
12619
|
+
break _L$4;
|
|
12285
12620
|
}
|
|
12286
12621
|
last_review_summary.val = reason;
|
|
12287
12622
|
_M0FP46mizchi7tornado3cmd3app13save__session({ iteration: iteration.val, phase: "idle", task: next_task.val, dev_output: dev_result, review_summary: reason, agent_sessions: agent_sessions });
|
|
@@ -12381,41 +12716,72 @@ function _M0FP46mizchi7tornado3cmd3app13run__validate(config_path) {
|
|
|
12381
12716
|
}
|
|
12382
12717
|
(() => {
|
|
12383
12718
|
const args = _M0FP36mizchi1x3sys14get__cli__args();
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
return;
|
|
12387
|
-
}
|
|
12388
|
-
const command = _M0MP311moonbitlang4core5array5Array2atGsE(args, 1);
|
|
12719
|
+
const command = _M0FP36mizchi7tornado3cli16parse__cli__args(args, _M0FP46mizchi7tornado3cmd3app18is__existing__file);
|
|
12720
|
+
let path;
|
|
12389
12721
|
_L: {
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12722
|
+
let review_kind;
|
|
12723
|
+
let plan_path;
|
|
12724
|
+
let config_path;
|
|
12725
|
+
let dev_kind;
|
|
12726
|
+
let warnings;
|
|
12727
|
+
_L$2: {
|
|
12728
|
+
switch (command.$tag) {
|
|
12729
|
+
case 0: {
|
|
12730
|
+
const _Run = command;
|
|
12731
|
+
const _config_path = _Run._0;
|
|
12732
|
+
const _plan_path = _Run._1;
|
|
12733
|
+
const _dev_kind = _Run._2;
|
|
12734
|
+
const _review_kind = _Run._3;
|
|
12735
|
+
const _warnings = _Run._4;
|
|
12736
|
+
review_kind = _review_kind;
|
|
12737
|
+
plan_path = _plan_path;
|
|
12738
|
+
config_path = _config_path;
|
|
12739
|
+
dev_kind = _dev_kind;
|
|
12740
|
+
warnings = _warnings;
|
|
12741
|
+
break _L$2;
|
|
12742
|
+
}
|
|
12743
|
+
case 1: {
|
|
12744
|
+
const _Validate = command;
|
|
12745
|
+
const _path = _Validate._0;
|
|
12746
|
+
path = _path;
|
|
12747
|
+
break _L;
|
|
12748
|
+
}
|
|
12749
|
+
default: {
|
|
12750
|
+
_M0FP46mizchi7tornado3cmd3app12print__usage();
|
|
12399
12751
|
return;
|
|
12400
12752
|
}
|
|
12401
|
-
_M0FP46mizchi7tornado3cmd3app13run__validate(_M0MP311moonbitlang4core5array5Array2atGsE(args, 2));
|
|
12402
|
-
return;
|
|
12403
|
-
}
|
|
12404
|
-
case "help": {
|
|
12405
|
-
break _L;
|
|
12406
12753
|
}
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12754
|
+
}
|
|
12755
|
+
const _arr = warnings;
|
|
12756
|
+
const _len = _arr.length;
|
|
12757
|
+
let _tmp = 0;
|
|
12758
|
+
while (true) {
|
|
12759
|
+
const _i = _tmp;
|
|
12760
|
+
if (_i < _len) {
|
|
12761
|
+
const w = _arr[_i];
|
|
12762
|
+
_M0FP46mizchi7tornado3cmd3app3log("WARN", w);
|
|
12763
|
+
_tmp = _i + 1 | 0;
|
|
12764
|
+
continue;
|
|
12765
|
+
} else {
|
|
12766
|
+
break;
|
|
12416
12767
|
}
|
|
12417
12768
|
}
|
|
12769
|
+
const initial_task = _M0FP46mizchi7tornado3cmd3app16load__plan__task(plan_path);
|
|
12770
|
+
_M0FP46mizchi7tornado3cmd3app9run__repl(config_path, initial_task, dev_kind, review_kind);
|
|
12771
|
+
return;
|
|
12772
|
+
}
|
|
12773
|
+
let config_path;
|
|
12774
|
+
_L$2: {
|
|
12775
|
+
if (path === undefined) {
|
|
12776
|
+
_M0FP311moonbitlang4core7builtin7printlnGsE("Usage: tornado validate <config.json>");
|
|
12777
|
+
return;
|
|
12778
|
+
} else {
|
|
12779
|
+
const _Some = path;
|
|
12780
|
+
const _config_path = _Some;
|
|
12781
|
+
config_path = _config_path;
|
|
12782
|
+
break _L$2;
|
|
12783
|
+
}
|
|
12418
12784
|
}
|
|
12419
|
-
|
|
12785
|
+
_M0FP46mizchi7tornado3cmd3app13run__validate(config_path);
|
|
12420
12786
|
})();
|
|
12421
12787
|
//# sourceMappingURL=app.js.map
|