@integrity-labs/agt-cli 0.28.1166 → 0.28.1168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/agt.js +6 -6
- package/dist/{chunk-I5NQ762W.js → chunk-7IAJXJ7C.js} +304 -34
- package/dist/chunk-7IAJXJ7C.js.map +1 -0
- package/dist/{chunk-NOCTCO7G.js → chunk-AJTF72A2.js} +3 -3
- package/dist/{chunk-ZSCZDOHR.js → chunk-AV4KD3HE.js} +2 -2
- package/dist/{chunk-6KJFIVYJ.js → chunk-IV2UENRG.js} +10 -2
- package/dist/chunk-IV2UENRG.js.map +1 -0
- package/dist/{chunk-UX3TDTVM.js → chunk-Y4DBRVXD.js} +5 -5
- package/dist/{claude-code-updater-VRZ7MMKO.js → claude-code-updater-WD4NNWY5.js} +5 -3
- package/dist/{claude-pair-runtime-HOIYDAGM.js → claude-pair-runtime-JWXVVSSG.js} +3 -3
- package/dist/lib/manager-worker.js +40 -27
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +752 -482
- package/dist/mcp/index.js +611 -339
- package/dist/mcp/origami.js +593 -323
- package/dist/mcp/slack-channel.js +602 -332
- package/dist/mcp/telegram-channel.js +593 -323
- package/dist/{persistent-session-YQLP5NPI.js → persistent-session-LKJVSRHX.js} +4 -4
- package/dist/{responsiveness-probe-6K6SVHRK.js → responsiveness-probe-ZEK2TD5E.js} +4 -4
- package/dist/{session-auth-dead-M4KYOBXK.js → session-auth-dead-TSARKC55.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-6KJFIVYJ.js.map +0 -1
- package/dist/chunk-I5NQ762W.js.map +0 -1
- /package/dist/{chunk-NOCTCO7G.js.map → chunk-AJTF72A2.js.map} +0 -0
- /package/dist/{chunk-ZSCZDOHR.js.map → chunk-AV4KD3HE.js.map} +0 -0
- /package/dist/{chunk-UX3TDTVM.js.map → chunk-Y4DBRVXD.js.map} +0 -0
- /package/dist/{claude-code-updater-VRZ7MMKO.js.map → claude-code-updater-WD4NNWY5.js.map} +0 -0
- /package/dist/{claude-pair-runtime-HOIYDAGM.js.map → claude-pair-runtime-JWXVVSSG.js.map} +0 -0
- /package/dist/{persistent-session-YQLP5NPI.js.map → persistent-session-LKJVSRHX.js.map} +0 -0
- /package/dist/{responsiveness-probe-6K6SVHRK.js.map → responsiveness-probe-ZEK2TD5E.js.map} +0 -0
- /package/dist/{session-auth-dead-M4KYOBXK.js.map → session-auth-dead-TSARKC55.js.map} +0 -0
package/dist/mcp/origami.js
CHANGED
|
@@ -105,7 +105,7 @@ var require_code = __commonJS({
|
|
|
105
105
|
}
|
|
106
106
|
exports._ = _;
|
|
107
107
|
var plus = new _Code("+");
|
|
108
|
-
function
|
|
108
|
+
function str2(strs, ...args) {
|
|
109
109
|
const expr = [safeStringify(strs[0])];
|
|
110
110
|
let i = 0;
|
|
111
111
|
while (i < args.length) {
|
|
@@ -116,7 +116,7 @@ var require_code = __commonJS({
|
|
|
116
116
|
optimize(expr);
|
|
117
117
|
return new _Code(expr);
|
|
118
118
|
}
|
|
119
|
-
exports.str =
|
|
119
|
+
exports.str = str2;
|
|
120
120
|
function addCodeArg(code, arg) {
|
|
121
121
|
if (arg instanceof _Code)
|
|
122
122
|
code.push(...arg._items);
|
|
@@ -159,7 +159,7 @@ var require_code = __commonJS({
|
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
function strConcat(c1, c2) {
|
|
162
|
-
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 :
|
|
162
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str2`${c1}${c2}`;
|
|
163
163
|
}
|
|
164
164
|
exports.strConcat = strConcat;
|
|
165
165
|
function interpolate(x) {
|
|
@@ -1121,22 +1121,22 @@ var require_util = __commonJS({
|
|
|
1121
1121
|
return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
1122
1122
|
}
|
|
1123
1123
|
exports.schemaRefOrVal = schemaRefOrVal;
|
|
1124
|
-
function unescapeFragment(
|
|
1125
|
-
return unescapeJsonPointer(decodeURIComponent(
|
|
1124
|
+
function unescapeFragment(str2) {
|
|
1125
|
+
return unescapeJsonPointer(decodeURIComponent(str2));
|
|
1126
1126
|
}
|
|
1127
1127
|
exports.unescapeFragment = unescapeFragment;
|
|
1128
|
-
function escapeFragment(
|
|
1129
|
-
return encodeURIComponent(escapeJsonPointer(
|
|
1128
|
+
function escapeFragment(str2) {
|
|
1129
|
+
return encodeURIComponent(escapeJsonPointer(str2));
|
|
1130
1130
|
}
|
|
1131
1131
|
exports.escapeFragment = escapeFragment;
|
|
1132
|
-
function escapeJsonPointer(
|
|
1133
|
-
if (typeof
|
|
1134
|
-
return `${
|
|
1135
|
-
return
|
|
1132
|
+
function escapeJsonPointer(str2) {
|
|
1133
|
+
if (typeof str2 == "number")
|
|
1134
|
+
return `${str2}`;
|
|
1135
|
+
return str2.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
1136
1136
|
}
|
|
1137
1137
|
exports.escapeJsonPointer = escapeJsonPointer;
|
|
1138
|
-
function unescapeJsonPointer(
|
|
1139
|
-
return
|
|
1138
|
+
function unescapeJsonPointer(str2) {
|
|
1139
|
+
return str2.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1140
1140
|
}
|
|
1141
1141
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
1142
1142
|
function eachItem(xs, f) {
|
|
@@ -2161,8 +2161,8 @@ var require_json_schema_traverse = __commonJS({
|
|
|
2161
2161
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
2162
2162
|
}
|
|
2163
2163
|
}
|
|
2164
|
-
function escapeJsonPtr(
|
|
2165
|
-
return
|
|
2164
|
+
function escapeJsonPtr(str2) {
|
|
2165
|
+
return str2.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2166
2166
|
}
|
|
2167
2167
|
}
|
|
2168
2168
|
});
|
|
@@ -3223,10 +3223,10 @@ var require_utils = __commonJS({
|
|
|
3223
3223
|
return { host, isIPV6: false };
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
3226
|
-
function findToken(
|
|
3226
|
+
function findToken(str2, token) {
|
|
3227
3227
|
let ind = 0;
|
|
3228
|
-
for (let i = 0; i <
|
|
3229
|
-
if (
|
|
3228
|
+
for (let i = 0; i < str2.length; i++) {
|
|
3229
|
+
if (str2[i] === token) ind++;
|
|
3230
3230
|
}
|
|
3231
3231
|
return ind;
|
|
3232
3232
|
}
|
|
@@ -3879,7 +3879,7 @@ var require_core = __commonJS({
|
|
|
3879
3879
|
var util_1 = require_util();
|
|
3880
3880
|
var $dataRefSchema = require_data();
|
|
3881
3881
|
var uri_1 = require_uri();
|
|
3882
|
-
var defaultRegExp = (
|
|
3882
|
+
var defaultRegExp = (str2, flags) => new RegExp(str2, flags);
|
|
3883
3883
|
defaultRegExp.code = "new RegExp";
|
|
3884
3884
|
var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
|
|
3885
3885
|
var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -4674,16 +4674,16 @@ var require_ucs2length = __commonJS({
|
|
|
4674
4674
|
"../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
|
4675
4675
|
"use strict";
|
|
4676
4676
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4677
|
-
function ucs2length(
|
|
4678
|
-
const len =
|
|
4677
|
+
function ucs2length(str2) {
|
|
4678
|
+
const len = str2.length;
|
|
4679
4679
|
let length = 0;
|
|
4680
4680
|
let pos = 0;
|
|
4681
4681
|
let value;
|
|
4682
4682
|
while (pos < len) {
|
|
4683
4683
|
length++;
|
|
4684
|
-
value =
|
|
4684
|
+
value = str2.charCodeAt(pos++);
|
|
4685
4685
|
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
4686
|
-
value =
|
|
4686
|
+
value = str2.charCodeAt(pos);
|
|
4687
4687
|
if ((value & 64512) === 56320)
|
|
4688
4688
|
pos++;
|
|
4689
4689
|
}
|
|
@@ -6566,8 +6566,8 @@ var require_formats = __commonJS({
|
|
|
6566
6566
|
}
|
|
6567
6567
|
var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
6568
6568
|
var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
6569
|
-
function date4(
|
|
6570
|
-
const matches = DATE.exec(
|
|
6569
|
+
function date4(str2) {
|
|
6570
|
+
const matches = DATE.exec(str2);
|
|
6571
6571
|
if (!matches)
|
|
6572
6572
|
return false;
|
|
6573
6573
|
const year = +matches[1];
|
|
@@ -6586,8 +6586,8 @@ var require_formats = __commonJS({
|
|
|
6586
6586
|
}
|
|
6587
6587
|
var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
6588
6588
|
function getTime(strictTimeZone) {
|
|
6589
|
-
return function time3(
|
|
6590
|
-
const matches = TIME.exec(
|
|
6589
|
+
return function time3(str2) {
|
|
6590
|
+
const matches = TIME.exec(str2);
|
|
6591
6591
|
if (!matches)
|
|
6592
6592
|
return false;
|
|
6593
6593
|
const hr = +matches[1];
|
|
@@ -6633,8 +6633,8 @@ var require_formats = __commonJS({
|
|
|
6633
6633
|
var DATE_TIME_SEPARATOR = /t|\s/i;
|
|
6634
6634
|
function getDateTime(strictTimeZone) {
|
|
6635
6635
|
const time3 = getTime(strictTimeZone);
|
|
6636
|
-
return function date_time(
|
|
6637
|
-
const dateTime =
|
|
6636
|
+
return function date_time(str2) {
|
|
6637
|
+
const dateTime = str2.split(DATE_TIME_SEPARATOR);
|
|
6638
6638
|
return dateTime.length === 2 && date4(dateTime[0]) && time3(dateTime[1]);
|
|
6639
6639
|
};
|
|
6640
6640
|
}
|
|
@@ -6659,13 +6659,13 @@ var require_formats = __commonJS({
|
|
|
6659
6659
|
}
|
|
6660
6660
|
var NOT_URI_FRAGMENT = /\/|:/;
|
|
6661
6661
|
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
6662
|
-
function uri(
|
|
6663
|
-
return NOT_URI_FRAGMENT.test(
|
|
6662
|
+
function uri(str2) {
|
|
6663
|
+
return NOT_URI_FRAGMENT.test(str2) && URI.test(str2);
|
|
6664
6664
|
}
|
|
6665
6665
|
var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
6666
|
-
function byte(
|
|
6666
|
+
function byte(str2) {
|
|
6667
6667
|
BYTE.lastIndex = 0;
|
|
6668
|
-
return BYTE.test(
|
|
6668
|
+
return BYTE.test(str2);
|
|
6669
6669
|
}
|
|
6670
6670
|
var MIN_INT32 = -(2 ** 31);
|
|
6671
6671
|
var MAX_INT32 = 2 ** 31 - 1;
|
|
@@ -6679,11 +6679,11 @@ var require_formats = __commonJS({
|
|
|
6679
6679
|
return true;
|
|
6680
6680
|
}
|
|
6681
6681
|
var Z_ANCHOR = /[^\\]\\Z/;
|
|
6682
|
-
function regex(
|
|
6683
|
-
if (Z_ANCHOR.test(
|
|
6682
|
+
function regex(str2) {
|
|
6683
|
+
if (Z_ANCHOR.test(str2))
|
|
6684
6684
|
return false;
|
|
6685
6685
|
try {
|
|
6686
|
-
new RegExp(
|
|
6686
|
+
new RegExp(str2);
|
|
6687
6687
|
return true;
|
|
6688
6688
|
} catch (e) {
|
|
6689
6689
|
return false;
|
|
@@ -8575,13 +8575,13 @@ var require_Collection = __commonJS({
|
|
|
8575
8575
|
var require_stringifyComment = __commonJS({
|
|
8576
8576
|
"../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyComment.js"(exports) {
|
|
8577
8577
|
"use strict";
|
|
8578
|
-
var stringifyComment = (
|
|
8578
|
+
var stringifyComment = (str2) => str2.replace(/^(?!$)(?: $)?/gm, "#");
|
|
8579
8579
|
function indentComment(comment, indent) {
|
|
8580
8580
|
if (/^\n+$/.test(comment))
|
|
8581
8581
|
return comment.substring(1);
|
|
8582
8582
|
return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
|
|
8583
8583
|
}
|
|
8584
|
-
var lineComment = (
|
|
8584
|
+
var lineComment = (str2, indent, comment) => str2.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str2.endsWith(" ") ? "" : " ") + comment;
|
|
8585
8585
|
exports.indentComment = indentComment;
|
|
8586
8586
|
exports.lineComment = lineComment;
|
|
8587
8587
|
exports.stringifyComment = stringifyComment;
|
|
@@ -8735,16 +8735,16 @@ var require_stringifyString = __commonJS({
|
|
|
8735
8735
|
lineWidth: ctx.options.lineWidth,
|
|
8736
8736
|
minContentWidth: ctx.options.minContentWidth
|
|
8737
8737
|
});
|
|
8738
|
-
var containsDocumentMarker = (
|
|
8739
|
-
function lineLengthOverLimit(
|
|
8738
|
+
var containsDocumentMarker = (str2) => /^(%|---|\.\.\.)/m.test(str2);
|
|
8739
|
+
function lineLengthOverLimit(str2, lineWidth, indentLength) {
|
|
8740
8740
|
if (!lineWidth || lineWidth < 0)
|
|
8741
8741
|
return false;
|
|
8742
8742
|
const limit = lineWidth - indentLength;
|
|
8743
|
-
const strLen =
|
|
8743
|
+
const strLen = str2.length;
|
|
8744
8744
|
if (strLen <= limit)
|
|
8745
8745
|
return false;
|
|
8746
8746
|
for (let i = 0, start = 0; i < strLen; ++i) {
|
|
8747
|
-
if (
|
|
8747
|
+
if (str2[i] === "\n") {
|
|
8748
8748
|
if (i - start > limit)
|
|
8749
8749
|
return true;
|
|
8750
8750
|
start = i + 1;
|
|
@@ -8761,11 +8761,11 @@ var require_stringifyString = __commonJS({
|
|
|
8761
8761
|
const { implicitKey } = ctx;
|
|
8762
8762
|
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
8763
8763
|
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
8764
|
-
let
|
|
8764
|
+
let str2 = "";
|
|
8765
8765
|
let start = 0;
|
|
8766
8766
|
for (let i = 0, ch = json2[i]; ch; ch = json2[++i]) {
|
|
8767
8767
|
if (ch === " " && json2[i + 1] === "\\" && json2[i + 2] === "n") {
|
|
8768
|
-
|
|
8768
|
+
str2 += json2.slice(start, i) + "\\ ";
|
|
8769
8769
|
i += 1;
|
|
8770
8770
|
start = i;
|
|
8771
8771
|
ch = "\\";
|
|
@@ -8774,38 +8774,38 @@ var require_stringifyString = __commonJS({
|
|
|
8774
8774
|
switch (json2[i + 1]) {
|
|
8775
8775
|
case "u":
|
|
8776
8776
|
{
|
|
8777
|
-
|
|
8777
|
+
str2 += json2.slice(start, i);
|
|
8778
8778
|
const code = json2.substr(i + 2, 4);
|
|
8779
8779
|
switch (code) {
|
|
8780
8780
|
case "0000":
|
|
8781
|
-
|
|
8781
|
+
str2 += "\\0";
|
|
8782
8782
|
break;
|
|
8783
8783
|
case "0007":
|
|
8784
|
-
|
|
8784
|
+
str2 += "\\a";
|
|
8785
8785
|
break;
|
|
8786
8786
|
case "000b":
|
|
8787
|
-
|
|
8787
|
+
str2 += "\\v";
|
|
8788
8788
|
break;
|
|
8789
8789
|
case "001b":
|
|
8790
|
-
|
|
8790
|
+
str2 += "\\e";
|
|
8791
8791
|
break;
|
|
8792
8792
|
case "0085":
|
|
8793
|
-
|
|
8793
|
+
str2 += "\\N";
|
|
8794
8794
|
break;
|
|
8795
8795
|
case "00a0":
|
|
8796
|
-
|
|
8796
|
+
str2 += "\\_";
|
|
8797
8797
|
break;
|
|
8798
8798
|
case "2028":
|
|
8799
|
-
|
|
8799
|
+
str2 += "\\L";
|
|
8800
8800
|
break;
|
|
8801
8801
|
case "2029":
|
|
8802
|
-
|
|
8802
|
+
str2 += "\\P";
|
|
8803
8803
|
break;
|
|
8804
8804
|
default:
|
|
8805
8805
|
if (code.substr(0, 2) === "00")
|
|
8806
|
-
|
|
8806
|
+
str2 += "\\x" + code.substr(2);
|
|
8807
8807
|
else
|
|
8808
|
-
|
|
8808
|
+
str2 += json2.substr(i, 6);
|
|
8809
8809
|
}
|
|
8810
8810
|
i += 5;
|
|
8811
8811
|
start = i + 1;
|
|
@@ -8815,14 +8815,14 @@ var require_stringifyString = __commonJS({
|
|
|
8815
8815
|
if (implicitKey || json2[i + 2] === '"' || json2.length < minMultiLineLength) {
|
|
8816
8816
|
i += 1;
|
|
8817
8817
|
} else {
|
|
8818
|
-
|
|
8818
|
+
str2 += json2.slice(start, i) + "\n\n";
|
|
8819
8819
|
while (json2[i + 2] === "\\" && json2[i + 3] === "n" && json2[i + 4] !== '"') {
|
|
8820
|
-
|
|
8820
|
+
str2 += "\n";
|
|
8821
8821
|
i += 2;
|
|
8822
8822
|
}
|
|
8823
|
-
|
|
8823
|
+
str2 += indent;
|
|
8824
8824
|
if (json2[i + 2] === " ")
|
|
8825
|
-
|
|
8825
|
+
str2 += "\\";
|
|
8826
8826
|
i += 1;
|
|
8827
8827
|
start = i + 1;
|
|
8828
8828
|
}
|
|
@@ -8831,8 +8831,8 @@ var require_stringifyString = __commonJS({
|
|
|
8831
8831
|
i += 1;
|
|
8832
8832
|
}
|
|
8833
8833
|
}
|
|
8834
|
-
|
|
8835
|
-
return implicitKey ?
|
|
8834
|
+
str2 = start ? str2 + json2.slice(start) : json2;
|
|
8835
|
+
return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
8836
8836
|
}
|
|
8837
8837
|
function singleQuotedString(value, ctx) {
|
|
8838
8838
|
if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
|
|
@@ -8916,9 +8916,9 @@ ${indent}`) + "'";
|
|
|
8916
8916
|
start = start.replace(/\n+/g, `$&${indent}`);
|
|
8917
8917
|
}
|
|
8918
8918
|
const indentSize = indent ? "2" : "1";
|
|
8919
|
-
let
|
|
8919
|
+
let header2 = (startWithSpace ? indentSize : "") + chomp;
|
|
8920
8920
|
if (comment) {
|
|
8921
|
-
|
|
8921
|
+
header2 += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
|
|
8922
8922
|
if (onComment)
|
|
8923
8923
|
onComment();
|
|
8924
8924
|
}
|
|
@@ -8933,11 +8933,11 @@ ${indent}`) + "'";
|
|
|
8933
8933
|
}
|
|
8934
8934
|
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
|
|
8935
8935
|
if (!literalFallback)
|
|
8936
|
-
return `>${
|
|
8936
|
+
return `>${header2}
|
|
8937
8937
|
${indent}${body}`;
|
|
8938
8938
|
}
|
|
8939
8939
|
value = value.replace(/\n+/g, `$&${indent}`);
|
|
8940
|
-
return `|${
|
|
8940
|
+
return `|${header2}
|
|
8941
8941
|
${indent}${start}${value}${end}`;
|
|
8942
8942
|
}
|
|
8943
8943
|
function plainString(item, ctx, onComment, onChompKeep) {
|
|
@@ -8960,15 +8960,15 @@ ${indent}${start}${value}${end}`;
|
|
|
8960
8960
|
return quotedString(value, ctx);
|
|
8961
8961
|
}
|
|
8962
8962
|
}
|
|
8963
|
-
const
|
|
8963
|
+
const str2 = value.replace(/\n+/g, `$&
|
|
8964
8964
|
${indent}`);
|
|
8965
8965
|
if (actualString) {
|
|
8966
|
-
const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(
|
|
8966
|
+
const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str2);
|
|
8967
8967
|
const { compat, tags } = ctx.doc.schema;
|
|
8968
8968
|
if (tags.some(test) || compat?.some(test))
|
|
8969
8969
|
return quotedString(value, ctx);
|
|
8970
8970
|
}
|
|
8971
|
-
return implicitKey ?
|
|
8971
|
+
return implicitKey ? str2 : foldFlowLines.foldFlowLines(str2, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
8972
8972
|
}
|
|
8973
8973
|
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
8974
8974
|
const { implicitKey, inFlow } = ctx;
|
|
@@ -9120,11 +9120,11 @@ var require_stringify = __commonJS({
|
|
|
9120
9120
|
const props = stringifyProps(node, tagObj, ctx);
|
|
9121
9121
|
if (props.length > 0)
|
|
9122
9122
|
ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
|
|
9123
|
-
const
|
|
9123
|
+
const str2 = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
|
|
9124
9124
|
if (!props)
|
|
9125
|
-
return
|
|
9126
|
-
return identity.isScalar(node) ||
|
|
9127
|
-
${ctx.indent}${
|
|
9125
|
+
return str2;
|
|
9126
|
+
return identity.isScalar(node) || str2[0] === "{" || str2[0] === "[" ? `${props} ${str2}` : `${props}
|
|
9127
|
+
${ctx.indent}${str2}`;
|
|
9128
9128
|
}
|
|
9129
9129
|
exports.createStringifyContext = createStringifyContext;
|
|
9130
9130
|
exports.stringify = stringify;
|
|
@@ -9159,8 +9159,8 @@ var require_stringifyPair = __commonJS({
|
|
|
9159
9159
|
});
|
|
9160
9160
|
let keyCommentDone = false;
|
|
9161
9161
|
let chompKeep = false;
|
|
9162
|
-
let
|
|
9163
|
-
if (!explicitKey && !ctx.inFlow &&
|
|
9162
|
+
let str2 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
9163
|
+
if (!explicitKey && !ctx.inFlow && str2.length > 1024) {
|
|
9164
9164
|
if (simpleKeys)
|
|
9165
9165
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
9166
9166
|
explicitKey = true;
|
|
@@ -9169,27 +9169,27 @@ var require_stringifyPair = __commonJS({
|
|
|
9169
9169
|
if (allNullValues || value == null) {
|
|
9170
9170
|
if (keyCommentDone && onComment)
|
|
9171
9171
|
onComment();
|
|
9172
|
-
return
|
|
9172
|
+
return str2 === "" ? "?" : explicitKey ? `? ${str2}` : str2;
|
|
9173
9173
|
}
|
|
9174
9174
|
} else if (allNullValues && !simpleKeys || value == null && explicitKey) {
|
|
9175
|
-
|
|
9175
|
+
str2 = `? ${str2}`;
|
|
9176
9176
|
if (keyComment && !keyCommentDone) {
|
|
9177
|
-
|
|
9177
|
+
str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
|
|
9178
9178
|
} else if (chompKeep && onChompKeep)
|
|
9179
9179
|
onChompKeep();
|
|
9180
|
-
return
|
|
9180
|
+
return str2;
|
|
9181
9181
|
}
|
|
9182
9182
|
if (keyCommentDone)
|
|
9183
9183
|
keyComment = null;
|
|
9184
9184
|
if (explicitKey) {
|
|
9185
9185
|
if (keyComment)
|
|
9186
|
-
|
|
9187
|
-
|
|
9186
|
+
str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
|
|
9187
|
+
str2 = `? ${str2}
|
|
9188
9188
|
${indent}:`;
|
|
9189
9189
|
} else {
|
|
9190
|
-
|
|
9190
|
+
str2 = `${str2}:`;
|
|
9191
9191
|
if (keyComment)
|
|
9192
|
-
|
|
9192
|
+
str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(keyComment));
|
|
9193
9193
|
}
|
|
9194
9194
|
let vsb, vcb, valueComment;
|
|
9195
9195
|
if (identity.isNode(value)) {
|
|
@@ -9205,7 +9205,7 @@ ${indent}:`;
|
|
|
9205
9205
|
}
|
|
9206
9206
|
ctx.implicitKey = false;
|
|
9207
9207
|
if (!explicitKey && !keyComment && identity.isScalar(value))
|
|
9208
|
-
ctx.indentAtStart =
|
|
9208
|
+
ctx.indentAtStart = str2.length + 1;
|
|
9209
9209
|
chompKeep = false;
|
|
9210
9210
|
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
|
|
9211
9211
|
ctx.indent = ctx.indent.substring(2);
|
|
@@ -9249,16 +9249,16 @@ ${ctx.indent}`;
|
|
|
9249
9249
|
} else if (valueStr === "" || valueStr[0] === "\n") {
|
|
9250
9250
|
ws = "";
|
|
9251
9251
|
}
|
|
9252
|
-
|
|
9252
|
+
str2 += ws + valueStr;
|
|
9253
9253
|
if (ctx.inFlow) {
|
|
9254
9254
|
if (valueCommentDone && onComment)
|
|
9255
9255
|
onComment();
|
|
9256
9256
|
} else if (valueComment && !valueCommentDone) {
|
|
9257
|
-
|
|
9257
|
+
str2 += stringifyComment.lineComment(str2, ctx.indent, commentString(valueComment));
|
|
9258
9258
|
} else if (chompKeep && onChompKeep) {
|
|
9259
9259
|
onChompKeep();
|
|
9260
9260
|
}
|
|
9261
|
-
return
|
|
9261
|
+
return str2;
|
|
9262
9262
|
}
|
|
9263
9263
|
exports.stringifyPair = stringifyPair;
|
|
9264
9264
|
}
|
|
@@ -9485,31 +9485,31 @@ var require_stringifyCollection = __commonJS({
|
|
|
9485
9485
|
}
|
|
9486
9486
|
}
|
|
9487
9487
|
chompKeep = false;
|
|
9488
|
-
let
|
|
9488
|
+
let str3 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
9489
9489
|
if (comment2)
|
|
9490
|
-
|
|
9490
|
+
str3 += stringifyComment.lineComment(str3, itemIndent, commentString(comment2));
|
|
9491
9491
|
if (chompKeep && comment2)
|
|
9492
9492
|
chompKeep = false;
|
|
9493
|
-
lines.push(blockItemPrefix +
|
|
9493
|
+
lines.push(blockItemPrefix + str3);
|
|
9494
9494
|
}
|
|
9495
|
-
let
|
|
9495
|
+
let str2;
|
|
9496
9496
|
if (lines.length === 0) {
|
|
9497
|
-
|
|
9497
|
+
str2 = flowChars.start + flowChars.end;
|
|
9498
9498
|
} else {
|
|
9499
|
-
|
|
9499
|
+
str2 = lines[0];
|
|
9500
9500
|
for (let i = 1; i < lines.length; ++i) {
|
|
9501
9501
|
const line = lines[i];
|
|
9502
|
-
|
|
9502
|
+
str2 += line ? `
|
|
9503
9503
|
${indent}${line}` : "\n";
|
|
9504
9504
|
}
|
|
9505
9505
|
}
|
|
9506
9506
|
if (comment) {
|
|
9507
|
-
|
|
9507
|
+
str2 += "\n" + stringifyComment.indentComment(commentString(comment), indent);
|
|
9508
9508
|
if (onComment)
|
|
9509
9509
|
onComment();
|
|
9510
9510
|
} else if (chompKeep && onChompKeep)
|
|
9511
9511
|
onChompKeep();
|
|
9512
|
-
return
|
|
9512
|
+
return str2;
|
|
9513
9513
|
}
|
|
9514
9514
|
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
|
|
9515
9515
|
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
|
|
@@ -9552,21 +9552,21 @@ ${indent}${line}` : "\n";
|
|
|
9552
9552
|
}
|
|
9553
9553
|
if (comment)
|
|
9554
9554
|
reqNewline = true;
|
|
9555
|
-
let
|
|
9556
|
-
reqNewline || (reqNewline = lines.length > linesAtValue ||
|
|
9555
|
+
let str2 = stringify.stringify(item, itemCtx, () => comment = null);
|
|
9556
|
+
reqNewline || (reqNewline = lines.length > linesAtValue || str2.includes("\n"));
|
|
9557
9557
|
if (i < items.length - 1) {
|
|
9558
|
-
|
|
9558
|
+
str2 += ",";
|
|
9559
9559
|
} else if (ctx.options.trailingComma) {
|
|
9560
9560
|
if (ctx.options.lineWidth > 0) {
|
|
9561
|
-
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (
|
|
9561
|
+
reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str2.length + 2) > ctx.options.lineWidth);
|
|
9562
9562
|
}
|
|
9563
9563
|
if (reqNewline) {
|
|
9564
|
-
|
|
9564
|
+
str2 += ",";
|
|
9565
9565
|
}
|
|
9566
9566
|
}
|
|
9567
9567
|
if (comment)
|
|
9568
|
-
|
|
9569
|
-
lines.push(
|
|
9568
|
+
str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment));
|
|
9569
|
+
lines.push(str2);
|
|
9570
9570
|
linesAtValue = lines.length;
|
|
9571
9571
|
}
|
|
9572
9572
|
const { start, end } = flowChars;
|
|
@@ -9578,11 +9578,11 @@ ${indent}${line}` : "\n";
|
|
|
9578
9578
|
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
|
|
9579
9579
|
}
|
|
9580
9580
|
if (reqNewline) {
|
|
9581
|
-
let
|
|
9581
|
+
let str2 = start;
|
|
9582
9582
|
for (const line of lines)
|
|
9583
|
-
|
|
9583
|
+
str2 += line ? `
|
|
9584
9584
|
${indentStep}${indent}${line}` : "\n";
|
|
9585
|
-
return `${
|
|
9585
|
+
return `${str2}
|
|
9586
9586
|
${indent}${end}`;
|
|
9587
9587
|
} else {
|
|
9588
9588
|
return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
|
|
@@ -9914,7 +9914,7 @@ var require_string = __commonJS({
|
|
|
9914
9914
|
identify: (value) => typeof value === "string",
|
|
9915
9915
|
default: true,
|
|
9916
9916
|
tag: "tag:yaml.org,2002:str",
|
|
9917
|
-
resolve: (
|
|
9917
|
+
resolve: (str2) => str2,
|
|
9918
9918
|
stringify(item, ctx, onComment, onChompKeep) {
|
|
9919
9919
|
ctx = Object.assign({ actualString: true }, ctx);
|
|
9920
9920
|
return stringifyString.stringifyString(item, ctx, onComment, onChompKeep);
|
|
@@ -9952,7 +9952,7 @@ var require_bool = __commonJS({
|
|
|
9952
9952
|
default: true,
|
|
9953
9953
|
tag: "tag:yaml.org,2002:bool",
|
|
9954
9954
|
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
|
|
9955
|
-
resolve: (
|
|
9955
|
+
resolve: (str2) => new Scalar.Scalar(str2[0] === "t" || str2[0] === "T"),
|
|
9956
9956
|
stringify({ source, value }, ctx) {
|
|
9957
9957
|
if (source && boolTag.test.test(source)) {
|
|
9958
9958
|
const sv = source[0] === "t" || source[0] === "T";
|
|
@@ -10004,7 +10004,7 @@ var require_float = __commonJS({
|
|
|
10004
10004
|
default: true,
|
|
10005
10005
|
tag: "tag:yaml.org,2002:float",
|
|
10006
10006
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
10007
|
-
resolve: (
|
|
10007
|
+
resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
10008
10008
|
stringify: stringifyNumber.stringifyNumber
|
|
10009
10009
|
};
|
|
10010
10010
|
var floatExp = {
|
|
@@ -10013,7 +10013,7 @@ var require_float = __commonJS({
|
|
|
10013
10013
|
tag: "tag:yaml.org,2002:float",
|
|
10014
10014
|
format: "EXP",
|
|
10015
10015
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
|
|
10016
|
-
resolve: (
|
|
10016
|
+
resolve: (str2) => parseFloat(str2),
|
|
10017
10017
|
stringify(node) {
|
|
10018
10018
|
const num = Number(node.value);
|
|
10019
10019
|
return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
|
|
@@ -10024,11 +10024,11 @@ var require_float = __commonJS({
|
|
|
10024
10024
|
default: true,
|
|
10025
10025
|
tag: "tag:yaml.org,2002:float",
|
|
10026
10026
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
|
|
10027
|
-
resolve(
|
|
10028
|
-
const node = new Scalar.Scalar(parseFloat(
|
|
10029
|
-
const dot =
|
|
10030
|
-
if (dot !== -1 &&
|
|
10031
|
-
node.minFractionDigits =
|
|
10027
|
+
resolve(str2) {
|
|
10028
|
+
const node = new Scalar.Scalar(parseFloat(str2));
|
|
10029
|
+
const dot = str2.indexOf(".");
|
|
10030
|
+
if (dot !== -1 && str2[str2.length - 1] === "0")
|
|
10031
|
+
node.minFractionDigits = str2.length - dot - 1;
|
|
10032
10032
|
return node;
|
|
10033
10033
|
},
|
|
10034
10034
|
stringify: stringifyNumber.stringifyNumber
|
|
@@ -10045,7 +10045,7 @@ var require_int = __commonJS({
|
|
|
10045
10045
|
"use strict";
|
|
10046
10046
|
var stringifyNumber = require_stringifyNumber();
|
|
10047
10047
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
10048
|
-
var intResolve = (
|
|
10048
|
+
var intResolve = (str2, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2.substring(offset), radix);
|
|
10049
10049
|
function intStringify(node, radix, prefix) {
|
|
10050
10050
|
const { value } = node;
|
|
10051
10051
|
if (intIdentify(value) && value >= 0)
|
|
@@ -10058,7 +10058,7 @@ var require_int = __commonJS({
|
|
|
10058
10058
|
tag: "tag:yaml.org,2002:int",
|
|
10059
10059
|
format: "OCT",
|
|
10060
10060
|
test: /^0o[0-7]+$/,
|
|
10061
|
-
resolve: (
|
|
10061
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 2, 8, opt),
|
|
10062
10062
|
stringify: (node) => intStringify(node, 8, "0o")
|
|
10063
10063
|
};
|
|
10064
10064
|
var int2 = {
|
|
@@ -10066,7 +10066,7 @@ var require_int = __commonJS({
|
|
|
10066
10066
|
default: true,
|
|
10067
10067
|
tag: "tag:yaml.org,2002:int",
|
|
10068
10068
|
test: /^[-+]?[0-9]+$/,
|
|
10069
|
-
resolve: (
|
|
10069
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
|
|
10070
10070
|
stringify: stringifyNumber.stringifyNumber
|
|
10071
10071
|
};
|
|
10072
10072
|
var intHex = {
|
|
@@ -10075,7 +10075,7 @@ var require_int = __commonJS({
|
|
|
10075
10075
|
tag: "tag:yaml.org,2002:int",
|
|
10076
10076
|
format: "HEX",
|
|
10077
10077
|
test: /^0x[0-9a-fA-F]+$/,
|
|
10078
|
-
resolve: (
|
|
10078
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
|
|
10079
10079
|
stringify: (node) => intStringify(node, 16, "0x")
|
|
10080
10080
|
};
|
|
10081
10081
|
exports.int = int2;
|
|
@@ -10128,7 +10128,7 @@ var require_schema3 = __commonJS({
|
|
|
10128
10128
|
identify: (value) => typeof value === "string",
|
|
10129
10129
|
default: true,
|
|
10130
10130
|
tag: "tag:yaml.org,2002:str",
|
|
10131
|
-
resolve: (
|
|
10131
|
+
resolve: (str2) => str2,
|
|
10132
10132
|
stringify: stringifyJSON
|
|
10133
10133
|
},
|
|
10134
10134
|
{
|
|
@@ -10145,7 +10145,7 @@ var require_schema3 = __commonJS({
|
|
|
10145
10145
|
default: true,
|
|
10146
10146
|
tag: "tag:yaml.org,2002:bool",
|
|
10147
10147
|
test: /^true$|^false$/,
|
|
10148
|
-
resolve: (
|
|
10148
|
+
resolve: (str2) => str2 === "true",
|
|
10149
10149
|
stringify: stringifyJSON
|
|
10150
10150
|
},
|
|
10151
10151
|
{
|
|
@@ -10153,7 +10153,7 @@ var require_schema3 = __commonJS({
|
|
|
10153
10153
|
default: true,
|
|
10154
10154
|
tag: "tag:yaml.org,2002:int",
|
|
10155
10155
|
test: /^-?(?:0|[1-9][0-9]*)$/,
|
|
10156
|
-
resolve: (
|
|
10156
|
+
resolve: (str2, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2, 10),
|
|
10157
10157
|
stringify: ({ value }) => intIdentify(value) ? value.toString() : JSON.stringify(value)
|
|
10158
10158
|
},
|
|
10159
10159
|
{
|
|
@@ -10161,7 +10161,7 @@ var require_schema3 = __commonJS({
|
|
|
10161
10161
|
default: true,
|
|
10162
10162
|
tag: "tag:yaml.org,2002:float",
|
|
10163
10163
|
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
|
|
10164
|
-
resolve: (
|
|
10164
|
+
resolve: (str2) => parseFloat(str2),
|
|
10165
10165
|
stringify: stringifyJSON
|
|
10166
10166
|
}
|
|
10167
10167
|
];
|
|
@@ -10169,9 +10169,9 @@ var require_schema3 = __commonJS({
|
|
|
10169
10169
|
default: true,
|
|
10170
10170
|
tag: "",
|
|
10171
10171
|
test: /^/,
|
|
10172
|
-
resolve(
|
|
10173
|
-
onError(`Unresolved plain scalar ${JSON.stringify(
|
|
10174
|
-
return
|
|
10172
|
+
resolve(str2, onError) {
|
|
10173
|
+
onError(`Unresolved plain scalar ${JSON.stringify(str2)}`);
|
|
10174
|
+
return str2;
|
|
10175
10175
|
}
|
|
10176
10176
|
};
|
|
10177
10177
|
var schema = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
@@ -10203,10 +10203,10 @@ var require_binary = __commonJS({
|
|
|
10203
10203
|
if (typeof node_buffer.Buffer === "function") {
|
|
10204
10204
|
return node_buffer.Buffer.from(src, "base64");
|
|
10205
10205
|
} else if (typeof atob === "function") {
|
|
10206
|
-
const
|
|
10207
|
-
const buffer = new Uint8Array(
|
|
10208
|
-
for (let i = 0; i <
|
|
10209
|
-
buffer[i] =
|
|
10206
|
+
const str2 = atob(src.replace(/[\n\r]/g, ""));
|
|
10207
|
+
const buffer = new Uint8Array(str2.length);
|
|
10208
|
+
for (let i = 0; i < str2.length; ++i)
|
|
10209
|
+
buffer[i] = str2.charCodeAt(i);
|
|
10210
10210
|
return buffer;
|
|
10211
10211
|
} else {
|
|
10212
10212
|
onError("This environment does not support reading binary tags; either Buffer or atob is required");
|
|
@@ -10217,28 +10217,28 @@ var require_binary = __commonJS({
|
|
|
10217
10217
|
if (!value)
|
|
10218
10218
|
return "";
|
|
10219
10219
|
const buf = value;
|
|
10220
|
-
let
|
|
10220
|
+
let str2;
|
|
10221
10221
|
if (typeof node_buffer.Buffer === "function") {
|
|
10222
|
-
|
|
10222
|
+
str2 = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
|
|
10223
10223
|
} else if (typeof btoa === "function") {
|
|
10224
10224
|
let s = "";
|
|
10225
10225
|
for (let i = 0; i < buf.length; ++i)
|
|
10226
10226
|
s += String.fromCharCode(buf[i]);
|
|
10227
|
-
|
|
10227
|
+
str2 = btoa(s);
|
|
10228
10228
|
} else {
|
|
10229
10229
|
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
|
|
10230
10230
|
}
|
|
10231
10231
|
type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
|
|
10232
10232
|
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
10233
10233
|
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
|
|
10234
|
-
const n = Math.ceil(
|
|
10234
|
+
const n = Math.ceil(str2.length / lineWidth);
|
|
10235
10235
|
const lines = new Array(n);
|
|
10236
10236
|
for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
|
|
10237
|
-
lines[i] =
|
|
10237
|
+
lines[i] = str2.substr(o, lineWidth);
|
|
10238
10238
|
}
|
|
10239
|
-
|
|
10239
|
+
str2 = lines.join(type === Scalar.Scalar.BLOCK_LITERAL ? "\n" : " ");
|
|
10240
10240
|
}
|
|
10241
|
-
return stringifyString.stringifyString({ comment, type, value:
|
|
10241
|
+
return stringifyString.stringifyString({ comment, type, value: str2 }, ctx, onComment, onChompKeep);
|
|
10242
10242
|
}
|
|
10243
10243
|
};
|
|
10244
10244
|
exports.binary = binary;
|
|
@@ -10444,7 +10444,7 @@ var require_float2 = __commonJS({
|
|
|
10444
10444
|
default: true,
|
|
10445
10445
|
tag: "tag:yaml.org,2002:float",
|
|
10446
10446
|
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
10447
|
-
resolve: (
|
|
10447
|
+
resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
10448
10448
|
stringify: stringifyNumber.stringifyNumber
|
|
10449
10449
|
};
|
|
10450
10450
|
var floatExp = {
|
|
@@ -10453,7 +10453,7 @@ var require_float2 = __commonJS({
|
|
|
10453
10453
|
tag: "tag:yaml.org,2002:float",
|
|
10454
10454
|
format: "EXP",
|
|
10455
10455
|
test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
|
|
10456
|
-
resolve: (
|
|
10456
|
+
resolve: (str2) => parseFloat(str2.replace(/_/g, "")),
|
|
10457
10457
|
stringify(node) {
|
|
10458
10458
|
const num = Number(node.value);
|
|
10459
10459
|
return isFinite(num) ? num.toExponential() : stringifyNumber.stringifyNumber(node);
|
|
@@ -10464,11 +10464,11 @@ var require_float2 = __commonJS({
|
|
|
10464
10464
|
default: true,
|
|
10465
10465
|
tag: "tag:yaml.org,2002:float",
|
|
10466
10466
|
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
|
|
10467
|
-
resolve(
|
|
10468
|
-
const node = new Scalar.Scalar(parseFloat(
|
|
10469
|
-
const dot =
|
|
10467
|
+
resolve(str2) {
|
|
10468
|
+
const node = new Scalar.Scalar(parseFloat(str2.replace(/_/g, "")));
|
|
10469
|
+
const dot = str2.indexOf(".");
|
|
10470
10470
|
if (dot !== -1) {
|
|
10471
|
-
const f =
|
|
10471
|
+
const f = str2.substring(dot + 1).replace(/_/g, "");
|
|
10472
10472
|
if (f[f.length - 1] === "0")
|
|
10473
10473
|
node.minFractionDigits = f.length;
|
|
10474
10474
|
}
|
|
@@ -10488,34 +10488,34 @@ var require_int2 = __commonJS({
|
|
|
10488
10488
|
"use strict";
|
|
10489
10489
|
var stringifyNumber = require_stringifyNumber();
|
|
10490
10490
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
10491
|
-
function intResolve(
|
|
10492
|
-
const sign =
|
|
10491
|
+
function intResolve(str2, offset, radix, { intAsBigInt }) {
|
|
10492
|
+
const sign = str2[0];
|
|
10493
10493
|
if (sign === "-" || sign === "+")
|
|
10494
10494
|
offset += 1;
|
|
10495
|
-
|
|
10495
|
+
str2 = str2.substring(offset).replace(/_/g, "");
|
|
10496
10496
|
if (intAsBigInt) {
|
|
10497
10497
|
switch (radix) {
|
|
10498
10498
|
case 2:
|
|
10499
|
-
|
|
10499
|
+
str2 = `0b${str2}`;
|
|
10500
10500
|
break;
|
|
10501
10501
|
case 8:
|
|
10502
|
-
|
|
10502
|
+
str2 = `0o${str2}`;
|
|
10503
10503
|
break;
|
|
10504
10504
|
case 16:
|
|
10505
|
-
|
|
10505
|
+
str2 = `0x${str2}`;
|
|
10506
10506
|
break;
|
|
10507
10507
|
}
|
|
10508
|
-
const n2 = BigInt(
|
|
10508
|
+
const n2 = BigInt(str2);
|
|
10509
10509
|
return sign === "-" ? BigInt(-1) * n2 : n2;
|
|
10510
10510
|
}
|
|
10511
|
-
const n = parseInt(
|
|
10511
|
+
const n = parseInt(str2, radix);
|
|
10512
10512
|
return sign === "-" ? -1 * n : n;
|
|
10513
10513
|
}
|
|
10514
10514
|
function intStringify(node, radix, prefix) {
|
|
10515
10515
|
const { value } = node;
|
|
10516
10516
|
if (intIdentify(value)) {
|
|
10517
|
-
const
|
|
10518
|
-
return value < 0 ? "-" + prefix +
|
|
10517
|
+
const str2 = value.toString(radix);
|
|
10518
|
+
return value < 0 ? "-" + prefix + str2.substr(1) : prefix + str2;
|
|
10519
10519
|
}
|
|
10520
10520
|
return stringifyNumber.stringifyNumber(node);
|
|
10521
10521
|
}
|
|
@@ -10525,7 +10525,7 @@ var require_int2 = __commonJS({
|
|
|
10525
10525
|
tag: "tag:yaml.org,2002:int",
|
|
10526
10526
|
format: "BIN",
|
|
10527
10527
|
test: /^[-+]?0b[0-1_]+$/,
|
|
10528
|
-
resolve: (
|
|
10528
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 2, 2, opt),
|
|
10529
10529
|
stringify: (node) => intStringify(node, 2, "0b")
|
|
10530
10530
|
};
|
|
10531
10531
|
var intOct = {
|
|
@@ -10534,7 +10534,7 @@ var require_int2 = __commonJS({
|
|
|
10534
10534
|
tag: "tag:yaml.org,2002:int",
|
|
10535
10535
|
format: "OCT",
|
|
10536
10536
|
test: /^[-+]?0[0-7_]+$/,
|
|
10537
|
-
resolve: (
|
|
10537
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 1, 8, opt),
|
|
10538
10538
|
stringify: (node) => intStringify(node, 8, "0")
|
|
10539
10539
|
};
|
|
10540
10540
|
var int2 = {
|
|
@@ -10542,7 +10542,7 @@ var require_int2 = __commonJS({
|
|
|
10542
10542
|
default: true,
|
|
10543
10543
|
tag: "tag:yaml.org,2002:int",
|
|
10544
10544
|
test: /^[-+]?[0-9][0-9_]*$/,
|
|
10545
|
-
resolve: (
|
|
10545
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt),
|
|
10546
10546
|
stringify: stringifyNumber.stringifyNumber
|
|
10547
10547
|
};
|
|
10548
10548
|
var intHex = {
|
|
@@ -10551,7 +10551,7 @@ var require_int2 = __commonJS({
|
|
|
10551
10551
|
tag: "tag:yaml.org,2002:int",
|
|
10552
10552
|
format: "HEX",
|
|
10553
10553
|
test: /^[-+]?0x[0-9a-fA-F_]+$/,
|
|
10554
|
-
resolve: (
|
|
10554
|
+
resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt),
|
|
10555
10555
|
stringify: (node) => intStringify(node, 16, "0x")
|
|
10556
10556
|
};
|
|
10557
10557
|
exports.int = int2;
|
|
@@ -10655,9 +10655,9 @@ var require_timestamp = __commonJS({
|
|
|
10655
10655
|
"../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) {
|
|
10656
10656
|
"use strict";
|
|
10657
10657
|
var stringifyNumber = require_stringifyNumber();
|
|
10658
|
-
function parseSexagesimal(
|
|
10659
|
-
const sign =
|
|
10660
|
-
const parts = sign === "-" || sign === "+" ?
|
|
10658
|
+
function parseSexagesimal(str2, asBigInt) {
|
|
10659
|
+
const sign = str2[0];
|
|
10660
|
+
const parts = sign === "-" || sign === "+" ? str2.substring(1) : str2;
|
|
10661
10661
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
10662
10662
|
const res = parts.replace(/_/g, "").split(":").reduce((res2, p2) => res2 * num(60) + num(p2), num(0));
|
|
10663
10663
|
return sign === "-" ? num(-1) * res : res;
|
|
@@ -10694,7 +10694,7 @@ var require_timestamp = __commonJS({
|
|
|
10694
10694
|
tag: "tag:yaml.org,2002:int",
|
|
10695
10695
|
format: "TIME",
|
|
10696
10696
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
|
|
10697
|
-
resolve: (
|
|
10697
|
+
resolve: (str2, _onError, { intAsBigInt }) => parseSexagesimal(str2, intAsBigInt),
|
|
10698
10698
|
stringify: stringifySexagesimal
|
|
10699
10699
|
};
|
|
10700
10700
|
var floatTime = {
|
|
@@ -10703,7 +10703,7 @@ var require_timestamp = __commonJS({
|
|
|
10703
10703
|
tag: "tag:yaml.org,2002:float",
|
|
10704
10704
|
format: "TIME",
|
|
10705
10705
|
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
|
|
10706
|
-
resolve: (
|
|
10706
|
+
resolve: (str2) => parseSexagesimal(str2, false),
|
|
10707
10707
|
stringify: stringifySexagesimal
|
|
10708
10708
|
};
|
|
10709
10709
|
var timestamp = {
|
|
@@ -10714,8 +10714,8 @@ var require_timestamp = __commonJS({
|
|
|
10714
10714
|
// may be omitted altogether, resulting in a date format. In such a case, the time part is
|
|
10715
10715
|
// assumed to be 00:00:00Z (start of day, UTC).
|
|
10716
10716
|
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
|
|
10717
|
-
resolve(
|
|
10718
|
-
const match =
|
|
10717
|
+
resolve(str2) {
|
|
10718
|
+
const match = str2.match(timestamp.test);
|
|
10719
10719
|
if (!match)
|
|
10720
10720
|
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
|
|
10721
10721
|
const [, year, month, day, hour, minute, second] = match.map(Number);
|
|
@@ -12040,10 +12040,10 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12040
12040
|
var Scalar = require_Scalar();
|
|
12041
12041
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
12042
12042
|
const start = scalar.offset;
|
|
12043
|
-
const
|
|
12044
|
-
if (!
|
|
12043
|
+
const header2 = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
12044
|
+
if (!header2)
|
|
12045
12045
|
return { value: "", type: null, comment: "", range: [start, start, start] };
|
|
12046
|
-
const type =
|
|
12046
|
+
const type = header2.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
|
|
12047
12047
|
const lines = scalar.source ? splitLines(scalar.source) : [];
|
|
12048
12048
|
let chompStart = lines.length;
|
|
12049
12049
|
for (let i = lines.length - 1; i >= 0; --i) {
|
|
@@ -12054,26 +12054,26 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12054
12054
|
break;
|
|
12055
12055
|
}
|
|
12056
12056
|
if (chompStart === 0) {
|
|
12057
|
-
const value2 =
|
|
12058
|
-
let end2 = start +
|
|
12057
|
+
const value2 = header2.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : "";
|
|
12058
|
+
let end2 = start + header2.length;
|
|
12059
12059
|
if (scalar.source)
|
|
12060
12060
|
end2 += scalar.source.length;
|
|
12061
|
-
return { value: value2, type, comment:
|
|
12061
|
+
return { value: value2, type, comment: header2.comment, range: [start, end2, end2] };
|
|
12062
12062
|
}
|
|
12063
|
-
let trimIndent = scalar.indent +
|
|
12064
|
-
let offset = scalar.offset +
|
|
12063
|
+
let trimIndent = scalar.indent + header2.indent;
|
|
12064
|
+
let offset = scalar.offset + header2.length;
|
|
12065
12065
|
let contentStart = 0;
|
|
12066
12066
|
for (let i = 0; i < chompStart; ++i) {
|
|
12067
12067
|
const [indent, content] = lines[i];
|
|
12068
12068
|
if (content === "" || content === "\r") {
|
|
12069
|
-
if (
|
|
12069
|
+
if (header2.indent === 0 && indent.length > trimIndent)
|
|
12070
12070
|
trimIndent = indent.length;
|
|
12071
12071
|
} else {
|
|
12072
12072
|
if (indent.length < trimIndent) {
|
|
12073
12073
|
const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
|
|
12074
12074
|
onError(offset + indent.length, "MISSING_CHAR", message);
|
|
12075
12075
|
}
|
|
12076
|
-
if (
|
|
12076
|
+
if (header2.indent === 0)
|
|
12077
12077
|
trimIndent = indent.length;
|
|
12078
12078
|
contentStart = i;
|
|
12079
12079
|
if (trimIndent === 0 && !ctx.atRoot) {
|
|
@@ -12100,7 +12100,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12100
12100
|
if (crlf)
|
|
12101
12101
|
content = content.slice(0, -1);
|
|
12102
12102
|
if (content && indent.length < trimIndent) {
|
|
12103
|
-
const src =
|
|
12103
|
+
const src = header2.indent ? "explicit indentation indicator" : "first line";
|
|
12104
12104
|
const message = `Block scalar lines must not be less indented than their ${src}`;
|
|
12105
12105
|
onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
|
|
12106
12106
|
indent = "";
|
|
@@ -12127,7 +12127,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12127
12127
|
prevMoreIndented = false;
|
|
12128
12128
|
}
|
|
12129
12129
|
}
|
|
12130
|
-
switch (
|
|
12130
|
+
switch (header2.chomp) {
|
|
12131
12131
|
case "-":
|
|
12132
12132
|
break;
|
|
12133
12133
|
case "+":
|
|
@@ -12139,8 +12139,8 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
12139
12139
|
default:
|
|
12140
12140
|
value += "\n";
|
|
12141
12141
|
}
|
|
12142
|
-
const end = start +
|
|
12143
|
-
return { value, type, comment:
|
|
12142
|
+
const end = start + header2.length + scalar.source.length;
|
|
12143
|
+
return { value, type, comment: header2.comment, range: [start, end, end] };
|
|
12144
12144
|
}
|
|
12145
12145
|
function parseBlockScalarHeader({ offset, props }, strict, onError) {
|
|
12146
12146
|
if (props[0].type !== "block-scalar-header") {
|
|
@@ -12976,10 +12976,10 @@ var require_cst_scalar = __commonJS({
|
|
|
12976
12976
|
type = "QUOTE_DOUBLE";
|
|
12977
12977
|
break;
|
|
12978
12978
|
case "block-scalar": {
|
|
12979
|
-
const
|
|
12980
|
-
if (
|
|
12979
|
+
const header2 = token.props[0];
|
|
12980
|
+
if (header2.type !== "block-scalar-header")
|
|
12981
12981
|
throw new Error("Invalid block scalar header");
|
|
12982
|
-
type =
|
|
12982
|
+
type = header2.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL";
|
|
12983
12983
|
break;
|
|
12984
12984
|
}
|
|
12985
12985
|
default:
|
|
@@ -13011,10 +13011,10 @@ var require_cst_scalar = __commonJS({
|
|
|
13011
13011
|
const head = source.substring(0, he);
|
|
13012
13012
|
const body = source.substring(he + 1) + "\n";
|
|
13013
13013
|
if (token.type === "block-scalar") {
|
|
13014
|
-
const
|
|
13015
|
-
if (
|
|
13014
|
+
const header2 = token.props[0];
|
|
13015
|
+
if (header2.type !== "block-scalar-header")
|
|
13016
13016
|
throw new Error("Invalid block scalar header");
|
|
13017
|
-
|
|
13017
|
+
header2.source = head;
|
|
13018
13018
|
token.source = body;
|
|
13019
13019
|
} else {
|
|
13020
13020
|
const { offset } = token;
|
|
@@ -15135,11 +15135,11 @@ var require_lib = __commonJS({
|
|
|
15135
15135
|
}
|
|
15136
15136
|
_exports.without = without;
|
|
15137
15137
|
function repeat(char_, n) {
|
|
15138
|
-
var
|
|
15138
|
+
var str2 = "";
|
|
15139
15139
|
for (var i = 0; i < n; i++) {
|
|
15140
|
-
|
|
15140
|
+
str2 += char_;
|
|
15141
15141
|
}
|
|
15142
|
-
return
|
|
15142
|
+
return str2;
|
|
15143
15143
|
}
|
|
15144
15144
|
_exports.repeat = repeat;
|
|
15145
15145
|
function each(obj, func, context) {
|
|
@@ -15482,10 +15482,10 @@ var require_lexer2 = __commonJS({
|
|
|
15482
15482
|
};
|
|
15483
15483
|
}
|
|
15484
15484
|
var Tokenizer = /* @__PURE__ */ (function() {
|
|
15485
|
-
function Tokenizer2(
|
|
15486
|
-
this.str =
|
|
15485
|
+
function Tokenizer2(str2, opts) {
|
|
15486
|
+
this.str = str2;
|
|
15487
15487
|
this.index = 0;
|
|
15488
|
-
this.len =
|
|
15488
|
+
this.len = str2.length;
|
|
15489
15489
|
this.lineno = 0;
|
|
15490
15490
|
this.colno = 0;
|
|
15491
15491
|
this.in_code = false;
|
|
@@ -15683,44 +15683,44 @@ var require_lexer2 = __commonJS({
|
|
|
15683
15683
|
};
|
|
15684
15684
|
_proto._parseString = function _parseString(delimiter) {
|
|
15685
15685
|
this.forward();
|
|
15686
|
-
var
|
|
15686
|
+
var str2 = "";
|
|
15687
15687
|
while (!this.isFinished() && this.current() !== delimiter) {
|
|
15688
15688
|
var cur = this.current();
|
|
15689
15689
|
if (cur === "\\") {
|
|
15690
15690
|
this.forward();
|
|
15691
15691
|
switch (this.current()) {
|
|
15692
15692
|
case "n":
|
|
15693
|
-
|
|
15693
|
+
str2 += "\n";
|
|
15694
15694
|
break;
|
|
15695
15695
|
case "t":
|
|
15696
|
-
|
|
15696
|
+
str2 += " ";
|
|
15697
15697
|
break;
|
|
15698
15698
|
case "r":
|
|
15699
|
-
|
|
15699
|
+
str2 += "\r";
|
|
15700
15700
|
break;
|
|
15701
15701
|
default:
|
|
15702
|
-
|
|
15702
|
+
str2 += this.current();
|
|
15703
15703
|
}
|
|
15704
15704
|
this.forward();
|
|
15705
15705
|
} else {
|
|
15706
|
-
|
|
15706
|
+
str2 += cur;
|
|
15707
15707
|
this.forward();
|
|
15708
15708
|
}
|
|
15709
15709
|
}
|
|
15710
15710
|
this.forward();
|
|
15711
|
-
return
|
|
15711
|
+
return str2;
|
|
15712
15712
|
};
|
|
15713
|
-
_proto._matches = function _matches(
|
|
15714
|
-
if (this.index +
|
|
15713
|
+
_proto._matches = function _matches(str2) {
|
|
15714
|
+
if (this.index + str2.length > this.len) {
|
|
15715
15715
|
return null;
|
|
15716
15716
|
}
|
|
15717
|
-
var m = this.str.slice(this.index, this.index +
|
|
15718
|
-
return m ===
|
|
15717
|
+
var m = this.str.slice(this.index, this.index + str2.length);
|
|
15718
|
+
return m === str2;
|
|
15719
15719
|
};
|
|
15720
|
-
_proto._extractString = function _extractString(
|
|
15721
|
-
if (this._matches(
|
|
15722
|
-
this.forwardN(
|
|
15723
|
-
return
|
|
15720
|
+
_proto._extractString = function _extractString(str2) {
|
|
15721
|
+
if (this._matches(str2)) {
|
|
15722
|
+
this.forwardN(str2.length);
|
|
15723
|
+
return str2;
|
|
15724
15724
|
}
|
|
15725
15725
|
return null;
|
|
15726
15726
|
};
|
|
@@ -16247,8 +16247,8 @@ var require_nodes = __commonJS({
|
|
|
16247
16247
|
fields: ["extName", "prop", "args", "contentArgs"]
|
|
16248
16248
|
});
|
|
16249
16249
|
var CallExtensionAsync = CallExtension.extend("CallExtensionAsync");
|
|
16250
|
-
function print(
|
|
16251
|
-
var lines =
|
|
16250
|
+
function print(str2, indent, inline) {
|
|
16251
|
+
var lines = str2.split("\n");
|
|
16252
16252
|
lines.forEach(function(line, i) {
|
|
16253
16253
|
if (line && (inline && i > 0 || !inline)) {
|
|
16254
16254
|
process.stdout.write(" ".repeat(indent));
|
|
@@ -16843,7 +16843,7 @@ var require_parser2 = __commonJS({
|
|
|
16843
16843
|
var endTagName = "end" + tagName;
|
|
16844
16844
|
var rawBlockRegex = new RegExp("([\\s\\S]*?){%\\s*(" + tagName + "|" + endTagName + ")\\s*(?=%})%}");
|
|
16845
16845
|
var rawLevel = 1;
|
|
16846
|
-
var
|
|
16846
|
+
var str2 = "";
|
|
16847
16847
|
var matches = null;
|
|
16848
16848
|
var begun = this.advanceAfterBlockEnd();
|
|
16849
16849
|
while ((matches = this.tokens._extractRegex(rawBlockRegex)) && rawLevel > 0) {
|
|
@@ -16856,13 +16856,13 @@ var require_parser2 = __commonJS({
|
|
|
16856
16856
|
rawLevel -= 1;
|
|
16857
16857
|
}
|
|
16858
16858
|
if (rawLevel === 0) {
|
|
16859
|
-
|
|
16859
|
+
str2 += pre;
|
|
16860
16860
|
this.tokens.backN(all.length - pre.length);
|
|
16861
16861
|
} else {
|
|
16862
|
-
|
|
16862
|
+
str2 += all;
|
|
16863
16863
|
}
|
|
16864
16864
|
}
|
|
16865
|
-
return new nodes.Output(begun.lineno, begun.colno, [new nodes.TemplateData(begun.lineno, begun.colno,
|
|
16865
|
+
return new nodes.Output(begun.lineno, begun.colno, [new nodes.TemplateData(begun.lineno, begun.colno, str2)]);
|
|
16866
16866
|
};
|
|
16867
16867
|
_proto.parsePostfix = function parsePostfix(node) {
|
|
16868
16868
|
var lookup;
|
|
@@ -18078,9 +18078,9 @@ var require_compiler = __commonJS({
|
|
|
18078
18078
|
}
|
|
18079
18079
|
this._emit(") === true");
|
|
18080
18080
|
};
|
|
18081
|
-
_proto._binOpEmitter = function _binOpEmitter(node, frame,
|
|
18081
|
+
_proto._binOpEmitter = function _binOpEmitter(node, frame, str2) {
|
|
18082
18082
|
this.compile(node.left, frame);
|
|
18083
|
-
this._emit(
|
|
18083
|
+
this._emit(str2);
|
|
18084
18084
|
this.compile(node.right, frame);
|
|
18085
18085
|
};
|
|
18086
18086
|
_proto.compileOr = function compileOr(node, frame) {
|
|
@@ -18762,22 +18762,22 @@ var require_filters = __commonJS({
|
|
|
18762
18762
|
return res;
|
|
18763
18763
|
}
|
|
18764
18764
|
_exports.batch = batch;
|
|
18765
|
-
function capitalize(
|
|
18766
|
-
|
|
18767
|
-
var ret =
|
|
18768
|
-
return r.copySafeness(
|
|
18765
|
+
function capitalize(str2) {
|
|
18766
|
+
str2 = normalize(str2, "");
|
|
18767
|
+
var ret = str2.toLowerCase();
|
|
18768
|
+
return r.copySafeness(str2, ret.charAt(0).toUpperCase() + ret.slice(1));
|
|
18769
18769
|
}
|
|
18770
18770
|
_exports.capitalize = capitalize;
|
|
18771
|
-
function center(
|
|
18772
|
-
|
|
18771
|
+
function center(str2, width) {
|
|
18772
|
+
str2 = normalize(str2, "");
|
|
18773
18773
|
width = width || 80;
|
|
18774
|
-
if (
|
|
18775
|
-
return
|
|
18774
|
+
if (str2.length >= width) {
|
|
18775
|
+
return str2;
|
|
18776
18776
|
}
|
|
18777
|
-
var spaces = width -
|
|
18777
|
+
var spaces = width - str2.length;
|
|
18778
18778
|
var pre = lib.repeat(" ", spaces / 2 - spaces % 2);
|
|
18779
18779
|
var post = lib.repeat(" ", spaces / 2);
|
|
18780
|
-
return r.copySafeness(
|
|
18780
|
+
return r.copySafeness(str2, pre + str2 + post);
|
|
18781
18781
|
}
|
|
18782
18782
|
_exports.center = center;
|
|
18783
18783
|
function default_(val, def, bool) {
|
|
@@ -18824,47 +18824,47 @@ var require_filters = __commonJS({
|
|
|
18824
18824
|
return JSON.stringify(obj, null, spaces);
|
|
18825
18825
|
}
|
|
18826
18826
|
_exports.dump = dump;
|
|
18827
|
-
function escape2(
|
|
18828
|
-
if (
|
|
18829
|
-
return
|
|
18827
|
+
function escape2(str2) {
|
|
18828
|
+
if (str2 instanceof r.SafeString) {
|
|
18829
|
+
return str2;
|
|
18830
18830
|
}
|
|
18831
|
-
|
|
18832
|
-
return r.markSafe(lib.escape(
|
|
18831
|
+
str2 = str2 === null || str2 === void 0 ? "" : str2;
|
|
18832
|
+
return r.markSafe(lib.escape(str2.toString()));
|
|
18833
18833
|
}
|
|
18834
18834
|
_exports.escape = escape2;
|
|
18835
|
-
function safe(
|
|
18836
|
-
if (
|
|
18837
|
-
return
|
|
18835
|
+
function safe(str2) {
|
|
18836
|
+
if (str2 instanceof r.SafeString) {
|
|
18837
|
+
return str2;
|
|
18838
18838
|
}
|
|
18839
|
-
|
|
18840
|
-
return r.markSafe(
|
|
18839
|
+
str2 = str2 === null || str2 === void 0 ? "" : str2;
|
|
18840
|
+
return r.markSafe(str2.toString());
|
|
18841
18841
|
}
|
|
18842
18842
|
_exports.safe = safe;
|
|
18843
18843
|
function first(arr) {
|
|
18844
18844
|
return arr[0];
|
|
18845
18845
|
}
|
|
18846
18846
|
_exports.first = first;
|
|
18847
|
-
function forceescape(
|
|
18848
|
-
|
|
18849
|
-
return r.markSafe(lib.escape(
|
|
18847
|
+
function forceescape(str2) {
|
|
18848
|
+
str2 = str2 === null || str2 === void 0 ? "" : str2;
|
|
18849
|
+
return r.markSafe(lib.escape(str2.toString()));
|
|
18850
18850
|
}
|
|
18851
18851
|
_exports.forceescape = forceescape;
|
|
18852
18852
|
function groupby(arr, attr) {
|
|
18853
18853
|
return lib.groupBy(arr, attr, this.env.opts.throwOnUndefined);
|
|
18854
18854
|
}
|
|
18855
18855
|
_exports.groupby = groupby;
|
|
18856
|
-
function indent(
|
|
18857
|
-
|
|
18858
|
-
if (
|
|
18856
|
+
function indent(str2, width, indentfirst) {
|
|
18857
|
+
str2 = normalize(str2, "");
|
|
18858
|
+
if (str2 === "") {
|
|
18859
18859
|
return "";
|
|
18860
18860
|
}
|
|
18861
18861
|
width = width || 4;
|
|
18862
|
-
var lines =
|
|
18862
|
+
var lines = str2.split("\n");
|
|
18863
18863
|
var sp = lib.repeat(" ", width);
|
|
18864
18864
|
var res = lines.map(function(l, i) {
|
|
18865
18865
|
return i === 0 && !indentfirst ? l : "" + sp + l;
|
|
18866
18866
|
}).join("\n");
|
|
18867
|
-
return r.copySafeness(
|
|
18867
|
+
return r.copySafeness(str2, res);
|
|
18868
18868
|
}
|
|
18869
18869
|
_exports.indent = indent;
|
|
18870
18870
|
function join(arr, del, attr) {
|
|
@@ -18913,16 +18913,16 @@ var require_filters = __commonJS({
|
|
|
18913
18913
|
}
|
|
18914
18914
|
}
|
|
18915
18915
|
_exports.list = list;
|
|
18916
|
-
function lower(
|
|
18917
|
-
|
|
18918
|
-
return
|
|
18916
|
+
function lower(str2) {
|
|
18917
|
+
str2 = normalize(str2, "");
|
|
18918
|
+
return str2.toLowerCase();
|
|
18919
18919
|
}
|
|
18920
18920
|
_exports.lower = lower;
|
|
18921
|
-
function nl2br(
|
|
18922
|
-
if (
|
|
18921
|
+
function nl2br(str2) {
|
|
18922
|
+
if (str2 === null || str2 === void 0) {
|
|
18923
18923
|
return "";
|
|
18924
18924
|
}
|
|
18925
|
-
return r.copySafeness(
|
|
18925
|
+
return r.copySafeness(str2, str2.replace(/\r\n|\n/g, "<br />\n"));
|
|
18926
18926
|
}
|
|
18927
18927
|
_exports.nl2br = nl2br;
|
|
18928
18928
|
function random(arr) {
|
|
@@ -18956,10 +18956,10 @@ var require_filters = __commonJS({
|
|
|
18956
18956
|
});
|
|
18957
18957
|
}
|
|
18958
18958
|
_exports.selectattr = selectattr;
|
|
18959
|
-
function replace(
|
|
18960
|
-
var originalStr =
|
|
18959
|
+
function replace(str2, old, new_, maxCount) {
|
|
18960
|
+
var originalStr = str2;
|
|
18961
18961
|
if (old instanceof RegExp) {
|
|
18962
|
-
return
|
|
18962
|
+
return str2.replace(old, new_);
|
|
18963
18963
|
}
|
|
18964
18964
|
if (typeof maxCount === "undefined") {
|
|
18965
18965
|
maxCount = -1;
|
|
@@ -18968,32 +18968,32 @@ var require_filters = __commonJS({
|
|
|
18968
18968
|
if (typeof old === "number") {
|
|
18969
18969
|
old = "" + old;
|
|
18970
18970
|
} else if (typeof old !== "string") {
|
|
18971
|
-
return
|
|
18971
|
+
return str2;
|
|
18972
18972
|
}
|
|
18973
|
-
if (typeof
|
|
18974
|
-
|
|
18973
|
+
if (typeof str2 === "number") {
|
|
18974
|
+
str2 = "" + str2;
|
|
18975
18975
|
}
|
|
18976
|
-
if (typeof
|
|
18977
|
-
return
|
|
18976
|
+
if (typeof str2 !== "string" && !(str2 instanceof r.SafeString)) {
|
|
18977
|
+
return str2;
|
|
18978
18978
|
}
|
|
18979
18979
|
if (old === "") {
|
|
18980
|
-
res = new_ +
|
|
18981
|
-
return r.copySafeness(
|
|
18980
|
+
res = new_ + str2.split("").join(new_) + new_;
|
|
18981
|
+
return r.copySafeness(str2, res);
|
|
18982
18982
|
}
|
|
18983
|
-
var nextIndex =
|
|
18983
|
+
var nextIndex = str2.indexOf(old);
|
|
18984
18984
|
if (maxCount === 0 || nextIndex === -1) {
|
|
18985
|
-
return
|
|
18985
|
+
return str2;
|
|
18986
18986
|
}
|
|
18987
18987
|
var pos = 0;
|
|
18988
18988
|
var count = 0;
|
|
18989
18989
|
while (nextIndex > -1 && (maxCount === -1 || count < maxCount)) {
|
|
18990
|
-
res +=
|
|
18990
|
+
res += str2.substring(pos, nextIndex) + new_;
|
|
18991
18991
|
pos = nextIndex + old.length;
|
|
18992
18992
|
count++;
|
|
18993
|
-
nextIndex =
|
|
18993
|
+
nextIndex = str2.indexOf(old, pos);
|
|
18994
18994
|
}
|
|
18995
|
-
if (pos <
|
|
18996
|
-
res +=
|
|
18995
|
+
if (pos < str2.length) {
|
|
18996
|
+
res += str2.substring(pos);
|
|
18997
18997
|
}
|
|
18998
18998
|
return r.copySafeness(originalStr, res);
|
|
18999
18999
|
}
|
|
@@ -19105,16 +19105,16 @@ var require_filters = __commonJS({
|
|
|
19105
19105
|
return r.copySafeness(input, res);
|
|
19106
19106
|
}
|
|
19107
19107
|
_exports.striptags = striptags;
|
|
19108
|
-
function title(
|
|
19109
|
-
|
|
19110
|
-
var words =
|
|
19108
|
+
function title(str2) {
|
|
19109
|
+
str2 = normalize(str2, "");
|
|
19110
|
+
var words = str2.split(" ").map(function(word) {
|
|
19111
19111
|
return capitalize(word);
|
|
19112
19112
|
});
|
|
19113
|
-
return r.copySafeness(
|
|
19113
|
+
return r.copySafeness(str2, words.join(" "));
|
|
19114
19114
|
}
|
|
19115
19115
|
_exports.title = title;
|
|
19116
|
-
function trim(
|
|
19117
|
-
return r.copySafeness(
|
|
19116
|
+
function trim(str2) {
|
|
19117
|
+
return r.copySafeness(str2, str2.replace(/^\s*|\s*$/g, ""));
|
|
19118
19118
|
}
|
|
19119
19119
|
_exports.trim = trim;
|
|
19120
19120
|
function truncate2(input, length, killwords, end) {
|
|
@@ -19137,9 +19137,9 @@ var require_filters = __commonJS({
|
|
|
19137
19137
|
return r.copySafeness(orig, input);
|
|
19138
19138
|
}
|
|
19139
19139
|
_exports.truncate = truncate2;
|
|
19140
|
-
function upper(
|
|
19141
|
-
|
|
19142
|
-
return
|
|
19140
|
+
function upper(str2) {
|
|
19141
|
+
str2 = normalize(str2, "");
|
|
19142
|
+
return str2.toUpperCase();
|
|
19143
19143
|
}
|
|
19144
19144
|
_exports.upper = upper;
|
|
19145
19145
|
function urlencode(obj) {
|
|
@@ -19160,12 +19160,12 @@ var require_filters = __commonJS({
|
|
|
19160
19160
|
var httpHttpsRe = /^https?:\/\/.*$/;
|
|
19161
19161
|
var wwwRe = /^www\./;
|
|
19162
19162
|
var tldRe = /\.(?:org|net|com)(?:\:|\/|$)/;
|
|
19163
|
-
function urlize(
|
|
19163
|
+
function urlize(str2, length, nofollow) {
|
|
19164
19164
|
if (isNaN2(length)) {
|
|
19165
19165
|
length = Infinity;
|
|
19166
19166
|
}
|
|
19167
19167
|
var noFollowAttr = nofollow === true ? ' rel="nofollow"' : "";
|
|
19168
|
-
var words =
|
|
19168
|
+
var words = str2.split(/(\s+)/).filter(function(word) {
|
|
19169
19169
|
return word && word.length;
|
|
19170
19170
|
}).map(function(word) {
|
|
19171
19171
|
var matches = word.match(puncRe);
|
|
@@ -19188,9 +19188,9 @@ var require_filters = __commonJS({
|
|
|
19188
19188
|
return words.join("");
|
|
19189
19189
|
}
|
|
19190
19190
|
_exports.urlize = urlize;
|
|
19191
|
-
function wordcount(
|
|
19192
|
-
|
|
19193
|
-
var words =
|
|
19191
|
+
function wordcount(str2) {
|
|
19192
|
+
str2 = normalize(str2, "");
|
|
19193
|
+
var words = str2 ? str2.match(/\w+/g) : null;
|
|
19194
19194
|
return words ? words.length : null;
|
|
19195
19195
|
}
|
|
19196
19196
|
_exports.wordcount = wordcount;
|
|
@@ -20392,18 +20392,18 @@ var require_chokidar = __commonJS({
|
|
|
20392
20392
|
return paths.map(normalizePathToUnix);
|
|
20393
20393
|
};
|
|
20394
20394
|
var toUnix = (string3) => {
|
|
20395
|
-
let
|
|
20395
|
+
let str2 = string3.replace(BACK_SLASH_RE, SLASH);
|
|
20396
20396
|
let prepend = false;
|
|
20397
|
-
if (
|
|
20397
|
+
if (str2.startsWith(SLASH_SLASH)) {
|
|
20398
20398
|
prepend = true;
|
|
20399
20399
|
}
|
|
20400
|
-
while (
|
|
20401
|
-
|
|
20400
|
+
while (str2.match(DOUBLE_SLASH_RE)) {
|
|
20401
|
+
str2 = str2.replace(DOUBLE_SLASH_RE, SLASH);
|
|
20402
20402
|
}
|
|
20403
20403
|
if (prepend) {
|
|
20404
|
-
|
|
20404
|
+
str2 = SLASH + str2;
|
|
20405
20405
|
}
|
|
20406
|
-
return
|
|
20406
|
+
return str2;
|
|
20407
20407
|
};
|
|
20408
20408
|
var normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path)));
|
|
20409
20409
|
var normalizeIgnored = (cwd = "") => (path) => {
|
|
@@ -21924,7 +21924,7 @@ var require_precompile = __commonJS({
|
|
|
21924
21924
|
return filename.match(pattern);
|
|
21925
21925
|
});
|
|
21926
21926
|
}
|
|
21927
|
-
function precompileString(
|
|
21927
|
+
function precompileString(str2, opts) {
|
|
21928
21928
|
opts = opts || {};
|
|
21929
21929
|
opts.isString = true;
|
|
21930
21930
|
var env2 = opts.env || new Environment([]);
|
|
@@ -21932,7 +21932,7 @@ var require_precompile = __commonJS({
|
|
|
21932
21932
|
if (!opts.name) {
|
|
21933
21933
|
throw new Error('the "name" option is required when compiling a string');
|
|
21934
21934
|
}
|
|
21935
|
-
return wrapper([_precompile(
|
|
21935
|
+
return wrapper([_precompile(str2, opts.name, env2)], opts);
|
|
21936
21936
|
}
|
|
21937
21937
|
function precompile(input, opts) {
|
|
21938
21938
|
opts = opts || {};
|
|
@@ -21978,14 +21978,14 @@ var require_precompile = __commonJS({
|
|
|
21978
21978
|
}
|
|
21979
21979
|
return wrapper(precompiled, opts);
|
|
21980
21980
|
}
|
|
21981
|
-
function _precompile(
|
|
21981
|
+
function _precompile(str2, name, env2) {
|
|
21982
21982
|
env2 = env2 || new Environment([]);
|
|
21983
21983
|
var asyncFilters = env2.asyncFilters;
|
|
21984
21984
|
var extensions = env2.extensionsList;
|
|
21985
21985
|
var template;
|
|
21986
21986
|
name = name.replace(/\\/g, "/");
|
|
21987
21987
|
try {
|
|
21988
|
-
template = compiler.compile(
|
|
21988
|
+
template = compiler.compile(str2, asyncFilters, extensions, name, env2.opts);
|
|
21989
21989
|
} catch (err) {
|
|
21990
21990
|
throw _prettifyError(name, false, err);
|
|
21991
21991
|
}
|
|
@@ -22635,14 +22635,14 @@ function promiseAllObject(promisesObj) {
|
|
|
22635
22635
|
}
|
|
22636
22636
|
function randomString(length = 10) {
|
|
22637
22637
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
22638
|
-
let
|
|
22638
|
+
let str2 = "";
|
|
22639
22639
|
for (let i = 0; i < length; i++) {
|
|
22640
|
-
|
|
22640
|
+
str2 += chars[Math.floor(Math.random() * chars.length)];
|
|
22641
22641
|
}
|
|
22642
|
-
return
|
|
22642
|
+
return str2;
|
|
22643
22643
|
}
|
|
22644
|
-
function esc(
|
|
22645
|
-
return JSON.stringify(
|
|
22644
|
+
function esc(str2) {
|
|
22645
|
+
return JSON.stringify(str2);
|
|
22646
22646
|
}
|
|
22647
22647
|
function slugify(input) {
|
|
22648
22648
|
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -22742,8 +22742,8 @@ var getParsedType = (data) => {
|
|
|
22742
22742
|
};
|
|
22743
22743
|
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
22744
22744
|
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
|
|
22745
|
-
function escapeRegex(
|
|
22746
|
-
return
|
|
22745
|
+
function escapeRegex(str2) {
|
|
22746
|
+
return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
22747
22747
|
}
|
|
22748
22748
|
function clone(inst, def, params) {
|
|
22749
22749
|
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
@@ -24394,10 +24394,10 @@ function isValidJWT(token, algorithm = null) {
|
|
|
24394
24394
|
const tokensParts = token.split(".");
|
|
24395
24395
|
if (tokensParts.length !== 3)
|
|
24396
24396
|
return false;
|
|
24397
|
-
const [
|
|
24398
|
-
if (!
|
|
24397
|
+
const [header2] = tokensParts;
|
|
24398
|
+
if (!header2)
|
|
24399
24399
|
return false;
|
|
24400
|
-
const parsedHeader = JSON.parse(atob(
|
|
24400
|
+
const parsedHeader = JSON.parse(atob(header2));
|
|
24401
24401
|
if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
|
|
24402
24402
|
return false;
|
|
24403
24403
|
if (!parsedHeader.alg)
|
|
@@ -31663,10 +31663,10 @@ function isValidJWT2(jwt2, alg) {
|
|
|
31663
31663
|
if (!jwtRegex.test(jwt2))
|
|
31664
31664
|
return false;
|
|
31665
31665
|
try {
|
|
31666
|
-
const [
|
|
31667
|
-
if (!
|
|
31666
|
+
const [header2] = jwt2.split(".");
|
|
31667
|
+
if (!header2)
|
|
31668
31668
|
return false;
|
|
31669
|
-
const base643 =
|
|
31669
|
+
const base643 = header2.replace(/-/g, "+").replace(/_/g, "/").padEnd(header2.length + (4 - header2.length % 4) % 4, "=");
|
|
31670
31670
|
const decoded = JSON.parse(atob(base643));
|
|
31671
31671
|
if (typeof decoded !== "object" || decoded === null)
|
|
31672
31672
|
return false;
|
|
@@ -43293,33 +43293,45 @@ function resolvePreset(config2) {
|
|
|
43293
43293
|
...typeof payload === "string" && payload ? { payloadPath: payload } : {}
|
|
43294
43294
|
};
|
|
43295
43295
|
}
|
|
43296
|
-
function
|
|
43297
|
-
const out = {};
|
|
43296
|
+
function validateOperatorText(input, out) {
|
|
43298
43297
|
const name = input["name"];
|
|
43299
43298
|
if (name !== void 0) {
|
|
43300
43299
|
if (typeof name !== "string")
|
|
43301
|
-
return
|
|
43300
|
+
return "name must be a string";
|
|
43302
43301
|
const trimmed = name.trim();
|
|
43303
43302
|
if (trimmed.length > WEBHOOK_NAME_MAX_CHARS) {
|
|
43304
|
-
return
|
|
43303
|
+
return `name must be at most ${WEBHOOK_NAME_MAX_CHARS} characters`;
|
|
43305
43304
|
}
|
|
43306
43305
|
if (trimmed)
|
|
43307
43306
|
out["name"] = trimmed;
|
|
43308
43307
|
}
|
|
43309
43308
|
const instruction = input["instruction"];
|
|
43310
43309
|
if (typeof instruction !== "string" || !instruction.trim()) {
|
|
43311
|
-
return
|
|
43312
|
-
ok: false,
|
|
43313
|
-
error: "instruction is required: tell the agent what to do when an event arrives"
|
|
43314
|
-
};
|
|
43310
|
+
return "instruction is required: tell the agent what to do when an event arrives";
|
|
43315
43311
|
}
|
|
43316
43312
|
if (instruction.trim().length > WEBHOOK_INSTRUCTION_MAX_CHARS) {
|
|
43317
|
-
return {
|
|
43318
|
-
ok: false,
|
|
43319
|
-
error: `instruction must be at most ${WEBHOOK_INSTRUCTION_MAX_CHARS} characters`
|
|
43320
|
-
};
|
|
43313
|
+
return `instruction must be at most ${WEBHOOK_INSTRUCTION_MAX_CHARS} characters`;
|
|
43321
43314
|
}
|
|
43322
43315
|
out["instruction"] = instruction.trim();
|
|
43316
|
+
return null;
|
|
43317
|
+
}
|
|
43318
|
+
function validateRateCapConfig(input, out) {
|
|
43319
|
+
const cap = input["max_events_per_hour"];
|
|
43320
|
+
if (cap !== void 0 && cap !== null) {
|
|
43321
|
+
if (typeof cap !== "number" || !Number.isInteger(cap) || cap < 1 || cap > WEBHOOK_MAX_RATE_CAP) {
|
|
43322
|
+
return `max_events_per_hour must be an integer from 1 to ${WEBHOOK_MAX_RATE_CAP}`;
|
|
43323
|
+
}
|
|
43324
|
+
out["max_events_per_hour"] = cap;
|
|
43325
|
+
} else {
|
|
43326
|
+
out["max_events_per_hour"] = WEBHOOK_DEFAULT_RATE_CAP;
|
|
43327
|
+
}
|
|
43328
|
+
return null;
|
|
43329
|
+
}
|
|
43330
|
+
function validateWebhookConfig(input) {
|
|
43331
|
+
const out = {};
|
|
43332
|
+
const textError = validateOperatorText(input, out);
|
|
43333
|
+
if (textError)
|
|
43334
|
+
return { ok: false, error: textError };
|
|
43323
43335
|
const preset = input["preset"] ?? "generic";
|
|
43324
43336
|
if (typeof preset !== "string" || !Object.prototype.hasOwnProperty.call(WEBHOOK_PRESETS, preset)) {
|
|
43325
43337
|
return {
|
|
@@ -43337,18 +43349,9 @@ function validateWebhookConfig(input) {
|
|
|
43337
43349
|
}
|
|
43338
43350
|
out[key] = v;
|
|
43339
43351
|
}
|
|
43340
|
-
const
|
|
43341
|
-
if (
|
|
43342
|
-
|
|
43343
|
-
return {
|
|
43344
|
-
ok: false,
|
|
43345
|
-
error: `max_events_per_hour must be an integer from 1 to ${WEBHOOK_MAX_RATE_CAP}`
|
|
43346
|
-
};
|
|
43347
|
-
}
|
|
43348
|
-
out["max_events_per_hour"] = cap;
|
|
43349
|
-
} else {
|
|
43350
|
-
out["max_events_per_hour"] = WEBHOOK_DEFAULT_RATE_CAP;
|
|
43351
|
-
}
|
|
43352
|
+
const capError = validateRateCapConfig(input, out);
|
|
43353
|
+
if (capError)
|
|
43354
|
+
return { ok: false, error: capError };
|
|
43352
43355
|
return { ok: true, config: out };
|
|
43353
43356
|
}
|
|
43354
43357
|
function webhookRateCap(trigger) {
|
|
@@ -43411,6 +43414,273 @@ var webhookTriggerAdapter = {
|
|
|
43411
43414
|
};
|
|
43412
43415
|
registerTriggerSource(webhookTriggerAdapter);
|
|
43413
43416
|
|
|
43417
|
+
// ../core/dist/triggers/adapters/github.js
|
|
43418
|
+
var GITHUB_TRIGGER_PROVIDER = "github";
|
|
43419
|
+
var GITHUB_MAX_BODY_BYTES = 5 * 1024 * 1024;
|
|
43420
|
+
var GITHUB_SIGNATURE_HEADER = "x-hub-signature-256";
|
|
43421
|
+
var GITHUB_EVENT_HEADER = "x-github-event";
|
|
43422
|
+
var GITHUB_DELIVERY_HEADER = "x-github-delivery";
|
|
43423
|
+
var GITHUB_EVENT_RULES = {
|
|
43424
|
+
pull_request: { actions: ["closed", "dequeued", "labeled"] },
|
|
43425
|
+
pull_request_review: { actions: ["submitted"] },
|
|
43426
|
+
check_suite: { actions: ["completed"] },
|
|
43427
|
+
issues: { actions: ["opened", "closed"] },
|
|
43428
|
+
issue_comment: { actions: ["created"] }
|
|
43429
|
+
};
|
|
43430
|
+
var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
|
|
43431
|
+
var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
|
|
43432
|
+
var LOGIN = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})(?:\[bot\])?$/;
|
|
43433
|
+
var LABEL_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._:/+-]{0,49}$/;
|
|
43434
|
+
var SHA = /^[0-9a-f]{40}$/;
|
|
43435
|
+
var GUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
43436
|
+
var REASON_TOKEN = /^(?=.{1,40}$)[a-z]+(?:_[a-z]+){0,3}$/;
|
|
43437
|
+
var APP_SLUG = /^[a-z0-9][a-z0-9-]{0,99}$/;
|
|
43438
|
+
var REVIEW_STATES = /* @__PURE__ */ new Set(["approved", "changes_requested", "commented", "dismissed"]);
|
|
43439
|
+
var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
|
|
43440
|
+
"success",
|
|
43441
|
+
"failure",
|
|
43442
|
+
"neutral",
|
|
43443
|
+
"cancelled",
|
|
43444
|
+
"timed_out",
|
|
43445
|
+
"action_required",
|
|
43446
|
+
"stale",
|
|
43447
|
+
"skipped",
|
|
43448
|
+
"startup_failure"
|
|
43449
|
+
]);
|
|
43450
|
+
var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
|
|
43451
|
+
function asDict(v) {
|
|
43452
|
+
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
|
|
43453
|
+
}
|
|
43454
|
+
function str(v) {
|
|
43455
|
+
return typeof v === "string" && v.length > 0 ? v : null;
|
|
43456
|
+
}
|
|
43457
|
+
function shaped(v, re) {
|
|
43458
|
+
const s = str(v);
|
|
43459
|
+
return s !== null && re.test(s) ? s : null;
|
|
43460
|
+
}
|
|
43461
|
+
function posInt(v) {
|
|
43462
|
+
return typeof v === "number" && Number.isInteger(v) && v > 0 ? v : null;
|
|
43463
|
+
}
|
|
43464
|
+
function header(headers, name) {
|
|
43465
|
+
const v = headers[name] ?? headers[name.toLowerCase()];
|
|
43466
|
+
return typeof v === "string" && v.length > 0 ? v : null;
|
|
43467
|
+
}
|
|
43468
|
+
function inSet(v, set2) {
|
|
43469
|
+
const s = str(v)?.toLowerCase() ?? null;
|
|
43470
|
+
return s !== null && set2.has(s) ? s : null;
|
|
43471
|
+
}
|
|
43472
|
+
function extractGithubFacts(event, payload) {
|
|
43473
|
+
const rule = Object.hasOwn(GITHUB_EVENT_RULES, event) ? GITHUB_EVENT_RULES[event] : void 0;
|
|
43474
|
+
if (!rule)
|
|
43475
|
+
return null;
|
|
43476
|
+
const root = asDict(payload);
|
|
43477
|
+
if (!root)
|
|
43478
|
+
return null;
|
|
43479
|
+
const rawAction = str(root["action"]);
|
|
43480
|
+
const action = rule.actions.find((a) => a === rawAction);
|
|
43481
|
+
if (!action)
|
|
43482
|
+
return null;
|
|
43483
|
+
const repo = shaped(asDict(root["repository"])?.["full_name"], REPO_FULL_NAME);
|
|
43484
|
+
if (!repo)
|
|
43485
|
+
return null;
|
|
43486
|
+
const sender = shaped(asDict(root["sender"])?.["login"], LOGIN);
|
|
43487
|
+
const base = `https://github.com/${repo}`;
|
|
43488
|
+
const details = [];
|
|
43489
|
+
if (event === "pull_request") {
|
|
43490
|
+
const pr = asDict(root["pull_request"]);
|
|
43491
|
+
const n2 = pr ? posInt(pr["number"]) : null;
|
|
43492
|
+
if (!pr || n2 === null)
|
|
43493
|
+
return null;
|
|
43494
|
+
let summary;
|
|
43495
|
+
if (action === "closed") {
|
|
43496
|
+
if (pr["merged"] !== true)
|
|
43497
|
+
return null;
|
|
43498
|
+
details.push(["Outcome", "merged"]);
|
|
43499
|
+
const mergedBy = shaped(asDict(pr["merged_by"])?.["login"], LOGIN);
|
|
43500
|
+
if (mergedBy)
|
|
43501
|
+
details.push(["Merged by", mergedBy]);
|
|
43502
|
+
summary = `PR #${n2} merged in ${repo}`;
|
|
43503
|
+
} else if (action === "dequeued") {
|
|
43504
|
+
const reasonRaw = str(root["reason"])?.toLowerCase().replace(/-/g, "_") ?? null;
|
|
43505
|
+
const reason = reasonRaw && REASON_TOKEN.test(reasonRaw) ? reasonRaw : "unknown";
|
|
43506
|
+
details.push(["Removed from merge queue, reason", reason]);
|
|
43507
|
+
if (pr["merged"] === true)
|
|
43508
|
+
details.push(["Merged", "yes"]);
|
|
43509
|
+
summary = `PR #${n2} removed from the merge queue in ${repo}`;
|
|
43510
|
+
} else {
|
|
43511
|
+
const label = shaped(asDict(root["label"])?.["name"], LABEL_TOKEN);
|
|
43512
|
+
details.push(["Label", label ?? "(name withheld: not a plain token)"]);
|
|
43513
|
+
summary = `PR #${n2} labeled in ${repo}`;
|
|
43514
|
+
}
|
|
43515
|
+
const state = str(pr["state"]);
|
|
43516
|
+
if (state === "open" || state === "closed")
|
|
43517
|
+
details.unshift(["State", state]);
|
|
43518
|
+
return {
|
|
43519
|
+
event,
|
|
43520
|
+
action,
|
|
43521
|
+
repo,
|
|
43522
|
+
subject: `Pull request: #${n2}`,
|
|
43523
|
+
url: `${base}/pull/${n2}`,
|
|
43524
|
+
sender,
|
|
43525
|
+
details,
|
|
43526
|
+
summary
|
|
43527
|
+
};
|
|
43528
|
+
}
|
|
43529
|
+
if (event === "pull_request_review") {
|
|
43530
|
+
const pr = asDict(root["pull_request"]);
|
|
43531
|
+
const n2 = pr ? posInt(pr["number"]) : null;
|
|
43532
|
+
if (n2 === null)
|
|
43533
|
+
return null;
|
|
43534
|
+
const review = asDict(root["review"]);
|
|
43535
|
+
const state = inSet(review?.["state"], REVIEW_STATES);
|
|
43536
|
+
details.push(["Review state", state ?? "unknown"]);
|
|
43537
|
+
const reviewId = review ? posInt(review["id"]) : null;
|
|
43538
|
+
return {
|
|
43539
|
+
event,
|
|
43540
|
+
action,
|
|
43541
|
+
repo,
|
|
43542
|
+
subject: `Pull request: #${n2}`,
|
|
43543
|
+
url: reviewId ? `${base}/pull/${n2}#pullrequestreview-${reviewId}` : `${base}/pull/${n2}`,
|
|
43544
|
+
sender,
|
|
43545
|
+
details,
|
|
43546
|
+
summary: `Review ${state ?? "submitted"} on PR #${n2} in ${repo}`
|
|
43547
|
+
};
|
|
43548
|
+
}
|
|
43549
|
+
if (event === "check_suite") {
|
|
43550
|
+
const suite = asDict(root["check_suite"]);
|
|
43551
|
+
if (!suite)
|
|
43552
|
+
return null;
|
|
43553
|
+
const conclusion = inSet(suite["conclusion"], CHECK_CONCLUSIONS);
|
|
43554
|
+
details.push(["Conclusion", conclusion ?? "unknown"]);
|
|
43555
|
+
const app = shaped(asDict(suite["app"])?.["slug"], APP_SLUG);
|
|
43556
|
+
if (app)
|
|
43557
|
+
details.push(["App", app]);
|
|
43558
|
+
const sha = shaped(str(suite["head_sha"])?.toLowerCase(), SHA);
|
|
43559
|
+
if (sha)
|
|
43560
|
+
details.push(["Head commit", sha]);
|
|
43561
|
+
const prs = Array.isArray(suite["pull_requests"]) ? suite["pull_requests"].map((p2) => posInt(asDict(p2)?.["number"])).filter((x) => x !== null).slice(0, 10) : [];
|
|
43562
|
+
if (prs.length > 0)
|
|
43563
|
+
details.push(["Pull requests", prs.map((x) => `#${x}`).join(", ")]);
|
|
43564
|
+
return {
|
|
43565
|
+
event,
|
|
43566
|
+
action,
|
|
43567
|
+
repo,
|
|
43568
|
+
subject: null,
|
|
43569
|
+
url: sha ? `${base}/commit/${sha}` : base,
|
|
43570
|
+
sender,
|
|
43571
|
+
details,
|
|
43572
|
+
summary: `Check suite ${conclusion ?? "completed"} in ${repo}${prs.length > 0 ? ` (PR #${prs[0]})` : ""}`
|
|
43573
|
+
};
|
|
43574
|
+
}
|
|
43575
|
+
if (event === "issues") {
|
|
43576
|
+
const issue3 = asDict(root["issue"]);
|
|
43577
|
+
const n2 = issue3 ? posInt(issue3["number"]) : null;
|
|
43578
|
+
if (!issue3 || n2 === null)
|
|
43579
|
+
return null;
|
|
43580
|
+
if (action === "closed") {
|
|
43581
|
+
const reason = inSet(issue3["state_reason"], ISSUE_STATE_REASONS);
|
|
43582
|
+
if (reason)
|
|
43583
|
+
details.push(["Close reason", reason]);
|
|
43584
|
+
}
|
|
43585
|
+
return {
|
|
43586
|
+
event,
|
|
43587
|
+
action,
|
|
43588
|
+
repo,
|
|
43589
|
+
subject: `Issue: #${n2}`,
|
|
43590
|
+
url: `${base}/issues/${n2}`,
|
|
43591
|
+
sender,
|
|
43592
|
+
details,
|
|
43593
|
+
summary: `Issue #${n2} ${action} in ${repo}`
|
|
43594
|
+
};
|
|
43595
|
+
}
|
|
43596
|
+
const issue2 = asDict(root["issue"]);
|
|
43597
|
+
const n = issue2 ? posInt(issue2["number"]) : null;
|
|
43598
|
+
if (!issue2 || n === null)
|
|
43599
|
+
return null;
|
|
43600
|
+
const onPr = asDict(issue2["pull_request"]) !== null;
|
|
43601
|
+
const commentId = posInt(asDict(root["comment"])?.["id"]);
|
|
43602
|
+
details.push(["Comment on", onPr ? "pull request" : "issue"]);
|
|
43603
|
+
return {
|
|
43604
|
+
event,
|
|
43605
|
+
action,
|
|
43606
|
+
repo,
|
|
43607
|
+
subject: `${onPr ? "Pull request" : "Issue"}: #${n}`,
|
|
43608
|
+
url: commentId ? `${base}/issues/${n}#issuecomment-${commentId}` : `${base}/issues/${n}`,
|
|
43609
|
+
sender,
|
|
43610
|
+
details,
|
|
43611
|
+
summary: `New comment on ${onPr ? "PR" : "issue"} #${n} in ${repo}`
|
|
43612
|
+
};
|
|
43613
|
+
}
|
|
43614
|
+
function githubDedupKey(event, rawBody) {
|
|
43615
|
+
return `gh:body:${stableHash(`${event}
|
|
43616
|
+
${rawBody}`)}`;
|
|
43617
|
+
}
|
|
43618
|
+
function buildGithubEvent(req, now = /* @__PURE__ */ new Date()) {
|
|
43619
|
+
const event = header(req.headers, GITHUB_EVENT_HEADER);
|
|
43620
|
+
if (!event)
|
|
43621
|
+
return null;
|
|
43622
|
+
const facts = extractGithubFacts(event, req.body);
|
|
43623
|
+
if (!facts)
|
|
43624
|
+
return null;
|
|
43625
|
+
const raw = req.rawBody ?? JSON.stringify(req.body ?? null);
|
|
43626
|
+
const delivery = header(req.headers, GITHUB_DELIVERY_HEADER);
|
|
43627
|
+
const deliveryGuid = delivery && GUID.test(delivery.toLowerCase()) ? delivery.toLowerCase() : null;
|
|
43628
|
+
const lines = [`GitHub event: ${facts.event} (${facts.action})`, `Repository: ${facts.repo}`];
|
|
43629
|
+
if (facts.subject)
|
|
43630
|
+
lines.push(facts.subject);
|
|
43631
|
+
for (const [k, v] of facts.details)
|
|
43632
|
+
lines.push(`${k}: ${v}`);
|
|
43633
|
+
if (facts.url)
|
|
43634
|
+
lines.push(`URL: ${facts.url}`);
|
|
43635
|
+
if (facts.sender)
|
|
43636
|
+
lines.push(`Sender: ${facts.sender}`);
|
|
43637
|
+
if (deliveryGuid)
|
|
43638
|
+
lines.push(`Delivery: ${deliveryGuid}`);
|
|
43639
|
+
lines.push("", "Titles, descriptions, comment text and commit messages are deliberately not included. Read them with your GitHub tools if you need them.");
|
|
43640
|
+
return {
|
|
43641
|
+
provider: GITHUB_TRIGGER_PROVIDER,
|
|
43642
|
+
occurredAt: now.toISOString(),
|
|
43643
|
+
dedupKey: githubDedupKey(facts.event, raw),
|
|
43644
|
+
sourceTrust: "untrusted",
|
|
43645
|
+
title: facts.summary,
|
|
43646
|
+
body: lines.join("\n"),
|
|
43647
|
+
// Ledger copy only (team-readable event log), never the prompt. Bounded
|
|
43648
|
+
// like the generic source; never headers (the signature rides there).
|
|
43649
|
+
raw: raw.length <= WEBHOOK_RAW_MAX_CHARS ? req.body : { truncated: true, bytes: raw.length, head: raw.slice(0, WEBHOOK_RAW_MAX_CHARS) },
|
|
43650
|
+
meaningful: true
|
|
43651
|
+
};
|
|
43652
|
+
}
|
|
43653
|
+
function validateGithubConfig(input) {
|
|
43654
|
+
const out = {};
|
|
43655
|
+
const textError = validateOperatorText(input, out);
|
|
43656
|
+
if (textError)
|
|
43657
|
+
return { ok: false, error: textError };
|
|
43658
|
+
const capError = validateRateCapConfig(input, out);
|
|
43659
|
+
if (capError)
|
|
43660
|
+
return { ok: false, error: capError };
|
|
43661
|
+
return { ok: true, config: out };
|
|
43662
|
+
}
|
|
43663
|
+
var githubTriggerAdapter = {
|
|
43664
|
+
provider: GITHUB_TRIGGER_PROVIDER,
|
|
43665
|
+
kind: "webhook",
|
|
43666
|
+
webhookAuth: "hmac",
|
|
43667
|
+
hmac: { signatureHeader: GITHUB_SIGNATURE_HEADER, signaturePrefix: "sha256=", algorithm: "sha256" },
|
|
43668
|
+
webhookEvents: [...GITHUB_WEBHOOK_EVENTS],
|
|
43669
|
+
// One trigger per repository or org hook, each with its own secret and instruction.
|
|
43670
|
+
multiInstance: true,
|
|
43671
|
+
maxBodyBytes: GITHUB_MAX_BODY_BYTES,
|
|
43672
|
+
validateConfig: validateGithubConfig,
|
|
43673
|
+
// Same breaker, same config key, same defaults as the generic source.
|
|
43674
|
+
rateCapPerHour: (trigger) => webhookRateCap(trigger),
|
|
43675
|
+
// Minted only on the human, agent.edit-gated route (as for `webhook`).
|
|
43676
|
+
operatorInstruction: true,
|
|
43677
|
+
ingest(req) {
|
|
43678
|
+
const event = buildGithubEvent(req);
|
|
43679
|
+
return event ? [event] : [];
|
|
43680
|
+
}
|
|
43681
|
+
};
|
|
43682
|
+
registerTriggerSource(githubTriggerAdapter);
|
|
43683
|
+
|
|
43414
43684
|
// ../core/dist/feature-flags/registry.js
|
|
43415
43685
|
var FLAG_REGISTRY = [
|
|
43416
43686
|
{
|