larkway 0.3.17 → 0.3.19
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 +272 -767
- package/dist/main.js +7447 -6830
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -10740,769 +10740,6 @@ var require_proxy_from_env = __commonJS({
|
|
|
10740
10740
|
}
|
|
10741
10741
|
});
|
|
10742
10742
|
|
|
10743
|
-
// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
|
|
10744
|
-
var require_ms = __commonJS({
|
|
10745
|
-
"node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
|
|
10746
|
-
var s = 1e3;
|
|
10747
|
-
var m = s * 60;
|
|
10748
|
-
var h = m * 60;
|
|
10749
|
-
var d = h * 24;
|
|
10750
|
-
var w = d * 7;
|
|
10751
|
-
var y = d * 365.25;
|
|
10752
|
-
module.exports = function(val, options) {
|
|
10753
|
-
options = options || {};
|
|
10754
|
-
var type2 = typeof val;
|
|
10755
|
-
if (type2 === "string" && val.length > 0) {
|
|
10756
|
-
return parse(val);
|
|
10757
|
-
} else if (type2 === "number" && isFinite(val)) {
|
|
10758
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
10759
|
-
}
|
|
10760
|
-
throw new Error(
|
|
10761
|
-
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
10762
|
-
);
|
|
10763
|
-
};
|
|
10764
|
-
function parse(str2) {
|
|
10765
|
-
str2 = String(str2);
|
|
10766
|
-
if (str2.length > 100) {
|
|
10767
|
-
return;
|
|
10768
|
-
}
|
|
10769
|
-
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(
|
|
10770
|
-
str2
|
|
10771
|
-
);
|
|
10772
|
-
if (!match) {
|
|
10773
|
-
return;
|
|
10774
|
-
}
|
|
10775
|
-
var n = parseFloat(match[1]);
|
|
10776
|
-
var type2 = (match[2] || "ms").toLowerCase();
|
|
10777
|
-
switch (type2) {
|
|
10778
|
-
case "years":
|
|
10779
|
-
case "year":
|
|
10780
|
-
case "yrs":
|
|
10781
|
-
case "yr":
|
|
10782
|
-
case "y":
|
|
10783
|
-
return n * y;
|
|
10784
|
-
case "weeks":
|
|
10785
|
-
case "week":
|
|
10786
|
-
case "w":
|
|
10787
|
-
return n * w;
|
|
10788
|
-
case "days":
|
|
10789
|
-
case "day":
|
|
10790
|
-
case "d":
|
|
10791
|
-
return n * d;
|
|
10792
|
-
case "hours":
|
|
10793
|
-
case "hour":
|
|
10794
|
-
case "hrs":
|
|
10795
|
-
case "hr":
|
|
10796
|
-
case "h":
|
|
10797
|
-
return n * h;
|
|
10798
|
-
case "minutes":
|
|
10799
|
-
case "minute":
|
|
10800
|
-
case "mins":
|
|
10801
|
-
case "min":
|
|
10802
|
-
case "m":
|
|
10803
|
-
return n * m;
|
|
10804
|
-
case "seconds":
|
|
10805
|
-
case "second":
|
|
10806
|
-
case "secs":
|
|
10807
|
-
case "sec":
|
|
10808
|
-
case "s":
|
|
10809
|
-
return n * s;
|
|
10810
|
-
case "milliseconds":
|
|
10811
|
-
case "millisecond":
|
|
10812
|
-
case "msecs":
|
|
10813
|
-
case "msec":
|
|
10814
|
-
case "ms":
|
|
10815
|
-
return n;
|
|
10816
|
-
default:
|
|
10817
|
-
return void 0;
|
|
10818
|
-
}
|
|
10819
|
-
}
|
|
10820
|
-
function fmtShort(ms) {
|
|
10821
|
-
var msAbs = Math.abs(ms);
|
|
10822
|
-
if (msAbs >= d) {
|
|
10823
|
-
return Math.round(ms / d) + "d";
|
|
10824
|
-
}
|
|
10825
|
-
if (msAbs >= h) {
|
|
10826
|
-
return Math.round(ms / h) + "h";
|
|
10827
|
-
}
|
|
10828
|
-
if (msAbs >= m) {
|
|
10829
|
-
return Math.round(ms / m) + "m";
|
|
10830
|
-
}
|
|
10831
|
-
if (msAbs >= s) {
|
|
10832
|
-
return Math.round(ms / s) + "s";
|
|
10833
|
-
}
|
|
10834
|
-
return ms + "ms";
|
|
10835
|
-
}
|
|
10836
|
-
function fmtLong(ms) {
|
|
10837
|
-
var msAbs = Math.abs(ms);
|
|
10838
|
-
if (msAbs >= d) {
|
|
10839
|
-
return plural(ms, msAbs, d, "day");
|
|
10840
|
-
}
|
|
10841
|
-
if (msAbs >= h) {
|
|
10842
|
-
return plural(ms, msAbs, h, "hour");
|
|
10843
|
-
}
|
|
10844
|
-
if (msAbs >= m) {
|
|
10845
|
-
return plural(ms, msAbs, m, "minute");
|
|
10846
|
-
}
|
|
10847
|
-
if (msAbs >= s) {
|
|
10848
|
-
return plural(ms, msAbs, s, "second");
|
|
10849
|
-
}
|
|
10850
|
-
return ms + " ms";
|
|
10851
|
-
}
|
|
10852
|
-
function plural(ms, msAbs, n, name) {
|
|
10853
|
-
var isPlural = msAbs >= n * 1.5;
|
|
10854
|
-
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
10855
|
-
}
|
|
10856
|
-
}
|
|
10857
|
-
});
|
|
10858
|
-
|
|
10859
|
-
// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
|
|
10860
|
-
var require_common = __commonJS({
|
|
10861
|
-
"node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
|
|
10862
|
-
function setup(env) {
|
|
10863
|
-
createDebug.debug = createDebug;
|
|
10864
|
-
createDebug.default = createDebug;
|
|
10865
|
-
createDebug.coerce = coerce2;
|
|
10866
|
-
createDebug.disable = disable;
|
|
10867
|
-
createDebug.enable = enable;
|
|
10868
|
-
createDebug.enabled = enabled;
|
|
10869
|
-
createDebug.humanize = require_ms();
|
|
10870
|
-
createDebug.destroy = destroy;
|
|
10871
|
-
Object.keys(env).forEach((key) => {
|
|
10872
|
-
createDebug[key] = env[key];
|
|
10873
|
-
});
|
|
10874
|
-
createDebug.names = [];
|
|
10875
|
-
createDebug.skips = [];
|
|
10876
|
-
createDebug.formatters = {};
|
|
10877
|
-
function selectColor(namespace) {
|
|
10878
|
-
let hash = 0;
|
|
10879
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
10880
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
10881
|
-
hash |= 0;
|
|
10882
|
-
}
|
|
10883
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
10884
|
-
}
|
|
10885
|
-
createDebug.selectColor = selectColor;
|
|
10886
|
-
function createDebug(namespace) {
|
|
10887
|
-
let prevTime;
|
|
10888
|
-
let enableOverride = null;
|
|
10889
|
-
let namespacesCache;
|
|
10890
|
-
let enabledCache;
|
|
10891
|
-
function debug(...args) {
|
|
10892
|
-
if (!debug.enabled) {
|
|
10893
|
-
return;
|
|
10894
|
-
}
|
|
10895
|
-
const self2 = debug;
|
|
10896
|
-
const curr = Number(/* @__PURE__ */ new Date());
|
|
10897
|
-
const ms = curr - (prevTime || curr);
|
|
10898
|
-
self2.diff = ms;
|
|
10899
|
-
self2.prev = prevTime;
|
|
10900
|
-
self2.curr = curr;
|
|
10901
|
-
prevTime = curr;
|
|
10902
|
-
args[0] = createDebug.coerce(args[0]);
|
|
10903
|
-
if (typeof args[0] !== "string") {
|
|
10904
|
-
args.unshift("%O");
|
|
10905
|
-
}
|
|
10906
|
-
let index = 0;
|
|
10907
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
10908
|
-
if (match === "%%") {
|
|
10909
|
-
return "%";
|
|
10910
|
-
}
|
|
10911
|
-
index++;
|
|
10912
|
-
const formatter = createDebug.formatters[format];
|
|
10913
|
-
if (typeof formatter === "function") {
|
|
10914
|
-
const val = args[index];
|
|
10915
|
-
match = formatter.call(self2, val);
|
|
10916
|
-
args.splice(index, 1);
|
|
10917
|
-
index--;
|
|
10918
|
-
}
|
|
10919
|
-
return match;
|
|
10920
|
-
});
|
|
10921
|
-
createDebug.formatArgs.call(self2, args);
|
|
10922
|
-
const logFn = self2.log || createDebug.log;
|
|
10923
|
-
logFn.apply(self2, args);
|
|
10924
|
-
}
|
|
10925
|
-
debug.namespace = namespace;
|
|
10926
|
-
debug.useColors = createDebug.useColors();
|
|
10927
|
-
debug.color = createDebug.selectColor(namespace);
|
|
10928
|
-
debug.extend = extend3;
|
|
10929
|
-
debug.destroy = createDebug.destroy;
|
|
10930
|
-
Object.defineProperty(debug, "enabled", {
|
|
10931
|
-
enumerable: true,
|
|
10932
|
-
configurable: false,
|
|
10933
|
-
get: () => {
|
|
10934
|
-
if (enableOverride !== null) {
|
|
10935
|
-
return enableOverride;
|
|
10936
|
-
}
|
|
10937
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
10938
|
-
namespacesCache = createDebug.namespaces;
|
|
10939
|
-
enabledCache = createDebug.enabled(namespace);
|
|
10940
|
-
}
|
|
10941
|
-
return enabledCache;
|
|
10942
|
-
},
|
|
10943
|
-
set: (v) => {
|
|
10944
|
-
enableOverride = v;
|
|
10945
|
-
}
|
|
10946
|
-
});
|
|
10947
|
-
if (typeof createDebug.init === "function") {
|
|
10948
|
-
createDebug.init(debug);
|
|
10949
|
-
}
|
|
10950
|
-
return debug;
|
|
10951
|
-
}
|
|
10952
|
-
function extend3(namespace, delimiter) {
|
|
10953
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
10954
|
-
newDebug.log = this.log;
|
|
10955
|
-
return newDebug;
|
|
10956
|
-
}
|
|
10957
|
-
function enable(namespaces) {
|
|
10958
|
-
createDebug.save(namespaces);
|
|
10959
|
-
createDebug.namespaces = namespaces;
|
|
10960
|
-
createDebug.names = [];
|
|
10961
|
-
createDebug.skips = [];
|
|
10962
|
-
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
10963
|
-
for (const ns of split) {
|
|
10964
|
-
if (ns[0] === "-") {
|
|
10965
|
-
createDebug.skips.push(ns.slice(1));
|
|
10966
|
-
} else {
|
|
10967
|
-
createDebug.names.push(ns);
|
|
10968
|
-
}
|
|
10969
|
-
}
|
|
10970
|
-
}
|
|
10971
|
-
function matchesTemplate(search, template) {
|
|
10972
|
-
let searchIndex = 0;
|
|
10973
|
-
let templateIndex = 0;
|
|
10974
|
-
let starIndex = -1;
|
|
10975
|
-
let matchIndex = 0;
|
|
10976
|
-
while (searchIndex < search.length) {
|
|
10977
|
-
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
10978
|
-
if (template[templateIndex] === "*") {
|
|
10979
|
-
starIndex = templateIndex;
|
|
10980
|
-
matchIndex = searchIndex;
|
|
10981
|
-
templateIndex++;
|
|
10982
|
-
} else {
|
|
10983
|
-
searchIndex++;
|
|
10984
|
-
templateIndex++;
|
|
10985
|
-
}
|
|
10986
|
-
} else if (starIndex !== -1) {
|
|
10987
|
-
templateIndex = starIndex + 1;
|
|
10988
|
-
matchIndex++;
|
|
10989
|
-
searchIndex = matchIndex;
|
|
10990
|
-
} else {
|
|
10991
|
-
return false;
|
|
10992
|
-
}
|
|
10993
|
-
}
|
|
10994
|
-
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
10995
|
-
templateIndex++;
|
|
10996
|
-
}
|
|
10997
|
-
return templateIndex === template.length;
|
|
10998
|
-
}
|
|
10999
|
-
function disable() {
|
|
11000
|
-
const namespaces = [
|
|
11001
|
-
...createDebug.names,
|
|
11002
|
-
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
11003
|
-
].join(",");
|
|
11004
|
-
createDebug.enable("");
|
|
11005
|
-
return namespaces;
|
|
11006
|
-
}
|
|
11007
|
-
function enabled(name) {
|
|
11008
|
-
for (const skip of createDebug.skips) {
|
|
11009
|
-
if (matchesTemplate(name, skip)) {
|
|
11010
|
-
return false;
|
|
11011
|
-
}
|
|
11012
|
-
}
|
|
11013
|
-
for (const ns of createDebug.names) {
|
|
11014
|
-
if (matchesTemplate(name, ns)) {
|
|
11015
|
-
return true;
|
|
11016
|
-
}
|
|
11017
|
-
}
|
|
11018
|
-
return false;
|
|
11019
|
-
}
|
|
11020
|
-
function coerce2(val) {
|
|
11021
|
-
if (val instanceof Error) {
|
|
11022
|
-
return val.stack || val.message;
|
|
11023
|
-
}
|
|
11024
|
-
return val;
|
|
11025
|
-
}
|
|
11026
|
-
function destroy() {
|
|
11027
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11028
|
-
}
|
|
11029
|
-
createDebug.enable(createDebug.load());
|
|
11030
|
-
return createDebug;
|
|
11031
|
-
}
|
|
11032
|
-
module.exports = setup;
|
|
11033
|
-
}
|
|
11034
|
-
});
|
|
11035
|
-
|
|
11036
|
-
// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
|
|
11037
|
-
var require_browser = __commonJS({
|
|
11038
|
-
"node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
|
|
11039
|
-
exports.formatArgs = formatArgs;
|
|
11040
|
-
exports.save = save;
|
|
11041
|
-
exports.load = load2;
|
|
11042
|
-
exports.useColors = useColors;
|
|
11043
|
-
exports.storage = localstorage();
|
|
11044
|
-
exports.destroy = /* @__PURE__ */ (() => {
|
|
11045
|
-
let warned = false;
|
|
11046
|
-
return () => {
|
|
11047
|
-
if (!warned) {
|
|
11048
|
-
warned = true;
|
|
11049
|
-
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11050
|
-
}
|
|
11051
|
-
};
|
|
11052
|
-
})();
|
|
11053
|
-
exports.colors = [
|
|
11054
|
-
"#0000CC",
|
|
11055
|
-
"#0000FF",
|
|
11056
|
-
"#0033CC",
|
|
11057
|
-
"#0033FF",
|
|
11058
|
-
"#0066CC",
|
|
11059
|
-
"#0066FF",
|
|
11060
|
-
"#0099CC",
|
|
11061
|
-
"#0099FF",
|
|
11062
|
-
"#00CC00",
|
|
11063
|
-
"#00CC33",
|
|
11064
|
-
"#00CC66",
|
|
11065
|
-
"#00CC99",
|
|
11066
|
-
"#00CCCC",
|
|
11067
|
-
"#00CCFF",
|
|
11068
|
-
"#3300CC",
|
|
11069
|
-
"#3300FF",
|
|
11070
|
-
"#3333CC",
|
|
11071
|
-
"#3333FF",
|
|
11072
|
-
"#3366CC",
|
|
11073
|
-
"#3366FF",
|
|
11074
|
-
"#3399CC",
|
|
11075
|
-
"#3399FF",
|
|
11076
|
-
"#33CC00",
|
|
11077
|
-
"#33CC33",
|
|
11078
|
-
"#33CC66",
|
|
11079
|
-
"#33CC99",
|
|
11080
|
-
"#33CCCC",
|
|
11081
|
-
"#33CCFF",
|
|
11082
|
-
"#6600CC",
|
|
11083
|
-
"#6600FF",
|
|
11084
|
-
"#6633CC",
|
|
11085
|
-
"#6633FF",
|
|
11086
|
-
"#66CC00",
|
|
11087
|
-
"#66CC33",
|
|
11088
|
-
"#9900CC",
|
|
11089
|
-
"#9900FF",
|
|
11090
|
-
"#9933CC",
|
|
11091
|
-
"#9933FF",
|
|
11092
|
-
"#99CC00",
|
|
11093
|
-
"#99CC33",
|
|
11094
|
-
"#CC0000",
|
|
11095
|
-
"#CC0033",
|
|
11096
|
-
"#CC0066",
|
|
11097
|
-
"#CC0099",
|
|
11098
|
-
"#CC00CC",
|
|
11099
|
-
"#CC00FF",
|
|
11100
|
-
"#CC3300",
|
|
11101
|
-
"#CC3333",
|
|
11102
|
-
"#CC3366",
|
|
11103
|
-
"#CC3399",
|
|
11104
|
-
"#CC33CC",
|
|
11105
|
-
"#CC33FF",
|
|
11106
|
-
"#CC6600",
|
|
11107
|
-
"#CC6633",
|
|
11108
|
-
"#CC9900",
|
|
11109
|
-
"#CC9933",
|
|
11110
|
-
"#CCCC00",
|
|
11111
|
-
"#CCCC33",
|
|
11112
|
-
"#FF0000",
|
|
11113
|
-
"#FF0033",
|
|
11114
|
-
"#FF0066",
|
|
11115
|
-
"#FF0099",
|
|
11116
|
-
"#FF00CC",
|
|
11117
|
-
"#FF00FF",
|
|
11118
|
-
"#FF3300",
|
|
11119
|
-
"#FF3333",
|
|
11120
|
-
"#FF3366",
|
|
11121
|
-
"#FF3399",
|
|
11122
|
-
"#FF33CC",
|
|
11123
|
-
"#FF33FF",
|
|
11124
|
-
"#FF6600",
|
|
11125
|
-
"#FF6633",
|
|
11126
|
-
"#FF9900",
|
|
11127
|
-
"#FF9933",
|
|
11128
|
-
"#FFCC00",
|
|
11129
|
-
"#FFCC33"
|
|
11130
|
-
];
|
|
11131
|
-
function useColors() {
|
|
11132
|
-
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
11133
|
-
return true;
|
|
11134
|
-
}
|
|
11135
|
-
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
11136
|
-
return false;
|
|
11137
|
-
}
|
|
11138
|
-
let m;
|
|
11139
|
-
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
11140
|
-
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
11141
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
11142
|
-
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
|
|
11143
|
-
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
11144
|
-
}
|
|
11145
|
-
function formatArgs(args) {
|
|
11146
|
-
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
11147
|
-
if (!this.useColors) {
|
|
11148
|
-
return;
|
|
11149
|
-
}
|
|
11150
|
-
const c = "color: " + this.color;
|
|
11151
|
-
args.splice(1, 0, c, "color: inherit");
|
|
11152
|
-
let index = 0;
|
|
11153
|
-
let lastC = 0;
|
|
11154
|
-
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
11155
|
-
if (match === "%%") {
|
|
11156
|
-
return;
|
|
11157
|
-
}
|
|
11158
|
-
index++;
|
|
11159
|
-
if (match === "%c") {
|
|
11160
|
-
lastC = index;
|
|
11161
|
-
}
|
|
11162
|
-
});
|
|
11163
|
-
args.splice(lastC, 0, c);
|
|
11164
|
-
}
|
|
11165
|
-
exports.log = console.debug || console.log || (() => {
|
|
11166
|
-
});
|
|
11167
|
-
function save(namespaces) {
|
|
11168
|
-
try {
|
|
11169
|
-
if (namespaces) {
|
|
11170
|
-
exports.storage.setItem("debug", namespaces);
|
|
11171
|
-
} else {
|
|
11172
|
-
exports.storage.removeItem("debug");
|
|
11173
|
-
}
|
|
11174
|
-
} catch (error) {
|
|
11175
|
-
}
|
|
11176
|
-
}
|
|
11177
|
-
function load2() {
|
|
11178
|
-
let r;
|
|
11179
|
-
try {
|
|
11180
|
-
r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
|
|
11181
|
-
} catch (error) {
|
|
11182
|
-
}
|
|
11183
|
-
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11184
|
-
r = process.env.DEBUG;
|
|
11185
|
-
}
|
|
11186
|
-
return r;
|
|
11187
|
-
}
|
|
11188
|
-
function localstorage() {
|
|
11189
|
-
try {
|
|
11190
|
-
return localStorage;
|
|
11191
|
-
} catch (error) {
|
|
11192
|
-
}
|
|
11193
|
-
}
|
|
11194
|
-
module.exports = require_common()(exports);
|
|
11195
|
-
var { formatters } = module.exports;
|
|
11196
|
-
formatters.j = function(v) {
|
|
11197
|
-
try {
|
|
11198
|
-
return JSON.stringify(v);
|
|
11199
|
-
} catch (error) {
|
|
11200
|
-
return "[UnexpectedJSONParseError]: " + error.message;
|
|
11201
|
-
}
|
|
11202
|
-
};
|
|
11203
|
-
}
|
|
11204
|
-
});
|
|
11205
|
-
|
|
11206
|
-
// node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
11207
|
-
var require_has_flag = __commonJS({
|
|
11208
|
-
"node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
|
|
11209
|
-
"use strict";
|
|
11210
|
-
module.exports = (flag, argv = process.argv) => {
|
|
11211
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
11212
|
-
const position = argv.indexOf(prefix + flag);
|
|
11213
|
-
const terminatorPosition = argv.indexOf("--");
|
|
11214
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
11215
|
-
};
|
|
11216
|
-
}
|
|
11217
|
-
});
|
|
11218
|
-
|
|
11219
|
-
// node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
11220
|
-
var require_supports_color = __commonJS({
|
|
11221
|
-
"node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
|
|
11222
|
-
"use strict";
|
|
11223
|
-
var os2 = __require("os");
|
|
11224
|
-
var tty = __require("tty");
|
|
11225
|
-
var hasFlag = require_has_flag();
|
|
11226
|
-
var { env } = process;
|
|
11227
|
-
var forceColor;
|
|
11228
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
11229
|
-
forceColor = 0;
|
|
11230
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
11231
|
-
forceColor = 1;
|
|
11232
|
-
}
|
|
11233
|
-
if ("FORCE_COLOR" in env) {
|
|
11234
|
-
if (env.FORCE_COLOR === "true") {
|
|
11235
|
-
forceColor = 1;
|
|
11236
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
11237
|
-
forceColor = 0;
|
|
11238
|
-
} else {
|
|
11239
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
11240
|
-
}
|
|
11241
|
-
}
|
|
11242
|
-
function translateLevel(level) {
|
|
11243
|
-
if (level === 0) {
|
|
11244
|
-
return false;
|
|
11245
|
-
}
|
|
11246
|
-
return {
|
|
11247
|
-
level,
|
|
11248
|
-
hasBasic: true,
|
|
11249
|
-
has256: level >= 2,
|
|
11250
|
-
has16m: level >= 3
|
|
11251
|
-
};
|
|
11252
|
-
}
|
|
11253
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
11254
|
-
if (forceColor === 0) {
|
|
11255
|
-
return 0;
|
|
11256
|
-
}
|
|
11257
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
11258
|
-
return 3;
|
|
11259
|
-
}
|
|
11260
|
-
if (hasFlag("color=256")) {
|
|
11261
|
-
return 2;
|
|
11262
|
-
}
|
|
11263
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
11264
|
-
return 0;
|
|
11265
|
-
}
|
|
11266
|
-
const min = forceColor || 0;
|
|
11267
|
-
if (env.TERM === "dumb") {
|
|
11268
|
-
return min;
|
|
11269
|
-
}
|
|
11270
|
-
if (process.platform === "win32") {
|
|
11271
|
-
const osRelease = os2.release().split(".");
|
|
11272
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
11273
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
11274
|
-
}
|
|
11275
|
-
return 1;
|
|
11276
|
-
}
|
|
11277
|
-
if ("CI" in env) {
|
|
11278
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
11279
|
-
return 1;
|
|
11280
|
-
}
|
|
11281
|
-
return min;
|
|
11282
|
-
}
|
|
11283
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
11284
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
11285
|
-
}
|
|
11286
|
-
if (env.COLORTERM === "truecolor") {
|
|
11287
|
-
return 3;
|
|
11288
|
-
}
|
|
11289
|
-
if ("TERM_PROGRAM" in env) {
|
|
11290
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
11291
|
-
switch (env.TERM_PROGRAM) {
|
|
11292
|
-
case "iTerm.app":
|
|
11293
|
-
return version >= 3 ? 3 : 2;
|
|
11294
|
-
case "Apple_Terminal":
|
|
11295
|
-
return 2;
|
|
11296
|
-
}
|
|
11297
|
-
}
|
|
11298
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
11299
|
-
return 2;
|
|
11300
|
-
}
|
|
11301
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
11302
|
-
return 1;
|
|
11303
|
-
}
|
|
11304
|
-
if ("COLORTERM" in env) {
|
|
11305
|
-
return 1;
|
|
11306
|
-
}
|
|
11307
|
-
return min;
|
|
11308
|
-
}
|
|
11309
|
-
function getSupportLevel(stream) {
|
|
11310
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
11311
|
-
return translateLevel(level);
|
|
11312
|
-
}
|
|
11313
|
-
module.exports = {
|
|
11314
|
-
supportsColor: getSupportLevel,
|
|
11315
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
11316
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
11317
|
-
};
|
|
11318
|
-
}
|
|
11319
|
-
});
|
|
11320
|
-
|
|
11321
|
-
// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
|
|
11322
|
-
var require_node = __commonJS({
|
|
11323
|
-
"node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js"(exports, module) {
|
|
11324
|
-
var tty = __require("tty");
|
|
11325
|
-
var util2 = __require("util");
|
|
11326
|
-
exports.init = init;
|
|
11327
|
-
exports.log = log;
|
|
11328
|
-
exports.formatArgs = formatArgs;
|
|
11329
|
-
exports.save = save;
|
|
11330
|
-
exports.load = load2;
|
|
11331
|
-
exports.useColors = useColors;
|
|
11332
|
-
exports.destroy = util2.deprecate(
|
|
11333
|
-
() => {
|
|
11334
|
-
},
|
|
11335
|
-
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
11336
|
-
);
|
|
11337
|
-
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
11338
|
-
try {
|
|
11339
|
-
const supportsColor = require_supports_color();
|
|
11340
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
11341
|
-
exports.colors = [
|
|
11342
|
-
20,
|
|
11343
|
-
21,
|
|
11344
|
-
26,
|
|
11345
|
-
27,
|
|
11346
|
-
32,
|
|
11347
|
-
33,
|
|
11348
|
-
38,
|
|
11349
|
-
39,
|
|
11350
|
-
40,
|
|
11351
|
-
41,
|
|
11352
|
-
42,
|
|
11353
|
-
43,
|
|
11354
|
-
44,
|
|
11355
|
-
45,
|
|
11356
|
-
56,
|
|
11357
|
-
57,
|
|
11358
|
-
62,
|
|
11359
|
-
63,
|
|
11360
|
-
68,
|
|
11361
|
-
69,
|
|
11362
|
-
74,
|
|
11363
|
-
75,
|
|
11364
|
-
76,
|
|
11365
|
-
77,
|
|
11366
|
-
78,
|
|
11367
|
-
79,
|
|
11368
|
-
80,
|
|
11369
|
-
81,
|
|
11370
|
-
92,
|
|
11371
|
-
93,
|
|
11372
|
-
98,
|
|
11373
|
-
99,
|
|
11374
|
-
112,
|
|
11375
|
-
113,
|
|
11376
|
-
128,
|
|
11377
|
-
129,
|
|
11378
|
-
134,
|
|
11379
|
-
135,
|
|
11380
|
-
148,
|
|
11381
|
-
149,
|
|
11382
|
-
160,
|
|
11383
|
-
161,
|
|
11384
|
-
162,
|
|
11385
|
-
163,
|
|
11386
|
-
164,
|
|
11387
|
-
165,
|
|
11388
|
-
166,
|
|
11389
|
-
167,
|
|
11390
|
-
168,
|
|
11391
|
-
169,
|
|
11392
|
-
170,
|
|
11393
|
-
171,
|
|
11394
|
-
172,
|
|
11395
|
-
173,
|
|
11396
|
-
178,
|
|
11397
|
-
179,
|
|
11398
|
-
184,
|
|
11399
|
-
185,
|
|
11400
|
-
196,
|
|
11401
|
-
197,
|
|
11402
|
-
198,
|
|
11403
|
-
199,
|
|
11404
|
-
200,
|
|
11405
|
-
201,
|
|
11406
|
-
202,
|
|
11407
|
-
203,
|
|
11408
|
-
204,
|
|
11409
|
-
205,
|
|
11410
|
-
206,
|
|
11411
|
-
207,
|
|
11412
|
-
208,
|
|
11413
|
-
209,
|
|
11414
|
-
214,
|
|
11415
|
-
215,
|
|
11416
|
-
220,
|
|
11417
|
-
221
|
|
11418
|
-
];
|
|
11419
|
-
}
|
|
11420
|
-
} catch (error) {
|
|
11421
|
-
}
|
|
11422
|
-
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11423
|
-
return /^debug_/i.test(key);
|
|
11424
|
-
}).reduce((obj, key) => {
|
|
11425
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
11426
|
-
return k.toUpperCase();
|
|
11427
|
-
});
|
|
11428
|
-
let val = process.env[key];
|
|
11429
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
11430
|
-
val = true;
|
|
11431
|
-
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
11432
|
-
val = false;
|
|
11433
|
-
} else if (val === "null") {
|
|
11434
|
-
val = null;
|
|
11435
|
-
} else {
|
|
11436
|
-
val = Number(val);
|
|
11437
|
-
}
|
|
11438
|
-
obj[prop] = val;
|
|
11439
|
-
return obj;
|
|
11440
|
-
}, {});
|
|
11441
|
-
function useColors() {
|
|
11442
|
-
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
11443
|
-
}
|
|
11444
|
-
function formatArgs(args) {
|
|
11445
|
-
const { namespace: name, useColors: useColors2 } = this;
|
|
11446
|
-
if (useColors2) {
|
|
11447
|
-
const c = this.color;
|
|
11448
|
-
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
11449
|
-
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
11450
|
-
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
11451
|
-
args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
11452
|
-
} else {
|
|
11453
|
-
args[0] = getDate() + name + " " + args[0];
|
|
11454
|
-
}
|
|
11455
|
-
}
|
|
11456
|
-
function getDate() {
|
|
11457
|
-
if (exports.inspectOpts.hideDate) {
|
|
11458
|
-
return "";
|
|
11459
|
-
}
|
|
11460
|
-
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
11461
|
-
}
|
|
11462
|
-
function log(...args) {
|
|
11463
|
-
return process.stderr.write(util2.formatWithOptions(exports.inspectOpts, ...args) + "\n");
|
|
11464
|
-
}
|
|
11465
|
-
function save(namespaces) {
|
|
11466
|
-
if (namespaces) {
|
|
11467
|
-
process.env.DEBUG = namespaces;
|
|
11468
|
-
} else {
|
|
11469
|
-
delete process.env.DEBUG;
|
|
11470
|
-
}
|
|
11471
|
-
}
|
|
11472
|
-
function load2() {
|
|
11473
|
-
return process.env.DEBUG;
|
|
11474
|
-
}
|
|
11475
|
-
function init(debug) {
|
|
11476
|
-
debug.inspectOpts = {};
|
|
11477
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
11478
|
-
for (let i = 0; i < keys.length; i++) {
|
|
11479
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
11480
|
-
}
|
|
11481
|
-
}
|
|
11482
|
-
module.exports = require_common()(exports);
|
|
11483
|
-
var { formatters } = module.exports;
|
|
11484
|
-
formatters.o = function(v) {
|
|
11485
|
-
this.inspectOpts.colors = this.useColors;
|
|
11486
|
-
return util2.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" ");
|
|
11487
|
-
};
|
|
11488
|
-
formatters.O = function(v) {
|
|
11489
|
-
this.inspectOpts.colors = this.useColors;
|
|
11490
|
-
return util2.inspect(v, this.inspectOpts);
|
|
11491
|
-
};
|
|
11492
|
-
}
|
|
11493
|
-
});
|
|
11494
|
-
|
|
11495
|
-
// node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
|
|
11496
|
-
var require_src = __commonJS({
|
|
11497
|
-
"node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js"(exports, module) {
|
|
11498
|
-
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
11499
|
-
module.exports = require_browser();
|
|
11500
|
-
} else {
|
|
11501
|
-
module.exports = require_node();
|
|
11502
|
-
}
|
|
11503
|
-
}
|
|
11504
|
-
});
|
|
11505
|
-
|
|
11506
10743
|
// node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js
|
|
11507
10744
|
var require_debug = __commonJS({
|
|
11508
10745
|
"node_modules/.pnpm/follow-redirects@1.16.0/node_modules/follow-redirects/debug.js"(exports, module) {
|
|
@@ -11510,7 +10747,7 @@ var require_debug = __commonJS({
|
|
|
11510
10747
|
module.exports = function() {
|
|
11511
10748
|
if (!debug) {
|
|
11512
10749
|
try {
|
|
11513
|
-
debug =
|
|
10750
|
+
debug = __require("debug")("follow-redirects");
|
|
11514
10751
|
} catch (error) {
|
|
11515
10752
|
}
|
|
11516
10753
|
if (typeof debug !== "function") {
|
|
@@ -111945,6 +111182,97 @@ var init_channelCardClient = __esm({
|
|
|
111945
111182
|
}
|
|
111946
111183
|
});
|
|
111947
111184
|
|
|
111185
|
+
// src/lark/outboundPostClient.ts
|
|
111186
|
+
function numericStatus(err2) {
|
|
111187
|
+
if (!err2 || typeof err2 !== "object") return void 0;
|
|
111188
|
+
const rec = err2;
|
|
111189
|
+
const status = rec["status"];
|
|
111190
|
+
if (typeof status === "number") return status;
|
|
111191
|
+
const code = rec["code"];
|
|
111192
|
+
if (typeof code === "number") return code;
|
|
111193
|
+
return void 0;
|
|
111194
|
+
}
|
|
111195
|
+
function isRetryablePostError(err2) {
|
|
111196
|
+
const status = numericStatus(err2);
|
|
111197
|
+
return status !== void 0 && status >= 500 && status < 600;
|
|
111198
|
+
}
|
|
111199
|
+
async function withPostRetry(label, fn, opts) {
|
|
111200
|
+
const maxAttempts = Math.max(1, opts.maxAttempts);
|
|
111201
|
+
const baseDelayMs = opts.baseDelayMs ?? 300;
|
|
111202
|
+
let lastErr;
|
|
111203
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
111204
|
+
try {
|
|
111205
|
+
return await fn();
|
|
111206
|
+
} catch (err2) {
|
|
111207
|
+
lastErr = err2;
|
|
111208
|
+
if (attempt === maxAttempts || !isRetryablePostError(err2)) {
|
|
111209
|
+
throw err2;
|
|
111210
|
+
}
|
|
111211
|
+
const delay = baseDelayMs * Math.pow(2, attempt - 1);
|
|
111212
|
+
console.warn(
|
|
111213
|
+
`[channel.post] ${label} attempt ${attempt} failed (${err2.message}); retrying in ${delay}ms`
|
|
111214
|
+
);
|
|
111215
|
+
if (delay > 0) {
|
|
111216
|
+
await new Promise((resolve2) => setTimeout(resolve2, delay));
|
|
111217
|
+
}
|
|
111218
|
+
}
|
|
111219
|
+
}
|
|
111220
|
+
throw lastErr;
|
|
111221
|
+
}
|
|
111222
|
+
var init_outboundPostClient = __esm({
|
|
111223
|
+
"src/lark/outboundPostClient.ts"() {
|
|
111224
|
+
"use strict";
|
|
111225
|
+
}
|
|
111226
|
+
});
|
|
111227
|
+
|
|
111228
|
+
// src/lark/channelPostClient.ts
|
|
111229
|
+
var ChannelPostClient;
|
|
111230
|
+
var init_channelPostClient = __esm({
|
|
111231
|
+
"src/lark/channelPostClient.ts"() {
|
|
111232
|
+
"use strict";
|
|
111233
|
+
init_outboundPostClient();
|
|
111234
|
+
ChannelPostClient = class {
|
|
111235
|
+
resolveChannel;
|
|
111236
|
+
maxAttempts;
|
|
111237
|
+
baseDelayMs;
|
|
111238
|
+
constructor(opts) {
|
|
111239
|
+
this.resolveChannel = opts.resolveChannel;
|
|
111240
|
+
this.maxAttempts = opts.maxAttempts ?? 3;
|
|
111241
|
+
this.baseDelayMs = opts.baseDelayMs ?? 300;
|
|
111242
|
+
}
|
|
111243
|
+
channel() {
|
|
111244
|
+
const ch = this.resolveChannel();
|
|
111245
|
+
if (!ch) {
|
|
111246
|
+
throw new Error("[channel.post] outbound called before the Channel SDK connected");
|
|
111247
|
+
}
|
|
111248
|
+
return ch;
|
|
111249
|
+
}
|
|
111250
|
+
async createPostReply(replyToMessageId, content, opts) {
|
|
111251
|
+
const res = await withPostRetry(
|
|
111252
|
+
"createPostReply",
|
|
111253
|
+
() => this.channel().rawClient.im.v1.message.reply({
|
|
111254
|
+
path: { message_id: replyToMessageId },
|
|
111255
|
+
data: {
|
|
111256
|
+
content,
|
|
111257
|
+
msg_type: "post",
|
|
111258
|
+
reply_in_thread: opts.replyInThread,
|
|
111259
|
+
uuid: opts.idempotencyKey
|
|
111260
|
+
}
|
|
111261
|
+
}),
|
|
111262
|
+
{ maxAttempts: this.maxAttempts, baseDelayMs: this.baseDelayMs }
|
|
111263
|
+
);
|
|
111264
|
+
const messageId = res.data?.message_id;
|
|
111265
|
+
if (!messageId) {
|
|
111266
|
+
throw new Error(
|
|
111267
|
+
`[channel.post] im.v1.message.reply returned no message_id (replyTo=${replyToMessageId})`
|
|
111268
|
+
);
|
|
111269
|
+
}
|
|
111270
|
+
return { messageId };
|
|
111271
|
+
}
|
|
111272
|
+
};
|
|
111273
|
+
}
|
|
111274
|
+
});
|
|
111275
|
+
|
|
111948
111276
|
// src/lark/channelClient.ts
|
|
111949
111277
|
var channelClient_exports = {};
|
|
111950
111278
|
__export(channelClient_exports, {
|
|
@@ -112100,6 +111428,7 @@ var init_channelClient = __esm({
|
|
|
112100
111428
|
import_node_sdk = __toESM(require_lib2(), 1);
|
|
112101
111429
|
init_transport();
|
|
112102
111430
|
init_channelCardClient();
|
|
111431
|
+
init_channelPostClient();
|
|
112103
111432
|
execFile4 = promisify4(execFileCallback);
|
|
112104
111433
|
LEARNED_CHATS_LIMIT = 100;
|
|
112105
111434
|
SEEN_MESSAGES_LIMIT = 1e3;
|
|
@@ -112209,6 +111538,8 @@ var init_channelClient = __esm({
|
|
|
112209
111538
|
cardThreads = /* @__PURE__ */ new Map();
|
|
112210
111539
|
/** Lazily built (after connect) so it can bind the live channel handle. */
|
|
112211
111540
|
cardClient = null;
|
|
111541
|
+
/** Lazily built and only requested by main.ts when post outbound gates are configured. */
|
|
111542
|
+
postClient = null;
|
|
112212
111543
|
constructor(opts) {
|
|
112213
111544
|
if (!opts.appId || !opts.appSecret) {
|
|
112214
111545
|
throw new Error(
|
|
@@ -112409,6 +111740,22 @@ var init_channelClient = __esm({
|
|
|
112409
111740
|
}
|
|
112410
111741
|
return this.cardClient;
|
|
112411
111742
|
}
|
|
111743
|
+
/**
|
|
111744
|
+
* Return an OutboundPostClient bound to this client's channel handle.
|
|
111745
|
+
*
|
|
111746
|
+
* main.ts only calls this when the per-bot response-surface config explicitly
|
|
111747
|
+
* enables post outbound behind an allowlist. The returned client still resolves
|
|
111748
|
+
* the live channel lazily at send time, so default production bots never create
|
|
111749
|
+
* or inject a real post client.
|
|
111750
|
+
*/
|
|
111751
|
+
outboundPostClient() {
|
|
111752
|
+
if (!this.postClient) {
|
|
111753
|
+
this.postClient = new ChannelPostClient({
|
|
111754
|
+
resolveChannel: () => this.channel
|
|
111755
|
+
});
|
|
111756
|
+
}
|
|
111757
|
+
return this.postClient;
|
|
111758
|
+
}
|
|
112412
111759
|
/**
|
|
112413
111760
|
* Gap-fill: after a WS reconnect, pull recent history from each allowed chat
|
|
112414
111761
|
* and dispatch any @-bot messages that arrived during the reconnect window but
|
|
@@ -117253,7 +116600,7 @@ var require_canvas = __commonJS({
|
|
|
117253
116600
|
});
|
|
117254
116601
|
|
|
117255
116602
|
// node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js
|
|
117256
|
-
var
|
|
116603
|
+
var require_browser = __commonJS({
|
|
117257
116604
|
"node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js"(exports) {
|
|
117258
116605
|
var canPromise = require_can_promise();
|
|
117259
116606
|
var QRCode2 = require_qrcode();
|
|
@@ -117400,7 +116747,7 @@ var require_server = __commonJS({
|
|
|
117400
116747
|
}
|
|
117401
116748
|
}
|
|
117402
116749
|
exports.create = QRCode2.create;
|
|
117403
|
-
exports.toCanvas =
|
|
116750
|
+
exports.toCanvas = require_browser().toCanvas;
|
|
117404
116751
|
exports.toString = function toString3(text, opts, cb) {
|
|
117405
116752
|
const params = checkParams(text, opts, cb);
|
|
117406
116753
|
const type2 = params.opts ? params.opts.type : void 0;
|
|
@@ -124325,6 +123672,145 @@ var jsYaml = {
|
|
|
124325
123672
|
// src/config/botLoader.ts
|
|
124326
123673
|
import { readdir, readFile } from "node:fs/promises";
|
|
124327
123674
|
import path from "node:path";
|
|
123675
|
+
|
|
123676
|
+
// src/responseSurface.ts
|
|
123677
|
+
var NonEmptyString = external_exports.string().trim().min(1);
|
|
123678
|
+
function defaultResponseSurfacePrototypeConfig() {
|
|
123679
|
+
return {
|
|
123680
|
+
enabled: false,
|
|
123681
|
+
allowed_chats: [],
|
|
123682
|
+
allowed_threads: [],
|
|
123683
|
+
lazy_card_creation: false,
|
|
123684
|
+
kill_switch: false,
|
|
123685
|
+
post_outbound_enabled: false,
|
|
123686
|
+
allowed_mention_open_ids: [],
|
|
123687
|
+
max_posts_per_turn: 1,
|
|
123688
|
+
max_posts_per_window: 4,
|
|
123689
|
+
post_window_ms: 6e4,
|
|
123690
|
+
max_post_attempts: 3,
|
|
123691
|
+
text_threshold_chars: 1200
|
|
123692
|
+
};
|
|
123693
|
+
}
|
|
123694
|
+
var DEFAULT_RESPONSE_SURFACE_PROTOTYPE = defaultResponseSurfacePrototypeConfig();
|
|
123695
|
+
var responseSurfacePrototypeConfigDefaults = () => ({
|
|
123696
|
+
enabled: false,
|
|
123697
|
+
allowed_chats: [],
|
|
123698
|
+
allowed_threads: [],
|
|
123699
|
+
lazy_card_creation: false,
|
|
123700
|
+
kill_switch: false,
|
|
123701
|
+
post_outbound_enabled: false,
|
|
123702
|
+
allowed_mention_open_ids: [],
|
|
123703
|
+
max_posts_per_turn: 1,
|
|
123704
|
+
max_posts_per_window: 4,
|
|
123705
|
+
post_window_ms: 6e4,
|
|
123706
|
+
max_post_attempts: 3,
|
|
123707
|
+
text_threshold_chars: 1200
|
|
123708
|
+
});
|
|
123709
|
+
var ResponseSurfaceModeSchema = external_exports.enum(["card", "post", "hybrid"]);
|
|
123710
|
+
var ResponseSurfacePrimarySchema = external_exports.enum(["card", "post"]);
|
|
123711
|
+
var ResponseSurfaceCapabilitySchema = external_exports.enum([
|
|
123712
|
+
"choices",
|
|
123713
|
+
"image_blocks",
|
|
123714
|
+
"content_blocks",
|
|
123715
|
+
"fallback",
|
|
123716
|
+
"audit"
|
|
123717
|
+
]);
|
|
123718
|
+
var MentionTargetSchema = external_exports.object({
|
|
123719
|
+
user_id: NonEmptyString.max(128),
|
|
123720
|
+
label: external_exports.string().trim().min(1).max(80).optional()
|
|
123721
|
+
});
|
|
123722
|
+
var ResponseSurfacePostSchema = external_exports.object({
|
|
123723
|
+
mentions: external_exports.array(MentionTargetSchema).max(5).default([])
|
|
123724
|
+
});
|
|
123725
|
+
var ResponseSurfaceCardSchema = external_exports.object({
|
|
123726
|
+
compact: external_exports.boolean().default(false),
|
|
123727
|
+
capabilities: external_exports.array(ResponseSurfaceCapabilitySchema).max(8).default([])
|
|
123728
|
+
});
|
|
123729
|
+
var StrictResponseSurfaceStateSchema = external_exports.object({
|
|
123730
|
+
mode: ResponseSurfaceModeSchema,
|
|
123731
|
+
primary: ResponseSurfacePrimarySchema.optional(),
|
|
123732
|
+
post: ResponseSurfacePostSchema.optional(),
|
|
123733
|
+
card: ResponseSurfaceCardSchema.optional()
|
|
123734
|
+
}).superRefine((surface, ctx) => {
|
|
123735
|
+
if (surface.mode === "card" && surface.primary === "post") {
|
|
123736
|
+
ctx.addIssue({
|
|
123737
|
+
code: external_exports.ZodIssueCode.custom,
|
|
123738
|
+
path: ["primary"],
|
|
123739
|
+
message: "response_surface.primary=post is incompatible with mode=card"
|
|
123740
|
+
});
|
|
123741
|
+
}
|
|
123742
|
+
});
|
|
123743
|
+
var ResponseSurfaceStateSchema = external_exports.preprocess((value) => {
|
|
123744
|
+
if (value === void 0) return void 0;
|
|
123745
|
+
const result = StrictResponseSurfaceStateSchema.safeParse(value);
|
|
123746
|
+
return result.success ? result.data : void 0;
|
|
123747
|
+
}, StrictResponseSurfaceStateSchema.optional());
|
|
123748
|
+
var ResponseSurfacePrototypeConfigSchema = external_exports.object({
|
|
123749
|
+
/**
|
|
123750
|
+
* Master gate. Default false keeps the legacy card-only response path.
|
|
123751
|
+
*/
|
|
123752
|
+
enabled: external_exports.boolean().default(false),
|
|
123753
|
+
/**
|
|
123754
|
+
* Optional chat allowlist for dark-launch experiments. Empty means no chat
|
|
123755
|
+
* is allowlisted by this gate.
|
|
123756
|
+
*/
|
|
123757
|
+
allowed_chats: external_exports.array(external_exports.string().min(1)).default([]),
|
|
123758
|
+
/**
|
|
123759
|
+
* Optional Larkway session/thread allowlist for narrow dogfood topics.
|
|
123760
|
+
* Empty means no thread is allowlisted by this gate.
|
|
123761
|
+
*/
|
|
123762
|
+
allowed_threads: external_exports.array(external_exports.string().min(1)).default([]),
|
|
123763
|
+
/**
|
|
123764
|
+
* Dark-launch hook for PR2. This does not enable post-only output by itself;
|
|
123765
|
+
* the bridge still requires a visible card fallback until post outbound
|
|
123766
|
+
* exists and is explicitly enabled in a later PR.
|
|
123767
|
+
*/
|
|
123768
|
+
lazy_card_creation: external_exports.boolean().default(false),
|
|
123769
|
+
/**
|
|
123770
|
+
* Runtime kill switch for emergency rollback. When true, every response
|
|
123771
|
+
* surface post path is treated as disabled even if enabled/allowlists are
|
|
123772
|
+
* otherwise configured. Default false preserves current default-off behavior.
|
|
123773
|
+
*/
|
|
123774
|
+
kill_switch: external_exports.boolean().default(false),
|
|
123775
|
+
/**
|
|
123776
|
+
* PR3 dark-launch gate for real post outbound. This must stay false by
|
|
123777
|
+
* default. PR4's dispatcher also requires this gate before any post path.
|
|
123778
|
+
*/
|
|
123779
|
+
post_outbound_enabled: external_exports.boolean().default(false),
|
|
123780
|
+
/**
|
|
123781
|
+
* Explicit target allowlist for future real post @ mentions. Empty means no
|
|
123782
|
+
* mention target is authorized. Keep real IDs in private bot config, never
|
|
123783
|
+
* in public docs/tests.
|
|
123784
|
+
*/
|
|
123785
|
+
allowed_mention_open_ids: external_exports.array(external_exports.string().min(1)).default([]),
|
|
123786
|
+
/**
|
|
123787
|
+
* Hard cap for surface dispatch. PR4 still keeps production post outbound
|
|
123788
|
+
* unavailable, but fake-channel dispatch tests enforce this bounded shape.
|
|
123789
|
+
*/
|
|
123790
|
+
max_posts_per_turn: external_exports.number().int().min(0).max(10).default(1),
|
|
123791
|
+
/**
|
|
123792
|
+
* Sliding-window hard cap for real post sends within one bot/chat/thread
|
|
123793
|
+
* runtime scope. This is enforced in the production handler before a post
|
|
123794
|
+
* transport call is attempted; exhausted windows degrade to visible cards.
|
|
123795
|
+
*/
|
|
123796
|
+
max_posts_per_window: external_exports.number().int().min(0).max(100).default(4),
|
|
123797
|
+
/**
|
|
123798
|
+
* Sliding-window duration for max_posts_per_window.
|
|
123799
|
+
*/
|
|
123800
|
+
post_window_ms: external_exports.number().int().min(1e3).max(864e5).default(6e4),
|
|
123801
|
+
/**
|
|
123802
|
+
* Max attempts for one logical post. Retry classification is intentionally
|
|
123803
|
+
* narrow in PR3: only 5xx errors are retryable.
|
|
123804
|
+
*/
|
|
123805
|
+
max_post_attempts: external_exports.number().int().min(1).max(5).default(3),
|
|
123806
|
+
/**
|
|
123807
|
+
* Future channel threshold for lazy card creation. Bounded so config cannot
|
|
123808
|
+
* grow unbounded or encode business rules.
|
|
123809
|
+
*/
|
|
123810
|
+
text_threshold_chars: external_exports.number().int().min(1).max(2e4).default(1200)
|
|
123811
|
+
}).default(responseSurfacePrototypeConfigDefaults);
|
|
123812
|
+
|
|
123813
|
+
// src/config/botLoader.ts
|
|
124328
123814
|
var GitIdentitySchema = external_exports.object({
|
|
124329
123815
|
name: external_exports.string().min(1),
|
|
124330
123816
|
email: external_exports.string().email()
|
|
@@ -124485,6 +123971,14 @@ var BotConfigSchema = external_exports.object({
|
|
|
124485
123971
|
* @default false — 所有现存 bot yaml 未设此字段时行为字节级不变。
|
|
124486
123972
|
*/
|
|
124487
123973
|
read_only: external_exports.boolean().default(false),
|
|
123974
|
+
/**
|
|
123975
|
+
* Dark-launch gate for the response-surface prototype.
|
|
123976
|
+
*
|
|
123977
|
+
* Default stays disabled so existing bots keep the legacy card-only path.
|
|
123978
|
+
* Even when enabled, PR1/PR2 only prepare schema/controller plumbing; post
|
|
123979
|
+
* outbound is not implemented here, so handler keeps a visible card fallback.
|
|
123980
|
+
*/
|
|
123981
|
+
response_surface_prototype: ResponseSurfacePrototypeConfigSchema,
|
|
124488
123982
|
/**
|
|
124489
123983
|
* Runtime layout used by the bridge.
|
|
124490
123984
|
*
|
|
@@ -124788,7 +124282,16 @@ var PermissionsConfig = external_exports.object({
|
|
|
124788
124282
|
* curl, wget, python3, basic POSIX tools); add things like
|
|
124789
124283
|
* "Bash(pnpm *)" / "Bash(NEXT_PUBLIC_PORT=* *)" here.
|
|
124790
124284
|
*/
|
|
124791
|
-
allowExtra: external_exports.array(external_exports.string()).default([])
|
|
124285
|
+
allowExtra: external_exports.array(external_exports.string()).default([]),
|
|
124286
|
+
/**
|
|
124287
|
+
* Permission posture for the Claude backend (and the bypass flag for Codex).
|
|
124288
|
+
* Unset (undefined) = the bridge default `bypassPermissions`, which aligns
|
|
124289
|
+
* the Claude backend with Codex's existing full-host posture and avoids
|
|
124290
|
+
* acceptEdits gating necessary Bash (e.g. lark-cli) in headless `-p` mode.
|
|
124291
|
+
* Set to `acceptEdits` / `ask` to TIGHTEN: Claude Code then routes Bash
|
|
124292
|
+
* through its allow-list gate (the stricter, future "real allow-list" path).
|
|
124293
|
+
*/
|
|
124294
|
+
mode: external_exports.enum(["acceptEdits", "ask", "bypassPermissions"]).optional()
|
|
124792
124295
|
}).default({ allowExtra: [] });
|
|
124793
124296
|
var ChatEntry = external_exports.object({
|
|
124794
124297
|
label: external_exports.string().min(1, "chats[].label is required (human-readable name)"),
|
|
@@ -125914,6 +125417,7 @@ async function runCreateBot(ctx, creds, basics) {
|
|
|
125914
125417
|
repos: basics.repos,
|
|
125915
125418
|
turn_taking_limit: basics.turnLimit ?? 10,
|
|
125916
125419
|
read_only: false,
|
|
125420
|
+
response_surface_prototype: DEFAULT_RESPONSE_SURFACE_PROTOTYPE,
|
|
125917
125421
|
runtime: "agent_workspace",
|
|
125918
125422
|
backend: basics.backend,
|
|
125919
125423
|
memory_file: memoryFile,
|
|
@@ -129247,6 +128751,7 @@ async function createBotFromCreds(opts) {
|
|
|
129247
128751
|
...git_token_env ? { git_token_env } : {},
|
|
129248
128752
|
memory_file: memoryFile,
|
|
129249
128753
|
read_only: false,
|
|
128754
|
+
response_surface_prototype: DEFAULT_RESPONSE_SURFACE_PROTOTYPE,
|
|
129250
128755
|
runtime: "agent_workspace",
|
|
129251
128756
|
backend: form.backend && form.backend.trim() ? form.backend.trim() : "codex",
|
|
129252
128757
|
// Persist the Feishu avatar URL so the Web 管理面 can show an avatar before
|