@narumitw/pi-worktree 0.51.7 → 0.51.8
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/README.md +19 -57
- package/dist/index.ts +52 -226
- package/dist/index.ts.map +2 -2
- package/package.json +49 -50
- package/src/command.ts +605 -693
- package/src/git.ts +635 -731
- package/src/session.ts +76 -84
- package/src/settings.ts +211 -223
- package/src/status.ts +287 -309
- package/src/worktree.ts +26 -33
package/README.md
CHANGED
|
@@ -46,34 +46,11 @@ Before each Git mutation, the extension runs its safety checks and shows the exa
|
|
|
46
46
|
|
|
47
47
|
## 💬 Commands
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
The root menu provides these actions:
|
|
56
|
-
|
|
57
|
-
- **Worktree status** — browse a local snapshot for every registered worktree without fetching remotes.
|
|
58
|
-
- **Add worktree** — enter a branch, optional start point, and optional path; review exact base provenance, confirm creation, and optionally switch.
|
|
59
|
-
- **Switch worktree** — search for another existing worktree by displayed path, branch, or HEAD and continue this Pi conversation there.
|
|
60
|
-
- **Remove worktree** — search for a linked worktree by path, branch, or HEAD, then remove it without deleting its branch.
|
|
61
|
-
- **Prune stale metadata** — inspect Git's dry-run output, then optionally run the matching prune.
|
|
62
|
-
- **Configure worktree root** — set a machine-local default root or submit a blank value to restore `~/.worktrees`.
|
|
63
|
-
|
|
64
|
-
The root menu shows the registered count, current path, effective worktree root, its source, and any settings warning.
|
|
65
|
-
Escape closes the root menu.
|
|
66
|
-
`/worktree` accepts no arguments and provides no argument completions.
|
|
67
|
-
Every operation starts through TUI or RPC dialogs, and destructive Git changes require confirmation.
|
|
68
|
-
Print and JSON modes reject the command before any Git call.
|
|
69
|
-
The extension owns branch and path inputs, searchable worktree selectors, preflight previews, and destructive confirmations.
|
|
70
|
-
These flows enforce Git safety and commit-aware revalidation.
|
|
71
|
-
|
|
72
|
-
The status browser runs only when selected and uses no watcher, timer, persistent cache, or network fetch.
|
|
73
|
-
Each card shows current, main, or detached state; the full snapshot HEAD; aggregate working-tree counts; configured upstream divergence; and the last commit timestamp and subject.
|
|
74
|
-
A missing upstream is reported as **not configured**; it is not treated as proof that no commits are unpushed.
|
|
75
|
-
Bare, missing, prunable, or individually failing worktrees remain visible with an unavailable reason.
|
|
76
|
-
The snapshot is informational and can become stale immediately, so Remove still performs its stricter inventory and identity checks.
|
|
49
|
+
Run `/worktree` to inspect, create, switch, or remove Git worktrees, prune stale metadata, and configure the default root in TUI or RPC mode.
|
|
50
|
+
It accepts no arguments; print and JSON modes reject it before any Git call.
|
|
51
|
+
Git must be installed and Pi must be inside a non-bare worktree.
|
|
52
|
+
Destructive changes require confirmation and never delete branches; review [Safety boundaries](#-safety-boundaries), including ignored-file and recovery-pointer loss.
|
|
53
|
+
See [Add defaults](#-add-defaults) for creation rules and [Pi workspace switching](#-pi-workspace-switching) for conversation transfer and failure recovery.
|
|
77
54
|
|
|
78
55
|
## 🌿 Add defaults
|
|
79
56
|
|
|
@@ -185,6 +162,11 @@ Resolve the reported Pi or session issue, then run `/worktree` and choose **Swit
|
|
|
185
162
|
- The status browser uses only local Git state and never fetches a remote; its cards never authorize Remove or Prune.
|
|
186
163
|
- The extension does not commit, push, fetch, rebase, repair, move, lock, or unlock worktrees.
|
|
187
164
|
|
|
165
|
+
Status is an on-demand local snapshot of each worktree's state, full HEAD, working-tree counts, upstream divergence, and last commit.
|
|
166
|
+
Unavailable worktrees remain visible with a reason.
|
|
167
|
+
A missing upstream means **not configured**, not proof that no commits are unpushed.
|
|
168
|
+
Snapshots can become stale immediately and never replace the stricter Remove and Prune checks.
|
|
169
|
+
|
|
188
170
|
Use Git directly for force removal, branch deletion, custom prune expiry, detach or orphan creation, move, repair, lock, unlock, and remote refresh operations.
|
|
189
171
|
|
|
190
172
|
## 🚧 Limitations
|
|
@@ -198,40 +180,20 @@ Use Git directly for force removal, branch deletion, custom prune expiry, detach
|
|
|
198
180
|
|
|
199
181
|
```text
|
|
200
182
|
packages/pi-worktree/
|
|
201
|
-
├── src/
|
|
202
|
-
│ ├── index.ts
|
|
203
|
-
│
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
│ ├── status.ts
|
|
208
|
-
│ └── worktree.ts
|
|
209
|
-
├── dist/ # Generated source-mapped Jiti runtime
|
|
210
|
-
├── scripts/
|
|
211
|
-
│ └── build-runtime.mjs
|
|
212
|
-
├── test/
|
|
213
|
-
│ ├── add-command.test.ts
|
|
214
|
-
│ ├── command-test-support.ts
|
|
215
|
-
│ ├── command.test.ts
|
|
216
|
-
│ ├── build-runtime.test.ts
|
|
217
|
-
│ ├── git.integration.test.ts
|
|
218
|
-
│ ├── git.test.ts
|
|
219
|
-
│ ├── remove-ignored-command.test.ts
|
|
220
|
-
│ ├── session.test.ts
|
|
221
|
-
│ ├── settings-command.test.ts
|
|
222
|
-
│ ├── settings.test.ts
|
|
223
|
-
│ ├── status-command.test.ts
|
|
224
|
-
│ └── status.test.ts
|
|
225
|
-
├── package.json
|
|
226
|
-
├── README.md
|
|
227
|
-
├── LICENSE
|
|
228
|
-
└── tsconfig.json
|
|
183
|
+
├── src/ # Authoritative implementation and helpers
|
|
184
|
+
│ ├── index.ts # Thin Pi entrypoint
|
|
185
|
+
│ └── worktree.ts # Worktree manager and lifecycle
|
|
186
|
+
├── dist/ # Generated Jiti runtime
|
|
187
|
+
├── scripts/build-runtime.mjs # Runtime builder
|
|
188
|
+
└── test/ # Behavior and lifecycle coverage
|
|
229
189
|
```
|
|
230
190
|
|
|
191
|
+
The generated runtime is built from `src/index.ts` and does not import back into `src`.
|
|
192
|
+
|
|
231
193
|
## 🔎 Keywords
|
|
232
194
|
|
|
233
195
|
`pi-package`, `pi-extension`, `git`, `worktree`, `workspace`, `session`
|
|
234
196
|
|
|
235
197
|
## 📄 License
|
|
236
198
|
|
|
237
|
-
MIT
|
|
199
|
+
[MIT](./LICENSE)
|