larkway 0.3.30 → 0.3.31

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/dist/main.js CHANGED
@@ -10379,769 +10379,6 @@ var require_proxy_from_env = __commonJS({
10379
10379
  }
10380
10380
  });
10381
10381
 
10382
- // node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
10383
- var require_ms = __commonJS({
10384
- "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
10385
- var s = 1e3;
10386
- var m = s * 60;
10387
- var h = m * 60;
10388
- var d = h * 24;
10389
- var w = d * 7;
10390
- var y = d * 365.25;
10391
- module.exports = function(val, options) {
10392
- options = options || {};
10393
- var type2 = typeof val;
10394
- if (type2 === "string" && val.length > 0) {
10395
- return parse(val);
10396
- } else if (type2 === "number" && isFinite(val)) {
10397
- return options.long ? fmtLong(val) : fmtShort(val);
10398
- }
10399
- throw new Error(
10400
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
10401
- );
10402
- };
10403
- function parse(str2) {
10404
- str2 = String(str2);
10405
- if (str2.length > 100) {
10406
- return;
10407
- }
10408
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
10409
- str2
10410
- );
10411
- if (!match) {
10412
- return;
10413
- }
10414
- var n = parseFloat(match[1]);
10415
- var type2 = (match[2] || "ms").toLowerCase();
10416
- switch (type2) {
10417
- case "years":
10418
- case "year":
10419
- case "yrs":
10420
- case "yr":
10421
- case "y":
10422
- return n * y;
10423
- case "weeks":
10424
- case "week":
10425
- case "w":
10426
- return n * w;
10427
- case "days":
10428
- case "day":
10429
- case "d":
10430
- return n * d;
10431
- case "hours":
10432
- case "hour":
10433
- case "hrs":
10434
- case "hr":
10435
- case "h":
10436
- return n * h;
10437
- case "minutes":
10438
- case "minute":
10439
- case "mins":
10440
- case "min":
10441
- case "m":
10442
- return n * m;
10443
- case "seconds":
10444
- case "second":
10445
- case "secs":
10446
- case "sec":
10447
- case "s":
10448
- return n * s;
10449
- case "milliseconds":
10450
- case "millisecond":
10451
- case "msecs":
10452
- case "msec":
10453
- case "ms":
10454
- return n;
10455
- default:
10456
- return void 0;
10457
- }
10458
- }
10459
- function fmtShort(ms) {
10460
- var msAbs = Math.abs(ms);
10461
- if (msAbs >= d) {
10462
- return Math.round(ms / d) + "d";
10463
- }
10464
- if (msAbs >= h) {
10465
- return Math.round(ms / h) + "h";
10466
- }
10467
- if (msAbs >= m) {
10468
- return Math.round(ms / m) + "m";
10469
- }
10470
- if (msAbs >= s) {
10471
- return Math.round(ms / s) + "s";
10472
- }
10473
- return ms + "ms";
10474
- }
10475
- function fmtLong(ms) {
10476
- var msAbs = Math.abs(ms);
10477
- if (msAbs >= d) {
10478
- return plural(ms, msAbs, d, "day");
10479
- }
10480
- if (msAbs >= h) {
10481
- return plural(ms, msAbs, h, "hour");
10482
- }
10483
- if (msAbs >= m) {
10484
- return plural(ms, msAbs, m, "minute");
10485
- }
10486
- if (msAbs >= s) {
10487
- return plural(ms, msAbs, s, "second");
10488
- }
10489
- return ms + " ms";
10490
- }
10491
- function plural(ms, msAbs, n, name) {
10492
- var isPlural = msAbs >= n * 1.5;
10493
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
10494
- }
10495
- }
10496
- });
10497
-
10498
- // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
10499
- var require_common = __commonJS({
10500
- "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
10501
- function setup(env) {
10502
- createDebug.debug = createDebug;
10503
- createDebug.default = createDebug;
10504
- createDebug.coerce = coerce2;
10505
- createDebug.disable = disable;
10506
- createDebug.enable = enable;
10507
- createDebug.enabled = enabled;
10508
- createDebug.humanize = require_ms();
10509
- createDebug.destroy = destroy;
10510
- Object.keys(env).forEach((key) => {
10511
- createDebug[key] = env[key];
10512
- });
10513
- createDebug.names = [];
10514
- createDebug.skips = [];
10515
- createDebug.formatters = {};
10516
- function selectColor(namespace) {
10517
- let hash = 0;
10518
- for (let i = 0; i < namespace.length; i++) {
10519
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
10520
- hash |= 0;
10521
- }
10522
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
10523
- }
10524
- createDebug.selectColor = selectColor;
10525
- function createDebug(namespace) {
10526
- let prevTime;
10527
- let enableOverride = null;
10528
- let namespacesCache;
10529
- let enabledCache;
10530
- function debug(...args) {
10531
- if (!debug.enabled) {
10532
- return;
10533
- }
10534
- const self2 = debug;
10535
- const curr = Number(/* @__PURE__ */ new Date());
10536
- const ms = curr - (prevTime || curr);
10537
- self2.diff = ms;
10538
- self2.prev = prevTime;
10539
- self2.curr = curr;
10540
- prevTime = curr;
10541
- args[0] = createDebug.coerce(args[0]);
10542
- if (typeof args[0] !== "string") {
10543
- args.unshift("%O");
10544
- }
10545
- let index = 0;
10546
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
10547
- if (match === "%%") {
10548
- return "%";
10549
- }
10550
- index++;
10551
- const formatter = createDebug.formatters[format];
10552
- if (typeof formatter === "function") {
10553
- const val = args[index];
10554
- match = formatter.call(self2, val);
10555
- args.splice(index, 1);
10556
- index--;
10557
- }
10558
- return match;
10559
- });
10560
- createDebug.formatArgs.call(self2, args);
10561
- const logFn = self2.log || createDebug.log;
10562
- logFn.apply(self2, args);
10563
- }
10564
- debug.namespace = namespace;
10565
- debug.useColors = createDebug.useColors();
10566
- debug.color = createDebug.selectColor(namespace);
10567
- debug.extend = extend3;
10568
- debug.destroy = createDebug.destroy;
10569
- Object.defineProperty(debug, "enabled", {
10570
- enumerable: true,
10571
- configurable: false,
10572
- get: () => {
10573
- if (enableOverride !== null) {
10574
- return enableOverride;
10575
- }
10576
- if (namespacesCache !== createDebug.namespaces) {
10577
- namespacesCache = createDebug.namespaces;
10578
- enabledCache = createDebug.enabled(namespace);
10579
- }
10580
- return enabledCache;
10581
- },
10582
- set: (v) => {
10583
- enableOverride = v;
10584
- }
10585
- });
10586
- if (typeof createDebug.init === "function") {
10587
- createDebug.init(debug);
10588
- }
10589
- return debug;
10590
- }
10591
- function extend3(namespace, delimiter) {
10592
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
10593
- newDebug.log = this.log;
10594
- return newDebug;
10595
- }
10596
- function enable(namespaces) {
10597
- createDebug.save(namespaces);
10598
- createDebug.namespaces = namespaces;
10599
- createDebug.names = [];
10600
- createDebug.skips = [];
10601
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
10602
- for (const ns of split) {
10603
- if (ns[0] === "-") {
10604
- createDebug.skips.push(ns.slice(1));
10605
- } else {
10606
- createDebug.names.push(ns);
10607
- }
10608
- }
10609
- }
10610
- function matchesTemplate(search, template) {
10611
- let searchIndex = 0;
10612
- let templateIndex = 0;
10613
- let starIndex = -1;
10614
- let matchIndex = 0;
10615
- while (searchIndex < search.length) {
10616
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
10617
- if (template[templateIndex] === "*") {
10618
- starIndex = templateIndex;
10619
- matchIndex = searchIndex;
10620
- templateIndex++;
10621
- } else {
10622
- searchIndex++;
10623
- templateIndex++;
10624
- }
10625
- } else if (starIndex !== -1) {
10626
- templateIndex = starIndex + 1;
10627
- matchIndex++;
10628
- searchIndex = matchIndex;
10629
- } else {
10630
- return false;
10631
- }
10632
- }
10633
- while (templateIndex < template.length && template[templateIndex] === "*") {
10634
- templateIndex++;
10635
- }
10636
- return templateIndex === template.length;
10637
- }
10638
- function disable() {
10639
- const namespaces = [
10640
- ...createDebug.names,
10641
- ...createDebug.skips.map((namespace) => "-" + namespace)
10642
- ].join(",");
10643
- createDebug.enable("");
10644
- return namespaces;
10645
- }
10646
- function enabled(name) {
10647
- for (const skip of createDebug.skips) {
10648
- if (matchesTemplate(name, skip)) {
10649
- return false;
10650
- }
10651
- }
10652
- for (const ns of createDebug.names) {
10653
- if (matchesTemplate(name, ns)) {
10654
- return true;
10655
- }
10656
- }
10657
- return false;
10658
- }
10659
- function coerce2(val) {
10660
- if (val instanceof Error) {
10661
- return val.stack || val.message;
10662
- }
10663
- return val;
10664
- }
10665
- function destroy() {
10666
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
10667
- }
10668
- createDebug.enable(createDebug.load());
10669
- return createDebug;
10670
- }
10671
- module.exports = setup;
10672
- }
10673
- });
10674
-
10675
- // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
10676
- var require_browser = __commonJS({
10677
- "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
10678
- exports.formatArgs = formatArgs;
10679
- exports.save = save;
10680
- exports.load = load2;
10681
- exports.useColors = useColors;
10682
- exports.storage = localstorage();
10683
- exports.destroy = /* @__PURE__ */ (() => {
10684
- let warned = false;
10685
- return () => {
10686
- if (!warned) {
10687
- warned = true;
10688
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
10689
- }
10690
- };
10691
- })();
10692
- exports.colors = [
10693
- "#0000CC",
10694
- "#0000FF",
10695
- "#0033CC",
10696
- "#0033FF",
10697
- "#0066CC",
10698
- "#0066FF",
10699
- "#0099CC",
10700
- "#0099FF",
10701
- "#00CC00",
10702
- "#00CC33",
10703
- "#00CC66",
10704
- "#00CC99",
10705
- "#00CCCC",
10706
- "#00CCFF",
10707
- "#3300CC",
10708
- "#3300FF",
10709
- "#3333CC",
10710
- "#3333FF",
10711
- "#3366CC",
10712
- "#3366FF",
10713
- "#3399CC",
10714
- "#3399FF",
10715
- "#33CC00",
10716
- "#33CC33",
10717
- "#33CC66",
10718
- "#33CC99",
10719
- "#33CCCC",
10720
- "#33CCFF",
10721
- "#6600CC",
10722
- "#6600FF",
10723
- "#6633CC",
10724
- "#6633FF",
10725
- "#66CC00",
10726
- "#66CC33",
10727
- "#9900CC",
10728
- "#9900FF",
10729
- "#9933CC",
10730
- "#9933FF",
10731
- "#99CC00",
10732
- "#99CC33",
10733
- "#CC0000",
10734
- "#CC0033",
10735
- "#CC0066",
10736
- "#CC0099",
10737
- "#CC00CC",
10738
- "#CC00FF",
10739
- "#CC3300",
10740
- "#CC3333",
10741
- "#CC3366",
10742
- "#CC3399",
10743
- "#CC33CC",
10744
- "#CC33FF",
10745
- "#CC6600",
10746
- "#CC6633",
10747
- "#CC9900",
10748
- "#CC9933",
10749
- "#CCCC00",
10750
- "#CCCC33",
10751
- "#FF0000",
10752
- "#FF0033",
10753
- "#FF0066",
10754
- "#FF0099",
10755
- "#FF00CC",
10756
- "#FF00FF",
10757
- "#FF3300",
10758
- "#FF3333",
10759
- "#FF3366",
10760
- "#FF3399",
10761
- "#FF33CC",
10762
- "#FF33FF",
10763
- "#FF6600",
10764
- "#FF6633",
10765
- "#FF9900",
10766
- "#FF9933",
10767
- "#FFCC00",
10768
- "#FFCC33"
10769
- ];
10770
- function useColors() {
10771
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
10772
- return true;
10773
- }
10774
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
10775
- return false;
10776
- }
10777
- let m;
10778
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
10779
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
10780
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
10781
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
10782
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
10783
- }
10784
- function formatArgs(args) {
10785
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
10786
- if (!this.useColors) {
10787
- return;
10788
- }
10789
- const c = "color: " + this.color;
10790
- args.splice(1, 0, c, "color: inherit");
10791
- let index = 0;
10792
- let lastC = 0;
10793
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
10794
- if (match === "%%") {
10795
- return;
10796
- }
10797
- index++;
10798
- if (match === "%c") {
10799
- lastC = index;
10800
- }
10801
- });
10802
- args.splice(lastC, 0, c);
10803
- }
10804
- exports.log = console.debug || console.log || (() => {
10805
- });
10806
- function save(namespaces) {
10807
- try {
10808
- if (namespaces) {
10809
- exports.storage.setItem("debug", namespaces);
10810
- } else {
10811
- exports.storage.removeItem("debug");
10812
- }
10813
- } catch (error) {
10814
- }
10815
- }
10816
- function load2() {
10817
- let r;
10818
- try {
10819
- r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
10820
- } catch (error) {
10821
- }
10822
- if (!r && typeof process !== "undefined" && "env" in process) {
10823
- r = process.env.DEBUG;
10824
- }
10825
- return r;
10826
- }
10827
- function localstorage() {
10828
- try {
10829
- return localStorage;
10830
- } catch (error) {
10831
- }
10832
- }
10833
- module.exports = require_common()(exports);
10834
- var { formatters } = module.exports;
10835
- formatters.j = function(v) {
10836
- try {
10837
- return JSON.stringify(v);
10838
- } catch (error) {
10839
- return "[UnexpectedJSONParseError]: " + error.message;
10840
- }
10841
- };
10842
- }
10843
- });
10844
-
10845
- // node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
10846
- var require_has_flag = __commonJS({
10847
- "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
10848
- "use strict";
10849
- module.exports = (flag, argv = process.argv) => {
10850
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
10851
- const position = argv.indexOf(prefix + flag);
10852
- const terminatorPosition = argv.indexOf("--");
10853
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
10854
- };
10855
- }
10856
- });
10857
-
10858
- // node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
10859
- var require_supports_color = __commonJS({
10860
- "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
10861
- "use strict";
10862
- var os2 = __require("os");
10863
- var tty = __require("tty");
10864
- var hasFlag = require_has_flag();
10865
- var { env } = process;
10866
- var forceColor;
10867
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
10868
- forceColor = 0;
10869
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
10870
- forceColor = 1;
10871
- }
10872
- if ("FORCE_COLOR" in env) {
10873
- if (env.FORCE_COLOR === "true") {
10874
- forceColor = 1;
10875
- } else if (env.FORCE_COLOR === "false") {
10876
- forceColor = 0;
10877
- } else {
10878
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
10879
- }
10880
- }
10881
- function translateLevel(level) {
10882
- if (level === 0) {
10883
- return false;
10884
- }
10885
- return {
10886
- level,
10887
- hasBasic: true,
10888
- has256: level >= 2,
10889
- has16m: level >= 3
10890
- };
10891
- }
10892
- function supportsColor(haveStream, streamIsTTY) {
10893
- if (forceColor === 0) {
10894
- return 0;
10895
- }
10896
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
10897
- return 3;
10898
- }
10899
- if (hasFlag("color=256")) {
10900
- return 2;
10901
- }
10902
- if (haveStream && !streamIsTTY && forceColor === void 0) {
10903
- return 0;
10904
- }
10905
- const min = forceColor || 0;
10906
- if (env.TERM === "dumb") {
10907
- return min;
10908
- }
10909
- if (process.platform === "win32") {
10910
- const osRelease = os2.release().split(".");
10911
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
10912
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
10913
- }
10914
- return 1;
10915
- }
10916
- if ("CI" in env) {
10917
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
10918
- return 1;
10919
- }
10920
- return min;
10921
- }
10922
- if ("TEAMCITY_VERSION" in env) {
10923
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
10924
- }
10925
- if (env.COLORTERM === "truecolor") {
10926
- return 3;
10927
- }
10928
- if ("TERM_PROGRAM" in env) {
10929
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
10930
- switch (env.TERM_PROGRAM) {
10931
- case "iTerm.app":
10932
- return version >= 3 ? 3 : 2;
10933
- case "Apple_Terminal":
10934
- return 2;
10935
- }
10936
- }
10937
- if (/-256(color)?$/i.test(env.TERM)) {
10938
- return 2;
10939
- }
10940
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
10941
- return 1;
10942
- }
10943
- if ("COLORTERM" in env) {
10944
- return 1;
10945
- }
10946
- return min;
10947
- }
10948
- function getSupportLevel(stream) {
10949
- const level = supportsColor(stream, stream && stream.isTTY);
10950
- return translateLevel(level);
10951
- }
10952
- module.exports = {
10953
- supportsColor: getSupportLevel,
10954
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
10955
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
10956
- };
10957
- }
10958
- });
10959
-
10960
- // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
10961
- var require_node = __commonJS({
10962
- "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) {
10963
- var tty = __require("tty");
10964
- var util2 = __require("util");
10965
- exports.init = init;
10966
- exports.log = log;
10967
- exports.formatArgs = formatArgs;
10968
- exports.save = save;
10969
- exports.load = load2;
10970
- exports.useColors = useColors;
10971
- exports.destroy = util2.deprecate(
10972
- () => {
10973
- },
10974
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
10975
- );
10976
- exports.colors = [6, 2, 3, 4, 5, 1];
10977
- try {
10978
- const supportsColor = require_supports_color();
10979
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
10980
- exports.colors = [
10981
- 20,
10982
- 21,
10983
- 26,
10984
- 27,
10985
- 32,
10986
- 33,
10987
- 38,
10988
- 39,
10989
- 40,
10990
- 41,
10991
- 42,
10992
- 43,
10993
- 44,
10994
- 45,
10995
- 56,
10996
- 57,
10997
- 62,
10998
- 63,
10999
- 68,
11000
- 69,
11001
- 74,
11002
- 75,
11003
- 76,
11004
- 77,
11005
- 78,
11006
- 79,
11007
- 80,
11008
- 81,
11009
- 92,
11010
- 93,
11011
- 98,
11012
- 99,
11013
- 112,
11014
- 113,
11015
- 128,
11016
- 129,
11017
- 134,
11018
- 135,
11019
- 148,
11020
- 149,
11021
- 160,
11022
- 161,
11023
- 162,
11024
- 163,
11025
- 164,
11026
- 165,
11027
- 166,
11028
- 167,
11029
- 168,
11030
- 169,
11031
- 170,
11032
- 171,
11033
- 172,
11034
- 173,
11035
- 178,
11036
- 179,
11037
- 184,
11038
- 185,
11039
- 196,
11040
- 197,
11041
- 198,
11042
- 199,
11043
- 200,
11044
- 201,
11045
- 202,
11046
- 203,
11047
- 204,
11048
- 205,
11049
- 206,
11050
- 207,
11051
- 208,
11052
- 209,
11053
- 214,
11054
- 215,
11055
- 220,
11056
- 221
11057
- ];
11058
- }
11059
- } catch (error) {
11060
- }
11061
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
11062
- return /^debug_/i.test(key);
11063
- }).reduce((obj, key) => {
11064
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
11065
- return k.toUpperCase();
11066
- });
11067
- let val = process.env[key];
11068
- if (/^(yes|on|true|enabled)$/i.test(val)) {
11069
- val = true;
11070
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
11071
- val = false;
11072
- } else if (val === "null") {
11073
- val = null;
11074
- } else {
11075
- val = Number(val);
11076
- }
11077
- obj[prop] = val;
11078
- return obj;
11079
- }, {});
11080
- function useColors() {
11081
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
11082
- }
11083
- function formatArgs(args) {
11084
- const { namespace: name, useColors: useColors2 } = this;
11085
- if (useColors2) {
11086
- const c = this.color;
11087
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
11088
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
11089
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
11090
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
11091
- } else {
11092
- args[0] = getDate() + name + " " + args[0];
11093
- }
11094
- }
11095
- function getDate() {
11096
- if (exports.inspectOpts.hideDate) {
11097
- return "";
11098
- }
11099
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
11100
- }
11101
- function log(...args) {
11102
- return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
11103
- }
11104
- function save(namespaces) {
11105
- if (namespaces) {
11106
- process.env.DEBUG = namespaces;
11107
- } else {
11108
- delete process.env.DEBUG;
11109
- }
11110
- }
11111
- function load2() {
11112
- return process.env.DEBUG;
11113
- }
11114
- function init(debug) {
11115
- debug.inspectOpts = {};
11116
- const keys = Object.keys(exports.inspectOpts);
11117
- for (let i = 0; i < keys.length; i++) {
11118
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
11119
- }
11120
- }
11121
- module.exports = require_common()(exports);
11122
- var { formatters } = module.exports;
11123
- formatters.o = function(v) {
11124
- this.inspectOpts.colors = this.useColors;
11125
- return util2.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" ");
11126
- };
11127
- formatters.O = function(v) {
11128
- this.inspectOpts.colors = this.useColors;
11129
- return util2.inspect(v, this.inspectOpts);
11130
- };
11131
- }
11132
- });
11133
-
11134
- // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
11135
- var require_src = __commonJS({
11136
- "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports, module) {
11137
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
11138
- module.exports = require_browser();
11139
- } else {
11140
- module.exports = require_node();
11141
- }
11142
- }
11143
- });
11144
-
11145
10382
  // node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js
11146
10383
  var require_debug = __commonJS({
11147
10384
  "node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js"(exports, module) {
@@ -11149,7 +10386,7 @@ var require_debug = __commonJS({
11149
10386
  module.exports = function() {
11150
10387
  if (!debug) {
11151
10388
  try {
11152
- debug = require_src()("follow-redirects");
10389
+ debug = __require("debug")("follow-redirects");
11153
10390
  } catch (error) {
11154
10391
  }
11155
10392
  if (typeof debug !== "function") {
@@ -120723,6 +119960,7 @@ function derivePostIdempotencyKey(input) {
120723
119960
 
120724
119961
  // src/bridge/handler.ts
120725
119962
  var DEFAULT_CARDKIT_RESPONSE_SURFACE_TIMEOUT_MS = 20 * 60 * 1e3;
119963
+ var DEFAULT_CARDKIT_IDLE_TIMEOUT_MS = 3 * 60 * 1e3;
120726
119964
  function summarizeMentionPolicyRules(rules) {
120727
119965
  const counts = /* @__PURE__ */ new Map();
120728
119966
  for (const rule of rules) {
@@ -121453,10 +120691,8 @@ var BridgeHandler = class {
121453
120691
  const backend = this.deps.botConfig?.backend ?? "claude";
121454
120692
  const permissionMode = this.deps.permissionMode ?? "bypassPermissions";
121455
120693
  const baseTimeoutMs = this.deps.subprocessTimeoutMs ?? 60 * 60 * 1e3;
121456
- const timeoutMs = cardKitProgress ? Math.min(
121457
- baseTimeoutMs,
121458
- this.deps.responseSurfaceTimeoutMs ?? DEFAULT_CARDKIT_RESPONSE_SURFACE_TIMEOUT_MS
121459
- ) : baseTimeoutMs;
120694
+ const timeoutMs = baseTimeoutMs;
120695
+ const idleTimeoutMs = this.deps.responseSurfaceIdleTimeoutMs ?? DEFAULT_CARDKIT_IDLE_TIMEOUT_MS;
121460
120696
  const runnerStartedAt = Date.now();
121461
120697
  const handle = createRunner(backend).run({
121462
120698
  prompt,
@@ -121468,6 +120704,24 @@ var BridgeHandler = class {
121468
120704
  botGitIdentity: this.deps.botConfig?.git_identity,
121469
120705
  gitlabToken: this.deps.gitlabToken
121470
120706
  });
120707
+ let lastActivityAt = Date.now();
120708
+ let interruptedByIdle = false;
120709
+ let idleWatchdog;
120710
+ if (cardKitProgress) {
120711
+ const cadenceMs = Math.max(50, Math.min(Math.floor(idleTimeoutMs / 4), 15e3));
120712
+ idleWatchdog = setInterval(() => {
120713
+ if (Date.now() - lastActivityAt >= idleTimeoutMs) {
120714
+ interruptedByIdle = true;
120715
+ if (idleWatchdog) clearInterval(idleWatchdog);
120716
+ idleWatchdog = void 0;
120717
+ try {
120718
+ handle.kill();
120719
+ } catch {
120720
+ }
120721
+ }
120722
+ }, cadenceMs);
120723
+ idleWatchdog.unref?.();
120724
+ }
121471
120725
  if (isAgentWorkspace && handle.pid != null) {
121472
120726
  const sessionPidFile = path9.join(worktreePath, ".larkway", "runner.pid");
121473
120727
  void fs6.mkdir(path9.dirname(sessionPidFile), { recursive: true }).then(
@@ -121479,6 +120733,7 @@ var BridgeHandler = class {
121479
120733
  let trustedAnswerText = "";
121480
120734
  try {
121481
120735
  for await (const ev of handle.events) {
120736
+ lastActivityAt = Date.now();
121482
120737
  if (cardKitProgress) cardKitProgress.handle(ev);
121483
120738
  else if (card) card.handle(ev);
121484
120739
  if (ev.type === "system_init") {
@@ -121491,7 +120746,11 @@ var BridgeHandler = class {
121491
120746
  }
121492
120747
  }
121493
120748
  const result = await handle.done;
121494
- const cardKitTurnTimedOut = cardKitProgress != null && result.exitCode !== 0 && Date.now() - runnerStartedAt >= timeoutMs;
120749
+ if (idleWatchdog) {
120750
+ clearInterval(idleWatchdog);
120751
+ idleWatchdog = void 0;
120752
+ }
120753
+ const cardKitTurnTimedOut = cardKitProgress != null && interruptedByIdle;
121495
120754
  const reportedStateRead = await readStateFileDetailed(worktreePath);
121496
120755
  const rawReportedState = reportedStateRead.state;
121497
120756
  const reportedState = rawReportedState?.updated_at != null && rawReportedState.updated_at !== preRunUpdatedAt ? rawReportedState : null;
@@ -121546,10 +120805,10 @@ var BridgeHandler = class {
121546
120805
  success = true;
121547
120806
  } else if (cardKitTimeoutFailure) {
121548
120807
  success = false;
121549
- failureReason = `agent turn timed out after ${timeoutMs}ms; CardKit running card was finalized as interrupted`;
120808
+ failureReason = `agent turn idle for ${idleTimeoutMs}ms with no activity (treated as stuck); run interrupted`;
121550
120809
  await recordEvent({
121551
120810
  status: "running",
121552
- appendPath: "Agent \u8D85\u65F6",
120811
+ appendPath: "Agent \u5361\u6B7B\u4E2D\u65AD",
121553
120812
  reason: failureReason
121554
120813
  });
121555
120814
  } else if (result.exitCode === 0) {
@@ -121564,7 +120823,7 @@ var BridgeHandler = class {
121564
120823
  });
121565
120824
  }
121566
120825
  const fallbackAnswer = trustedAnswerText.trim() || cardKitProgress?.answerText.trim() || "";
121567
- const cardBody = cardKitTimeoutFailure ? "\u26A0\uFE0F \u672C\u8F6E\u5904\u7406\u8D85\u65F6\uFF0C\u5DF2\u4E2D\u65AD\u3002\u8BF7\u518D @ \u6211\u4E00\u6B21\u91CD\u8BD5\u3002" : reportedState?.last_message ?? (fallbackAnswer ? fallbackAnswer : "\u26A0\uFE0F \u672C\u8F6E\u6CA1\u6709\u62FF\u5230 agent \u7684\u65B0\u56DE\u590D(\u53EF\u80FD\u88AB\u4E2D\u65AD\u6216\u672A\u66F4\u65B0\u72B6\u6001),\u518D @ \u6211\u4E00\u6B21\u91CD\u8BD5\u3002");
120826
+ const cardBody = cardKitTimeoutFailure ? "\u26A0\uFE0F \u672C\u8F6E\u88AB\u4E2D\u65AD\uFF08\u957F\u65F6\u95F4\u65E0\u6D3B\u6027\uFF0C\u5224\u5B9A\u5361\u6B7B\uFF09\uFF0C\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002" : reportedState?.last_message ?? (fallbackAnswer ? fallbackAnswer : "\u26A0\uFE0F \u672C\u8F6E\u6CA1\u6709\u62FF\u5230 agent \u7684\u65B0\u56DE\u590D(\u53EF\u80FD\u88AB\u4E2D\u65AD\u6216\u672A\u66F4\u65B0\u72B6\u6001),\u518D @ \u6211\u4E00\u6B21\u91CD\u8BD5\u3002");
121568
120827
  const noReportThisTurn = reportedState === null;
121569
120828
  const neutralTitle = noReportThisTurn && success && !failureReason ? "\u{1F4AC} \u5DF2\u56DE\u590D" : void 0;
121570
120829
  const baseCardPayload = {
@@ -125423,17 +124682,18 @@ function selectOrphanCards(entries, opts) {
125423
124682
  }
125424
124683
  return out;
125425
124684
  }
124685
+ var INTERRUPTED_TURN_TEXT = "\u26A0\uFE0F \u672C\u8F6E\u5728\u5904\u7406\u4E2D\u88AB bridge \u91CD\u542F\u4E2D\u65AD\uFF0C\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5(\u91CD\u65B0\u53D1\u8D77\u672C\u8F6E)\u3002";
125426
124686
  function mapFinalizeArgs(state, success, stateFresh = true) {
125427
124687
  if (!stateFresh) {
125428
124688
  return {
125429
- finalText: "\u26A0\uFE0F \u672C\u8F6E\u5728\u5904\u7406\u4E2D\u88AB bridge \u91CD\u542F\u4E2D\u65AD\uFF0C\u672A\u62FF\u5230 agent \u7684\u65B0\u56DE\u590D\u3002\u8BF7\u518D @ \u6211\u4E00\u6B21\u7EE7\u7EED\u3002",
124689
+ finalText: INTERRUPTED_TURN_TEXT,
125430
124690
  success: false,
125431
124691
  failureReason: "bridge \u91CD\u542F\u540E\u53D1\u73B0\u65E7 state.json \u65E9\u4E8E\u672C\u8F6E\u5361\u7247\uFF0C\u5DF2\u963B\u6B62\u65E7\u56DE\u590D\u8986\u76D6\u65B0\u95EE\u9898",
125432
124692
  titleOverride: "\u26A0\uFE0F \u672C\u8F6E\u88AB\u4E2D\u65AD",
125433
124693
  colorOverride: "failure"
125434
124694
  };
125435
124695
  }
125436
- const finalText = state.last_message ?? "\u26A0\uFE0F \u672C\u8F6E\u5728\u5904\u7406\u4E2D\u88AB\u4E2D\u65AD(bridge \u91CD\u542F),\u72B6\u6001\u5DF2\u636E state.json \u6536\u5C3E\u3002\u518D @ \u6211\u4E00\u6B21\u53EF\u7EE7\u7EED\u3002";
124696
+ const finalText = state.last_message ?? INTERRUPTED_TURN_TEXT;
125437
124697
  const failureReason = success ? void 0 : state.error ?? "bridge \u91CD\u542F\u65F6\u8BE5\u8F6E\u672A\u6B63\u5E38\u6536\u5C3E(reconcile \u515C\u5E95)";
125438
124698
  return {
125439
124699
  finalText,
@@ -125450,7 +124710,7 @@ function mapFinalizeArgs(state, success, stateFresh = true) {
125450
124710
  function mapCardKitFinalizeArgs(state, success, stateFresh = true) {
125451
124711
  const args = mapFinalizeArgs(state, success, stateFresh);
125452
124712
  return {
125453
- finalText: args.finalText ?? "\u26A0\uFE0F \u672C\u8F6E\u5728\u5904\u7406\u4E2D\u88AB bridge \u91CD\u542F\u4E2D\u65AD\uFF0C\u672A\u62FF\u5230 agent \u7684\u65B0\u56DE\u590D\u3002",
124713
+ finalText: args.finalText ?? INTERRUPTED_TURN_TEXT,
125454
124714
  ...args.titleOverride !== void 0 ? { title: args.titleOverride } : {},
125455
124715
  ...args.choices !== void 0 ? { choices: args.choices } : {},
125456
124716
  ...args.choicePrompt !== void 0 ? { choicePrompt: args.choicePrompt } : {},