@agent-deck/cli 1.11.9 → 2.1.0
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-harness.d.ts +9 -2
- package/dist/agent-harness.d.ts.map +1 -1
- package/dist/agent-harness.js +90 -23
- package/dist/agent-harness.js.map +1 -1
- package/dist/codex-plugin.d.ts +27 -0
- package/dist/codex-plugin.d.ts.map +1 -1
- package/dist/codex-plugin.js +111 -6
- package/dist/codex-plugin.js.map +1 -1
- package/dist/daemon-logs.d.ts +1 -1
- package/dist/daemon-logs.d.ts.map +1 -1
- package/dist/daemon-logs.js +49 -1
- package/dist/daemon-logs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp-bridge.d.ts +83 -1
- package/dist/mcp-bridge.d.ts.map +1 -1
- package/dist/mcp-bridge.js +252 -7
- package/dist/mcp-bridge.js.map +1 -1
- package/dist/mcp-config.d.ts +13 -1
- package/dist/mcp-config.d.ts.map +1 -1
- package/dist/mcp-config.js +49 -1
- package/dist/mcp-config.js.map +1 -1
- package/dist/muse-skills/agent-deck-playbooks/SKILL.md +24 -0
- package/dist/muse-skills/agent-deck-run/SKILL.md +69 -0
- package/dist/muse-skills/agent-deck-session/SKILL.md +59 -0
- package/dist/muse-skills/agent-deck-setup/SKILL.md +28 -0
- package/dist/muse-skills.d.ts +42 -0
- package/dist/muse-skills.d.ts.map +1 -0
- package/dist/muse-skills.js +149 -0
- package/dist/muse-skills.js.map +1 -0
- package/dist/run-adapter.d.ts +100 -0
- package/dist/run-adapter.d.ts.map +1 -0
- package/dist/run-adapter.js +73 -0
- package/dist/run-adapter.js.map +1 -0
- package/dist/run-claude.d.ts +41 -0
- package/dist/run-claude.d.ts.map +1 -0
- package/dist/run-claude.js +91 -0
- package/dist/run-claude.js.map +1 -0
- package/dist/run-codex.d.ts +75 -0
- package/dist/run-codex.d.ts.map +1 -0
- package/dist/run-codex.js +337 -0
- package/dist/run-codex.js.map +1 -0
- package/dist/run-cursor.d.ts +79 -0
- package/dist/run-cursor.d.ts.map +1 -0
- package/dist/run-cursor.js +455 -0
- package/dist/run-cursor.js.map +1 -0
- package/dist/run-detach.d.ts +36 -0
- package/dist/run-detach.d.ts.map +1 -0
- package/dist/run-detach.js +233 -0
- package/dist/run-detach.js.map +1 -0
- package/dist/run-muse.d.ts +127 -0
- package/dist/run-muse.d.ts.map +1 -0
- package/dist/run-muse.js +499 -0
- package/dist/run-muse.js.map +1 -0
- package/dist/run-status.d.ts +62 -0
- package/dist/run-status.d.ts.map +1 -0
- package/dist/run-status.js +552 -0
- package/dist/run-status.js.map +1 -0
- package/dist/run.d.ts +191 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +680 -0
- package/dist/run.js.map +1 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +51 -10
- package/dist/setup.js.map +1 -1
- package/dist/terminal-style.d.ts +9 -0
- package/dist/terminal-style.d.ts.map +1 -0
- package/dist/terminal-style.js +34 -0
- package/dist/terminal-style.js.map +1 -0
- package/dist/use.d.ts +1 -1
- package/dist/use.d.ts.map +1 -1
- package/dist/use.js +16 -15
- package/dist/use.js.map +1 -1
- package/package.json +5 -4
package/dist/agent-harness.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare const HARNESS_RULE_DESCRIPTION = "Use when user mentions decks, p
|
|
|
8
8
|
export declare function buildClaudeHarnessBlock(scope: SetupScope): string;
|
|
9
9
|
/** Codex uses the same protocol guidance, merged into AGENTS.md. */
|
|
10
10
|
export declare function buildCodexHarnessBlock(scope: SetupScope): string;
|
|
11
|
+
/** Muse project scope merges the same full harness into root AGENTS.md. */
|
|
12
|
+
export declare function buildMuseHarnessBlock(scope: SetupScope): string;
|
|
11
13
|
export declare function buildCursorHarnessInner(scope: SetupScope): string;
|
|
12
14
|
/** Merge only the agent-deck section; never replace other Cursor rules or skills. */
|
|
13
15
|
export declare function mergeCursorHarnessFile(existing: string, harnessInner: string, description?: string): {
|
|
@@ -25,6 +27,7 @@ export type HarnessInstallResult = {
|
|
|
25
27
|
path?: string;
|
|
26
28
|
action?: 'created' | 'updated' | 'unchanged';
|
|
27
29
|
message: string;
|
|
30
|
+
error?: string;
|
|
28
31
|
};
|
|
29
32
|
export declare function installAgentHarness(client: HarnessClient, scope: SetupScope): HarnessInstallResult;
|
|
30
33
|
export type HarnessDiagnosisStatus = 'current' | 'missing' | 'stale';
|
|
@@ -42,6 +45,10 @@ export interface HarnessDiagnosis {
|
|
|
42
45
|
export declare function diagnoseHarness(client: HarnessClient, scope: SetupScope): HarnessDiagnosis;
|
|
43
46
|
/** Read-only freshness check for every supported harness client. */
|
|
44
47
|
export declare function diagnoseAllHarnesses(scope?: SetupScope): HarnessDiagnosis[];
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
export interface HarnessFormatOptions {
|
|
49
|
+
color?: boolean;
|
|
50
|
+
homeDir?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Compact, human-readable recovery summary with visually distinct commands. */
|
|
53
|
+
export declare function formatHarnessDiagnosis(diagnoses: HarnessDiagnosis[], options?: HarnessFormatOptions): string[];
|
|
47
54
|
//# sourceMappingURL=agent-harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-harness.d.ts","sourceRoot":"","sources":["../src/agent-harness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-harness.d.ts","sourceRoot":"","sources":["../src/agent-harness.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQ1D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhD,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,eAAO,MA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U,GAAG,oBAAoB,CA6ElG;AAED,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB;AAwBD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,gBAAgB,CAuB1F;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,UAAqB,GAAG,gBAAgB,EAAE,CAGrF;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAUD,gFAAgF;AAChF,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,OAAO,GAAE,oBAAyB,GACjC,MAAM,EAAE,CAuBV"}
|
package/dist/agent-harness.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.HARNESS_RULE_DESCRIPTION = exports.CURSOR_RULE_FILENAME = exports.HARNESS_MARKER_END = exports.HARNESS_MARKER_START = void 0;
|
|
7
7
|
exports.buildClaudeHarnessBlock = buildClaudeHarnessBlock;
|
|
8
8
|
exports.buildCodexHarnessBlock = buildCodexHarnessBlock;
|
|
9
|
+
exports.buildMuseHarnessBlock = buildMuseHarnessBlock;
|
|
9
10
|
exports.buildCursorHarnessInner = buildCursorHarnessInner;
|
|
10
11
|
exports.mergeCursorHarnessFile = mergeCursorHarnessFile;
|
|
11
12
|
exports.buildCursorHarnessFile = buildCursorHarnessFile;
|
|
@@ -18,6 +19,8 @@ exports.formatHarnessDiagnosis = formatHarnessDiagnosis;
|
|
|
18
19
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
19
20
|
const node_os_1 = __importDefault(require("node:os"));
|
|
20
21
|
const node_path_1 = __importDefault(require("node:path"));
|
|
22
|
+
const muse_skills_1 = require("./muse-skills");
|
|
23
|
+
const terminal_style_1 = require("./terminal-style");
|
|
21
24
|
exports.HARNESS_MARKER_START = '<!-- agent-deck:harness:start -->';
|
|
22
25
|
exports.HARNESS_MARKER_END = '<!-- agent-deck:harness:end -->';
|
|
23
26
|
exports.CURSOR_RULE_FILENAME = 'agent-deck.mdc';
|
|
@@ -29,12 +32,20 @@ const GLOBAL_BODY = `**Connect first:** Connection has three layers: host transp
|
|
|
29
32
|
|
|
30
33
|
**Session opener (first turn only) — the canonical session receipt:** This call verifies an existing connection; it does not create it. The folder's deck comes from \`.agent-deck/use.json\`, which \`agent-deck use <deck>\` writes — the connection carries it; the agent does **not** pick a deck and must **not** call \`get_decks\`. When Agent Deck MCP is configured for the session, call \`get_session_context\` once, and show the session binding as **exactly one transcript line** rendering \`display_summary\` (e.g. \`◆ dev · 2 MCP · 0 keys · 1 playbooks\`). Render it verbatim: the string is the one source for the receipt — do not reconstruct the deck name, counts, badge, or the session (default …) override suffix, and print the suffix exactly as returned when the session deck differs from the workspace default. This transcript receipt is the authoritative binding record for the session; workspace badges and terminal status lines are optional secondary context and never override it. Match the task against the returned playbook triggers and call \`get_playbook\` for every match before taking task action. If tools are unavailable, repair the host transport first. On \`GRANT_REQUIRED\`, match the message before acting. "No deck assigned to this folder…" means the folder itself has no assignment — tell the user to run \`agent-deck use <deck>\` in the folder and reload MCP, then stop. "This MCP session has not bound yet…" means the session only needs its first bind — call \`bind_workspace\` (or \`get_session_binding\`) once, then retry \`switch_deck\`; no CLI step, no reload, and stop only if that retry also fails. For an unattended session, fix \`x-agent-deck-deck-id\` / the launch config instead. If \`.agent-deck/use.json\` already assigns the deck and only the project MCP pin is missing, that \`use\` can succeed from a host agent sandbox; creating a new assignment needs an unsandboxed terminal (home store write). Do **not** repeat the receipt on later turns when the binding is unchanged. A confirmed binding change allows exactly one new receipt line. (\`get_session_binding\` and \`get_bound_deck\` remain available for compatibility; the opener needs only \`get_session_context\`.)
|
|
31
34
|
|
|
35
|
+
**Deck operating instructions:** \`get_session_context\` returns \`operatingInstructions\` for the bound deck (\`''\` when the deck sets none). On the first turn, read and follow the non-empty instructions for this session's deck only. After a confirmed deck change, call \`get_session_context\` once before more task work and follow only the new deck's instructions — the previous deck's instructions stop applying immediately. Deck instructions never override platform safety, developer/user instructions, or authorization boundaries, and never enable extra tools. On any conflict the higher-priority instruction wins — report the conflict instead of complying. MCP initialize-time server instructions are a bootstrap hint only: they reflect the deck at connect time and never update after a hot switch, so \`get_session_context\` stays the authoritative live value. No reconnect is needed after a switch.
|
|
36
|
+
|
|
32
37
|
**Later turns:** Deck scope comes from the launch-selected connection (folder assignment or launch header). Do not re-bind unless the user asks for deck administration. Do not re-show the session receipt on later turns when the binding is unchanged; after a confirmed binding change, show exactly one new receipt line and then stop repeating it. To move to another deck, call \`switch_deck\` and wait — the user approves it as This session only or This workspace by default; the active deck is unchanged until approval and no reload is needed. A rejected move (\`DECK_FIXED\` / \`ADMIN_REQUIRED\`) means the agent cannot change the connection itself — tell the user instead of retrying.
|
|
33
38
|
|
|
34
39
|
Before declining for missing tools (Slack, Linear, GitHub, etc.), use agent-deck MCP: \`get_bound_deck\`, \`call_service_tool\`. Don't hardcode deck IDs.
|
|
35
40
|
|
|
36
41
|
**Deck admin (create/edit deck):** Normal agents get \`ADMIN_REQUIRED\`. Call \`request_admin_elevation\`; user approves in the dashboard/menubar. After approval, \`mode\` is \`agent-admin\` until lease expiry or \`exit_admin_mode\`. Surface shared-deck workspace counts before mutating a deck used elsewhere. Deck switches never use elevation — request them with \`switch_deck\` and wait for human approval.
|
|
37
42
|
|
|
43
|
+
**Delegating to another session:** When the user asks to hand a task to another local session, delegate with \`agent-deck run\`.
|
|
44
|
+
The orchestrator must not choose the deck — the user names it; never pick or change it yourself.
|
|
45
|
+
Choose \`--tools readonly\` unless the brief owner says \`edit\`, and never raise the profile on your own.
|
|
46
|
+
For the brief–launch–monitor–review–resume protocol read the \`agent-deck-run\` skill (\`skills/agent-deck-run/SKILL.md\`); for per-client flags, resume ids, and trust behavior read \`docs/DELEGATION.md\`.
|
|
47
|
+
For corrections from a delegated run, who files and with what evidence is defined in the "Corrections from a delegated run" block of \`skills/agent-deck-run/SKILL.md\`.
|
|
48
|
+
|
|
38
49
|
**Playbooks — runtime discovery (no generated stubs):** Playbook triggers and bodies live only on the bound deck — \`agent-deck use\` and bind/switch write no per-playbook files, so switching decks never requires regenerating workspace files for discovery. On every task, match the task against the playbook \`triggers\` returned by \`get_bound_deck\` and call \`get_playbook\` for every match before acting. A playbook that exists only on the newly active deck is discovered the same way (\`get_bound_deck\` lists its triggers; \`get_playbook\` fetches its body) — never rely on checked-in stub or skill files, which may belong to a previously bound deck. **Never** mirror playbook bodies into \`.cursor/skills/\`, rules, or Claude skills — one source of truth on the deck.
|
|
39
50
|
|
|
40
51
|
### When user asks for a playbook task
|
|
@@ -83,6 +94,10 @@ function buildClaudeHarnessBlock(scope) {
|
|
|
83
94
|
function buildCodexHarnessBlock(scope) {
|
|
84
95
|
return buildClaudeHarnessBlock(scope);
|
|
85
96
|
}
|
|
97
|
+
/** Muse project scope merges the same full harness into root AGENTS.md. */
|
|
98
|
+
function buildMuseHarnessBlock(scope) {
|
|
99
|
+
return buildClaudeHarnessBlock(scope);
|
|
100
|
+
}
|
|
86
101
|
function buildCursorHarnessInner(scope) {
|
|
87
102
|
const body = scope === 'project' ? `${GLOBAL_BODY}\n\n${PROJECT_BODY_EXTRA}` : GLOBAL_BODY;
|
|
88
103
|
return `# Agent Deck\n\n${body}`;
|
|
@@ -151,6 +166,12 @@ function resolveHarnessPath(client, scope) {
|
|
|
151
166
|
const codexHome = process.env.CODEX_HOME?.trim() || node_path_1.default.join(home, '.codex');
|
|
152
167
|
return scope === 'project' ? node_path_1.default.join(cwd, 'AGENTS.md') : node_path_1.default.join(codexHome, 'AGENTS.md');
|
|
153
168
|
}
|
|
169
|
+
if (client === 'muse') {
|
|
170
|
+
if (scope === 'project') {
|
|
171
|
+
return node_path_1.default.join(cwd, 'AGENTS.md');
|
|
172
|
+
}
|
|
173
|
+
return (0, muse_skills_1.resolveMuseSkillsDir)(home);
|
|
174
|
+
}
|
|
154
175
|
return null;
|
|
155
176
|
}
|
|
156
177
|
function readTextFile(filePath) {
|
|
@@ -167,11 +188,36 @@ function writeTextFile(filePath, content) {
|
|
|
167
188
|
node_fs_1.default.writeFileSync(filePath, content, 'utf8');
|
|
168
189
|
}
|
|
169
190
|
function installAgentHarness(client, scope) {
|
|
191
|
+
if (client === 'muse' && scope === 'global') {
|
|
192
|
+
const skills = (0, muse_skills_1.installMuseSkills)();
|
|
193
|
+
if (!skills.ok) {
|
|
194
|
+
return {
|
|
195
|
+
installed: false,
|
|
196
|
+
path: skills.collisionPath,
|
|
197
|
+
message: skills.error,
|
|
198
|
+
error: skills.error,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const values = Object.values(skills.actions);
|
|
202
|
+
const action = values.every((value) => value === 'unchanged')
|
|
203
|
+
? 'unchanged'
|
|
204
|
+
: values.some((value) => value === 'updated')
|
|
205
|
+
? 'updated'
|
|
206
|
+
: 'created';
|
|
207
|
+
return {
|
|
208
|
+
installed: true,
|
|
209
|
+
path: skills.dir,
|
|
210
|
+
action,
|
|
211
|
+
message: action === 'unchanged'
|
|
212
|
+
? `Muse skills already current → ${skills.dir}`
|
|
213
|
+
: `${skills.message} (other skills untouched)`,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
170
216
|
const harnessPath = resolveHarnessPath(client, scope);
|
|
171
217
|
if (!harnessPath) {
|
|
172
218
|
return {
|
|
173
219
|
installed: false,
|
|
174
|
-
message: 'Agent harness applies to Cursor, Claude Code, and
|
|
220
|
+
message: 'Agent harness applies to Cursor, Claude Code, Codex, and Muse. For Claude Desktop, add the same snippets from docs/AGENT_HARNESS.md to your Claude Code global CLAUDE.md if you use both.',
|
|
175
221
|
};
|
|
176
222
|
}
|
|
177
223
|
if (client === 'cursor') {
|
|
@@ -190,27 +236,38 @@ function installAgentHarness(client, scope) {
|
|
|
190
236
|
: `Installed agent harness → ${harnessPath} (other rules/skills untouched)`,
|
|
191
237
|
};
|
|
192
238
|
}
|
|
193
|
-
const block = client === 'codex'
|
|
239
|
+
const block = client === 'codex'
|
|
240
|
+
? buildCodexHarnessBlock(scope)
|
|
241
|
+
: client === 'muse'
|
|
242
|
+
? buildMuseHarnessBlock(scope)
|
|
243
|
+
: buildClaudeHarnessBlock(scope);
|
|
194
244
|
const existing = readTextFile(harnessPath);
|
|
195
245
|
const { content, changed } = mergeClaudeHarness(existing, block);
|
|
196
246
|
const action = !existing.trim() ? 'created' : changed ? 'updated' : 'unchanged';
|
|
197
247
|
if (action !== 'unchanged') {
|
|
198
248
|
writeTextFile(harnessPath, content);
|
|
199
249
|
}
|
|
250
|
+
const hostFile = client === 'codex' || client === 'muse' ? 'AGENTS.md' : 'CLAUDE.md';
|
|
200
251
|
return {
|
|
201
252
|
installed: true,
|
|
202
253
|
path: harnessPath,
|
|
203
254
|
action,
|
|
204
255
|
message: action === 'unchanged'
|
|
205
256
|
? `Agent harness already current → ${harnessPath}`
|
|
206
|
-
: `Installed agent harness → ${harnessPath} (rest of ${
|
|
257
|
+
: `Installed agent harness → ${harnessPath} (rest of ${hostFile} untouched)`,
|
|
207
258
|
};
|
|
208
259
|
}
|
|
209
260
|
function expectedHarnessInner(client, scope) {
|
|
210
261
|
if (client === 'cursor') {
|
|
211
262
|
return buildCursorHarnessInner(scope);
|
|
212
263
|
}
|
|
213
|
-
|
|
264
|
+
if (client === 'codex') {
|
|
265
|
+
return buildCodexHarnessBlock(scope);
|
|
266
|
+
}
|
|
267
|
+
if (client === 'muse') {
|
|
268
|
+
return buildMuseHarnessBlock(scope);
|
|
269
|
+
}
|
|
270
|
+
return buildClaudeHarnessBlock(scope);
|
|
214
271
|
}
|
|
215
272
|
function extractManagedHarnessBlock(content) {
|
|
216
273
|
const start = content.indexOf(exports.HARNESS_MARKER_START);
|
|
@@ -226,8 +283,12 @@ function extractManagedHarnessBlock(content) {
|
|
|
226
283
|
* frontmatter, and other rules/skills cannot flag a file as stale.
|
|
227
284
|
*/
|
|
228
285
|
function diagnoseHarness(client, scope) {
|
|
229
|
-
const harnessPath = resolveHarnessPath(client, scope);
|
|
230
286
|
const repairCommand = `agent-deck setup --client ${client}`;
|
|
287
|
+
if (client === 'muse' && scope === 'global') {
|
|
288
|
+
const summary = (0, muse_skills_1.summarizeMuseSkillsDiagnosis)();
|
|
289
|
+
return { client, path: summary.path, status: summary.status, repairCommand };
|
|
290
|
+
}
|
|
291
|
+
const harnessPath = resolveHarnessPath(client, scope);
|
|
231
292
|
if (!harnessPath) {
|
|
232
293
|
return { client, path: '', status: 'missing', repairCommand };
|
|
233
294
|
}
|
|
@@ -247,29 +308,35 @@ function diagnoseHarness(client, scope) {
|
|
|
247
308
|
}
|
|
248
309
|
/** Read-only freshness check for every supported harness client. */
|
|
249
310
|
function diagnoseAllHarnesses(scope = 'global') {
|
|
250
|
-
const clients = ['cursor', 'claude', 'codex'];
|
|
311
|
+
const clients = ['cursor', 'claude', 'codex', 'muse'];
|
|
251
312
|
return clients.map((client) => diagnoseHarness(client, scope));
|
|
252
313
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
let problems = 0;
|
|
257
|
-
for (const diagnosis of diagnoses) {
|
|
258
|
-
if (diagnosis.status === 'current') {
|
|
259
|
-
lines.push(` OK: ${diagnosis.client} → ${diagnosis.path}`);
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
problems += 1;
|
|
263
|
-
const label = diagnosis.status === 'missing' ? 'MISSING' : 'STALE';
|
|
264
|
-
lines.push(` ${label}: ${diagnosis.client} → ${diagnosis.path || '(no path)'}`);
|
|
265
|
-
lines.push(` repair: ${diagnosis.repairCommand}`);
|
|
314
|
+
function compactHomePath(filePath, homeDir) {
|
|
315
|
+
if (filePath === homeDir) {
|
|
316
|
+
return '~';
|
|
266
317
|
}
|
|
267
|
-
|
|
268
|
-
|
|
318
|
+
const homePrefix = `${homeDir}${node_path_1.default.sep}`;
|
|
319
|
+
return filePath.startsWith(homePrefix) ? `~${node_path_1.default.sep}${filePath.slice(homePrefix.length)}` : filePath;
|
|
320
|
+
}
|
|
321
|
+
/** Compact, human-readable recovery summary with visually distinct commands. */
|
|
322
|
+
function formatHarnessDiagnosis(diagnoses, options = {}) {
|
|
323
|
+
const color = options.color ?? (0, terminal_style_1.terminalColorsEnabled)();
|
|
324
|
+
const homeDir = options.homeDir ?? node_os_1.default.homedir();
|
|
325
|
+
const problems = diagnoses.filter((diagnosis) => diagnosis.status !== 'current');
|
|
326
|
+
if (problems.length === 0) {
|
|
327
|
+
return [`${terminal_style_1.terminalStyle.bold('Agent harness:', color)} all current`];
|
|
269
328
|
}
|
|
270
|
-
|
|
271
|
-
|
|
329
|
+
const noun = problems.length === 1 ? 'repair' : 'repairs';
|
|
330
|
+
const lines = [
|
|
331
|
+
`${terminal_style_1.terminalStyle.bold('Agent harness:', color)} ${terminal_style_1.terminalStyle.warning(`${problems.length} ${noun} needed`, color)}`,
|
|
332
|
+
];
|
|
333
|
+
for (const diagnosis of problems) {
|
|
334
|
+
const label = diagnosis.status === 'missing' ? 'MISSING' : 'STALE';
|
|
335
|
+
const target = compactHomePath(diagnosis.path, homeDir) || '(no path)';
|
|
336
|
+
lines.push(` ${terminal_style_1.terminalStyle.warning(label, color)} ${diagnosis.client} ${terminal_style_1.terminalStyle.dim(target, color)}`);
|
|
337
|
+
lines.push(` Run: ${terminal_style_1.terminalStyle.command(diagnosis.repairCommand, color)}`);
|
|
272
338
|
}
|
|
339
|
+
lines.push(terminal_style_1.terminalStyle.dim(' Restart each repaired host to load the updated harness.', color));
|
|
273
340
|
return lines;
|
|
274
341
|
}
|
|
275
342
|
//# sourceMappingURL=agent-harness.js.map
|
|
@@ -1 +1 @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AAC,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,8BAAa,CAAC,GAAG,CAAC,2DAA2D,EAAE,KAAK,CAAC,CAAC,CAAC;IAClG,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/codex-plugin.d.ts
CHANGED
|
@@ -32,6 +32,19 @@ export interface CodexPluginState {
|
|
|
32
32
|
classification?: CodexClassification;
|
|
33
33
|
installedVersion?: string;
|
|
34
34
|
selector?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Installed plugin root as reported by `codex plugin list` (the Codex
|
|
37
|
+
* versioned cache path, e.g. `~/.codex/plugins/cache/agent-deck/agent-deck/<version>/`,
|
|
38
|
+
* when Codex materializes one). This is the version source of truth — not
|
|
39
|
+
* the marketplace workspace path.
|
|
40
|
+
*/
|
|
41
|
+
installedRoot?: string;
|
|
42
|
+
/** Marketplace source root from `codex plugin marketplace list`. */
|
|
43
|
+
marketplaceRoot?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Back-compat alias: the installed root when known, else the marketplace
|
|
46
|
+
* root. Prefer {@link installedRoot} / {@link marketplaceRoot}.
|
|
47
|
+
*/
|
|
35
48
|
root?: string;
|
|
36
49
|
marketplaceName?: string;
|
|
37
50
|
sourceKind?: 'local' | 'git' | 'unknown';
|
|
@@ -40,6 +53,20 @@ export interface CodexPluginState {
|
|
|
40
53
|
export declare function inspectCodexPlugin(cliVersion: string, runner?: CodexRunner): Promise<CodexPluginState>;
|
|
41
54
|
export declare function manualCodexCommands(selector: string): string[];
|
|
42
55
|
export declare function remediationLine(selector: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* True when `root` is a Codex versioned plugin cache path, e.g.
|
|
58
|
+
* `~/.codex/plugins/cache/agent-deck/agent-deck/1.11.7/`. Only such paths
|
|
59
|
+
* are ever suggested for manual `rm -rf`: Agent Deck never removes cache
|
|
60
|
+
* paths itself and never suggests removing a marketplace workspace path.
|
|
61
|
+
*/
|
|
62
|
+
export declare function isVersionedCodexCachePath(root: string | undefined): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Manual cache-clear commands for a sticky installed root. Returns [] unless
|
|
65
|
+
* the root is recognisably a versioned `plugins/cache/agent-deck` path, so
|
|
66
|
+
* callers never print `rm -rf` against a marketplace workspace checkout.
|
|
67
|
+
* Agent Deck never runs these itself — they are printed for the operator.
|
|
68
|
+
*/
|
|
69
|
+
export declare function stickyCacheClearCommands(installedRoot: string | undefined): string[];
|
|
43
70
|
/**
|
|
44
71
|
* Reconcile the installed Agent Deck plugin after a CLI upgrade.
|
|
45
72
|
* Pass `{ alreadyCurrent: true }` when the CLI was already current so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-plugin.d.ts","sourceRoot":"","sources":["../src/codex-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-plugin.d.ts","sourceRoot":"","sources":["../src/codex-plugin.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,UAAU,GACV,YAAY,GACZ,kBAAkB,GAClB,aAAa,GACb,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAM/D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAqBvE;AAoDD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAA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AKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAK3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAKpF;AA+DD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,MAAM,EACvB,MAAM,GAAE,WAA6B,EACrC,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GACzC,OAAO,CAAC,MAAM,CAAC,CAkHjB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,WAA6B,GACpC,OAAO,CAAC,MAAM,CAAC,CA+DjB"}
|
package/dist/codex-plugin.js
CHANGED
|
@@ -8,10 +8,13 @@ exports.runCodexCommand = runCodexCommand;
|
|
|
8
8
|
exports.inspectCodexPlugin = inspectCodexPlugin;
|
|
9
9
|
exports.manualCodexCommands = manualCodexCommands;
|
|
10
10
|
exports.remediationLine = remediationLine;
|
|
11
|
+
exports.isVersionedCodexCachePath = isVersionedCodexCachePath;
|
|
12
|
+
exports.stickyCacheClearCommands = stickyCacheClearCommands;
|
|
11
13
|
exports.reconcileCodexPluginAfterUpgrade = reconcileCodexPluginAfterUpgrade;
|
|
12
14
|
exports.runCodexPluginDoctor = runCodexPluginDoctor;
|
|
13
15
|
const node_child_process_1 = require("node:child_process");
|
|
14
16
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
17
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
15
18
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
19
|
exports.AGENT_DECK_PLUGIN_NAME = 'agent-deck';
|
|
17
20
|
exports.DEFAULT_PLUGIN_SELECTOR = 'agent-deck@agent-deck';
|
|
@@ -317,6 +320,7 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
317
320
|
classification: 'disabled',
|
|
318
321
|
installedVersion: first.version,
|
|
319
322
|
selector: first.selector,
|
|
323
|
+
installedRoot: first.root,
|
|
320
324
|
root: first.root,
|
|
321
325
|
transport: readTransport(first.root),
|
|
322
326
|
};
|
|
@@ -336,6 +340,7 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
336
340
|
const distinctRoots = [...new Set(installed.map((p) => p.root).filter(Boolean))];
|
|
337
341
|
const ambiguous = selectors.length > 1 || supplying.length > 1 || distinctRoots.length > 1;
|
|
338
342
|
if (ambiguous) {
|
|
343
|
+
const ambiguousRoot = distinctRoots.length === 1 ? distinctRoots[0] : first.root;
|
|
339
344
|
return {
|
|
340
345
|
...base,
|
|
341
346
|
installed,
|
|
@@ -343,15 +348,23 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
343
348
|
classification: 'ambiguous-source',
|
|
344
349
|
installedVersion: first.version,
|
|
345
350
|
selector,
|
|
346
|
-
|
|
347
|
-
|
|
351
|
+
installedRoot: ambiguousRoot,
|
|
352
|
+
root: ambiguousRoot,
|
|
353
|
+
transport: readTransport(ambiguousRoot),
|
|
348
354
|
};
|
|
349
355
|
}
|
|
350
356
|
const resolvedMarketplace = supplying.length === 1 ? supplying[0] : undefined;
|
|
351
|
-
|
|
357
|
+
// The installed root (Codex versioned cache path when present) is the
|
|
358
|
+
// version source of truth; the marketplace root is only where Codex
|
|
359
|
+
// re-reads from on `plugin add`. A sticky cache keeps serving the old
|
|
360
|
+
// installed root after the marketplace workspace already has the new
|
|
361
|
+
// `plugin.json`, so the two must stay distinguishable downstream.
|
|
362
|
+
const installedRoot = observedVersionedCacheRoot(first.version) ?? first.root;
|
|
363
|
+
const marketplaceRoot = resolvedMarketplace?.root;
|
|
364
|
+
const root = installedRoot ?? marketplaceRoot;
|
|
352
365
|
const marketplaceName = part ?? resolvedMarketplace?.name ?? first.marketplace;
|
|
353
366
|
const sourceKind = resolvedMarketplace?.source ?? 'unknown';
|
|
354
|
-
const transport = readTransport(
|
|
367
|
+
const transport = readTransport(installedRoot ?? marketplaceRoot);
|
|
355
368
|
if (transport === 'direct-http') {
|
|
356
369
|
return {
|
|
357
370
|
...base,
|
|
@@ -360,6 +373,8 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
360
373
|
classification: 'legacy-http',
|
|
361
374
|
installedVersion: first.version,
|
|
362
375
|
selector,
|
|
376
|
+
installedRoot,
|
|
377
|
+
marketplaceRoot,
|
|
363
378
|
root,
|
|
364
379
|
marketplaceName,
|
|
365
380
|
sourceKind,
|
|
@@ -374,6 +389,8 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
374
389
|
classification: 'version-mismatch',
|
|
375
390
|
installedVersion: first.version,
|
|
376
391
|
selector,
|
|
392
|
+
installedRoot,
|
|
393
|
+
marketplaceRoot,
|
|
377
394
|
root,
|
|
378
395
|
marketplaceName,
|
|
379
396
|
sourceKind,
|
|
@@ -390,6 +407,8 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
390
407
|
classification: 'unknown-transport',
|
|
391
408
|
installedVersion: first.version,
|
|
392
409
|
selector,
|
|
410
|
+
installedRoot,
|
|
411
|
+
marketplaceRoot,
|
|
393
412
|
root,
|
|
394
413
|
marketplaceName,
|
|
395
414
|
sourceKind,
|
|
@@ -403,6 +422,8 @@ async function inspectCodexPlugin(cliVersion, runner = runCodexCommand) {
|
|
|
403
422
|
classification: 'compatible',
|
|
404
423
|
installedVersion: first.version,
|
|
405
424
|
selector,
|
|
425
|
+
installedRoot,
|
|
426
|
+
marketplaceRoot,
|
|
406
427
|
root,
|
|
407
428
|
marketplaceName,
|
|
408
429
|
sourceKind,
|
|
@@ -415,6 +436,72 @@ function manualCodexCommands(selector) {
|
|
|
415
436
|
function remediationLine(selector) {
|
|
416
437
|
return `codex plugin remove ${selector} && codex plugin add ${selector}`;
|
|
417
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* True when `root` is a Codex versioned plugin cache path, e.g.
|
|
441
|
+
* `~/.codex/plugins/cache/agent-deck/agent-deck/1.11.7/`. Only such paths
|
|
442
|
+
* are ever suggested for manual `rm -rf`: Agent Deck never removes cache
|
|
443
|
+
* paths itself and never suggests removing a marketplace workspace path.
|
|
444
|
+
*/
|
|
445
|
+
function isVersionedCodexCachePath(root) {
|
|
446
|
+
if (!root) {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
return /plugins[/\\]cache[/\\]agent-deck[/\\]agent-deck[/\\][^/\\]+/.test(root.replace(/\\/g, '/'));
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Manual cache-clear commands for a sticky installed root. Returns [] unless
|
|
453
|
+
* the root is recognisably a versioned `plugins/cache/agent-deck` path, so
|
|
454
|
+
* callers never print `rm -rf` against a marketplace workspace checkout.
|
|
455
|
+
* Agent Deck never runs these itself — they are printed for the operator.
|
|
456
|
+
*/
|
|
457
|
+
function stickyCacheClearCommands(installedRoot) {
|
|
458
|
+
if (!isVersionedCodexCachePath(installedRoot)) {
|
|
459
|
+
return [];
|
|
460
|
+
}
|
|
461
|
+
return [`rm -rf "${installedRoot}"`];
|
|
462
|
+
}
|
|
463
|
+
function codexHomeDir() {
|
|
464
|
+
const fromEnv = process.env.CODEX_HOME?.trim();
|
|
465
|
+
if (fromEnv) {
|
|
466
|
+
return fromEnv;
|
|
467
|
+
}
|
|
468
|
+
return node_path_1.default.join(node_os_1.default.homedir(), '.codex');
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Versioned Codex plugin cache dir for an installed version, e.g.
|
|
472
|
+
* `<CODEX_HOME>/plugins/cache/agent-deck/agent-deck/1.11.7/`, when it
|
|
473
|
+
* exists on disk. Live Codex may list the marketplace workspace as the
|
|
474
|
+
* plugin source path while actually serving a stale copy from this cache,
|
|
475
|
+
* so an on-disk match takes precedence as the installed root. Returns
|
|
476
|
+
* undefined when absent — inspection never implies a cache that is not there.
|
|
477
|
+
*/
|
|
478
|
+
function observedVersionedCacheRoot(installedVersion) {
|
|
479
|
+
if (!installedVersion || /[/\\]/.test(installedVersion) || installedVersion.includes('..')) {
|
|
480
|
+
return undefined;
|
|
481
|
+
}
|
|
482
|
+
const candidate = node_path_1.default.join(codexHomeDir(), 'plugins', 'cache', 'agent-deck', 'agent-deck', installedVersion);
|
|
483
|
+
try {
|
|
484
|
+
if (node_fs_1.default.statSync(candidate).isDirectory()) {
|
|
485
|
+
return candidate;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
catch {
|
|
489
|
+
return undefined;
|
|
490
|
+
}
|
|
491
|
+
return undefined;
|
|
492
|
+
}
|
|
493
|
+
function printStickyCacheBlock(installedRoot, selector) {
|
|
494
|
+
const commands = stickyCacheClearCommands(installedRoot);
|
|
495
|
+
if (commands.length === 0) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
console.log('If remove/add keeps reporting the old version, Codex kept a sticky versioned cache.');
|
|
499
|
+
console.log('Clear the Agent Deck cache path manually (never removed by Agent Deck itself), then re-add:');
|
|
500
|
+
for (const command of commands) {
|
|
501
|
+
console.log(` ${command}`);
|
|
502
|
+
}
|
|
503
|
+
console.log(` codex plugin add ${selector}`);
|
|
504
|
+
}
|
|
418
505
|
function printManualSyncBlock(selector, marketplaceName) {
|
|
419
506
|
console.log('To sync the plugin manually, run:');
|
|
420
507
|
if (marketplaceName) {
|
|
@@ -518,7 +605,12 @@ async function reconcileCodexPluginAfterUpgrade(expectedVersion, runner = runCod
|
|
|
518
605
|
return 0;
|
|
519
606
|
}
|
|
520
607
|
console.log(`${prefix}; Codex plugin still ${reread.classification ?? 'unreadable'} (installed ${reread.installedVersion ?? '(unknown)'}, expected ${expectedVersion}).`);
|
|
608
|
+
const rereadInstalledRoot = reread.installedRoot ?? reread.root;
|
|
609
|
+
if (rereadInstalledRoot) {
|
|
610
|
+
console.log(`Installed root: ${rereadInstalledRoot}`);
|
|
611
|
+
}
|
|
521
612
|
printManualSyncBlock(targetSelector, marketplaceName);
|
|
613
|
+
printStickyCacheBlock(rereadInstalledRoot, targetSelector);
|
|
522
614
|
return 1;
|
|
523
615
|
}
|
|
524
616
|
/**
|
|
@@ -556,13 +648,26 @@ async function runCodexPluginDoctor(cliVersion, runner = runCodexCommand) {
|
|
|
556
648
|
case 'unknown-transport':
|
|
557
649
|
case 'ambiguous-source': {
|
|
558
650
|
const selector = state.selector ?? exports.DEFAULT_PLUGIN_SELECTOR;
|
|
559
|
-
|
|
651
|
+
// The installed root is the version source of truth; the marketplace
|
|
652
|
+
// root only shows where `plugin add` re-reads from. When a sticky
|
|
653
|
+
// versioned cache survives, the two differ and only the installed
|
|
654
|
+
// root explains the reported version.
|
|
655
|
+
const installedRoot = state.installedRoot ?? state.root;
|
|
656
|
+
const marketplaceRoot = state.marketplaceRoot ?? state.root ?? '(unknown)';
|
|
560
657
|
const source = state.sourceKind ?? 'unknown';
|
|
561
658
|
console.log(`Codex plugin: ${state.classification} (installed ${state.installedVersion ?? '(unknown)'}, expected ${cliVersion})`);
|
|
562
659
|
console.log(`Selector: ${selector}`);
|
|
563
|
-
console.log(`Marketplace root: ${
|
|
660
|
+
console.log(`Marketplace root: ${marketplaceRoot} (${source})`);
|
|
661
|
+
if (installedRoot && installedRoot !== marketplaceRoot) {
|
|
662
|
+
console.log(`Installed root: ${installedRoot}`);
|
|
663
|
+
}
|
|
564
664
|
console.log(`Transport: ${state.transport}`);
|
|
565
665
|
console.log(`Remediation: ${remediationLine(selector)}`);
|
|
666
|
+
if (state.classification === 'version-mismatch' ||
|
|
667
|
+
state.classification === 'legacy-http' ||
|
|
668
|
+
state.classification === 'unknown-transport') {
|
|
669
|
+
printStickyCacheBlock(installedRoot, selector);
|
|
670
|
+
}
|
|
566
671
|
console.error(`FAIL: Codex plugin ${state.classification} (installed ${state.installedVersion ?? '(unknown)'}, expected ${cliVersion})`);
|
|
567
672
|
return 1;
|
|
568
673
|
}
|