@oxagen/cli 5.5.1-228 → 5.5.1-235

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/oxagen.mjs +474 -325
  2. package/package.json +1 -1
package/oxagen.mjs CHANGED
@@ -4555,14 +4555,14 @@ var init_timestamp = __esm({
4555
4555
 
4556
4556
  // ../../packages/tacho/src/envelope.ts
4557
4557
  function refineTokenSourcePairs(body2, ctx2, path2 = []) {
4558
- for (const count14 of TOKEN_SOURCE_COUNTS) {
4559
- const basis = `${count14}_basis`;
4560
- const hasCount = body2[count14] !== void 0;
4558
+ for (const count15 of TOKEN_SOURCE_COUNTS) {
4559
+ const basis = `${count15}_basis`;
4560
+ const hasCount = body2[count15] !== void 0;
4561
4561
  if (hasCount === (body2[basis] !== void 0)) continue;
4562
4562
  ctx2.addIssue({
4563
4563
  code: external_exports.ZodIssueCode.custom,
4564
- path: [...path2, hasCount ? basis : count14],
4565
- message: hasCount ? `${count14} needs ${basis} beside it` : `${basis} names no ${count14}`
4564
+ path: [...path2, hasCount ? basis : count15],
4565
+ message: hasCount ? `${count15} needs ${basis} beside it` : `${basis} names no ${count15}`
4566
4566
  });
4567
4567
  }
4568
4568
  }
@@ -8040,27 +8040,27 @@ function isPaymentCardNumber(candidate) {
8040
8040
  const digits2 = candidate.replace(/[ -]/g, "");
8041
8041
  return digits2.length >= CARD_DIGITS_MIN && digits2.length <= CARD_DIGITS_MAX && /^[2-6]/.test(digits2) && passesLuhn(digits2);
8042
8042
  }
8043
- function sensitiveDataAttrs(count14, screen) {
8044
- const rules = SENSITIVE_DATA_KINDS.filter((kind) => count14[kind] > 0).map(
8043
+ function sensitiveDataAttrs(count15, screen) {
8044
+ const rules = SENSITIVE_DATA_KINDS.filter((kind) => count15[kind] > 0).map(
8045
8045
  (kind) => SENSITIVE_SCREEN_RULE_IDS[kind]
8046
8046
  );
8047
8047
  return {
8048
- [SENSITIVE_DATA_ATTRS.total]: String(count14.total),
8049
- [SENSITIVE_DATA_ATTRS.email]: String(count14.email),
8050
- [SENSITIVE_DATA_ATTRS.payment_card]: String(count14.payment_card),
8048
+ [SENSITIVE_DATA_ATTRS.total]: String(count15.total),
8049
+ [SENSITIVE_DATA_ATTRS.email]: String(count15.email),
8050
+ [SENSITIVE_DATA_ATTRS.payment_card]: String(count15.payment_card),
8051
8051
  [SENSITIVE_DATA_ATTRS.rules]: rules.join(","),
8052
8052
  [SENSITIVE_DATA_ATTRS.screen]: screen
8053
8053
  };
8054
8054
  }
8055
8055
  function screenSensitiveJson(value, strip) {
8056
- const count14 = { email: 0, payment_card: 0, total: 0 };
8056
+ const count15 = { email: 0, payment_card: 0, total: 0 };
8057
8057
  const find14 = (text6) => findSpans(text6, SENSITIVE_DETECTORS);
8058
8058
  const next = walkJson(value, find14, strip, (span) => {
8059
8059
  if (span.reason === "email" || span.reason === "payment_card")
8060
- count14[span.reason] += 1;
8061
- count14.total += 1;
8060
+ count15[span.reason] += 1;
8061
+ count15.total += 1;
8062
8062
  });
8063
- return { value: next, count: count14 };
8063
+ return { value: next, count: count15 };
8064
8064
  }
8065
8065
  function unrunnablePatternRefusal(policy) {
8066
8066
  const patterns = policy?.prompt_redaction?.patterns;
@@ -8074,33 +8074,33 @@ function unrunnablePatternRefusal(policy) {
8074
8074
  }
8075
8075
  }
8076
8076
  function promptRedactionRefusal(problems) {
8077
- const count14 = problems.length;
8077
+ const count15 = problems.length;
8078
8078
  const first = problems[0] ?? "";
8079
- const listed = count14 === 1 ? `a pattern the gateway cannot run, so the call was not sent. ${first}` : `${count14} patterns the gateway cannot run, so the call was not sent. For the first one: ${first}`;
8079
+ const listed = count15 === 1 ? `a pattern the gateway cannot run, so the call was not sent. ${first}` : `${count15} patterns the gateway cannot run, so the call was not sent. For the first one: ${first}`;
8080
8080
  return {
8081
8081
  code: "prompt_redaction_unrunnable",
8082
- message: `This workspace's Oxagen prompt redaction is on and lists ${listed} Ask a workspace Admin to enter ${count14 === 1 ? "it" : "them"} again under Workspace settings \u203A Agent gateway \u203A Prompt redaction.`,
8082
+ message: `This workspace's Oxagen prompt redaction is on and lists ${listed} Ask a workspace Admin to enter ${count15 === 1 ? "it" : "them"} again under Workspace settings \u203A Agent gateway \u203A Prompt redaction.`,
8083
8083
  source: "bundle",
8084
- attrs: { "oxagen.prompt_redaction_unrunnable": String(count14) }
8084
+ attrs: { "oxagen.prompt_redaction_unrunnable": String(count15) }
8085
8085
  };
8086
8086
  }
8087
8087
  function sensitiveRequestRefusal(request4) {
8088
8088
  if (request4 === void 0) return void 0;
8089
- const { count: count14 } = screenSensitiveJson(request4, false);
8090
- if (count14.total === 0) return void 0;
8089
+ const { count: count15 } = screenSensitiveJson(request4, false);
8090
+ if (count15.total === 0) return void 0;
8091
8091
  const found = [
8092
- ...count14.email > 0 ? [
8093
- count14.email === 1 ? "1 email address" : `${count14.email} email addresses`
8092
+ ...count15.email > 0 ? [
8093
+ count15.email === 1 ? "1 email address" : `${count15.email} email addresses`
8094
8094
  ] : [],
8095
- ...count14.payment_card > 0 ? [
8096
- count14.payment_card === 1 ? "1 payment card number" : `${count14.payment_card} payment card numbers`
8095
+ ...count15.payment_card > 0 ? [
8096
+ count15.payment_card === 1 ? "1 payment card number" : `${count15.payment_card} payment card numbers`
8097
8097
  ] : []
8098
8098
  ].join(" and ");
8099
8099
  return {
8100
8100
  code: "sensitive_data",
8101
8101
  message: `This workspace's Oxagen sensitive data screen refuses a prompt that carries an email address or a payment card number, and this one carries ${found}. Remove them and send the call again.`,
8102
8102
  source: "bundle",
8103
- attrs: sensitiveDataAttrs(count14, "reject")
8103
+ attrs: sensitiveDataAttrs(count15, "reject")
8104
8104
  };
8105
8105
  }
8106
8106
  function applyModelRequestPrivacy(request4, policy) {
@@ -12260,9 +12260,9 @@ function frame(chunks, value) {
12260
12260
  function frameText(chunks, value) {
12261
12261
  frame(chunks, Buffer.from(value, "utf8"));
12262
12262
  }
12263
- function frameListLength(chunks, count14) {
12263
+ function frameListLength(chunks, count15) {
12264
12264
  const bytes = Buffer.alloc(4);
12265
- bytes.writeUInt32BE(count14);
12265
+ bytes.writeUInt32BE(count15);
12266
12266
  frame(chunks, bytes);
12267
12267
  }
12268
12268
  function frameOptionalText(chunks, value) {
@@ -18004,7 +18004,7 @@ function llmCallKeys(body2) {
18004
18004
  finiteNumber(body2["cache_read_tokens"]),
18005
18005
  finiteNumber(body2["cache_creation_tokens"])
18006
18006
  ];
18007
- const tuple2 = counts2.some((count14) => count14 !== void 0) ? `tuple:${str2(body2["model"]) ?? ""}|${counts2.map((count14) => count14 ?? "").join("|")}` : void 0;
18007
+ const tuple2 = counts2.some((count15) => count15 !== void 0) ? `tuple:${str2(body2["model"]) ?? ""}|${counts2.map((count15) => count15 ?? "").join("|")}` : void 0;
18008
18008
  return { ids, tuple: tuple2 };
18009
18009
  }
18010
18010
  var LLM_CALL_USAGE_KEYS, LLM_CALL_TOKEN_SOURCES, LLM_CALL_LEDGER_CAPACITY, LlmCallLedger;
@@ -27329,13 +27329,13 @@ async function countSubagents(sessionDir) {
27329
27329
  const isAgent = (name2) => /^agent-.+\.jsonl$/.test(name2);
27330
27330
  const ignore = () => {
27331
27331
  };
27332
- let count14 = (await listDir(dir, ignore)).filter(isAgent).length;
27332
+ let count15 = (await listDir(dir, ignore)).filter(isAgent).length;
27333
27333
  const workflows = join15(dir, "workflows");
27334
27334
  for (const workflow of await listDir(workflows, ignore))
27335
- count14 += (await listDir(join15(workflows, workflow), ignore)).filter(
27335
+ count15 += (await listDir(join15(workflows, workflow), ignore)).filter(
27336
27336
  isAgent
27337
27337
  ).length;
27338
- return count14;
27338
+ return count15;
27339
27339
  }
27340
27340
  async function readMeta(path2, unreadable) {
27341
27341
  let parsed2;
@@ -32382,8 +32382,8 @@ function spawnInvocation(command2, args, platform2 = process.platform, env = pro
32382
32382
  windowsVerbatimArguments: true
32383
32383
  };
32384
32384
  }
32385
- function failure3(problem2, count14) {
32386
- return { answers: Array.from({ length: count14 }, () => ({})), problem: problem2 };
32385
+ function failure3(problem2, count15) {
32386
+ return { answers: Array.from({ length: count15 }, () => ({})), problem: problem2 };
32387
32387
  }
32388
32388
  function codexAppServerClient(options) {
32389
32389
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
@@ -32907,7 +32907,7 @@ function renderWindowsLauncher(spec, generation = "0") {
32907
32907
  ).join("\r\n");
32908
32908
  const command2 = spec.command.map(cmdQuote).join(" ");
32909
32909
  const system = "%SystemRoot%\\System32";
32910
- const ping = (count14) => `"${system}\\PING.EXE" -n ${count14} 127.0.0.1 >nul`;
32910
+ const ping = (count15) => `"${system}\\PING.EXE" -n ${count15} 127.0.0.1 >nul`;
32911
32911
  return [
32912
32912
  "@echo off",
32913
32913
  `"${system}\\chcp.com" 65001 >nul`,
@@ -33126,7 +33126,7 @@ import { readFileSync as readFileSync12 } from "node:fs";
33126
33126
  import { dirname as dirname14, resolve as resolve3 } from "node:path";
33127
33127
  import { fileURLToPath } from "node:url";
33128
33128
  function readVersion() {
33129
- if (true) return "5.5.1-228";
33129
+ if (true) return "5.5.1-235";
33130
33130
  try {
33131
33131
  const here = dirname14(fileURLToPath(import.meta.url));
33132
33132
  const pkg = JSON.parse(
@@ -35441,11 +35441,11 @@ ${list2.join("\n")}
35441
35441
  */
35442
35442
  remove(sessionUuid2) {
35443
35443
  const state = this.state();
35444
- const count14 = state.get(sessionUuid2)?.bodies ?? 0;
35444
+ const count15 = state.get(sessionUuid2)?.bodies ?? 0;
35445
35445
  const path2 = this.pathFor(sessionUuid2);
35446
35446
  if (existsSync15(path2)) unlinkSync10(path2);
35447
35447
  state.delete(sessionUuid2);
35448
- return count14;
35448
+ return count15;
35449
35449
  }
35450
35450
  state() {
35451
35451
  if (this.loaded !== void 0) return this.loaded;
@@ -36102,15 +36102,15 @@ ${lines.join("\n")}
36102
36102
  }
36103
36103
  /** Count a session and read its endpoints without keeping its history in memory. */
36104
36104
  summary(sessionUuid2) {
36105
- let count14 = 0;
36105
+ let count15 = 0;
36106
36106
  let first;
36107
36107
  let last;
36108
36108
  for (const event of this.eventsForward(sessionUuid2)) {
36109
36109
  first ??= event;
36110
36110
  last = event;
36111
- count14 += 1;
36111
+ count15 += 1;
36112
36112
  }
36113
- return { count: count14, first, last };
36113
+ return { count: count15, first, last };
36114
36114
  }
36115
36115
  *eventsForward(sessionUuid2) {
36116
36116
  const path2 = this.fileFor(sessionUuid2);
@@ -38422,11 +38422,11 @@ function shippingHealth(daemon, wal, now) {
38422
38422
  if (wal.unshipped === 0)
38423
38423
  return { healthy: true, detail: "every recorded event has shipped" };
38424
38424
  const lastError = typeof daemon["last_error"] === "string" && daemon["last_error"] !== "" ? daemon["last_error"] : void 0;
38425
- const count14 = `${wal.unshipped} event${wal.unshipped === 1 ? "" : "s"} waiting`;
38425
+ const count15 = `${wal.unshipped} event${wal.unshipped === 1 ? "" : "s"} waiting`;
38426
38426
  if (lastError !== void 0)
38427
38427
  return {
38428
38428
  healthy: false,
38429
- detail: `the last ingest failed, ${count14}: ${lastError}`
38429
+ detail: `the last ingest failed, ${count15}: ${lastError}`
38430
38430
  };
38431
38431
  const lastIngest = typeof daemon["last_ingest_at"] === "string" ? Date.parse(daemon["last_ingest_at"]) : Number.NaN;
38432
38432
  const oldest = wal.oldestUnshippedAt !== void 0 ? Date.parse(wal.oldestUnshippedAt) : Number.NaN;
@@ -38435,9 +38435,9 @@ function shippingHealth(daemon, wal, now) {
38435
38435
  if (ingestStale && backlogOld)
38436
38436
  return {
38437
38437
  healthy: false,
38438
- detail: `nothing has shipped in over ${SHIPPING_STALL_MS / 6e4} minutes, ${count14}`
38438
+ detail: `nothing has shipped in over ${SHIPPING_STALL_MS / 6e4} minutes, ${count15}`
38439
38439
  };
38440
- return { healthy: true, detail: `shipping, ${count14}` };
38440
+ return { healthy: true, detail: `shipping, ${count15}` };
38441
38441
  }
38442
38442
  function installedCursor(execpath, deps) {
38443
38443
  const cli = execpath !== void 0 && execpath.length > 0 && existsSync18(execpath) ? execpath : void 0;
@@ -41589,8 +41589,8 @@ async function exportCommand(options, deps) {
41589
41589
  if (options.list === true || options.session === void 0) {
41590
41590
  const rows = wals.flatMap(
41591
41591
  (wal) => wal.sessions().map((uuid3) => {
41592
- const { first, last, count: count14 } = wal.summary(uuid3);
41593
- return `${uuid3} ${first?.session_id ?? "?"} ${count14} events ${first?.ts ?? ""} .. ${last?.ts ?? ""}${last?.kind === "agent_stop" ? " locked" : ""}`;
41592
+ const { first, last, count: count15 } = wal.summary(uuid3);
41593
+ return `${uuid3} ${first?.session_id ?? "?"} ${count15} events ${first?.ts ?? ""} .. ${last?.ts ?? ""}${last?.kind === "agent_stop" ? " locked" : ""}`;
41594
41594
  })
41595
41595
  );
41596
41596
  deps.out(
@@ -44364,7 +44364,8 @@ var init_local = __esm({
44364
44364
  "list_held_decisions",
44365
44365
  "list_link_labels",
44366
44366
  "get_dataflow_slice",
44367
- "localize_fault"
44367
+ "localize_fault",
44368
+ "get_repair_context"
44368
44369
  ];
44369
44370
  READ_SET = new Set(LOCAL_CODE_GRAPH_READS);
44370
44371
  BUILD_CODE_GRAPH_TOOL = "build_code_graph";
@@ -45161,7 +45162,7 @@ function createMcpGateway(deps) {
45161
45162
  if (!isLocalCodeGraphRead(name2)) return void 0;
45162
45163
  if (allowed !== void 0 && !allowed.has(name2)) return void 0;
45163
45164
  if (args["at"] !== void 0) return void 0;
45164
- if (name2 === "localize_fault" && args["failure"] !== void 0)
45165
+ if ((name2 === "localize_fault" || name2 === "get_repair_context") && args["failure"] !== void 0)
45165
45166
  return void 0;
45166
45167
  let built;
45167
45168
  try {
@@ -45354,10 +45355,10 @@ function createMcpGateway(deps) {
45354
45355
  };
45355
45356
  }
45356
45357
  const ceiling = ceilingOf(bundle2);
45357
- const count14 = toolCountOf(served2);
45358
- if (ceiling !== void 0 && count14 !== void 0 && count14 > ceiling.maxTools) {
45358
+ const count15 = toolCountOf(served2);
45359
+ if (ceiling !== void 0 && count15 !== void 0 && count15 > ceiling.maxTools) {
45359
45360
  log(
45360
- `mcp gateway refused tools/list: ${count14} tools exceeds ${ceiling.maxTools} for ${ceiling.modelId}`
45361
+ `mcp gateway refused tools/list: ${count15} tools exceeds ${ceiling.maxTools} for ${ceiling.modelId}`
45361
45362
  );
45362
45363
  recordCall(
45363
45364
  request4,
@@ -45372,11 +45373,11 @@ function createMcpGateway(deps) {
45372
45373
  body: rpcError(
45373
45374
  id2,
45374
45375
  RPC_REFUSED,
45375
- tooManyToolsMessage(ceiling, count14),
45376
+ tooManyToolsMessage(ceiling, count15),
45376
45377
  {
45377
45378
  modelId: ceiling.modelId,
45378
45379
  maxTools: ceiling.maxTools,
45379
- toolCount: count14
45380
+ toolCount: count15
45380
45381
  }
45381
45382
  )
45382
45383
  });
@@ -45530,7 +45531,8 @@ var init_mcp_gateway = __esm({
45530
45531
  FORWARDED_LOCAL_ERRORS = /* @__PURE__ */ new Set([
45531
45532
  "not_built",
45532
45533
  "not_found",
45533
- "unavailable"
45534
+ "unavailable",
45535
+ "unknown_call"
45534
45536
  ]);
45535
45537
  UPSTREAM_LEGACY_RECHECK_MS = 10 * 6e4;
45536
45538
  UPSTREAM_PROBE_RETRY_MS = 6e4;
@@ -49429,14 +49431,14 @@ function rowsOf(entries2, counts2, root, uncommitted) {
49429
49431
  for (const entry2 of entries2) {
49430
49432
  const status2 = statusOf(entry2.code);
49431
49433
  if (status2 === void 0) continue;
49432
- const count14 = counts2.get(entry2.path);
49434
+ const count15 = counts2.get(entry2.path);
49433
49435
  const left = uncommitted?.get(entry2.path);
49434
49436
  out.push({
49435
49437
  path: absoluteIn(root, entry2.path),
49436
49438
  repo_relative_path: root === void 0 ? "" : entry2.path,
49437
49439
  status: status2,
49438
- lines_added: count14?.added ?? 0,
49439
- lines_removed: count14?.removed ?? 0,
49440
+ lines_added: count15?.added ?? 0,
49441
+ lines_removed: count15?.removed ?? 0,
49440
49442
  ...uncommitted === void 0 ? {} : {
49441
49443
  uncommitted_lines_added: left?.added ?? 0,
49442
49444
  uncommitted_lines_removed: left?.removed ?? 0
@@ -50582,16 +50584,16 @@ async function contributionOf(exec4, cwd, root, repoRelative, entry2, copies) {
50582
50584
  if (kept === void 0 || kept === "absent" || kept.kind !== "file")
50583
50585
  return void 0;
50584
50586
  } else if (now === "absent") return void 0;
50585
- const count14 = await lineDelta(
50587
+ const count15 = await lineDelta(
50586
50588
  exec4,
50587
50589
  cwd,
50588
50590
  copy ?? "/dev/null",
50589
50591
  now === "absent" ? "/dev/null" : absolute
50590
50592
  );
50591
- if (count14 === void 0) return void 0;
50593
+ if (count15 === void 0) return void 0;
50592
50594
  return {
50593
50595
  code: copy === null ? "A " : now === "absent" ? "D " : "M ",
50594
- count: count14,
50596
+ count: count15,
50595
50597
  copy
50596
50598
  };
50597
50599
  }
@@ -50703,7 +50705,7 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
50703
50705
  ]);
50704
50706
  if (local === void 0 || mine === void 0) return void 0;
50705
50707
  const tests = new Map(known.tests);
50706
- const count14 = (into, commits, test) => {
50708
+ const count15 = (into, commits, test) => {
50707
50709
  for (const commit of commits)
50708
50710
  if (commit.committedAt >= since && commit.authoredAt >= since) {
50709
50711
  into.set(commit.sha, commit);
@@ -50711,8 +50713,8 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
50711
50713
  }
50712
50714
  };
50713
50715
  const counted = /* @__PURE__ */ new Map();
50714
- count14(counted, parseLog(local), "unpushed");
50715
- count14(
50716
+ count15(counted, parseLog(local), "unpushed");
50717
+ count15(
50716
50718
  counted,
50717
50719
  parseLog(mine).filter((commit) => commit.email === email3),
50718
50720
  "email"
@@ -50743,7 +50745,7 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
50743
50745
  }),
50744
50746
  UNTRACKED_COUNT_CONCURRENCY
50745
50747
  );
50746
- count14(
50748
+ count15(
50747
50749
  counted,
50748
50750
  candidates.filter((commit) => reached.has(commit.sha)),
50749
50751
  "reflog"
@@ -50751,8 +50753,8 @@ async function sessionCommits(exec4, cwd, baseline, head3, firstReadAt, known) {
50751
50753
  }
50752
50754
  const merges = /* @__PURE__ */ new Map();
50753
50755
  if (localMerges !== void 0 && myMerges !== void 0) {
50754
- count14(merges, parseLog(localMerges), "unpushed");
50755
- count14(
50756
+ count15(merges, parseLog(localMerges), "unpushed");
50757
+ count15(
50756
50758
  merges,
50757
50759
  parseLog(myMerges).filter((commit) => commit.email === email3),
50758
50760
  "email"
@@ -50878,14 +50880,14 @@ async function readSessionChanges(exec4, cwd, start, copies) {
50878
50880
  if (!touched.paths.has(entry2.path)) continue;
50879
50881
  rows.set(entry2.path, entry2.code);
50880
50882
  baselinePaths.add(entry2.path);
50881
- const count14 = atBaseline?.counts.get(entry2.path);
50882
- if (count14 !== void 0) counts2.set(entry2.path, count14);
50883
+ const count15 = atBaseline?.counts.get(entry2.path);
50884
+ if (count15 !== void 0) counts2.set(entry2.path, count15);
50883
50885
  }
50884
50886
  for (const entry2 of atHead.entries) {
50885
50887
  if (rows.has(entry2.path)) continue;
50886
50888
  rows.set(entry2.path, entry2.code);
50887
- const count14 = atHead.counts.get(entry2.path);
50888
- if (count14 !== void 0) counts2.set(entry2.path, count14);
50889
+ const count15 = atHead.counts.get(entry2.path);
50890
+ if (count15 !== void 0) counts2.set(entry2.path, count15);
50889
50891
  }
50890
50892
  for (const entry2 of listed)
50891
50893
  if (entry2.code === "??" && !rows.has(entry2.path))
@@ -54124,7 +54126,7 @@ function promptText(input2) {
54124
54126
  function recallContext(memories, used, max2 = ADDITIONAL_CONTEXT_MAX_CHARS) {
54125
54127
  const room = max2 - used - (used > 0 ? CONTEXT_JOINER.length : 0);
54126
54128
  let text6 = RECALL_HEADING;
54127
- let count14 = 0;
54129
+ let count15 = 0;
54128
54130
  for (const memory of memories) {
54129
54131
  const statement = memory.statement.replace(/\s+/g, " ").trim();
54130
54132
  if (statement.length === 0) continue;
@@ -54132,9 +54134,9 @@ function recallContext(memories, used, max2 = ADDITIONAL_CONTEXT_MAX_CHARS) {
54132
54134
  - ${statement}`;
54133
54135
  if (text6.length + line.length > room) continue;
54134
54136
  text6 += line;
54135
- count14 += 1;
54137
+ count15 += 1;
54136
54138
  }
54137
- return count14 > 0 ? { text: text6, count: count14 } : void 0;
54139
+ return count15 > 0 ? { text: text6, count: count15 } : void 0;
54138
54140
  }
54139
54141
  async function runSteeringBundle(record2, deps) {
54140
54142
  if (deps.runSteering === void 0) return void 0;
@@ -56399,21 +56401,21 @@ function countsOf(state) {
56399
56401
  record2.counts
56400
56402
  )) {
56401
56403
  if (typeof paths !== "object" || paths === null) continue;
56402
- for (const [path2, count14] of Object.entries(
56404
+ for (const [path2, count15] of Object.entries(
56403
56405
  paths
56404
56406
  ))
56405
- if (Number.isSafeInteger(count14) && count14 > 0)
56406
- counts2.set(keyOf(harness, path2), count14);
56407
+ if (Number.isSafeInteger(count15) && count15 > 0)
56408
+ counts2.set(keyOf(harness, path2), count15);
56407
56409
  }
56408
56410
  return counts2;
56409
56411
  }
56410
56412
  function stateOf2(counts2) {
56411
56413
  const byHarness = {};
56412
- for (const [key, count14] of counts2) {
56414
+ for (const [key, count15] of counts2) {
56413
56415
  const split = key.indexOf("\n");
56414
56416
  const harness = key.slice(0, split);
56415
56417
  const path2 = key.slice(split + 1);
56416
- (byHarness[harness] ??= {})[path2] = count14;
56418
+ (byHarness[harness] ??= {})[path2] = count15;
56417
56419
  }
56418
56420
  return JSON.stringify({
56419
56421
  schema: MEMORY_COUNTS_STATE_SCHEMA,
@@ -56473,19 +56475,19 @@ function createUseCountLedger(deps) {
56473
56475
  let changed = false;
56474
56476
  for (const read2 of reads) {
56475
56477
  const present = /* @__PURE__ */ new Set();
56476
- for (const { path: path2, count: count14, lastUsedAt } of read2.counts) {
56477
- if (!Number.isSafeInteger(count14) || count14 < 0) continue;
56478
+ for (const { path: path2, count: count15, lastUsedAt } of read2.counts) {
56479
+ if (!Number.isSafeInteger(count15) || count15 < 0) continue;
56478
56480
  const key = keyOf(read2.harness, path2);
56479
56481
  present.add(key);
56480
56482
  const base2 = counts2.get(key) ?? 0;
56481
- if (count14 < base2) {
56482
- if (count14 === 0) counts2.delete(key);
56483
- else counts2.set(key, count14);
56483
+ if (count15 < base2) {
56484
+ if (count15 === 0) counts2.delete(key);
56485
+ else counts2.set(key, count15);
56484
56486
  changed = true;
56485
56487
  continue;
56486
56488
  }
56487
- if (count14 === base2) continue;
56488
- const rise = Math.min(count14 - base2, RISE_MAX);
56489
+ if (count15 === base2) continue;
56490
+ const rise = Math.min(count15 - base2, RISE_MAX);
56489
56491
  rises.push({
56490
56492
  harness: read2.harness,
56491
56493
  path: path2,
@@ -56814,7 +56816,7 @@ function createMemoryReader(deps) {
56814
56816
  else if (where2.kind === "outside") uploading.delete(root);
56815
56817
  }
56816
56818
  async function offerStored(store, memories, budget, seen, read2) {
56817
- let count14 = 0;
56819
+ let count15 = 0;
56818
56820
  const paths = [];
56819
56821
  const counts2 = [];
56820
56822
  for (const memory of memories) {
@@ -56838,8 +56840,8 @@ function createMemoryReader(deps) {
56838
56840
  read2
56839
56841
  );
56840
56842
  if (offered === "failed")
56841
- return { sent: count14, failed: true, paths, counts: counts2 };
56842
- if (offered === "sent") count14 += 1;
56843
+ return { sent: count15, failed: true, paths, counts: counts2 };
56844
+ if (offered === "sent") count15 += 1;
56843
56845
  if (memory.useCount !== void 0)
56844
56846
  counts2.push({
56845
56847
  path: memory.path,
@@ -56847,10 +56849,10 @@ function createMemoryReader(deps) {
56847
56849
  ...memory.lastUsedAt !== void 0 ? { lastUsedAt: memory.lastUsedAt } : {}
56848
56850
  });
56849
56851
  }
56850
- return { sent: count14, failed: false, paths, counts: counts2 };
56852
+ return { sent: count15, failed: false, paths, counts: counts2 };
56851
56853
  }
56852
56854
  async function scanOnce() {
56853
- let count14 = 0;
56855
+ let count15 = 0;
56854
56856
  const scans = [];
56855
56857
  const counts2 = [];
56856
56858
  const whole2 = [];
@@ -56874,7 +56876,7 @@ function createMemoryReader(deps) {
56874
56876
  file2.read
56875
56877
  );
56876
56878
  if (offered === "failed") return false;
56877
- if (offered === "sent") count14 += 1;
56879
+ if (offered === "sent") count15 += 1;
56878
56880
  }
56879
56881
  return true;
56880
56882
  }
@@ -56900,7 +56902,7 @@ function createMemoryReader(deps) {
56900
56902
  if (!sends(where3)) continue;
56901
56903
  const paths2 = [];
56902
56904
  if (!await readFolder(location, dir, files2.names, where3, paths2))
56903
- return { sent: count14 };
56905
+ return { sent: count15 };
56904
56906
  whole2.push(keyOf2(location.harness, folder));
56905
56907
  scans.push({
56906
56908
  harness: location.harness,
@@ -56921,7 +56923,7 @@ function createMemoryReader(deps) {
56921
56923
  const files2 = await list2(dir);
56922
56924
  if (!files2.complete) complete = false;
56923
56925
  if (!await readFolder(location, dir, files2.names, where2, paths))
56924
- return { sent: count14 };
56926
+ return { sent: count15 };
56925
56927
  }
56926
56928
  if (!complete) continue;
56927
56929
  whole2.push(prefix);
@@ -56944,8 +56946,8 @@ function createMemoryReader(deps) {
56944
56946
  seen,
56945
56947
  storeRead
56946
56948
  );
56947
- count14 += offered.sent;
56948
- if (offered.failed) return { sent: count14 };
56949
+ count15 += offered.sent;
56950
+ if (offered.failed) return { sent: count15 };
56949
56951
  scans.push({
56950
56952
  harness: store.harness,
56951
56953
  root: store.root,
@@ -56965,7 +56967,7 @@ function createMemoryReader(deps) {
56965
56967
  dirty = true;
56966
56968
  }
56967
56969
  for (const key of [...refused3.keys()]) if (gone(key)) refused3.delete(key);
56968
- return { sent: count14, scans, counts: counts2 };
56970
+ return { sent: count15, scans, counts: counts2 };
56969
56971
  }
56970
56972
  async function sendFile(given) {
56971
56973
  if (!isAbsolute10(given)) return "skipped";
@@ -61039,7 +61041,7 @@ function parseRequest(text6) {
61039
61041
  purpose: value.input_type === "query" ? "query" : "document"
61040
61042
  };
61041
61043
  }
61042
- function vectorsOf(text6, count14) {
61044
+ function vectorsOf(text6, count15) {
61043
61045
  let body2;
61044
61046
  try {
61045
61047
  body2 = JSON.parse(text6);
@@ -61047,7 +61049,7 @@ function vectorsOf(text6, count14) {
61047
61049
  return void 0;
61048
61050
  }
61049
61051
  const value = body2 ?? {};
61050
- if (value.space !== OXAGEN_EMBED_SPACE || value.dimensions !== OXAGEN_EMBED_DIMENSIONS || !Array.isArray(value.vectors) || value.vectors.length !== count14)
61052
+ if (value.space !== OXAGEN_EMBED_SPACE || value.dimensions !== OXAGEN_EMBED_DIMENSIONS || !Array.isArray(value.vectors) || value.vectors.length !== count15)
61051
61053
  return void 0;
61052
61054
  const vectors = value.vectors;
61053
61055
  const usable = vectors.every(
@@ -63033,16 +63035,16 @@ var init_cache_keep_alive = __esm({
63033
63035
  this.stop(state, `no price for ${snapshot.model}`);
63034
63036
  return void 0;
63035
63037
  }
63036
- const count14 = state.sent + 1;
63038
+ const count15 = state.sent + 1;
63037
63039
  if (!mayKeepAlive(state.sent, snapshot, price)) {
63038
63040
  this.stop(
63039
63041
  state,
63040
- `${count14} keep-alive${count14 === 1 ? "" : "s"} would cost at least one rewrite of the prefix`
63042
+ `${count15} keep-alive${count15 === 1 ? "" : "s"} would cost at least one rewrite of the prefix`
63041
63043
  );
63042
63044
  return void 0;
63043
63045
  }
63044
63046
  state.inFlight = true;
63045
- return Promise.resolve().then(() => this.deps.send(state.session, snapshot, count14, finding)).catch(
63047
+ return Promise.resolve().then(() => this.deps.send(state.session, snapshot, count15, finding)).catch(
63046
63048
  (error2) => ({
63047
63049
  sent: false,
63048
63050
  reason: error2 instanceof Error ? error2.message : String(error2)
@@ -63062,7 +63064,7 @@ var init_cache_keep_alive = __esm({
63062
63064
  return;
63063
63065
  }
63064
63066
  snapshot.anchorAt = outcome.startedAt;
63065
- state.sent = count14;
63067
+ state.sent = count15;
63066
63068
  });
63067
63069
  }
63068
63070
  stop(state, reason3) {
@@ -63352,9 +63354,9 @@ function modelSteeringAttributes(manifest) {
63352
63354
  const json3 = JSON.stringify(manifest);
63353
63355
  if (json3.length <= 4096) return { [MODEL_STEERING_MANIFEST_ATTR]: json3 };
63354
63356
  const attrs2 = {};
63355
- const count14 = Math.ceil(json3.length / 4096);
63356
- attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.parts`] = String(count14);
63357
- for (let i2 = 0; i2 < count14; i2 += 1)
63357
+ const count15 = Math.ceil(json3.length / 4096);
63358
+ attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.parts`] = String(count15);
63359
+ for (let i2 = 0; i2 < count15; i2 += 1)
63358
63360
  attrs2[`${MODEL_STEERING_MANIFEST_ATTR}.${i2}`] = json3.slice(
63359
63361
  i2 * 4096,
63360
63362
  (i2 + 1) * 4096
@@ -64269,7 +64271,7 @@ function createModelProxy(deps) {
64269
64271
  waiting: (record2) => record2.recorder.openChildren.size > 0,
64270
64272
  finding: () => cacheKeepAliveFinding(deps.policy().bundle),
64271
64273
  price: (model) => resolveModelPrice(deps.policy().bundle.model_prices, "anthropic", model),
64272
- send: (record2, snapshot, count14, finding) => sendKeepAlive(record2, snapshot, count14, finding),
64274
+ send: (record2, snapshot, count15, finding) => sendKeepAlive(record2, snapshot, count15, finding),
64273
64275
  log: deps.log
64274
64276
  });
64275
64277
  const keepAliveTimer = setInterval(() => {
@@ -64874,7 +64876,7 @@ function createModelProxy(deps) {
64874
64876
  if (timer !== void 0) clearTimeout(timer);
64875
64877
  }
64876
64878
  }
64877
- function sendKeepAlive(record2, snapshot, count14, finding) {
64879
+ function sendKeepAlive(record2, snapshot, count15, finding) {
64878
64880
  const refusal = refusalFor2(record2, snapshot.model, false, true);
64879
64881
  if (refusal !== void 0)
64880
64882
  return Promise.resolve({
@@ -64975,7 +64977,7 @@ function createModelProxy(deps) {
64975
64977
  const requestId = response.headers["request-id"] ?? response.headers["x-request-id"];
64976
64978
  let readTokens = 0;
64977
64979
  try {
64978
- readTokens = sealKeepAlive(record2, snapshot, count14, finding, {
64980
+ readTokens = sealKeepAlive(record2, snapshot, count15, finding, {
64979
64981
  startedAt,
64980
64982
  firstByteAt,
64981
64983
  status: status2,
@@ -65020,7 +65022,7 @@ function createModelProxy(deps) {
65020
65022
  sent.end(payload.body);
65021
65023
  });
65022
65024
  }
65023
- function sealKeepAlive(record2, snapshot, count14, finding, answer) {
65025
+ function sealKeepAlive(record2, snapshot, count15, finding, answer) {
65024
65026
  const payload = snapshot.payload;
65025
65027
  const usage3 = {};
65026
65028
  if (answer.responseText !== void 0) {
@@ -65102,7 +65104,7 @@ function createModelProxy(deps) {
65102
65104
  [TACHO_METERING_ATTR]: TACHO_METERING_OBSERVED,
65103
65105
  [KEEP_ALIVE_ATTR]: "1",
65104
65106
  [KEEP_ALIVE_FINDING_ATTR]: finding,
65105
- [KEEP_ALIVE_COUNT_ATTR]: String(count14),
65107
+ [KEEP_ALIVE_COUNT_ATTR]: String(count15),
65106
65108
  [KEEP_ALIVE_TTL_ATTR]: snapshot.ttl,
65107
65109
  "oxagen.request_digest": digestBytes(payload.body),
65108
65110
  "oxagen.request_bytes": String(payload.body.length),
@@ -72384,11 +72386,11 @@ async function initializeDaemon(options, server, port, ready, clock2) {
72384
72386
  await modelProxyListener.start();
72385
72387
  }
72386
72388
  function quarantineFileCount() {
72387
- const count14 = readdirSync17(paths.quarantine).filter(
72389
+ const count15 = readdirSync17(paths.quarantine).filter(
72388
72390
  (name2) => name2.endsWith(".json")
72389
72391
  ).length;
72390
- quarantineDepth = count14;
72391
- return count14;
72392
+ quarantineDepth = count15;
72393
+ return count15;
72392
72394
  }
72393
72395
  async function refreshQuarantineDepth() {
72394
72396
  const writes = quarantineWrites;
@@ -74423,6 +74425,47 @@ var init_workspace_switch = __esm({
74423
74425
  }
74424
74426
  });
74425
74427
 
74428
+ // ../../packages/tacho/src/codegraph/embedding-estimate.ts
74429
+ function formatTokens(tokens) {
74430
+ return new Intl.NumberFormat("en-US", {
74431
+ notation: "compact",
74432
+ maximumFractionDigits: 1
74433
+ }).format(tokens);
74434
+ }
74435
+ function describeEstimate(estimate2) {
74436
+ return `About ${formatTokens(estimate2.tokens)} tokens to embed ${estimate2.cards.toLocaleString("en-US")} cards.`;
74437
+ }
74438
+ function count7(value) {
74439
+ return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : void 0;
74440
+ }
74441
+ async function fetchEmbeddingEstimate(fetch2, host) {
74442
+ try {
74443
+ const answer = await postToControlPlane(
74444
+ fetch2,
74445
+ host,
74446
+ EMBEDDING_ESTIMATE_PATH,
74447
+ {},
74448
+ AbortSignal.timeout(ESTIMATE_TIMEOUT_MS)
74449
+ );
74450
+ if (!answer.ok) return void 0;
74451
+ const body2 = JSON.parse(answer.text);
74452
+ const cards = count7(body2.cards);
74453
+ const tokens = count7(body2.tokens);
74454
+ return cards === void 0 || tokens === void 0 ? void 0 : { cards, tokens };
74455
+ } catch {
74456
+ return void 0;
74457
+ }
74458
+ }
74459
+ var EMBEDDING_ESTIMATE_PATH, ESTIMATE_TIMEOUT_MS;
74460
+ var init_embedding_estimate = __esm({
74461
+ "../../packages/tacho/src/codegraph/embedding-estimate.ts"() {
74462
+ "use strict";
74463
+ init_memory_upload();
74464
+ EMBEDDING_ESTIMATE_PATH = "/v1/tacho/codegraph/embedding-estimate";
74465
+ ESTIMATE_TIMEOUT_MS = 1e4;
74466
+ }
74467
+ });
74468
+
74426
74469
  // ../../packages/tacho/src/codegraph/harness-entries.ts
74427
74470
  import { existsSync as existsSync29, readFileSync as readFileSync27 } from "node:fs";
74428
74471
  import { dirname as dirname34, join as join60 } from "node:path";
@@ -74560,6 +74603,7 @@ var init_harness_entries = __esm({
74560
74603
  // ../../packages/tacho/src/codegraph/cli.ts
74561
74604
  import { rmSync as rmSync12 } from "node:fs";
74562
74605
  import { resolve as resolve21 } from "node:path";
74606
+ import { createInterface as createInterface3 } from "node:readline/promises";
74563
74607
  async function daemonRoute(deps, route, body2) {
74564
74608
  if (deps.daemonStream === void 0) return void 0;
74565
74609
  const lines = [];
@@ -74703,6 +74747,42 @@ async function buildAndWait(deps, link, path2, force) {
74703
74747
  );
74704
74748
  return { started, state: done.state };
74705
74749
  }
74750
+ async function askAtTerminal(question) {
74751
+ if (!process.stdin.isTTY) return false;
74752
+ const lines = createInterface3({
74753
+ input: process.stdin,
74754
+ output: process.stderr
74755
+ });
74756
+ try {
74757
+ return /^y(es)?$/i.test((await lines.question(question)).trim());
74758
+ } finally {
74759
+ lines.close();
74760
+ }
74761
+ }
74762
+ function embeddingsSwitchedOff(answer) {
74763
+ const supervisor = answer.supervisor;
74764
+ return supervisor?.embeddings === "none" && supervisor.embeddingsReason?.startsWith("embeddings_off") === true;
74765
+ }
74766
+ async function offerEmbeddings(deps, host, answer, options) {
74767
+ if (!embeddingsSwitchedOff(answer)) return void 0;
74768
+ const estimate2 = await fetchEmbeddingEstimate(deps.fetch, {
74769
+ api_url: host.api_url,
74770
+ api_key: host.api_key,
74771
+ host_enrollment_id: host.host_enrollment_id,
74772
+ deviceKey: loadOrCreateDeviceKey(deps.paths.deviceKey).key
74773
+ });
74774
+ if (estimate2 === void 0 || options.json === true) return estimate2;
74775
+ deps.out("Embeddings are off.");
74776
+ if (estimate2.tokens === 0) return estimate2;
74777
+ deps.out(describeEstimate(estimate2));
74778
+ const ask = deps.askYesNo ?? askAtTerminal;
74779
+ if (await ask("Turn on embeddings? [y/N] "))
74780
+ deps.out(
74781
+ "Turn them on with the Embeddings switch in Code graph settings. The switch opens a steering PR."
74782
+ );
74783
+ else deps.out("Embeddings stay off.");
74784
+ return estimate2;
74785
+ }
74706
74786
  async function withLink(deps, host, body2) {
74707
74787
  let opened;
74708
74788
  try {
@@ -74736,8 +74816,20 @@ async function codegraphInit(path2, options, deps) {
74736
74816
  );
74737
74817
  const answer = await link.status();
74738
74818
  if (options.json === true) {
74819
+ const embeddingEstimate = await offerEmbeddings(
74820
+ deps,
74821
+ host,
74822
+ answer,
74823
+ options
74824
+ );
74739
74825
  deps.out(
74740
- JSON.stringify({ entries: entries2, build: built, ...answer, via: link.via })
74826
+ JSON.stringify({
74827
+ entries: entries2,
74828
+ build: built,
74829
+ ...answer,
74830
+ via: link.via,
74831
+ ...embeddingEstimate !== void 0 ? { embeddingEstimate } : {}
74832
+ })
74741
74833
  );
74742
74834
  } else {
74743
74835
  printEntries(deps, entries2);
@@ -74746,6 +74838,7 @@ async function codegraphInit(path2, options, deps) {
74746
74838
  deps.out(
74747
74839
  "The build is still running. Run `oxagen graph status` to see when it ends."
74748
74840
  );
74841
+ await offerEmbeddings(deps, host, answer, options);
74749
74842
  }
74750
74843
  return built.state !== "failed";
74751
74844
  });
@@ -74796,6 +74889,7 @@ var init_cli = __esm({
74796
74889
  "use strict";
74797
74890
  init_device_key();
74798
74891
  init_host_file();
74892
+ init_embedding_estimate();
74799
74893
  init_harness_entries();
74800
74894
  init_local();
74801
74895
  init_supervisor();
@@ -78345,10 +78439,10 @@ function readBounded(root, relative11, limit = ARP_MAX_BLOB_BYTES) {
78345
78439
  const bytes = Buffer.alloc(stat7.size);
78346
78440
  let offset = 0;
78347
78441
  while (offset < bytes.length) {
78348
- const count14 = readSync5(fd2, bytes, offset, bytes.length - offset, offset);
78349
- if (!count14)
78442
+ const count15 = readSync5(fd2, bytes, offset, bytes.length - offset, offset);
78443
+ if (!count15)
78350
78444
  arpFail(`The bundle file ${relative11} changed while it was read.`);
78351
- offset += count14;
78445
+ offset += count15;
78352
78446
  }
78353
78447
  if (readSync5(fd2, Buffer.alloc(1), 0, 1, offset) !== 0)
78354
78448
  arpFail(`The bundle file ${relative11} changed while it was read.`);
@@ -79297,12 +79391,12 @@ function readRegular(label, path2, limit) {
79297
79391
  const bytes = Buffer.alloc(before.size);
79298
79392
  let offset = 0;
79299
79393
  while (offset < bytes.length) {
79300
- const count14 = readSync6(fd2, bytes, offset, bytes.length - offset, offset);
79301
- if (count14 === 0)
79394
+ const count15 = readSync6(fd2, bytes, offset, bytes.length - offset, offset);
79395
+ if (count15 === 0)
79302
79396
  arpFail(
79303
79397
  `${label} ${path2} changed while it was read. Stop its writer and capture again.`
79304
79398
  );
79305
- offset += count14;
79399
+ offset += count15;
79306
79400
  }
79307
79401
  if (readSync6(fd2, Buffer.alloc(1), 0, 1, offset) !== 0)
79308
79402
  arpFail(
@@ -80458,7 +80552,7 @@ var init_package = __esm({
80458
80552
  "package.json"() {
80459
80553
  package_default = {
80460
80554
  name: "@oxagen/cli",
80461
- version: "5.5.1-228",
80555
+ version: "5.5.1-235",
80462
80556
  description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
80463
80557
  type: "module",
80464
80558
  main: "./dist/index.js",
@@ -83369,7 +83463,7 @@ function responseSchema(result2) {
83369
83463
  source: external_exports.enum(["cloud", "local"]),
83370
83464
  enrichment: enrichmentStateSchema,
83371
83465
  indexedAt: external_exports.string().datetime(),
83372
- behindHead: external_exports.record(repoName, count7),
83466
+ behindHead: external_exports.record(repoName, count8),
83373
83467
  budget: budgetReportSchema,
83374
83468
  hint: external_exports.string().min(1).optional(),
83375
83469
  restricted: external_exports.boolean().default(false),
@@ -83379,7 +83473,7 @@ function responseSchema(result2) {
83379
83473
  path: ["revision"]
83380
83474
  });
83381
83475
  }
83382
- var nodeKindSchema, edgeKindSchema, QUERY_TARGET_KINDS, queryTargetKindSchema, QUERY_PSEUDO_TARGETS, DEFAULT_BUDGET, sourceTagSchema, shortSha, unit2, count7, repoName, publicIdSchema, nodeTargetSchema, symbolTargetSchema, diffTargetSchema, pullRequestTargetSchema, targetSchema, atSchema, responseFormatSchema, baseRequestShape, snapshotEntrySchema, steeringSchema, enrichmentStateSchema, budgetReportSchema, excludedSchema, seedSchema, graphItemSchema, ambiguousTargetSchema;
83476
+ var nodeKindSchema, edgeKindSchema, QUERY_TARGET_KINDS, queryTargetKindSchema, QUERY_PSEUDO_TARGETS, DEFAULT_BUDGET, sourceTagSchema, shortSha, unit2, count8, repoName, publicIdSchema, nodeTargetSchema, symbolTargetSchema, diffTargetSchema, pullRequestTargetSchema, targetSchema, atSchema, responseFormatSchema, baseRequestShape, snapshotEntrySchema, steeringSchema, enrichmentStateSchema, budgetReportSchema, excludedSchema, seedSchema, graphItemSchema, ambiguousTargetSchema;
83383
83477
  var init_common = __esm({
83384
83478
  "../../packages/codegraph/src/query/common.ts"() {
83385
83479
  "use strict";
@@ -83414,7 +83508,7 @@ var init_common = __esm({
83414
83508
  sourceTagSchema = external_exports.string().regex(/^[a-z][a-z0-9-]*$/, "a lowercase source tag");
83415
83509
  shortSha = external_exports.string().regex(/^[0-9a-f]{7,64}$/, "a commit hash");
83416
83510
  unit2 = external_exports.number().min(0).max(1);
83417
- count7 = external_exports.number().int().nonnegative();
83511
+ count8 = external_exports.number().int().nonnegative();
83418
83512
  repoName = external_exports.string().min(1);
83419
83513
  publicIdSchema = external_exports.string().regex(PUBLIC_ID_PATTERN, "a public ID is gn_ and 26 base32 characters");
83420
83514
  nodeTargetSchema = external_exports.object({
@@ -83474,8 +83568,8 @@ var init_common = __esm({
83474
83568
  enrichmentStateSchema = external_exports.enum(["pending", "tagged", "complete"]);
83475
83569
  budgetReportSchema = external_exports.object({
83476
83570
  requested: external_exports.number().int().positive(),
83477
- used: count7,
83478
- omitted: external_exports.record(external_exports.string(), count7).default({})
83571
+ used: count8,
83572
+ omitted: external_exports.record(external_exports.string(), count8).default({})
83479
83573
  }).strict();
83480
83574
  excludedSchema = external_exports.record(external_exports.string(), excludedEntrySchema);
83481
83575
  seedSchema = external_exports.object({
@@ -83496,7 +83590,7 @@ var init_common = __esm({
83496
83590
  /** `file:line`. */
83497
83591
  at: external_exports.string().min(1).optional(),
83498
83592
  via: edgeKindSchema.optional(),
83499
- distance: count7.optional(),
83593
+ distance: count8.optional(),
83500
83594
  provenance: provenanceKindSchema.optional(),
83501
83595
  /** What a `RELATES_TO` link means, such as `plans` or `configures`. */
83502
83596
  relation: external_exports.string().min(1).optional(),
@@ -83508,7 +83602,7 @@ var init_common = __esm({
83508
83602
  deleted: external_exports.boolean().optional(),
83509
83603
  why: external_exports.string().optional(),
83510
83604
  signature: external_exports.string().optional(),
83511
- span: external_exports.object({ startLine: count7, endLine: count7 }).strict().optional()
83605
+ span: external_exports.object({ startLine: count8, endLine: count8 }).strict().optional()
83512
83606
  }).strict();
83513
83607
  ambiguousTargetSchema = external_exports.object({
83514
83608
  error: external_exports.literal("ambiguous_target"),
@@ -83522,7 +83616,7 @@ var init_common = __esm({
83522
83616
  function call(name2, request4, result2) {
83523
83617
  return { call: name2, request: request4, result: result2, response: responseSchema(result2) };
83524
83618
  }
83525
- var unit3, count8, names, excluded, withinSchema, testRefSchema, SEARCH_GROUPS, searchHitSchema, SEARCH_MEANING_STATES, searchMeaningStateSchema, searchCodeGraphRequest, searchCodeGraphResult, blastTargetSchema, decisionItemSchema, blastGroupsSchema, getBlastRadiusRequest, getBlastRadiusResult, listUnitTestsRequest, listUnitTestsResult, flowDataSchema, flowNodeSchema, jobStepSchema, getExecutionFlowRequest, getExecutionFlowResult, traceSpecRequest, traceSpecResult, listGoverningDecisionsBase, listGoverningDecisionsRequest, listGoverningDecisionsResult, getEnvVarsRequest, getEnvVarsResult, connectionSchema, getInfraRequest, getInfraResult, listCiJobsRequest, listCiJobsResult, scriptEffectSchema, listScriptsRequest, listScriptsResult, getApiDocsRequest, getApiDocsResult, exportOpenapiDraftRequest, exportOpenapiDraftResult, listCoChangesRequest, listCoChangesResult, rankSymbolsRequest, rankSymbolsResult, getMeaningMapRequest, getMeaningMapResult, getRepoMapRequest, getRepoMapResult, getDomainBriefRequest, getDomainBriefResult, checkChangeRequest, checkChangeResult, findDefinitionRequest, findDefinitionResult, findReferencesRequest, findReferencesResult, findImplementationsRequest, findImplementationsResult, listNeighborsRequest, listNeighborsResult, failureRefSchema, FAILURE_KINDS, failureSchema2, DATAFLOW_EDGE_KINDS, SLICE_DIRECTIONS, SLICE_ROLES, SLICE_MAX_DEPTH, SLICE_MAX_CALL_DEPTH, SLICE_DEFAULT_CALL_DEPTH, sliceStepSchema, dataflowSliceBase, getDataflowSliceRequest, dataflowLayerKey, missingLayerSchema, getDataflowSliceResult, FAULT_SIGNALS, LOCALIZE_MAX_SUSPECTS, signalEvidenceSchema, suspectSchema, localizeFaultBase, localizeFaultRequest, localizeFaultResult, INTENT_EVIDENCE_KINDS, intentEvidenceSchema, getIntendedBehaviorRequest, getIntendedBehaviorResult, REPAIR_CONTEXT_SECTIONS, REPAIR_CONTEXT_DEFAULT_BUDGET, REPAIR_CONTEXT_MAX_BUDGET, repairContextSectionSchema, repairContextBase, getRepairContextRequest, getRepairContextResult, CODEGRAPH_CALLS;
83619
+ var unit3, count9, names, excluded, withinSchema, testRefSchema, SEARCH_GROUPS, searchHitSchema, SEARCH_MEANING_STATES, searchMeaningStateSchema, searchCodeGraphRequest, searchCodeGraphResult, blastTargetSchema, decisionItemSchema, blastGroupsSchema, getBlastRadiusRequest, getBlastRadiusResult, listUnitTestsRequest, listUnitTestsResult, flowDataSchema, flowNodeSchema, jobStepSchema, getExecutionFlowRequest, getExecutionFlowResult, traceSpecRequest, traceSpecResult, listGoverningDecisionsBase, listGoverningDecisionsRequest, listGoverningDecisionsResult, getEnvVarsRequest, getEnvVarsResult, connectionSchema, getInfraRequest, getInfraResult, listCiJobsRequest, listCiJobsResult, scriptEffectSchema, listScriptsRequest, listScriptsResult, getApiDocsRequest, getApiDocsResult, exportOpenapiDraftRequest, exportOpenapiDraftResult, listCoChangesRequest, listCoChangesResult, rankSymbolsRequest, rankSymbolsResult, getMeaningMapRequest, getMeaningMapResult, getRepoMapRequest, getRepoMapResult, getDomainBriefRequest, getDomainBriefResult, checkChangeRequest, checkChangeResult, findDefinitionRequest, findDefinitionResult, findReferencesRequest, findReferencesResult, findImplementationsRequest, findImplementationsResult, listNeighborsRequest, listNeighborsResult, failureRefSchema, FAILURE_KINDS, failureSchema2, DATAFLOW_EDGE_KINDS, SLICE_DIRECTIONS, SLICE_ROLES, SLICE_MAX_DEPTH, SLICE_MAX_CALL_DEPTH, SLICE_DEFAULT_CALL_DEPTH, sliceStepSchema, dataflowSliceBase, getDataflowSliceRequest, dataflowLayerKey, missingLayerSchema, getDataflowSliceResult, FAULT_SIGNALS, LOCALIZE_MAX_SUSPECTS, signalEvidenceSchema, suspectSchema, localizeFaultBase, localizeFaultRequest, localizeFaultResult, INTENT_EVIDENCE_KINDS, intentEvidenceSchema, getIntendedBehaviorRequest, getIntendedBehaviorResult, REPAIR_CONTEXT_SECTIONS, REPAIR_CONTEXT_DEFAULT_BUDGET, REPAIR_CONTEXT_MIN_BUDGET, REPAIR_CONTEXT_MAX_BUDGET, REPAIR_CONTEXT_MAX_FIX_RANGES, REPAIR_CONTEXT_MAX_FIX_SPAN, repairContextSectionSchema, fixLinesSchema, repairContextBase, getRepairContextRequest, repairContextCutSchema, repairContextTrimmedSchema, missingSourceSchema, getRepairContextResult, CODEGRAPH_CALLS;
83526
83620
  var init_calls = __esm({
83527
83621
  "../../packages/codegraph/src/query/calls.ts"() {
83528
83622
  "use strict";
@@ -83531,7 +83625,7 @@ var init_calls = __esm({
83531
83625
  init_status2();
83532
83626
  init_common();
83533
83627
  unit3 = external_exports.number().min(0).max(1);
83534
- count8 = external_exports.number().int().nonnegative();
83628
+ count9 = external_exports.number().int().nonnegative();
83535
83629
  names = external_exports.array(external_exports.string().min(1));
83536
83630
  excluded = excludedSchema.default({});
83537
83631
  withinSchema = external_exports.object({
@@ -83661,7 +83755,7 @@ var init_calls = __esm({
83661
83755
  getBlastRadiusResult = external_exports.object({
83662
83756
  target: blastTargetSchema,
83663
83757
  seeds: external_exports.array(seedSchema).min(1),
83664
- summary: external_exports.record(external_exports.string(), count8),
83758
+ summary: external_exports.record(external_exports.string(), count9),
83665
83759
  excluded,
83666
83760
  groups: blastGroupsSchema
83667
83761
  }).strict();
@@ -83678,8 +83772,8 @@ var init_calls = __esm({
83678
83772
  external_exports.object({
83679
83773
  name: external_exports.string().min(1),
83680
83774
  source: external_exports.enum(["coverage", "static", "runtime"]),
83681
- linesHit: count8.optional(),
83682
- durationMs: count8.optional(),
83775
+ linesHit: count9.optional(),
83776
+ durationMs: count9.optional(),
83683
83777
  confidence: unit3.optional(),
83684
83778
  run: external_exports.string().min(1).optional()
83685
83779
  }).strict()
@@ -83695,7 +83789,7 @@ var init_calls = __esm({
83695
83789
  symbol: external_exports.string().min(1).optional(),
83696
83790
  at: external_exports.string().min(1).optional(),
83697
83791
  observed: external_exports.boolean().optional(),
83698
- count: count8.optional(),
83792
+ count: count9.optional(),
83699
83793
  share: external_exports.number().gt(0).lte(1).optional(),
83700
83794
  data: flowDataSchema.optional(),
83701
83795
  context: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.boolean()])).optional(),
@@ -83734,7 +83828,7 @@ var init_calls = __esm({
83734
83828
  flow: flowNodeSchema.optional(),
83735
83829
  jobs: external_exports.array(jobStepSchema).optional(),
83736
83830
  shared: external_exports.record(external_exports.string(), flowNodeSchema).default({}),
83737
- omitted: external_exports.object({ branches: count8, reason: external_exports.string().min(1) }).strict().optional(),
83831
+ omitted: external_exports.object({ branches: count9, reason: external_exports.string().min(1) }).strict().optional(),
83738
83832
  excluded
83739
83833
  }).strict().refine((r) => r.flow !== void 0 || r.jobs !== void 0, {
83740
83834
  message: "a flow answer holds a call tree or a job order"
@@ -83863,9 +83957,9 @@ var init_calls = __esm({
83863
83957
  // The job's own runs summed up, as the CI index stored them on the
83864
83958
  // job (#8010). Absent when the host read no runs of it.
83865
83959
  history: external_exports.object({
83866
- runs: count8,
83867
- passed: count8,
83868
- failed: count8,
83960
+ runs: count9,
83961
+ passed: count9,
83962
+ failed: count9,
83869
83963
  passRate: unit3,
83870
83964
  /** The job both failed and passed on one commit. */
83871
83965
  flaky: external_exports.boolean(),
@@ -83876,14 +83970,14 @@ var init_calls = __esm({
83876
83970
  }).strict()
83877
83971
  ),
83878
83972
  runHistory: external_exports.object({
83879
- runs: count8,
83973
+ runs: count9,
83880
83974
  passRate: unit3,
83881
83975
  medianMinutes: external_exports.number().nonnegative(),
83882
83976
  flakyJobs: names,
83883
83977
  // The figures the CI index stores beside those (#8010). Each is
83884
83978
  // absent when the stored history has none.
83885
- passed: count8.optional(),
83886
- failed: count8.optional(),
83979
+ passed: count9.optional(),
83980
+ failed: count9.optional(),
83887
83981
  /** The 90th percentile run time. */
83888
83982
  p90Minutes: external_exports.number().nonnegative().optional(),
83889
83983
  /** The median time a run waited for a runner. */
@@ -83941,7 +84035,7 @@ var init_calls = __esm({
83941
84035
  });
83942
84036
  exportOpenapiDraftResult = external_exports.object({
83943
84037
  format: external_exports.literal("openapi-3.1"),
83944
- operations: count8,
84038
+ operations: count9,
83945
84039
  document: external_exports.record(external_exports.string(), external_exports.unknown()),
83946
84040
  excluded
83947
84041
  }).strict();
@@ -83966,17 +84060,17 @@ var init_calls = __esm({
83966
84060
  /** The embedding space the map was drawn in, or null with no map. */
83967
84061
  space: external_exports.string().min(1).nullable(),
83968
84062
  /** How many symbols the map places in scope, before the budget cut. */
83969
- placed: count8,
84063
+ placed: count9,
83970
84064
  /** How many folders those symbols sit in, before the budget cut. */
83971
- modules: count8,
84065
+ modules: count9,
83972
84066
  /**
83973
84067
  * How many of them are bridges between two listed groups, before the
83974
84068
  * budget cut. A bridge whose second group is not listed keeps its role
83975
84069
  * and is not counted.
83976
84070
  */
83977
- bridges: count8,
84071
+ bridges: count9,
83978
84072
  /** How many of them are outliers, before the budget cut. */
83979
- outliers: count8,
84073
+ outliers: count9,
83980
84074
  /**
83981
84075
  * The listed symbols, in turns: one symbol from each group, the most
83982
84076
  * typical first, then one bridge, the narrowest margin first, then one
@@ -83990,11 +84084,11 @@ var init_calls = __esm({
83990
84084
  x: external_exports.number(),
83991
84085
  y: external_exports.number(),
83992
84086
  /** The index of its group in `clusters`. */
83993
- cluster: count8,
84087
+ cluster: count9,
83994
84088
  /** Its cosine similarity to its group's center. */
83995
84089
  similarity: external_exports.number().min(-1).max(1),
83996
84090
  /** The nearest other group, by its index. */
83997
- next: count8.optional(),
84091
+ next: count9.optional(),
83998
84092
  /** Its cosine similarity to that group's center. */
83999
84093
  nextSimilarity: external_exports.number().min(-1).max(1).optional(),
84000
84094
  /**
@@ -84004,7 +84098,7 @@ var init_calls = __esm({
84004
84098
  */
84005
84099
  role: external_exports.enum(["bridge", "outlier"]).optional(),
84006
84100
  /** How many places call, import or reference it in its repo. */
84007
- fanIn: count8
84101
+ fanIn: count9
84008
84102
  }).strict()
84009
84103
  ),
84010
84104
  /** Each group with a member in scope, largest first across the workspace. */
@@ -84013,9 +84107,9 @@ var init_calls = __esm({
84013
84107
  /** Counted from its members' names. Null when the answer is restricted. */
84014
84108
  name: external_exports.string().min(1).nullable(),
84015
84109
  /** How many listed symbols are in it, after the budget cut. */
84016
- size: count8,
84110
+ size: count9,
84017
84111
  /** How many of its symbols are in scope, before the budget cut. */
84018
- placed: count8,
84112
+ placed: count9,
84019
84113
  /** Their mean similarity to its center, before the budget cut. */
84020
84114
  mean: external_exports.number().min(-1).max(1),
84021
84115
  /** Its center's cosine similarity to every listed center, in order. */
@@ -84035,7 +84129,7 @@ var init_calls = __esm({
84035
84129
  external_exports.object({
84036
84130
  name: external_exports.string().min(1),
84037
84131
  signature: external_exports.string().optional(),
84038
- line: count8.optional()
84132
+ line: count9.optional()
84039
84133
  }).strict()
84040
84134
  )
84041
84135
  }).strict()
@@ -84070,7 +84164,7 @@ var init_calls = __esm({
84070
84164
  scripts: external_exports.array(
84071
84165
  external_exports.object({ name: external_exports.string().min(1), effect: external_exports.string().min(1) }).strict()
84072
84166
  ),
84073
- blastRadius: external_exports.object({ summary: external_exports.record(external_exports.string(), count8) }).strict(),
84167
+ blastRadius: external_exports.object({ summary: external_exports.record(external_exports.string(), count9) }).strict(),
84074
84168
  tests: external_exports.array(testRefSchema),
84075
84169
  findings: external_exports.array(
84076
84170
  external_exports.object({ rule: external_exports.string().min(1), at: external_exports.string().min(1) }).strict()
@@ -84141,11 +84235,11 @@ var init_calls = __esm({
84141
84235
  SLICE_MAX_CALL_DEPTH = 10;
84142
84236
  SLICE_DEFAULT_CALL_DEPTH = 3;
84143
84237
  sliceStepSchema = external_exports.object({
84144
- order: count8,
84238
+ order: count9,
84145
84239
  role: external_exports.enum(SLICE_ROLES),
84146
84240
  file: external_exports.string().min(1),
84147
84241
  repo: external_exports.string().min(1).optional(),
84148
- span: external_exports.object({ startLine: count8, endLine: count8 }).strict(),
84242
+ span: external_exports.object({ startLine: count9, endLine: count9 }).strict(),
84149
84243
  /** The statement's text. With `responseFormat: "detailed"` only. */
84150
84244
  text: external_exports.string().optional(),
84151
84245
  /** The function the statement sits in, and its stable id. */
@@ -84153,7 +84247,7 @@ var init_calls = __esm({
84153
84247
  symbolId: external_exports.string().min(1).optional(),
84154
84248
  /** The edge the step was reached over, and the order of the step before it. */
84155
84249
  via: external_exports.enum(DATAFLOW_EDGE_KINDS).optional(),
84156
- from: count8.optional(),
84250
+ from: count9.optional(),
84157
84251
  provenance: provenanceKindSchema.optional(),
84158
84252
  confidence: unit3
84159
84253
  }).strict();
@@ -84247,7 +84341,7 @@ var init_calls = __esm({
84247
84341
  repo: external_exports.string().min(1).optional(),
84248
84342
  at: external_exports.string().min(1).optional(),
84249
84343
  /** The suspect lines inside the symbol or file. */
84250
- lines: external_exports.array(external_exports.object({ startLine: count8, endLine: count8 }).strict()).optional(),
84344
+ lines: external_exports.array(external_exports.object({ startLine: count9, endLine: count9 }).strict()).optional(),
84251
84345
  /** The fused score the ranking orders by. */
84252
84346
  score: external_exports.number().nonnegative(),
84253
84347
  signals: external_exports.array(signalEvidenceSchema).min(1)
@@ -84338,32 +84432,78 @@ var init_calls = __esm({
84338
84432
  "environment"
84339
84433
  ];
84340
84434
  REPAIR_CONTEXT_DEFAULT_BUDGET = 8e3;
84435
+ REPAIR_CONTEXT_MIN_BUDGET = 2e3;
84341
84436
  REPAIR_CONTEXT_MAX_BUDGET = 16e3;
84437
+ REPAIR_CONTEXT_MAX_FIX_RANGES = 500;
84438
+ REPAIR_CONTEXT_MAX_FIX_SPAN = 1e4;
84342
84439
  repairContextSectionSchema = external_exports.object({
84343
84440
  name: external_exports.enum(REPAIR_CONTEXT_SECTIONS),
84344
- tokens: count8,
84441
+ tokens: count9,
84345
84442
  /** The section as it goes to a model. */
84346
84443
  text: external_exports.string(),
84347
84444
  /** The nodes the text cites. */
84348
84445
  cites: external_exports.array(graphItemSchema).default([])
84349
84446
  }).strict();
84447
+ fixLinesSchema = external_exports.object({
84448
+ repo: external_exports.string().min(1).optional(),
84449
+ file: external_exports.string().min(1),
84450
+ startLine: external_exports.number().int().positive(),
84451
+ endLine: external_exports.number().int().positive()
84452
+ }).strict().refine((l) => l.endLine >= l.startLine, {
84453
+ message: "endLine is at or after startLine"
84454
+ }).refine((l) => l.endLine - l.startLine < REPAIR_CONTEXT_MAX_FIX_SPAN, {
84455
+ message: `a range spans at most ${REPAIR_CONTEXT_MAX_FIX_SPAN} lines`
84456
+ });
84350
84457
  repairContextBase = requestSchema({
84351
84458
  /** The suspects to pack, as localize_fault ranked them. */
84352
84459
  suspects: external_exports.array(nodeTargetSchema).min(1).max(20).optional(),
84353
84460
  /** Or the failure, whose top suspects are packed. */
84354
84461
  failure: failureRefSchema.optional(),
84355
84462
  sections: external_exports.array(external_exports.enum(REPAIR_CONTEXT_SECTIONS)).min(1).optional(),
84356
- budget: external_exports.number().int().positive().max(REPAIR_CONTEXT_MAX_BUDGET).default(REPAIR_CONTEXT_DEFAULT_BUDGET)
84463
+ budget: external_exports.number().int().min(REPAIR_CONTEXT_MIN_BUDGET).max(REPAIR_CONTEXT_MAX_BUDGET).default(REPAIR_CONTEXT_DEFAULT_BUDGET),
84464
+ /**
84465
+ * The lines a fix touched, when the caller already knows the fix, as a
84466
+ * replay does. The answer then reports `coverageAtBudget`.
84467
+ */
84468
+ fixLines: external_exports.array(fixLinesSchema).min(1).max(REPAIR_CONTEXT_MAX_FIX_RANGES).optional()
84357
84469
  });
84358
84470
  getRepairContextRequest = repairContextBase.refine(
84359
84471
  (r) => r.suspects !== void 0 || r.failure !== void 0,
84360
84472
  { message: "pass suspects or a failure" }
84361
84473
  );
84474
+ repairContextCutSchema = external_exports.object({
84475
+ section: external_exports.enum(REPAIR_CONTEXT_SECTIONS),
84476
+ /** The suspect or test the piece is about. */
84477
+ name: external_exports.string().min(1),
84478
+ /** What the piece would have cost. */
84479
+ tokens: count9
84480
+ }).strict();
84481
+ repairContextTrimmedSchema = external_exports.object({
84482
+ section: external_exports.enum(REPAIR_CONTEXT_SECTIONS),
84483
+ name: external_exports.string().min(1),
84484
+ shownLines: count9,
84485
+ totalLines: count9
84486
+ }).strict();
84487
+ missingSourceSchema = external_exports.object({
84488
+ repo: external_exports.string().min(1),
84489
+ file: external_exports.string().min(1),
84490
+ contentHash: external_exports.string().min(1).optional()
84491
+ }).strict();
84362
84492
  getRepairContextResult = external_exports.object({
84363
84493
  failure: failureSchema2.optional(),
84494
+ /** The suspects packed, ranked from 1. */
84495
+ suspects: external_exports.array(graphItemSchema.extend({ rank: external_exports.number().int().positive() })).default([]),
84364
84496
  sections: external_exports.array(repairContextSectionSchema),
84365
- /** On a replay: the share of the fix's lines inside the bundle. */
84497
+ /** Each piece the budget cut, the first 30 by rank; `budget.omitted` counts them all by section. */
84498
+ cut: external_exports.array(repairContextCutSchema).default([]),
84499
+ /** Each suspect whose code went out in its short form. */
84500
+ trimmed: external_exports.array(repairContextTrimmedSchema).default([]),
84501
+ /** With `fixLines`: the share of the fix's lines inside the bundle. */
84366
84502
  coverageAtBudget: unit3.optional(),
84503
+ /** Files the bundle wanted the code of. The handler reads them from the host and asks again. */
84504
+ missingSources: external_exports.array(missingSourceSchema).optional(),
84505
+ /** Def-use layers the failure's slice wanted and no host has built yet. */
84506
+ missingLayers: external_exports.array(missingLayerSchema).optional(),
84367
84507
  excluded
84368
84508
  }).strict();
84369
84509
  CODEGRAPH_CALLS = {
@@ -84766,7 +84906,7 @@ function charsetTable(spec) {
84766
84906
  for (const c of parseCharset(spec)) table[c] = 1;
84767
84907
  return table;
84768
84908
  }
84769
- var isAscii, isLower, id, text4, lowerText, charset, count9, blockRuleSchema, tokenRuleSchema, assignmentRuleSchema, lowerList, skipListSchema, secretPatternsSchema;
84909
+ var isAscii, isLower, id, text4, lowerText, charset, count10, blockRuleSchema, tokenRuleSchema, assignmentRuleSchema, lowerList, skipListSchema, secretPatternsSchema;
84770
84910
  var init_schema3 = __esm({
84771
84911
  "../../packages/codegraph/src/secrets/schema.ts"() {
84772
84912
  "use strict";
@@ -84783,7 +84923,7 @@ var init_schema3 = __esm({
84783
84923
  ctx2.addIssue({ code: external_exports.ZodIssueCode.custom, message: String(error2) });
84784
84924
  }
84785
84925
  });
84786
- count9 = external_exports.number().int().min(1);
84926
+ count10 = external_exports.number().int().min(1);
84787
84927
  blockRuleSchema = external_exports.object({
84788
84928
  id,
84789
84929
  begin: text4,
@@ -84792,21 +84932,21 @@ var init_schema3 = __esm({
84792
84932
  labelChars: charset,
84793
84933
  labelSuffixes: external_exports.array(text4).min(1),
84794
84934
  truncatedChars: charset,
84795
- truncatedMin: count9
84935
+ truncatedMin: count10
84796
84936
  }).strict();
84797
84937
  tokenRuleSchema = external_exports.object({
84798
84938
  id,
84799
84939
  prefixes: external_exports.array(text4).min(1),
84800
84940
  chars: charset,
84801
84941
  boundary: charset,
84802
- min: count9,
84803
- max: count9.optional(),
84942
+ min: count10,
84943
+ max: count10.optional(),
84804
84944
  requireDigit: external_exports.boolean().optional(),
84805
84945
  keepPrefix: external_exports.boolean().optional(),
84806
84946
  segments: external_exports.object({
84807
84947
  separator: external_exports.string().length(1).refine(isAscii, "must be ASCII"),
84808
84948
  count: external_exports.number().int().min(2),
84809
- min: count9
84949
+ min: count10
84810
84950
  }).strict().optional()
84811
84951
  }).strict().refine((r) => r.max === void 0 || r.max >= r.min, "max is below min");
84812
84952
  assignmentRuleSchema = external_exports.object({
@@ -84814,7 +84954,7 @@ var init_schema3 = __esm({
84814
84954
  names: external_exports.array(text4.refine((s2) => s2 === s2.toUpperCase(), "must be upper case")).min(1),
84815
84955
  nameChars: charset,
84816
84956
  valueChars: charset,
84817
- minLength: count9,
84957
+ minLength: count10,
84818
84958
  minEntropy: external_exports.number().min(0).max(8),
84819
84959
  placeholders: external_exports.array(lowerText)
84820
84960
  }).strict();
@@ -86019,8 +86159,8 @@ var require_Node = __commonJS({
86019
86159
  };
86020
86160
  const res = toJS.toJS(this, "", ctx2);
86021
86161
  if (typeof onAnchor === "function")
86022
- for (const { count: count14, res: res2 } of ctx2.anchors.values())
86023
- onAnchor(res2, count14);
86162
+ for (const { count: count15, res: res2 } of ctx2.anchors.values())
86163
+ onAnchor(res2, count15);
86024
86164
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
86025
86165
  }
86026
86166
  };
@@ -86128,13 +86268,13 @@ var require_Alias = __commonJS({
86128
86268
  const anchor2 = anchors2 && source && anchors2.get(source);
86129
86269
  return anchor2 ? anchor2.count * anchor2.aliasCount : 0;
86130
86270
  } else if (identity.isCollection(node3)) {
86131
- let count14 = 0;
86271
+ let count15 = 0;
86132
86272
  for (const item of node3.items) {
86133
86273
  const c = getAliasCount(doc, item, anchors2);
86134
- if (c > count14)
86135
- count14 = c;
86274
+ if (c > count15)
86275
+ count15 = c;
86136
86276
  }
86137
- return count14;
86277
+ return count15;
86138
86278
  } else if (identity.isPair(node3)) {
86139
86279
  const kc = getAliasCount(doc, node3.key, anchors2);
86140
86280
  const vc = getAliasCount(doc, node3.value, anchors2);
@@ -89087,8 +89227,8 @@ var require_Document = __commonJS({
89087
89227
  };
89088
89228
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx2);
89089
89229
  if (typeof onAnchor === "function")
89090
- for (const { count: count14, res: res2 } of ctx2.anchors.values())
89091
- onAnchor(res2, count14);
89230
+ for (const { count: count15, res: res2 } of ctx2.anchors.values())
89231
+ onAnchor(res2, count15);
89092
89232
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
89093
89233
  }
89094
89234
  /**
@@ -89165,12 +89305,12 @@ var require_errors = __commonJS({
89165
89305
  lineStr = prev + lineStr;
89166
89306
  }
89167
89307
  if (/[^ ]/.test(lineStr)) {
89168
- let count14 = 1;
89308
+ let count15 = 1;
89169
89309
  const end = error2.linePos[1];
89170
89310
  if (end?.line === line && end.col > col) {
89171
- count14 = Math.max(1, Math.min(end.col - col, 80 - ci));
89311
+ count15 = Math.max(1, Math.min(end.col - col, 80 - ci));
89172
89312
  }
89173
- const pointer = " ".repeat(ci) + "^".repeat(count14);
89313
+ const pointer = " ".repeat(ci) + "^".repeat(count15);
89174
89314
  error2.message += `:
89175
89315
 
89176
89316
  ${lineStr}
@@ -97338,7 +97478,7 @@ function wrappedFrameOf(event, bytesRef, serverCut = null) {
97338
97478
  const content = asRecord2(event["content"]);
97339
97479
  const turn = asRecord2(event["turn"]);
97340
97480
  const text6 = (value) => typeof value === "string" ? value : "";
97341
- const count14 = (value) => typeof value === "number" ? value : null;
97481
+ const count15 = (value) => typeof value === "number" ? value : null;
97342
97482
  return {
97343
97483
  event_id: event["event_id"] ?? null,
97344
97484
  seq: event["seq"] ?? null,
@@ -97369,8 +97509,8 @@ function wrappedFrameOf(event, bytesRef, serverCut = null) {
97369
97509
  model: text6(body2["model"]),
97370
97510
  provider: text6(body2["provider"]),
97371
97511
  policy_decision: text6(body2["policy_decision"]),
97372
- cost_usd_micros: count14(body2["cost_usd_micros"]),
97373
- turn_seq: count14(turn?.["turn_seq"]),
97512
+ cost_usd_micros: count15(body2["cost_usd_micros"]),
97513
+ turn_seq: count15(turn?.["turn_seq"]),
97374
97514
  event
97375
97515
  };
97376
97516
  }
@@ -97378,14 +97518,14 @@ function asRecord2(value) {
97378
97518
  return isRecord(value) ? value : null;
97379
97519
  }
97380
97520
  function tally(counts2) {
97381
- return [...counts2.entries()].map(([kind, { count: count14, frames }]) => ({ kind, count: count14, frames })).sort((a, b3) => a.kind.localeCompare(b3.kind));
97521
+ return [...counts2.entries()].map(([kind, { count: count15, frames }]) => ({ kind, count: count15, frames })).sort((a, b3) => a.kind.localeCompare(b3.kind));
97382
97522
  }
97383
97523
  function summarizeRunExportRedactions(envelopes) {
97384
97524
  const redacted2 = /* @__PURE__ */ new Map();
97385
97525
  const withheld = /* @__PURE__ */ new Map();
97386
- const bump = (map2, kind, count14) => {
97526
+ const bump = (map2, kind, count15) => {
97387
97527
  const entry2 = map2.get(kind) ?? { count: 0, frames: 0 };
97388
- entry2.count += count14;
97528
+ entry2.count += count15;
97389
97529
  entry2.frames += 1;
97390
97530
  map2.set(kind, entry2);
97391
97531
  };
@@ -97402,9 +97542,9 @@ function summarizeRunExportRedactions(envelopes) {
97402
97542
  const kind = typeof reason3 === "string" ? reason3 : "unknown";
97403
97543
  perReason.set(kind, (perReason.get(kind) ?? 0) + 1);
97404
97544
  }
97405
- for (const [kind, count14] of perReason) {
97406
- bump(redacted2, kind, count14);
97407
- total2 += count14;
97545
+ for (const [kind, count15] of perReason) {
97546
+ bump(redacted2, kind, count15);
97547
+ total2 += count15;
97408
97548
  }
97409
97549
  }
97410
97550
  if (typeof content?.["bytes_ref"] === "string") {
@@ -97990,8 +98130,8 @@ function printable2(text6) {
97990
98130
  }
97991
98131
  return out;
97992
98132
  }
97993
- function plural(count14, one, many) {
97994
- return `${count14} ${count14 === 1 ? one : many}`;
98133
+ function plural(count15, one, many) {
98134
+ return `${count15} ${count15 === 1 ? one : many}`;
97995
98135
  }
97996
98136
  function formatClaimVerification(result2) {
97997
98137
  const lines = ["Frames"];
@@ -98205,15 +98345,15 @@ var init_cbor = __esm({
98205
98345
  this.take(this.length(info))
98206
98346
  );
98207
98347
  case 4: {
98208
- const count14 = this.length(info);
98348
+ const count15 = this.length(info);
98209
98349
  const out = [];
98210
- for (let i2 = 0; i2 < count14; i2 += 1) out.push(this.item(depth + 1));
98350
+ for (let i2 = 0; i2 < count15; i2 += 1) out.push(this.item(depth + 1));
98211
98351
  return out;
98212
98352
  }
98213
98353
  case 5: {
98214
- const count14 = this.length(info);
98354
+ const count15 = this.length(info);
98215
98355
  const out = /* @__PURE__ */ new Map();
98216
- for (let i2 = 0; i2 < count14; i2 += 1) {
98356
+ for (let i2 = 0; i2 < count15; i2 += 1) {
98217
98357
  const key = this.item(depth + 1);
98218
98358
  if (typeof key !== "number" && typeof key !== "string") {
98219
98359
  throw new CborError("a CBOR map key is not an integer or text");
@@ -98629,17 +98769,17 @@ function parseAt(bytes, start, depth) {
98629
98769
  at2 += 1;
98630
98770
  let length = first;
98631
98771
  if (first & 128) {
98632
- const count14 = first & 127;
98633
- if (count14 === 0 || count14 > 4)
98772
+ const count15 = first & 127;
98773
+ if (count15 === 0 || count15 > 4)
98634
98774
  throw new DerError("DER length is not definite");
98635
98775
  length = 0;
98636
- for (let i2 = 0; i2 < count14; i2 += 1) {
98776
+ for (let i2 = 0; i2 < count15; i2 += 1) {
98637
98777
  const b3 = bytes[at2];
98638
98778
  if (b3 === void 0) throw new DerError("DER ends early");
98639
98779
  length = length * 256 + b3;
98640
98780
  at2 += 1;
98641
98781
  }
98642
- if (length < 128 || count14 > 1 && length < 256 ** (count14 - 1)) {
98782
+ if (length < 128 || count15 > 1 && length < 256 ** (count15 - 1)) {
98643
98783
  throw new DerError("DER length is not in its shortest form");
98644
98784
  }
98645
98785
  }
@@ -101829,8 +101969,8 @@ async function defaultEnroll(opts, writer) {
101829
101969
  return result2.ok && result2.shipping?.healthy !== false;
101830
101970
  }
101831
101971
  async function defaultConfirm(question) {
101832
- const { createInterface: createInterface5 } = await import("node:readline/promises");
101833
- const rl = createInterface5({ input: process.stdin, output: process.stdout });
101972
+ const { createInterface: createInterface6 } = await import("node:readline/promises");
101973
+ const rl = createInterface6({ input: process.stdin, output: process.stdout });
101834
101974
  try {
101835
101975
  const answer = await rl.question(`${question} [y/N] `);
101836
101976
  return /^y(es)?$/i.test(answer.trim());
@@ -102296,16 +102436,16 @@ ${question}
102296
102436
  }
102297
102437
  return items[choiceIndex];
102298
102438
  }
102299
- function parseMultiSelection(raw, count14, defaults) {
102439
+ function parseMultiSelection(raw, count15, defaults) {
102300
102440
  const answer = raw.trim().toLowerCase();
102301
102441
  if (answer === "") return [...defaults];
102302
- if (answer === "all") return Array.from({ length: count14 }, (_, i2) => i2);
102442
+ if (answer === "all") return Array.from({ length: count15 }, (_, i2) => i2);
102303
102443
  if (answer === "none") return [];
102304
102444
  const chosen = /* @__PURE__ */ new Set();
102305
102445
  for (const word2 of answer.split(/[\s,]+/).filter((w) => w !== "")) {
102306
102446
  if (!/^\d+$/.test(word2)) return null;
102307
102447
  const n2 = parseInt(word2, 10);
102308
- if (n2 < 1 || n2 > count14) return null;
102448
+ if (n2 < 1 || n2 > count15) return null;
102309
102449
  chosen.add(n2 - 1);
102310
102450
  }
102311
102451
  return [...chosen].sort((a, b3) => a - b3);
@@ -106705,8 +106845,8 @@ function formatDollars(micros2) {
106705
106845
  const minus = value < 0n && cents > 0n ? "-" : "";
106706
106846
  return `${minus}$${String(cents / 100n)}.${frac}`;
106707
106847
  }
106708
- function formatCount(count14) {
106709
- return Number.isInteger(count14) ? String(count14) : count14.toFixed(1);
106848
+ function formatCount(count15) {
106849
+ return Number.isInteger(count15) ? String(count15) : count15.toFixed(1);
106710
106850
  }
106711
106851
  function nameOf(group) {
106712
106852
  const { name: name2, number: itemNumber } = group.display;
@@ -106724,8 +106864,8 @@ function wordOf(dimension) {
106724
106864
  function lastDay(end) {
106725
106865
  return new Date(Date.parse(end) - 1).toISOString().slice(0, 10);
106726
106866
  }
106727
- function plural2(count14, noun) {
106728
- return `${formatCount(count14)} ${noun}${count14 === 1 ? "" : "s"}`;
106867
+ function plural2(count15, noun) {
106868
+ return `${formatCount(count15)} ${noun}${count15 === 1 ? "" : "s"}`;
106729
106869
  }
106730
106870
  function render(result2, writer) {
106731
106871
  const { groupBy, crossBy, range, compared: compared2, total: total2 } = result2;
@@ -106885,14 +107025,14 @@ var init_spend_export2 = __esm({
106885
107025
  });
106886
107026
 
106887
107027
  // ../../packages/oxagen/src/contracts/status-report.shared.ts
106888
- var micros, count10, day, lookSchema2, statusValueDisplaySchema, valueSchema, ranked, statusReportAboutSchema, STATUS_NOTABLE_KINDS, statusReportFactsSchema;
107028
+ var micros, count11, day, lookSchema2, statusValueDisplaySchema, valueSchema, ranked, statusReportAboutSchema, STATUS_NOTABLE_KINDS, statusReportFactsSchema;
106889
107029
  var init_status_report_shared = __esm({
106890
107030
  "../../packages/oxagen/src/contracts/status-report.shared.ts"() {
106891
107031
  "use strict";
106892
107032
  init_zod();
106893
107033
  init_spend_attribution_shared();
106894
107034
  micros = external_exports.string().regex(/^\d+$/);
106895
- count10 = external_exports.number().finite().nonnegative();
107035
+ count11 = external_exports.number().finite().nonnegative();
106896
107036
  day = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/);
106897
107037
  lookSchema2 = external_exports.object({ icon: external_exports.string(), color: external_exports.string(), variant: external_exports.string() }).strict();
106898
107038
  statusValueDisplaySchema = external_exports.object({
@@ -106915,8 +107055,8 @@ var init_status_report_shared = __esm({
106915
107055
  name: external_exports.string(),
106916
107056
  display: statusValueDisplaySchema.optional(),
106917
107057
  spendMicros: micros,
106918
- items: count10,
106919
- runs: count10
107058
+ items: count11,
107059
+ runs: count11
106920
107060
  }).strict();
106921
107061
  statusReportAboutSchema = external_exports.object({
106922
107062
  scope: external_exports.discriminatedUnion("kind", [
@@ -106950,18 +107090,18 @@ var init_status_report_shared = __esm({
106950
107090
  statusReportFactsSchema = external_exports.object({
106951
107091
  version: external_exports.literal("status-report-facts/v1"),
106952
107092
  about: statusReportAboutSchema.optional(),
106953
- items: external_exports.object({ opened: count10, closed: count10 }).strict(),
107093
+ items: external_exports.object({ opened: count11, closed: count11 }).strict(),
106954
107094
  runs: external_exports.object({
106955
- started: count10,
106956
- merged: count10,
106957
- failed: count10,
106958
- abandoned: count10,
106959
- running: count10
107095
+ started: count11,
107096
+ merged: count11,
107097
+ failed: count11,
107098
+ abandoned: count11,
107099
+ running: count11
106960
107100
  }).strict(),
106961
107101
  spend: external_exports.object({
106962
107102
  micros,
106963
107103
  wastedMicros: micros,
106964
- estimatedRuns: count10,
107104
+ estimatedRuns: count11,
106965
107105
  comparedMicros: micros.nullable().optional(),
106966
107106
  comparedWastedMicros: micros.nullable().optional()
106967
107107
  }).strict(),
@@ -106981,7 +107121,7 @@ var init_status_report_shared = __esm({
106981
107121
  notable: external_exports.array(
106982
107122
  external_exports.object({
106983
107123
  text: external_exports.string(),
106984
- weight: count10,
107124
+ weight: count11,
106985
107125
  kind: external_exports.enum(STATUS_NOTABLE_KINDS).optional()
106986
107126
  }).strict()
106987
107127
  ).max(2)
@@ -108109,8 +108249,8 @@ function usageError(writer, message2, line) {
108109
108249
  writer.writeErr(`usage: ${line}`);
108110
108250
  process.exitCode = 2;
108111
108251
  }
108112
- function plural3(count14, one, many) {
108113
- return `${count14} ${count14 === 1 ? one : many}`;
108252
+ function plural3(count15, one, many) {
108253
+ return `${count15} ${count15 === 1 ? one : many}`;
108114
108254
  }
108115
108255
  function findingRow(finding) {
108116
108256
  const pr = finding.pull_request;
@@ -108494,8 +108634,8 @@ function fileRow(file2) {
108494
108634
  file2.fixture ? "fixture" : ""
108495
108635
  ];
108496
108636
  }
108497
- function plural4(count14, one, many) {
108498
- return `${count14} ${count14 === 1 ? one : many}`;
108637
+ function plural4(count15, one, many) {
108638
+ return `${count15} ${count15 === 1 ? one : many}`;
108499
108639
  }
108500
108640
  function countsLine(counts2) {
108501
108641
  const parts = [
@@ -111214,15 +111354,15 @@ var init_context_steering_shared = __esm({
111214
111354
 
111215
111355
  // ../../packages/oxagen/src/contracts/steering.markdown_import.shared.ts
111216
111356
  function markdownImportFileCount(rows) {
111217
- let count14 = rows.policies.filter((policy) => policy.action === "add").length;
111357
+ let count15 = rows.policies.filter((policy) => policy.action === "add").length;
111218
111358
  for (const row of rows.records) {
111219
- if (row.action === "add") count14 += 1 + (row.files?.length ?? 0);
111359
+ if (row.action === "add") count15 += 1 + (row.files?.length ?? 0);
111220
111360
  }
111221
- return count14;
111361
+ return count15;
111222
111362
  }
111223
- function markdownImportTooManyFiles(count14) {
111224
- if (count14 <= STEERING_PR_MAX_FILES) return null;
111225
- return `The import marks ${count14} records and policy files add, and one steering PR holds at most ${STEERING_PR_MAX_FILES} files. Mark ${count14 - STEERING_PR_MAX_FILES} of them skip, or import the files in smaller sets.`;
111363
+ function markdownImportTooManyFiles(count15) {
111364
+ if (count15 <= STEERING_PR_MAX_FILES) return null;
111365
+ return `The import marks ${count15} records and policy files add, and one steering PR holds at most ${STEERING_PR_MAX_FILES} files. Mark ${count15 - STEERING_PR_MAX_FILES} of them skip, or import the files in smaller sets.`;
111226
111366
  }
111227
111367
  function markdownImportSourceOf(path2) {
111228
111368
  const clean = path2.replace(/\\/g, "/").replace(/^\.?\//, "");
@@ -114647,10 +114787,18 @@ var init_codegraph_settings = __esm({
114647
114787
  ),
114648
114788
  30
114649
114789
  ),
114650
- revision_retention_days: setting(
114651
- external_exports.number().int().min(1).describe("Days a default-branch revision is kept."),
114652
- 90
114790
+ tracked_branch_revisions: setting(
114791
+ external_exports.number().int().min(1).describe(
114792
+ "How many of the newest built revisions of each repository's tracked branch are kept."
114793
+ ),
114794
+ 2
114653
114795
  ),
114796
+ // The 90-day window that tracked_branch_revisions replaced (#7269). It
114797
+ // still reads, so a file written before the change passes its check, and
114798
+ // nothing uses its value.
114799
+ revision_retention_days: external_exports.number().int().min(1).describe(
114800
+ "No longer used. Revisions are kept by count: see tracked_branch_revisions."
114801
+ ).optional(),
114654
114802
  pr_copy_retention_days: setting(
114655
114803
  external_exports.number().int().min(0).describe("Days a PR copy is kept after the PR closes."),
114656
114804
  7
@@ -114658,7 +114806,7 @@ var init_codegraph_settings = __esm({
114658
114806
  }).strict();
114659
114807
  CODEGRAPH_FRESHNESS_DEFAULTS = {
114660
114808
  lag_window_minutes: 30,
114661
- revision_retention_days: 90,
114809
+ tracked_branch_revisions: 2,
114662
114810
  pr_copy_retention_days: 7
114663
114811
  };
114664
114812
  CODEGRAPH_SETTINGS_GROUPS = [
@@ -114774,7 +114922,7 @@ var init_codegraph_settings = __esm({
114774
114922
  group: "freshness",
114775
114923
  id: "codegraph-freshness/v1",
114776
114924
  title: "Code graph freshness and retention",
114777
- description: "codegraph/freshness.toml: the CI check's lag window and how long revisions and PR copies are kept.",
114925
+ description: "codegraph/freshness.toml: the CI check's lag window, how many revisions are kept, and how long PR copies are kept.",
114778
114926
  schema: codegraphFreshnessSchema,
114779
114927
  defaults: CODEGRAPH_FRESHNESS_DEFAULTS,
114780
114928
  timing: "next_build"
@@ -118653,9 +118801,9 @@ function formatImportRows(rows) {
118653
118801
  const alwaysOn = rows.filter(
118654
118802
  (row) => row.action === "add" && (row.force === "must" || row.force === "should")
118655
118803
  ).reduce((sum3, row) => sum3 + row.tokens, 0);
118656
- const count14 = rows.length;
118804
+ const count15 = rows.length;
118657
118805
  return [header2, ...lines].join("\n") + `
118658
- ${count14} proposed ${count14 === 1 ? "record" : "records"}. The must and should rows marked add load ${alwaysOn} tokens on every request.`;
118806
+ ${count15} proposed ${count15 === 1 ? "record" : "records"}. The must and should rows marked add load ${alwaysOn} tokens on every request.`;
118659
118807
  }
118660
118808
  function formatImportPolicies(policies) {
118661
118809
  if (policies.length === 0) return "No policies were proposed.";
@@ -118673,10 +118821,10 @@ function formatImportPolicies(policies) {
118673
118821
  return `${String(i2 + 1).padEnd(4)} ${truncate(policy.path, 36).padEnd(36)} ${String(policy.statements.length).padEnd(10)} ${policy.action.padEnd(7)} ${truncate(policy.file, 48)}` + notes.map((note) => `
118674
118822
  ${note}`).join("");
118675
118823
  });
118676
- const count14 = policies.length;
118824
+ const count15 = policies.length;
118677
118825
  const fix = policies.some((policy) => policy.issues.length > 0) ? " A file with an issue stays skip. Fix its Markdown and import it again." : "";
118678
118826
  return [header2, ...lines].join("\n") + `
118679
- ${count14} proposed policy ${count14 === 1 ? "file" : "files"}.${fix}`;
118827
+ ${count15} proposed policy ${count15 === 1 ? "file" : "files"}.${fix}`;
118680
118828
  }
118681
118829
  function memoryMark(row) {
118682
118830
  const match = row.duplicate;
@@ -118699,9 +118847,9 @@ function formatImportMemories(rows) {
118699
118847
  return `${String(i2 + 1).padEnd(4)} ${source} ${row.action.padEnd(7)} ${truncate(row.statement, 60)}` + (mark ? `
118700
118848
  ${mark}` : "");
118701
118849
  });
118702
- const count14 = rows.length;
118850
+ const count15 = rows.length;
118703
118851
  return [header2, ...lines].join("\n") + `
118704
- ${count14} proposed ${count14 === 1 ? "memory" : "memories"}. Each one marked add is stored as a waiting memory, and none steers an agent until a person promotes it.`;
118852
+ ${count15} proposed ${count15 === 1 ? "memory" : "memories"}. Each one marked add is stored as a waiting memory, and none steers an agent until a person promotes it.`;
118705
118853
  }
118706
118854
  function memorySkipNote(skip2) {
118707
118855
  const where2 = `${skip2.file}:${skip2.line}`;
@@ -118973,12 +119121,12 @@ async function runMarkdownImport(documents, run3, writer) {
118973
119121
  }
118974
119122
  const records = reconcileImportRows(parsedRecords);
118975
119123
  const policies = run3.policies ? reconcileImportPolicies(parsedPolicies) : [];
118976
- const count14 = markdownImportFileCount({ records, policies });
118977
- const tooMany = markdownImportTooManyFiles(count14);
119124
+ const count15 = markdownImportFileCount({ records, policies });
119125
+ const tooMany = markdownImportTooManyFiles(count15);
118978
119126
  if (!run3.yes) {
118979
119127
  if (run3.json) {
118980
119128
  const pullRequestFiles = {
118981
- count: count14,
119129
+ count: count15,
118982
119130
  max: STEERING_PR_MAX_FILES,
118983
119131
  message: tooMany
118984
119132
  };
@@ -119546,8 +119694,8 @@ async function dropMemoryPrRecord(input2) {
119546
119694
  function memoryName(memory) {
119547
119695
  return memory.label ?? memory.statement.split("\n")[0] ?? memory.statement;
119548
119696
  }
119549
- function usesText(count14, signal) {
119550
- return signal || count14 > 0 ? String(count14) : "No signal";
119697
+ function usesText(count15, signal) {
119698
+ return signal || count15 > 0 ? String(count15) : "No signal";
119551
119699
  }
119552
119700
  function ago(iso, now = /* @__PURE__ */ new Date()) {
119553
119701
  if (iso === null) return "Never";
@@ -119562,8 +119710,8 @@ function ago(iso, now = /* @__PURE__ */ new Date()) {
119562
119710
  if (hours < 48) return `${hours}h ago`;
119563
119711
  return `${Math.round(hours / 24)}d ago`;
119564
119712
  }
119565
- function plural5(count14, one, many) {
119566
- return `${count14} ${count14 === 1 ? one : many}`;
119713
+ function plural5(count15, one, many) {
119714
+ return `${count15} ${count15 === 1 ? one : many}`;
119567
119715
  }
119568
119716
  function formatWorkspaceMemories(result2, now = /* @__PURE__ */ new Date()) {
119569
119717
  if (result2.groups.length === 0) {
@@ -120721,19 +120869,19 @@ async function runTranscript(runId, opts = {}, writer = stdoutWriter) {
120721
120869
  return;
120722
120870
  }
120723
120871
  const { counts: counts2, search, complete } = result2;
120724
- const count14 = (n2) => complete ? String(n2) : `${n2}+`;
120872
+ const count15 = (n2) => complete ? String(n2) : `${n2}+`;
120725
120873
  const shown3 = result2.entries.filter((entry2) => entry2.quiet !== true);
120726
120874
  writer.write(
120727
- `${runId} at ${result2.zoom}: ${plural3(shown3.length, "entry", "entries")} on this page${counts2 === void 0 ? "" : `, ${count14(counts2.entries)} in the run`}`
120875
+ `${runId} at ${result2.zoom}: ${plural3(shown3.length, "entry", "entries")} on this page${counts2 === void 0 ? "" : `, ${count15(counts2.entries)} in the run`}`
120728
120876
  );
120729
120877
  if (counts2 !== void 0) {
120730
120878
  const chipCounts = TRANSCRIPT_KINDS.filter(
120731
120879
  (kind) => counts2.kinds[kind] !== void 0
120732
- ).map((kind) => `${kind} ${count14(counts2.kinds[kind] ?? 0)}`);
120880
+ ).map((kind) => `${kind} ${count15(counts2.kinds[kind] ?? 0)}`);
120733
120881
  writer.write(`Counts: ${chipCounts.join(", ")}`);
120734
120882
  }
120735
120883
  if (search !== void 0) {
120736
- writer.write(`Search "${search.query}": ${count14(search.matched)} matched`);
120884
+ writer.write(`Search "${search.query}": ${count15(search.matched)} matched`);
120737
120885
  if (search.unsearched > 0) {
120738
120886
  writer.write(
120739
120887
  `The search is partial: it could not look inside ${plural3(search.unsearched, "kept body", "kept bodies")}.`
@@ -121215,7 +121363,7 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
121215
121363
  const assembly = result2.assemblies[0];
121216
121364
  if (assembly !== void 0)
121217
121365
  writer.write(
121218
- `Steering: ${count11(assembly.spentTokens)} of ${count11(assembly.budgetTokens)} tokens spent, ${assembly.included} included, ${assembly.cut} cut (frame ${assembly.seq})`
121366
+ `Steering: ${count12(assembly.spentTokens)} of ${count12(assembly.budgetTokens)} tokens spent, ${assembly.included} included, ${assembly.cut} cut (frame ${assembly.seq})`
121219
121367
  );
121220
121368
  if (result2.windows.length === 0) {
121221
121369
  writer.write(
@@ -121228,11 +121376,11 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
121228
121376
  ...result2.windows.map((w) => [
121229
121377
  w.seq,
121230
121378
  w.model ?? NOT_RECORDED2,
121231
- w.promptTokens === null ? NOT_RECORDED2 : count11(w.promptTokens),
121379
+ w.promptTokens === null ? NOT_RECORDED2 : count12(w.promptTokens),
121232
121380
  ...BLOCKS.map((kind) => {
121233
121381
  const block = w.blocks.find((b3) => b3.kind === kind);
121234
121382
  if (block === void 0) return "-";
121235
- return block.tokens === null ? NOT_RECORDED2 : count11(block.tokens);
121383
+ return block.tokens === null ? NOT_RECORDED2 : count12(block.tokens);
121236
121384
  })
121237
121385
  ])
121238
121386
  ];
@@ -121240,11 +121388,11 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
121240
121388
  if (composition !== null)
121241
121389
  rows.push([
121242
121390
  "All",
121243
- `${count11(composition.requests)} request(s)`,
121244
- count11(composition.promptTokens),
121391
+ `${count12(composition.requests)} request(s)`,
121392
+ count12(composition.promptTokens),
121245
121393
  ...BLOCKS.map((kind) => {
121246
121394
  const tokens = composition.blocks[kind];
121247
- return tokens === null ? "-" : count11(tokens);
121395
+ return tokens === null ? "-" : count12(tokens);
121248
121396
  })
121249
121397
  ]);
121250
121398
  writer.write("");
@@ -121259,7 +121407,7 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
121259
121407
  function titleOf(kind) {
121260
121408
  return kind.charAt(0).toUpperCase() + kind.slice(1);
121261
121409
  }
121262
- var BLOCKS, NOT_RECORDED2, count11;
121410
+ var BLOCKS, NOT_RECORDED2, count12;
121263
121411
  var init_run_context = __esm({
121264
121412
  "src/commands/run-context.ts"() {
121265
121413
  init_api();
@@ -121274,7 +121422,7 @@ var init_run_context = __esm({
121274
121422
  "conversation"
121275
121423
  ];
121276
121424
  NOT_RECORDED2 = "not recorded";
121277
- count11 = (n2) => n2.toLocaleString("en-US");
121425
+ count12 = (n2) => n2.toLocaleString("en-US");
121278
121426
  }
121279
121427
  });
121280
121428
 
@@ -121304,7 +121452,7 @@ function wholeNumber(value, min, max2) {
121304
121452
  const n2 = Number(text6);
121305
121453
  return n2 >= min && n2 <= max2 ? n2 : void 0;
121306
121454
  }
121307
- function count12(n2) {
121455
+ function count13(n2) {
121308
121456
  return n2.toLocaleString("en-US");
121309
121457
  }
121310
121458
  function parseSteer(text6, opts) {
@@ -121343,7 +121491,7 @@ function parseSteer(text6, opts) {
121343
121491
  if (body2 === "") return { error: "the steer text is empty." };
121344
121492
  if (body2.length > STEER_TEXT_MAX)
121345
121493
  return {
121346
- error: `the steer text is ${count12(body2.length)} characters, and a steer holds at most ${count12(STEER_TEXT_MAX)}.`
121494
+ error: `the steer text is ${count13(body2.length)} characters, and a steer holds at most ${count13(STEER_TEXT_MAX)}.`
121347
121495
  };
121348
121496
  const mode = opts.mode ?? "next_step";
121349
121497
  if (!isDeliveryMode(mode))
@@ -121357,7 +121505,7 @@ function parseSteer(text6, opts) {
121357
121505
  return { error: "--reason is empty. Say why, or leave it out." };
121358
121506
  if (reason3.length > COMMAND_REASON_MAX)
121359
121507
  return {
121360
- error: `--reason is ${count12(reason3.length)} characters, and a reason holds at most ${count12(COMMAND_REASON_MAX)}.`
121508
+ error: `--reason is ${count13(reason3.length)} characters, and a reason holds at most ${count13(COMMAND_REASON_MAX)}.`
121361
121509
  };
121362
121510
  request4.reason = reason3;
121363
121511
  }
@@ -121365,7 +121513,7 @@ function parseSteer(text6, opts) {
121365
121513
  const minutes = wholeNumber(opts.expiresIn, 1, EXPIRES_IN_MAX_MINUTES);
121366
121514
  if (minutes === void 0)
121367
121515
  return {
121368
- error: `--expires-in takes whole minutes from 1 to ${count12(EXPIRES_IN_MAX_MINUTES)}, got ${JSON.stringify(String(opts.expiresIn))}.`
121516
+ error: `--expires-in takes whole minutes from 1 to ${count13(EXPIRES_IN_MAX_MINUTES)}, got ${JSON.stringify(String(opts.expiresIn))}.`
121369
121517
  };
121370
121518
  request4.expiresInMs = minutes * 6e4;
121371
121519
  }
@@ -122064,8 +122212,8 @@ function keyName(credential) {
122064
122212
  return `the ${credential.provider} key${name2} ending ${credential.hint}`;
122065
122213
  }
122066
122214
  async function confirmOnTerminal(question) {
122067
- const { createInterface: createInterface5 } = await import("node:readline/promises");
122068
- const rl = createInterface5({ input: process.stdin, output: process.stderr });
122215
+ const { createInterface: createInterface6 } = await import("node:readline/promises");
122216
+ const rl = createInterface6({ input: process.stdin, output: process.stderr });
122069
122217
  try {
122070
122218
  const answer = (await rl.question(question)).trim().toLowerCase();
122071
122219
  return answer === "y" || answer === "yes";
@@ -123626,8 +123774,8 @@ function formatOf(entries2) {
123626
123774
  return null;
123627
123775
  }
123628
123776
  }
123629
- function plural6(count14, one, many) {
123630
- return `${count14} ${count14 === 1 ? one : many}`;
123777
+ function plural6(count15, one, many) {
123778
+ return `${count15} ${count15 === 1 ? one : many}`;
123631
123779
  }
123632
123780
  function digestLabel(state) {
123633
123781
  return state === "not_carried" ? "not carried" : state;
@@ -124803,14 +124951,14 @@ function codePointLength(str4) {
124803
124951
  const units = str4.length;
124804
124952
  if (!highSurrogate.test(str4))
124805
124953
  return units;
124806
- let count14 = units;
124954
+ let count15 = units;
124807
124955
  for (let i2 = 0; i2 < units - 1; i2++) {
124808
124956
  if ((str4.charCodeAt(i2) & 64512) === 55296 && (str4.charCodeAt(i2 + 1) & 64512) === 56320) {
124809
- count14--;
124957
+ count15--;
124810
124958
  i2++;
124811
124959
  }
124812
124960
  }
124813
- return count14;
124961
+ return count15;
124814
124962
  }
124815
124963
  function getLengthableOrigin(input2) {
124816
124964
  if (Array.isArray(input2))
@@ -141473,15 +141621,15 @@ var init_ajvProvider_BIwGVY6G = __esm({
141473
141621
  return false;
141474
141622
  }
141475
141623
  function countKeys(schema) {
141476
- let count14 = 0;
141624
+ let count15 = 0;
141477
141625
  for (const key in schema) {
141478
141626
  if (key === "$ref") return Infinity;
141479
- count14++;
141627
+ count15++;
141480
141628
  if (SIMPLE_INLINED.has(key)) continue;
141481
- if (typeof schema[key] == "object") (0, util_1.eachItem)(schema[key], (sch) => count14 += countKeys(sch));
141482
- if (count14 === Infinity) return Infinity;
141629
+ if (typeof schema[key] == "object") (0, util_1.eachItem)(schema[key], (sch) => count15 += countKeys(sch));
141630
+ if (count15 === Infinity) return Infinity;
141483
141631
  }
141484
- return count14;
141632
+ return count15;
141485
141633
  }
141486
141634
  function getFullPath(resolver, id2 = "", normalize4) {
141487
141635
  if (normalize4 !== false) id2 = normalizeId(id2);
@@ -144434,8 +144582,8 @@ var init_ajvProvider_BIwGVY6G = __esm({
144434
144582
  cxt.result(valid, () => cxt.reset());
144435
144583
  function validateItemsWithCount() {
144436
144584
  const schValid = gen.name("_valid");
144437
- const count14 = gen.let("count", 0);
144438
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count14)));
144585
+ const count15 = gen.let("count", 0);
144586
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count15)));
144439
144587
  }
144440
144588
  function validateItems(_valid, block) {
144441
144589
  gen.forRange("i", 0, len, (i2) => {
@@ -144448,13 +144596,13 @@ var init_ajvProvider_BIwGVY6G = __esm({
144448
144596
  block();
144449
144597
  });
144450
144598
  }
144451
- function checkLimits(count14) {
144452
- gen.code((0, codegen_1._)`${count14}++`);
144453
- if (max2 === void 0) gen.if((0, codegen_1._)`${count14} >= ${min}`, () => gen.assign(valid, true).break());
144599
+ function checkLimits(count15) {
144600
+ gen.code((0, codegen_1._)`${count15}++`);
144601
+ if (max2 === void 0) gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true).break());
144454
144602
  else {
144455
- gen.if((0, codegen_1._)`${count14} > ${max2}`, () => gen.assign(valid, false).break());
144603
+ gen.if((0, codegen_1._)`${count15} > ${max2}`, () => gen.assign(valid, false).break());
144456
144604
  if (min === 1) gen.assign(valid, true);
144457
- else gen.if((0, codegen_1._)`${count14} >= ${min}`, () => gen.assign(valid, true));
144605
+ else gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true));
144458
144606
  }
144459
144607
  }
144460
144608
  }
@@ -150333,6 +150481,7 @@ var init_dist2 = __esm({
150333
150481
  var EventSourceParserStream;
150334
150482
  var init_stream = __esm({
150335
150483
  "../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js"() {
150484
+ init_dist2();
150336
150485
  init_dist2();
150337
150486
  EventSourceParserStream = class extends TransformStream {
150338
150487
  constructor({ onError, onRetry, onComment, maxBufferSize } = {}) {
@@ -155138,7 +155287,7 @@ var init_schemas6 = __esm({
155138
155287
  });
155139
155288
 
155140
155289
  // ../../packages/mcp-studio/src/model/definition-limits.ts
155141
- function count13(value) {
155290
+ function count14(value) {
155142
155291
  return value.toLocaleString("en-US");
155143
155292
  }
155144
155293
  var DEFINITION_BYTES_MAX, DEFINITION_SIZE;
@@ -155220,11 +155369,11 @@ function keyProblems(all, given, type) {
155220
155369
  if (name2 !== void 0) counts2.set(name2, (counts2.get(name2) ?? 0) + 1);
155221
155370
  if (key !== void 0) settable.add(key);
155222
155371
  }
155223
- for (const [name2, count14] of counts2) {
155224
- if (count14 > 1 && settable.has(name2)) {
155372
+ for (const [name2, count15] of counts2) {
155373
+ if (count15 > 1 && settable.has(name2)) {
155225
155374
  problems.push({
155226
155375
  field: "source.registry_type",
155227
- message: `the ${type} package has ${count14} arguments keyed ${name2}, so source.arguments cannot tell them apart`
155376
+ message: `the ${type} package has ${count15} arguments keyed ${name2}, so source.arguments cannot tell them apart`
155228
155377
  });
155229
155378
  }
155230
155379
  }
@@ -170048,7 +170197,7 @@ function namedSources(input2) {
170048
170197
  if (bytes > DEFINITION_BYTES_MAX) {
170049
170198
  throw new GrpcImportError(
170050
170199
  "too_large",
170051
- `The .proto files come to ${count13(bytes)} bytes. Import refuses a definition over ${DEFINITION_SIZE}, so import only the files the services need.`
170200
+ `The .proto files come to ${count14(bytes)} bytes. Import refuses a definition over ${DEFINITION_SIZE}, so import only the files the services need.`
170052
170201
  );
170053
170202
  }
170054
170203
  const sources = /* @__PURE__ */ new Map();
@@ -170264,7 +170413,7 @@ function fromReflection(protos, notes) {
170264
170413
  if (bytes > DEFINITION_BYTES_MAX) {
170265
170414
  throw new GrpcImportError(
170266
170415
  "too_large",
170267
- `Server reflection returned ${count13(bytes)} bytes of descriptors. Import refuses a definition over ${DEFINITION_SIZE}, so import the .proto files the services need instead.`
170416
+ `Server reflection returned ${count14(bytes)} bytes of descriptors. Import refuses a definition over ${DEFINITION_SIZE}, so import the .proto files the services need instead.`
170268
170417
  );
170269
170418
  }
170270
170419
  const reflected = decodeAll(protos);
@@ -170597,11 +170746,11 @@ var init_json_schema4 = __esm({
170597
170746
  }
170598
170747
  if (this.toolNodes > TOOL_NODES_SOFT_MAX) {
170599
170748
  this.note(
170600
- `This tool's schemas passed ${count13(TOOL_NODES_SOFT_MAX)} nodes, so import cut each message after that point to a stub.`
170749
+ `This tool's schemas passed ${count14(TOOL_NODES_SOFT_MAX)} nodes, so import cut each message after that point to a stub.`
170601
170750
  );
170602
170751
  return {
170603
170752
  type: "object",
170604
- description: `Cut: this tool's schemas passed ${count13(TOOL_NODES_SOFT_MAX)} nodes.`
170753
+ description: `Cut: this tool's schemas passed ${count14(TOOL_NODES_SOFT_MAX)} nodes.`
170605
170754
  };
170606
170755
  }
170607
170756
  this.active.set(name2, open8 + 1);
@@ -170706,7 +170855,7 @@ var init_json_schema4 = __esm({
170706
170855
  if (this.nodes > EXPANSION_NODES_MAX) {
170707
170856
  throw new GrpcImportError(
170708
170857
  "expansion_limit",
170709
- `Schema expansion passed ${count13(EXPANSION_NODES_MAX)} nodes, the limit for one import. Remove unused services or split the definition, then import again.`
170858
+ `Schema expansion passed ${count14(EXPANSION_NODES_MAX)} nodes, the limit for one import. Remove unused services or split the definition, then import again.`
170710
170859
  );
170711
170860
  }
170712
170861
  }
@@ -171782,12 +171931,12 @@ function lintKeys(slots, given, type, other, report) {
171782
171931
  if (name2 !== void 0) counts2.set(name2, (counts2.get(name2) ?? 0) + 1);
171783
171932
  if (key !== void 0) settable.add(key);
171784
171933
  }
171785
- for (const [name2, count14] of counts2) {
171786
- if (count14 < 2 || !settable.has(name2)) continue;
171934
+ for (const [name2, count15] of counts2) {
171935
+ if (count15 < 2 || !settable.has(name2)) continue;
171787
171936
  report("argument_without_value", {
171788
171937
  tool: void 0,
171789
171938
  field: "source.registry_type",
171790
- message: `The ${type} package has ${count14} arguments keyed ${name2}, so source.arguments cannot tell them apart.`,
171939
+ message: `The ${type} package has ${count15} arguments keyed ${name2}, so source.arguments cannot tell them apart.`,
171791
171940
  fix: other
171792
171941
  });
171793
171942
  }
@@ -172234,7 +172383,7 @@ function lintTools(folder, context, report) {
172234
172383
  report("over_definition_budget", {
172235
172384
  tool: void 0,
172236
172385
  field: "exposure.mode",
172237
- message: `${imported === 1 ? "The one imported tool costs" : `The ${imported} imported tools cost`} about ${count13(tokens)} tokens on every request, over the definition_budget of ${count13(budget)}.`,
172386
+ message: `${imported === 1 ? "The one imported tool costs" : `The ${imported} imported tools cost`} about ${count14(tokens)} tokens on every request, over the definition_budget of ${count14(budget)}.`,
172238
172387
  fix: `Set exposure.mode = "search" in server.toml, so each request lists ${SEARCH_MODE_TOOLS.length} tools (${andList([...SEARCH_MODE_TOOLS])}) in place of ${imported}.`
172239
172388
  });
172240
172389
  }
@@ -172300,8 +172449,8 @@ function lintLength(key, entry2, description, report) {
172300
172449
  report("long_description", {
172301
172450
  tool: key,
172302
172451
  field: "description",
172303
- message: own2 ? `${key}'s description is ${count13(description.length)} characters, over the ${count13(TOOL_DESCRIPTION_MAX)} a description may be, and every request pays for it.` : `The source's description of ${key} is ${count13(description.length)} characters, at the ${count13(TOOL_DESCRIPTION_MAX)} import cuts a description to, and every request pays for it.`,
172304
- fix: `Set description in [tools.${key}] to a summary under ${count13(TOOL_DESCRIPTION_MAX)} characters.`
172452
+ message: own2 ? `${key}'s description is ${count14(description.length)} characters, over the ${count14(TOOL_DESCRIPTION_MAX)} a description may be, and every request pays for it.` : `The source's description of ${key} is ${count14(description.length)} characters, at the ${count14(TOOL_DESCRIPTION_MAX)} import cuts a description to, and every request pays for it.`,
172453
+ fix: `Set description in [tools.${key}] to a summary under ${count14(TOOL_DESCRIPTION_MAX)} characters.`
172305
172454
  });
172306
172455
  }
172307
172456
  function lintName(folder, key, report) {
@@ -172329,7 +172478,7 @@ function lintName(folder, key, report) {
172329
172478
  report("invalid_name", {
172330
172479
  tool: key,
172331
172480
  field: "name",
172332
- message: `${name2} is ${count13(name2.length)} characters, and model APIs reject a tool name over ${TOOL_NAME_MAX}.`,
172481
+ message: `${name2} is ${count14(name2.length)} characters, and model APIs reject a tool name over ${TOOL_NAME_MAX}.`,
172333
172482
  fix: `Rename [tools.${key}] to at most ${room} characters.`
172334
172483
  });
172335
172484
  }
@@ -174476,8 +174625,8 @@ function errorText3(error2) {
174476
174625
  function asSentence(text6) {
174477
174626
  return /[.!?…]$/.test(text6) ? text6 : `${text6}.`;
174478
174627
  }
174479
- function plural7(count14, one, many) {
174480
- return `${count14} ${count14 === 1 ? one : many}`;
174628
+ function plural7(count15, one, many) {
174629
+ return `${count15} ${count15 === 1 ? one : many}`;
174481
174630
  }
174482
174631
  function pagingNote(paged, options) {
174483
174632
  const read2 = `${plural7(paged.items, "item", "items")} from ${plural7(paged.pages, "page", "pages")}`;
@@ -175875,12 +176024,12 @@ function jsonResultBytes(value, text6) {
175875
176024
  function cutList(value, rules) {
175876
176025
  const list2 = valueAt2(value, rules.list);
175877
176026
  if (!isList(list2) || list2.length === 0) return void 0;
175878
- const render2 = (count14) => {
175879
- const head4 = withValueAt(value, rules.list, list2.slice(0, count14));
176027
+ const render2 = (count15) => {
176028
+ const head4 = withValueAt(value, rules.list, list2.slice(0, count15));
175880
176029
  return { head: head4, text: JSON.stringify(head4) };
175881
176030
  };
175882
- const fits = (count14) => {
175883
- const { head: head4, text: text7 } = render2(count14);
176031
+ const fits = (count15) => {
176032
+ const { head: head4, text: text7 } = render2(count15);
175884
176033
  return jsonResultBytes(head4, text7) <= rules.max_result_bytes;
175885
176034
  };
175886
176035
  if (!fits(0)) return void 0;
@@ -176167,8 +176316,8 @@ function listOf3(values) {
176167
176316
  const more = values.length - shown3.length;
176168
176317
  return more > 0 ? `${shown3.join(", ")}, and ${more} more` : shown3.join(", ");
176169
176318
  }
176170
- function plural8(count14, one, many = `${one}s`) {
176171
- return count14 === 1 ? one : many;
176319
+ function plural8(count15, one, many = `${one}s`) {
176320
+ return count15 === 1 ? one : many;
176172
176321
  }
176173
176322
  var MAX_DEPTH4, MAX_STEPS, MAX_ISSUES, REJECTED_INPUT_MAX, ROOT, PATTERNS, PATH_STEP, SURROGATE, TYPE_NAMES, Checker;
176174
176323
  var init_validate = __esm({
@@ -176431,12 +176580,12 @@ var init_validate = __esm({
176431
176580
  const decided = schema.oneOf.map(
176432
176581
  (part) => this.decides(part, value, path2, depth + 1)
176433
176582
  );
176434
- const count14 = decided.filter((match) => match === true).length;
176583
+ const count15 = decided.filter((match) => match === true).length;
176435
176584
  const unsure = decided.includes(void 0);
176436
- if (count14 > 1 || count14 === 0 && !unsure)
176585
+ if (count15 > 1 || count15 === 0 && !unsure)
176437
176586
  issues.push({
176438
176587
  path: path2,
176439
- message: `${path2} must match exactly one of its oneOf schemas, and it matches ${count14}.`
176588
+ message: `${path2} must match exactly one of its oneOf schemas, and it matches ${count15}.`
176440
176589
  });
176441
176590
  }
176442
176591
  if (schema.not !== void 0 && this.decides(schema.not, value, path2, depth + 1) === true) {
@@ -188229,13 +188378,13 @@ var require_retrying_call = __commonJS({
188229
188378
  }, retryDelayMs);
188230
188379
  }
188231
188380
  countActiveCalls() {
188232
- let count14 = 0;
188381
+ let count15 = 0;
188233
188382
  for (const call2 of this.underlyingCalls) {
188234
188383
  if ((call2 === null || call2 === void 0 ? void 0 : call2.state) === "ACTIVE") {
188235
- count14 += 1;
188384
+ count15 += 1;
188236
188385
  }
188237
188386
  }
188238
- return count14;
188387
+ return count15;
188239
188388
  }
188240
188389
  handleProcessedStatus(status2, callIndex, pushback) {
188241
188390
  var _a4, _b2, _c;
@@ -194148,13 +194297,13 @@ var require_load_balancer_weighted_round_robin = __commonJS({
194148
194297
  this.weightUpdateTimer = null;
194149
194298
  }
194150
194299
  countChildrenWithState(state) {
194151
- let count14 = 0;
194300
+ let count15 = 0;
194152
194301
  for (const entry2 of this.children.values()) {
194153
194302
  if (entry2.child.getConnectivityState() === state) {
194154
- count14 += 1;
194303
+ count15 += 1;
194155
194304
  }
194156
194305
  }
194157
- return count14;
194306
+ return count15;
194158
194307
  }
194159
194308
  updateWeight(entry2, loadReport) {
194160
194309
  var _a4, _b2;
@@ -196557,8 +196706,8 @@ type Tool = {
196557
196706
  });
196558
196707
 
196559
196708
  // ../../packages/policy/src/compile.ts
196560
- function lexicalOrder(count14) {
196561
- return Array.from({ length: count14 }, (_, k) => `policy${k}`).sort().map((id2) => Number(id2.slice("policy".length)));
196709
+ function lexicalOrder(count15) {
196710
+ return Array.from({ length: count15 }, (_, k) => `policy${k}`).sort().map((id2) => Number(id2.slice("policy".length)));
196562
196711
  }
196563
196712
  function sourceOrder(source, parts) {
196564
196713
  const offsets = parts.map((part) => source.indexOf(part));
@@ -196749,10 +196898,10 @@ function compilePolicies(input2, runtime) {
196749
196898
  if (policy.approval) approvalIds.push(policy.id);
196750
196899
  }
196751
196900
  }
196752
- const count14 = Object.keys(policies).length;
196753
- if (count14 > MAX_POLICIES) {
196901
+ const count15 = Object.keys(policies).length;
196902
+ if (count15 > MAX_POLICIES) {
196754
196903
  errors.push({
196755
- message: `The set holds ${count14} policies. The limit is ${MAX_POLICIES}.`
196904
+ message: `The set holds ${count15} policies. The limit is ${MAX_POLICIES}.`
196756
196905
  });
196757
196906
  return { schema, errors, warnings };
196758
196907
  }
@@ -197825,10 +197974,10 @@ function readHead2(root) {
197825
197974
  }
197826
197975
  return files2;
197827
197976
  }
197828
- function parseBatch(out, count14) {
197977
+ function parseBatch(out, count15) {
197829
197978
  const texts = [];
197830
197979
  let at2 = 0;
197831
- while (texts.length < count14) {
197980
+ while (texts.length < count15) {
197832
197981
  const eol = out.indexOf(10, at2);
197833
197982
  if (eol < 0) return null;
197834
197983
  const [, type, sizeText] = out.subarray(at2, eol).toString("utf8").split(" ");
@@ -198687,8 +198836,8 @@ import * as http from "node:http";
198687
198836
  import * as os from "node:os";
198688
198837
  function describeWait(ms) {
198689
198838
  const minutes = ms >= 6e4;
198690
- const count14 = minutes ? Math.round(ms / 6e4) : Math.max(1, Math.round(ms / 1e3));
198691
- return `${count14} ${minutes ? "minute" : "second"}${count14 === 1 ? "" : "s"}`;
198839
+ const count15 = minutes ? Math.round(ms / 6e4) : Math.max(1, Math.round(ms / 1e3));
198840
+ return `${count15} ${minutes ? "minute" : "second"}${count15 === 1 ? "" : "s"}`;
198692
198841
  }
198693
198842
  function asTokenExchangeResponse(body2) {
198694
198843
  const record2 = body2 !== null && typeof body2 === "object" ? body2 : {};
@@ -200384,8 +200533,8 @@ async function confirmsIrreversible(what, yes) {
200384
200533
  process.exitCode = 2;
200385
200534
  return false;
200386
200535
  }
200387
- const { createInterface: createInterface5 } = await import("node:readline/promises");
200388
- const rl = createInterface5({ input: process.stdin, output: process.stderr });
200536
+ const { createInterface: createInterface6 } = await import("node:readline/promises");
200537
+ const rl = createInterface6({ input: process.stdin, output: process.stderr });
200389
200538
  let answer;
200390
200539
  try {
200391
200540
  answer = (await rl.question(`${what} cannot be undone. Continue? [y/N] `)).trim().toLowerCase();