@sma1lboy/kobe 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli/index.js +24 -4
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -70,7 +70,7 @@ var init_package = __esm(() => {
70
70
  package_default = {
71
71
  $schema: "https://json.schemastore.org/package.json",
72
72
  name: "@sma1lboy/kobe",
73
- version: "0.7.5",
73
+ version: "0.7.6",
74
74
  description: "TUI orchestrator for Claude Code (codename)",
75
75
  type: "module",
76
76
  packageManager: "bun@1.3.13",
@@ -2477,6 +2477,8 @@ class ClaudeHookAdapter {
2477
2477
  const current = await readJsonObject(settingsFilePath);
2478
2478
  const command = install ? shellQuoteArgv([...kobeCliInvocation(), "hook", "worktree-created"]) : null;
2479
2479
  const next = mergeWorktreeSyncHook(current, command);
2480
+ if (JSON.stringify(next) === JSON.stringify(current))
2481
+ return;
2480
2482
  await mkdir2(dirname3(settingsFilePath), { recursive: true });
2481
2483
  await writeFile2(settingsFilePath, `${JSON.stringify(next, null, 2)}
2482
2484
  `);
@@ -8454,7 +8456,8 @@ var init_skill_cmd = __esm(() => {
8454
8456
  // src/cli/hook-cmd.ts
8455
8457
  var exports_hook_cmd = {};
8456
8458
  __export(exports_hook_cmd, {
8457
- runHookSubcommand: () => runHookSubcommand
8459
+ runHookSubcommand: () => runHookSubcommand,
8460
+ ensureDefaultWorktreeSync: () => ensureDefaultWorktreeSync
8458
8461
  });
8459
8462
  import { homedir as homedir10 } from "os";
8460
8463
  import { dirname as dirname7, join as join10, resolve as resolve6 } from "path";
@@ -8572,13 +8575,29 @@ function persistedSyncPath(stored) {
8572
8575
  return syncSettingsPath({ kind: "repo", path: stored.slice(5) });
8573
8576
  return stored;
8574
8577
  }
8578
+ async function ensureDefaultWorktreeSync() {
8579
+ try {
8580
+ const stored = getPersistedString(SYNC_SETTING_KEY);
8581
+ if (stored === "off")
8582
+ return;
8583
+ const adapters = worktreeSyncAdapters();
8584
+ if (adapters.length === 0)
8585
+ return;
8586
+ const path6 = persistedSyncPath(stored) ?? syncSettingsPath({ kind: "global" });
8587
+ for (const a of adapters)
8588
+ await a.installWorktreeSyncHook(path6);
8589
+ if (!stored)
8590
+ setPersistedString(SYNC_SETTING_KEY, path6);
8591
+ } catch {}
8592
+ }
8575
8593
  async function runHookSetup(argv) {
8576
8594
  if (argv.includes("--help") || argv.includes("-h")) {
8577
8595
  process.stdout.write([
8578
8596
  "Usage: kobe hook setup [--global | --repo <path> | --off]",
8579
8597
  "",
8580
- "Install (or remove with --off) the hook that syncs an external",
8581
- "`claude --worktree` into kobe as a task. Default: --global (~/.claude).",
8598
+ "Syncs an external `claude --worktree` into kobe as a task. This is ON",
8599
+ "by default (installed globally into ~/.claude on launch). Use this to",
8600
+ "move it to one repo (--repo <path>) or to turn it OFF (--off).",
8582
8601
  ""
8583
8602
  ].join(`
8584
8603
  `));
@@ -21141,6 +21160,7 @@ async function ensureRepos(orchestrator) {
21141
21160
  }
21142
21161
  async function startDirectTmux() {
21143
21162
  setClientLogContext("gui");
21163
+ Promise.resolve().then(() => (init_hook_cmd(), exports_hook_cmd)).then((m) => m.ensureDefaultWorktreeSync());
21144
21164
  if (!await tmuxAvailable()) {
21145
21165
  console.error("kobe: tmux not found on PATH \u2014 install tmux to use kobe 0.6 direct mode");
21146
21166
  process.exitCode = 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sma1lboy/kobe",
4
- "version": "0.7.5",
4
+ "version": "0.7.6",
5
5
  "description": "TUI orchestrator for Claude Code (codename)",
6
6
  "type": "module",
7
7
  "packageManager": "bun@1.3.13",