@join-pantheon/cli 0.37.1 → 0.37.3
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/accounts.js +4 -0
- package/dist/cli.js +86 -6
- package/dist/client.js +11 -1
- package/dist/continued.js +34 -0
- package/dist/doctor.js +7 -0
- package/dist/email-templates.js +2 -2
- package/dist/email.js +2 -2
- package/dist/finish-line.js +11 -0
- package/dist/flag-signin.js +7 -3
- package/dist/forget-team.js +7 -3
- package/dist/git-safe.js +1 -1
- package/dist/machine.js +23 -33
- package/dist/mcp.js +2 -0
- package/dist/notice.js +21 -0
- package/dist/notifier.js +38 -1
- package/dist/onboard-copy.js +3 -2
- package/dist/recover-offer.js +16 -5
- package/dist/relay.js +9 -6
- package/dist/runs.js +337 -0
- package/dist/setup-guide.js +1 -1
- package/dist/worker.js +205 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/relay.js
CHANGED
|
@@ -438,6 +438,8 @@ const LOOP_WINDOW_MS = 60_000;
|
|
|
438
438
|
function loopMs(ns) {
|
|
439
439
|
return Math.max(0, Math.round((ns / 1e6 - LOOP_RESOLUTION_MS) * 100) / 100);
|
|
440
440
|
}
|
|
441
|
+
const LINK_CLOSED = "Different words were typed here, so this link is closed. That's all: the 6-digit code in the same email still works. Give it to your coding agent.";
|
|
442
|
+
const LINK_GONE = "This link has expired (they last 10 minutes), a newer Pantheon email replaced it, or it was already used. Use the code in the newest Pantheon email, or ask your coding agent to send a new one.";
|
|
441
443
|
const STORAGE_HELD = "the relay received this but has not saved it yet — its disk is refusing writes. It is kept, and reaches the team when the disk recovers; do not send it again.";
|
|
442
444
|
export function backupExcludes(dir, keep) {
|
|
443
445
|
const always = ["--exclude=*.tmp"];
|
|
@@ -1361,11 +1363,11 @@ export class Relay {
|
|
|
1361
1363
|
}
|
|
1362
1364
|
const why = r.reason;
|
|
1363
1365
|
if (why === "empty")
|
|
1364
|
-
return this.confirmPage(res, t, { said: "Type the two words your
|
|
1365
|
-
return this.confirmPage(res, "", { said: why === "wrong_words" ?
|
|
1366
|
+
return this.confirmPage(res, t, { said: "Type the two words in capitals that your coding agent (or terminal) showed you. Don't have them? Give your coding agent the 6-digit code from the email instead." });
|
|
1367
|
+
return this.confirmPage(res, "", { said: why === "wrong_words" ? LINK_CLOSED
|
|
1366
1368
|
: why === "links_locked" ? "Too many wrong words for this address in the last hour, so links are off for now. Use the 6-digit code from the email."
|
|
1367
1369
|
: why === "device_other_account" ? DEVICE_OTHER_ACCOUNT
|
|
1368
|
-
:
|
|
1370
|
+
: LINK_GONE });
|
|
1369
1371
|
});
|
|
1370
1372
|
}
|
|
1371
1373
|
if (url.pathname === "/auth/status" && req.method === "GET") {
|
|
@@ -1655,10 +1657,11 @@ export class Relay {
|
|
|
1655
1657
|
<p>Only go on if you started this yourself, just now, on your own computer or through your own coding agent.</p>
|
|
1656
1658
|
${o.said ? `<p class="said">${esc(o.said)}</p>` : ""}
|
|
1657
1659
|
<form method="post" action="/auth/confirm"><input type="hidden" name="t" value="${esc(token)}">
|
|
1658
|
-
<label for="w">The two words
|
|
1660
|
+
<label for="w">The two words in capitals your coding agent (or terminal) showed you</label>
|
|
1659
1661
|
<input id="w" name="words" autocomplete="off" autocapitalize="off" spellcheck="false" placeholder="two words">
|
|
1660
|
-
<button type="submit">Confirm</button></form
|
|
1661
|
-
|
|
1662
|
+
<button type="submit">Confirm</button></form>
|
|
1663
|
+
<p>Don't have the two words? Close this page and give your coding agent the 6-digit code from the same email. It works just as well.</p>`
|
|
1664
|
+
: `<h1>This link does not work.</h1><p>${esc(o.said ?? (token && A.linkGone(token) === "closed" ? LINK_CLOSED : LINK_GONE))}</p>`;
|
|
1662
1665
|
const html = `<!doctype html><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=no-referrer><title>Pantheon sign-in</title>
|
|
1663
1666
|
<style>body{font:16px/1.6 "Space Mono",Menlo,Consolas,monospace;background:#ece0c8;color:#1b1917;max-width:34rem;margin:10vh auto;padding:0 16px}h1{font:400 28px/1.15 "Archivo Black","Arial Black",Arial,sans-serif}label{display:block;margin:18px 0 6px}input{font:inherit;width:100%;box-sizing:border-box;padding:10px;border:2px solid #1b1917;border-radius:8px;background:#f1e7d3}button{margin-top:12px;font:inherit;font-weight:700;background:#e36f55;color:#1b1917;border:0;border-radius:8px;padding:10px 18px}.said{background:#f1e7d3;border-left:4px solid #b8492f;padding:8px 12px}</style>
|
|
1664
1667
|
${body}`;
|
package/dist/runs.js
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
4
|
+
import { adoptWorktree, adoptedCommon, checkWorktree, gitCallEnv } from "./git-safe.js";
|
|
5
|
+
export function indexFile(home) { return join(home, "worktrees", "index.json"); }
|
|
6
|
+
export function readIndex(home) {
|
|
7
|
+
try {
|
|
8
|
+
const j = JSON.parse(readFileSync(indexFile(home), "utf8"));
|
|
9
|
+
if (!j || typeof j !== "object" || Array.isArray(j))
|
|
10
|
+
return {};
|
|
11
|
+
const out = {};
|
|
12
|
+
for (const [k, v] of Object.entries(j)) {
|
|
13
|
+
const e = v;
|
|
14
|
+
if (e && typeof e.worktree === "string" && typeof e.repo === "string" && typeof e.branch === "string" && typeof e.request === "string")
|
|
15
|
+
out[k] = e;
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function updateIndex(home, change) {
|
|
24
|
+
try {
|
|
25
|
+
const ix = readIndex(home);
|
|
26
|
+
change(ix);
|
|
27
|
+
const f = indexFile(home);
|
|
28
|
+
mkdirSync(dirname(f), { recursive: true });
|
|
29
|
+
const tmp = `${f}.${process.pid}.tmp`;
|
|
30
|
+
writeFileSync(tmp, JSON.stringify(ix, null, 1) + "\n", { mode: 0o600 });
|
|
31
|
+
renameSync(tmp, f);
|
|
32
|
+
}
|
|
33
|
+
catch { }
|
|
34
|
+
}
|
|
35
|
+
const key = (p) => real(p);
|
|
36
|
+
function real(p) {
|
|
37
|
+
try {
|
|
38
|
+
return realpathSync(p);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
const abs = resolve(p), parent = dirname(abs);
|
|
42
|
+
return parent === abs ? abs : join(real(parent), basename(abs));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function recordRunStart(home, e, worker, now = Date.now()) {
|
|
46
|
+
updateIndex(home, (ix) => {
|
|
47
|
+
const k = key(e.worktree);
|
|
48
|
+
const had = ix[k];
|
|
49
|
+
const same = !!had && had.branch === e.branch;
|
|
50
|
+
ix[k] = { ...(same ? { base_ref: had.base_ref, base_sha: had.base_sha, asker: had.asker } : {}), ...e, worktree: k, created: same ? had.created : now, last_run: now, active: { worker: worker.pid, ...(worker.id ? { worker_id: worker.id } : {}), since: now } };
|
|
51
|
+
for (const f of ["base_ref", "base_sha", "asker"])
|
|
52
|
+
if (ix[k][f] === undefined)
|
|
53
|
+
delete ix[k][f];
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function recordRunEnd(home, worktree) {
|
|
57
|
+
updateIndex(home, (ix) => {
|
|
58
|
+
const k = key(worktree);
|
|
59
|
+
const e = ix[k];
|
|
60
|
+
if (!e)
|
|
61
|
+
return;
|
|
62
|
+
if (!existsSync(worktree)) {
|
|
63
|
+
delete ix[k];
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
delete e.active;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
const NO_HOOKS = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
70
|
+
export const realGit = (cwd, args) => {
|
|
71
|
+
checkWorktree(cwd);
|
|
72
|
+
return execFileSync("git", ["-c", "core.fsmonitor=false", "-c", "protocol.file.allow=user", "-c", `core.hooksPath=${NO_HOOKS}`, ...args], {
|
|
73
|
+
cwd, encoding: "utf8", windowsHide: true, stdio: ["ignore", "pipe", "pipe"], env: gitCallEnv(args, process.env), timeout: 60_000, killSignal: "SIGKILL", maxBuffer: 1 << 28,
|
|
74
|
+
}).trim();
|
|
75
|
+
};
|
|
76
|
+
export function listRuns(repos, roots, home, git = realGit) {
|
|
77
|
+
const ix = readIndex(home);
|
|
78
|
+
const rootsReal = roots.map(real);
|
|
79
|
+
const under = (p) => { const pp = real(p); return rootsReal.some((r) => pp === r || pp.startsWith(r + sep) || pp.startsWith(r + "/")); };
|
|
80
|
+
const out = [];
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
for (const repo of [...new Set(repos.map((r) => real(r)))]) {
|
|
83
|
+
if (seen.has(repo))
|
|
84
|
+
continue;
|
|
85
|
+
seen.add(repo);
|
|
86
|
+
let list;
|
|
87
|
+
try {
|
|
88
|
+
list = git(repo, ["worktree", "list", "--porcelain"]);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const checkedOut = new Set();
|
|
94
|
+
for (const block of list.split(/\n\s*\n/)) {
|
|
95
|
+
const wt = /^worktree (.+)$/m.exec(block)?.[1]?.trim();
|
|
96
|
+
const br = /^branch refs\/heads\/(.+)$/m.exec(block)?.[1]?.trim() ?? null;
|
|
97
|
+
if (br)
|
|
98
|
+
checkedOut.add(br);
|
|
99
|
+
if (!wt || !under(wt))
|
|
100
|
+
continue;
|
|
101
|
+
out.push({ repo, worktree: wt, branch: br, ...(ix[key(wt)] ? { entry: ix[key(wt)] } : {}) });
|
|
102
|
+
}
|
|
103
|
+
let branches = [];
|
|
104
|
+
try {
|
|
105
|
+
branches = git(repo, ["for-each-ref", "--format=%(refname:short)", "refs/heads/pantheon/"]).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
106
|
+
}
|
|
107
|
+
catch { }
|
|
108
|
+
for (const b of branches) {
|
|
109
|
+
if (checkedOut.has(b))
|
|
110
|
+
continue;
|
|
111
|
+
const entry = Object.values(ix).find((e) => e.branch === b && real(e.repo) === repo);
|
|
112
|
+
out.push({ repo, worktree: "", branch: b, ...(entry ? { entry } : {}) });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
const STATUS_ARGS = ["-c", "diff.ignoreSubmodules=all", "--no-optional-locks", "status", "--porcelain", "--ignore-submodules=all"];
|
|
118
|
+
export function runRecordAlive(home) {
|
|
119
|
+
try {
|
|
120
|
+
const r = JSON.parse(readFileSync(join(home, "worker-run.json"), "utf8"));
|
|
121
|
+
if (typeof r.pid !== "number" || !Number.isInteger(r.pid) || r.pid <= 1)
|
|
122
|
+
return false;
|
|
123
|
+
try {
|
|
124
|
+
process.kill(process.platform === "win32" ? r.pid : -r.pid, 0);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function ownConfig(worktree) {
|
|
136
|
+
try {
|
|
137
|
+
const m = /^gitdir:\s*(.+?)\s*$/m.exec(readFileSync(join(worktree, ".git"), "utf8"));
|
|
138
|
+
if (!m)
|
|
139
|
+
return false;
|
|
140
|
+
const body = readFileSync(join(resolve(worktree, m[1]), "config.worktree"), "utf8");
|
|
141
|
+
return !/^?[ \t\r\n]*$/.test(body);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export function stateOf(t, o) {
|
|
148
|
+
const git = o.git ?? realGit;
|
|
149
|
+
const s = { active: false, missing: false, unsafe: null, dirty: 0, unpushed: null, merged: false, keep: null };
|
|
150
|
+
const a = t.entry?.active;
|
|
151
|
+
s.active = !!a && o.alive(a.worker, a.worker_id);
|
|
152
|
+
if (t.worktree) {
|
|
153
|
+
let st;
|
|
154
|
+
try {
|
|
155
|
+
st = lstatSync(t.worktree);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
st = null;
|
|
159
|
+
}
|
|
160
|
+
if (!st)
|
|
161
|
+
s.missing = true;
|
|
162
|
+
else {
|
|
163
|
+
let why = null;
|
|
164
|
+
if (adoptedCommon(t.worktree)) {
|
|
165
|
+
try {
|
|
166
|
+
checkWorktree(t.worktree);
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
why = e.message;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else
|
|
173
|
+
why = adoptWorktree(t.repo, t.worktree)?.why ?? null;
|
|
174
|
+
if (why)
|
|
175
|
+
s.unsafe = why;
|
|
176
|
+
else if (ownConfig(t.worktree))
|
|
177
|
+
s.unsafe = "it has git settings of its own (config.worktree)";
|
|
178
|
+
else if (!s.active) {
|
|
179
|
+
try {
|
|
180
|
+
if (/^160000 /m.test(git(t.worktree, ["ls-files", "--stage"])))
|
|
181
|
+
s.unsafe = "it holds a submodule (a repo inside it)";
|
|
182
|
+
else
|
|
183
|
+
s.dirty = git(t.worktree, STATUS_ARGS).split("\n").filter(Boolean).length;
|
|
184
|
+
}
|
|
185
|
+
catch (e) {
|
|
186
|
+
s.unsafe = `git could not read it (${e.message.split("\n")[0]})`;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (t.branch) {
|
|
192
|
+
const ref = `refs/heads/${t.branch}`;
|
|
193
|
+
try {
|
|
194
|
+
s.unpushed = Number(git(t.repo, ["rev-list", "--count", ref, "--not", "--exclude=pantheon/*", "--branches", "--remotes"])) || 0;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
s.unpushed = null;
|
|
198
|
+
}
|
|
199
|
+
const recorded = t.entry?.base_ref && /^[A-Za-z0-9_][A-Za-z0-9._\/-]*$/.test(t.entry.base_ref) && !t.entry.base_ref.includes("..") ? t.entry.base_ref : null;
|
|
200
|
+
const base = recorded ?? (() => { try {
|
|
201
|
+
return git(t.repo, ["symbolic-ref", "--quiet", "--short", "refs/remotes/origin/HEAD"]);
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return "";
|
|
205
|
+
} })();
|
|
206
|
+
try {
|
|
207
|
+
s.merged = Number(git(t.repo, ["rev-list", "--count", ref, "--not", "--exclude=pantheon/*", "--branches", ...(base ? [base] : [])])) === 0;
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
s.merged = false;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
s.keep = s.active ? "a run is working in it"
|
|
214
|
+
: o.runInFlight ? "a run is in progress on this computer; try again when it ends"
|
|
215
|
+
: s.unsafe ? `it could not be checked safely: ${s.unsafe}`
|
|
216
|
+
: s.dirty ? `${s.dirty} file${s.dirty === 1 ? "" : "s"} changed and not committed`
|
|
217
|
+
: null;
|
|
218
|
+
return s;
|
|
219
|
+
}
|
|
220
|
+
function branchKeep(t, s, dropPushed) {
|
|
221
|
+
if (!t.branch || !t.branch.startsWith("pantheon/"))
|
|
222
|
+
return "not a branch Pantheon made";
|
|
223
|
+
if (s.merged)
|
|
224
|
+
return null;
|
|
225
|
+
if (s.unpushed === null)
|
|
226
|
+
return "its commits could not be counted";
|
|
227
|
+
if (s.unpushed > 0)
|
|
228
|
+
return `${s.unpushed} commit${s.unpushed === 1 ? "" : "s"} found nowhere else (not pushed, not in your branches)`;
|
|
229
|
+
return dropPushed ? null : "pushed, not merged yet";
|
|
230
|
+
}
|
|
231
|
+
export function cleanRuns(trees, o) {
|
|
232
|
+
const record = o.record !== false;
|
|
233
|
+
const git = o.git ?? realGit;
|
|
234
|
+
const res = { removed: [], kept: [] };
|
|
235
|
+
for (const t of trees) {
|
|
236
|
+
const what = describeTree(t);
|
|
237
|
+
const s = stateOf(t, { git, alive: o.alive, ...(o.runInFlight !== undefined ? { runInFlight: o.runInFlight } : {}) });
|
|
238
|
+
if (s.keep) {
|
|
239
|
+
res.kept.push({ tree: t, why: s.keep, line: `${what} — kept: ${s.keep}` });
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const now = t.worktree ? readIndex(o.home)[key(t.worktree)]?.active : undefined;
|
|
243
|
+
if (now && o.alive(now.worker, now.worker_id)) {
|
|
244
|
+
res.kept.push({ tree: t, why: "a run is working in it", line: `${what} — kept: a run is working in it` });
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
let treeGone = false;
|
|
248
|
+
if (t.worktree) {
|
|
249
|
+
if (s.missing) {
|
|
250
|
+
try {
|
|
251
|
+
git(t.repo, ["worktree", "prune"]);
|
|
252
|
+
}
|
|
253
|
+
catch { }
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
if (record)
|
|
257
|
+
keepLog(o.home, t);
|
|
258
|
+
try {
|
|
259
|
+
git(t.repo, ["worktree", "remove", "--", t.worktree]);
|
|
260
|
+
}
|
|
261
|
+
catch (e) {
|
|
262
|
+
const why = `git would not remove it (${e.message.split("\n").find((l) => /fatal|error/.test(l)) ?? "it refused"})`;
|
|
263
|
+
res.kept.push({ tree: t, why, line: `${what} — kept: ${why}` });
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
treeGone = true;
|
|
268
|
+
if (record)
|
|
269
|
+
updateIndex(o.home, (ix) => { delete ix[key(t.worktree)]; });
|
|
270
|
+
}
|
|
271
|
+
const bkeep = branchKeep(t, s, !!o.dropPushed);
|
|
272
|
+
let branchGone = false;
|
|
273
|
+
if (!bkeep) {
|
|
274
|
+
try {
|
|
275
|
+
git(t.repo, ["branch", "-D", "--", t.branch]);
|
|
276
|
+
branchGone = true;
|
|
277
|
+
}
|
|
278
|
+
catch { }
|
|
279
|
+
}
|
|
280
|
+
if (!treeGone && !branchGone) {
|
|
281
|
+
res.kept.push({ tree: t, why: bkeep ?? "git would not delete it", line: `${what} — kept: ${bkeep ?? "git would not delete it"}` });
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (record && branchGone && !t.worktree && t.entry)
|
|
285
|
+
updateIndex(o.home, (ix) => { delete ix[key(t.entry.worktree)]; });
|
|
286
|
+
res.removed.push({ tree: t, line: `${what} — ${[treeGone ? "checkout removed" : null, branchGone ? "branch deleted on this computer" : t.branch ? `branch kept (${bkeep})` : null].filter(Boolean).join("; ")}` });
|
|
287
|
+
}
|
|
288
|
+
return res;
|
|
289
|
+
}
|
|
290
|
+
function keepLog(home, t) {
|
|
291
|
+
try {
|
|
292
|
+
const f = join(t.worktree, ".pantheon-run.log");
|
|
293
|
+
const st = lstatSync(f);
|
|
294
|
+
if (!st.isFile())
|
|
295
|
+
return;
|
|
296
|
+
const dir = join(home, "worktrees", "logs");
|
|
297
|
+
mkdirSync(dir, { recursive: true });
|
|
298
|
+
copyFileSync(f, join(dir, `${(t.branch ?? basename(t.worktree)).replace(/[^A-Za-z0-9._-]+/g, "_")}.log`));
|
|
299
|
+
}
|
|
300
|
+
catch { }
|
|
301
|
+
}
|
|
302
|
+
export function describeTree(t) {
|
|
303
|
+
const e = t.entry;
|
|
304
|
+
const name = t.branch ?? basename(t.worktree);
|
|
305
|
+
if (!e)
|
|
306
|
+
return `${name} (${t.worktree ? "a checkout" : "a branch"} from before 0.37.2: request unknown)`;
|
|
307
|
+
const parts = [e.goal_title ? `"${e.goal_title}"` : e.goal ? `goal ${e.goal}` : null, e.asker ? `asked by ${e.asker}` : null].filter(Boolean);
|
|
308
|
+
return `${name}${parts.length ? ` (${parts.join(", ")})` : ""}`;
|
|
309
|
+
}
|
|
310
|
+
export function runLines(trees, o) {
|
|
311
|
+
const now = o.now ?? Date.now();
|
|
312
|
+
const lines = [];
|
|
313
|
+
for (const t of trees) {
|
|
314
|
+
const s = stateOf(t, o);
|
|
315
|
+
const e = t.entry;
|
|
316
|
+
const commits = !t.branch ? null
|
|
317
|
+
: s.unpushed === null ? "commits not counted"
|
|
318
|
+
: s.merged ? "nothing unmerged"
|
|
319
|
+
: s.unpushed ? `${s.unpushed} commit${s.unpushed === 1 ? "" : "s"} not pushed`
|
|
320
|
+
: "pushed, not merged";
|
|
321
|
+
const state = s.active ? "a run is working in it"
|
|
322
|
+
: s.unsafe ? `could not be checked: ${s.unsafe}`
|
|
323
|
+
: [t.worktree ? (s.missing ? "folder gone" : s.dirty ? `${s.dirty} uncommitted change${s.dirty === 1 ? "" : "s"}` : "no uncommitted changes") : "no checkout", commits].filter(Boolean).join(", ");
|
|
324
|
+
lines.push(describeTree(t));
|
|
325
|
+
lines.push(` ${t.worktree || t.repo}${e?.request ? ` request ${e.request}` : ""}${e ? ` last run ${ago(now - e.last_run)}` : ""}`);
|
|
326
|
+
lines.push(` ${state}`);
|
|
327
|
+
}
|
|
328
|
+
return lines;
|
|
329
|
+
}
|
|
330
|
+
function ago(ms) {
|
|
331
|
+
const m = Math.round(ms / 60_000);
|
|
332
|
+
if (m < 60)
|
|
333
|
+
return `${Math.max(0, m)} min ago`;
|
|
334
|
+
const h = Math.round(m / 60);
|
|
335
|
+
return h < 48 ? `${h} h ago` : `${Math.round(h / 24)} days ago`;
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=runs.js.map
|
package/dist/setup-guide.js
CHANGED
|
@@ -33,7 +33,7 @@ export const MODE_OPTIONS = [
|
|
|
33
33
|
{ id: "here", label: `${MODE_LABELS.here} — requests wait while I'm at my computer, and my agent takes them when I'm away.` },
|
|
34
34
|
];
|
|
35
35
|
export const ALERT_OPTIONS = [
|
|
36
|
-
{ id: "decisions", label: "
|
|
36
|
+
{ id: "decisions", label: "Decisions that need me, and a teammate's request nothing here has picked up (recommended) — never for ordinary agent traffic." },
|
|
37
37
|
{ id: "deliveries", label: "Decisions, and when a teammate delivers work to me." },
|
|
38
38
|
{ id: "worker", label: "Decisions, deliveries, and when my own worker finishes a run." },
|
|
39
39
|
{ id: "none", label: "None — I will look at pantheon status (and the menu bar, on a Mac)." },
|