boomkin 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,21 +1,25 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
+ var __defProp = Object.defineProperty;
3
4
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
4
- var __esm = (fn, res, err) => () => {
5
- if (fn)
6
- try {
7
- res = fn(fn = 0);
8
- } catch (e) {
9
- err = [e];
10
- }
11
- if (err)
12
- throw err[0];
13
- return res;
5
+ var __returnValue = (v) => v;
6
+ function __exportSetter(name, newValue) {
7
+ this[name] = __returnValue.bind(null, newValue);
8
+ }
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true,
14
+ configurable: true,
15
+ set: __exportSetter.bind(all, name)
16
+ });
14
17
  };
18
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
15
19
  var __require = import.meta.require;
16
20
 
17
21
  // node_modules/yaml/dist/nodes/identity.js
18
- var require_identity = __commonJS(function(exports) {
22
+ var require_identity = __commonJS((exports) => {
19
23
  var ALIAS = Symbol.for("yaml.alias");
20
24
  var DOC = Symbol.for("yaml.document");
21
25
  var MAP = Symbol.for("yaml.map");
@@ -69,7 +73,7 @@ var require_identity = __commonJS(function(exports) {
69
73
  });
70
74
 
71
75
  // node_modules/yaml/dist/visit.js
72
- var require_visit = __commonJS(function(exports) {
76
+ var require_visit = __commonJS((exports) => {
73
77
  var identity = require_identity();
74
78
  var BREAK = Symbol("break visit");
75
79
  var SKIP = Symbol("skip children");
@@ -224,7 +228,7 @@ var require_visit = __commonJS(function(exports) {
224
228
  });
225
229
 
226
230
  // node_modules/yaml/dist/doc/directives.js
227
- var require_directives = __commonJS(function(exports) {
231
+ var require_directives = __commonJS((exports) => {
228
232
  var identity = require_identity();
229
233
  var visit = require_visit();
230
234
  var escapeChars = {
@@ -376,7 +380,7 @@ var require_directives = __commonJS(function(exports) {
376
380
  });
377
381
 
378
382
  // node_modules/yaml/dist/doc/anchors.js
379
- var require_anchors = __commonJS(function(exports) {
383
+ var require_anchors = __commonJS((exports) => {
380
384
  var identity = require_identity();
381
385
  var visit = require_visit();
382
386
  function anchorIsValid(anchor) {
@@ -438,7 +442,7 @@ var require_anchors = __commonJS(function(exports) {
438
442
  });
439
443
 
440
444
  // node_modules/yaml/dist/doc/applyReviver.js
441
- var require_applyReviver = __commonJS(function(exports) {
445
+ var require_applyReviver = __commonJS((exports) => {
442
446
  function applyReviver(reviver, obj, key, val) {
443
447
  if (val && typeof val === "object") {
444
448
  if (Array.isArray(val)) {
@@ -485,7 +489,7 @@ var require_applyReviver = __commonJS(function(exports) {
485
489
  });
486
490
 
487
491
  // node_modules/yaml/dist/nodes/toJS.js
488
- var require_toJS = __commonJS(function(exports) {
492
+ var require_toJS = __commonJS((exports) => {
489
493
  var identity = require_identity();
490
494
  function toJS(value, arg, ctx) {
491
495
  if (Array.isArray(value))
@@ -495,8 +499,8 @@ var require_toJS = __commonJS(function(exports) {
495
499
  return value.toJSON(arg, ctx);
496
500
  const data = { aliasCount: 0, count: 1, res: undefined };
497
501
  ctx.anchors.set(value, data);
498
- ctx.onCreate = (res) => {
499
- data.res = res;
502
+ ctx.onCreate = (res2) => {
503
+ data.res = res2;
500
504
  delete ctx.onCreate;
501
505
  };
502
506
  const res = value.toJSON(arg, ctx);
@@ -512,7 +516,7 @@ var require_toJS = __commonJS(function(exports) {
512
516
  });
513
517
 
514
518
  // node_modules/yaml/dist/nodes/Node.js
515
- var require_Node = __commonJS(function(exports) {
519
+ var require_Node = __commonJS((exports) => {
516
520
  var applyReviver = require_applyReviver();
517
521
  var identity = require_identity();
518
522
  var toJS = require_toJS();
@@ -540,8 +544,8 @@ var require_Node = __commonJS(function(exports) {
540
544
  };
541
545
  const res = toJS.toJS(this, "", ctx);
542
546
  if (typeof onAnchor === "function")
543
- for (const { count, res } of ctx.anchors.values())
544
- onAnchor(res, count);
547
+ for (const { count, res: res2 } of ctx.anchors.values())
548
+ onAnchor(res2, count);
545
549
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
546
550
  }
547
551
  }
@@ -549,7 +553,7 @@ var require_Node = __commonJS(function(exports) {
549
553
  });
550
554
 
551
555
  // node_modules/yaml/dist/nodes/Alias.js
552
- var require_Alias = __commonJS(function(exports) {
556
+ var require_Alias = __commonJS((exports) => {
553
557
  var anchors = require_anchors();
554
558
  var visit = require_visit();
555
559
  var identity = require_identity();
@@ -591,11 +595,11 @@ var require_Alias = __commonJS(function(exports) {
591
595
  found = node;
592
596
  }
593
597
  if (found && ctx) {
594
- const { anchors, doc, maxAliasCount } = ctx;
595
- let data = anchors.get(found);
598
+ const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
599
+ let data = anchors2.get(found);
596
600
  if (!data) {
597
601
  toJS.toJS(found, null, ctx);
598
- data = anchors.get(found);
602
+ data = anchors2.get(found);
599
603
  }
600
604
  if (data?.res === undefined) {
601
605
  const msg = "This should not happen: Alias anchor was not resolved?";
@@ -604,7 +608,7 @@ var require_Alias = __commonJS(function(exports) {
604
608
  if (maxAliasCount >= 0) {
605
609
  data.count += 1;
606
610
  if (data.aliasCount === 0)
607
- data.aliasCount = getAliasCount(doc, found, anchors);
611
+ data.aliasCount = getAliasCount(doc2, found, anchors2);
608
612
  if (data.count * data.aliasCount > maxAliasCount) {
609
613
  const msg = "Excessive alias count indicates a resource exhaustion attack";
610
614
  throw new ReferenceError(msg);
@@ -637,22 +641,22 @@ var require_Alias = __commonJS(function(exports) {
637
641
  return src;
638
642
  }
639
643
  }
640
- function getAliasCount(doc, node, anchors) {
644
+ function getAliasCount(doc, node, anchors2) {
641
645
  if (identity.isAlias(node)) {
642
646
  const source = node.resolve(doc);
643
- const anchor = anchors && source && anchors.get(source);
647
+ const anchor = anchors2 && source && anchors2.get(source);
644
648
  return anchor ? anchor.count * anchor.aliasCount : 0;
645
649
  } else if (identity.isCollection(node)) {
646
650
  let count = 0;
647
651
  for (const item of node.items) {
648
- const c = getAliasCount(doc, item, anchors);
652
+ const c = getAliasCount(doc, item, anchors2);
649
653
  if (c > count)
650
654
  count = c;
651
655
  }
652
656
  return count;
653
657
  } else if (identity.isPair(node)) {
654
- const kc = getAliasCount(doc, node.key, anchors);
655
- const vc = getAliasCount(doc, node.value, anchors);
658
+ const kc = getAliasCount(doc, node.key, anchors2);
659
+ const vc = getAliasCount(doc, node.value, anchors2);
656
660
  return Math.max(kc, vc);
657
661
  }
658
662
  return 1;
@@ -661,7 +665,7 @@ var require_Alias = __commonJS(function(exports) {
661
665
  });
662
666
 
663
667
  // node_modules/yaml/dist/nodes/Scalar.js
664
- var require_Scalar = __commonJS(function(exports) {
668
+ var require_Scalar = __commonJS((exports) => {
665
669
  var identity = require_identity();
666
670
  var Node = require_Node();
667
671
  var toJS = require_toJS();
@@ -689,7 +693,7 @@ var require_Scalar = __commonJS(function(exports) {
689
693
  });
690
694
 
691
695
  // node_modules/yaml/dist/doc/createNode.js
692
- var require_createNode = __commonJS(function(exports) {
696
+ var require_createNode = __commonJS((exports) => {
693
697
  var Alias = require_Alias();
694
698
  var identity = require_identity();
695
699
  var Scalar = require_Scalar();
@@ -737,10 +741,10 @@ var require_createNode = __commonJS(function(exports) {
737
741
  value = value.toJSON();
738
742
  }
739
743
  if (!value || typeof value !== "object") {
740
- const node = new Scalar.Scalar(value);
744
+ const node2 = new Scalar.Scalar(value);
741
745
  if (ref)
742
- ref.node = node;
743
- return node;
746
+ ref.node = node2;
747
+ return node2;
744
748
  }
745
749
  tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
746
750
  }
@@ -761,7 +765,7 @@ var require_createNode = __commonJS(function(exports) {
761
765
  });
762
766
 
763
767
  // node_modules/yaml/dist/nodes/Collection.js
764
- var require_Collection = __commonJS(function(exports) {
768
+ var require_Collection = __commonJS((exports) => {
765
769
  var createNode = require_createNode();
766
770
  var identity = require_identity();
767
771
  var Node = require_Node();
@@ -876,7 +880,7 @@ var require_Collection = __commonJS(function(exports) {
876
880
  });
877
881
 
878
882
  // node_modules/yaml/dist/stringify/stringifyComment.js
879
- var require_stringifyComment = __commonJS(function(exports) {
883
+ var require_stringifyComment = __commonJS((exports) => {
880
884
  var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
881
885
  function indentComment(comment, indent) {
882
886
  if (/^\n+$/.test(comment))
@@ -893,7 +897,7 @@ var require_stringifyComment = __commonJS(function(exports) {
893
897
  });
894
898
 
895
899
  // node_modules/yaml/dist/stringify/foldFlowLines.js
896
- var require_foldFlowLines = __commonJS(function(exports) {
900
+ var require_foldFlowLines = __commonJS((exports) => {
897
901
  var FOLD_FLOW = "flow";
898
902
  var FOLD_BLOCK = "block";
899
903
  var FOLD_QUOTED = "quoted";
@@ -989,17 +993,17 @@ var require_foldFlowLines = __commonJS(function(exports) {
989
993
  if (onFold)
990
994
  onFold();
991
995
  let res = text.slice(0, folds[0]);
992
- for (let i = 0;i < folds.length; ++i) {
993
- const fold = folds[i];
994
- const end = folds[i + 1] || text.length;
996
+ for (let i2 = 0;i2 < folds.length; ++i2) {
997
+ const fold = folds[i2];
998
+ const end2 = folds[i2 + 1] || text.length;
995
999
  if (fold === 0)
996
1000
  res = `
997
- ${indent}${text.slice(0, end)}`;
1001
+ ${indent}${text.slice(0, end2)}`;
998
1002
  else {
999
1003
  if (mode === FOLD_QUOTED && escapedFolds[fold])
1000
1004
  res += `${text[fold]}\\`;
1001
1005
  res += `
1002
- ${indent}${text.slice(fold + 1, end)}`;
1006
+ ${indent}${text.slice(fold + 1, end2)}`;
1003
1007
  }
1004
1008
  }
1005
1009
  return res;
@@ -1030,7 +1034,7 @@ ${indent}${text.slice(fold + 1, end)}`;
1030
1034
  });
1031
1035
 
1032
1036
  // node_modules/yaml/dist/stringify/stringifyString.js
1033
- var require_stringifyString = __commonJS(function(exports) {
1037
+ var require_stringifyString = __commonJS((exports) => {
1034
1038
  var Scalar = require_Scalar();
1035
1039
  var foldFlowLines = require_foldFlowLines();
1036
1040
  var getFoldOptions = (ctx, isBlock) => ({
@@ -1328,7 +1332,7 @@ ${indent}`);
1328
1332
  });
1329
1333
 
1330
1334
  // node_modules/yaml/dist/stringify/stringify.js
1331
- var require_stringify = __commonJS(function(exports) {
1335
+ var require_stringify = __commonJS((exports) => {
1332
1336
  var anchors = require_anchors();
1333
1337
  var identity = require_identity();
1334
1338
  var stringifyComment = require_stringifyComment();
@@ -1449,7 +1453,7 @@ ${ctx.indent}${str}`;
1449
1453
  });
1450
1454
 
1451
1455
  // node_modules/yaml/dist/stringify/stringifyPair.js
1452
- var require_stringifyPair = __commonJS(function(exports) {
1456
+ var require_stringifyPair = __commonJS((exports) => {
1453
1457
  var identity = require_identity();
1454
1458
  var Scalar = require_Scalar();
1455
1459
  var stringify = require_stringify();
@@ -1585,7 +1589,7 @@ ${ctx.indent}`;
1585
1589
  });
1586
1590
 
1587
1591
  // node_modules/yaml/dist/log.js
1588
- var require_log = __commonJS(function(exports) {
1592
+ var require_log = __commonJS((exports) => {
1589
1593
  var node_process = __require("process");
1590
1594
  function debug(logLevel, ...messages) {
1591
1595
  if (logLevel === "debug")
@@ -1604,7 +1608,7 @@ var require_log = __commonJS(function(exports) {
1604
1608
  });
1605
1609
 
1606
1610
  // node_modules/yaml/dist/schema/yaml-1.1/merge.js
1607
- var require_merge = __commonJS(function(exports) {
1611
+ var require_merge = __commonJS((exports) => {
1608
1612
  var identity = require_identity();
1609
1613
  var Scalar = require_Scalar();
1610
1614
  var MERGE_KEY = "<<";
@@ -1635,15 +1639,15 @@ var require_merge = __commonJS(function(exports) {
1635
1639
  if (!identity.isMap(source))
1636
1640
  throw new Error("Merge sources must be maps or map aliases");
1637
1641
  const srcMap = source.toJSON(null, ctx, Map);
1638
- for (const [key, value] of srcMap) {
1642
+ for (const [key, value2] of srcMap) {
1639
1643
  if (map instanceof Map) {
1640
1644
  if (!map.has(key))
1641
- map.set(key, value);
1645
+ map.set(key, value2);
1642
1646
  } else if (map instanceof Set) {
1643
1647
  map.add(key);
1644
1648
  } else if (!Object.prototype.hasOwnProperty.call(map, key)) {
1645
1649
  Object.defineProperty(map, key, {
1646
- value,
1650
+ value: value2,
1647
1651
  writable: true,
1648
1652
  enumerable: true,
1649
1653
  configurable: true
@@ -1661,7 +1665,7 @@ var require_merge = __commonJS(function(exports) {
1661
1665
  });
1662
1666
 
1663
1667
  // node_modules/yaml/dist/nodes/addPairToJSMap.js
1664
- var require_addPairToJSMap = __commonJS(function(exports) {
1668
+ var require_addPairToJSMap = __commonJS((exports) => {
1665
1669
  var log = require_log();
1666
1670
  var merge = require_merge();
1667
1671
  var stringify = require_stringify();
@@ -1722,7 +1726,7 @@ var require_addPairToJSMap = __commonJS(function(exports) {
1722
1726
  });
1723
1727
 
1724
1728
  // node_modules/yaml/dist/nodes/Pair.js
1725
- var require_Pair = __commonJS(function(exports) {
1729
+ var require_Pair = __commonJS((exports) => {
1726
1730
  var createNode = require_createNode();
1727
1731
  var stringifyPair = require_stringifyPair();
1728
1732
  var addPairToJSMap = require_addPairToJSMap();
@@ -1760,14 +1764,14 @@ var require_Pair = __commonJS(function(exports) {
1760
1764
  });
1761
1765
 
1762
1766
  // node_modules/yaml/dist/stringify/stringifyCollection.js
1763
- var require_stringifyCollection = __commonJS(function(exports) {
1767
+ var require_stringifyCollection = __commonJS((exports) => {
1764
1768
  var identity = require_identity();
1765
1769
  var stringify = require_stringify();
1766
1770
  var stringifyComment = require_stringifyComment();
1767
1771
  function stringifyCollection(collection, ctx, options) {
1768
1772
  const flow = ctx.inFlow ?? collection.flow;
1769
- const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
1770
- return stringify(collection, ctx, options);
1773
+ const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
1774
+ return stringify2(collection, ctx, options);
1771
1775
  }
1772
1776
  function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
1773
1777
  const { indent, options: { commentString } } = ctx;
@@ -1776,13 +1780,13 @@ var require_stringifyCollection = __commonJS(function(exports) {
1776
1780
  const lines = [];
1777
1781
  for (let i = 0;i < items.length; ++i) {
1778
1782
  const item = items[i];
1779
- let comment = null;
1783
+ let comment2 = null;
1780
1784
  if (identity.isNode(item)) {
1781
1785
  if (!chompKeep && item.spaceBefore)
1782
1786
  lines.push("");
1783
1787
  addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
1784
1788
  if (item.comment)
1785
- comment = item.comment;
1789
+ comment2 = item.comment;
1786
1790
  } else if (identity.isPair(item)) {
1787
1791
  const ik = identity.isNode(item.key) ? item.key : null;
1788
1792
  if (ik) {
@@ -1792,12 +1796,12 @@ var require_stringifyCollection = __commonJS(function(exports) {
1792
1796
  }
1793
1797
  }
1794
1798
  chompKeep = false;
1795
- let str = stringify.stringify(item, itemCtx, () => comment = null, () => chompKeep = true);
1796
- if (comment)
1797
- str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
1798
- if (chompKeep && comment)
1799
+ let str2 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
1800
+ if (comment2)
1801
+ str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
1802
+ if (chompKeep && comment2)
1799
1803
  chompKeep = false;
1800
- lines.push(blockItemPrefix + str);
1804
+ lines.push(blockItemPrefix + str2);
1801
1805
  }
1802
1806
  let str;
1803
1807
  if (lines.length === 0) {
@@ -1912,7 +1916,7 @@ ${indent}${end}`;
1912
1916
  });
1913
1917
 
1914
1918
  // node_modules/yaml/dist/nodes/YAMLMap.js
1915
- var require_YAMLMap = __commonJS(function(exports) {
1919
+ var require_YAMLMap = __commonJS((exports) => {
1916
1920
  var stringifyCollection = require_stringifyCollection();
1917
1921
  var addPairToJSMap = require_addPairToJSMap();
1918
1922
  var Collection = require_Collection();
@@ -2039,7 +2043,7 @@ var require_YAMLMap = __commonJS(function(exports) {
2039
2043
  });
2040
2044
 
2041
2045
  // node_modules/yaml/dist/schema/common/map.js
2042
- var require_map = __commonJS(function(exports) {
2046
+ var require_map = __commonJS((exports) => {
2043
2047
  var identity = require_identity();
2044
2048
  var YAMLMap = require_YAMLMap();
2045
2049
  var map = {
@@ -2047,10 +2051,10 @@ var require_map = __commonJS(function(exports) {
2047
2051
  default: true,
2048
2052
  nodeClass: YAMLMap.YAMLMap,
2049
2053
  tag: "tag:yaml.org,2002:map",
2050
- resolve(map, onError) {
2051
- if (!identity.isMap(map))
2054
+ resolve(map2, onError) {
2055
+ if (!identity.isMap(map2))
2052
2056
  onError("Expected a mapping for this tag");
2053
- return map;
2057
+ return map2;
2054
2058
  },
2055
2059
  createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
2056
2060
  };
@@ -2058,7 +2062,7 @@ var require_map = __commonJS(function(exports) {
2058
2062
  });
2059
2063
 
2060
2064
  // node_modules/yaml/dist/nodes/YAMLSeq.js
2061
- var require_YAMLSeq = __commonJS(function(exports) {
2065
+ var require_YAMLSeq = __commonJS((exports) => {
2062
2066
  var createNode = require_createNode();
2063
2067
  var stringifyCollection = require_stringifyCollection();
2064
2068
  var Collection = require_Collection();
@@ -2151,7 +2155,7 @@ var require_YAMLSeq = __commonJS(function(exports) {
2151
2155
  });
2152
2156
 
2153
2157
  // node_modules/yaml/dist/schema/common/seq.js
2154
- var require_seq = __commonJS(function(exports) {
2158
+ var require_seq = __commonJS((exports) => {
2155
2159
  var identity = require_identity();
2156
2160
  var YAMLSeq = require_YAMLSeq();
2157
2161
  var seq = {
@@ -2159,10 +2163,10 @@ var require_seq = __commonJS(function(exports) {
2159
2163
  default: true,
2160
2164
  nodeClass: YAMLSeq.YAMLSeq,
2161
2165
  tag: "tag:yaml.org,2002:seq",
2162
- resolve(seq, onError) {
2163
- if (!identity.isSeq(seq))
2166
+ resolve(seq2, onError) {
2167
+ if (!identity.isSeq(seq2))
2164
2168
  onError("Expected a sequence for this tag");
2165
- return seq;
2169
+ return seq2;
2166
2170
  },
2167
2171
  createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
2168
2172
  };
@@ -2170,7 +2174,7 @@ var require_seq = __commonJS(function(exports) {
2170
2174
  });
2171
2175
 
2172
2176
  // node_modules/yaml/dist/schema/common/string.js
2173
- var require_string = __commonJS(function(exports) {
2177
+ var require_string = __commonJS((exports) => {
2174
2178
  var stringifyString = require_stringifyString();
2175
2179
  var string = {
2176
2180
  identify: (value) => typeof value === "string",
@@ -2186,7 +2190,7 @@ var require_string = __commonJS(function(exports) {
2186
2190
  });
2187
2191
 
2188
2192
  // node_modules/yaml/dist/schema/common/null.js
2189
- var require_null = __commonJS(function(exports) {
2193
+ var require_null = __commonJS((exports) => {
2190
2194
  var Scalar = require_Scalar();
2191
2195
  var nullTag = {
2192
2196
  identify: (value) => value == null,
@@ -2201,7 +2205,7 @@ var require_null = __commonJS(function(exports) {
2201
2205
  });
2202
2206
 
2203
2207
  // node_modules/yaml/dist/schema/core/bool.js
2204
- var require_bool = __commonJS(function(exports) {
2208
+ var require_bool = __commonJS((exports) => {
2205
2209
  var Scalar = require_Scalar();
2206
2210
  var boolTag = {
2207
2211
  identify: (value) => typeof value === "boolean",
@@ -2222,7 +2226,7 @@ var require_bool = __commonJS(function(exports) {
2222
2226
  });
2223
2227
 
2224
2228
  // node_modules/yaml/dist/stringify/stringifyNumber.js
2225
- var require_stringifyNumber = __commonJS(function(exports) {
2229
+ var require_stringifyNumber = __commonJS((exports) => {
2226
2230
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
2227
2231
  if (typeof value === "bigint")
2228
2232
  return String(value);
@@ -2246,7 +2250,7 @@ var require_stringifyNumber = __commonJS(function(exports) {
2246
2250
  });
2247
2251
 
2248
2252
  // node_modules/yaml/dist/schema/core/float.js
2249
- var require_float = __commonJS(function(exports) {
2253
+ var require_float = __commonJS((exports) => {
2250
2254
  var Scalar = require_Scalar();
2251
2255
  var stringifyNumber = require_stringifyNumber();
2252
2256
  var floatNaN = {
@@ -2289,7 +2293,7 @@ var require_float = __commonJS(function(exports) {
2289
2293
  });
2290
2294
 
2291
2295
  // node_modules/yaml/dist/schema/core/int.js
2292
- var require_int = __commonJS(function(exports) {
2296
+ var require_int = __commonJS((exports) => {
2293
2297
  var stringifyNumber = require_stringifyNumber();
2294
2298
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
2295
2299
  var intResolve = (str, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
@@ -2331,7 +2335,7 @@ var require_int = __commonJS(function(exports) {
2331
2335
  });
2332
2336
 
2333
2337
  // node_modules/yaml/dist/schema/core/schema.js
2334
- var require_schema = __commonJS(function(exports) {
2338
+ var require_schema = __commonJS((exports) => {
2335
2339
  var map = require_map();
2336
2340
  var _null = require_null();
2337
2341
  var seq = require_seq();
@@ -2356,7 +2360,7 @@ var require_schema = __commonJS(function(exports) {
2356
2360
  });
2357
2361
 
2358
2362
  // node_modules/yaml/dist/schema/json/schema.js
2359
- var require_schema2 = __commonJS(function(exports) {
2363
+ var require_schema2 = __commonJS((exports) => {
2360
2364
  var Scalar = require_Scalar();
2361
2365
  var map = require_map();
2362
2366
  var seq = require_seq();
@@ -2420,7 +2424,7 @@ var require_schema2 = __commonJS(function(exports) {
2420
2424
  });
2421
2425
 
2422
2426
  // node_modules/yaml/dist/schema/yaml-1.1/binary.js
2423
- var require_binary = __commonJS(function(exports) {
2427
+ var require_binary = __commonJS((exports) => {
2424
2428
  var node_buffer = __require("buffer");
2425
2429
  var Scalar = require_Scalar();
2426
2430
  var stringifyString = require_stringifyString();
@@ -2475,7 +2479,7 @@ var require_binary = __commonJS(function(exports) {
2475
2479
  });
2476
2480
 
2477
2481
  // node_modules/yaml/dist/schema/yaml-1.1/pairs.js
2478
- var require_pairs = __commonJS(function(exports) {
2482
+ var require_pairs = __commonJS((exports) => {
2479
2483
  var identity = require_identity();
2480
2484
  var Pair = require_Pair();
2481
2485
  var Scalar = require_Scalar();
@@ -2508,8 +2512,8 @@ ${cn.comment}` : item.comment;
2508
2512
  }
2509
2513
  function createPairs(schema, iterable, ctx) {
2510
2514
  const { replacer } = ctx;
2511
- const pairs = new YAMLSeq.YAMLSeq(schema);
2512
- pairs.tag = "tag:yaml.org,2002:pairs";
2515
+ const pairs2 = new YAMLSeq.YAMLSeq(schema);
2516
+ pairs2.tag = "tag:yaml.org,2002:pairs";
2513
2517
  let i = 0;
2514
2518
  if (iterable && Symbol.iterator in Object(iterable))
2515
2519
  for (let it of iterable) {
@@ -2533,9 +2537,9 @@ ${cn.comment}` : item.comment;
2533
2537
  } else {
2534
2538
  key = it;
2535
2539
  }
2536
- pairs.items.push(Pair.createPair(key, value, ctx));
2540
+ pairs2.items.push(Pair.createPair(key, value, ctx));
2537
2541
  }
2538
- return pairs;
2542
+ return pairs2;
2539
2543
  }
2540
2544
  var pairs = {
2541
2545
  collection: "seq",
@@ -2550,7 +2554,7 @@ ${cn.comment}` : item.comment;
2550
2554
  });
2551
2555
 
2552
2556
  // node_modules/yaml/dist/schema/yaml-1.1/omap.js
2553
- var require_omap = __commonJS(function(exports) {
2557
+ var require_omap = __commonJS((exports) => {
2554
2558
  var identity = require_identity();
2555
2559
  var toJS = require_toJS();
2556
2560
  var YAMLMap = require_YAMLMap();
@@ -2589,9 +2593,9 @@ var require_omap = __commonJS(function(exports) {
2589
2593
  }
2590
2594
  static from(schema, iterable, ctx) {
2591
2595
  const pairs$1 = pairs.createPairs(schema, iterable, ctx);
2592
- const omap = new this;
2593
- omap.items = pairs$1.items;
2594
- return omap;
2596
+ const omap2 = new this;
2597
+ omap2.items = pairs$1.items;
2598
+ return omap2;
2595
2599
  }
2596
2600
  }
2597
2601
  YAMLOMap.tag = "tag:yaml.org,2002:omap";
@@ -2622,7 +2626,7 @@ var require_omap = __commonJS(function(exports) {
2622
2626
  });
2623
2627
 
2624
2628
  // node_modules/yaml/dist/schema/yaml-1.1/bool.js
2625
- var require_bool2 = __commonJS(function(exports) {
2629
+ var require_bool2 = __commonJS((exports) => {
2626
2630
  var Scalar = require_Scalar();
2627
2631
  function boolStringify({ value, source }, ctx) {
2628
2632
  const boolObj = value ? trueTag : falseTag;
@@ -2651,7 +2655,7 @@ var require_bool2 = __commonJS(function(exports) {
2651
2655
  });
2652
2656
 
2653
2657
  // node_modules/yaml/dist/schema/yaml-1.1/float.js
2654
- var require_float2 = __commonJS(function(exports) {
2658
+ var require_float2 = __commonJS((exports) => {
2655
2659
  var Scalar = require_Scalar();
2656
2660
  var stringifyNumber = require_stringifyNumber();
2657
2661
  var floatNaN = {
@@ -2697,7 +2701,7 @@ var require_float2 = __commonJS(function(exports) {
2697
2701
  });
2698
2702
 
2699
2703
  // node_modules/yaml/dist/schema/yaml-1.1/int.js
2700
- var require_int2 = __commonJS(function(exports) {
2704
+ var require_int2 = __commonJS((exports) => {
2701
2705
  var stringifyNumber = require_stringifyNumber();
2702
2706
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
2703
2707
  function intResolve(str, offset, radix, { intAsBigInt }) {
@@ -2717,8 +2721,8 @@ var require_int2 = __commonJS(function(exports) {
2717
2721
  str = `0x${str}`;
2718
2722
  break;
2719
2723
  }
2720
- const n = BigInt(str);
2721
- return sign === "-" ? BigInt(-1) * n : n;
2724
+ const n2 = BigInt(str);
2725
+ return sign === "-" ? BigInt(-1) * n2 : n2;
2722
2726
  }
2723
2727
  const n = parseInt(str, radix);
2724
2728
  return sign === "-" ? -1 * n : n;
@@ -2773,7 +2777,7 @@ var require_int2 = __commonJS(function(exports) {
2773
2777
  });
2774
2778
 
2775
2779
  // node_modules/yaml/dist/schema/yaml-1.1/set.js
2776
- var require_set = __commonJS(function(exports) {
2780
+ var require_set = __commonJS((exports) => {
2777
2781
  var identity = require_identity();
2778
2782
  var Pair = require_Pair();
2779
2783
  var YAMLMap = require_YAMLMap();
@@ -2822,14 +2826,14 @@ var require_set = __commonJS(function(exports) {
2822
2826
  }
2823
2827
  static from(schema, iterable, ctx) {
2824
2828
  const { replacer } = ctx;
2825
- const set = new this(schema);
2829
+ const set2 = new this(schema);
2826
2830
  if (iterable && Symbol.iterator in Object(iterable))
2827
2831
  for (let value of iterable) {
2828
2832
  if (typeof replacer === "function")
2829
2833
  value = replacer.call(iterable, value, value);
2830
- set.items.push(Pair.createPair(value, null, ctx));
2834
+ set2.items.push(Pair.createPair(value, null, ctx));
2831
2835
  }
2832
- return set;
2836
+ return set2;
2833
2837
  }
2834
2838
  }
2835
2839
  YAMLSet.tag = "tag:yaml.org,2002:set";
@@ -2856,13 +2860,13 @@ var require_set = __commonJS(function(exports) {
2856
2860
  });
2857
2861
 
2858
2862
  // node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
2859
- var require_timestamp = __commonJS(function(exports) {
2863
+ var require_timestamp = __commonJS((exports) => {
2860
2864
  var stringifyNumber = require_stringifyNumber();
2861
2865
  function parseSexagesimal(str, asBigInt) {
2862
2866
  const sign = str[0];
2863
2867
  const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
2864
2868
  const num = (n) => asBigInt ? BigInt(n) : Number(n);
2865
- const res = parts.replace(/_/g, "").split(":").reduce((res, p) => res * num(60) + num(p), num(0));
2869
+ const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
2866
2870
  return sign === "-" ? num(-1) * res : res;
2867
2871
  }
2868
2872
  function stringifySexagesimal(node) {
@@ -2938,7 +2942,7 @@ var require_timestamp = __commonJS(function(exports) {
2938
2942
  });
2939
2943
 
2940
2944
  // node_modules/yaml/dist/schema/yaml-1.1/schema.js
2941
- var require_schema3 = __commonJS(function(exports) {
2945
+ var require_schema3 = __commonJS((exports) => {
2942
2946
  var map = require_map();
2943
2947
  var _null = require_null();
2944
2948
  var seq = require_seq();
@@ -2979,7 +2983,7 @@ var require_schema3 = __commonJS(function(exports) {
2979
2983
  });
2980
2984
 
2981
2985
  // node_modules/yaml/dist/schema/tags.js
2982
- var require_tags = __commonJS(function(exports) {
2986
+ var require_tags = __commonJS((exports) => {
2983
2987
  var map = require_map();
2984
2988
  var _null = require_null();
2985
2989
  var seq = require_seq();
@@ -3053,16 +3057,16 @@ var require_tags = __commonJS(function(exports) {
3053
3057
  }
3054
3058
  if (addMergeTag)
3055
3059
  tags = tags.concat(merge.merge);
3056
- return tags.reduce((tags, tag) => {
3060
+ return tags.reduce((tags2, tag) => {
3057
3061
  const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
3058
3062
  if (!tagObj) {
3059
3063
  const tagName = JSON.stringify(tag);
3060
3064
  const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
3061
3065
  throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
3062
3066
  }
3063
- if (!tags.includes(tagObj))
3064
- tags.push(tagObj);
3065
- return tags;
3067
+ if (!tags2.includes(tagObj))
3068
+ tags2.push(tagObj);
3069
+ return tags2;
3066
3070
  }, []);
3067
3071
  }
3068
3072
  exports.coreKnownTags = coreKnownTags;
@@ -3070,7 +3074,7 @@ var require_tags = __commonJS(function(exports) {
3070
3074
  });
3071
3075
 
3072
3076
  // node_modules/yaml/dist/schema/Schema.js
3073
- var require_Schema = __commonJS(function(exports) {
3077
+ var require_Schema = __commonJS((exports) => {
3074
3078
  var identity = require_identity();
3075
3079
  var map = require_map();
3076
3080
  var seq = require_seq();
@@ -3100,7 +3104,7 @@ var require_Schema = __commonJS(function(exports) {
3100
3104
  });
3101
3105
 
3102
3106
  // node_modules/yaml/dist/stringify/stringifyDocument.js
3103
- var require_stringifyDocument = __commonJS(function(exports) {
3107
+ var require_stringifyDocument = __commonJS((exports) => {
3104
3108
  var identity = require_identity();
3105
3109
  var stringify = require_stringify();
3106
3110
  var stringifyComment = require_stringifyComment();
@@ -3180,7 +3184,7 @@ var require_stringifyDocument = __commonJS(function(exports) {
3180
3184
  });
3181
3185
 
3182
3186
  // node_modules/yaml/dist/doc/Document.js
3183
- var require_Document = __commonJS(function(exports) {
3187
+ var require_Document = __commonJS((exports) => {
3184
3188
  var Alias = require_Alias();
3185
3189
  var Collection = require_Collection();
3186
3190
  var identity = require_identity();
@@ -3389,8 +3393,8 @@ var require_Document = __commonJS(function(exports) {
3389
3393
  };
3390
3394
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
3391
3395
  if (typeof onAnchor === "function")
3392
- for (const { count, res } of ctx.anchors.values())
3393
- onAnchor(res, count);
3396
+ for (const { count, res: res2 } of ctx.anchors.values())
3397
+ onAnchor(res2, count);
3394
3398
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
3395
3399
  }
3396
3400
  toJSON(jsonArg, onAnchor) {
@@ -3415,7 +3419,7 @@ var require_Document = __commonJS(function(exports) {
3415
3419
  });
3416
3420
 
3417
3421
  // node_modules/yaml/dist/errors.js
3418
- var require_errors = __commonJS(function(exports) {
3422
+ var require_errors = __commonJS((exports) => {
3419
3423
  class YAMLError extends Error {
3420
3424
  constructor(name, pos, code, message) {
3421
3425
  super();
@@ -3480,7 +3484,7 @@ ${pointer}
3480
3484
  });
3481
3485
 
3482
3486
  // node_modules/yaml/dist/compose/resolve-props.js
3483
- var require_resolve_props = __commonJS(function(exports) {
3487
+ var require_resolve_props = __commonJS((exports) => {
3484
3488
  function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
3485
3489
  let spaceBefore = false;
3486
3490
  let atNewline = startOnNewline;
@@ -3610,7 +3614,7 @@ var require_resolve_props = __commonJS(function(exports) {
3610
3614
  });
3611
3615
 
3612
3616
  // node_modules/yaml/dist/compose/util-contains-newline.js
3613
- var require_util_contains_newline = __commonJS(function(exports) {
3617
+ var require_util_contains_newline = __commonJS((exports) => {
3614
3618
  function containsNewline(key) {
3615
3619
  if (!key)
3616
3620
  return null;
@@ -3650,7 +3654,7 @@ var require_util_contains_newline = __commonJS(function(exports) {
3650
3654
  });
3651
3655
 
3652
3656
  // node_modules/yaml/dist/compose/util-flow-indent-check.js
3653
- var require_util_flow_indent_check = __commonJS(function(exports) {
3657
+ var require_util_flow_indent_check = __commonJS((exports) => {
3654
3658
  var utilContainsNewline = require_util_contains_newline();
3655
3659
  function flowIndentCheck(indent, fc, onError) {
3656
3660
  if (fc?.type === "flow-collection") {
@@ -3665,7 +3669,7 @@ var require_util_flow_indent_check = __commonJS(function(exports) {
3665
3669
  });
3666
3670
 
3667
3671
  // node_modules/yaml/dist/compose/util-map-includes.js
3668
- var require_util_map_includes = __commonJS(function(exports) {
3672
+ var require_util_map_includes = __commonJS((exports) => {
3669
3673
  var identity = require_identity();
3670
3674
  function mapIncludes(ctx, items, search) {
3671
3675
  const { uniqueKeys } = ctx.options;
@@ -3678,7 +3682,7 @@ var require_util_map_includes = __commonJS(function(exports) {
3678
3682
  });
3679
3683
 
3680
3684
  // node_modules/yaml/dist/compose/resolve-block-map.js
3681
- var require_resolve_block_map = __commonJS(function(exports) {
3685
+ var require_resolve_block_map = __commonJS((exports) => {
3682
3686
  var Pair = require_Pair();
3683
3687
  var YAMLMap = require_YAMLMap();
3684
3688
  var resolveProps = require_resolve_props();
@@ -3785,7 +3789,7 @@ var require_resolve_block_map = __commonJS(function(exports) {
3785
3789
  });
3786
3790
 
3787
3791
  // node_modules/yaml/dist/compose/resolve-block-seq.js
3788
- var require_resolve_block_seq = __commonJS(function(exports) {
3792
+ var require_resolve_block_seq = __commonJS((exports) => {
3789
3793
  var YAMLSeq = require_YAMLSeq();
3790
3794
  var resolveProps = require_resolve_props();
3791
3795
  var utilFlowIndentCheck = require_util_flow_indent_check();
@@ -3833,7 +3837,7 @@ var require_resolve_block_seq = __commonJS(function(exports) {
3833
3837
  });
3834
3838
 
3835
3839
  // node_modules/yaml/dist/compose/resolve-end.js
3836
- var require_resolve_end = __commonJS(function(exports) {
3840
+ var require_resolve_end = __commonJS((exports) => {
3837
3841
  function resolveEnd(end, offset, reqSpace, onError) {
3838
3842
  let comment = "";
3839
3843
  if (end) {
@@ -3873,7 +3877,7 @@ var require_resolve_end = __commonJS(function(exports) {
3873
3877
  });
3874
3878
 
3875
3879
  // node_modules/yaml/dist/compose/resolve-flow-collection.js
3876
- var require_resolve_flow_collection = __commonJS(function(exports) {
3880
+ var require_resolve_flow_collection = __commonJS((exports) => {
3877
3881
  var identity = require_identity();
3878
3882
  var Pair = require_Pair();
3879
3883
  var YAMLMap = require_YAMLMap();
@@ -4064,7 +4068,7 @@ var require_resolve_flow_collection = __commonJS(function(exports) {
4064
4068
  });
4065
4069
 
4066
4070
  // node_modules/yaml/dist/compose/compose-collection.js
4067
- var require_compose_collection = __commonJS(function(exports) {
4071
+ var require_compose_collection = __commonJS((exports) => {
4068
4072
  var identity = require_identity();
4069
4073
  var Scalar = require_Scalar();
4070
4074
  var YAMLMap = require_YAMLMap();
@@ -4126,7 +4130,7 @@ var require_compose_collection = __commonJS(function(exports) {
4126
4130
  });
4127
4131
 
4128
4132
  // node_modules/yaml/dist/compose/resolve-block-scalar.js
4129
- var require_resolve_block_scalar = __commonJS(function(exports) {
4133
+ var require_resolve_block_scalar = __commonJS((exports) => {
4130
4134
  var Scalar = require_Scalar();
4131
4135
  function resolveBlockScalar(ctx, scalar, onError) {
4132
4136
  const start = scalar.offset;
@@ -4144,12 +4148,12 @@ var require_resolve_block_scalar = __commonJS(function(exports) {
4144
4148
  break;
4145
4149
  }
4146
4150
  if (chompStart === 0) {
4147
- const value = header.chomp === "+" && lines.length > 0 ? `
4151
+ const value2 = header.chomp === "+" && lines.length > 0 ? `
4148
4152
  `.repeat(Math.max(1, lines.length - 1)) : "";
4149
- let end = start + header.length;
4153
+ let end2 = start + header.length;
4150
4154
  if (scalar.source)
4151
- end += scalar.source.length;
4152
- return { value, type, comment: header.comment, range: [start, end, end] };
4155
+ end2 += scalar.source.length;
4156
+ return { value: value2, type, comment: header.comment, range: [start, end2, end2] };
4153
4157
  }
4154
4158
  let trimIndent = scalar.indent + header.indent;
4155
4159
  let offset = scalar.offset + header.length;
@@ -4319,7 +4323,7 @@ var require_resolve_block_scalar = __commonJS(function(exports) {
4319
4323
  });
4320
4324
 
4321
4325
  // node_modules/yaml/dist/compose/resolve-flow-scalar.js
4322
- var require_resolve_flow_scalar = __commonJS(function(exports) {
4326
+ var require_resolve_flow_scalar = __commonJS((exports) => {
4323
4327
  var Scalar = require_Scalar();
4324
4328
  var resolveEnd = require_resolve_end();
4325
4329
  function resolveFlowScalar(scalar, strict, onError) {
@@ -4535,7 +4539,7 @@ var require_resolve_flow_scalar = __commonJS(function(exports) {
4535
4539
  });
4536
4540
 
4537
4541
  // node_modules/yaml/dist/compose/compose-scalar.js
4538
- var require_compose_scalar = __commonJS(function(exports) {
4542
+ var require_compose_scalar = __commonJS((exports) => {
4539
4543
  var identity = require_identity();
4540
4544
  var Scalar = require_Scalar();
4541
4545
  var resolveBlockScalar = require_resolve_block_scalar();
@@ -4597,9 +4601,9 @@ var require_compose_scalar = __commonJS(function(exports) {
4597
4601
  return schema[identity.SCALAR];
4598
4602
  }
4599
4603
  function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
4600
- const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR];
4604
+ const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
4601
4605
  if (schema.compat) {
4602
- const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR];
4606
+ const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
4603
4607
  if (tag.tag !== compat.tag) {
4604
4608
  const ts = directives.tagString(tag.tag);
4605
4609
  const cs = directives.tagString(compat.tag);
@@ -4613,7 +4617,7 @@ var require_compose_scalar = __commonJS(function(exports) {
4613
4617
  });
4614
4618
 
4615
4619
  // node_modules/yaml/dist/compose/util-empty-scalar-position.js
4616
- var require_util_empty_scalar_position = __commonJS(function(exports) {
4620
+ var require_util_empty_scalar_position = __commonJS((exports) => {
4617
4621
  function emptyScalarPosition(offset, before, pos) {
4618
4622
  if (before) {
4619
4623
  pos ?? (pos = before.length);
@@ -4640,7 +4644,7 @@ var require_util_empty_scalar_position = __commonJS(function(exports) {
4640
4644
  });
4641
4645
 
4642
4646
  // node_modules/yaml/dist/compose/compose-node.js
4643
- var require_compose_node = __commonJS(function(exports) {
4647
+ var require_compose_node = __commonJS((exports) => {
4644
4648
  var Alias = require_Alias();
4645
4649
  var identity = require_identity();
4646
4650
  var composeCollection = require_compose_collection();
@@ -4743,7 +4747,7 @@ var require_compose_node = __commonJS(function(exports) {
4743
4747
  });
4744
4748
 
4745
4749
  // node_modules/yaml/dist/compose/compose-doc.js
4746
- var require_compose_doc = __commonJS(function(exports) {
4750
+ var require_compose_doc = __commonJS((exports) => {
4747
4751
  var Document = require_Document();
4748
4752
  var composeNode = require_compose_node();
4749
4753
  var resolveEnd = require_resolve_end();
@@ -4783,7 +4787,7 @@ var require_compose_doc = __commonJS(function(exports) {
4783
4787
  });
4784
4788
 
4785
4789
  // node_modules/yaml/dist/compose/composer.js
4786
- var require_composer = __commonJS(function(exports) {
4790
+ var require_composer = __commonJS((exports) => {
4787
4791
  var node_process = __require("process");
4788
4792
  var directives = require_directives();
4789
4793
  var Document = require_Document();
@@ -4974,7 +4978,7 @@ ${end.comment}` : end.comment;
4974
4978
  });
4975
4979
 
4976
4980
  // node_modules/yaml/dist/parse/cst-scalar.js
4977
- var require_cst_scalar = __commonJS(function(exports) {
4981
+ var require_cst_scalar = __commonJS((exports) => {
4978
4982
  var resolveBlockScalar = require_resolve_block_scalar();
4979
4983
  var resolveFlowScalar = require_resolve_flow_scalar();
4980
4984
  var errors = require_errors();
@@ -5164,7 +5168,7 @@ var require_cst_scalar = __commonJS(function(exports) {
5164
5168
  });
5165
5169
 
5166
5170
  // node_modules/yaml/dist/parse/cst-stringify.js
5167
- var require_cst_stringify = __commonJS(function(exports) {
5171
+ var require_cst_stringify = __commonJS((exports) => {
5168
5172
  var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
5169
5173
  function stringifyToken(token) {
5170
5174
  switch (token.type) {
@@ -5222,7 +5226,7 @@ var require_cst_stringify = __commonJS(function(exports) {
5222
5226
  });
5223
5227
 
5224
5228
  // node_modules/yaml/dist/parse/cst-visit.js
5225
- var require_cst_visit = __commonJS(function(exports) {
5229
+ var require_cst_visit = __commonJS((exports) => {
5226
5230
  var BREAK = Symbol("break visit");
5227
5231
  var SKIP = Symbol("skip children");
5228
5232
  var REMOVE = Symbol("remove item");
@@ -5281,7 +5285,7 @@ var require_cst_visit = __commonJS(function(exports) {
5281
5285
  });
5282
5286
 
5283
5287
  // node_modules/yaml/dist/parse/cst.js
5284
- var require_cst = __commonJS(function(exports) {
5288
+ var require_cst = __commonJS((exports) => {
5285
5289
  var cstScalar = require_cst_scalar();
5286
5290
  var cstStringify = require_cst_stringify();
5287
5291
  var cstVisit = require_cst_visit();
@@ -5382,7 +5386,7 @@ var require_cst = __commonJS(function(exports) {
5382
5386
  });
5383
5387
 
5384
5388
  // node_modules/yaml/dist/parse/lexer.js
5385
- var require_lexer = __commonJS(function(exports) {
5389
+ var require_lexer = __commonJS((exports) => {
5386
5390
  var cst = require_cst();
5387
5391
  function isEmpty(ch) {
5388
5392
  switch (ch) {
@@ -5755,18 +5759,18 @@ var require_lexer = __commonJS(function(exports) {
5755
5759
  let indent = 0;
5756
5760
  let ch;
5757
5761
  loop:
5758
- for (let i = this.pos;ch = this.buffer[i]; ++i) {
5762
+ for (let i2 = this.pos;ch = this.buffer[i2]; ++i2) {
5759
5763
  switch (ch) {
5760
5764
  case " ":
5761
5765
  indent += 1;
5762
5766
  break;
5763
5767
  case `
5764
5768
  `:
5765
- nl = i;
5769
+ nl = i2;
5766
5770
  indent = 0;
5767
5771
  break;
5768
5772
  case "\r": {
5769
- const next = this.buffer[i + 1];
5773
+ const next = this.buffer[i2 + 1];
5770
5774
  if (!next && !this.atEnd)
5771
5775
  return this.setNext("block-scalar");
5772
5776
  if (next === `
@@ -5809,16 +5813,16 @@ var require_lexer = __commonJS(function(exports) {
5809
5813
  nl = i - 1;
5810
5814
  } else if (!this.blockScalarKeep) {
5811
5815
  do {
5812
- let i = nl - 1;
5813
- let ch = this.buffer[i];
5814
- if (ch === "\r")
5815
- ch = this.buffer[--i];
5816
- const lastChar = i;
5817
- while (ch === " ")
5818
- ch = this.buffer[--i];
5819
- if (ch === `
5820
- ` && i >= this.pos && i + 1 + indent > lastChar)
5821
- nl = i;
5816
+ let i2 = nl - 1;
5817
+ let ch2 = this.buffer[i2];
5818
+ if (ch2 === "\r")
5819
+ ch2 = this.buffer[--i2];
5820
+ const lastChar = i2;
5821
+ while (ch2 === " ")
5822
+ ch2 = this.buffer[--i2];
5823
+ if (ch2 === `
5824
+ ` && i2 >= this.pos && i2 + 1 + indent > lastChar)
5825
+ nl = i2;
5822
5826
  else
5823
5827
  break;
5824
5828
  } while (true);
@@ -5979,7 +5983,7 @@ var require_lexer = __commonJS(function(exports) {
5979
5983
  });
5980
5984
 
5981
5985
  // node_modules/yaml/dist/parse/line-counter.js
5982
- var require_line_counter = __commonJS(function(exports) {
5986
+ var require_line_counter = __commonJS((exports) => {
5983
5987
  class LineCounter {
5984
5988
  constructor() {
5985
5989
  this.lineStarts = [];
@@ -6007,7 +6011,7 @@ var require_line_counter = __commonJS(function(exports) {
6007
6011
  });
6008
6012
 
6009
6013
  // node_modules/yaml/dist/parse/parser.js
6010
- var require_parser = __commonJS(function(exports) {
6014
+ var require_parser = __commonJS((exports) => {
6011
6015
  var node_process = __require("process");
6012
6016
  var cst = require_cst();
6013
6017
  var lexer = require_lexer();
@@ -6505,12 +6509,12 @@ var require_parser = __commonJS(function(exports) {
6505
6509
  if (includesToken(it.start, "newline")) {
6506
6510
  Object.assign(it, { key: null, sep: [this.sourceToken] });
6507
6511
  } else {
6508
- const start = getFirstKeyStartProps(it.start);
6512
+ const start2 = getFirstKeyStartProps(it.start);
6509
6513
  this.stack.push({
6510
6514
  type: "block-map",
6511
6515
  offset: this.offset,
6512
6516
  indent: this.indent,
6513
- items: [{ start, key: null, sep: [this.sourceToken] }]
6517
+ items: [{ start: start2, key: null, sep: [this.sourceToken] }]
6514
6518
  });
6515
6519
  }
6516
6520
  } else if (it.value) {
@@ -6523,7 +6527,7 @@ var require_parser = __commonJS(function(exports) {
6523
6527
  items: [{ start, key: null, sep: [this.sourceToken] }]
6524
6528
  });
6525
6529
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
6526
- const start = getFirstKeyStartProps(it.start);
6530
+ const start2 = getFirstKeyStartProps(it.start);
6527
6531
  const key = it.key;
6528
6532
  const sep = it.sep;
6529
6533
  sep.push(this.sourceToken);
@@ -6533,7 +6537,7 @@ var require_parser = __commonJS(function(exports) {
6533
6537
  type: "block-map",
6534
6538
  offset: this.offset,
6535
6539
  indent: this.indent,
6536
- items: [{ start, key, sep }]
6540
+ items: [{ start: start2, key, sep }]
6537
6541
  });
6538
6542
  } else if (start.length > 0) {
6539
6543
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -6863,7 +6867,7 @@ var require_parser = __commonJS(function(exports) {
6863
6867
  });
6864
6868
 
6865
6869
  // node_modules/yaml/dist/public-api.js
6866
- var require_public_api = __commonJS(function(exports) {
6870
+ var require_public_api = __commonJS((exports) => {
6867
6871
  var composer = require_composer();
6868
6872
  var Document = require_Document();
6869
6873
  var errors = require_errors();
@@ -6877,22 +6881,22 @@ var require_public_api = __commonJS(function(exports) {
6877
6881
  return { lineCounter: lineCounter$1, prettyErrors };
6878
6882
  }
6879
6883
  function parseAllDocuments(source, options = {}) {
6880
- const { lineCounter, prettyErrors } = parseOptions(options);
6881
- const parser$1 = new parser.Parser(lineCounter?.addNewLine);
6884
+ const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
6885
+ const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
6882
6886
  const composer$1 = new composer.Composer(options);
6883
6887
  const docs = Array.from(composer$1.compose(parser$1.parse(source)));
6884
- if (prettyErrors && lineCounter)
6888
+ if (prettyErrors && lineCounter2)
6885
6889
  for (const doc of docs) {
6886
- doc.errors.forEach(errors.prettifyError(source, lineCounter));
6887
- doc.warnings.forEach(errors.prettifyError(source, lineCounter));
6890
+ doc.errors.forEach(errors.prettifyError(source, lineCounter2));
6891
+ doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
6888
6892
  }
6889
6893
  if (docs.length > 0)
6890
6894
  return docs;
6891
6895
  return Object.assign([], { empty: true }, composer$1.streamInfo());
6892
6896
  }
6893
6897
  function parseDocument(source, options = {}) {
6894
- const { lineCounter, prettyErrors } = parseOptions(options);
6895
- const parser$1 = new parser.Parser(lineCounter?.addNewLine);
6898
+ const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
6899
+ const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
6896
6900
  const composer$1 = new composer.Composer(options);
6897
6901
  let doc = null;
6898
6902
  for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
@@ -6903,9 +6907,9 @@ var require_public_api = __commonJS(function(exports) {
6903
6907
  break;
6904
6908
  }
6905
6909
  }
6906
- if (prettyErrors && lineCounter) {
6907
- doc.errors.forEach(errors.prettifyError(source, lineCounter));
6908
- doc.warnings.forEach(errors.prettifyError(source, lineCounter));
6910
+ if (prettyErrors && lineCounter2) {
6911
+ doc.errors.forEach(errors.prettifyError(source, lineCounter2));
6912
+ doc.warnings.forEach(errors.prettifyError(source, lineCounter2));
6909
6913
  }
6910
6914
  return doc;
6911
6915
  }
@@ -7423,6 +7427,20 @@ var init_workflows = __esm(() => {
7423
7427
  });
7424
7428
 
7425
7429
  // src/core.ts
7430
+ var exports_core = {};
7431
+ __export(exports_core, {
7432
+ selectPacks: () => selectPacks,
7433
+ parseHarness: () => parseHarness,
7434
+ parseConfig: () => parseConfig,
7435
+ parseCatalog: () => parseCatalog,
7436
+ installedVersion: () => installedVersion,
7437
+ installArgs: () => installArgs,
7438
+ identity: () => identity2,
7439
+ harnesses: () => harnesses,
7440
+ fetchCatalog: () => fetchCatalog,
7441
+ compatibilitySetupMessage: () => compatibilitySetupMessage,
7442
+ catalogChanges: () => catalogChanges
7443
+ });
7426
7444
  import { resolve } from "path";
7427
7445
  function compatibilitySetupMessage(harness) {
7428
7446
  return harness === "hermes" ? undefined : harnesses[harness].setup;
@@ -7676,8 +7694,8 @@ var skills_default = {
7676
7694
  id: "defi-yield-skills",
7677
7695
  source: "galleonlabs/crypto-defi-skills",
7678
7696
  description: "Evaluate vaults and yield tokens, including liquidity and maturity.",
7679
- version: "0.2.1",
7680
- revision: "9fe67c24efc0fd5796066605b29576f3b8f2de94",
7697
+ version: "0.3.0",
7698
+ revision: "27960db6bc3dfd4e3264b73232a0196dd845c37c",
7681
7699
  skills: [
7682
7700
  "galleon-defi-yield",
7683
7701
  "galleon-pendle-maturity",
@@ -7818,7 +7836,7 @@ var skills_default = {
7818
7836
  // package.json
7819
7837
  var package_default = {
7820
7838
  name: "boomkin",
7821
- version: "0.11.0",
7839
+ version: "0.12.0",
7822
7840
  description: "Your open-source DeFi desk: native Hermes research projects, verifiable evidence and independent financial skills.",
7823
7841
  type: "module",
7824
7842
  license: "MIT",
@@ -7840,8 +7858,8 @@ var package_default = {
7840
7858
  },
7841
7859
  devDependencies: {
7842
7860
  "@types/bun": "1.4.2",
7843
- marked: "16.4.0",
7844
- typescript: "5.9.3"
7861
+ marked: "18.1.0",
7862
+ typescript: "7.0.2"
7845
7863
  },
7846
7864
  bin: {
7847
7865
  boomkin: "dist/cli.js"
@@ -7924,10 +7942,10 @@ async function packageDirectory(pack, checkout) {
7924
7942
  const manifest = JSON.parse(await readFile(join(path, "package.json"), "utf8"));
7925
7943
  if (manifest.name !== pack.package || manifest.version !== pack.version)
7926
7944
  throw new Error(`Package release metadata mismatch: ${pack.id}`);
7927
- await Promise.resolve().then(() => init_core());
7945
+ const { installedVersion: installedVersion2 } = await Promise.resolve().then(() => (init_core(), exports_core));
7928
7946
  for (const skill of pack.skills) {
7929
7947
  const text = await readFile(join(path, "skills", skill, "SKILL.md"), "utf8");
7930
- if (installedVersion(text) !== pack.version)
7948
+ if (installedVersion2(text) !== pack.version)
7931
7949
  throw new Error(`Source skill version mismatch: ${skill}`);
7932
7950
  }
7933
7951
  return path;
@@ -8041,8 +8059,8 @@ function hermesModelConfigured(config) {
8041
8059
  const flatten = (value) => {
8042
8060
  if (!object(value))
8043
8061
  return value;
8044
- const id = value.model || value.default;
8045
- return typeof id === "string" ? id.trim() : id;
8062
+ const id2 = value.model || value.default;
8063
+ return typeof id2 === "string" ? id2.trim() : id2;
8046
8064
  };
8047
8065
  const id = flatten(model.default) || flatten(model.model) || flatten(model.name);
8048
8066
  return typeof id === "string" && !!id.trim();
@@ -8158,9 +8176,9 @@ async function ensureRuntime(directory, options) {
8158
8176
  const installed = await findRuntime(root);
8159
8177
  if (!installed || !installed.startsWith(runtime + "/"))
8160
8178
  throw new Error("The installer completed without a usable profile-managed Hermes executable");
8161
- const git = Bun.spawn(["git", "-C", runtime, "rev-parse", "HEAD"], { stdout: "pipe", stderr: "ignore" });
8162
- const revision = (await new Response(git.stdout).text()).trim();
8163
- if (await git.exited !== 0 || revision !== HERMES_COMMIT)
8179
+ const git2 = Bun.spawn(["git", "-C", runtime, "rev-parse", "HEAD"], { stdout: "pipe", stderr: "ignore" });
8180
+ const revision = (await new Response(git2.stdout).text()).trim();
8181
+ if (await git2.exited !== 0 || revision !== HERMES_COMMIT)
8164
8182
  throw new Error("Hermes installed revision differs from the reviewed pin. Existing runtime was preserved; review it before continuing.");
8165
8183
  if (!(await localProfileStatus(root)).runtime.available)
8166
8184
  throw new Error("Installed Hermes cannot report its version; runtime readiness is incomplete");
@@ -8169,12 +8187,12 @@ async function ensureRuntime(directory, options) {
8169
8187
  await rm(path, { force: true });
8170
8188
  }
8171
8189
  }
8172
- async function initializeProfile(directory, identity) {
8190
+ async function initializeProfile(directory, identity3) {
8173
8191
  const root = await profilePath(directory);
8174
8192
  await mkdir(root, { recursive: true, mode: 448 });
8175
8193
  await safePath(join(root, "SOUL.md"));
8176
8194
  try {
8177
- await writeFile(join(root, "SOUL.md"), identity, { flag: "wx", mode: 384 });
8195
+ await writeFile(join(root, "SOUL.md"), identity3, { flag: "wx", mode: 384 });
8178
8196
  return { createdSoul: true };
8179
8197
  } catch (error) {
8180
8198
  if (error.code === "EEXIST")
@@ -8203,7 +8221,7 @@ async function configureMcpServers(directory, servers) {
8203
8221
  for (const [name, server] of Object.entries(servers)) {
8204
8222
  if (!/^[a-z][a-z0-9_-]*$/.test(name))
8205
8223
  throw new Error("Invalid MCP server name");
8206
- if (server.trust !== "untrusted" || !Array.isArray(server.tools?.include) || server.tools.include.some((name) => !name || /[*?\[\]]/.test(name)) || server.tools.resources !== false || server.tools.prompts !== false)
8224
+ if (server.trust !== "untrusted" || !Array.isArray(server.tools?.include) || server.tools.include.some((name2) => !name2 || /[*?\[\]]/.test(name2)) || server.tools.resources !== false || server.tools.prompts !== false)
8207
8225
  throw new Error("Boomkin MCP setup requires untrusted servers, explicit tool names, and disabled resource/prompt utilities");
8208
8226
  if (Boolean(server.url) === Boolean(server.command))
8209
8227
  throw new Error("Choose one MCP transport");
@@ -11571,6 +11589,250 @@ import { lstat as lstat4, mkdir as mkdir3, readFile as readFile5, rename as rena
11571
11589
  import { join as join5, resolve as resolve5 } from "path";
11572
11590
  import { pathToFileURL } from "url";
11573
11591
  init_core();
11592
+
11593
+ // src/desk-comparison.ts
11594
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
11595
+ var at = (value, ...path) => path.reduce((next, key) => record(next)[key], value);
11596
+ var list2 = (value) => Array.isArray(value) ? value : [];
11597
+ var strings = (value) => list2(value).filter((item) => typeof item === "string");
11598
+ var time = (value) => typeof value === "string" && Number.isFinite(Date.parse(value)) ? Date.parse(value) : NaN;
11599
+ var hash = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
11600
+ var number = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
11601
+ var display = (value) => value === null || !Number.isFinite(value) ? null : String(Object.is(value, -0) ? 0 : value);
11602
+ function stable(value) {
11603
+ if (Array.isArray(value))
11604
+ return `[${value.map(stable).join(",")}]`;
11605
+ if (value !== null && typeof value === "object")
11606
+ return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stable(record(value)[key])}`).join(",")}}`;
11607
+ return JSON.stringify(value);
11608
+ }
11609
+ function sourceKey(value) {
11610
+ const item = record(value);
11611
+ if (typeof item.id !== "string" || !/^[a-z0-9][a-z0-9-]{0,62}$/.test(item.id) || typeof item.source !== "string")
11612
+ return null;
11613
+ try {
11614
+ const url = new URL(item.source);
11615
+ if (!item.id || !["https:", "http:"].includes(url.protocol) || url.username || url.password)
11616
+ return null;
11617
+ url.hash = "";
11618
+ url.searchParams.sort();
11619
+ return `${item.id} \xB7 ${url.href}`;
11620
+ } catch {
11621
+ return null;
11622
+ }
11623
+ }
11624
+ function decimal(value) {
11625
+ if (typeof value !== "string" || !/^-?\d{1,60}(?:\.\d{1,36})?$/.test(value))
11626
+ return null;
11627
+ const [whole, fraction = ""] = value.split(".");
11628
+ const units = BigInt(whole + fraction), scale = fraction.length;
11629
+ return { units, scale, text: decimalText(units, scale) };
11630
+ }
11631
+ function decimalText(units, scale) {
11632
+ const digits = (units < 0n ? -units : units).toString().padStart(scale + 1, "0");
11633
+ const value = scale ? `${digits.slice(0, -scale)}.${digits.slice(-scale)}`.replace(/\.?0+$/, "") : digits;
11634
+ return `${units < 0n ? "-" : ""}${value}`;
11635
+ }
11636
+ function walletRow(id, label, before, after, note) {
11637
+ const a = decimal(before), b = decimal(after), scale = Math.max(a?.scale ?? 0, b?.scale ?? 0);
11638
+ return {
11639
+ id,
11640
+ label,
11641
+ unit: "USDC",
11642
+ before: a?.text ?? null,
11643
+ after: b?.text ?? null,
11644
+ delta: a && b ? decimalText(b.units * 10n ** BigInt(scale - b.scale) - a.units * 10n ** BigInt(scale - a.scale), scale) : null,
11645
+ changePct: null,
11646
+ note: a && b ? note : `${note} Missing or invalid amounts remain unavailable.`
11647
+ };
11648
+ }
11649
+ function numericRow(id, label, unit, before, after, comparable, note, relative2 = false) {
11650
+ const a = number(before), b = number(after), delta = comparable && a !== null && b !== null ? b - a : null;
11651
+ return {
11652
+ id,
11653
+ label,
11654
+ unit,
11655
+ before: display(a),
11656
+ after: display(b),
11657
+ delta: display(delta),
11658
+ changePct: relative2 && delta !== null && a !== null && a > 0 ? display(delta / a * 100) : null,
11659
+ note: a === null || b === null ? `${note} Missing or invalid values remain unavailable.` : note
11660
+ };
11661
+ }
11662
+ function compareDeskRuns(kind, before, after) {
11663
+ const select = ({ id, createdAt, state }) => ({ id, createdAt, state });
11664
+ const output = { schemaVersion: 1, kind, status: "unavailable", summary: "These runs cannot be compared.", baseline: select(before.run), current: select(after.run), sections: [], notes: [], issues: [], sourceChanges: { added: [], removed: [], changed: [] } };
11665
+ if (before.run.id === after.run.id || !(time(before.run.createdAt) < time(after.run.createdAt)))
11666
+ output.issues.push("Choose a different baseline run captured before the current run.");
11667
+ if (before.run.project !== after.run.project || before.run.kind !== kind || after.run.kind !== kind)
11668
+ output.issues.push("Runs must belong to the same project and research kind.");
11669
+ if (stable(before.inputs) !== stable(after.inputs))
11670
+ output.issues.push("Saved research inputs differ; comparisons require the same question and scope.");
11671
+ if (!before.packRevision || before.packRevision !== after.packRevision)
11672
+ output.issues.push("Installed helper revisions differ or are missing; recapture both runs with the same helper revision.");
11673
+ for (const [label, snapshot] of [["Baseline", before], ["Current", after]]) {
11674
+ if (snapshot.run.execution || !["complete", "partial"].includes(snapshot.run.state))
11675
+ output.issues.push(`${label}: only completed deterministic captures can be compared; native or unfinished runs are unavailable.`);
11676
+ if (snapshot.resultVerified !== true)
11677
+ output.issues.push(`${label}: this saved result has no verified result digest. Recapture the research to create a comparable run; legacy results remain readable.`);
11678
+ if (!Array.isArray(snapshot.integrityIssues) || snapshot.integrityIssues.some((issue) => typeof issue !== "string"))
11679
+ output.issues.push(`${label}: integrity validation is unavailable.`);
11680
+ output.issues.push(...strings(snapshot.integrityIssues).map((issue) => `${label}: ${issue}`));
11681
+ }
11682
+ if (output.issues.length)
11683
+ return finish(output);
11684
+ const indexes = [];
11685
+ for (const [label, snapshot] of [["Baseline", before], ["Current", after]]) {
11686
+ const index = new Map;
11687
+ if (!Array.isArray(snapshot.evidence) || !snapshot.evidence.length)
11688
+ output.issues.push(`${label}: captured source evidence is missing or malformed.`);
11689
+ for (const value of list2(snapshot.evidence)) {
11690
+ const item = record(value);
11691
+ const key = sourceKey(item);
11692
+ if (!key || !hash(item.sha256) || index.has(key) || !Array.isArray(item.limitations) || item.limitations.some((note) => typeof note !== "string"))
11693
+ output.issues.push(`${label}: captured source identity, digest or limitations are missing, malformed or duplicated.`);
11694
+ else
11695
+ index.set(key, item.sha256);
11696
+ output.notes.push(...strings(item.limitations).map((note) => `${label} source: ${note}`));
11697
+ }
11698
+ indexes.push(index);
11699
+ output.notes.push(...strings(at(snapshot.result, "limitations")).map((note) => `${label}: ${note}`));
11700
+ output.notes.push(`${label} captured ${snapshot.run.createdAt}${snapshot.run.finishedAt ? `; finished ${snapshot.run.finishedAt}` : ""}.`);
11701
+ }
11702
+ if (output.issues.length)
11703
+ return finish(output);
11704
+ const [oldSources, newSources] = indexes;
11705
+ output.sourceChanges = {
11706
+ added: [...newSources.keys()].filter((key) => !oldSources.has(key)).sort(),
11707
+ removed: [...oldSources.keys()].filter((key) => !newSources.has(key)).sort(),
11708
+ changed: [...newSources.keys()].filter((key) => oldSources.has(key) && oldSources.get(key) !== newSources.get(key)).sort()
11709
+ };
11710
+ output.notes.push("Source changes compare captured bytes by artifact identity and source URL; a new retrieval time alone is not market movement. Hashes verify saved bytes, not provider truth.");
11711
+ if (output.issues.length)
11712
+ return finish(output);
11713
+ if (kind === "market")
11714
+ market(output, before, after);
11715
+ if (kind === "wallet")
11716
+ wallet(output, before, after);
11717
+ if (kind === "strategy")
11718
+ strategy(output, before, after);
11719
+ const rows = output.sections.flatMap((section) => section.rows), valid = rows.some((row) => row.before !== null || row.after !== null);
11720
+ output.status = !valid ? "unavailable" : output.issues.length || rows.some((row) => row.delta === null) || before.run.state === "partial" || after.run.state === "partial" ? "limited" : "compared";
11721
+ output.summary = output.status === "compared" ? "Saved observations compared within the same research scope." : output.status === "limited" ? rows.some((row) => row.delta !== null) ? "Some saved observations are comparable; read the gaps and limitations below." : "Saved values are shown, but their changes cannot be compared." : "No comparable observations are available in these saved runs.";
11722
+ return finish(output);
11723
+ }
11724
+ function finish(output) {
11725
+ output.notes = [...new Set(output.notes)];
11726
+ output.issues = [...new Set(output.issues)];
11727
+ return output;
11728
+ }
11729
+ function market(output, before, after) {
11730
+ function observations(snapshot) {
11731
+ const rows2 = new Map;
11732
+ const age = number(at(snapshot.result, "parameters", "maxAgeSeconds")) ?? 300;
11733
+ for (const read of list2(at(snapshot.result, "reads")))
11734
+ for (const row of list2(at(read, "observations"))) {
11735
+ const provider = at(read, "provider"), identity3 = at(row, "identity");
11736
+ if (typeof provider !== "string" || !["coingecko", "defillama"].includes(provider) || at(row, "provider") !== provider || at(identity3, "namespace") !== "coingecko" || at(identity3, "id") !== snapshot.inputs.asset) {
11737
+ output.issues.push("A market observation has an unsupported provider or mismatched CoinGecko identity.");
11738
+ continue;
11739
+ }
11740
+ const key = String(provider), observed = time(at(row, "observedAt")), retrieved = time(at(row, "retrievedAt"));
11741
+ const price = number(at(row, "priceUsd")), delay = (retrieved - observed) / 1000;
11742
+ const valid = at(row, "ok") === true && at(row, "unit") === "USD" && price !== null && price >= 0.000000000001 && price <= 1000000000000 && delay >= -60 && delay <= age && age >= 1 && age <= 86400;
11743
+ const note = valid ? `Observed ${at(row, "observedAt")}; retrieved ${at(row, "retrievedAt")}.` : `Unavailable: ${typeof at(row, "error") === "string" ? at(row, "error") : "missing, stale or invalid observation"}.`;
11744
+ if (rows2.has(key)) {
11745
+ output.issues.push(`Duplicate ${key} observations cannot be matched reliably.`);
11746
+ rows2.set(key, { value: null, observed: NaN, note: "Duplicate source observations." });
11747
+ } else
11748
+ rows2.set(key, { value: valid ? price : null, observed, note });
11749
+ }
11750
+ return rows2;
11751
+ }
11752
+ const a = observations(before), b = observations(after);
11753
+ const rows = [...new Set([...a.keys(), ...b.keys()])].sort().map((provider) => {
11754
+ const old = a.get(provider), current = b.get(provider), newer = !!old && !!current && old.observed < current.observed;
11755
+ const chronology = !old || !current ? "Source missing in one run." : !newer ? "Provider timestamp is cached, reversed or unavailable; no price movement is inferred." : "Change is between provider observations, not a portfolio return.";
11756
+ return numericRow(provider, provider === "coingecko" ? "CoinGecko USD mark" : "DefiLlama USD mark", "USD", old?.value, current?.value, newer, `Baseline: ${old?.note ?? "unavailable"} Current: ${current?.note ?? "unavailable"} ${chronology}`, true);
11757
+ });
11758
+ output.sections.push({ title: "Market observations", description: "Same provider and exact CoinGecko asset identity. Missing and stale marks remain unavailable.", rows });
11759
+ output.notes.push("Aggregate marks are not executable quotes. Providers may share upstream data; agreement does not establish independent corroboration.");
11760
+ }
11761
+ function wallet(output, before, after) {
11762
+ const a = before.result, b = after.result;
11763
+ for (const snapshot of [before, after]) {
11764
+ const scope = at(snapshot.result, "scope"), input = snapshot.inputs;
11765
+ const address = at(scope, "address");
11766
+ if (typeof input.account !== "string" || typeof address !== "string" || address.toLowerCase() !== input.account.toLowerCase() || at(scope, "network") !== input.network || at(scope, "startTime") !== time(input.startTime) || at(scope, "endTime") !== time(input.endTime)) {
11767
+ output.issues.push("Wallet result scope does not match the saved account, network and time window.");
11768
+ return;
11769
+ }
11770
+ }
11771
+ function historyAvailable(result, type) {
11772
+ const network = at(result, "scope", "network");
11773
+ const endpoint = network === "testnet" ? "https://api.hyperliquid-testnet.xyz/info" : network === "mainnet" ? "https://api.hyperliquid.xyz/info" : null;
11774
+ return endpoint !== null && list2(at(result, "evidence", "entries")).some((entry) => at(entry, "type") === type && at(entry, "endpoint") === endpoint && at(entry, "httpStatus") === 200 && at(entry, "error") === null);
11775
+ }
11776
+ function amount(result, field) {
11777
+ const fills = historyAvailable(result, "userFillsByTime"), funding = historyAvailable(result, "userFunding");
11778
+ if (field === "fundingUsdc" ? !funding : field === "observedNetUsdc" ? !fills || !funding : !fills)
11779
+ return null;
11780
+ if (field !== "signedFeesByToken")
11781
+ return at(result, "outcome", field);
11782
+ const fees = at(result, "outcome", field);
11783
+ if (at(result, "outcome", "fillCount") === 0 && fees !== null && typeof fees === "object" && !Array.isArray(fees) && Object.keys(fees).length === 0)
11784
+ return "0";
11785
+ return at(fees, "USDC");
11786
+ }
11787
+ for (const [label, result] of [["Baseline", a], ["Current", b]]) {
11788
+ for (const type of ["userFillsByTime", "userFunding"])
11789
+ if (!historyAvailable(result, type))
11790
+ output.issues.push(`${label}: no successful ${type} history read was captured; dependent amounts are unavailable, not zero.`);
11791
+ output.notes.push(...strings(at(result, "coverage", "gaps")).map((note) => `${label} coverage: ${note}`));
11792
+ if (at(result, "coverage", "completeWindow") !== true)
11793
+ output.issues.push(`${label}: full-window history is unverified; results describe only observed activity.`);
11794
+ const observed = at(result, "exposure", "accountSnapshotTime");
11795
+ output.notes.push(`${label} exposure snapshot: ${typeof observed === "number" && Number.isFinite(observed) && !Number.isNaN(new Date(observed).getTime()) ? new Date(observed).toISOString() : "timestamp unavailable"}.`);
11796
+ }
11797
+ const accounting = "Change is revised evidence for the same historical window, not newly earned profit or a portfolio return.";
11798
+ output.sections.push({ title: "Observed wallet activity", description: accounting, rows: [
11799
+ walletRow("observed-net", "Observed net outcome", amount(a, "observedNetUsdc"), amount(b, "observedNetUsdc"), "Closed PnL minus signed fees plus signed funding; excludes unrealized PnL and unseen cashflows."),
11800
+ walletRow("closed-pnl", "Observed closed PnL", amount(a, "closedPnlUsdc"), amount(b, "closedPnlUsdc"), accounting),
11801
+ walletRow("signed-fees", "Signed USDC fees", amount(a, "signedFeesByToken"), amount(b, "signedFeesByToken"), "Positive fees are costs; negative fees are rebates. Builder fees are already included. Missing fee currencies are not assumed zero."),
11802
+ walletRow("signed-funding", "Signed funding", amount(a, "fundingUsdc"), amount(b, "fundingUsdc"), "Positive funding is received; negative funding is paid. Signed cashflow changes have no percentage-return interpretation.")
11803
+ ] });
11804
+ output.sections.push({ title: "Current exposure", description: "Sequential capture-time observations, not historical window-end balances.", rows: [walletRow("gross-exposure", "Gross default-perp exposure", at(a, "exposure", "grossNotionalUsdc"), at(b, "exposure", "grossNotionalUsdc"), "Gross notional is exposure, not account equity or profit. Stop protection is not assessed.")] });
11805
+ output.notes.push(accounting, "Default-perpetual scope only. Provider retention, page budgets and unknown opening inventory limit coverage; spot, HIP-3, transfers and unenumerated accounts prevent a complete portfolio-return claim.");
11806
+ }
11807
+ function strategy(output, before, after) {
11808
+ const a = before.result, b = after.result;
11809
+ if ([a, b].some((result) => at(result, "model") !== "daily-frozen-rule-validation-v1" || at(result, "identity", "namespace") !== "coingecko" || at(result, "identity", "id") !== before.inputs.asset)) {
11810
+ output.issues.push("Strategy result model or asset identity is unsupported or inconsistent.");
11811
+ return;
11812
+ }
11813
+ const sameHashes = ["datasetSha256", "specificationSha256", "engineSha256"].every((key) => hash(at(a, "inputHashes", key)) && at(a, "inputHashes", key) === at(b, "inputHashes", key));
11814
+ if (!sameHashes)
11815
+ output.issues.push("Dataset, specification or engine hashes changed or are missing. Values are shown for inspection; deltas are unavailable across incompatible experiments.");
11816
+ for (const period of ["reference", "heldOut"]) {
11817
+ const pa = at(a, "periods", period, "period"), pb = at(b, "periods", period, "period");
11818
+ const validPeriod = (value) => time(at(value, "firstObservation")) < time(at(value, "lastObservation")) && Number.isSafeInteger(at(value, "observations")) && Number(at(value, "observations")) >= 2;
11819
+ const samePeriod = validPeriod(pa) && validPeriod(pb) && stable(pa) === stable(pb);
11820
+ if (!samePeriod)
11821
+ output.issues.push(`${period === "heldOut" ? "Held-out" : "Reference"} period boundaries changed or are unavailable; period deltas are suppressed.`);
11822
+ const periodLabel = (value) => validPeriod(value) ? `${at(value, "firstObservation")} to ${at(value, "lastObservation")} (${at(value, "observations")} observations)` : "unavailable";
11823
+ for (const scenario of ["baseline", "higherCosts"]) {
11824
+ const metricsA = at(a, "periods", period, scenario, "metrics"), metricsB = at(b, "periods", period, scenario, "metrics");
11825
+ const comparable = sameHashes && samePeriod && stable(at(a, "costScenarios", scenario)) === stable(at(b, "costScenarios", scenario));
11826
+ const note = comparable ? "Same data, frozen specification, engine and period. Percentage metrics change in percentage points." : "Different or unverifiable experiments; values are shown without a performance delta.";
11827
+ const metrics = [["timeWeightedReturnPct", "Time-weighted return", "percent"], ["endingEquityUsd", "Ending equity", "USD"], ["maxDrawdownPct", "Maximum drawdown", "percent"], ["tradeCount", "Modeled trades", "count"]];
11828
+ const validMetric = (value, key) => key === "tradeCount" ? Number.isSafeInteger(value) && Number(value) >= 0 ? value : null : key === "maxDrawdownPct" ? number(value) !== null && Number(value) >= 0 && Number(value) <= 100 ? value : null : value;
11829
+ output.sections.push({ title: `${period === "heldOut" ? "Held-out" : "Reference"} \xB7 ${scenario === "higherCosts" ? "Higher costs" : "Baseline costs"}`, description: `Baseline: ${periodLabel(pa)}. Current: ${periodLabel(pb)}.`, rows: metrics.map(([key, label, unit]) => numericRow(`${period}-${scenario}-${key}`, label, unit, validMetric(at(metricsA, key), key), validMetric(at(metricsB, key), key), comparable, note)) });
11830
+ }
11831
+ }
11832
+ output.notes.push("Historical simulations restart each period independently. Comparing captures is not a continuous equity curve, an out-of-sample guarantee or a reason to tune a rule on held-out results.");
11833
+ }
11834
+
11835
+ // src/desk.ts
11574
11836
  var sha = (value) => createHash5("sha256").update(value).digest("hex");
11575
11837
  var json2 = (value) => JSON.stringify(value, null, 2) + `
11576
11838
  `;
@@ -11637,16 +11899,18 @@ async function atomic(root, parts, value) {
11637
11899
  await rm3(temporary, { force: true });
11638
11900
  }
11639
11901
  }
11640
- var projectParts = (name) => [".boomkin", "projects", validName(name)];
11641
- var runParts = (name, id) => [...projectParts(name), "runs", validRun(id)];
11642
- function parseRun(value, name, id) {
11643
- if (!object(value) || value.schemaVersion !== 1 || value.project !== name || value.id !== id || !Object.hasOwn(kinds, value.kind) || !["queued", "running", "complete", "partial", "failed", "cancelled", "interrupted"].includes(value.state) || typeof value.createdAt !== "string" || !Number.isFinite(Date.parse(value.createdAt)) || typeof value.progress !== "string")
11902
+ var projectParts = (name2) => [".boomkin", "projects", validName(name2)];
11903
+ var runParts = (name2, id) => [...projectParts(name2), "runs", validRun(id)];
11904
+ function parseRun(value, name2, id) {
11905
+ if (!object(value) || value.schemaVersion !== 1 || value.project !== name2 || value.id !== id || !Object.hasOwn(kinds, value.kind) || !["queued", "running", "complete", "partial", "failed", "cancelled", "interrupted"].includes(value.state) || typeof value.createdAt !== "string" || !Number.isFinite(Date.parse(value.createdAt)) || typeof value.progress !== "string")
11644
11906
  throw new DeskError("Saved desk run is malformed; files were preserved", 409);
11645
11907
  return value;
11646
11908
  }
11647
11909
  function parseMetadata(value) {
11648
11910
  if (!object(value) || value.schemaVersion !== 1 || !Object.hasOwn(kinds, value.kind) || typeof value.title !== "string" || !value.title.trim() || value.title.length > 160)
11649
11911
  throw new DeskError("Saved desk project is malformed; files were preserved", 409);
11912
+ if (value.parent !== undefined && (!object(value.parent) || typeof value.parent.project !== "string" || !slug.test(value.parent.project) || typeof value.parent.runId !== "string" || !runPattern.test(value.parent.runId)))
11913
+ throw new DeskError("Saved parent capture is malformed; files were preserved", 409);
11650
11914
  return value;
11651
11915
  }
11652
11916
  function normalizeInput(kind, input) {
@@ -11713,10 +11977,10 @@ async function startDesk(options) {
11713
11977
  const recovery = await safe(root, [".boomkin", "desk-recovery.lock"]);
11714
11978
  try {
11715
11979
  await mkdir3(recovery, { mode: 448 });
11716
- } catch (error) {
11717
- if (error.code === "EEXIST")
11980
+ } catch (error2) {
11981
+ if (error2.code === "EEXIST")
11718
11982
  throw new DeskError("Desk lock recovery is already in progress. Retry after it finishes; inspect a retained recovery lock before removing it", 409);
11719
- throw error;
11983
+ throw error2;
11720
11984
  }
11721
11985
  try {
11722
11986
  await writeFile3(join5(recovery, "owner.json"), json2({ pid: process.pid, startedAt: new Date().toISOString() }), { flag: "wx", mode: 384 });
@@ -11731,8 +11995,8 @@ async function startDesk(options) {
11731
11995
  let alive = true;
11732
11996
  try {
11733
11997
  process.kill(owner.pid, 0);
11734
- } catch (error) {
11735
- if (error.code === "ESRCH")
11998
+ } catch (error2) {
11999
+ if (error2.code === "ESRCH")
11736
12000
  alive = false;
11737
12001
  }
11738
12002
  if (alive)
@@ -11744,11 +12008,11 @@ async function startDesk(options) {
11744
12008
  }
11745
12009
  }
11746
12010
  await writeFile3(join5(lock, "owner.json"), json2({ pid: process.pid, startedAt: new Date().toISOString() }), { flag: "wx", mode: 384 });
11747
- async function readMetadata(name) {
11748
- return parseMetadata(JSON.parse(await limited(await safe(root, [...projectParts(name), "desk.json"]))));
12011
+ async function readMetadata(name2) {
12012
+ return parseMetadata(JSON.parse(await limited(await safe(root, [...projectParts(name2), "desk.json"]))));
11749
12013
  }
11750
- async function readDeskRun(name, id) {
11751
- return parseRun(JSON.parse(await limited(await safe(root, [...runParts(name, id), "desk.json"]))), name, id);
12014
+ async function readDeskRun(name2, id) {
12015
+ return parseRun(JSON.parse(await limited(await safe(root, [...runParts(name2, id), "desk.json"]))), name2, id);
11752
12016
  }
11753
12017
  async function saveRun(run) {
11754
12018
  await atomic(root, [...runParts(run.project, run.id), "desk.json"], json2(run));
@@ -11763,7 +12027,7 @@ async function startDesk(options) {
11763
12027
  throw error;
11764
12028
  }
11765
12029
  }
11766
- return { name: project.name, title: meta.title, kind: meta.kind, ...meta.execution ? { execution: meta.execution } : {}, createdAt: project.createdAt, inputs: project.inputs, runs: runs.reverse() };
12030
+ return { name: project.name, title: meta.title, kind: meta.kind, ...meta.execution ? { execution: meta.execution } : {}, ...meta.parent ? { parent: meta.parent } : {}, createdAt: project.createdAt, inputs: project.inputs, runs: runs.reverse() };
11767
12031
  }
11768
12032
  async function projects() {
11769
12033
  const result = [];
@@ -11821,8 +12085,8 @@ async function startDesk(options) {
11821
12085
  throw new DeskError("This project already has an active run", 409);
11822
12086
  const controller = new AbortController;
11823
12087
  let release;
11824
- const done = new Promise((resolve) => {
11825
- release = resolve;
12088
+ const done = new Promise((resolve6) => {
12089
+ release = resolve6;
11826
12090
  });
11827
12091
  preparing.set(key, { controller, done });
11828
12092
  try {
@@ -11874,46 +12138,66 @@ async function startDesk(options) {
11874
12138
  const title = body.title ?? (kind === "wallet" ? "Hyperliquid wallet review" : kind === "market" ? `${input.asset} market research` : `${input.asset} strategy test`);
11875
12139
  if (typeof title !== "string" || !title.trim() || title.length > 160)
11876
12140
  throw new DeskError("Title must contain 1\u2013160 characters");
11877
- const name = `${kind}-${randomUUID3().slice(0, 8)}`;
12141
+ const name2 = `${kind}-${randomUUID3().slice(0, 8)}`;
11878
12142
  controller.signal.throwIfAborted();
11879
12143
  const { dataset, ...savedInput } = input;
11880
12144
  if (dataset)
11881
12145
  savedInput.uploadedDatasetSha256 = sha(json2(dataset));
11882
- const project = await createProject(root, { name, workflow: kinds[kind].workflow, inputs: savedInput, objective: title }, catalog);
12146
+ const project = await createProject(root, { name: name2, workflow: kinds[kind].workflow, inputs: savedInput, objective: title }, catalog);
11883
12147
  if (dataset)
11884
- await writeFile3(await safe(root, [...projectParts(name), "input.json"]), json2(dataset), { flag: "wx", mode: 384 });
11885
- await writeFile3(await safe(root, [...projectParts(name), "desk.json"]), json2({ schemaVersion: 1, kind, title }), { flag: "wx", mode: 384 });
12148
+ await writeFile3(await safe(root, [...projectParts(name2), "input.json"]), json2(dataset), { flag: "wx", mode: 384 });
12149
+ await writeFile3(await safe(root, [...projectParts(name2), "desk.json"]), json2({ schemaVersion: 1, kind, title }), { flag: "wx", mode: 384 });
11886
12150
  return projectDto(project);
11887
12151
  });
11888
12152
  }
11889
- async function runDetails(name, id) {
11890
- const run = await readDeskRun(name, id), parts = runParts(name, id);
12153
+ async function runDetails(name2, id) {
12154
+ const run = await readDeskRun(name2, id), parts = runParts(name2, id);
12155
+ const integrity = { issues: [], resultVerified: false };
12156
+ function parseSaved(value, file) {
12157
+ try {
12158
+ return JSON.parse(value);
12159
+ } catch {
12160
+ integrity.issues.push(`${file} contains invalid JSON`);
12161
+ return null;
12162
+ }
12163
+ }
11891
12164
  async function optional(file, parse = false) {
11892
12165
  try {
11893
12166
  const value = await limited(await safe(root, [...parts, file]), 20971520);
11894
- return parse ? JSON.parse(value) : value;
12167
+ return parse ? parseSaved(value, file) : value;
11895
12168
  } catch (error) {
11896
12169
  if (error.code === "ENOENT")
11897
12170
  return null;
11898
12171
  throw error;
11899
12172
  }
11900
12173
  }
11901
- let integrity = { issues: [] };
11902
- if (["complete", "partial"].includes(run.state))
11903
- integrity = { issues: (await checkProjectRun(root, name, id)).issues };
11904
- return { run, report: await optional("report.md"), evidence: await optional("evidence.json", true), result: await optional("result.json", true), integrity };
12174
+ const resultText = await optional("result.json");
12175
+ if (["complete", "partial"].includes(run.state)) {
12176
+ integrity.issues = (await checkProjectRun(root, name2, id)).issues;
12177
+ if (run.resultSha256 !== undefined) {
12178
+ integrity.resultVerified = typeof run.resultSha256 === "string" && /^[a-f0-9]{64}$/.test(run.resultSha256) && resultText !== null && sha(resultText) === run.resultSha256;
12179
+ if (!integrity.resultVerified)
12180
+ integrity.issues.push("Structured result changed or is missing since this capture finished");
12181
+ }
12182
+ }
12183
+ return { run, report: await optional("report.md"), evidence: await optional("evidence.json", true), result: resultText === null ? null : parseSaved(resultText, "result.json"), integrity };
12184
+ }
12185
+ async function comparisonSnapshot(name2, id) {
12186
+ const detail = await runDetails(name2, id), record2 = (await projectRuns(root, name2)).find((run) => run.id === id);
12187
+ const brief = detail.integrity.issues.length ? { inputs: {} } : JSON.parse(await limited(await safe(root, [...runParts(name2, id), "brief.json"])));
12188
+ return { run: detail.run, inputs: brief.inputs, packRevision: record2.pack.revision, result: detail.result, evidence: detail.evidence?.observations ?? [], integrityIssues: detail.integrity.issues, resultVerified: detail.integrity.resultVerified };
11905
12189
  }
11906
- async function startRun(name) {
11907
- return reserve(name, async (controller) => {
11908
- const project = await readProject(root, name), meta = await readMetadata(name), tools = await installed(meta.kind);
12190
+ async function startRun(name2) {
12191
+ return reserve(name2, async (controller) => {
12192
+ const project = await readProject(root, name2), meta = await readMetadata(name2), tools = await installed(meta.kind);
11909
12193
  controller.signal.throwIfAborted();
11910
12194
  if (meta.execution === "native-hermes")
11911
12195
  return startNative(project, meta, controller);
11912
- const id = new Date().toISOString().replaceAll(":", "-").replace(".", "-") + "-" + randomUUID3().slice(0, 8), parts = runParts(name, id);
12196
+ const id = new Date().toISOString().replaceAll(":", "-").replace(".", "-") + "-" + randomUUID3().slice(0, 8), parts = runParts(name2, id);
11913
12197
  const output = await safe(root, parts), createdAt = new Date().toISOString();
11914
- const brief = json2(project), prompt = renderProjectPrompt(project, output, (await projectRuns(root, name)).at(-1));
12198
+ const brief = json2(project), prompt = renderProjectPrompt(project, output, (await projectRuns(root, name2)).at(-1));
11915
12199
  controller.signal.throwIfAborted();
11916
- const projectLock = await safe(root, [...projectParts(name), "run.lock"]);
12200
+ const projectLock = await safe(root, [...projectParts(name2), "run.lock"]);
11917
12201
  try {
11918
12202
  await mkdir3(projectLock, { mode: 448 });
11919
12203
  } catch (error) {
@@ -11921,38 +12205,44 @@ async function startDesk(options) {
11921
12205
  throw new DeskError("This project already has an active run or an unresolved run lock", 409);
11922
12206
  throw error;
11923
12207
  }
11924
- const run = { schemaVersion: 1, id, project: name, kind: meta.kind, createdAt, state: "queued", progress: "Preparing verified research tools" };
11925
- const record = { schemaVersion: 1, id, project: name, createdAt, state: "prepared", briefSha256: sha(brief), promptSha256: sha(prompt), pack: tools.pack, maxTurns: 1 };
12208
+ const run = { schemaVersion: 1, id, project: name2, kind: meta.kind, createdAt, state: "queued", progress: "Preparing verified research tools" };
12209
+ const record2 = { schemaVersion: 1, id, project: name2, createdAt, state: "prepared", briefSha256: sha(brief), promptSha256: sha(prompt), pack: tools.pack, maxTurns: 1 };
11926
12210
  try {
11927
12211
  await writeFile3(join5(projectLock, "owner.json"), json2({ pid: process.pid, runId: id, owner: "desk" }), { flag: "wx", mode: 384 });
11928
12212
  await mkdir3(output, { mode: 448 });
11929
12213
  await mkdir3(join5(output, "sources"), { mode: 448 });
11930
- for (const [file, value] of [["brief.json", brief], ["prompt.md", prompt], ["run.json", json2(record)], ["desk.json", json2(run)]])
12214
+ for (const [file, value] of [["brief.json", brief], ["prompt.md", prompt], ["run.json", json2(record2)], ["desk.json", json2(run)]])
11931
12215
  await writeFile3(join5(output, file), value, { flag: "wx", mode: 384 });
11932
12216
  } catch (error) {
11933
12217
  await rm3(projectLock, { recursive: true, force: true });
11934
12218
  throw error;
11935
12219
  }
11936
12220
  const entry = { controller, done: Promise.resolve() };
11937
- active.set(name, entry);
11938
- entry.done = execute(project, tools, run, record, controller.signal).finally(async () => {
11939
- active.delete(name);
12221
+ active.set(name2, entry);
12222
+ entry.done = execute(project, tools, run, record2, controller.signal).finally(async () => {
12223
+ active.delete(name2);
11940
12224
  await rm3(projectLock, { recursive: true, force: true });
11941
12225
  });
11942
12226
  return run;
11943
12227
  });
11944
12228
  }
11945
- async function followup(name, body) {
11946
- return reserve(`followup-${name}`, async (controller) => {
11947
- if (!object(body) || Object.keys(body).some((key) => !["question", "maxTurns"].includes(key)) || typeof body.question !== "string" || !body.question.trim() || body.question.length > 4000)
12229
+ async function followup(name2, body) {
12230
+ return reserve(`followup-${name2}`, async (controller) => {
12231
+ if (!object(body) || Object.keys(body).some((key) => !["question", "maxTurns", "runId"].includes(key)) || typeof body.question !== "string" || !body.question.trim() || body.question.length > 4000)
11948
12232
  throw new DeskError("Enter a follow-up question under 4000 characters");
12233
+ if (body.runId !== undefined && (typeof body.runId !== "string" || !runPattern.test(body.runId)))
12234
+ throw new DeskError("Choose a valid saved run for the follow-up");
11949
12235
  const maxTurns = body.maxTurns ?? 10;
11950
12236
  if (!Number.isInteger(maxTurns) || maxTurns < 1 || maxTurns > 30)
11951
12237
  throw new DeskError("Follow-up requires 1\u201330 native model turns");
11952
- const previous = await readProject(root, name), meta = await readMetadata(name);
12238
+ const previous = await readProject(root, name2), meta = await readMetadata(name2);
11953
12239
  await installed(meta.kind);
11954
- const priorRun = (await projectRuns(root, name)).filter((item) => item.state === "ready-for-review").at(-1);
11955
- if (!priorRun || (await checkProjectRun(root, name, priorRun.id)).issues.length)
12240
+ const runs = await projectRuns(root, name2);
12241
+ const priorRun = body.runId ? runs.find((item) => item.id === body.runId) : runs.filter((item) => item.state === "ready-for-review").at(-1);
12242
+ if (!priorRun || priorRun.state !== "ready-for-review")
12243
+ throw new DeskError("Follow up on a completed result with verified evidence", 409);
12244
+ const priorDetail = await runDetails(name2, priorRun.id);
12245
+ if (!["complete", "partial"].includes(priorDetail.run.state) || priorDetail.integrity.issues.length)
11956
12246
  throw new DeskError("Follow up on a completed result with verified evidence", 409);
11957
12247
  checkProfile();
11958
12248
  await profilePromise;
@@ -11962,8 +12252,9 @@ async function startDesk(options) {
11962
12252
  throw new DeskError("Configure the native Hermes runtime and model first", 409);
11963
12253
  const derivedName = `followup-${randomUUID3().slice(0, 8)}`;
11964
12254
  const question = body.question.trim(), title = `Follow-up: ${question}`.slice(0, 160);
11965
- const project = await createProject(root, { name: derivedName, workflow: previous.workflow.id, objective: `Answer the user's follow-up using fresh public reads and the previous saved research as historical context. Question: ${question}`, inputs: { ...previous.inputs, followupQuestion: question, previousReport: await safe(root, [...runParts(name, priorRun.id), "report.md"]), previousEvidence: await safe(root, [...runParts(name, priorRun.id), "evidence.json"]) } }, catalog);
11966
- const derived = { schemaVersion: 1, kind: meta.kind, title, execution: "native-hermes", maxTurns };
12255
+ const priorBrief = JSON.parse(await limited(await safe(root, [...runParts(name2, priorRun.id), "brief.json"])));
12256
+ const project = await createProject(root, { name: derivedName, workflow: previous.workflow.id, objective: `Answer the user's follow-up using fresh public reads and the previous saved research as historical context. Question: ${question}`, inputs: { ...priorBrief.inputs, followupQuestion: question, previousProject: name2, previousRunId: priorRun.id, previousReport: await safe(root, [...runParts(name2, priorRun.id), "report.md"]), previousEvidence: await safe(root, [...runParts(name2, priorRun.id), "evidence.json"]) } }, catalog);
12257
+ const derived = { schemaVersion: 1, kind: meta.kind, title, execution: "native-hermes", maxTurns, parent: { project: name2, runId: priorRun.id } };
11967
12258
  await writeFile3(await safe(root, [...projectParts(derivedName), "desk.json"]), json2(derived), { flag: "wx", mode: 384 });
11968
12259
  const run = await startNative(project, derived, controller);
11969
12260
  return { project: await projectDto(project), run };
@@ -11973,8 +12264,8 @@ async function startDesk(options) {
11973
12264
  if (active.has(project.name))
11974
12265
  throw new DeskError("This project already has an active run", 409);
11975
12266
  let persisted, preparedResolve, preparedReject;
11976
- const prepared = new Promise((resolve, reject) => {
11977
- preparedResolve = resolve;
12267
+ const prepared = new Promise((resolve6, reject) => {
12268
+ preparedResolve = resolve6;
11978
12269
  preparedReject = reject;
11979
12270
  });
11980
12271
  const entry = { controller, done: Promise.resolve() };
@@ -11985,8 +12276,8 @@ async function startDesk(options) {
11985
12276
  signal: controller.signal,
11986
12277
  executable: options.nativeExecutable,
11987
12278
  maxTurns: meta.maxTurns ?? 10,
11988
- onPrepared: async (record) => {
11989
- persisted = { schemaVersion: 1, project: project.name, id: record.id, kind: meta.kind, execution: "native-hermes", createdAt: record.createdAt, state: "queued", progress: "Starting native Hermes with the configured model; provider usage may incur costs" };
12279
+ onPrepared: async (record2) => {
12280
+ persisted = { schemaVersion: 1, project: project.name, id: record2.id, kind: meta.kind, execution: "native-hermes", createdAt: record2.createdAt, state: "queued", progress: "Starting native Hermes with the configured model; provider usage may incur costs" };
11990
12281
  await saveRun(persisted);
11991
12282
  preparedResolve(persisted);
11992
12283
  },
@@ -12020,7 +12311,7 @@ async function startDesk(options) {
12020
12311
  })();
12021
12312
  return prepared;
12022
12313
  }
12023
- async function execute(project, tools, run, record, signal) {
12314
+ async function execute(project, tools, run, record2, signal) {
12024
12315
  const parts = runParts(project.name, run.id), evidence = [];
12025
12316
  async function progress(message) {
12026
12317
  signal.throwIfAborted();
@@ -12046,10 +12337,10 @@ async function startDesk(options) {
12046
12337
  }
12047
12338
  await progress(label);
12048
12339
  const sequence = ++readSequence;
12049
- const response = await (options.fetcher ?? fetch)(resource, { ...init, credentials: "omit", redirect: "error", signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal });
12340
+ const response2 = await (options.fetcher ?? fetch)(resource, { ...init, credentials: "omit", redirect: "error", signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal });
12050
12341
  {
12051
- const limit = run.kind === "wallet" ? 8388608 : 2097152, reader = response.body?.getReader();
12052
- if (!reader || Number(response.headers.get("content-length")) > limit)
12342
+ const limit = run.kind === "wallet" ? 8388608 : 2097152, reader = response2.body?.getReader();
12343
+ if (!reader || Number(response2.headers.get("content-length")) > limit)
12053
12344
  throw new DeskError("Public response exceeds the capture bound", 502);
12054
12345
  const chunks = [];
12055
12346
  let length = 0;
@@ -12067,17 +12358,17 @@ async function startDesk(options) {
12067
12358
  } finally {
12068
12359
  await reader.cancel().catch(() => {});
12069
12360
  }
12070
- const bytes = Buffer.concat(chunks);
12071
- new TextDecoder("utf-8", { fatal: true }).decode(bytes);
12072
- await artifact(`read-${String(sequence).padStart(3, "0")}.${run.kind === "wallet" ? "txt" : "json"}`, bytes, url, `Raw public response: HTTP ${response.status}; historical timestamps are contained in the response`, [run.kind === "wallet" ? "Sequential exchange snapshot; full-window completeness is unverified." : "Aggregate observations are not executable quotes."]);
12073
- return new Response(bytes, { status: response.status, headers: response.headers });
12361
+ const bytes2 = Buffer.concat(chunks);
12362
+ new TextDecoder("utf-8", { fatal: true }).decode(bytes2);
12363
+ await artifact(`read-${String(sequence).padStart(3, "0")}.${run.kind === "wallet" ? "txt" : "json"}`, bytes2, url, `Raw public response: HTTP ${response2.status}; historical timestamps are contained in the response`, [run.kind === "wallet" ? "Sequential exchange snapshot; full-window completeness is unverified." : "Aggregate observations are not executable quotes."]);
12364
+ return new Response(bytes2, { status: response2.status, headers: response2.headers });
12074
12365
  }
12075
12366
  };
12076
12367
  try {
12077
12368
  run.state = "running";
12078
- record.state = "running";
12369
+ record2.state = "running";
12079
12370
  await saveRun(run);
12080
- await atomic(root, [...parts, "run.json"], json2(record));
12371
+ await atomic(root, [...parts, "run.json"], json2(record2));
12081
12372
  const module = await import(pathToFileURL(tools.path).href + `?release=${tools.pack.revision}`);
12082
12373
  let result, report, partial = false;
12083
12374
  if (run.kind === "wallet") {
@@ -12173,20 +12464,22 @@ Captured evidence:
12173
12464
  ` + evidence.map((item) => `
12174
12465
  - [${item.id}] ${item.summary}`).join("") + `
12175
12466
  `;
12176
- await atomic(root, [...parts, "result.json"], json2(result));
12467
+ const resultText = json2(result);
12468
+ await atomic(root, [...parts, "result.json"], resultText);
12469
+ run.resultSha256 = sha(resultText);
12177
12470
  await atomic(root, [...parts, "report.md"], report);
12178
12471
  await atomic(root, [...parts, "evidence.json"], json2({ schemaVersion: 1, observations: evidence }));
12179
12472
  await atomic(root, [...parts, "plan.json"], json2({ schemaVersion: 1, status: "no-action", authorization: "not-granted", summary: "Read-only research; no financial action or authority", steps: [] }));
12180
- record.state = "needs-review";
12181
- record.finishedAt = new Date().toISOString();
12182
- await atomic(root, [...parts, "run.json"], json2(record));
12473
+ record2.state = "needs-review";
12474
+ record2.finishedAt = new Date().toISOString();
12475
+ await atomic(root, [...parts, "run.json"], json2(record2));
12183
12476
  const checked = await checkProjectRun(root, project.name, run.id);
12184
12477
  if (checked.issues.length)
12185
12478
  throw new DeskError("Saved result failed evidence validation: " + checked.issues.join("; "), 409);
12186
- record.state = "ready-for-review";
12187
- await atomic(root, [...parts, "run.json"], json2(record));
12479
+ record2.state = "ready-for-review";
12480
+ await atomic(root, [...parts, "run.json"], json2(record2));
12188
12481
  run.state = partial ? "partial" : "complete";
12189
- run.finishedAt = record.finishedAt;
12482
+ run.finishedAt = record2.finishedAt;
12190
12483
  run.progress = partial ? "Saved with explicit missing or partial observations" : "Research saved; sources and methodology are available";
12191
12484
  await saveRun(run);
12192
12485
  } catch (error) {
@@ -12195,9 +12488,9 @@ Captured evidence:
12195
12488
  run.finishedAt = new Date().toISOString();
12196
12489
  run.error = message;
12197
12490
  run.progress = message;
12198
- record.state = "failed";
12199
- record.finishedAt = run.finishedAt;
12200
- record.issues = [message];
12491
+ record2.state = "failed";
12492
+ record2.finishedAt = run.finishedAt;
12493
+ record2.issues = [message];
12201
12494
  await atomic(root, [...parts, "evidence.json"], json2({ schemaVersion: 1, observations: evidence }));
12202
12495
  await atomic(root, [...parts, "report.md"], `# Research incomplete
12203
12496
 
@@ -12208,14 +12501,14 @@ ${evidence.map((item) => `[${item.id}] ${item.summary}`).join(`
12208
12501
  `)}
12209
12502
  `);
12210
12503
  await atomic(root, [...parts, "plan.json"], json2({ schemaVersion: 1, status: "no-action", authorization: "not-granted", summary: message, steps: [] }));
12211
- await atomic(root, [...parts, "run.json"], json2(record));
12504
+ await atomic(root, [...parts, "run.json"], json2(record2));
12212
12505
  await saveRun(run);
12213
12506
  }
12214
12507
  }
12215
12508
  let origin = "";
12216
12509
  const headers = { "cache-control": "no-store", "x-content-type-options": "nosniff", "referrer-policy": "no-referrer", "content-security-policy": "default-src 'self'; connect-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'" };
12217
- function response(value, status = 200) {
12218
- return Response.json(value, { status, headers });
12510
+ function response(value, status2 = 200) {
12511
+ return Response.json(value, { status: status2, headers });
12219
12512
  }
12220
12513
  async function requestJson(request) {
12221
12514
  if (request.headers.get("content-type")?.split(";")[0].trim() !== "application/json")
@@ -12299,43 +12592,52 @@ ${evidence.map((item) => `[${item.id}] ${item.summary}`).join(`
12299
12592
  }
12300
12593
  if (request.method === "POST" && path === "/api/projects")
12301
12594
  return response({ project: await create(await requestJson(request)) }, 201);
12302
- const match = path.match(/^\/api\/projects\/([a-z0-9-]+)(?:\/runs\/([^/]+)(?:\/(export|cancel|evidence)(?:\/([^/]+))?)?|\/(run|refresh|followup))?$/);
12595
+ const match = path.match(/^\/api\/projects\/([a-z0-9-]+)(?:\/runs\/([^/]+)(?:\/(export|cancel|evidence|compare)(?:\/([^/]+))?)?|\/(run|refresh|followup))?$/);
12303
12596
  if (!match)
12304
12597
  throw new DeskError("Unknown desk route", 404);
12305
- const [, name, id, action, observationId, operation] = match;
12598
+ const [, name2, id, action, observationId, operation] = match;
12306
12599
  if (!id && !operation && request.method === "GET")
12307
- return response({ project: await projectDto(await readProject(root, name)) });
12600
+ return response({ project: await projectDto(await readProject(root, name2)) });
12308
12601
  if (operation === "followup" && request.method === "POST")
12309
- return response(await followup(name, await requestJson(request)), 202);
12602
+ return response(await followup(name2, await requestJson(request)), 202);
12310
12603
  if (operation && request.method === "POST")
12311
- return response({ run: await startRun(name) }, 202);
12604
+ return response({ run: await startRun(name2) }, 202);
12312
12605
  if (id) {
12606
+ if (action === "compare" && request.method === "GET") {
12607
+ const params = new URL(request.url).searchParams, baseline = params.get("baseline");
12608
+ if (!baseline || params.getAll("baseline").length !== 1 || [...params.keys()].some((key) => key !== "baseline") || observationId)
12609
+ throw new DeskError("Choose one baseline run from this project");
12610
+ validRun(baseline);
12611
+ validRun(id);
12612
+ const before = await comparisonSnapshot(name2, baseline), after = await comparisonSnapshot(name2, id);
12613
+ return response(compareDeskRuns(after.run.kind, before, after));
12614
+ }
12313
12615
  if (action === "cancel" && request.method === "POST") {
12314
- const run = await readDeskRun(name, id), pending = active.get(name);
12616
+ const run = await readDeskRun(name2, id), pending = active.get(name2);
12315
12617
  if (!pending || !["queued", "running"].includes(run.state))
12316
12618
  throw new DeskError("This run is no longer active", 409);
12317
- const current = (await projectRuns(root, name)).at(-1);
12619
+ const current = (await projectRuns(root, name2)).at(-1);
12318
12620
  if (current?.id !== id)
12319
12621
  throw new DeskError("Only the active run can be cancelled", 409);
12320
12622
  pending.controller.abort();
12321
12623
  await pending.done;
12322
- return response({ run: await readDeskRun(name, id) });
12624
+ return response({ run: await readDeskRun(name2, id) });
12323
12625
  }
12324
12626
  if (request.method === "GET" && action === "evidence") {
12325
12627
  if (!observationId || !slug.test(observationId))
12326
12628
  throw new DeskError("Invalid observation ID");
12327
- const detail = await runDetails(name, id), evidence = detail.evidence?.observations?.find((item) => item.id === observationId);
12629
+ const detail = await runDetails(name2, id), evidence = detail.evidence?.observations?.find((item) => item.id === observationId);
12328
12630
  if (!evidence || !/^sources\/(?:[a-zA-Z0-9][a-zA-Z0-9._-]*\/)*[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(evidence.artifact))
12329
12631
  throw new DeskError("Unknown captured observation", 404);
12330
- const bytes = await limitedBytes(await safe(root, [...runParts(name, id), ...evidence.artifact.split("/")]), 20971520);
12331
- if (sha(bytes) !== evidence.sha256)
12632
+ const bytes2 = await limitedBytes(await safe(root, [...runParts(name2, id), ...evidence.artifact.split("/")]), 20971520);
12633
+ if (sha(bytes2) !== evidence.sha256)
12332
12634
  throw new DeskError("Captured artifact hash differs from its evidence record", 409);
12333
- return new Response(bytes, { headers: { ...headers, "content-type": "text/plain; charset=utf-8" } });
12635
+ return new Response(bytes2, { headers: { ...headers, "content-type": "text/plain; charset=utf-8" } });
12334
12636
  }
12335
12637
  if (request.method === "GET" && (!action || action === "export")) {
12336
- const detail = await runDetails(name, id);
12638
+ const detail = await runDetails(name2, id);
12337
12639
  if (action === "export")
12338
- return new Response(json2(detail), { headers: { ...headers, "content-type": "application/json", "content-disposition": `attachment; filename="${name}-${id}.json"` } });
12640
+ return new Response(json2(detail), { headers: { ...headers, "content-type": "application/json", "content-disposition": `attachment; filename="${name2}-${id}.json"` } });
12339
12641
  return response(detail);
12340
12642
  }
12341
12643
  }
@@ -12366,8 +12668,8 @@ ${evidence.map((item) => `[${item.id}] ${item.summary}`).join(`
12366
12668
  const contents = await readFile5(filePath);
12367
12669
  return new Response(request.method === "HEAD" ? null : contents, { headers: { ...headers, "content-type": file.type } });
12368
12670
  } catch (error) {
12369
- const status = error instanceof DeskError ? error.status : error.code === "ENOENT" ? 404 : 500;
12370
- return response({ error: { message: status === 500 ? "Desk operation failed; saved files were preserved" : error.message } }, status);
12671
+ const status2 = error instanceof DeskError ? error.status : error.code === "ENOENT" ? 404 : 500;
12672
+ return response({ error: { message: status2 === 500 ? "Desk operation failed; saved files were preserved" : error.message } }, status2);
12371
12673
  }
12372
12674
  }
12373
12675
  });
@@ -12505,8 +12807,8 @@ function createNativeDashboard(directory, options = {}) {
12505
12807
  const consume = async (stream) => {
12506
12808
  const decoder = new TextDecoder;
12507
12809
  let tail = "";
12508
- for await (const bytes of stream) {
12509
- const lines = (tail + decoder.decode(bytes, { stream: true })).split(`
12810
+ for await (const bytes2 of stream) {
12811
+ const lines = (tail + decoder.decode(bytes2, { stream: true })).split(`
12510
12812
  `);
12511
12813
  tail = lines.pop().slice(-4096);
12512
12814
  for (const line of lines) {
@@ -12695,22 +12997,22 @@ async function main() {
12695
12997
  if (command === "desk") {
12696
12998
  if (values.pack || values.harness || values["offline-catalog"])
12697
12999
  throw new Error("desk uses its selected Hermes profile; pack options belong to setup or onboard");
12698
- const directory = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
13000
+ const directory2 = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
12699
13001
  const port = deskPort(values.port);
12700
13002
  if (values["dry-run"])
12701
- return console.log(`Would serve the local desk on 127.0.0.1:${port || "an available port"} using ${directory}; no model, data read or setup starts in this preview.`);
12702
- const catalog = parseCatalog(skills_default);
12703
- const nativeDashboard = createNativeDashboard(directory);
13003
+ return console.log(`Would serve the local desk on 127.0.0.1:${port || "an available port"} using ${directory2}; no model, data read or setup starts in this preview.`);
13004
+ const catalog2 = parseCatalog(skills_default);
13005
+ const nativeDashboard = createNativeDashboard(directory2);
12704
13006
  const desk = await startDesk({
12705
- directory,
12706
- catalog,
13007
+ directory: directory2,
13008
+ catalog: catalog2,
12707
13009
  port,
12708
13010
  assetsDirectory: deskAssetsDirectory(import.meta.url),
12709
13011
  onSetup: async (signal) => {
12710
- const selected = await deskSetupPacks(directory, catalog);
13012
+ const selected = await deskSetupPacks(directory2, catalog2);
12711
13013
  signal.throwIfAborted();
12712
13014
  const group = process.platform !== "win32";
12713
- const child = Bun.spawn([process.execPath, fileURLToPath2(import.meta.url), "setup", "--harness", "hermes", "--directory", directory, ...selected.flatMap((id) => ["--pack", id])], { stdin: "inherit", stdout: "inherit", stderr: "inherit", detached: group });
13015
+ const child = Bun.spawn([process.execPath, fileURLToPath2(import.meta.url), "setup", "--harness", "hermes", "--directory", directory2, ...selected.flatMap((id) => ["--pack", id])], { stdin: "inherit", stdout: "inherit", stderr: "inherit", detached: group });
12714
13016
  let termination;
12715
13017
  const abort = () => {
12716
13018
  termination ??= terminateOwnedProcess(child, group);
@@ -12730,13 +13032,13 @@ async function main() {
12730
13032
  }
12731
13033
  },
12732
13034
  onModelSetup: async (signal) => {
12733
- await prepareHermes(directory, { install: true, skipModelSetup: true, signal });
13035
+ await prepareHermes(directory2, { install: true, skipModelSetup: true, signal });
12734
13036
  signal.throwIfAborted();
12735
13037
  return nativeDashboard.open();
12736
13038
  }
12737
13039
  });
12738
13040
  console.log(`Boomkin desk: ${desk.url}
12739
- Profile: ${directory}
13041
+ Profile: ${directory2}
12740
13042
  Public jobs use bounded keyless reads. Native model research is optional. Stop with Ctrl-C.`);
12741
13043
  if (!values["no-open"]) {
12742
13044
  const opener = process.platform === "darwin" ? "open" : process.platform === "win32" ? undefined : Bun.which("xdg-open");
@@ -12770,11 +13072,11 @@ Public jobs use bounded keyless reads. Native model research is optional. Stop w
12770
13072
  throw new Error("--dry-run is available for project create and run");
12771
13073
  if (action === "run" && values.json && !values["dry-run"])
12772
13074
  throw new Error("Live project run streams native Hermes output. Use --dry-run --json to preview, or project show/project check for saved JSON results");
12773
- const directory = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
13075
+ const directory2 = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
12774
13076
  if (action === "list") {
12775
13077
  if (values.name !== undefined)
12776
13078
  throw new Error("project list does not accept --name");
12777
- const projects = await listProjects(directory);
13079
+ const projects = await listProjects(directory2);
12778
13080
  return console.log(values.json ? JSON.stringify({ schemaVersion: 1, projects }, null, 2) : projects.length ? projects.map((project) => `${project.name}: ${project.workflow.title}`).join(`
12779
13081
  `) : "No saved projects. Use project create with a workflow and input file.");
12780
13082
  }
@@ -12787,19 +13089,19 @@ Public jobs use bounded keyless reads. Native model research is optional. Stop w
12787
13089
  if (file.size > 65536)
12788
13090
  throw new Error("Project input file exceeds 64 KiB");
12789
13091
  const supplied = await file.json();
12790
- const project = await createProject(directory, { name: values.name, workflow: values.template ? selectTemplate(values.template).workflow : values.workflow, inputs: values.template ? templateInputs(values.template, supplied) : supplied, objective: values.objective, dryRun: values["dry-run"] }, parseCatalog(skills_default));
12791
- return console.log(values.json ? JSON.stringify(project, null, 2) : `${values["dry-run"] ? "Would create" : "Saved"} ${project.name} in ${directory}. Preview with project run --name ${project.name} --dry-run.`);
13092
+ const project = await createProject(directory2, { name: values.name, workflow: values.template ? selectTemplate(values.template).workflow : values.workflow, inputs: values.template ? templateInputs(values.template, supplied) : supplied, objective: values.objective, dryRun: values["dry-run"] }, parseCatalog(skills_default));
13093
+ return console.log(values.json ? JSON.stringify(project, null, 2) : `${values["dry-run"] ? "Would create" : "Saved"} ${project.name} in ${directory2}. Preview with project run --name ${project.name} --dry-run.`);
12792
13094
  }
12793
13095
  if (action === "show")
12794
- return console.log(JSON.stringify({ project: await readProject(directory, values.name), runs: await projectRuns(directory, values.name) }, null, 2));
13096
+ return console.log(JSON.stringify({ project: await readProject(directory2, values.name), runs: await projectRuns(directory2, values.name) }, null, 2));
12795
13097
  if (action === "run") {
12796
- const result = await runProject(directory, values.name, { dryRun: values["dry-run"], maxTurns: values["max-turns"] === undefined ? undefined : Number(values["max-turns"]) });
12797
- return console.log(values.json ? JSON.stringify(result, null, 2) : values["dry-run"] ? result.prompt : `${result.run.state}: ${result.path}${result.run.issues?.length ? `
12798
- ${result.run.issues.join(`
13098
+ const result2 = await runProject(directory2, values.name, { dryRun: values["dry-run"], maxTurns: values["max-turns"] === undefined ? undefined : Number(values["max-turns"]) });
13099
+ return console.log(values.json ? JSON.stringify(result2, null, 2) : values["dry-run"] ? result2.prompt : `${result2.run.state}: ${result2.path}${result2.run.issues?.length ? `
13100
+ ${result2.run.issues.join(`
12799
13101
  `)}` : `
12800
13102
  Captured files passed structural and hash checks. Review the findings and unsigned plan.`}`);
12801
13103
  }
12802
- const result = await checkProjectRun(directory, values.name, values["run-id"]);
13104
+ const result = await checkProjectRun(directory2, values.name, values["run-id"]);
12803
13105
  console.log(JSON.stringify(result, null, 2));
12804
13106
  if (result.issues.length)
12805
13107
  process.exitCode = 1;
@@ -12835,7 +13137,7 @@ Captured files passed structural and hash checks. Review the findings and unsign
12835
13137
  if (["onboard", "doctor", "start", "connect", "model", "chatgpt"].includes(command)) {
12836
13138
  if (values.harness && values.harness !== "hermes")
12837
13139
  throw new Error("Boomkin onboarding uses Hermes. Use setup for skill-only compatibility with another harness.");
12838
- const directory = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
13140
+ const directory2 = await canonicalPath(resolve8(values.directory ?? defaultProfile()));
12839
13141
  if (command === "onboard") {
12840
13142
  if (values.pack && values["all-packs"])
12841
13143
  throw new Error("Choose --pack or --all-packs, not both");
@@ -12847,36 +13149,36 @@ Captured files passed structural and hash checks. Review the findings and unsign
12847
13149
  "--harness",
12848
13150
  "hermes",
12849
13151
  "--directory",
12850
- directory,
13152
+ directory2,
12851
13153
  ...selected?.flatMap((id) => ["--pack", id]) ?? [],
12852
13154
  ...values["dry-run"] ? ["--dry-run"] : []
12853
13155
  ];
12854
13156
  const child = Bun.spawn(args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" });
12855
13157
  if (await child.exited !== 0)
12856
13158
  throw new Error("Skill setup did not finish. Resolve its reported issue and rerun onboard.");
12857
- console.log(`Hermes home: ${directory}. Native model setup and keyless CoinGecko data; other providers are opt-in.`);
12858
- await prepareHermes(directory, { install: !values["no-install"], dryRun: values["dry-run"], skipModelSetup: values["skip-model-setup"] });
13159
+ console.log(`Hermes home: ${directory2}. Native model setup and keyless CoinGecko data; other providers are opt-in.`);
13160
+ await prepareHermes(directory2, { install: !values["no-install"], dryRun: values["dry-run"], skipModelSetup: values["skip-model-setup"] });
12859
13161
  if (values["dry-run"])
12860
13162
  return;
12861
- console.log(JSON.stringify(await doctor(directory, parseCatalog(skills_default)), null, 2));
13163
+ console.log(JSON.stringify(await doctor(directory2, parseCatalog(skills_default)), null, 2));
12862
13164
  console.log("Onboarding saved. Use doctor --live to check public data, then start to launch Hermes. Complete any listed setup gaps first.");
12863
13165
  return;
12864
13166
  }
12865
13167
  if (values.pack || values["all-packs"] || values["skip-model-setup"] || values["no-install"])
12866
13168
  throw new Error("Pack and installer options are only available for onboard here");
12867
13169
  if (command === "chatgpt")
12868
- return runChatGpt(directory, values.action ?? "status", values["dry-run"]);
13170
+ return runChatGpt(directory2, values.action ?? "status", values["dry-run"]);
12869
13171
  if (command === "doctor")
12870
- return console.log(JSON.stringify(await doctor(directory, parseCatalog(skills_default), values.live), null, 2));
13172
+ return console.log(JSON.stringify(await doctor(directory2, parseCatalog(skills_default), values.live), null, 2));
12871
13173
  if (command === "connect")
12872
- return connectProvider(directory, values.provider ?? "", values["dry-run"], values["key-file"] ? resolve8(values["key-file"]) : undefined);
13174
+ return connectProvider(directory2, values.provider ?? "", values["dry-run"], values["key-file"] ? resolve8(values["key-file"]) : undefined);
12873
13175
  if (values["dry-run"])
12874
- return console.log(`Hermes ${command === "model" ? "setup model" : "chat"} in ${directory}`);
12875
- return runHermes(directory, command === "model" ? ["setup", "model"] : ["chat"]);
13176
+ return console.log(`Hermes ${command === "model" ? "setup model" : "chat"} in ${directory2}`);
13177
+ return runHermes(directory2, command === "model" ? ["setup", "model"] : ["chat"]);
12876
13178
  }
12877
13179
  if (command === "harnesses") {
12878
- for (const [name, h] of Object.entries(harnesses))
12879
- console.log(`${name}
13180
+ for (const [name2, h] of Object.entries(harnesses))
13181
+ console.log(`${name2}
12880
13182
  ${h.setup}
12881
13183
  ${h.docs}
12882
13184
  `);
@@ -12917,11 +13219,11 @@ Captured files passed structural and hash checks. Review the findings and unsign
12917
13219
  if (await child.exited !== 0)
12918
13220
  throw new Error("Upstream skills command failed. Completed packs remain installed; rerun after resolving the error.");
12919
13221
  }
12920
- async function verifyInstalled(catalog) {
12921
- for (const pack of catalog.packs) {
13222
+ async function verifyInstalled(catalog2) {
13223
+ for (const pack of catalog2.packs) {
12922
13224
  for (const skill of pack.skills) {
12923
- const text = await readFile7(join8(directory, adapter.skillsPath, skill, "SKILL.md"), "utf8");
12924
- const version = installedVersion(text);
13225
+ const text2 = await readFile7(join8(directory, adapter.skillsPath, skill, "SKILL.md"), "utf8");
13226
+ const version = installedVersion(text2);
12925
13227
  if (version !== pack.version)
12926
13228
  throw new Error(`Installed ${skill} has version ${version ?? "unknown"}; expected ${pack.version}. Sync not marked complete.`);
12927
13229
  }
@@ -12935,9 +13237,9 @@ ${adapter.setup}`);
12935
13237
  }
12936
13238
  let previous;
12937
13239
  try {
12938
- const record = JSON.parse(await readFile7(join8(stateDir, "last-sync.json"), "utf8"));
12939
- if (record.catalog?.schemaVersion === 3)
12940
- previous = parseCatalog(record.catalog);
13240
+ const record2 = JSON.parse(await readFile7(join8(stateDir, "last-sync.json"), "utf8"));
13241
+ if (record2.catalog?.schemaVersion === 3)
13242
+ previous = parseCatalog(record2.catalog);
12941
13243
  } catch (error) {
12942
13244
  if (error.code !== "ENOENT" && command === "check")
12943
13245
  throw new Error("Sync record is incomplete; run update to rebuild it.");