@staff0rd/assist 0.875.3 → 0.877.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.875.3",
9
+ version: "0.877.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -8583,7 +8583,7 @@ var harnesses = {
8583
8583
  command: "claude",
8584
8584
  homeDir: path19.join(os2.homedir(), ".claude"),
8585
8585
  sync: {
8586
- commandDest: (name) => path19.join("commands", `${name}.md`)
8586
+ commandDest: (name) => path19.join("skills", name, "SKILL.md")
8587
8587
  }
8588
8588
  },
8589
8589
  codex: {
@@ -14531,8 +14531,8 @@ function subsequenceScore(text18, query) {
14531
14531
  function scoreFilePath(path109, query) {
14532
14532
  const needle = query.trim().toLowerCase();
14533
14533
  if (!needle) return 0;
14534
- const basename36 = path109.slice(path109.lastIndexOf("/") + 1);
14535
- const inBasename = subsequenceScore(basename36, needle);
14534
+ const basename35 = path109.slice(path109.lastIndexOf("/") + 1);
14535
+ const inBasename = subsequenceScore(basename35, needle);
14536
14536
  if (inBasename !== null) return BASENAME_WEIGHT + inBasename;
14537
14537
  return subsequenceScore(path109, needle);
14538
14538
  }
@@ -40476,6 +40476,26 @@ function pruneCommands(targetDir, commandNames, options2) {
40476
40476
  );
40477
40477
  }
40478
40478
 
40479
+ // src/commands/sync/pruneSkills.ts
40480
+ import * as fs40 from "fs";
40481
+ function pruneSkills(targetDir, skillNames, options2) {
40482
+ return pruneTarget(
40483
+ targetDir,
40484
+ skillNames,
40485
+ {
40486
+ nameOf: (entry) => entry.isDirectory() ? entry.name : void 0,
40487
+ blockedBy: unexpectedContent
40488
+ },
40489
+ options2
40490
+ );
40491
+ }
40492
+ function unexpectedContent(skillDir) {
40493
+ const entries = fs40.readdirSync(skillDir);
40494
+ const others = entries.filter((entry) => entry !== "SKILL.md");
40495
+ if (others.length > 0) return `contains ${others.sort().join(", ")}`;
40496
+ return entries.length === 0 ? "no SKILL.md" : void 0;
40497
+ }
40498
+
40479
40499
  // src/commands/sync/reportPrune.ts
40480
40500
  function reportPrune(label2, result, force) {
40481
40501
  if (result.orphans.length === 0) {
@@ -40504,56 +40524,108 @@ function reportPrune(label2, result, force) {
40504
40524
  }
40505
40525
 
40506
40526
  // src/commands/sync/syncClaudeCommands.ts
40507
- import * as fs43 from "fs";
40508
- import * as path96 from "path";
40527
+ import * as fs41 from "fs";
40528
+ import * as path93 from "path";
40529
+
40530
+ // src/commands/sync/splitFrontmatter.ts
40531
+ function splitFrontmatter(content) {
40532
+ const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
40533
+ const frontmatter2 = match ? match[1] : "";
40534
+ const body = match ? content.slice(match[0].length) : content;
40535
+ const descriptionMatch = frontmatter2.match(/^description:\s*(.*)$/m);
40536
+ const description = descriptionMatch ? descriptionMatch[1].trim().replace(/^["']|["']$/g, "") : void 0;
40537
+ return { frontmatter: frontmatter2, body, description };
40538
+ }
40539
+
40540
+ // src/commands/sync/commandToSkill.ts
40541
+ function commandToSkill(name, content) {
40542
+ const { body, description } = splitFrontmatter(content);
40543
+ const header = `---
40544
+ name: ${name}
40545
+ description: ${quoteYaml(description ?? name)}
40546
+ ---
40547
+
40548
+ `;
40549
+ return header + body.replace(/^\r?\n+/, "");
40550
+ }
40551
+ function quoteYaml(value) {
40552
+ return `"${value.replace(/\\/g, String.raw`\\`).replace(/"/g, String.raw`\"`)}"`;
40553
+ }
40554
+
40555
+ // src/commands/sync/syncClaudeCommands.ts
40556
+ function replaceFileWithoutFollowingSymlink(file, content) {
40557
+ fs41.rmSync(file, { force: true });
40558
+ fs41.writeFileSync(file, content);
40559
+ }
40560
+ function writeSkill(targetBase, name, content) {
40561
+ const skillDir = path93.join(targetBase, "skills", name);
40562
+ fs41.mkdirSync(skillDir, { recursive: true });
40563
+ replaceFileWithoutFollowingSymlink(
40564
+ path93.join(skillDir, "SKILL.md"),
40565
+ commandToSkill(name, content)
40566
+ );
40567
+ fs41.rmSync(path93.join(targetBase, "commands", `${name}.md`), { force: true });
40568
+ }
40569
+ function syncClaudeCommands(claudeDir, targetBase) {
40570
+ const sourceDir = path93.join(claudeDir, "commands");
40571
+ const names = fs41.readdirSync(sourceDir).filter((file) => file.endsWith(".md")).map((file) => path93.basename(file, ".md"));
40572
+ for (const name of names) {
40573
+ const content = fs41.readFileSync(path93.join(sourceDir, `${name}.md`), "utf8");
40574
+ writeSkill(targetBase, name, content);
40575
+ }
40576
+ console.log(
40577
+ `Synced ${names.length} skill(s) to ${path93.join(targetBase, "skills")}`
40578
+ );
40579
+ return names;
40580
+ }
40581
+
40582
+ // src/commands/sync/reportRetiredAgentsFiles.ts
40583
+ import * as fs42 from "fs";
40584
+ import * as path94 from "path";
40585
+ var retired = [
40586
+ path94.join(harnesses.claude.homeDir, "CLAUDE.md"),
40587
+ path94.join(harnesses.codex.homeDir, "AGENTS.md"),
40588
+ path94.join(harnesses.pi.homeDir, "AGENTS.md")
40589
+ ];
40590
+ function reportRetiredAgentsFiles() {
40591
+ const leftovers = retired.filter((file) => fs42.existsSync(file));
40592
+ if (leftovers.length === 0) return;
40593
+ console.log(
40594
+ "No longer written by sync \u2014 each harness now composes its own advice at session start:"
40595
+ );
40596
+ for (const file of leftovers) console.log(` ${file}`);
40597
+ console.log(
40598
+ " Delete them, or they keep injecting the retired global instructions."
40599
+ );
40600
+ }
40509
40601
 
40510
40602
  // src/commands/sync/syncCodex.ts
40511
- import * as path95 from "path";
40603
+ import * as path97 from "path";
40512
40604
 
40513
40605
  // src/commands/sync/installHarnessCommands.ts
40514
- import * as fs40 from "fs";
40515
- import * as path93 from "path";
40606
+ import * as fs43 from "fs";
40607
+ import * as path95 from "path";
40516
40608
  function installHarnessCommands(claudeDir, harness, transform) {
40517
- const commandsSource = path93.join(claudeDir, "commands");
40518
- const files = fs40.readdirSync(commandsSource);
40609
+ const commandsSource = path95.join(claudeDir, "commands");
40610
+ const files = fs43.readdirSync(commandsSource);
40519
40611
  const names = [];
40520
40612
  let synced = 0;
40521
40613
  for (const file of files) {
40522
40614
  if (!file.endsWith(".md")) continue;
40523
40615
  const name = file.replace(/\.md$/, "");
40524
40616
  names.push(name);
40525
- const content = fs40.readFileSync(path93.join(commandsSource, file), "utf8");
40526
- const target = path93.join(harness.homeDir, harness.sync.commandDest(name));
40527
- fs40.mkdirSync(path93.dirname(target), { recursive: true });
40528
- fs40.writeFileSync(target, transform(name, content));
40617
+ const content = fs43.readFileSync(path95.join(commandsSource, file), "utf8");
40618
+ const target = path95.join(harness.homeDir, harness.sync.commandDest(name));
40619
+ fs43.mkdirSync(path95.dirname(target), { recursive: true });
40620
+ fs43.writeFileSync(target, transform(name, content));
40529
40621
  synced++;
40530
40622
  }
40531
40623
  return { total: files.length, synced, names };
40532
40624
  }
40533
40625
 
40534
- // src/commands/sync/pruneSkills.ts
40535
- import * as fs41 from "fs";
40536
- function pruneSkills(targetDir, skillNames, options2) {
40537
- return pruneTarget(
40538
- targetDir,
40539
- skillNames,
40540
- {
40541
- nameOf: (entry) => entry.isDirectory() ? entry.name : void 0,
40542
- blockedBy: unexpectedContent
40543
- },
40544
- options2
40545
- );
40546
- }
40547
- function unexpectedContent(skillDir) {
40548
- const entries = fs41.readdirSync(skillDir);
40549
- const others = entries.filter((entry) => entry !== "SKILL.md");
40550
- if (others.length > 0) return `contains ${others.sort().join(", ")}`;
40551
- return entries.length === 0 ? "no SKILL.md" : void 0;
40552
- }
40553
-
40554
40626
  // src/commands/sync/syncCodexHooks.ts
40555
- import * as fs42 from "fs";
40556
- import * as path94 from "path";
40627
+ import * as fs44 from "fs";
40628
+ import * as path96 from "path";
40557
40629
  var BEGIN = "# >>> assist codex hooks (managed) \u2014 do not edit >>>";
40558
40630
  var END = "# <<< assist codex hooks (managed) <<<";
40559
40631
  function upsertManagedBlock(existing, body) {
@@ -40583,34 +40655,17 @@ ${rest}
40583
40655
  `;
40584
40656
  }
40585
40657
  function syncCodexHooks(sourcePath) {
40586
- const body = fs42.readFileSync(sourcePath, "utf8");
40587
- const configPath = path94.join(harnesses.codex.homeDir, "config.toml");
40588
- const existing = fs42.existsSync(configPath) ? fs42.readFileSync(configPath, "utf8") : "";
40589
- fs42.mkdirSync(path94.dirname(configPath), { recursive: true });
40590
- fs42.writeFileSync(configPath, upsertManagedBlock(existing, body));
40658
+ const body = fs44.readFileSync(sourcePath, "utf8");
40659
+ const configPath = path96.join(harnesses.codex.homeDir, "config.toml");
40660
+ const existing = fs44.existsSync(configPath) ? fs44.readFileSync(configPath, "utf8") : "";
40661
+ fs44.mkdirSync(path96.dirname(configPath), { recursive: true });
40662
+ fs44.writeFileSync(configPath, upsertManagedBlock(existing, body));
40591
40663
  console.log(
40592
40664
  "Registered assist codex-hook in ~/.codex/config.toml (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PermissionRequest, Stop)"
40593
40665
  );
40594
40666
  }
40595
40667
 
40596
40668
  // src/commands/sync/syncCodex.ts
40597
- function quoteYaml(value) {
40598
- return `"${value.replace(/\\/g, String.raw`\\`).replace(/"/g, String.raw`\"`)}"`;
40599
- }
40600
- function commandToSkill(name, content) {
40601
- const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
40602
- const frontmatter2 = match ? match[1] : "";
40603
- const body = match ? content.slice(match[0].length) : content;
40604
- const descriptionMatch = frontmatter2.match(/^description:\s*(.*)$/m);
40605
- const description = descriptionMatch ? descriptionMatch[1].trim().replace(/^["']|["']$/g, "") : name;
40606
- const header = `---
40607
- name: ${name}
40608
- description: ${quoteYaml(description)}
40609
- ---
40610
-
40611
- `;
40612
- return header + body.replace(/^\r?\n+/, "");
40613
- }
40614
40669
  function syncCodex(claudeDir, options2) {
40615
40670
  if (!isHarnessAvailable("codex")) return;
40616
40671
  const { total: total2, names } = installHarnessCommands(
@@ -40618,77 +40673,17 @@ function syncCodex(claudeDir, options2) {
40618
40673
  harnesses.codex,
40619
40674
  commandToSkill
40620
40675
  );
40621
- syncCodexHooks(path95.join(claudeDir, "..", "codex", "config.toml"));
40676
+ syncCodexHooks(path97.join(claudeDir, "..", "codex", "config.toml"));
40622
40677
  console.log(`Synced ${total2} skill(s) to ~/.codex/skills`);
40623
40678
  if (!options2?.prune) return;
40624
40679
  const force = options2.force ?? false;
40625
40680
  reportPrune(
40626
40681
  "~/.codex/skills",
40627
- pruneSkills(path95.join(harnesses.codex.homeDir, "skills"), names, { force }),
40682
+ pruneSkills(path97.join(harnesses.codex.homeDir, "skills"), names, { force }),
40628
40683
  force
40629
40684
  );
40630
40685
  }
40631
40686
 
40632
- // src/commands/sync/syncClaudeCommands.ts
40633
- function isSkillFlagged(content) {
40634
- const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
40635
- return match ? /^skill:\s*true\s*$/m.test(match[1]) : false;
40636
- }
40637
- function replaceFileWithoutFollowingSymlink(file, content) {
40638
- fs43.rmSync(file, { force: true });
40639
- fs43.writeFileSync(file, content);
40640
- }
40641
- function writeSkill(targetBase, name, content) {
40642
- const skillDir = path96.join(targetBase, "skills", name);
40643
- fs43.mkdirSync(skillDir, { recursive: true });
40644
- replaceFileWithoutFollowingSymlink(
40645
- path96.join(skillDir, "SKILL.md"),
40646
- commandToSkill(name, content)
40647
- );
40648
- fs43.rmSync(path96.join(targetBase, "commands", `${name}.md`), { force: true });
40649
- console.log(`Wrote ${name} as a skill to ${skillDir}`);
40650
- }
40651
- function syncClaudeCommands(claudeDir, targetBase) {
40652
- const sourceDir = path96.join(claudeDir, "commands");
40653
- const targetDir = path96.join(targetBase, "commands");
40654
- fs43.mkdirSync(targetDir, { recursive: true });
40655
- const files = fs43.readdirSync(sourceDir);
40656
- for (const file of files) {
40657
- const source = path96.join(sourceDir, file);
40658
- if (file.endsWith(".md")) {
40659
- const content = fs43.readFileSync(source, "utf8");
40660
- if (isSkillFlagged(content)) {
40661
- writeSkill(targetBase, path96.basename(file, ".md"), content);
40662
- continue;
40663
- }
40664
- }
40665
- fs43.copyFileSync(source, path96.join(targetDir, file));
40666
- console.log(`Copied ${file} to ${targetDir}`);
40667
- }
40668
- console.log(`Synced ${files.length} command(s) to ~/.claude`);
40669
- return files;
40670
- }
40671
-
40672
- // src/commands/sync/reportRetiredAgentsFiles.ts
40673
- import * as fs44 from "fs";
40674
- import * as path97 from "path";
40675
- var retired = [
40676
- path97.join(harnesses.claude.homeDir, "CLAUDE.md"),
40677
- path97.join(harnesses.codex.homeDir, "AGENTS.md"),
40678
- path97.join(harnesses.pi.homeDir, "AGENTS.md")
40679
- ];
40680
- function reportRetiredAgentsFiles() {
40681
- const leftovers = retired.filter((file) => fs44.existsSync(file));
40682
- if (leftovers.length === 0) return;
40683
- console.log(
40684
- "No longer written by sync \u2014 each harness now composes its own advice at session start:"
40685
- );
40686
- for (const file of leftovers) console.log(` ${file}`);
40687
- console.log(
40688
- " Delete them, or they keep injecting the retired global instructions."
40689
- );
40690
- }
40691
-
40692
40687
  // src/commands/sync/syncDesign.ts
40693
40688
  import * as fs45 from "fs";
40694
40689
  import * as path98 from "path";
@@ -40745,11 +40740,9 @@ function unquote3(value) {
40745
40740
  return value.trim().replace(/^["']|["']$/g, "");
40746
40741
  }
40747
40742
  function commandToPrompt(name, content) {
40748
- const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
40749
- const frontmatter2 = match ? match[1] : "";
40750
- const body = match ? content.slice(match[0].length) : content;
40751
- const descriptionMatch = frontmatter2.match(/^description:\s*(.*)$/m);
40752
- const description = descriptionMatch ? unquote3(descriptionMatch[1]) : name;
40743
+ const split = splitFrontmatter(content);
40744
+ const { frontmatter: frontmatter2, body } = split;
40745
+ const description = split.description ?? name;
40753
40746
  const argsMatch = frontmatter2.match(/^allowed_args:\s*(.*)$/m);
40754
40747
  const argumentHint = argsMatch ? unquote3(argsMatch[1]) : void 0;
40755
40748
  const header = [
@@ -40833,18 +40826,22 @@ async function sync(options2) {
40833
40826
  const prune = { prune: options2?.prune, force: options2?.force };
40834
40827
  const claudeDir = path102.join(__dirname5, "..", "claude");
40835
40828
  const targetBase = path102.join(os5.homedir(), ".claude");
40836
- const commandFiles = syncClaudeCommands(claudeDir, targetBase);
40829
+ const commandNames = syncClaudeCommands(claudeDir, targetBase);
40837
40830
  syncDesign(claudeDir, targetBase);
40838
40831
  await syncSettings(claudeDir, targetBase, { yes });
40839
40832
  syncCodex(claudeDir, prune);
40840
40833
  syncPi(claudeDir, prune);
40841
40834
  reportRetiredAgentsFiles();
40842
40835
  if (!options2?.prune) return;
40843
- const commandNames = commandFiles.filter((file) => file.endsWith(".md")).map((file) => path102.basename(file, ".md"));
40844
40836
  const force = options2.force ?? false;
40837
+ reportPrune(
40838
+ "~/.claude/skills",
40839
+ pruneSkills(path102.join(targetBase, "skills"), commandNames, { force }),
40840
+ force
40841
+ );
40845
40842
  reportPrune(
40846
40843
  "~/.claude/commands",
40847
- pruneCommands(path102.join(targetBase, "commands"), commandNames, { force }),
40844
+ pruneCommands(path102.join(targetBase, "commands"), [], { force }),
40848
40845
  force
40849
40846
  );
40850
40847
  }
@@ -40852,13 +40849,13 @@ async function sync(options2) {
40852
40849
  // src/commands/registerSync.ts
40853
40850
  function registerSync(program2) {
40854
40851
  const syncCommand = program2.command("sync").description(
40855
- "Copy command files to ~/.claude/commands; when codex is detected, also install commands as ~/.codex/skills/<name>/SKILL.md and register the assist codex-hook in ~/.codex/config.toml, which auto-approves read-only commands and injects the repo's composed advice on SessionStart; when pi is detected, also install commands as ~/.pi/agent/prompts/<name>.md and install the assist extensions into ~/.pi/agent/extensions, which gate permissions and inject the same advice. No global instructions file is written \u2014 every harness composes its own from assist advise at session start, and any ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md or ~/.pi/agent/AGENTS.md an earlier sync left behind is named so you can remove it. With --prune, also report commands in those target dirs that sync did not write, and with --prune --force remove them"
40852
+ "Install commands as ~/.claude/skills/<name>/SKILL.md, so they take precedence over a project skill of the same name, and delete any ~/.claude/commands/<name>.md an earlier sync wrote; when codex is detected, also install commands as ~/.codex/skills/<name>/SKILL.md and register the assist codex-hook in ~/.codex/config.toml, which auto-approves read-only commands and injects the repo's composed advice on SessionStart; when pi is detected, also install commands as ~/.pi/agent/prompts/<name>.md and install the assist extensions into ~/.pi/agent/extensions, which gate permissions and inject the same advice. No global instructions file is written \u2014 every harness composes its own from assist advise at session start, and any ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md or ~/.pi/agent/AGENTS.md an earlier sync left behind is named so you can remove it. With --prune, also report commands in those target dirs that sync did not write, and with --prune --force remove them"
40856
40853
  ).option("-y, --yes", "Overwrite settings.json without prompting").option(
40857
40854
  "--prune",
40858
- "After syncing, list commands in the target dirs whose name is not in the repo's claude/commands/*.md set; subdirectories and non-.md files are listed separately and never removed"
40855
+ "After syncing, list commands in the target dirs whose name is not in the repo's claude/commands/*.md set (every ~/.claude/commands/*.md counts, since sync no longer writes there); subdirectories and non-.md files are listed separately and never removed"
40859
40856
  ).option(
40860
40857
  "--force",
40861
- "With --prune, remove the listed orphaned commands; a codex skill directory is removed only when SKILL.md is its sole content. Errors without --prune"
40858
+ "With --prune, remove the listed orphaned commands; a claude or codex skill directory is removed only when SKILL.md is its sole content. Errors without --prune"
40862
40859
  ).action((options2) => {
40863
40860
  if (options2.force && !options2.prune) {
40864
40861
  console.error("--force requires --prune.");
@@ -41245,7 +41242,7 @@ function list3() {
41245
41242
 
41246
41243
  // src/commands/transcript/move.ts
41247
41244
  import { existsSync as existsSync79, mkdirSync as mkdirSync33, renameSync as renameSync4, writeFileSync as writeFileSync49 } from "fs";
41248
- import { basename as basename29, join as join99 } from "path";
41245
+ import { basename as basename28, join as join99 } from "path";
41249
41246
 
41250
41247
  // src/commands/transcript/convertVttToMarkdown.ts
41251
41248
  function convertVttToMarkdown(inputPath) {
@@ -41266,13 +41263,13 @@ function move(file, options2) {
41266
41263
  process.exit(1);
41267
41264
  }
41268
41265
  const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
41269
- const filename = basename29(file);
41266
+ const filename = basename28(file);
41270
41267
  const sourcePath = join99(vttDir, filename);
41271
41268
  if (!existsSync79(sourcePath)) {
41272
41269
  console.error(`Error: VTT file not found: ${sourcePath}`);
41273
41270
  process.exit(1);
41274
41271
  }
41275
- const base = basename29(filename, ".vtt").replace(/ Transcription$/, "");
41272
+ const base = basename28(filename, ".vtt").replace(/ Transcription$/, "");
41276
41273
  const outputName = `${date} ${base}.md`;
41277
41274
  const formattedDir = join99(transcriptsDir, client);
41278
41275
  mkdirSync33(formattedDir, { recursive: true });
@@ -41286,7 +41283,7 @@ function move(file, options2) {
41286
41283
 
41287
41284
  // src/commands/transcript/merge.ts
41288
41285
  import { existsSync as existsSync80, writeFileSync as writeFileSync50 } from "fs";
41289
- import { basename as basename30 } from "path";
41286
+ import { basename as basename29 } from "path";
41290
41287
 
41291
41288
  // src/commands/transcript/failTranscript.ts
41292
41289
  function failTranscript(message3) {
@@ -41432,7 +41429,7 @@ function readSource3(file) {
41432
41429
  if (!existsSync80(file)) failTranscript(`VTT file not found: ${file}`);
41433
41430
  const cues = readCleanedCues(file);
41434
41431
  if (cues.length === 0) failTranscript(`no cues found in: ${file}`);
41435
- return { path: file, name: basename30(file), cues };
41432
+ return { path: file, name: basename29(file), cues };
41436
41433
  }
41437
41434
  function wholePassages(sources) {
41438
41435
  return sources.map((source) => ({
@@ -42095,7 +42092,7 @@ function listMigrationFiles(dir) {
42095
42092
 
42096
42093
  // src/commands/verify/migrations/readBaselineMigrations.ts
42097
42094
  import { execSync as execSync58 } from "child_process";
42098
- import { basename as basename31 } from "path";
42095
+ import { basename as basename30 } from "path";
42099
42096
  var MIGRATION_FILE3 = /^migration\d+[A-Za-z0-9]*\.ts$/;
42100
42097
  function readBaselineMigrations(repoRelativeDir, ref) {
42101
42098
  const baseline = /* @__PURE__ */ new Map();
@@ -42108,7 +42105,7 @@ function readBaselineMigrations(repoRelativeDir, ref) {
42108
42105
  } catch {
42109
42106
  return baseline;
42110
42107
  }
42111
- const paths = listing.split("\n").map((line) => line.trim()).filter(Boolean).filter((path109) => MIGRATION_FILE3.test(basename31(path109)));
42108
+ const paths = listing.split("\n").map((line) => line.trim()).filter(Boolean).filter((path109) => MIGRATION_FILE3.test(basename30(path109)));
42112
42109
  for (const path109 of paths) {
42113
42110
  try {
42114
42111
  const content = execSync58(`git show "${ref}:${path109}"`, {
@@ -42116,7 +42113,7 @@ function readBaselineMigrations(repoRelativeDir, ref) {
42116
42113
  maxBuffer: 16 * 1024 * 1024,
42117
42114
  stdio: ["pipe", "pipe", "pipe"]
42118
42115
  });
42119
- baseline.set(basename31(path109), content);
42116
+ baseline.set(basename30(path109), content);
42120
42117
  } catch {
42121
42118
  }
42122
42119
  }
@@ -45326,7 +45323,7 @@ function setStatus2(session, newStatus) {
45326
45323
 
45327
45324
  // src/commands/sessions/daemon/worktree/reapWorktree.ts
45328
45325
  import { existsSync as existsSync90 } from "fs";
45329
- import { basename as basename32 } from "path";
45326
+ import { basename as basename31 } from "path";
45330
45327
 
45331
45328
  // src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
45332
45329
  import { existsSync as existsSync89 } from "fs";
@@ -45469,7 +45466,7 @@ async function reapWorktree(worktreePath, force = false) {
45469
45466
  const clone = owningClone(worktreePath);
45470
45467
  const removal = await removeTree(clone, worktreePath, force);
45471
45468
  if (!removal.removed) return removal;
45472
- await deleteWorktreeBranch(clone, basename32(worktreePath));
45469
+ await deleteWorktreeBranch(clone, basename31(worktreePath));
45473
45470
  forgetWorktree(worktreePath);
45474
45471
  daemonLog(`worktree ${worktreePath} reaped${force ? " (forced)" : ""}`);
45475
45472
  return removal;
@@ -48532,7 +48529,7 @@ function rearmStoppedSessions(sessions, notify2) {
48532
48529
 
48533
48530
  // src/commands/sessions/daemon/worktree/reconcileWorktreesOnRestore.ts
48534
48531
  import { existsSync as existsSync96 } from "fs";
48535
- import { basename as basename34 } from "path";
48532
+ import { basename as basename33 } from "path";
48536
48533
 
48537
48534
  // src/commands/sessions/daemon/worktree/accountedTrees.ts
48538
48535
  function accountedTrees(sessions) {
@@ -48640,7 +48637,7 @@ function capped2(lines2) {
48640
48637
  }
48641
48638
 
48642
48639
  // src/commands/sessions/daemon/worktree/resurfaceOrphanedWorktree.ts
48643
- import { basename as basename33 } from "path";
48640
+ import { basename as basename32 } from "path";
48644
48641
  function resurfaceOrphanedWorktree(sessions, spawnWith, recovered, notify2) {
48645
48642
  const { orphan, reason: reason4, held } = recovered;
48646
48643
  let id;
@@ -48663,7 +48660,7 @@ function orphanedSession(id, recovered) {
48663
48660
  const { orphan, reason: reason4, held } = recovered;
48664
48661
  return {
48665
48662
  ...sessionBase(id, "stopped"),
48666
- name: `recovered ${basename33(orphan.path)}`,
48663
+ name: `recovered ${basename32(orphan.path)}`,
48667
48664
  subtitle: `${held.summary} in ${orphan.path}`,
48668
48665
  commandType: "claude",
48669
48666
  pty: null,
@@ -48724,7 +48721,7 @@ async function recoverOrphanedWorktrees(sessions, spawnWith, notify2) {
48724
48721
  logVanishedTree(sessions, path109);
48725
48722
  vanished.set(clone, [
48726
48723
  ...vanished.get(clone) ?? [],
48727
- { path: path109, branch: basename34(path109) }
48724
+ { path: path109, branch: basename33(path109) }
48728
48725
  ]);
48729
48726
  continue;
48730
48727
  }
@@ -49830,7 +49827,7 @@ function resumeSession(id, sessionId, cwd, name, holdPty, harness) {
49830
49827
  import { existsSync as existsSync98 } from "fs";
49831
49828
 
49832
49829
  // src/commands/sessions/daemon/worktree/carryTranscriptToTree.ts
49833
- import { copyFileSync as copyFileSync5, existsSync as existsSync97, mkdirSync as mkdirSync38 } from "fs";
49830
+ import { copyFileSync as copyFileSync4, existsSync as existsSync97, mkdirSync as mkdirSync38 } from "fs";
49834
49831
  import { join as join107 } from "path";
49835
49832
  function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
49836
49833
  const dir = projectDirForCwd(toCwd);
@@ -49854,7 +49851,7 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
49854
49851
  }
49855
49852
  try {
49856
49853
  mkdirSync38(dir, { recursive: true });
49857
- copyFileSync5(source, dest);
49854
+ copyFileSync4(source, dest);
49858
49855
  daemonLog(
49859
49856
  `transcript ${source} copied to ${dest} so ${toCwd} can resume it`
49860
49857
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.875.3",
3
+ "version": "0.877.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {