@staff0rd/assist 0.936.0 → 0.938.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.936.0",
9
+ version: "0.938.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -539,6 +539,18 @@ function deepMergeRawConfig(base, override) {
539
539
  return merged;
540
540
  }
541
541
 
542
+ // src/shared/mergeAdviceRules.ts
543
+ function adviceRules(raw) {
544
+ const advice = raw.advice;
545
+ return Array.isArray(advice?.rules) ? advice.rules : void 0;
546
+ }
547
+ function mergeAdviceRules(globalRaw, projectRaw) {
548
+ const globalRules = adviceRules(globalRaw);
549
+ const projectRules = adviceRules(projectRaw);
550
+ if (!globalRules || !projectRules) return void 0;
551
+ return [...globalRules, ...projectRules];
552
+ }
553
+
542
554
  // src/shared/mergeDenyRules.ts
543
555
  function mergeDenyRules(globalDeny, projectDeny) {
544
556
  if (!globalDeny && !projectDeny) return void 0;
@@ -573,7 +585,11 @@ function mergeRawConfigs(globalRaw, projectRaw) {
573
585
  globalRaw.run,
574
586
  projectRaw.run
575
587
  );
588
+ const adviceRules2 = mergeAdviceRules(globalRaw, projectRaw);
576
589
  const merged = deepMergeRawConfig(globalRaw, projectRaw);
590
+ if (adviceRules2 !== void 0) {
591
+ merged.advice = { ...merged.advice, rules: adviceRules2 };
592
+ }
577
593
  if (deny !== void 0) {
578
594
  merged.deny = deny;
579
595
  }
@@ -1163,7 +1179,8 @@ var assistConfigShape = {
1163
1179
  advice: z6.strictObject({
1164
1180
  sections: z6.partialRecord(z6.enum(adviceFragmentNames), z6.boolean()).default({}),
1165
1181
  extra: z6.string().optional(),
1166
- verify: z6.string().optional()
1182
+ verify: z6.string().optional(),
1183
+ rules: z6.array(z6.strictObject({ title: z6.string(), text: z6.string() })).optional()
1167
1184
  }).optional(),
1168
1185
  backup: z6.strictObject({
1169
1186
  dir: z6.string().default(DEFAULT_BACKUP_DIR),
@@ -6191,6 +6208,11 @@ var adviceConfigHelp = [
6191
6208
  key: "advice.verify",
6192
6209
  setter: 'assist config set advice.verify "Run make check"',
6193
6210
  note: "replaces the verify fragment's text and forces it in"
6211
+ },
6212
+ {
6213
+ key: "advice.rules",
6214
+ setter: "assist rules add '<text>' --title '<title>' --global",
6215
+ note: 'listed under "Your rules"; global and repo entries are concatenated, global first'
6194
6216
  }
6195
6217
  ];
6196
6218
 
@@ -14128,6 +14150,13 @@ ${renderAdviceBody(fragment, context)}`
14128
14150
  if (extra) sections.push(`## Repo notes
14129
14151
 
14130
14152
  ${extra}`);
14153
+ const rules2 = context.config.advice?.rules ?? [];
14154
+ if (rules2.length > 0)
14155
+ sections.push(
14156
+ `## Your rules
14157
+
14158
+ ${rules2.map(({ title, text: text17 }) => `- **${title}** \u2014 ${text17}`).join("\n")}`
14159
+ );
14131
14160
  if (sections.length === 0) return "";
14132
14161
  return [heading, ...sections].join("\n\n");
14133
14162
  }
@@ -40195,10 +40224,49 @@ function registerReview(program) {
40195
40224
  );
40196
40225
  }
40197
40226
 
40227
+ // src/commands/rules/addGlobalRule.ts
40228
+ import chalk244 from "chalk";
40229
+ function fail8(message3) {
40230
+ console.error(chalk244.red(message3));
40231
+ process.exitCode = 1;
40232
+ }
40233
+ function existingRules(globalConfigPath) {
40234
+ const advice = loadGlobalConfigRaw(globalConfigPath).advice;
40235
+ return Array.isArray(advice?.rules) ? advice.rules : [];
40236
+ }
40237
+ function addGlobalRule(text17, options2, globalConfigPath = getGlobalConfigPath()) {
40238
+ if (options2.scope !== void 0) {
40239
+ fail8(
40240
+ "--global writes to ~/.assist.yml and cannot be combined with --scope"
40241
+ );
40242
+ return;
40243
+ }
40244
+ const rule = text17.trim();
40245
+ const title = options2.title?.trim() ?? "";
40246
+ if (rule === "" || title === "") {
40247
+ fail8("Global rules need both rule text and --title");
40248
+ return;
40249
+ }
40250
+ const result = applyConfigSet(
40251
+ "advice.rules",
40252
+ [...existingRules(globalConfigPath), { title, text: rule }],
40253
+ true,
40254
+ process.cwd(),
40255
+ globalConfigPath
40256
+ );
40257
+ if (!result.ok) {
40258
+ fail8(result.errors.join("\n"));
40259
+ return;
40260
+ }
40261
+ console.log(
40262
+ `Added ${chalk244.cyan(title)} to advice.rules in ${globalConfigFileLabel(globalConfigPath)}`
40263
+ );
40264
+ }
40265
+
40198
40266
  // src/commands/rules/addRule.ts
40199
40267
  import { existsSync as existsSync72, readFileSync as readFileSync56, writeFileSync as writeFileSync44 } from "fs";
40200
40268
  import path87 from "path";
40201
- import chalk244 from "chalk";
40269
+ import chalk245 from "chalk";
40202
40270
 
40203
40271
  // src/commands/rules/insertRuleBullet.ts
40204
40272
  function ruleBullet({ code, title, text: text17 }) {
@@ -40334,7 +40402,7 @@ function read2(file) {
40334
40402
  function addRule(text17, options2) {
40335
40403
  const rule = text17.trim();
40336
40404
  if (rule === "") {
40337
- console.error(chalk244.red("Rule text is required"));
40405
+ console.error(chalk245.red("Rule text is required"));
40338
40406
  process.exitCode = 1;
40339
40407
  return;
40340
40408
  }
@@ -40352,13 +40420,13 @@ function addRule(text17, options2) {
40352
40420
  );
40353
40421
  updateScopedRulesIndex(root2);
40354
40422
  console.log(
40355
- `Added ${chalk244.cyan(code)} to ${path87.relative(process.cwd(), target) || target}`
40423
+ `Added ${chalk245.cyan(code)} to ${path87.relative(process.cwd(), target) || target}`
40356
40424
  );
40357
40425
  }
40358
40426
 
40359
40427
  // src/commands/rules/indexRules.ts
40360
40428
  import path88 from "path";
40361
- import chalk245 from "chalk";
40429
+ import chalk246 from "chalk";
40362
40430
  function indexRules() {
40363
40431
  const startDir = scopeDirectory(process.cwd());
40364
40432
  const root2 = findRepoRoot(startDir) ?? startDir;
@@ -40366,24 +40434,24 @@ function indexRules() {
40366
40434
  const rootFile = path88.relative(process.cwd(), path88.join(root2, "CLAUDE.md"));
40367
40435
  if (directories.length === 0) {
40368
40436
  console.log(
40369
- chalk245.gray(`No directories carry their own \`## Rules\` under ${root2}`)
40437
+ chalk246.gray(`No directories carry their own \`## Rules\` under ${root2}`)
40370
40438
  );
40371
40439
  return;
40372
40440
  }
40373
40441
  console.log(`Recorded in ${rootFile || "CLAUDE.md"}`);
40374
40442
  for (const directory of directories)
40375
- console.log(` ${chalk245.cyan(directory)}`);
40443
+ console.log(` ${chalk246.cyan(directory)}`);
40376
40444
  }
40377
40445
 
40378
40446
  // src/commands/rules/listRules.ts
40379
40447
  import path89 from "path";
40380
- import chalk246 from "chalk";
40448
+ import chalk247 from "chalk";
40381
40449
  function listRules(target, options2 = {}) {
40382
40450
  const resolved = path89.resolve(target ?? process.cwd());
40383
40451
  const rules2 = readScopedRules(resolved);
40384
40452
  if (rules2.length === 0) {
40385
40453
  const label = path89.relative(process.cwd(), resolved) || ".";
40386
- console.log(chalk246.gray(`No rules in scope for ${label}`));
40454
+ console.log(chalk247.gray(`No rules in scope for ${label}`));
40387
40455
  return;
40388
40456
  }
40389
40457
  const base = findRepoRoot(scopeDirectory(resolved));
@@ -40393,14 +40461,14 @@ function listRules(target, options2 = {}) {
40393
40461
  if (rule.source !== shown) {
40394
40462
  shown = rule.source;
40395
40463
  console.log(
40396
- chalk246.dim(base ? path89.relative(base, rule.source) : rule.source)
40464
+ chalk247.dim(base ? path89.relative(base, rule.source) : rule.source)
40397
40465
  );
40398
40466
  }
40399
40467
  console.log(
40400
- ` ${chalk246.cyan(rule.code.padEnd(width2))} ${rule.title ?? rule.text}`
40468
+ ` ${chalk247.cyan(rule.code.padEnd(width2))} ${rule.title ?? rule.text}`
40401
40469
  );
40402
40470
  if (options2.full && rule.title)
40403
- console.log(` ${" ".repeat(width2)} ${chalk246.dim(rule.text)}`);
40471
+ console.log(` ${" ".repeat(width2)} ${chalk247.dim(rule.text)}`);
40404
40472
  }
40405
40473
  }
40406
40474
 
@@ -40421,8 +40489,11 @@ function registerRules(program) {
40421
40489
  ).option(
40422
40490
  "--scope <path>",
40423
40491
  "File or directory whose nearest CLAUDE.md receives the rule, or a CLAUDE.md path to write to directly (default: cwd)"
40492
+ ).option(
40493
+ "--global",
40494
+ "Append the rule to advice.rules in ~/.assist.yml instead of a CLAUDE.md, for rules about agent conduct that hold in every repo. Needs --title; takes no R-code and cannot be combined with --scope"
40424
40495
  ).action(
40425
- (text17, options2) => addRule(text17, options2)
40496
+ (text17, options2) => options2.global ? addGlobalRule(text17, options2) : addRule(text17, options2)
40426
40497
  ),
40427
40498
  "/add-rule and /fix-rules"
40428
40499
  );
@@ -40435,7 +40506,7 @@ function registerRules(program) {
40435
40506
  }
40436
40507
 
40437
40508
  // src/commands/seq/seqAuth.ts
40438
- import chalk248 from "chalk";
40509
+ import chalk249 from "chalk";
40439
40510
 
40440
40511
  // src/commands/seq/loadConnections.ts
40441
40512
  function loadConnections2() {
@@ -40464,10 +40535,10 @@ function setDefaultConnection(name) {
40464
40535
  }
40465
40536
 
40466
40537
  // src/shared/assertUniqueName.ts
40467
- import chalk247 from "chalk";
40538
+ import chalk248 from "chalk";
40468
40539
  function assertUniqueName(existingNames, name) {
40469
40540
  if (existingNames.includes(name)) {
40470
- console.error(chalk247.red(`Connection "${name}" already exists.`));
40541
+ console.error(chalk248.red(`Connection "${name}" already exists.`));
40471
40542
  process.exit(1);
40472
40543
  }
40473
40544
  }
@@ -40485,16 +40556,16 @@ async function promptConnection2(existingNames) {
40485
40556
  var seqAuth = createConnectionAuth({
40486
40557
  load: loadConnections2,
40487
40558
  save: saveConnections2,
40488
- format: (c) => `${chalk248.bold(c.name)} ${c.url}`,
40559
+ format: (c) => `${chalk249.bold(c.name)} ${c.url}`,
40489
40560
  promptNew: promptConnection2,
40490
40561
  onFirst: (c) => setDefaultConnection(c.name)
40491
40562
  });
40492
40563
 
40493
40564
  // src/commands/seq/seqQuery.ts
40494
- import chalk252 from "chalk";
40565
+ import chalk253 from "chalk";
40495
40566
 
40496
40567
  // src/commands/seq/fetchSeq.ts
40497
- import chalk249 from "chalk";
40568
+ import chalk250 from "chalk";
40498
40569
  async function fetchSeq(conn, path108, params) {
40499
40570
  const url = `${conn.url}${path108}?${params}`;
40500
40571
  const response = await fetch(url, {
@@ -40505,7 +40576,7 @@ async function fetchSeq(conn, path108, params) {
40505
40576
  });
40506
40577
  if (!response.ok) {
40507
40578
  const body = await response.text();
40508
- console.error(chalk249.red(`Seq returned ${response.status}: ${body}`));
40579
+ console.error(chalk250.red(`Seq returned ${response.status}: ${body}`));
40509
40580
  process.exit(1);
40510
40581
  }
40511
40582
  return response;
@@ -40564,23 +40635,23 @@ async function fetchSeqEvents(conn, params) {
40564
40635
  }
40565
40636
 
40566
40637
  // src/commands/seq/formatEvent.ts
40567
- import chalk250 from "chalk";
40638
+ import chalk251 from "chalk";
40568
40639
  function levelColor(level) {
40569
40640
  switch (level) {
40570
40641
  case "Fatal":
40571
- return chalk250.bgRed.white;
40642
+ return chalk251.bgRed.white;
40572
40643
  case "Error":
40573
- return chalk250.red;
40644
+ return chalk251.red;
40574
40645
  case "Warning":
40575
- return chalk250.yellow;
40646
+ return chalk251.yellow;
40576
40647
  case "Information":
40577
- return chalk250.cyan;
40648
+ return chalk251.cyan;
40578
40649
  case "Debug":
40579
- return chalk250.gray;
40650
+ return chalk251.gray;
40580
40651
  case "Verbose":
40581
- return chalk250.dim;
40652
+ return chalk251.dim;
40582
40653
  default:
40583
- return chalk250.white;
40654
+ return chalk251.white;
40584
40655
  }
40585
40656
  }
40586
40657
  function levelAbbrev(level) {
@@ -40621,12 +40692,12 @@ function formatTimestamp(iso) {
40621
40692
  function formatEvent(event) {
40622
40693
  const color = levelColor(event.Level);
40623
40694
  const abbrev = levelAbbrev(event.Level);
40624
- const ts10 = chalk250.dim(formatTimestamp(event.Timestamp));
40695
+ const ts10 = chalk251.dim(formatTimestamp(event.Timestamp));
40625
40696
  const msg = renderMessage(event);
40626
40697
  const lines2 = [`${ts10} ${color(`[${abbrev}]`)} ${msg}`];
40627
40698
  if (event.Exception) {
40628
40699
  for (const line of event.Exception.split("\n")) {
40629
- lines2.push(chalk250.red(` ${line}`));
40700
+ lines2.push(chalk251.red(` ${line}`));
40630
40701
  }
40631
40702
  }
40632
40703
  return lines2.join("\n");
@@ -40659,11 +40730,11 @@ function rejectTimestampFilter(filter) {
40659
40730
  }
40660
40731
 
40661
40732
  // src/shared/resolveNamedConnection.ts
40662
- import chalk251 from "chalk";
40733
+ import chalk252 from "chalk";
40663
40734
  function resolveNamedConnection(connections, requested, defaultName, kind, authCommand) {
40664
40735
  if (connections.length === 0) {
40665
40736
  console.error(
40666
- chalk251.red(
40737
+ chalk252.red(
40667
40738
  `No ${kind} connections configured. Run '${authCommand}' first.`
40668
40739
  )
40669
40740
  );
@@ -40672,7 +40743,7 @@ function resolveNamedConnection(connections, requested, defaultName, kind, authC
40672
40743
  const target = requested ?? defaultName ?? connections[0].name;
40673
40744
  const connection = connections.find((c) => c.name === target);
40674
40745
  if (!connection) {
40675
- console.error(chalk251.red(`${kind} connection "${target}" not found.`));
40746
+ console.error(chalk252.red(`${kind} connection "${target}" not found.`));
40676
40747
  process.exit(1);
40677
40748
  }
40678
40749
  return connection;
@@ -40701,7 +40772,7 @@ async function seqQuery(filter, options2) {
40701
40772
  new URLSearchParams({ filter, count: String(count10) })
40702
40773
  );
40703
40774
  if (events.length === 0) {
40704
- console.log(chalk252.yellow("No events found."));
40775
+ console.log(chalk253.yellow("No events found."));
40705
40776
  return;
40706
40777
  }
40707
40778
  if (options2.json) {
@@ -40712,11 +40783,11 @@ async function seqQuery(filter, options2) {
40712
40783
  for (const event of chronological) {
40713
40784
  console.log(formatEvent(event));
40714
40785
  }
40715
- console.log(chalk252.dim(`
40786
+ console.log(chalk253.dim(`
40716
40787
  ${events.length} events`));
40717
40788
  if (events.length >= count10) {
40718
40789
  console.log(
40719
- chalk252.yellow(
40790
+ chalk253.yellow(
40720
40791
  `Results limited to ${count10}. Use --count to retrieve more.`
40721
40792
  )
40722
40793
  );
@@ -40724,10 +40795,10 @@ ${events.length} events`));
40724
40795
  }
40725
40796
 
40726
40797
  // src/shared/setNamedDefaultConnection.ts
40727
- import chalk253 from "chalk";
40798
+ import chalk254 from "chalk";
40728
40799
  function setNamedDefaultConnection(connections, name, setDefault, kind) {
40729
40800
  if (!connections.find((c) => c.name === name)) {
40730
- console.error(chalk253.red(`Connection "${name}" not found.`));
40801
+ console.error(chalk254.red(`Connection "${name}" not found.`));
40731
40802
  process.exit(1);
40732
40803
  }
40733
40804
  setDefault(name);
@@ -41029,7 +41100,7 @@ function registerSlack(program) {
41029
41100
  }
41030
41101
 
41031
41102
  // src/commands/sql/sqlAuth.ts
41032
- import chalk255 from "chalk";
41103
+ import chalk256 from "chalk";
41033
41104
 
41034
41105
  // src/commands/sql/loadConnections.ts
41035
41106
  function loadConnections3() {
@@ -41058,7 +41129,7 @@ function setDefaultConnection2(name) {
41058
41129
  }
41059
41130
 
41060
41131
  // src/commands/sql/promptConnection.ts
41061
- import chalk254 from "chalk";
41132
+ import chalk255 from "chalk";
41062
41133
  async function promptConnection3(existingNames) {
41063
41134
  const name = await promptInput("name", "Connection name:", "default");
41064
41135
  assertUniqueName(existingNames, name);
@@ -41066,7 +41137,7 @@ async function promptConnection3(existingNames) {
41066
41137
  const portStr = await promptInput("port", "Port:", "1433");
41067
41138
  const port = Number.parseInt(portStr, 10);
41068
41139
  if (!Number.isFinite(port)) {
41069
- console.error(chalk254.red(`Invalid port "${portStr}".`));
41140
+ console.error(chalk255.red(`Invalid port "${portStr}".`));
41070
41141
  process.exit(1);
41071
41142
  }
41072
41143
  const user = await promptInput("user", "User:");
@@ -41079,13 +41150,13 @@ async function promptConnection3(existingNames) {
41079
41150
  var sqlAuth = createConnectionAuth({
41080
41151
  load: loadConnections3,
41081
41152
  save: saveConnections3,
41082
- format: (c) => `${chalk255.bold(c.name)} ${c.server}:${c.port}/${c.database} (${c.user})`,
41153
+ format: (c) => `${chalk256.bold(c.name)} ${c.server}:${c.port}/${c.database} (${c.user})`,
41083
41154
  promptNew: promptConnection3,
41084
41155
  onFirst: (c) => setDefaultConnection2(c.name)
41085
41156
  });
41086
41157
 
41087
41158
  // src/commands/sql/printTable.ts
41088
- import chalk256 from "chalk";
41159
+ import chalk257 from "chalk";
41089
41160
  function formatCell(value) {
41090
41161
  if (value === null || value === void 0) return "";
41091
41162
  if (value instanceof Date) return value.toISOString();
@@ -41094,7 +41165,7 @@ function formatCell(value) {
41094
41165
  }
41095
41166
  function printTable(rows) {
41096
41167
  if (rows.length === 0) {
41097
- console.log(chalk256.yellow("(no rows)"));
41168
+ console.log(chalk257.yellow("(no rows)"));
41098
41169
  return;
41099
41170
  }
41100
41171
  const columns = Object.keys(rows[0]);
@@ -41102,13 +41173,13 @@ function printTable(rows) {
41102
41173
  (col) => Math.max(col.length, ...rows.map((r) => formatCell(r[col]).length))
41103
41174
  );
41104
41175
  const header = columns.map((c, i) => c.padEnd(widths[i])).join(" ");
41105
- console.log(chalk256.dim(header));
41106
- console.log(chalk256.dim("-".repeat(header.length)));
41176
+ console.log(chalk257.dim(header));
41177
+ console.log(chalk257.dim("-".repeat(header.length)));
41107
41178
  for (const row3 of rows) {
41108
41179
  const line = columns.map((c, i) => formatCell(row3[c]).padEnd(widths[i])).join(" ");
41109
41180
  console.log(line);
41110
41181
  }
41111
- console.log(chalk256.dim(`
41182
+ console.log(chalk257.dim(`
41112
41183
  ${rows.length} row${rows.length === 1 ? "" : "s"}`));
41113
41184
  }
41114
41185
 
@@ -41168,7 +41239,7 @@ async function sqlColumns(table, connectionName) {
41168
41239
  }
41169
41240
 
41170
41241
  // src/commands/sql/sqlMutate.ts
41171
- import chalk257 from "chalk";
41242
+ import chalk258 from "chalk";
41172
41243
 
41173
41244
  // src/commands/sql/isMutation.ts
41174
41245
  var MUTATION_KEYWORDS = [
@@ -41202,7 +41273,7 @@ function isMutation(sql27) {
41202
41273
  async function sqlMutate(query, connectionName) {
41203
41274
  if (!isMutation(query)) {
41204
41275
  console.error(
41205
- chalk257.red(
41276
+ chalk258.red(
41206
41277
  "assist sql mutate refuses non-mutating statements. Use `assist sql query` instead."
41207
41278
  )
41208
41279
  );
@@ -41212,18 +41283,18 @@ async function sqlMutate(query, connectionName) {
41212
41283
  const pool = await sqlConnect(conn);
41213
41284
  try {
41214
41285
  const result = await pool.request().query(query);
41215
- console.log(chalk257.dim(`${result.rowsAffected.join(", ")} row(s) affected`));
41286
+ console.log(chalk258.dim(`${result.rowsAffected.join(", ")} row(s) affected`));
41216
41287
  } finally {
41217
41288
  await pool.close();
41218
41289
  }
41219
41290
  }
41220
41291
 
41221
41292
  // src/commands/sql/sqlQuery.ts
41222
- import chalk258 from "chalk";
41293
+ import chalk259 from "chalk";
41223
41294
  async function sqlQuery(query, connectionName) {
41224
41295
  if (isMutation(query)) {
41225
41296
  console.error(
41226
- chalk258.red(
41297
+ chalk259.red(
41227
41298
  "assist sql query refuses mutating statements. Use `assist sql mutate` instead."
41228
41299
  )
41229
41300
  );
@@ -41238,7 +41309,7 @@ async function sqlQuery(query, connectionName) {
41238
41309
  printTable(rows);
41239
41310
  } else {
41240
41311
  console.log(
41241
- chalk258.dim(`${result.rowsAffected.join(", ")} row(s) affected`)
41312
+ chalk259.dim(`${result.rowsAffected.join(", ")} row(s) affected`)
41242
41313
  );
41243
41314
  }
41244
41315
  } finally {
@@ -41653,7 +41724,7 @@ function syncPi(claudeDir, options2) {
41653
41724
  // src/commands/sync/syncSettings.ts
41654
41725
  import * as fs46 from "fs";
41655
41726
  import * as path100 from "path";
41656
- import chalk259 from "chalk";
41727
+ import chalk260 from "chalk";
41657
41728
  async function syncSettings(claudeDir, targetBase, options2) {
41658
41729
  const source = path100.join(claudeDir, "settings.json");
41659
41730
  const target = path100.join(targetBase, "settings.json");
@@ -41672,7 +41743,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
41672
41743
  if (mergedContent !== normalizedTarget) {
41673
41744
  if (!options2?.yes) {
41674
41745
  console.log(
41675
- chalk259.yellow(
41746
+ chalk260.yellow(
41676
41747
  "\n\u26A0\uFE0F Warning: settings.json differs from existing file"
41677
41748
  )
41678
41749
  );
@@ -41680,7 +41751,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
41680
41751
  printDiff(targetContent, mergedContent);
41681
41752
  printAutoConfirmHint();
41682
41753
  const confirm = await promptConfirm(
41683
- chalk259.red("Overwrite existing settings.json?"),
41754
+ chalk260.red("Overwrite existing settings.json?"),
41684
41755
  false
41685
41756
  );
41686
41757
  if (!confirm) {
@@ -44228,7 +44299,7 @@ function parseEnvPairs(pairs) {
44228
44299
  }
44229
44300
 
44230
44301
  // src/commands/run/parseParamSpecs.ts
44231
- function fail8(spec) {
44302
+ function fail9(spec) {
44232
44303
  console.error(
44233
44304
  `--param must be <name>, <name>! or <name>=<default>, got "${spec}"`
44234
44305
  );
@@ -44238,14 +44309,14 @@ function parseParamSpec(spec) {
44238
44309
  const eq46 = spec.indexOf("=");
44239
44310
  const name = eq46 === -1 ? spec : spec.slice(0, eq46);
44240
44311
  if (eq46 !== -1) {
44241
- if (eq46 === 0 || name.endsWith("!")) fail8(spec);
44312
+ if (eq46 === 0 || name.endsWith("!")) fail9(spec);
44242
44313
  return { name, default: spec.slice(eq46 + 1) };
44243
44314
  }
44244
44315
  if (name.endsWith("!")) {
44245
- if (name.length === 1) fail8(spec);
44316
+ if (name.length === 1) fail9(spec);
44246
44317
  return { name: name.slice(0, -1), required: true };
44247
44318
  }
44248
- if (name.length === 0) fail8(spec);
44319
+ if (name.length === 0) fail9(spec);
44249
44320
  return { name };
44250
44321
  }
44251
44322
  function parseParamSpecs(specs) {
@@ -44504,18 +44575,18 @@ function registerRun(program) {
44504
44575
  }
44505
44576
 
44506
44577
  // src/commands/sessions/nodes/formatLink.ts
44507
- import chalk260 from "chalk";
44578
+ import chalk261 from "chalk";
44508
44579
  var STATE_COLOURS = {
44509
- connected: chalk260.green,
44510
- connecting: chalk260.yellow,
44511
- disconnected: chalk260.red,
44512
- "version-blocked": chalk260.red
44580
+ connected: chalk261.green,
44581
+ connecting: chalk261.yellow,
44582
+ disconnected: chalk261.red,
44583
+ "version-blocked": chalk261.red
44513
44584
  };
44514
44585
  function formatLink(link3) {
44515
- const colour = STATE_COLOURS[link3.state] ?? chalk260.white;
44586
+ const colour = STATE_COLOURS[link3.state] ?? chalk261.white;
44516
44587
  const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
44517
44588
  const error = link3.error ? `
44518
- ${chalk260.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
44589
+ ${chalk261.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
44519
44590
  return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
44520
44591
  }
44521
44592
 
@@ -52275,7 +52346,7 @@ async function closeSession() {
52275
52346
  }
52276
52347
 
52277
52348
  // src/commands/sessions/nodes/listNodes.ts
52278
- import chalk261 from "chalk";
52349
+ import chalk262 from "chalk";
52279
52350
  async function nodesReport() {
52280
52351
  const live = await queryNodes();
52281
52352
  if (live)
@@ -52292,10 +52363,10 @@ async function listNodes(options2) {
52292
52363
  console.log(JSON.stringify(report, null, 2));
52293
52364
  return;
52294
52365
  }
52295
- console.log(`${report.local} ${chalk261.dim("(this node)")}`);
52366
+ console.log(`${report.local} ${chalk262.dim("(this node)")}`);
52296
52367
  if (!report.daemonRunning)
52297
- console.log(chalk261.dim(" daemon not running; showing configured links"));
52298
- if (report.links.length === 0) console.log(chalk261.dim(" no links"));
52368
+ console.log(chalk262.dim(" daemon not running; showing configured links"));
52369
+ if (report.links.length === 0) console.log(chalk262.dim(" no links"));
52299
52370
  for (const link3 of report.links) console.log(formatLink(link3));
52300
52371
  }
52301
52372
 
@@ -52317,7 +52388,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
52317
52388
  }
52318
52389
 
52319
52390
  // src/commands/sessions/nodes/printReport.ts
52320
- import chalk262 from "chalk";
52391
+ import chalk263 from "chalk";
52321
52392
  function printReport(report) {
52322
52393
  if (report.links.length === 0) {
52323
52394
  console.log(`${report.local} has no links`);
@@ -52331,11 +52402,11 @@ function printReport(report) {
52331
52402
  for (const diagnosis of report.links) printDiagnosis(diagnosis);
52332
52403
  }
52333
52404
  function printDiagnosis(diagnosis) {
52334
- console.log(`${chalk262.bold(diagnosis.name)} ${chalk262.dim(diagnosis.url)}`);
52405
+ console.log(`${chalk263.bold(diagnosis.name)} ${chalk263.dim(diagnosis.url)}`);
52335
52406
  for (const hop of diagnosis.hops) {
52336
- const mark = hop.ok ? chalk262.green("\u2713") : chalk262.red("\u2717");
52407
+ const mark = hop.ok ? chalk263.green("\u2713") : chalk263.red("\u2717");
52337
52408
  console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
52338
- if (hop.remediation) console.log(` ${chalk262.yellow(hop.remediation)}`);
52409
+ if (hop.remediation) console.log(` ${chalk263.yellow(hop.remediation)}`);
52339
52410
  }
52340
52411
  }
52341
52412
 
@@ -52407,14 +52478,14 @@ function registerDiagnoseCommands(nodes, calledBy4) {
52407
52478
  }
52408
52479
 
52409
52480
  // src/commands/sessions/nodes/linkNode.ts
52410
- import chalk265 from "chalk";
52481
+ import chalk266 from "chalk";
52411
52482
 
52412
52483
  // src/commands/sessions/nodes/notifyDaemonLinks.ts
52413
- import chalk263 from "chalk";
52484
+ import chalk264 from "chalk";
52414
52485
  async function notifyDaemonLinks() {
52415
52486
  if (!await isDaemonRunning()) {
52416
52487
  console.log(
52417
- chalk263.yellow(
52488
+ chalk264.yellow(
52418
52489
  "The sessions daemon is not running; it loads the links when it starts."
52419
52490
  )
52420
52491
  );
@@ -52422,11 +52493,11 @@ async function notifyDaemonLinks() {
52422
52493
  }
52423
52494
  try {
52424
52495
  await sendToDaemonAwaitAck({ type: "reload-links" });
52425
- console.log(chalk263.dim("The sessions daemon reloaded its links."));
52496
+ console.log(chalk264.dim("The sessions daemon reloaded its links."));
52426
52497
  } catch (error) {
52427
52498
  const message3 = error instanceof Error ? error.message : String(error);
52428
52499
  console.log(
52429
- chalk263.yellow(
52500
+ chalk264.yellow(
52430
52501
  `Could not notify the sessions daemon (${message3}); run \`assist daemon restart\` to apply the change.`
52431
52502
  )
52432
52503
  );
@@ -52434,7 +52505,7 @@ async function notifyDaemonLinks() {
52434
52505
  }
52435
52506
 
52436
52507
  // src/commands/sessions/nodes/readLinks.ts
52437
- import chalk264 from "chalk";
52508
+ import chalk265 from "chalk";
52438
52509
 
52439
52510
  // src/commands/sessions/nodes/writeLinks.ts
52440
52511
  async function writeLinks(links2) {
@@ -52457,7 +52528,7 @@ async function readLinks() {
52457
52528
  await writeLinks(links2);
52458
52529
  const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
52459
52530
  console.log(
52460
- chalk264.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
52531
+ chalk265.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
52461
52532
  );
52462
52533
  return links2;
52463
52534
  }
@@ -52513,7 +52584,7 @@ async function linkNode(name, url, options2) {
52513
52584
  throw new Error(`${name} is this node; link to a different node`);
52514
52585
  const link3 = await buildLink(name, url, options2);
52515
52586
  await writeLinks([...others, link3]);
52516
- console.log(chalk265.green(`Linked ${name} (${link3.url})`));
52587
+ console.log(chalk266.green(`Linked ${name} (${link3.url})`));
52517
52588
  await notifyDaemonLinks();
52518
52589
  }
52519
52590
 
@@ -52578,14 +52649,14 @@ function startPeerAction(name, action) {
52578
52649
  const line = `nodes ${action} ${name} trace=${traceId}`;
52579
52650
  console.log(line);
52580
52651
  appendDaemonLog(line);
52581
- const fail10 = async (summary, error) => new Error(await describeFailure(name, summary, error));
52652
+ const fail11 = async (summary, error) => new Error(await describeFailure(name, summary, error));
52582
52653
  return {
52583
52654
  spec,
52584
52655
  traceId,
52585
- fail: fail10,
52656
+ fail: fail11,
52586
52657
  async awaitReturn(sawDown, timeoutMs = RETURN_TIMEOUT_MS) {
52587
52658
  const link3 = await awaitLinkReturn(name, { sawDown, timeoutMs });
52588
- if (!link3) throw await fail10(`${name} did not come back`);
52659
+ if (!link3) throw await fail11(`${name} did not come back`);
52589
52660
  return link3;
52590
52661
  }
52591
52662
  };
@@ -52696,16 +52767,16 @@ function registerPeerActionCommands(nodes, calledBy4) {
52696
52767
  }
52697
52768
 
52698
52769
  // src/commands/sessions/nodes/unlinkNode.ts
52699
- import chalk266 from "chalk";
52770
+ import chalk267 from "chalk";
52700
52771
  async function unlinkNode(name) {
52701
52772
  const links2 = await readLinks();
52702
52773
  const remaining = links2.filter((link3) => link3.name !== name);
52703
52774
  if (remaining.length === links2.length) {
52704
- console.log(chalk266.yellow(`No link named ${name}`));
52775
+ console.log(chalk267.yellow(`No link named ${name}`));
52705
52776
  return;
52706
52777
  }
52707
52778
  await writeLinks(remaining);
52708
- console.log(chalk266.green(`Unlinked ${name}`));
52779
+ console.log(chalk267.green(`Unlinked ${name}`));
52709
52780
  await notifyDaemonLinks();
52710
52781
  }
52711
52782
 
@@ -52779,17 +52850,17 @@ function resolveTarget3(sessionId, server) {
52779
52850
  async function sessionOutput(sessionId, options2) {
52780
52851
  const count10 = Number.parseInt(options2.lines, 10);
52781
52852
  if (!Number.isInteger(count10) || count10 < 1)
52782
- return fail9(`-n must be a positive integer, got ${options2.lines}`);
52853
+ return fail10(`-n must be a positive integer, got ${options2.lines}`);
52783
52854
  const target = resolveTarget3(sessionId, options2.server);
52784
- if (typeof target === "string") return fail9(target);
52855
+ if (typeof target === "string") return fail10(target);
52785
52856
  try {
52786
52857
  const scrollback = await requestSessionOutput(target);
52787
52858
  for (const line of lastLines(scrollback, count10)) console.log(line);
52788
52859
  } catch (error) {
52789
- fail9(error instanceof Error ? error.message : String(error));
52860
+ fail10(error instanceof Error ? error.message : String(error));
52790
52861
  }
52791
52862
  }
52792
- function fail9(message3) {
52863
+ function fail10(message3) {
52793
52864
  console.error(message3);
52794
52865
  process.exitCode = 1;
52795
52866
  }
@@ -52940,10 +53011,10 @@ function createProgram() {
52940
53011
  }
52941
53012
 
52942
53013
  // src/reportCliError.ts
52943
- import chalk267 from "chalk";
53014
+ import chalk268 from "chalk";
52944
53015
  function reportCliError(error) {
52945
53016
  if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError) {
52946
- console.error(chalk267.red(error.message));
53017
+ console.error(chalk268.red(error.message));
52947
53018
  } else {
52948
53019
  console.error(error);
52949
53020
  }