larkway 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/cli/index.js +3 -766
- package/dist/main.js +159 -785
- package/package.json +1 -1
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 =
|
|
10389
|
+
debug = __require("debug")("follow-redirects");
|
|
11153
10390
|
} catch (error) {
|
|
11154
10391
|
}
|
|
11155
10392
|
if (typeof debug !== "function") {
|
|
@@ -116989,6 +116226,7 @@ function summarizeInput(input) {
|
|
|
116989
116226
|
}
|
|
116990
116227
|
return s.length > 60 ? s.slice(0, 57) + "\u2026" : s;
|
|
116991
116228
|
}
|
|
116229
|
+
var MAX_CARD_ELEMENTS = 50;
|
|
116992
116230
|
var CHOICE_MARKERS = ["A", "B", "C", "D", "E"];
|
|
116993
116231
|
function choiceMarker(i) {
|
|
116994
116232
|
return CHOICE_MARKERS[i] ?? String(i + 1);
|
|
@@ -117014,6 +116252,65 @@ function buildChoiceRow(choices) {
|
|
|
117014
116252
|
function buildChoiceLegend(choices) {
|
|
117015
116253
|
return choices.map((c, i) => `**${choiceMarker(i)}.** ${c.label}`).join("\n");
|
|
117016
116254
|
}
|
|
116255
|
+
function plainText(content) {
|
|
116256
|
+
return { tag: "plain_text", content };
|
|
116257
|
+
}
|
|
116258
|
+
function buildImageElement(block) {
|
|
116259
|
+
const element = {
|
|
116260
|
+
tag: "img",
|
|
116261
|
+
img_key: block.img_key,
|
|
116262
|
+
alt: plainText(block.alt || "\u56FE\u7247\u9884\u89C8"),
|
|
116263
|
+
scale_type: block.mode,
|
|
116264
|
+
preview: block.preview
|
|
116265
|
+
};
|
|
116266
|
+
if (block.title) {
|
|
116267
|
+
element["title"] = plainText(block.title);
|
|
116268
|
+
}
|
|
116269
|
+
return element;
|
|
116270
|
+
}
|
|
116271
|
+
function canPushElement(elements, reservedTail = 0) {
|
|
116272
|
+
return elements.length + reservedTail < MAX_CARD_ELEMENTS;
|
|
116273
|
+
}
|
|
116274
|
+
function pushElement(elements, element, reservedTail = 0) {
|
|
116275
|
+
if (!canPushElement(elements, reservedTail)) return false;
|
|
116276
|
+
elements.push(element);
|
|
116277
|
+
return true;
|
|
116278
|
+
}
|
|
116279
|
+
function pushMarkdownElements(elements, text, reservedTail = 0) {
|
|
116280
|
+
const chunks = chunkMarkdown(text);
|
|
116281
|
+
let truncated = false;
|
|
116282
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
116283
|
+
const content = i === 0 ? chunks[i] : `(\u7EED ${i + 1})
|
|
116284
|
+
${chunks[i]}`;
|
|
116285
|
+
if (!pushElement(elements, { tag: "markdown", content }, reservedTail)) {
|
|
116286
|
+
truncated = true;
|
|
116287
|
+
break;
|
|
116288
|
+
}
|
|
116289
|
+
}
|
|
116290
|
+
if (truncated && canPushElement(elements, reservedTail)) {
|
|
116291
|
+
pushElement(elements, {
|
|
116292
|
+
tag: "markdown",
|
|
116293
|
+
content: "_\u5185\u5BB9\u8FC7\u957F,\u540E\u7EED\u90E8\u5206\u5DF2\u7701\u7565_"
|
|
116294
|
+
}, reservedTail);
|
|
116295
|
+
}
|
|
116296
|
+
}
|
|
116297
|
+
function buildContentBlockElements(blocks, opts = {}) {
|
|
116298
|
+
const elements = [];
|
|
116299
|
+
const mentionPrefix = atMentionMarkdown(opts.mentionOpenId);
|
|
116300
|
+
const reservedTail = opts.reservedTail ?? 0;
|
|
116301
|
+
if (mentionPrefix) {
|
|
116302
|
+
pushMarkdownElements(elements, mentionPrefix, reservedTail);
|
|
116303
|
+
}
|
|
116304
|
+
for (const block of blocks) {
|
|
116305
|
+
if (block.type === "markdown") {
|
|
116306
|
+
const clean = stripLeakedToolMarkup(block.content);
|
|
116307
|
+
if (clean) pushMarkdownElements(elements, clean, reservedTail);
|
|
116308
|
+
continue;
|
|
116309
|
+
}
|
|
116310
|
+
pushElement(elements, buildImageElement(block), reservedTail);
|
|
116311
|
+
}
|
|
116312
|
+
return elements;
|
|
116313
|
+
}
|
|
117017
116314
|
function stripLeakedToolMarkup(text) {
|
|
117018
116315
|
return text.replace(/<function_calls>[\s\S]*?<\/function_calls>/gi, "").replace(/<invoke\b[^>]*>[\s\S]*?<\/invoke>/gi, "").replace(/<(?:function_calls|invoke|parameter)\b[\s\S]*$/i, "").replace(/<\/?(?:function_calls|invoke|parameter)\b[^>]*>/gi, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
117019
116316
|
}
|
|
@@ -117046,6 +116343,11 @@ function chunkMarkdown(text, maxLen = 2800) {
|
|
|
117046
116343
|
}
|
|
117047
116344
|
function buildCardJson(opts) {
|
|
117048
116345
|
const elements = [];
|
|
116346
|
+
const hasContentBlocks = !!opts.contentBlocks?.length;
|
|
116347
|
+
const failureReserve = opts.status === "failure" && opts.failureReason ? 2 : 0;
|
|
116348
|
+
const choicesReserve = opts.choices && opts.choices.length ? 4 : 0;
|
|
116349
|
+
const legacyImagesReserve = !hasContentBlocks && opts.imageBlocks?.length ? opts.imageBlocks.length + 1 : 0;
|
|
116350
|
+
const tailReserve = failureReserve + choicesReserve + legacyImagesReserve;
|
|
117049
116351
|
const TOOL_LINES_CAP = 1;
|
|
117050
116352
|
if (opts.showToolSummary && opts.toolLines.length > 0 && !opts.hideTools && opts.status !== "success") {
|
|
117051
116353
|
const total = opts.toolLines.length;
|
|
@@ -117053,44 +116355,52 @@ function buildCardJson(opts) {
|
|
|
117053
116355
|
const omitted = total - recent.length;
|
|
117054
116356
|
const content = omitted > 0 ? `_(\u7565\u524D ${omitted} \u6761\u5DE5\u5177\u8C03\u7528)_
|
|
117055
116357
|
${recent.join("\n")}` : recent.join("\n");
|
|
117056
|
-
elements
|
|
116358
|
+
pushElement(elements, {
|
|
117057
116359
|
tag: "markdown",
|
|
117058
116360
|
content
|
|
117059
116361
|
});
|
|
117060
|
-
elements
|
|
116362
|
+
pushElement(elements, { tag: "hr" });
|
|
117061
116363
|
}
|
|
117062
116364
|
const mentionPrefix = atMentionMarkdown(opts.mentionOpenId);
|
|
117063
116365
|
const cleanBody = opts.bodyText ? stripLeakedToolMarkup(opts.bodyText) : "";
|
|
117064
116366
|
const bodyWithMention = [mentionPrefix, cleanBody].filter(Boolean).join("\n\n");
|
|
117065
|
-
if (
|
|
117066
|
-
|
|
117067
|
-
|
|
117068
|
-
|
|
117069
|
-
|
|
117070
|
-
|
|
117071
|
-
|
|
117072
|
-
|
|
117073
|
-
|
|
116367
|
+
if (hasContentBlocks) {
|
|
116368
|
+
elements.push(
|
|
116369
|
+
...buildContentBlockElements(opts.contentBlocks ?? [], {
|
|
116370
|
+
mentionOpenId: opts.mentionOpenId,
|
|
116371
|
+
reservedTail: tailReserve
|
|
116372
|
+
})
|
|
116373
|
+
);
|
|
116374
|
+
} else if (bodyWithMention) {
|
|
116375
|
+
pushMarkdownElements(elements, bodyWithMention, tailReserve);
|
|
117074
116376
|
} else if (opts.status === "thinking") {
|
|
117075
|
-
elements
|
|
116377
|
+
pushElement(elements, {
|
|
117076
116378
|
tag: "markdown",
|
|
117077
116379
|
content: "\u{1F914} \u601D\u8003\u4E2D\u2026"
|
|
117078
116380
|
});
|
|
117079
116381
|
}
|
|
117080
116382
|
if (opts.status === "failure" && opts.failureReason) {
|
|
117081
|
-
elements
|
|
117082
|
-
elements
|
|
116383
|
+
pushElement(elements, { tag: "hr" }, choicesReserve);
|
|
116384
|
+
pushElement(elements, {
|
|
117083
116385
|
tag: "markdown",
|
|
117084
116386
|
content: `\u26A0\uFE0F **\u9519\u8BEF**: ${opts.failureReason}`
|
|
117085
|
-
});
|
|
116387
|
+
}, choicesReserve);
|
|
116388
|
+
}
|
|
116389
|
+
if (!hasContentBlocks && opts.imageBlocks && opts.imageBlocks.length) {
|
|
116390
|
+
if (bodyWithMention || opts.status === "failure" && opts.failureReason) {
|
|
116391
|
+
pushElement(elements, { tag: "hr" }, choicesReserve);
|
|
116392
|
+
}
|
|
116393
|
+
for (const block of opts.imageBlocks) {
|
|
116394
|
+
pushElement(elements, buildImageElement(block), choicesReserve);
|
|
116395
|
+
}
|
|
117086
116396
|
}
|
|
117087
116397
|
if (opts.choices && opts.choices.length) {
|
|
117088
|
-
elements
|
|
116398
|
+
pushElement(elements, { tag: "hr" });
|
|
117089
116399
|
if (opts.choicePrompt) {
|
|
117090
|
-
elements
|
|
116400
|
+
pushElement(elements, { tag: "markdown", content: opts.choicePrompt });
|
|
117091
116401
|
}
|
|
117092
|
-
elements
|
|
117093
|
-
elements
|
|
116402
|
+
pushElement(elements, { tag: "markdown", content: buildChoiceLegend(opts.choices) });
|
|
116403
|
+
pushElement(elements, buildChoiceRow(opts.choices));
|
|
117094
116404
|
}
|
|
117095
116405
|
const headerColor = opts.status === "thinking" || opts.status === "streaming" ? "blue" : opts.status === "success" ? "green" : "red";
|
|
117096
116406
|
const statusText = opts.status === "thinking" ? "\u23F3 \u5904\u7406\u4E2D" : opts.status === "streaming" ? "\u{1F527} \u5904\u7406\u4E2D" : opts.status === "success" ? "\u2705 \u5B8C\u6210" : "\u274C \u51FA\u9519\u4E86";
|
|
@@ -117165,6 +116475,8 @@ var CardHandleImpl = class {
|
|
|
117165
116475
|
// V2 dynamic-choice buttons — agent-declared, only on finalize.
|
|
117166
116476
|
choices: opts.choices,
|
|
117167
116477
|
choicePrompt: opts.choicePrompt,
|
|
116478
|
+
imageBlocks: opts.imageBlocks,
|
|
116479
|
+
contentBlocks: opts.contentBlocks,
|
|
117168
116480
|
titleOverride: opts.titleOverride,
|
|
117169
116481
|
// Hide tool-use summary on every finalize — the agent finished, so the
|
|
117170
116482
|
// Feishu card should present the result/error only. Diagnostics remain in
|
|
@@ -117877,6 +117189,9 @@ function renderStateContract(stateFilePath) {
|
|
|
117877
117189
|
"- error: \u5931\u8D25\u539F\u56E0(\u642D\u914D status=failed)",
|
|
117878
117190
|
"- card_title: \u5361\u7247\u6807\u9898\u8986\u76D6(\u53EF\u9009)",
|
|
117879
117191
|
"- card_color: \u5361\u7247\u914D\u8272(\u53EF\u9009,success/failure/neutral,\u4E5F\u53EF\u76F4\u63A5\u5199 green/red/grey)",
|
|
117192
|
+
"- image_blocks: \u53EF\u9009\u56FE\u7247\u9884\u89C8\u5757\u6570\u7EC4,\u6700\u591A 4 \u4E2A\u3002\u6BCF\u9879 `{img_key, alt?, title?, mode?, preview?}`; `img_key` \u5FC5\u987B\u662F\u5DF2\u4E0A\u4F20/\u53EF\u7528\u4E8E\u5361\u7247\u7684 Feishu \u56FE\u7247 key,`alt` \u7701\u7565\u65F6 bridge \u9ED8\u8BA4\u201C\u56FE\u7247\u9884\u89C8\u201D,`mode` \u53EA\u5141\u8BB8 `crop_center`/`fit_horizontal` \u5E76\u6620\u5C04\u5230 Card JSON 2.0 `scale_type`,`preview` \u9ED8\u8BA4 true\u3002bridge \u4E0D\u8D1F\u8D23\u4E0B\u8F7D/\u4E0A\u4F20/\u9009\u62E9\u56FE\u7247;\u8FD9\u4E9B\u7531\u4F60\u7528 lark-cli \u7B49\u5DE5\u5177\u5148\u5B8C\u6210\u3002",
|
|
117193
|
+
'- content_blocks: \u53EF\u9009\u6709\u5E8F\u6B63\u6587\u5757\u6570\u7EC4,\u6700\u591A 12 \u4E2A block\u3001\u6700\u591A 4 \u4E2A image block\u3002\u53EA\u652F\u6301\u7A84 union:`{type:"markdown", content}` \u548C `{type:"image", img_key, alt?, title?, mode?, preview?}`;\u4E0D\u652F\u6301 raw card JSON\u3002\u7528\u4E8E\u6B63\u6587\u4E0E\u56FE\u7247\u4EA4\u9519\u6392\u7248,\u4F8B\u5982 markdown -> image -> markdown -> image\u3002\u82E5 `content_blocks` \u975E\u7A7A,bridge \u4EE5\u5B83\u4F5C\u4E3A\u4E3B\u6B63\u6587\u5E76\u5FFD\u7565 `last_message` + `image_blocks` \u7684\u6B63\u6587\u6E32\u67D3,\u907F\u514D\u91CD\u590D;\u82E5\u7701\u7565\u5219\u4FDD\u6301\u65E7 `last_message` + `image_blocks` \u884C\u4E3A\u3002',
|
|
117194
|
+
"- scheduled reply / daily social ops review card \u7B49\u9700\u8981\u201C\u5E73\u53F0\u6B63\u6587 + \u5339\u914D\u56FE\u7247\u201D\u540C\u6BB5\u76F8\u90BB\u5C55\u793A\u7684\u573A\u666F,\u5E94\u5148\u53D6\u5F97\u5404\u56FE\u7247 `img_key`,\u518D\u5199 `content_blocks` \u4E3A `\u5E73\u53F0 markdown -> \u5BF9\u5E94 image -> \u4E0B\u4E2A\u5E73\u53F0 markdown -> \u5BF9\u5E94 image`;\u4E0D\u8981\u7528\u5355\u72EC\u8BDD\u9898\u56FE\u7247\u6D88\u606F\u6216\u5C3E\u90E8 `image_blocks` \u4EE3\u66FF\u9A8C\u6536\u9762\u3002",
|
|
117880
117195
|
"- dev_url / mr_url / \u5176\u4F59\u4E1A\u52A1\u5B57\u6BB5:\u81EA\u7531\u5199\u5165,bridge \u4E0D\u611F\u77E5\u5176\u4E1A\u52A1\u542B\u4E49;\u8981\u8BA9\u8FD0\u8425\u770B\u5230,\u8BF7\u5199\u8FDB last_message",
|
|
117881
117196
|
"- updated_at: ISO 8601 timestamp",
|
|
117882
117197
|
"",
|
|
@@ -117886,7 +117201,7 @@ function renderStateContract(stateFilePath) {
|
|
|
117886
117201
|
"\u6302\u7740\u4E0D\u9000\u51FA = \u5361\u7247\u6C38\u8FDC\u5361\u5728\u300C\u5904\u7406\u4E2D\u300D)\u3002",
|
|
117887
117202
|
"",
|
|
117888
117203
|
"\u5361\u7247\u5C55\u793A\u539F\u5219:",
|
|
117889
|
-
"- bridge \u53EF\u80FD\u5728\u8FD0\u884C\u4E2D\u5C55\u793A\u5DE5\u5177\u6458\u8981,\u8FD9\u662F\u901A\u7528\u8FDB\u5EA6\u4FE1\u53F7;\u6700\u7EC8\u6210\u529F\u5361\u7247\u4EE5\u4F60\u7684 last_message \u4E3A\u4E3B\u3002",
|
|
117204
|
+
"- bridge \u53EF\u80FD\u5728\u8FD0\u884C\u4E2D\u5C55\u793A\u5DE5\u5177\u6458\u8981,\u8FD9\u662F\u901A\u7528\u8FDB\u5EA6\u4FE1\u53F7;\u6700\u7EC8\u6210\u529F\u5361\u7247\u4EE5\u4F60\u7684 `content_blocks`(\u82E5\u975E\u7A7A)\u6216 `last_message` \u4E3A\u4E3B\u3002",
|
|
117890
117205
|
"- \u4E0D\u8981\u4F9D\u8D56 bridge \u4ECE\u8F93\u51FA\u91CC\u89E3\u6790\u4E1A\u52A1\u9636\u6BB5\u3001MR\u3001\u9884\u89C8\u5730\u5740\u6216\u4E0B\u4E00\u6B65\u52A8\u4F5C;\u9700\u8981\u5C55\u793A\u7684\u5185\u5BB9\u4F60\u81EA\u5DF1\u5199\u8FDB last_message\u3002",
|
|
117891
117206
|
"- \u4E0D\u8981\u6C42\u56FA\u5B9A\u683C\u5F0F\u3002\u6839\u636E\u4EFB\u52A1\u9009\u62E9\u6700\u6E05\u695A\u7684\u8868\u8FBE:\u77ED\u7ED3\u8BBA\u3001\u5206\u70B9\u3001\u8868\u683C\u3001\u94FE\u63A5\u3001\u4E0B\u4E00\u6B65\u95EE\u9898\u90FD\u53EF\u4EE5\u3002",
|
|
117892
117207
|
"- \u5982\u679C\u672C\u8F6E\u6D89\u53CA repo / \u4EE3\u7801 / \u6587\u6863\u4FEE\u6539,last_message \u5E94\u5305\u542B\u8DB3\u591F\u8BA9\u8FD0\u8425\u9A8C\u6536\u7684\u8BC1\u636E,\u4F8B\u5982\u4F60\u5B9E\u9645\u4F7F\u7528\u7684 workspace/repo\u3001\u5173\u952E diff \u6216\u94FE\u63A5\u3001\u8FD0\u884C\u8FC7\u7684\u6D4B\u8BD5/\u68C0\u67E5\u547D\u4EE4\u548C\u7ED3\u679C\u3002\u5177\u4F53\u8BC1\u636E\u7531\u4EFB\u52A1\u51B3\u5B9A;dogfood E2E \u7684\u4E25\u683C\u6E05\u5355\u53EA\u5728 dogfood guide \u4E2D\u8981\u6C42\u3002",
|
|
@@ -117904,6 +117219,7 @@ function renderStateContract(stateFilePath) {
|
|
|
117904
117219
|
" \u6240\u4EE5\u4F60**\u4E0D\u8981\u5728 `last_message` \u91CC\u518D\u624B\u52A8\u5217\u4E00\u904D\u9009\u9879**(\u4F1A\u91CD\u590D);\u6B63\u6587\u53EA\u5199\u95EE\u9898\u80CC\u666F,\u9009\u9879\u4EA4\u7ED9 bridge \u6E32\u67D3",
|
|
117905
117220
|
"- \u628A `value` \u5199\u6210\u4E00\u53E5\u81EA\u63CF\u8FF0\u7684\u5B8C\u6574\u6307\u4EE4(\u5B83\u5C31\u662F\u4F60\u5C06\u6536\u5230\u7684\u4EFB\u52A1\u6587\u672C),\u4E0D\u8981\u5199\u6210 `optA` \u8FD9\u79CD\u4EE3\u53F7",
|
|
117906
117221
|
"- \u6CA1\u6709\u9700\u8981\u9009\u7684\u5C31**\u7701\u7565** `choices`(\u5361\u7247\u4FDD\u6301\u5E72\u51C0,\u65E0\u6309\u94AE)",
|
|
117222
|
+
"- \u82E5\u540C\u65F6\u5199 `content_blocks` \u548C `choices`,bridge \u59CB\u7EC8\u628A choices \u6E32\u67D3\u5728\u6B63\u6587\u5185\u5BB9\u4E4B\u540E;\u82E5 `status=failed`,error \u4ECD\u4F1A\u663E\u793A,\u4E0D\u4F1A\u88AB content_blocks \u8986\u76D6\u3002",
|
|
117907
117223
|
"",
|
|
117908
117224
|
"\u5199 status=ready \u524D\u5FC5\u987B\u81EA\u5DF1\u7528\u4EE3\u7801\u9A8C\u8FC7(dev server \u7528 curl -I \u770B 200;\u6587\u4EF6 ls/test -f;\u547D\u4EE4\u770B exit code)\u3002bridge \u4E0D\u518D\u66FF\u4F60 probe,\u9A8C\u8BC1\u5B8C\u5168\u662F\u4F60\u7684\u8D23\u4EFB\u3002",
|
|
117909
117225
|
"\u7B2C\u4E00\u4E2A\u5DE5\u5177\u5931\u8D25\u7ACB\u523B\u5199 status=failed + error,\u522B\u88F8\u5954\u649E\u591A\u4E2A\u5DE5\u5177\u5237\u6210\u8D85\u65F6;\u9700\u6C42\u6709\u6B67\u4E49\u5148\u505C\u4E0B\u5199 status=in_progress + last_message='\u7B49X\u786E\u8BA4',\u522B\u778E\u731C\u5C31\u5F00\u505A\u4E0D\u53EF\u9006\u52A8\u4F5C\u3002",
|
|
@@ -118681,6 +117997,48 @@ var optionalUrl = external_exports.preprocess(
|
|
|
118681
117997
|
(v) => typeof v === "string" && v.trim() === "" ? void 0 : v,
|
|
118682
117998
|
external_exports.string().optional()
|
|
118683
117999
|
);
|
|
118000
|
+
var imageAlt = external_exports.preprocess(
|
|
118001
|
+
(v) => typeof v === "string" && v.trim() === "" ? void 0 : v,
|
|
118002
|
+
external_exports.string().trim().min(1).max(200).default("\u56FE\u7247\u9884\u89C8")
|
|
118003
|
+
);
|
|
118004
|
+
var imageTitle = external_exports.preprocess(
|
|
118005
|
+
(v) => typeof v === "string" && v.trim() === "" ? void 0 : v,
|
|
118006
|
+
external_exports.string().trim().min(1).max(200).optional()
|
|
118007
|
+
);
|
|
118008
|
+
var ImageBlockSchema = external_exports.object({
|
|
118009
|
+
img_key: external_exports.string().trim().min(1).max(256),
|
|
118010
|
+
alt: imageAlt,
|
|
118011
|
+
title: imageTitle,
|
|
118012
|
+
/**
|
|
118013
|
+
* Agent-facing mode maps directly to Feishu Card JSON 2.0 `scale_type`.
|
|
118014
|
+
* Keep the enum narrow until we have live-card evidence for more modes.
|
|
118015
|
+
*/
|
|
118016
|
+
mode: external_exports.enum(["crop_center", "fit_horizontal"]).default("fit_horizontal"),
|
|
118017
|
+
preview: external_exports.boolean().default(true)
|
|
118018
|
+
});
|
|
118019
|
+
var ContentMarkdownBlockSchema = external_exports.object({
|
|
118020
|
+
type: external_exports.literal("markdown"),
|
|
118021
|
+
content: external_exports.string().trim().min(1).max(2e4)
|
|
118022
|
+
});
|
|
118023
|
+
var ContentImageBlockSchema = ImageBlockSchema.extend({
|
|
118024
|
+
type: external_exports.literal("image")
|
|
118025
|
+
});
|
|
118026
|
+
var ContentBlockSchema = external_exports.discriminatedUnion("type", [
|
|
118027
|
+
ContentMarkdownBlockSchema,
|
|
118028
|
+
ContentImageBlockSchema
|
|
118029
|
+
]);
|
|
118030
|
+
var ContentBlocksSchema = external_exports.array(ContentBlockSchema).max(12).superRefine((blocks, ctx) => {
|
|
118031
|
+
const imageCount = blocks.filter((b) => b.type === "image").length;
|
|
118032
|
+
if (imageCount > 4) {
|
|
118033
|
+
ctx.addIssue({
|
|
118034
|
+
code: external_exports.ZodIssueCode.too_big,
|
|
118035
|
+
type: "array",
|
|
118036
|
+
maximum: 4,
|
|
118037
|
+
inclusive: true,
|
|
118038
|
+
message: "content_blocks supports at most 4 image blocks"
|
|
118039
|
+
});
|
|
118040
|
+
}
|
|
118041
|
+
});
|
|
118684
118042
|
var StateFileSchema = external_exports.object({
|
|
118685
118043
|
// Thin channel: the bridge only validates `status`. Any other key the bot
|
|
118686
118044
|
// writes (incl. a legacy `stage`) is a business field — z.object STRIPS
|
|
@@ -118757,6 +118115,20 @@ var StateFileSchema = external_exports.object({
|
|
|
118757
118115
|
* V1 bots never write this field → V1 cards are byte-for-byte unchanged.
|
|
118758
118116
|
*/
|
|
118759
118117
|
choices: external_exports.array(external_exports.object({ label: external_exports.string().min(1), value: external_exports.string().min(1) })).max(5).optional(),
|
|
118118
|
+
/**
|
|
118119
|
+
* V2 image blocks (thin-channel). Agents upload or otherwise obtain `img_key`
|
|
118120
|
+
* themselves, then declare generic image previews here. Bridge only renders the
|
|
118121
|
+
* already-declared keys into Feishu Card JSON 2.0 image elements; it does not
|
|
118122
|
+
* download, upload, choose assets, or interpret platform workflows.
|
|
118123
|
+
*/
|
|
118124
|
+
image_blocks: external_exports.array(ImageBlockSchema).max(4).optional(),
|
|
118125
|
+
/**
|
|
118126
|
+
* V2 ordered card body blocks (thin-channel). When present and non-empty,
|
|
118127
|
+
* these are the authoritative card body sequence and take precedence over
|
|
118128
|
+
* legacy `last_message` + tail-appended `image_blocks` rendering. Narrow union
|
|
118129
|
+
* only: markdown and image. No raw card JSON escape hatch.
|
|
118130
|
+
*/
|
|
118131
|
+
content_blocks: ContentBlocksSchema.optional(),
|
|
118760
118132
|
/**
|
|
118761
118133
|
* Optional one-line prompt rendered above the choice buttons (e.g. "选哪个方案?").
|
|
118762
118134
|
* Rendered VERBATIM, bridge-opaque. Only meaningful alongside `choices`.
|
|
@@ -119566,7 +118938,9 @@ var BridgeHandler = class {
|
|
|
119566
118938
|
// reportedState is null when state.json wasn't freshly written
|
|
119567
118939
|
// (stale-guard), so stale leftover choices never reappear.
|
|
119568
118940
|
choices: reportedState?.choices,
|
|
119569
|
-
choicePrompt: reportedState?.choice_prompt
|
|
118941
|
+
choicePrompt: reportedState?.choice_prompt,
|
|
118942
|
+
imageBlocks: reportedState?.image_blocks,
|
|
118943
|
+
contentBlocks: reportedState?.content_blocks
|
|
119570
118944
|
});
|
|
119571
118945
|
await deleteCardFile(worktreePath);
|
|
119572
118946
|
}
|