@join-pantheon/cli 0.35.0 → 0.35.1-rc.2
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/agent-outage.js +165 -35
- package/dist/agent-token.js +5 -3
- package/dist/agents.js +6 -4
- package/dist/approvals-list.js +87 -0
- package/dist/board.js +491 -88
- package/dist/brief.js +17 -0
- package/dist/cli.js +687 -95
- package/dist/client.js +159 -19
- package/dist/config.js +3 -2
- package/dist/continued.js +56 -1
- package/dist/decision-ui.js +5 -3
- package/dist/doctor.js +84 -16
- package/dist/file-lock.js +40 -5
- package/dist/flow-stats.js +18 -1
- package/dist/home-guard.js +336 -54
- package/dist/home-safety.js +2 -0
- package/dist/hud-queue.js +91 -0
- package/dist/install.js +15 -1
- package/dist/mcp-instructions.js +67 -28
- package/dist/mcp.js +129 -24
- package/dist/notice-linux.js +15 -4
- package/dist/notice-windows.js +2 -2
- package/dist/notifier.js +2 -1
- package/dist/notify.js +28 -9
- package/dist/open-in.js +4 -3
- package/dist/pickup.js +17 -0
- package/dist/plain.js +139 -3
- package/dist/profile.js +12 -8
- package/dist/protocol.js +1 -1
- package/dist/question-goal.js +74 -0
- package/dist/readiness-alert.js +24 -3
- package/dist/refusal.js +2 -2
- package/dist/relay.js +143 -28
- package/dist/removed.js +4 -4
- package/dist/run-control.js +4 -3
- package/dist/run-failure.js +67 -10
- package/dist/setup-changes.js +7 -6
- package/dist/signed-out.js +144 -21
- package/dist/spend.js +5 -4
- package/dist/tray.js +24 -6
- package/dist/update-check.js +2 -1
- package/dist/uri-handler.js +10 -2
- package/dist/which.js +2 -0
- package/dist/worker-policy.js +212 -10
- package/dist/worker.js +942 -133
- package/dist/worklist.js +31 -1
- package/helper/macos/main.swift +42 -3
- package/helper/macos/menubar.swift +482 -87
- package/helper/macos/prebuilt/manifest.json +5 -5
- package/helper/macos/prebuilt/pantheon-hud +0 -0
- package/helper/macos/prebuilt/pantheon-tray +0 -0
- package/package.json +1 -1
package/dist/file-lock.js
CHANGED
|
@@ -99,6 +99,18 @@ function takeOver(lock, seen) {
|
|
|
99
99
|
catch { }
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
export function readStateText(p) {
|
|
103
|
+
const t = readStateFile(p);
|
|
104
|
+
if (t === null)
|
|
105
|
+
throw Object.assign(new Error(`${p}: no such file`), { code: "ENOENT" });
|
|
106
|
+
return t;
|
|
107
|
+
}
|
|
108
|
+
export function readStateBytes(p) {
|
|
109
|
+
const st = statSync(p);
|
|
110
|
+
if (!st.isFile())
|
|
111
|
+
throw new Error(`${p} is not a plain file`);
|
|
112
|
+
return readFileSync(p);
|
|
113
|
+
}
|
|
102
114
|
export function readStateFile(p) {
|
|
103
115
|
let st;
|
|
104
116
|
try {
|
|
@@ -109,9 +121,9 @@ export function readStateFile(p) {
|
|
|
109
121
|
}
|
|
110
122
|
if (!st.isFile())
|
|
111
123
|
throw new Error(`${p} is not a plain file`);
|
|
112
|
-
return readFileSync(p, "utf8");
|
|
124
|
+
return readFileSync(p, "utf8").replace(/^\uFEFF/, "");
|
|
113
125
|
}
|
|
114
|
-
export function brokenStateFiles(dir) {
|
|
126
|
+
export function brokenStateFiles(dir, guarded = []) {
|
|
115
127
|
const out = [];
|
|
116
128
|
if (existsSync(dir)) {
|
|
117
129
|
const probe = join(dir, `.write-check.${randomBytes(4).toString("hex")}`);
|
|
@@ -123,7 +135,8 @@ export function brokenStateFiles(dir) {
|
|
|
123
135
|
out.push("(the folder)");
|
|
124
136
|
}
|
|
125
137
|
}
|
|
126
|
-
|
|
138
|
+
const strict = ["nonces.json", "continued.json", "keys.json", "run-slot.json", "spend.json", "worker-policy.json"];
|
|
139
|
+
for (const f of strict) {
|
|
127
140
|
const p = join(dir, f);
|
|
128
141
|
try {
|
|
129
142
|
const text = readStateFile(p);
|
|
@@ -136,6 +149,21 @@ export function brokenStateFiles(dir) {
|
|
|
136
149
|
out.push(f);
|
|
137
150
|
}
|
|
138
151
|
}
|
|
152
|
+
for (const f of guarded) {
|
|
153
|
+
if (strict.includes(f))
|
|
154
|
+
continue;
|
|
155
|
+
const p = join(dir, f);
|
|
156
|
+
try {
|
|
157
|
+
const text = readStateFile(p);
|
|
158
|
+
if (text === null)
|
|
159
|
+
continue;
|
|
160
|
+
if (f.endsWith(".json") && text.trim())
|
|
161
|
+
JSON.parse(text);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
out.push(f);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
139
167
|
return out;
|
|
140
168
|
}
|
|
141
169
|
export function brokenStateFix(broken) {
|
|
@@ -143,8 +171,15 @@ export function brokenStateFix(broken) {
|
|
|
143
171
|
const parts = [];
|
|
144
172
|
if (broken.includes("(the folder)"))
|
|
145
173
|
parts.push("make the Pantheon folder writable again (its permissions) — do not delete it: it holds your key and memberships");
|
|
146
|
-
|
|
147
|
-
|
|
174
|
+
const PRECIOUS = new Set(["worker-policy.json", "config.json", "keys.json", "profile.json"]);
|
|
175
|
+
const keep = files.filter((f) => PRECIOUS.has(f)), other = files.filter((f) => !PRECIOUS.has(f));
|
|
176
|
+
if (keep.length)
|
|
177
|
+
parts.push(`make ${keep.join(", ")} writable again (its permissions, a lock or a flag on it — e.g. chflags nouchg,nouappnd on a Mac) — do not delete ${keep.length === 1 ? "it" : "them"}: ${keep.length === 1 ? "it holds" : "they hold"} your settings${keep.includes("worker-policy.json") ? ` (worker-policy.json torn or not JSON, rather than locked: pantheon policy repair)` : ""}`);
|
|
178
|
+
if (other.length)
|
|
179
|
+
parts.push(`repair or delete ${other.join(", ")} (one made read-only or locked: make it writable again; one that is a folder or not a file: delete it)`);
|
|
180
|
+
const folders = [...new Set(files.filter((f) => f.includes("/")).map((f) => f.slice(0, f.lastIndexOf("/"))))];
|
|
181
|
+
if (folders.length)
|
|
182
|
+
parts.push(`and the folder${folders.length === 1 ? "" : "s"} ${folders.join(", ")} in the Pantheon folder (on a Mac: chflags nouchg,nouappnd on ${folders.length === 1 ? "it" : "them"})`);
|
|
148
183
|
return parts.join("; ");
|
|
149
184
|
}
|
|
150
185
|
export function withFileLock(f, fn, waitMs = WAIT_MS) {
|
package/dist/flow-stats.js
CHANGED
|
@@ -416,6 +416,21 @@ export function dur(ms) {
|
|
|
416
416
|
return hh ? `${d}d ${hh}h` : `${d}d`;
|
|
417
417
|
}
|
|
418
418
|
export const REFUSAL_WORDS = {
|
|
419
|
+
ALREADY_JOINED: "a connection that said hello twice",
|
|
420
|
+
BAD_DELEGATE: "a run whose permission from its person did not check",
|
|
421
|
+
BAD_INVITE: "an invite that could not be used",
|
|
422
|
+
BAD_NAME: "a team name that is not allowed",
|
|
423
|
+
BAD_NONCE: "a connection that answered the wrong challenge",
|
|
424
|
+
BAD_SIGNATURE: "a connection whose signature did not check",
|
|
425
|
+
BAD_TOKEN: "the wrong team token",
|
|
426
|
+
KEY_MISMATCH: "a name already held with another key",
|
|
427
|
+
NAME_TAKEN: "a team name too close to one that exists",
|
|
428
|
+
NO_CREDENTIAL: "a connection with no invite and no team token",
|
|
429
|
+
NO_SUCH_SPACE: "a team that does not exist here",
|
|
430
|
+
NOT_JOINED: "a request before the connection said hello",
|
|
431
|
+
PENDING_FULL: "too many people waiting to be admitted",
|
|
432
|
+
RESERVED_NAME: "a name the relay keeps for itself",
|
|
433
|
+
SESSION_REVOKED: "a device signed out from elsewhere",
|
|
419
434
|
ALREADY_RETRACTED: "a retract of an act already withdrawn",
|
|
420
435
|
AMBIGUOUS_DECISION_AUTHORITY: "a decision two people claim the say over",
|
|
421
436
|
BAD_ACT_ID: "an act with a malformed id",
|
|
@@ -497,7 +512,9 @@ export const REFUSAL_WORDS = {
|
|
|
497
512
|
UNBOUND_SPACE: "an invite to an old team that has no team token yet",
|
|
498
513
|
UNVERIFIABLE_DELIVERY: "a delivery that named no branch and commit",
|
|
499
514
|
UPGRADE_REQUIRED: "a client too old for this team",
|
|
500
|
-
|
|
515
|
+
WITHDRAWN: "an answer to a decision already withdrawn",
|
|
516
|
+
ALREADY_ANSWERED: "a second answer to a decision its person had already answered",
|
|
517
|
+
WOULD_ORPHAN: "a goal standing down for one that is closed, or itself standing down",
|
|
501
518
|
WRONG_DECISION_OWNER: "a decision sent to the wrong person",
|
|
502
519
|
};
|
|
503
520
|
export const refusalWords = (code) => REFUSAL_WORDS[code] ?? code.toLowerCase().replace(/_/g, " ");
|