@solaqua/gji 0.11.0 → 0.12.1

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 (77) hide show
  1. package/README.md +82 -496
  2. package/dist/bootstrap-output.js +0 -1
  3. package/dist/clean.js +2 -0
  4. package/dist/cli.d.ts +4 -0
  5. package/dist/cli.js +40 -4
  6. package/dist/context-card.d.ts +1 -0
  7. package/dist/context-card.js +25 -0
  8. package/dist/dependency-bootstrap.d.ts +10 -17
  9. package/dist/dependency-bootstrap.js +343 -108
  10. package/dist/dir-clone.d.ts +1 -2
  11. package/dist/dir-clone.js +303 -167
  12. package/dist/doctor.js +21 -0
  13. package/dist/done.js +2 -0
  14. package/dist/gji-bundle.mjs +1854 -1032
  15. package/dist/go.d.ts +1 -0
  16. package/dist/go.js +8 -0
  17. package/dist/hooks.d.ts +1 -0
  18. package/dist/hooks.js +7 -1
  19. package/dist/hub.d.ts +31 -0
  20. package/dist/hub.js +299 -0
  21. package/dist/ls.js +9 -1
  22. package/dist/new.d.ts +1 -0
  23. package/dist/new.js +9 -0
  24. package/dist/pr-open.js +2 -10
  25. package/dist/pull-requests.d.ts +1 -0
  26. package/dist/pull-requests.js +32 -3
  27. package/dist/remove.js +2 -0
  28. package/dist/repo.d.ts +1 -0
  29. package/dist/repo.js +4 -0
  30. package/dist/run-hook.js +2 -0
  31. package/dist/safe-destination.js +10 -0
  32. package/dist/shell-completion.js +11 -3
  33. package/dist/slots.d.ts +8 -0
  34. package/dist/slots.js +61 -0
  35. package/dist/status.d.ts +2 -0
  36. package/dist/status.js +9 -1
  37. package/dist/sync-directories.d.ts +0 -4
  38. package/dist/sync-directories.js +6 -26
  39. package/dist/task-command.d.ts +9 -0
  40. package/dist/task-command.js +29 -0
  41. package/dist/task.d.ts +9 -0
  42. package/dist/task.js +37 -0
  43. package/dist/terminal-text.d.ts +4 -0
  44. package/dist/terminal-text.js +72 -0
  45. package/dist/worktree-bootstrap.js +3 -2
  46. package/dist/worktree-info.d.ts +6 -1
  47. package/dist/worktree-info.js +14 -4
  48. package/dist/worktree-picker.d.ts +3 -3
  49. package/dist/worktree-picker.js +84 -82
  50. package/dist/worktree-sources.d.ts +1 -0
  51. package/dist/worktree-sources.js +57 -11
  52. package/man/man1/gji-back.1 +1 -1
  53. package/man/man1/gji-clean.1 +1 -1
  54. package/man/man1/gji-completion.1 +1 -1
  55. package/man/man1/gji-config.1 +1 -1
  56. package/man/man1/gji-doctor.1 +1 -1
  57. package/man/man1/gji-done.1 +1 -1
  58. package/man/man1/gji-go.1 +4 -1
  59. package/man/man1/gji-history.1 +1 -1
  60. package/man/man1/gji-init.1 +1 -1
  61. package/man/man1/gji-ls.1 +1 -1
  62. package/man/man1/gji-new.1 +4 -1
  63. package/man/man1/gji-open.1 +1 -1
  64. package/man/man1/gji-pr.1 +1 -1
  65. package/man/man1/gji-remove.1 +1 -1
  66. package/man/man1/gji-root.1 +1 -1
  67. package/man/man1/gji-run-hook.1 +1 -1
  68. package/man/man1/gji-status.1 +1 -1
  69. package/man/man1/gji-sync-files.1 +1 -1
  70. package/man/man1/gji-sync.1 +1 -1
  71. package/man/man1/gji-task.1 +16 -0
  72. package/man/man1/gji-undo.1 +1 -1
  73. package/man/man1/gji-warp.1 +1 -1
  74. package/man/man1/gji.1 +5 -1
  75. package/package.json +1 -1
  76. package/dist/clone-failure-store.d.ts +0 -18
  77. package/dist/clone-failure-store.js +0 -230
package/dist/doctor.js CHANGED
@@ -12,6 +12,7 @@ import { detectRepository } from "./repo.js";
12
12
  import { loadRegistry, REGISTRY_FILE_PATH, removeMissingRegistryEntries, } from "./repo-registry.js";
13
13
  import { resolveSupportedShell } from "./shell.js";
14
14
  import { executableExists, hasShellIntegration, resolveCompletionPath, resolveShellConfigPath, } from "./shell-setup.js";
15
+ import { loadSlots } from "./slots.js";
15
16
  const execFileAsync = promisify(execFile);
16
17
  const MINIMUM_GIT_VERSION = { major: 2, minor: 17 };
17
18
  export async function runDoctorCommand(options) {
@@ -82,10 +83,30 @@ async function collectDoctorInspection(cwd, home, shell) {
82
83
  await checkWorktreeBase(repository, effectiveConfig, home),
83
84
  registry.check,
84
85
  await checkEditor(effectiveConfig),
86
+ await checkOrphanSlots(home),
85
87
  ],
86
88
  missingRegistryPaths: registry.missingPaths,
87
89
  };
88
90
  }
91
+ async function checkOrphanSlots(home) {
92
+ const slots = await loadSlots(home);
93
+ const missing = (await Promise.all(Object.keys(slots).map(async (path) => {
94
+ try {
95
+ await access(path);
96
+ return false;
97
+ }
98
+ catch {
99
+ return true;
100
+ }
101
+ }))).filter(Boolean).length;
102
+ return {
103
+ id: "slots",
104
+ message: missing === 0
105
+ ? "worktree slots healthy"
106
+ : `${missing} orphaned worktree slot${missing === 1 ? "" : "s"}`,
107
+ status: "ok",
108
+ };
109
+ }
89
110
  function buildDoctorFixes(missingRegistryPaths) {
90
111
  if (missingRegistryPaths.length === 0)
91
112
  return [];
package/dist/done.js CHANGED
@@ -7,6 +7,7 @@ import { loadHistory } from "./history.js";
7
7
  import { extractHooks, runHook } from "./hooks.js";
8
8
  import { detectRepository, listWorktrees } from "./repo.js";
9
9
  import { writeShellOutput } from "./shell-handoff.js";
10
+ import { releaseWorktreeSlot } from "./slots.js";
10
11
  import { finalizeUndoOperation, recordUndoOperation } from "./undo.js";
11
12
  import { deleteBranch, forceDeleteBranch, forceRemoveWorktree, isBranchUnmergedError, isWorktreeForceRemovalError, removeWorktree, } from "./worktree-management.js";
12
13
  const DONE_OUTPUT_FILE_ENV = "GJI_DONE_OUTPUT_FILE";
@@ -122,6 +123,7 @@ export async function runDoneCommand(options) {
122
123
  }
123
124
  }
124
125
  await finalizeUndoOperation(journal, [target]);
126
+ await releaseWorktreeSlot(target.path);
125
127
  await runGit(repository.repoRoot, ["worktree", "prune"]).catch(() => undefined);
126
128
  const shouldMove = options.branch === undefined || target.path === repository.currentRoot;
127
129
  const movedTo = shouldMove