@agent-deck/cli 2.1.0 → 2.1.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.
@@ -7,7 +7,6 @@ description: Use when a task matches a bound-deck playbook trigger, or when the
7
7
 
8
8
  1. On task match: check `triggers` on `get_bound_deck`, then `get_playbook` before improvising. Playbook bodies live on the deck — do not mirror them into local skills.
9
9
 
10
- <!-- Self-improvement blocks below are verbatim from GLOBAL_BODY in packages/cli/src/agent-harness.ts (NOT-427); keep in sync. -->
11
10
 
12
11
  **When the user corrects your output** (the write trigger — no need to have called `get_playbook` earlier in the session):
13
12
 
@@ -1,19 +1,36 @@
1
1
  ---
2
2
  name: agent-deck-run
3
- description: Use when delegating a task to a local coding session on a named deck: brief it, launch it detached with agent-deck run, monitor it, review the result against the goal, and resume it with feedback until done.
3
+ description: "Use when delegating a task to a local coding session on a named deck: brief it, launch it detached with agent-deck run, monitor it, review the result against the goal, and resume it with feedback until done."
4
4
  ---
5
5
 
6
6
  # Agent Deck run (orchestrator)
7
7
 
8
8
  You are the caller of a session, not the session. Follow the five steps below.
9
9
 
10
- ## Prerequisite
10
+ ## 0. Check prerequisites first
11
11
 
12
- You must be able to run shell commands on the machine where the coding tool is signed in; otherwise stop and tell the human you cannot use this skill.
12
+ You must be able to run shell commands on the machine where the coding tool is signed in; otherwise stop and tell the human you cannot use this skill. Then check, read-only, before writing any brief:
13
+
14
+ ```sh
15
+ agent-deck --version # >= 2.1.0
16
+ agent-deck status # Status: running
17
+ agent-deck deck list # the deck the user named exists
18
+ claude auth status # or: codex login status | cursor-agent status | muse --version
19
+ ```
20
+
21
+ If anything fails, stop and tell the human exactly what is missing and how to fix it (the `agent-deck-setup` skill lists the fixes). Do not start a run that will fail midway.
22
+
23
+ Bind the working folder once; `run` refuses an unbound folder ("No deck assigned in <dir>: run `agent-deck use <deck>` there first"):
24
+
25
+ ```sh
26
+ cd <dir> && agent-deck use <deck> --client <client>
27
+ ```
28
+
29
+ Leave the user's uncommitted changes alone; use a separate git worktree or branch when the repo is dirty.
13
30
 
14
31
  ## 1. Write the brief
15
32
 
16
- Write the brief to a file. It must state the goal, the constraints, the definition of done, what the session must not do, and the tool profile the brief owner chose. Never put secrets in the brief.
33
+ Write the brief to a file. It must state the goal, the constraints, the definition of done, what the session must not do, and the tool profile the brief owner chose, and "if unclear, end your turn with the question". For code changes, the definition of done includes committing and pushing a named branch. Keep the user's decisions; label any number you had to assume as an assumption. Never put secrets in the brief.
17
34
 
18
35
  ## 2. Launch detached
19
36
 
@@ -25,11 +42,11 @@ agent-deck run <deck> --client <client> --cwd <dir> --prompt-file <brief-file> -
25
42
 
26
43
  Supported `--client` values are `claude`, `codex`, `cursor`, `muse`; `agent-deck run --help` lists the clients. The examples use `claude`; substitute your client. Read the `runId`, pid, and log path from the `run <runId> detached: pid <pid> log <path>` line. If the launch fails closed on a deck binding mismatch, stop and report to the human instead of rebinding.
27
44
 
28
- For per-client flags, resume ids, tool mappings, and trust behavior, see [docs/DELEGATION.md](../../docs/DELEGATION.md).
45
+ For per-client flags, resume ids, tool mappings, and trust behavior, see `docs/DELEGATION.md` in the agent-deck repository.
29
46
 
30
47
  ## 3. Monitor
31
48
 
32
- Poll until the state leaves `running`. Suggested poll interval: 30 seconds (unconfirmed — no measured run durations yet; NOT-429 operator runs will justify the value against `run status --json` durations).
49
+ Poll until the state leaves `running`. Poll every 30 seconds: read-only runs typically take about 1–3 minutes, so a 30-second cadence catches the end within one interval without busy-polling.
33
50
 
34
51
  ```sh
35
52
  agent-deck run status <runId>
@@ -39,11 +56,11 @@ agent-deck run log <runId> --tail 50
39
56
  agent-deck run list
40
57
  ```
41
58
 
42
- Read the `state` field (`running|ended|error|died`), the `sessionId`, and the log path. Stop rule: on `died` or `error`, stop polling, read the tail of the log for the failure, and report to the human.
59
+ Log lines look like `<ts> text|tool|result|end ...`; a finished run ends with `result success sessionId=<id> <final text>` and `end sessionId=<id>`. Read `text` lines for questions; answer from verified facts or ask the human. Read the `state` field (`running|ended|error|died`), the `sessionId`, and the log path. Stop rule: on `died` or `error`, stop polling, read the tail of the log for the failure, and report to the human.
43
60
 
44
61
  ## 4. Review
45
62
 
46
- Judge the session's output against the goal and definition of done from step 1, not against the session's own summary. If it meets the goal, report to the human and stop.
63
+ Judge the session's output against the goal and definition of done from step 1, not against the session's own summary: open the real files, diff, tickets, or PR yourself. For code work, verify it landed: `git ls-remote origin <branch>` matches the session's commit. If it meets the goal, report to the human and stop.
47
64
 
48
65
  ## 5. Resume with feedback
49
66
 
@@ -53,13 +70,13 @@ Resume the same session with a feedback brief that quotes the gap found in step
53
70
  agent-deck run <deck> --client <client> --cwd <dir> --prompt-file <feedback-file> --tools readonly --resume <sessionId> --detach
54
71
  ```
55
72
 
56
- Repeat steps 3-5 until the goal is met or a round cap is hit (placeholder: 3 feedback rounds, unconfirmed — awaiting owner confirmation per NOT-429), then report to the human.
73
+ Repeat steps 3-5 until the goal is met, for at most 3 feedback rounds. If the goal is still not met after round 3, stop and bring the blocker to the human instead of resuming again.
57
74
 
58
75
  ### Corrections from a delegated run
59
- - The party that observed and made the correction files it: the orchestrator files `propose_playbook_patch` on its own bound deck <TBD: owner confirms who files>; the delegated session files only when a human corrects it directly.
76
+ - The party that observed and made the correction files it: the orchestrator files `propose_playbook_patch` on its own bound deck; the delegated session files only when a human corrects it directly.
60
77
  - Evidence quotes the review gap as `user_feedback_excerpt` plus `runId`, `sessionId`, tool profile, and log path; no secrets in evidence.
61
78
  - Clearly general lesson: `update` with `add_item` (or `create` when no playbook covers it); not yet general: `signal_only`.
62
- - Cross-deck: `create`/`signal_only` land on the caller's bound deck and `get_playbook` reads only that deck (`packages/backend/src/mcp-tools/register.ts:758`, `packages/backend/src/routes/playbooks.ts:185`), so for a playbook on another deck file `signal_only` with the ids above.
79
+ - Cross-deck: `create`/`signal_only` land on the caller's bound deck and `get_playbook` reads only that deck, so for a playbook on another deck file `signal_only` with the ids above.
63
80
 
64
81
  ## Hard rules
65
82
 
@@ -9,9 +9,11 @@ Treat setup as three separate layers: daemon health, host transport, then folder
9
9
 
10
10
  1. Run `agent-deck status` and check `http://127.0.0.1:1110/health` (or `<mcp-url>/health`
11
11
  from `.agent-deck/use.json` if present).
12
- 2. If the daemon is down, tell the user to run:
13
- - `npm i -g agent-deck`
14
- - `agent-deck start --daemon`
12
+ 2. If agent-deck is missing, older than 2.1.0 (`agent-deck --version`), or the daemon is down, tell the user to run the matching fix:
13
+ - Not installed (macOS, Node.js 20+, npm): `npx @agent-deck/cli@latest install`, then `export PATH="$HOME/.local/bin:$PATH"` (managed install: launcher in `~/.local/bin`, versions under `~/.agent-deck/`).
14
+ - Outdated: `agent-deck upgrade` (`agent-deck upgrade --check` reports whether one is available).
15
+ - Daemon down: `agent-deck start --daemon`.
16
+ - `agent-deck doctor` prints any harness repair as `agent-deck setup --client <client>`; run it, then restart that host.
15
17
  3. If the daemon is healthy but MCP tools are unavailable, repair the host transport:
16
18
  - **Codex:** verify the Agent Deck plugin is installed, enabled, and current. Its bundled
17
19
  `.mcp.json` must run `agent-deck mcp-launch`; reload or start a new task after changing
@@ -22,7 +24,9 @@ Treat setup as three separate layers: daemon health, host transport, then folder
22
24
  that host.
23
25
  4. Check the folder assignment reported by `agent-deck status`. If it is missing or legacy,
24
26
  tell the user to run `agent-deck use <deck>` in that folder, then reload or retry MCP.
25
- 5. Once transport and assignment are valid, use the session skill and require
27
+ 5. For delegation (`agent-deck run`), the client CLI must also be installed and signed in. Check `claude auth status`, `codex login status`, `cursor-agent status`, or `muse --version`; if missing, point the user to the official install docs ([Claude Code](https://docs.anthropic.com/en/docs/claude-code/setup), [Codex](https://developers.openai.com/codex/cli), [Cursor CLI](https://cursor.com/docs/cli/installation); muse per its distribution) and its sign-in (`claude`, `codex login`, `cursor-agent login`, `muse login`).
28
+ 6. If no deck exists (`agent-deck deck list`), the user creates one in the dashboard (`agent-deck open` → My Decks) or imports one: `agent-deck import <file>.agent-deck.json`.
29
+ 7. Once transport and assignment are valid, use the session skill and require
26
30
  `get_session_binding` followed by `get_bound_deck`.
27
- 6. Do not invent credentials, ports, or shell install pipelines. Keep guidance read-only;
31
+ 8. Do not invent credentials, ports, or shell install pipelines. Keep guidance read-only;
28
32
  the user executes install and setup commands.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-deck/cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Local MCP proxy — decks of tools, keys, and self-improving playbooks",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -40,8 +40,8 @@
40
40
  "prepublishOnly": "node ../../scripts/pre-publish-check.mjs && npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@agent-deck/backend": "^2.1.0",
44
- "@agent-deck/shared": "^2.1.0",
43
+ "@agent-deck/backend": "^2.1.1",
44
+ "@agent-deck/shared": "^2.1.1",
45
45
  "@anthropic-ai/claude-agent-sdk": "^0.3.296"
46
46
  },
47
47
  "devDependencies": {