@staff0rd/assist 0.932.3 → 0.933.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.932.3",
9
+ version: "0.933.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -89,6 +89,8 @@ var package_default = {
89
89
  "@emotion/cache": "^11.14.0",
90
90
  "@emotion/react": "^11.14.0",
91
91
  "@emotion/styled": "^11.14.1",
92
+ "@fontsource-variable/geist": "^5.3.0",
93
+ "@fontsource-variable/geist-mono": "^5.3.0",
92
94
  "@mui/icons-material": "^9.0.0",
93
95
  "@mui/material": "^9.0.0",
94
96
  "@semantic-release/changelog": "^6.0.3",
@@ -309,13 +311,13 @@ function buildUrl(port, initialPath) {
309
311
  const base = `http://localhost:${port}`;
310
312
  return initialPath ? `${base}${initialPath}` : base;
311
313
  }
312
- function startWebServer(label2, port, handler, initialPath, open = true) {
314
+ function startWebServer(label, port, handler, initialPath, open = true) {
313
315
  const url = buildUrl(port, initialPath);
314
316
  const server = createServer((req, res) => {
315
317
  runHandler(handler, req, res, port);
316
318
  });
317
319
  server.listen(port, "127.0.0.1", () => {
318
- console.log(chalk.green(`${label2}: ${url}`));
320
+ console.log(chalk.green(`${label}: ${url}`));
319
321
  console.log(chalk.dim("Press Ctrl+C to stop"));
320
322
  if (open) {
321
323
  openBrowser(url);
@@ -827,6 +829,7 @@ function stripLegacyConfigKeys(config) {
827
829
  if (stripped.repos) stripped.repos = stripRepos(stripped.repos);
828
830
  delete stripped.backlog;
829
831
  delete stripped.cliReadVerbs;
832
+ delete stripped.roam;
830
833
  const news = stripped.news;
831
834
  if (news && typeof news === "object" && "feeds" in news) {
832
835
  const { feeds: _feeds, ...rest } = news;
@@ -952,15 +955,15 @@ var NAMED_KEYS = [
952
955
  ];
953
956
  function hotkeyKeyCode(token) {
954
957
  if (/^[a-z]$/i.test(token)) {
955
- const label2 = token.toUpperCase();
956
- return { code: `Key${label2}`, label: label2 };
958
+ const label = token.toUpperCase();
959
+ return { code: `Key${label}`, label };
957
960
  }
958
961
  if (/^\d$/.test(token)) return { code: `Digit${token}`, label: token };
959
962
  const punctuation = PUNCTUATION_CODES[token];
960
963
  if (punctuation) return { code: punctuation, label: token };
961
964
  if (/^F([1-9]|1[0-2])$/i.test(token)) {
962
- const label2 = token.toUpperCase();
963
- return { code: label2, label: label2 };
965
+ const label = token.toUpperCase();
966
+ return { code: label, label };
964
967
  }
965
968
  const named = NAMED_KEYS.find(
966
969
  (name) => name.toLowerCase() === token.toLowerCase()
@@ -1185,13 +1188,6 @@ var assistConfigShape = {
1185
1188
  jira: z6.strictObject({
1186
1189
  acField: z6.string().default("customfield_11937")
1187
1190
  }).optional(),
1188
- roam: z6.strictObject({
1189
- clientId: secretConfigValue(z6.string()),
1190
- clientSecret: secretConfigValue(z6.string()),
1191
- accessToken: secretConfigValue(z6.string()).optional(),
1192
- refreshToken: secretConfigValue(z6.string()).optional(),
1193
- tokenExpiresAt: z6.number().optional()
1194
- }).optional(),
1195
1191
  slack: z6.strictObject({
1196
1192
  channel: z6.string().optional()
1197
1193
  }).optional(),
@@ -5426,7 +5422,7 @@ var SUPPORTED = /* @__PURE__ */ new Set([
5426
5422
  "Address Comments (auto)"
5427
5423
  ]);
5428
5424
  var azureDevopsPrActions = prActions.filter(
5429
- ({ label: label2 }) => SUPPORTED.has(label2)
5425
+ ({ label }) => SUPPORTED.has(label)
5430
5426
  );
5431
5427
 
5432
5428
  // src/shared/azureDevops/isAllowedAzureDevopsPrArgs.ts
@@ -6524,35 +6520,6 @@ var reviewConfigHelp = [
6524
6520
  }
6525
6521
  ];
6526
6522
 
6527
- // src/commands/roam/roamConfigHelp.ts
6528
- var roamConfigHelp = [
6529
- {
6530
- key: "roam.clientId",
6531
- setter: "assist roam auth",
6532
- note: "OAuth client ID (written by the auth flow)"
6533
- },
6534
- {
6535
- key: "roam.clientSecret",
6536
- setter: "assist roam auth",
6537
- note: "OAuth client secret (written by the auth flow)"
6538
- },
6539
- {
6540
- key: "roam.accessToken",
6541
- setter: "assist roam auth",
6542
- note: "OAuth access token (managed by the auth flow)"
6543
- },
6544
- {
6545
- key: "roam.refreshToken",
6546
- setter: "assist roam auth",
6547
- note: "OAuth refresh token (managed by the auth flow)"
6548
- },
6549
- {
6550
- key: "roam.tokenExpiresAt",
6551
- setter: "assist roam auth",
6552
- note: "access-token expiry epoch (managed by the auth flow)"
6553
- }
6554
- ];
6555
-
6556
6523
  // src/commands/sync/printAutoConfirmHint.ts
6557
6524
  import chalk9 from "chalk";
6558
6525
  var autoConfirmHintCommand = "assist config set sync.autoConfirm true --global";
@@ -6859,7 +6826,6 @@ var configHelpEntries = [
6859
6826
  ...refactorConfigHelp,
6860
6827
  ...releasesConfigHelp,
6861
6828
  ...reviewConfigHelp,
6862
- ...roamConfigHelp,
6863
6829
  ...runConfigHelp,
6864
6830
  ...seqConfigHelp,
6865
6831
  ...sessionsConfigHelp,
@@ -7989,7 +7955,7 @@ async function fetchAssignedIssues(cwd, entry) {
7989
7955
  createdAt: issue.createdAt,
7990
7956
  author: issue.author?.login ?? "unknown",
7991
7957
  labels: (issue.labels ?? []).flatMap(
7992
- (label2) => label2.name ? [label2.name] : []
7958
+ (label) => label.name ? [label.name] : []
7993
7959
  )
7994
7960
  }));
7995
7961
  }
@@ -8343,7 +8309,7 @@ function isPickable(filter) {
8343
8309
  const type = issue.issueType?.name?.toLowerCase();
8344
8310
  if (type && excludedTypes.has(type)) return false;
8345
8311
  return !(issue.labels?.nodes ?? []).some(
8346
- (label2) => label2?.name && excludedLabels.has(label2.name.toLowerCase())
8312
+ (label) => label?.name && excludedLabels.has(label.name.toLowerCase())
8347
8313
  );
8348
8314
  };
8349
8315
  }
@@ -8362,7 +8328,7 @@ function toPickup(node, board, order) {
8362
8328
  createdAt: issue.createdAt ?? "",
8363
8329
  author: issue.author?.login ?? "unknown",
8364
8330
  labels: (issue.labels?.nodes ?? []).flatMap(
8365
- (label2) => label2?.name ? [label2.name] : []
8331
+ (label) => label?.name ? [label.name] : []
8366
8332
  ),
8367
8333
  project: board.project,
8368
8334
  projectTitle: board.title,
@@ -9193,8 +9159,8 @@ var LINKED_FROM_HEADER = "x-assist-linked-from";
9193
9159
  function forwardToPeer(req, res, node, url) {
9194
9160
  const started = Date.now();
9195
9161
  const traceId = newTraceId();
9196
- const label2 = `link ${node} http: ${req.method} ${url.pathname} trace=${traceId}`;
9197
- const log2 = (outcome) => console.log(`${label2} -> ${outcome} (${Date.now() - started}ms)`);
9162
+ const label = `link ${node} http: ${req.method} ${url.pathname} trace=${traceId}`;
9163
+ const log2 = (outcome) => console.log(`${label} -> ${outcome} (${Date.now() - started}ms)`);
9198
9164
  const send = url.protocol === "https:" ? httpsRequest : httpRequest;
9199
9165
  return new Promise((resolve31) => {
9200
9166
  const upstream = send(
@@ -10946,8 +10912,8 @@ function resolveNamedRepoWriteLabel(globalRaw, name, source = "~/.assist.yml") {
10946
10912
  // src/commands/config/resolveSharedRepoBlock.ts
10947
10913
  async function resolveSharedRepoBlock(orm, repoName, cwd) {
10948
10914
  const shared = { repos: await listRepoConfigs(orm) };
10949
- const label2 = repoName === void 0 ? currentRepoLabel(shared, getCurrentOrigin(cwd)) : resolveNamedRepoWriteLabel(shared, repoName, SHARED_REPO_CONFIG_SOURCE);
10950
- return { label: label2, block: shared.repos[label2] ?? {} };
10915
+ const label = repoName === void 0 ? currentRepoLabel(shared, getCurrentOrigin(cwd)) : resolveNamedRepoWriteLabel(shared, repoName, SHARED_REPO_CONFIG_SOURCE);
10916
+ return { label, block: shared.repos[label] ?? {} };
10951
10917
  }
10952
10918
  function currentRepoLabel(shared, origin) {
10953
10919
  return matchRepoConfigKey(shared, origin, SHARED_REPO_CONFIG_SOURCE) ?? origin;
@@ -10989,8 +10955,8 @@ async function refreshRepoConfigCache(orm) {
10989
10955
  }
10990
10956
 
10991
10957
  // src/commands/config/saveSharedRepoBlock.ts
10992
- async function saveSharedRepoBlock(orm, label2, block) {
10993
- await saveRepoConfig(orm, label2, block);
10958
+ async function saveSharedRepoBlock(orm, label, block) {
10959
+ await saveRepoConfig(orm, label, block);
10994
10960
  await refreshRepoConfigCache(orm);
10995
10961
  }
10996
10962
 
@@ -10999,12 +10965,12 @@ async function applySharedRepoConfigSet(key, coerced, repoName, cwd = process.cw
10999
10965
  const globalOnly = globalOnlyRepoKeyError(key, "Set");
11000
10966
  if (globalOnly) return globalOnly;
11001
10967
  const orm = await getDb();
11002
- const { label: label2, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
10968
+ const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
11003
10969
  const updatedBlock = setNestedValue(block, key, coerced);
11004
10970
  const validation = validateConfig(updatedBlock, key, repoConfigSchema);
11005
10971
  if (!validation.ok) return validation;
11006
- await saveSharedRepoBlock(orm, label2, updatedBlock);
11007
- return { ok: true, target: "repo", label: label2 };
10972
+ await saveSharedRepoBlock(orm, label, updatedBlock);
10973
+ return { ok: true, target: "repo", label };
11008
10974
  }
11009
10975
 
11010
10976
  // src/commands/sessions/web/applyScopedConfigSet.ts
@@ -11205,11 +11171,11 @@ async function applySharedRepoConfigUnset(key, repoName, cwd = process.cwd()) {
11205
11171
  const globalOnly = globalOnlyRepoKeyError(key, "Unset");
11206
11172
  if (globalOnly) return globalOnly;
11207
11173
  const orm = await getDb();
11208
- const { label: label2, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
11174
+ const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
11209
11175
  const unset = unsetRepoBlockKey(block, key);
11210
11176
  if (!unset.ok) return unset;
11211
- if (unset.removed) await saveSharedRepoBlock(orm, label2, unset.block);
11212
- return { ok: true, target: "repo", label: label2, removed: unset.removed };
11177
+ if (unset.removed) await saveSharedRepoBlock(orm, label, unset.block);
11178
+ return { ok: true, target: "repo", label, removed: unset.removed };
11213
11179
  }
11214
11180
 
11215
11181
  // src/commands/sessions/web/applyScopedConfigUnset.ts
@@ -11958,10 +11924,10 @@ function renderRestartMenu(items2, selected) {
11958
11924
  const pointer = active ? chalk12.cyan("\u276F ") : " ";
11959
11925
  const number = chalk12.dim(`${i + 1}. `);
11960
11926
  const note = item.note ? chalk12.dim(` (${item.note})`) : "";
11961
- let label2 = item.label;
11962
- if (item.disabled) label2 = chalk12.dim(label2);
11963
- else if (active) label2 = chalk12.cyan.bold(label2);
11964
- lines2.push(`${pointer}${number}${label2}${note}`);
11927
+ let label = item.label;
11928
+ if (item.disabled) label = chalk12.dim(label);
11929
+ else if (active) label = chalk12.cyan.bold(label);
11930
+ lines2.push(`${pointer}${number}${label}${note}`);
11965
11931
  });
11966
11932
  lines2.push(chalk12.dim("\u2191/\u2193 move \xB7 1-3 jump \xB7 enter select \xB7 esc close"));
11967
11933
  return lines2.join("\n");
@@ -13834,7 +13800,7 @@ var keyboardInput = () => {
13834
13800
  };
13835
13801
  function renderLineChart({
13836
13802
  title,
13837
- label: label2,
13803
+ label,
13838
13804
  seriesTitle,
13839
13805
  labels,
13840
13806
  values,
@@ -13850,7 +13816,7 @@ function renderLineChart({
13850
13816
  });
13851
13817
  const grid = new contrib.grid({ rows: 1, cols: 1, screen });
13852
13818
  const line = grid.set(0, 0, 1, 1, contrib.line, {
13853
- label: ` ${label2} (press q to close) `,
13819
+ label: ` ${label} (press q to close) `,
13854
13820
  showLegend: true,
13855
13821
  legend: { width: Math.max(12, seriesTitle.length + 2) },
13856
13822
  xLabelPadding: 3,
@@ -14073,10 +14039,10 @@ function renderAdviceBody(fragment, context) {
14073
14039
  // src/commands/advise/adviceConditions.ts
14074
14040
  import { existsSync as existsSync36 } from "fs";
14075
14041
  import { join as join40 } from "path";
14076
- function repoFile(file, label2) {
14042
+ function repoFile(file, label) {
14077
14043
  return {
14078
- whenMet: `the repo has ${label2}`,
14079
- whenUnmet: `the repo has no ${label2}`,
14044
+ whenMet: `the repo has ${label}`,
14045
+ whenUnmet: `the repo has no ${label}`,
14080
14046
  matches: ({ rootDir }) => existsSync36(join40(rootDir, file))
14081
14047
  };
14082
14048
  }
@@ -14875,13 +14841,13 @@ function parseChartSeries(lines2) {
14875
14841
  if (parts.length < 2) {
14876
14842
  throw new Error(`Expected a label and a value, got: ${trimmed}`);
14877
14843
  }
14878
- const label2 = parts.slice(0, -1).join(" ");
14844
+ const label = parts.slice(0, -1).join(" ");
14879
14845
  const raw = parts[parts.length - 1];
14880
14846
  const value = Number(raw);
14881
14847
  if (!Number.isFinite(value)) {
14882
14848
  throw new Error(`Value "${raw}" is not numeric, on line: ${trimmed}`);
14883
14849
  }
14884
- points.push({ label: label2, value });
14850
+ points.push({ label, value });
14885
14851
  }
14886
14852
  return points;
14887
14853
  }
@@ -15182,7 +15148,7 @@ import { eq as eq24 } from "drizzle-orm";
15182
15148
  // src/commands/backlog/beginAssociation.ts
15183
15149
  import chalk42 from "chalk";
15184
15150
  import { eq as eq23 } from "drizzle-orm";
15185
- async function beginAssociation(id, options2, clearPatch, label2) {
15151
+ async function beginAssociation(id, options2, clearPatch, label) {
15186
15152
  const found = await findOneItem(id);
15187
15153
  if (!found) {
15188
15154
  process.exitCode = 1;
@@ -15194,7 +15160,7 @@ async function beginAssociation(id, options2, clearPatch, label2) {
15194
15160
  await orm.update(items).set(clearPatch).where(eq23(items.id, itemId2));
15195
15161
  console.log(
15196
15162
  chalk42.green(
15197
- `Cleared ${label2} association on item ${formatItemId(itemId2)}.`
15163
+ `Cleared ${label} association on item ${formatItemId(itemId2)}.`
15198
15164
  )
15199
15165
  );
15200
15166
  return null;
@@ -16211,14 +16177,14 @@ async function reviewProposal(item, sessionId, confirmed) {
16211
16177
  }
16212
16178
 
16213
16179
  // src/commands/review/startChainedSession.ts
16214
- async function startChainedSession(label2, start2) {
16180
+ async function startChainedSession(label, start2) {
16215
16181
  if (process.env.ASSIST_SESSION !== "1") return;
16216
16182
  try {
16217
16183
  await start2();
16218
- console.log(`Started ${label2}.`);
16184
+ console.log(`Started ${label}.`);
16219
16185
  } catch (error) {
16220
16186
  console.error(
16221
- `Warning: could not start ${label2}: ${error instanceof Error ? error.message : String(error)}`
16187
+ `Warning: could not start ${label}: ${error instanceof Error ? error.message : String(error)}`
16222
16188
  );
16223
16189
  }
16224
16190
  }
@@ -18002,11 +17968,11 @@ async function phaseDone(id, phase, summary) {
18002
17968
  if (phaseNumber === void 0) return;
18003
17969
  const phaseIndex = phaseNumber - 1;
18004
17970
  const itemId2 = parseItemId(id);
18005
- const label2 = formatItemId(itemId2);
17971
+ const label = formatItemId(itemId2);
18006
17972
  const { orm } = await getReady();
18007
17973
  const item = await loadItem(orm, itemId2);
18008
17974
  if (item === void 0) {
18009
- console.log(chalk79.red(`Item ${label2} not found.`));
17975
+ console.log(chalk79.red(`Item ${label} not found.`));
18010
17976
  return;
18011
17977
  }
18012
17978
  function signal() {
@@ -18019,7 +17985,7 @@ async function phaseDone(id, phase, summary) {
18019
17985
  if (item.status === "done") {
18020
17986
  signal();
18021
17987
  console.log(
18022
- chalk79.dim(`Item ${label2} already done, skipping phase advance.`)
17988
+ chalk79.dim(`Item ${label} already done, skipping phase advance.`)
18023
17989
  );
18024
17990
  return;
18025
17991
  }
@@ -18030,7 +17996,7 @@ async function phaseDone(id, phase, summary) {
18030
17996
  await setCurrentPhase(id, phaseNumber + 1);
18031
17997
  signal();
18032
17998
  console.log(
18033
- chalk79.green(`Phase ${phaseNumber} of item ${label2} marked as complete.`)
17999
+ chalk79.green(`Phase ${phaseNumber} of item ${label} marked as complete.`)
18034
18000
  );
18035
18001
  }
18036
18002
 
@@ -18098,30 +18064,30 @@ async function surfaceCreatedItem(slashCommand, id) {
18098
18064
  import chalk81 from "chalk";
18099
18065
  async function tryRunById(id, options2) {
18100
18066
  const numericId = parseItemId(id);
18101
- const label2 = formatItemId(numericId);
18067
+ const label = formatItemId(numericId);
18102
18068
  const { orm } = await getReady();
18103
18069
  const item = await loadItem(orm, numericId);
18104
18070
  if (!item) {
18105
- console.log(chalk81.red(`Item ${label2} not found.`));
18071
+ console.log(chalk81.red(`Item ${label} not found.`));
18106
18072
  return false;
18107
18073
  }
18108
18074
  if (item.status === "done") {
18109
- console.log(chalk81.red(`Item ${label2} is already done.`));
18075
+ console.log(chalk81.red(`Item ${label} is already done.`));
18110
18076
  return false;
18111
18077
  }
18112
18078
  if (item.status === "wontdo") {
18113
- console.log(chalk81.red(`Item ${label2} is marked won't do.`));
18079
+ console.log(chalk81.red(`Item ${label} is marked won't do.`));
18114
18080
  return false;
18115
18081
  }
18116
18082
  const hasDeps = (item.links ?? []).some((l) => l.type === "depends-on");
18117
18083
  if (hasDeps && isBlocked(item, await loadItemSummaries(orm, getOrigin()))) {
18118
18084
  console.log(
18119
- chalk81.red(`Item ${label2} is blocked by unresolved dependencies.`)
18085
+ chalk81.red(`Item ${label} is blocked by unresolved dependencies.`)
18120
18086
  );
18121
18087
  return false;
18122
18088
  }
18123
18089
  console.log(chalk81.bold(`
18124
- Running backlog item ${label2}...
18090
+ Running backlog item ${label}...
18125
18091
  `));
18126
18092
  await run2(id, options2);
18127
18093
  return true;
@@ -18640,15 +18606,15 @@ async function findPhase(id, phase) {
18640
18606
  }
18641
18607
 
18642
18608
  // src/commands/backlog/update/parseListIndex.ts
18643
- function parseListIndex(raw, length, label2) {
18609
+ function parseListIndex(raw, length, label) {
18644
18610
  if (!/^\d+$/.test(raw)) {
18645
- return { ok: false, error: `${label2} must be a positive integer.` };
18611
+ return { ok: false, error: `${label} must be a positive integer.` };
18646
18612
  }
18647
18613
  const index2 = Number.parseInt(raw, 10);
18648
18614
  if (index2 < 1 || index2 > length) {
18649
18615
  return {
18650
18616
  ok: false,
18651
- error: `${label2} ${index2} is out of range (1-${length}).`
18617
+ error: `${label} ${index2} is out of range (1-${length}).`
18652
18618
  };
18653
18619
  }
18654
18620
  return { ok: true, index: index2 };
@@ -19366,8 +19332,8 @@ function printPhaseTasks(phase) {
19366
19332
  function phaseHeader(index2, name, isCurrent) {
19367
19333
  const phaseNumber = index2 + 1;
19368
19334
  const marker2 = isCurrent ? chalk108.green("\u25B6 ") : " ";
19369
- const label2 = isCurrent ? chalk108.green.bold(`Phase ${phaseNumber}: ${name}`) : `${chalk108.bold(`Phase ${phaseNumber}:`)} ${name}`;
19370
- return `${marker2}${label2}`;
19335
+ const label = isCurrent ? chalk108.green.bold(`Phase ${phaseNumber}: ${name}`) : `${chalk108.bold(`Phase ${phaseNumber}:`)} ${name}`;
19336
+ return `${marker2}${label}`;
19371
19337
  }
19372
19338
  function printPhaseSessions(sessions) {
19373
19339
  if (sessions.length === 0) return;
@@ -20691,10 +20657,10 @@ function runHelp(args) {
20691
20657
  var SAFETY_DEPTH = 10;
20692
20658
  var CONCURRENCY = 8;
20693
20659
  var interactive = !isClaudeCode();
20694
- function showProgress(p, label2) {
20660
+ function showProgress(p, label) {
20695
20661
  if (!interactive) return;
20696
20662
  const pct = Math.round(p.done / p.total * 100);
20697
- process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${label2}...`);
20663
+ process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${label}...`);
20698
20664
  }
20699
20665
  async function resolveCommand2(cli, path108, description, depth, p) {
20700
20666
  showProgress(p, path108.join(" "));
@@ -20940,8 +20906,8 @@ function denyList() {
20940
20906
  for (const rule of merged) {
20941
20907
  const inProject = projectPatterns.has(rule.pattern);
20942
20908
  const inGlobal = globalPatterns.has(rule.pattern);
20943
- const label2 = inProject && inGlobal ? chalk112.dim(" (project, overrides global)") : inGlobal ? chalk112.dim(" (global)") : "";
20944
- console.log(`${chalk112.red(rule.pattern)} \u2192 ${rule.message}${label2}`);
20909
+ const label = inProject && inGlobal ? chalk112.dim(" (project, overrides global)") : inGlobal ? chalk112.dim(" (global)") : "";
20910
+ console.log(`${chalk112.red(rule.pattern)} \u2192 ${rule.message}${label}`);
20945
20911
  }
20946
20912
  }
20947
20913
 
@@ -22959,8 +22925,8 @@ async function browserInspect(selector, options2) {
22959
22925
  url: options2.url,
22960
22926
  ...query
22961
22927
  });
22962
- const label2 = options2.text ? `text ${JSON.stringify(options2.text)}` : `selector ${selector}`;
22963
- for (const line of formatInspectMatches(result, label2)) console.log(line);
22928
+ const label = options2.text ? `text ${JSON.stringify(options2.text)}` : `selector ${selector}`;
22929
+ for (const line of formatInspectMatches(result, label)) console.log(line);
22964
22930
  }
22965
22931
 
22966
22932
  // src/commands/browser/browserSnapshot.ts
@@ -24250,8 +24216,8 @@ function printNodes(nodes, prefix2) {
24250
24216
  const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
24251
24217
  const childPrefix = isLast ? " " : "\u2502 ";
24252
24218
  const isMissing = nodes[i].relativePath.startsWith("[MISSING]");
24253
- const label2 = isMissing ? chalk157.red(nodes[i].relativePath) : nodes[i].relativePath;
24254
- console.log(`${prefix2}${connector}${label2}`);
24219
+ const label = isMissing ? chalk157.red(nodes[i].relativePath) : nodes[i].relativePath;
24220
+ console.log(`${prefix2}${connector}${label}`);
24255
24221
  printNodes(nodes[i].children, prefix2 + childPrefix);
24256
24222
  }
24257
24223
  }
@@ -25700,11 +25666,11 @@ function applyFixStructurePlan(plan2) {
25700
25666
  }
25701
25667
  if (labelRemovals.length > 0) {
25702
25668
  writeLineNow(
25703
- `${where} removing ${labelRemovals.map((label2) => label2.name).join(", ")}`
25669
+ `${where} removing ${labelRemovals.map((label) => label.name).join(", ")}`
25704
25670
  );
25705
25671
  removeIssueLabels(
25706
25672
  entry.issue.id,
25707
- labelRemovals.map((label2) => label2.id)
25673
+ labelRemovals.map((label) => label.id)
25708
25674
  );
25709
25675
  }
25710
25676
  }
@@ -25736,8 +25702,8 @@ function describe3(entry) {
25736
25702
  `${where} is still ${entry.typeChange.from ?? "untyped"}, not ${entry.typeChange.to}`
25737
25703
  );
25738
25704
  }
25739
- for (const label2 of entry.labelRemovals) {
25740
- notes.push(`${where} still carries ${label2.name}`);
25705
+ for (const label of entry.labelRemovals) {
25706
+ notes.push(`${where} still carries ${label.name}`);
25741
25707
  }
25742
25708
  return notes;
25743
25709
  }
@@ -25782,7 +25748,7 @@ function parseIssueNode(node) {
25782
25748
  title: raw.title,
25783
25749
  repo,
25784
25750
  typeName: raw.issueType?.name ?? null,
25785
- labels: (raw.labels?.nodes ?? []).filter((label2) => label2 !== null),
25751
+ labels: (raw.labels?.nodes ?? []).filter((label) => label !== null),
25786
25752
  childIds: (raw.subIssues?.nodes ?? []).filter((child) => child !== null).map((child) => child.id)
25787
25753
  };
25788
25754
  }
@@ -25813,7 +25779,7 @@ function fetchRootIssue(target) {
25813
25779
  function matchedLabels(labels, stripLabels) {
25814
25780
  if (stripLabels.length === 0) return [];
25815
25781
  const wanted = new Set(stripLabels.map((name) => name.trim().toLowerCase()));
25816
- return labels.filter((label2) => wanted.has(label2.name.trim().toLowerCase()));
25782
+ return labels.filter((label) => wanted.has(label.name.trim().toLowerCase()));
25817
25783
  }
25818
25784
 
25819
25785
  // src/commands/github/issue/fixStructure/normaliseTypeName.ts
@@ -26015,8 +25981,8 @@ function annotate(entry) {
26015
25981
  } else {
26016
25982
  notes.push(chalk170.dim(entry.issue.typeName ?? "no type"));
26017
25983
  }
26018
- for (const label2 of entry.labelRemovals) {
26019
- notes.push(chalk170.yellow(`-${label2.name}`));
25984
+ for (const label of entry.labelRemovals) {
25985
+ notes.push(chalk170.yellow(`-${label.name}`));
26020
25986
  }
26021
25987
  return notes;
26022
25988
  }
@@ -26289,7 +26255,7 @@ var minGhAttachVersion = "2.99.0";
26289
26255
 
26290
26256
  // src/commands/github/issue/collectLabels.ts
26291
26257
  function collectLabels(value, previous) {
26292
- const added = value.split(",").map((label2) => label2.trim()).filter((label2) => label2.length > 0);
26258
+ const added = value.split(",").map((label) => label.trim()).filter((label) => label.length > 0);
26293
26259
  return [...previous, ...added];
26294
26260
  }
26295
26261
 
@@ -26533,11 +26499,11 @@ function matchLabel(names, wanted) {
26533
26499
  }
26534
26500
  function resolveIssueLabels(target, wanted) {
26535
26501
  const names = readRepoLabels(target);
26536
- return wanted.map((label2) => {
26537
- const match = matchLabel(names, label2);
26502
+ return wanted.map((label) => {
26503
+ const match = matchLabel(names, label);
26538
26504
  if (!match) {
26539
26505
  throw new Error(
26540
- `${target.owner}/${target.repo} has no ${label2} label. It has ${names.join(", ")}`
26506
+ `${target.owner}/${target.repo} has no ${label} label. It has ${names.join(", ")}`
26541
26507
  );
26542
26508
  }
26543
26509
  return match;
@@ -26825,7 +26791,7 @@ function runGhWithAttachments(args, attachments) {
26825
26791
  function runGhIssueCreate(title, body, repo, metadata2, attachments = []) {
26826
26792
  const args = ["issue", "create", "--title", title, "--body", body];
26827
26793
  if (repo) args.push("--repo", repo);
26828
- for (const label2 of metadata2?.labels ?? []) args.push("--label", label2);
26794
+ for (const label of metadata2?.labels ?? []) args.push("--label", label);
26829
26795
  if (metadata2?.milestone) args.push("--milestone", metadata2.milestone);
26830
26796
  args.push(...attachArgs(attachments));
26831
26797
  return runGhWithAttachments(args, attachments);
@@ -27259,9 +27225,9 @@ function toIssueProjectItem(node) {
27259
27225
  }
27260
27226
 
27261
27227
  // src/commands/github/issue/parseIssueProjectItems.ts
27262
- function parseIssueProjectItems(raw, label2) {
27228
+ function parseIssueProjectItems(raw, label) {
27263
27229
  const issue = JSON.parse(raw).data?.repository?.issue;
27264
- if (!issue?.id) throw new Error(`No issue ${label2} could be read`);
27230
+ if (!issue?.id) throw new Error(`No issue ${label} could be read`);
27265
27231
  const items2 = (issue.projectItems?.nodes ?? []).map(toIssueProjectItem).filter((item) => item !== void 0);
27266
27232
  return { issueId: issue.id, items: items2 };
27267
27233
  }
@@ -30665,10 +30631,10 @@ function agentFooter(unresolvedCount) {
30665
30631
  import chalk189 from "chalk";
30666
30632
  var plain = (text17) => text17;
30667
30633
  function colouredState(state) {
30668
- const label2 = `[${state}]`;
30669
- if (state === "APPROVED") return chalk189.green(label2);
30670
- if (state === "CHANGES_REQUESTED") return chalk189.red(label2);
30671
- return chalk189.yellow(label2);
30634
+ const label = `[${state}]`;
30635
+ if (state === "APPROVED") return chalk189.green(label);
30636
+ if (state === "CHANGES_REQUESTED") return chalk189.red(label);
30637
+ return chalk189.yellow(label);
30672
30638
  }
30673
30639
  function commentStyle() {
30674
30640
  if (isClaudeCode()) {
@@ -31237,8 +31203,8 @@ function isFile2(path108) {
31237
31203
  }
31238
31204
  }
31239
31205
  function parseScreenshotSpec(spec) {
31240
- const [label2, rawPath] = splitOnce(spec, "=") ?? ["", spec];
31241
- const [group, caption] = splitOnce(label2, "/") ?? ["", label2];
31206
+ const [label, rawPath] = splitOnce(spec, "=") ?? ["", spec];
31207
+ const [group, caption] = splitOnce(label, "/") ?? ["", label];
31242
31208
  const path108 = resolve23(rawPath.trim());
31243
31209
  const ext = extname5(path108).replace(/^\./, "").toLowerCase();
31244
31210
  if (!isFile2(path108))
@@ -32401,10 +32367,10 @@ async function readTime(target, options2 = {}) {
32401
32367
  prose + code * CODE_WORDS_PER_PROSE_WORD,
32402
32368
  wordsPerMinute
32403
32369
  );
32404
- const label2 = words === 1 ? "word" : "words";
32370
+ const label = words === 1 ? "word" : "words";
32405
32371
  const verdict = seconds > budgetSeconds ? ` \xB7 over the ~${formatReadDuration(budgetSeconds)} budget` : "";
32406
32372
  console.log(
32407
- `${words} ${label2} \xB7 ~${formatReadDuration(seconds)} read${verdict}`
32373
+ `${words} ${label} \xB7 ~${formatReadDuration(seconds)} read${verdict}`
32408
32374
  );
32409
32375
  }
32410
32376
  function resolveBudget(budget) {
@@ -32864,10 +32830,10 @@ async function ravendbQuery(connectionName, collection, options2) {
32864
32830
  // src/commands/registerRavendb.ts
32865
32831
  function registerRavendb(program) {
32866
32832
  const cmd = program.command("ravendb").description("RavenDB query utilities");
32867
- const auth2 = cmd.command("auth").description("Configure a named RavenDB connection");
32868
- auth2.command("add").description("Add a new connection").action(() => ravendbAuth.add());
32869
- auth2.command("list").description("List configured connections").action(() => ravendbAuth.list());
32870
- auth2.command("remove <name>").description("Remove a configured connection").action((name) => ravendbAuth.remove(name));
32833
+ const auth = cmd.command("auth").description("Configure a named RavenDB connection");
32834
+ auth.command("add").description("Add a new connection").action(() => ravendbAuth.add());
32835
+ auth.command("list").description("List configured connections").action(() => ravendbAuth.list());
32836
+ auth.command("remove <name>").description("Remove a configured connection").action((name) => ravendbAuth.remove(name));
32871
32837
  cmd.command("set-connection <name>").description("Set the default connection").action((name) => ravendbSetConnection(name));
32872
32838
  cmd.command("query [connection] [collection]").description("Query a RavenDB collection").option("--page-size <n>", "Documents per page", "25").option(
32873
32839
  "--sort <field>",
@@ -33003,11 +32969,11 @@ async function writeConfigKeys(writes, scope, cwd = process.cwd()) {
33003
32969
  }
33004
32970
  async function writeRepoBlock(writes, cwd) {
33005
32971
  const orm = await getDb();
33006
- const { label: label2, block } = await resolveSharedRepoBlock(orm, void 0, cwd);
32972
+ const { label, block } = await resolveSharedRepoBlock(orm, void 0, cwd);
33007
32973
  const applied = applyConfigWrites(block, writes, repoConfigSchema);
33008
32974
  if (!applied.ok) return applied;
33009
- await saveSharedRepoBlock(orm, label2, applied.updated);
33010
- return { ok: true, target: `${SHARED_REPO_CONFIG_SOURCE}, repo: ${label2}` };
32975
+ await saveSharedRepoBlock(orm, label, applied.updated);
32976
+ return { ok: true, target: `${SHARED_REPO_CONFIG_SOURCE}, repo: ${label}` };
33011
32977
  }
33012
32978
 
33013
32979
  // src/commands/releases/declaredStreamsInScope.ts
@@ -33723,9 +33689,9 @@ var LEVEL_COLOR = {
33723
33689
  };
33724
33690
  function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel, now) {
33725
33691
  const level = rateLimitLevel(pct, resetsAt, windowSeconds, now);
33726
- const label2 = LEVEL_COLOR[level](`${Math.round(pct)}%`);
33692
+ const label = LEVEL_COLOR[level](`${Math.round(pct)}%`);
33727
33693
  const timeLabel = resetsAt ? formatRateLimitTimeLeft(resetsAt, now) : fallbackLabel;
33728
- return `${label2} (${timeLabel})`;
33694
+ return `${label} (${timeLabel})`;
33729
33695
  }
33730
33696
  function buildLimitsSegment(rateLimits) {
33731
33697
  const fiveHrPct = rateLimits?.five_hour?.used_percentage;
@@ -33820,14 +33786,14 @@ function formatNumber(num) {
33820
33786
  return num.toLocaleString("en-US");
33821
33787
  }
33822
33788
  function colorizePercent(pct) {
33823
- const label2 = `${Math.round(pct)}%`;
33789
+ const label = `${Math.round(pct)}%`;
33824
33790
  switch (contextLevel(pct)) {
33825
33791
  case "red":
33826
- return chalk212.red(label2);
33792
+ return chalk212.red(label);
33827
33793
  case "yellow":
33828
- return chalk212.yellow(label2);
33794
+ return chalk212.yellow(label);
33829
33795
  default:
33830
- return label2;
33796
+ return label;
33831
33797
  }
33832
33798
  }
33833
33799
  async function statusLine() {
@@ -36496,19 +36462,19 @@ function nodesOf(at2, prefix2) {
36496
36462
  return [...dirs.sort(byName), ...files.sort(byName)];
36497
36463
  }
36498
36464
  function collapsedDirNode(name, at2, prefix2) {
36499
- let label2 = name;
36465
+ let label = name;
36500
36466
  let path108 = prefix2 ? `${prefix2}/${name}` : name;
36501
36467
  let node = at2;
36502
36468
  while (node.files.length === 0 && node.dirs.size === 1) {
36503
36469
  const [childName, child] = [...node.dirs][0];
36504
- label2 = `${label2}/${childName}`;
36470
+ label = `${label}/${childName}`;
36505
36471
  path108 = `${path108}/${childName}`;
36506
36472
  node = child;
36507
36473
  }
36508
36474
  const children = nodesOf(node, path108);
36509
36475
  return {
36510
36476
  kind: "dir",
36511
- name: label2,
36477
+ name: label,
36512
36478
  path: path108,
36513
36479
  additions: sum(children, "additions"),
36514
36480
  deletions: sum(children, "deletions"),
@@ -38095,8 +38061,8 @@ function total(usages) {
38095
38061
  format(sumOf(reported, (u) => u.cacheWrite))
38096
38062
  ];
38097
38063
  }
38098
- function row2(label2, values) {
38099
- return `| ${label2} | ${values.join(" | ")} |`;
38064
+ function row2(label, values) {
38065
+ return `| ${label} | ${values.join(" | ")} |`;
38100
38066
  }
38101
38067
  function buildTokenUsageTable(usages) {
38102
38068
  return [
@@ -38606,13 +38572,13 @@ function formatToolText(name, tool, summary) {
38606
38572
 
38607
38573
  // src/commands/review/reportReviewerToolUse.ts
38608
38574
  function reportReviewerToolUse(name, use, spinner, model) {
38609
- const label2 = reviewerLabel(name, model);
38575
+ const label = reviewerLabel(name, model);
38610
38576
  if (spinner) {
38611
- spinner.text = formatToolText(label2, use.tool, use.summary);
38577
+ spinner.text = formatToolText(label, use.tool, use.summary);
38612
38578
  return;
38613
38579
  }
38614
38580
  const suffix = use.summary ? `: ${use.summary}` : "";
38615
- console.log(`[${label2}] ${use.tool}${suffix}`);
38581
+ console.log(`[${label}] ${use.tool}${suffix}`);
38616
38582
  }
38617
38583
 
38618
38584
  // src/commands/review/createClaudeLineHandler.ts
@@ -38642,16 +38608,16 @@ function summariseStderr(stderr) {
38642
38608
  return trimmed.length > SUMMARY_MAX_LEN ? `${trimmed.slice(0, SUMMARY_MAX_LEN - 1)}\u2026` : trimmed;
38643
38609
  }
38644
38610
  function finaliseReviewerSpinner(spinner, outcome) {
38645
- const label2 = reviewerLabel(outcome.name, outcome.model);
38611
+ const label = reviewerLabel(outcome.name, outcome.model);
38646
38612
  const elapsed = Math.round(outcome.elapsedMs / 1e3);
38647
38613
  if (outcome.exitCode === 0) {
38648
- spinner.succeed(`${label2} \u2014 done in ${elapsed}s`);
38614
+ spinner.succeed(`${label} \u2014 done in ${elapsed}s`);
38649
38615
  return;
38650
38616
  }
38651
38617
  const summary = summariseStderr(outcome.stderr ?? "");
38652
38618
  const suffix = summary ? `: ${summary}` : "";
38653
38619
  spinner.fail(
38654
- `${label2} \u2014 failed in ${elapsed}s (exit ${outcome.exitCode})${suffix}`
38620
+ `${label} \u2014 failed in ${elapsed}s (exit ${outcome.exitCode})${suffix}`
38655
38621
  );
38656
38622
  }
38657
38623
 
@@ -39322,9 +39288,9 @@ function createUi(spinnerUi) {
39322
39288
  function finishUi(ui, ok) {
39323
39289
  if (!ui.elapsed) return;
39324
39290
  const seconds = Math.round((Date.now() - ui.startedAt) / 1e3);
39325
- const label2 = `total: ${seconds}s`;
39326
- if (ok) ui.elapsed.succeed(label2);
39327
- else ui.elapsed.fail(label2);
39291
+ const label = `total: ${seconds}s`;
39292
+ if (ok) ui.elapsed.succeed(label);
39293
+ else ui.elapsed.fail(label);
39328
39294
  }
39329
39295
  async function runReviewPipeline(paths, options2) {
39330
39296
  const cachedClaude = cachedReviewerResult("claude", paths.claudePath);
@@ -39356,8 +39322,8 @@ var FILE_HEADER2 = /^\+\+\+ (?:b\/)?(.+)$/;
39356
39322
  var HUNK_HEADER4 = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/;
39357
39323
  var GUTTER_WIDTH = 6;
39358
39324
  function gutter(lineNumber) {
39359
- const label2 = lineNumber === null ? "" : String(lineNumber);
39360
- return `${label2.padStart(GUTTER_WIDTH, " ")} `;
39325
+ const label = lineNumber === null ? "" : String(lineNumber);
39326
+ return `${label.padStart(GUTTER_WIDTH, " ")} `;
39361
39327
  }
39362
39328
  function annotateDiffWithLineNumbers(diff3) {
39363
39329
  let inFile = false;
@@ -40360,8 +40326,8 @@ function listRules(target, options2 = {}) {
40360
40326
  const resolved = path89.resolve(target ?? process.cwd());
40361
40327
  const rules2 = readScopedRules(resolved);
40362
40328
  if (rules2.length === 0) {
40363
- const label2 = path89.relative(process.cwd(), resolved) || ".";
40364
- console.log(chalk246.gray(`No rules in scope for ${label2}`));
40329
+ const label = path89.relative(process.cwd(), resolved) || ".";
40330
+ console.log(chalk246.gray(`No rules in scope for ${label}`));
40365
40331
  return;
40366
40332
  }
40367
40333
  const base = findRepoRoot(scopeDirectory(resolved));
@@ -40725,10 +40691,10 @@ function seqSetConnection(name) {
40725
40691
  // src/commands/registerSeq.ts
40726
40692
  function registerSeq(program) {
40727
40693
  const cmd = program.command("seq").description("Seq log query utilities");
40728
- const auth2 = cmd.command("auth").description("Configure a Seq connection");
40729
- auth2.command("add").description("Add a new connection").action(() => seqAuth.add());
40730
- auth2.command("list").description("List configured connections").action(() => seqAuth.list());
40731
- auth2.command("remove <name>").description("Remove a configured connection").action((name) => seqAuth.remove(name));
40694
+ const auth = cmd.command("auth").description("Configure a Seq connection");
40695
+ auth.command("add").description("Add a new connection").action(() => seqAuth.add());
40696
+ auth.command("list").description("List configured connections").action(() => seqAuth.list());
40697
+ auth.command("remove <name>").description("Remove a configured connection").action((name) => seqAuth.remove(name));
40732
40698
  cmd.command("set-connection <name>").description("Set the default Seq connection").action((name) => seqSetConnection(name));
40733
40699
  cmd.command("query <filter>").description("Query Seq events with a filter expression").option("-c, --connection <name>", "Connection to use").option("-n, --count <n>", "Number of events to fetch", "50").option(
40734
40700
  "--from <date>",
@@ -41254,10 +41220,10 @@ async function sqlTables(connectionName) {
41254
41220
  // src/commands/registerSql.ts
41255
41221
  function registerSql(program) {
41256
41222
  const cmd = program.command("sql").description("MSSQL query utilities");
41257
- const auth2 = cmd.command("auth").description("Configure a SQL connection");
41258
- auth2.command("add").description("Add a new connection").action(() => sqlAuth.add());
41259
- auth2.command("list").description("List configured connections").action(() => sqlAuth.list());
41260
- auth2.command("remove <name>").description("Remove a configured connection").action((name) => sqlAuth.remove(name));
41223
+ const auth = cmd.command("auth").description("Configure a SQL connection");
41224
+ auth.command("add").description("Add a new connection").action(() => sqlAuth.add());
41225
+ auth.command("list").description("List configured connections").action(() => sqlAuth.list());
41226
+ auth.command("remove <name>").description("Remove a configured connection").action((name) => sqlAuth.remove(name));
41261
41227
  cmd.command("set-connection <name>").description("Set the default SQL connection").action((name) => sqlSetConnection(name));
41262
41228
  cmd.command("query <sql> [connection]").description("Execute a read-only SQL query (rejects mutating statements)").action(
41263
41229
  (query, connection) => sqlQuery(query, connection)
@@ -41351,27 +41317,27 @@ function unexpectedContent(skillDir) {
41351
41317
  }
41352
41318
 
41353
41319
  // src/commands/sync/reportPrune.ts
41354
- function reportPrune(label2, result, force) {
41320
+ function reportPrune(label, result, force) {
41355
41321
  if (result.orphans.length === 0) {
41356
- console.log(`No orphaned commands in ${label2}`);
41322
+ console.log(`No orphaned commands in ${label}`);
41357
41323
  } else if (force) {
41358
41324
  for (const name of result.removed) {
41359
- console.log(`Removed ${name} from ${label2}`);
41325
+ console.log(`Removed ${name} from ${label}`);
41360
41326
  }
41361
41327
  } else {
41362
- console.log(`Orphaned commands in ${label2} (run with --force to remove):`);
41328
+ console.log(`Orphaned commands in ${label} (run with --force to remove):`);
41363
41329
  for (const name of result.orphans) {
41364
41330
  console.log(` ${name}`);
41365
41331
  }
41366
41332
  }
41367
41333
  if (result.skipped.length > 0) {
41368
- console.log(`Left in place in ${label2} (not written by sync):`);
41334
+ console.log(`Left in place in ${label} (not written by sync):`);
41369
41335
  for (const { name, reason: reason4 } of result.skipped) {
41370
41336
  console.log(` ${name} - ${reason4}`);
41371
41337
  }
41372
41338
  }
41373
41339
  if (result.unmanaged.length === 0) return;
41374
- console.log(`Not managed by sync in ${label2} (never removed):`);
41340
+ console.log(`Not managed by sync in ${label} (never removed):`);
41375
41341
  for (const name of result.unmanaged) {
41376
41342
  console.log(` ${name}`);
41377
41343
  }
@@ -42033,8 +41999,8 @@ function askQuestion(rl, question) {
42033
41999
  }
42034
42000
 
42035
42001
  // src/commands/transcript/configure.ts
42036
- function buildPrompt4(label2, current) {
42037
- return current ? `${label2} [${current}]: ` : `${label2}: `;
42002
+ function buildPrompt4(label, current) {
42003
+ return current ? `${label} [${current}]: ` : `${label}: `;
42038
42004
  }
42039
42005
  function printExisting(existing) {
42040
42006
  console.log("Current configuration:");
@@ -42390,10 +42356,10 @@ function registerTranscript(program) {
42390
42356
  }
42391
42357
 
42392
42358
  // src/commands/verify/reportVerifyProblems.ts
42393
- function verifySection(label2, entries) {
42359
+ function verifySection(label, entries) {
42394
42360
  if (entries.length === 0) return void 0;
42395
42361
  const list6 = entries.sort().map((entry) => ` ${entry}`).join("\n");
42396
- return `${label2}:
42362
+ return `${label}:
42397
42363
  ${list6}`;
42398
42364
  }
42399
42365
  function reportVerifyProblems(problems, success) {
@@ -43896,165 +43862,6 @@ function registerWatch(program) {
43896
43862
  );
43897
43863
  }
43898
43864
 
43899
- // src/commands/roam/auth.ts
43900
- import { randomBytes } from "crypto";
43901
- import chalk260 from "chalk";
43902
-
43903
- // src/commands/roam/waitForCallback.ts
43904
- import { createServer as createServer3 } from "http";
43905
- function respondHtml(res, status2, title) {
43906
- res.writeHead(status2, { "Content-Type": "text/html" });
43907
- res.end(
43908
- `<html><body><h1>${title}</h1><p>You can close this tab.</p></body></html>`
43909
- );
43910
- }
43911
- function extractCode(url, expectedState) {
43912
- const error = url.searchParams.get("error");
43913
- if (error) throw new Error(`Authorization denied: ${error}`);
43914
- const state = url.searchParams.get("state");
43915
- if (state !== expectedState)
43916
- throw new Error("State mismatch \u2014 possible CSRF attack");
43917
- const code = url.searchParams.get("code");
43918
- if (!code) throw new Error("No authorization code received");
43919
- return code;
43920
- }
43921
- function waitForCallback(port, expectedState) {
43922
- return new Promise((resolve31, reject) => {
43923
- const timeout = setTimeout(() => {
43924
- server.close();
43925
- reject(new Error("Authorization timed out after 120 seconds"));
43926
- }, 12e4);
43927
- const server = createServer3((req, res) => {
43928
- const url = new URL(req.url ?? "/", `http://localhost:${port}`);
43929
- if (url.pathname !== "/callback") {
43930
- res.writeHead(404);
43931
- res.end();
43932
- return;
43933
- }
43934
- clearTimeout(timeout);
43935
- try {
43936
- const code = extractCode(url, expectedState);
43937
- respondHtml(res, 200, "Authorization successful!");
43938
- server.close();
43939
- resolve31(code);
43940
- } catch (error) {
43941
- respondHtml(res, 400, error.message);
43942
- server.close();
43943
- reject(error);
43944
- }
43945
- });
43946
- server.listen(port);
43947
- });
43948
- }
43949
-
43950
- // src/commands/roam/authorizeInBrowser.ts
43951
- var PORT = 14523;
43952
- var REDIRECT_URI = `http://localhost:${PORT}/callback`;
43953
- var SCOPES = "user:read meetings:read transcript:read user:read.email";
43954
- function buildAuthorizeUrl(clientId, state) {
43955
- const params = new URLSearchParams({
43956
- client_id: clientId,
43957
- redirect_uri: REDIRECT_URI,
43958
- response_type: "code",
43959
- scope: SCOPES,
43960
- state
43961
- });
43962
- return `https://ro.am/oauth/authorize?${params}`;
43963
- }
43964
- async function authorizeInBrowser(clientId, state) {
43965
- openBrowser(buildAuthorizeUrl(clientId, state));
43966
- const code = await waitForCallback(PORT, state);
43967
- return { code, redirectUri: REDIRECT_URI };
43968
- }
43969
-
43970
- // src/commands/roam/exchangeToken.ts
43971
- async function exchangeToken(params) {
43972
- const body = new URLSearchParams({
43973
- grant_type: "authorization_code",
43974
- code: params.code,
43975
- client_id: params.clientId,
43976
- client_secret: params.clientSecret,
43977
- redirect_uri: params.redirectUri
43978
- });
43979
- const response = await fetch("https://ro.am/oauth/token", {
43980
- method: "POST",
43981
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
43982
- body: body.toString()
43983
- });
43984
- if (!response.ok) {
43985
- const text17 = await response.text();
43986
- throw new Error(`Token exchange failed (${response.status}): ${text17}`);
43987
- }
43988
- return response.json();
43989
- }
43990
-
43991
- // src/commands/roam/promptCredentials.ts
43992
- import enquirer10 from "enquirer";
43993
- function censor(value) {
43994
- const visible = value.slice(-4);
43995
- return `${"*".repeat(value.length - 4)}${visible}`;
43996
- }
43997
- function label(name, existing) {
43998
- return existing ? `${name} (${censor(existing)})` : name;
43999
- }
44000
- async function promptField(name, existing) {
44001
- const { value } = await enquirer10.prompt({
44002
- type: "input",
44003
- name: "value",
44004
- message: `${label(name, existing)}:`,
44005
- validate: (v) => v.trim().length > 0 || !!existing || `${name} is required`
44006
- });
44007
- return value.trim() || existing || "";
44008
- }
44009
- async function promptCredentials2(existing) {
44010
- const clientId = await promptField("Client ID", existing?.clientId);
44011
- const clientSecret = await promptField(
44012
- "Client Secret",
44013
- existing?.clientSecret
44014
- );
44015
- if (!clientId || !clientSecret) {
44016
- throw new Error("Client ID and Client Secret are required");
44017
- }
44018
- return { clientId, clientSecret };
44019
- }
44020
-
44021
- // src/commands/roam/auth.ts
44022
- async function auth() {
44023
- const config = loadGlobalConfigRaw();
44024
- const { clientId, clientSecret } = await promptCredentials2(
44025
- config.roam
44026
- );
44027
- const existingRoam = config.roam ?? {};
44028
- config.roam = { ...existingRoam, clientId, clientSecret };
44029
- saveGlobalConfig(config);
44030
- const state = randomBytes(16).toString("hex");
44031
- console.log(
44032
- chalk260.yellow("\nEnsure this Redirect URI is set in your Roam OAuth app:")
44033
- );
44034
- console.log(chalk260.white("http://localhost:14523/callback\n"));
44035
- console.log(chalk260.blue("Opening browser for authorization..."));
44036
- console.log(chalk260.dim("Waiting for authorization callback..."));
44037
- const { code, redirectUri } = await authorizeInBrowser(clientId, state);
44038
- console.log(chalk260.dim("Exchanging code for tokens..."));
44039
- const tokens = await exchangeToken({
44040
- code,
44041
- clientId,
44042
- clientSecret,
44043
- redirectUri
44044
- });
44045
- config.roam = {
44046
- clientId,
44047
- clientSecret,
44048
- accessToken: tokens.access_token,
44049
- refreshToken: tokens.refresh_token,
44050
- tokenExpiresAt: Date.now() + tokens.expires_in * 1e3
44051
- };
44052
- saveGlobalConfig(config);
44053
- console.log(
44054
- chalk260.green("Roam credentials and tokens saved to ~/.assist.yml")
44055
- );
44056
- }
44057
-
44058
43865
  // src/commands/roam/postRoamActivity.ts
44059
43866
  import { execFileSync as execFileSync32 } from "child_process";
44060
43867
  import { readdirSync as readdirSync23, readFileSync as readFileSync65, statSync as statSync13 } from "fs";
@@ -44127,12 +43934,10 @@ async function stopCodexIcon() {
44127
43934
  // src/commands/roam/registerRoam.ts
44128
43935
  function registerRoam(program) {
44129
43936
  const roamCommand = program.command("roam").description("Roam Research utilities");
44130
- roamCommand.command("auth").description("Configure Roam API credentials").action(auth);
44131
43937
  roamCommand.command("show-claude-code-icon").description("Forward Claude Code hook activity to Roam local API").action(showClaudeCodeIcon);
44132
43938
  roamCommand.command("stop-claude-code-icon").description("Signal Claude Code session stop to Roam local API").action(stopClaudeCodeIcon);
44133
43939
  roamCommand.command("show-codex-icon").description("Forward Codex hook activity to Roam local API").action(showCodexIcon);
44134
43940
  roamCommand.command("stop-codex-icon").description("Signal Codex session stop to Roam local API").action(stopCodexIcon);
44135
- configHelp(roamCommand, roamConfigHelp);
44136
43941
  }
44137
43942
 
44138
43943
  // src/commands/run/formatConfiguredCommands.ts
@@ -44275,13 +44080,13 @@ import { join as join103 } from "path";
44275
44080
  // src/commands/run/editRepoRunList.ts
44276
44081
  async function editRepoRunList(repoName, cwd, edit2) {
44277
44082
  const orm = await getDb();
44278
- const { label: label2, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
44279
- const run4 = edit2(block.run ?? [], label2);
44083
+ const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
44084
+ const run4 = edit2(block.run ?? [], label);
44280
44085
  const updated2 = { ...block, run: run4 };
44281
44086
  const validation = validateConfig(updated2, "run", repoConfigSchema);
44282
44087
  if (!validation.ok) exitWithConfigErrors(validation.errors);
44283
- await saveSharedRepoBlock(orm, label2, updated2);
44284
- return label2;
44088
+ await saveSharedRepoBlock(orm, label, updated2);
44089
+ return label;
44285
44090
  }
44286
44091
 
44287
44092
  // src/commands/run/ensureNoDuplicateRun.ts
@@ -44458,12 +44263,12 @@ async function add4() {
44458
44263
  const entry = buildRunEntry(name, command, args, options2);
44459
44264
  const display = formatDisplay(command, args);
44460
44265
  if (repo !== void 0) {
44461
- const label2 = await addRepoRunConfig(
44266
+ const label = await addRepoRunConfig(
44462
44267
  entry,
44463
44268
  typeof repo === "string" ? repo : void 0
44464
44269
  );
44465
44270
  console.log(
44466
- `Added run configuration: ${name} -> ${display} (repo: ${label2})`
44271
+ `Added run configuration: ${name} -> ${display} (repo: ${label})`
44467
44272
  );
44468
44273
  return;
44469
44274
  }
@@ -44562,9 +44367,9 @@ function isNamed(entry, name) {
44562
44367
  return "name" in entry && entry.name === name;
44563
44368
  }
44564
44369
  function removeRepoRunConfig(name, repoName, cwd = process.cwd()) {
44565
- return editRepoRunList(repoName, cwd, (runList, label2) => {
44370
+ return editRepoRunList(repoName, cwd, (runList, label) => {
44566
44371
  if (!runList.some((r) => isNamed(r, name))) {
44567
- console.error(`Run configuration "${name}" not found in repo ${label2}`);
44372
+ console.error(`Run configuration "${name}" not found in repo ${label}`);
44568
44373
  process.exit(1);
44569
44374
  }
44570
44375
  return runList.filter((r) => !isNamed(r, name));
@@ -44592,11 +44397,11 @@ function removeProjectRunConfig(name) {
44592
44397
  }
44593
44398
  async function remove2(name, options2 = {}) {
44594
44399
  if (options2.repo !== void 0) {
44595
- const label2 = await removeRepoRunConfig(
44400
+ const label = await removeRepoRunConfig(
44596
44401
  name,
44597
44402
  typeof options2.repo === "string" ? options2.repo : void 0
44598
44403
  );
44599
- console.log(`Removed run configuration: ${name} (repo: ${label2})`);
44404
+ console.log(`Removed run configuration: ${name} (repo: ${label})`);
44600
44405
  return;
44601
44406
  }
44602
44407
  removeProjectRunConfig(name);
@@ -44627,18 +44432,18 @@ function registerRun(program) {
44627
44432
  }
44628
44433
 
44629
44434
  // src/commands/sessions/nodes/formatLink.ts
44630
- import chalk261 from "chalk";
44435
+ import chalk260 from "chalk";
44631
44436
  var STATE_COLOURS = {
44632
- connected: chalk261.green,
44633
- connecting: chalk261.yellow,
44634
- disconnected: chalk261.red,
44635
- "version-blocked": chalk261.red
44437
+ connected: chalk260.green,
44438
+ connecting: chalk260.yellow,
44439
+ disconnected: chalk260.red,
44440
+ "version-blocked": chalk260.red
44636
44441
  };
44637
44442
  function formatLink(link3) {
44638
- const colour = STATE_COLOURS[link3.state] ?? chalk261.white;
44443
+ const colour = STATE_COLOURS[link3.state] ?? chalk260.white;
44639
44444
  const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
44640
44445
  const error = link3.error ? `
44641
- ${chalk261.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
44446
+ ${chalk260.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
44642
44447
  return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
44643
44448
  }
44644
44449
 
@@ -47146,13 +46951,13 @@ function parsePreviewMetadata(value) {
47146
46951
  if (!Array.isArray(value)) return void 0;
47147
46952
  const items2 = value.flatMap((entry) => {
47148
46953
  const {
47149
- label: label2,
46954
+ label,
47150
46955
  value: text17,
47151
46956
  url
47152
46957
  } = entry ?? {};
47153
- if (typeof label2 !== "string" || typeof text17 !== "string") return [];
46958
+ if (typeof label !== "string" || typeof text17 !== "string") return [];
47154
46959
  return [
47155
- typeof url === "string" ? { label: label2, value: text17, url } : { label: label2, value: text17 }
46960
+ typeof url === "string" ? { label, value: text17, url } : { label, value: text17 }
47156
46961
  ];
47157
46962
  });
47158
46963
  return items2.length > 0 ? items2 : void 0;
@@ -49034,12 +48839,12 @@ var portWaitTiming = { pollMs: 500, timeoutMs: 3e4 };
49034
48839
  function awaitServerPort(session, port, deps2) {
49035
48840
  const { sessions, clients, onStatusChange, notify: notify2 } = deps2;
49036
48841
  const deadline = Date.now() + portWaitTiming.timeoutMs;
49037
- const label2 = `session ${session.id} ("${session.name}")`;
48842
+ const label = `session ${session.id} ("${session.name}")`;
49038
48843
  const tick = () => {
49039
48844
  if (!session.pendingStart || sessions.get(session.id) !== session) return;
49040
48845
  const holder = findPortHolderPid(port);
49041
48846
  if (holder === void 0) {
49042
- daemonLog(`${label2} port ${port} freed`);
48847
+ daemonLog(`${label} port ${port} freed`);
49043
48848
  startHeldSession(
49044
48849
  session,
49045
48850
  sessions,
@@ -49055,7 +48860,7 @@ function awaitServerPort(session, port, deps2) {
49055
48860
  return;
49056
48861
  }
49057
48862
  daemonLog(
49058
- `${label2} gave up waiting for port ${port} after ${portWaitTiming.timeoutMs}ms`
48863
+ `${label} gave up waiting for port ${port} after ${portWaitTiming.timeoutMs}ms`
49059
48864
  );
49060
48865
  refuseSpawn(
49061
48866
  session,
@@ -50205,13 +50010,13 @@ async function collectHistory(linked) {
50205
50010
  }
50206
50011
 
50207
50012
  // src/commands/sessions/daemon/links/guardLinkCallback.ts
50208
- function guardLinkCallback(label2, callback) {
50013
+ function guardLinkCallback(label, callback) {
50209
50014
  return (...args) => {
50210
50015
  try {
50211
50016
  callback(...args);
50212
50017
  } catch (error) {
50213
50018
  daemonLog(
50214
- `${label2} threw; ignored so the daemon keeps running: ${error instanceof Error ? error.message : String(error)}`
50019
+ `${label} threw; ignored so the daemon keeps running: ${error instanceof Error ? error.message : String(error)}`
50215
50020
  );
50216
50021
  }
50217
50022
  };
@@ -50244,8 +50049,8 @@ function linkDeps(options2, callbacks) {
50244
50049
  var MAX_FAILURES = 3;
50245
50050
  var BACKOFF_MS = 6e4;
50246
50051
  var LaunchCircuitBreaker = class {
50247
- constructor(label2) {
50248
- this.label = label2;
50052
+ constructor(label) {
50053
+ this.label = label;
50249
50054
  }
50250
50055
  failures = 0;
50251
50056
  until = 0;
@@ -50529,9 +50334,9 @@ var relayOutput = (state, msg) => {
50529
50334
  appendScrollback(state, sessionId, msg.data);
50530
50335
  broadcastToViewers(state, { type: "output", sessionId, data: msg.data });
50531
50336
  };
50532
- var relayToCreator = (label2) => (state, msg) => {
50337
+ var relayToCreator = (label) => (state, msg) => {
50533
50338
  daemonLog(
50534
- `link ${state.node} ws: ${label2} ${msg.sessionId ?? msg.message}`
50339
+ `link ${state.node} ws: ${label} ${msg.sessionId ?? msg.message}`
50535
50340
  );
50536
50341
  const client = takePendingCreator(state);
50537
50342
  const reply2 = msg.type === "created" ? { ...msg, sessionId: nsId(state, msg) } : msg;
@@ -52385,7 +52190,7 @@ async function closeSession() {
52385
52190
  }
52386
52191
 
52387
52192
  // src/commands/sessions/nodes/listNodes.ts
52388
- import chalk262 from "chalk";
52193
+ import chalk261 from "chalk";
52389
52194
  async function nodesReport() {
52390
52195
  const live = await queryNodes();
52391
52196
  if (live)
@@ -52402,10 +52207,10 @@ async function listNodes(options2) {
52402
52207
  console.log(JSON.stringify(report, null, 2));
52403
52208
  return;
52404
52209
  }
52405
- console.log(`${report.local} ${chalk262.dim("(this node)")}`);
52210
+ console.log(`${report.local} ${chalk261.dim("(this node)")}`);
52406
52211
  if (!report.daemonRunning)
52407
- console.log(chalk262.dim(" daemon not running; showing configured links"));
52408
- if (report.links.length === 0) console.log(chalk262.dim(" no links"));
52212
+ console.log(chalk261.dim(" daemon not running; showing configured links"));
52213
+ if (report.links.length === 0) console.log(chalk261.dim(" no links"));
52409
52214
  for (const link3 of report.links) console.log(formatLink(link3));
52410
52215
  }
52411
52216
 
@@ -52427,7 +52232,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
52427
52232
  }
52428
52233
 
52429
52234
  // src/commands/sessions/nodes/printReport.ts
52430
- import chalk263 from "chalk";
52235
+ import chalk262 from "chalk";
52431
52236
  function printReport(report) {
52432
52237
  if (report.links.length === 0) {
52433
52238
  console.log(`${report.local} has no links`);
@@ -52441,11 +52246,11 @@ function printReport(report) {
52441
52246
  for (const diagnosis of report.links) printDiagnosis(diagnosis);
52442
52247
  }
52443
52248
  function printDiagnosis(diagnosis) {
52444
- console.log(`${chalk263.bold(diagnosis.name)} ${chalk263.dim(diagnosis.url)}`);
52249
+ console.log(`${chalk262.bold(diagnosis.name)} ${chalk262.dim(diagnosis.url)}`);
52445
52250
  for (const hop of diagnosis.hops) {
52446
- const mark = hop.ok ? chalk263.green("\u2713") : chalk263.red("\u2717");
52251
+ const mark = hop.ok ? chalk262.green("\u2713") : chalk262.red("\u2717");
52447
52252
  console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
52448
- if (hop.remediation) console.log(` ${chalk263.yellow(hop.remediation)}`);
52253
+ if (hop.remediation) console.log(` ${chalk262.yellow(hop.remediation)}`);
52449
52254
  }
52450
52255
  }
52451
52256
 
@@ -52517,14 +52322,14 @@ function registerDiagnoseCommands(nodes, calledBy4) {
52517
52322
  }
52518
52323
 
52519
52324
  // src/commands/sessions/nodes/linkNode.ts
52520
- import chalk266 from "chalk";
52325
+ import chalk265 from "chalk";
52521
52326
 
52522
52327
  // src/commands/sessions/nodes/notifyDaemonLinks.ts
52523
- import chalk264 from "chalk";
52328
+ import chalk263 from "chalk";
52524
52329
  async function notifyDaemonLinks() {
52525
52330
  if (!await isDaemonRunning()) {
52526
52331
  console.log(
52527
- chalk264.yellow(
52332
+ chalk263.yellow(
52528
52333
  "The sessions daemon is not running; it loads the links when it starts."
52529
52334
  )
52530
52335
  );
@@ -52532,11 +52337,11 @@ async function notifyDaemonLinks() {
52532
52337
  }
52533
52338
  try {
52534
52339
  await sendToDaemonAwaitAck({ type: "reload-links" });
52535
- console.log(chalk264.dim("The sessions daemon reloaded its links."));
52340
+ console.log(chalk263.dim("The sessions daemon reloaded its links."));
52536
52341
  } catch (error) {
52537
52342
  const message3 = error instanceof Error ? error.message : String(error);
52538
52343
  console.log(
52539
- chalk264.yellow(
52344
+ chalk263.yellow(
52540
52345
  `Could not notify the sessions daemon (${message3}); run \`assist daemon restart\` to apply the change.`
52541
52346
  )
52542
52347
  );
@@ -52544,7 +52349,7 @@ async function notifyDaemonLinks() {
52544
52349
  }
52545
52350
 
52546
52351
  // src/commands/sessions/nodes/readLinks.ts
52547
- import chalk265 from "chalk";
52352
+ import chalk264 from "chalk";
52548
52353
 
52549
52354
  // src/commands/sessions/nodes/writeLinks.ts
52550
52355
  async function writeLinks(links2) {
@@ -52567,7 +52372,7 @@ async function readLinks() {
52567
52372
  await writeLinks(links2);
52568
52373
  const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
52569
52374
  console.log(
52570
- chalk265.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
52375
+ chalk264.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
52571
52376
  );
52572
52377
  return links2;
52573
52378
  }
@@ -52623,7 +52428,7 @@ async function linkNode(name, url, options2) {
52623
52428
  throw new Error(`${name} is this node; link to a different node`);
52624
52429
  const link3 = await buildLink(name, url, options2);
52625
52430
  await writeLinks([...others, link3]);
52626
- console.log(chalk266.green(`Linked ${name} (${link3.url})`));
52431
+ console.log(chalk265.green(`Linked ${name} (${link3.url})`));
52627
52432
  await notifyDaemonLinks();
52628
52433
  }
52629
52434
 
@@ -52806,16 +52611,16 @@ function registerPeerActionCommands(nodes, calledBy4) {
52806
52611
  }
52807
52612
 
52808
52613
  // src/commands/sessions/nodes/unlinkNode.ts
52809
- import chalk267 from "chalk";
52614
+ import chalk266 from "chalk";
52810
52615
  async function unlinkNode(name) {
52811
52616
  const links2 = await readLinks();
52812
52617
  const remaining = links2.filter((link3) => link3.name !== name);
52813
52618
  if (remaining.length === links2.length) {
52814
- console.log(chalk267.yellow(`No link named ${name}`));
52619
+ console.log(chalk266.yellow(`No link named ${name}`));
52815
52620
  return;
52816
52621
  }
52817
52622
  await writeLinks(remaining);
52818
- console.log(chalk267.green(`Unlinked ${name}`));
52623
+ console.log(chalk266.green(`Unlinked ${name}`));
52819
52624
  await notifyDaemonLinks();
52820
52625
  }
52821
52626
 
@@ -53050,10 +52855,10 @@ function createProgram() {
53050
52855
  }
53051
52856
 
53052
52857
  // src/reportCliError.ts
53053
- import chalk268 from "chalk";
52858
+ import chalk267 from "chalk";
53054
52859
  function reportCliError(error) {
53055
52860
  if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError) {
53056
- console.error(chalk268.red(error.message));
52861
+ console.error(chalk267.red(error.message));
53057
52862
  } else {
53058
52863
  console.error(error);
53059
52864
  }