@marcusrbrown/infra 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +416 -316
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
4
4
|
var __require = import.meta.require;
|
|
5
5
|
|
|
6
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
6
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js
|
|
7
7
|
var require_identity = __commonJS(function(exports) {
|
|
8
8
|
var ALIAS = Symbol.for("yaml.alias");
|
|
9
9
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -57,7 +57,7 @@ var require_identity = __commonJS(function(exports) {
|
|
|
57
57
|
exports.isSeq = isSeq;
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
60
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/visit.js
|
|
61
61
|
var require_visit = __commonJS(function(exports) {
|
|
62
62
|
var identity = require_identity();
|
|
63
63
|
var BREAK = Symbol("break visit");
|
|
@@ -212,7 +212,7 @@ var require_visit = __commonJS(function(exports) {
|
|
|
212
212
|
exports.visitAsync = visitAsync;
|
|
213
213
|
});
|
|
214
214
|
|
|
215
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
215
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js
|
|
216
216
|
var require_directives = __commonJS(function(exports) {
|
|
217
217
|
var identity = require_identity();
|
|
218
218
|
var visit = require_visit();
|
|
@@ -364,7 +364,7 @@ var require_directives = __commonJS(function(exports) {
|
|
|
364
364
|
exports.Directives = Directives;
|
|
365
365
|
});
|
|
366
366
|
|
|
367
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
367
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js
|
|
368
368
|
var require_anchors = __commonJS(function(exports) {
|
|
369
369
|
var identity = require_identity();
|
|
370
370
|
var visit = require_visit();
|
|
@@ -426,7 +426,7 @@ var require_anchors = __commonJS(function(exports) {
|
|
|
426
426
|
exports.findNewAnchor = findNewAnchor;
|
|
427
427
|
});
|
|
428
428
|
|
|
429
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
429
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js
|
|
430
430
|
var require_applyReviver = __commonJS(function(exports) {
|
|
431
431
|
function applyReviver(reviver, obj, key, val) {
|
|
432
432
|
if (val && typeof val === "object") {
|
|
@@ -473,7 +473,7 @@ var require_applyReviver = __commonJS(function(exports) {
|
|
|
473
473
|
exports.applyReviver = applyReviver;
|
|
474
474
|
});
|
|
475
475
|
|
|
476
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
476
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js
|
|
477
477
|
var require_toJS = __commonJS(function(exports) {
|
|
478
478
|
var identity = require_identity();
|
|
479
479
|
function toJS(value, arg, ctx) {
|
|
@@ -484,8 +484,8 @@ var require_toJS = __commonJS(function(exports) {
|
|
|
484
484
|
return value.toJSON(arg, ctx);
|
|
485
485
|
const data = { aliasCount: 0, count: 1, res: undefined };
|
|
486
486
|
ctx.anchors.set(value, data);
|
|
487
|
-
ctx.onCreate = (
|
|
488
|
-
data.res =
|
|
487
|
+
ctx.onCreate = (res) => {
|
|
488
|
+
data.res = res;
|
|
489
489
|
delete ctx.onCreate;
|
|
490
490
|
};
|
|
491
491
|
const res = value.toJSON(arg, ctx);
|
|
@@ -500,7 +500,7 @@ var require_toJS = __commonJS(function(exports) {
|
|
|
500
500
|
exports.toJS = toJS;
|
|
501
501
|
});
|
|
502
502
|
|
|
503
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
503
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js
|
|
504
504
|
var require_Node = __commonJS(function(exports) {
|
|
505
505
|
var applyReviver = require_applyReviver();
|
|
506
506
|
var identity = require_identity();
|
|
@@ -529,15 +529,15 @@ var require_Node = __commonJS(function(exports) {
|
|
|
529
529
|
};
|
|
530
530
|
const res = toJS.toJS(this, "", ctx);
|
|
531
531
|
if (typeof onAnchor === "function")
|
|
532
|
-
for (const { count, res
|
|
533
|
-
onAnchor(
|
|
532
|
+
for (const { count, res } of ctx.anchors.values())
|
|
533
|
+
onAnchor(res, count);
|
|
534
534
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
exports.NodeBase = NodeBase;
|
|
538
538
|
});
|
|
539
539
|
|
|
540
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
540
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js
|
|
541
541
|
var require_Alias = __commonJS(function(exports) {
|
|
542
542
|
var anchors = require_anchors();
|
|
543
543
|
var visit = require_visit();
|
|
@@ -579,36 +579,38 @@ var require_Alias = __commonJS(function(exports) {
|
|
|
579
579
|
if (node.anchor === this.source)
|
|
580
580
|
found = node;
|
|
581
581
|
}
|
|
582
|
+
if (found && ctx) {
|
|
583
|
+
const { anchors, doc, maxAliasCount } = ctx;
|
|
584
|
+
let data = anchors.get(found);
|
|
585
|
+
if (!data) {
|
|
586
|
+
toJS.toJS(found, null, ctx);
|
|
587
|
+
data = anchors.get(found);
|
|
588
|
+
}
|
|
589
|
+
if (data?.res === undefined) {
|
|
590
|
+
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
591
|
+
throw new ReferenceError(msg);
|
|
592
|
+
}
|
|
593
|
+
if (maxAliasCount >= 0) {
|
|
594
|
+
data.count += 1;
|
|
595
|
+
if (data.aliasCount === 0)
|
|
596
|
+
data.aliasCount = getAliasCount(doc, found, anchors);
|
|
597
|
+
if (data.count * data.aliasCount > maxAliasCount) {
|
|
598
|
+
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
599
|
+
throw new ReferenceError(msg);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
582
603
|
return found;
|
|
583
604
|
}
|
|
584
605
|
toJSON(_arg, ctx) {
|
|
585
606
|
if (!ctx)
|
|
586
607
|
return { source: this.source };
|
|
587
|
-
const
|
|
588
|
-
const source = this.resolve(doc, ctx);
|
|
608
|
+
const source = this.resolve(ctx.doc, ctx);
|
|
589
609
|
if (!source) {
|
|
590
610
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
591
611
|
throw new ReferenceError(msg);
|
|
592
612
|
}
|
|
593
|
-
|
|
594
|
-
if (!data) {
|
|
595
|
-
toJS.toJS(source, null, ctx);
|
|
596
|
-
data = anchors2.get(source);
|
|
597
|
-
}
|
|
598
|
-
if (data?.res === undefined) {
|
|
599
|
-
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
600
|
-
throw new ReferenceError(msg);
|
|
601
|
-
}
|
|
602
|
-
if (maxAliasCount >= 0) {
|
|
603
|
-
data.count += 1;
|
|
604
|
-
if (data.aliasCount === 0)
|
|
605
|
-
data.aliasCount = getAliasCount(doc, source, anchors2);
|
|
606
|
-
if (data.count * data.aliasCount > maxAliasCount) {
|
|
607
|
-
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
608
|
-
throw new ReferenceError(msg);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return data.res;
|
|
613
|
+
return ctx.anchors.get(source).res;
|
|
612
614
|
}
|
|
613
615
|
toString(ctx, _onComment, _onChompKeep) {
|
|
614
616
|
const src = `*${this.source}`;
|
|
@@ -624,22 +626,22 @@ var require_Alias = __commonJS(function(exports) {
|
|
|
624
626
|
return src;
|
|
625
627
|
}
|
|
626
628
|
}
|
|
627
|
-
function getAliasCount(doc, node,
|
|
629
|
+
function getAliasCount(doc, node, anchors) {
|
|
628
630
|
if (identity.isAlias(node)) {
|
|
629
631
|
const source = node.resolve(doc);
|
|
630
|
-
const anchor =
|
|
632
|
+
const anchor = anchors && source && anchors.get(source);
|
|
631
633
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
632
634
|
} else if (identity.isCollection(node)) {
|
|
633
635
|
let count = 0;
|
|
634
636
|
for (const item of node.items) {
|
|
635
|
-
const c = getAliasCount(doc, item,
|
|
637
|
+
const c = getAliasCount(doc, item, anchors);
|
|
636
638
|
if (c > count)
|
|
637
639
|
count = c;
|
|
638
640
|
}
|
|
639
641
|
return count;
|
|
640
642
|
} else if (identity.isPair(node)) {
|
|
641
|
-
const kc = getAliasCount(doc, node.key,
|
|
642
|
-
const vc = getAliasCount(doc, node.value,
|
|
643
|
+
const kc = getAliasCount(doc, node.key, anchors);
|
|
644
|
+
const vc = getAliasCount(doc, node.value, anchors);
|
|
643
645
|
return Math.max(kc, vc);
|
|
644
646
|
}
|
|
645
647
|
return 1;
|
|
@@ -647,7 +649,7 @@ var require_Alias = __commonJS(function(exports) {
|
|
|
647
649
|
exports.Alias = Alias;
|
|
648
650
|
});
|
|
649
651
|
|
|
650
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
652
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js
|
|
651
653
|
var require_Scalar = __commonJS(function(exports) {
|
|
652
654
|
var identity = require_identity();
|
|
653
655
|
var Node = require_Node();
|
|
@@ -675,7 +677,7 @@ var require_Scalar = __commonJS(function(exports) {
|
|
|
675
677
|
exports.isScalarValue = isScalarValue;
|
|
676
678
|
});
|
|
677
679
|
|
|
678
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
680
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js
|
|
679
681
|
var require_createNode = __commonJS(function(exports) {
|
|
680
682
|
var Alias = require_Alias();
|
|
681
683
|
var identity = require_identity();
|
|
@@ -724,10 +726,10 @@ var require_createNode = __commonJS(function(exports) {
|
|
|
724
726
|
value = value.toJSON();
|
|
725
727
|
}
|
|
726
728
|
if (!value || typeof value !== "object") {
|
|
727
|
-
const
|
|
729
|
+
const node = new Scalar.Scalar(value);
|
|
728
730
|
if (ref)
|
|
729
|
-
ref.node =
|
|
730
|
-
return
|
|
731
|
+
ref.node = node;
|
|
732
|
+
return node;
|
|
731
733
|
}
|
|
732
734
|
tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
|
|
733
735
|
}
|
|
@@ -747,7 +749,7 @@ var require_createNode = __commonJS(function(exports) {
|
|
|
747
749
|
exports.createNode = createNode;
|
|
748
750
|
});
|
|
749
751
|
|
|
750
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
752
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js
|
|
751
753
|
var require_Collection = __commonJS(function(exports) {
|
|
752
754
|
var createNode = require_createNode();
|
|
753
755
|
var identity = require_identity();
|
|
@@ -862,7 +864,7 @@ var require_Collection = __commonJS(function(exports) {
|
|
|
862
864
|
exports.isEmptyPath = isEmptyPath;
|
|
863
865
|
});
|
|
864
866
|
|
|
865
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
867
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
866
868
|
var require_stringifyComment = __commonJS(function(exports) {
|
|
867
869
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
868
870
|
function indentComment(comment, indent) {
|
|
@@ -879,7 +881,7 @@ var require_stringifyComment = __commonJS(function(exports) {
|
|
|
879
881
|
exports.stringifyComment = stringifyComment;
|
|
880
882
|
});
|
|
881
883
|
|
|
882
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
884
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
883
885
|
var require_foldFlowLines = __commonJS(function(exports) {
|
|
884
886
|
var FOLD_FLOW = "flow";
|
|
885
887
|
var FOLD_BLOCK = "block";
|
|
@@ -976,17 +978,17 @@ var require_foldFlowLines = __commonJS(function(exports) {
|
|
|
976
978
|
if (onFold)
|
|
977
979
|
onFold();
|
|
978
980
|
let res = text.slice(0, folds[0]);
|
|
979
|
-
for (let
|
|
980
|
-
const fold = folds[
|
|
981
|
-
const
|
|
981
|
+
for (let i = 0;i < folds.length; ++i) {
|
|
982
|
+
const fold = folds[i];
|
|
983
|
+
const end = folds[i + 1] || text.length;
|
|
982
984
|
if (fold === 0)
|
|
983
985
|
res = `
|
|
984
|
-
${indent}${text.slice(0,
|
|
986
|
+
${indent}${text.slice(0, end)}`;
|
|
985
987
|
else {
|
|
986
988
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
987
989
|
res += `${text[fold]}\\`;
|
|
988
990
|
res += `
|
|
989
|
-
${indent}${text.slice(fold + 1,
|
|
991
|
+
${indent}${text.slice(fold + 1, end)}`;
|
|
990
992
|
}
|
|
991
993
|
}
|
|
992
994
|
return res;
|
|
@@ -1016,7 +1018,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1016
1018
|
exports.foldFlowLines = foldFlowLines;
|
|
1017
1019
|
});
|
|
1018
1020
|
|
|
1019
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1021
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js
|
|
1020
1022
|
var require_stringifyString = __commonJS(function(exports) {
|
|
1021
1023
|
var Scalar = require_Scalar();
|
|
1022
1024
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -1314,7 +1316,7 @@ ${indent}`);
|
|
|
1314
1316
|
exports.stringifyString = stringifyString;
|
|
1315
1317
|
});
|
|
1316
1318
|
|
|
1317
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1319
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js
|
|
1318
1320
|
var require_stringify = __commonJS(function(exports) {
|
|
1319
1321
|
var anchors = require_anchors();
|
|
1320
1322
|
var identity = require_identity();
|
|
@@ -1435,7 +1437,7 @@ ${ctx.indent}${str}`;
|
|
|
1435
1437
|
exports.stringify = stringify;
|
|
1436
1438
|
});
|
|
1437
1439
|
|
|
1438
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1440
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1439
1441
|
var require_stringifyPair = __commonJS(function(exports) {
|
|
1440
1442
|
var identity = require_identity();
|
|
1441
1443
|
var Scalar = require_Scalar();
|
|
@@ -1571,7 +1573,7 @@ ${ctx.indent}`;
|
|
|
1571
1573
|
exports.stringifyPair = stringifyPair;
|
|
1572
1574
|
});
|
|
1573
1575
|
|
|
1574
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1576
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/log.js
|
|
1575
1577
|
var require_log = __commonJS(function(exports) {
|
|
1576
1578
|
var node_process = __require("process");
|
|
1577
1579
|
function debug(logLevel, ...messages) {
|
|
@@ -1590,7 +1592,7 @@ var require_log = __commonJS(function(exports) {
|
|
|
1590
1592
|
exports.warn = warn;
|
|
1591
1593
|
});
|
|
1592
1594
|
|
|
1593
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1595
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
1594
1596
|
var require_merge = __commonJS(function(exports) {
|
|
1595
1597
|
var identity = require_identity();
|
|
1596
1598
|
var Scalar = require_Scalar();
|
|
@@ -1622,15 +1624,15 @@ var require_merge = __commonJS(function(exports) {
|
|
|
1622
1624
|
if (!identity.isMap(source))
|
|
1623
1625
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1624
1626
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
1625
|
-
for (const [key,
|
|
1627
|
+
for (const [key, value] of srcMap) {
|
|
1626
1628
|
if (map instanceof Map) {
|
|
1627
1629
|
if (!map.has(key))
|
|
1628
|
-
map.set(key,
|
|
1630
|
+
map.set(key, value);
|
|
1629
1631
|
} else if (map instanceof Set) {
|
|
1630
1632
|
map.add(key);
|
|
1631
1633
|
} else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
|
1632
1634
|
Object.defineProperty(map, key, {
|
|
1633
|
-
value
|
|
1635
|
+
value,
|
|
1634
1636
|
writable: true,
|
|
1635
1637
|
enumerable: true,
|
|
1636
1638
|
configurable: true
|
|
@@ -1647,7 +1649,7 @@ var require_merge = __commonJS(function(exports) {
|
|
|
1647
1649
|
exports.merge = merge;
|
|
1648
1650
|
});
|
|
1649
1651
|
|
|
1650
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1652
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
1651
1653
|
var require_addPairToJSMap = __commonJS(function(exports) {
|
|
1652
1654
|
var log = require_log();
|
|
1653
1655
|
var merge = require_merge();
|
|
@@ -1708,7 +1710,7 @@ var require_addPairToJSMap = __commonJS(function(exports) {
|
|
|
1708
1710
|
exports.addPairToJSMap = addPairToJSMap;
|
|
1709
1711
|
});
|
|
1710
1712
|
|
|
1711
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1713
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js
|
|
1712
1714
|
var require_Pair = __commonJS(function(exports) {
|
|
1713
1715
|
var createNode = require_createNode();
|
|
1714
1716
|
var stringifyPair = require_stringifyPair();
|
|
@@ -1746,15 +1748,15 @@ var require_Pair = __commonJS(function(exports) {
|
|
|
1746
1748
|
exports.createPair = createPair;
|
|
1747
1749
|
});
|
|
1748
1750
|
|
|
1749
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1751
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
1750
1752
|
var require_stringifyCollection = __commonJS(function(exports) {
|
|
1751
1753
|
var identity = require_identity();
|
|
1752
1754
|
var stringify = require_stringify();
|
|
1753
1755
|
var stringifyComment = require_stringifyComment();
|
|
1754
1756
|
function stringifyCollection(collection, ctx, options) {
|
|
1755
1757
|
const flow = ctx.inFlow ?? collection.flow;
|
|
1756
|
-
const
|
|
1757
|
-
return
|
|
1758
|
+
const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
1759
|
+
return stringify(collection, ctx, options);
|
|
1758
1760
|
}
|
|
1759
1761
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
1760
1762
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -1763,13 +1765,13 @@ var require_stringifyCollection = __commonJS(function(exports) {
|
|
|
1763
1765
|
const lines = [];
|
|
1764
1766
|
for (let i = 0;i < items.length; ++i) {
|
|
1765
1767
|
const item = items[i];
|
|
1766
|
-
let
|
|
1768
|
+
let comment = null;
|
|
1767
1769
|
if (identity.isNode(item)) {
|
|
1768
1770
|
if (!chompKeep && item.spaceBefore)
|
|
1769
1771
|
lines.push("");
|
|
1770
1772
|
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
|
1771
1773
|
if (item.comment)
|
|
1772
|
-
|
|
1774
|
+
comment = item.comment;
|
|
1773
1775
|
} else if (identity.isPair(item)) {
|
|
1774
1776
|
const ik = identity.isNode(item.key) ? item.key : null;
|
|
1775
1777
|
if (ik) {
|
|
@@ -1779,12 +1781,12 @@ var require_stringifyCollection = __commonJS(function(exports) {
|
|
|
1779
1781
|
}
|
|
1780
1782
|
}
|
|
1781
1783
|
chompKeep = false;
|
|
1782
|
-
let
|
|
1783
|
-
if (
|
|
1784
|
-
|
|
1785
|
-
if (chompKeep &&
|
|
1784
|
+
let str = stringify.stringify(item, itemCtx, () => comment = null, () => chompKeep = true);
|
|
1785
|
+
if (comment)
|
|
1786
|
+
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
|
|
1787
|
+
if (chompKeep && comment)
|
|
1786
1788
|
chompKeep = false;
|
|
1787
|
-
lines.push(blockItemPrefix +
|
|
1789
|
+
lines.push(blockItemPrefix + str);
|
|
1788
1790
|
}
|
|
1789
1791
|
let str;
|
|
1790
1792
|
if (lines.length === 0) {
|
|
@@ -1898,7 +1900,7 @@ ${indent}${end}`;
|
|
|
1898
1900
|
exports.stringifyCollection = stringifyCollection;
|
|
1899
1901
|
});
|
|
1900
1902
|
|
|
1901
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
1903
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
1902
1904
|
var require_YAMLMap = __commonJS(function(exports) {
|
|
1903
1905
|
var stringifyCollection = require_stringifyCollection();
|
|
1904
1906
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -2025,7 +2027,7 @@ var require_YAMLMap = __commonJS(function(exports) {
|
|
|
2025
2027
|
exports.findPair = findPair;
|
|
2026
2028
|
});
|
|
2027
2029
|
|
|
2028
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2030
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js
|
|
2029
2031
|
var require_map = __commonJS(function(exports) {
|
|
2030
2032
|
var identity = require_identity();
|
|
2031
2033
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2034,17 +2036,17 @@ var require_map = __commonJS(function(exports) {
|
|
|
2034
2036
|
default: true,
|
|
2035
2037
|
nodeClass: YAMLMap.YAMLMap,
|
|
2036
2038
|
tag: "tag:yaml.org,2002:map",
|
|
2037
|
-
resolve(
|
|
2038
|
-
if (!identity.isMap(
|
|
2039
|
+
resolve(map, onError) {
|
|
2040
|
+
if (!identity.isMap(map))
|
|
2039
2041
|
onError("Expected a mapping for this tag");
|
|
2040
|
-
return
|
|
2042
|
+
return map;
|
|
2041
2043
|
},
|
|
2042
2044
|
createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
|
|
2043
2045
|
};
|
|
2044
2046
|
exports.map = map;
|
|
2045
2047
|
});
|
|
2046
2048
|
|
|
2047
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2049
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2048
2050
|
var require_YAMLSeq = __commonJS(function(exports) {
|
|
2049
2051
|
var createNode = require_createNode();
|
|
2050
2052
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -2137,7 +2139,7 @@ var require_YAMLSeq = __commonJS(function(exports) {
|
|
|
2137
2139
|
exports.YAMLSeq = YAMLSeq;
|
|
2138
2140
|
});
|
|
2139
2141
|
|
|
2140
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2142
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js
|
|
2141
2143
|
var require_seq = __commonJS(function(exports) {
|
|
2142
2144
|
var identity = require_identity();
|
|
2143
2145
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -2146,17 +2148,17 @@ var require_seq = __commonJS(function(exports) {
|
|
|
2146
2148
|
default: true,
|
|
2147
2149
|
nodeClass: YAMLSeq.YAMLSeq,
|
|
2148
2150
|
tag: "tag:yaml.org,2002:seq",
|
|
2149
|
-
resolve(
|
|
2150
|
-
if (!identity.isSeq(
|
|
2151
|
+
resolve(seq, onError) {
|
|
2152
|
+
if (!identity.isSeq(seq))
|
|
2151
2153
|
onError("Expected a sequence for this tag");
|
|
2152
|
-
return
|
|
2154
|
+
return seq;
|
|
2153
2155
|
},
|
|
2154
2156
|
createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
|
|
2155
2157
|
};
|
|
2156
2158
|
exports.seq = seq;
|
|
2157
2159
|
});
|
|
2158
2160
|
|
|
2159
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2161
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js
|
|
2160
2162
|
var require_string = __commonJS(function(exports) {
|
|
2161
2163
|
var stringifyString = require_stringifyString();
|
|
2162
2164
|
var string = {
|
|
@@ -2172,7 +2174,7 @@ var require_string = __commonJS(function(exports) {
|
|
|
2172
2174
|
exports.string = string;
|
|
2173
2175
|
});
|
|
2174
2176
|
|
|
2175
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2177
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js
|
|
2176
2178
|
var require_null = __commonJS(function(exports) {
|
|
2177
2179
|
var Scalar = require_Scalar();
|
|
2178
2180
|
var nullTag = {
|
|
@@ -2187,7 +2189,7 @@ var require_null = __commonJS(function(exports) {
|
|
|
2187
2189
|
exports.nullTag = nullTag;
|
|
2188
2190
|
});
|
|
2189
2191
|
|
|
2190
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2192
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js
|
|
2191
2193
|
var require_bool = __commonJS(function(exports) {
|
|
2192
2194
|
var Scalar = require_Scalar();
|
|
2193
2195
|
var boolTag = {
|
|
@@ -2208,7 +2210,7 @@ var require_bool = __commonJS(function(exports) {
|
|
|
2208
2210
|
exports.boolTag = boolTag;
|
|
2209
2211
|
});
|
|
2210
2212
|
|
|
2211
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2213
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2212
2214
|
var require_stringifyNumber = __commonJS(function(exports) {
|
|
2213
2215
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2214
2216
|
if (typeof value === "bigint")
|
|
@@ -2232,7 +2234,7 @@ var require_stringifyNumber = __commonJS(function(exports) {
|
|
|
2232
2234
|
exports.stringifyNumber = stringifyNumber;
|
|
2233
2235
|
});
|
|
2234
2236
|
|
|
2235
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2237
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js
|
|
2236
2238
|
var require_float = __commonJS(function(exports) {
|
|
2237
2239
|
var Scalar = require_Scalar();
|
|
2238
2240
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2275,7 +2277,7 @@ var require_float = __commonJS(function(exports) {
|
|
|
2275
2277
|
exports.floatNaN = floatNaN;
|
|
2276
2278
|
});
|
|
2277
2279
|
|
|
2278
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2280
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js
|
|
2279
2281
|
var require_int = __commonJS(function(exports) {
|
|
2280
2282
|
var stringifyNumber = require_stringifyNumber();
|
|
2281
2283
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2317,7 +2319,7 @@ var require_int = __commonJS(function(exports) {
|
|
|
2317
2319
|
exports.intOct = intOct;
|
|
2318
2320
|
});
|
|
2319
2321
|
|
|
2320
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2322
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js
|
|
2321
2323
|
var require_schema = __commonJS(function(exports) {
|
|
2322
2324
|
var map = require_map();
|
|
2323
2325
|
var _null = require_null();
|
|
@@ -2342,7 +2344,7 @@ var require_schema = __commonJS(function(exports) {
|
|
|
2342
2344
|
exports.schema = schema;
|
|
2343
2345
|
});
|
|
2344
2346
|
|
|
2345
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2347
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js
|
|
2346
2348
|
var require_schema2 = __commonJS(function(exports) {
|
|
2347
2349
|
var Scalar = require_Scalar();
|
|
2348
2350
|
var map = require_map();
|
|
@@ -2406,7 +2408,7 @@ var require_schema2 = __commonJS(function(exports) {
|
|
|
2406
2408
|
exports.schema = schema;
|
|
2407
2409
|
});
|
|
2408
2410
|
|
|
2409
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2411
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2410
2412
|
var require_binary = __commonJS(function(exports) {
|
|
2411
2413
|
var node_buffer = __require("buffer");
|
|
2412
2414
|
var Scalar = require_Scalar();
|
|
@@ -2461,7 +2463,7 @@ var require_binary = __commonJS(function(exports) {
|
|
|
2461
2463
|
exports.binary = binary;
|
|
2462
2464
|
});
|
|
2463
2465
|
|
|
2464
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2466
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2465
2467
|
var require_pairs = __commonJS(function(exports) {
|
|
2466
2468
|
var identity = require_identity();
|
|
2467
2469
|
var Pair = require_Pair();
|
|
@@ -2495,8 +2497,8 @@ ${cn.comment}` : item.comment;
|
|
|
2495
2497
|
}
|
|
2496
2498
|
function createPairs(schema, iterable, ctx) {
|
|
2497
2499
|
const { replacer } = ctx;
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2500
|
+
const pairs = new YAMLSeq.YAMLSeq(schema);
|
|
2501
|
+
pairs.tag = "tag:yaml.org,2002:pairs";
|
|
2500
2502
|
let i = 0;
|
|
2501
2503
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
2502
2504
|
for (let it of iterable) {
|
|
@@ -2520,9 +2522,9 @@ ${cn.comment}` : item.comment;
|
|
|
2520
2522
|
} else {
|
|
2521
2523
|
key = it;
|
|
2522
2524
|
}
|
|
2523
|
-
|
|
2525
|
+
pairs.items.push(Pair.createPair(key, value, ctx));
|
|
2524
2526
|
}
|
|
2525
|
-
return
|
|
2527
|
+
return pairs;
|
|
2526
2528
|
}
|
|
2527
2529
|
var pairs = {
|
|
2528
2530
|
collection: "seq",
|
|
@@ -2536,7 +2538,7 @@ ${cn.comment}` : item.comment;
|
|
|
2536
2538
|
exports.resolvePairs = resolvePairs;
|
|
2537
2539
|
});
|
|
2538
2540
|
|
|
2539
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2541
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2540
2542
|
var require_omap = __commonJS(function(exports) {
|
|
2541
2543
|
var identity = require_identity();
|
|
2542
2544
|
var toJS = require_toJS();
|
|
@@ -2576,9 +2578,9 @@ var require_omap = __commonJS(function(exports) {
|
|
|
2576
2578
|
}
|
|
2577
2579
|
static from(schema, iterable, ctx) {
|
|
2578
2580
|
const pairs$1 = pairs.createPairs(schema, iterable, ctx);
|
|
2579
|
-
const
|
|
2580
|
-
|
|
2581
|
-
return
|
|
2581
|
+
const omap = new this;
|
|
2582
|
+
omap.items = pairs$1.items;
|
|
2583
|
+
return omap;
|
|
2582
2584
|
}
|
|
2583
2585
|
}
|
|
2584
2586
|
YAMLOMap.tag = "tag:yaml.org,2002:omap";
|
|
@@ -2608,7 +2610,7 @@ var require_omap = __commonJS(function(exports) {
|
|
|
2608
2610
|
exports.omap = omap;
|
|
2609
2611
|
});
|
|
2610
2612
|
|
|
2611
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2613
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2612
2614
|
var require_bool2 = __commonJS(function(exports) {
|
|
2613
2615
|
var Scalar = require_Scalar();
|
|
2614
2616
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -2637,7 +2639,7 @@ var require_bool2 = __commonJS(function(exports) {
|
|
|
2637
2639
|
exports.trueTag = trueTag;
|
|
2638
2640
|
});
|
|
2639
2641
|
|
|
2640
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2642
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
2641
2643
|
var require_float2 = __commonJS(function(exports) {
|
|
2642
2644
|
var Scalar = require_Scalar();
|
|
2643
2645
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2683,7 +2685,7 @@ var require_float2 = __commonJS(function(exports) {
|
|
|
2683
2685
|
exports.floatNaN = floatNaN;
|
|
2684
2686
|
});
|
|
2685
2687
|
|
|
2686
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2688
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
2687
2689
|
var require_int2 = __commonJS(function(exports) {
|
|
2688
2690
|
var stringifyNumber = require_stringifyNumber();
|
|
2689
2691
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2704,8 +2706,8 @@ var require_int2 = __commonJS(function(exports) {
|
|
|
2704
2706
|
str = `0x${str}`;
|
|
2705
2707
|
break;
|
|
2706
2708
|
}
|
|
2707
|
-
const
|
|
2708
|
-
return sign === "-" ? BigInt(-1) *
|
|
2709
|
+
const n = BigInt(str);
|
|
2710
|
+
return sign === "-" ? BigInt(-1) * n : n;
|
|
2709
2711
|
}
|
|
2710
2712
|
const n = parseInt(str, radix);
|
|
2711
2713
|
return sign === "-" ? -1 * n : n;
|
|
@@ -2759,7 +2761,7 @@ var require_int2 = __commonJS(function(exports) {
|
|
|
2759
2761
|
exports.intOct = intOct;
|
|
2760
2762
|
});
|
|
2761
2763
|
|
|
2762
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2764
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
2763
2765
|
var require_set = __commonJS(function(exports) {
|
|
2764
2766
|
var identity = require_identity();
|
|
2765
2767
|
var Pair = require_Pair();
|
|
@@ -2809,14 +2811,14 @@ var require_set = __commonJS(function(exports) {
|
|
|
2809
2811
|
}
|
|
2810
2812
|
static from(schema, iterable, ctx) {
|
|
2811
2813
|
const { replacer } = ctx;
|
|
2812
|
-
const
|
|
2814
|
+
const set = new this(schema);
|
|
2813
2815
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
2814
2816
|
for (let value of iterable) {
|
|
2815
2817
|
if (typeof replacer === "function")
|
|
2816
2818
|
value = replacer.call(iterable, value, value);
|
|
2817
|
-
|
|
2819
|
+
set.items.push(Pair.createPair(value, null, ctx));
|
|
2818
2820
|
}
|
|
2819
|
-
return
|
|
2821
|
+
return set;
|
|
2820
2822
|
}
|
|
2821
2823
|
}
|
|
2822
2824
|
YAMLSet.tag = "tag:yaml.org,2002:set";
|
|
@@ -2842,14 +2844,14 @@ var require_set = __commonJS(function(exports) {
|
|
|
2842
2844
|
exports.set = set;
|
|
2843
2845
|
});
|
|
2844
2846
|
|
|
2845
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2847
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
2846
2848
|
var require_timestamp = __commonJS(function(exports) {
|
|
2847
2849
|
var stringifyNumber = require_stringifyNumber();
|
|
2848
2850
|
function parseSexagesimal(str, asBigInt) {
|
|
2849
2851
|
const sign = str[0];
|
|
2850
2852
|
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
2851
2853
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
2852
|
-
const res = parts.replace(/_/g, "").split(":").reduce((
|
|
2854
|
+
const res = parts.replace(/_/g, "").split(":").reduce((res, p) => res * num(60) + num(p), num(0));
|
|
2853
2855
|
return sign === "-" ? num(-1) * res : res;
|
|
2854
2856
|
}
|
|
2855
2857
|
function stringifySexagesimal(node) {
|
|
@@ -2924,7 +2926,7 @@ var require_timestamp = __commonJS(function(exports) {
|
|
|
2924
2926
|
exports.timestamp = timestamp;
|
|
2925
2927
|
});
|
|
2926
2928
|
|
|
2927
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2929
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
2928
2930
|
var require_schema3 = __commonJS(function(exports) {
|
|
2929
2931
|
var map = require_map();
|
|
2930
2932
|
var _null = require_null();
|
|
@@ -2965,7 +2967,7 @@ var require_schema3 = __commonJS(function(exports) {
|
|
|
2965
2967
|
exports.schema = schema;
|
|
2966
2968
|
});
|
|
2967
2969
|
|
|
2968
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
2970
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js
|
|
2969
2971
|
var require_tags = __commonJS(function(exports) {
|
|
2970
2972
|
var map = require_map();
|
|
2971
2973
|
var _null = require_null();
|
|
@@ -3040,23 +3042,23 @@ var require_tags = __commonJS(function(exports) {
|
|
|
3040
3042
|
}
|
|
3041
3043
|
if (addMergeTag)
|
|
3042
3044
|
tags = tags.concat(merge.merge);
|
|
3043
|
-
return tags.reduce((
|
|
3045
|
+
return tags.reduce((tags, tag) => {
|
|
3044
3046
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
|
3045
3047
|
if (!tagObj) {
|
|
3046
3048
|
const tagName = JSON.stringify(tag);
|
|
3047
3049
|
const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
|
|
3048
3050
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
|
3049
3051
|
}
|
|
3050
|
-
if (!
|
|
3051
|
-
|
|
3052
|
-
return
|
|
3052
|
+
if (!tags.includes(tagObj))
|
|
3053
|
+
tags.push(tagObj);
|
|
3054
|
+
return tags;
|
|
3053
3055
|
}, []);
|
|
3054
3056
|
}
|
|
3055
3057
|
exports.coreKnownTags = coreKnownTags;
|
|
3056
3058
|
exports.getTags = getTags;
|
|
3057
3059
|
});
|
|
3058
3060
|
|
|
3059
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3061
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js
|
|
3060
3062
|
var require_Schema = __commonJS(function(exports) {
|
|
3061
3063
|
var identity = require_identity();
|
|
3062
3064
|
var map = require_map();
|
|
@@ -3086,7 +3088,7 @@ var require_Schema = __commonJS(function(exports) {
|
|
|
3086
3088
|
exports.Schema = Schema;
|
|
3087
3089
|
});
|
|
3088
3090
|
|
|
3089
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3091
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3090
3092
|
var require_stringifyDocument = __commonJS(function(exports) {
|
|
3091
3093
|
var identity = require_identity();
|
|
3092
3094
|
var stringify = require_stringify();
|
|
@@ -3166,7 +3168,7 @@ var require_stringifyDocument = __commonJS(function(exports) {
|
|
|
3166
3168
|
exports.stringifyDocument = stringifyDocument;
|
|
3167
3169
|
});
|
|
3168
3170
|
|
|
3169
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3171
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js
|
|
3170
3172
|
var require_Document = __commonJS(function(exports) {
|
|
3171
3173
|
var Alias = require_Alias();
|
|
3172
3174
|
var Collection = require_Collection();
|
|
@@ -3376,8 +3378,8 @@ var require_Document = __commonJS(function(exports) {
|
|
|
3376
3378
|
};
|
|
3377
3379
|
const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
|
|
3378
3380
|
if (typeof onAnchor === "function")
|
|
3379
|
-
for (const { count, res
|
|
3380
|
-
onAnchor(
|
|
3381
|
+
for (const { count, res } of ctx.anchors.values())
|
|
3382
|
+
onAnchor(res, count);
|
|
3381
3383
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
3382
3384
|
}
|
|
3383
3385
|
toJSON(jsonArg, onAnchor) {
|
|
@@ -3401,7 +3403,7 @@ var require_Document = __commonJS(function(exports) {
|
|
|
3401
3403
|
exports.Document = Document;
|
|
3402
3404
|
});
|
|
3403
3405
|
|
|
3404
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3406
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/errors.js
|
|
3405
3407
|
var require_errors = __commonJS(function(exports) {
|
|
3406
3408
|
class YAMLError extends Error {
|
|
3407
3409
|
constructor(name, pos, code, message) {
|
|
@@ -3466,7 +3468,7 @@ ${pointer}
|
|
|
3466
3468
|
exports.prettifyError = prettifyError;
|
|
3467
3469
|
});
|
|
3468
3470
|
|
|
3469
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3471
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js
|
|
3470
3472
|
var require_resolve_props = __commonJS(function(exports) {
|
|
3471
3473
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3472
3474
|
let spaceBefore = false;
|
|
@@ -3596,7 +3598,7 @@ var require_resolve_props = __commonJS(function(exports) {
|
|
|
3596
3598
|
exports.resolveProps = resolveProps;
|
|
3597
3599
|
});
|
|
3598
3600
|
|
|
3599
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3601
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
3600
3602
|
var require_util_contains_newline = __commonJS(function(exports) {
|
|
3601
3603
|
function containsNewline(key) {
|
|
3602
3604
|
if (!key)
|
|
@@ -3636,7 +3638,7 @@ var require_util_contains_newline = __commonJS(function(exports) {
|
|
|
3636
3638
|
exports.containsNewline = containsNewline;
|
|
3637
3639
|
});
|
|
3638
3640
|
|
|
3639
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3641
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
3640
3642
|
var require_util_flow_indent_check = __commonJS(function(exports) {
|
|
3641
3643
|
var utilContainsNewline = require_util_contains_newline();
|
|
3642
3644
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -3651,7 +3653,7 @@ var require_util_flow_indent_check = __commonJS(function(exports) {
|
|
|
3651
3653
|
exports.flowIndentCheck = flowIndentCheck;
|
|
3652
3654
|
});
|
|
3653
3655
|
|
|
3654
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3656
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js
|
|
3655
3657
|
var require_util_map_includes = __commonJS(function(exports) {
|
|
3656
3658
|
var identity = require_identity();
|
|
3657
3659
|
function mapIncludes(ctx, items, search) {
|
|
@@ -3664,7 +3666,7 @@ var require_util_map_includes = __commonJS(function(exports) {
|
|
|
3664
3666
|
exports.mapIncludes = mapIncludes;
|
|
3665
3667
|
});
|
|
3666
3668
|
|
|
3667
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3669
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
3668
3670
|
var require_resolve_block_map = __commonJS(function(exports) {
|
|
3669
3671
|
var Pair = require_Pair();
|
|
3670
3672
|
var YAMLMap = require_YAMLMap();
|
|
@@ -3771,7 +3773,7 @@ var require_resolve_block_map = __commonJS(function(exports) {
|
|
|
3771
3773
|
exports.resolveBlockMap = resolveBlockMap;
|
|
3772
3774
|
});
|
|
3773
3775
|
|
|
3774
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3776
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
3775
3777
|
var require_resolve_block_seq = __commonJS(function(exports) {
|
|
3776
3778
|
var YAMLSeq = require_YAMLSeq();
|
|
3777
3779
|
var resolveProps = require_resolve_props();
|
|
@@ -3819,7 +3821,7 @@ var require_resolve_block_seq = __commonJS(function(exports) {
|
|
|
3819
3821
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
3820
3822
|
});
|
|
3821
3823
|
|
|
3822
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3824
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js
|
|
3823
3825
|
var require_resolve_end = __commonJS(function(exports) {
|
|
3824
3826
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
3825
3827
|
let comment = "";
|
|
@@ -3859,7 +3861,7 @@ var require_resolve_end = __commonJS(function(exports) {
|
|
|
3859
3861
|
exports.resolveEnd = resolveEnd;
|
|
3860
3862
|
});
|
|
3861
3863
|
|
|
3862
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
3864
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
3863
3865
|
var require_resolve_flow_collection = __commonJS(function(exports) {
|
|
3864
3866
|
var identity = require_identity();
|
|
3865
3867
|
var Pair = require_Pair();
|
|
@@ -4050,7 +4052,7 @@ var require_resolve_flow_collection = __commonJS(function(exports) {
|
|
|
4050
4052
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
4051
4053
|
});
|
|
4052
4054
|
|
|
4053
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4055
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js
|
|
4054
4056
|
var require_compose_collection = __commonJS(function(exports) {
|
|
4055
4057
|
var identity = require_identity();
|
|
4056
4058
|
var Scalar = require_Scalar();
|
|
@@ -4112,7 +4114,7 @@ var require_compose_collection = __commonJS(function(exports) {
|
|
|
4112
4114
|
exports.composeCollection = composeCollection;
|
|
4113
4115
|
});
|
|
4114
4116
|
|
|
4115
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4117
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4116
4118
|
var require_resolve_block_scalar = __commonJS(function(exports) {
|
|
4117
4119
|
var Scalar = require_Scalar();
|
|
4118
4120
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -4131,12 +4133,12 @@ var require_resolve_block_scalar = __commonJS(function(exports) {
|
|
|
4131
4133
|
break;
|
|
4132
4134
|
}
|
|
4133
4135
|
if (chompStart === 0) {
|
|
4134
|
-
const
|
|
4136
|
+
const value = header.chomp === "+" && lines.length > 0 ? `
|
|
4135
4137
|
`.repeat(Math.max(1, lines.length - 1)) : "";
|
|
4136
|
-
let
|
|
4138
|
+
let end = start + header.length;
|
|
4137
4139
|
if (scalar.source)
|
|
4138
|
-
|
|
4139
|
-
return { value
|
|
4140
|
+
end += scalar.source.length;
|
|
4141
|
+
return { value, type, comment: header.comment, range: [start, end, end] };
|
|
4140
4142
|
}
|
|
4141
4143
|
let trimIndent = scalar.indent + header.indent;
|
|
4142
4144
|
let offset = scalar.offset + header.length;
|
|
@@ -4305,7 +4307,7 @@ var require_resolve_block_scalar = __commonJS(function(exports) {
|
|
|
4305
4307
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
4306
4308
|
});
|
|
4307
4309
|
|
|
4308
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4310
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4309
4311
|
var require_resolve_flow_scalar = __commonJS(function(exports) {
|
|
4310
4312
|
var Scalar = require_Scalar();
|
|
4311
4313
|
var resolveEnd = require_resolve_end();
|
|
@@ -4370,33 +4372,32 @@ var require_resolve_flow_scalar = __commonJS(function(exports) {
|
|
|
4370
4372
|
}
|
|
4371
4373
|
if (badChar)
|
|
4372
4374
|
onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
|
|
4373
|
-
return
|
|
4375
|
+
return unfoldLines(source);
|
|
4374
4376
|
}
|
|
4375
4377
|
function singleQuotedValue(source, onError) {
|
|
4376
4378
|
if (source[source.length - 1] !== "'" || source.length === 1)
|
|
4377
4379
|
onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
|
|
4378
|
-
return
|
|
4380
|
+
return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
|
|
4379
4381
|
}
|
|
4380
|
-
function
|
|
4381
|
-
|
|
4382
|
+
function unfoldLines(source) {
|
|
4383
|
+
const line = /(.*?)\r?\n/sy;
|
|
4384
|
+
let match = line.exec(source);
|
|
4385
|
+
if (!match)
|
|
4386
|
+
return source;
|
|
4387
|
+
let trimEnd, trimBoth;
|
|
4382
4388
|
try {
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
line = new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
4386
|
-
`, "sy");
|
|
4389
|
+
trimEnd = new RegExp("(?<![ \t])[ \t]+$");
|
|
4390
|
+
trimBoth = new RegExp("^[ \t]+|(?<![ \t])[ \t]+$", "g");
|
|
4387
4391
|
} catch {
|
|
4388
|
-
|
|
4389
|
-
|
|
4392
|
+
trimEnd = /[ \t]+$/;
|
|
4393
|
+
trimBoth = /^[ \t]+|[ \t]+$/g;
|
|
4390
4394
|
}
|
|
4391
|
-
let
|
|
4392
|
-
if (!match)
|
|
4393
|
-
return source;
|
|
4394
|
-
let res = match[1];
|
|
4395
|
+
let res = match[1].replace(trimEnd, "");
|
|
4395
4396
|
let sep = " ";
|
|
4396
|
-
let pos =
|
|
4397
|
-
line.lastIndex = pos;
|
|
4397
|
+
let pos = line.lastIndex;
|
|
4398
4398
|
while (match = line.exec(source)) {
|
|
4399
|
-
|
|
4399
|
+
const lm = match[1].replace(trimBoth, "");
|
|
4400
|
+
if (lm === "") {
|
|
4400
4401
|
if (sep === `
|
|
4401
4402
|
`)
|
|
4402
4403
|
res += sep;
|
|
@@ -4404,7 +4405,7 @@ var require_resolve_flow_scalar = __commonJS(function(exports) {
|
|
|
4404
4405
|
sep = `
|
|
4405
4406
|
`;
|
|
4406
4407
|
} else {
|
|
4407
|
-
res += sep +
|
|
4408
|
+
res += sep + lm;
|
|
4408
4409
|
sep = " ";
|
|
4409
4410
|
}
|
|
4410
4411
|
pos = line.lastIndex;
|
|
@@ -4522,7 +4523,7 @@ var require_resolve_flow_scalar = __commonJS(function(exports) {
|
|
|
4522
4523
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
4523
4524
|
});
|
|
4524
4525
|
|
|
4525
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4526
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js
|
|
4526
4527
|
var require_compose_scalar = __commonJS(function(exports) {
|
|
4527
4528
|
var identity = require_identity();
|
|
4528
4529
|
var Scalar = require_Scalar();
|
|
@@ -4585,9 +4586,9 @@ var require_compose_scalar = __commonJS(function(exports) {
|
|
|
4585
4586
|
return schema[identity.SCALAR];
|
|
4586
4587
|
}
|
|
4587
4588
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
4588
|
-
const tag = schema.tags.find((
|
|
4589
|
+
const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR];
|
|
4589
4590
|
if (schema.compat) {
|
|
4590
|
-
const compat = schema.compat.find((
|
|
4591
|
+
const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR];
|
|
4591
4592
|
if (tag.tag !== compat.tag) {
|
|
4592
4593
|
const ts = directives.tagString(tag.tag);
|
|
4593
4594
|
const cs = directives.tagString(compat.tag);
|
|
@@ -4600,7 +4601,7 @@ var require_compose_scalar = __commonJS(function(exports) {
|
|
|
4600
4601
|
exports.composeScalar = composeScalar;
|
|
4601
4602
|
});
|
|
4602
4603
|
|
|
4603
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4604
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
4604
4605
|
var require_util_empty_scalar_position = __commonJS(function(exports) {
|
|
4605
4606
|
function emptyScalarPosition(offset, before, pos) {
|
|
4606
4607
|
if (before) {
|
|
@@ -4627,7 +4628,7 @@ var require_util_empty_scalar_position = __commonJS(function(exports) {
|
|
|
4627
4628
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
4628
4629
|
});
|
|
4629
4630
|
|
|
4630
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4631
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js
|
|
4631
4632
|
var require_compose_node = __commonJS(function(exports) {
|
|
4632
4633
|
var Alias = require_Alias();
|
|
4633
4634
|
var identity = require_identity();
|
|
@@ -4730,7 +4731,7 @@ var require_compose_node = __commonJS(function(exports) {
|
|
|
4730
4731
|
exports.composeNode = composeNode;
|
|
4731
4732
|
});
|
|
4732
4733
|
|
|
4733
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4734
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js
|
|
4734
4735
|
var require_compose_doc = __commonJS(function(exports) {
|
|
4735
4736
|
var Document = require_Document();
|
|
4736
4737
|
var composeNode = require_compose_node();
|
|
@@ -4770,7 +4771,7 @@ var require_compose_doc = __commonJS(function(exports) {
|
|
|
4770
4771
|
exports.composeDoc = composeDoc;
|
|
4771
4772
|
});
|
|
4772
4773
|
|
|
4773
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4774
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js
|
|
4774
4775
|
var require_composer = __commonJS(function(exports) {
|
|
4775
4776
|
var node_process = __require("process");
|
|
4776
4777
|
var directives = require_directives();
|
|
@@ -4961,7 +4962,7 @@ ${end.comment}` : end.comment;
|
|
|
4961
4962
|
exports.Composer = Composer;
|
|
4962
4963
|
});
|
|
4963
4964
|
|
|
4964
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
4965
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js
|
|
4965
4966
|
var require_cst_scalar = __commonJS(function(exports) {
|
|
4966
4967
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
4967
4968
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -5151,7 +5152,7 @@ var require_cst_scalar = __commonJS(function(exports) {
|
|
|
5151
5152
|
exports.setScalarValue = setScalarValue;
|
|
5152
5153
|
});
|
|
5153
5154
|
|
|
5154
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5155
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js
|
|
5155
5156
|
var require_cst_stringify = __commonJS(function(exports) {
|
|
5156
5157
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
5157
5158
|
function stringifyToken(token) {
|
|
@@ -5209,7 +5210,7 @@ var require_cst_stringify = __commonJS(function(exports) {
|
|
|
5209
5210
|
exports.stringify = stringify;
|
|
5210
5211
|
});
|
|
5211
5212
|
|
|
5212
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5213
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js
|
|
5213
5214
|
var require_cst_visit = __commonJS(function(exports) {
|
|
5214
5215
|
var BREAK = Symbol("break visit");
|
|
5215
5216
|
var SKIP = Symbol("skip children");
|
|
@@ -5268,7 +5269,7 @@ var require_cst_visit = __commonJS(function(exports) {
|
|
|
5268
5269
|
exports.visit = visit;
|
|
5269
5270
|
});
|
|
5270
5271
|
|
|
5271
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5272
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js
|
|
5272
5273
|
var require_cst = __commonJS(function(exports) {
|
|
5273
5274
|
var cstScalar = require_cst_scalar();
|
|
5274
5275
|
var cstStringify = require_cst_stringify();
|
|
@@ -5369,7 +5370,7 @@ var require_cst = __commonJS(function(exports) {
|
|
|
5369
5370
|
exports.tokenType = tokenType;
|
|
5370
5371
|
});
|
|
5371
5372
|
|
|
5372
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5373
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js
|
|
5373
5374
|
var require_lexer = __commonJS(function(exports) {
|
|
5374
5375
|
var cst = require_cst();
|
|
5375
5376
|
function isEmpty(ch) {
|
|
@@ -5743,18 +5744,18 @@ var require_lexer = __commonJS(function(exports) {
|
|
|
5743
5744
|
let indent = 0;
|
|
5744
5745
|
let ch;
|
|
5745
5746
|
loop:
|
|
5746
|
-
for (let
|
|
5747
|
+
for (let i = this.pos;ch = this.buffer[i]; ++i) {
|
|
5747
5748
|
switch (ch) {
|
|
5748
5749
|
case " ":
|
|
5749
5750
|
indent += 1;
|
|
5750
5751
|
break;
|
|
5751
5752
|
case `
|
|
5752
5753
|
`:
|
|
5753
|
-
nl =
|
|
5754
|
+
nl = i;
|
|
5754
5755
|
indent = 0;
|
|
5755
5756
|
break;
|
|
5756
5757
|
case "\r": {
|
|
5757
|
-
const next = this.buffer[
|
|
5758
|
+
const next = this.buffer[i + 1];
|
|
5758
5759
|
if (!next && !this.atEnd)
|
|
5759
5760
|
return this.setNext("block-scalar");
|
|
5760
5761
|
if (next === `
|
|
@@ -5797,16 +5798,16 @@ var require_lexer = __commonJS(function(exports) {
|
|
|
5797
5798
|
nl = i - 1;
|
|
5798
5799
|
} else if (!this.blockScalarKeep) {
|
|
5799
5800
|
do {
|
|
5800
|
-
let
|
|
5801
|
-
let
|
|
5802
|
-
if (
|
|
5803
|
-
|
|
5804
|
-
const lastChar =
|
|
5805
|
-
while (
|
|
5806
|
-
|
|
5807
|
-
if (
|
|
5808
|
-
` &&
|
|
5809
|
-
nl =
|
|
5801
|
+
let i = nl - 1;
|
|
5802
|
+
let ch = this.buffer[i];
|
|
5803
|
+
if (ch === "\r")
|
|
5804
|
+
ch = this.buffer[--i];
|
|
5805
|
+
const lastChar = i;
|
|
5806
|
+
while (ch === " ")
|
|
5807
|
+
ch = this.buffer[--i];
|
|
5808
|
+
if (ch === `
|
|
5809
|
+
` && i >= this.pos && i + 1 + indent > lastChar)
|
|
5810
|
+
nl = i;
|
|
5810
5811
|
else
|
|
5811
5812
|
break;
|
|
5812
5813
|
} while (true);
|
|
@@ -5966,7 +5967,7 @@ var require_lexer = __commonJS(function(exports) {
|
|
|
5966
5967
|
exports.Lexer = Lexer;
|
|
5967
5968
|
});
|
|
5968
5969
|
|
|
5969
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5970
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js
|
|
5970
5971
|
var require_line_counter = __commonJS(function(exports) {
|
|
5971
5972
|
class LineCounter {
|
|
5972
5973
|
constructor() {
|
|
@@ -5994,7 +5995,7 @@ var require_line_counter = __commonJS(function(exports) {
|
|
|
5994
5995
|
exports.LineCounter = LineCounter;
|
|
5995
5996
|
});
|
|
5996
5997
|
|
|
5997
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
5998
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js
|
|
5998
5999
|
var require_parser = __commonJS(function(exports) {
|
|
5999
6000
|
var node_process = __require("process");
|
|
6000
6001
|
var cst = require_cst();
|
|
@@ -6493,12 +6494,12 @@ var require_parser = __commonJS(function(exports) {
|
|
|
6493
6494
|
if (includesToken(it.start, "newline")) {
|
|
6494
6495
|
Object.assign(it, { key: null, sep: [this.sourceToken] });
|
|
6495
6496
|
} else {
|
|
6496
|
-
const
|
|
6497
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6497
6498
|
this.stack.push({
|
|
6498
6499
|
type: "block-map",
|
|
6499
6500
|
offset: this.offset,
|
|
6500
6501
|
indent: this.indent,
|
|
6501
|
-
items: [{ start
|
|
6502
|
+
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6502
6503
|
});
|
|
6503
6504
|
}
|
|
6504
6505
|
} else if (it.value) {
|
|
@@ -6511,7 +6512,7 @@ var require_parser = __commonJS(function(exports) {
|
|
|
6511
6512
|
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6512
6513
|
});
|
|
6513
6514
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6514
|
-
const
|
|
6515
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6515
6516
|
const key = it.key;
|
|
6516
6517
|
const sep = it.sep;
|
|
6517
6518
|
sep.push(this.sourceToken);
|
|
@@ -6521,7 +6522,7 @@ var require_parser = __commonJS(function(exports) {
|
|
|
6521
6522
|
type: "block-map",
|
|
6522
6523
|
offset: this.offset,
|
|
6523
6524
|
indent: this.indent,
|
|
6524
|
-
items: [{ start
|
|
6525
|
+
items: [{ start, key, sep }]
|
|
6525
6526
|
});
|
|
6526
6527
|
} else if (start.length > 0) {
|
|
6527
6528
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -6850,7 +6851,7 @@ var require_parser = __commonJS(function(exports) {
|
|
|
6850
6851
|
exports.Parser = Parser;
|
|
6851
6852
|
});
|
|
6852
6853
|
|
|
6853
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
6854
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/public-api.js
|
|
6854
6855
|
var require_public_api = __commonJS(function(exports) {
|
|
6855
6856
|
var composer = require_composer();
|
|
6856
6857
|
var Document = require_Document();
|
|
@@ -6865,22 +6866,22 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
6865
6866
|
return { lineCounter: lineCounter$1, prettyErrors };
|
|
6866
6867
|
}
|
|
6867
6868
|
function parseAllDocuments(source, options = {}) {
|
|
6868
|
-
const { lineCounter
|
|
6869
|
-
const parser$1 = new parser.Parser(
|
|
6869
|
+
const { lineCounter, prettyErrors } = parseOptions(options);
|
|
6870
|
+
const parser$1 = new parser.Parser(lineCounter?.addNewLine);
|
|
6870
6871
|
const composer$1 = new composer.Composer(options);
|
|
6871
6872
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
6872
|
-
if (prettyErrors &&
|
|
6873
|
+
if (prettyErrors && lineCounter)
|
|
6873
6874
|
for (const doc of docs) {
|
|
6874
|
-
doc.errors.forEach(errors.prettifyError(source,
|
|
6875
|
-
doc.warnings.forEach(errors.prettifyError(source,
|
|
6875
|
+
doc.errors.forEach(errors.prettifyError(source, lineCounter));
|
|
6876
|
+
doc.warnings.forEach(errors.prettifyError(source, lineCounter));
|
|
6876
6877
|
}
|
|
6877
6878
|
if (docs.length > 0)
|
|
6878
6879
|
return docs;
|
|
6879
6880
|
return Object.assign([], { empty: true }, composer$1.streamInfo());
|
|
6880
6881
|
}
|
|
6881
6882
|
function parseDocument(source, options = {}) {
|
|
6882
|
-
const { lineCounter
|
|
6883
|
-
const parser$1 = new parser.Parser(
|
|
6883
|
+
const { lineCounter, prettyErrors } = parseOptions(options);
|
|
6884
|
+
const parser$1 = new parser.Parser(lineCounter?.addNewLine);
|
|
6884
6885
|
const composer$1 = new composer.Composer(options);
|
|
6885
6886
|
let doc = null;
|
|
6886
6887
|
for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
|
|
@@ -6891,9 +6892,9 @@ var require_public_api = __commonJS(function(exports) {
|
|
|
6891
6892
|
break;
|
|
6892
6893
|
}
|
|
6893
6894
|
}
|
|
6894
|
-
if (prettyErrors &&
|
|
6895
|
-
doc.errors.forEach(errors.prettifyError(source,
|
|
6896
|
-
doc.warnings.forEach(errors.prettifyError(source,
|
|
6895
|
+
if (prettyErrors && lineCounter) {
|
|
6896
|
+
doc.errors.forEach(errors.prettifyError(source, lineCounter));
|
|
6897
|
+
doc.warnings.forEach(errors.prettifyError(source, lineCounter));
|
|
6897
6898
|
}
|
|
6898
6899
|
return doc;
|
|
6899
6900
|
}
|
|
@@ -6949,7 +6950,7 @@ import { goke } from "goke";
|
|
|
6949
6950
|
// package.json
|
|
6950
6951
|
var package_default = {
|
|
6951
6952
|
name: "@marcusrbrown/infra",
|
|
6952
|
-
version: "0.
|
|
6953
|
+
version: "0.23.0",
|
|
6953
6954
|
description: "Infrastructure management CLI \u2014 deploy automation, health checks, and MCP bridge",
|
|
6954
6955
|
keywords: [
|
|
6955
6956
|
"infra",
|
|
@@ -6993,7 +6994,7 @@ var package_default = {
|
|
|
6993
6994
|
devDependencies: {
|
|
6994
6995
|
"@marcusrbrown/infra-shared": "workspace:*",
|
|
6995
6996
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
6996
|
-
yaml: "2.9.
|
|
6997
|
+
yaml: "2.9.1"
|
|
6997
6998
|
},
|
|
6998
6999
|
engines: {
|
|
6999
7000
|
bun: ">=1.0.0"
|
|
@@ -7011,7 +7012,7 @@ import { z as z5 } from "zod";
|
|
|
7011
7012
|
// src/commands/agent/setup-core/gh.ts
|
|
7012
7013
|
import { confirm, log, spinner } from "@clack/prompts";
|
|
7013
7014
|
|
|
7014
|
-
// ../../node_modules/.bun/yaml@2.9.
|
|
7015
|
+
// ../../node_modules/.bun/yaml@2.9.1/node_modules/yaml/dist/index.js
|
|
7015
7016
|
var composer = require_composer();
|
|
7016
7017
|
var Document = require_Document();
|
|
7017
7018
|
var Schema = require_Schema();
|
|
@@ -7201,8 +7202,8 @@ function readablePipe(pipe) {
|
|
|
7201
7202
|
throw new Error("CLI subprocess did not expose piped output.");
|
|
7202
7203
|
return pipe;
|
|
7203
7204
|
}
|
|
7204
|
-
function redactExactValues(
|
|
7205
|
-
let redacted =
|
|
7205
|
+
function redactExactValues(text, values) {
|
|
7206
|
+
let redacted = text;
|
|
7206
7207
|
for (const value of new Set(values)) {
|
|
7207
7208
|
if (value.length > 0)
|
|
7208
7209
|
redacted = redacted.split(value).join("[REDACTED]");
|
|
@@ -7270,8 +7271,8 @@ async function runCommand(command, args, timeoutMs = COMMAND_TIMEOUT_MS, stdin,
|
|
|
7270
7271
|
async function runGh(args) {
|
|
7271
7272
|
return runCommand("gh", args);
|
|
7272
7273
|
}
|
|
7273
|
-
function isGhRateLimitError(
|
|
7274
|
-
return /rate limit/i.test(
|
|
7274
|
+
function isGhRateLimitError(text) {
|
|
7275
|
+
return /rate limit/i.test(text);
|
|
7275
7276
|
}
|
|
7276
7277
|
async function queryRateLimitReset() {
|
|
7277
7278
|
try {
|
|
@@ -7383,9 +7384,9 @@ async function deleteManagementApiKey(baseUrl, managementKey, keyValue) {
|
|
|
7383
7384
|
}
|
|
7384
7385
|
async function applyGhValue(kind, name, repo, value) {
|
|
7385
7386
|
if (kind === "secret") {
|
|
7386
|
-
const
|
|
7387
|
-
if (
|
|
7388
|
-
throw new Error(`gh secret set ${name} failed: ${
|
|
7387
|
+
const result = await runCommand("gh", ["secret", "set", name, "--repo", repo], COMMAND_TIMEOUT_MS, value);
|
|
7388
|
+
if (result.exitCode !== 0)
|
|
7389
|
+
throw new Error(`gh secret set ${name} failed: ${result.stderr.trim()}`.trim());
|
|
7389
7390
|
return;
|
|
7390
7391
|
}
|
|
7391
7392
|
const result = await runGh([kind, "set", name, "--repo", repo, "--body", value]);
|
|
@@ -7975,13 +7976,13 @@ function buildCannotVerifyMessage(repo, writtenSecretNames, writtenVariableNames
|
|
|
7975
7976
|
const variablePart = writtenVariableNames.length > 0 ? `gh variable list --repo ${repo} (expect: ${writtenVariableNames.join(", ")})` : `gh variable list --repo ${repo}`;
|
|
7976
7977
|
return `Post-write readback: could not verify the written names are visible in ${repo} ` + `(the GitHub list call failed). Verify manually: ${secretPart}; ${variablePart}.`;
|
|
7977
7978
|
}
|
|
7978
|
-
async function verifyWrittenNamesVisible(repo, writtenSecretNames, writtenVariableNames,
|
|
7979
|
+
async function verifyWrittenNamesVisible(repo, writtenSecretNames, writtenVariableNames, listExistingGhNames) {
|
|
7979
7980
|
try {
|
|
7980
7981
|
let secretReadback;
|
|
7981
7982
|
let variableReadback;
|
|
7982
7983
|
let readbackFailed = false;
|
|
7983
7984
|
try {
|
|
7984
|
-
secretReadback = await
|
|
7985
|
+
secretReadback = await listExistingGhNames(repo, "secret");
|
|
7985
7986
|
} catch {
|
|
7986
7987
|
readbackFailed = true;
|
|
7987
7988
|
secretReadback = [];
|
|
@@ -7990,7 +7991,7 @@ async function verifyWrittenNamesVisible(repo, writtenSecretNames, writtenVariab
|
|
|
7990
7991
|
variableReadback = [];
|
|
7991
7992
|
} else {
|
|
7992
7993
|
try {
|
|
7993
|
-
variableReadback = await
|
|
7994
|
+
variableReadback = await listExistingGhNames(repo, "variable");
|
|
7994
7995
|
} catch {
|
|
7995
7996
|
readbackFailed = true;
|
|
7996
7997
|
variableReadback = [];
|
|
@@ -8873,7 +8874,7 @@ function validateNeedsGraph(analyses, violations) {
|
|
|
8873
8874
|
}
|
|
8874
8875
|
const visiting = new Set;
|
|
8875
8876
|
const visited = new Set;
|
|
8876
|
-
const
|
|
8877
|
+
const visit = (jobId) => {
|
|
8877
8878
|
if (visiting.has(jobId)) {
|
|
8878
8879
|
violations.push(`Job needs graph contains a cycle involving '${jobId}'.`);
|
|
8879
8880
|
return;
|
|
@@ -8883,13 +8884,13 @@ function validateNeedsGraph(analyses, violations) {
|
|
|
8883
8884
|
visiting.add(jobId);
|
|
8884
8885
|
for (const need of analyses.get(jobId)?.needs ?? []) {
|
|
8885
8886
|
if (analyses.has(need))
|
|
8886
|
-
|
|
8887
|
+
visit(need);
|
|
8887
8888
|
}
|
|
8888
8889
|
visiting.delete(jobId);
|
|
8889
8890
|
visited.add(jobId);
|
|
8890
8891
|
};
|
|
8891
8892
|
for (const jobId of analyses.keys())
|
|
8892
|
-
|
|
8893
|
+
visit(jobId);
|
|
8893
8894
|
}
|
|
8894
8895
|
function formatStorageWorkflowSnippet() {
|
|
8895
8896
|
return `jobs:
|
|
@@ -9619,14 +9620,14 @@ function registerBrokerDeploy(cli) {
|
|
|
9619
9620
|
console.log(`- BROKER_DOMAIN=${env.BROKER_DOMAIN || "(unset)"}`);
|
|
9620
9621
|
return;
|
|
9621
9622
|
}
|
|
9622
|
-
const
|
|
9623
|
+
const child = Bun.spawn(command, {
|
|
9623
9624
|
env,
|
|
9624
9625
|
stdout: "inherit",
|
|
9625
9626
|
stderr: "inherit"
|
|
9626
9627
|
});
|
|
9627
|
-
const
|
|
9628
|
-
if (
|
|
9629
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
9628
|
+
const exitCode = await child.exited;
|
|
9629
|
+
if (exitCode !== 0) {
|
|
9630
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
9630
9631
|
}
|
|
9631
9632
|
return;
|
|
9632
9633
|
}
|
|
@@ -10049,14 +10050,14 @@ function registerCliproxyDeploy(cli) {
|
|
|
10049
10050
|
console.log(`- CLIPROXY_DOMAIN=${env.CLIPROXY_DOMAIN || "(unset)"}`);
|
|
10050
10051
|
return;
|
|
10051
10052
|
}
|
|
10052
|
-
const
|
|
10053
|
+
const child = Bun.spawn(command, {
|
|
10053
10054
|
env,
|
|
10054
10055
|
stdout: "inherit",
|
|
10055
10056
|
stderr: "inherit"
|
|
10056
10057
|
});
|
|
10057
|
-
const
|
|
10058
|
-
if (
|
|
10059
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
10058
|
+
const exitCode = await child.exited;
|
|
10059
|
+
if (exitCode !== 0) {
|
|
10060
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
10060
10061
|
}
|
|
10061
10062
|
return;
|
|
10062
10063
|
}
|
|
@@ -10391,11 +10392,11 @@ import { z as z16 } from "zod";
|
|
|
10391
10392
|
import { z as z15 } from "zod";
|
|
10392
10393
|
|
|
10393
10394
|
// src/lib/redact.ts
|
|
10394
|
-
function redactHost(
|
|
10395
|
+
function redactHost(text, host) {
|
|
10395
10396
|
if (!host)
|
|
10396
|
-
return
|
|
10397
|
+
return text;
|
|
10397
10398
|
const escaped = host.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
|
|
10398
|
-
return
|
|
10399
|
+
return text.replaceAll(new RegExp(escaped, "gi"), "<host>");
|
|
10399
10400
|
}
|
|
10400
10401
|
|
|
10401
10402
|
// ../shared/server/droplet-helpers.ts
|
|
@@ -10547,7 +10548,7 @@ async function checkUsageStats(baseUrl, key) {
|
|
|
10547
10548
|
};
|
|
10548
10549
|
}
|
|
10549
10550
|
const total = payload.length;
|
|
10550
|
-
const
|
|
10551
|
+
const errors = countQueueErrors(payload);
|
|
10551
10552
|
if (total === 0) {
|
|
10552
10553
|
return {
|
|
10553
10554
|
title: "Usage stats",
|
|
@@ -10557,8 +10558,8 @@ async function checkUsageStats(baseUrl, key) {
|
|
|
10557
10558
|
}
|
|
10558
10559
|
return {
|
|
10559
10560
|
title: "Usage stats",
|
|
10560
|
-
level:
|
|
10561
|
-
summary:
|
|
10561
|
+
level: errors > 0 ? "warning" : "ok",
|
|
10562
|
+
summary: errors > 0 ? `recent: ${total}, errors: ${errors}` : `recent: ${total}`
|
|
10562
10563
|
};
|
|
10563
10564
|
} catch (error) {
|
|
10564
10565
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -10614,8 +10615,8 @@ async function checkRunningVersion(host, spawn = defaultSpawn) {
|
|
|
10614
10615
|
try {
|
|
10615
10616
|
validateCliproxyHost(host);
|
|
10616
10617
|
const knownHostsArgs = buildKnownHostsArgs();
|
|
10617
|
-
const
|
|
10618
|
-
cleanup =
|
|
10618
|
+
const identity = buildIdentityArgs(process.env.CLIPROXY_SSH_KEY);
|
|
10619
|
+
cleanup = identity.cleanup;
|
|
10619
10620
|
const sshCmd = [
|
|
10620
10621
|
"ssh",
|
|
10621
10622
|
"-o",
|
|
@@ -10625,7 +10626,7 @@ async function checkRunningVersion(host, spawn = defaultSpawn) {
|
|
|
10625
10626
|
"-o",
|
|
10626
10627
|
"StrictHostKeyChecking=yes",
|
|
10627
10628
|
...knownHostsArgs,
|
|
10628
|
-
...
|
|
10629
|
+
...identity.args,
|
|
10629
10630
|
`root@${host}`,
|
|
10630
10631
|
`docker ps --format '{{.Image}}'`
|
|
10631
10632
|
];
|
|
@@ -10872,8 +10873,8 @@ function formatUsageSummaryLine(result) {
|
|
|
10872
10873
|
}
|
|
10873
10874
|
const total = Number(recentMatch[1]);
|
|
10874
10875
|
const errorMatch = /errors:\s*(\d+)/.exec(result.summary);
|
|
10875
|
-
const
|
|
10876
|
-
return `Recent requests: ${total}${
|
|
10876
|
+
const errors = errorMatch ? Number(errorMatch[1]) : 0;
|
|
10877
|
+
return `Recent requests: ${total}${errors > 0 ? `, ${errors} errors` : ""}`;
|
|
10877
10878
|
}
|
|
10878
10879
|
async function getCliproxyStatusSummary(baseUrl, key, verbose, spawn = defaultSpawn) {
|
|
10879
10880
|
const normalizedBaseUrl = stripTrailingSlash5(baseUrl);
|
|
@@ -10998,7 +10999,7 @@ var githubIssueSchema = z16.object({
|
|
|
10998
10999
|
var githubIssuesSchema = z16.array(githubIssueSchema);
|
|
10999
11000
|
var defaultMonitorRuntime = {
|
|
11000
11001
|
fetch: globalThis.fetch,
|
|
11001
|
-
sleep: (milliseconds) => new Promise((
|
|
11002
|
+
sleep: (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)),
|
|
11002
11003
|
ghApi: (token, path, method, body) => runGhApiOnce(token, path, method, body),
|
|
11003
11004
|
setTimeout,
|
|
11004
11005
|
clearTimeout
|
|
@@ -11289,12 +11290,12 @@ async function cliproxyMonitorAction(options, ctx, runtime = defaultMonitorRunti
|
|
|
11289
11290
|
const timestamp = new Date().toISOString();
|
|
11290
11291
|
try {
|
|
11291
11292
|
const classification = validation === "live" ? await checkProviderAuthState(proxyUrl, inputs.apiKey) : providerState(validation);
|
|
11292
|
-
const finish = (transition,
|
|
11293
|
+
const finish = (transition, issue = [], discord = "none") => {
|
|
11293
11294
|
const summary = {
|
|
11294
11295
|
probeState: classification.state,
|
|
11295
11296
|
probeReason: classification.reason,
|
|
11296
11297
|
transition,
|
|
11297
|
-
issue
|
|
11298
|
+
issue,
|
|
11298
11299
|
discord,
|
|
11299
11300
|
timestamp
|
|
11300
11301
|
};
|
|
@@ -11316,17 +11317,17 @@ async function cliproxyMonitorAction(options, ctx, runtime = defaultMonitorRunti
|
|
|
11316
11317
|
return finish("outage", ["created"], "outage-sent");
|
|
11317
11318
|
}
|
|
11318
11319
|
if (target === "dead") {
|
|
11319
|
-
const
|
|
11320
|
-
const
|
|
11321
|
-
const body = issueBody(identityMarker, "dead", timestamp,
|
|
11320
|
+
const currentMarker = notifiedState(issue.body, identityMarker);
|
|
11321
|
+
const wasOpen = issue.state === "open";
|
|
11322
|
+
const body = issueBody(identityMarker, "dead", timestamp, currentMarker === "dead");
|
|
11322
11323
|
await updateIssue(client, issue, "open", body);
|
|
11323
11324
|
issue.state = "open";
|
|
11324
|
-
issueActions.push(
|
|
11325
|
-
if (
|
|
11325
|
+
issueActions.push(wasOpen ? "updated" : "reopened");
|
|
11326
|
+
if (currentMarker === "dead" && wasOpen)
|
|
11326
11327
|
return finish("none", issueActions);
|
|
11327
11328
|
await sendDiscord(inputs.discordWebhook, "dead", timestamp, validation !== "live", runtime);
|
|
11328
11329
|
await persistNotifiedMarker(client, issue, identityMarker, "dead", timestamp);
|
|
11329
|
-
return finish(
|
|
11330
|
+
return finish(wasOpen ? "notification-retry" : "outage", issueActions, "outage-sent");
|
|
11330
11331
|
}
|
|
11331
11332
|
const currentMarker = notifiedState(issue.body, identityMarker);
|
|
11332
11333
|
const wasOpen = issue.state === "open";
|
|
@@ -11404,6 +11405,104 @@ function registerCliproxyOpen(cli) {
|
|
|
11404
11405
|
});
|
|
11405
11406
|
}
|
|
11406
11407
|
|
|
11408
|
+
// src/commands/cliproxy/reset-quota.ts
|
|
11409
|
+
import { z as z18 } from "zod";
|
|
11410
|
+
var DEFAULT_CLIPROXY_URL8 = "https://cliproxy.fro.bot";
|
|
11411
|
+
var ResetQuotaResponseSchema = z18.object({
|
|
11412
|
+
status: z18.literal("ok"),
|
|
11413
|
+
auth_index: z18.string(),
|
|
11414
|
+
models: z18.array(z18.unknown())
|
|
11415
|
+
});
|
|
11416
|
+
var AuthFileSchema = z18.object({
|
|
11417
|
+
id: z18.string(),
|
|
11418
|
+
auth_index: z18.string(),
|
|
11419
|
+
name: z18.string(),
|
|
11420
|
+
type: z18.string(),
|
|
11421
|
+
provider: z18.string(),
|
|
11422
|
+
email: z18.string()
|
|
11423
|
+
});
|
|
11424
|
+
var AuthFilesResponseSchema = z18.object({
|
|
11425
|
+
files: z18.array(AuthFileSchema)
|
|
11426
|
+
});
|
|
11427
|
+
var ManagementErrorSchema = z18.object({ error: z18.string() });
|
|
11428
|
+
function stripTrailingSlash6(value) {
|
|
11429
|
+
return value.endsWith("/") ? value.slice(0, -1) : value;
|
|
11430
|
+
}
|
|
11431
|
+
function resolveBaseUrl4(input) {
|
|
11432
|
+
return stripTrailingSlash6(input ?? process.env.CLIPROXY_URL ?? DEFAULT_CLIPROXY_URL8);
|
|
11433
|
+
}
|
|
11434
|
+
function resolveManagementKey4(input) {
|
|
11435
|
+
const key = input ?? process.env.CLIPROXY_MANAGEMENT_KEY;
|
|
11436
|
+
if (!key) {
|
|
11437
|
+
throw new Error("Management API key is required. Pass --key or set CLIPROXY_MANAGEMENT_KEY.");
|
|
11438
|
+
}
|
|
11439
|
+
return key;
|
|
11440
|
+
}
|
|
11441
|
+
async function requestParsedJson(endpoint, init, schema) {
|
|
11442
|
+
const response = await fetch(endpoint, {
|
|
11443
|
+
...init,
|
|
11444
|
+
signal: AbortSignal.timeout(HTTP_TIMEOUT_MS)
|
|
11445
|
+
});
|
|
11446
|
+
const body = await response.text();
|
|
11447
|
+
let payload;
|
|
11448
|
+
try {
|
|
11449
|
+
payload = body.length === 0 ? null : JSON.parse(body);
|
|
11450
|
+
} catch {
|
|
11451
|
+
payload = undefined;
|
|
11452
|
+
}
|
|
11453
|
+
if (!response.ok) {
|
|
11454
|
+
const error = ManagementErrorSchema.safeParse(payload);
|
|
11455
|
+
if (error.success) {
|
|
11456
|
+
throw new Error(error.data.error);
|
|
11457
|
+
}
|
|
11458
|
+
throw new Error(`${init.method ?? "GET"} ${endpoint} failed with HTTP ${response.status}: ${body}`);
|
|
11459
|
+
}
|
|
11460
|
+
return schema.parse(payload);
|
|
11461
|
+
}
|
|
11462
|
+
function formatAuthFile(file, index) {
|
|
11463
|
+
return `${index + 1}. ${file.auth_index} \u2014 ${file.name} (${file.provider}, ${file.email})`;
|
|
11464
|
+
}
|
|
11465
|
+
async function cliproxyResetQuotaAction(authIndex, options, ctx) {
|
|
11466
|
+
try {
|
|
11467
|
+
const baseUrl = resolveBaseUrl4(options.url);
|
|
11468
|
+
const managementKey = resolveManagementKey4(options.key);
|
|
11469
|
+
if (options.list) {
|
|
11470
|
+
const files = (await requestParsedJson(`${baseUrl}/v0/management/auth-files`, {
|
|
11471
|
+
method: "GET",
|
|
11472
|
+
headers: managementHeaders(managementKey)
|
|
11473
|
+
}, AuthFilesResponseSchema)).files;
|
|
11474
|
+
if (options.json) {
|
|
11475
|
+
ctx.console.log(JSON.stringify(files, null, 2));
|
|
11476
|
+
} else if (files.length === 0) {
|
|
11477
|
+
ctx.console.log("No auth files configured");
|
|
11478
|
+
} else {
|
|
11479
|
+
for (const [index, file] of files.entries()) {
|
|
11480
|
+
ctx.console.log(formatAuthFile(file, index));
|
|
11481
|
+
}
|
|
11482
|
+
}
|
|
11483
|
+
return files;
|
|
11484
|
+
}
|
|
11485
|
+
if (!authIndex) {
|
|
11486
|
+
throw new Error("auth_index is required. Pass an auth index or use --list to enumerate auth files.");
|
|
11487
|
+
}
|
|
11488
|
+
const payload = await requestParsedJson(`${baseUrl}/v0/management/reset-quota`, {
|
|
11489
|
+
method: "POST",
|
|
11490
|
+
headers: managementHeaders(managementKey),
|
|
11491
|
+
body: JSON.stringify({ auth_index: authIndex })
|
|
11492
|
+
}, ResetQuotaResponseSchema);
|
|
11493
|
+
ctx.console.log(JSON.stringify(payload, null, 2));
|
|
11494
|
+
return payload;
|
|
11495
|
+
} catch (error) {
|
|
11496
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
11497
|
+
ctx.console.error(message);
|
|
11498
|
+
ctx.process.exit(1);
|
|
11499
|
+
return [];
|
|
11500
|
+
}
|
|
11501
|
+
}
|
|
11502
|
+
function registerCliproxyResetQuota(cli) {
|
|
11503
|
+
cli.command("cliproxy reset-quota [auth-index]", "Reset the quota for one CLIProxyAPI auth record, or list valid auth indexes.").option("--url [url]", z18.string().describe("Base URL for CLIProxyAPI management requests. Falls back to CLIPROXY_URL or https://cliproxy.fro.bot.")).option("--key [key]", z18.string().describe("Management API key. Falls back to CLIPROXY_MANAGEMENT_KEY when omitted.")).option("--list", "List auth records and their auth indexes without resetting quota.").option("--json", "Output auth records as JSON when used with --list.").example("# List valid auth indexes before resetting one").example("infra cliproxy reset-quota --list").example("# Reset quota for one auth record").example("infra cliproxy reset-quota auth-index-123").action(cliproxyResetQuotaAction);
|
|
11504
|
+
}
|
|
11505
|
+
|
|
11407
11506
|
// src/commands/cliproxy/setup.ts
|
|
11408
11507
|
function registerCliproxySetup(cli) {
|
|
11409
11508
|
registerSetupCommand(cli, "cliproxy setup");
|
|
@@ -11419,11 +11518,12 @@ function registerCliproxyCommands(cli) {
|
|
|
11419
11518
|
registerCliproxyModels(cli);
|
|
11420
11519
|
registerCliproxyMonitor(cli);
|
|
11421
11520
|
registerCliproxyOpen(cli);
|
|
11521
|
+
registerCliproxyResetQuota(cli);
|
|
11422
11522
|
registerCliproxySetup(cli);
|
|
11423
11523
|
}
|
|
11424
11524
|
|
|
11425
11525
|
// src/commands/dashboard/deploy.ts
|
|
11426
|
-
import { z as
|
|
11526
|
+
import { z as z19 } from "zod";
|
|
11427
11527
|
var REPO3 = "marcusrbrown/infra";
|
|
11428
11528
|
var WORKFLOW_NAME3 = "Deploy Dashboard";
|
|
11429
11529
|
var WORKFLOW_URL3 = "https://github.com/marcusrbrown/infra/actions/workflows/deploy-dashboard.yaml";
|
|
@@ -11485,7 +11585,7 @@ function validateDashboardRemotePreconditions() {
|
|
|
11485
11585
|
}
|
|
11486
11586
|
}
|
|
11487
11587
|
function registerDashboardDeploy(cli) {
|
|
11488
|
-
cli.command("dashboard deploy", "Deploy the dashboard. Default mode triggers the GitHub Deploy Dashboard workflow, while --local runs apps/dashboard deploy directly with Bun.").option("--local",
|
|
11588
|
+
cli.command("dashboard deploy", "Deploy the dashboard. Default mode triggers the GitHub Deploy Dashboard workflow, while --local runs apps/dashboard deploy directly with Bun.").option("--local", z19.boolean().default(false).describe("Run local deployment with Bun using apps/dashboard instead of triggering GitHub Actions.")).option("--dry-run", z19.boolean().default(false).describe("Validate deploy prerequisites and print planned actions without executing local deploy or dispatching workflow.")).option("--image-version <version>", z19.string().optional().describe("CalVer version to deploy (e.g. 2026.06.47). Remote-only. Triggers the versioned release path and requires dashboard environment approval. Must match YYYY.MM.N. Forwarded as -f version=<value> to gh workflow run.")).option("--digest <digest>", z19.string().optional().describe("Expected sha256 digest (e.g. sha256:abc...def). Remote-only. Requires --image-version. When set, the workflow fails if GHCR resolves the tag to a different digest. Must match sha256:<64 hex chars>.")).example("# Trigger remote GitHub Actions deploy (default mode)").example("infra dashboard deploy").example("# Deploy a specific CalVer release via GitHub Actions").example("infra dashboard deploy --image-version 2026.06.47").example("# Deploy a specific release with digest cross-check").example("infra dashboard deploy --image-version 2026.06.47 --digest sha256:<64 hex>").example("# Validate local deploy preconditions and planned command").example("infra dashboard deploy --local --dry-run").example("# Run local deploy with explicit SSH agent context").example("infra dashboard deploy --local").action(async (options) => {
|
|
11489
11589
|
validateReleaseFlags({ imageVersion: options.imageVersion, digest: options.digest, local: options.local });
|
|
11490
11590
|
if (options.local) {
|
|
11491
11591
|
const command = ["bun", "run", "--cwd", "apps/dashboard", "deploy"];
|
|
@@ -11495,14 +11595,14 @@ function registerDashboardDeploy(cli) {
|
|
|
11495
11595
|
return;
|
|
11496
11596
|
}
|
|
11497
11597
|
const env = getDashboardDeployEnv();
|
|
11498
|
-
const
|
|
11598
|
+
const child = Bun.spawn(command, {
|
|
11499
11599
|
env,
|
|
11500
11600
|
stdout: "inherit",
|
|
11501
11601
|
stderr: "inherit"
|
|
11502
11602
|
});
|
|
11503
|
-
const
|
|
11504
|
-
if (
|
|
11505
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
11603
|
+
const exitCode = await child.exited;
|
|
11604
|
+
if (exitCode !== 0) {
|
|
11605
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
11506
11606
|
}
|
|
11507
11607
|
return;
|
|
11508
11608
|
}
|
|
@@ -11528,7 +11628,7 @@ function registerDashboardDeploy(cli) {
|
|
|
11528
11628
|
}
|
|
11529
11629
|
|
|
11530
11630
|
// src/commands/dashboard/logs.ts
|
|
11531
|
-
import { z as
|
|
11631
|
+
import { z as z20 } from "zod";
|
|
11532
11632
|
|
|
11533
11633
|
// src/commands/dashboard/host.ts
|
|
11534
11634
|
var VALID_HOST_RE3 = /^[a-z\d][a-z\d.\-]*$/i;
|
|
@@ -11601,7 +11701,7 @@ async function streamDashboardLogs(opts, spawn = defaultLogsSpawn2, printOut, pr
|
|
|
11601
11701
|
return { refused: false, exitCode };
|
|
11602
11702
|
}
|
|
11603
11703
|
function registerDashboardLogs(cli) {
|
|
11604
|
-
cli.command("dashboard logs [service]", "Stream logs from a dashboard service via SSH and docker compose.").option("--tail [n]",
|
|
11704
|
+
cli.command("dashboard logs [service]", "Stream logs from a dashboard service via SSH and docker compose.").option("--tail [n]", z20.number().default(100).describe("Number of log lines to tail from each service.")).option("--allow-ci", z20.boolean().default(false).describe("Allow log streaming in CI environments. Logs may contain sensitive credentials.")).option("--key [key]", z20.string().describe("Environment variable name holding the SSH host. Falls back to DASHBOARD_DOMAIN when omitted.")).action(async (service, options) => {
|
|
11605
11705
|
const targetService = service ?? "dashboard";
|
|
11606
11706
|
try {
|
|
11607
11707
|
validateService(targetService);
|
|
@@ -11631,7 +11731,7 @@ function registerDashboardLogs(cli) {
|
|
|
11631
11731
|
}
|
|
11632
11732
|
|
|
11633
11733
|
// src/commands/dashboard/status.ts
|
|
11634
|
-
import { z as
|
|
11734
|
+
import { z as z21 } from "zod";
|
|
11635
11735
|
var COMPOSE_PROJECT_DIR2 = "/opt/dashboard";
|
|
11636
11736
|
function parseComposePsOutput(stdoutText) {
|
|
11637
11737
|
const trimmed = stdoutText.trim();
|
|
@@ -11805,7 +11905,7 @@ async function dashboardStatusAction(options, ctx, spawn) {
|
|
|
11805
11905
|
}
|
|
11806
11906
|
}
|
|
11807
11907
|
function registerDashboardStatus(cli) {
|
|
11808
|
-
cli.command("dashboard status", "Show operational health of the dashboard deployment via docker compose ps.").option("--key [key]",
|
|
11908
|
+
cli.command("dashboard status", "Show operational health of the dashboard deployment via docker compose ps.").option("--key [key]", z21.string().optional().describe("Environment variable name holding the SSH host. Falls back to DASHBOARD_DOMAIN when omitted.")).action((options, ctx) => dashboardStatusAction(options, ctx));
|
|
11809
11909
|
}
|
|
11810
11910
|
|
|
11811
11911
|
// src/commands/dashboard/index.ts
|
|
@@ -11817,7 +11917,7 @@ function registerDashboardCommands(cli) {
|
|
|
11817
11917
|
|
|
11818
11918
|
// src/commands/gateway/backup.ts
|
|
11819
11919
|
import { closeSync, constants as fsConstants, openSync, renameSync, unlinkSync, writeSync } from "fs";
|
|
11820
|
-
import { z as
|
|
11920
|
+
import { z as z22 } from "zod";
|
|
11821
11921
|
|
|
11822
11922
|
// src/commands/gateway/host.ts
|
|
11823
11923
|
var VALID_HOST_RE4 = /^[a-z\d][a-z\d.\-]*$/i;
|
|
@@ -11927,11 +12027,11 @@ async function gatewayBackupAction(options, ctx, spawn) {
|
|
|
11927
12027
|
ctx.console.log(`CA backup written to: ${output}`);
|
|
11928
12028
|
}
|
|
11929
12029
|
function registerGatewayBackup(cli) {
|
|
11930
|
-
cli.command("gateway backup", "Back up the mitmproxy CA certificate and private key from the gateway Docker volume to a local tarball. The output contains the CA private trust anchor \u2014 treat it as sensitive material.").option("--output [file]",
|
|
12030
|
+
cli.command("gateway backup", "Back up the mitmproxy CA certificate and private key from the gateway Docker volume to a local tarball. The output contains the CA private trust anchor \u2014 treat it as sensitive material.").option("--output [file]", z22.string().default(DEFAULT_OUTPUT).describe("Local path to write the CA tarball. File permissions are set to 0600 after writing.")).option("--include-ca", z22.boolean().default(true).describe("Include the mitmproxy CA certificate and private key in the backup. Currently the only supported backup target.")).example("# Back up the CA to the default path").example("infra gateway backup --include-ca").example("# Back up the CA to a custom path").example("infra gateway backup --output /secure/backup/mitmproxy-ca.tar").action(gatewayBackupAction);
|
|
11931
12031
|
}
|
|
11932
12032
|
|
|
11933
12033
|
// src/commands/gateway/deploy.ts
|
|
11934
|
-
import { z as
|
|
12034
|
+
import { z as z23 } from "zod";
|
|
11935
12035
|
var REPO4 = "marcusrbrown/infra";
|
|
11936
12036
|
var WORKFLOW_NAME4 = "Deploy Gateway";
|
|
11937
12037
|
var WORKFLOW_URL4 = "https://github.com/marcusrbrown/infra/actions/workflows/deploy-gateway.yaml";
|
|
@@ -12000,7 +12100,7 @@ function validateGatewayRemotePreconditions() {
|
|
|
12000
12100
|
}
|
|
12001
12101
|
}
|
|
12002
12102
|
function registerGatewayDeploy(cli) {
|
|
12003
|
-
cli.command("gateway deploy", "Deploy the gateway. Default mode triggers the GitHub Deploy Gateway workflow, while --local runs apps/gateway deploy directly with Bun.").option("--local",
|
|
12103
|
+
cli.command("gateway deploy", "Deploy the gateway. Default mode triggers the GitHub Deploy Gateway workflow, while --local runs apps/gateway deploy directly with Bun.").option("--local", z23.boolean().default(false).describe("Run local deployment with Bun using apps/gateway instead of triggering GitHub Actions.")).option("--dry-run", z23.boolean().default(false).describe("Validate deploy prerequisites and print planned actions without executing local deploy or dispatching workflow.")).option("--force-recreate", z23.boolean().default(false).describe("Force recreate containers. Forwarded only in local mode.")).example("# Trigger remote GitHub Actions deploy (default mode)").example("infra gateway deploy").example("# Validate local deploy preconditions and planned command").example("infra gateway deploy --local --dry-run").example("# Run local deploy with explicit SSH agent context").example("infra gateway deploy --local").action(async (options) => {
|
|
12004
12104
|
if (options.local) {
|
|
12005
12105
|
const command = [
|
|
12006
12106
|
"bun",
|
|
@@ -12016,14 +12116,14 @@ function registerGatewayDeploy(cli) {
|
|
|
12016
12116
|
return;
|
|
12017
12117
|
}
|
|
12018
12118
|
const env = getGatewayDeployEnv();
|
|
12019
|
-
const
|
|
12119
|
+
const child = Bun.spawn(command, {
|
|
12020
12120
|
env,
|
|
12021
12121
|
stdout: "inherit",
|
|
12022
12122
|
stderr: "inherit"
|
|
12023
12123
|
});
|
|
12024
|
-
const
|
|
12025
|
-
if (
|
|
12026
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
12124
|
+
const exitCode = await child.exited;
|
|
12125
|
+
if (exitCode !== 0) {
|
|
12126
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
12027
12127
|
}
|
|
12028
12128
|
return;
|
|
12029
12129
|
}
|
|
@@ -12048,7 +12148,7 @@ function registerGatewayDeploy(cli) {
|
|
|
12048
12148
|
}
|
|
12049
12149
|
|
|
12050
12150
|
// src/commands/gateway/logs.ts
|
|
12051
|
-
import { z as
|
|
12151
|
+
import { z as z24 } from "zod";
|
|
12052
12152
|
var COMPOSE_PROJECT_DIR3 = "/opt/gateway/deploy";
|
|
12053
12153
|
var SENSITIVE_WARNING4 = "Warning: Logs may contain Discord tokens, S3 credentials, or user data. Treat output as sensitive; do not capture in shared logs or chat.";
|
|
12054
12154
|
var VALID_SERVICES2 = ["gateway", "workspace", "mitmproxy"];
|
|
@@ -12097,7 +12197,7 @@ async function streamGatewayLogs(opts, spawn = defaultLogsSpawn3, printOut, prin
|
|
|
12097
12197
|
return { refused: false, exitCode };
|
|
12098
12198
|
}
|
|
12099
12199
|
function registerGatewayLogs(cli) {
|
|
12100
|
-
cli.command("gateway logs [service]", "Stream logs from a gateway service via SSH and docker compose.").option("--tail [n]",
|
|
12200
|
+
cli.command("gateway logs [service]", "Stream logs from a gateway service via SSH and docker compose.").option("--tail [n]", z24.number().default(100).describe("Number of log lines to tail from each service.")).option("--allow-ci", z24.boolean().default(false).describe("Allow log streaming in CI environments. Logs may contain sensitive credentials.")).option("--key [key]", z24.string().describe("Environment variable name holding the SSH host. Falls back to GATEWAY_HOST when omitted.")).action(async (service, options) => {
|
|
12101
12201
|
const targetService = service ?? "gateway";
|
|
12102
12202
|
try {
|
|
12103
12203
|
validateService2(targetService);
|
|
@@ -12127,7 +12227,7 @@ function registerGatewayLogs(cli) {
|
|
|
12127
12227
|
}
|
|
12128
12228
|
|
|
12129
12229
|
// src/commands/gateway/restore.ts
|
|
12130
|
-
import { z as
|
|
12230
|
+
import { z as z25 } from "zod";
|
|
12131
12231
|
var MITMPROXY_CERTS_VOLUME2 = "mitmproxy-certs";
|
|
12132
12232
|
var CA_CERT_FILE2 = "mitmproxy-ca-cert.pem";
|
|
12133
12233
|
var CA_KEY_FILE2 = "mitmproxy-ca.pem";
|
|
@@ -12281,7 +12381,7 @@ async function restoreGatewayCa(opts, spawn = defaultSpawn4) {
|
|
|
12281
12381
|
}
|
|
12282
12382
|
}
|
|
12283
12383
|
function registerGatewayRestore(cli) {
|
|
12284
|
-
cli.command("gateway restore", "Restore the mitmproxy CA certificate and private key from a local tarball into the gateway Docker volume. Restarts mitmproxy and gateway services after restore and confirms byte-equal content before reporting success.").option("--input <file>",
|
|
12384
|
+
cli.command("gateway restore", "Restore the mitmproxy CA certificate and private key from a local tarball into the gateway Docker volume. Restarts mitmproxy and gateway services after restore and confirms byte-equal content before reporting success.").option("--input <file>", z25.string().describe("Path to the tarball produced by `gateway backup --include-ca`. Required.")).option("--include-ca", z25.boolean().default(true).describe("Restore the mitmproxy CA certificate and private key. Currently the only supported restore target.")).example("# Restore CA from a backup tarball").example("infra gateway restore --input apps/gateway/.local/mitmproxy-ca.tar").example("# Restore CA from a custom path").example("infra gateway restore --input /secure/backup/mitmproxy-ca.tar --include-ca").action(async (options) => {
|
|
12285
12385
|
const hostEnvKey = "GATEWAY_HOST";
|
|
12286
12386
|
const host = process.env[hostEnvKey];
|
|
12287
12387
|
if (!host) {
|
|
@@ -12302,7 +12402,7 @@ function registerGatewayRestore(cli) {
|
|
|
12302
12402
|
}
|
|
12303
12403
|
|
|
12304
12404
|
// src/commands/gateway/status.ts
|
|
12305
|
-
import { z as
|
|
12405
|
+
import { z as z26 } from "zod";
|
|
12306
12406
|
var COMPOSE_PROJECT_DIR5 = "/opt/gateway/deploy";
|
|
12307
12407
|
function parseComposePsOutput2(stdoutText) {
|
|
12308
12408
|
const trimmed = stdoutText.trim();
|
|
@@ -12444,7 +12544,7 @@ async function gatewayStatusAction(options, ctx, spawn) {
|
|
|
12444
12544
|
}
|
|
12445
12545
|
}
|
|
12446
12546
|
function registerGatewayStatus(cli) {
|
|
12447
|
-
cli.command("gateway status", "Show operational health of the gateway deployment via docker compose ps.").option("--key [key]",
|
|
12547
|
+
cli.command("gateway status", "Show operational health of the gateway deployment via docker compose ps.").option("--key [key]", z26.string().describe("Environment variable name holding the SSH host. Falls back to GATEWAY_HOST when omitted.")).action((options, ctx) => gatewayStatusAction(options, ctx));
|
|
12448
12548
|
}
|
|
12449
12549
|
|
|
12450
12550
|
// src/commands/gateway/index.ts
|
|
@@ -12459,7 +12559,7 @@ function registerGatewayCommands(cli) {
|
|
|
12459
12559
|
// src/commands/keeweb/deploy.ts
|
|
12460
12560
|
import { existsSync as existsSync5 } from "fs";
|
|
12461
12561
|
import { join as join6 } from "path";
|
|
12462
|
-
import { z as
|
|
12562
|
+
import { z as z27 } from "zod";
|
|
12463
12563
|
var REPO5 = "marcusrbrown/infra";
|
|
12464
12564
|
var WORKFLOW_NAME5 = "Deploy KeeWeb";
|
|
12465
12565
|
var WORKFLOW_URL5 = "https://github.com/marcusrbrown/infra/actions/workflows/deploy-keeweb.yaml";
|
|
@@ -12513,21 +12613,21 @@ function validateRemotePreconditions3() {
|
|
|
12513
12613
|
}
|
|
12514
12614
|
}
|
|
12515
12615
|
function registerKeewebDeploy(cli) {
|
|
12516
|
-
cli.command("keeweb deploy", "Trigger KeeWeb deployment. Default mode dispatches the GitHub Deploy KeeWeb workflow. Use --local to run apps/keeweb/deploy.sh directly from this repo.").option("--local",
|
|
12616
|
+
cli.command("keeweb deploy", "Trigger KeeWeb deployment. Default mode dispatches the GitHub Deploy KeeWeb workflow. Use --local to run apps/keeweb/deploy.sh directly from this repo.").option("--local", z27.boolean().default(false).describe("Run local deployment using apps/keeweb/deploy.sh instead of triggering GitHub Actions.")).option("--nginx", z27.boolean().default(false).describe("Include nginx config deployment. Valid only with --local and passed through to deploy.sh as --nginx.")).option("--dry-run", z27.boolean().default(false).describe("Print planned actions without validating preconditions, executing deploy.sh, or triggering GitHub Actions.")).example("# Trigger GitHub Deploy KeeWeb workflow (default mode)").example("infra keeweb deploy").example("# Preview local deploy plan without side effects").example("infra keeweb deploy --local --dry-run").example("# Run local deploy including nginx config update").example("infra keeweb deploy --local --nginx").action(async (options) => {
|
|
12517
12617
|
if (options.nginx && !options.local) {
|
|
12518
12618
|
throw new Error("--nginx is only valid with --local");
|
|
12519
12619
|
}
|
|
12520
12620
|
if (options.local) {
|
|
12521
12621
|
if (options.dryRun) {
|
|
12522
|
-
const
|
|
12523
|
-
const
|
|
12622
|
+
const deployScriptPath = resolveDeployScriptPath();
|
|
12623
|
+
const args = ["bash", deployScriptPath];
|
|
12524
12624
|
if (options.nginx) {
|
|
12525
|
-
|
|
12625
|
+
args.push("--nginx");
|
|
12526
12626
|
}
|
|
12527
12627
|
console.log("Dry run: local KeeWeb deploy");
|
|
12528
|
-
console.log(`- deploy script: ${
|
|
12628
|
+
console.log(`- deploy script: ${deployScriptPath}`);
|
|
12529
12629
|
console.log(`- dist check: ${resolveDistIndexPath()}`);
|
|
12530
|
-
console.log(`- command: ${
|
|
12630
|
+
console.log(`- command: ${args.join(" ")}`);
|
|
12531
12631
|
return;
|
|
12532
12632
|
}
|
|
12533
12633
|
const { deployScriptPath } = validateLocalPreconditions3({ nginx: options.nginx });
|
|
@@ -12536,14 +12636,14 @@ function registerKeewebDeploy(cli) {
|
|
|
12536
12636
|
if (options.nginx) {
|
|
12537
12637
|
args.push("--nginx");
|
|
12538
12638
|
}
|
|
12539
|
-
const
|
|
12639
|
+
const child = Bun.spawn(args, {
|
|
12540
12640
|
env,
|
|
12541
12641
|
stdout: "inherit",
|
|
12542
12642
|
stderr: "inherit"
|
|
12543
12643
|
});
|
|
12544
|
-
const
|
|
12545
|
-
if (
|
|
12546
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
12644
|
+
const exitCode = await child.exited;
|
|
12645
|
+
if (exitCode !== 0) {
|
|
12646
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
12547
12647
|
}
|
|
12548
12648
|
return;
|
|
12549
12649
|
}
|
|
@@ -12592,13 +12692,13 @@ function registerKeewebOpen(cli) {
|
|
|
12592
12692
|
|
|
12593
12693
|
// src/commands/keeweb/status.ts
|
|
12594
12694
|
import { join as join7 } from "path";
|
|
12595
|
-
import { z as
|
|
12695
|
+
import { z as z28 } from "zod";
|
|
12596
12696
|
var SITE_URL = "https://kw.igg.ms/";
|
|
12597
12697
|
var GH_REPO = "marcusrbrown/infra";
|
|
12598
12698
|
var HTTP_TIMEOUT_MS4 = 1e4;
|
|
12599
|
-
var ghRunSchema =
|
|
12600
|
-
createdAt:
|
|
12601
|
-
url:
|
|
12699
|
+
var ghRunSchema = z28.array(z28.object({
|
|
12700
|
+
createdAt: z28.string().min(1),
|
|
12701
|
+
url: z28.url()
|
|
12602
12702
|
}));
|
|
12603
12703
|
function levelLabel2(level) {
|
|
12604
12704
|
if (level === "ok") {
|
|
@@ -12896,10 +12996,10 @@ function registerMcp(cli) {
|
|
|
12896
12996
|
}
|
|
12897
12997
|
|
|
12898
12998
|
// src/commands/status.ts
|
|
12899
|
-
import { z as
|
|
12999
|
+
import { z as z37 } from "zod";
|
|
12900
13000
|
|
|
12901
13001
|
// src/commands/umami/deploy.ts
|
|
12902
|
-
import { z as
|
|
13002
|
+
import { z as z29 } from "zod";
|
|
12903
13003
|
var REPO6 = "marcusrbrown/infra";
|
|
12904
13004
|
var WORKFLOW_NAME6 = "Deploy Umami";
|
|
12905
13005
|
var WORKFLOW_URL6 = "https://github.com/marcusrbrown/infra/actions/workflows/deploy-umami.yaml";
|
|
@@ -12934,7 +13034,7 @@ function validateUmamiRemotePreconditions() {
|
|
|
12934
13034
|
}
|
|
12935
13035
|
}
|
|
12936
13036
|
function registerUmamiDeploy(cli) {
|
|
12937
|
-
cli.command("umami deploy", "Deploy Umami analytics. Default mode triggers the GitHub Deploy Umami workflow, while --local runs apps/umami deploy directly with Bun.").option("--local",
|
|
13037
|
+
cli.command("umami deploy", "Deploy Umami analytics. Default mode triggers the GitHub Deploy Umami workflow, while --local runs apps/umami deploy directly with Bun.").option("--local", z29.boolean().default(false).describe("Run local deployment with Bun using apps/umami instead of triggering GitHub Actions.")).option("--dry-run", z29.boolean().default(false).describe("Validate deploy prerequisites and print planned actions without executing local deploy or dispatching workflow.")).example("# Trigger remote GitHub Actions deploy (default mode)").example("infra umami deploy").example("# Validate local deploy preconditions and planned command").example("infra umami deploy --local --dry-run").example("# Run local deploy with explicit SSH agent context").example("infra umami deploy --local").action(async (options) => {
|
|
12938
13038
|
if (options.local) {
|
|
12939
13039
|
const command = ["bun", "run", "--cwd", "apps/umami", "deploy"];
|
|
12940
13040
|
if (options.dryRun) {
|
|
@@ -12943,14 +13043,14 @@ function registerUmamiDeploy(cli) {
|
|
|
12943
13043
|
return;
|
|
12944
13044
|
}
|
|
12945
13045
|
const env = getUmamiDeployEnv();
|
|
12946
|
-
const
|
|
13046
|
+
const child = Bun.spawn(command, {
|
|
12947
13047
|
env,
|
|
12948
13048
|
stdout: "inherit",
|
|
12949
13049
|
stderr: "inherit"
|
|
12950
13050
|
});
|
|
12951
|
-
const
|
|
12952
|
-
if (
|
|
12953
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
13051
|
+
const exitCode = await child.exited;
|
|
13052
|
+
if (exitCode !== 0) {
|
|
13053
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
12954
13054
|
}
|
|
12955
13055
|
return;
|
|
12956
13056
|
}
|
|
@@ -12975,7 +13075,7 @@ function registerUmamiDeploy(cli) {
|
|
|
12975
13075
|
}
|
|
12976
13076
|
|
|
12977
13077
|
// src/commands/umami/logs.ts
|
|
12978
|
-
import { z as
|
|
13078
|
+
import { z as z30 } from "zod";
|
|
12979
13079
|
|
|
12980
13080
|
// src/commands/umami/host.ts
|
|
12981
13081
|
var VALID_HOST_RE5 = /^[a-z\d][a-z\d.\-]*$/i;
|
|
@@ -13039,7 +13139,7 @@ async function streamUmamiLogs(opts, spawn = defaultLogsSpawn4, printOut, printE
|
|
|
13039
13139
|
return { refused: false, exitCode };
|
|
13040
13140
|
}
|
|
13041
13141
|
function registerUmamiLogs(cli) {
|
|
13042
|
-
cli.command("umami logs [service]", "Stream logs from an Umami service via SSH and docker compose.").option("--tail [n]",
|
|
13142
|
+
cli.command("umami logs [service]", "Stream logs from an Umami service via SSH and docker compose.").option("--tail [n]", z30.number().default(100).describe("Number of log lines to tail from each service.")).option("--allow-ci", z30.boolean().default(false).describe("Allow log streaming in CI environments. Logs may contain sensitive credentials.")).option("--key [key]", z30.string().describe("Environment variable name holding the SSH host. Falls back to UMAMI_DOMAIN when omitted.")).action(async (service, options) => {
|
|
13043
13143
|
const targetService = service ?? "umami";
|
|
13044
13144
|
try {
|
|
13045
13145
|
validateService3(targetService);
|
|
@@ -13069,7 +13169,7 @@ function registerUmamiLogs(cli) {
|
|
|
13069
13169
|
}
|
|
13070
13170
|
|
|
13071
13171
|
// src/commands/umami/status.ts
|
|
13072
|
-
import { z as
|
|
13172
|
+
import { z as z31 } from "zod";
|
|
13073
13173
|
var COMPOSE_PROJECT_DIR7 = "/opt/umami";
|
|
13074
13174
|
function parseComposePsOutput3(stdoutText) {
|
|
13075
13175
|
const trimmed = stdoutText.trim();
|
|
@@ -13240,7 +13340,7 @@ async function umamiStatusAction(options, ctx, spawn) {
|
|
|
13240
13340
|
}
|
|
13241
13341
|
}
|
|
13242
13342
|
function registerUmamiStatus(cli) {
|
|
13243
|
-
cli.command("umami status", "Show operational health of the Umami analytics deployment via docker compose ps.").option("--key [key]",
|
|
13343
|
+
cli.command("umami status", "Show operational health of the Umami analytics deployment via docker compose ps.").option("--key [key]", z31.string().optional().describe("Environment variable name holding the SSH host. Falls back to UMAMI_DOMAIN when omitted.")).action((options, ctx) => umamiStatusAction(options, ctx));
|
|
13244
13344
|
}
|
|
13245
13345
|
|
|
13246
13346
|
// src/commands/umami/index.ts
|
|
@@ -13253,24 +13353,24 @@ function registerUmamiCommands(cli) {
|
|
|
13253
13353
|
// src/commands/vpn/client.ts
|
|
13254
13354
|
import { mkdir, writeFile as writeFile2 } from "fs/promises";
|
|
13255
13355
|
import { join as join8, resolve as resolve2 } from "path";
|
|
13256
|
-
import { z as
|
|
13356
|
+
import { z as z33 } from "zod";
|
|
13257
13357
|
|
|
13258
13358
|
// src/commands/vpn/peers.ts
|
|
13259
13359
|
import { readFile, writeFile } from "fs/promises";
|
|
13260
|
-
import { z as
|
|
13261
|
-
var peerSchema =
|
|
13262
|
-
name:
|
|
13263
|
-
publicKey:
|
|
13264
|
-
tunnelIp:
|
|
13360
|
+
import { z as z32 } from "zod";
|
|
13361
|
+
var peerSchema = z32.object({
|
|
13362
|
+
name: z32.string(),
|
|
13363
|
+
publicKey: z32.string(),
|
|
13364
|
+
tunnelIp: z32.string()
|
|
13265
13365
|
});
|
|
13266
|
-
var peersFileSchema =
|
|
13267
|
-
peers:
|
|
13366
|
+
var peersFileSchema = z32.object({
|
|
13367
|
+
peers: z32.array(peerSchema)
|
|
13268
13368
|
}).superRefine((data, ctx) => {
|
|
13269
13369
|
const seenIps = new Set;
|
|
13270
13370
|
for (const peer of data.peers) {
|
|
13271
13371
|
if (seenIps.has(peer.tunnelIp)) {
|
|
13272
13372
|
ctx.addIssue({
|
|
13273
|
-
code:
|
|
13373
|
+
code: z32.ZodIssueCode.custom,
|
|
13274
13374
|
message: `Duplicate tunnel IP "${peer.tunnelIp}" \u2014 each peer must have a unique tunnel IP.`,
|
|
13275
13375
|
path: ["peers"]
|
|
13276
13376
|
});
|
|
@@ -13282,7 +13382,7 @@ var peersFileSchema = z31.object({
|
|
|
13282
13382
|
for (const peer of data.peers) {
|
|
13283
13383
|
if (seenNames.has(peer.name)) {
|
|
13284
13384
|
ctx.addIssue({
|
|
13285
|
-
code:
|
|
13385
|
+
code: z32.ZodIssueCode.custom,
|
|
13286
13386
|
message: `Duplicate name "${peer.name}" \u2014 each peer must have a unique name.`,
|
|
13287
13387
|
path: ["peers"]
|
|
13288
13388
|
});
|
|
@@ -13524,7 +13624,7 @@ function resolveDefaultClientsDir() {
|
|
|
13524
13624
|
return join8(findRepoRoot(), "apps", "vpn", "clients");
|
|
13525
13625
|
}
|
|
13526
13626
|
function registerVpnClient(cli) {
|
|
13527
|
-
cli.command("vpn client add <name>", "Add a new VPN client peer. Generates a keypair, assigns a tunnel IP, writes the client .conf to apps/vpn/clients/, and syncs the roster to the VPN_PEERS GitHub secret (best-effort).").option("--split-tunnel [cidrs]",
|
|
13627
|
+
cli.command("vpn client add <name>", "Add a new VPN client peer. Generates a keypair, assigns a tunnel IP, writes the client .conf to apps/vpn/clients/, and syncs the roster to the VPN_PEERS GitHub secret (best-effort).").option("--split-tunnel [cidrs]", z33.string().describe("Comma-separated CIDRs for split-tunnel routing. Defaults to 0.0.0.0/0 (full tunnel).")).option("--dns [dns]", z33.string().describe("DNS server for the client config.")).option("--server-pubkey [key]", z33.string().describe("Server public key. Falls back to VPN_SERVER_PUBKEY env var.")).option("--endpoint [host]", z33.string().describe("VPN server endpoint (IP or hostname). Falls back to VPN_HOST env var.")).example('# Add a new client named "laptop"').example("infra vpn client add laptop").example("# Add a split-tunnel client").example("infra vpn client add laptop --split-tunnel 10.0.0.0/8,192.168.0.0/16").action(async (name, options) => {
|
|
13528
13628
|
const serverPublicKey = options.serverPubkey ?? process.env.VPN_SERVER_PUBKEY;
|
|
13529
13629
|
const endpoint = options.endpoint ?? process.env.VPN_HOST;
|
|
13530
13630
|
if (!serverPublicKey) {
|
|
@@ -13588,7 +13688,7 @@ function registerVpnClient(cli) {
|
|
|
13588
13688
|
}
|
|
13589
13689
|
|
|
13590
13690
|
// src/commands/vpn/deploy.ts
|
|
13591
|
-
import { z as
|
|
13691
|
+
import { z as z34 } from "zod";
|
|
13592
13692
|
var REPO7 = "marcusrbrown/infra";
|
|
13593
13693
|
var WORKFLOW_NAME7 = "Deploy VPN";
|
|
13594
13694
|
var WORKFLOW_URL7 = "https://github.com/marcusrbrown/infra/actions/workflows/deploy-vpn.yaml";
|
|
@@ -13618,7 +13718,7 @@ function validateVpnRemotePreconditions() {
|
|
|
13618
13718
|
}
|
|
13619
13719
|
}
|
|
13620
13720
|
function registerVpnDeploy(cli) {
|
|
13621
|
-
cli.command("vpn deploy", "Deploy the VPN. Default mode triggers the GitHub Deploy VPN workflow, while --local runs apps/vpn deploy directly with Bun.").option("--local",
|
|
13721
|
+
cli.command("vpn deploy", "Deploy the VPN. Default mode triggers the GitHub Deploy VPN workflow, while --local runs apps/vpn deploy directly with Bun.").option("--local", z34.boolean().default(false).describe("Run local deployment with Bun using apps/vpn instead of triggering GitHub Actions.")).option("--dry-run", z34.boolean().default(false).describe("Validate deploy prerequisites and print planned actions without executing local deploy or dispatching workflow.")).option("--force-server-key", z34.boolean().default(false).describe("Force regeneration of the server WireGuard keypair. WARNING: invalidates all existing client configs.")).example("# Trigger remote GitHub Actions deploy (default mode)").example("infra vpn deploy").example("# Validate local deploy preconditions and planned command").example("infra vpn deploy --local --dry-run").example("# Run local deploy with explicit SSH agent context").example("infra vpn deploy --local").action(async (options) => {
|
|
13622
13722
|
if (options.local) {
|
|
13623
13723
|
const command = [
|
|
13624
13724
|
"bun",
|
|
@@ -13634,14 +13734,14 @@ function registerVpnDeploy(cli) {
|
|
|
13634
13734
|
return;
|
|
13635
13735
|
}
|
|
13636
13736
|
const env = getVpnDeployEnv();
|
|
13637
|
-
const
|
|
13737
|
+
const child = Bun.spawn(command, {
|
|
13638
13738
|
env,
|
|
13639
13739
|
stdout: "inherit",
|
|
13640
13740
|
stderr: "inherit"
|
|
13641
13741
|
});
|
|
13642
|
-
const
|
|
13643
|
-
if (
|
|
13644
|
-
throw new Error(`Local deploy failed with exit code ${
|
|
13742
|
+
const exitCode = await child.exited;
|
|
13743
|
+
if (exitCode !== 0) {
|
|
13744
|
+
throw new Error(`Local deploy failed with exit code ${exitCode}`);
|
|
13645
13745
|
}
|
|
13646
13746
|
return;
|
|
13647
13747
|
}
|
|
@@ -13666,7 +13766,7 @@ function registerVpnDeploy(cli) {
|
|
|
13666
13766
|
}
|
|
13667
13767
|
|
|
13668
13768
|
// src/commands/vpn/logs.ts
|
|
13669
|
-
import { z as
|
|
13769
|
+
import { z as z35 } from "zod";
|
|
13670
13770
|
|
|
13671
13771
|
// src/commands/vpn/host.ts
|
|
13672
13772
|
var VALID_HOST_RE6 = /^[a-z\d][a-z\d.\-]*$/i;
|
|
@@ -13722,7 +13822,7 @@ async function streamVpnLogs(opts, spawn = defaultLogsSpawn5, printOut, printErr
|
|
|
13722
13822
|
return { refused: false, exitCode };
|
|
13723
13823
|
}
|
|
13724
13824
|
function registerVpnLogs(cli) {
|
|
13725
|
-
cli.command("vpn logs", "Stream WireGuard VPN logs via SSH and journalctl.").option("--tail [n]",
|
|
13825
|
+
cli.command("vpn logs", "Stream WireGuard VPN logs via SSH and journalctl.").option("--tail [n]", z35.number().default(100).describe("Number of log lines to tail.")).option("--allow-ci", z35.boolean().default(false).describe("Allow log streaming in CI environments. Logs may contain sensitive VPN data.")).option("--key [key]", z35.string().describe("Environment variable name holding the SSH host. Falls back to VPN_HOST when omitted.")).action(async (options) => {
|
|
13726
13826
|
const hostEnvKey = options.key ?? "VPN_HOST";
|
|
13727
13827
|
const host = process.env[hostEnvKey];
|
|
13728
13828
|
if (!host) {
|
|
@@ -13744,7 +13844,7 @@ function registerVpnLogs(cli) {
|
|
|
13744
13844
|
}
|
|
13745
13845
|
|
|
13746
13846
|
// src/commands/vpn/status.ts
|
|
13747
|
-
import { z as
|
|
13847
|
+
import { z as z36 } from "zod";
|
|
13748
13848
|
|
|
13749
13849
|
// src/commands/vpn/shared.ts
|
|
13750
13850
|
function parseWgShowOutput(output) {
|
|
@@ -13871,7 +13971,7 @@ async function vpnStatusAction(options, ctx, spawn) {
|
|
|
13871
13971
|
}
|
|
13872
13972
|
}
|
|
13873
13973
|
function registerVpnStatus(cli) {
|
|
13874
|
-
cli.command("vpn status", "Show operational health of the VPN box via SSH and wg show.").option("--key [key]",
|
|
13974
|
+
cli.command("vpn status", "Show operational health of the VPN box via SSH and wg show.").option("--key [key]", z36.string().describe("Environment variable name holding the SSH host. Falls back to VPN_HOST when omitted.")).action((options, ctx) => vpnStatusAction(options, ctx));
|
|
13875
13975
|
}
|
|
13876
13976
|
|
|
13877
13977
|
// src/commands/vpn/index.ts
|
|
@@ -13883,7 +13983,7 @@ function registerVpnCommands(cli) {
|
|
|
13883
13983
|
}
|
|
13884
13984
|
|
|
13885
13985
|
// src/commands/status.ts
|
|
13886
|
-
var
|
|
13986
|
+
var DEFAULT_CLIPROXY_URL9 = "https://cliproxy.fro.bot";
|
|
13887
13987
|
var ERROR_PREFIX = "\u274C";
|
|
13888
13988
|
var TABLE_COLUMNS = [
|
|
13889
13989
|
{ key: "app", label: "App" },
|
|
@@ -13893,7 +13993,7 @@ var TABLE_COLUMNS = [
|
|
|
13893
13993
|
{ key: "contentHash", label: "Content Hash" },
|
|
13894
13994
|
{ key: "usageStats", label: "Usage Stats" }
|
|
13895
13995
|
];
|
|
13896
|
-
function
|
|
13996
|
+
function stripTrailingSlash7(value) {
|
|
13897
13997
|
return value.endsWith("/") ? value.slice(0, -1) : value;
|
|
13898
13998
|
}
|
|
13899
13999
|
function errorSummary(app, reason) {
|
|
@@ -13933,7 +14033,7 @@ async function unifiedStatusAction(options, ctx, dependencies = {
|
|
|
13933
14033
|
getBrokerStatusSummary
|
|
13934
14034
|
}) {
|
|
13935
14035
|
const verbose = options.verbose === true;
|
|
13936
|
-
const cliproxyBaseUrl =
|
|
14036
|
+
const cliproxyBaseUrl = stripTrailingSlash7(process.env.CLIPROXY_URL ?? DEFAULT_CLIPROXY_URL9);
|
|
13937
14037
|
const cliproxyKey = process.env.CLIPROXY_MANAGEMENT_KEY ?? "";
|
|
13938
14038
|
const gatewayHost = process.env.GATEWAY_HOST ?? "";
|
|
13939
14039
|
const umamiHost = process.env.UMAMI_DOMAIN ?? "";
|
|
@@ -13978,7 +14078,7 @@ function registerStatus(cli, dependencies = {
|
|
|
13978
14078
|
getVpnStatusSummary,
|
|
13979
14079
|
getBrokerStatusSummary
|
|
13980
14080
|
}) {
|
|
13981
|
-
cli.command("status", "Show status of all deployments").option("--json",
|
|
14081
|
+
cli.command("status", "Show status of all deployments").option("--json", z37.boolean().describe("Output machine-readable JSON with keeweb, cliproxy, gateway, umami, dashboard, vpn, and broker summary objects.")).option("--verbose", z37.boolean().describe("Include verbose per-app health check details when building the summary rows.")).action((options, ctx) => unifiedStatusAction(options, ctx, dependencies));
|
|
13982
14082
|
}
|
|
13983
14083
|
|
|
13984
14084
|
// src/cli.ts
|