zelio-cli 0.0.0-stage → 0.1.0-beta.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.
- package/README.md +178 -2
- package/dist/attachments.js +121 -0
- package/dist/attachments.js.map +1 -0
- package/dist/cli.js +469 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud/board.js +311 -0
- package/dist/cloud/board.js.map +1 -0
- package/dist/cloud/command.js +260 -0
- package/dist/cloud/command.js.map +1 -0
- package/dist/cloud/config.js +132 -0
- package/dist/cloud/config.js.map +1 -0
- package/dist/cloud/credentials.js +134 -0
- package/dist/cloud/credentials.js.map +1 -0
- package/dist/cloud/login.js +165 -0
- package/dist/cloud/login.js.map +1 -0
- package/dist/cloud/pair.js +110 -0
- package/dist/cloud/pair.js.map +1 -0
- package/dist/cloud/pkce.js +16 -0
- package/dist/cloud/pkce.js.map +1 -0
- package/dist/cloud/push-nudge.js +63 -0
- package/dist/cloud/push-nudge.js.map +1 -0
- package/dist/cloud/relay.js +129 -0
- package/dist/cloud/relay.js.map +1 -0
- package/dist/cloud/token.js +66 -0
- package/dist/cloud/token.js.map +1 -0
- package/dist/cloud/tunnel.js +410 -0
- package/dist/cloud/tunnel.js.map +1 -0
- package/dist/db/db.js +1614 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/lifecycle.js +133 -0
- package/dist/db/lifecycle.js.map +1 -0
- package/dist/limits.js +35 -0
- package/dist/limits.js.map +1 -0
- package/dist/metrics.js +30 -0
- package/dist/metrics.js.map +1 -0
- package/dist/orchestrator/claude-session.js +208 -0
- package/dist/orchestrator/claude-session.js.map +1 -0
- package/dist/orchestrator/codex-session.js +326 -0
- package/dist/orchestrator/codex-session.js.map +1 -0
- package/dist/orchestrator/contract.js +181 -0
- package/dist/orchestrator/contract.js.map +1 -0
- package/dist/orchestrator/explore.js +176 -0
- package/dist/orchestrator/explore.js.map +1 -0
- package/dist/orchestrator/new-task-prompt.js +51 -0
- package/dist/orchestrator/new-task-prompt.js.map +1 -0
- package/dist/orchestrator/pi-session.js +228 -0
- package/dist/orchestrator/pi-session.js.map +1 -0
- package/dist/orchestrator/prompt.js +110 -0
- package/dist/orchestrator/prompt.js.map +1 -0
- package/dist/orchestrator/research.js +178 -0
- package/dist/orchestrator/research.js.map +1 -0
- package/dist/orchestrator/runtime.js +1054 -0
- package/dist/orchestrator/runtime.js.map +1 -0
- package/dist/orchestrator/session.js +2 -0
- package/dist/orchestrator/session.js.map +1 -0
- package/dist/orchestrator/types.js +2 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/web.js +276 -0
- package/dist/orchestrator/web.js.map +1 -0
- package/dist/repo/index.js +188 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/repo/instructions.js +52 -0
- package/dist/repo/instructions.js.map +1 -0
- package/dist/repo/linked-boards.js +252 -0
- package/dist/repo/linked-boards.js.map +1 -0
- package/dist/run/actions.js +233 -0
- package/dist/run/actions.js.map +1 -0
- package/dist/run/bash-guard.js +183 -0
- package/dist/run/bash-guard.js.map +1 -0
- package/dist/run/claude-runtime.js +242 -0
- package/dist/run/claude-runtime.js.map +1 -0
- package/dist/run/claude-stream.js +306 -0
- package/dist/run/claude-stream.js.map +1 -0
- package/dist/run/codex-client.js +200 -0
- package/dist/run/codex-client.js.map +1 -0
- package/dist/run/codex-runtime.js +366 -0
- package/dist/run/codex-runtime.js.map +1 -0
- package/dist/run/context.js +87 -0
- package/dist/run/context.js.map +1 -0
- package/dist/run/diff.js +196 -0
- package/dist/run/diff.js.map +1 -0
- package/dist/run/evidence.js +48 -0
- package/dist/run/evidence.js.map +1 -0
- package/dist/run/finish.js +393 -0
- package/dist/run/finish.js.map +1 -0
- package/dist/run/harness-runtime.js +28 -0
- package/dist/run/harness-runtime.js.map +1 -0
- package/dist/run/harnesses.js +273 -0
- package/dist/run/harnesses.js.map +1 -0
- package/dist/run/issue.js +79 -0
- package/dist/run/issue.js.map +1 -0
- package/dist/run/keep-awake.js +58 -0
- package/dist/run/keep-awake.js.map +1 -0
- package/dist/run/lead.js +200 -0
- package/dist/run/lead.js.map +1 -0
- package/dist/run/manager.js +1709 -0
- package/dist/run/manager.js.map +1 -0
- package/dist/run/mentions.js +35 -0
- package/dist/run/mentions.js.map +1 -0
- package/dist/run/merge-watch.js +394 -0
- package/dist/run/merge-watch.js.map +1 -0
- package/dist/run/models.js +88 -0
- package/dist/run/models.js.map +1 -0
- package/dist/run/phases.js +23 -0
- package/dist/run/phases.js.map +1 -0
- package/dist/run/pi-rpc.js +412 -0
- package/dist/run/pi-rpc.js.map +1 -0
- package/dist/run/pr-merge.js +121 -0
- package/dist/run/pr-merge.js.map +1 -0
- package/dist/run/profiles.js +43 -0
- package/dist/run/profiles.js.map +1 -0
- package/dist/run/prompt.js +345 -0
- package/dist/run/prompt.js.map +1 -0
- package/dist/run/pull-request.js +23 -0
- package/dist/run/pull-request.js.map +1 -0
- package/dist/run/result-tool.js +93 -0
- package/dist/run/result-tool.js.map +1 -0
- package/dist/run/result.js +113 -0
- package/dist/run/result.js.map +1 -0
- package/dist/run/retro.js +346 -0
- package/dist/run/retro.js.map +1 -0
- package/dist/run/settings.js +25 -0
- package/dist/run/settings.js.map +1 -0
- package/dist/run/thinking.js +41 -0
- package/dist/run/thinking.js.map +1 -0
- package/dist/run/types.js +2 -0
- package/dist/run/types.js.map +1 -0
- package/dist/run/workflow.js +266 -0
- package/dist/run/workflow.js.map +1 -0
- package/dist/run/worktree.js +354 -0
- package/dist/run/worktree.js.map +1 -0
- package/dist/server/app.js +2503 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/auth.js +93 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/demo.js +96 -0
- package/dist/server/demo.js.map +1 -0
- package/dist/server/idempotency.js +104 -0
- package/dist/server/idempotency.js.map +1 -0
- package/dist/server/port.js +36 -0
- package/dist/server/port.js.map +1 -0
- package/dist/server/principal.js +90 -0
- package/dist/server/principal.js.map +1 -0
- package/dist/server/terminal.js +285 -0
- package/dist/server/terminal.js.map +1 -0
- package/dist/setup/components.js +98 -0
- package/dist/setup/components.js.map +1 -0
- package/dist/setup/config.js +102 -0
- package/dist/setup/config.js.map +1 -0
- package/dist/setup/ink-ui.js +188 -0
- package/dist/setup/ink-ui.js.map +1 -0
- package/dist/setup/onboarding.js +183 -0
- package/dist/setup/onboarding.js.map +1 -0
- package/dist/setup/run.js +70 -0
- package/dist/setup/run.js.map +1 -0
- package/dist/ticket-cli.js +116 -0
- package/dist/ticket-cli.js.map +1 -0
- package/dist/voice/index.js +69 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/moonshine.js +247 -0
- package/dist/voice/moonshine.js.map +1 -0
- package/dist/voice/wav.js +54 -0
- package/dist/voice/wav.js.map +1 -0
- package/dist/voice/whisper.js +491 -0
- package/dist/voice/whisper.js.map +1 -0
- package/dist/web/assets/index-ChuS3qKc.js +254 -0
- package/dist/web/assets/index-DR6WkmzI.css +1 -0
- package/dist/web/icons/apple-touch-icon.png +0 -0
- package/dist/web/icons/icon-192.png +0 -0
- package/dist/web/icons/icon-512.png +0 -0
- package/dist/web/icons/maskable-512.png +0 -0
- package/dist/web/index.html +21 -0
- package/dist/web/manifest.webmanifest +30 -0
- package/dist/web/sw.js +183 -0
- package/package.json +96 -4
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
export class WorktreeError extends Error {
|
|
6
|
+
kind;
|
|
7
|
+
constructor(kind, message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.kind = kind;
|
|
10
|
+
this.name = "WorktreeError";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const exec = promisify(execFile);
|
|
14
|
+
const GIT_TIMEOUT_MS = 15_000;
|
|
15
|
+
/** Ticket ids are ours (`T-` plus hex), but they end up in a path and a ref. */
|
|
16
|
+
function safeId(ticketId) {
|
|
17
|
+
if (!/^[A-Za-z0-9._-]+$/.test(ticketId) || ticketId.startsWith(".")) {
|
|
18
|
+
throw new WorktreeError("path-conflict", `not a usable ticket id: ${ticketId}`);
|
|
19
|
+
}
|
|
20
|
+
return ticketId;
|
|
21
|
+
}
|
|
22
|
+
export function worktreePath(root, ticketId) {
|
|
23
|
+
return join(resolve(root), ".zelio", "worktrees", safeId(ticketId));
|
|
24
|
+
}
|
|
25
|
+
/** The branch a checkout made before title branches would be on. */
|
|
26
|
+
export function worktreeBranch(ticketId) {
|
|
27
|
+
return `zelio/${safeId(ticketId)}`;
|
|
28
|
+
}
|
|
29
|
+
/** The first word of a title, mapped to the conventional type it implies. */
|
|
30
|
+
const TYPES = {
|
|
31
|
+
add: "feat",
|
|
32
|
+
allow: "feat",
|
|
33
|
+
create: "feat",
|
|
34
|
+
enable: "feat",
|
|
35
|
+
implement: "feat",
|
|
36
|
+
introduce: "feat",
|
|
37
|
+
support: "feat",
|
|
38
|
+
build: "build",
|
|
39
|
+
correct: "fix",
|
|
40
|
+
fix: "fix",
|
|
41
|
+
prevent: "fix",
|
|
42
|
+
repair: "fix",
|
|
43
|
+
resolve: "fix",
|
|
44
|
+
ci: "ci",
|
|
45
|
+
document: "docs",
|
|
46
|
+
docs: "docs",
|
|
47
|
+
chore: "chore",
|
|
48
|
+
bump: "chore",
|
|
49
|
+
depend: "chore",
|
|
50
|
+
dependencies: "chore",
|
|
51
|
+
update: "chore",
|
|
52
|
+
upgrade: "chore",
|
|
53
|
+
extract: "refactor",
|
|
54
|
+
move: "refactor",
|
|
55
|
+
refactor: "refactor",
|
|
56
|
+
remove: "refactor",
|
|
57
|
+
rename: "refactor",
|
|
58
|
+
replace: "refactor",
|
|
59
|
+
simplify: "refactor",
|
|
60
|
+
split: "refactor",
|
|
61
|
+
optimise: "perf",
|
|
62
|
+
optimize: "perf",
|
|
63
|
+
perf: "perf",
|
|
64
|
+
speed: "perf",
|
|
65
|
+
format: "style",
|
|
66
|
+
style: "style",
|
|
67
|
+
cover: "test",
|
|
68
|
+
test: "test",
|
|
69
|
+
tests: "test",
|
|
70
|
+
revert: "revert",
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* How much of a title's slug a branch carries. A title is a sentence, not a
|
|
74
|
+
* ref: past this length git's own limits and the person's terminal make the
|
|
75
|
+
* name unreadable, and the ticket id is what actually identifies the branch.
|
|
76
|
+
*/
|
|
77
|
+
const SLUG_LIMIT = 40;
|
|
78
|
+
/**
|
|
79
|
+
* Caps a slug at `SLUG_LIMIT`, dropping a half word rather than shipping one.
|
|
80
|
+
* A single word longer than the limit has no word boundary to fall back on, so
|
|
81
|
+
* it is hard-cut: the branch still has to exist for the agent to commit.
|
|
82
|
+
*/
|
|
83
|
+
function capSlug(slug) {
|
|
84
|
+
if (slug.length <= SLUG_LIMIT)
|
|
85
|
+
return slug;
|
|
86
|
+
const cut = slug.slice(0, SLUG_LIMIT).replace(/-+$/, "");
|
|
87
|
+
const breakAt = cut.lastIndexOf("-");
|
|
88
|
+
return breakAt > 0 ? cut.slice(0, breakAt).replace(/-+$/, "") : cut;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The branch name a title implies. Unknown leading words and titles that have
|
|
92
|
+
* no slug at all still get a branch: the ticket id is always usable, and an
|
|
93
|
+
* agent with nowhere to commit cannot finish the ticket.
|
|
94
|
+
*/
|
|
95
|
+
export function branchName(title, ticketId) {
|
|
96
|
+
const id = safeId(ticketId);
|
|
97
|
+
const slug = capSlug(title
|
|
98
|
+
.normalize("NFKD")
|
|
99
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
100
|
+
.toLowerCase()
|
|
101
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
102
|
+
.replace(/^-+|-+$/g, ""));
|
|
103
|
+
const type = TYPES[slug.split("-")[0] ?? ""] ?? "chore";
|
|
104
|
+
return `${type}/${slug || id}`;
|
|
105
|
+
}
|
|
106
|
+
async function git(root, args) {
|
|
107
|
+
try {
|
|
108
|
+
const { stdout } = await exec("git", ["-C", root, ...args], { timeout: GIT_TIMEOUT_MS });
|
|
109
|
+
return stdout;
|
|
110
|
+
}
|
|
111
|
+
catch (cause) {
|
|
112
|
+
const reason = cause && typeof cause === "object" && "stderr" in cause
|
|
113
|
+
? String(cause.stderr).trim().split("\n")[0]
|
|
114
|
+
: cause instanceof Error
|
|
115
|
+
? cause.message
|
|
116
|
+
: "git failed";
|
|
117
|
+
throw new WorktreeError("git", reason || "git failed");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Checks what a worktree cannot say for itself. The refusal is checked before
|
|
122
|
+
* any side effect: an agent with no commit to branch from would "run" and write
|
|
123
|
+
* its work somewhere nobody can review.
|
|
124
|
+
*/
|
|
125
|
+
async function assertCanBranch(root, ticketId) {
|
|
126
|
+
try {
|
|
127
|
+
await exec("git", ["-C", root, "rev-parse", "--git-dir"], { timeout: GIT_TIMEOUT_MS });
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
throw new WorktreeError("not-a-repo", `cannot start ${ticketId}: ${root} is not a git repository`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The ticket branch starts from main, not from whatever branch the person
|
|
135
|
+
* happens to have checked out. Starting from HEAD while an unmerged feature
|
|
136
|
+
* branch is open makes the ticket PR inherit that branch's commits.
|
|
137
|
+
*/
|
|
138
|
+
async function resolveBase(root, ticketId) {
|
|
139
|
+
for (const ref of ["refs/heads/main", "refs/remotes/origin/main"]) {
|
|
140
|
+
try {
|
|
141
|
+
// Candidate order matters: the local main is the branch the person
|
|
142
|
+
// expects, and a stale origin/main should not silently become the base.
|
|
143
|
+
// oxlint-disable-next-line no-await-in-loop
|
|
144
|
+
await git(root, ["rev-parse", "--verify", "--quiet", ref]);
|
|
145
|
+
return ref;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// Try the next name; a repo without main still gets the HEAD fallback.
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
await git(root, ["rev-parse", "--verify", "HEAD"]);
|
|
153
|
+
return "HEAD";
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
throw new WorktreeError("no-commits", `cannot start ${ticketId}: the repo has no commits to branch from`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** Branch names currently checked out in any worktree, the main one included. */
|
|
160
|
+
async function branchesInUse(root) {
|
|
161
|
+
const listing = await git(root, ["worktree", "list", "--porcelain"]);
|
|
162
|
+
const branches = new Set();
|
|
163
|
+
for (const line of listing.split("\n")) {
|
|
164
|
+
if (line.startsWith("branch refs/heads/")) {
|
|
165
|
+
branches.add(line.slice("branch refs/heads/".length));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return branches;
|
|
169
|
+
}
|
|
170
|
+
async function branchExists(root, branch) {
|
|
171
|
+
return git(root, ["rev-parse", "--verify", "--quiet", `refs/heads/${branch}`]).then(() => true, () => false);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Two tickets can share a title, and a branch can only be checked out once. The
|
|
175
|
+
* title's branch belongs to the first ticket; the second gets the same slug with
|
|
176
|
+
* its own id appended. A branch with no checkout is reused: it is this ticket's
|
|
177
|
+
* branch after a checkout was removed by hand.
|
|
178
|
+
*/
|
|
179
|
+
async function availableBranch(root, wanted, ticketId) {
|
|
180
|
+
const inUse = await branchesInUse(root);
|
|
181
|
+
if (!inUse.has(wanted))
|
|
182
|
+
return wanted;
|
|
183
|
+
const suffixed = `${wanted}-${ticketId}`;
|
|
184
|
+
if (!inUse.has(suffixed))
|
|
185
|
+
return suffixed;
|
|
186
|
+
for (let attempt = 2;; attempt += 1) {
|
|
187
|
+
const candidate = `${suffixed}-${attempt}`;
|
|
188
|
+
if (!inUse.has(candidate))
|
|
189
|
+
return candidate;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export async function ensureWorktree(root, ticketId, title = "", recordedBranch) {
|
|
193
|
+
const id = safeId(ticketId);
|
|
194
|
+
const path = worktreePath(root, id);
|
|
195
|
+
// A linked worktree's `.git` is a file, not a directory: this is the cheap
|
|
196
|
+
// check, and it keeps the common re-start away from git entirely. The branch
|
|
197
|
+
// is read from the checkout itself, so a title edited after the start does
|
|
198
|
+
// not disagree with what git actually has checked out.
|
|
199
|
+
if (existsSync(join(path, ".git"))) {
|
|
200
|
+
const branch = (await git(path, ["branch", "--show-current"])).trim() || worktreeBranch(id);
|
|
201
|
+
return { path, branch, created: false };
|
|
202
|
+
}
|
|
203
|
+
if (existsSync(path)) {
|
|
204
|
+
throw new WorktreeError("path-conflict", `cannot start ${id}: ${path} exists but is not a git worktree`);
|
|
205
|
+
}
|
|
206
|
+
await assertCanBranch(root, id);
|
|
207
|
+
const base = await resolveBase(root, id);
|
|
208
|
+
// Callers that only know the id (older tests, a caller rebuilding a
|
|
209
|
+
// checkout) keep the id-derived name; a real start always passes the title.
|
|
210
|
+
const wanted = recordedBranch?.trim() || (title ? branchName(title, id) : worktreeBranch(id));
|
|
211
|
+
const branch = await availableBranch(root, wanted, id);
|
|
212
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
213
|
+
// The branch outlives the directory: a worktree removed by hand still leaves
|
|
214
|
+
// the branch behind, and the next start must continue it, not fail on it.
|
|
215
|
+
const hasBranch = await branchExists(root, branch);
|
|
216
|
+
await git(root, ["worktree", "add", path, ...(hasBranch ? [branch] : ["-b", branch, base])]);
|
|
217
|
+
return { path, branch, created: true };
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Drops the ticket's checkout and registration, leaving its branch alone. This
|
|
221
|
+
* is the half of retirement that `retireWorktree` builds on; a checkout that is
|
|
222
|
+
* already gone, or one git refuses to remove, is not worth failing a background
|
|
223
|
+
* pass over.
|
|
224
|
+
*/
|
|
225
|
+
export async function removeWorktree(root, ticketId) {
|
|
226
|
+
const id = safeId(ticketId);
|
|
227
|
+
const path = worktreePath(root, id);
|
|
228
|
+
if (!existsSync(join(path, ".git"))) {
|
|
229
|
+
// The directory went away by hand; `prune` clears the stale registration
|
|
230
|
+
// so `git worktree list` stops mentioning a checkout that is not there.
|
|
231
|
+
await git(root, ["worktree", "prune"]).catch(() => "");
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
await git(root, ["worktree", "remove", "--force", path]);
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** The branch a checkout is on, or null when there is no checkout to read. */
|
|
243
|
+
async function checkoutBranch(path) {
|
|
244
|
+
if (!existsSync(join(path, ".git")))
|
|
245
|
+
return null;
|
|
246
|
+
try {
|
|
247
|
+
return (await git(path, ["branch", "--show-current"])).trim() || null;
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/** The repository's default branch, from origin HEAD or the root checkout. */
|
|
254
|
+
async function defaultBranch(root) {
|
|
255
|
+
try {
|
|
256
|
+
const ref = (await git(root, ["symbolic-ref", "--short", "refs/remotes/origin/HEAD"])).trim();
|
|
257
|
+
const name = ref.replace(/^origin\//, "");
|
|
258
|
+
if (name)
|
|
259
|
+
return name;
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
// No origin HEAD; the root checkout is the next best evidence.
|
|
263
|
+
}
|
|
264
|
+
try {
|
|
265
|
+
return (await git(root, ["branch", "--show-current"])).trim() || null;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/** A ref the person's repository can be asked to delete without options. */
|
|
272
|
+
function usableBranch(branch) {
|
|
273
|
+
return /^[A-Za-z0-9._/-]+$/.test(branch) && !branch.startsWith("-");
|
|
274
|
+
}
|
|
275
|
+
/** Branch names this board must never delete, whatever a ticket records. */
|
|
276
|
+
const PROTECTED_BRANCHES = new Set(["HEAD", "main", "master"]);
|
|
277
|
+
function deletableBranch(branch, defaultName) {
|
|
278
|
+
return usableBranch(branch) && !PROTECTED_BRANCHES.has(branch) && branch !== defaultName;
|
|
279
|
+
}
|
|
280
|
+
/** A branch this ticket can own without a recorded branch. */
|
|
281
|
+
function belongsToTicket(branch, id) {
|
|
282
|
+
return branch === worktreeBranch(id) || branch.endsWith(`-${id}`);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Deletes the branch locally, ignoring a ref that is already gone. `-D` is
|
|
286
|
+
* deliberate: a closing ticket's work is often unmerged, and a branch that is
|
|
287
|
+
* kept because git calls it unmerged is the leftover this function exists to
|
|
288
|
+
* remove.
|
|
289
|
+
*/
|
|
290
|
+
async function deleteLocalBranch(root, branch) {
|
|
291
|
+
if (!usableBranch(branch))
|
|
292
|
+
return;
|
|
293
|
+
await git(root, ["branch", "-D", "--", branch]).catch(() => "");
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Deletes the branch on `origin`. A board with no origin, or one reached from a
|
|
297
|
+
* machine that is offline, is still a board: the local close already happened,
|
|
298
|
+
* so a remote that cannot answer is not an error the person has to clear.
|
|
299
|
+
*/
|
|
300
|
+
async function deleteRemoteBranch(root, branch) {
|
|
301
|
+
if (!usableBranch(branch))
|
|
302
|
+
return;
|
|
303
|
+
await exec("git", ["-C", root, "push", "--quiet", "origin", "--delete", branch], {
|
|
304
|
+
timeout: GIT_TIMEOUT_MS,
|
|
305
|
+
}).catch(() => undefined);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Retires everything a closing ticket owns: its checkout, its local branch and
|
|
309
|
+
* its branch on origin. This is the Done ending and the deleted-row ending —
|
|
310
|
+
* a merged pull request, a Review card dragged to Done, a person's delete, and
|
|
311
|
+
* the watcher dropping a row whose PR was closed.
|
|
312
|
+
*
|
|
313
|
+
* It is deliberately quiet. The card has already closed, so a worktree git will
|
|
314
|
+
* not remove, a missing origin or an unreachable one must not turn the close
|
|
315
|
+
* into an error for the person to clear. The local removal is synchronous; the
|
|
316
|
+
* origin delete is best-effort off the close path, so a hanging remote cannot
|
|
317
|
+
* hold the card on Done or block a delete.
|
|
318
|
+
*/
|
|
319
|
+
export async function retireWorktree(root, ticketId, recordedBranch) {
|
|
320
|
+
let id;
|
|
321
|
+
try {
|
|
322
|
+
id = safeId(ticketId);
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
const path = worktreePath(root, id);
|
|
328
|
+
const defaultName = await defaultBranch(root);
|
|
329
|
+
const recorded = recordedBranch?.trim();
|
|
330
|
+
let branch = null;
|
|
331
|
+
if (recorded) {
|
|
332
|
+
// The recorded branch is the ticket's identity. The checkout may have been
|
|
333
|
+
// moved by the agent, so its current branch is not evidence about ownership.
|
|
334
|
+
if (deletableBranch(recorded, defaultName))
|
|
335
|
+
branch = recorded;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
// Before the branch column existed, the ticket branch was id-derived. A
|
|
339
|
+
// checkout on anything else is not proof this ticket owns that branch.
|
|
340
|
+
const checkedOut = await checkoutBranch(path);
|
|
341
|
+
if (checkedOut && belongsToTicket(checkedOut, id) && deletableBranch(checkedOut, defaultName)) {
|
|
342
|
+
branch = checkedOut;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const removed = await removeWorktree(root, id).catch(() => false);
|
|
346
|
+
if (branch) {
|
|
347
|
+
await deleteLocalBranch(root, branch);
|
|
348
|
+
// The local claim is gone. Origin is best-effort and must not hold the
|
|
349
|
+
// card on Done, so the push is deliberately off the close path.
|
|
350
|
+
void deleteRemoteBranch(root, branch);
|
|
351
|
+
}
|
|
352
|
+
return removed;
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=worktree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workt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