agentpack-cli 0.1.7 → 0.1.9

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/docs/ROADMAP.md CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  ## North Star
4
4
 
5
- Agentpack is a local task-state layer for AI coding agents. It captures useful working context that usually gets lost in long sessions, restarts, and compaction: decisions, dead ends, inspected sources, evidence, checkpoints, and budgeted resumes.
5
+ Agentpack makes agent continuity native to the repo.
6
6
 
7
- Agentpack is not an orchestrator or a broad automatic memory engine. It is the portable context ledger for humans, single agents, and agent teams working on a repo.
7
+ It is a neutral task passport for agentic workspaces: a compact, portable record of decisions, source conclusions, evidence, dead ends, checkpoints, and next actions that survives chat compaction, client switches, worktree handoffs, machines, branches, and orchestrators.
8
+
9
+ See [VISION.md](VISION.md) for the fuller strategic framing.
10
+ See [TASK-PASSPORT.md](TASK-PASSPORT.md) for the target Task Passport schema and state transitions.
8
11
 
9
12
  ## Product Principles
10
13
 
@@ -22,24 +25,28 @@ Agentpack is not an orchestrator or a broad automatic memory engine. It is the p
22
25
 
23
26
  ## State Model
24
27
 
25
- Agentpack has four layers:
28
+ Agentpack has five layers:
26
29
 
27
30
  1. Tool install: the `agentpack` binary is installed once on a developer machine.
28
31
  2. Repo init: each repo gets its own local `.agentpack/` directory.
29
32
  3. Repo source cache: inspected source conclusions and file hashes can be reused across tasks in the same repo.
30
- 4. Task ledger: goal, status, decisions, dead ends, evidence, checkpoints, and exports belong to a workstream, not to a chat.
33
+ 4. Task Passport: objective, constraints, write scope, status, decisions, dead ends, evidence, verification, checkpoints, and next actions belong to one coherent unit of work.
34
+ 5. Role lanes: Scout, Builder, Reviewer, and Archivist can contribute to the current passport without creating separate tasks.
31
35
 
32
36
  Agent sessions and web chats are transport surfaces. They should be able to resume, write, and hand off a task, but they are not first-class Agentpack state.
33
37
 
34
- Sharing ledger state across machines or teammates is intentionally post-local-stability work. Prefer explicit sanitized export/import bundles before considering committed or synced shared state.
38
+ One active Task Passport owns the work in a repo worktree by default. Multiple passports can exist as closed history, parked work, or separate worktree handoffs, but Agentpack should not become a backlog manager or a code-conflict resolver.
39
+
40
+ Sharing passport state across machines or teammates is intentionally post-local-stability work. Prefer explicit sanitized export/import bundles before considering committed or synced shared state.
35
41
 
36
42
  Target task UX:
37
43
 
38
44
  ```bash
39
45
  agentpack init
40
- agentpack task start "Claude Desktop MCP install"
46
+ agentpack task start "Claude Desktop MCP install" --write-scope src/integrations/install.ts --write-scope docs/INTEGRATIONS.md
41
47
  agentpack task list
42
48
  agentpack task switch claude-desktop-mcp-install
49
+ agentpack task passport
43
50
  agentpack resume --preset agent
44
51
  agentpack checkpoint -m "Desktop config tested"
45
52
  agentpack task close
@@ -54,14 +61,38 @@ Target file shape:
54
61
  tasks/
55
62
  current
56
63
  claude-desktop-mcp-install/
57
- state.json
64
+ passport.json
58
65
  events.jsonl
59
66
  checkpoints/
60
67
  evidence/
61
68
  exports/
62
69
  ```
63
70
 
64
- This keeps source knowledge reusable across a repo while preventing unrelated feature work from mixing decisions, dead ends, and next actions.
71
+ This keeps source knowledge reusable across a repo while preventing unrelated work from mixing decisions, dead ends, and next actions. If another open passport claims overlapping write scope, Agentpack should warn and point the user toward reusing the current passport, parking one task, or moving work into a separate worktree.
72
+
73
+ Target consistency checks:
74
+
75
+ - current passport branch/head/worktree are visible in context
76
+ - source conclusions are validated by file hash
77
+ - write-scope overlap is detected before new work starts
78
+ - role lanes are advisory and scoped; Scout/Reviewer are read-oriented, Builder claims writes, Archivist records durable handoff state
79
+ - checkpoints remain append-only snapshots for recovery and handoff
80
+
81
+ ## Dogfood Success Metrics
82
+
83
+ Agentpack should prove itself first in this repo. Measure whether it reduces repeated work and handoff friction while keeping the ledger compact.
84
+
85
+ Useful signals:
86
+
87
+ - resume usefulness: a fresh agent can explain the current task, constraints, relevant files, risks, and next action after `load_context` or `resume`
88
+ - re-read avoidance: unchanged source conclusions let agents skip re-opening files unless the task requires fresh inspection
89
+ - dead-end avoidance: recorded failed approaches are not repeated in later sessions
90
+ - handoff time: a new agent can continue meaningful work within a few minutes after context load
91
+ - verification quality: important changes have evidence, test output, or explicit reasoning attached before checkpoint
92
+ - ledger health: `agentpack doctor` reports zero changed or missing source records before release-like handoff
93
+ - overhead: recording useful state stays lightweight enough that it does not interrupt normal coding flow
94
+
95
+ The target is reliable continuation of the work that was worth preserving.
65
96
 
66
97
  ## v0.1: Usable Manual CLI
67
98
 
@@ -115,7 +146,10 @@ Demo story:
115
146
  - Stable `.agentpack/` schema.
116
147
  - Stable CLI.
117
148
  - Stable MCP tools.
118
- - Task/workstream separation.
149
+ - Task Passport schema and one-current-passport workflow.
150
+ - Workstream separation for parked work, history, and worktree handoffs.
151
+ - Lightweight role lanes for Scout, Builder, Reviewer, and Archivist.
152
+ - Write-scope and stale-state warnings.
119
153
  - Security model documented.
120
154
  - npm publish as `agentpack-cli`.
121
155
  - Good demo and examples.
@@ -0,0 +1,227 @@
1
+ # Task Passport
2
+
3
+ Task Passport is the handoff artifact for one coherent unit of agentic work.
4
+
5
+ It captures the reviewed state a future agent needs in order to continue the current task without rediscovering context, repeating dead ends, or guessing what is safe to touch.
6
+
7
+ ## Model
8
+
9
+ Default rule:
10
+
11
+ - one active Task Passport owns a repo worktree
12
+ - a repo may keep many completed or parked passports over time
13
+ - worktrees can carry different active passports
14
+ - the shared repo source cache remains repo-level
15
+ - decisions, dead ends, evidence, checkpoints, and next actions become passport-scoped
16
+
17
+ This keeps source knowledge reusable while preventing unrelated work from mixing task state.
18
+
19
+ ## File Shape
20
+
21
+ Target local layout:
22
+
23
+ ```text
24
+ .agentpack/
25
+ config.json
26
+ sources.json
27
+ tasks/
28
+ current
29
+ task_20260518_source_cleanup/
30
+ passport.json
31
+ events.jsonl
32
+ checkpoints/
33
+ evidence/
34
+ exports/
35
+ ```
36
+
37
+ `tasks/current` is a small pointer to the active task id for this worktree. If it is missing, Agentpack can fall back to the current v0 repo-level state.
38
+
39
+ ## Passport Schema
40
+
41
+ `passport.json` should be compact, readable, and safe to inspect manually.
42
+
43
+ ```json
44
+ {
45
+ "schemaVersion": 1,
46
+ "id": "task_20260518_source_cleanup",
47
+ "title": "Add source cache cleanup commands",
48
+ "status": "active",
49
+ "createdAt": "2026-05-18T11:00:00.000Z",
50
+ "updatedAt": "2026-05-18T11:30:00.000Z",
51
+ "closedAt": null,
52
+ "objective": "Let Agentpack remove stale source records safely.",
53
+ "constraints": [
54
+ "Preserve existing source add/status behavior",
55
+ "Do not delete source records broadly without an explicit guard"
56
+ ],
57
+ "branch": "main",
58
+ "baseHead": "8d22011",
59
+ "currentHead": "21fe674",
60
+ "worktree": "/path/to/repo",
61
+ "writeScope": [
62
+ "src/operations.ts",
63
+ "src/cli/index.ts",
64
+ "tests/agentpack.test.ts",
65
+ "docs/CLI.md"
66
+ ],
67
+ "risk": "low",
68
+ "roles": {
69
+ "scout": {
70
+ "status": "done",
71
+ "summary": "Inspected source add/status flow and tests."
72
+ },
73
+ "builder": {
74
+ "status": "done",
75
+ "summary": "Implemented remove/prune commands inside declared write scope."
76
+ },
77
+ "reviewer": {
78
+ "status": "done",
79
+ "summary": "Verified tests, doctor, and dogfood cleanup."
80
+ },
81
+ "archivist": {
82
+ "status": "done",
83
+ "summary": "Recorded source conclusions, evidence, and checkpoint."
84
+ }
85
+ },
86
+ "verification": {
87
+ "status": "passed",
88
+ "evidence": [
89
+ "evt_example_test_output"
90
+ ],
91
+ "summary": "npm test passed; doctor clean after source cache refresh."
92
+ },
93
+ "nextActions": [
94
+ "Design Task Passport schema and state transitions"
95
+ ],
96
+ "tags": [
97
+ "source-cache",
98
+ "trust-foundation"
99
+ ]
100
+ }
101
+ ```
102
+
103
+ Required fields for v1:
104
+
105
+ - `schemaVersion`
106
+ - `id`
107
+ - `title`
108
+ - `status`
109
+ - `createdAt`
110
+ - `updatedAt`
111
+ - `objective`
112
+ - `branch`
113
+ - `baseHead`
114
+ - `worktree`
115
+ - `writeScope`
116
+ - `nextActions`
117
+
118
+ Optional but recommended:
119
+
120
+ - `constraints`
121
+ - `currentHead`
122
+ - `risk`
123
+ - `roles`
124
+ - `verification`
125
+ - `tags`
126
+ - `closedAt`
127
+
128
+ ## Statuses
129
+
130
+ Initial statuses:
131
+
132
+ - `active`: current work is in progress in this worktree
133
+ - `parked`: intentionally paused and not the current task
134
+ - `blocked`: waiting on user input, external dependency, or unresolved risk
135
+ - `verifying`: implementation is done, but evidence/review is not complete
136
+ - `completed`: task finished with verification or explicit acceptance
137
+ - `abandoned`: task stopped and should not be resumed without a new decision
138
+
139
+ Default context should show the active passport in full, and show parked or blocked passports only as compact references unless explicitly requested.
140
+
141
+ ## State Transitions
142
+
143
+ Allowed transitions:
144
+
145
+ ```text
146
+ none -> active task start
147
+ active -> parked task park
148
+ parked -> active task switch/resume
149
+ active -> blocked task block
150
+ blocked -> active task unblock/resume
151
+ active -> verifying task verify
152
+ verifying -> active verification found more work
153
+ verifying -> completed verification passed
154
+ active -> completed small/docs task accepted directly
155
+ active -> abandoned task abandon
156
+ parked -> abandoned stale parked task is discarded
157
+ blocked -> abandoned blocked task is discarded
158
+ ```
159
+
160
+ Closed statuses are `completed` and `abandoned`. Closed passports remain inspectable history but should not appear in the default resume unless they are query-relevant.
161
+
162
+ ## CLI Shape
163
+
164
+ Target first CLI surface:
165
+
166
+ ```bash
167
+ agentpack task start "Add source cache cleanup commands" \
168
+ --objective "Let Agentpack remove stale source records safely" \
169
+ --write-scope src/operations.ts \
170
+ --write-scope src/cli/index.ts
171
+
172
+ agentpack task list
173
+ agentpack task passport
174
+ agentpack task switch task_20260518_source_cleanup
175
+ agentpack task audit
176
+ agentpack task park
177
+ agentpack task block --reason "Waiting for API decision"
178
+ agentpack task verify
179
+ agentpack task close
180
+ ```
181
+
182
+ `resume` and MCP `load_context` read the current passport automatically when one exists, then show the broader repo-level ledger below it.
183
+
184
+ `task audit` is a diagnostic pass for continuity risk. It checks the current passport for branch/head drift, missing next actions, open verification, stale source conclusions, and closed-current-task anomalies.
185
+
186
+ ## Role Lanes
187
+
188
+ Roles are coordination lanes inside one passport, not separate tasks.
189
+
190
+ - Scout: read-oriented; records source conclusions, risks, and known unknowns
191
+ - Builder: write-oriented; works inside the declared write scope
192
+ - Reviewer: read-oriented; checks diff, tests, risks, and regression surface
193
+ - Archivist: state-oriented; records evidence, checkpoints, and handoff notes
194
+
195
+ For v1, roles should be metadata and prompts, not a multi-agent runtime. Orchestrators can later map their own workers onto these lanes.
196
+
197
+ ## Consistency Rules
198
+
199
+ Agentpack should warn before work continues when:
200
+
201
+ - the current git branch does not match the passport branch
202
+ - the current git head moved since the last passport update
203
+ - the current worktree path does not match the passport worktree
204
+ - a source conclusion in the current context is changed or missing
205
+ - a new active passport would overlap another open passport's write scope
206
+ - a Builder role attempts changes outside the declared write scope
207
+ - a task is marked completed without evidence or an explicit acceptance note
208
+
209
+ Agentpack should not try to resolve code conflicts. It should point the user toward one of three safe paths:
210
+
211
+ - reuse the current passport
212
+ - park one task before starting another
213
+ - move parallel work into a separate worktree
214
+
215
+ ## Migration
216
+
217
+ Existing v0 packs should remain valid.
218
+
219
+ When task support is introduced, Agentpack can create an initial passport from the current repo-level state:
220
+
221
+ - `goal` becomes `objective`
222
+ - `currentStatus` becomes a summary or active status note
223
+ - `nextActions` copy into the passport
224
+ - existing events remain readable as legacy repo-level events
225
+ - `sources.json` stays repo-level
226
+
227
+ This avoids breaking existing users while moving new work into passport-scoped ledgers.
package/docs/VISION.md ADDED
@@ -0,0 +1,64 @@
1
+ # Vision
2
+
3
+ ## Strategic North Star
4
+
5
+ Agentpack makes agent continuity native to the repo.
6
+
7
+ It is a neutral task passport for agentic workspaces: a compact, portable record of decisions, source conclusions, evidence, dead ends, checkpoints, and next actions that survives chat compaction, client switches, worktree handoffs, machines, branches, and orchestrators.
8
+
9
+ ## Product Bet
10
+
11
+ As agent UIs evolve from chat boxes into execution workspaces, handoffs will become common: chat to worktree, IDE to background agent, local repo to cloud sandbox, Claude to Codex, Cursor to CI.
12
+
13
+ Branches and transcripts are not enough. Agents need reviewed task state that is portable, inspectable, and client-neutral.
14
+
15
+ Codex, Claude Code, Cursor, LangGraph, Temporal, OpenAI Agents SDK, and similar systems can own execution loops, retries, approvals, tool calls, and durable runs. Agentpack should own the neutral repo-scoped continuity layer that those surfaces can share.
16
+
17
+ ## What Agentpack Should Own
18
+
19
+ - repo-native continuity
20
+ - task passports as the handoff artifact
21
+ - semantic checkpoints
22
+ - source-inspection cache
23
+ - dead-end memory
24
+ - evidence-linked handoffs
25
+ - MCP-first access
26
+ - portable bundles between worktrees, machines, and clients
27
+ - orchestrator recipes later
28
+
29
+ ## Task Passport Model
30
+
31
+ A Task Passport is the handoff artifact for one coherent unit of agentic work. It should capture the objective, constraints, write scope, relevant source conclusions, decisions, dead ends, evidence, verification state, checkpoints, and next actions.
32
+
33
+ See [TASK-PASSPORT.md](TASK-PASSPORT.md) for the target schema and state transitions.
34
+
35
+ One active Task Passport should own the work in a repo worktree by default. A repo can keep many closed or parked passports over time, but Agentpack should not turn one working directory into a backlog or a multi-task merge engine.
36
+
37
+ Workstreams are how passports stay separated across repo work, branches, and worktrees. They are for history, parked work, and handoff boundaries, not a substitute for issue tracking or code conflict resolution.
38
+
39
+ Multi-role agents should collaborate inside one Task Passport:
40
+
41
+ - Scout: inspect sources and record source conclusions
42
+ - Builder: make changes inside the declared write scope
43
+ - Reviewer: check the diff, risks, and verification
44
+ - Archivist: record evidence, checkpoints, and handoff state
45
+
46
+ Agentpack should support those role lanes as lightweight prompts, metadata, and consistency checks before it attempts any heavier orchestration.
47
+
48
+ ## Operating Principles
49
+
50
+ - Git stores code state. Agentpack stores reviewed task state.
51
+ - Execution engines run the work. Agentpack preserves what future agents need to continue it.
52
+ - Continuity should be native to the repo, not reconstructed from chat history.
53
+ - One Task Passport owns the current work; multiple roles can contribute to it.
54
+ - Prefer small, inspectable, local files before hosted sync or hidden databases.
55
+ - Prefer portable MCP, CLI, and file surfaces over framework lock-in.
56
+ - Record durable context, not every action.
57
+
58
+ ## Scope Boundaries
59
+
60
+ - Keep the core artifact focused on reviewed task state.
61
+ - Keep backlog, issue tracking, and code merge conflict resolution in the tools that already own them.
62
+ - Keep execution loops, retries, approvals, tool calls, and durable runs in execution engines.
63
+ - Keep the core workflow local-first; hosted sync can remain optional future work.
64
+ - Keep deterministic file, hash, and source summaries as the default before adding embeddings or network calls.