@polka-codes/cli 0.9.78 → 0.9.79

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.
Files changed (2) hide show
  1. package/dist/index.js +934 -242
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13849,13 +13849,13 @@ var require_identity = __commonJS((exports) => {
13849
13849
 
13850
13850
  // ../../node_modules/yaml/dist/visit.js
13851
13851
  var require_visit = __commonJS((exports) => {
13852
- var identity2 = require_identity();
13852
+ var identity = require_identity();
13853
13853
  var BREAK = Symbol("break visit");
13854
13854
  var SKIP = Symbol("skip children");
13855
13855
  var REMOVE = Symbol("remove node");
13856
13856
  function visit(node, visitor) {
13857
13857
  const visitor_ = initVisitor(visitor);
13858
- if (identity2.isDocument(node)) {
13858
+ if (identity.isDocument(node)) {
13859
13859
  const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
13860
13860
  if (cd === REMOVE)
13861
13861
  node.contents = null;
@@ -13867,12 +13867,12 @@ var require_visit = __commonJS((exports) => {
13867
13867
  visit.REMOVE = REMOVE;
13868
13868
  function visit_(key, node, visitor, path) {
13869
13869
  const ctrl = callVisitor(key, node, visitor, path);
13870
- if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
13870
+ if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
13871
13871
  replaceNode(key, path, ctrl);
13872
13872
  return visit_(key, ctrl, visitor, path);
13873
13873
  }
13874
13874
  if (typeof ctrl !== "symbol") {
13875
- if (identity2.isCollection(node)) {
13875
+ if (identity.isCollection(node)) {
13876
13876
  path = Object.freeze(path.concat(node));
13877
13877
  for (let i = 0;i < node.items.length; ++i) {
13878
13878
  const ci = visit_(i, node.items[i], visitor, path);
@@ -13885,7 +13885,7 @@ var require_visit = __commonJS((exports) => {
13885
13885
  i -= 1;
13886
13886
  }
13887
13887
  }
13888
- } else if (identity2.isPair(node)) {
13888
+ } else if (identity.isPair(node)) {
13889
13889
  path = Object.freeze(path.concat(node));
13890
13890
  const ck = visit_("key", node.key, visitor, path);
13891
13891
  if (ck === BREAK)
@@ -13903,7 +13903,7 @@ var require_visit = __commonJS((exports) => {
13903
13903
  }
13904
13904
  async function visitAsync(node, visitor) {
13905
13905
  const visitor_ = initVisitor(visitor);
13906
- if (identity2.isDocument(node)) {
13906
+ if (identity.isDocument(node)) {
13907
13907
  const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
13908
13908
  if (cd === REMOVE)
13909
13909
  node.contents = null;
@@ -13915,12 +13915,12 @@ var require_visit = __commonJS((exports) => {
13915
13915
  visitAsync.REMOVE = REMOVE;
13916
13916
  async function visitAsync_(key, node, visitor, path) {
13917
13917
  const ctrl = await callVisitor(key, node, visitor, path);
13918
- if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
13918
+ if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
13919
13919
  replaceNode(key, path, ctrl);
13920
13920
  return visitAsync_(key, ctrl, visitor, path);
13921
13921
  }
13922
13922
  if (typeof ctrl !== "symbol") {
13923
- if (identity2.isCollection(node)) {
13923
+ if (identity.isCollection(node)) {
13924
13924
  path = Object.freeze(path.concat(node));
13925
13925
  for (let i = 0;i < node.items.length; ++i) {
13926
13926
  const ci = await visitAsync_(i, node.items[i], visitor, path);
@@ -13933,7 +13933,7 @@ var require_visit = __commonJS((exports) => {
13933
13933
  i -= 1;
13934
13934
  }
13935
13935
  }
13936
- } else if (identity2.isPair(node)) {
13936
+ } else if (identity.isPair(node)) {
13937
13937
  path = Object.freeze(path.concat(node));
13938
13938
  const ck = await visitAsync_("key", node.key, visitor, path);
13939
13939
  if (ck === BREAK)
@@ -13970,31 +13970,31 @@ var require_visit = __commonJS((exports) => {
13970
13970
  function callVisitor(key, node, visitor, path) {
13971
13971
  if (typeof visitor === "function")
13972
13972
  return visitor(key, node, path);
13973
- if (identity2.isMap(node))
13973
+ if (identity.isMap(node))
13974
13974
  return visitor.Map?.(key, node, path);
13975
- if (identity2.isSeq(node))
13975
+ if (identity.isSeq(node))
13976
13976
  return visitor.Seq?.(key, node, path);
13977
- if (identity2.isPair(node))
13977
+ if (identity.isPair(node))
13978
13978
  return visitor.Pair?.(key, node, path);
13979
- if (identity2.isScalar(node))
13979
+ if (identity.isScalar(node))
13980
13980
  return visitor.Scalar?.(key, node, path);
13981
- if (identity2.isAlias(node))
13981
+ if (identity.isAlias(node))
13982
13982
  return visitor.Alias?.(key, node, path);
13983
13983
  return;
13984
13984
  }
13985
13985
  function replaceNode(key, path, node) {
13986
13986
  const parent = path[path.length - 1];
13987
- if (identity2.isCollection(parent)) {
13987
+ if (identity.isCollection(parent)) {
13988
13988
  parent.items[key] = node;
13989
- } else if (identity2.isPair(parent)) {
13989
+ } else if (identity.isPair(parent)) {
13990
13990
  if (key === "key")
13991
13991
  parent.key = node;
13992
13992
  else
13993
13993
  parent.value = node;
13994
- } else if (identity2.isDocument(parent)) {
13994
+ } else if (identity.isDocument(parent)) {
13995
13995
  parent.contents = node;
13996
13996
  } else {
13997
- const pt = identity2.isAlias(parent) ? "alias" : "scalar";
13997
+ const pt = identity.isAlias(parent) ? "alias" : "scalar";
13998
13998
  throw new Error(`Cannot replace node with ${pt} parent`);
13999
13999
  }
14000
14000
  }
@@ -14004,7 +14004,7 @@ var require_visit = __commonJS((exports) => {
14004
14004
 
14005
14005
  // ../../node_modules/yaml/dist/doc/directives.js
14006
14006
  var require_directives = __commonJS((exports) => {
14007
- var identity2 = require_identity();
14007
+ var identity = require_identity();
14008
14008
  var visit = require_visit();
14009
14009
  var escapeChars = {
14010
14010
  "!": "%21",
@@ -14130,10 +14130,10 @@ var require_directives = __commonJS((exports) => {
14130
14130
  const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
14131
14131
  const tagEntries = Object.entries(this.tags);
14132
14132
  let tagNames;
14133
- if (doc2 && tagEntries.length > 0 && identity2.isNode(doc2.contents)) {
14133
+ if (doc2 && tagEntries.length > 0 && identity.isNode(doc2.contents)) {
14134
14134
  const tags = {};
14135
14135
  visit.visit(doc2.contents, (_key, node) => {
14136
- if (identity2.isNode(node) && node.tag)
14136
+ if (identity.isNode(node) && node.tag)
14137
14137
  tags[node.tag] = true;
14138
14138
  });
14139
14139
  tagNames = Object.keys(tags);
@@ -14156,7 +14156,7 @@ var require_directives = __commonJS((exports) => {
14156
14156
 
14157
14157
  // ../../node_modules/yaml/dist/doc/anchors.js
14158
14158
  var require_anchors = __commonJS((exports) => {
14159
- var identity2 = require_identity();
14159
+ var identity = require_identity();
14160
14160
  var visit = require_visit();
14161
14161
  function anchorIsValid(anchor) {
14162
14162
  if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
@@ -14166,9 +14166,9 @@ var require_anchors = __commonJS((exports) => {
14166
14166
  }
14167
14167
  return true;
14168
14168
  }
14169
- function anchorNames(root2) {
14169
+ function anchorNames(root) {
14170
14170
  const anchors = new Set;
14171
- visit.visit(root2, {
14171
+ visit.visit(root, {
14172
14172
  Value(_key, node) {
14173
14173
  if (node.anchor)
14174
14174
  anchors.add(node.anchor);
@@ -14198,7 +14198,7 @@ var require_anchors = __commonJS((exports) => {
14198
14198
  setAnchors: () => {
14199
14199
  for (const source of aliasObjects) {
14200
14200
  const ref = sourceObjects.get(source);
14201
- if (typeof ref === "object" && ref.anchor && (identity2.isScalar(ref.node) || identity2.isCollection(ref.node))) {
14201
+ if (typeof ref === "object" && ref.anchor && (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
14202
14202
  ref.node.anchor = ref.anchor;
14203
14203
  } else {
14204
14204
  const error46 = new Error("Failed to resolve repeated object (this should not happen)");
@@ -14265,12 +14265,12 @@ var require_applyReviver = __commonJS((exports) => {
14265
14265
 
14266
14266
  // ../../node_modules/yaml/dist/nodes/toJS.js
14267
14267
  var require_toJS = __commonJS((exports) => {
14268
- var identity2 = require_identity();
14268
+ var identity = require_identity();
14269
14269
  function toJS(value, arg, ctx) {
14270
14270
  if (Array.isArray(value))
14271
14271
  return value.map((v, i) => toJS(v, String(i), ctx));
14272
14272
  if (value && typeof value.toJSON === "function") {
14273
- if (!ctx || !identity2.hasAnchor(value))
14273
+ if (!ctx || !identity.hasAnchor(value))
14274
14274
  return value.toJSON(arg, ctx);
14275
14275
  const data = { aliasCount: 0, count: 1, res: undefined };
14276
14276
  ctx.anchors.set(value, data);
@@ -14293,12 +14293,12 @@ var require_toJS = __commonJS((exports) => {
14293
14293
  // ../../node_modules/yaml/dist/nodes/Node.js
14294
14294
  var require_Node = __commonJS((exports) => {
14295
14295
  var applyReviver = require_applyReviver();
14296
- var identity2 = require_identity();
14296
+ var identity = require_identity();
14297
14297
  var toJS = require_toJS();
14298
14298
 
14299
14299
  class NodeBase {
14300
14300
  constructor(type) {
14301
- Object.defineProperty(this, identity2.NODE_TYPE, { value: type });
14301
+ Object.defineProperty(this, identity.NODE_TYPE, { value: type });
14302
14302
  }
14303
14303
  clone() {
14304
14304
  const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
@@ -14307,7 +14307,7 @@ var require_Node = __commonJS((exports) => {
14307
14307
  return copy;
14308
14308
  }
14309
14309
  toJS(doc2, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
14310
- if (!identity2.isDocument(doc2))
14310
+ if (!identity.isDocument(doc2))
14311
14311
  throw new TypeError("A document argument is required");
14312
14312
  const ctx = {
14313
14313
  anchors: new Map,
@@ -14331,13 +14331,13 @@ var require_Node = __commonJS((exports) => {
14331
14331
  var require_Alias = __commonJS((exports) => {
14332
14332
  var anchors = require_anchors();
14333
14333
  var visit = require_visit();
14334
- var identity2 = require_identity();
14334
+ var identity = require_identity();
14335
14335
  var Node = require_Node();
14336
14336
  var toJS = require_toJS();
14337
14337
 
14338
14338
  class Alias extends Node.NodeBase {
14339
14339
  constructor(source) {
14340
- super(identity2.ALIAS);
14340
+ super(identity.ALIAS);
14341
14341
  this.source = source;
14342
14342
  Object.defineProperty(this, "tag", {
14343
14343
  set() {
@@ -14353,7 +14353,7 @@ var require_Alias = __commonJS((exports) => {
14353
14353
  nodes = [];
14354
14354
  visit.visit(doc2, {
14355
14355
  Node: (_key, node) => {
14356
- if (identity2.isAlias(node) || identity2.hasAnchor(node))
14356
+ if (identity.isAlias(node) || identity.hasAnchor(node))
14357
14357
  nodes.push(node);
14358
14358
  }
14359
14359
  });
@@ -14413,11 +14413,11 @@ var require_Alias = __commonJS((exports) => {
14413
14413
  }
14414
14414
  }
14415
14415
  function getAliasCount(doc2, node, anchors2) {
14416
- if (identity2.isAlias(node)) {
14416
+ if (identity.isAlias(node)) {
14417
14417
  const source = node.resolve(doc2);
14418
14418
  const anchor = anchors2 && source && anchors2.get(source);
14419
14419
  return anchor ? anchor.count * anchor.aliasCount : 0;
14420
- } else if (identity2.isCollection(node)) {
14420
+ } else if (identity.isCollection(node)) {
14421
14421
  let count = 0;
14422
14422
  for (const item of node.items) {
14423
14423
  const c = getAliasCount(doc2, item, anchors2);
@@ -14425,7 +14425,7 @@ var require_Alias = __commonJS((exports) => {
14425
14425
  count = c;
14426
14426
  }
14427
14427
  return count;
14428
- } else if (identity2.isPair(node)) {
14428
+ } else if (identity.isPair(node)) {
14429
14429
  const kc = getAliasCount(doc2, node.key, anchors2);
14430
14430
  const vc = getAliasCount(doc2, node.value, anchors2);
14431
14431
  return Math.max(kc, vc);
@@ -14437,14 +14437,14 @@ var require_Alias = __commonJS((exports) => {
14437
14437
 
14438
14438
  // ../../node_modules/yaml/dist/nodes/Scalar.js
14439
14439
  var require_Scalar = __commonJS((exports) => {
14440
- var identity2 = require_identity();
14440
+ var identity = require_identity();
14441
14441
  var Node = require_Node();
14442
14442
  var toJS = require_toJS();
14443
14443
  var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
14444
14444
 
14445
14445
  class Scalar extends Node.NodeBase {
14446
14446
  constructor(value) {
14447
- super(identity2.SCALAR);
14447
+ super(identity.SCALAR);
14448
14448
  this.value = value;
14449
14449
  }
14450
14450
  toJSON(arg, ctx) {
@@ -14466,7 +14466,7 @@ var require_Scalar = __commonJS((exports) => {
14466
14466
  // ../../node_modules/yaml/dist/doc/createNode.js
14467
14467
  var require_createNode = __commonJS((exports) => {
14468
14468
  var Alias = require_Alias();
14469
- var identity2 = require_identity();
14469
+ var identity = require_identity();
14470
14470
  var Scalar = require_Scalar();
14471
14471
  var defaultTagPrefix = "tag:yaml.org,2002:";
14472
14472
  function findTagObject(value, tagName, tags) {
@@ -14480,12 +14480,12 @@ var require_createNode = __commonJS((exports) => {
14480
14480
  return tags.find((t) => t.identify?.(value) && !t.format);
14481
14481
  }
14482
14482
  function createNode(value, tagName, ctx) {
14483
- if (identity2.isDocument(value))
14483
+ if (identity.isDocument(value))
14484
14484
  value = value.contents;
14485
- if (identity2.isNode(value))
14485
+ if (identity.isNode(value))
14486
14486
  return value;
14487
- if (identity2.isPair(value)) {
14488
- const map2 = ctx.schema[identity2.MAP].createNode?.(ctx.schema, null, ctx);
14487
+ if (identity.isPair(value)) {
14488
+ const map2 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
14489
14489
  map2.items.push(value);
14490
14490
  return map2;
14491
14491
  }
@@ -14517,7 +14517,7 @@ var require_createNode = __commonJS((exports) => {
14517
14517
  ref.node = node2;
14518
14518
  return node2;
14519
14519
  }
14520
- tagObj = value instanceof Map ? schema[identity2.MAP] : (Symbol.iterator in Object(value)) ? schema[identity2.SEQ] : schema[identity2.MAP];
14520
+ tagObj = value instanceof Map ? schema[identity.MAP] : (Symbol.iterator in Object(value)) ? schema[identity.SEQ] : schema[identity.MAP];
14521
14521
  }
14522
14522
  if (onTagObj) {
14523
14523
  onTagObj(tagObj);
@@ -14538,7 +14538,7 @@ var require_createNode = __commonJS((exports) => {
14538
14538
  // ../../node_modules/yaml/dist/nodes/Collection.js
14539
14539
  var require_Collection = __commonJS((exports) => {
14540
14540
  var createNode = require_createNode();
14541
- var identity2 = require_identity();
14541
+ var identity = require_identity();
14542
14542
  var Node = require_Node();
14543
14543
  function collectionFromPath(schema, path, value) {
14544
14544
  let v = value;
@@ -14578,7 +14578,7 @@ var require_Collection = __commonJS((exports) => {
14578
14578
  const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
14579
14579
  if (schema)
14580
14580
  copy.schema = schema;
14581
- copy.items = copy.items.map((it) => identity2.isNode(it) || identity2.isPair(it) ? it.clone(schema) : it);
14581
+ copy.items = copy.items.map((it) => identity.isNode(it) || identity.isPair(it) ? it.clone(schema) : it);
14582
14582
  if (this.range)
14583
14583
  copy.range = this.range.slice();
14584
14584
  return copy;
@@ -14589,7 +14589,7 @@ var require_Collection = __commonJS((exports) => {
14589
14589
  else {
14590
14590
  const [key, ...rest] = path;
14591
14591
  const node = this.get(key, true);
14592
- if (identity2.isCollection(node))
14592
+ if (identity.isCollection(node))
14593
14593
  node.addIn(rest, value);
14594
14594
  else if (node === undefined && this.schema)
14595
14595
  this.set(key, collectionFromPath(this.schema, rest, value));
@@ -14602,7 +14602,7 @@ var require_Collection = __commonJS((exports) => {
14602
14602
  if (rest.length === 0)
14603
14603
  return this.delete(key);
14604
14604
  const node = this.get(key, true);
14605
- if (identity2.isCollection(node))
14605
+ if (identity.isCollection(node))
14606
14606
  return node.deleteIn(rest);
14607
14607
  else
14608
14608
  throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
@@ -14611,16 +14611,16 @@ var require_Collection = __commonJS((exports) => {
14611
14611
  const [key, ...rest] = path;
14612
14612
  const node = this.get(key, true);
14613
14613
  if (rest.length === 0)
14614
- return !keepScalar && identity2.isScalar(node) ? node.value : node;
14614
+ return !keepScalar && identity.isScalar(node) ? node.value : node;
14615
14615
  else
14616
- return identity2.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
14616
+ return identity.isCollection(node) ? node.getIn(rest, keepScalar) : undefined;
14617
14617
  }
14618
14618
  hasAllNullValues(allowScalar) {
14619
14619
  return this.items.every((node) => {
14620
- if (!identity2.isPair(node))
14620
+ if (!identity.isPair(node))
14621
14621
  return false;
14622
14622
  const n = node.value;
14623
- return n == null || allowScalar && identity2.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
14623
+ return n == null || allowScalar && identity.isScalar(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
14624
14624
  });
14625
14625
  }
14626
14626
  hasIn(path) {
@@ -14628,7 +14628,7 @@ var require_Collection = __commonJS((exports) => {
14628
14628
  if (rest.length === 0)
14629
14629
  return this.has(key);
14630
14630
  const node = this.get(key, true);
14631
- return identity2.isCollection(node) ? node.hasIn(rest) : false;
14631
+ return identity.isCollection(node) ? node.hasIn(rest) : false;
14632
14632
  }
14633
14633
  setIn(path, value) {
14634
14634
  const [key, ...rest] = path;
@@ -14636,7 +14636,7 @@ var require_Collection = __commonJS((exports) => {
14636
14636
  this.set(key, value);
14637
14637
  } else {
14638
14638
  const node = this.get(key, true);
14639
- if (identity2.isCollection(node))
14639
+ if (identity.isCollection(node))
14640
14640
  node.setIn(rest, value);
14641
14641
  else if (node === undefined && this.schema)
14642
14642
  this.set(key, collectionFromPath(this.schema, rest, value));
@@ -15105,7 +15105,7 @@ ${indent}`);
15105
15105
  // ../../node_modules/yaml/dist/stringify/stringify.js
15106
15106
  var require_stringify = __commonJS((exports) => {
15107
15107
  var anchors = require_anchors();
15108
- var identity2 = require_identity();
15108
+ var identity = require_identity();
15109
15109
  var stringifyComment = require_stringifyComment();
15110
15110
  var stringifyString = require_stringifyString();
15111
15111
  function createStringifyContext(doc2, options) {
@@ -15157,7 +15157,7 @@ var require_stringify = __commonJS((exports) => {
15157
15157
  }
15158
15158
  let tagObj = undefined;
15159
15159
  let obj;
15160
- if (identity2.isScalar(item)) {
15160
+ if (identity.isScalar(item)) {
15161
15161
  obj = item.value;
15162
15162
  let match = tags.filter((t) => t.identify?.(obj));
15163
15163
  if (match.length > 1) {
@@ -15180,7 +15180,7 @@ var require_stringify = __commonJS((exports) => {
15180
15180
  if (!doc2.directives)
15181
15181
  return "";
15182
15182
  const props = [];
15183
- const anchor = (identity2.isScalar(node) || identity2.isCollection(node)) && node.anchor;
15183
+ const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
15184
15184
  if (anchor && anchors.anchorIsValid(anchor)) {
15185
15185
  anchors$1.add(anchor);
15186
15186
  props.push(`&${anchor}`);
@@ -15191,9 +15191,9 @@ var require_stringify = __commonJS((exports) => {
15191
15191
  return props.join(" ");
15192
15192
  }
15193
15193
  function stringify(item, ctx, onComment, onChompKeep) {
15194
- if (identity2.isPair(item))
15194
+ if (identity.isPair(item))
15195
15195
  return item.toString(ctx, onComment, onChompKeep);
15196
- if (identity2.isAlias(item)) {
15196
+ if (identity.isAlias(item)) {
15197
15197
  if (ctx.doc.directives)
15198
15198
  return item.toString(ctx);
15199
15199
  if (ctx.resolvedAliases?.has(item)) {
@@ -15207,15 +15207,15 @@ var require_stringify = __commonJS((exports) => {
15207
15207
  }
15208
15208
  }
15209
15209
  let tagObj = undefined;
15210
- const node = identity2.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
15210
+ const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
15211
15211
  tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
15212
15212
  const props = stringifyProps(node, tagObj, ctx);
15213
15213
  if (props.length > 0)
15214
15214
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
15215
- const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity2.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
15215
+ const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : identity.isScalar(node) ? stringifyString.stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
15216
15216
  if (!props)
15217
15217
  return str;
15218
- return identity2.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
15218
+ return identity.isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
15219
15219
  ${ctx.indent}${str}`;
15220
15220
  }
15221
15221
  exports.createStringifyContext = createStringifyContext;
@@ -15224,23 +15224,23 @@ ${ctx.indent}${str}`;
15224
15224
 
15225
15225
  // ../../node_modules/yaml/dist/stringify/stringifyPair.js
15226
15226
  var require_stringifyPair = __commonJS((exports) => {
15227
- var identity2 = require_identity();
15227
+ var identity = require_identity();
15228
15228
  var Scalar = require_Scalar();
15229
15229
  var stringify = require_stringify();
15230
15230
  var stringifyComment = require_stringifyComment();
15231
15231
  function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
15232
15232
  const { allNullValues, doc: doc2, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
15233
- let keyComment = identity2.isNode(key) && key.comment || null;
15233
+ let keyComment = identity.isNode(key) && key.comment || null;
15234
15234
  if (simpleKeys) {
15235
15235
  if (keyComment) {
15236
15236
  throw new Error("With simple keys, key nodes cannot have comments");
15237
15237
  }
15238
- if (identity2.isCollection(key) || !identity2.isNode(key) && typeof key === "object") {
15238
+ if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
15239
15239
  const msg = "With simple keys, collection cannot be used as a key value";
15240
15240
  throw new Error(msg);
15241
15241
  }
15242
15242
  }
15243
- let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity2.isCollection(key) || (identity2.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object"));
15243
+ let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || identity.isCollection(key) || (identity.isScalar(key) ? key.type === Scalar.Scalar.BLOCK_FOLDED || key.type === Scalar.Scalar.BLOCK_LITERAL : typeof key === "object"));
15244
15244
  ctx = Object.assign({}, ctx, {
15245
15245
  allNullValues: false,
15246
15246
  implicitKey: !explicitKey && (simpleKeys || !allNullValues),
@@ -15281,7 +15281,7 @@ ${indent}:`;
15281
15281
  str += stringifyComment.lineComment(str, ctx.indent, commentString(keyComment));
15282
15282
  }
15283
15283
  let vsb, vcb, valueComment;
15284
- if (identity2.isNode(value)) {
15284
+ if (identity.isNode(value)) {
15285
15285
  vsb = !!value.spaceBefore;
15286
15286
  vcb = value.commentBefore;
15287
15287
  valueComment = value.comment;
@@ -15293,10 +15293,10 @@ ${indent}:`;
15293
15293
  value = doc2.createNode(value);
15294
15294
  }
15295
15295
  ctx.implicitKey = false;
15296
- if (!explicitKey && !keyComment && identity2.isScalar(value))
15296
+ if (!explicitKey && !keyComment && identity.isScalar(value))
15297
15297
  ctx.indentAtStart = str.length + 1;
15298
15298
  chompKeep = false;
15299
- if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity2.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
15299
+ if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && identity.isSeq(value) && !value.flow && !value.tag && !value.anchor) {
15300
15300
  ctx.indent = ctx.indent.substring(2);
15301
15301
  }
15302
15302
  let valueCommentDone = false;
@@ -15320,7 +15320,7 @@ ${stringifyComment.indentComment(cs, ctx.indent)}`;
15320
15320
  ws += `
15321
15321
  ${ctx.indent}`;
15322
15322
  }
15323
- } else if (!explicitKey && identity2.isCollection(value)) {
15323
+ } else if (!explicitKey && identity.isCollection(value)) {
15324
15324
  const vs0 = valueStr[0];
15325
15325
  const nl0 = valueStr.indexOf(`
15326
15326
  `);
@@ -15379,10 +15379,10 @@ var require_log = __commonJS((exports) => {
15379
15379
 
15380
15380
  // ../../node_modules/yaml/dist/schema/yaml-1.1/merge.js
15381
15381
  var require_merge = __commonJS((exports) => {
15382
- var identity2 = require_identity();
15382
+ var identity = require_identity();
15383
15383
  var Scalar = require_Scalar();
15384
15384
  var MERGE_KEY = "<<";
15385
- var merge3 = {
15385
+ var merge2 = {
15386
15386
  identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
15387
15387
  default: "key",
15388
15388
  tag: "tag:yaml.org,2002:merge",
@@ -15392,10 +15392,10 @@ var require_merge = __commonJS((exports) => {
15392
15392
  }),
15393
15393
  stringify: () => MERGE_KEY
15394
15394
  };
15395
- var isMergeKey = (ctx, key) => (merge3.identify(key) || identity2.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge3.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default);
15395
+ var isMergeKey = (ctx, key) => (merge2.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge2.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge2.tag && tag.default);
15396
15396
  function addMergeToJSMap(ctx, map2, value) {
15397
- value = ctx && identity2.isAlias(value) ? value.resolve(ctx.doc) : value;
15398
- if (identity2.isSeq(value))
15397
+ value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
15398
+ if (identity.isSeq(value))
15399
15399
  for (const it of value.items)
15400
15400
  mergeValue(ctx, map2, it);
15401
15401
  else if (Array.isArray(value))
@@ -15405,8 +15405,8 @@ var require_merge = __commonJS((exports) => {
15405
15405
  mergeValue(ctx, map2, value);
15406
15406
  }
15407
15407
  function mergeValue(ctx, map2, value) {
15408
- const source = ctx && identity2.isAlias(value) ? value.resolve(ctx.doc) : value;
15409
- if (!identity2.isMap(source))
15408
+ const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
15409
+ if (!identity.isMap(source))
15410
15410
  throw new Error("Merge sources must be maps or map aliases");
15411
15411
  const srcMap = source.toJSON(null, ctx, Map);
15412
15412
  for (const [key, value2] of srcMap) {
@@ -15428,21 +15428,21 @@ var require_merge = __commonJS((exports) => {
15428
15428
  }
15429
15429
  exports.addMergeToJSMap = addMergeToJSMap;
15430
15430
  exports.isMergeKey = isMergeKey;
15431
- exports.merge = merge3;
15431
+ exports.merge = merge2;
15432
15432
  });
15433
15433
 
15434
15434
  // ../../node_modules/yaml/dist/nodes/addPairToJSMap.js
15435
15435
  var require_addPairToJSMap = __commonJS((exports) => {
15436
15436
  var log = require_log();
15437
- var merge3 = require_merge();
15437
+ var merge2 = require_merge();
15438
15438
  var stringify = require_stringify();
15439
- var identity2 = require_identity();
15439
+ var identity = require_identity();
15440
15440
  var toJS = require_toJS();
15441
15441
  function addPairToJSMap(ctx, map2, { key, value }) {
15442
- if (identity2.isNode(key) && key.addToJSMap)
15442
+ if (identity.isNode(key) && key.addToJSMap)
15443
15443
  key.addToJSMap(ctx, map2, value);
15444
- else if (merge3.isMergeKey(ctx, key))
15445
- merge3.addMergeToJSMap(ctx, map2, value);
15444
+ else if (merge2.isMergeKey(ctx, key))
15445
+ merge2.addMergeToJSMap(ctx, map2, value);
15446
15446
  else {
15447
15447
  const jsKey = toJS.toJS(key, "", ctx);
15448
15448
  if (map2 instanceof Map) {
@@ -15470,7 +15470,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
15470
15470
  return "";
15471
15471
  if (typeof jsKey !== "object")
15472
15472
  return String(jsKey);
15473
- if (identity2.isNode(key) && ctx?.doc) {
15473
+ if (identity.isNode(key) && ctx?.doc) {
15474
15474
  const strCtx = stringify.createStringifyContext(ctx.doc, {});
15475
15475
  strCtx.anchors = new Set;
15476
15476
  for (const node of ctx.anchors.keys())
@@ -15497,7 +15497,7 @@ var require_Pair = __commonJS((exports) => {
15497
15497
  var createNode = require_createNode();
15498
15498
  var stringifyPair = require_stringifyPair();
15499
15499
  var addPairToJSMap = require_addPairToJSMap();
15500
- var identity2 = require_identity();
15500
+ var identity = require_identity();
15501
15501
  function createPair(key, value, ctx) {
15502
15502
  const k = createNode.createNode(key, undefined, ctx);
15503
15503
  const v = createNode.createNode(value, undefined, ctx);
@@ -15506,15 +15506,15 @@ var require_Pair = __commonJS((exports) => {
15506
15506
 
15507
15507
  class Pair {
15508
15508
  constructor(key, value = null) {
15509
- Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
15509
+ Object.defineProperty(this, identity.NODE_TYPE, { value: identity.PAIR });
15510
15510
  this.key = key;
15511
15511
  this.value = value;
15512
15512
  }
15513
15513
  clone(schema) {
15514
15514
  let { key, value } = this;
15515
- if (identity2.isNode(key))
15515
+ if (identity.isNode(key))
15516
15516
  key = key.clone(schema);
15517
- if (identity2.isNode(value))
15517
+ if (identity.isNode(value))
15518
15518
  value = value.clone(schema);
15519
15519
  return new Pair(key, value);
15520
15520
  }
@@ -15532,7 +15532,7 @@ var require_Pair = __commonJS((exports) => {
15532
15532
 
15533
15533
  // ../../node_modules/yaml/dist/stringify/stringifyCollection.js
15534
15534
  var require_stringifyCollection = __commonJS((exports) => {
15535
- var identity2 = require_identity();
15535
+ var identity = require_identity();
15536
15536
  var stringify = require_stringify();
15537
15537
  var stringifyComment = require_stringifyComment();
15538
15538
  function stringifyCollection(collection, ctx, options) {
@@ -15548,14 +15548,14 @@ var require_stringifyCollection = __commonJS((exports) => {
15548
15548
  for (let i = 0;i < items.length; ++i) {
15549
15549
  const item = items[i];
15550
15550
  let comment2 = null;
15551
- if (identity2.isNode(item)) {
15551
+ if (identity.isNode(item)) {
15552
15552
  if (!chompKeep && item.spaceBefore)
15553
15553
  lines.push("");
15554
15554
  addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
15555
15555
  if (item.comment)
15556
15556
  comment2 = item.comment;
15557
- } else if (identity2.isPair(item)) {
15558
- const ik = identity2.isNode(item.key) ? item.key : null;
15557
+ } else if (identity.isPair(item)) {
15558
+ const ik = identity.isNode(item.key) ? item.key : null;
15559
15559
  if (ik) {
15560
15560
  if (!chompKeep && ik.spaceBefore)
15561
15561
  lines.push("");
@@ -15605,14 +15605,14 @@ ${indent}${line}` : `
15605
15605
  for (let i = 0;i < items.length; ++i) {
15606
15606
  const item = items[i];
15607
15607
  let comment = null;
15608
- if (identity2.isNode(item)) {
15608
+ if (identity.isNode(item)) {
15609
15609
  if (item.spaceBefore)
15610
15610
  lines.push("");
15611
15611
  addCommentBefore(ctx, lines, item.commentBefore, false);
15612
15612
  if (item.comment)
15613
15613
  comment = item.comment;
15614
- } else if (identity2.isPair(item)) {
15615
- const ik = identity2.isNode(item.key) ? item.key : null;
15614
+ } else if (identity.isPair(item)) {
15615
+ const ik = identity.isNode(item.key) ? item.key : null;
15616
15616
  if (ik) {
15617
15617
  if (ik.spaceBefore)
15618
15618
  lines.push("");
@@ -15620,7 +15620,7 @@ ${indent}${line}` : `
15620
15620
  if (ik.comment)
15621
15621
  reqNewline = true;
15622
15622
  }
15623
- const iv = identity2.isNode(item.value) ? item.value : null;
15623
+ const iv = identity.isNode(item.value) ? item.value : null;
15624
15624
  if (iv) {
15625
15625
  if (iv.comment)
15626
15626
  comment = iv.comment;
@@ -15680,16 +15680,16 @@ var require_YAMLMap = __commonJS((exports) => {
15680
15680
  var stringifyCollection = require_stringifyCollection();
15681
15681
  var addPairToJSMap = require_addPairToJSMap();
15682
15682
  var Collection = require_Collection();
15683
- var identity2 = require_identity();
15683
+ var identity = require_identity();
15684
15684
  var Pair = require_Pair();
15685
15685
  var Scalar = require_Scalar();
15686
15686
  function findPair(items, key) {
15687
- const k = identity2.isScalar(key) ? key.value : key;
15687
+ const k = identity.isScalar(key) ? key.value : key;
15688
15688
  for (const it of items) {
15689
- if (identity2.isPair(it)) {
15689
+ if (identity.isPair(it)) {
15690
15690
  if (it.key === key || it.key === k)
15691
15691
  return it;
15692
- if (identity2.isScalar(it.key) && it.key.value === k)
15692
+ if (identity.isScalar(it.key) && it.key.value === k)
15693
15693
  return it;
15694
15694
  }
15695
15695
  }
@@ -15701,7 +15701,7 @@ var require_YAMLMap = __commonJS((exports) => {
15701
15701
  return "tag:yaml.org,2002:map";
15702
15702
  }
15703
15703
  constructor(schema) {
15704
- super(identity2.MAP, schema);
15704
+ super(identity.MAP, schema);
15705
15705
  this.items = [];
15706
15706
  }
15707
15707
  static from(schema, obj, ctx) {
@@ -15729,7 +15729,7 @@ var require_YAMLMap = __commonJS((exports) => {
15729
15729
  }
15730
15730
  add(pair, overwrite) {
15731
15731
  let _pair;
15732
- if (identity2.isPair(pair))
15732
+ if (identity.isPair(pair))
15733
15733
  _pair = pair;
15734
15734
  else if (!pair || typeof pair !== "object" || !("key" in pair)) {
15735
15735
  _pair = new Pair.Pair(pair, pair?.value);
@@ -15740,7 +15740,7 @@ var require_YAMLMap = __commonJS((exports) => {
15740
15740
  if (prev) {
15741
15741
  if (!overwrite)
15742
15742
  throw new Error(`Key ${_pair.key} already set`);
15743
- if (identity2.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
15743
+ if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))
15744
15744
  prev.value.value = _pair.value;
15745
15745
  else
15746
15746
  prev.value = _pair.value;
@@ -15764,7 +15764,7 @@ var require_YAMLMap = __commonJS((exports) => {
15764
15764
  get(key, keepScalar) {
15765
15765
  const it = findPair(this.items, key);
15766
15766
  const node = it?.value;
15767
- return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
15767
+ return (!keepScalar && identity.isScalar(node) ? node.value : node) ?? undefined;
15768
15768
  }
15769
15769
  has(key) {
15770
15770
  return !!findPair(this.items, key);
@@ -15784,7 +15784,7 @@ var require_YAMLMap = __commonJS((exports) => {
15784
15784
  if (!ctx)
15785
15785
  return JSON.stringify(this);
15786
15786
  for (const item of this.items) {
15787
- if (!identity2.isPair(item))
15787
+ if (!identity.isPair(item))
15788
15788
  throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
15789
15789
  }
15790
15790
  if (!ctx.allNullValues && this.hasAllNullValues(false))
@@ -15804,7 +15804,7 @@ var require_YAMLMap = __commonJS((exports) => {
15804
15804
 
15805
15805
  // ../../node_modules/yaml/dist/schema/common/map.js
15806
15806
  var require_map = __commonJS((exports) => {
15807
- var identity2 = require_identity();
15807
+ var identity = require_identity();
15808
15808
  var YAMLMap = require_YAMLMap();
15809
15809
  var map2 = {
15810
15810
  collection: "map",
@@ -15812,7 +15812,7 @@ var require_map = __commonJS((exports) => {
15812
15812
  nodeClass: YAMLMap.YAMLMap,
15813
15813
  tag: "tag:yaml.org,2002:map",
15814
15814
  resolve(map3, onError) {
15815
- if (!identity2.isMap(map3))
15815
+ if (!identity.isMap(map3))
15816
15816
  onError("Expected a mapping for this tag");
15817
15817
  return map3;
15818
15818
  },
@@ -15826,7 +15826,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15826
15826
  var createNode = require_createNode();
15827
15827
  var stringifyCollection = require_stringifyCollection();
15828
15828
  var Collection = require_Collection();
15829
- var identity2 = require_identity();
15829
+ var identity = require_identity();
15830
15830
  var Scalar = require_Scalar();
15831
15831
  var toJS = require_toJS();
15832
15832
 
@@ -15835,7 +15835,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15835
15835
  return "tag:yaml.org,2002:seq";
15836
15836
  }
15837
15837
  constructor(schema) {
15838
- super(identity2.SEQ, schema);
15838
+ super(identity.SEQ, schema);
15839
15839
  this.items = [];
15840
15840
  }
15841
15841
  add(value) {
@@ -15853,7 +15853,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15853
15853
  if (typeof idx !== "number")
15854
15854
  return;
15855
15855
  const it = this.items[idx];
15856
- return !keepScalar && identity2.isScalar(it) ? it.value : it;
15856
+ return !keepScalar && identity.isScalar(it) ? it.value : it;
15857
15857
  }
15858
15858
  has(key) {
15859
15859
  const idx = asItemIndex(key);
@@ -15864,7 +15864,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15864
15864
  if (typeof idx !== "number")
15865
15865
  throw new Error(`Expected a valid index, not ${key}.`);
15866
15866
  const prev = this.items[idx];
15867
- if (identity2.isScalar(prev) && Scalar.isScalarValue(value))
15867
+ if (identity.isScalar(prev) && Scalar.isScalarValue(value))
15868
15868
  prev.value = value;
15869
15869
  else
15870
15870
  this.items[idx] = value;
@@ -15906,7 +15906,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15906
15906
  }
15907
15907
  }
15908
15908
  function asItemIndex(key) {
15909
- let idx = identity2.isScalar(key) ? key.value : key;
15909
+ let idx = identity.isScalar(key) ? key.value : key;
15910
15910
  if (idx && typeof idx === "string")
15911
15911
  idx = Number(idx);
15912
15912
  return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
@@ -15916,7 +15916,7 @@ var require_YAMLSeq = __commonJS((exports) => {
15916
15916
 
15917
15917
  // ../../node_modules/yaml/dist/schema/common/seq.js
15918
15918
  var require_seq = __commonJS((exports) => {
15919
- var identity2 = require_identity();
15919
+ var identity = require_identity();
15920
15920
  var YAMLSeq = require_YAMLSeq();
15921
15921
  var seq = {
15922
15922
  collection: "seq",
@@ -15924,7 +15924,7 @@ var require_seq = __commonJS((exports) => {
15924
15924
  nodeClass: YAMLSeq.YAMLSeq,
15925
15925
  tag: "tag:yaml.org,2002:seq",
15926
15926
  resolve(seq2, onError) {
15927
- if (!identity2.isSeq(seq2))
15927
+ if (!identity.isSeq(seq2))
15928
15928
  onError("Expected a sequence for this tag");
15929
15929
  return seq2;
15930
15930
  },
@@ -15952,29 +15952,29 @@ var require_string = __commonJS((exports) => {
15952
15952
  // ../../node_modules/yaml/dist/schema/common/null.js
15953
15953
  var require_null = __commonJS((exports) => {
15954
15954
  var Scalar = require_Scalar();
15955
- var nullTag2 = {
15955
+ var nullTag = {
15956
15956
  identify: (value) => value == null,
15957
15957
  createNode: () => new Scalar.Scalar(null),
15958
15958
  default: true,
15959
15959
  tag: "tag:yaml.org,2002:null",
15960
15960
  test: /^(?:~|[Nn]ull|NULL)?$/,
15961
15961
  resolve: () => new Scalar.Scalar(null),
15962
- stringify: ({ source }, ctx) => typeof source === "string" && nullTag2.test.test(source) ? source : ctx.options.nullStr
15962
+ stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
15963
15963
  };
15964
- exports.nullTag = nullTag2;
15964
+ exports.nullTag = nullTag;
15965
15965
  });
15966
15966
 
15967
15967
  // ../../node_modules/yaml/dist/schema/core/bool.js
15968
15968
  var require_bool = __commonJS((exports) => {
15969
15969
  var Scalar = require_Scalar();
15970
- var boolTag2 = {
15970
+ var boolTag = {
15971
15971
  identify: (value) => typeof value === "boolean",
15972
15972
  default: true,
15973
15973
  tag: "tag:yaml.org,2002:bool",
15974
15974
  test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
15975
15975
  resolve: (str) => new Scalar.Scalar(str[0] === "t" || str[0] === "T"),
15976
15976
  stringify({ source, value }, ctx) {
15977
- if (source && boolTag2.test.test(source)) {
15977
+ if (source && boolTag.test.test(source)) {
15978
15978
  const sv = source[0] === "t" || source[0] === "T";
15979
15979
  if (value === sv)
15980
15980
  return source;
@@ -15982,7 +15982,7 @@ var require_bool = __commonJS((exports) => {
15982
15982
  return value ? ctx.options.trueStr : ctx.options.falseStr;
15983
15983
  }
15984
15984
  };
15985
- exports.boolTag = boolTag2;
15985
+ exports.boolTag = boolTag;
15986
15986
  });
15987
15987
 
15988
15988
  // ../../node_modules/yaml/dist/stringify/stringifyNumber.js
@@ -16240,17 +16240,17 @@ var require_binary = __commonJS((exports) => {
16240
16240
 
16241
16241
  // ../../node_modules/yaml/dist/schema/yaml-1.1/pairs.js
16242
16242
  var require_pairs = __commonJS((exports) => {
16243
- var identity2 = require_identity();
16243
+ var identity = require_identity();
16244
16244
  var Pair = require_Pair();
16245
16245
  var Scalar = require_Scalar();
16246
16246
  var YAMLSeq = require_YAMLSeq();
16247
16247
  function resolvePairs(seq, onError) {
16248
- if (identity2.isSeq(seq)) {
16248
+ if (identity.isSeq(seq)) {
16249
16249
  for (let i = 0;i < seq.items.length; ++i) {
16250
16250
  let item = seq.items[i];
16251
- if (identity2.isPair(item))
16251
+ if (identity.isPair(item))
16252
16252
  continue;
16253
- else if (identity2.isMap(item)) {
16253
+ else if (identity.isMap(item)) {
16254
16254
  if (item.items.length > 1)
16255
16255
  onError("Each pair must have its own sequence indicator");
16256
16256
  const pair = item.items[0] || new Pair.Pair(new Scalar.Scalar(null));
@@ -16264,7 +16264,7 @@ ${cn.comment}` : item.comment;
16264
16264
  }
16265
16265
  item = pair;
16266
16266
  }
16267
- seq.items[i] = identity2.isPair(item) ? item : new Pair.Pair(item);
16267
+ seq.items[i] = identity.isPair(item) ? item : new Pair.Pair(item);
16268
16268
  }
16269
16269
  } else
16270
16270
  onError("Expected a sequence for this tag");
@@ -16315,7 +16315,7 @@ ${cn.comment}` : item.comment;
16315
16315
 
16316
16316
  // ../../node_modules/yaml/dist/schema/yaml-1.1/omap.js
16317
16317
  var require_omap = __commonJS((exports) => {
16318
- var identity2 = require_identity();
16318
+ var identity = require_identity();
16319
16319
  var toJS = require_toJS();
16320
16320
  var YAMLMap = require_YAMLMap();
16321
16321
  var YAMLSeq = require_YAMLSeq();
@@ -16339,7 +16339,7 @@ var require_omap = __commonJS((exports) => {
16339
16339
  ctx.onCreate(map2);
16340
16340
  for (const pair of this.items) {
16341
16341
  let key, value;
16342
- if (identity2.isPair(pair)) {
16342
+ if (identity.isPair(pair)) {
16343
16343
  key = toJS.toJS(pair.key, "", ctx);
16344
16344
  value = toJS.toJS(pair.value, key, ctx);
16345
16345
  } else {
@@ -16369,7 +16369,7 @@ var require_omap = __commonJS((exports) => {
16369
16369
  const pairs$1 = pairs.resolvePairs(seq, onError);
16370
16370
  const seenKeys = [];
16371
16371
  for (const { key } of pairs$1.items) {
16372
- if (identity2.isScalar(key)) {
16372
+ if (identity.isScalar(key)) {
16373
16373
  if (seenKeys.includes(key.value)) {
16374
16374
  onError(`Ordered maps must not include duplicate keys: ${key.value}`);
16375
16375
  } else {
@@ -16538,7 +16538,7 @@ var require_int2 = __commonJS((exports) => {
16538
16538
 
16539
16539
  // ../../node_modules/yaml/dist/schema/yaml-1.1/set.js
16540
16540
  var require_set = __commonJS((exports) => {
16541
- var identity2 = require_identity();
16541
+ var identity = require_identity();
16542
16542
  var Pair = require_Pair();
16543
16543
  var YAMLMap = require_YAMLMap();
16544
16544
 
@@ -16549,7 +16549,7 @@ var require_set = __commonJS((exports) => {
16549
16549
  }
16550
16550
  add(key) {
16551
16551
  let pair;
16552
- if (identity2.isPair(key))
16552
+ if (identity.isPair(key))
16553
16553
  pair = key;
16554
16554
  else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
16555
16555
  pair = new Pair.Pair(key.key, null);
@@ -16561,7 +16561,7 @@ var require_set = __commonJS((exports) => {
16561
16561
  }
16562
16562
  get(key, keepPair) {
16563
16563
  const pair = YAMLMap.findPair(this.items, key);
16564
- return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
16564
+ return !keepPair && identity.isPair(pair) ? identity.isScalar(pair.key) ? pair.key.value : pair.key : pair;
16565
16565
  }
16566
16566
  set(key, value) {
16567
16567
  if (typeof value !== "boolean")
@@ -16586,18 +16586,18 @@ var require_set = __commonJS((exports) => {
16586
16586
  }
16587
16587
  static from(schema, iterable, ctx) {
16588
16588
  const { replacer } = ctx;
16589
- const set4 = new this(schema);
16589
+ const set3 = new this(schema);
16590
16590
  if (iterable && Symbol.iterator in Object(iterable))
16591
16591
  for (let value of iterable) {
16592
16592
  if (typeof replacer === "function")
16593
16593
  value = replacer.call(iterable, value, value);
16594
- set4.items.push(Pair.createPair(value, null, ctx));
16594
+ set3.items.push(Pair.createPair(value, null, ctx));
16595
16595
  }
16596
- return set4;
16596
+ return set3;
16597
16597
  }
16598
16598
  }
16599
16599
  YAMLSet.tag = "tag:yaml.org,2002:set";
16600
- var set3 = {
16600
+ var set2 = {
16601
16601
  collection: "map",
16602
16602
  identify: (value) => value instanceof Set,
16603
16603
  nodeClass: YAMLSet,
@@ -16605,7 +16605,7 @@ var require_set = __commonJS((exports) => {
16605
16605
  tag: "tag:yaml.org,2002:set",
16606
16606
  createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
16607
16607
  resolve(map2, onError) {
16608
- if (identity2.isMap(map2)) {
16608
+ if (identity.isMap(map2)) {
16609
16609
  if (map2.hasAllNullValues(true))
16610
16610
  return Object.assign(new YAMLSet, map2);
16611
16611
  else
@@ -16616,7 +16616,7 @@ var require_set = __commonJS((exports) => {
16616
16616
  }
16617
16617
  };
16618
16618
  exports.YAMLSet = YAMLSet;
16619
- exports.set = set3;
16619
+ exports.set = set2;
16620
16620
  });
16621
16621
 
16622
16622
  // ../../node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
@@ -16711,10 +16711,10 @@ var require_schema3 = __commonJS((exports) => {
16711
16711
  var bool = require_bool2();
16712
16712
  var float = require_float2();
16713
16713
  var int2 = require_int2();
16714
- var merge3 = require_merge();
16714
+ var merge2 = require_merge();
16715
16715
  var omap = require_omap();
16716
16716
  var pairs = require_pairs();
16717
- var set3 = require_set();
16717
+ var set2 = require_set();
16718
16718
  var timestamp = require_timestamp();
16719
16719
  var schema = [
16720
16720
  map2.map,
@@ -16731,10 +16731,10 @@ var require_schema3 = __commonJS((exports) => {
16731
16731
  float.floatExp,
16732
16732
  float.float,
16733
16733
  binary.binary,
16734
- merge3.merge,
16734
+ merge2.merge,
16735
16735
  omap.omap,
16736
16736
  pairs.pairs,
16737
- set3.set,
16737
+ set2.set,
16738
16738
  timestamp.intTime,
16739
16739
  timestamp.floatTime,
16740
16740
  timestamp.timestamp
@@ -16754,11 +16754,11 @@ var require_tags = __commonJS((exports) => {
16754
16754
  var schema = require_schema();
16755
16755
  var schema$1 = require_schema2();
16756
16756
  var binary = require_binary();
16757
- var merge3 = require_merge();
16757
+ var merge2 = require_merge();
16758
16758
  var omap = require_omap();
16759
16759
  var pairs = require_pairs();
16760
16760
  var schema$2 = require_schema3();
16761
- var set3 = require_set();
16761
+ var set2 = require_set();
16762
16762
  var timestamp = require_timestamp();
16763
16763
  var schemas3 = new Map([
16764
16764
  ["core", schema.schema],
@@ -16779,26 +16779,26 @@ var require_tags = __commonJS((exports) => {
16779
16779
  intOct: int2.intOct,
16780
16780
  intTime: timestamp.intTime,
16781
16781
  map: map2.map,
16782
- merge: merge3.merge,
16782
+ merge: merge2.merge,
16783
16783
  null: _null4.nullTag,
16784
16784
  omap: omap.omap,
16785
16785
  pairs: pairs.pairs,
16786
16786
  seq: seq.seq,
16787
- set: set3.set,
16787
+ set: set2.set,
16788
16788
  timestamp: timestamp.timestamp
16789
16789
  };
16790
16790
  var coreKnownTags = {
16791
16791
  "tag:yaml.org,2002:binary": binary.binary,
16792
- "tag:yaml.org,2002:merge": merge3.merge,
16792
+ "tag:yaml.org,2002:merge": merge2.merge,
16793
16793
  "tag:yaml.org,2002:omap": omap.omap,
16794
16794
  "tag:yaml.org,2002:pairs": pairs.pairs,
16795
- "tag:yaml.org,2002:set": set3.set,
16795
+ "tag:yaml.org,2002:set": set2.set,
16796
16796
  "tag:yaml.org,2002:timestamp": timestamp.timestamp
16797
16797
  };
16798
16798
  function getTags(customTags, schemaName, addMergeTag) {
16799
16799
  const schemaTags = schemas3.get(schemaName);
16800
16800
  if (schemaTags && !customTags) {
16801
- return addMergeTag && !schemaTags.includes(merge3.merge) ? schemaTags.concat(merge3.merge) : schemaTags.slice();
16801
+ return addMergeTag && !schemaTags.includes(merge2.merge) ? schemaTags.concat(merge2.merge) : schemaTags.slice();
16802
16802
  }
16803
16803
  let tags = schemaTags;
16804
16804
  if (!tags) {
@@ -16816,7 +16816,7 @@ var require_tags = __commonJS((exports) => {
16816
16816
  tags = customTags(tags.slice());
16817
16817
  }
16818
16818
  if (addMergeTag)
16819
- tags = tags.concat(merge3.merge);
16819
+ tags = tags.concat(merge2.merge);
16820
16820
  return tags.reduce((tags2, tag) => {
16821
16821
  const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
16822
16822
  if (!tagObj) {
@@ -16835,7 +16835,7 @@ var require_tags = __commonJS((exports) => {
16835
16835
 
16836
16836
  // ../../node_modules/yaml/dist/schema/Schema.js
16837
16837
  var require_Schema = __commonJS((exports) => {
16838
- var identity2 = require_identity();
16838
+ var identity = require_identity();
16839
16839
  var map2 = require_map();
16840
16840
  var seq = require_seq();
16841
16841
  var string4 = require_string();
@@ -16843,15 +16843,15 @@ var require_Schema = __commonJS((exports) => {
16843
16843
  var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
16844
16844
 
16845
16845
  class Schema {
16846
- constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
16846
+ constructor({ compat: compat2, customTags, merge: merge2, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
16847
16847
  this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
16848
16848
  this.name = typeof schema === "string" && schema || "core";
16849
16849
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
16850
- this.tags = tags.getTags(customTags, this.name, merge3);
16850
+ this.tags = tags.getTags(customTags, this.name, merge2);
16851
16851
  this.toStringOptions = toStringDefaults ?? null;
16852
- Object.defineProperty(this, identity2.MAP, { value: map2.map });
16853
- Object.defineProperty(this, identity2.SCALAR, { value: string4.string });
16854
- Object.defineProperty(this, identity2.SEQ, { value: seq.seq });
16852
+ Object.defineProperty(this, identity.MAP, { value: map2.map });
16853
+ Object.defineProperty(this, identity.SCALAR, { value: string4.string });
16854
+ Object.defineProperty(this, identity.SEQ, { value: seq.seq });
16855
16855
  this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
16856
16856
  }
16857
16857
  clone() {
@@ -16865,7 +16865,7 @@ var require_Schema = __commonJS((exports) => {
16865
16865
 
16866
16866
  // ../../node_modules/yaml/dist/stringify/stringifyDocument.js
16867
16867
  var require_stringifyDocument = __commonJS((exports) => {
16868
- var identity2 = require_identity();
16868
+ var identity = require_identity();
16869
16869
  var stringify = require_stringify();
16870
16870
  var stringifyComment = require_stringifyComment();
16871
16871
  function stringifyDocument(doc2, options) {
@@ -16892,7 +16892,7 @@ var require_stringifyDocument = __commonJS((exports) => {
16892
16892
  let chompKeep = false;
16893
16893
  let contentComment = null;
16894
16894
  if (doc2.contents) {
16895
- if (identity2.isNode(doc2.contents)) {
16895
+ if (identity.isNode(doc2.contents)) {
16896
16896
  if (doc2.contents.spaceBefore && hasDirectives)
16897
16897
  lines.push("");
16898
16898
  if (doc2.contents.commentBefore) {
@@ -16947,7 +16947,7 @@ var require_stringifyDocument = __commonJS((exports) => {
16947
16947
  var require_Document = __commonJS((exports) => {
16948
16948
  var Alias = require_Alias();
16949
16949
  var Collection = require_Collection();
16950
- var identity2 = require_identity();
16950
+ var identity = require_identity();
16951
16951
  var Pair = require_Pair();
16952
16952
  var toJS = require_toJS();
16953
16953
  var Schema = require_Schema();
@@ -16963,7 +16963,7 @@ var require_Document = __commonJS((exports) => {
16963
16963
  this.comment = null;
16964
16964
  this.errors = [];
16965
16965
  this.warnings = [];
16966
- Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.DOC });
16966
+ Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
16967
16967
  let _replacer = null;
16968
16968
  if (typeof replacer === "function" || Array.isArray(replacer)) {
16969
16969
  _replacer = replacer;
@@ -16994,7 +16994,7 @@ var require_Document = __commonJS((exports) => {
16994
16994
  }
16995
16995
  clone() {
16996
16996
  const copy = Object.create(Document.prototype, {
16997
- [identity2.NODE_TYPE]: { value: identity2.DOC }
16997
+ [identity.NODE_TYPE]: { value: identity.DOC }
16998
16998
  });
16999
16999
  copy.commentBefore = this.commentBefore;
17000
17000
  copy.comment = this.comment;
@@ -17004,7 +17004,7 @@ var require_Document = __commonJS((exports) => {
17004
17004
  if (this.directives)
17005
17005
  copy.directives = this.directives.clone();
17006
17006
  copy.schema = this.schema.clone();
17007
- copy.contents = identity2.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
17007
+ copy.contents = identity.isNode(this.contents) ? this.contents.clone(copy.schema) : this.contents;
17008
17008
  if (this.range)
17009
17009
  copy.range = this.range.slice();
17010
17010
  return copy;
@@ -17051,7 +17051,7 @@ var require_Document = __commonJS((exports) => {
17051
17051
  sourceObjects
17052
17052
  };
17053
17053
  const node = createNode.createNode(value, tag, ctx);
17054
- if (flow && identity2.isCollection(node))
17054
+ if (flow && identity.isCollection(node))
17055
17055
  node.flow = true;
17056
17056
  setAnchors();
17057
17057
  return node;
@@ -17074,20 +17074,20 @@ var require_Document = __commonJS((exports) => {
17074
17074
  return assertCollection(this.contents) ? this.contents.deleteIn(path) : false;
17075
17075
  }
17076
17076
  get(key, keepScalar) {
17077
- return identity2.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined;
17077
+ return identity.isCollection(this.contents) ? this.contents.get(key, keepScalar) : undefined;
17078
17078
  }
17079
17079
  getIn(path, keepScalar) {
17080
17080
  if (Collection.isEmptyPath(path))
17081
- return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
17082
- return identity2.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : undefined;
17081
+ return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
17082
+ return identity.isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : undefined;
17083
17083
  }
17084
17084
  has(key) {
17085
- return identity2.isCollection(this.contents) ? this.contents.has(key) : false;
17085
+ return identity.isCollection(this.contents) ? this.contents.has(key) : false;
17086
17086
  }
17087
17087
  hasIn(path) {
17088
17088
  if (Collection.isEmptyPath(path))
17089
17089
  return this.contents !== undefined;
17090
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path) : false;
17090
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
17091
17091
  }
17092
17092
  set(key, value) {
17093
17093
  if (this.contents == null) {
@@ -17171,7 +17171,7 @@ var require_Document = __commonJS((exports) => {
17171
17171
  }
17172
17172
  }
17173
17173
  function assertCollection(contents) {
17174
- if (identity2.isCollection(contents))
17174
+ if (identity.isCollection(contents))
17175
17175
  return true;
17176
17176
  throw new Error("Expected a YAML collection as document contents");
17177
17177
  }
@@ -17430,12 +17430,12 @@ var require_util_flow_indent_check = __commonJS((exports) => {
17430
17430
 
17431
17431
  // ../../node_modules/yaml/dist/compose/util-map-includes.js
17432
17432
  var require_util_map_includes = __commonJS((exports) => {
17433
- var identity2 = require_identity();
17433
+ var identity = require_identity();
17434
17434
  function mapIncludes(ctx, items, search) {
17435
17435
  const { uniqueKeys } = ctx.options;
17436
17436
  if (uniqueKeys === false)
17437
17437
  return false;
17438
- const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity2.isScalar(a) && identity2.isScalar(b) && a.value === b.value;
17438
+ const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
17439
17439
  return items.some((pair) => isEqual(pair.key, search));
17440
17440
  }
17441
17441
  exports.mapIncludes = mapIncludes;
@@ -17638,7 +17638,7 @@ var require_resolve_end = __commonJS((exports) => {
17638
17638
 
17639
17639
  // ../../node_modules/yaml/dist/compose/resolve-flow-collection.js
17640
17640
  var require_resolve_flow_collection = __commonJS((exports) => {
17641
- var identity2 = require_identity();
17641
+ var identity = require_identity();
17642
17642
  var Pair = require_Pair();
17643
17643
  var YAMLMap = require_YAMLMap();
17644
17644
  var YAMLSeq = require_YAMLSeq();
@@ -17714,7 +17714,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
17714
17714
  }
17715
17715
  if (prevItemComment) {
17716
17716
  let prev = coll.items[coll.items.length - 1];
17717
- if (identity2.isPair(prev))
17717
+ if (identity.isPair(prev))
17718
17718
  prev = prev.value ?? prev.key;
17719
17719
  if (prev.comment)
17720
17720
  prev.comment += `
@@ -17829,7 +17829,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
17829
17829
 
17830
17830
  // ../../node_modules/yaml/dist/compose/compose-collection.js
17831
17831
  var require_compose_collection = __commonJS((exports) => {
17832
- var identity2 = require_identity();
17832
+ var identity = require_identity();
17833
17833
  var Scalar = require_Scalar();
17834
17834
  var YAMLMap = require_YAMLMap();
17835
17835
  var YAMLSeq = require_YAMLSeq();
@@ -17879,7 +17879,7 @@ var require_compose_collection = __commonJS((exports) => {
17879
17879
  }
17880
17880
  const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
17881
17881
  const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
17882
- const node = identity2.isNode(res) ? res : new Scalar.Scalar(res);
17882
+ const node = identity.isNode(res) ? res : new Scalar.Scalar(res);
17883
17883
  node.range = coll.range;
17884
17884
  node.tag = tagName;
17885
17885
  if (tag?.format)
@@ -18300,7 +18300,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
18300
18300
 
18301
18301
  // ../../node_modules/yaml/dist/compose/compose-scalar.js
18302
18302
  var require_compose_scalar = __commonJS((exports) => {
18303
- var identity2 = require_identity();
18303
+ var identity = require_identity();
18304
18304
  var Scalar = require_Scalar();
18305
18305
  var resolveBlockScalar = require_resolve_block_scalar();
18306
18306
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -18309,17 +18309,17 @@ var require_compose_scalar = __commonJS((exports) => {
18309
18309
  const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
18310
18310
  let tag;
18311
18311
  if (ctx.options.stringKeys && ctx.atKey) {
18312
- tag = ctx.schema[identity2.SCALAR];
18312
+ tag = ctx.schema[identity.SCALAR];
18313
18313
  } else if (tagName)
18314
18314
  tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
18315
18315
  else if (token.type === "scalar")
18316
18316
  tag = findScalarTagByTest(ctx, value, token, onError);
18317
18317
  else
18318
- tag = ctx.schema[identity2.SCALAR];
18318
+ tag = ctx.schema[identity.SCALAR];
18319
18319
  let scalar;
18320
18320
  try {
18321
18321
  const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
18322
- scalar = identity2.isScalar(res) ? res : new Scalar.Scalar(res);
18322
+ scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
18323
18323
  } catch (error46) {
18324
18324
  const msg = error46 instanceof Error ? error46.message : String(error46);
18325
18325
  onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
@@ -18339,7 +18339,7 @@ var require_compose_scalar = __commonJS((exports) => {
18339
18339
  }
18340
18340
  function findScalarTagByName(schema, value, tagName, tagToken, onError) {
18341
18341
  if (tagName === "!")
18342
- return schema[identity2.SCALAR];
18342
+ return schema[identity.SCALAR];
18343
18343
  const matchWithTest = [];
18344
18344
  for (const tag of schema.tags) {
18345
18345
  if (!tag.collection && tag.tag === tagName) {
@@ -18358,12 +18358,12 @@ var require_compose_scalar = __commonJS((exports) => {
18358
18358
  return kt;
18359
18359
  }
18360
18360
  onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
18361
- return schema[identity2.SCALAR];
18361
+ return schema[identity.SCALAR];
18362
18362
  }
18363
18363
  function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
18364
- const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity2.SCALAR];
18364
+ const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
18365
18365
  if (schema.compat) {
18366
- const compat2 = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity2.SCALAR];
18366
+ const compat2 = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
18367
18367
  if (tag.tag !== compat2.tag) {
18368
18368
  const ts = directives.tagString(tag.tag);
18369
18369
  const cs = directives.tagString(compat2.tag);
@@ -18406,7 +18406,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
18406
18406
  // ../../node_modules/yaml/dist/compose/compose-node.js
18407
18407
  var require_compose_node = __commonJS((exports) => {
18408
18408
  var Alias = require_Alias();
18409
- var identity2 = require_identity();
18409
+ var identity = require_identity();
18410
18410
  var composeCollection = require_compose_collection();
18411
18411
  var composeScalar = require_compose_scalar();
18412
18412
  var resolveEnd = require_resolve_end();
@@ -18447,7 +18447,7 @@ var require_compose_node = __commonJS((exports) => {
18447
18447
  }
18448
18448
  if (anchor && node.anchor === "")
18449
18449
  onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
18450
- if (atKey && ctx.options.stringKeys && (!identity2.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
18450
+ if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
18451
18451
  const msg = "With stringKeys, all keys must be strings";
18452
18452
  onError(tag ?? token, "NON_STRING_KEY", msg);
18453
18453
  }
@@ -18547,7 +18547,7 @@ var require_composer = __commonJS((exports) => {
18547
18547
  var directives = require_directives();
18548
18548
  var Document = require_Document();
18549
18549
  var errors3 = require_errors();
18550
- var identity2 = require_identity();
18550
+ var identity = require_identity();
18551
18551
  var composeDoc = require_compose_doc();
18552
18552
  var resolveEnd = require_resolve_end();
18553
18553
  function getErrorPos(src) {
@@ -18613,9 +18613,9 @@ var require_composer = __commonJS((exports) => {
18613
18613
  ${comment}` : comment;
18614
18614
  } else if (afterEmptyLine || doc2.directives.docStart || !dc) {
18615
18615
  doc2.commentBefore = comment;
18616
- } else if (identity2.isCollection(dc) && !dc.flow && dc.items.length > 0) {
18616
+ } else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
18617
18617
  let it = dc.items[0];
18618
- if (identity2.isPair(it))
18618
+ if (identity.isPair(it))
18619
18619
  it = it.key;
18620
18620
  const cb = it.commentBefore;
18621
18621
  it.commentBefore = cb ? `${comment}
@@ -20607,7 +20607,7 @@ var require_public_api = __commonJS((exports) => {
20607
20607
  var Document = require_Document();
20608
20608
  var errors3 = require_errors();
20609
20609
  var log = require_log();
20610
- var identity2 = require_identity();
20610
+ var identity = require_identity();
20611
20611
  var lineCounter = require_line_counter();
20612
20612
  var parser = require_parser();
20613
20613
  function parseOptions(options) {
@@ -20685,7 +20685,7 @@ var require_public_api = __commonJS((exports) => {
20685
20685
  if (!keepUndefined)
20686
20686
  return;
20687
20687
  }
20688
- if (identity2.isDocument(value) && !_replacer)
20688
+ if (identity.isDocument(value) && !_replacer)
20689
20689
  return value.toString(options);
20690
20690
  return new Document.Document(value, _replacer, options).toString(options);
20691
20691
  }
@@ -37660,7 +37660,7 @@ var {
37660
37660
  Help
37661
37661
  } = import__.default;
37662
37662
  // package.json
37663
- var version = "0.9.78";
37663
+ var version = "0.9.79";
37664
37664
 
37665
37665
  // src/commands/code.ts
37666
37666
  import { readFile as readFile4 } from "node:fs/promises";
@@ -64146,7 +64146,575 @@ var agentWorkflow = async (input, { step, tools, logger }) => {
64146
64146
  await event("end-task", { kind: "EndTask" /* EndTask */, exitReason: { type: "UsageExceeded", messages } });
64147
64147
  throw new Error("Maximum number of tool round trips reached.");
64148
64148
  };
64149
+ // ../../node_modules/yaml/dist/index.js
64150
+ var composer = require_composer();
64151
+ var Document = require_Document();
64152
+ var Schema = require_Schema();
64153
+ var errors3 = require_errors();
64154
+ var Alias = require_Alias();
64155
+ var identity = require_identity();
64156
+ var Pair = require_Pair();
64157
+ var Scalar = require_Scalar();
64158
+ var YAMLMap = require_YAMLMap();
64159
+ var YAMLSeq = require_YAMLSeq();
64160
+ var cst = require_cst();
64161
+ var lexer = require_lexer();
64162
+ var lineCounter = require_line_counter();
64163
+ var parser = require_parser();
64164
+ var publicApi = require_public_api();
64165
+ var visit = require_visit();
64166
+ var $Composer = composer.Composer;
64167
+ var $Document = Document.Document;
64168
+ var $Schema = Schema.Schema;
64169
+ var $YAMLError = errors3.YAMLError;
64170
+ var $YAMLParseError = errors3.YAMLParseError;
64171
+ var $YAMLWarning = errors3.YAMLWarning;
64172
+ var $Alias = Alias.Alias;
64173
+ var $isAlias = identity.isAlias;
64174
+ var $isCollection = identity.isCollection;
64175
+ var $isDocument = identity.isDocument;
64176
+ var $isMap = identity.isMap;
64177
+ var $isNode = identity.isNode;
64178
+ var $isPair = identity.isPair;
64179
+ var $isScalar = identity.isScalar;
64180
+ var $isSeq = identity.isSeq;
64181
+ var $Pair = Pair.Pair;
64182
+ var $Scalar = Scalar.Scalar;
64183
+ var $YAMLMap = YAMLMap.YAMLMap;
64184
+ var $YAMLSeq = YAMLSeq.YAMLSeq;
64185
+ var $Lexer = lexer.Lexer;
64186
+ var $LineCounter = lineCounter.LineCounter;
64187
+ var $Parser = parser.Parser;
64188
+ var $parse = publicApi.parse;
64189
+ var $parseAllDocuments = publicApi.parseAllDocuments;
64190
+ var $parseDocument = publicApi.parseDocument;
64191
+ var $stringify = publicApi.stringify;
64192
+ var $visit = visit.visit;
64193
+ var $visitAsync = visit.visitAsync;
64194
+
64195
+ // ../core/src/workflow/dynamic-types.ts
64196
+ var WorkflowInputDefinitionSchema = exports_external.object({
64197
+ id: exports_external.string(),
64198
+ description: exports_external.string().nullish(),
64199
+ default: exports_external.any().nullish()
64200
+ });
64201
+ var WorkflowStepDefinitionSchema = exports_external.object({
64202
+ id: exports_external.string(),
64203
+ tools: exports_external.array(exports_external.string()).nullish(),
64204
+ task: exports_external.string(),
64205
+ output: exports_external.string().nullish(),
64206
+ expected_outcome: exports_external.string().nullish(),
64207
+ code: exports_external.string().nullish(),
64208
+ outputSchema: exports_external.any().nullish()
64209
+ });
64210
+ var WorkflowDefinitionSchema = exports_external.object({
64211
+ task: exports_external.string(),
64212
+ inputs: exports_external.array(WorkflowInputDefinitionSchema).nullish(),
64213
+ steps: exports_external.array(WorkflowStepDefinitionSchema),
64214
+ output: exports_external.string().nullish()
64215
+ });
64216
+ var WorkflowFileSchema = exports_external.object({
64217
+ workflows: exports_external.record(exports_external.string(), WorkflowDefinitionSchema)
64218
+ });
64219
+
64220
+ // ../core/src/workflow/dynamic.ts
64221
+ function parseDynamicWorkflowDefinition(source) {
64222
+ try {
64223
+ const raw = $parse(source);
64224
+ const validated = WorkflowFileSchema.safeParse(raw);
64225
+ if (!validated.success) {
64226
+ return { success: false, error: exports_external.prettifyError(validated.error) };
64227
+ }
64228
+ return { success: true, definition: validated.data };
64229
+ } catch (error46) {
64230
+ return { success: false, error: error46 instanceof Error ? error46.message : String(error46) };
64231
+ }
64232
+ }
64233
+ var AsyncFunction = Object.getPrototypeOf(async () => {}).constructor;
64234
+ function createRunWorkflowFn(args) {
64235
+ return async (subWorkflowId, subInput) => {
64236
+ const mergedInput = { ...args.input, ...args.state, ...subInput ?? {} };
64237
+ return await args.runInternal(subWorkflowId, mergedInput, args.context, args.state);
64238
+ };
64239
+ }
64240
+ function compileStep(stepDef, workflowId, compiledSteps) {
64241
+ const key = `${workflowId}.${stepDef.id}`;
64242
+ const existing = compiledSteps.get(key);
64243
+ if (existing) {
64244
+ return existing;
64245
+ }
64246
+ if (!stepDef.code) {
64247
+ throw new Error(`Step '${stepDef.id}' in workflow '${workflowId}' has no code`);
64248
+ }
64249
+ try {
64250
+ const fn = new AsyncFunction("ctx", stepDef.code);
64251
+ compiledSteps.set(key, fn);
64252
+ return fn;
64253
+ } catch (error46) {
64254
+ throw new Error(`Failed to compile code for step '${stepDef.id}' in workflow '${workflowId}': ${error46 instanceof Error ? error46.message : String(error46)}`);
64255
+ }
64256
+ }
64257
+ async function executeStepWithAgent(stepDef, workflowId, input, state, context, options, runInternal) {
64258
+ const tools = context.tools;
64259
+ if (typeof tools.generateText !== "function" || typeof tools.invokeTool !== "function" || typeof tools.taskEvent !== "function") {
64260
+ throw new Error(`Step '${stepDef.id}' in workflow '${workflowId}' requires agent execution, but AgentToolRegistry tools are not available.`);
64261
+ }
64262
+ if (!options.toolInfo) {
64263
+ throw new Error(`Step '${stepDef.id}' in workflow '${workflowId}' requires agent execution, but no toolInfo was provided to DynamicWorkflowRunner.`);
64264
+ }
64265
+ const allowedToolNames = stepDef.tools;
64266
+ const toolsForAgent = allowedToolNames ? options.toolInfo.filter((t) => allowedToolNames.includes(t.name)) : [...options.toolInfo];
64267
+ if (!allowedToolNames || allowedToolNames.includes("runWorkflow")) {
64268
+ toolsForAgent.push({
64269
+ name: "runWorkflow",
64270
+ description: "Run a named sub-workflow defined in the current workflow file.",
64271
+ parameters: exports_external.object({
64272
+ workflowId: exports_external.string().describe("Sub-workflow id to run"),
64273
+ input: exports_external.any().nullish().describe("Optional input object for the sub-workflow")
64274
+ }),
64275
+ handler: async () => {
64276
+ return { type: "Error" /* Error */, message: { type: "error-text", value: "runWorkflow is virtual." } };
64277
+ }
64278
+ });
64279
+ }
64280
+ const allowedToolNameSet = new Set(toolsForAgent.map((t) => t.name));
64281
+ const systemPrompt = options.stepSystemPrompt?.({ workflowId, step: stepDef, input, state }) ?? [
64282
+ `You are an AI assistant executing a workflow step.`,
64283
+ "",
64284
+ "# Instructions",
64285
+ "- Execute the task defined in the user message.",
64286
+ "- Use the provided tools to accomplish the task.",
64287
+ "- Return the step output as valid JSON in markdown.",
64288
+ "- Do not ask for user input. If information is missing, make a reasonable assumption or fail."
64289
+ ].filter(Boolean).join(`
64290
+ `);
64291
+ const userContent = [
64292
+ `Workflow: ${workflowId}`,
64293
+ `Step: ${stepDef.id}`,
64294
+ `Task: ${stepDef.task}`,
64295
+ stepDef.expected_outcome ? `Expected outcome: ${stepDef.expected_outcome}` : "",
64296
+ `Workflow Input: ${JSON.stringify(input)}`,
64297
+ `Current State: ${JSON.stringify(state)}`
64298
+ ].filter(Boolean).join(`
64299
+ `);
64300
+ const runWorkflow = createRunWorkflowFn({ input, state, context, runInternal });
64301
+ const agentTools = {
64302
+ generateText: tools.generateText.bind(tools),
64303
+ taskEvent: tools.taskEvent.bind(tools),
64304
+ invokeTool: async ({ toolName, input: toolInput }) => {
64305
+ if (!allowedToolNameSet.has(toolName)) {
64306
+ return {
64307
+ type: "Error" /* Error */,
64308
+ message: { type: "error-text", value: `Tool '${toolName}' is not allowed in this step.` }
64309
+ };
64310
+ }
64311
+ if (toolName === "runWorkflow") {
64312
+ const subWorkflowId = toolInput?.workflowId;
64313
+ const subInput = toolInput?.input;
64314
+ if (typeof subWorkflowId !== "string") {
64315
+ return {
64316
+ type: "Error" /* Error */,
64317
+ message: { type: "error-text", value: "runWorkflow.workflowId must be a string." }
64318
+ };
64319
+ }
64320
+ try {
64321
+ const output = await runWorkflow(subWorkflowId, subInput);
64322
+ const jsonResult = { type: "json", value: output };
64323
+ return { type: "Reply" /* Reply */, message: jsonResult };
64324
+ } catch (error46) {
64325
+ return {
64326
+ type: "Error" /* Error */,
64327
+ message: { type: "error-text", value: error46 instanceof Error ? error46.message : String(error46) }
64328
+ };
64329
+ }
64330
+ }
64331
+ return await tools.invokeTool({ toolName, input: toolInput });
64332
+ }
64333
+ };
64334
+ const result = await agentWorkflow({
64335
+ tools: toolsForAgent,
64336
+ systemPrompt,
64337
+ userMessage: [{ role: "user", content: userContent }],
64338
+ maxToolRoundTrips: options.maxToolRoundTrips,
64339
+ model: options.model
64340
+ }, { ...context, tools: agentTools });
64341
+ if (result.type === "Exit") {
64342
+ if (result.object !== undefined) {
64343
+ return result.object;
64344
+ }
64345
+ const parsed = parseJsonFromMarkdown(result.message);
64346
+ if (parsed.success) {
64347
+ return parsed.data;
64348
+ }
64349
+ return result.message;
64350
+ }
64351
+ throw new Error(`Agent execution for step '${stepDef.id}' in workflow '${workflowId}' did not exit cleanly.`);
64352
+ }
64353
+ async function executeStep(stepDef, workflowId, input, state, context, options, compiledSteps, runInternal) {
64354
+ if (stepDef.code && options.allowUnsafeCodeExecution) {
64355
+ const fn = compileStep(stepDef, workflowId, compiledSteps);
64356
+ const runWorkflow = createRunWorkflowFn({ input, state, context, runInternal });
64357
+ const runtimeCtx = {
64358
+ workflowId,
64359
+ stepId: stepDef.id,
64360
+ input,
64361
+ state,
64362
+ tools: context.tools,
64363
+ logger: context.logger,
64364
+ step: context.step,
64365
+ runWorkflow,
64366
+ toolInfo: options.toolInfo
64367
+ };
64368
+ return await fn(runtimeCtx);
64369
+ }
64370
+ return await executeStepWithAgent(stepDef, workflowId, input, state, context, options, runInternal);
64371
+ }
64372
+ function createDynamicWorkflow(definition, options = {}) {
64373
+ if (typeof definition === "string") {
64374
+ const res = parseDynamicWorkflowDefinition(definition);
64375
+ if (!res.success) {
64376
+ throw new Error(res.error);
64377
+ }
64378
+ definition = res.definition;
64379
+ }
64380
+ const compiledSteps = new Map;
64381
+ const runInternal = async (workflowId, input, context, inheritedState) => {
64382
+ const workflow = definition.workflows[workflowId];
64383
+ if (!workflow) {
64384
+ throw new Error(`Workflow '${workflowId}' not found`);
64385
+ }
64386
+ const state = { ...inheritedState };
64387
+ let lastOutput;
64388
+ for (const stepDef of workflow.steps) {
64389
+ const stepName = `${workflowId}.${stepDef.id}`;
64390
+ lastOutput = await context.step(stepName, async () => {
64391
+ return await executeStep(stepDef, workflowId, input, state, context, options, compiledSteps, runInternal);
64392
+ });
64393
+ const outputKey = stepDef.output ?? stepDef.id;
64394
+ state[outputKey] = lastOutput;
64395
+ }
64396
+ if (workflow.output) {
64397
+ return state[workflow.output];
64398
+ }
64399
+ return state;
64400
+ };
64401
+ return async (workflowId, input, context) => {
64402
+ return await runInternal(workflowId, input, context, {});
64403
+ };
64404
+ }
64405
+ // ../core/src/workflow/dynamic-generator.workflow.ts
64406
+ var GenerateWorkflowDefinitionInputSchema = exports_external.object({
64407
+ prompt: exports_external.string(),
64408
+ availableTools: exports_external.array(exports_external.object({
64409
+ name: exports_external.string(),
64410
+ description: exports_external.string()
64411
+ })).optional()
64412
+ });
64413
+ var GenerateWorkflowCodeInputSchema = exports_external.object({
64414
+ workflow: WorkflowFileSchema
64415
+ });
64416
+ var WORKFLOW_DEFINITION_SYSTEM_PROMPT = `You are an expert workflow architect.
64417
+ Your task is to create a JSON workflow definition based on the user's request.
64418
+
64419
+ The workflow definition must follow this structure:
64420
+ {
64421
+ "workflows": {
64422
+ "workflowName": {
64423
+ "task": "Description of the workflow",
64424
+ "inputs": [
64425
+ { "id": "inputName", "description": "Description", "default": "optionalDefault" }
64426
+ ],
64427
+ "steps": [
64428
+ {
64429
+ "id": "stepId",
64430
+ "task": "Description of the step",
64431
+ "tools": ["toolName1", "toolName2"], // Optional list of tools needed
64432
+ "output": "outputVariableName", // Optional
64433
+ }
64434
+ ],
64435
+ "output": "outputVariableName" // Optional
64436
+ }
64437
+ }
64438
+ }
64439
+
64440
+ Constraints:
64441
+ - You MUST always include a workflow named 'main'. This is the entry point.
64442
+ - The 'main' workflow input must be either empty (no input) or a single string input.
64443
+ - Break down complex tasks into logical steps.
64444
+ - Define clear inputs and outputs.
64445
+
64446
+ Example 1:
64447
+ User: "Research a topic and summarize it."
64448
+ Output:
64449
+ \`\`\`json
64450
+ {
64451
+ "workflows": {
64452
+ "main": {
64453
+ "task": "Research a topic and provide a summary",
64454
+ "inputs": [
64455
+ { "id": "topic", "description": "The topic to research" }
64456
+ ],
64457
+ "steps": [
64458
+ {
64459
+ "id": "search",
64460
+ "task": "Search for information about the topic",
64461
+ "tools": ["search"],
64462
+ "output": "searchResults"
64463
+ },
64464
+ {
64465
+ "id": "summarize",
64466
+ "task": "Summarize the search results",
64467
+ "tools": ["generateText"],
64468
+ "output": "summary"
64469
+ }
64470
+ ],
64471
+ "output": "summary"
64472
+ }
64473
+ }
64474
+ }
64475
+ \`\`\`
64476
+
64477
+ Example 2:
64478
+ User: "Review urgent PRs. For each PR, run the review workflow."
64479
+ Output:
64480
+ \`\`\`json
64481
+ {
64482
+ "workflows": {
64483
+ "main": {
64484
+ "task": "Fetch urgent PRs and review them",
64485
+ "inputs": [],
64486
+ "steps": [
64487
+ {
64488
+ "id": "fetchPRs",
64489
+ "task": "Fetch list of urgent PRs",
64490
+ "tools": ["github_list_prs"],
64491
+ "output": "prs"
64492
+ },
64493
+ {
64494
+ "id": "reviewEachPR",
64495
+ "task": "Run review workflow for each PR",
64496
+ "tools": [],
64497
+ "output": "reviews"
64498
+ }
64499
+ ],
64500
+ "output": "reviews"
64501
+ },
64502
+ "reviewPR": {
64503
+ "task": "Review a single PR",
64504
+ "inputs": [
64505
+ { "id": "prId", "description": "ID of the PR to review" }
64506
+ ],
64507
+ "steps": [
64508
+ {
64509
+ "id": "getDiff",
64510
+ "task": "Get PR diff",
64511
+ "tools": ["github_get_diff"],
64512
+ "output": "diff"
64513
+ },
64514
+ {
64515
+ "id": "analyze",
64516
+ "task": "Analyze the diff",
64517
+ "tools": ["generateText"],
64518
+ "output": "analysis"
64519
+ }
64520
+ ],
64521
+ "output": "analysis"
64522
+ }
64523
+ }
64524
+ }
64525
+ \`\`\`
64526
+ `;
64527
+ var WORKFLOW_CODE_SYSTEM_PROMPT = `You are an expert TypeScript developer.
64528
+ Your task is to implement the TypeScript code for the steps in the provided workflow definition.
64529
+
64530
+ You will receive a JSON workflow definition where the "code" field is null.
64531
+ You must fill in the "code" field for each step with valid TypeScript code.
64532
+
64533
+ The code will be executed in an async function with the following signature:
64534
+ async (ctx) => {
64535
+ // Your code here
64536
+ }
64537
+
64538
+ The \`ctx\` object provides access to:
64539
+ - \`ctx.input\`: The workflow inputs.
64540
+ - \`ctx.state\`: A shared state object for passing data between steps.
64541
+ - \`ctx.tools\`: An object containing available tools.
64542
+ - \`ctx.runWorkflow\`: (workflowId: string, input?: any) => Promise<any>. Use this to run other workflows.
64543
+
64544
+ Guidelines:
64545
+ - Use \`await\` for asynchronous operations.
64546
+ - Return the output value of the step.
64547
+ - Access inputs via \`ctx.input.inputName\`.
64548
+ - Access previous step outputs via \`ctx.state.stepOutputName\`.
64549
+ - Use \`ctx.tools.invokeTool({ toolName: 'name', input: { ... } })\` to call tools.
64550
+ - Use \`ctx.tools.generateText({ messages: [...] })\` for LLM calls.
64551
+ - Use \`ctx.tools.invokeTool({ toolName: 'runAgent', input: { prompt: '...' } })\` for complex sub-tasks that require multiple steps or tools. Prefer this over \`generateText\` for advanced tasks.
64552
+
64553
+ Example Code for a step:
64554
+ \`\`\`typescript
64555
+ const searchResults = await ctx.tools.invokeTool({
64556
+ toolName: 'search',
64557
+ input: { query: ctx.input.topic }
64558
+ });
64559
+ return searchResults;
64560
+ \`\`\`
64561
+
64562
+ Example Code for LLM step:
64563
+ \`\`\`typescript
64564
+ const summary = await ctx.tools.generateText({
64565
+ messages: [
64566
+ { role: 'system', content: 'Summarize the following text.' },
64567
+ { role: 'user', content: ctx.state.searchResults }
64568
+ ]
64569
+ });
64570
+ return summary;
64571
+ \`\`\`
64572
+
64573
+ Example Code for runAgent:
64574
+ \`\`\`typescript
64575
+ const result = await ctx.tools.invokeTool({
64576
+ toolName: 'runAgent',
64577
+ input: {
64578
+ prompt: 'Research the history of the internet and write a summary.',
64579
+ tools: ['search', 'generateText']
64580
+ }
64581
+ });
64582
+ return result;
64583
+ \`\`\`
64584
+
64585
+ Example Code for invoking a sub-workflow:
64586
+ \`\`\`typescript
64587
+ const results = [];
64588
+ for (const pr of ctx.state.prs) {
64589
+ const review = await ctx.runWorkflow('reviewPR', { prId: pr.id });
64590
+ results.push(review);
64591
+ }
64592
+ return results;
64593
+ \`\`\`
64594
+
64595
+ Return the complete workflow JSON with the "code" fields populated.
64596
+ `;
64597
+ var generateWorkflowDefinitionWorkflow = async (input, ctx) => {
64598
+ let systemPrompt = WORKFLOW_DEFINITION_SYSTEM_PROMPT;
64599
+ if (input.availableTools && input.availableTools.length > 0) {
64600
+ const toolsList = input.availableTools.map((t) => `- ${t.name}: ${t.description}`).join(`
64601
+ `);
64602
+ systemPrompt += `
64603
+
64604
+ Available Tools:
64605
+ ${toolsList}
64606
+
64607
+ Use these tools when appropriate.`;
64608
+ }
64609
+ const result = await ctx.step("generate-workflow-definition", async () => {
64610
+ return agentWorkflow({
64611
+ systemPrompt,
64612
+ userMessage: [{ role: "user", content: input.prompt }],
64613
+ tools: [],
64614
+ outputSchema: WorkflowFileSchema
64615
+ }, ctx);
64616
+ });
64617
+ if (result.type === "Exit" && result.object) {
64618
+ return result.object;
64619
+ }
64620
+ throw new Error("Failed to generate workflow definition");
64621
+ };
64622
+ var generateWorkflowCodeWorkflow = async (input, ctx) => {
64623
+ const result = await ctx.step("generate-workflow-code", async () => {
64624
+ return agentWorkflow({
64625
+ systemPrompt: WORKFLOW_CODE_SYSTEM_PROMPT,
64626
+ userMessage: [{ role: "user", content: JSON.stringify(input.workflow, null, 2) }],
64627
+ tools: [],
64628
+ outputSchema: WorkflowFileSchema
64629
+ }, ctx);
64630
+ });
64631
+ if (result.type === "Exit" && result.object) {
64632
+ return result.object;
64633
+ }
64634
+ throw new Error("Failed to generate workflow code");
64635
+ };
64149
64636
  // ../core/src/workflow/json-ai-types.ts
64637
+ var toJsonDataContent = (data) => {
64638
+ if (data instanceof URL) {
64639
+ return {
64640
+ type: "url",
64641
+ value: data.toString()
64642
+ };
64643
+ }
64644
+ if (typeof data === "string") {
64645
+ return {
64646
+ type: "base64",
64647
+ value: data
64648
+ };
64649
+ }
64650
+ let buffer;
64651
+ if (data instanceof Uint8Array) {
64652
+ buffer = Buffer.from(data);
64653
+ } else if (data instanceof Buffer) {
64654
+ buffer = data;
64655
+ } else {
64656
+ buffer = Buffer.from(data);
64657
+ }
64658
+ return {
64659
+ type: "base64",
64660
+ value: buffer.toString("base64")
64661
+ };
64662
+ };
64663
+ var toJsonUserContent = (content) => {
64664
+ if (typeof content === "string") {
64665
+ return content;
64666
+ }
64667
+ return content.map((part) => {
64668
+ switch (part.type) {
64669
+ case "image":
64670
+ return {
64671
+ ...part,
64672
+ image: toJsonDataContent(part.image)
64673
+ };
64674
+ case "file":
64675
+ return {
64676
+ ...part,
64677
+ data: toJsonDataContent(part.data)
64678
+ };
64679
+ }
64680
+ return part;
64681
+ });
64682
+ };
64683
+ var toJsonAssistantContent = (content) => {
64684
+ if (typeof content === "string") {
64685
+ return content;
64686
+ }
64687
+ return content.map((part) => {
64688
+ switch (part.type) {
64689
+ case "file":
64690
+ return {
64691
+ ...part,
64692
+ data: toJsonDataContent(part.data)
64693
+ };
64694
+ case "tool-call":
64695
+ return {
64696
+ ...part,
64697
+ input: part.input
64698
+ };
64699
+ }
64700
+ return part;
64701
+ });
64702
+ };
64703
+ var toJsonModelMessage = (msg) => {
64704
+ switch (msg.role) {
64705
+ case "user":
64706
+ return {
64707
+ ...msg,
64708
+ content: toJsonUserContent(msg.content)
64709
+ };
64710
+ case "assistant":
64711
+ return {
64712
+ ...msg,
64713
+ content: toJsonAssistantContent(msg.content)
64714
+ };
64715
+ }
64716
+ return msg;
64717
+ };
64150
64718
  var fromJsonDataContent = (data) => {
64151
64719
  if (data.type === "url") {
64152
64720
  return new URL(data.value);
@@ -64352,10 +64920,10 @@ function isObject2(value) {
64352
64920
  var isObject_default = isObject2;
64353
64921
 
64354
64922
  // ../../node_modules/lodash-es/identity.js
64355
- function identity(value) {
64923
+ function identity2(value) {
64356
64924
  return value;
64357
64925
  }
64358
- var identity_default = identity;
64926
+ var identity_default = identity2;
64359
64927
 
64360
64928
  // ../../node_modules/lodash-es/isFunction.js
64361
64929
  var asyncTag = "[object AsyncFunction]";
@@ -65440,52 +66008,6 @@ function set2(object3, path, value) {
65440
66008
  return object3 == null ? object3 : _baseSet_default(object3, path, value);
65441
66009
  }
65442
66010
  var set_default = set2;
65443
- // ../../node_modules/yaml/dist/index.js
65444
- var composer = require_composer();
65445
- var Document = require_Document();
65446
- var Schema = require_Schema();
65447
- var errors3 = require_errors();
65448
- var Alias = require_Alias();
65449
- var identity2 = require_identity();
65450
- var Pair = require_Pair();
65451
- var Scalar = require_Scalar();
65452
- var YAMLMap = require_YAMLMap();
65453
- var YAMLSeq = require_YAMLSeq();
65454
- var cst = require_cst();
65455
- var lexer = require_lexer();
65456
- var lineCounter = require_line_counter();
65457
- var parser = require_parser();
65458
- var publicApi = require_public_api();
65459
- var visit = require_visit();
65460
- var $Composer = composer.Composer;
65461
- var $Document = Document.Document;
65462
- var $Schema = Schema.Schema;
65463
- var $YAMLError = errors3.YAMLError;
65464
- var $YAMLParseError = errors3.YAMLParseError;
65465
- var $YAMLWarning = errors3.YAMLWarning;
65466
- var $Alias = Alias.Alias;
65467
- var $isAlias = identity2.isAlias;
65468
- var $isCollection = identity2.isCollection;
65469
- var $isDocument = identity2.isDocument;
65470
- var $isMap = identity2.isMap;
65471
- var $isNode = identity2.isNode;
65472
- var $isPair = identity2.isPair;
65473
- var $isScalar = identity2.isScalar;
65474
- var $isSeq = identity2.isSeq;
65475
- var $Pair = Pair.Pair;
65476
- var $Scalar = Scalar.Scalar;
65477
- var $YAMLMap = YAMLMap.YAMLMap;
65478
- var $YAMLSeq = YAMLSeq.YAMLSeq;
65479
- var $Lexer = lexer.Lexer;
65480
- var $LineCounter = lineCounter.LineCounter;
65481
- var $Parser = parser.Parser;
65482
- var $parse = publicApi.parse;
65483
- var $parseAllDocuments = publicApi.parseAllDocuments;
65484
- var $parseDocument = publicApi.parseDocument;
65485
- var $stringify = publicApi.stringify;
65486
- var $visit = visit.visit;
65487
- var $visitAsync = visit.visitAsync;
65488
-
65489
66011
  // ../cli-shared/src/config.ts
65490
66012
  function getGlobalConfigPath(home = homedir()) {
65491
66013
  return join(home, ".config", "polkacodes", "config.yml");
@@ -70391,7 +70913,7 @@ function readMultiline(prompt = "Enter text (Ctrl+D to finish):") {
70391
70913
  const rl = readline3.createInterface({
70392
70914
  input: process.stdin,
70393
70915
  output: process.stdout,
70394
- terminal: true
70916
+ prompt: ""
70395
70917
  });
70396
70918
  const lines = [];
70397
70919
  rl.on("line", (line) => {
@@ -84815,7 +85337,7 @@ async function generateText2(input2, context) {
84815
85337
  }
84816
85338
  });
84817
85339
  const resp = await stream.response;
84818
- return resp.messages;
85340
+ return resp.messages.map(toJsonModelMessage);
84819
85341
  } catch (error46) {
84820
85342
  if (error46.name === "AbortError") {
84821
85343
  if (repetitionDetected) {
@@ -84913,7 +85435,11 @@ async function updateTodoItem(input2, context) {
84913
85435
  const provider3 = context.toolProvider;
84914
85436
  return provider3.updateTodoItem(input2);
84915
85437
  }
85438
+ async function runAgent(input2, context) {
85439
+ return await agentWorkflow(input2, context.workflowContext);
85440
+ }
84916
85441
  var localToolHandlers = {
85442
+ runAgent,
84917
85443
  createPullRequest,
84918
85444
  createCommit,
84919
85445
  printChangeFile,
@@ -85008,6 +85534,7 @@ async function runWorkflow(workflow2, workflowInput, options) {
85008
85534
  requestTimeoutSeconds: config4.requestTimeoutSeconds,
85009
85535
  usageMeter: usage
85010
85536
  };
85537
+ let context;
85011
85538
  const tools2 = new Proxy({}, {
85012
85539
  get: (_target, tool3) => {
85013
85540
  return async (input2) => {
@@ -85018,12 +85545,13 @@ async function runWorkflow(workflow2, workflowInput, options) {
85018
85545
  agentCallback: onEvent,
85019
85546
  toolProvider,
85020
85547
  command,
85021
- yes
85548
+ yes,
85549
+ workflowContext: context
85022
85550
  });
85023
85551
  };
85024
85552
  }
85025
85553
  });
85026
- const context = {
85554
+ context = {
85027
85555
  step: makeStepFn(),
85028
85556
  logger,
85029
85557
  tools: tools2
@@ -85149,6 +85677,8 @@ Please implement all the necessary code changes according to this plan.
85149
85677
 
85150
85678
  After making changes, you MUST return a JSON object in a markdown block with either a summary of the changes OR a bailReason if you cannot complete the task.
85151
85679
 
85680
+ DO NOT save this JSON object to a file. Output it directly in your response.
85681
+
85152
85682
  Example for successful implementation:
85153
85683
  ${createJsonResponseInstruction({
85154
85684
  summary: "Implemented user authentication with JWT tokens and password hashing.",
@@ -85529,6 +86059,8 @@ ${TOOL_USAGE_INSTRUCTION}
85529
86059
 
85530
86060
  After making changes, you MUST return a JSON object in a markdown block with either a summary of the changes OR a bailReason if you cannot complete the task.
85531
86061
 
86062
+ DO NOT save this JSON object to a file. Output it directly in your response.
86063
+
85532
86064
  Example for successful fix:
85533
86065
  ${createJsonResponseInstruction({
85534
86066
  summary: "Fixed the 'add' function in 'math.ts' to correctly handle negative numbers.",
@@ -88257,6 +88789,165 @@ ${formattedReview}`;
88257
88789
  }
88258
88790
  });
88259
88791
 
88792
+ // src/commands/workflow.ts
88793
+ import { mkdir as mkdir3, readFile as readFile5, writeFile as writeFile2 } from "node:fs/promises";
88794
+ import { dirname as dirname3 } from "node:path";
88795
+ async function saveWorkflowFile(path, workflow3) {
88796
+ await mkdir3(dirname3(path), { recursive: true });
88797
+ await writeFile2(path, $stringify(workflow3));
88798
+ }
88799
+ function clearWorkflowCode(workflowDef) {
88800
+ for (const wf of Object.values(workflowDef.workflows)) {
88801
+ for (const step of wf.steps) {
88802
+ step.code = undefined;
88803
+ }
88804
+ }
88805
+ }
88806
+ async function runWorkflowCommand(task2, _options, command) {
88807
+ const globalOpts = (command.parent ?? command).opts();
88808
+ const { verbose, yes } = globalOpts;
88809
+ const logger = createLogger({ verbose });
88810
+ const { file: file2, regenerate, create, workflow: workflowName } = command.opts();
88811
+ if (!file2) {
88812
+ logger.error("Error: Workflow file is required. Use -f or --file.");
88813
+ return;
88814
+ }
88815
+ const tools2 = [
88816
+ readFile_default,
88817
+ writeToFile_default,
88818
+ replaceInFile_default,
88819
+ searchFiles_default,
88820
+ listFiles_default,
88821
+ executeCommand_default,
88822
+ fetchUrl_default,
88823
+ readBinaryFile_default,
88824
+ removeFile_default,
88825
+ renameFile_default,
88826
+ askFollowupQuestion_default
88827
+ ];
88828
+ const availableTools = tools2.map((t2) => ({ name: t2.name, description: t2.description }));
88829
+ const isCreate = !!create;
88830
+ const isUpdate = !!regenerate;
88831
+ if (isCreate) {
88832
+ if (!task2) {
88833
+ logger.error("Error: Task is required for creating a workflow.");
88834
+ return;
88835
+ }
88836
+ logger.info("Generating workflow definition...");
88837
+ const defResult = await runWorkflow(generateWorkflowDefinitionWorkflow, { prompt: task2, availableTools }, { commandName: "workflow", command, logger, yes });
88838
+ if (!defResult) {
88839
+ logger.error("Failed to generate workflow definition.");
88840
+ return;
88841
+ }
88842
+ logger.info("Generating workflow code...");
88843
+ const codeResult = await runWorkflow(generateWorkflowCodeWorkflow, { workflow: defResult }, { commandName: "workflow", command, logger, yes });
88844
+ if (!codeResult) {
88845
+ logger.error("Failed to generate workflow code.");
88846
+ return;
88847
+ }
88848
+ await saveWorkflowFile(file2, codeResult);
88849
+ logger.info(`Workflow saved to '${file2}'.`);
88850
+ return;
88851
+ }
88852
+ if (isUpdate) {
88853
+ let workflowDef2;
88854
+ try {
88855
+ const content2 = await readFile5(file2, "utf-8");
88856
+ const res = parseDynamicWorkflowDefinition(content2);
88857
+ if (!res.success) {
88858
+ throw new Error(res.error);
88859
+ }
88860
+ workflowDef2 = res.definition;
88861
+ } catch (e2) {
88862
+ logger.error(`Error reading or parsing file '${file2}': ${e2}`);
88863
+ return;
88864
+ }
88865
+ if (task2) {
88866
+ logger.info("Updating workflow definition...");
88867
+ const updatePrompt = `Current workflow definition:
88868
+ ${JSON.stringify(workflowDef2, null, 2)}
88869
+
88870
+ Update request: ${task2}
88871
+
88872
+ Return the updated workflow definition.`;
88873
+ const defResult = await runWorkflow(generateWorkflowDefinitionWorkflow, { prompt: updatePrompt, availableTools }, { commandName: "workflow", command, logger, yes });
88874
+ if (!defResult) {
88875
+ logger.error("Failed to update workflow definition.");
88876
+ return;
88877
+ }
88878
+ workflowDef2 = defResult;
88879
+ } else {
88880
+ logger.info("Clearing existing code for regeneration...");
88881
+ clearWorkflowCode(workflowDef2);
88882
+ }
88883
+ logger.info("Generating workflow code...");
88884
+ const codeResult = await runWorkflow(generateWorkflowCodeWorkflow, { workflow: workflowDef2 }, { commandName: "workflow", command, logger, yes });
88885
+ if (!codeResult) {
88886
+ logger.error("Failed to generate workflow code.");
88887
+ return;
88888
+ }
88889
+ await saveWorkflowFile(file2, codeResult);
88890
+ logger.info(`Workflow saved to '${file2}'.`);
88891
+ return;
88892
+ }
88893
+ logger.info(`Executing workflow from '${file2}'...`);
88894
+ let content;
88895
+ try {
88896
+ content = await readFile5(file2, "utf-8");
88897
+ } catch (e2) {
88898
+ logger.error(`Error reading file '${file2}': ${e2}`);
88899
+ return;
88900
+ }
88901
+ logger.warn("Warning: allowUnsafeCodeExecution is enabled. This workflow has full access to your system.");
88902
+ const parsedResult = parseDynamicWorkflowDefinition(content);
88903
+ if (!parsedResult.success) {
88904
+ logger.error(`Failed to parse workflow: ${parsedResult.error}`);
88905
+ return;
88906
+ }
88907
+ const workflowDef = parsedResult.definition;
88908
+ const workflowNames = Object.keys(workflowDef.workflows);
88909
+ let workflowId = workflowName;
88910
+ if (!workflowId) {
88911
+ if (workflowNames.includes("main")) {
88912
+ workflowId = "main";
88913
+ } else if (workflowNames.length === 1) {
88914
+ workflowId = workflowNames[0];
88915
+ } else if (workflowNames.length > 1) {
88916
+ logger.error(`Multiple workflows found in file and no 'main' workflow. Please specify one using --workflow <name>. Available workflows: ${workflowNames.join(", ")}`);
88917
+ return;
88918
+ } else {
88919
+ logger.error("No workflows found in file.");
88920
+ return;
88921
+ }
88922
+ } else {
88923
+ if (!workflowNames.includes(workflowId)) {
88924
+ logger.error(`Workflow '${workflowId}' not found in file. Available workflows: ${workflowNames.join(", ")}`);
88925
+ return;
88926
+ }
88927
+ }
88928
+ let dynamicRunner;
88929
+ try {
88930
+ dynamicRunner = createDynamicWorkflow(workflowDef, {
88931
+ allowUnsafeCodeExecution: true,
88932
+ toolInfo: tools2
88933
+ });
88934
+ } catch (error46) {
88935
+ logger.error(`Failed to parse workflow: ${error46.message}`);
88936
+ return;
88937
+ }
88938
+ const workflowFn = async (input2, context) => {
88939
+ return dynamicRunner(workflowId, input2, context);
88940
+ };
88941
+ const selectedWorkflow = workflowDef.workflows[workflowId];
88942
+ const workflowInput = {};
88943
+ if (selectedWorkflow.inputs && selectedWorkflow.inputs.length > 0 && task2) {
88944
+ const firstInput = selectedWorkflow.inputs[0];
88945
+ workflowInput[firstInput.id] = task2;
88946
+ }
88947
+ await runWorkflow(workflowFn, workflowInput, { commandName: "workflow", command, logger, yes });
88948
+ }
88949
+ var workflowCommand = new Command("workflow").description("Generate, manage, and run custom workflows.").argument("[task]", "The task description for generating the workflow.").option("-f, --file <path>", "Path to the workflow file").option("-w, --workflow <name>", "The name of the workflow to run").option("--create", "Create a new workflow").option("--regenerate", "Regenerate the code for the workflow").action(runWorkflowCommand);
88950
+
88260
88951
  // src/index.ts
88261
88952
  globalThis.AI_SDK_LOG_WARNINGS = false;
88262
88953
  var program2 = new Command;
@@ -88270,6 +88961,7 @@ program2.addCommand(planCommand);
88270
88961
  program2.addCommand(codeCommand);
88271
88962
  program2.addCommand(epicCommand);
88272
88963
  program2.addCommand(fixCommand);
88964
+ program2.addCommand(workflowCommand);
88273
88965
  addSharedOptions(program2);
88274
88966
  program2.parse();
88275
88967
  process.on("uncaughtException", (error46) => {