poe-code 10.0.3 → 10.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -67,9 +67,9 @@ function applyStyles(text5, styles) {
67
67
  if (!supportsColor() || styles.length === 0) {
68
68
  return text5;
69
69
  }
70
- const open8 = styles.map((style) => style.open).join("");
71
- const output = text5.includes(reset) ? replaceAll(text5, reset, `${reset}${open8}`) : text5;
72
- return `${open8}${output}${reset}`;
70
+ const open9 = styles.map((style) => style.open).join("");
71
+ const output = text5.includes(reset) ? replaceAll(text5, reset, `${reset}${open9}`) : text5;
72
+ return `${open9}${output}${reset}`;
73
73
  }
74
74
  function clampRgb(value) {
75
75
  if (Number.isNaN(value)) {
@@ -1867,14 +1867,14 @@ function parseTemplate(template2) {
1867
1867
  let tokens = root;
1868
1868
  let index = 0;
1869
1869
  while (index < template2.length) {
1870
- const open8 = template2.indexOf("{{", index);
1871
- if (open8 === -1) {
1870
+ const open9 = template2.indexOf("{{", index);
1871
+ if (open9 === -1) {
1872
1872
  appendText(tokens, template2.slice(index), index);
1873
1873
  break;
1874
1874
  }
1875
- appendText(tokens, template2.slice(index, open8), index);
1876
- const parsed = parseTag(template2, open8);
1877
- const standalone = getStandalone(template2, open8, parsed.end, parsed.kind);
1875
+ appendText(tokens, template2.slice(index, open9), index);
1876
+ const parsed = parseTag(template2, open9);
1877
+ const standalone = getStandalone(template2, open9, parsed.end, parsed.kind);
1878
1878
  if (standalone !== void 0) {
1879
1879
  trimTextAfter(tokens, standalone.lineStart);
1880
1880
  }
@@ -1891,7 +1891,7 @@ function parseTemplate(template2) {
1891
1891
  name: parsed.name,
1892
1892
  children: [],
1893
1893
  rawStart: parsed.end,
1894
- rawEnd: standalone?.lineStart ?? open8
1894
+ rawEnd: standalone?.lineStart ?? open9
1895
1895
  };
1896
1896
  tokens.push(token);
1897
1897
  stack.push({ token, parent: tokens });
@@ -1903,7 +1903,7 @@ function parseTemplate(template2) {
1903
1903
  tokens.push({
1904
1904
  type: "partial",
1905
1905
  name: parsed.name,
1906
- indent: standalone === void 0 ? "" : template2.slice(standalone.lineStart, open8)
1906
+ indent: standalone === void 0 ? "" : template2.slice(standalone.lineStart, open9)
1907
1907
  });
1908
1908
  index = standalone?.nextIndex ?? parsed.end;
1909
1909
  continue;
@@ -1916,12 +1916,12 @@ function parseTemplate(template2) {
1916
1916
  if (frame2.token.name !== parsed.name) {
1917
1917
  throw new Error(`Unclosed section "${frame2.token.name}" before closing "${parsed.name}"`);
1918
1918
  }
1919
- frame2.token.rawEnd = open8;
1919
+ frame2.token.rawEnd = open9;
1920
1920
  tokens = frame2.parent;
1921
1921
  index = standalone?.nextIndex ?? parsed.end;
1922
1922
  continue;
1923
1923
  }
1924
- tokens.push({ type: parsed.kind, name: parsed.name, raw: template2.slice(open8, parsed.end) });
1924
+ tokens.push({ type: parsed.kind, name: parsed.name, raw: template2.slice(open9, parsed.end) });
1925
1925
  index = parsed.end;
1926
1926
  }
1927
1927
  const frame = stack.pop();
@@ -1930,19 +1930,19 @@ function parseTemplate(template2) {
1930
1930
  }
1931
1931
  return root;
1932
1932
  }
1933
- function parseTag(template2, open8) {
1934
- if (template2.startsWith("{{{", open8)) {
1935
- const close2 = template2.indexOf("}}}", open8 + 3);
1933
+ function parseTag(template2, open9) {
1934
+ if (template2.startsWith("{{{", open9)) {
1935
+ const close2 = template2.indexOf("}}}", open9 + 3);
1936
1936
  if (close2 === -1) {
1937
- throw unclosedTagError(template2, open8, "}}}");
1937
+ throw unclosedTagError(template2, open9, "}}}");
1938
1938
  }
1939
- return { kind: "unescaped", name: template2.slice(open8 + 3, close2).trim(), end: close2 + 3 };
1939
+ return { kind: "unescaped", name: template2.slice(open9 + 3, close2).trim(), end: close2 + 3 };
1940
1940
  }
1941
- const close = template2.indexOf("}}", open8 + 2);
1941
+ const close = template2.indexOf("}}", open9 + 2);
1942
1942
  if (close === -1) {
1943
- throw unclosedTagError(template2, open8, "}}");
1943
+ throw unclosedTagError(template2, open9, "}}");
1944
1944
  }
1945
- const raw = template2.slice(open8 + 2, close).trim();
1945
+ const raw = template2.slice(open9 + 2, close).trim();
1946
1946
  const sigil = raw[0];
1947
1947
  const name = sigil === void 0 ? "" : raw.slice(1).trim();
1948
1948
  const end = close + 2;
@@ -1955,14 +1955,14 @@ function parseTag(template2, open8) {
1955
1955
  if (sigil === "=" && raw.endsWith("=")) return { kind: "delimiter", name, end };
1956
1956
  return { kind: "name", name: raw, end };
1957
1957
  }
1958
- function unclosedTagError(template2, open8, expected) {
1959
- const before = template2.slice(0, open8);
1960
- const lineEnd = template2.indexOf("\n", open8);
1961
- const opened = template2.slice(open8, lineEnd === -1 ? template2.length : lineEnd).trimEnd();
1958
+ function unclosedTagError(template2, open9, expected) {
1959
+ const before = template2.slice(0, open9);
1960
+ const lineEnd = template2.indexOf("\n", open9);
1961
+ const opened = template2.slice(open9, lineEnd === -1 ? template2.length : lineEnd).trimEnd();
1962
1962
  const tag = opened.length > MAX_TAG_EXCERPT_LENGTH ? `${opened.slice(0, MAX_TAG_EXCERPT_LENGTH)}...` : opened;
1963
1963
  return new TemplateParseError(`Unclosed tag "${tag}": expected "${expected}"`, {
1964
1964
  line: before.split("\n").length,
1965
- column: open8 - (before.lastIndexOf("\n") + 1) + 1
1965
+ column: open9 - (before.lastIndexOf("\n") + 1) + 1
1966
1966
  });
1967
1967
  }
1968
1968
  function getStandalone(template2, tagStart, tagEnd, kind) {
@@ -2170,12 +2170,12 @@ function expandTemplatePartials(template2, partials, partialStack) {
2170
2170
  let output = "";
2171
2171
  let index = 0;
2172
2172
  while (index < template2.length) {
2173
- const open8 = template2.indexOf("{{", index);
2174
- if (open8 === -1) {
2173
+ const open9 = template2.indexOf("{{", index);
2174
+ if (open9 === -1) {
2175
2175
  output += template2.slice(index);
2176
2176
  break;
2177
2177
  }
2178
- const parsed = parseTag(template2, open8);
2178
+ const parsed = parseTag(template2, open9);
2179
2179
  if (parsed.kind !== "partial") {
2180
2180
  output += template2.slice(index, parsed.end);
2181
2181
  index = parsed.end;
@@ -2192,9 +2192,9 @@ function expandTemplatePartials(template2, partials, partialStack) {
2192
2192
  if (partialStack.length >= MAX_PARTIAL_DEPTH) {
2193
2193
  throw new Error(`Maximum partial depth exceeded (${MAX_PARTIAL_DEPTH}).`);
2194
2194
  }
2195
- const standalone = getStandalone(template2, open8, parsed.end, parsed.kind);
2196
- const beforePartial = standalone === void 0 ? template2.slice(index, open8) : template2.slice(index, standalone.lineStart);
2197
- const indent = standalone === void 0 ? "" : template2.slice(standalone.lineStart, open8);
2195
+ const standalone = getStandalone(template2, open9, parsed.end, parsed.kind);
2196
+ const beforePartial = standalone === void 0 ? template2.slice(index, open9) : template2.slice(index, standalone.lineStart);
2197
+ const indent = standalone === void 0 ? "" : template2.slice(standalone.lineStart, open9);
2198
2198
  const partial = indentPartial(partials[parsed.name], indent);
2199
2199
  output += beforePartial + expandTemplatePartials(partial, partials, [...partialStack, parsed.name]);
2200
2200
  index = standalone?.nextIndex ?? parsed.end;
@@ -2826,11 +2826,11 @@ function parseInline(raw, options = {}) {
2826
2826
  index = footnoteReference.end;
2827
2827
  continue;
2828
2828
  }
2829
- const link3 = parseLink(raw, index, footnoteLabels, offsets);
2830
- if (link3 !== null) {
2829
+ const link4 = parseLink(raw, index, footnoteLabels, offsets);
2830
+ if (link4 !== null) {
2831
2831
  flushText();
2832
- nodes.push(link3.node);
2833
- index = link3.end;
2832
+ nodes.push(link4.node);
2833
+ index = link4.end;
2834
2834
  continue;
2835
2835
  }
2836
2836
  }
@@ -10694,7 +10694,7 @@ function createFrameWriter(stream, options = {}) {
10694
10694
  close();
10695
10695
  process.kill(process.pid, signal);
10696
10696
  }
10697
- function open8() {
10697
+ function open9() {
10698
10698
  if (opened) return;
10699
10699
  opened = true;
10700
10700
  stream.write(`${OPEN}${options.mouse === false ? CLOSE_MOUSE : OPEN_MOUSE}\x1B[?7l`);
@@ -10711,7 +10711,7 @@ function createFrameWriter(stream, options = {}) {
10711
10711
  stream.write(`\x1B[0m\x1B[?7h${options.mouse === false ? "" : CLOSE_MOUSE}${CLOSE}`);
10712
10712
  }
10713
10713
  return {
10714
- open: open8,
10714
+ open: open9,
10715
10715
  close,
10716
10716
  writeFrame(ansi) {
10717
10717
  if (!opened || ansi.length === 0) return;
@@ -16370,17 +16370,17 @@ function validate(schema, value) {
16370
16370
  }
16371
16371
  return { ok: true, value: result.present ? result.value : void 0 };
16372
16372
  }
16373
- function walkSchema(schema, value, path190, state) {
16373
+ function walkSchema(schema, value, path191, state) {
16374
16374
  if (schema.kind === "optional") {
16375
- return walkOptional(schema, value, path190, state);
16375
+ return walkOptional(schema, value, path191, state);
16376
16376
  }
16377
16377
  if (value === missingValue) {
16378
16378
  addIssue(
16379
16379
  state,
16380
- path190,
16380
+ path191,
16381
16381
  expectedFor(schema),
16382
16382
  "missing",
16383
- `Expected ${expectedFor(schema)} at ${formatPath(path190)}`
16383
+ `Expected ${expectedFor(schema)} at ${formatPath(path191)}`
16384
16384
  );
16385
16385
  return { present: false };
16386
16386
  }
@@ -16389,149 +16389,149 @@ function walkSchema(schema, value, path190, state) {
16389
16389
  }
16390
16390
  switch (schema.kind) {
16391
16391
  case "string":
16392
- return walkString(schema, value, path190, state);
16392
+ return walkString(schema, value, path191, state);
16393
16393
  case "number":
16394
- return walkNumber(schema, value, path190, state);
16394
+ return walkNumber(schema, value, path191, state);
16395
16395
  case "boolean":
16396
- return walkBoolean(value, path190, state);
16396
+ return walkBoolean(value, path191, state);
16397
16397
  case "enum":
16398
- return walkEnum(schema, value, path190, state);
16398
+ return walkEnum(schema, value, path191, state);
16399
16399
  case "array":
16400
- return walkArray(schema, value, path190, state);
16400
+ return walkArray(schema, value, path191, state);
16401
16401
  case "object":
16402
- return walkObject(schema, value, path190, state);
16402
+ return walkObject(schema, value, path191, state);
16403
16403
  case "oneOf":
16404
- return walkOneOf(schema, value, path190, state);
16404
+ return walkOneOf(schema, value, path191, state);
16405
16405
  case "union":
16406
- return walkUnion(schema, value, path190, state);
16406
+ return walkUnion(schema, value, path191, state);
16407
16407
  case "record":
16408
- return walkRecord(schema, value, path190, state);
16408
+ return walkRecord(schema, value, path191, state);
16409
16409
  case "json":
16410
- return walkJson(value, path190, state);
16410
+ return walkJson(value, path191, state);
16411
16411
  }
16412
16412
  }
16413
- function walkOptional(schema, value, path190, state) {
16413
+ function walkOptional(schema, value, path191, state) {
16414
16414
  if (value === missingValue || value === void 0) {
16415
16415
  const defaultValue = getDefault(schema.inner);
16416
16416
  if (defaultValue.present) {
16417
- return walkSchema(schema.inner, cloneDefault(defaultValue.value), path190, state);
16417
+ return walkSchema(schema.inner, cloneDefault(defaultValue.value), path191, state);
16418
16418
  }
16419
16419
  return { present: false };
16420
16420
  }
16421
- return walkSchema(schema.inner, value, path190, state);
16421
+ return walkSchema(schema.inner, value, path191, state);
16422
16422
  }
16423
- function walkString(schema, value, path190, state) {
16423
+ function walkString(schema, value, path191, state) {
16424
16424
  if (typeof value !== "string") {
16425
- addExpectedIssue(state, path190, "string", value);
16425
+ addExpectedIssue(state, path191, "string", value);
16426
16426
  return { present: true, value };
16427
16427
  }
16428
16428
  if (schema.minLength !== void 0 && value.length < schema.minLength) {
16429
16429
  const expected = `string with length at least ${schema.minLength}`;
16430
16430
  addIssue(
16431
16431
  state,
16432
- path190,
16432
+ path191,
16433
16433
  expected,
16434
16434
  `string with length ${value.length}`,
16435
- `Expected ${expected} at ${formatPath(path190)}`
16435
+ `Expected ${expected} at ${formatPath(path191)}`
16436
16436
  );
16437
16437
  }
16438
16438
  if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
16439
16439
  const expected = `string with length at most ${schema.maxLength}`;
16440
16440
  addIssue(
16441
16441
  state,
16442
- path190,
16442
+ path191,
16443
16443
  expected,
16444
16444
  `string with length ${value.length}`,
16445
- `Expected ${expected} at ${formatPath(path190)}`
16445
+ `Expected ${expected} at ${formatPath(path191)}`
16446
16446
  );
16447
16447
  }
16448
16448
  if (schema.pattern !== void 0) {
16449
16449
  const pattern = compilePattern(schema.pattern);
16450
16450
  if (pattern === void 0 || !pattern.test(value)) {
16451
16451
  const expected = `string matching pattern ${schema.pattern}`;
16452
- addIssue(state, path190, expected, value, `Expected ${expected} at ${formatPath(path190)}`);
16452
+ addIssue(state, path191, expected, value, `Expected ${expected} at ${formatPath(path191)}`);
16453
16453
  }
16454
16454
  }
16455
16455
  return { present: true, value };
16456
16456
  }
16457
- function walkNumber(schema, value, path190, state) {
16457
+ function walkNumber(schema, value, path191, state) {
16458
16458
  if (typeof value !== "number" || !Number.isFinite(value)) {
16459
- addExpectedIssue(state, path190, schema.jsonType === "integer" ? "integer" : "number", value);
16459
+ addExpectedIssue(state, path191, schema.jsonType === "integer" ? "integer" : "number", value);
16460
16460
  return { present: true, value };
16461
16461
  }
16462
16462
  if (schema.jsonType === "integer" && !Number.isInteger(value)) {
16463
- addExpectedIssue(state, path190, "integer", value);
16463
+ addExpectedIssue(state, path191, "integer", value);
16464
16464
  }
16465
16465
  if (schema.minimum !== void 0 && value < schema.minimum) {
16466
16466
  const expected = `number greater than or equal to ${schema.minimum}`;
16467
- addIssue(state, path190, expected, String(value), `Expected ${expected} at ${formatPath(path190)}`);
16467
+ addIssue(state, path191, expected, String(value), `Expected ${expected} at ${formatPath(path191)}`);
16468
16468
  }
16469
16469
  if (schema.maximum !== void 0 && value > schema.maximum) {
16470
16470
  const expected = `number less than or equal to ${schema.maximum}`;
16471
- addIssue(state, path190, expected, String(value), `Expected ${expected} at ${formatPath(path190)}`);
16471
+ addIssue(state, path191, expected, String(value), `Expected ${expected} at ${formatPath(path191)}`);
16472
16472
  }
16473
16473
  return { present: true, value };
16474
16474
  }
16475
- function walkBoolean(value, path190, state) {
16475
+ function walkBoolean(value, path191, state) {
16476
16476
  if (typeof value !== "boolean") {
16477
- addExpectedIssue(state, path190, "boolean", value);
16477
+ addExpectedIssue(state, path191, "boolean", value);
16478
16478
  }
16479
16479
  return { present: true, value };
16480
16480
  }
16481
- function walkEnum(schema, value, path190, state) {
16481
+ function walkEnum(schema, value, path191, state) {
16482
16482
  if (!schema.values.includes(value)) {
16483
16483
  const expected = `one of ${schema.values.join(", ")}`;
16484
16484
  addIssue(
16485
16485
  state,
16486
- path190,
16486
+ path191,
16487
16487
  expected,
16488
16488
  receivedValue(value),
16489
- `Expected ${expected} at ${formatPath(path190)}`
16489
+ `Expected ${expected} at ${formatPath(path191)}`
16490
16490
  );
16491
16491
  }
16492
16492
  return { present: true, value };
16493
16493
  }
16494
- function walkArray(schema, value, path190, state) {
16494
+ function walkArray(schema, value, path191, state) {
16495
16495
  if (!Array.isArray(value)) {
16496
- addExpectedIssue(state, path190, "array", value);
16496
+ addExpectedIssue(state, path191, "array", value);
16497
16497
  return { present: true, value };
16498
16498
  }
16499
16499
  if (schema.minItems !== void 0 && value.length < schema.minItems) {
16500
16500
  const expected = `array with at least ${schema.minItems} items`;
16501
16501
  addIssue(
16502
16502
  state,
16503
- path190,
16503
+ path191,
16504
16504
  expected,
16505
16505
  `array with ${value.length} items`,
16506
- `Expected ${expected} at ${formatPath(path190)}`
16506
+ `Expected ${expected} at ${formatPath(path191)}`
16507
16507
  );
16508
16508
  }
16509
16509
  if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
16510
16510
  const expected = `array with at most ${schema.maxItems} items`;
16511
16511
  addIssue(
16512
16512
  state,
16513
- path190,
16513
+ path191,
16514
16514
  expected,
16515
16515
  `array with ${value.length} items`,
16516
- `Expected ${expected} at ${formatPath(path190)}`
16516
+ `Expected ${expected} at ${formatPath(path191)}`
16517
16517
  );
16518
16518
  }
16519
16519
  const nextValue = value.map((item, index) => {
16520
- const result = walkSchema(schema.item, item, [...path190, String(index)], state);
16520
+ const result = walkSchema(schema.item, item, [...path191, String(index)], state);
16521
16521
  return result.present ? result.value : item;
16522
16522
  });
16523
16523
  return { present: true, value: nextValue };
16524
16524
  }
16525
- function walkObject(schema, value, path190, state, injectedProperties = {}) {
16525
+ function walkObject(schema, value, path191, state, injectedProperties = {}) {
16526
16526
  if (!isPlainRecord3(value)) {
16527
- addExpectedIssue(state, path190, "object", value);
16527
+ addExpectedIssue(state, path191, "object", value);
16528
16528
  return { present: true, value };
16529
16529
  }
16530
16530
  const nextValue = {};
16531
16531
  const allowedKeys = /* @__PURE__ */ new Set([...Object.keys(schema.shape), ...Object.keys(injectedProperties)]);
16532
16532
  for (const [key3, propertySchema] of Object.entries(schema.shape)) {
16533
16533
  const propertyValue = Object.hasOwn(value, key3) ? value[key3] : missingValue;
16534
- const result = walkSchema(propertySchema, propertyValue, [...path190, key3], state);
16534
+ const result = walkSchema(propertySchema, propertyValue, [...path191, key3], state);
16535
16535
  if (result.present) {
16536
16536
  setOwnValue(nextValue, key3, result.value);
16537
16537
  }
@@ -16550,18 +16550,18 @@ function walkObject(schema, value, path190, state, injectedProperties = {}) {
16550
16550
  if (schema.additionalProperties === true) {
16551
16551
  setOwnValue(nextValue, key3, propertyValue);
16552
16552
  } else {
16553
- addUnexpectedPropertyIssue(state, [...path190, key3]);
16553
+ addUnexpectedPropertyIssue(state, [...path191, key3]);
16554
16554
  }
16555
16555
  }
16556
16556
  return { present: true, value: nextValue };
16557
16557
  }
16558
- function walkOneOf(schema, value, path190, state) {
16558
+ function walkOneOf(schema, value, path191, state) {
16559
16559
  if (!isPlainRecord3(value)) {
16560
- addExpectedIssue(state, path190, "object", value);
16560
+ addExpectedIssue(state, path191, "object", value);
16561
16561
  return { present: true, value };
16562
16562
  }
16563
16563
  const discriminatorValue = value[schema.discriminator];
16564
- const discriminatorPath = [...path190, schema.discriminator];
16564
+ const discriminatorPath = [...path191, schema.discriminator];
16565
16565
  const branchValues = Object.keys(schema.branches);
16566
16566
  const expected = `one of ${branchValues.join(", ")}`;
16567
16567
  if (!Object.hasOwn(value, schema.discriminator)) {
@@ -16570,7 +16570,7 @@ function walkOneOf(schema, value, path190, state) {
16570
16570
  discriminatorPath,
16571
16571
  expected,
16572
16572
  "missing",
16573
- `Missing discriminator "${schema.discriminator}" at ${formatPath(path190)}. Expected one of: ${branchValues.join(", ")}.`
16573
+ `Missing discriminator "${schema.discriminator}" at ${formatPath(path191)}. Expected one of: ${branchValues.join(", ")}.`
16574
16574
  );
16575
16575
  return { present: true, value };
16576
16576
  }
@@ -16584,21 +16584,21 @@ function walkOneOf(schema, value, path190, state) {
16584
16584
  );
16585
16585
  return { present: true, value };
16586
16586
  }
16587
- return walkObject(schema.branches[discriminatorValue], value, path190, state, {
16587
+ return walkObject(schema.branches[discriminatorValue], value, path191, state, {
16588
16588
  [schema.discriminator]: discriminatorValue
16589
16589
  });
16590
16590
  }
16591
- function walkUnion(schema, value, path190, state) {
16591
+ function walkUnion(schema, value, path191, state) {
16592
16592
  if (isPlainRecord3(value)) {
16593
16593
  const candidateBranches = schema.branches.filter((branch) => hasRequiredKeys(branch, value));
16594
16594
  if (candidateBranches.length === 1) {
16595
- return walkObject(candidateBranches[0], value, path190, state);
16595
+ return walkObject(candidateBranches[0], value, path191, state);
16596
16596
  }
16597
16597
  }
16598
16598
  const matches = [];
16599
16599
  for (const branch of schema.branches) {
16600
16600
  const branchState = { issues: [] };
16601
- const result = walkObject(branch, value, path190, branchState);
16601
+ const result = walkObject(branch, value, path191, branchState);
16602
16602
  if (branchState.issues.length === 0 && result.present) {
16603
16603
  matches.push({ fingerprint: getRequiredKeyFingerprint(branch), value: result.value });
16604
16604
  }
@@ -16610,19 +16610,19 @@ function walkUnion(schema, value, path190, state) {
16610
16610
  const branchDescriptions = schema.branches.map((branch) => getRequiredKeyFingerprint(branch));
16611
16611
  addIssueWithMessage(
16612
16612
  state,
16613
- path190,
16613
+ path191,
16614
16614
  "exactly one union branch",
16615
16615
  "0 matching branches",
16616
- `No union branch matched at ${formatPath(path190)}. Tried ${schema.branches.length} branches. Expected one of: ${branchDescriptions.join(" | ")}.`
16616
+ `No union branch matched at ${formatPath(path191)}. Tried ${schema.branches.length} branches. Expected one of: ${branchDescriptions.join(" | ")}.`
16617
16617
  );
16618
16618
  return { present: true, value };
16619
16619
  }
16620
16620
  addIssueWithMessage(
16621
16621
  state,
16622
- path190,
16622
+ path191,
16623
16623
  "exactly one union branch",
16624
16624
  `${matches.length} matching branches`,
16625
- `Expected exactly one union branch at ${formatPath(path190)}, but matched more than one branch: ${matches.map((match) => match.fingerprint).join(" | ")}`
16625
+ `Expected exactly one union branch at ${formatPath(path191)}, but matched more than one branch: ${matches.map((match) => match.fingerprint).join(" | ")}`
16626
16626
  );
16627
16627
  return { present: true, value };
16628
16628
  }
@@ -16634,25 +16634,25 @@ function hasRequiredKeys(schema, value) {
16634
16634
  }
16635
16635
  return true;
16636
16636
  }
16637
- function walkRecord(schema, value, path190, state) {
16637
+ function walkRecord(schema, value, path191, state) {
16638
16638
  if (!isPlainRecord3(value)) {
16639
- addExpectedIssue(state, path190, "object", value);
16639
+ addExpectedIssue(state, path191, "object", value);
16640
16640
  return { present: true, value };
16641
16641
  }
16642
16642
  const nextValue = {};
16643
16643
  for (const [key3, propertyValue] of Object.entries(value)) {
16644
- const result = walkSchema(schema.value, propertyValue, [...path190, key3], state);
16644
+ const result = walkSchema(schema.value, propertyValue, [...path191, key3], state);
16645
16645
  if (result.present) {
16646
16646
  setOwnValue(nextValue, key3, result.value);
16647
16647
  }
16648
16648
  }
16649
16649
  return { present: true, value: nextValue };
16650
16650
  }
16651
- function walkJson(value, path190, state) {
16651
+ function walkJson(value, path191, state) {
16652
16652
  if (isJsonValue(value)) {
16653
16653
  return { present: true, value };
16654
16654
  }
16655
- addExpectedIssue(state, path190, "JSON value", value);
16655
+ addExpectedIssue(state, path191, "JSON value", value);
16656
16656
  return { present: true, value };
16657
16657
  }
16658
16658
  function getDefault(schema) {
@@ -16730,45 +16730,45 @@ function expectedFor(schema) {
16730
16730
  return expectedFor(schema.inner);
16731
16731
  }
16732
16732
  }
16733
- function addExpectedIssue(state, path190, expected, value) {
16733
+ function addExpectedIssue(state, path191, expected, value) {
16734
16734
  addIssue(
16735
16735
  state,
16736
- path190,
16736
+ path191,
16737
16737
  expected,
16738
16738
  receivedType(value),
16739
- `Expected ${expected} at ${formatPath(path190)}`
16739
+ `Expected ${expected} at ${formatPath(path191)}`
16740
16740
  );
16741
16741
  }
16742
- function addUnexpectedPropertyIssue(state, path190) {
16742
+ function addUnexpectedPropertyIssue(state, path191) {
16743
16743
  addIssue(
16744
16744
  state,
16745
- path190,
16745
+ path191,
16746
16746
  "no additional properties",
16747
16747
  "unknown property",
16748
- `Unexpected property ${formatPath(path190)}`
16748
+ `Unexpected property ${formatPath(path191)}`
16749
16749
  );
16750
16750
  }
16751
- function addIssue(state, path190, expected, received, _message) {
16751
+ function addIssue(state, path191, expected, received, _message) {
16752
16752
  state.issues.push({
16753
- path: path190,
16753
+ path: path191,
16754
16754
  expected,
16755
16755
  received,
16756
- message: formatIssueMessage(expected, path190, received)
16756
+ message: formatIssueMessage(expected, path191, received)
16757
16757
  });
16758
16758
  }
16759
- function addIssueWithMessage(state, path190, expected, received, message2) {
16759
+ function addIssueWithMessage(state, path191, expected, received, message2) {
16760
16760
  state.issues.push({
16761
- path: path190,
16761
+ path: path191,
16762
16762
  expected,
16763
16763
  received,
16764
16764
  message: message2
16765
16765
  });
16766
16766
  }
16767
- function formatIssueMessage(expected, path190, received) {
16768
- return `Expected ${expected} at ${formatPath(path190)}, got ${received}`;
16767
+ function formatIssueMessage(expected, path191, received) {
16768
+ return `Expected ${expected} at ${formatPath(path191)}, got ${received}`;
16769
16769
  }
16770
- function formatPath(path190) {
16771
- return path190.length === 0 ? "value" : path190.join(".");
16770
+ function formatPath(path191) {
16771
+ return path191.length === 0 ? "value" : path191.join(".");
16772
16772
  }
16773
16773
  function compilePattern(pattern) {
16774
16774
  try {
@@ -16882,8 +16882,8 @@ function receivedType2(value) {
16882
16882
  }
16883
16883
  return typeof value;
16884
16884
  }
16885
- function issue(path190, expected, value, message2, keyword = keywordFor(expected)) {
16886
- return { path: path190, expected, received: receivedType2(value), message: message2, keyword };
16885
+ function issue(path191, expected, value, message2, keyword = keywordFor(expected)) {
16886
+ return { path: path191, expected, received: receivedType2(value), message: message2, keyword };
16887
16887
  }
16888
16888
  function keywordFor(expected) {
16889
16889
  if (["null", "boolean", "object", "array", "number", "integer", "string"].includes(expected)) {
@@ -17715,44 +17715,44 @@ function evaluateArrayApplicators(graph, node, schema, value, context) {
17715
17715
  }
17716
17716
  return results;
17717
17717
  }
17718
- function evaluateValidationKeywords(node, schema, value, path190) {
17718
+ function evaluateValidationKeywords(node, schema, value, path191) {
17719
17719
  const results = [];
17720
17720
  if (schema.nullable === true && value === null) {
17721
17721
  return results;
17722
17722
  }
17723
17723
  const types2 = typeof schema.type === "string" ? [schema.type] : Array.isArray(schema.type) ? schema.type : [];
17724
17724
  if (types2.length > 0 && !types2.some((type) => typeof type === "string" && typeMatches(type, value))) {
17725
- results.push(invalidResult(issue(path190, types2.join(","), value, `must be ${types2.join(",")}`)));
17725
+ results.push(invalidResult(issue(path191, types2.join(","), value, `must be ${types2.join(",")}`)));
17726
17726
  return results;
17727
17727
  }
17728
17728
  if (schema.const !== void 0 && !deepEqual(schema.const, value)) {
17729
- results.push(invalidResult(issue(path190, "const", value, "must be equal to constant")));
17729
+ results.push(invalidResult(issue(path191, "const", value, "must be equal to constant")));
17730
17730
  }
17731
17731
  if (Array.isArray(schema.enum) && !schema.enum.some((entry) => deepEqual(entry, value))) {
17732
17732
  results.push(
17733
- invalidResult(issue(path190, "enum", value, "must be equal to one of the allowed values"))
17733
+ invalidResult(issue(path191, "enum", value, "must be equal to one of the allowed values"))
17734
17734
  );
17735
17735
  }
17736
17736
  if (typeof value === "number" && Number.isFinite(value)) {
17737
- evaluateNumberKeywords(schema, value, path190, results);
17737
+ evaluateNumberKeywords(schema, value, path191, results);
17738
17738
  }
17739
17739
  if (typeof value === "string") {
17740
- evaluateStringKeywords(schema, value, path190, results);
17740
+ evaluateStringKeywords(schema, value, path191, results);
17741
17741
  }
17742
17742
  if (Array.isArray(value)) {
17743
- evaluateArrayKeywords(schema, value, path190, results);
17743
+ evaluateArrayKeywords(schema, value, path191, results);
17744
17744
  }
17745
17745
  if (isObject(value)) {
17746
- evaluateObjectKeywords(node, schema, value, path190, results);
17746
+ evaluateObjectKeywords(node, schema, value, path191, results);
17747
17747
  }
17748
17748
  return results;
17749
17749
  }
17750
- function evaluateNumberKeywords(schema, value, path190, results) {
17750
+ function evaluateNumberKeywords(schema, value, path191, results) {
17751
17751
  if (typeof schema.multipleOf === "number" && !isMultipleOf(value, schema.multipleOf)) {
17752
17752
  results.push(
17753
17753
  invalidResult(
17754
17754
  issue(
17755
- path190,
17755
+ path191,
17756
17756
  `multiple of ${schema.multipleOf}`,
17757
17757
  value,
17758
17758
  `must be multiple of ${schema.multipleOf}`
@@ -17762,36 +17762,36 @@ function evaluateNumberKeywords(schema, value, path190, results) {
17762
17762
  }
17763
17763
  if (typeof schema.maximum === "number" && value > schema.maximum) {
17764
17764
  results.push(
17765
- invalidResult(issue(path190, `<= ${schema.maximum}`, value, `must be <= ${schema.maximum}`))
17765
+ invalidResult(issue(path191, `<= ${schema.maximum}`, value, `must be <= ${schema.maximum}`))
17766
17766
  );
17767
17767
  }
17768
17768
  if (typeof schema.minimum === "number" && value < schema.minimum) {
17769
17769
  results.push(
17770
- invalidResult(issue(path190, `>= ${schema.minimum}`, value, `must be >= ${schema.minimum}`))
17770
+ invalidResult(issue(path191, `>= ${schema.minimum}`, value, `must be >= ${schema.minimum}`))
17771
17771
  );
17772
17772
  }
17773
17773
  if (typeof schema.exclusiveMaximum === "number" && value >= schema.exclusiveMaximum) {
17774
17774
  results.push(
17775
17775
  invalidResult(
17776
- issue(path190, `< ${schema.exclusiveMaximum}`, value, `must be < ${schema.exclusiveMaximum}`)
17776
+ issue(path191, `< ${schema.exclusiveMaximum}`, value, `must be < ${schema.exclusiveMaximum}`)
17777
17777
  )
17778
17778
  );
17779
17779
  }
17780
17780
  if (typeof schema.exclusiveMinimum === "number" && value <= schema.exclusiveMinimum) {
17781
17781
  results.push(
17782
17782
  invalidResult(
17783
- issue(path190, `> ${schema.exclusiveMinimum}`, value, `must be > ${schema.exclusiveMinimum}`)
17783
+ issue(path191, `> ${schema.exclusiveMinimum}`, value, `must be > ${schema.exclusiveMinimum}`)
17784
17784
  )
17785
17785
  );
17786
17786
  }
17787
17787
  }
17788
- function evaluateStringKeywords(schema, value, path190, results) {
17788
+ function evaluateStringKeywords(schema, value, path191, results) {
17789
17789
  const length = unicodeLength(value);
17790
17790
  if (typeof schema.maxLength === "number" && length > schema.maxLength) {
17791
17791
  results.push(
17792
17792
  invalidResult(
17793
17793
  issue(
17794
- path190,
17794
+ path191,
17795
17795
  `length <= ${schema.maxLength}`,
17796
17796
  value,
17797
17797
  `must NOT have more than ${schema.maxLength} characters`
@@ -17803,7 +17803,7 @@ function evaluateStringKeywords(schema, value, path190, results) {
17803
17803
  results.push(
17804
17804
  invalidResult(
17805
17805
  issue(
17806
- path190,
17806
+ path191,
17807
17807
  `length >= ${schema.minLength}`,
17808
17808
  value,
17809
17809
  `must NOT have fewer than ${schema.minLength} characters`
@@ -17814,17 +17814,17 @@ function evaluateStringKeywords(schema, value, path190, results) {
17814
17814
  if (typeof schema.pattern === "string" && !new RegExp(schema.pattern, "u").test(value)) {
17815
17815
  results.push(
17816
17816
  invalidResult(
17817
- issue(path190, `pattern ${schema.pattern}`, value, `must match pattern ${schema.pattern}`)
17817
+ issue(path191, `pattern ${schema.pattern}`, value, `must match pattern ${schema.pattern}`)
17818
17818
  )
17819
17819
  );
17820
17820
  }
17821
17821
  }
17822
- function evaluateArrayKeywords(schema, value, path190, results) {
17822
+ function evaluateArrayKeywords(schema, value, path191, results) {
17823
17823
  if (typeof schema.maxItems === "number" && value.length > schema.maxItems) {
17824
17824
  results.push(
17825
17825
  invalidResult(
17826
17826
  issue(
17827
- path190,
17827
+ path191,
17828
17828
  `items <= ${schema.maxItems}`,
17829
17829
  value,
17830
17830
  `must NOT have more than ${schema.maxItems} items`
@@ -17836,7 +17836,7 @@ function evaluateArrayKeywords(schema, value, path190, results) {
17836
17836
  results.push(
17837
17837
  invalidResult(
17838
17838
  issue(
17839
- path190,
17839
+ path191,
17840
17840
  `items >= ${schema.minItems}`,
17841
17841
  value,
17842
17842
  `must NOT have fewer than ${schema.minItems} items`
@@ -17849,7 +17849,7 @@ function evaluateArrayKeywords(schema, value, path190, results) {
17849
17849
  for (let right = left + 1; right < value.length; right += 1) {
17850
17850
  if (deepEqual(value[left], value[right])) {
17851
17851
  results.push(
17852
- invalidResult(issue(path190, "unique items", value, "must NOT have duplicate items"))
17852
+ invalidResult(issue(path191, "unique items", value, "must NOT have duplicate items"))
17853
17853
  );
17854
17854
  return;
17855
17855
  }
@@ -17857,13 +17857,13 @@ function evaluateArrayKeywords(schema, value, path190, results) {
17857
17857
  }
17858
17858
  }
17859
17859
  }
17860
- function evaluateObjectKeywords(node, schema, value, path190, results) {
17860
+ function evaluateObjectKeywords(node, schema, value, path191, results) {
17861
17861
  const keys = Object.keys(value);
17862
17862
  if (typeof schema.maxProperties === "number" && keys.length > schema.maxProperties) {
17863
17863
  results.push(
17864
17864
  invalidResult(
17865
17865
  issue(
17866
- path190,
17866
+ path191,
17867
17867
  `properties <= ${schema.maxProperties}`,
17868
17868
  value,
17869
17869
  `must NOT have more than ${schema.maxProperties} properties`
@@ -17875,7 +17875,7 @@ function evaluateObjectKeywords(node, schema, value, path190, results) {
17875
17875
  results.push(
17876
17876
  invalidResult(
17877
17877
  issue(
17878
- path190,
17878
+ path191,
17879
17879
  `properties >= ${schema.minProperties}`,
17880
17880
  value,
17881
17881
  `must NOT have fewer than ${schema.minProperties} properties`
@@ -17888,7 +17888,7 @@ function evaluateObjectKeywords(node, schema, value, path190, results) {
17888
17888
  if (typeof key3 === "string" && !Object.prototype.hasOwnProperty.call(value, key3)) {
17889
17889
  results.push(
17890
17890
  invalidResult(
17891
- issue([...path190, key3], "required", void 0, `must have required property '${key3}'`)
17891
+ issue([...path191, key3], "required", void 0, `must have required property '${key3}'`)
17892
17892
  )
17893
17893
  );
17894
17894
  }
@@ -17897,24 +17897,24 @@ function evaluateObjectKeywords(node, schema, value, path190, results) {
17897
17897
  const dependentRequired = isObject(schema.dependentRequired) ? schema.dependentRequired : {};
17898
17898
  for (const [key3, dependencies] of Object.entries(dependentRequired)) {
17899
17899
  if (Object.prototype.hasOwnProperty.call(value, key3) && Array.isArray(dependencies)) {
17900
- addMissingDependencies(value, dependencies, path190, results);
17900
+ addMissingDependencies(value, dependencies, path191, results);
17901
17901
  }
17902
17902
  }
17903
17903
  if (node.dialect === "draft7" && isObject(schema.dependencies)) {
17904
17904
  for (const [key3, dependencies] of Object.entries(schema.dependencies)) {
17905
17905
  if (Object.prototype.hasOwnProperty.call(value, key3) && Array.isArray(dependencies)) {
17906
- addMissingDependencies(value, dependencies, path190, results);
17906
+ addMissingDependencies(value, dependencies, path191, results);
17907
17907
  }
17908
17908
  }
17909
17909
  }
17910
17910
  }
17911
- function addMissingDependencies(value, dependencies, path190, results) {
17911
+ function addMissingDependencies(value, dependencies, path191, results) {
17912
17912
  for (const dependency of dependencies) {
17913
17913
  if (typeof dependency === "string" && !Object.prototype.hasOwnProperty.call(value, dependency)) {
17914
17914
  results.push(
17915
17915
  invalidResult(
17916
17916
  issue(
17917
- [...path190, dependency],
17917
+ [...path191, dependency],
17918
17918
  "dependency",
17919
17919
  void 0,
17920
17920
  `must have property '${dependency}'`
@@ -18036,8 +18036,8 @@ function compileJsonSchema(schema, options = {}) {
18036
18036
  }
18037
18037
  function formatIssues(issues) {
18038
18038
  return issues.map((current) => {
18039
- const path190 = current.path.length === 0 ? "data" : `data/${current.path.join("/")}`;
18040
- return `${path190} ${current.message}`;
18039
+ const path191 = current.path.length === 0 ? "data" : `data/${current.path.join("/")}`;
18040
+ return `${path191} ${current.message}`;
18041
18041
  }).join(", ");
18042
18042
  }
18043
18043
  var init_json_schema = __esm({
@@ -18547,11 +18547,11 @@ function mergeLayers(layers) {
18547
18547
  }
18548
18548
  return mergeObjectLayers(layers, []);
18549
18549
  }
18550
- function mergeObjectLayers(layers, path190) {
18550
+ function mergeObjectLayers(layers, path191) {
18551
18551
  const data = {};
18552
18552
  const sources = {};
18553
18553
  for (const key3 of collectKeys(layers)) {
18554
- const resolved = resolveKey(layers, key3, path190);
18554
+ const resolved = resolveKey(layers, key3, path191);
18555
18555
  if (resolved === void 0) {
18556
18556
  continue;
18557
18557
  }
@@ -18571,7 +18571,7 @@ function collectKeys(layers) {
18571
18571
  }
18572
18572
  return [...keys];
18573
18573
  }
18574
- function resolveKey(layers, key3, path190) {
18574
+ function resolveKey(layers, key3, path191) {
18575
18575
  let winningSource;
18576
18576
  let winningValue;
18577
18577
  const objectLayers = [];
@@ -18604,9 +18604,9 @@ function resolveKey(layers, key3, path190) {
18604
18604
  if (winningValue === null) {
18605
18605
  return void 0;
18606
18606
  }
18607
- const fullPath = buildPath(path190, key3);
18607
+ const fullPath = buildPath(path191, key3);
18608
18608
  if (isPlainObject(winningValue)) {
18609
- const merged = mergeObjectLayers(objectLayers, [...path190, key3]);
18609
+ const merged = mergeObjectLayers(objectLayers, [...path191, key3]);
18610
18610
  return {
18611
18611
  value: merged.data,
18612
18612
  sources: {
@@ -18634,8 +18634,8 @@ function isWinningCandidate(key3, value) {
18634
18634
  function getOwnEntry2(record2, key3) {
18635
18635
  return Object.prototype.hasOwnProperty.call(record2, key3) ? record2[key3] : void 0;
18636
18636
  }
18637
- function buildPath(path190, key3) {
18638
- return [...path190, key3].map(escapePathSegment).join(".");
18637
+ function buildPath(path191, key3) {
18638
+ return [...path191, key3].map(escapePathSegment).join(".");
18639
18639
  }
18640
18640
  function escapePathSegment(segment) {
18641
18641
  return segment.replaceAll("\\", "\\\\").replaceAll(".", "\\.");
@@ -19499,22 +19499,22 @@ function prune2(obj, shape) {
19499
19499
  }
19500
19500
  return { changed, result };
19501
19501
  }
19502
- function modifyAtPath(content, path190, value) {
19502
+ function modifyAtPath(content, path191, value) {
19503
19503
  const indent = detectIndent(content);
19504
19504
  const formattingOptions = {
19505
19505
  tabSize: indent === " " ? 1 : indent.length,
19506
19506
  insertSpaces: indent !== " ",
19507
19507
  eol: "\n"
19508
19508
  };
19509
- const edits = jsonc.modify(content, path190, value, { formattingOptions });
19509
+ const edits = jsonc.modify(content, path191, value, { formattingOptions });
19510
19510
  let result = jsonc.applyEdits(content, edits);
19511
19511
  if (!result.endsWith("\n")) {
19512
19512
  result += "\n";
19513
19513
  }
19514
19514
  return result;
19515
19515
  }
19516
- function removeAtPath(content, path190) {
19517
- return modifyAtPath(content, path190, void 0);
19516
+ function removeAtPath(content, path191) {
19517
+ return modifyAtPath(content, path191, void 0);
19518
19518
  }
19519
19519
  function serializeUpdate(content, current, next) {
19520
19520
  let result = content || "{}";
@@ -19524,15 +19524,15 @@ function serializeUpdate(content, current, next) {
19524
19524
  }
19525
19525
  return result;
19526
19526
  }
19527
- function applyObjectUpdate(content, path190, current, next) {
19527
+ function applyObjectUpdate(content, path191, current, next) {
19528
19528
  let result = content;
19529
19529
  for (const key3 of Object.keys(current)) {
19530
19530
  if (!hasConfigEntry(next, key3)) {
19531
- result = removeAtPath(result, [...path190, key3]);
19531
+ result = removeAtPath(result, [...path191, key3]);
19532
19532
  }
19533
19533
  }
19534
19534
  for (const [key3, nextValue] of Object.entries(next)) {
19535
- const nextPath = [...path190, key3];
19535
+ const nextPath = [...path191, key3];
19536
19536
  const hasCurrent = hasConfigEntry(current, key3);
19537
19537
  const currentValue = hasCurrent ? current[key3] : void 0;
19538
19538
  if (hasCurrent && isConfigObject(currentValue) && isConfigObject(nextValue)) {
@@ -19739,16 +19739,16 @@ function getConfigFormat(pathOrFormat) {
19739
19739
  }
19740
19740
  return formatRegistry[formatName];
19741
19741
  }
19742
- function detectFormat2(path190) {
19743
- const ext = getExtension(path190);
19742
+ function detectFormat2(path191) {
19743
+ const ext = getExtension(path191);
19744
19744
  return extensionMap[ext];
19745
19745
  }
19746
- function getExtension(path190) {
19747
- const lastDot = path190.lastIndexOf(".");
19746
+ function getExtension(path191) {
19747
+ const lastDot = path191.lastIndexOf(".");
19748
19748
  if (lastDot === -1) {
19749
19749
  return "";
19750
19750
  }
19751
- return path190.slice(lastDot).toLowerCase();
19751
+ return path191.slice(lastDot).toLowerCase();
19752
19752
  }
19753
19753
  var formatRegistry, extensionMap;
19754
19754
  var init_formats = __esm({
@@ -21138,7 +21138,7 @@ function mergeScope(scope, baseScope, overrideScope) {
21138
21138
  }
21139
21139
  return merged;
21140
21140
  }
21141
- function mergeRuntimeScope(baseScope, overrideScope, path190 = []) {
21141
+ function mergeRuntimeScope(baseScope, overrideScope, path191 = []) {
21142
21142
  const merged = {};
21143
21143
  const keys = /* @__PURE__ */ new Set([...Object.keys(baseScope), ...Object.keys(overrideScope)]);
21144
21144
  for (const key3 of keys) {
@@ -21151,7 +21151,7 @@ function mergeRuntimeScope(baseScope, overrideScope, path190 = []) {
21151
21151
  continue;
21152
21152
  }
21153
21153
  if (isRecord4(baseValue) && isRecord4(overrideValue)) {
21154
- setOwnEntry(merged, key3, mergeRuntimeScope(baseValue, overrideValue, [...path190, key3]));
21154
+ setOwnEntry(merged, key3, mergeRuntimeScope(baseValue, overrideValue, [...path191, key3]));
21155
21155
  continue;
21156
21156
  }
21157
21157
  setOwnEntry(merged, key3, overrideValue);
@@ -22742,45 +22742,45 @@ import { createTwoFilesPatch } from "diff";
22742
22742
  import chalk from "chalk";
22743
22743
  function createDryRunFileSystem(base, recorder) {
22744
22744
  const proxy = {
22745
- async readFile(path190, encoding) {
22745
+ async readFile(path191, encoding) {
22746
22746
  if (encoding) {
22747
- return base.readFile(path190, encoding);
22747
+ return base.readFile(path191, encoding);
22748
22748
  }
22749
- return base.readFile(path190);
22749
+ return base.readFile(path191);
22750
22750
  },
22751
- async writeFile(path190, data, options) {
22752
- const previousContent = await tryReadText(base, path190);
22751
+ async writeFile(path191, data, options) {
22752
+ const previousContent = await tryReadText(base, path191);
22753
22753
  const nextContent = formatData(data, options?.encoding);
22754
22754
  recorder.record({
22755
22755
  type: "writeFile",
22756
- path: path190,
22756
+ path: path191,
22757
22757
  nextContent,
22758
22758
  previousContent
22759
22759
  });
22760
22760
  },
22761
- async symlink(target, path190) {
22762
- recorder.record({ type: "symlink", target, path: path190 });
22761
+ async symlink(target, path191) {
22762
+ recorder.record({ type: "symlink", target, path: path191 });
22763
22763
  },
22764
- async readlink(path190) {
22765
- return base.readlink(path190);
22764
+ async readlink(path191) {
22765
+ return base.readlink(path191);
22766
22766
  },
22767
- async realpath(path190) {
22768
- return base.realpath(path190);
22767
+ async realpath(path191) {
22768
+ return base.realpath(path191);
22769
22769
  },
22770
- async mkdir(path190, options) {
22770
+ async mkdir(path191, options) {
22771
22771
  recorder.record({
22772
22772
  type: "mkdir",
22773
- path: path190,
22773
+ path: path191,
22774
22774
  options,
22775
22775
  // Matches how the mutation layer itself decides the mkdir is a no-op.
22776
- existing: await pathExists(base, path190)
22776
+ existing: await pathExists(base, path191)
22777
22777
  });
22778
22778
  },
22779
- async stat(path190) {
22780
- return base.stat(path190);
22779
+ async stat(path191) {
22780
+ return base.stat(path191);
22781
22781
  },
22782
- async lstat(path190) {
22783
- return base.lstat(path190);
22782
+ async lstat(path191) {
22783
+ return base.lstat(path191);
22784
22784
  },
22785
22785
  async rename(from, to) {
22786
22786
  const staged = recorder.takeStagedWrite(from);
@@ -22795,16 +22795,16 @@ function createDryRunFileSystem(base, recorder) {
22795
22795
  }
22796
22796
  recorder.record({ type: "rename", from, to });
22797
22797
  },
22798
- async unlink(path190) {
22799
- recorder.record({ type: "unlink", path: path190 });
22798
+ async unlink(path191) {
22799
+ recorder.record({ type: "unlink", path: path191 });
22800
22800
  },
22801
- async readdir(path190) {
22802
- return base.readdir(path190);
22801
+ async readdir(path191) {
22802
+ return base.readdir(path191);
22803
22803
  }
22804
22804
  };
22805
22805
  if (typeof base.rm === "function") {
22806
- proxy.rm = async (path190, options) => {
22807
- recorder.record({ type: "rm", path: path190, options });
22806
+ proxy.rm = async (path191, options) => {
22807
+ recorder.record({ type: "rm", path: path191, options });
22808
22808
  };
22809
22809
  }
22810
22810
  if (typeof base.copyFile === "function") {
@@ -22949,8 +22949,8 @@ function describeWriteChange(previous, next) {
22949
22949
  }
22950
22950
  return "update";
22951
22951
  }
22952
- function renderWriteCommand(path190, change) {
22953
- const command = `cat > ${quoteShellArgument(path190)}`;
22952
+ function renderWriteCommand(path191, change) {
22953
+ const command = `cat > ${quoteShellArgument(path191)}`;
22954
22954
  if (change === "create") {
22955
22955
  return renderOperationCommand(command, chalk.green, "# create");
22956
22956
  }
@@ -23157,9 +23157,9 @@ function describesChange(operation) {
23157
23157
  }
23158
23158
  return true;
23159
23159
  }
23160
- async function tryReadText(base, path190) {
23160
+ async function tryReadText(base, path191) {
23161
23161
  try {
23162
- return await base.readFile(path190, "utf8");
23162
+ return await base.readFile(path191, "utf8");
23163
23163
  } catch (error3) {
23164
23164
  if (isNotFound(error3)) {
23165
23165
  return null;
@@ -23213,10 +23213,10 @@ var init_dry_run = __esm({
23213
23213
  // Atomic writers stage content in a temp file and rename it over the target.
23214
23214
  // Pulling the staged write back out lets the rename re-record it against the
23215
23215
  // real target, so the preview diffs the delta instead of the whole file.
23216
- takeStagedWrite(path190) {
23216
+ takeStagedWrite(path191) {
23217
23217
  for (let index = this.operations.length - 1; index >= 0; index -= 1) {
23218
23218
  const operation = this.operations[index];
23219
- if (operation.type === "writeFile" && operation.path === path190) {
23219
+ if (operation.type === "writeFile" && operation.path === path191) {
23220
23220
  this.operations.splice(index, 1);
23221
23221
  return operation;
23222
23222
  }
@@ -34906,21 +34906,21 @@ async function* adaptClaude(lines) {
34906
34906
  if (blockType !== "tool_result") continue;
34907
34907
  const kind = toolKindsById.get(item.tool_use_id);
34908
34908
  toolKindsById.delete(item.tool_use_id);
34909
- let path190;
34909
+ let path191;
34910
34910
  if (typeof item.content === "string") {
34911
- path190 = item.content;
34911
+ path191 = item.content;
34912
34912
  } else {
34913
34913
  try {
34914
- path190 = JSON.stringify(item.content);
34914
+ path191 = JSON.stringify(item.content);
34915
34915
  } catch {
34916
- path190 = String(item.content);
34916
+ path191 = String(item.content);
34917
34917
  }
34918
34918
  }
34919
34919
  yield {
34920
34920
  event: "tool_complete",
34921
34921
  id: item.tool_use_id,
34922
34922
  kind,
34923
- path: path190
34923
+ path: path191
34924
34924
  };
34925
34925
  }
34926
34926
  }
@@ -35043,10 +35043,10 @@ async function* adaptCodex(lines) {
35043
35043
  const kindFromStart = toolKindById.get(item.id);
35044
35044
  const kind = kindFromStart ?? (itemType === "command_execution" ? "exec" : itemType === "file_edit" ? "edit" : "other");
35045
35045
  const titleFromEvent = isNonEmptyString(item.path) ? item.path : itemType === "mcp_tool_call" ? `${isNonEmptyString(item.server) ? item.server : "unknown"}.${isNonEmptyString(item.tool) ? item.tool : "unknown"}` : void 0;
35046
- const path190 = titleFromEvent ?? toolTitleById.get(item.id) ?? "";
35046
+ const path191 = titleFromEvent ?? toolTitleById.get(item.id) ?? "";
35047
35047
  toolTitleById.delete(item.id);
35048
35048
  toolKindById.delete(item.id);
35049
- yield { event: "tool_complete", id: item.id, kind, path: path190 };
35049
+ yield { event: "tool_complete", id: item.id, kind, path: path191 };
35050
35050
  }
35051
35051
  }
35052
35052
  }
@@ -35425,14 +35425,14 @@ function toolInfo(event) {
35425
35425
  const [toolName = "tool", rawTool = {}] = Object.entries(toolCall)[0] ?? [];
35426
35426
  const tool = asObject2(rawTool) ?? {};
35427
35427
  const args = asObject2(tool.args) ?? asObject2(tool.arguments) ?? tool;
35428
- const path190 = typeof args.path === "string" ? args.path : "";
35428
+ const path191 = typeof args.path === "string" ? args.path : "";
35429
35429
  const kinds = {
35430
35430
  editToolCall: "edit",
35431
35431
  readToolCall: "read",
35432
35432
  shellToolCall: "exec",
35433
35433
  bashToolCall: "exec"
35434
35434
  };
35435
- return { kind: kinds[toolName] ?? "other", title: path190 || toolName, path: path190 };
35435
+ return { kind: kinds[toolName] ?? "other", title: path191 || toolName, path: path191 };
35436
35436
  }
35437
35437
  async function* adaptCursor(lines) {
35438
35438
  for await (const rawLine of lines) {
@@ -37783,8 +37783,8 @@ function resourceNotFound(resource) {
37783
37783
  `Resource not found: ${resource}`
37784
37784
  );
37785
37785
  }
37786
- function assertAbsolutePath(path190) {
37787
- if (!isAbsolute(path190)) {
37786
+ function assertAbsolutePath(path191) {
37787
+ if (!isAbsolute(path191)) {
37788
37788
  throw invalidParams('"path" must be an absolute path');
37789
37789
  }
37790
37790
  }
@@ -39196,7 +39196,7 @@ function updateSessionFromEvent(ctx, event, toolCallsById) {
39196
39196
  }
39197
39197
  const id = readString(event.id);
39198
39198
  const kind = readString(event.kind);
39199
- const path190 = readString(event.path);
39199
+ const path191 = readString(event.path);
39200
39200
  let toolCall = id ? toolCallsById.get(id) : void 0;
39201
39201
  if (!toolCall) {
39202
39202
  toolCall = {};
@@ -39211,8 +39211,8 @@ function updateSessionFromEvent(ctx, event, toolCallsById) {
39211
39211
  if (kind) {
39212
39212
  toolCall.kind = kind;
39213
39213
  }
39214
- if (path190) {
39215
- toolCall.path = path190;
39214
+ if (path191) {
39215
+ toolCall.path = path191;
39216
39216
  }
39217
39217
  }
39218
39218
  var sessionCapture;
@@ -55184,7 +55184,7 @@ function isWorktree(value) {
55184
55184
  return false;
55185
55185
  }
55186
55186
  const name = getOwnEntry18(value, "name");
55187
- const path190 = getOwnEntry18(value, "path");
55187
+ const path191 = getOwnEntry18(value, "path");
55188
55188
  const branch = getOwnEntry18(value, "branch");
55189
55189
  const baseBranch = getOwnEntry18(value, "baseBranch");
55190
55190
  const createdAt2 = getOwnEntry18(value, "createdAt");
@@ -55198,7 +55198,7 @@ function isWorktree(value) {
55198
55198
  const baseHead = getOwnEntry18(value, "baseHead");
55199
55199
  const reconciledAt = getOwnEntry18(value, "reconciledAt");
55200
55200
  const reconciliation = getOwnEntry18(value, "reconciliation");
55201
- return typeof name === "string" && typeof path190 === "string" && typeof branch === "string" && typeof baseBranch === "string" && typeof createdAt2 === "string" && typeof source === "string" && typeof agent3 === "string" && (status === "active" || status === "reconciling" || status === "conflicted" || status === "cleanup_failed" || status === "done" || status === "failed" || status === "removing") && (storyId === void 0 || typeof storyId === "string") && (planPath === void 0 || typeof planPath === "string") && (prompt === void 0 || typeof prompt === "string") && (sourceCwd === void 0 || typeof sourceCwd === "string") && (baseHead === void 0 || typeof baseHead === "string") && (reconciledAt === void 0 || typeof reconciledAt === "string") && (reconciliation === void 0 || isReconciliationSummary(reconciliation));
55201
+ return typeof name === "string" && typeof path191 === "string" && typeof branch === "string" && typeof baseBranch === "string" && typeof createdAt2 === "string" && typeof source === "string" && typeof agent3 === "string" && (status === "active" || status === "reconciling" || status === "conflicted" || status === "cleanup_failed" || status === "done" || status === "failed" || status === "removing") && (storyId === void 0 || typeof storyId === "string") && (planPath === void 0 || typeof planPath === "string") && (prompt === void 0 || typeof prompt === "string") && (sourceCwd === void 0 || typeof sourceCwd === "string") && (baseHead === void 0 || typeof baseHead === "string") && (reconciledAt === void 0 || typeof reconciledAt === "string") && (reconciliation === void 0 || isReconciliationSummary(reconciliation));
55202
55202
  }
55203
55203
  function isReconciliationSummary(value) {
55204
55204
  if (typeof value !== "object" || value === null) {
@@ -55639,9 +55639,9 @@ function parsePorcelainPaths(output) {
55639
55639
  const entries = output.split("\0").filter((entry) => entry.length > 0);
55640
55640
  for (let index = 0; index < entries.length; index += 1) {
55641
55641
  const entry = entries[index];
55642
- const path190 = entry.length > 3 ? entry.slice(3) : entry;
55643
- if (path190.length > 0) {
55644
- paths.push(path190);
55642
+ const path191 = entry.length > 3 ? entry.slice(3) : entry;
55643
+ if (path191.length > 0) {
55644
+ paths.push(path191);
55645
55645
  }
55646
55646
  if ((entry.startsWith("R ") || entry.startsWith("C ")) && index + 1 < entries.length) {
55647
55647
  const sourcePath = entries[index + 1];
@@ -57992,14 +57992,14 @@ function formatTimestamp2(timestamp) {
57992
57992
  }
57993
57993
  function editPlan(dashboard, absolutePath, env, openInEditor) {
57994
57994
  const editor = resolveEditor(env);
57995
- const open8 = openInEditor ?? openInEditorWithSystem;
57995
+ const open9 = openInEditor ?? openInEditorWithSystem;
57996
57996
  if (editor.mode === "gui") {
57997
- open8(absolutePath, env);
57997
+ open9(absolutePath, env);
57998
57998
  return;
57999
57999
  }
58000
58000
  dashboard.stop();
58001
58001
  try {
58002
- open8(absolutePath, env);
58002
+ open9(absolutePath, env);
58003
58003
  } finally {
58004
58004
  dashboard.start();
58005
58005
  }
@@ -59063,10 +59063,10 @@ function parseReviewDiff(diffText) {
59063
59063
  finalizeFile();
59064
59064
  const paths = parseDiffGitPaths(line);
59065
59065
  const previousPath = paths?.previousPath ?? "";
59066
- const path190 = paths?.path ?? previousPath;
59066
+ const path191 = paths?.path ?? previousPath;
59067
59067
  currentFile = {
59068
- path: path190,
59069
- previousPath: previousPath && previousPath !== path190 ? previousPath : null,
59068
+ path: path191,
59069
+ previousPath: previousPath && previousPath !== path191 ? previousPath : null,
59070
59070
  status: "modified",
59071
59071
  hunks: [],
59072
59072
  reviewableLines: [],
@@ -59096,9 +59096,9 @@ function parseReviewDiff(diffText) {
59096
59096
  continue;
59097
59097
  }
59098
59098
  if (line.startsWith("+++ ")) {
59099
- const path190 = normalizeDiffPath(line.slice(4).trim());
59100
- if (path190) {
59101
- currentFile.path = path190;
59099
+ const path191 = normalizeDiffPath(line.slice(4).trim());
59100
+ if (path191) {
59101
+ currentFile.path = path191;
59102
59102
  }
59103
59103
  continue;
59104
59104
  }
@@ -59157,31 +59157,31 @@ function validateInlineComments(comments, context) {
59157
59157
  const accepted = [];
59158
59158
  const seen = /* @__PURE__ */ new Set();
59159
59159
  for (const comment of comments) {
59160
- const path190 = comment.path;
59160
+ const path191 = comment.path;
59161
59161
  const body = comment.body.trim();
59162
- if (path190.length === 0 || !body || !Number.isInteger(comment.line) || comment.line < 1) {
59162
+ if (path191.length === 0 || !body || !Number.isInteger(comment.line) || comment.line < 1) {
59163
59163
  throw new Error("Inline review comments require path, positive line, and body.");
59164
59164
  }
59165
59165
  if (comment.side === "LEFT") {
59166
59166
  throw new Error(
59167
- `Inline comment target ${path190}:${comment.line} is a left-side diff target; only right-side comments are supported.`
59167
+ `Inline comment target ${path191}:${comment.line} is a left-side diff target; only right-side comments are supported.`
59168
59168
  );
59169
59169
  }
59170
- if (!context.reviewableLinesByPath.get(path190)?.has(comment.line)) {
59170
+ if (!context.reviewableLinesByPath.get(path191)?.has(comment.line)) {
59171
59171
  throw new Error(
59172
- `Inline comment target ${path190}:${comment.line} is not a valid right-side diff target.`
59172
+ `Inline comment target ${path191}:${comment.line} is not a valid right-side diff target.`
59173
59173
  );
59174
59174
  }
59175
- if (!comment.side && context.leftLinesByPath.get(path190)?.has(comment.line) && context.rightContextLinesByPath.get(path190)?.has(comment.line)) {
59175
+ if (!comment.side && context.leftLinesByPath.get(path191)?.has(comment.line) && context.rightContextLinesByPath.get(path191)?.has(comment.line)) {
59176
59176
  throw new Error(
59177
- `Inline comment target ${path190}:${comment.line} is ambiguous; specify side RIGHT to target the right-side diff line.`
59177
+ `Inline comment target ${path191}:${comment.line} is ambiguous; specify side RIGHT to target the right-side diff line.`
59178
59178
  );
59179
59179
  }
59180
- const key3 = `${path190}\0${comment.line}\0${body}`;
59180
+ const key3 = `${path191}\0${comment.line}\0${body}`;
59181
59181
  if (!seen.has(key3)) {
59182
59182
  seen.add(key3);
59183
59183
  accepted.push({
59184
- path: path190,
59184
+ path: path191,
59185
59185
  line: comment.line,
59186
59186
  ...comment.side ? { side: comment.side } : {},
59187
59187
  body
@@ -59682,9 +59682,9 @@ function reviewEndpoint(prUrl) {
59682
59682
  }
59683
59683
  function normalizeReviewComments(comments) {
59684
59684
  return comments.map((comment) => {
59685
- const path190 = comment.path.trim();
59685
+ const path191 = comment.path.trim();
59686
59686
  const body = comment.body.trim();
59687
- if (!path190) {
59687
+ if (!path191) {
59688
59688
  throw new Error("Review comment path must be non-empty.");
59689
59689
  }
59690
59690
  if (!Number.isSafeInteger(comment.line) || comment.line <= 0) {
@@ -59693,7 +59693,7 @@ function normalizeReviewComments(comments) {
59693
59693
  if (!body) {
59694
59694
  throw new Error("Review comment body must be non-empty.");
59695
59695
  }
59696
- return { path: path190, line: comment.line, body };
59696
+ return { path: path191, line: comment.line, body };
59697
59697
  });
59698
59698
  }
59699
59699
  function submissionFromResponse(response) {
@@ -59988,10 +59988,10 @@ var init_review_history = __esm({
59988
59988
  kind,
59989
59989
  body
59990
59990
  };
59991
- const path190 = text4(record2, "path");
59991
+ const path191 = text4(record2, "path");
59992
59992
  const line = integer(record2, "line") ?? integer(record2, "original_line");
59993
59993
  const diffHunk = text4(record2, "diff_hunk");
59994
- if (path190) normalized.path = path190;
59994
+ if (path191) normalized.path = path191;
59995
59995
  if (line !== null) normalized.line = line;
59996
59996
  if (diffHunk) normalized.diffHunk = diffHunk;
59997
59997
  return normalized;
@@ -60701,9 +60701,9 @@ function containedPath(directory, name) {
60701
60701
  }
60702
60702
  return target;
60703
60703
  }
60704
- async function pathExists7(path190) {
60704
+ async function pathExists7(path191) {
60705
60705
  try {
60706
- await access(path190);
60706
+ await access(path191);
60707
60707
  return true;
60708
60708
  } catch (error3) {
60709
60709
  if (isMissingFileError4(error3)) {
@@ -64100,9 +64100,9 @@ function normalizeToolResult2(handlerResult, outputSchema) {
64100
64100
  structuredContent
64101
64101
  };
64102
64102
  }
64103
- function assertObjectRootSchema(schema, path190) {
64103
+ function assertObjectRootSchema(schema, path191) {
64104
64104
  if (schema.type !== "object") {
64105
- throw new Error(`${path190} root type must be "object"`);
64105
+ throw new Error(`${path191} root type must be "object"`);
64106
64106
  }
64107
64107
  }
64108
64108
  function isJsonObject(value) {
@@ -64441,23 +64441,23 @@ function extractFieldErrors(body) {
64441
64441
  const flattened = candidates.flatMap((candidate) => flattenFieldErrors(candidate, []));
64442
64442
  return flattened.length === 0 ? void 0 : flattened;
64443
64443
  }
64444
- function flattenFieldErrors(value, path190) {
64444
+ function flattenFieldErrors(value, path191) {
64445
64445
  if (typeof value === "string") {
64446
- return [{ path: formatPath2(path190), message: value }];
64446
+ return [{ path: formatPath2(path191), message: value }];
64447
64447
  }
64448
64448
  if (Array.isArray(value)) {
64449
64449
  if (value.every((entry) => typeof entry === "string")) {
64450
- return value.map((message2) => ({ path: formatPath2(path190), message: message2 }));
64450
+ return value.map((message2) => ({ path: formatPath2(path191), message: message2 }));
64451
64451
  }
64452
- return value.flatMap((entry, index) => flattenFieldErrors(entry, [...path190, String(index)]));
64452
+ return value.flatMap((entry, index) => flattenFieldErrors(entry, [...path191, String(index)]));
64453
64453
  }
64454
64454
  if (!isPlainObject4(value)) {
64455
64455
  return [];
64456
64456
  }
64457
- return Object.entries(value).flatMap(([key3, nested]) => flattenFieldErrors(nested, [...path190, key3]));
64457
+ return Object.entries(value).flatMap(([key3, nested]) => flattenFieldErrors(nested, [...path191, key3]));
64458
64458
  }
64459
- function formatPath2(path190) {
64460
- return path190.length === 0 ? "error" : path190.join(".");
64459
+ function formatPath2(path191) {
64460
+ return path191.length === 0 ? "error" : path191.join(".");
64461
64461
  }
64462
64462
  function extractFirstString(body, fields) {
64463
64463
  if (!isPlainObject4(body)) {
@@ -64999,12 +64999,12 @@ function mergeApprovalsRoot(root, options) {
64999
64999
  }
65000
65000
  return options.humanInLoop.mergeApprovalsGroup(root);
65001
65001
  }
65002
- function findHumanInLoopCommandPath(node, path190) {
65002
+ function findHumanInLoopCommandPath(node, path191) {
65003
65003
  if (node.kind === "command") {
65004
- return node.humanInLoop ? path190.join(".") || node.name : void 0;
65004
+ return node.humanInLoop ? path191.join(".") || node.name : void 0;
65005
65005
  }
65006
65006
  for (const child of node.children) {
65007
- const found = findHumanInLoopCommandPath(child, [...path190, child.name]);
65007
+ const found = findHumanInLoopCommandPath(child, [...path191, child.name]);
65008
65008
  if (found !== void 0) {
65009
65009
  return found;
65010
65010
  }
@@ -65039,13 +65039,13 @@ function convertJsonSchema(schema) {
65039
65039
  }
65040
65040
  return convertSchema(schema, schema, []);
65041
65041
  }
65042
- function convertSchema(schema, root, path190) {
65043
- const resolvedSchema = resolveReferencedSchema(schema, root, path190);
65042
+ function convertSchema(schema, root, path191) {
65043
+ const resolvedSchema = resolveReferencedSchema(schema, root, path191);
65044
65044
  const normalizedSchema = normalizeNullability(resolvedSchema);
65045
65045
  const composition = getComposition(normalizedSchema.schema);
65046
65046
  if (Array.isArray(normalizedSchema.schema.type)) {
65047
65047
  throw new Error(
65048
- `JSON Schema "${formatJsonSchemaPath(path190)}" has an unsupported type "${formatJsonSchemaType(
65048
+ `JSON Schema "${formatJsonSchemaPath(path191)}" has an unsupported type "${formatJsonSchemaType(
65049
65049
  normalizedSchema.schema.type
65050
65050
  )}". Supported: string, number, integer, boolean, array, object.`
65051
65051
  );
@@ -65057,13 +65057,13 @@ function convertSchema(schema, root, path190) {
65057
65057
  return convertEnumSchema(resolvedSchema, normalizedSchema.nullable);
65058
65058
  }
65059
65059
  if (composition !== void 0) {
65060
- return convertCompositionSchema(normalizedSchema.schema, root, normalizedSchema.nullable, path190);
65060
+ return convertCompositionSchema(normalizedSchema.schema, root, normalizedSchema.nullable, path191);
65061
65061
  }
65062
65062
  if (isRecordSchema(normalizedSchema.schema)) {
65063
65063
  return applyMetadata(
65064
65064
  S.Record(
65065
65065
  convertSchema(normalizedSchema.schema.additionalProperties, root, [
65066
- ...path190,
65066
+ ...path191,
65067
65067
  "additionalProperties"
65068
65068
  ])
65069
65069
  ),
@@ -65112,12 +65112,12 @@ function convertSchema(schema, root, path190) {
65112
65112
  if (normalizedSchema.schema.items === void 0) {
65113
65113
  throw new Error(
65114
65114
  `JSON Schema "${formatJsonSchemaPath(
65115
- path190
65115
+ path191
65116
65116
  )}" is an array but is missing the "items" field. Add "items": { ... } to declare the element type.`
65117
65117
  );
65118
65118
  }
65119
65119
  return S.Array(
65120
- convertSchema(normalizedSchema.schema.items, root, [...path190, "items"]),
65120
+ convertSchema(normalizedSchema.schema.items, root, [...path191, "items"]),
65121
65121
  createCommonOptions(
65122
65122
  normalizedSchema.schema,
65123
65123
  normalizedSchema.nullable,
@@ -65127,7 +65127,7 @@ function convertSchema(schema, root, path190) {
65127
65127
  case "object":
65128
65128
  return convertObjectSchema(normalizedSchema.schema, root, {
65129
65129
  nullable: normalizedSchema.nullable,
65130
- path: path190
65130
+ path: path191
65131
65131
  });
65132
65132
  case "null":
65133
65133
  return applyMetadata(S.Json(), normalizedSchema.schema, {
@@ -65142,12 +65142,12 @@ function convertSchema(schema, root, path190) {
65142
65142
  }
65143
65143
  throw new Error(
65144
65144
  `JSON Schema "${formatJsonSchemaPath(
65145
- path190
65145
+ path191
65146
65146
  )}" must declare one of: "type", "enum", "const", "oneOf", "anyOf", or "allOf".`
65147
65147
  );
65148
65148
  }
65149
65149
  throw new Error(
65150
- `JSON Schema "${formatJsonSchemaPath(path190)}" has an unsupported type "${formatJsonSchemaType(
65150
+ `JSON Schema "${formatJsonSchemaPath(path191)}" has an unsupported type "${formatJsonSchemaType(
65151
65151
  normalizedSchema.schema.type
65152
65152
  )}". Supported: string, number, integer, boolean, array, object.`
65153
65153
  );
@@ -65191,21 +65191,21 @@ function convertEnumSchema(schema, nullable) {
65191
65191
  )
65192
65192
  });
65193
65193
  }
65194
- function convertCompositionSchema(schema, root, nullable, path190) {
65194
+ function convertCompositionSchema(schema, root, nullable, path191) {
65195
65195
  const composition = getComposition(schema);
65196
65196
  const branchSchemas = composition?.branches ?? [];
65197
65197
  const keyword = composition?.keyword ?? "oneOf";
65198
65198
  const branches = branchSchemas.map(
65199
- (branch, index) => resolveReferencedSchema(branch, root, [...path190, keyword, String(index)])
65199
+ (branch, index) => resolveReferencedSchema(branch, root, [...path191, keyword, String(index)])
65200
65200
  );
65201
- const discriminator = findDiscriminator(branches, root, path190);
65201
+ const discriminator = findDiscriminator(branches, root, path191);
65202
65202
  if (discriminator !== void 0) {
65203
65203
  const convertedBranches = Object.fromEntries(
65204
65204
  branches.map((branch, index) => [
65205
65205
  getDiscriminatorLiteral(branch, discriminator, root),
65206
65206
  convertObjectSchema(branch, root, {
65207
65207
  omitProperty: discriminator,
65208
- path: [...path190, keyword, String(index)]
65208
+ path: [...path191, keyword, String(index)]
65209
65209
  })
65210
65210
  ])
65211
65211
  );
@@ -65224,7 +65224,7 @@ function convertCompositionSchema(schema, root, nullable, path190) {
65224
65224
  S.Union(
65225
65225
  branches.map(
65226
65226
  (branch, index) => convertObjectSchema(branch, root, {
65227
- path: [...path190, keyword, String(index)]
65227
+ path: [...path191, keyword, String(index)]
65228
65228
  })
65229
65229
  )
65230
65230
  ),
@@ -65338,11 +65338,11 @@ function getComposition(schema) {
65338
65338
  }
65339
65339
  return void 0;
65340
65340
  }
65341
- function formatJsonSchemaPath(path190) {
65342
- if (path190.length === 0) {
65341
+ function formatJsonSchemaPath(path191) {
65342
+ if (path191.length === 0) {
65343
65343
  return "#";
65344
65344
  }
65345
- return `#/${path190.map(escapeJsonPointerSegment).join("/")}`;
65345
+ return `#/${path191.map(escapeJsonPointerSegment).join("/")}`;
65346
65346
  }
65347
65347
  function formatJsonSchemaType(type) {
65348
65348
  return Array.isArray(type) ? JSON.stringify(type) : String(type);
@@ -65358,11 +65358,11 @@ function isRecordSchema(schema) {
65358
65358
  const propertyKeys = Object.keys(schema.properties ?? {});
65359
65359
  return schema.type === "object" && propertyKeys.length === 0 && typeof schema.additionalProperties === "object" && schema.additionalProperties !== null;
65360
65360
  }
65361
- function findDiscriminator(branches, root, path190) {
65361
+ function findDiscriminator(branches, root, path191) {
65362
65362
  const [firstBranch] = branches;
65363
65363
  if (firstBranch === void 0) {
65364
65364
  throw new Error(
65365
- `JSON Schema "${formatJsonSchemaPath(path190)}" uses oneOf/anyOf/allOf but has no branches.`
65365
+ `JSON Schema "${formatJsonSchemaPath(path191)}" uses oneOf/anyOf/allOf but has no branches.`
65366
65366
  );
65367
65367
  }
65368
65368
  const candidateKeys = Object.keys(firstBranch.properties ?? {});
@@ -65402,19 +65402,19 @@ function getDiscriminatorLiteral(branch, key3, root) {
65402
65402
  }
65403
65403
  return void 0;
65404
65404
  }
65405
- function resolveReferencedSchema(schema, root, path190) {
65405
+ function resolveReferencedSchema(schema, root, path191) {
65406
65406
  if (schema.$ref === void 0) {
65407
65407
  return schema;
65408
65408
  }
65409
65409
  const resolvedTarget = resolveLocalRef(root, schema.$ref);
65410
65410
  if (resolvedTarget === void 0) {
65411
65411
  throw new Error(
65412
- `JSON Schema "${formatJsonSchemaPath(path190)}" uses "$ref": ${schema.$ref}. toolcraft only supports internal refs like "#/components/schemas/Foo".`
65412
+ `JSON Schema "${formatJsonSchemaPath(path191)}" uses "$ref": ${schema.$ref}. toolcraft only supports internal refs like "#/components/schemas/Foo".`
65413
65413
  );
65414
65414
  }
65415
65415
  const { $ref: ignoredRef, ...siblingKeywords } = schema;
65416
65416
  void ignoredRef;
65417
- const resolvedSchema = resolveReferencedSchema(resolvedTarget, root, path190);
65417
+ const resolvedSchema = resolveReferencedSchema(resolvedTarget, root, path191);
65418
65418
  if (Object.keys(siblingKeywords).length === 0) {
65419
65419
  return resolvedSchema;
65420
65420
  }
@@ -65438,9 +65438,9 @@ function mergeJsonSchemas(base, overlay) {
65438
65438
  ...mergedRequired === void 0 ? {} : { required: mergedRequired }
65439
65439
  };
65440
65440
  }
65441
- function hasSelfReferencingRef(schema, root, path190 = "#", activePaths = /* @__PURE__ */ new Set()) {
65441
+ function hasSelfReferencingRef(schema, root, path191 = "#", activePaths = /* @__PURE__ */ new Set()) {
65442
65442
  const nextActivePaths = new Set(activePaths);
65443
- nextActivePaths.add(path190);
65443
+ nextActivePaths.add(path191);
65444
65444
  const localRefPath = getLocalRefPath(schema.$ref);
65445
65445
  if (localRefPath !== void 0) {
65446
65446
  if (nextActivePaths.has(localRefPath)) {
@@ -65451,13 +65451,13 @@ function hasSelfReferencingRef(schema, root, path190 = "#", activePaths = /* @__
65451
65451
  return true;
65452
65452
  }
65453
65453
  }
65454
- if (schema.items !== void 0 && hasSelfReferencingRef(schema.items, root, `${path190}/items`, nextActivePaths)) {
65454
+ if (schema.items !== void 0 && hasSelfReferencingRef(schema.items, root, `${path191}/items`, nextActivePaths)) {
65455
65455
  return true;
65456
65456
  }
65457
65457
  if (typeof schema.additionalProperties === "object" && schema.additionalProperties !== null && hasSelfReferencingRef(
65458
65458
  schema.additionalProperties,
65459
65459
  root,
65460
- `${path190}/additionalProperties`,
65460
+ `${path191}/additionalProperties`,
65461
65461
  nextActivePaths
65462
65462
  )) {
65463
65463
  return true;
@@ -65466,7 +65466,7 @@ function hasSelfReferencingRef(schema, root, path190 = "#", activePaths = /* @__
65466
65466
  if (hasSelfReferencingRef(
65467
65467
  childSchema,
65468
65468
  root,
65469
- `${path190}/properties/${escapeJsonPointerSegment(key3)}`,
65469
+ `${path191}/properties/${escapeJsonPointerSegment(key3)}`,
65470
65470
  nextActivePaths
65471
65471
  )) {
65472
65472
  return true;
@@ -65476,24 +65476,24 @@ function hasSelfReferencingRef(schema, root, path190 = "#", activePaths = /* @__
65476
65476
  if (hasSelfReferencingRef(
65477
65477
  childSchema,
65478
65478
  root,
65479
- `${path190}/$defs/${escapeJsonPointerSegment(key3)}`,
65479
+ `${path191}/$defs/${escapeJsonPointerSegment(key3)}`,
65480
65480
  nextActivePaths
65481
65481
  )) {
65482
65482
  return true;
65483
65483
  }
65484
65484
  }
65485
65485
  for (const [index, childSchema] of (schema.oneOf ?? []).entries()) {
65486
- if (hasSelfReferencingRef(childSchema, root, `${path190}/oneOf/${index}`, nextActivePaths)) {
65486
+ if (hasSelfReferencingRef(childSchema, root, `${path191}/oneOf/${index}`, nextActivePaths)) {
65487
65487
  return true;
65488
65488
  }
65489
65489
  }
65490
65490
  for (const [index, childSchema] of (schema.anyOf ?? []).entries()) {
65491
- if (hasSelfReferencingRef(childSchema, root, `${path190}/anyOf/${index}`, nextActivePaths)) {
65491
+ if (hasSelfReferencingRef(childSchema, root, `${path191}/anyOf/${index}`, nextActivePaths)) {
65492
65492
  return true;
65493
65493
  }
65494
65494
  }
65495
65495
  for (const [index, childSchema] of (schema.allOf ?? []).entries()) {
65496
- if (hasSelfReferencingRef(childSchema, root, `${path190}/allOf/${index}`, nextActivePaths)) {
65496
+ if (hasSelfReferencingRef(childSchema, root, `${path191}/allOf/${index}`, nextActivePaths)) {
65497
65497
  return true;
65498
65498
  }
65499
65499
  }
@@ -65509,14 +65509,14 @@ function getLocalRefPath(ref) {
65509
65509
  return ref.startsWith("#/") ? ref : void 0;
65510
65510
  }
65511
65511
  function resolveLocalRef(root, ref) {
65512
- const path190 = getLocalRefPath(ref);
65513
- if (path190 === void 0) {
65512
+ const path191 = getLocalRefPath(ref);
65513
+ if (path191 === void 0) {
65514
65514
  return void 0;
65515
65515
  }
65516
- if (path190 === "#") {
65516
+ if (path191 === "#") {
65517
65517
  return root;
65518
65518
  }
65519
- const segments = path190.slice(2).split("/").map(unescapeJsonPointerSegment);
65519
+ const segments = path191.slice(2).split("/").map(unescapeJsonPointerSegment);
65520
65520
  let current = root;
65521
65521
  for (const segment of segments) {
65522
65522
  if (Array.isArray(current)) {
@@ -66269,21 +66269,21 @@ function createFs(fs31) {
66269
66269
  return fs31;
66270
66270
  }
66271
66271
  return {
66272
- readFile: async (path190, encoding = "utf8") => readFile13(path190, { encoding }),
66273
- writeFile: async (path190, contents, options) => {
66274
- await writeFile9(path190, contents, options);
66272
+ readFile: async (path191, encoding = "utf8") => readFile13(path191, { encoding }),
66273
+ writeFile: async (path191, contents, options) => {
66274
+ await writeFile9(path191, contents, options);
66275
66275
  },
66276
- exists: async (path190) => {
66276
+ exists: async (path191) => {
66277
66277
  try {
66278
- await access2(path190);
66278
+ await access2(path191);
66279
66279
  return true;
66280
66280
  } catch {
66281
66281
  return false;
66282
66282
  }
66283
66283
  },
66284
- lstat: async (path190) => lstat12(path190),
66284
+ lstat: async (path191) => lstat12(path191),
66285
66285
  rename: async (fromPath, toPath) => rename10(fromPath, toPath),
66286
- unlink: async (path190) => unlink9(path190)
66286
+ unlink: async (path191) => unlink9(path191)
66287
66287
  };
66288
66288
  }
66289
66289
  function createEnv(values = process.env) {
@@ -66421,11 +66421,11 @@ function applySchemaCasing(schema, casing) {
66421
66421
  ...oneOf === void 0 ? {} : { oneOf }
66422
66422
  };
66423
66423
  }
66424
- function collectParamSummaries(schema, casing, path190 = [], inheritedOptional = false) {
66424
+ function collectParamSummaries(schema, casing, path191 = [], inheritedOptional = false) {
66425
66425
  const summaries = [];
66426
66426
  for (const [key3, rawChildSchema] of Object.entries(schema.shape)) {
66427
66427
  const childSchema = unwrapOptional3(rawChildSchema);
66428
- const nextPath = [...path190, formatSegment(key3, casing)];
66428
+ const nextPath = [...path191, formatSegment(key3, casing)];
66429
66429
  const optional = inheritedOptional || isOptional(rawChildSchema);
66430
66430
  if (childSchema.kind === "object") {
66431
66431
  summaries.push(...collectParamSummaries(childSchema, casing, nextPath, optional));
@@ -66469,8 +66469,8 @@ function matchesAllowlist(toolName, allowlist) {
66469
66469
  const candidates = segments.map((_segment, index) => segments.slice(0, index + 1).join("__"));
66470
66470
  return candidates.some((candidate) => allowlist.includes(candidate));
66471
66471
  }
66472
- function formatToolName(path190) {
66473
- return path190.map((segment) => formatSegment(segment, "snake")).join("__");
66472
+ function formatToolName(path191) {
66473
+ return path191.map((segment) => formatSegment(segment, "snake")).join("__");
66474
66474
  }
66475
66475
  function validateUniqueMCPParameterFields(schema, casing) {
66476
66476
  const sourceKeysByField = /* @__PURE__ */ new Map();
@@ -69066,14 +69066,14 @@ function parseDockerLocator(input) {
69066
69066
  throw new Error(`Invalid docker workspace locator "${input}".`);
69067
69067
  }
69068
69068
  const container = input.slice(0, slashIndex);
69069
- const path190 = input.slice(slashIndex);
69070
- if (container.length === 0 || path190.length === 0) {
69069
+ const path191 = input.slice(slashIndex);
69070
+ if (container.length === 0 || path191.length === 0) {
69071
69071
  throw new Error(`Invalid docker workspace locator "${input}".`);
69072
69072
  }
69073
69073
  return {
69074
69074
  scheme: "docker",
69075
69075
  container,
69076
- path: path190
69076
+ path: path191
69077
69077
  };
69078
69078
  }
69079
69079
  function splitOnce(input, separator) {
@@ -69937,8 +69937,8 @@ async function checkAuth(options) {
69937
69937
  }
69938
69938
  function createCurrentBalanceUrl(baseUrl) {
69939
69939
  const url = new URL(baseUrl);
69940
- const path190 = url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname;
69941
- url.pathname = `${path190}/usage/current_balance`;
69940
+ const path191 = url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname;
69941
+ url.pathname = `${path191}/usage/current_balance`;
69942
69942
  return url.toString();
69943
69943
  }
69944
69944
  function isCurrentBalanceResponse(value) {
@@ -71404,26 +71404,26 @@ function createSdkContainer(options) {
71404
71404
  });
71405
71405
  loggerFactory.setErrorLogger(errorLogger);
71406
71406
  const asyncFs = {
71407
- readFile: ((path190, encoding) => {
71407
+ readFile: ((path191, encoding) => {
71408
71408
  if (encoding) {
71409
- return fs9.readFile(path190, encoding);
71409
+ return fs9.readFile(path191, encoding);
71410
71410
  }
71411
- return fs9.readFile(path190);
71411
+ return fs9.readFile(path191);
71412
71412
  }),
71413
- symlink: (target, path190) => fs9.symlink(target, path190),
71414
- readlink: (path190) => fs9.readlink(path190, { encoding: "utf8" }),
71415
- realpath: (path190) => fs9.realpath(path190),
71416
- writeFile: (path190, data, opts) => fs9.writeFile(path190, data, opts),
71417
- mkdir: (path190, opts) => fs9.mkdir(path190, opts).then(() => {
71413
+ symlink: (target, path191) => fs9.symlink(target, path191),
71414
+ readlink: (path191) => fs9.readlink(path191, { encoding: "utf8" }),
71415
+ realpath: (path191) => fs9.realpath(path191),
71416
+ writeFile: (path191, data, opts) => fs9.writeFile(path191, data, opts),
71417
+ mkdir: (path191, opts) => fs9.mkdir(path191, opts).then(() => {
71418
71418
  }),
71419
- stat: (path190) => fs9.stat(path190),
71420
- lstat: (path190) => fs9.lstat(path190),
71419
+ stat: (path191) => fs9.stat(path191),
71420
+ lstat: (path191) => fs9.lstat(path191),
71421
71421
  rename: (oldPath, newPath) => fs9.rename(oldPath, newPath),
71422
- rm: (path190, opts) => fs9.rm(path190, opts),
71423
- unlink: (path190) => fs9.unlink(path190),
71424
- readdir: (path190) => fs9.readdir(path190),
71422
+ rm: (path191, opts) => fs9.rm(path191, opts),
71423
+ unlink: (path191) => fs9.unlink(path191),
71424
+ readdir: (path191) => fs9.readdir(path191),
71425
71425
  copyFile: (src, dest) => fs9.copyFile(src, dest),
71426
- chmod: (path190, mode) => fs9.chmod(path190, mode)
71426
+ chmod: (path191, mode) => fs9.chmod(path191, mode)
71427
71427
  };
71428
71428
  const contextFactory = createCommandContextFactory({ fs: asyncFs });
71429
71429
  const authProviders = allAuthProviders;
@@ -73574,7 +73574,7 @@ function selectNextExecution(plan, taskId) {
73574
73574
  function describeExecutionContext(selection) {
73575
73575
  return selection.stepName ? `task "${selection.task.id}" step "${selection.stepName}"` : `task "${selection.task.id}"`;
73576
73576
  }
73577
- async function resolveFileIncludes(template2, cwd, readFile59) {
73577
+ async function resolveFileIncludes(template2, cwd, readFile60) {
73578
73578
  const matches = [...template2.matchAll(FILE_INCLUDE_PATTERN)];
73579
73579
  if (matches.length === 0) {
73580
73580
  return template2;
@@ -73586,7 +73586,7 @@ async function resolveFileIncludes(template2, cwd, readFile59) {
73586
73586
  if (relativePath === ".." || relativePath.startsWith(`..${path82.sep}`) || path82.isAbsolute(relativePath)) {
73587
73587
  throw new Error(`Pipeline file include resolves outside the project root: ${match[1]}`);
73588
73588
  }
73589
- const content = await readFile59(absolutePath, "utf8");
73589
+ const content = await readFile60(absolutePath, "utf8");
73590
73590
  result = result.replace(match[0], content);
73591
73591
  }
73592
73592
  return result;
@@ -73660,15 +73660,15 @@ async function resolveDocVarFromPath(options) {
73660
73660
  );
73661
73661
  }
73662
73662
  }
73663
- async function resolvePipelineVars(vars, cwd, readFile59) {
73663
+ async function resolvePipelineVars(vars, cwd, readFile60) {
73664
73664
  const resolved = {};
73665
73665
  for (const [key3, value] of Object.entries(vars)) {
73666
73666
  if (key3.endsWith("_doc") && looksLikeDocPath(value)) {
73667
- const docContent = await resolveDocVarFromPath({ key: key3, value, cwd, readFile: readFile59 });
73668
- defineRecordEntry3(resolved, key3, await resolveFileIncludes(docContent, cwd, readFile59));
73667
+ const docContent = await resolveDocVarFromPath({ key: key3, value, cwd, readFile: readFile60 });
73668
+ defineRecordEntry3(resolved, key3, await resolveFileIncludes(docContent, cwd, readFile60));
73669
73669
  continue;
73670
73670
  }
73671
- defineRecordEntry3(resolved, key3, await resolveFileIncludes(value, cwd, readFile59));
73671
+ defineRecordEntry3(resolved, key3, await resolveFileIncludes(value, cwd, readFile60));
73672
73672
  }
73673
73673
  return resolved;
73674
73674
  }
@@ -84438,9 +84438,9 @@ async function openTraceIndex(options) {
84438
84438
  stats2.removed += shard.count;
84439
84439
  delete manifest.shards[directory];
84440
84440
  manifestDirty = true;
84441
- const unlink26 = fs31.unlink;
84442
- if (typeof unlink26 === "function") {
84443
- await unlink26.call(fs31, path112.join(shardsDir, shard.file)).catch(() => void 0);
84441
+ const unlink27 = fs31.unlink;
84442
+ if (typeof unlink27 === "function") {
84443
+ await unlink27.call(fs31, path112.join(shardsDir, shard.file)).catch(() => void 0);
84444
84444
  }
84445
84445
  }
84446
84446
  }
@@ -84484,13 +84484,13 @@ async function openTraceIndex(options) {
84484
84484
  return results.map(referenceFromRecord);
84485
84485
  };
84486
84486
  const rebuild = async (syncOptions) => {
84487
- const unlink26 = fs31.unlink;
84488
- if (typeof unlink26 === "function") {
84487
+ const unlink27 = fs31.unlink;
84488
+ if (typeof unlink27 === "function") {
84489
84489
  const names = await fs31.readdir(shardsDir).catch(() => []);
84490
84490
  for (const name of names) {
84491
- await unlink26.call(fs31, path112.join(shardsDir, name)).catch(() => void 0);
84491
+ await unlink27.call(fs31, path112.join(shardsDir, name)).catch(() => void 0);
84492
84492
  }
84493
- await unlink26.call(fs31, manifestPath).catch(() => void 0);
84493
+ await unlink27.call(fs31, manifestPath).catch(() => void 0);
84494
84494
  } else {
84495
84495
  await writeAtomic(manifestPath, JSON.stringify({ version: MANIFEST_VERSION, shards: {} }));
84496
84496
  }
@@ -88043,15 +88043,15 @@ async function publishFiles(fs31, files) {
88043
88043
  function isAlreadyExistsError12(error3) {
88044
88044
  return hasOwnErrorCode24(error3, "EEXIST");
88045
88045
  }
88046
- async function assertNotSymbolicLinkIfSet(fs31, path190) {
88047
- if (path190 !== void 0 && path190 !== "") {
88048
- await assertNotSymbolicLink2(fs31, path190);
88046
+ async function assertNotSymbolicLinkIfSet(fs31, path191) {
88047
+ if (path191 !== void 0 && path191 !== "") {
88048
+ await assertNotSymbolicLink2(fs31, path191);
88049
88049
  }
88050
88050
  }
88051
- async function assertNotSymbolicLink2(fs31, path190) {
88051
+ async function assertNotSymbolicLink2(fs31, path191) {
88052
88052
  try {
88053
- if ((await fs31.lstat(path190)).isSymbolicLink()) {
88054
- throw new UserError2(`Refusing to use symbolic link path: ${path190}`);
88053
+ if ((await fs31.lstat(path191)).isSymbolicLink()) {
88054
+ throw new UserError2(`Refusing to use symbolic link path: ${path191}`);
88055
88055
  }
88056
88056
  } catch (error3) {
88057
88057
  if (isMissingFileError8(error3)) {
@@ -89459,12 +89459,12 @@ function validateNonBlankStrings(value) {
89459
89459
  }
89460
89460
  return issues;
89461
89461
  }
89462
- function blankStringIssue(path190, value) {
89462
+ function blankStringIssue(path191, value) {
89463
89463
  return {
89464
- path: path190,
89464
+ path: path191,
89465
89465
  expected: "non-blank string",
89466
89466
  received: JSON.stringify(value),
89467
- message: `${path190.join(".")} must not be blank.`
89467
+ message: `${path191.join(".")} must not be blank.`
89468
89468
  };
89469
89469
  }
89470
89470
  function validateTarget(target) {
@@ -89515,8 +89515,8 @@ function validateMetrics(metrics) {
89515
89515
  function formatIssues2(filePath, issues) {
89516
89516
  return issues.map((issue2) => `${filePath} (${formatPath3(issue2.path)}): ${issue2.message}`).join("\n");
89517
89517
  }
89518
- function formatPath3(path190) {
89519
- return path190.join(".") || "value";
89518
+ function formatPath3(path191) {
89519
+ return path191.join(".") || "value";
89520
89520
  }
89521
89521
  var nonEmptyString2, positiveInteger, nonNegativeInteger, scoringWeight, metricEvaluatorSchema, metricSchema, evalYamlSchema, EvalYamlValidationError;
89522
89522
  var init_schema5 = __esm({
@@ -89920,9 +89920,9 @@ async function loadEval(source, id, fs31 = nodeFs17) {
89920
89920
  plan
89921
89921
  };
89922
89922
  }
89923
- async function isFile2(path190, fs31) {
89923
+ async function isFile2(path191, fs31) {
89924
89924
  try {
89925
- const stat36 = await fs31.stat(path190);
89925
+ const stat36 = await fs31.stat(path191);
89926
89926
  return typeof stat36.isFile === "function" ? stat36.isFile() : !stat36.isDirectory();
89927
89927
  } catch (error3) {
89928
89928
  if (isMissingPath4(error3)) {
@@ -91805,19 +91805,19 @@ function validateRunResult(value, filePath) {
91805
91805
  requireRecord2(result.cheatReport, filePath, "result.json", ["cheatReport"]);
91806
91806
  return result;
91807
91807
  }
91808
- function validateScoringComponent(value, filePath, path190) {
91809
- const component = requireRecord2(value, filePath, "result.json", path190);
91810
- requireBoolean(component.configured, filePath, "result.json", [...path190, "configured"]);
91811
- requireBoolean(component.required, filePath, "result.json", [...path190, "required"]);
91808
+ function validateScoringComponent(value, filePath, path191) {
91809
+ const component = requireRecord2(value, filePath, "result.json", path191);
91810
+ requireBoolean(component.configured, filePath, "result.json", [...path191, "configured"]);
91811
+ requireBoolean(component.required, filePath, "result.json", [...path191, "required"]);
91812
91812
  requireRange(component.configuredWeight, 0, 1, filePath, "result.json", [
91813
- ...path190,
91813
+ ...path191,
91814
91814
  "configuredWeight"
91815
91815
  ]);
91816
91816
  requireRange(component.effectiveWeight, 0, 1, filePath, "result.json", [
91817
- ...path190,
91817
+ ...path191,
91818
91818
  "effectiveWeight"
91819
91819
  ]);
91820
- requireString(component.status, filePath, "result.json", [...path190, "status"]);
91820
+ requireString(component.status, filePath, "result.json", [...path191, "status"]);
91821
91821
  }
91822
91822
  function validateTrace(value, filePath) {
91823
91823
  const trace = requireRecord2(value, filePath, "trace.json", []);
@@ -91826,48 +91826,48 @@ function validateTrace(value, filePath) {
91826
91826
  }
91827
91827
  return trace;
91828
91828
  }
91829
- function requireRecord2(value, filePath, artifact, path190) {
91829
+ function requireRecord2(value, filePath, artifact, path191) {
91830
91830
  if (typeof value === "object" && value !== null && !Array.isArray(value)) {
91831
91831
  return value;
91832
91832
  }
91833
- throw invalidArtifactField(filePath, artifact, path190, "object", value);
91833
+ throw invalidArtifactField(filePath, artifact, path191, "object", value);
91834
91834
  }
91835
- function requireString(value, filePath, artifact, path190) {
91835
+ function requireString(value, filePath, artifact, path191) {
91836
91836
  if (typeof value === "string" && value.length > 0) {
91837
91837
  return value;
91838
91838
  }
91839
- throw invalidArtifactField(filePath, artifact, path190, "non-empty string", value);
91839
+ throw invalidArtifactField(filePath, artifact, path191, "non-empty string", value);
91840
91840
  }
91841
- function requireBoolean(value, filePath, artifact, path190) {
91841
+ function requireBoolean(value, filePath, artifact, path191) {
91842
91842
  if (typeof value !== "boolean") {
91843
- throw invalidArtifactField(filePath, artifact, path190, "boolean", value);
91843
+ throw invalidArtifactField(filePath, artifact, path191, "boolean", value);
91844
91844
  }
91845
91845
  }
91846
- function requireNonNegativeInteger2(value, filePath, artifact, path190) {
91846
+ function requireNonNegativeInteger2(value, filePath, artifact, path191) {
91847
91847
  if (typeof value === "number" && Number.isInteger(value) && value >= 0) {
91848
91848
  return value;
91849
91849
  }
91850
- throw invalidArtifactField(filePath, artifact, path190, "non-negative integer", value);
91850
+ throw invalidArtifactField(filePath, artifact, path191, "non-negative integer", value);
91851
91851
  }
91852
- function requireNonNegativeNumber(value, filePath, artifact, path190) {
91852
+ function requireNonNegativeNumber(value, filePath, artifact, path191) {
91853
91853
  if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
91854
91854
  return value;
91855
91855
  }
91856
- throw invalidArtifactField(filePath, artifact, path190, "non-negative number", value);
91856
+ throw invalidArtifactField(filePath, artifact, path191, "non-negative number", value);
91857
91857
  }
91858
- function requireRange(value, min, max, filePath, artifact, path190) {
91858
+ function requireRange(value, min, max, filePath, artifact, path191) {
91859
91859
  if (typeof value === "number" && Number.isFinite(value) && value >= min && value <= max) {
91860
91860
  return;
91861
91861
  }
91862
- throw invalidArtifactField(filePath, artifact, path190, `number from ${min} through ${max}`, value);
91862
+ throw invalidArtifactField(filePath, artifact, path191, `number from ${min} through ${max}`, value);
91863
91863
  }
91864
- function invalidArtifactField(filePath, artifact, path190, expected, received) {
91864
+ function invalidArtifactField(filePath, artifact, path191, expected, received) {
91865
91865
  return new Error(
91866
- `Invalid ${artifact} in ${filePath} (${formatIssuePath(path190)}): expected ${expected}, received ${formatReceived2(received)}.`
91866
+ `Invalid ${artifact} in ${filePath} (${formatIssuePath(path191)}): expected ${expected}, received ${formatReceived2(received)}.`
91867
91867
  );
91868
91868
  }
91869
- function formatIssuePath(path190) {
91870
- return path190.join(".") || "value";
91869
+ function formatIssuePath(path191) {
91870
+ return path191.join(".") || "value";
91871
91871
  }
91872
91872
  function formatReceived2(value) {
91873
91873
  if (typeof value === "string") {
@@ -96660,11 +96660,11 @@ function formatSegment2(segment, casing) {
96660
96660
  const separator = casing === "snake" ? "_" : "-";
96661
96661
  return splitWords4(segment).join(separator);
96662
96662
  }
96663
- function toOptionFlag(path190, casing) {
96664
- return `--${path190.map((segment) => formatSegment2(segment, casing)).join(".")}`;
96663
+ function toOptionFlag(path191, casing) {
96664
+ return `--${path191.map((segment) => formatSegment2(segment, casing)).join(".")}`;
96665
96665
  }
96666
- function toOptionAttribute(path190, casing) {
96667
- return path190.map((segment) => {
96666
+ function toOptionAttribute(path191, casing) {
96667
+ return path191.map((segment) => {
96668
96668
  const formatted = formatSegment2(segment, casing);
96669
96669
  if (casing === "snake") {
96670
96670
  return formatted;
@@ -96675,23 +96675,23 @@ function toOptionAttribute(path190, casing) {
96675
96675
  ).join("");
96676
96676
  }).join(".");
96677
96677
  }
96678
- function toDisplayPath(path190) {
96679
- return path190.join(".");
96678
+ function toDisplayPath(path191) {
96679
+ return path191.join(".");
96680
96680
  }
96681
- function toUnionKindControlPath(path190) {
96682
- if (path190.length === 0) {
96681
+ function toUnionKindControlPath(path191) {
96682
+ if (path191.length === 0) {
96683
96683
  return ["kind"];
96684
96684
  }
96685
- const head = path190.slice(0, -1);
96686
- const tail = path190[path190.length - 1] ?? "";
96685
+ const head = path191.slice(0, -1);
96686
+ const tail = path191[path191.length - 1] ?? "";
96687
96687
  return [...head, `${tail}Kind`];
96688
96688
  }
96689
- function toUnionKindDisplayPath(path190) {
96690
- if (path190.length === 0) {
96689
+ function toUnionKindDisplayPath(path191) {
96690
+ if (path191.length === 0) {
96691
96691
  return "kind";
96692
96692
  }
96693
- const head = path190.slice(0, -1);
96694
- const tail = path190[path190.length - 1] ?? "";
96693
+ const head = path191.slice(0, -1);
96694
+ const tail = path191[path191.length - 1] ?? "";
96695
96695
  return [...head, `${tail}-kind`].join(".");
96696
96696
  }
96697
96697
  function createSyntheticEnumSchema(values) {
@@ -96707,14 +96707,14 @@ function getRequiredBranchFingerprint(branch, casing) {
96707
96707
  const requiredKeys = Object.entries(branch.shape).filter(([, schema]) => schema.kind !== "optional").map(([key3]) => formatSegment2(key3, casing)).sort();
96708
96708
  return requiredKeys.join("+");
96709
96709
  }
96710
- function collectFields(schema, casing, globalLongOptionFlags, path190 = [], inheritedOptional = false, variantContext) {
96710
+ function collectFields(schema, casing, globalLongOptionFlags, path191 = [], inheritedOptional = false, variantContext) {
96711
96711
  const collected = {
96712
96712
  dynamicFields: [],
96713
96713
  fields: [],
96714
96714
  variants: []
96715
96715
  };
96716
96716
  for (const [key3, rawChildSchema] of Object.entries(schema.shape)) {
96717
- const nextPath = [...path190, key3];
96717
+ const nextPath = [...path191, key3];
96718
96718
  const runtimeOptional = inheritedOptional || rawChildSchema.kind === "optional";
96719
96719
  const childSchema = unwrapOptional4(rawChildSchema);
96720
96720
  const requiredWhenActive = rawChildSchema.kind !== "optional" && childSchema.default === void 0;
@@ -96900,9 +96900,9 @@ function collectFields(schema, casing, globalLongOptionFlags, path190 = [], inhe
96900
96900
  }
96901
96901
  return collected;
96902
96902
  }
96903
- function toCommanderOptionAttribute(path190, casing, globalLongOptionFlags) {
96904
- const optionAttribute = toOptionAttribute(path190, casing);
96905
- const optionFlag = toOptionFlag(path190, casing);
96903
+ function toCommanderOptionAttribute(path191, casing, globalLongOptionFlags) {
96904
+ const optionAttribute = toOptionAttribute(path191, casing);
96905
+ const optionFlag = toOptionFlag(path191, casing);
96906
96906
  if (!globalLongOptionFlags.has(optionFlag)) {
96907
96907
  return optionAttribute;
96908
96908
  }
@@ -98496,10 +98496,10 @@ function writeCLIDiagnosticEvent(event) {
98496
98496
  process.stderr.write(`${event.message}
98497
98497
  `);
98498
98498
  }
98499
- function setNestedValue(target, path190, value) {
98499
+ function setNestedValue(target, path191, value) {
98500
98500
  let cursor2 = target;
98501
- for (let index = 0; index < path190.length - 1; index += 1) {
98502
- const segment = path190[index] ?? "";
98501
+ for (let index = 0; index < path191.length - 1; index += 1) {
98502
+ const segment = path191[index] ?? "";
98503
98503
  const existing = Object.prototype.hasOwnProperty.call(cursor2, segment) ? cursor2[segment] : void 0;
98504
98504
  if (typeof existing === "object" && existing !== null) {
98505
98505
  cursor2 = existing;
@@ -98514,7 +98514,7 @@ function setNestedValue(target, path190, value) {
98514
98514
  });
98515
98515
  cursor2 = next;
98516
98516
  }
98517
- const leaf = path190[path190.length - 1];
98517
+ const leaf = path191[path191.length - 1];
98518
98518
  if (leaf !== void 0) {
98519
98519
  Object.defineProperty(cursor2, leaf, {
98520
98520
  value,
@@ -98696,9 +98696,9 @@ function isPlainObject8(value) {
98696
98696
  function hasFieldValue(value) {
98697
98697
  return value !== void 0;
98698
98698
  }
98699
- function hasNestedField(fields, path190) {
98699
+ function hasNestedField(fields, path191) {
98700
98700
  return fields.some(
98701
- (field) => path190.length < field.path.length && path190.every((segment, index) => field.path[index] === segment)
98701
+ (field) => path191.length < field.path.length && path191.every((segment, index) => field.path[index] === segment)
98702
98702
  );
98703
98703
  }
98704
98704
  function describeExpectedPresetValue(schema) {
@@ -98827,9 +98827,9 @@ async function loadPresetValues(fields, presetPath) {
98827
98827
  }
98828
98828
  const fieldByPath = new Map(fields.map((field) => [field.displayPath, field]));
98829
98829
  const presetValues = {};
98830
- function visitObject(current, path190) {
98830
+ function visitObject(current, path191) {
98831
98831
  for (const [key3, value] of Object.entries(current)) {
98832
- const nextPath = [...path190, key3];
98832
+ const nextPath = [...path191, key3];
98833
98833
  const displayPath = toDisplayPath(nextPath);
98834
98834
  const field = fieldByPath.get(displayPath);
98835
98835
  if (field !== void 0) {
@@ -99212,8 +99212,8 @@ This is a bug in toolcraft or in the command definition; it cannot be worked aro
99212
99212
  }
99213
99213
  process.exitCode = 1;
99214
99214
  }
99215
- function getNestedValue(target, path190) {
99216
- return path190.reduce(
99215
+ function getNestedValue(target, path191) {
99216
+ return path191.reduce(
99217
99217
  (current, segment) => current !== null && typeof current === "object" ? current[segment] : void 0,
99218
99218
  target
99219
99219
  );
@@ -101277,13 +101277,13 @@ function formatAvailableApprovalCommandPaths(root) {
101277
101277
  }
101278
101278
  function enumerateApprovalCommandPaths(root) {
101279
101279
  const paths = [];
101280
- const visit = (node, path190) => {
101280
+ const visit = (node, path191) => {
101281
101281
  if (node.kind === "command") {
101282
- paths.push(path190.join("."));
101282
+ paths.push(path191.join("."));
101283
101283
  return;
101284
101284
  }
101285
101285
  for (const child of getVisibleCliChildren(node)) {
101286
- visit(child, [...path190, child.name]);
101286
+ visit(child, [...path191, child.name]);
101287
101287
  }
101288
101288
  };
101289
101289
  if (root.kind === "command") {
@@ -102799,12 +102799,12 @@ function createOverlayFileSystem(base) {
102799
102799
  }
102800
102800
  return { kind: "file", content: await base.readFile(filePath, "utf8") };
102801
102801
  };
102802
- async function readFile59(filePath, encoding) {
102802
+ async function readFile60(filePath, encoding) {
102803
102803
  const content = await readOverlayText(filePath);
102804
102804
  return encoding ? content : Buffer.from(content);
102805
102805
  }
102806
102806
  const fs31 = {
102807
- readFile: readFile59,
102807
+ readFile: readFile60,
102808
102808
  async writeFile(filePath, content, options) {
102809
102809
  await assertOverlayParentDirectory(filePath);
102810
102810
  if (options?.flag === "wx" && await overlayPathExists(filePath)) {
@@ -105158,9 +105158,9 @@ var init_config8 = __esm({
105158
105158
 
105159
105159
  // src/cli/commands/utils-symlink-ops.ts
105160
105160
  import { dirname as dirname10 } from "node:path";
105161
- async function tryLstat(fs31, path190) {
105161
+ async function tryLstat(fs31, path191) {
105162
105162
  try {
105163
- return await fs31.lstat(path190);
105163
+ return await fs31.lstat(path191);
105164
105164
  } catch (error3) {
105165
105165
  if (isNotFound(error3)) {
105166
105166
  return null;
@@ -105244,13 +105244,13 @@ function formatUnknownError6(error3) {
105244
105244
  }
105245
105245
  return String(error3);
105246
105246
  }
105247
- async function isSymlinkPointingTo(fs31, path190, expectedTarget) {
105247
+ async function isSymlinkPointingTo(fs31, path191, expectedTarget) {
105248
105248
  try {
105249
- const stats2 = await fs31.lstat(path190);
105249
+ const stats2 = await fs31.lstat(path191);
105250
105250
  if (!stats2.isSymbolicLink()) {
105251
105251
  return false;
105252
105252
  }
105253
- return await fs31.readlink(path190) === expectedTarget;
105253
+ return await fs31.readlink(path191) === expectedTarget;
105254
105254
  } catch (error3) {
105255
105255
  if (isNotFound(error3)) {
105256
105256
  return false;
@@ -108716,11 +108716,11 @@ function registerPipelineCommand(program, container) {
108716
108716
  if (typeof t.status === "string") return t.status === "done";
108717
108717
  return Object.values(t.status).every((s) => s === "done");
108718
108718
  }).length;
108719
- const readFile59 = container.fs.readFile.bind(container.fs);
108719
+ const readFile60 = container.fs.readFile.bind(container.fs);
108720
108720
  const resolvedVars = await resolvePipelineVars(
108721
108721
  plan.vars ?? {},
108722
108722
  container.env.cwd,
108723
- readFile59
108723
+ readFile60
108724
108724
  );
108725
108725
  const resolvedSetup = plan.setup === null ? void 0 : plan.setup ?? steps.setup;
108726
108726
  const resolvedTeardown = plan.teardown === null ? void 0 : plan.teardown ?? steps.teardown;
@@ -108742,7 +108742,7 @@ function registerPipelineCommand(program, container) {
108742
108742
  if (opts.preview) {
108743
108743
  if (resolvedSetup) {
108744
108744
  const raw = interpolatePipelineVars(resolvedSetup.prompt, resolvedVars, "setup");
108745
- const expanded = await resolveFileIncludes(raw, container.env.cwd, readFile59);
108745
+ const expanded = await resolveFileIncludes(raw, container.env.cwd, readFile60);
108746
108746
  resources.logger.resolved("setup", expanded);
108747
108747
  }
108748
108748
  for (const task of plan.tasks) {
@@ -108755,7 +108755,7 @@ function registerPipelineCommand(program, container) {
108755
108755
  vars: resolvedVars
108756
108756
  }),
108757
108757
  container.env.cwd,
108758
- readFile59
108758
+ readFile60
108759
108759
  );
108760
108760
  resources.logger.resolved(`task: ${task.id} \u2014 ${task.title}`, expanded);
108761
108761
  } else {
@@ -108768,7 +108768,7 @@ function registerPipelineCommand(program, container) {
108768
108768
  vars: resolvedVars
108769
108769
  }),
108770
108770
  container.env.cwd,
108771
- readFile59
108771
+ readFile60
108772
108772
  );
108773
108773
  resources.logger.resolved(`task: ${task.id} / ${stepName}`, expanded);
108774
108774
  }
@@ -108776,7 +108776,7 @@ function registerPipelineCommand(program, container) {
108776
108776
  }
108777
108777
  if (resolvedTeardown) {
108778
108778
  const raw = interpolatePipelineVars(resolvedTeardown.prompt, resolvedVars, "teardown");
108779
- const expanded = await resolveFileIncludes(raw, container.env.cwd, readFile59);
108779
+ const expanded = await resolveFileIncludes(raw, container.env.cwd, readFile60);
108780
108780
  resources.logger.resolved("teardown", expanded);
108781
108781
  }
108782
108782
  }
@@ -109721,28 +109721,28 @@ function detectTraceFile(firstLine) {
109721
109721
  }
109722
109722
  return void 0;
109723
109723
  }
109724
- async function loadTraceFromFile(path190, options) {
109725
- const stat36 = await options.fs.stat(path190).catch(() => void 0);
109724
+ async function loadTraceFromFile(path191, options) {
109725
+ const stat36 = await options.fs.stat(path191).catch(() => void 0);
109726
109726
  if (stat36 === void 0) {
109727
109727
  throw new UserError(
109728
- `Trace file not found: ${path190}
109728
+ `Trace file not found: ${path191}
109729
109729
  Pass a path to an existing trace file, or run "poe-code traces" to list the traces found.`
109730
109730
  );
109731
109731
  }
109732
109732
  if (stat36.isDirectory()) {
109733
109733
  throw new UserError(
109734
- `Trace path is a directory: ${path190}
109734
+ `Trace path is a directory: ${path191}
109735
109735
  Pass a path to a trace file, or run "poe-code traces" to list the traces found.`
109736
109736
  );
109737
109737
  }
109738
- const contents = await options.fs.readFile(path190, "utf8");
109738
+ const contents = await options.fs.readFile(path191, "utf8");
109739
109739
  const firstLineEnd = contents.indexOf("\n");
109740
109740
  const firstLine = firstLineEnd === -1 ? contents : contents.slice(0, firstLineEnd);
109741
109741
  const source = detectTraceFile(firstLine);
109742
109742
  if (source === void 0) {
109743
- throw new Error(`Unable to detect trace source for file: ${path190}`);
109743
+ throw new Error(`Unable to detect trace source for file: ${path191}`);
109744
109744
  }
109745
- return loadTrace({ source, id: path190, path: path190 }, options);
109745
+ return loadTrace({ source, id: path191, path: path191 }, options);
109746
109746
  }
109747
109747
  function dateValue(date) {
109748
109748
  return date?.getTime() ?? 0;
@@ -111255,8 +111255,8 @@ var init_write_html = __esm({
111255
111255
  import { pathToFileURL as pathToFileURL2 } from "node:url";
111256
111256
  async function openTraceHtml(tree, options) {
111257
111257
  const written = await writeTraceHtml(tree, options);
111258
- const open8 = options.open ?? ((target) => openExternal(target));
111259
- await open8(pathToFileURL2(written.path).href);
111258
+ const open9 = options.open ?? ((target) => openExternal(target));
111259
+ await open9(pathToFileURL2(written.path).href);
111260
111260
  return written;
111261
111261
  }
111262
111262
  var init_open_html = __esm({
@@ -111658,9 +111658,9 @@ async function exportTraceHtml(tree, options, output) {
111658
111658
  writeLine5(output, `Wrote ${written.path}`);
111659
111659
  return;
111660
111660
  }
111661
- const open8 = options.openExternal ?? ((target) => openExternal(target));
111661
+ const open9 = options.openExternal ?? ((target) => openExternal(target));
111662
111662
  try {
111663
- await open8(pathToFileURL3(written.path).href);
111663
+ await open9(pathToFileURL3(written.path).href);
111664
111664
  writeLine5(output, `Opened ${written.path}`);
111665
111665
  } catch (error3) {
111666
111666
  writeLine5(output, `Wrote ${written.path}`);
@@ -111745,16 +111745,16 @@ function registerTracesCommand(program, container) {
111745
111745
  const options = this.opts();
111746
111746
  const flags = resolveCommandFlags(program);
111747
111747
  const json = options.json === true;
111748
- const open8 = options.open === true;
111748
+ const open9 = options.open === true;
111749
111749
  const htmlOut = options.htmlOut;
111750
- if ((open8 || htmlOut !== void 0) && pathArg === void 0) {
111750
+ if ((open9 || htmlOut !== void 0) && pathArg === void 0) {
111751
111751
  throw new ValidationError(
111752
- open8 ? "--open requires a trace path." : "--html-out requires a trace path."
111752
+ open9 ? "--open requires a trace path." : "--html-out requires a trace path."
111753
111753
  );
111754
111754
  }
111755
- if ((open8 || htmlOut !== void 0) && json) {
111755
+ if ((open9 || htmlOut !== void 0) && json) {
111756
111756
  throw new ValidationError(
111757
- open8 ? "--open cannot be used with --json." : "--html-out cannot be used with --json."
111757
+ open9 ? "--open cannot be used with --json." : "--html-out cannot be used with --json."
111758
111758
  );
111759
111759
  }
111760
111760
  const viewerOptions = {
@@ -111768,7 +111768,7 @@ function registerTracesCommand(program, container) {
111768
111768
  limit: parseLimit2(options.limit),
111769
111769
  json,
111770
111770
  fullTitles: options.fullTitles === true,
111771
- open: open8,
111771
+ open: open9,
111772
111772
  htmlOut,
111773
111773
  rebuildIndex: options.rebuildIndex === true
111774
111774
  };
@@ -111784,11 +111784,11 @@ function registerTracesCommand(program, container) {
111784
111784
  if (pathArg === void 0 && viewerOptions.rebuildIndex) {
111785
111785
  logger2.dryRun("Dry run: would rebuild the trace index.");
111786
111786
  }
111787
- if (open8 || htmlOut !== void 0) {
111787
+ if (open9 || htmlOut !== void 0) {
111788
111788
  logger2.dryRun(
111789
111789
  `Dry run: would export trace ${pathArg} as HTML${htmlOut !== void 0 ? ` to ${htmlOut}` : ""}.`
111790
111790
  );
111791
- if (open8) {
111791
+ if (open9) {
111792
111792
  logger2.dryRun("Dry run: would open the HTML in a browser.");
111793
111793
  }
111794
111794
  } else {
@@ -114351,7 +114351,7 @@ function parseSources(value) {
114351
114351
  'Invalid "sources" frontmatter. Expected each source to be a string or object.'
114352
114352
  );
114353
114353
  }
114354
- const path190 = readRequiredString(getOwnEntry35(item, "path"), "sources[].path");
114354
+ const path191 = readRequiredString(getOwnEntry35(item, "path"), "sources[].path");
114355
114355
  const startLine = readOptionalPositiveInteger(
114356
114356
  getOwnEntry35(item, "startLine"),
114357
114357
  "sources[].startLine"
@@ -114359,7 +114359,7 @@ function parseSources(value) {
114359
114359
  const endLine = readOptionalPositiveInteger(getOwnEntry35(item, "endLine"), "sources[].endLine");
114360
114360
  return parseSourceRef(
114361
114361
  serializeSourceRef({
114362
- path: path190,
114362
+ path: path191,
114363
114363
  ...startLine === void 0 ? {} : { startLine },
114364
114364
  ...endLine === void 0 ? {} : { endLine }
114365
114365
  })
@@ -130879,9 +130879,9 @@ function findPathToModule(currentModuleName, targetModuleName, dependencyGraph,
130879
130879
  }
130880
130880
  visited.add(currentModuleName);
130881
130881
  for (const dependencyModuleName of dependencyGraph.get(currentModuleName) ?? []) {
130882
- const path190 = findPathToModule(dependencyModuleName, targetModuleName, dependencyGraph, visited);
130883
- if (path190 !== void 0) {
130884
- return [currentModuleName, ...path190];
130882
+ const path191 = findPathToModule(dependencyModuleName, targetModuleName, dependencyGraph, visited);
130883
+ if (path191 !== void 0) {
130884
+ return [currentModuleName, ...path191];
130885
130885
  }
130886
130886
  }
130887
130887
  visited.delete(currentModuleName);
@@ -136264,11 +136264,11 @@ function assertSandboxDataDepth(depth) {
136264
136264
  throw new SandboxError({ budget: "dataDepth", current: depth, limit: MAX_DATA_DEPTH });
136265
136265
  }
136266
136266
  }
136267
- function assertSnapshotDataDepth(depth, path190) {
136268
- if (depth > MAX_DATA_DEPTH) throw new SnapshotBudgetError(path190, depth);
136267
+ function assertSnapshotDataDepth(depth, path191) {
136268
+ if (depth > MAX_DATA_DEPTH) throw new SnapshotBudgetError(path191, depth);
136269
136269
  }
136270
136270
  function assertSnapshotGraphDepth(value, rootPath = "$") {
136271
- walkGraphDepth(value, rootPath, (depth, path190) => assertSnapshotDataDepth(depth, path190));
136271
+ walkGraphDepth(value, rootPath, (depth, path191) => assertSnapshotDataDepth(depth, path191));
136272
136272
  }
136273
136273
  function assertSandboxGraphDepth(value) {
136274
136274
  walkGraphDepth(value, "<root>", (depth) => assertSandboxDataDepth(depth));
@@ -136335,12 +136335,12 @@ var init_graph_depth = __esm({
136335
136335
  current;
136336
136336
  limit;
136337
136337
  path;
136338
- constructor(path190, current, limit = MAX_DATA_DEPTH) {
136339
- super(`Snapshot budget exceeded for dataDepth at ${path190}: ${current} > ${limit}.`);
136338
+ constructor(path191, current, limit = MAX_DATA_DEPTH) {
136339
+ super(`Snapshot budget exceeded for dataDepth at ${path191}: ${current} > ${limit}.`);
136340
136340
  this.name = "SnapshotBudgetError";
136341
136341
  this.current = current;
136342
136342
  this.limit = limit;
136343
- this.path = path190;
136343
+ this.path = path191;
136344
136344
  replaceErrorStack(this);
136345
136345
  }
136346
136346
  };
@@ -136423,7 +136423,7 @@ function createDumpFile(snapshot2) {
136423
136423
  }
136424
136424
  return dumped;
136425
136425
  }
136426
- function serializeDumpValue(value, path190, state) {
136426
+ function serializeDumpValue(value, path191, state) {
136427
136427
  if (value === null || typeof value === "string" || typeof value === "boolean") {
136428
136428
  return value;
136429
136429
  }
@@ -136440,22 +136440,22 @@ function serializeDumpValue(value, path190, state) {
136440
136440
  return SKIP_VALUE;
136441
136441
  }
136442
136442
  if (Array.isArray(value)) {
136443
- const reference2 = serializeHeapReference(value, path190, state);
136443
+ const reference2 = serializeHeapReference(value, path191, state);
136444
136444
  if (reference2 !== void 0) {
136445
136445
  return reference2;
136446
136446
  }
136447
- return serializeArrayItems(value, path190, state);
136447
+ return serializeArrayItems(value, path191, state);
136448
136448
  }
136449
136449
  if (!isPlainObject9(value)) {
136450
136450
  return SKIP_VALUE;
136451
136451
  }
136452
- const reference = serializeHeapReference(value, path190, state);
136452
+ const reference = serializeHeapReference(value, path191, state);
136453
136453
  if (reference !== void 0) {
136454
136454
  return reference;
136455
136455
  }
136456
- return serializeObjectEntries(value, path190, state);
136456
+ return serializeObjectEntries(value, path191, state);
136457
136457
  }
136458
- function serializeHeapReference(value, path190, state) {
136458
+ function serializeHeapReference(value, path191, state) {
136459
136459
  const id = state.heapIds.get(value);
136460
136460
  if (id === void 0) {
136461
136461
  return void 0;
@@ -136464,19 +136464,19 @@ function serializeHeapReference(value, path190, state) {
136464
136464
  state.serializedHeapIds.add(id);
136465
136465
  if (isSandboxArguments(value)) {
136466
136466
  state.heap[String(id)] = serializeArguments(value, (entry, key3) => {
136467
- const serialized = serializeDumpValue(entry, `${path190}.${key3}`, state);
136467
+ const serialized = serializeDumpValue(entry, `${path191}.${key3}`, state);
136468
136468
  return serialized === SKIP_VALUE ? { kind: "undefined" } : serialized;
136469
136469
  });
136470
136470
  } else if (Array.isArray(value)) {
136471
136471
  state.heap[String(id)] = {
136472
136472
  kind: "array",
136473
- items: serializeArrayItems(value, path190, state)
136473
+ items: serializeArrayItems(value, path191, state)
136474
136474
  };
136475
136475
  } else {
136476
136476
  const errorType = sandboxErrorTypes.get(value);
136477
136477
  state.heap[String(id)] = {
136478
136478
  kind: "object",
136479
- entries: serializeObjectEntries(value, path190, state),
136479
+ entries: serializeObjectEntries(value, path191, state),
136480
136480
  ...errorType === void 0 ? {} : { errorType }
136481
136481
  };
136482
136482
  }
@@ -136486,10 +136486,10 @@ function serializeHeapReference(value, path190, state) {
136486
136486
  id
136487
136487
  };
136488
136488
  }
136489
- function serializeObjectEntries(value, path190, state) {
136489
+ function serializeObjectEntries(value, path191, state) {
136490
136490
  const serialized = {};
136491
136491
  for (const [key3, entry] of getEnumerableDataEntries(value)) {
136492
- const dumped = serializeDumpValue(entry, `${path190}.${key3}`, state);
136492
+ const dumped = serializeDumpValue(entry, `${path191}.${key3}`, state);
136493
136493
  if (dumped !== SKIP_VALUE) {
136494
136494
  serialized[key3] = dumped;
136495
136495
  }
@@ -136551,9 +136551,9 @@ function isPlainObject9(value) {
136551
136551
  const prototype = Object.getPrototypeOf(value);
136552
136552
  return prototype === Object.prototype || prototype === null;
136553
136553
  }
136554
- function serializeArrayItems(value, path190, state) {
136554
+ function serializeArrayItems(value, path191, state) {
136555
136555
  return getArrayDataItems(value).map((entry, index) => {
136556
- const serialized = serializeDumpValue(entry, `${path190}[${index}]`, state);
136556
+ const serialized = serializeDumpValue(entry, `${path191}[${index}]`, state);
136557
136557
  return serialized === SKIP_VALUE ? { kind: "undefined" } : serialized;
136558
136558
  });
136559
136559
  }
@@ -136634,44 +136634,44 @@ function validateDumpHeap(root, state) {
136634
136634
  const heap = root.heap === void 0 ? /* @__PURE__ */ Object.create(null) : requireRecord3(root.heap, "$.heap");
136635
136635
  const heapIds = /* @__PURE__ */ new Set();
136636
136636
  for (const [key3, value] of Object.entries(heap)) {
136637
- const path190 = `$.heap${formatKey(key3)}`;
136638
- const id = parseHeapId(key3, path190);
136639
- addUnique2(heapIds, id, path190);
136640
- const entry = requireRecord3(value, path190);
136641
- validateErrorType(entry, path190);
136637
+ const path191 = `$.heap${formatKey(key3)}`;
136638
+ const id = parseHeapId(key3, path191);
136639
+ addUnique2(heapIds, id, path191);
136640
+ const entry = requireRecord3(value, path191);
136641
+ validateErrorType(entry, path191);
136642
136642
  if (entry.kind === "arguments") {
136643
- validateArgumentsProperties(entry, path190);
136643
+ validateArgumentsProperties(entry, path191);
136644
136644
  continue;
136645
136645
  }
136646
136646
  if (entry.kind === "array") {
136647
- requireArray(entry.items, `${path190}.items`, state);
136647
+ requireArray(entry.items, `${path191}.items`, state);
136648
136648
  continue;
136649
136649
  }
136650
136650
  if (entry.kind === "object") {
136651
- requireRecord3(entry.entries, `${path190}.entries`);
136651
+ requireRecord3(entry.entries, `${path191}.entries`);
136652
136652
  continue;
136653
136653
  }
136654
- fail2("unknownTag", `${path190}.kind`, "unknown dump heap tag");
136654
+ fail2("unknownTag", `${path191}.kind`, "unknown dump heap tag");
136655
136655
  }
136656
136656
  validateDumpReferences(root, "$", 0, state, heapIds);
136657
136657
  }
136658
- function validateDumpReferences(value, path190, depth, state, heapIds) {
136658
+ function validateDumpReferences(value, path191, depth, state, heapIds) {
136659
136659
  if (value === null || typeof value !== "object") return;
136660
136660
  if (depth > state.limits.maxDepth)
136661
- fail2("budgetExceeded", path190, `exceeds nesting limit ${state.limits.maxDepth}`);
136661
+ fail2("budgetExceeded", path191, `exceeds nesting limit ${state.limits.maxDepth}`);
136662
136662
  if (Array.isArray(value)) {
136663
136663
  value.forEach(
136664
- (entry, index) => validateDumpReferences(entry, `${path190}[${index}]`, depth + 1, state, heapIds)
136664
+ (entry, index) => validateDumpReferences(entry, `${path191}[${index}]`, depth + 1, state, heapIds)
136665
136665
  );
136666
136666
  return;
136667
136667
  }
136668
136668
  const record2 = value;
136669
136669
  if (record2.kind === "ref") {
136670
- const id = requireSafeInteger(record2.id, `${path190}.id`, 1);
136671
- if (!heapIds.has(id)) fail2("danglingReference", `${path190}.id`, `unknown heap value ${id}`);
136670
+ const id = requireSafeInteger(record2.id, `${path191}.id`, 1);
136671
+ if (!heapIds.has(id)) fail2("danglingReference", `${path191}.id`, `unknown heap value ${id}`);
136672
136672
  }
136673
136673
  for (const [key3, entry] of Object.entries(record2)) {
136674
- validateDumpReferences(entry, `${path190}${formatKey(key3)}`, depth + 1, state, heapIds);
136674
+ validateDumpReferences(entry, `${path191}${formatKey(key3)}`, depth + 1, state, heapIds);
136675
136675
  }
136676
136676
  }
136677
136677
  function validateRunSnapshotState(root, state) {
@@ -136690,64 +136690,64 @@ function validateRunSnapshotState(root, state) {
136690
136690
  if (root.loopIterations !== void 0) {
136691
136691
  const iterations = requireRecord3(root.loopIterations, "$.loopIterations");
136692
136692
  for (const [nodeId, value] of Object.entries(iterations)) {
136693
- const path190 = `$.loopIterations${formatKey(nodeId)}`;
136694
- requireSafeInteger(Number(nodeId), `${path190}#key`, 0);
136693
+ const path191 = `$.loopIterations${formatKey(nodeId)}`;
136694
+ requireSafeInteger(Number(nodeId), `${path191}#key`, 0);
136695
136695
  if (typeof value === "number") {
136696
- requireSafeInteger(value, path190, 0);
136696
+ requireSafeInteger(value, path191, 0);
136697
136697
  continue;
136698
136698
  }
136699
- const iteration = requireRecord3(value, path190);
136700
- requireSafeInteger(iteration.index, `${path190}.index`, 0);
136701
- requireArray(iteration.values, `${path190}.values`, state);
136699
+ const iteration = requireRecord3(value, path191);
136700
+ requireSafeInteger(iteration.index, `${path191}.index`, 0);
136701
+ requireArray(iteration.values, `${path191}.values`, state);
136702
136702
  }
136703
136703
  }
136704
136704
  if (root.pendingAwaits !== void 0) {
136705
136705
  const pendingAwaits = requireArray(root.pendingAwaits, "$.pendingAwaits", state);
136706
136706
  pendingAwaits.forEach((value, index) => {
136707
- const path190 = `$.pendingAwaits[${index}]`;
136708
- const pending = requireRecord3(value, path190);
136709
- if (pending.nodeId !== void 0) requireSafeInteger(pending.nodeId, `${path190}.nodeId`, 0);
136710
- const span = requireRecord3(pending.span, `${path190}.span`);
136711
- const start = validatePosition(span.start, `${path190}.span.start`);
136712
- const end = validatePosition(span.end, `${path190}.span.end`);
136707
+ const path191 = `$.pendingAwaits[${index}]`;
136708
+ const pending = requireRecord3(value, path191);
136709
+ if (pending.nodeId !== void 0) requireSafeInteger(pending.nodeId, `${path191}.nodeId`, 0);
136710
+ const span = requireRecord3(pending.span, `${path191}.span`);
136711
+ const start = validatePosition(span.start, `${path191}.span.start`);
136712
+ const end = validatePosition(span.end, `${path191}.span.end`);
136713
136713
  if (start > end) {
136714
- fail2("invalidValue", `${path190}.span`, "start must not exceed end");
136714
+ fail2("invalidValue", `${path191}.span`, "start must not exceed end");
136715
136715
  }
136716
136716
  });
136717
136717
  }
136718
136718
  }
136719
- function validatePosition(value, path190) {
136720
- const position = requireRecord3(value, path190);
136721
- requireSafeInteger(position.line, `${path190}.line`, 1);
136722
- requireSafeInteger(position.column, `${path190}.column`, 0);
136723
- return requireSafeInteger(position.offset, `${path190}.offset`, 0);
136719
+ function validatePosition(value, path191) {
136720
+ const position = requireRecord3(value, path191);
136721
+ requireSafeInteger(position.line, `${path191}.line`, 1);
136722
+ requireSafeInteger(position.column, `${path191}.column`, 0);
136723
+ return requireSafeInteger(position.offset, `${path191}.offset`, 0);
136724
136724
  }
136725
- function validateTaggedValue(record2, path190, state) {
136725
+ function validateTaggedValue(record2, path191, state) {
136726
136726
  switch (record2.kind) {
136727
136727
  case "undefined":
136728
136728
  return;
136729
136729
  case "number":
136730
136730
  if (!["-Infinity", "Infinity", "NaN"].includes(String(record2.value))) {
136731
- fail2("invalidValue", `${path190}.value`, "unknown non-finite number value");
136731
+ fail2("invalidValue", `${path191}.value`, "unknown non-finite number value");
136732
136732
  }
136733
136733
  return;
136734
136734
  case "fn":
136735
- requireSafeInteger(record2.astNodeId, `${path190}.astNodeId`, 0);
136736
- requireSnapshotId(record2.capturedScopeId, `${path190}.capturedScopeId`);
136735
+ requireSafeInteger(record2.astNodeId, `${path191}.astNodeId`, 0);
136736
+ requireSnapshotId(record2.capturedScopeId, `${path191}.capturedScopeId`);
136737
136737
  return;
136738
136738
  case "generator":
136739
- validateGeneratorShape(record2, path190, state);
136739
+ validateGeneratorShape(record2, path191, state);
136740
136740
  return;
136741
136741
  case "promise":
136742
- requireSnapshotId(record2.id, `${path190}.id`);
136742
+ requireSnapshotId(record2.id, `${path191}.id`);
136743
136743
  return;
136744
136744
  case "ref":
136745
- requireSafeInteger(record2.id, `${path190}.id`, 1);
136745
+ requireSafeInteger(record2.id, `${path191}.id`, 1);
136746
136746
  return;
136747
136747
  case "regex":
136748
- requireString2(record2.source, `${path190}.source`, state.limits);
136749
- requireString2(record2.flags, `${path190}.flags`, state.limits);
136750
- requireSafeInteger(record2.lastIndex, `${path190}.lastIndex`, 0);
136748
+ requireString2(record2.source, `${path191}.source`, state.limits);
136749
+ requireString2(record2.flags, `${path191}.flags`, state.limits);
136750
+ requireSafeInteger(record2.lastIndex, `${path191}.lastIndex`, 0);
136751
136751
  return;
136752
136752
  case "array":
136753
136753
  case "arguments":
@@ -136757,28 +136757,28 @@ function validateTaggedValue(record2, path190, state) {
136757
136757
  return;
136758
136758
  }
136759
136759
  }
136760
- function validateGeneratorShape(record2, path190, state) {
136760
+ function validateGeneratorShape(record2, path191, state) {
136761
136761
  if (!["start", "suspended", "done"].includes(String(record2.state))) {
136762
- fail2("invalidState", `${path190}.state`, "unknown generator state");
136762
+ fail2("invalidState", `${path191}.state`, "unknown generator state");
136763
136763
  }
136764
136764
  if (record2.state === "done") {
136765
136765
  if (record2.astNodeId !== void 0 || record2.capturedScopeId !== void 0 || record2.sent !== void 0 || record2.yieldNodeId !== void 0) {
136766
- fail2("invalidState", path190, "done generator cannot contain resume state");
136766
+ fail2("invalidState", path191, "done generator cannot contain resume state");
136767
136767
  }
136768
136768
  return;
136769
136769
  }
136770
- requireSafeInteger(record2.astNodeId, `${path190}.astNodeId`, 0);
136771
- requireSnapshotId(record2.capturedScopeId, `${path190}.capturedScopeId`);
136770
+ requireSafeInteger(record2.astNodeId, `${path191}.astNodeId`, 0);
136771
+ requireSnapshotId(record2.capturedScopeId, `${path191}.capturedScopeId`);
136772
136772
  if (record2.state === "start") {
136773
136773
  if (record2.sent !== void 0 || record2.yieldNodeId !== void 0) {
136774
- fail2("invalidState", path190, "unstarted generator cannot contain a resume cursor");
136774
+ fail2("invalidState", path191, "unstarted generator cannot contain a resume cursor");
136775
136775
  }
136776
136776
  return;
136777
136777
  }
136778
- requireSafeInteger(record2.yieldNodeId, `${path190}.yieldNodeId`, 0);
136779
- const sent = requireArray(record2.sent, `${path190}.sent`, state);
136778
+ requireSafeInteger(record2.yieldNodeId, `${path191}.yieldNodeId`, 0);
136779
+ const sent = requireArray(record2.sent, `${path191}.sent`, state);
136780
136780
  sent.forEach((completion, index) => {
136781
- const completionPath = `${path190}.sent[${index}]`;
136781
+ const completionPath = `${path191}.sent[${index}]`;
136782
136782
  const candidate = requireRecord3(completion, completionPath);
136783
136783
  if (!Object.hasOwn(candidate, "type")) {
136784
136784
  fail2("invalidValue", `${completionPath}.type`, "completion type is required");
@@ -136791,41 +136791,41 @@ function validateGeneratorShape(record2, path190, state) {
136791
136791
  }
136792
136792
  });
136793
136793
  }
136794
- function validateErrorType(record2, path190) {
136794
+ function validateErrorType(record2, path191) {
136795
136795
  if (!Object.hasOwn(record2, "errorType")) return;
136796
136796
  if (record2.kind !== "object" || !sandboxErrorNames.includes(record2.errorType)) {
136797
- fail2("invalidValue", `${path190}.errorType`, "invalid error metadata");
136797
+ fail2("invalidValue", `${path191}.errorType`, "invalid error metadata");
136798
136798
  }
136799
136799
  }
136800
- function validateArgumentsProperties(record2, path190) {
136800
+ function validateArgumentsProperties(record2, path191) {
136801
136801
  if (typeof record2.extensible !== "boolean") {
136802
- fail2("invalidType", `${path190}.extensible`, "expected boolean");
136802
+ fail2("invalidType", `${path191}.extensible`, "expected boolean");
136803
136803
  }
136804
136804
  if (typeof record2.lengthBeforeCallee !== "boolean") {
136805
- fail2("invalidType", `${path190}.lengthBeforeCallee`, "expected boolean");
136805
+ fail2("invalidType", `${path191}.lengthBeforeCallee`, "expected boolean");
136806
136806
  }
136807
- const properties = requireRecord3(record2.properties, `${path190}.properties`);
136807
+ const properties = requireRecord3(record2.properties, `${path191}.properties`);
136808
136808
  if (record2.iterator !== null) {
136809
- const iterator = requireRecord3(record2.iterator, `${path190}.iterator`);
136809
+ const iterator = requireRecord3(record2.iterator, `${path191}.iterator`);
136810
136810
  for (const key3 of Object.keys(iterator)) {
136811
136811
  if (!["configurable", "enumerable", "writable"].includes(key3)) {
136812
136812
  fail2(
136813
136813
  "invalidValue",
136814
- `${path190}.iterator${formatKey(key3)}`,
136814
+ `${path191}.iterator${formatKey(key3)}`,
136815
136815
  "unknown iterator descriptor field"
136816
136816
  );
136817
136817
  }
136818
136818
  }
136819
136819
  for (const flag of ["configurable", "enumerable", "writable"]) {
136820
136820
  if (typeof iterator[flag] !== "boolean")
136821
- fail2("invalidType", `${path190}.iterator.${flag}`, "expected boolean");
136821
+ fail2("invalidType", `${path191}.iterator.${flag}`, "expected boolean");
136822
136822
  }
136823
136823
  }
136824
136824
  if (record2.lengthBeforeCallee && !Object.hasOwn(properties, "length")) {
136825
- fail2("invalidValue", `${path190}.properties`, "initial length property is required");
136825
+ fail2("invalidValue", `${path191}.properties`, "initial length property is required");
136826
136826
  }
136827
136827
  for (const [key3, value] of Object.entries(properties)) {
136828
- const propertyPath = `${path190}.properties${formatKey(key3)}`;
136828
+ const propertyPath = `${path191}.properties${formatKey(key3)}`;
136829
136829
  if (key3 === "callee")
136830
136830
  fail2("invalidValue", propertyPath, "strict callee accessor cannot be replaced");
136831
136831
  const descriptor = requireRecord3(value, propertyPath);
@@ -136846,71 +136846,71 @@ function validateArgumentsProperties(record2, path190) {
136846
136846
  }
136847
136847
  }
136848
136848
  }
136849
- function validateGenericValue(value, path190, depth, state) {
136849
+ function validateGenericValue(value, path191, depth, state) {
136850
136850
  if (state.dataPropertiesOnly && types.isProxy(value)) {
136851
- fail2("invalidType", path190, "proxy objects are not snapshot data");
136851
+ fail2("invalidType", path191, "proxy objects are not snapshot data");
136852
136852
  }
136853
136853
  if (depth > state.limits.maxDepth)
136854
- fail2("budgetExceeded", path190, `exceeds nesting limit ${state.limits.maxDepth}`);
136854
+ fail2("budgetExceeded", path191, `exceeds nesting limit ${state.limits.maxDepth}`);
136855
136855
  state.entries += 1;
136856
136856
  if (state.entries > state.limits.maxAggregateEntries)
136857
136857
  fail2(
136858
136858
  "budgetExceeded",
136859
- path190,
136859
+ path191,
136860
136860
  `exceeds aggregate entry limit ${state.limits.maxAggregateEntries}`
136861
136861
  );
136862
136862
  if (typeof value === "string") {
136863
- requireString2(value, path190, state.limits);
136863
+ requireString2(value, path191, state.limits);
136864
136864
  state.dataSize += value.length;
136865
136865
  } else if (typeof value === "number") {
136866
136866
  if (Number.isInteger(value) && !Number.isSafeInteger(value))
136867
- fail2("invalidValue", path190, "integer must be safe");
136867
+ fail2("invalidValue", path191, "integer must be safe");
136868
136868
  } else if (Array.isArray(value)) {
136869
- if (value.length > state.limits.maxEntries) fail2("budgetExceeded", path190, "array is too large");
136869
+ if (value.length > state.limits.maxEntries) fail2("budgetExceeded", path191, "array is too large");
136870
136870
  if (state.dataPropertiesOnly) {
136871
- const entries = snapshotDataEntries(value, path190).filter(([key3]) => key3 !== "length");
136871
+ const entries = snapshotDataEntries(value, path191).filter(([key3]) => key3 !== "length");
136872
136872
  if (entries.length !== value.length)
136873
- fail2("invalidType", path190, "snapshot arrays must be dense");
136873
+ fail2("invalidType", path191, "snapshot arrays must be dense");
136874
136874
  for (const [key3, entry] of entries) {
136875
136875
  const index = Number(key3);
136876
136876
  if (!Number.isInteger(index) || index < 0 || index >= value.length || String(index) !== key3) {
136877
- fail2("invalidType", path190, "snapshot arrays cannot have named properties");
136877
+ fail2("invalidType", path191, "snapshot arrays cannot have named properties");
136878
136878
  }
136879
- validateGenericValue(entry, `${path190}[${key3}]`, depth + 1, state);
136879
+ validateGenericValue(entry, `${path191}[${key3}]`, depth + 1, state);
136880
136880
  }
136881
136881
  } else {
136882
136882
  value.forEach(
136883
- (entry, index) => validateGenericValue(entry, `${path190}[${index}]`, depth + 1, state)
136883
+ (entry, index) => validateGenericValue(entry, `${path191}[${index}]`, depth + 1, state)
136884
136884
  );
136885
136885
  }
136886
136886
  } else if (value !== null && typeof value === "object") {
136887
136887
  const record2 = value;
136888
136888
  if (state.validateTaggedPayloads && isTaggedValueShape(record2)) {
136889
- validateTaggedValue(record2, path190, state);
136889
+ validateTaggedValue(record2, path191, state);
136890
136890
  }
136891
- const entries = state.dataPropertiesOnly ? snapshotDataEntries(value, path190) : Object.entries(value);
136891
+ const entries = state.dataPropertiesOnly ? snapshotDataEntries(value, path191) : Object.entries(value);
136892
136892
  for (const [key3, entry] of entries) {
136893
- requireString2(key3, `${path190}${formatKey(key3)}`, state.limits);
136893
+ requireString2(key3, `${path191}${formatKey(key3)}`, state.limits);
136894
136894
  state.dataSize += key3.length;
136895
- validateGenericValue(entry, `${path190}${formatKey(key3)}`, depth + 1, state);
136895
+ validateGenericValue(entry, `${path191}${formatKey(key3)}`, depth + 1, state);
136896
136896
  }
136897
136897
  } else if (!["boolean", "number"].includes(typeof value) && !(state.allowFunctions && typeof value === "function") && !(state.allowUndefined && value === void 0) && value !== null) {
136898
- fail2("invalidType", path190, "contains an unsupported value");
136898
+ fail2("invalidType", path191, "contains an unsupported value");
136899
136899
  }
136900
136900
  if (state.dataSize > state.limits.maxDataSize)
136901
- fail2("budgetExceeded", path190, `exceeds aggregate data limit ${state.limits.maxDataSize}`);
136901
+ fail2("budgetExceeded", path191, `exceeds aggregate data limit ${state.limits.maxDataSize}`);
136902
136902
  }
136903
- function snapshotDataEntries(value, path190) {
136903
+ function snapshotDataEntries(value, path191) {
136904
136904
  const prototype = Object.getPrototypeOf(value);
136905
136905
  if (prototype !== null && prototype !== (Array.isArray(value) ? Array.prototype : Object.prototype)) {
136906
- fail2("invalidType", path190, "snapshot data must not have a custom prototype");
136906
+ fail2("invalidType", path191, "snapshot data must not have a custom prototype");
136907
136907
  }
136908
136908
  if (Object.getOwnPropertySymbols(value).length > 0) {
136909
- fail2("invalidType", path190, "snapshot data must not have symbol properties");
136909
+ fail2("invalidType", path191, "snapshot data must not have symbol properties");
136910
136910
  }
136911
136911
  return Object.entries(Object.getOwnPropertyDescriptors(value)).map(([key3, descriptor]) => {
136912
136912
  if (!("value" in descriptor))
136913
- fail2("invalidType", `${path190}${formatKey(key3)}`, "snapshot data must not have accessors");
136913
+ fail2("invalidType", `${path191}${formatKey(key3)}`, "snapshot data must not have accessors");
136914
136914
  return [key3, descriptor.value];
136915
136915
  });
136916
136916
  }
@@ -136924,48 +136924,48 @@ function defaultLimits() {
136924
136924
  maxDataSize: DEFAULT_MAX_DATA_SIZE
136925
136925
  };
136926
136926
  }
136927
- function requireArray(value, path190, state) {
136928
- if (!Array.isArray(value)) fail2("invalidType", path190, "must be an array");
136927
+ function requireArray(value, path191, state) {
136928
+ if (!Array.isArray(value)) fail2("invalidType", path191, "must be an array");
136929
136929
  if (value.length > state.limits.maxEntries)
136930
- fail2("budgetExceeded", path190, `exceeds collection entry limit ${state.limits.maxEntries}`);
136930
+ fail2("budgetExceeded", path191, `exceeds collection entry limit ${state.limits.maxEntries}`);
136931
136931
  return value;
136932
136932
  }
136933
- function requireRecord3(value, path190) {
136933
+ function requireRecord3(value, path191) {
136934
136934
  if (typeof value !== "object" || value === null || Array.isArray(value))
136935
- fail2("invalidType", path190, "must be an object");
136935
+ fail2("invalidType", path191, "must be an object");
136936
136936
  return value;
136937
136937
  }
136938
- function requireSnapshotId(value, path190) {
136938
+ function requireSnapshotId(value, path191) {
136939
136939
  if (typeof value === "string") {
136940
- if (value.length === 0) fail2("invalidValue", path190, "id must not be empty");
136940
+ if (value.length === 0) fail2("invalidValue", path191, "id must not be empty");
136941
136941
  return value;
136942
136942
  }
136943
- return requireSafeInteger(value, path190, 0);
136943
+ return requireSafeInteger(value, path191, 0);
136944
136944
  }
136945
- function requireSafeInteger(value, path190, minimum) {
136945
+ function requireSafeInteger(value, path191, minimum) {
136946
136946
  if (typeof value !== "number" || !Number.isSafeInteger(value) || value < minimum)
136947
- fail2("invalidValue", path190, `must be a safe integer >= ${minimum}`);
136947
+ fail2("invalidValue", path191, `must be a safe integer >= ${minimum}`);
136948
136948
  return value;
136949
136949
  }
136950
- function requireNonEmptyString5(value, path190, limits) {
136951
- const text5 = requireString2(value, path190, limits);
136952
- if (text5.length === 0) fail2("invalidValue", path190, "must not be empty");
136950
+ function requireNonEmptyString5(value, path191, limits) {
136951
+ const text5 = requireString2(value, path191, limits);
136952
+ if (text5.length === 0) fail2("invalidValue", path191, "must not be empty");
136953
136953
  return text5;
136954
136954
  }
136955
- function requireString2(value, path190, limits) {
136956
- if (typeof value !== "string") fail2("invalidType", path190, "must be a string");
136955
+ function requireString2(value, path191, limits) {
136956
+ if (typeof value !== "string") fail2("invalidType", path191, "must be a string");
136957
136957
  if (value.length > limits.maxStringLength)
136958
- fail2("budgetExceeded", path190, `exceeds string limit ${limits.maxStringLength}`);
136958
+ fail2("budgetExceeded", path191, `exceeds string limit ${limits.maxStringLength}`);
136959
136959
  return value;
136960
136960
  }
136961
- function addUnique2(values, value, path190) {
136962
- if (values.has(value)) fail2("duplicateId", path190, `duplicate id ${String(value)}`);
136961
+ function addUnique2(values, value, path191) {
136962
+ if (values.has(value)) fail2("duplicateId", path191, `duplicate id ${String(value)}`);
136963
136963
  values.add(value);
136964
136964
  }
136965
- function parseHeapId(value, path190) {
136965
+ function parseHeapId(value, path191) {
136966
136966
  if (String(Number(value)) !== value)
136967
- fail2("invalidValue", path190, "heap key must be a canonical positive integer");
136968
- return requireSafeInteger(Number(value), path190, 1);
136967
+ fail2("invalidValue", path191, "heap key must be a canonical positive integer");
136968
+ return requireSafeInteger(Number(value), path191, 1);
136969
136969
  }
136970
136970
  function formatKey(key3) {
136971
136971
  return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key3) ? `.${key3}` : `[${JSON.stringify(key3)}]`;
@@ -136973,8 +136973,8 @@ function formatKey(key3) {
136973
136973
  function isTaggedValueShape(value) {
136974
136974
  return typeof value.kind === "string" && TAGGED_VALUE_KINDS.has(value.kind);
136975
136975
  }
136976
- function fail2(code, path190, detail) {
136977
- throw new SnapshotValidationError(code, path190, detail);
136976
+ function fail2(code, path191, detail) {
136977
+ throw new SnapshotValidationError(code, path191, detail);
136978
136978
  }
136979
136979
  var DEFAULT_MAX_DEPTH, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_STRING_LENGTH, DEFAULT_MAX_DATA_SIZE, TAGGED_VALUE_KINDS, SnapshotValidationError;
136980
136980
  var init_validation = __esm({
@@ -137005,11 +137005,11 @@ var init_validation = __esm({
137005
137005
  SnapshotValidationError = class extends Error {
137006
137006
  code;
137007
137007
  path;
137008
- constructor(code, path190, detail) {
137009
- super(`Invalid snapshot at ${path190}: ${detail}`);
137008
+ constructor(code, path191, detail) {
137009
+ super(`Invalid snapshot at ${path191}: ${detail}`);
137010
137010
  this.name = "SnapshotValidationError";
137011
137011
  this.code = code;
137012
- this.path = path190;
137012
+ this.path = path191;
137013
137013
  replaceErrorStack(this);
137014
137014
  }
137015
137015
  };
@@ -137374,7 +137374,7 @@ var init_promise_replay = __esm({
137374
137374
  function encodeReplayData(value, options = {}) {
137375
137375
  const nodes = [];
137376
137376
  const seen = /* @__PURE__ */ new WeakMap();
137377
- const encode = (entry, depth, path190) => {
137377
+ const encode = (entry, depth, path191) => {
137378
137378
  if (depth > MAX_DATA_DEPTH) throw new TypeError("Replay data exceeds the nesting limit.");
137379
137379
  if (entry === null || typeof entry === "boolean" || typeof entry === "string") return entry;
137380
137380
  if (entry === void 0) return { tag: "undefined" };
@@ -137387,12 +137387,12 @@ function encodeReplayData(value, options = {}) {
137387
137387
  };
137388
137388
  }
137389
137389
  if (isSandboxPromise(entry)) {
137390
- const id2 = options.identifyPromise?.(entry, path190);
137390
+ const id2 = options.identifyPromise?.(entry, path191);
137391
137391
  if (typeof id2 === "string" && id2.length > 0) return { tag: "promise-capability", id: id2 };
137392
137392
  }
137393
137393
  let capabilityId;
137394
137394
  if (isSandboxClosure(entry)) {
137395
- capabilityId = options.identifyCapability?.(entry, path190);
137395
+ capabilityId = options.identifyCapability?.(entry, path191);
137396
137396
  if (typeof capabilityId !== "string" || capabilityId.length === 0)
137397
137397
  throw new MissingReplayCapabilityError("A callable needs an explicit resume capability.");
137398
137398
  if (!options.captureCapabilityProperties) return { tag: "capability", id: capabilityId };
@@ -137407,7 +137407,7 @@ function encodeReplayData(value, options = {}) {
137407
137407
  const id = nodes.length;
137408
137408
  seen.set(entry, id);
137409
137409
  nodes.push(void 0);
137410
- const child = (value2, key3) => encode(value2, depth + 1, [...path190, key3]);
137410
+ const child = (value2, key3) => encode(value2, depth + 1, [...path191, key3]);
137411
137411
  if (isSandboxClosure(entry)) {
137412
137412
  nodes[id] = {
137413
137413
  kind: "capability",
@@ -137725,8 +137725,8 @@ function restoreReplayCalls(input, encodedOutcomes, callbackSizes, requiredHostC
137725
137725
  }
137726
137726
  const resolveCapability = (id) => {
137727
137727
  if (!capabilities.has(id) && id.startsWith("host:")) {
137728
- const path190 = JSON.parse(id.slice(5));
137729
- if (!Array.isArray(path190) || path190.length < 2 || path190.some((value) => typeof value !== "string"))
137728
+ const path191 = JSON.parse(id.slice(5));
137729
+ if (!Array.isArray(path191) || path191.length < 2 || path191.some((value) => typeof value !== "string"))
137730
137730
  throw new TypeError("Invalid host capability identity.");
137731
137731
  requiredHostCapabilities.add(id);
137732
137732
  capabilities.set(
@@ -138125,8 +138125,8 @@ var init_host_call = __esm({
138125
138125
  if (!this.capabilityIds.has(closure)) this.capabilityIds.set(closure, identity);
138126
138126
  this.nativeClosures.set(native, closure);
138127
138127
  }
138128
- registerHostCapability(path190, closure, native) {
138129
- const identity = `host:${path190}`;
138128
+ registerHostCapability(path191, closure, native) {
138129
+ const identity = `host:${path191}`;
138130
138130
  const existing = this.capabilities.get(identity);
138131
138131
  if (existing !== void 0 && existing !== closure)
138132
138132
  throw new TypeError(`Conflicting replay capability '${identity}'.`);
@@ -140082,7 +140082,7 @@ function deepCopyFromSandbox(value, options = {}) {
140082
140082
  options
140083
140083
  );
140084
140084
  }
140085
- function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections = false, depth = 0) {
140085
+ function copyToSandbox(value, state, path191 = "<root>", cloneSandboxCollections = false, depth = 0) {
140086
140086
  assertSandboxDataDepth(depth);
140087
140087
  if (isSandboxPrimitive(value)) {
140088
140088
  return value;
@@ -140098,8 +140098,8 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140098
140098
  state.seen.set(value, copy);
140099
140099
  for (const [key3, entry] of value.entries) {
140100
140100
  copy.entries.set(
140101
- copyToSandbox(key3, state, `${path190}.<key>`, true, depth + 1),
140102
- copyToSandbox(entry, state, `${path190}.<value>`, true, depth + 1)
140101
+ copyToSandbox(key3, state, `${path191}.<key>`, true, depth + 1),
140102
+ copyToSandbox(entry, state, `${path191}.<value>`, true, depth + 1)
140103
140103
  );
140104
140104
  }
140105
140105
  return copy;
@@ -140111,7 +140111,7 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140111
140111
  const copy = createSandboxSet();
140112
140112
  state.seen.set(value, copy);
140113
140113
  for (const entry of value.values) {
140114
- copy.values.add(copyToSandbox(entry, state, `${path190}.<value>`, true, depth + 1));
140114
+ copy.values.add(copyToSandbox(entry, state, `${path191}.<value>`, true, depth + 1));
140115
140115
  }
140116
140116
  return copy;
140117
140117
  }
@@ -140137,8 +140137,8 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140137
140137
  state.seen.set(value, copy);
140138
140138
  for (const [key3, entry] of value) {
140139
140139
  copy.entries.set(
140140
- copyToSandbox(key3, state, `${path190}.<key>`, cloneSandboxCollections, depth + 1),
140141
- copyToSandbox(entry, state, `${path190}.<value>`, cloneSandboxCollections, depth + 1)
140140
+ copyToSandbox(key3, state, `${path191}.<key>`, cloneSandboxCollections, depth + 1),
140141
+ copyToSandbox(entry, state, `${path191}.<value>`, cloneSandboxCollections, depth + 1)
140142
140142
  );
140143
140143
  }
140144
140144
  return copy;
@@ -140152,7 +140152,7 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140152
140152
  state.seen.set(value, copy);
140153
140153
  for (const entry of value) {
140154
140154
  copy.values.add(
140155
- copyToSandbox(entry, state, `${path190}.<value>`, cloneSandboxCollections, depth + 1)
140155
+ copyToSandbox(entry, state, `${path191}.<value>`, cloneSandboxCollections, depth + 1)
140156
140156
  );
140157
140157
  }
140158
140158
  return copy;
@@ -140164,14 +140164,14 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140164
140164
  }
140165
140165
  const copy = new Array(value.length);
140166
140166
  state.seen.set(value, copy);
140167
- for (const entry of getEnumerableArrayEntries(value, path190)) {
140167
+ for (const entry of getEnumerableArrayEntries(value, path191)) {
140168
140168
  defineOwnDataProperty(
140169
140169
  copy,
140170
140170
  entry.key,
140171
140171
  copyToSandbox(
140172
140172
  entry.value,
140173
140173
  state,
140174
- joinArrayPath(path190, entry.key),
140174
+ joinArrayPath(path191, entry.key),
140175
140175
  cloneSandboxCollections,
140176
140176
  depth + 1
140177
140177
  )
@@ -140187,7 +140187,7 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140187
140187
  copySandboxArgumentProperties(
140188
140188
  value,
140189
140189
  copy,
140190
- (entry, key3) => copyToSandbox(entry, state, joinPath(path190, key3), cloneSandboxCollections, depth + 1)
140190
+ (entry, key3) => copyToSandbox(entry, state, joinPath(path191, key3), cloneSandboxCollections, depth + 1)
140191
140191
  );
140192
140192
  return copy;
140193
140193
  }
@@ -140200,14 +140200,14 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140200
140200
  state.seen.set(value, copy);
140201
140201
  const errorType = sandboxErrorTypes.get(value);
140202
140202
  if (errorType !== void 0) sandboxErrorTypes.set(copy, errorType);
140203
- for (const entry of getEnumerableObjectEntries(value, path190)) {
140203
+ for (const entry of getEnumerableObjectEntries(value, path191)) {
140204
140204
  defineOwnDataProperty(
140205
140205
  copy,
140206
140206
  entry.key,
140207
140207
  copyToSandbox(
140208
140208
  entry.value,
140209
140209
  state,
140210
- joinPath(path190, entry.key),
140210
+ joinPath(path191, entry.key),
140211
140211
  cloneSandboxCollections,
140212
140212
  depth + 1
140213
140213
  )
@@ -140215,9 +140215,9 @@ function copyToSandbox(value, state, path190 = "<root>", cloneSandboxCollections
140215
140215
  }
140216
140216
  return copy;
140217
140217
  }
140218
- throw new TypeError(`Unsupported sandbox value at ${path190}: ${describeValue(value)}`);
140218
+ throw new TypeError(`Unsupported sandbox value at ${path191}: ${describeValue(value)}`);
140219
140219
  }
140220
- function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140220
+ function copyFromSandbox(value, state, path191 = "<root>", options, depth = 0) {
140221
140221
  assertSandboxDataDepth(depth);
140222
140222
  if (isSandboxPrimitive(value)) {
140223
140223
  return value;
@@ -140262,8 +140262,8 @@ function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140262
140262
  state.seen.set(value, copy);
140263
140263
  for (const [key3, entry] of value.entries) {
140264
140264
  copy.set(
140265
- copyFromSandbox(key3, state, `${path190}.<key>`, options, depth + 1),
140266
- copyFromSandbox(entry, state, `${path190}.<value>`, options, depth + 1)
140265
+ copyFromSandbox(key3, state, `${path191}.<key>`, options, depth + 1),
140266
+ copyFromSandbox(entry, state, `${path191}.<value>`, options, depth + 1)
140267
140267
  );
140268
140268
  }
140269
140269
  return copy;
@@ -140276,7 +140276,7 @@ function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140276
140276
  const copy = /* @__PURE__ */ new Set();
140277
140277
  state.seen.set(value, copy);
140278
140278
  for (const entry of value.values) {
140279
- copy.add(copyFromSandbox(entry, state, `${path190}.<value>`, options, depth + 1));
140279
+ copy.add(copyFromSandbox(entry, state, `${path191}.<value>`, options, depth + 1));
140280
140280
  }
140281
140281
  return copy;
140282
140282
  }
@@ -140287,11 +140287,11 @@ function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140287
140287
  }
140288
140288
  const copy = new Array(value.length);
140289
140289
  state.seen.set(value, copy);
140290
- for (const entry of getEnumerableArrayEntries(value, path190)) {
140290
+ for (const entry of getEnumerableArrayEntries(value, path191)) {
140291
140291
  defineOwnDataProperty(
140292
140292
  copy,
140293
140293
  entry.key,
140294
- copyFromSandbox(entry.value, state, joinArrayPath(path190, entry.key), options, depth + 1)
140294
+ copyFromSandbox(entry.value, state, joinArrayPath(path191, entry.key), options, depth + 1)
140295
140295
  );
140296
140296
  }
140297
140297
  return copy;
@@ -140304,7 +140304,7 @@ function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140304
140304
  copySandboxArgumentProperties(
140305
140305
  value,
140306
140306
  copy,
140307
- (entry, key3) => copyFromSandbox(entry, state, joinPath(path190, key3), options, depth + 1)
140307
+ (entry, key3) => copyFromSandbox(entry, state, joinPath(path191, key3), options, depth + 1)
140308
140308
  );
140309
140309
  return copy;
140310
140310
  }
@@ -140315,16 +140315,16 @@ function copyFromSandbox(value, state, path190 = "<root>", options, depth = 0) {
140315
140315
  }
140316
140316
  const copy = createPlainObject(Object.getPrototypeOf(value) === null);
140317
140317
  state.seen.set(value, copy);
140318
- for (const entry of getEnumerableObjectEntries(value, path190)) {
140318
+ for (const entry of getEnumerableObjectEntries(value, path191)) {
140319
140319
  defineOwnDataProperty(
140320
140320
  copy,
140321
140321
  entry.key,
140322
- copyFromSandbox(entry.value, state, joinPath(path190, entry.key), options, depth + 1)
140322
+ copyFromSandbox(entry.value, state, joinPath(path191, entry.key), options, depth + 1)
140323
140323
  );
140324
140324
  }
140325
140325
  return copy;
140326
140326
  }
140327
- throw new TypeError(`Unsupported sandbox value at ${path190}: ${describeValue(value)}`);
140327
+ throw new TypeError(`Unsupported sandbox value at ${path191}: ${describeValue(value)}`);
140328
140328
  }
140329
140329
  function isSandboxPrimitive(value) {
140330
140330
  return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
@@ -140404,7 +140404,7 @@ function defineOwnDataProperty(target, key3, value) {
140404
140404
  value
140405
140405
  });
140406
140406
  }
140407
- function getEnumerableObjectEntries(value, path190) {
140407
+ function getEnumerableObjectEntries(value, path191) {
140408
140408
  const descriptors = Object.getOwnPropertyDescriptors(value);
140409
140409
  const entries = [];
140410
140410
  for (const [key3, descriptor] of Object.entries(descriptors)) {
@@ -140412,7 +140412,7 @@ function getEnumerableObjectEntries(value, path190) {
140412
140412
  continue;
140413
140413
  }
140414
140414
  if ("get" in descriptor || "set" in descriptor) {
140415
- throw new TypeError(`Unsupported sandbox value at ${joinPath(path190, key3)}: accessor property`);
140415
+ throw new TypeError(`Unsupported sandbox value at ${joinPath(path191, key3)}: accessor property`);
140416
140416
  }
140417
140417
  entries.push({
140418
140418
  key: key3,
@@ -140421,7 +140421,7 @@ function getEnumerableObjectEntries(value, path190) {
140421
140421
  }
140422
140422
  return entries;
140423
140423
  }
140424
- function getEnumerableArrayEntries(value, path190) {
140424
+ function getEnumerableArrayEntries(value, path191) {
140425
140425
  const descriptors = Object.getOwnPropertyDescriptors(value);
140426
140426
  const entries = [];
140427
140427
  for (const [key3, descriptor] of Object.entries(descriptors)) {
@@ -140430,7 +140430,7 @@ function getEnumerableArrayEntries(value, path190) {
140430
140430
  }
140431
140431
  if ("get" in descriptor || "set" in descriptor) {
140432
140432
  throw new TypeError(
140433
- `Unsupported sandbox value at ${joinArrayPath(path190, key3)}: accessor property`
140433
+ `Unsupported sandbox value at ${joinArrayPath(path191, key3)}: accessor property`
140434
140434
  );
140435
140435
  }
140436
140436
  entries.push({
@@ -140459,11 +140459,11 @@ function describeValue(value) {
140459
140459
  }
140460
140460
  return typeof value;
140461
140461
  }
140462
- function joinPath(path190, key3) {
140463
- return path190 === "<root>" ? `<root>.${key3}` : `${path190}.${key3}`;
140462
+ function joinPath(path191, key3) {
140463
+ return path191 === "<root>" ? `<root>.${key3}` : `${path191}.${key3}`;
140464
140464
  }
140465
- function joinArrayPath(path190, key3) {
140466
- return isArrayIndexKey(key3) ? `${path190}[${key3}]` : joinPath(path190, key3);
140465
+ function joinArrayPath(path191, key3) {
140466
+ return isArrayIndexKey(key3) ? `${path191}[${key3}]` : joinPath(path191, key3);
140467
140467
  }
140468
140468
  var sandboxClosureBrand, sandboxGeneratorBrand, sandboxMapBrand, sandboxPromiseBrand, sandboxRegexBrand, sandboxRegexPattern, sandboxSetBrand, sandboxRetainedValues;
140469
140469
  var init_values = __esm({
@@ -140601,10 +140601,102 @@ var init_random = __esm({
140601
140601
  }
140602
140602
  });
140603
140603
 
140604
+ // packages/safejs/src/snapshot/migration.ts
140605
+ function validateMigrationSemantics(value) {
140606
+ if (!["jobs-v1", "jobs-v2", "jobs-v3", "jobs-v4", "jobs-v5"].includes(value))
140607
+ throw new TypeError(
140608
+ "Migration requires a supported execution-semantics marker (jobs-v1 through jobs-v5)."
140609
+ );
140610
+ }
140611
+ function validateMigrationJournal(sourceHash, replay, hostCalls = []) {
140612
+ if (replay === void 0)
140613
+ throw new TypeError("Migration requires a complete host replay journal.");
140614
+ if (!Array.isArray(hostCalls)) throw new TypeError("Invalid migration hostCalls.");
140615
+ const journal = new HostCallJournal(sourceHash, hostCalls, void 0, replay);
140616
+ try {
140617
+ const restored = journal.snapshotReplay();
140618
+ for (const call of restored.calls) {
140619
+ if (["created", "running"].includes(call.lifecycle) && call.outcome !== void 0)
140620
+ throw new TypeError("Unresolved migration calls cannot contain a recorded outcome.");
140621
+ for (const callback of call.callbacks ?? []) {
140622
+ if (!call.functions?.includes(callback.id))
140623
+ throw new TypeError("Migration callback has no registered source function.");
140624
+ }
140625
+ }
140626
+ return restored;
140627
+ } finally {
140628
+ journal.dispose();
140629
+ }
140630
+ }
140631
+ function validateMigrationReconciliation(value, checkpointDigest, calls) {
140632
+ validateSnapshotData(value);
140633
+ const receipt = value;
140634
+ if (receipt === null || typeof receipt !== "object" || receipt.checkpointDigest !== checkpointDigest || !isCheckpointDigest(receipt.checkpointDigest))
140635
+ throw new TypeError("Migration reconciliation must identify this exact checkpoint digest.");
140636
+ if (receipt.quiescent !== true)
140637
+ throw new TypeError(
140638
+ "Migration requires explicit host confirmation that execution, operations, and callbacks are quiescent."
140639
+ );
140640
+ if (!Array.isArray(receipt.calls))
140641
+ throw new TypeError("Migration reconciliation calls must be an array.");
140642
+ const pending = new Map(
140643
+ calls.filter((call) => !["settled", "consumed"].includes(call.lifecycle)).map((call) => [call.id, call])
140644
+ );
140645
+ for (const resolution of receipt.calls) {
140646
+ if (resolution === null || typeof resolution !== "object" || !pending.has(resolution.callId))
140647
+ throw new TypeError("Migration contains an unknown or duplicate call resolution.");
140648
+ if (!["not-performed", "fulfilled", "rejected"].includes(resolution.disposition) || resolution.disposition === "fulfilled" && !Object.hasOwn(resolution, "value") || resolution.disposition === "rejected" && !Object.hasOwn(resolution, "reason"))
140649
+ throw new TypeError(
140650
+ "Migration call resolution requires a reconciled outcome or confirmed non-performance."
140651
+ );
140652
+ pending.delete(resolution.callId);
140653
+ }
140654
+ if (pending.size > 0)
140655
+ throw new TypeError(
140656
+ `Migration requires external reconciliation for: ${[...pending.keys()].join(", ")}`
140657
+ );
140658
+ }
140659
+ function validateSnapshotMigration(value, sourceHash) {
140660
+ if (value === void 0) return void 0;
140661
+ validateSnapshotData(value);
140662
+ const migration = value;
140663
+ if (migration === null || typeof migration !== "object" || migration.version !== 1 || !Array.isArray(migration.history) || migration.history.length === 0)
140664
+ throw new TypeError("Invalid snapshot migration history.");
140665
+ decodeReplayData(migration.state);
140666
+ let previousTarget;
140667
+ for (const entry of migration.history) {
140668
+ if (entry === null || typeof entry !== "object" || typeof entry.sourceHash !== "string" || entry.sourceHash.length === 0 || typeof entry.targetSourceHash !== "string" || entry.targetSourceHash.length === 0 || previousTarget !== void 0 && previousTarget !== entry.sourceHash)
140669
+ throw new TypeError("Invalid snapshot migration ancestry.");
140670
+ validateMigrationSemantics(entry.executionSemantics);
140671
+ const replay = validateMigrationJournal(entry.sourceHash, entry.replay);
140672
+ validateMigrationReconciliation(
140673
+ entry.reconciliation,
140674
+ entry.reconciliation?.checkpointDigest,
140675
+ replay.calls
140676
+ );
140677
+ previousTarget = entry.targetSourceHash;
140678
+ }
140679
+ if (previousTarget !== sourceHash)
140680
+ throw new TypeError("Migration ancestry does not match the target source.");
140681
+ return migration;
140682
+ }
140683
+ function isCheckpointDigest(value) {
140684
+ return typeof value === "string" && value.length === 64 && [...value].every((character2) => "0123456789abcdef".includes(character2));
140685
+ }
140686
+ var init_migration = __esm({
140687
+ "packages/safejs/src/snapshot/migration.ts"() {
140688
+ "use strict";
140689
+ init_host_call();
140690
+ init_replay_data();
140691
+ init_validation();
140692
+ }
140693
+ });
140694
+
140604
140695
  // packages/safejs/src/restore.ts
140605
140696
  function restore2(snapshot2, options) {
140606
140697
  assertSnapshotInactive(snapshot2);
140607
140698
  validateDumpEnvelope(snapshot2);
140699
+ validateSnapshotMigration(snapshot2.migration, snapshot2.sourceHash);
140608
140700
  if (snapshot2.executionSemantics !== EXECUTION_SEMANTICS && (snapshot2.executionSemantics !== void 0 || snapshot2.promiseReplay !== void 0 || snapshot2.replay !== void 0 || snapshot2.initialInputs !== void 0)) {
140609
140701
  throw new SnapshotValidationError(
140610
140702
  "unsupportedVersion",
@@ -140627,6 +140719,7 @@ var init_restore = __esm({
140627
140719
  init_validation();
140628
140720
  init_dump_format();
140629
140721
  init_running_state();
140722
+ init_migration();
140630
140723
  SnapshotMismatchError = class extends Error {
140631
140724
  actualHash;
140632
140725
  expectedHash;
@@ -141791,7 +141884,7 @@ function wrapHostPromiseWithSignal(promise, signal) {
141791
141884
  );
141792
141885
  });
141793
141886
  }
141794
- function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141887
+ function copyHostValueToSandbox(value, stackFrames, options, state, path191) {
141795
141888
  const { budget } = options;
141796
141889
  if (value === null || value === void 0 || typeof value === "number" || typeof value === "boolean") {
141797
141890
  return value;
@@ -141817,11 +141910,11 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141817
141910
  return existing;
141818
141911
  }
141819
141912
  return wrapCallerInjectedFunction(
141820
- callable.name.length > 0 ? callable.name : readPathName(path190),
141913
+ callable.name.length > 0 ? callable.name : readPathName(path191),
141821
141914
  callable,
141822
141915
  {
141823
141916
  ...options,
141824
- operation: path190.startsWith("<root>") ? `${options.operation ?? "<root>"}${path190.slice(6)}` : path190
141917
+ operation: path191.startsWith("<root>") ? `${options.operation ?? "<root>"}${path191.slice(6)}` : path191
141825
141918
  },
141826
141919
  state
141827
141920
  );
@@ -141873,14 +141966,14 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141873
141966
  const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
141874
141967
  if (descriptor === void 0) continue;
141875
141968
  if (!("value" in descriptor)) {
141876
- throw new TypeError(`Unsupported sandbox value at ${path190}[${index}]: accessor property`);
141969
+ throw new TypeError(`Unsupported sandbox value at ${path191}[${index}]: accessor property`);
141877
141970
  }
141878
141971
  copy[index] = copyHostValueToSandbox(
141879
141972
  descriptor.value,
141880
141973
  stackFrames,
141881
141974
  { ...options, capabilityPath: [...options.capabilityPath ?? [], String(index)] },
141882
141975
  state,
141883
- `${path190}[${index}]`
141976
+ `${path191}[${index}]`
141884
141977
  );
141885
141978
  }
141886
141979
  return copy;
@@ -141901,14 +141994,14 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141901
141994
  stackFrames,
141902
141995
  { ...options, capabilityPath: [...options.capabilityPath ?? [], `key:${ordinal}`] },
141903
141996
  state,
141904
- `${path190}.<key>`
141997
+ `${path191}.<key>`
141905
141998
  ),
141906
141999
  copyHostValueToSandbox(
141907
142000
  entry,
141908
142001
  stackFrames,
141909
142002
  { ...options, capabilityPath: [...options.capabilityPath ?? [], `value:${ordinal}`] },
141910
142003
  state,
141911
- `${path190}.<value>`
142004
+ `${path191}.<value>`
141912
142005
  )
141913
142006
  );
141914
142007
  }
@@ -141932,7 +142025,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141932
142025
  capabilityPath: [...options.capabilityPath ?? [], String(copy.values.size)]
141933
142026
  },
141934
142027
  state,
141935
- `${path190}.<value>`
142028
+ `${path191}.<value>`
141936
142029
  )
141937
142030
  );
141938
142031
  }
@@ -141951,7 +142044,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141951
142044
  }
141952
142045
  if ("get" in descriptor || "set" in descriptor) {
141953
142046
  throw new TypeError(
141954
- `Unsupported sandbox value at ${joinPath2(path190, key3)}: accessor property`
142047
+ `Unsupported sandbox value at ${joinPath2(path191, key3)}: accessor property`
141955
142048
  );
141956
142049
  }
141957
142050
  Object.defineProperty(copy, budget.allocateString(key3), {
@@ -141963,13 +142056,13 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path190) {
141963
142056
  stackFrames,
141964
142057
  { ...options, capabilityPath: [...options.capabilityPath ?? [], key3] },
141965
142058
  state,
141966
- joinPath2(path190, key3)
142059
+ joinPath2(path191, key3)
141967
142060
  )
141968
142061
  });
141969
142062
  }
141970
142063
  return copy;
141971
142064
  }
141972
- throw new TypeError(`Unsupported sandbox value at ${path190}: ${describeValue2(value)}`);
142065
+ throw new TypeError(`Unsupported sandbox value at ${path191}: ${describeValue2(value)}`);
141973
142066
  }
141974
142067
  function readAbortReason2(signal) {
141975
142068
  return signal.reason ?? createAbortError11();
@@ -142018,7 +142111,7 @@ function readStringProperty(value, key3) {
142018
142111
  const entry = value[key3];
142019
142112
  return typeof entry === "string" ? entry : void 0;
142020
142113
  }
142021
- function copyFunctionProperties(callable, stackFrames, options, state, path190) {
142114
+ function copyFunctionProperties(callable, stackFrames, options, state, path191) {
142022
142115
  const properties = {};
142023
142116
  for (const key3 of Object.getOwnPropertyNames(callable)) {
142024
142117
  const descriptor = Object.getOwnPropertyDescriptor(callable, key3);
@@ -142036,7 +142129,7 @@ function copyFunctionProperties(callable, stackFrames, options, state, path190)
142036
142129
  stackFrames,
142037
142130
  { ...options, capabilityPath: [...options.capabilityPath ?? [], key3] },
142038
142131
  state,
142039
- joinPath2(path190, key3)
142132
+ joinPath2(path191, key3)
142040
142133
  );
142041
142134
  }
142042
142135
  return Object.keys(properties).length > 0 ? properties : void 0;
@@ -142048,11 +142141,11 @@ function isPlainObject11(value) {
142048
142141
  const prototype = Object.getPrototypeOf(value);
142049
142142
  return prototype === Object.prototype || prototype === null;
142050
142143
  }
142051
- function joinPath2(path190, key3) {
142052
- return /^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(key3) ? `${path190}.${key3}` : `${path190}[${JSON.stringify(key3)}]`;
142144
+ function joinPath2(path191, key3) {
142145
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(key3) ? `${path191}.${key3}` : `${path191}[${JSON.stringify(key3)}]`;
142053
142146
  }
142054
- function readPathName(path190) {
142055
- const segment = path190.replace(/^.*\./u, "");
142147
+ function readPathName(path191) {
142148
+ const segment = path191.replace(/^.*\./u, "");
142056
142149
  return segment === "<root>" ? "host" : segment;
142057
142150
  }
142058
142151
  function describeValue2(value) {
@@ -147568,16 +147661,16 @@ async function writeSnapshotOnce(temporaryPath, snapshotPath, contents) {
147568
147661
  }
147569
147662
  }
147570
147663
  }
147571
- async function enqueueOperation(path190, operation) {
147572
- const previous = pendingOperations.get(path190) ?? Promise.resolve();
147664
+ async function enqueueOperation(path191, operation) {
147665
+ const previous = pendingOperations.get(path191) ?? Promise.resolve();
147573
147666
  const pending = previous.catch(() => void 0).then(operation);
147574
147667
  const queued = pending.catch(() => void 0);
147575
- pendingOperations.set(path190, queued);
147668
+ pendingOperations.set(path191, queued);
147576
147669
  try {
147577
147670
  await pending;
147578
147671
  } finally {
147579
- if (pendingOperations.get(path190) === queued) {
147580
- pendingOperations.delete(path190);
147672
+ if (pendingOperations.get(path191) === queued) {
147673
+ pendingOperations.delete(path191);
147581
147674
  }
147582
147675
  }
147583
147676
  }
@@ -147614,8 +147707,8 @@ var init_backend = __esm({
147614
147707
  LOCKED_FILE_ERROR_CODES = /* @__PURE__ */ new Set(["EACCES", "EBUSY", "EPERM"]);
147615
147708
  pendingOperations = /* @__PURE__ */ new Map();
147616
147709
  FileSnapshotBackend = class {
147617
- constructor(path190, options = {}) {
147618
- this.path = path190;
147710
+ constructor(path191, options = {}) {
147711
+ this.path = path191;
147619
147712
  this.#writeMaxAttempts = options.writeMaxAttempts ?? DEFAULT_WRITE_MAX_ATTEMPTS;
147620
147713
  this.#writeRetryDelayMs = options.writeRetryDelayMs ?? DEFAULT_WRITE_RETRY_DELAY_MS;
147621
147714
  }
@@ -147763,12 +147856,12 @@ var init_serialize = __esm({
147763
147856
  init_values();
147764
147857
  UnsnapshotableValueError = class extends Error {
147765
147858
  path;
147766
- constructor(path190) {
147859
+ constructor(path191) {
147767
147860
  super(
147768
147861
  "Cannot snapshot a generator suspended mid-iteration; drain or discard it before the await boundary."
147769
147862
  );
147770
147863
  this.name = "UnsnapshotableValueError";
147771
- this.path = path190;
147864
+ this.path = path191;
147772
147865
  }
147773
147866
  };
147774
147867
  }
@@ -147782,15 +147875,15 @@ function prepareReplayInputs(current, saved, preparePromise, onCapabilityRestore
147782
147875
  if (saved === void 0) {
147783
147876
  const snapshot2 = encodeReplayData(current, {
147784
147877
  captureCapabilityProperties: true,
147785
- identifyCapability: (closure, path190) => {
147786
- const id = identities.get(closure) ?? JSON.stringify(path190);
147878
+ identifyCapability: (closure, path191) => {
147879
+ const id = identities.get(closure) ?? JSON.stringify(path191);
147787
147880
  identities.set(closure, id);
147788
147881
  capabilities.set(id, closure);
147789
147882
  return id;
147790
147883
  },
147791
- identifyPromise: (promise, path190) => {
147884
+ identifyPromise: (promise, path191) => {
147792
147885
  if (preparePromise === void 0) return void 0;
147793
- const id = identities.get(promise) ?? JSON.stringify(path190);
147886
+ const id = identities.get(promise) ?? JSON.stringify(path191);
147794
147887
  identities.set(promise, id);
147795
147888
  if (!promises.has(id)) promises.set(id, preparePromise(promise, id));
147796
147889
  return id;
@@ -147805,11 +147898,11 @@ function prepareReplayInputs(current, saved, preparePromise, onCapabilityRestore
147805
147898
  };
147806
147899
  }
147807
147900
  const readCapability = (id) => {
147808
- const path190 = JSON.parse(id);
147809
- if (!Array.isArray(path190) || path190.length === 0 || path190.some((key3) => typeof key3 !== "string"))
147901
+ const path191 = JSON.parse(id);
147902
+ if (!Array.isArray(path191) || path191.length === 0 || path191.some((key3) => typeof key3 !== "string"))
147810
147903
  throw new TypeError("Invalid replay input capability path.");
147811
147904
  let value = current;
147812
- for (const key3 of path190) {
147905
+ for (const key3 of path191) {
147813
147906
  if (isSandboxMap(value)) {
147814
147907
  const [kind, ordinal] = key3.split(":");
147815
147908
  const index = Number(ordinal);
@@ -147960,6 +148053,17 @@ function run(source, options = {}) {
147960
148053
  }),
147961
148054
  ...createRegexGlobals()
147962
148055
  };
148056
+ const importMeta = deepCopyToSandbox(options.importMeta ?? {});
148057
+ if (restoredSnapshot?.migration !== void 0) {
148058
+ if (Object.hasOwn(importMeta, "migration"))
148059
+ throw new TypeError("import.meta.migration is reserved for migrated checkpoint state.");
148060
+ Object.defineProperty(importMeta, "migration", {
148061
+ value: decodeReplayData(restoredSnapshot.migration.state),
148062
+ enumerable: true,
148063
+ configurable: true,
148064
+ writable: true
148065
+ });
148066
+ }
147963
148067
  const initialInputs = prepareReplayInputs(
147964
148068
  {
147965
148069
  bindings: callerBindings,
@@ -147970,7 +148074,7 @@ function run(source, options = {}) {
147970
148074
  allowMissing: restoredSnapshot?.initialInputs !== void 0
147971
148075
  }),
147972
148076
  entryPointArgs: options.entryPointArgs === void 0 ? void 0 : deepCopyToSandbox([...options.entryPointArgs]),
147973
- importMeta: deepCopyToSandbox(options.importMeta ?? {})
148077
+ importMeta
147974
148078
  },
147975
148079
  restoredSnapshot?.initialInputs,
147976
148080
  (promise, id) => {
@@ -148035,6 +148139,7 @@ function run(source, options = {}) {
148035
148139
  });
148036
148140
  snapshotScheduler = activeSnapshotScheduler;
148037
148141
  createFailureSnapshot = () => createRunSnapshot({
148142
+ migration: restoredSnapshot?.migration,
148038
148143
  bindings: executionScope.snapshot().bindings,
148039
148144
  clock: options.clock,
148040
148145
  hostCalls: hostCalls.snapshot(),
@@ -148060,6 +148165,7 @@ function run(source, options = {}) {
148060
148165
  }
148061
148166
  const interpreterSnapshot2 = yieldPoint.snapshot();
148062
148167
  snapshot3 = createRunSnapshot({
148168
+ migration: restoredSnapshot?.migration,
148063
148169
  bindings: interpreterSnapshot2.bindings,
148064
148170
  clock: options.clock,
148065
148171
  hostCalls: hostCalls.snapshot(),
@@ -148101,6 +148207,7 @@ function run(source, options = {}) {
148101
148207
  }
148102
148208
  const interpreterSnapshot2 = yieldPoint.snapshot();
148103
148209
  snapshot3 = createRunSnapshot({
148210
+ migration: restoredSnapshot?.migration,
148104
148211
  bindings: interpreterSnapshot2.bindings,
148105
148212
  clock: options.clock,
148106
148213
  hostCalls: hostCalls.snapshot(),
@@ -148134,6 +148241,7 @@ function run(source, options = {}) {
148134
148241
  replayError = error3.message;
148135
148242
  }
148136
148243
  const snapshot2 = createRunSnapshot({
148244
+ migration: restoredSnapshot?.migration,
148137
148245
  bindings: executionScope.snapshot().bindings,
148138
148246
  clock: options.clock,
148139
148247
  hostCalls: hostCalls.snapshot(),
@@ -148303,6 +148411,7 @@ function createRunSnapshot(input) {
148303
148411
  version: DUMP_FORMAT_VERSION,
148304
148412
  executionSemantics: EXECUTION_SEMANTICS,
148305
148413
  sourceHash: input.sourceHash,
148414
+ ...input.migration === void 0 ? {} : { migration: structuredClone(input.migration) },
148306
148415
  bindings: input.bindings,
148307
148416
  clock: input.clock?.snapshot(),
148308
148417
  ...input.hostCalls === void 0 || input.hostCalls.length === 0 ? {} : { hostCalls: input.hostCalls },
@@ -148423,6 +148532,173 @@ var init_dump2 = __esm({
148423
148532
  }
148424
148533
  });
148425
148534
 
148535
+ // packages/safejs/src/migrate.ts
148536
+ import { createHash as createHash14 } from "node:crypto";
148537
+ function inspectSnapshotMigration(snapshot2, options) {
148538
+ assertSnapshotInactive(snapshot2);
148539
+ validateSnapshotData(snapshot2);
148540
+ validateDumpEnvelope(snapshot2);
148541
+ validateMigrationSemantics(snapshot2.executionSemantics);
148542
+ const sourceHash = hashSource(options.source);
148543
+ if (snapshot2.sourceHash !== sourceHash)
148544
+ throw new TypeError(
148545
+ `Migration requires the original executable source (checkpoint hash ${snapshot2.sourceHash}, supplied ${sourceHash}). Preserve the checkpoint; do not replace its hash.`
148546
+ );
148547
+ validateSnapshotMigration(snapshot2.migration, sourceHash);
148548
+ const replay = validateMigrationJournal(sourceHash, snapshot2.replay, snapshot2.hostCalls);
148549
+ return {
148550
+ checkpointDigest: createHash14("sha256").update(canonicalData(snapshot2)).digest("hex"),
148551
+ sourceHash,
148552
+ executionSemantics: snapshot2.executionSemantics,
148553
+ calls: replay.calls,
148554
+ unresolvedCalls: replay.calls.filter(
148555
+ (call) => !["settled", "consumed"].includes(call.lifecycle)
148556
+ )
148557
+ };
148558
+ }
148559
+ function migrateSnapshot(snapshot2, options) {
148560
+ if (!Object.hasOwn(options, "state"))
148561
+ throw new TypeError("Migration requires explicit application state.");
148562
+ const inspection = inspectSnapshotMigration(snapshot2, { source: options.source });
148563
+ parseModule(options.targetSource);
148564
+ const targetSourceHash = hashSource(options.targetSource);
148565
+ validateMigrationReconciliation(
148566
+ options.reconciliation,
148567
+ inspection.checkpointDigest,
148568
+ inspection.calls
148569
+ );
148570
+ const state = encodeReplayData(deepCopyToSandbox(options.state));
148571
+ const previous = snapshot2.migration;
148572
+ const migration = {
148573
+ version: 1,
148574
+ state,
148575
+ history: [
148576
+ ...structuredClone(previous?.history ?? []),
148577
+ {
148578
+ sourceHash: inspection.sourceHash,
148579
+ targetSourceHash,
148580
+ executionSemantics: inspection.executionSemantics,
148581
+ replay: { version: 1, calls: inspection.calls },
148582
+ reconciliation: structuredClone(options.reconciliation)
148583
+ }
148584
+ ]
148585
+ };
148586
+ validateSnapshotMigration(migration, targetSourceHash);
148587
+ return {
148588
+ version: DUMP_FORMAT_VERSION,
148589
+ executionSemantics: EXECUTION_SEMANTICS,
148590
+ sourceHash: targetSourceHash,
148591
+ bindings: {},
148592
+ replay: { version: 1, calls: [] },
148593
+ migration
148594
+ };
148595
+ }
148596
+ function canonicalData(value) {
148597
+ if (Array.isArray(value)) return `[${value.map(canonicalData).join(",")}]`;
148598
+ if (value !== null && typeof value === "object")
148599
+ return `{${Object.keys(value).sort().map(
148600
+ (key3) => `${JSON.stringify(key3)}:${canonicalData(value[key3])}`
148601
+ ).join(",")}}`;
148602
+ return JSON.stringify(value);
148603
+ }
148604
+ var init_migrate = __esm({
148605
+ "packages/safejs/src/migrate.ts"() {
148606
+ "use strict";
148607
+ init_running_state();
148608
+ init_values();
148609
+ init_hash();
148610
+ init_parser3();
148611
+ init_dump_format();
148612
+ init_migration();
148613
+ init_replay_data();
148614
+ init_validation();
148615
+ }
148616
+ });
148617
+
148618
+ // packages/safejs/src/migration-file.ts
148619
+ import { randomUUID as randomUUID51 } from "node:crypto";
148620
+ import { link as link3, open as open8, readFile as readFile53, unlink as unlink25 } from "node:fs/promises";
148621
+ import path184 from "node:path";
148622
+ async function migrateSnapshotFile(options) {
148623
+ const cwd = options.cwd ?? process.cwd();
148624
+ const resolvePath3 = (value, label) => {
148625
+ if (typeof value !== "string" || value.trim().length === 0)
148626
+ throw new TypeError(`Migration requires ${label}.`);
148627
+ return path184.resolve(cwd, value);
148628
+ };
148629
+ const snapshotPath = resolvePath3(options.snapshotPath, "a snapshot path");
148630
+ const sourcePath = resolvePath3(options.sourcePath, "--from <original.ajs>");
148631
+ if (options.inspect && [options.targetSourcePath, options.planPath, options.outputPath].some(
148632
+ (value) => value !== void 0
148633
+ ))
148634
+ throw new TypeError("Migration --inspect cannot be combined with --to, --plan, or --output.");
148635
+ const outputPath = options.inspect ? void 0 : resolvePath3(options.outputPath, "--output <new-checkpoint.json>");
148636
+ const targetSourcePath = options.inspect ? void 0 : resolvePath3(options.targetSourcePath, "--to <continuation.ajs>");
148637
+ const planPath = options.inspect ? void 0 : resolvePath3(options.planPath, "--plan <migration.json>");
148638
+ for (const filepath of [sourcePath, targetSourcePath]) {
148639
+ if (filepath !== void 0 && ![".ajs", ".safejs"].includes(path184.extname(filepath)))
148640
+ throw new TypeError(
148641
+ "Migration source paths must name executable .ajs or .safejs files, not harness Markdown."
148642
+ );
148643
+ }
148644
+ const snapshot2 = JSON.parse(await readFile53(snapshotPath, "utf8"));
148645
+ const source = await readFile53(sourcePath, "utf8");
148646
+ const inspection = inspectSnapshotMigration(snapshot2, { source });
148647
+ if (options.inspect) return { inspection };
148648
+ const plan = JSON.parse(await readFile53(planPath, "utf8"));
148649
+ if (plan === null || typeof plan !== "object" || !Object.hasOwn(plan, "state") || !Object.hasOwn(plan, "reconciliation"))
148650
+ throw new TypeError("Migration plan requires explicit state and reconciliation fields.");
148651
+ const targetSource = await readFile53(targetSourcePath, "utf8");
148652
+ const migrated = migrateSnapshot(snapshot2, {
148653
+ source,
148654
+ targetSource,
148655
+ state: plan.state,
148656
+ reconciliation: plan.reconciliation
148657
+ });
148658
+ const contents = serializeSafeJSSnapshot(migrated);
148659
+ if (!options.dryRun) {
148660
+ const temporaryPath = path184.join(
148661
+ path184.dirname(outputPath),
148662
+ `.safejs-migration-${randomUUID51()}.tmp`
148663
+ );
148664
+ let created = false;
148665
+ try {
148666
+ const handle = await open8(temporaryPath, "wx", 384);
148667
+ created = true;
148668
+ try {
148669
+ await handle.writeFile(contents, "utf8");
148670
+ await handle.sync();
148671
+ } finally {
148672
+ await handle.close();
148673
+ }
148674
+ try {
148675
+ await link3(temporaryPath, outputPath);
148676
+ } catch (error3) {
148677
+ if (hasOwnErrorCode29(error3, "EEXIST"))
148678
+ throw Object.assign(
148679
+ new Error(
148680
+ `Migration output already exists: ${JSON.stringify(outputPath)}. Choose a new output path; existing files are never overwritten.`,
148681
+ { cause: error3 }
148682
+ ),
148683
+ { code: "EEXIST" }
148684
+ );
148685
+ throw error3;
148686
+ }
148687
+ } finally {
148688
+ if (created) await unlink25(temporaryPath);
148689
+ }
148690
+ }
148691
+ return { inspection, outputPath, dryRun: options.dryRun === true };
148692
+ }
148693
+ var init_migration_file = __esm({
148694
+ "packages/safejs/src/migration-file.ts"() {
148695
+ "use strict";
148696
+ init_error_codes22();
148697
+ init_migrate();
148698
+ init_dump_format();
148699
+ }
148700
+ });
148701
+
148426
148702
  // packages/safejs/src/error/format.ts
148427
148703
  var init_format3 = __esm({
148428
148704
  "packages/safejs/src/error/format.ts"() {
@@ -148512,7 +148788,7 @@ var init_runtime_modules = __esm({
148512
148788
  });
148513
148789
 
148514
148790
  // packages/safejs/src/runner/run-harness.ts
148515
- import { readFile as readFile53, stat as stat34 } from "node:fs/promises";
148791
+ import { readFile as readFile54, stat as stat34 } from "node:fs/promises";
148516
148792
  import { extname } from "node:path";
148517
148793
  var init_run_harness = __esm({
148518
148794
  "packages/safejs/src/runner/run-harness.ts"() {
@@ -149606,9 +149882,9 @@ var init_fail = __esm({
149606
149882
 
149607
149883
  // packages/safejs/src/modules/canonical-path.ts
149608
149884
  import { basename as basename8, dirname as dirname13, isAbsolute as isAbsolute9, relative as relative7, resolve as resolve13, sep as sep6 } from "node:path";
149609
- async function resolveCanonicalPath({ realpath: realpath20, readlink: readlink5 }, path190) {
149885
+ async function resolveCanonicalPath({ realpath: realpath20, readlink: readlink5 }, path191) {
149610
149886
  const missingSegments = [];
149611
- let current = path190;
149887
+ let current = path191;
149612
149888
  let follows = 0;
149613
149889
  while (true) {
149614
149890
  try {
@@ -149621,23 +149897,23 @@ async function resolveCanonicalPath({ realpath: realpath20, readlink: readlink5
149621
149897
  const target = await readSymlinkTarget2(readlink5, current);
149622
149898
  if (target !== void 0) {
149623
149899
  if (++follows > MAX_SYMLINK_FOLLOWS) {
149624
- throw createLoopError(path190);
149900
+ throw createLoopError(path191);
149625
149901
  }
149626
149902
  current = isAbsolute9(target) ? resolve13(target) : resolve13(dirname13(current), target);
149627
149903
  continue;
149628
149904
  }
149629
149905
  const parent = dirname13(current);
149630
149906
  if (parent === current) {
149631
- return resolve13(path190);
149907
+ return resolve13(path191);
149632
149908
  }
149633
149909
  missingSegments.push(basename8(current));
149634
149910
  current = parent;
149635
149911
  }
149636
149912
  }
149637
149913
  }
149638
- async function readSymlinkTarget2(readlink5, path190) {
149914
+ async function readSymlinkTarget2(readlink5, path191) {
149639
149915
  try {
149640
- return await readlink5(path190);
149916
+ return await readlink5(path191);
149641
149917
  } catch (error3) {
149642
149918
  if (NOT_A_SYMLINK_CODES.includes(getOwnErrorCode2(error3) ?? "")) {
149643
149919
  return void 0;
@@ -149645,9 +149921,9 @@ async function readSymlinkTarget2(readlink5, path190) {
149645
149921
  throw error3;
149646
149922
  }
149647
149923
  }
149648
- function createLoopError(path190) {
149924
+ function createLoopError(path191) {
149649
149925
  const error3 = new Error(
149650
- `ELOOP: too many symbolic links encountered, realpath '${path190}'`
149926
+ `ELOOP: too many symbolic links encountered, realpath '${path191}'`
149651
149927
  );
149652
149928
  error3.code = "ELOOP";
149653
149929
  return error3;
@@ -149690,9 +149966,9 @@ async function descendsFromRoot(stat36, canonicalRoot, canonicalPath) {
149690
149966
  current = parent;
149691
149967
  }
149692
149968
  }
149693
- async function readIdentity(stat36, path190) {
149969
+ async function readIdentity(stat36, path191) {
149694
149970
  try {
149695
- const { dev, ino } = await stat36(path190);
149971
+ const { dev, ino } = await stat36(path191);
149696
149972
  return { dev, ino };
149697
149973
  } catch (error3) {
149698
149974
  if (MISSING_PATH_CODES.includes(getOwnErrorCode2(error3) ?? "")) {
@@ -149840,32 +150116,32 @@ async function resolvePathArguments(fs31, root, name, args) {
149840
150116
  return resolved;
149841
150117
  }
149842
150118
  const paths = FS_PATH_ARGUMENTS[name].map((_, index) => {
149843
- const path190 = readPath(canonicalRoot, args[index]);
149844
- resolved[index] = path190;
149845
- return path190;
150119
+ const path191 = readPath(canonicalRoot, args[index]);
150120
+ resolved[index] = path191;
150121
+ return path191;
149846
150122
  });
149847
150123
  await assertInsideRoot2(fs31, canonicalRoot, name, paths);
149848
150124
  return resolved;
149849
150125
  }
149850
150126
  async function assertInsideRoot2(fs31, canonicalRoot, name, paths) {
149851
- for (const path190 of paths) {
149852
- if (await escapesRoot(fs31, canonicalRoot, path190)) {
150127
+ for (const path191 of paths) {
150128
+ if (await escapesRoot(fs31, canonicalRoot, path191)) {
149853
150129
  throw createAccessDeniedError(name, paths[0], paths[1]);
149854
150130
  }
149855
150131
  }
149856
150132
  }
149857
- async function escapesRoot(fs31, canonicalRoot, path190) {
149858
- const canonicalPath = await resolveCanonicalPath(readCanonicalPathFs(fs31), path190);
150133
+ async function escapesRoot(fs31, canonicalRoot, path191) {
150134
+ const canonicalPath = await resolveCanonicalPath(readCanonicalPathFs(fs31), path191);
149859
150135
  return !await containsPath(readStat(fs31), canonicalRoot, canonicalPath);
149860
150136
  }
149861
150137
  function readCanonicalPathFs(fs31) {
149862
150138
  return {
149863
- realpath: async (path190) => await invoke(fs31, "realpath", [path190]),
149864
- readlink: async (path190) => await invoke(fs31, "readlink", [path190])
150139
+ realpath: async (path191) => await invoke(fs31, "realpath", [path191]),
150140
+ readlink: async (path191) => await invoke(fs31, "readlink", [path191])
149865
150141
  };
149866
150142
  }
149867
150143
  function readStat(fs31) {
149868
- return async (path190) => await invoke(fs31, "stat", [path190]);
150144
+ return async (path191) => await invoke(fs31, "stat", [path191]);
149869
150145
  }
149870
150146
  function assertSupportedPath(name, argument, value) {
149871
150147
  if (typeof value === "string") {
@@ -149916,19 +150192,19 @@ function describeReceivedValue(value) {
149916
150192
  return `type ${typeof value} (${inspect(value)})`;
149917
150193
  }
149918
150194
  function readPath(base, value) {
149919
- const path190 = value;
149920
- return isAbsolute10(path190) ? resolve14(path190) : resolve14(base, path190);
150195
+ const path191 = value;
150196
+ return isAbsolute10(path191) ? resolve14(path191) : resolve14(base, path191);
149921
150197
  }
149922
- function createAccessDeniedError(name, path190, dest) {
150198
+ function createAccessDeniedError(name, path191, dest) {
149923
150199
  const syscall = FS_SYSCALLS[name];
149924
- const target = dest === void 0 ? `'${path190}'` : `'${path190}' -> '${dest}'`;
150200
+ const target = dest === void 0 ? `'${path191}'` : `'${path191}' -> '${dest}'`;
149925
150201
  const error3 = new Error(
149926
150202
  `${ACCESS_DENIED_CODE}: ${ACCESS_DENIED_MESSAGE}, ${syscall} ${target}`
149927
150203
  );
149928
150204
  error3.code = ACCESS_DENIED_CODE;
149929
150205
  error3.errno = ACCESS_DENIED_ERRNO;
149930
150206
  error3.syscall = syscall;
149931
- error3.path = path190;
150207
+ error3.path = path191;
149932
150208
  if (dest !== void 0) {
149933
150209
  error3.dest = dest;
149934
150210
  }
@@ -150286,9 +150562,9 @@ function makeGitModule(cwd) {
150286
150562
  branch: normalizedBranch
150287
150563
  };
150288
150564
  },
150289
- async worktreeRemove(path190) {
150565
+ async worktreeRemove(path191) {
150290
150566
  const repoRoot = await getRepoRoot(normalizedCwd);
150291
- const worktreePath = await resolveWorktreePath(repoRoot, path190, "Git worktree path");
150567
+ const worktreePath = await resolveWorktreePath(repoRoot, path191, "Git worktree path");
150292
150568
  const worktrees = await listWorktrees2(normalizedCwd);
150293
150569
  if (!worktrees.some((worktree) => resolve15(worktree.path) === worktreePath)) {
150294
150570
  return;
@@ -150335,10 +150611,10 @@ function normalizeWorktreeCreateOptions(options) {
150335
150611
  throw new Error("Git worktree create options must be an object.");
150336
150612
  }
150337
150613
  const base = getOwnProperty8(options, "base");
150338
- const path190 = getOwnProperty8(options, "path");
150614
+ const path191 = getOwnProperty8(options, "path");
150339
150615
  return {
150340
150616
  base: base === void 0 ? "HEAD" : readNonEmptyString6(base, "Git worktree create options base"),
150341
- path: path190 === void 0 ? void 0 : readNonEmptyString6(path190, "Git worktree create options path")
150617
+ path: path191 === void 0 ? void 0 : readNonEmptyString6(path191, "Git worktree create options path")
150342
150618
  };
150343
150619
  }
150344
150620
  function createSavepointRef() {
@@ -150398,9 +150674,9 @@ function parseBranchRef(ref) {
150398
150674
  const branchPrefix = "refs/heads/";
150399
150675
  return ref.startsWith(branchPrefix) ? ref.slice(branchPrefix.length) : ref;
150400
150676
  }
150401
- async function resolveWorktreePath(repoRoot, path190, label) {
150677
+ async function resolveWorktreePath(repoRoot, path191, label) {
150402
150678
  const resolvedRoot = resolve15(repoRoot);
150403
- const resolvedPath = isAbsolute11(path190) ? resolve15(path190) : resolve15(resolvedRoot, path190);
150679
+ const resolvedPath = isAbsolute11(path191) ? resolve15(path191) : resolve15(resolvedRoot, path191);
150404
150680
  const canonicalRoot = await realpath19(resolvedRoot);
150405
150681
  const canonicalPath = await resolveCanonicalPath({ realpath: realpath19, readlink: readlink4 }, resolvedPath);
150406
150682
  const [inside, isRootItself] = await Promise.all([
@@ -150768,7 +151044,7 @@ var init_metric = __esm({
150768
151044
 
150769
151045
  // packages/safejs/src/modules/mcp-transport.ts
150770
151046
  import { spawn as spawn11 } from "node:child_process";
150771
- import path184 from "node:path";
151047
+ import path185 from "node:path";
150772
151048
  function parseMcpConfig3(source, directory) {
150773
151049
  const parsed = JSON.parse(source);
150774
151050
  const options = normalizeMcpOptions(parsed, [
@@ -150779,9 +151055,9 @@ function parseMcpConfig3(source, directory) {
150779
151055
  ]);
150780
151056
  for (const server of Object.values(options.servers)) {
150781
151057
  if ("command" in server) {
150782
- server.cwd = path184.resolve(directory, server.cwd ?? ".");
151058
+ server.cwd = path185.resolve(directory, server.cwd ?? ".");
150783
151059
  if (server.command.includes("/") || server.command.includes("\\")) {
150784
- server.command = path184.resolve(directory, server.command);
151060
+ server.command = path185.resolve(directory, server.command);
150785
151061
  }
150786
151062
  }
150787
151063
  }
@@ -151506,6 +151782,8 @@ var init_src49 = __esm({
151506
151782
  init_policy();
151507
151783
  init_dump2();
151508
151784
  init_restore();
151785
+ init_migrate();
151786
+ init_migration_file();
151509
151787
  init_validation();
151510
151788
  init_budget2();
151511
151789
  init_format3();
@@ -151647,9 +151925,9 @@ var init_extract_schema = __esm({
151647
151925
  });
151648
151926
 
151649
151927
  // packages/agent-harness/src/codegen/emit-schemas.ts
151650
- import { randomUUID as randomUUID51 } from "node:crypto";
151928
+ import { randomUUID as randomUUID52 } from "node:crypto";
151651
151929
  import * as nodeFs21 from "node:fs/promises";
151652
- import path185 from "node:path";
151930
+ import path186 from "node:path";
151653
151931
  import { fileURLToPath as fileURLToPath14 } from "node:url";
151654
151932
  var init_emit_schemas = __esm({
151655
151933
  "packages/agent-harness/src/codegen/emit-schemas.ts"() {
@@ -151707,23 +151985,23 @@ var init_pair = __esm({
151707
151985
  MissingPairError = class extends UserError {
151708
151986
  side;
151709
151987
  path;
151710
- constructor(side, path190) {
151988
+ constructor(side, path191) {
151711
151989
  super(
151712
- `Missing harness ${side} file: ${path190}
151990
+ `Missing harness ${side} file: ${path191}
151713
151991
  Run \`poe-code harness list\` to see available harnesses, or \`poe-code harness new <name>\` to scaffold this pair.`
151714
151992
  );
151715
151993
  this.side = side;
151716
- this.path = path190;
151994
+ this.path = path191;
151717
151995
  }
151718
151996
  };
151719
151997
  InvalidPairExtensionError = class extends Error {
151720
151998
  extension;
151721
151999
  path;
151722
- constructor(path190, extension) {
151723
- super(`Harness pair input must be a .md or .ajs file: ${path190}`);
152000
+ constructor(path191, extension) {
152001
+ super(`Harness pair input must be a .md or .ajs file: ${path191}`);
151724
152002
  this.name = "InvalidPairExtensionError";
151725
152003
  this.extension = extension;
151726
- this.path = path190;
152004
+ this.path = path191;
151727
152005
  }
151728
152006
  };
151729
152007
  }
@@ -151790,8 +152068,8 @@ function validateFrontmatter(schema, frontmatter, mdPath) {
151790
152068
  function formatIssues3(mdPath, issues) {
151791
152069
  return issues.map((issue2) => `${mdPath} (${formatPath4(issue2.path)}): ${issue2.message}`).join("\n");
151792
152070
  }
151793
- function formatPath4(path190) {
151794
- return path190.join(".") || "frontmatter";
152071
+ function formatPath4(path191) {
152072
+ return path191.join(".") || "frontmatter";
151795
152073
  }
151796
152074
  var FrontmatterValidationError;
151797
152075
  var init_validate4 = __esm({
@@ -151810,8 +152088,8 @@ var init_validate4 = __esm({
151810
152088
  });
151811
152089
 
151812
152090
  // packages/agent-harness/src/loader/run.ts
151813
- import { createHash as createHash14, randomUUID as randomUUID52 } from "node:crypto";
151814
- import { lstat as lstat34, mkdir as mkdir39, readFile as readFile55, rename as rename28, unlink as unlink25, writeFile as writeFile29 } from "node:fs/promises";
152091
+ import { createHash as createHash15, randomUUID as randomUUID53 } from "node:crypto";
152092
+ import { lstat as lstat34, mkdir as mkdir39, readFile as readFile56, rename as rename28, unlink as unlink26, writeFile as writeFile29 } from "node:fs/promises";
151815
152093
  import os25 from "node:os";
151816
152094
  import { dirname as dirname17, join as join17, parse as parse16, resolve as resolve16, sep as sep7 } from "node:path";
151817
152095
  async function runHarnessPair2(mdPath, options) {
@@ -151932,7 +152210,9 @@ async function runHarnessPair2(mdPath, options) {
151932
152210
  throw error3;
151933
152211
  }
151934
152212
  await hostCallReplay.flush();
151935
- if (result.ok && options.preserveSnapshotOnSuccess !== true) {
152213
+ if (result.ok && result.snapshot.migration !== void 0) {
152214
+ await snapshotBackend.write(result.snapshot);
152215
+ } else if (result.ok && options.preserveSnapshotOnSuccess !== true) {
151936
152216
  await cleanupCompletedSnapshot(snapshotBackend, snapshotPath);
151937
152217
  }
151938
152218
  const usage = usageAccumulator.snapshot();
@@ -152141,7 +152421,7 @@ async function createHostCallReplay(snapshotPath, statefulBindings = {}, opts =
152141
152421
  }
152142
152422
  async function readHostCallRecords(storePath) {
152143
152423
  try {
152144
- const parsed = JSON.parse(await readFile55(storePath, "utf8"));
152424
+ const parsed = JSON.parse(await readFile56(storePath, "utf8"));
152145
152425
  return Array.isArray(parsed) ? parsed : [];
152146
152426
  } catch (error3) {
152147
152427
  if (hasErrorCode6(error3, "ENOENT")) {
@@ -152161,7 +152441,7 @@ async function writeHostCallRecords(storePath, records) {
152161
152441
  await writeTextFileAtomically2(storePath, serialized);
152162
152442
  }
152163
152443
  async function writeTextFileAtomically2(filePath, content) {
152164
- const temporaryPath = `${filePath}.${process.pid}.${randomUUID52()}.tmp`;
152444
+ const temporaryPath = `${filePath}.${process.pid}.${randomUUID53()}.tmp`;
152165
152445
  let temporaryCreated = false;
152166
152446
  try {
152167
152447
  await writeFile29(temporaryPath, content, { encoding: "utf8", flag: "wx" });
@@ -152177,9 +152457,9 @@ async function writeTextFileAtomically2(filePath, content) {
152177
152457
  async function cleanupCompletedSnapshot(snapshotBackend, snapshotPath) {
152178
152458
  await Promise.all([snapshotBackend.remove(), unlinkIfExists(hostCallStorePath(snapshotPath))]);
152179
152459
  }
152180
- async function unlinkIfExists(path190) {
152460
+ async function unlinkIfExists(path191) {
152181
152461
  try {
152182
- await unlink25(path190);
152462
+ await unlink26(path191);
152183
152463
  } catch (error3) {
152184
152464
  if (!hasErrorCode6(error3, "ENOENT")) {
152185
152465
  throw error3;
@@ -152215,7 +152495,7 @@ function listModuleExports(moduleExports) {
152215
152495
  return exportNames.filter((exportName) => exportName.length > 0).sort((left, right) => left.localeCompare(right));
152216
152496
  }
152217
152497
  function resolveSnapshotPath(mdPath, snapshotPath) {
152218
- const documentKey = createHash14("sha256").update(resolve16(mdPath)).digest("hex").slice(0, 12);
152498
+ const documentKey = createHash15("sha256").update(resolve16(mdPath)).digest("hex").slice(0, 12);
152219
152499
  return snapshotPath ?? join17(
152220
152500
  resolveRunLogDir({
152221
152501
  planPath: mdPath,
@@ -152243,8 +152523,8 @@ async function assertDefaultSnapshotPathIsRegular(snapshotPath) {
152243
152523
  }
152244
152524
  }
152245
152525
  }
152246
- async function readTextFile(path190) {
152247
- const source = await readFile55(path190, "utf8");
152526
+ async function readTextFile(path191) {
152527
+ const source = await readFile56(path191, "utf8");
152248
152528
  return source.startsWith("\uFEFF") ? source.slice(1) : source;
152249
152529
  }
152250
152530
  function formatLintErrorMessage(diagnostics) {
@@ -152302,7 +152582,7 @@ var init_run8 = __esm({
152302
152582
  });
152303
152583
 
152304
152584
  // packages/agent-harness/src/testing/replay-equivalence.ts
152305
- import { mkdir as mkdir40, readFile as readFile56, rm as rm17, writeFile as writeFile30 } from "node:fs/promises";
152585
+ import { mkdir as mkdir40, readFile as readFile57, rm as rm17, writeFile as writeFile30 } from "node:fs/promises";
152306
152586
  import os26 from "node:os";
152307
152587
  import { join as join18 } from "node:path";
152308
152588
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
@@ -152399,8 +152679,8 @@ var init_harness_spawn_retry = __esm({
152399
152679
  });
152400
152680
 
152401
152681
  // src/cli/commands/harness.ts
152402
- import path186 from "node:path";
152403
- import { readFile as readFile57 } from "node:fs/promises";
152682
+ import path187 from "node:path";
152683
+ import { readFile as readFile58 } from "node:fs/promises";
152404
152684
  import { Argument } from "commander";
152405
152685
  function registerHarnessCommand(program, container) {
152406
152686
  const harness = program.command("harness").description("Run and manage agent harness pairs.");
@@ -152426,6 +152706,26 @@ function registerHarnessCommand(program, container) {
152426
152706
  await executeHarnessRun(program, container, mdPath, options);
152427
152707
  }
152428
152708
  });
152709
+ harness.command("migrate").description("Inspect or explicitly migrate a checkpoint to continuation source.").argument("<snapshot-path>", "Original checkpoint JSON; never overwritten").requiredOption("--from <path>", "Original executable .ajs source").option("--inspect", "Inspect identities and unresolved calls without writing").option("--to <path>", "New continuation .ajs source").option("--plan <path>", "JSON application state and digest-bound reconciliation").option("--output <path>", "New checkpoint path; must not already exist").action(
152710
+ async (snapshotPath, options) => {
152711
+ const flags = resolveHarnessFlags(program, void 0);
152712
+ const result = await withSpinner({
152713
+ message: options.inspect ? "Inspecting checkpoint" : "Validating checkpoint migration",
152714
+ fn: () => migrateSnapshotFile({
152715
+ snapshotPath,
152716
+ sourcePath: options.from,
152717
+ targetSourcePath: options.to,
152718
+ planPath: options.plan,
152719
+ outputPath: options.output,
152720
+ inspect: options.inspect,
152721
+ dryRun: flags.dryRun,
152722
+ cwd: container.env.cwd
152723
+ })
152724
+ });
152725
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
152726
+ `);
152727
+ }
152728
+ );
152429
152729
  harness.command("new").description("Scaffold a harness pair from a built-in template.").addArgument(new Argument("<kind>", "Built-in template kind").choices(builtinKinds())).argument("<basename>", "New harness basename").option("--dir <path>", "Output directory for the harness pair").option("-y, --yes", "Accept defaults without prompting.").action(async (kind, basename10, options) => {
152430
152730
  await executeHarnessNew(program, container, kind, basename10, options);
152431
152731
  });
@@ -152441,20 +152741,20 @@ async function executeHarnessRun(program, container, mdPath, options) {
152441
152741
  if (options.envConfig !== void 0) {
152442
152742
  if (options.envConfig.trim().length === 0)
152443
152743
  throw new ValidationError("--env-config needs a JSON file path.");
152444
- const configPath = path186.resolve(container.env.cwd, options.envConfig);
152744
+ const configPath = path187.resolve(container.env.cwd, options.envConfig);
152445
152745
  envOptions = parseEnvConfig(await container.fs.readFile(configPath, "utf8"));
152446
152746
  }
152447
152747
  let mcpOptions;
152448
152748
  if (options.mcpConfig !== void 0) {
152449
152749
  if (options.mcpConfig.trim().length === 0)
152450
152750
  throw new ValidationError("--mcp-config needs a JSON file path.");
152451
- const configPath = path186.resolve(container.env.cwd, options.mcpConfig);
152751
+ const configPath = path187.resolve(container.env.cwd, options.mcpConfig);
152452
152752
  mcpOptions = parseMcpConfig3(
152453
152753
  await container.fs.readFile(configPath, "utf8"),
152454
- path186.dirname(configPath)
152754
+ path187.dirname(configPath)
152455
152755
  );
152456
152756
  }
152457
- const selectedPath = mdPath ? path186.resolve(container.env.cwd, mdPath) : (await resolveDiscoveredHarness(container, options.dir, flags.assumeYes)).mdPath;
152757
+ const selectedPath = mdPath ? path187.resolve(container.env.cwd, mdPath) : (await resolveDiscoveredHarness(container, options.dir, flags.assumeYes)).mdPath;
152458
152758
  if (flags.dryRun) {
152459
152759
  await resolvePair(selectedPath, container.fs);
152460
152760
  resources.logger.dryRun(
@@ -152462,7 +152762,7 @@ async function executeHarnessRun(program, container, mdPath, options) {
152462
152762
  );
152463
152763
  if (fsOptions !== void 0) {
152464
152764
  resources.logger.dryRun(
152465
- `Dry run: would enable the fs module rooted at ${formatDisplayPath3(container, resolveFsRoot(fsOptions, path186.dirname(selectedPath)))}.`
152765
+ `Dry run: would enable the fs module rooted at ${formatDisplayPath3(container, resolveFsRoot(fsOptions, path187.dirname(selectedPath)))}.`
152466
152766
  );
152467
152767
  }
152468
152768
  return;
@@ -152578,9 +152878,9 @@ async function resolveHarnessWorktreeAgent(container, selectedPath, options) {
152578
152878
  );
152579
152879
  }
152580
152880
  function mapSourcePathIntoWorktree3(sourceCwd, sourcePath, worktreeCwd) {
152581
- const relativePath = path186.relative(sourceCwd, sourcePath);
152582
- if (relativePath === "" || !relativePath.startsWith("..") && !path186.isAbsolute(relativePath)) {
152583
- return path186.join(worktreeCwd, relativePath);
152881
+ const relativePath = path187.relative(sourceCwd, sourcePath);
152882
+ if (relativePath === "" || !relativePath.startsWith("..") && !path187.isAbsolute(relativePath)) {
152883
+ return path187.join(worktreeCwd, relativePath);
152584
152884
  }
152585
152885
  return sourcePath;
152586
152886
  }
@@ -152731,10 +153031,10 @@ function buildAgentFrontmatterOverrides(options) {
152731
153031
  }
152732
153032
  function resolveRunSnapshotPath(container, mdPath, snapshotPath) {
152733
153033
  if (snapshotPath !== void 0) {
152734
- return path186.resolve(container.env.cwd, snapshotPath);
153034
+ return path187.resolve(container.env.cwd, snapshotPath);
152735
153035
  }
152736
- const basename10 = path186.basename(mdPath, path186.extname(mdPath));
152737
- return path186.join(container.env.cwd, ".poe-code", "harnesses", basename10, "snapshot.json");
153036
+ const basename10 = path187.basename(mdPath, path187.extname(mdPath));
153037
+ return path187.join(container.env.cwd, ".poe-code", "harnesses", basename10, "snapshot.json");
152738
153038
  }
152739
153039
  async function prepareHarnessSnapshot(container, mdPath, snapshotPath, resumeRequested) {
152740
153040
  const snapshotExists = await pathExists17(container, snapshotPath);
@@ -152803,8 +153103,8 @@ function formatRunMessage(baseMessage, progress) {
152803
153103
  return progress === void 0 ? baseMessage : `${baseMessage} (${progress})`;
152804
153104
  }
152805
153105
  function resolveAjsPath(mdPath) {
152806
- const parsed = path186.parse(mdPath);
152807
- return path186.join(parsed.dir, `${parsed.name}.ajs`);
153106
+ const parsed = path187.parse(mdPath);
153107
+ return path187.join(parsed.dir, `${parsed.name}.ajs`);
152808
153108
  }
152809
153109
  async function pathExists17(container, targetPath) {
152810
153110
  try {
@@ -152830,16 +153130,16 @@ async function executeHarnessNew(program, container, kind, basename10, options)
152830
153130
  `Unknown harness template "${kind}". Available kinds: ${builtinKinds().join(", ")}.`
152831
153131
  );
152832
153132
  }
152833
- if (basename10.length === 0 || basename10 === "." || basename10 === ".." || path186.basename(basename10) !== basename10) {
153133
+ if (basename10.length === 0 || basename10 === "." || basename10 === ".." || path187.basename(basename10) !== basename10) {
152834
153134
  throw new ValidationError(
152835
153135
  `Invalid harness basename "${basename10}". Use a single directory name.`
152836
153136
  );
152837
153137
  }
152838
- const defaultDir = path186.join(".poe-code", "harnesses", basename10);
153138
+ const defaultDir = path187.join(".poe-code", "harnesses", basename10);
152839
153139
  const outputDir = options.dir ?? await resolveOutputDir(defaultDir, flags.assumeYes);
152840
- const resolvedDir = path186.resolve(container.env.cwd, outputDir);
152841
- const mdPath = path186.join(resolvedDir, `${basename10}.md`);
152842
- const ajsPath = path186.join(resolvedDir, `${basename10}.ajs`);
153140
+ const resolvedDir = path187.resolve(container.env.cwd, outputDir);
153141
+ const mdPath = path187.join(resolvedDir, `${basename10}.md`);
153142
+ const ajsPath = path187.join(resolvedDir, `${basename10}.ajs`);
152843
153143
  await assertFilesDoNotExist(container, [mdPath, ajsPath]);
152844
153144
  if (flags.dryRun) {
152845
153145
  resources.logger.dryRun(`Would create ${formatDisplayPath3(container, mdPath)}`);
@@ -152847,8 +153147,8 @@ async function executeHarnessNew(program, container, kind, basename10, options)
152847
153147
  return;
152848
153148
  }
152849
153149
  const [mdSource, ajsSource] = await Promise.all([
152850
- readFile57(template2.mdPath, "utf8"),
152851
- readFile57(template2.ajsPath, "utf8")
153150
+ readFile58(template2.mdPath, "utf8"),
153151
+ readFile58(template2.ajsPath, "utf8")
152852
153152
  ]);
152853
153153
  await container.fs.mkdir(resolvedDir, { recursive: true });
152854
153154
  const createdPaths = [];
@@ -152957,10 +153257,10 @@ async function resolveDiscoveredHarness(container, dir, assumeYes) {
152957
153257
  }
152958
153258
  function harnessDiscoveryRoots(container, dir) {
152959
153259
  const roots = [
152960
- path186.join(container.env.cwd, ".poe-code", "harnesses"),
152961
- path186.join(container.env.homeDir, ".poe-code", "harnesses")
153260
+ path187.join(container.env.cwd, ".poe-code", "harnesses"),
153261
+ path187.join(container.env.homeDir, ".poe-code", "harnesses")
152962
153262
  ];
152963
- return dir === void 0 ? roots : [path186.resolve(container.env.cwd, dir), ...roots];
153263
+ return dir === void 0 ? roots : [path187.resolve(container.env.cwd, dir), ...roots];
152964
153264
  }
152965
153265
  function formatSearchedRoots(container, dir) {
152966
153266
  return harnessDiscoveryRoots(container, dir).map((root) => formatDisplayPath3(container, root)).join(", ");
@@ -152982,7 +153282,7 @@ async function discoverPairsDirectlyIn(container, root) {
152982
153282
  for (const entry of entries.filter((name) => name.endsWith(".md")).sort()) {
152983
153283
  try {
152984
153284
  pairs.push(
152985
- await resolvePair(path186.join(root, entry), container.fs)
153285
+ await resolvePair(path187.join(root, entry), container.fs)
152986
153286
  );
152987
153287
  } catch (error3) {
152988
153288
  if (error3 instanceof MissingPairError) {
@@ -153004,7 +153304,7 @@ async function discoverProjectThenUserHarnesses(container, dir) {
153004
153304
  const stat36 = await container.fs.stat(pair.mdPath);
153005
153305
  discovered.push({
153006
153306
  ...pair,
153007
- dir: path186.dirname(pair.mdPath),
153307
+ dir: path187.dirname(pair.mdPath),
153008
153308
  mdMtimeMs: stat36.mtimeMs
153009
153309
  });
153010
153310
  }
@@ -153060,7 +153360,7 @@ function resolveHarnessFsOptions(container, options) {
153060
153360
  "--fs-root needs a directory path. Pass --fs-root <path> to confine the harness to that directory, or drop --fs-root to confine it to the harness directory."
153061
153361
  );
153062
153362
  }
153063
- return { root: path186.resolve(container.env.cwd, options.fsRoot) };
153363
+ return { root: path187.resolve(container.env.cwd, options.fsRoot) };
153064
153364
  }
153065
153365
  function resolveFsRoot(fsOptions, harnessDir) {
153066
153366
  return fsOptions.root ?? harnessDir;
@@ -153220,8 +153520,8 @@ function toModuleExports(moduleExports) {
153220
153520
  return new Map(Object.entries(moduleExports));
153221
153521
  }
153222
153522
  function formatDisplayPath3(container, filePath) {
153223
- const relative8 = path186.relative(container.env.cwd, filePath);
153224
- return relative8.length > 0 && !relative8.startsWith("..") && !path186.isAbsolute(relative8) ? relative8 : filePath.replace(container.env.homeDir, "~");
153523
+ const relative8 = path187.relative(container.env.cwd, filePath);
153524
+ return relative8.length > 0 && !relative8.startsWith("..") && !path187.isAbsolute(relative8) ? relative8 : filePath.replace(container.env.homeDir, "~");
153225
153525
  }
153226
153526
  var init_harness3 = __esm({
153227
153527
  async "src/cli/commands/harness.ts"() {
@@ -153528,7 +153828,7 @@ import { Argument as Argument2 } from "commander";
153528
153828
  function isVisible(command) {
153529
153829
  return Reflect.get(command, "_hidden") !== true;
153530
153830
  }
153531
- function collectNodes(command, path190 = []) {
153831
+ function collectNodes(command, path191 = []) {
153532
153832
  const children2 = command.commands.filter(isVisible).map((child) => ({
153533
153833
  name: child.name(),
153534
153834
  aliases: [...child.aliases()],
@@ -153559,10 +153859,10 @@ function collectNodes(command, path190 = []) {
153559
153859
  return [];
153560
153860
  }
153561
153861
  return [
153562
- { path: path190, children: children2, options, requiredValueFlags, isPositionalLeaf, positionalChildren },
153862
+ { path: path191, children: children2, options, requiredValueFlags, isPositionalLeaf, positionalChildren },
153563
153863
  ...command.commands.filter(isVisible).flatMap(
153564
153864
  (child) => [child.name(), ...child.aliases()].flatMap(
153565
- (name) => collectNodes(child, [...path190, name])
153865
+ (name) => collectNodes(child, [...path191, name])
153566
153866
  )
153567
153867
  )
153568
153868
  ];
@@ -153694,8 +153994,8 @@ function renderZsh(nodes) {
153694
153994
  function quoteFish(value) {
153695
153995
  return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
153696
153996
  }
153697
- function fishCondition(path190) {
153698
- return path190.length === 0 ? '"__fish_use_subcommand"' : `"__fish_seen_subcommand_from ${path190.at(-1)}"`;
153997
+ function fishCondition(path191) {
153998
+ return path191.length === 0 ? '"__fish_use_subcommand"' : `"__fish_seen_subcommand_from ${path191.at(-1)}"`;
153699
153999
  }
153700
154000
  function renderFish(nodes) {
153701
154001
  const lines = nodes.flatMap((node) => {
@@ -153752,7 +154052,7 @@ var init_completion = __esm({
153752
154052
 
153753
154053
  // src/cli/commands/tasks-options.ts
153754
154054
  import * as fsPromises27 from "node:fs/promises";
153755
- import path187 from "node:path";
154055
+ import path188 from "node:path";
153756
154056
  async function resolveWorkflowTaskListOptions(workflowPath) {
153757
154057
  const frontmatter = await readWorkflowFrontmatter(workflowPath);
153758
154058
  return readTaskListOptions(frontmatter, workflowPath);
@@ -153990,7 +154290,7 @@ function resolveStringValue2(value) {
153990
154290
  return process.env[value.slice(envPrefix.length)] ?? value;
153991
154291
  }
153992
154292
  function resolveWorkflowRelativePath(value, workflowPath) {
153993
- return path187.isAbsolute(value) ? value : path187.resolve(path187.dirname(workflowPath), value);
154293
+ return path188.isAbsolute(value) ? value : path188.resolve(path188.dirname(workflowPath), value);
153994
154294
  }
153995
154295
  function asRecord6(value) {
153996
154296
  return isPlainRecord6(value) ? value : void 0;
@@ -154035,7 +154335,7 @@ var init_tasks_options = __esm({
154035
154335
  });
154036
154336
 
154037
154337
  // src/cli/commands/tasks.ts
154038
- import path188 from "node:path";
154338
+ import path189 from "node:path";
154039
154339
  function registerTasksCommand(program, container) {
154040
154340
  const tasks = program.command("tasks").description("Read and mutate configured workflow tasks.");
154041
154341
  tasks.command("verify").description("Verify a task GitHub Project.").argument("<list>", "Project list in <owner>/<number> format.").option("--workflow <path>", "Workflow file path.", "./WORKFLOW.md").option("--repo <owner/name>", "GitHub repository owner/name.").option("--project <owner/number>", "GitHub project owner/number.").option("--states <csv>", "Required task state names.").option("--json", jsonOptionDescription).action(async (list2, options, command) => {
@@ -154185,7 +154485,7 @@ async function runImport(options, container) {
154185
154485
  const limit = options.limit === void 0 ? void 0 : parseNonNegativeInteger3(options.limit, "--limit");
154186
154486
  const source = {
154187
154487
  type: "markdown-dir",
154188
- path: path188.resolve(options.from),
154488
+ path: path189.resolve(options.from),
154189
154489
  singleList: "import",
154190
154490
  frontmatterMode: "passthrough"
154191
154491
  };
@@ -154619,7 +154919,7 @@ var init_tasks2 = __esm({
154619
154919
  });
154620
154920
 
154621
154921
  // src/cli/commands/gaslight.ts
154622
- import path189 from "node:path";
154922
+ import path190 from "node:path";
154623
154923
  import { Option as Option10 } from "commander";
154624
154924
  async function resolveGaslightCommandConfig(container) {
154625
154925
  const configDoc = await readMergedDocumentReadonly(
@@ -154638,9 +154938,9 @@ async function resolveGaslightCommandConfig(container) {
154638
154938
  }
154639
154939
  function resolveConfiguredPath(cwd, homeDir, value) {
154640
154940
  if (value.startsWith("~/")) {
154641
- return path189.join(homeDir, value.slice(2));
154941
+ return path190.join(homeDir, value.slice(2));
154642
154942
  }
154643
- return path189.isAbsolute(value) ? value : path189.resolve(cwd, value);
154943
+ return path190.isAbsolute(value) ? value : path190.resolve(cwd, value);
154644
154944
  }
154645
154945
  function formatPlanDirectoryDetails(container, planDirectory, absoluteDirectory) {
154646
154946
  return [
@@ -154755,7 +155055,7 @@ function formatCompletedPlans(result) {
154755
155055
  return [
154756
155056
  "Completed plans:",
154757
155057
  ...result.plans.map(
154758
- (plan) => `- ${path189.basename(plan.planPath)}${plan.durationMs === void 0 ? "" : ` \xB7 ${formatDuration3(plan.durationMs)}`}`
155058
+ (plan) => `- ${path190.basename(plan.planPath)}${plan.durationMs === void 0 ? "" : ` \xB7 ${formatDuration3(plan.durationMs)}`}`
154759
155059
  )
154760
155060
  ].join("\n");
154761
155061
  }
@@ -154821,8 +155121,8 @@ async function resolveInstallScope(options, assumeYes) {
154821
155121
  }
154822
155122
  async function scaffoldConfig(container, scope, force, dryRun) {
154823
155123
  const root = scope === "global" ? container.env.homeDir : container.env.cwd;
154824
- const configPath = path189.join(root, ".poe-code", "gaslight.yaml");
154825
- const configDirectory = path189.dirname(configPath);
155124
+ const configPath = path190.join(root, ".poe-code", "gaslight.yaml");
155125
+ const configDirectory = path190.dirname(configPath);
154826
155126
  try {
154827
155127
  const stats2 = await container.fs.lstat(configDirectory);
154828
155128
  if (stats2.isSymbolicLink()) {
@@ -155217,7 +155517,7 @@ var init_package2 = __esm({
155217
155517
  "package.json"() {
155218
155518
  package_default2 = {
155219
155519
  name: "poe-code",
155220
- version: "10.0.3",
155520
+ version: "10.0.4",
155221
155521
  description: "CLI tool to configure Poe API for developer workflows.",
155222
155522
  license: "MIT",
155223
155523
  type: "module",
@@ -155851,11 +156151,11 @@ function readCommandTreeOption(command, optionName) {
155851
156151
  }
155852
156152
  return void 0;
155853
156153
  }
155854
- function assertPathIsNotOptionName(path190, command) {
155855
- const named = command.options.find((option) => option.long === `--${path190}`);
156154
+ function assertPathIsNotOptionName(path191, command) {
156155
+ const named = command.options.find((option) => option.long === `--${path191}`);
155856
156156
  if (named !== void 0) {
155857
156157
  throw new ValidationError(
155858
- `\`${path190}\` is not a workflow path. Did you mean \`${named.long}\`?`
156158
+ `\`${path191}\` is not a workflow path. Did you mean \`${named.long}\`?`
155859
156159
  );
155860
156160
  }
155861
156161
  }
@@ -155916,14 +156216,14 @@ function registerMaestroCommand(program, container) {
155916
156216
  "--log-level <level>",
155917
156217
  maestroCommandSchema.shape.logLevel.description ?? "Log level"
155918
156218
  ).choices(maestroCommandSchema.shape.logLevel.values.map(String)).default(maestroCommandSchema.shape.logLevel.default)
155919
- ).action(async (path190, options, command) => {
155920
- assertPathIsNotOptionName(path190, command);
156219
+ ).action(async (path191, options, command) => {
156220
+ assertPathIsNotOptionName(path191, command);
155921
156221
  const mergedOptions = {
155922
156222
  ...options,
155923
156223
  ...command.optsWithGlobals()
155924
156224
  };
155925
156225
  await runMaestro({
155926
- workflowPath: mergedOptions.config ?? path190,
156226
+ workflowPath: mergedOptions.config ?? path191,
155927
156227
  maxConcurrent: mergedOptions.maxConcurrent,
155928
156228
  pollIntervalMs: mergedOptions.pollIntervalMs,
155929
156229
  list: mergedOptions.list,
@@ -156084,7 +156384,7 @@ function createProgram(dependencies) {
156084
156384
  }
156085
156385
  function assertKnownHelpPath(program, container, argv) {
156086
156386
  let target = program;
156087
- const path190 = [];
156387
+ const path191 = [];
156088
156388
  for (const token of argv.filter((arg) => !arg.startsWith("-"))) {
156089
156389
  if (target.commands.length === 0) {
156090
156390
  return;
@@ -156092,7 +156392,7 @@ function assertKnownHelpPath(program, container, argv) {
156092
156392
  const child = findCommand2(target, token);
156093
156393
  if (child !== void 0) {
156094
156394
  target = child;
156095
- path190.push(token);
156395
+ path191.push(token);
156096
156396
  continue;
156097
156397
  }
156098
156398
  if (target !== program && target.registeredArguments.length > 0) {
@@ -156102,7 +156402,7 @@ function assertKnownHelpPath(program, container, argv) {
156102
156402
  container,
156103
156403
  scope: target === program ? "cli" : target.name(),
156104
156404
  unknownCommand: token,
156105
- helpArgs: [...path190, "--help"],
156405
+ helpArgs: [...path191, "--help"],
156106
156406
  candidates: commandCandidates(target),
156107
156407
  moduleUrl: import.meta.url
156108
156408
  });
@@ -156133,16 +156433,16 @@ function commandCandidates(parent) {
156133
156433
  return parent.commands.flatMap((command) => [command.name(), ...command.aliases()]);
156134
156434
  }
156135
156435
  function registerHelpCommand(program, container) {
156136
- program.command("help").description("Display help for a command.").argument("[command...]", "Command path to describe, for example `maestro tui`.").action((path190) => {
156436
+ program.command("help").description("Display help for a command.").argument("[command...]", "Command path to describe, for example `maestro tui`.").action((path191) => {
156137
156437
  let target = program;
156138
- for (const name of path190) {
156438
+ for (const name of path191) {
156139
156439
  const child = findCommand2(target, name);
156140
156440
  if (child === void 0) {
156141
156441
  throwCommandNotFound({
156142
156442
  container,
156143
156443
  scope: "cli",
156144
156444
  unknownCommand: name,
156145
- helpArgs: [...path190.slice(0, path190.indexOf(name)), "--help"],
156445
+ helpArgs: [...path191.slice(0, path191.indexOf(name)), "--help"],
156146
156446
  candidates: commandCandidates(target),
156147
156447
  moduleUrl: import.meta.url
156148
156448
  });