@aerovato/operator-opencode-v2 1.0.0 → 2.0.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/README.md +2 -4
- package/dist/index.js +333 -472
- package/dist/index.js.map +10 -11
- package/dist/notifications.js +2 -6
- package/dist/notifications.js.map +3 -3
- package/dist/server.js +8067 -0
- package/dist/server.js.map +97 -0
- package/dist/tui.js +48 -43530
- package/dist/tui.js.map +5 -20
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
3
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
|
|
6
|
-
var require_identity = __commonJS((exports)
|
|
6
|
+
var require_identity = __commonJS(function(exports) {
|
|
7
7
|
var ALIAS = Symbol.for("yaml.alias");
|
|
8
8
|
var DOC = Symbol.for("yaml.document");
|
|
9
9
|
var MAP = Symbol.for("yaml.map");
|
|
@@ -57,7 +57,7 @@ var require_identity = __commonJS((exports) => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/visit.js
|
|
60
|
-
var require_visit = __commonJS((exports)
|
|
60
|
+
var require_visit = __commonJS(function(exports) {
|
|
61
61
|
var identity = require_identity();
|
|
62
62
|
var BREAK = Symbol("break visit");
|
|
63
63
|
var SKIP = Symbol("skip children");
|
|
@@ -212,7 +212,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js
|
|
215
|
-
var require_directives = __commonJS((exports)
|
|
215
|
+
var require_directives = __commonJS(function(exports) {
|
|
216
216
|
var identity = require_identity();
|
|
217
217
|
var visit = require_visit();
|
|
218
218
|
var escapeChars = {
|
|
@@ -364,7 +364,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
364
364
|
});
|
|
365
365
|
|
|
366
366
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js
|
|
367
|
-
var require_anchors = __commonJS((exports)
|
|
367
|
+
var require_anchors = __commonJS(function(exports) {
|
|
368
368
|
var identity = require_identity();
|
|
369
369
|
var visit = require_visit();
|
|
370
370
|
function anchorIsValid(anchor) {
|
|
@@ -426,7 +426,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
426
426
|
});
|
|
427
427
|
|
|
428
428
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js
|
|
429
|
-
var require_applyReviver = __commonJS((exports)
|
|
429
|
+
var require_applyReviver = __commonJS(function(exports) {
|
|
430
430
|
function applyReviver(reviver, obj, key, val) {
|
|
431
431
|
if (val && typeof val === "object") {
|
|
432
432
|
if (Array.isArray(val)) {
|
|
@@ -473,7 +473,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
473
473
|
});
|
|
474
474
|
|
|
475
475
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js
|
|
476
|
-
var require_toJS = __commonJS((exports)
|
|
476
|
+
var require_toJS = __commonJS(function(exports) {
|
|
477
477
|
var identity = require_identity();
|
|
478
478
|
function toJS(value, arg, ctx) {
|
|
479
479
|
if (Array.isArray(value))
|
|
@@ -483,8 +483,8 @@ var require_toJS = __commonJS((exports) => {
|
|
|
483
483
|
return value.toJSON(arg, ctx);
|
|
484
484
|
const data = { aliasCount: 0, count: 1, res: undefined };
|
|
485
485
|
ctx.anchors.set(value, data);
|
|
486
|
-
ctx.onCreate = (
|
|
487
|
-
data.res =
|
|
486
|
+
ctx.onCreate = (res) => {
|
|
487
|
+
data.res = res;
|
|
488
488
|
delete ctx.onCreate;
|
|
489
489
|
};
|
|
490
490
|
const res = value.toJSON(arg, ctx);
|
|
@@ -500,7 +500,7 @@ var require_toJS = __commonJS((exports) => {
|
|
|
500
500
|
});
|
|
501
501
|
|
|
502
502
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js
|
|
503
|
-
var require_Node = __commonJS((exports)
|
|
503
|
+
var require_Node = __commonJS(function(exports) {
|
|
504
504
|
var applyReviver = require_applyReviver();
|
|
505
505
|
var identity = require_identity();
|
|
506
506
|
var toJS = require_toJS();
|
|
@@ -528,8 +528,8 @@ var require_Node = __commonJS((exports) => {
|
|
|
528
528
|
};
|
|
529
529
|
const res = toJS.toJS(this, "", ctx);
|
|
530
530
|
if (typeof onAnchor === "function")
|
|
531
|
-
for (const { count, res
|
|
532
|
-
onAnchor(
|
|
531
|
+
for (const { count, res } of ctx.anchors.values())
|
|
532
|
+
onAnchor(res, count);
|
|
533
533
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
@@ -537,7 +537,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
537
537
|
});
|
|
538
538
|
|
|
539
539
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js
|
|
540
|
-
var require_Alias = __commonJS((exports)
|
|
540
|
+
var require_Alias = __commonJS(function(exports) {
|
|
541
541
|
var anchors = require_anchors();
|
|
542
542
|
var visit = require_visit();
|
|
543
543
|
var identity = require_identity();
|
|
@@ -583,16 +583,16 @@ var require_Alias = __commonJS((exports) => {
|
|
|
583
583
|
toJSON(_arg, ctx) {
|
|
584
584
|
if (!ctx)
|
|
585
585
|
return { source: this.source };
|
|
586
|
-
const { anchors
|
|
586
|
+
const { anchors, doc, maxAliasCount } = ctx;
|
|
587
587
|
const source = this.resolve(doc, ctx);
|
|
588
588
|
if (!source) {
|
|
589
589
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
590
590
|
throw new ReferenceError(msg);
|
|
591
591
|
}
|
|
592
|
-
let data =
|
|
592
|
+
let data = anchors.get(source);
|
|
593
593
|
if (!data) {
|
|
594
594
|
toJS.toJS(source, null, ctx);
|
|
595
|
-
data =
|
|
595
|
+
data = anchors.get(source);
|
|
596
596
|
}
|
|
597
597
|
if (data?.res === undefined) {
|
|
598
598
|
const msg = "This should not happen: Alias anchor was not resolved?";
|
|
@@ -601,7 +601,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
601
601
|
if (maxAliasCount >= 0) {
|
|
602
602
|
data.count += 1;
|
|
603
603
|
if (data.aliasCount === 0)
|
|
604
|
-
data.aliasCount = getAliasCount(doc, source,
|
|
604
|
+
data.aliasCount = getAliasCount(doc, source, anchors);
|
|
605
605
|
if (data.count * data.aliasCount > maxAliasCount) {
|
|
606
606
|
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
607
607
|
throw new ReferenceError(msg);
|
|
@@ -623,22 +623,22 @@ var require_Alias = __commonJS((exports) => {
|
|
|
623
623
|
return src;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function getAliasCount(doc, node,
|
|
626
|
+
function getAliasCount(doc, node, anchors) {
|
|
627
627
|
if (identity.isAlias(node)) {
|
|
628
628
|
const source = node.resolve(doc);
|
|
629
|
-
const anchor =
|
|
629
|
+
const anchor = anchors && source && anchors.get(source);
|
|
630
630
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
631
631
|
} else if (identity.isCollection(node)) {
|
|
632
632
|
let count = 0;
|
|
633
633
|
for (const item of node.items) {
|
|
634
|
-
const c = getAliasCount(doc, item,
|
|
634
|
+
const c = getAliasCount(doc, item, anchors);
|
|
635
635
|
if (c > count)
|
|
636
636
|
count = c;
|
|
637
637
|
}
|
|
638
638
|
return count;
|
|
639
639
|
} else if (identity.isPair(node)) {
|
|
640
|
-
const kc = getAliasCount(doc, node.key,
|
|
641
|
-
const vc = getAliasCount(doc, node.value,
|
|
640
|
+
const kc = getAliasCount(doc, node.key, anchors);
|
|
641
|
+
const vc = getAliasCount(doc, node.value, anchors);
|
|
642
642
|
return Math.max(kc, vc);
|
|
643
643
|
}
|
|
644
644
|
return 1;
|
|
@@ -647,7 +647,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
647
647
|
});
|
|
648
648
|
|
|
649
649
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js
|
|
650
|
-
var require_Scalar = __commonJS((exports)
|
|
650
|
+
var require_Scalar = __commonJS(function(exports) {
|
|
651
651
|
var identity = require_identity();
|
|
652
652
|
var Node = require_Node();
|
|
653
653
|
var toJS = require_toJS();
|
|
@@ -675,7 +675,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
675
675
|
});
|
|
676
676
|
|
|
677
677
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js
|
|
678
|
-
var require_createNode = __commonJS((exports)
|
|
678
|
+
var require_createNode = __commonJS(function(exports) {
|
|
679
679
|
var Alias = require_Alias();
|
|
680
680
|
var identity = require_identity();
|
|
681
681
|
var Scalar = require_Scalar();
|
|
@@ -723,10 +723,10 @@ var require_createNode = __commonJS((exports) => {
|
|
|
723
723
|
value = value.toJSON();
|
|
724
724
|
}
|
|
725
725
|
if (!value || typeof value !== "object") {
|
|
726
|
-
const
|
|
726
|
+
const node = new Scalar.Scalar(value);
|
|
727
727
|
if (ref)
|
|
728
|
-
ref.node =
|
|
729
|
-
return
|
|
728
|
+
ref.node = node;
|
|
729
|
+
return node;
|
|
730
730
|
}
|
|
731
731
|
tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
|
|
732
732
|
}
|
|
@@ -747,7 +747,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
747
747
|
});
|
|
748
748
|
|
|
749
749
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js
|
|
750
|
-
var require_Collection = __commonJS((exports)
|
|
750
|
+
var require_Collection = __commonJS(function(exports) {
|
|
751
751
|
var createNode = require_createNode();
|
|
752
752
|
var identity = require_identity();
|
|
753
753
|
var Node = require_Node();
|
|
@@ -862,7 +862,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
862
862
|
});
|
|
863
863
|
|
|
864
864
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
865
|
-
var require_stringifyComment = __commonJS((exports)
|
|
865
|
+
var require_stringifyComment = __commonJS(function(exports) {
|
|
866
866
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
867
867
|
function indentComment(comment, indent) {
|
|
868
868
|
if (/^\n+$/.test(comment))
|
|
@@ -879,7 +879,7 @@ var require_stringifyComment = __commonJS((exports) => {
|
|
|
879
879
|
});
|
|
880
880
|
|
|
881
881
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
882
|
-
var require_foldFlowLines = __commonJS((exports)
|
|
882
|
+
var require_foldFlowLines = __commonJS(function(exports) {
|
|
883
883
|
var FOLD_FLOW = "flow";
|
|
884
884
|
var FOLD_BLOCK = "block";
|
|
885
885
|
var FOLD_QUOTED = "quoted";
|
|
@@ -975,17 +975,17 @@ var require_foldFlowLines = __commonJS((exports) => {
|
|
|
975
975
|
if (onFold)
|
|
976
976
|
onFold();
|
|
977
977
|
let res = text.slice(0, folds[0]);
|
|
978
|
-
for (let
|
|
979
|
-
const fold = folds[
|
|
980
|
-
const
|
|
978
|
+
for (let i = 0;i < folds.length; ++i) {
|
|
979
|
+
const fold = folds[i];
|
|
980
|
+
const end = folds[i + 1] || text.length;
|
|
981
981
|
if (fold === 0)
|
|
982
982
|
res = `
|
|
983
|
-
${indent}${text.slice(0,
|
|
983
|
+
${indent}${text.slice(0, end)}`;
|
|
984
984
|
else {
|
|
985
985
|
if (mode === FOLD_QUOTED && escapedFolds[fold])
|
|
986
986
|
res += `${text[fold]}\\`;
|
|
987
987
|
res += `
|
|
988
|
-
${indent}${text.slice(fold + 1,
|
|
988
|
+
${indent}${text.slice(fold + 1, end)}`;
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
return res;
|
|
@@ -1016,7 +1016,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1016
1016
|
});
|
|
1017
1017
|
|
|
1018
1018
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js
|
|
1019
|
-
var require_stringifyString = __commonJS((exports)
|
|
1019
|
+
var require_stringifyString = __commonJS(function(exports) {
|
|
1020
1020
|
var Scalar = require_Scalar();
|
|
1021
1021
|
var foldFlowLines = require_foldFlowLines();
|
|
1022
1022
|
var getFoldOptions = (ctx, isBlock) => ({
|
|
@@ -1314,7 +1314,7 @@ ${indent}`);
|
|
|
1314
1314
|
});
|
|
1315
1315
|
|
|
1316
1316
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js
|
|
1317
|
-
var require_stringify = __commonJS((exports)
|
|
1317
|
+
var require_stringify = __commonJS(function(exports) {
|
|
1318
1318
|
var anchors = require_anchors();
|
|
1319
1319
|
var identity = require_identity();
|
|
1320
1320
|
var stringifyComment = require_stringifyComment();
|
|
@@ -1435,7 +1435,7 @@ ${ctx.indent}${str}`;
|
|
|
1435
1435
|
});
|
|
1436
1436
|
|
|
1437
1437
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1438
|
-
var require_stringifyPair = __commonJS((exports)
|
|
1438
|
+
var require_stringifyPair = __commonJS(function(exports) {
|
|
1439
1439
|
var identity = require_identity();
|
|
1440
1440
|
var Scalar = require_Scalar();
|
|
1441
1441
|
var stringify = require_stringify();
|
|
@@ -1571,7 +1571,7 @@ ${ctx.indent}`;
|
|
|
1571
1571
|
});
|
|
1572
1572
|
|
|
1573
1573
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/log.js
|
|
1574
|
-
var require_log = __commonJS((exports)
|
|
1574
|
+
var require_log = __commonJS(function(exports) {
|
|
1575
1575
|
var node_process = __require("process");
|
|
1576
1576
|
function debug(logLevel, ...messages) {
|
|
1577
1577
|
if (logLevel === "debug")
|
|
@@ -1590,7 +1590,7 @@ var require_log = __commonJS((exports) => {
|
|
|
1590
1590
|
});
|
|
1591
1591
|
|
|
1592
1592
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
1593
|
-
var require_merge = __commonJS((exports)
|
|
1593
|
+
var require_merge = __commonJS(function(exports) {
|
|
1594
1594
|
var identity = require_identity();
|
|
1595
1595
|
var Scalar = require_Scalar();
|
|
1596
1596
|
var MERGE_KEY = "<<";
|
|
@@ -1621,15 +1621,15 @@ var require_merge = __commonJS((exports) => {
|
|
|
1621
1621
|
if (!identity.isMap(source))
|
|
1622
1622
|
throw new Error("Merge sources must be maps or map aliases");
|
|
1623
1623
|
const srcMap = source.toJSON(null, ctx, Map);
|
|
1624
|
-
for (const [key,
|
|
1624
|
+
for (const [key, value] of srcMap) {
|
|
1625
1625
|
if (map instanceof Map) {
|
|
1626
1626
|
if (!map.has(key))
|
|
1627
|
-
map.set(key,
|
|
1627
|
+
map.set(key, value);
|
|
1628
1628
|
} else if (map instanceof Set) {
|
|
1629
1629
|
map.add(key);
|
|
1630
1630
|
} else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
|
1631
1631
|
Object.defineProperty(map, key, {
|
|
1632
|
-
value
|
|
1632
|
+
value,
|
|
1633
1633
|
writable: true,
|
|
1634
1634
|
enumerable: true,
|
|
1635
1635
|
configurable: true
|
|
@@ -1647,7 +1647,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
1647
1647
|
});
|
|
1648
1648
|
|
|
1649
1649
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
1650
|
-
var require_addPairToJSMap = __commonJS((exports)
|
|
1650
|
+
var require_addPairToJSMap = __commonJS(function(exports) {
|
|
1651
1651
|
var log = require_log();
|
|
1652
1652
|
var merge = require_merge();
|
|
1653
1653
|
var stringify = require_stringify();
|
|
@@ -1708,7 +1708,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
1708
1708
|
});
|
|
1709
1709
|
|
|
1710
1710
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js
|
|
1711
|
-
var require_Pair = __commonJS((exports)
|
|
1711
|
+
var require_Pair = __commonJS(function(exports) {
|
|
1712
1712
|
var createNode = require_createNode();
|
|
1713
1713
|
var stringifyPair = require_stringifyPair();
|
|
1714
1714
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -1746,14 +1746,14 @@ var require_Pair = __commonJS((exports) => {
|
|
|
1746
1746
|
});
|
|
1747
1747
|
|
|
1748
1748
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
1749
|
-
var require_stringifyCollection = __commonJS((exports)
|
|
1749
|
+
var require_stringifyCollection = __commonJS(function(exports) {
|
|
1750
1750
|
var identity = require_identity();
|
|
1751
1751
|
var stringify = require_stringify();
|
|
1752
1752
|
var stringifyComment = require_stringifyComment();
|
|
1753
1753
|
function stringifyCollection(collection, ctx, options) {
|
|
1754
1754
|
const flow = ctx.inFlow ?? collection.flow;
|
|
1755
|
-
const
|
|
1756
|
-
return
|
|
1755
|
+
const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
1756
|
+
return stringify(collection, ctx, options);
|
|
1757
1757
|
}
|
|
1758
1758
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
1759
1759
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -1762,13 +1762,13 @@ var require_stringifyCollection = __commonJS((exports) => {
|
|
|
1762
1762
|
const lines = [];
|
|
1763
1763
|
for (let i = 0;i < items.length; ++i) {
|
|
1764
1764
|
const item = items[i];
|
|
1765
|
-
let
|
|
1765
|
+
let comment = null;
|
|
1766
1766
|
if (identity.isNode(item)) {
|
|
1767
1767
|
if (!chompKeep && item.spaceBefore)
|
|
1768
1768
|
lines.push("");
|
|
1769
1769
|
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
|
|
1770
1770
|
if (item.comment)
|
|
1771
|
-
|
|
1771
|
+
comment = item.comment;
|
|
1772
1772
|
} else if (identity.isPair(item)) {
|
|
1773
1773
|
const ik = identity.isNode(item.key) ? item.key : null;
|
|
1774
1774
|
if (ik) {
|
|
@@ -1778,12 +1778,12 @@ var require_stringifyCollection = __commonJS((exports) => {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
}
|
|
1780
1780
|
chompKeep = false;
|
|
1781
|
-
let
|
|
1782
|
-
if (
|
|
1783
|
-
|
|
1784
|
-
if (chompKeep &&
|
|
1781
|
+
let str = stringify.stringify(item, itemCtx, () => comment = null, () => chompKeep = true);
|
|
1782
|
+
if (comment)
|
|
1783
|
+
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
|
|
1784
|
+
if (chompKeep && comment)
|
|
1785
1785
|
chompKeep = false;
|
|
1786
|
-
lines.push(blockItemPrefix +
|
|
1786
|
+
lines.push(blockItemPrefix + str);
|
|
1787
1787
|
}
|
|
1788
1788
|
let str;
|
|
1789
1789
|
if (lines.length === 0) {
|
|
@@ -1898,7 +1898,7 @@ ${indent}${end}`;
|
|
|
1898
1898
|
});
|
|
1899
1899
|
|
|
1900
1900
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
1901
|
-
var require_YAMLMap = __commonJS((exports)
|
|
1901
|
+
var require_YAMLMap = __commonJS(function(exports) {
|
|
1902
1902
|
var stringifyCollection = require_stringifyCollection();
|
|
1903
1903
|
var addPairToJSMap = require_addPairToJSMap();
|
|
1904
1904
|
var Collection = require_Collection();
|
|
@@ -2025,7 +2025,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
2025
2025
|
});
|
|
2026
2026
|
|
|
2027
2027
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js
|
|
2028
|
-
var require_map = __commonJS((exports)
|
|
2028
|
+
var require_map = __commonJS(function(exports) {
|
|
2029
2029
|
var identity = require_identity();
|
|
2030
2030
|
var YAMLMap = require_YAMLMap();
|
|
2031
2031
|
var map = {
|
|
@@ -2033,10 +2033,10 @@ var require_map = __commonJS((exports) => {
|
|
|
2033
2033
|
default: true,
|
|
2034
2034
|
nodeClass: YAMLMap.YAMLMap,
|
|
2035
2035
|
tag: "tag:yaml.org,2002:map",
|
|
2036
|
-
resolve(
|
|
2037
|
-
if (!identity.isMap(
|
|
2036
|
+
resolve(map, onError) {
|
|
2037
|
+
if (!identity.isMap(map))
|
|
2038
2038
|
onError("Expected a mapping for this tag");
|
|
2039
|
-
return
|
|
2039
|
+
return map;
|
|
2040
2040
|
},
|
|
2041
2041
|
createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
|
|
2042
2042
|
};
|
|
@@ -2044,7 +2044,7 @@ var require_map = __commonJS((exports) => {
|
|
|
2044
2044
|
});
|
|
2045
2045
|
|
|
2046
2046
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2047
|
-
var require_YAMLSeq = __commonJS((exports)
|
|
2047
|
+
var require_YAMLSeq = __commonJS(function(exports) {
|
|
2048
2048
|
var createNode = require_createNode();
|
|
2049
2049
|
var stringifyCollection = require_stringifyCollection();
|
|
2050
2050
|
var Collection = require_Collection();
|
|
@@ -2137,7 +2137,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
2137
2137
|
});
|
|
2138
2138
|
|
|
2139
2139
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js
|
|
2140
|
-
var require_seq = __commonJS((exports)
|
|
2140
|
+
var require_seq = __commonJS(function(exports) {
|
|
2141
2141
|
var identity = require_identity();
|
|
2142
2142
|
var YAMLSeq = require_YAMLSeq();
|
|
2143
2143
|
var seq = {
|
|
@@ -2145,10 +2145,10 @@ var require_seq = __commonJS((exports) => {
|
|
|
2145
2145
|
default: true,
|
|
2146
2146
|
nodeClass: YAMLSeq.YAMLSeq,
|
|
2147
2147
|
tag: "tag:yaml.org,2002:seq",
|
|
2148
|
-
resolve(
|
|
2149
|
-
if (!identity.isSeq(
|
|
2148
|
+
resolve(seq, onError) {
|
|
2149
|
+
if (!identity.isSeq(seq))
|
|
2150
2150
|
onError("Expected a sequence for this tag");
|
|
2151
|
-
return
|
|
2151
|
+
return seq;
|
|
2152
2152
|
},
|
|
2153
2153
|
createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
|
|
2154
2154
|
};
|
|
@@ -2156,7 +2156,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
2156
2156
|
});
|
|
2157
2157
|
|
|
2158
2158
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js
|
|
2159
|
-
var require_string = __commonJS((exports)
|
|
2159
|
+
var require_string = __commonJS(function(exports) {
|
|
2160
2160
|
var stringifyString = require_stringifyString();
|
|
2161
2161
|
var string = {
|
|
2162
2162
|
identify: (value) => typeof value === "string",
|
|
@@ -2172,7 +2172,7 @@ var require_string = __commonJS((exports) => {
|
|
|
2172
2172
|
});
|
|
2173
2173
|
|
|
2174
2174
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js
|
|
2175
|
-
var require_null = __commonJS((exports)
|
|
2175
|
+
var require_null = __commonJS(function(exports) {
|
|
2176
2176
|
var Scalar = require_Scalar();
|
|
2177
2177
|
var nullTag = {
|
|
2178
2178
|
identify: (value) => value == null,
|
|
@@ -2187,7 +2187,7 @@ var require_null = __commonJS((exports) => {
|
|
|
2187
2187
|
});
|
|
2188
2188
|
|
|
2189
2189
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js
|
|
2190
|
-
var require_bool = __commonJS((exports)
|
|
2190
|
+
var require_bool = __commonJS(function(exports) {
|
|
2191
2191
|
var Scalar = require_Scalar();
|
|
2192
2192
|
var boolTag = {
|
|
2193
2193
|
identify: (value) => typeof value === "boolean",
|
|
@@ -2208,7 +2208,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
2208
2208
|
});
|
|
2209
2209
|
|
|
2210
2210
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2211
|
-
var require_stringifyNumber = __commonJS((exports)
|
|
2211
|
+
var require_stringifyNumber = __commonJS(function(exports) {
|
|
2212
2212
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2213
2213
|
if (typeof value === "bigint")
|
|
2214
2214
|
return String(value);
|
|
@@ -2232,7 +2232,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
2232
2232
|
});
|
|
2233
2233
|
|
|
2234
2234
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js
|
|
2235
|
-
var require_float = __commonJS((exports)
|
|
2235
|
+
var require_float = __commonJS(function(exports) {
|
|
2236
2236
|
var Scalar = require_Scalar();
|
|
2237
2237
|
var stringifyNumber = require_stringifyNumber();
|
|
2238
2238
|
var floatNaN = {
|
|
@@ -2275,7 +2275,7 @@ var require_float = __commonJS((exports) => {
|
|
|
2275
2275
|
});
|
|
2276
2276
|
|
|
2277
2277
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js
|
|
2278
|
-
var require_int = __commonJS((exports)
|
|
2278
|
+
var require_int = __commonJS(function(exports) {
|
|
2279
2279
|
var stringifyNumber = require_stringifyNumber();
|
|
2280
2280
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
2281
2281
|
var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
|
|
@@ -2317,7 +2317,7 @@ var require_int = __commonJS((exports) => {
|
|
|
2317
2317
|
});
|
|
2318
2318
|
|
|
2319
2319
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js
|
|
2320
|
-
var require_schema = __commonJS((exports)
|
|
2320
|
+
var require_schema = __commonJS(function(exports) {
|
|
2321
2321
|
var map = require_map();
|
|
2322
2322
|
var _null = require_null();
|
|
2323
2323
|
var seq = require_seq();
|
|
@@ -2342,7 +2342,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
|
|
2344
2344
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js
|
|
2345
|
-
var require_schema2 = __commonJS((exports)
|
|
2345
|
+
var require_schema2 = __commonJS(function(exports) {
|
|
2346
2346
|
var Scalar = require_Scalar();
|
|
2347
2347
|
var map = require_map();
|
|
2348
2348
|
var seq = require_seq();
|
|
@@ -2406,7 +2406,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
2406
2406
|
});
|
|
2407
2407
|
|
|
2408
2408
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2409
|
-
var require_binary = __commonJS((exports)
|
|
2409
|
+
var require_binary = __commonJS(function(exports) {
|
|
2410
2410
|
var node_buffer = __require("buffer");
|
|
2411
2411
|
var Scalar = require_Scalar();
|
|
2412
2412
|
var stringifyString = require_stringifyString();
|
|
@@ -2461,7 +2461,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
2461
2461
|
});
|
|
2462
2462
|
|
|
2463
2463
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2464
|
-
var require_pairs = __commonJS((exports)
|
|
2464
|
+
var require_pairs = __commonJS(function(exports) {
|
|
2465
2465
|
var identity = require_identity();
|
|
2466
2466
|
var Pair = require_Pair();
|
|
2467
2467
|
var Scalar = require_Scalar();
|
|
@@ -2494,8 +2494,8 @@ ${cn.comment}` : item.comment;
|
|
|
2494
2494
|
}
|
|
2495
2495
|
function createPairs(schema, iterable, ctx) {
|
|
2496
2496
|
const { replacer } = ctx;
|
|
2497
|
-
const
|
|
2498
|
-
|
|
2497
|
+
const pairs = new YAMLSeq.YAMLSeq(schema);
|
|
2498
|
+
pairs.tag = "tag:yaml.org,2002:pairs";
|
|
2499
2499
|
let i = 0;
|
|
2500
2500
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
2501
2501
|
for (let it of iterable) {
|
|
@@ -2519,9 +2519,9 @@ ${cn.comment}` : item.comment;
|
|
|
2519
2519
|
} else {
|
|
2520
2520
|
key = it;
|
|
2521
2521
|
}
|
|
2522
|
-
|
|
2522
|
+
pairs.items.push(Pair.createPair(key, value, ctx));
|
|
2523
2523
|
}
|
|
2524
|
-
return
|
|
2524
|
+
return pairs;
|
|
2525
2525
|
}
|
|
2526
2526
|
var pairs = {
|
|
2527
2527
|
collection: "seq",
|
|
@@ -2536,7 +2536,7 @@ ${cn.comment}` : item.comment;
|
|
|
2536
2536
|
});
|
|
2537
2537
|
|
|
2538
2538
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2539
|
-
var require_omap = __commonJS((exports)
|
|
2539
|
+
var require_omap = __commonJS(function(exports) {
|
|
2540
2540
|
var identity = require_identity();
|
|
2541
2541
|
var toJS = require_toJS();
|
|
2542
2542
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2575,9 +2575,9 @@ var require_omap = __commonJS((exports) => {
|
|
|
2575
2575
|
}
|
|
2576
2576
|
static from(schema, iterable, ctx) {
|
|
2577
2577
|
const pairs$1 = pairs.createPairs(schema, iterable, ctx);
|
|
2578
|
-
const
|
|
2579
|
-
|
|
2580
|
-
return
|
|
2578
|
+
const omap = new this;
|
|
2579
|
+
omap.items = pairs$1.items;
|
|
2580
|
+
return omap;
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
2583
|
YAMLOMap.tag = "tag:yaml.org,2002:omap";
|
|
@@ -2608,7 +2608,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
2608
2608
|
});
|
|
2609
2609
|
|
|
2610
2610
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2611
|
-
var require_bool2 = __commonJS((exports)
|
|
2611
|
+
var require_bool2 = __commonJS(function(exports) {
|
|
2612
2612
|
var Scalar = require_Scalar();
|
|
2613
2613
|
function boolStringify({ value, source }, ctx) {
|
|
2614
2614
|
const boolObj = value ? trueTag : falseTag;
|
|
@@ -2637,7 +2637,7 @@ var require_bool2 = __commonJS((exports) => {
|
|
|
2637
2637
|
});
|
|
2638
2638
|
|
|
2639
2639
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
2640
|
-
var require_float2 = __commonJS((exports)
|
|
2640
|
+
var require_float2 = __commonJS(function(exports) {
|
|
2641
2641
|
var Scalar = require_Scalar();
|
|
2642
2642
|
var stringifyNumber = require_stringifyNumber();
|
|
2643
2643
|
var floatNaN = {
|
|
@@ -2683,7 +2683,7 @@ var require_float2 = __commonJS((exports) => {
|
|
|
2683
2683
|
});
|
|
2684
2684
|
|
|
2685
2685
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
2686
|
-
var require_int2 = __commonJS((exports)
|
|
2686
|
+
var require_int2 = __commonJS(function(exports) {
|
|
2687
2687
|
var stringifyNumber = require_stringifyNumber();
|
|
2688
2688
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
2689
2689
|
function intResolve(str, offset, radix, { intAsBigInt }) {
|
|
@@ -2703,8 +2703,8 @@ var require_int2 = __commonJS((exports) => {
|
|
|
2703
2703
|
str = `0x${str}`;
|
|
2704
2704
|
break;
|
|
2705
2705
|
}
|
|
2706
|
-
const
|
|
2707
|
-
return sign === "-" ? BigInt(-1) *
|
|
2706
|
+
const n = BigInt(str);
|
|
2707
|
+
return sign === "-" ? BigInt(-1) * n : n;
|
|
2708
2708
|
}
|
|
2709
2709
|
const n = parseInt(str, radix);
|
|
2710
2710
|
return sign === "-" ? -1 * n : n;
|
|
@@ -2759,7 +2759,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
2759
2759
|
});
|
|
2760
2760
|
|
|
2761
2761
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
2762
|
-
var require_set = __commonJS((exports)
|
|
2762
|
+
var require_set = __commonJS(function(exports) {
|
|
2763
2763
|
var identity = require_identity();
|
|
2764
2764
|
var Pair = require_Pair();
|
|
2765
2765
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2808,14 +2808,14 @@ var require_set = __commonJS((exports) => {
|
|
|
2808
2808
|
}
|
|
2809
2809
|
static from(schema, iterable, ctx) {
|
|
2810
2810
|
const { replacer } = ctx;
|
|
2811
|
-
const
|
|
2811
|
+
const set = new this(schema);
|
|
2812
2812
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
2813
2813
|
for (let value of iterable) {
|
|
2814
2814
|
if (typeof replacer === "function")
|
|
2815
2815
|
value = replacer.call(iterable, value, value);
|
|
2816
|
-
|
|
2816
|
+
set.items.push(Pair.createPair(value, null, ctx));
|
|
2817
2817
|
}
|
|
2818
|
-
return
|
|
2818
|
+
return set;
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
2821
|
YAMLSet.tag = "tag:yaml.org,2002:set";
|
|
@@ -2842,13 +2842,13 @@ var require_set = __commonJS((exports) => {
|
|
|
2842
2842
|
});
|
|
2843
2843
|
|
|
2844
2844
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
2845
|
-
var require_timestamp = __commonJS((exports)
|
|
2845
|
+
var require_timestamp = __commonJS(function(exports) {
|
|
2846
2846
|
var stringifyNumber = require_stringifyNumber();
|
|
2847
2847
|
function parseSexagesimal(str, asBigInt) {
|
|
2848
2848
|
const sign = str[0];
|
|
2849
2849
|
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
2850
2850
|
const num = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
2851
|
-
const res = parts.replace(/_/g, "").split(":").reduce((
|
|
2851
|
+
const res = parts.replace(/_/g, "").split(":").reduce((res, p) => res * num(60) + num(p), num(0));
|
|
2852
2852
|
return sign === "-" ? num(-1) * res : res;
|
|
2853
2853
|
}
|
|
2854
2854
|
function stringifySexagesimal(node) {
|
|
@@ -2924,7 +2924,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
2924
2924
|
});
|
|
2925
2925
|
|
|
2926
2926
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
2927
|
-
var require_schema3 = __commonJS((exports)
|
|
2927
|
+
var require_schema3 = __commonJS(function(exports) {
|
|
2928
2928
|
var map = require_map();
|
|
2929
2929
|
var _null = require_null();
|
|
2930
2930
|
var seq = require_seq();
|
|
@@ -2965,7 +2965,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
2965
2965
|
});
|
|
2966
2966
|
|
|
2967
2967
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js
|
|
2968
|
-
var require_tags = __commonJS((exports)
|
|
2968
|
+
var require_tags = __commonJS(function(exports) {
|
|
2969
2969
|
var map = require_map();
|
|
2970
2970
|
var _null = require_null();
|
|
2971
2971
|
var seq = require_seq();
|
|
@@ -3039,16 +3039,16 @@ var require_tags = __commonJS((exports) => {
|
|
|
3039
3039
|
}
|
|
3040
3040
|
if (addMergeTag)
|
|
3041
3041
|
tags = tags.concat(merge.merge);
|
|
3042
|
-
return tags.reduce((
|
|
3042
|
+
return tags.reduce((tags, tag) => {
|
|
3043
3043
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
|
3044
3044
|
if (!tagObj) {
|
|
3045
3045
|
const tagName = JSON.stringify(tag);
|
|
3046
3046
|
const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
|
|
3047
3047
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
|
3048
3048
|
}
|
|
3049
|
-
if (!
|
|
3050
|
-
|
|
3051
|
-
return
|
|
3049
|
+
if (!tags.includes(tagObj))
|
|
3050
|
+
tags.push(tagObj);
|
|
3051
|
+
return tags;
|
|
3052
3052
|
}, []);
|
|
3053
3053
|
}
|
|
3054
3054
|
exports.coreKnownTags = coreKnownTags;
|
|
@@ -3056,7 +3056,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
3056
3056
|
});
|
|
3057
3057
|
|
|
3058
3058
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js
|
|
3059
|
-
var require_Schema = __commonJS((exports)
|
|
3059
|
+
var require_Schema = __commonJS(function(exports) {
|
|
3060
3060
|
var identity = require_identity();
|
|
3061
3061
|
var map = require_map();
|
|
3062
3062
|
var seq = require_seq();
|
|
@@ -3086,7 +3086,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
3086
3086
|
});
|
|
3087
3087
|
|
|
3088
3088
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3089
|
-
var require_stringifyDocument = __commonJS((exports)
|
|
3089
|
+
var require_stringifyDocument = __commonJS(function(exports) {
|
|
3090
3090
|
var identity = require_identity();
|
|
3091
3091
|
var stringify = require_stringify();
|
|
3092
3092
|
var stringifyComment = require_stringifyComment();
|
|
@@ -3166,7 +3166,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
3166
3166
|
});
|
|
3167
3167
|
|
|
3168
3168
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js
|
|
3169
|
-
var require_Document = __commonJS((exports)
|
|
3169
|
+
var require_Document = __commonJS(function(exports) {
|
|
3170
3170
|
var Alias = require_Alias();
|
|
3171
3171
|
var Collection = require_Collection();
|
|
3172
3172
|
var identity = require_identity();
|
|
@@ -3375,8 +3375,8 @@ var require_Document = __commonJS((exports) => {
|
|
|
3375
3375
|
};
|
|
3376
3376
|
const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
|
|
3377
3377
|
if (typeof onAnchor === "function")
|
|
3378
|
-
for (const { count, res
|
|
3379
|
-
onAnchor(
|
|
3378
|
+
for (const { count, res } of ctx.anchors.values())
|
|
3379
|
+
onAnchor(res, count);
|
|
3380
3380
|
return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
|
|
3381
3381
|
}
|
|
3382
3382
|
toJSON(jsonArg, onAnchor) {
|
|
@@ -3401,7 +3401,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
3401
3401
|
});
|
|
3402
3402
|
|
|
3403
3403
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/errors.js
|
|
3404
|
-
var require_errors = __commonJS((exports)
|
|
3404
|
+
var require_errors = __commonJS(function(exports) {
|
|
3405
3405
|
class YAMLError extends Error {
|
|
3406
3406
|
constructor(name, pos, code, message) {
|
|
3407
3407
|
super();
|
|
@@ -3466,7 +3466,7 @@ ${pointer}
|
|
|
3466
3466
|
});
|
|
3467
3467
|
|
|
3468
3468
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js
|
|
3469
|
-
var require_resolve_props = __commonJS((exports)
|
|
3469
|
+
var require_resolve_props = __commonJS(function(exports) {
|
|
3470
3470
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3471
3471
|
let spaceBefore = false;
|
|
3472
3472
|
let atNewline = startOnNewline;
|
|
@@ -3596,7 +3596,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3596
3596
|
});
|
|
3597
3597
|
|
|
3598
3598
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
3599
|
-
var require_util_contains_newline = __commonJS((exports)
|
|
3599
|
+
var require_util_contains_newline = __commonJS(function(exports) {
|
|
3600
3600
|
function containsNewline(key) {
|
|
3601
3601
|
if (!key)
|
|
3602
3602
|
return null;
|
|
@@ -3636,7 +3636,7 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
3636
3636
|
});
|
|
3637
3637
|
|
|
3638
3638
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
3639
|
-
var require_util_flow_indent_check = __commonJS((exports)
|
|
3639
|
+
var require_util_flow_indent_check = __commonJS(function(exports) {
|
|
3640
3640
|
var utilContainsNewline = require_util_contains_newline();
|
|
3641
3641
|
function flowIndentCheck(indent, fc, onError) {
|
|
3642
3642
|
if (fc?.type === "flow-collection") {
|
|
@@ -3651,7 +3651,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
3651
3651
|
});
|
|
3652
3652
|
|
|
3653
3653
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js
|
|
3654
|
-
var require_util_map_includes = __commonJS((exports)
|
|
3654
|
+
var require_util_map_includes = __commonJS(function(exports) {
|
|
3655
3655
|
var identity = require_identity();
|
|
3656
3656
|
function mapIncludes(ctx, items, search) {
|
|
3657
3657
|
const { uniqueKeys } = ctx.options;
|
|
@@ -3664,7 +3664,7 @@ var require_util_map_includes = __commonJS((exports) => {
|
|
|
3664
3664
|
});
|
|
3665
3665
|
|
|
3666
3666
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
3667
|
-
var require_resolve_block_map = __commonJS((exports)
|
|
3667
|
+
var require_resolve_block_map = __commonJS(function(exports) {
|
|
3668
3668
|
var Pair = require_Pair();
|
|
3669
3669
|
var YAMLMap = require_YAMLMap();
|
|
3670
3670
|
var resolveProps = require_resolve_props();
|
|
@@ -3771,7 +3771,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
3771
3771
|
});
|
|
3772
3772
|
|
|
3773
3773
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
3774
|
-
var require_resolve_block_seq = __commonJS((exports)
|
|
3774
|
+
var require_resolve_block_seq = __commonJS(function(exports) {
|
|
3775
3775
|
var YAMLSeq = require_YAMLSeq();
|
|
3776
3776
|
var resolveProps = require_resolve_props();
|
|
3777
3777
|
var utilFlowIndentCheck = require_util_flow_indent_check();
|
|
@@ -3819,7 +3819,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
3819
3819
|
});
|
|
3820
3820
|
|
|
3821
3821
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js
|
|
3822
|
-
var require_resolve_end = __commonJS((exports)
|
|
3822
|
+
var require_resolve_end = __commonJS(function(exports) {
|
|
3823
3823
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
3824
3824
|
let comment = "";
|
|
3825
3825
|
if (end) {
|
|
@@ -3859,7 +3859,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
3859
3859
|
});
|
|
3860
3860
|
|
|
3861
3861
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
3862
|
-
var require_resolve_flow_collection = __commonJS((exports)
|
|
3862
|
+
var require_resolve_flow_collection = __commonJS(function(exports) {
|
|
3863
3863
|
var identity = require_identity();
|
|
3864
3864
|
var Pair = require_Pair();
|
|
3865
3865
|
var YAMLMap = require_YAMLMap();
|
|
@@ -4050,7 +4050,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
4050
4050
|
});
|
|
4051
4051
|
|
|
4052
4052
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js
|
|
4053
|
-
var require_compose_collection = __commonJS((exports)
|
|
4053
|
+
var require_compose_collection = __commonJS(function(exports) {
|
|
4054
4054
|
var identity = require_identity();
|
|
4055
4055
|
var Scalar = require_Scalar();
|
|
4056
4056
|
var YAMLMap = require_YAMLMap();
|
|
@@ -4112,7 +4112,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
4112
4112
|
});
|
|
4113
4113
|
|
|
4114
4114
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4115
|
-
var require_resolve_block_scalar = __commonJS((exports)
|
|
4115
|
+
var require_resolve_block_scalar = __commonJS(function(exports) {
|
|
4116
4116
|
var Scalar = require_Scalar();
|
|
4117
4117
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
4118
4118
|
const start = scalar.offset;
|
|
@@ -4130,12 +4130,12 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4130
4130
|
break;
|
|
4131
4131
|
}
|
|
4132
4132
|
if (chompStart === 0) {
|
|
4133
|
-
const
|
|
4133
|
+
const value = header.chomp === "+" && lines.length > 0 ? `
|
|
4134
4134
|
`.repeat(Math.max(1, lines.length - 1)) : "";
|
|
4135
|
-
let
|
|
4135
|
+
let end = start + header.length;
|
|
4136
4136
|
if (scalar.source)
|
|
4137
|
-
|
|
4138
|
-
return { value
|
|
4137
|
+
end += scalar.source.length;
|
|
4138
|
+
return { value, type, comment: header.comment, range: [start, end, end] };
|
|
4139
4139
|
}
|
|
4140
4140
|
let trimIndent = scalar.indent + header.indent;
|
|
4141
4141
|
let offset = scalar.offset + header.length;
|
|
@@ -4305,7 +4305,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4305
4305
|
});
|
|
4306
4306
|
|
|
4307
4307
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4308
|
-
var require_resolve_flow_scalar = __commonJS((exports)
|
|
4308
|
+
var require_resolve_flow_scalar = __commonJS(function(exports) {
|
|
4309
4309
|
var Scalar = require_Scalar();
|
|
4310
4310
|
var resolveEnd = require_resolve_end();
|
|
4311
4311
|
function resolveFlowScalar(scalar, strict, onError) {
|
|
@@ -4522,7 +4522,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4522
4522
|
});
|
|
4523
4523
|
|
|
4524
4524
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js
|
|
4525
|
-
var require_compose_scalar = __commonJS((exports)
|
|
4525
|
+
var require_compose_scalar = __commonJS(function(exports) {
|
|
4526
4526
|
var identity = require_identity();
|
|
4527
4527
|
var Scalar = require_Scalar();
|
|
4528
4528
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
@@ -4584,9 +4584,9 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
4584
4584
|
return schema[identity.SCALAR];
|
|
4585
4585
|
}
|
|
4586
4586
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
4587
|
-
const tag = schema.tags.find((
|
|
4587
|
+
const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR];
|
|
4588
4588
|
if (schema.compat) {
|
|
4589
|
-
const compat = schema.compat.find((
|
|
4589
|
+
const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR];
|
|
4590
4590
|
if (tag.tag !== compat.tag) {
|
|
4591
4591
|
const ts = directives.tagString(tag.tag);
|
|
4592
4592
|
const cs = directives.tagString(compat.tag);
|
|
@@ -4600,7 +4600,7 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
4600
4600
|
});
|
|
4601
4601
|
|
|
4602
4602
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
4603
|
-
var require_util_empty_scalar_position = __commonJS((exports)
|
|
4603
|
+
var require_util_empty_scalar_position = __commonJS(function(exports) {
|
|
4604
4604
|
function emptyScalarPosition(offset, before, pos) {
|
|
4605
4605
|
if (before) {
|
|
4606
4606
|
pos ?? (pos = before.length);
|
|
@@ -4627,7 +4627,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
4627
4627
|
});
|
|
4628
4628
|
|
|
4629
4629
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js
|
|
4630
|
-
var require_compose_node = __commonJS((exports)
|
|
4630
|
+
var require_compose_node = __commonJS(function(exports) {
|
|
4631
4631
|
var Alias = require_Alias();
|
|
4632
4632
|
var identity = require_identity();
|
|
4633
4633
|
var composeCollection = require_compose_collection();
|
|
@@ -4730,7 +4730,7 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
4730
4730
|
});
|
|
4731
4731
|
|
|
4732
4732
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js
|
|
4733
|
-
var require_compose_doc = __commonJS((exports)
|
|
4733
|
+
var require_compose_doc = __commonJS(function(exports) {
|
|
4734
4734
|
var Document = require_Document();
|
|
4735
4735
|
var composeNode = require_compose_node();
|
|
4736
4736
|
var resolveEnd = require_resolve_end();
|
|
@@ -4770,7 +4770,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
4770
4770
|
});
|
|
4771
4771
|
|
|
4772
4772
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js
|
|
4773
|
-
var require_composer = __commonJS((exports)
|
|
4773
|
+
var require_composer = __commonJS(function(exports) {
|
|
4774
4774
|
var node_process = __require("process");
|
|
4775
4775
|
var directives = require_directives();
|
|
4776
4776
|
var Document = require_Document();
|
|
@@ -4961,7 +4961,7 @@ ${end.comment}` : end.comment;
|
|
|
4961
4961
|
});
|
|
4962
4962
|
|
|
4963
4963
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js
|
|
4964
|
-
var require_cst_scalar = __commonJS((exports)
|
|
4964
|
+
var require_cst_scalar = __commonJS(function(exports) {
|
|
4965
4965
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
4966
4966
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
4967
4967
|
var errors = require_errors();
|
|
@@ -5151,7 +5151,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5151
5151
|
});
|
|
5152
5152
|
|
|
5153
5153
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js
|
|
5154
|
-
var require_cst_stringify = __commonJS((exports)
|
|
5154
|
+
var require_cst_stringify = __commonJS(function(exports) {
|
|
5155
5155
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
5156
5156
|
function stringifyToken(token) {
|
|
5157
5157
|
switch (token.type) {
|
|
@@ -5209,7 +5209,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
5209
5209
|
});
|
|
5210
5210
|
|
|
5211
5211
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js
|
|
5212
|
-
var require_cst_visit = __commonJS((exports)
|
|
5212
|
+
var require_cst_visit = __commonJS(function(exports) {
|
|
5213
5213
|
var BREAK = Symbol("break visit");
|
|
5214
5214
|
var SKIP = Symbol("skip children");
|
|
5215
5215
|
var REMOVE = Symbol("remove item");
|
|
@@ -5268,7 +5268,7 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
5268
5268
|
});
|
|
5269
5269
|
|
|
5270
5270
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js
|
|
5271
|
-
var require_cst = __commonJS((exports)
|
|
5271
|
+
var require_cst = __commonJS(function(exports) {
|
|
5272
5272
|
var cstScalar = require_cst_scalar();
|
|
5273
5273
|
var cstStringify = require_cst_stringify();
|
|
5274
5274
|
var cstVisit = require_cst_visit();
|
|
@@ -5369,7 +5369,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
5369
5369
|
});
|
|
5370
5370
|
|
|
5371
5371
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js
|
|
5372
|
-
var require_lexer = __commonJS((exports)
|
|
5372
|
+
var require_lexer = __commonJS(function(exports) {
|
|
5373
5373
|
var cst = require_cst();
|
|
5374
5374
|
function isEmpty(ch) {
|
|
5375
5375
|
switch (ch) {
|
|
@@ -5742,18 +5742,18 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5742
5742
|
let indent = 0;
|
|
5743
5743
|
let ch;
|
|
5744
5744
|
loop:
|
|
5745
|
-
for (let
|
|
5745
|
+
for (let i = this.pos;ch = this.buffer[i]; ++i) {
|
|
5746
5746
|
switch (ch) {
|
|
5747
5747
|
case " ":
|
|
5748
5748
|
indent += 1;
|
|
5749
5749
|
break;
|
|
5750
5750
|
case `
|
|
5751
5751
|
`:
|
|
5752
|
-
nl =
|
|
5752
|
+
nl = i;
|
|
5753
5753
|
indent = 0;
|
|
5754
5754
|
break;
|
|
5755
5755
|
case "\r": {
|
|
5756
|
-
const next = this.buffer[
|
|
5756
|
+
const next = this.buffer[i + 1];
|
|
5757
5757
|
if (!next && !this.atEnd)
|
|
5758
5758
|
return this.setNext("block-scalar");
|
|
5759
5759
|
if (next === `
|
|
@@ -5796,16 +5796,16 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5796
5796
|
nl = i - 1;
|
|
5797
5797
|
} else if (!this.blockScalarKeep) {
|
|
5798
5798
|
do {
|
|
5799
|
-
let
|
|
5800
|
-
let
|
|
5801
|
-
if (
|
|
5802
|
-
|
|
5803
|
-
const lastChar =
|
|
5804
|
-
while (
|
|
5805
|
-
|
|
5806
|
-
if (
|
|
5807
|
-
` &&
|
|
5808
|
-
nl =
|
|
5799
|
+
let i = nl - 1;
|
|
5800
|
+
let ch = this.buffer[i];
|
|
5801
|
+
if (ch === "\r")
|
|
5802
|
+
ch = this.buffer[--i];
|
|
5803
|
+
const lastChar = i;
|
|
5804
|
+
while (ch === " ")
|
|
5805
|
+
ch = this.buffer[--i];
|
|
5806
|
+
if (ch === `
|
|
5807
|
+
` && i >= this.pos && i + 1 + indent > lastChar)
|
|
5808
|
+
nl = i;
|
|
5809
5809
|
else
|
|
5810
5810
|
break;
|
|
5811
5811
|
} while (true);
|
|
@@ -5966,7 +5966,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5966
5966
|
});
|
|
5967
5967
|
|
|
5968
5968
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js
|
|
5969
|
-
var require_line_counter = __commonJS((exports)
|
|
5969
|
+
var require_line_counter = __commonJS(function(exports) {
|
|
5970
5970
|
class LineCounter {
|
|
5971
5971
|
constructor() {
|
|
5972
5972
|
this.lineStarts = [];
|
|
@@ -5994,7 +5994,7 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
5994
5994
|
});
|
|
5995
5995
|
|
|
5996
5996
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js
|
|
5997
|
-
var require_parser = __commonJS((exports)
|
|
5997
|
+
var require_parser = __commonJS(function(exports) {
|
|
5998
5998
|
var node_process = __require("process");
|
|
5999
5999
|
var cst = require_cst();
|
|
6000
6000
|
var lexer = require_lexer();
|
|
@@ -6492,12 +6492,12 @@ var require_parser = __commonJS((exports) => {
|
|
|
6492
6492
|
if (includesToken(it.start, "newline")) {
|
|
6493
6493
|
Object.assign(it, { key: null, sep: [this.sourceToken] });
|
|
6494
6494
|
} else {
|
|
6495
|
-
const
|
|
6495
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6496
6496
|
this.stack.push({
|
|
6497
6497
|
type: "block-map",
|
|
6498
6498
|
offset: this.offset,
|
|
6499
6499
|
indent: this.indent,
|
|
6500
|
-
items: [{ start
|
|
6500
|
+
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6501
6501
|
});
|
|
6502
6502
|
}
|
|
6503
6503
|
} else if (it.value) {
|
|
@@ -6510,7 +6510,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6510
6510
|
items: [{ start, key: null, sep: [this.sourceToken] }]
|
|
6511
6511
|
});
|
|
6512
6512
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
6513
|
-
const
|
|
6513
|
+
const start = getFirstKeyStartProps(it.start);
|
|
6514
6514
|
const key = it.key;
|
|
6515
6515
|
const sep = it.sep;
|
|
6516
6516
|
sep.push(this.sourceToken);
|
|
@@ -6520,7 +6520,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6520
6520
|
type: "block-map",
|
|
6521
6521
|
offset: this.offset,
|
|
6522
6522
|
indent: this.indent,
|
|
6523
|
-
items: [{ start
|
|
6523
|
+
items: [{ start, key, sep }]
|
|
6524
6524
|
});
|
|
6525
6525
|
} else if (start.length > 0) {
|
|
6526
6526
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -6850,7 +6850,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6850
6850
|
});
|
|
6851
6851
|
|
|
6852
6852
|
// ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/public-api.js
|
|
6853
|
-
var require_public_api = __commonJS((exports)
|
|
6853
|
+
var require_public_api = __commonJS(function(exports) {
|
|
6854
6854
|
var composer = require_composer();
|
|
6855
6855
|
var Document = require_Document();
|
|
6856
6856
|
var errors = require_errors();
|
|
@@ -6864,22 +6864,22 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6864
6864
|
return { lineCounter: lineCounter$1, prettyErrors };
|
|
6865
6865
|
}
|
|
6866
6866
|
function parseAllDocuments(source, options = {}) {
|
|
6867
|
-
const { lineCounter
|
|
6868
|
-
const parser$1 = new parser.Parser(
|
|
6867
|
+
const { lineCounter, prettyErrors } = parseOptions(options);
|
|
6868
|
+
const parser$1 = new parser.Parser(lineCounter?.addNewLine);
|
|
6869
6869
|
const composer$1 = new composer.Composer(options);
|
|
6870
6870
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
6871
|
-
if (prettyErrors &&
|
|
6871
|
+
if (prettyErrors && lineCounter)
|
|
6872
6872
|
for (const doc of docs) {
|
|
6873
|
-
doc.errors.forEach(errors.prettifyError(source,
|
|
6874
|
-
doc.warnings.forEach(errors.prettifyError(source,
|
|
6873
|
+
doc.errors.forEach(errors.prettifyError(source, lineCounter));
|
|
6874
|
+
doc.warnings.forEach(errors.prettifyError(source, lineCounter));
|
|
6875
6875
|
}
|
|
6876
6876
|
if (docs.length > 0)
|
|
6877
6877
|
return docs;
|
|
6878
6878
|
return Object.assign([], { empty: true }, composer$1.streamInfo());
|
|
6879
6879
|
}
|
|
6880
6880
|
function parseDocument(source, options = {}) {
|
|
6881
|
-
const { lineCounter
|
|
6882
|
-
const parser$1 = new parser.Parser(
|
|
6881
|
+
const { lineCounter, prettyErrors } = parseOptions(options);
|
|
6882
|
+
const parser$1 = new parser.Parser(lineCounter?.addNewLine);
|
|
6883
6883
|
const composer$1 = new composer.Composer(options);
|
|
6884
6884
|
let doc = null;
|
|
6885
6885
|
for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
|
|
@@ -6890,9 +6890,9 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6890
6890
|
break;
|
|
6891
6891
|
}
|
|
6892
6892
|
}
|
|
6893
|
-
if (prettyErrors &&
|
|
6894
|
-
doc.errors.forEach(errors.prettifyError(source,
|
|
6895
|
-
doc.warnings.forEach(errors.prettifyError(source,
|
|
6893
|
+
if (prettyErrors && lineCounter) {
|
|
6894
|
+
doc.errors.forEach(errors.prettifyError(source, lineCounter));
|
|
6895
|
+
doc.warnings.forEach(errors.prettifyError(source, lineCounter));
|
|
6896
6896
|
}
|
|
6897
6897
|
return doc;
|
|
6898
6898
|
}
|
|
@@ -6943,49 +6943,11 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6943
6943
|
exports.stringify = stringify;
|
|
6944
6944
|
});
|
|
6945
6945
|
|
|
6946
|
-
// src/notifications.ts
|
|
6947
|
-
import { Rpc } from "@opencode-ai/plugin/rpc";
|
|
6948
|
-
var OperatorNotifications = Rpc.define({
|
|
6949
|
-
id: "aerovato.operator-memory",
|
|
6950
|
-
methods: {
|
|
6951
|
-
status: {
|
|
6952
|
-
input: {
|
|
6953
|
-
type: "object",
|
|
6954
|
-
properties: { refresh: { type: "boolean" } },
|
|
6955
|
-
required: ["refresh"]
|
|
6956
|
-
},
|
|
6957
|
-
output: {
|
|
6958
|
-
type: "object",
|
|
6959
|
-
properties: {
|
|
6960
|
-
detail: { type: "string" },
|
|
6961
|
-
user: { enum: ["loaded", "uninitialized", "error"] },
|
|
6962
|
-
private: { enum: ["loaded", "uninitialized", "error"] },
|
|
6963
|
-
shared: { enum: ["loaded", "uninitialized", "error"] }
|
|
6964
|
-
},
|
|
6965
|
-
required: ["detail", "user", "private", "shared"]
|
|
6966
|
-
}
|
|
6967
|
-
}
|
|
6968
|
-
},
|
|
6969
|
-
events: {
|
|
6970
|
-
toast: {
|
|
6971
|
-
schema: {
|
|
6972
|
-
type: "object",
|
|
6973
|
-
properties: {
|
|
6974
|
-
title: { type: "string" },
|
|
6975
|
-
message: { type: "string" },
|
|
6976
|
-
variant: { enum: ["info", "success", "warning", "error"] }
|
|
6977
|
-
},
|
|
6978
|
-
required: ["title", "message", "variant"]
|
|
6979
|
-
}
|
|
6980
|
-
}
|
|
6981
|
-
}
|
|
6982
|
-
});
|
|
6983
|
-
|
|
6984
6946
|
// src/index.ts
|
|
6985
|
-
import { spawn as
|
|
6947
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
6986
6948
|
import { homedir } from "node:os";
|
|
6987
|
-
import { dirname
|
|
6988
|
-
import { fileURLToPath
|
|
6949
|
+
import { dirname } from "node:path";
|
|
6950
|
+
import { fileURLToPath } from "node:url";
|
|
6989
6951
|
|
|
6990
6952
|
// ../core/src/memory/load.ts
|
|
6991
6953
|
import { resolve } from "node:path";
|
|
@@ -7240,25 +7202,38 @@ function compareStrings(left, right) {
|
|
|
7240
7202
|
import { join as join2 } from "node:path";
|
|
7241
7203
|
async function loadUserPartition(root, loadFiles) {
|
|
7242
7204
|
if (!loadFiles) {
|
|
7243
|
-
const
|
|
7244
|
-
if (!
|
|
7245
|
-
return hasNodeErrorCode(
|
|
7205
|
+
const directory = await readDirectory(root);
|
|
7206
|
+
if (!directory.ok) {
|
|
7207
|
+
return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false }) : directory;
|
|
7208
|
+
}
|
|
7209
|
+
for (const path of [join2(root, "operator.md"), join2(root, "catalog.md")]) {
|
|
7210
|
+
const file = await checkOptionalReadableFile(path);
|
|
7211
|
+
if (!file.ok) {
|
|
7212
|
+
return file;
|
|
7213
|
+
}
|
|
7246
7214
|
}
|
|
7247
|
-
|
|
7248
|
-
return operatorInstructions2.ok ? success({ exists: true }) : operatorInstructions2;
|
|
7215
|
+
return success({ exists: true });
|
|
7249
7216
|
}
|
|
7250
7217
|
const operatorInstructions = await readOptionalContent(join2(root, "operator.md"));
|
|
7251
7218
|
if (!operatorInstructions.ok) {
|
|
7252
7219
|
return operatorInstructions;
|
|
7253
7220
|
}
|
|
7254
|
-
|
|
7255
|
-
|
|
7221
|
+
const catalog = await readOptionalContent(join2(root, "catalog.md"));
|
|
7222
|
+
if (!catalog.ok) {
|
|
7223
|
+
return catalog;
|
|
7224
|
+
}
|
|
7225
|
+
if (operatorInstructions.value !== null || catalog.value !== null) {
|
|
7226
|
+
return success({
|
|
7227
|
+
exists: true,
|
|
7228
|
+
operatorInstructions: operatorInstructions.value,
|
|
7229
|
+
catalog: catalog.value
|
|
7230
|
+
});
|
|
7256
7231
|
}
|
|
7257
7232
|
const directory = await readDirectory(root);
|
|
7258
7233
|
if (!directory.ok) {
|
|
7259
|
-
return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false, operatorInstructions: null }) : directory;
|
|
7234
|
+
return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false, operatorInstructions: null, catalog: null }) : directory;
|
|
7260
7235
|
}
|
|
7261
|
-
return success({ exists: true, operatorInstructions: null });
|
|
7236
|
+
return success({ exists: true, operatorInstructions: null, catalog: null });
|
|
7262
7237
|
}
|
|
7263
7238
|
|
|
7264
7239
|
// ../core/src/memory/load.ts
|
|
@@ -7267,12 +7242,12 @@ async function loadMemorySnapshot(projectDirectory, homeDirectory, loadFiles) {
|
|
|
7267
7242
|
const userRoot = resolve(homeDirectory, ".operator", "user");
|
|
7268
7243
|
const privateRoot = resolve(projectDirectory, PROJECT_PRIVATE_ROOT);
|
|
7269
7244
|
if (!loadFiles) {
|
|
7270
|
-
const [
|
|
7245
|
+
const [shared, user, privatePartition] = await Promise.all([
|
|
7271
7246
|
loadProjectPartition(sharedRoot, false),
|
|
7272
7247
|
loadUserPartition(userRoot, false),
|
|
7273
7248
|
loadProjectPartition(privateRoot, false)
|
|
7274
7249
|
]);
|
|
7275
|
-
return { shared
|
|
7250
|
+
return { shared, user, private: privatePartition };
|
|
7276
7251
|
}
|
|
7277
7252
|
const [shared, user, privatePartition] = await Promise.all([
|
|
7278
7253
|
loadProjectPartition(sharedRoot, true),
|
|
@@ -7283,11 +7258,11 @@ async function loadMemorySnapshot(projectDirectory, homeDirectory, loadFiles) {
|
|
|
7283
7258
|
}
|
|
7284
7259
|
|
|
7285
7260
|
// src/index.ts
|
|
7286
|
-
import { Plugin } from "@opencode
|
|
7261
|
+
import { Plugin } from "@opencode/plugin";
|
|
7287
7262
|
// package.json
|
|
7288
7263
|
var package_default = {
|
|
7289
7264
|
name: "@aerovato/operator-opencode-v2",
|
|
7290
|
-
version: "
|
|
7265
|
+
version: "2.0.0",
|
|
7291
7266
|
description: "Operator Memory adapter for OpenCode V2.",
|
|
7292
7267
|
license: "BSD-3-Clause",
|
|
7293
7268
|
author: "Aerovato Research",
|
|
@@ -7328,9 +7303,9 @@ var package_default = {
|
|
|
7328
7303
|
prepack: "bun run build"
|
|
7329
7304
|
},
|
|
7330
7305
|
peerDependencies: {
|
|
7331
|
-
"@opencode
|
|
7332
|
-
"@opentui/core": ">=0.5.
|
|
7333
|
-
"@opentui/solid": ">=0.5.
|
|
7306
|
+
"@opencode/plugin": "^2.0.14",
|
|
7307
|
+
"@opentui/core": ">=0.5.10",
|
|
7308
|
+
"@opentui/solid": ">=0.5.10",
|
|
7334
7309
|
"solid-js": ">=1.9.0"
|
|
7335
7310
|
},
|
|
7336
7311
|
peerDependenciesMeta: {
|
|
@@ -7346,9 +7321,9 @@ var package_default = {
|
|
|
7346
7321
|
},
|
|
7347
7322
|
devDependencies: {
|
|
7348
7323
|
"@aerovato/operator-core": "workspace:*",
|
|
7349
|
-
"@opencode
|
|
7350
|
-
"@opentui/core": "0.5.
|
|
7351
|
-
"@opentui/solid": "0.5.
|
|
7324
|
+
"@opencode/plugin": "2.0.14",
|
|
7325
|
+
"@opentui/core": "0.5.10",
|
|
7326
|
+
"@opentui/solid": "0.5.10",
|
|
7352
7327
|
"solid-js": "1.9.12"
|
|
7353
7328
|
}
|
|
7354
7329
|
};
|
|
@@ -7440,7 +7415,7 @@ async function commandOutput(name, cwd) {
|
|
|
7440
7415
|
`);
|
|
7441
7416
|
}
|
|
7442
7417
|
function runHelper(arguments_, cwd) {
|
|
7443
|
-
return new Promise((
|
|
7418
|
+
return new Promise((resolve) => {
|
|
7444
7419
|
const child = spawn(`operator-helper ${arguments_.join(" ")} 2>&1`, {
|
|
7445
7420
|
cwd,
|
|
7446
7421
|
shell: true,
|
|
@@ -7448,8 +7423,8 @@ function runHelper(arguments_, cwd) {
|
|
|
7448
7423
|
});
|
|
7449
7424
|
const output = [];
|
|
7450
7425
|
child.stdout.on("data", (chunk) => output.push(Buffer.from(chunk)));
|
|
7451
|
-
child.on("error", (error) =>
|
|
7452
|
-
child.on("close", (code) =>
|
|
7426
|
+
child.on("error", (error) => resolve({ exitCode: 1, output: error.message }));
|
|
7427
|
+
child.on("close", (code) => resolve({ exitCode: code ?? 1, output: Buffer.concat(output).toString().trim() }));
|
|
7453
7428
|
});
|
|
7454
7429
|
}
|
|
7455
7430
|
function wrapCommand(arguments_, output) {
|
|
@@ -7464,8 +7439,8 @@ function wrapCommand(arguments_, output) {
|
|
|
7464
7439
|
`);
|
|
7465
7440
|
}
|
|
7466
7441
|
|
|
7467
|
-
// ../core/src/templates/
|
|
7468
|
-
var
|
|
7442
|
+
// ../core/src/templates/catalog.ts
|
|
7443
|
+
var CATALOG_TEMPLATE = `# {User|Private|Shared} Partition Catalog
|
|
7469
7444
|
|
|
7470
7445
|
## Tree
|
|
7471
7446
|
|
|
@@ -7475,8 +7450,14 @@ var PROJECT_CATALOG_TEMPLATE = `# {Private|Shared} Partition Catalog
|
|
|
7475
7450
|
- \`catalog.md\`
|
|
7476
7451
|
- Description: This catalog.
|
|
7477
7452
|
- Read If: Auto-injected.
|
|
7453
|
+
- \`powerpoint-builder/SKILL.md\` (artifact-backed freeform example)
|
|
7454
|
+
- Description: PowerPoint generation skill; supporting templates and images live in \`powerpoint-builder/\`.
|
|
7455
|
+
- Read If: Creating or reviewing presentations.
|
|
7456
|
+
- \`writing-style.md\` (User Partition freeform example)
|
|
7457
|
+
- Description: Cross-project writing style rules so replies do not sound like AI.
|
|
7458
|
+
- Read If: Writing any user-facing reply or document.
|
|
7478
7459
|
|
|
7479
|
-
### \`specs/\` - System contracts for this partition
|
|
7460
|
+
### \`specs/\` - System contracts for this partition (Project partition freeform example)
|
|
7480
7461
|
|
|
7481
7462
|
- \`example.md\`
|
|
7482
7463
|
- Description: …
|
|
@@ -7554,11 +7535,7 @@ var PREAMBLE_PROMPT = `<operator-guidance>
|
|
|
7554
7535
|
|
|
7555
7536
|
# Operator
|
|
7556
7537
|
|
|
7557
|
-
You are an agent working under **Operator by Aerovato Research**. Operator Memory is a durable documentation framework for agent-driven development. Operator provides you with a human-readable **brain** on disk that you own and maintain so project knowledge outlives this session.
|
|
7558
|
-
|
|
7559
|
-
## This Message
|
|
7560
|
-
|
|
7561
|
-
This fixed preamble injects this guidance, \`operator.md\` instructions, Project Index listings (\`description\` / \`read_if\`) plus each main \`index/index.md\` body, catalog bodies, core tenets after those injections, and any setup or maintenance warnings.
|
|
7538
|
+
You are an agent working under **Operator by Aerovato Research**. Operator Memory is a durable documentation framework for agent-driven development. Operator provides you with a human-readable **brain** on disk that you own and maintain so project knowledge outlives this session. This preamble is fixed; everything it injects is already below.
|
|
7562
7539
|
|
|
7563
7540
|
## The Brain
|
|
7564
7541
|
|
|
@@ -7566,41 +7543,40 @@ Your conversation is ephemeral; Operator provides a durable brain on disk. **You
|
|
|
7566
7543
|
|
|
7567
7544
|
\`\`\`
|
|
7568
7545
|
Operator Memory
|
|
7569
|
-
├──
|
|
7570
|
-
├──
|
|
7571
|
-
|
|
7546
|
+
├── User Partition (~/.operator/user/) private; global; applies to all projects
|
|
7547
|
+
│ ├── operator.md User Instructions
|
|
7548
|
+
│ ├── catalog.md User Catalog
|
|
7549
|
+
│ └── … Freeform user memory
|
|
7550
|
+
├── Project Private (.operator/) private; local; default for new project work
|
|
7551
|
+
│ ├── index/ Project Index (codebase map)
|
|
7552
|
+
│ ├── operator.md Operator Instructions
|
|
7553
|
+
│ ├── catalog.md Project Partition Catalog (brain map)
|
|
7554
|
+
│ └── … Freeform project brain
|
|
7555
|
+
└── Project Shared (.operator-shared/) optional; published with the repo; team-wide knowledge
|
|
7556
|
+
└── (same layout as Project Private)
|
|
7572
7557
|
\`\`\`
|
|
7573
7558
|
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
\`\`\`
|
|
7577
|
-
├── index/ Project Index (codebase map)
|
|
7578
|
-
├── operator.md Operator Instructions
|
|
7579
|
-
├── catalog.md Partition Catalog (brain map)
|
|
7580
|
-
└── … Freeform brain
|
|
7581
|
-
\`\`\`
|
|
7582
|
-
|
|
7583
|
-
### Memory Partitions
|
|
7584
|
-
|
|
7585
|
-
The Project Brain is the Project Partition, split into Private and Shared so local work and published knowledge stay distinct. The User Partition is separate and cross-project.
|
|
7586
|
-
|
|
7587
|
-
- **Private** (\`.operator/\`): local to this checkout, not committed. Project-specific instructions and knowledge that should stay local — private plans, research, work in progress, and indexes.
|
|
7588
|
-
- **Shared** (\`.operator-shared/\`): tracked and published with the repo. Team-wide and repository-wide instructions and knowledge. Optional — need not exist; everything can stay private.
|
|
7589
|
-
- **User** (\`~/.operator/user/\`): private to the user, applies across projects. Global operating doctrine (communication, workflow, autonomy, engineering, verification) at \`operator.md\`.
|
|
7559
|
+
The User Partition is cross-project. The Project Brain consists of both Project Partitions, split into Private and Shared so local work and published knowledge stay distinct.
|
|
7590
7560
|
|
|
7591
7561
|
---
|
|
7592
7562
|
|
|
7593
|
-
**
|
|
7563
|
+
**Operator changes the agentic loop itself.** The traditional workflow is: user prompts, agent builds. The **Memory Aware Agentic Workflow** is: user prompts, agent consults the brain, agent builds, agent updates the brain. **You must perform the memory-aware agentic workflow.** Consult before you build; update after you build.
|
|
7594
7564
|
|
|
7595
7565
|
## Consult the Brain
|
|
7596
7566
|
|
|
7597
|
-
Before you search the codebase or open files, use what this message already loaded. Instructions,
|
|
7567
|
+
Before you search the codebase or open files, use what this message already loaded. Instructions, catalogs, and main indexes are already below. Do not reopen those files unless repairing a load failure.
|
|
7598
7568
|
|
|
7599
|
-
### Instructions
|
|
7569
|
+
### Operator Instructions
|
|
7600
7570
|
|
|
7601
|
-
- \`operator.md\` is a more sophisticated \`AGENTS.md\`: standing agent rules, split across
|
|
7571
|
+
- \`operator.md\` is a more sophisticated \`AGENTS.md\`: standing agent rules, split across User / Shared / Private instead of one root file.
|
|
7602
7572
|
- Follow Operator Instructions when present. On conflict, later wins: **Project Private > User > Project Shared**.
|
|
7603
|
-
|
|
7573
|
+
|
|
7574
|
+
### Partition Catalogs
|
|
7575
|
+
|
|
7576
|
+
Agent-maintained map of a partition's brain root — the User Partition and each Project partition.
|
|
7577
|
+
|
|
7578
|
+
- Use the catalog as an intelligent listing of your brain contents.
|
|
7579
|
+
- File bodies are not auto-attached. **Read cataloged files when their Read If matches the task.**
|
|
7604
7580
|
|
|
7605
7581
|
### Project Index
|
|
7606
7582
|
|
|
@@ -7608,14 +7584,15 @@ Living map of **codebase** structure and intent. Answers what code exists, what
|
|
|
7608
7584
|
|
|
7609
7585
|
**Important: Use the index and subindexes to supplement your exploration. Combine normal search tools with index primers before deep code reads.**
|
|
7610
7586
|
|
|
7611
|
-
###
|
|
7587
|
+
### Freeform Files
|
|
7612
7588
|
|
|
7613
|
-
|
|
7589
|
+
The knowledge itself. Indexes and catalogs only point at it; \`operator.md\` only governs behavior. Everything the brain actually knows lives in freeform files, found through their catalog entries.
|
|
7614
7590
|
|
|
7615
|
-
-
|
|
7616
|
-
-
|
|
7591
|
+
- Project freeform — project memory, specs (system truth and contracts the code cannot show), research and guides (library, SDK, API), product vision, plans, etc.
|
|
7592
|
+
- User freeform — replaces skills, and goes further: everything a skill pack would hold (reusable instruction sets, style guides, playbooks), plus what skills never carried — cross-project research and guides, personal standards, long-term memory. Freeform is not limited to Markdown: artifact-backed skills (folder containing entry document plus code, images, or other artifacts) is valid freeform.
|
|
7593
|
+
- **Read a matching freeform file before implementing or exploring the code — specs are system truth the code cannot own. Do not skip it because the code looks sufficient.**
|
|
7617
7594
|
|
|
7618
|
-
##
|
|
7595
|
+
## Update the Brain
|
|
7619
7596
|
|
|
7620
7597
|
As you work, record only what future sessions will need. **Do not document anything already evident from the code.** The brain holds big-picture contracts, analysis, meta-requirements, invariants, conventions, standards and more. Do not restate implementation or inventory artifacts the code already contains. Don't bloat documents with minor tweaks.
|
|
7621
7598
|
|
|
@@ -7629,17 +7606,13 @@ As you work, record only what future sessions will need. **Do not document anyth
|
|
|
7629
7606
|
- Private documents may reference shared content, but not vice versa.
|
|
7630
7607
|
- **DO NOT** create multiple sources of truth. Private **instructions** may override Shared; **facts** (codebase state) must not be duplicated. Keep partitions **mostly mutually exclusive**.
|
|
7631
7608
|
|
|
7632
|
-
###
|
|
7609
|
+
### Operator Instructions
|
|
7633
7610
|
|
|
7634
|
-
|
|
7635
|
-
- Extra guides (e.g. frontend-only notes) live in freeform; document in the Catalog.
|
|
7636
|
-
- Primarily driven by the user. Edit only to lock a standing rule or convention.
|
|
7611
|
+
One \`operator.md\` per partition. Primarily driven by the user; edit only to lock a standing rule or convention.
|
|
7637
7612
|
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
-
|
|
7641
|
-
- Keep project-specific instructions in the appropriate Project Operator Instructions.
|
|
7642
|
-
- Change only when the user asks you to remember a cross-project working rule.
|
|
7613
|
+
- User: global core principles, communication style, workflow, autonomy, engineering principles, code style, and verification expectations.
|
|
7614
|
+
- Project: standing rules, style, process, project constraints, and project-specific share/private placement — structured however the user prefers. Keep project-specific instructions out of the User file.
|
|
7615
|
+
- Extra guides (e.g. frontend-only notes) are not instructions; they live in freeform, documented in the Catalog.
|
|
7643
7616
|
|
|
7644
7617
|
### Project Index
|
|
7645
7618
|
|
|
@@ -7650,7 +7623,7 @@ As you work, record only what future sessions will need. **Do not document anyth
|
|
|
7650
7623
|
- **DO** split large or high-traffic areas into dedicated subindexes as the map grows. Keep the main index "must know" so long-term navigation stays scalable.
|
|
7651
7624
|
- **DO** add a private subindex (and main-index link) when a third-party or external tree is cloned for reference so future sessions can navigate it without rediscovering the layout.
|
|
7652
7625
|
- **DO** try to document every non-ignored file and directory unless the directory is excessively large or low-value. Then document the directory only. Document ignored entities if relevant. If file content is obvious, label "Ditto"; if multiple files are similar, group them.
|
|
7653
|
-
- **DO NOT** put brain structure or brain documents into the Project Index — that belongs in the Partition Catalog.
|
|
7626
|
+
- **DO NOT** put brain structure or brain documents into the Project Index — that belongs in the Project Partition Catalog.
|
|
7654
7627
|
- Indexes use a **fixed structure and entry syntax**. Do not invent alternate layouts. Filled documents need only real content — do not keep instructional Guidelines, placeholders, or example trees from seed templates.
|
|
7655
7628
|
|
|
7656
7629
|
Main index required shape (\`<partition>/index/index.md\`):
|
|
@@ -7679,34 +7652,28 @@ Subindex rules:
|
|
|
7679
7652
|
- Follow this shape when seeding a new subindex; never freehand a blank structure.
|
|
7680
7653
|
- Fill frontmatter, title, Coverage, Architecture, and the tree. No instructional sections required in the file.
|
|
7681
7654
|
|
|
7682
|
-
### Partition
|
|
7655
|
+
### Partition Catalogs
|
|
7656
|
+
|
|
7657
|
+
Agent-maintained map of a partition's brain root. One \`catalog.md\` per partition: the User Partition and each Project partition.
|
|
7683
7658
|
|
|
7684
|
-
-
|
|
7685
|
-
-
|
|
7686
|
-
- Every entry
|
|
7687
|
-
-
|
|
7688
|
-
-
|
|
7689
|
-
-
|
|
7690
|
-
- **DO NOT** put codebase structure into
|
|
7691
|
-
- Catalogs use a **fixed structure and entry syntax**.
|
|
7659
|
+
- Catalog only that partition's brain root. Never list repository source files.
|
|
7660
|
+
- Project catalogs never list \`index/\`; the Project Index is injected separately. Never list other partitions' paths.
|
|
7661
|
+
- Every entry needs a \`Description\` and \`Read If\`. \`operator.md\` and \`catalog.md\` are auto-injected; keep their seed entries and catalog every other path.
|
|
7662
|
+
- Same density rules as the Project Index: document densely (paths, roles, grouping, "Ditto" where obvious); directory-only lines for large or low-value dirs. No catalog subindexes.
|
|
7663
|
+
- Artifact-backed freeform (e.g. a ported skill folder): catalog the entry file path (e.g. \`powerpoint-builder/SKILL.md\`) as a single entry. Do not catalog individual artifacts.
|
|
7664
|
+
- **DO** update the catalog after creating or significantly changing freeform files or layout.
|
|
7665
|
+
- **DO NOT** put codebase structure into Project catalogs — that lives in the Project Index.
|
|
7666
|
+
- Catalogs use a **fixed structure and entry syntax**. Filled catalogs need only real content — no placeholders or example trees from seed templates.
|
|
7692
7667
|
|
|
7693
|
-
Required shape (
|
|
7668
|
+
Required shape (\`catalog.md\`):
|
|
7694
7669
|
|
|
7695
7670
|
\`\`\`markdown
|
|
7696
|
-
${
|
|
7671
|
+
${CATALOG_TEMPLATE.trimEnd()}
|
|
7697
7672
|
\`\`\`
|
|
7698
7673
|
|
|
7699
|
-
Catalog rules:
|
|
7700
|
-
|
|
7701
|
-
- Catalog **only** that partition’s brain root — never the codebase.
|
|
7702
|
-
- **DO NOT** catalog \`index/\`; the Project Index is injected separately.
|
|
7703
|
-
- Every entry needs **Description** and **Read If**.
|
|
7704
|
-
- Same density rules as indexes: paths, roles, grouping, \`Ditto\` where obvious; directory-only lines for large/low-value brain dirs.
|
|
7705
|
-
- No catalog subindexes.
|
|
7706
|
-
|
|
7707
7674
|
### Freeform Brain
|
|
7708
7675
|
|
|
7709
|
-
Agent-owned content outside plugin-managed index / instructions / catalog paths.
|
|
7676
|
+
Agent-owned content outside plugin-managed index / instructions / catalog paths. Project freeform lives in the Project Brain; user freeform lives in the User Partition. Both follow the same rules below.
|
|
7710
7677
|
|
|
7711
7678
|
**Cold starts:** After Operator is added to an existing project, the brain may hold little more than instructions, catalogs, and indexes. Still create small, reasonably scoped specs for features/systems you actually work on. Document only truth established so far — decisions made, contracts enforced, behavior built. Sparse is correct. Do not skip writing because the brain is empty, and do not invent, infer, or pad requirements to make a document feel complete. Greenfield projects are not cold starts; document as you build, using the ownership rules below.
|
|
7712
7679
|
|
|
@@ -7747,6 +7714,7 @@ var PREAMBLE_TENETS = `<operator-tenets>
|
|
|
7747
7714
|
## **REMEMBER: Core Tenets**
|
|
7748
7715
|
|
|
7749
7716
|
<important>
|
|
7717
|
+
- **Run the memory-aware loop.** Consult the brain before you build; update it after you learn. Do not build from zero while a brain exists; do not leave lessons unrecorded.
|
|
7750
7718
|
- **Explore efficiently.** Instructions, indexes, and catalogs are already loaded. Use them before search. Open relevant subindexes; do not rediscover the tree; do not default to reading everything.
|
|
7751
7719
|
- **Specs are system truth.** Read a matching spec before you implement. Update that spec when the contract changes. Do not skip it because the code looks sufficient; make focused reads, do not default to reading everything.
|
|
7752
7720
|
- **Your context is ephemeral.** You WILL forget everything after the user starts a new conversation. Proactively persist durable decisions, specs, guides, and lessons in the right place now if they should survive the next session.
|
|
@@ -7761,6 +7729,7 @@ var PREAMBLE_TENETS = `<operator-tenets>
|
|
|
7761
7729
|
var SHARED_ROOT = ".operator-shared";
|
|
7762
7730
|
var PRIVATE_ROOT = ".operator";
|
|
7763
7731
|
var USER_INSTRUCTIONS_PATH = "~/.operator/user/operator.md";
|
|
7732
|
+
var USER_CATALOG_PATH = "~/.operator/user/catalog.md";
|
|
7764
7733
|
function renderPreamble(memory) {
|
|
7765
7734
|
if (!memory.shared.ok || !memory.user.ok || !memory.private.ok) {
|
|
7766
7735
|
return {
|
|
@@ -7781,6 +7750,18 @@ ${renderLoadDiagnostic(memory)}`,
|
|
|
7781
7750
|
if (instructions !== null) {
|
|
7782
7751
|
sections.push(instructions);
|
|
7783
7752
|
}
|
|
7753
|
+
const userCatalog = renderUserCatalog(loaded.user);
|
|
7754
|
+
if (userCatalog !== null) {
|
|
7755
|
+
sections.push(userCatalog);
|
|
7756
|
+
} else if (loaded.user.exists) {
|
|
7757
|
+
warnings.push(`<operator-warning>
|
|
7758
|
+
The User Partition exists but ~/.operator/user/catalog.md does not. You must create and maintain a catalog.md to document any non-empty User Partition.
|
|
7759
|
+
</operator-warning>`);
|
|
7760
|
+
} else {
|
|
7761
|
+
warnings.push(`<operator-warning>
|
|
7762
|
+
The ~/.operator/user directory does not exist. If the user would benefit from cross-project user memory, ask the user to run /operator:user-init first to initialize the User Partition. If not needed, do not ask; they may be working without user memory intentionally.
|
|
7763
|
+
</operator-warning>`);
|
|
7764
|
+
}
|
|
7784
7765
|
if (!loaded.shared.exists && !loaded.private.exists) {
|
|
7785
7766
|
warnings.push(`<operator-warning>
|
|
7786
7767
|
Neither the .operator nor .operator-shared directory exists. If the user requests significant amounts of work to be done on the project, ask the user to run /operator:project-init first to initialize Operator. If the user is not requesting work to be done, do not ask to initialize; they could simply be exploring.
|
|
@@ -7788,20 +7769,19 @@ Neither the .operator nor .operator-shared directory exists. If the user request
|
|
|
7788
7769
|
} else {
|
|
7789
7770
|
const indexes = renderIndexes(loaded);
|
|
7790
7771
|
const catalogs = renderCatalogs(loaded);
|
|
7791
|
-
if (indexes !== null) {
|
|
7792
|
-
sections.push(indexes);
|
|
7793
|
-
}
|
|
7794
7772
|
if (catalogs !== null) {
|
|
7795
7773
|
sections.push(catalogs);
|
|
7796
|
-
}
|
|
7797
|
-
if (!hasMainIndex(loaded)) {
|
|
7774
|
+
} else {
|
|
7798
7775
|
warnings.push(`<operator-warning>
|
|
7799
|
-
Neither .operator/
|
|
7776
|
+
Neither .operator/catalog.md nor .operator-shared/catalog.md exists. You must create and maintain a catalog.md to document any non-empty Project Brain partitions.
|
|
7800
7777
|
</operator-warning>`);
|
|
7801
7778
|
}
|
|
7802
|
-
if (
|
|
7779
|
+
if (indexes !== null) {
|
|
7780
|
+
sections.push(indexes);
|
|
7781
|
+
}
|
|
7782
|
+
if (!hasMainIndex(loaded)) {
|
|
7803
7783
|
warnings.push(`<operator-warning>
|
|
7804
|
-
Neither .operator/
|
|
7784
|
+
Neither .operator/index/index.md nor .operator-shared/index/index.md exists. If the project is not in an empty state, ask the user to run /operator:index to initialize a project index before performing any work.
|
|
7805
7785
|
</operator-warning>`);
|
|
7806
7786
|
}
|
|
7807
7787
|
}
|
|
@@ -7828,7 +7808,10 @@ ${status("Private", memory.private)}
|
|
|
7828
7808
|
|
|
7829
7809
|
IMPORTANT: You MUST focus explicitly and exclusively on fixing Operator memory loading before proceeding with the user's requested work; otherwise, user and project instructions will not be loaded and you may not perform according to the user's wishes.
|
|
7830
7810
|
|
|
7831
|
-
Use the error paths and causes above to repair the affected partitions, then run \`operator-helper memory check\` to validate the full load.
|
|
7811
|
+
Use the error paths and causes above to repair the affected partitions, then run \`operator-helper memory check\` to validate the full load. \`operator-helper\` is the globally installed Operator CLI (npm package \`@aerovato/operator-helper\`), not a project dependency; it runs directly in any shell.
|
|
7812
|
+
|
|
7813
|
+
- If the check succeeds: tell the user to start a new session and resubmit their original request so the next session loads the full preamble.
|
|
7814
|
+
- If you cannot resolve the loading failure: stop, ask the user for guidance, and suggest they run \`/operator:repair\` in a standalone session to perform self-repair.
|
|
7832
7815
|
</operator-diagnostic>`;
|
|
7833
7816
|
}
|
|
7834
7817
|
function renderInstructions(memory) {
|
|
@@ -7895,6 +7878,16 @@ function renderIndexListing(root, indexes) {
|
|
|
7895
7878
|
return lines.join(`
|
|
7896
7879
|
`);
|
|
7897
7880
|
}
|
|
7881
|
+
function renderUserCatalog(partition) {
|
|
7882
|
+
if (partition.catalog === null) {
|
|
7883
|
+
return null;
|
|
7884
|
+
}
|
|
7885
|
+
return `<user-catalog>
|
|
7886
|
+
<file-content path="${USER_CATALOG_PATH}">
|
|
7887
|
+
${partition.catalog}
|
|
7888
|
+
</file-content>
|
|
7889
|
+
</user-catalog>`;
|
|
7890
|
+
}
|
|
7898
7891
|
function renderCatalogs(memory) {
|
|
7899
7892
|
const files = [];
|
|
7900
7893
|
if (memory.shared.catalog !== null) {
|
|
@@ -7939,172 +7932,43 @@ async function readPreamble(projectDirectory, homeDirectory) {
|
|
|
7939
7932
|
}
|
|
7940
7933
|
}
|
|
7941
7934
|
|
|
7942
|
-
// src/
|
|
7943
|
-
import {
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
}
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
if (basename(packageDirectory) !== "operator-opencode-v2" || basename(scopeDirectory) !== "@aerovato" || basename(nodeModulesDirectory) !== "node_modules" || !/^\d+$/.test(basename(installDirectory)) || basename(cacheDirectory) !== "operator-opencode-v2@latest") {
|
|
7978
|
-
return { current: null, latest: null };
|
|
7979
|
-
}
|
|
7980
|
-
const packageJson = await readPackageJson(join3(packageDirectory, "package.json"));
|
|
7981
|
-
if (packageJson?.name !== PACKAGE_NAME || typeof packageJson.version !== "string") {
|
|
7982
|
-
return { current: null, latest: null };
|
|
7983
|
-
}
|
|
7984
|
-
return {
|
|
7985
|
-
current: {
|
|
7986
|
-
directory: installDirectory,
|
|
7987
|
-
cacheDirectory,
|
|
7988
|
-
version: packageJson.version
|
|
7989
|
-
},
|
|
7990
|
-
latest: await latestVersion()
|
|
7991
|
-
};
|
|
7992
|
-
}
|
|
7993
|
-
function isVersionNewer(latest, current) {
|
|
7994
|
-
const next = parseVersion(latest);
|
|
7995
|
-
const previous = parseVersion(current);
|
|
7996
|
-
if (next === null || previous === null)
|
|
7997
|
-
return false;
|
|
7998
|
-
for (const index of [0, 1, 2]) {
|
|
7999
|
-
if (next[index] !== previous[index])
|
|
8000
|
-
return next[index] > previous[index];
|
|
8001
|
-
}
|
|
8002
|
-
return false;
|
|
8003
|
-
}
|
|
8004
|
-
async function findPackageDirectory(moduleUrl) {
|
|
8005
|
-
const modulePath = fileURLToPath(moduleUrl);
|
|
8006
|
-
for (let directory = dirname(modulePath);; directory = dirname(directory)) {
|
|
8007
|
-
const packageJson = await readPackageJson(join3(directory, "package.json"));
|
|
8008
|
-
if (packageJson?.name === PACKAGE_NAME)
|
|
8009
|
-
return directory;
|
|
8010
|
-
if (dirname(directory) === directory)
|
|
8011
|
-
return null;
|
|
8012
|
-
}
|
|
8013
|
-
}
|
|
8014
|
-
async function readPackageJson(path) {
|
|
8015
|
-
return readFile2(path, "utf8").then((value) => JSON.parse(value)).catch(() => null);
|
|
8016
|
-
}
|
|
8017
|
-
async function fetchLatestVersion() {
|
|
8018
|
-
const registry = (process.env.NPM_CONFIG_REGISTRY ?? "https://registry.npmjs.org").replace(/\/+$/, "");
|
|
8019
|
-
return fetch(`${registry}/${encodeURIComponent(PACKAGE_NAME)}/latest`, {
|
|
8020
|
-
signal: AbortSignal.timeout(1e4)
|
|
8021
|
-
}).then(async (response) => {
|
|
8022
|
-
if (!response.ok)
|
|
8023
|
-
return null;
|
|
8024
|
-
const value = await response.json();
|
|
8025
|
-
if (value === null || typeof value !== "object" || !("version" in value))
|
|
8026
|
-
return null;
|
|
8027
|
-
return typeof value.version === "string" ? value.version : null;
|
|
8028
|
-
}).catch(() => null);
|
|
8029
|
-
}
|
|
8030
|
-
async function installPackage(current, latest) {
|
|
8031
|
-
if (await npmInstallPackage(current.directory, latest) === "updated")
|
|
8032
|
-
return "updated";
|
|
8033
|
-
return clearInstallCache(current.cacheDirectory);
|
|
8034
|
-
}
|
|
8035
|
-
async function npmInstallPackage(installDirectory, version) {
|
|
8036
|
-
return new Promise((resolve2) => {
|
|
8037
|
-
const child = spawn2("npm", [
|
|
8038
|
-
"install",
|
|
8039
|
-
"--save-exact",
|
|
8040
|
-
"--ignore-scripts",
|
|
8041
|
-
"--no-audit",
|
|
8042
|
-
"--no-fund",
|
|
8043
|
-
"--no-progress",
|
|
8044
|
-
`${PACKAGE_NAME}@${version}`
|
|
8045
|
-
], {
|
|
8046
|
-
cwd: installDirectory,
|
|
8047
|
-
env: { ...process.env, NPM_CONFIG_MIN_RELEASE_AGE: "0" },
|
|
8048
|
-
stdio: "ignore"
|
|
8049
|
-
});
|
|
8050
|
-
let timedOut = false;
|
|
8051
|
-
const timeout = setTimeout(() => {
|
|
8052
|
-
timedOut = true;
|
|
8053
|
-
child.kill();
|
|
8054
|
-
}, INSTALL_TIMEOUT);
|
|
8055
|
-
child.once("error", () => {
|
|
8056
|
-
clearTimeout(timeout);
|
|
8057
|
-
resolve2("failed");
|
|
8058
|
-
});
|
|
8059
|
-
child.once("exit", (code) => {
|
|
8060
|
-
clearTimeout(timeout);
|
|
8061
|
-
resolve2(!timedOut && code === 0 ? "updated" : "failed");
|
|
8062
|
-
});
|
|
8063
|
-
});
|
|
8064
|
-
}
|
|
8065
|
-
async function clearInstallCache(directory) {
|
|
8066
|
-
return rm(directory, { recursive: true, force: true }).then(() => "cache-cleared").catch(() => "cache-clear-failed");
|
|
8067
|
-
}
|
|
8068
|
-
async function showUpdateResult(showToast, result) {
|
|
8069
|
-
if (result.status === "none")
|
|
8070
|
-
return;
|
|
8071
|
-
if (result.status === "updated") {
|
|
8072
|
-
await showToast({
|
|
8073
|
-
title: "Operator Updated",
|
|
8074
|
-
message: `v${result.current} → v${result.latest}. Restart OpenCode V2 to apply.`,
|
|
8075
|
-
variant: "success"
|
|
8076
|
-
}).catch(() => {
|
|
8077
|
-
return;
|
|
8078
|
-
});
|
|
8079
|
-
return;
|
|
8080
|
-
}
|
|
8081
|
-
if (result.status === "cache-cleared") {
|
|
8082
|
-
await showToast({
|
|
8083
|
-
title: "Operator Update Queued",
|
|
8084
|
-
message: "Restart OpenCode V2 to reinstall Operator.",
|
|
8085
|
-
variant: "info"
|
|
8086
|
-
}).catch(() => {
|
|
8087
|
-
return;
|
|
8088
|
-
});
|
|
8089
|
-
return;
|
|
7935
|
+
// src/notifications.ts
|
|
7936
|
+
import { Rpc } from "@opencode/plugin/rpc";
|
|
7937
|
+
var OperatorNotifications = Rpc.define({
|
|
7938
|
+
id: "aerovato.operator-memory",
|
|
7939
|
+
methods: {
|
|
7940
|
+
status: {
|
|
7941
|
+
input: {
|
|
7942
|
+
type: "object",
|
|
7943
|
+
properties: { refresh: { type: "boolean" } },
|
|
7944
|
+
required: ["refresh"]
|
|
7945
|
+
},
|
|
7946
|
+
output: {
|
|
7947
|
+
type: "object",
|
|
7948
|
+
properties: {
|
|
7949
|
+
detail: { type: "string" },
|
|
7950
|
+
user: { enum: ["loaded", "uninitialized", "error"] },
|
|
7951
|
+
private: { enum: ["loaded", "uninitialized", "error"] },
|
|
7952
|
+
shared: { enum: ["loaded", "uninitialized", "error"] }
|
|
7953
|
+
},
|
|
7954
|
+
required: ["detail", "user", "private", "shared"]
|
|
7955
|
+
}
|
|
7956
|
+
}
|
|
7957
|
+
},
|
|
7958
|
+
events: {
|
|
7959
|
+
toast: {
|
|
7960
|
+
schema: {
|
|
7961
|
+
type: "object",
|
|
7962
|
+
properties: {
|
|
7963
|
+
title: { type: "string" },
|
|
7964
|
+
message: { type: "string" },
|
|
7965
|
+
variant: { enum: ["info", "success", "warning", "error"] }
|
|
7966
|
+
},
|
|
7967
|
+
required: ["title", "message", "variant"]
|
|
7968
|
+
}
|
|
7969
|
+
}
|
|
8090
7970
|
}
|
|
8091
|
-
|
|
8092
|
-
title: "Operator Update Failed",
|
|
8093
|
-
message: `Could not install v${result.latest}. Run operator-helper install opencode-v2 to install the latest version.`,
|
|
8094
|
-
variant: "error"
|
|
8095
|
-
}).catch(() => {
|
|
8096
|
-
return;
|
|
8097
|
-
});
|
|
8098
|
-
}
|
|
8099
|
-
function parseVersion(version) {
|
|
8100
|
-
const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
8101
|
-
if (match === null)
|
|
8102
|
-
return null;
|
|
8103
|
-
const [, major, minor, patch] = match;
|
|
8104
|
-
if (major === undefined || minor === undefined || patch === undefined)
|
|
8105
|
-
return null;
|
|
8106
|
-
return [Number(major), Number(minor), Number(patch)];
|
|
8107
|
-
}
|
|
7971
|
+
});
|
|
8108
7972
|
|
|
8109
7973
|
// src/index.ts
|
|
8110
7974
|
var helperUpdateStarted = false;
|
|
@@ -8125,9 +7989,6 @@ var OperatorPlugin = Plugin.define({
|
|
|
8125
7989
|
});
|
|
8126
7990
|
const showToast = (toast) => notifications.events.emit("toast", toast);
|
|
8127
7991
|
startHelperUpdate();
|
|
8128
|
-
startAutoUpdate(showToast).catch(() => {
|
|
8129
|
-
return;
|
|
8130
|
-
});
|
|
8131
7992
|
await registerCommands(context);
|
|
8132
7993
|
await context.session.hook("context", async (event) => {
|
|
8133
7994
|
const result = await loadPreamble({
|
|
@@ -8177,7 +8038,7 @@ function partitionStatus(partition) {
|
|
|
8177
8038
|
return partition.value.exists ? "loaded" : "uninitialized";
|
|
8178
8039
|
}
|
|
8179
8040
|
function installationDetail(moduleUrl) {
|
|
8180
|
-
const packageDirectory =
|
|
8041
|
+
const packageDirectory = dirname(dirname(fileURLToPath(moduleUrl)));
|
|
8181
8042
|
return packageDirectory.includes(`${process.platform === "win32" ? "\\" : "/"}node_modules${process.platform === "win32" ? "\\" : "/"}`) ? `v${package_default.version}` : "Local Build";
|
|
8182
8043
|
}
|
|
8183
8044
|
function startHelperUpdate() {
|
|
@@ -8187,7 +8048,7 @@ function startHelperUpdate() {
|
|
|
8187
8048
|
const environment = { ...process.env };
|
|
8188
8049
|
delete environment.OPERATOR_HELPER_SKIP_UPDATE;
|
|
8189
8050
|
try {
|
|
8190
|
-
const child =
|
|
8051
|
+
const child = spawn2("operator-helper", ["version"], {
|
|
8191
8052
|
detached: true,
|
|
8192
8053
|
env: environment,
|
|
8193
8054
|
stdio: "ignore",
|
|
@@ -8203,4 +8064,4 @@ export {
|
|
|
8203
8064
|
src_default as default
|
|
8204
8065
|
};
|
|
8205
8066
|
|
|
8206
|
-
//# debugId=
|
|
8067
|
+
//# debugId=BBF7343808AC7D6164756E2164756E21
|