agent-planner-mcp 0.9.1 → 1.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/AGENT_GUIDE.md CHANGED
@@ -1,6 +1,6 @@
1
- # AgentPlanner Quick Reference (v0.9.0)
1
+ # AgentPlanner Quick Reference (v1.0.0)
2
2
 
3
- Tight cheat sheet for AI agents. Full docs: [SKILL.md](SKILL.md). Migration from 0.8.x: [docs/MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md).
3
+ Tight cheat sheet for AI agents. Full docs: [SKILL.md](SKILL.md). Migration history: [docs/MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md), [docs/MIGRATION_v1.0.md](docs/MIGRATION_v1.0.md).
4
4
 
5
5
  ## Start here
6
6
 
@@ -9,7 +9,7 @@ get_started()
9
9
  // → Returns the BDI tool surface map and recommended workflows
10
10
  ```
11
11
 
12
- ## The 15 tools
12
+ ## The 24 tools
13
13
 
14
14
  ### Beliefs (read state)
15
15
  | Tool | When |
@@ -26,24 +26,66 @@ get_started()
26
26
  |---|---|
27
27
  | `list_goals` | Goal list with health summary |
28
28
  | `update_goal` | Atomic goal change (subsumes link/unlink/achievers) |
29
+ | `derive_subgoal` | Propose a sub-goal under an existing parent (top-level goals stay UI-only) |
29
30
 
30
- ### Intentions (act)
31
+ ### Intentions — execution
31
32
  | Tool | When |
32
33
  |---|---|
33
34
  | `claim_next_task` | Pick + claim + load context (one call) |
34
35
  | `update_task` | Atomic status+log+release+learning |
35
36
  | `release_task` | Explicit handoff |
36
- | `queue_decision` | Escalate to human |
37
+ | `queue_decision` | Escalate to human (real decision queue) |
37
38
  | `resolve_decision` | Pick up human's answer |
38
39
  | `add_learning` | Write to knowledge graph |
39
40
 
40
- ## Three workflow templates
41
+ ### Intentions creation (v1.0)
42
+ | Tool | When |
43
+ |---|---|
44
+ | `form_intention` | Create plan + initial tree under a goal, atomically |
45
+ | `extend_intention` | Add children under existing parent (lightweight, no queue) |
46
+ | `propose_research_chain` | RPI triple with 2 blocking edges in one call |
47
+
48
+ ### Intentions — structural mutation (v1.0)
49
+ | Tool | When |
50
+ |---|---|
51
+ | `update_plan` | Edit plan title/description/status/visibility/metadata |
52
+ | `update_node` | Edit any node property except status |
53
+ | `move_node` | Reparent within plan; cycle-safe |
54
+ | `link_intentions` | Create dependency edge between two tasks |
55
+ | `unlink_intentions` | Remove a dependency edge |
56
+ | `delete_plan` | Soft-delete via status='archived' |
57
+ | `delete_node` | Soft-delete via status='archived' |
58
+
59
+ ### Intentions — sharing & collaboration (v1.0)
60
+ | Tool | When |
61
+ |---|---|
62
+ | `share_plan` | Atomic visibility change + add/remove collaborators |
63
+ | `invite_member` | Add user to organization |
64
+ | `update_member_role` | Owner-only role change |
65
+ | `remove_member` | Owner/admin removes non-owner member |
66
+
67
+ ## status='active' vs status='draft' (v1.0)
68
+
69
+ The single most important decision when calling a creation tool.
70
+
71
+ | Origin | Default | Why |
72
+ |---|---|---|
73
+ | **Human said so in chat** | `status='active'` (omit) | User already approved by asking. Don't bury their request in drafts. |
74
+ | **You're acting autonomously** | `status='draft'` (pass explicitly) | Let the human review before it activates. Drafts surface in the dashboard pending queue. |
75
+ | **You're uncertain** | use `queue_decision` instead | Drafts are for "I'm proposing structure"; the queue is for "I need an answer." |
76
+
77
+ Drafts auto-promote to active when work begins on any node (transitions to `in_progress`, `completed`, `blocked`, `plan_ready`). Promote explicitly via `update_plan({status: 'active'})` or `update_goal({status: 'active'})`.
78
+
79
+ ## Workflow templates
41
80
 
42
81
  ### A) Mission control (Cowork autopilot)
43
82
  ```
44
83
  briefing → check goal_health.summary
45
84
  → top_recommendation? act
46
- → at_risk goals? goal_state(goal_id), then update_task or queue_decision
85
+ → at_risk goals? goal_state(goal_id)
86
+ → if you can plan it: derive_subgoal + form_intention (status='draft')
87
+ → if reversible: update_task or update_goal
88
+ → if uncertain: queue_decision
47
89
  → add_learning to record
48
90
  ```
49
91
 
@@ -63,22 +105,43 @@ update_task(...) for transitions
63
105
  release_task(message='handoff') for explicit handover
64
106
  ```
65
107
 
108
+ ### D) Human-directed restructure (v1.0)
109
+ User: "Rename the launch plan to 'Public Beta', mark it active, and add me as editor on the auth plan."
110
+ ```
111
+ update_plan({plan_id: '<launch>', title: 'Public Beta', status: 'active'})
112
+ share_plan({plan_id: '<auth>', add_collaborators: [{user_id: '<user>', role: 'editor'}]})
113
+ ```
114
+ No UI required.
115
+
116
+ ### E) Autonomous proposal (v1.0)
117
+ You spotted a gap during a scheduled tick.
118
+ ```
119
+ derive_subgoal({parent_goal_id, title, rationale, status: 'draft'})
120
+ form_intention({goal_id: <new>, title, rationale, status: 'draft', tree: [...]})
121
+ // Both surface in the dashboard pending queue. Human reviews and either:
122
+ // - tells you "approve them" → update_goal/update_plan({status: 'active'}) for each
123
+ // - tells you "archive" → update_plan({status: 'archived'}) for each
124
+ ```
125
+
66
126
  ## Decision rule
67
127
 
68
128
  When in doubt between act and queue:
69
- - Reversible local action (status, log, learning) → **act** via `update_task` / `add_learning`
129
+ - Reversible local action (status, log, learning, edit, decompose) → **act** via `update_task`, `update_node`, `extend_intention`, `add_learning`
70
130
  - External cost, public publish, strategy change, customer comm → **queue** via `queue_decision`
131
+ - Whole new direction or sub-goal you weren't asked for → propose as **draft** via `form_intention` / `derive_subgoal` with `status='draft'`
71
132
 
72
- Never use `add_learning(entry_type='decision')` to fake a decision queue. `queue_decision` is a real tool now.
133
+ Never use `add_learning(entry_type='decision')` to fake a decision queue. `queue_decision` is the real tool.
73
134
 
74
135
  ## Atomic patterns to remember
75
136
 
76
137
  - `update_task` does status + log + claim release + learning in one call. Don't decompose.
77
138
  - `claim_next_task` does suggest + claim + context. Don't decompose.
78
139
  - `briefing` does goals + decisions + tasks + activity + recommendation. Don't decompose.
140
+ - `form_intention` creates plan + tree atomically. Don't trickle node-by-node.
141
+ - `share_plan` does visibility + add + remove in one call. Don't fan out.
79
142
 
80
143
  ## Output discipline
81
144
 
82
145
  - Every response carries `as_of` — surface this on live artifacts to indicate freshness.
83
- - Every tool degrades gracefully on partial upstream failure — check `meta.failures` if present.
146
+ - Every tool degrades gracefully on partial upstream failure — check `failures[]` if present.
84
147
  - Keep follow-up calls minimal — these tools are designed to bundle.
package/README.md CHANGED
@@ -123,6 +123,28 @@ Beyond title, description, agent_instructions, and acceptance criteria, the gene
123
123
 
124
124
  The CLI is intentionally thin: it covers the read context + writeback loop and nothing else. For decomposition, dependency creation, knowledge graph queries, RPI chains, coherence runs, and goal management, use the MCP server (or the API directly).
125
125
 
126
+ ## Agent Loop Facade
127
+
128
+ AgentPlanner API now exposes a narrow `/agent/*` facade for the main autonomous loop. MCP uses this facade when available and falls back to older domain endpoints for self-hosted older APIs.
129
+
130
+ Primary mappings:
131
+
132
+ | MCP tool | Preferred API endpoint |
133
+ |---|---|
134
+ | `briefing` | `GET /agent/briefing` |
135
+ | `claim_next_task` | `POST /agent/work-sessions` |
136
+ | `update_task` with `session_id` + `completed` | `POST /agent/work-sessions/:id/complete` |
137
+ | `update_task` with `session_id` + `blocked` | `POST /agent/work-sessions/:id/block` |
138
+ | `form_intention` | `POST /agent/intentions` when available, with domain-endpoint fallback |
139
+
140
+ Validation:
141
+
142
+ ```bash
143
+ npm run validate:mcp-loop
144
+ ```
145
+
146
+ This checks that the MCP tools route through the facade for briefing, task claim/start, and session completion/blocking.
147
+
126
148
 
127
149
  ### Claude Desktop
128
150
 
@@ -210,59 +232,61 @@ Add the same JSON config to your Cline MCP settings in VS Code.
210
232
 
211
233
  ## Key Features
212
234
 
213
- - **60+ tools** for planning, task management, dependencies, and knowledge
214
- - **Dependency graph** with cycle detection, impact analysis, and critical path
235
+ - **24 BDI-aligned tools** for state, goals, and committed actions — no CRUD shapes, every tool answers a whole agentic question
236
+ - **Full mutation surface (v1.0)** agents and humans-via-agents can manage every plan/node/org property without leaving the conversation; UI is optional inspection
237
+ - **Draft-status seam** — autonomous agent creation lands as drafts surfacing in the dashboard pending queue; human-directed creation defaults to active
238
+ - **Dependency graph** — cycle detection, impact analysis, critical path
215
239
  - **Progressive context** — 4-layer context assembly with token budgeting
216
240
  - **Knowledge graph** — temporal knowledge via Graphiti (entities, facts, contradictions)
217
- - **RPI chains** — Research > Plan > Implement task decomposition
218
- - **Goal tracking** — health dashboard, briefings, bottleneck detection
241
+ - **RPI chains** — Research Plan Implement task decomposition (one-call shortcut)
219
242
  - **Task claims** — TTL-based locking for multi-agent coordination
220
- - **Organizations** — multi-tenant isolation
221
-
222
- ## Available Tools
223
-
224
- ### Planning & Search
225
- - `search` - Universal search across all scopes with filters
226
- - `create_plan` / `update_plan` / `delete_plan` - Plan CRUD
227
- - `get_plan_structure` - Hierarchical plan tree
228
- - `get_plan_summary` - Statistics and summary
229
-
230
- ### Node Management
231
- - `create_node` / `update_node` / `delete_node` - Node CRUD
232
- - `move_node` - Reorder or reparent nodes
233
- - `batch_update_nodes` - Update multiple nodes at once
234
- - `get_node_context` / `get_node_ancestry` - Rich context
235
-
236
- ### Dependencies & Analysis
237
- - `create_dependency` / `delete_dependency` - Manage edges
238
- - `list_dependencies` / `get_node_dependencies` - Query graph
239
- - `analyze_impact` - Delay/block/remove scenario analysis
240
- - `get_critical_path` - Longest blocking chain
241
- - `create_rpi_chain` - Research > Plan > Implement chain
242
-
243
- ### Progressive Context
244
- - `get_task_context` - Primary context tool (depth 1-4, token budget)
245
- - `suggest_next_tasks` - Dependency-aware suggestions
246
- - `get_agent_context` / `get_plan_context` - Focused views
247
-
248
- ### Knowledge Graph
249
- - `add_learning` / `recall_knowledge` - Learn and retrieve
250
- - `find_entities` / `check_contradictions` - Graph queries
251
- - `get_recent_episodes` - Temporal episodes
252
-
253
- ### Goals & Organizations
254
- - `create_goal` / `update_goal` / `list_goals` / `get_goal` - Goal management
255
- - `check_goals_health` - Health dashboard
256
- - `create_organization` / `get_organization` / `list_organizations` / `update_organization`
257
-
258
- ### Collaboration
259
- - `add_log` / `get_logs` - Log entries (comments, progress, reasoning)
260
- - `claim_task` / `release_task` - Task locking
261
- - `share_plan` - Collaboration management
262
-
263
- ### Alignment & Review
264
- - `check_coherence_pending` - See which plans/goals need alignment review (staleness check)
265
- - `run_coherence_check` - Evaluate plan quality and stamp as reviewed
243
+ - **Organizations** — multi-tenant isolation with member management
244
+
245
+ ## Available Tools (v1.0.0)
246
+
247
+ ### Beliefs (read state)
248
+ - `briefing` bundled mission control state in one call
249
+ - `task_context` single task at progressive depth 1-4
250
+ - `goal_state` — single goal deep-dive (details + quality + progress + bottlenecks + gaps)
251
+ - `recall_knowledge` knowledge graph query (facts, entities, episodes, contradictions)
252
+ - `search` — text search across plans/nodes
253
+ - `plan_analysis` — impact, critical path, bottlenecks, coherence
254
+
255
+ ### Desires (goals)
256
+ - `list_goals` goals with health rollup
257
+ - `update_goal` atomic goal update (subsumes link/unlink/achievers)
258
+ - `derive_subgoal` *(v1.0)* — propose a sub-goal under an existing parent
259
+
260
+ ### Intentions execution
261
+ - `claim_next_task` pick + claim + load context (one call)
262
+ - `update_task` atomic status + log + claim release + learning
263
+ - `release_task` explicit handoff
264
+ - `queue_decision` escalate to human (real decision queue)
265
+ - `resolve_decision` — pick up human's answer (atomically materializes any `proposed_subtasks`)
266
+ - `add_learning` — record knowledge episode
267
+
268
+ ### Intentions creation *(v1.0)*
269
+ - `form_intention` create plan + initial tree under a goal, atomically
270
+ - `extend_intention` — add children under an existing parent (lightweight)
271
+ - `propose_research_chain` — RPI triple with 2 blocking edges, in one call
272
+
273
+ ### Intentions structural mutation *(v1.0)*
274
+ - `update_plan` edit any plan property
275
+ - `update_node` — edit any node property except status
276
+ - `move_node` reparent within plan; cycle-safe
277
+ - `link_intentions` / `unlink_intentions` manage dependency edges
278
+ - `delete_plan` / `delete_node` — soft-delete via `status='archived'` (recoverable)
279
+
280
+ ### Intentions — sharing & collaboration *(v1.0)*
281
+ - `share_plan` — atomic visibility + add/remove collaborators
282
+ - `invite_member` add user to org (by user_id or email)
283
+ - `update_member_role` owner-only role change
284
+ - `remove_member` — owner/admin removes non-owner member
285
+
286
+ ### Utility
287
+ - `get_started` dynamic reference for new agents
288
+
289
+ See [SKILL.md](./SKILL.md) for full descriptions, the human-steering scenarios (A/B/C), and `status='draft'` vs `status='active'` guidance.
266
290
 
267
291
  ## LLM Skill Reference
268
292
 
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: agentplanner
3
- description: "Agent orchestration skill for AgentPlanner — BDI-aligned tools for state, goals, and committed actions with human oversight"
4
- version: 0.9.0
3
+ description: "Agent orchestration skill for AgentPlanner — BDI-aligned tools for state, goals, committed actions, and full mutation surface with human oversight"
4
+ version: 1.0.0
5
5
  homepage: https://agentplanner.io
6
6
  metadata:
7
7
  openclaw:
@@ -15,7 +15,7 @@ metadata:
15
15
 
16
16
  You have access to the AgentPlanner MCP tools. AgentPlanner is a collaborative planning system where you track work, manage dependencies, and coordinate with humans. This document is your complete reference.
17
17
 
18
- > **Prerequisite:** This skill requires the `agent-planner-mcp` MCP server (v0.9.0+) to be connected. Create an API token at Settings → API Tokens on [agentplanner.io](https://agentplanner.io).
18
+ > **Prerequisite:** This skill requires the `agent-planner-mcp` MCP server (v1.0.0+) to be connected. Create an API token at Settings → API Tokens on [agentplanner.io](https://agentplanner.io).
19
19
  >
20
20
  > **Setup by client:**
21
21
  > - **Claude Desktop:** Download the [.mcpb](https://github.com/TAgents/agent-planner-mcp/releases/latest), double-click to install
@@ -23,9 +23,9 @@ You have access to the AgentPlanner MCP tools. AgentPlanner is a collaborative p
23
23
  > - **Cursor / VS Code:** Add `npx agent-planner-mcp` to your MCP config with env vars `API_URL` and `USER_API_TOKEN`
24
24
  > - **ChatGPT:** HTTP endpoint at `https://agentplanner.io/mcp`
25
25
 
26
- ## The 15 tools, organized by intent
26
+ ## The 24 tools, organized by intent
27
27
 
28
- AgentPlanner exposes a **BDI-aligned** surface — Beliefs (state queries), Desires (goal management), Intentions (committed actions). Each tool answers one whole agentic question and returns an `as_of` ISO 8601 timestamp.
28
+ AgentPlanner exposes a **BDI-aligned** surface — Beliefs (state queries), Desires (goal management), Intentions (committed actions). Each tool answers one whole agentic question and returns an `as_of` ISO 8601 timestamp. v1.0.0 completes the mutation surface so humans can steer entirely through agent conversation — no UI required for normal operations.
29
29
 
30
30
  ### Beliefs — what is the state of the world?
31
31
 
@@ -40,9 +40,11 @@ AgentPlanner exposes a **BDI-aligned** surface — Beliefs (state queries), Desi
40
40
 
41
41
  - `list_goals` — goals with health rollup (`{ on_track, at_risk, stale, total }`)
42
42
  - `update_goal` — atomic goal update; subsumes link/unlink + achiever changes
43
+ - `derive_subgoal` *(v1.0)* — propose a sub-goal under an existing parent. Top-level goal creation stays UI-only.
43
44
 
44
45
  ### Intentions — what am I committing to?
45
46
 
47
+ **Execution (existing in v0.9):**
46
48
  - `claim_next_task` — pick + claim + load context in one call (cornerstone for coding agents)
47
49
  - `update_task` — atomic state transition (status + log + claim release + optional learning)
48
50
  - `release_task` — explicit handoff
@@ -50,6 +52,26 @@ AgentPlanner exposes a **BDI-aligned** surface — Beliefs (state queries), Desi
50
52
  - `resolve_decision` — pick up after human approval/deferral
51
53
  - `add_learning` — record a knowledge episode for future recall
52
54
 
55
+ **Creation (v1.0):**
56
+ - `form_intention` — create a plan + initial phase/task tree under a goal, atomically
57
+ - `extend_intention` — add children under an existing phase or task (lightweight, no decision-queue gate)
58
+ - `propose_research_chain` — Research → Plan → Implement triple with two blocking edges, in one call
59
+
60
+ **Structural mutation (v1.0):**
61
+ - `update_plan` — edit any plan property (title, description, status, visibility, metadata)
62
+ - `update_node` — edit any node property except status (status routes through `update_task`)
63
+ - `move_node` — reparent within the same plan; cycle-safe
64
+ - `link_intentions` — create a dependency edge between two existing tasks
65
+ - `unlink_intentions` — remove a dependency edge by id
66
+ - `delete_plan` — soft-delete via `status='archived'`; recoverable
67
+ - `delete_node` — soft-delete via `status='archived'`
68
+
69
+ **Sharing and collaboration (v1.0):**
70
+ - `share_plan` — atomic visibility change + add/remove collaborators
71
+ - `invite_member` — add user to organization (by user_id or email)
72
+ - `update_member_role` — owner-only role change within an org
73
+ - `remove_member` — owner/admin can remove non-owner members
74
+
53
75
  ### Utility
54
76
 
55
77
  - `get_started` — dynamic reference; call this if you're new to AgentPlanner
@@ -107,7 +129,7 @@ claim_next_task({ scope: { plan_id } }) // dry_run defaults to false
107
129
 
108
130
  ### Proposing subtasks for human approval (v0.9.1+)
109
131
 
110
- Agents can't create plan structure directly that's the human's job. But agents *can* propose subtasks via `queue_decision` and have them materialize on approval. This preserves the "agents drive execution, humans steer structure" boundary while removing the manual follow-through tax.
132
+ For high-touch proposals (entire new directions, structural changes the human should review before they materialize), use `queue_decision` with `proposed_subtasks` tasks only get created on `resolve_decision({action: 'approve'})`.
111
133
 
112
134
  ```
113
135
  queue_decision({
@@ -125,6 +147,100 @@ queue_decision({
125
147
  // and their IDs returned in created_subtasks[]. Defer/reject does nothing.
126
148
  ```
127
149
 
150
+ For routine decomposition (a task you're working on needs subtasks), use `extend_intention` directly — no decision queue, no friction.
151
+
152
+ ## The human-steering loop (v1.0)
153
+
154
+ v1.0 closes the creation gap. There are three distinct flows depending on who initiated the action:
155
+
156
+ ### Scenario A: Human directs you in conversation
157
+
158
+ User says "create a plan to ship the new auth flow under the security goal" or "mark the BSL launch plan completed."
159
+
160
+ Default to **`status='active'`** — the human asked for it, just do it.
161
+
162
+ ```
163
+ form_intention({
164
+ goal_id: '<security-goal-id>',
165
+ title: 'Ship new auth flow',
166
+ rationale: 'User-requested plan to migrate auth to passkeys',
167
+ tree: [
168
+ { node_type: 'phase', title: 'Discovery', children: [...] },
169
+ { node_type: 'phase', title: 'Implementation', children: [...] },
170
+ ]
171
+ })
172
+ // Plan lands as active. No approval needed — user already approved by asking.
173
+ ```
174
+
175
+ ```
176
+ update_plan({ plan_id: '<bsl-plan>', status: 'completed' })
177
+ // Done. No queue, no UI trip.
178
+ ```
179
+
180
+ ### Scenario B: You're acting autonomously (scheduled loop, etc.)
181
+
182
+ No explicit human direction. You decided the workspace needs new structure.
183
+
184
+ Pass **`status='draft'`** — let the human see what you proposed before it activates.
185
+
186
+ ```
187
+ derive_subgoal({
188
+ parent_goal_id: '<launch-goal>',
189
+ title: 'First 3 paying customers',
190
+ rationale: 'Goal is at_risk — need a concrete intermediate target before broader push',
191
+ status: 'draft',
192
+ })
193
+ // Surfaces in dashboard pending. Human approves via update_goal({status: 'active'})
194
+ // or in the UI. Plans auto-promote to active when first task moves to in_progress.
195
+ ```
196
+
197
+ ### Scenario C: You're uncertain and want explicit input
198
+
199
+ Genuine ambiguity. Use `queue_decision`.
200
+
201
+ ```
202
+ queue_decision({
203
+ title: 'Two conflicting facts about pricing',
204
+ context: 'Memory says $19/mo Pro tier; recent decision log says $29/mo. Which is current?',
205
+ smallest_input_needed: 'pick one',
206
+ options: [{ label: '$19' }, { label: '$29' }],
207
+ urgency: 'normal',
208
+ })
209
+ ```
210
+
211
+ The decision queue is for genuine uncertainty, not as a default gate on everything you do.
212
+
213
+ ## Editing structure (v1.0)
214
+
215
+ These are routine — call them whenever needed. No decision-queue ceremony.
216
+
217
+ | Want to... | Call |
218
+ |---|---|
219
+ | Rename a plan | `update_plan({plan_id, title})` |
220
+ | Rename a task | `update_node({node_id, title})` |
221
+ | Edit task instructions | `update_node({node_id, agent_instructions})` |
222
+ | Move a task under a different phase | `move_node({node_id, new_parent_id})` |
223
+ | Express B blocks A | `link_intentions({from_task_id: A, to_task_id: B, relation: 'blocks', rationale: '...'})` |
224
+ | Remove a stale dep | `unlink_intentions({dependency_id, plan_id})` |
225
+ | Archive a plan | `delete_plan({plan_id, reason})` |
226
+ | Archive a task | `delete_node({node_id})` |
227
+ | Restore an archived plan | `update_plan({plan_id, status: 'active', restore: true})` |
228
+
229
+ `delete_*` is soft delete (sets `status='archived'`) — fully recoverable. Hard delete stays REST + admin-only on purpose; agents shouldn't be able to permanently destroy data.
230
+
231
+ ## Sharing and collaboration (v1.0)
232
+
233
+ | Want to... | Call |
234
+ |---|---|
235
+ | Make a plan public | `share_plan({plan_id, visibility: 'public'})` |
236
+ | Add a collaborator (by user_id) | `share_plan({plan_id, add_collaborators: [{user_id, role: 'editor'}]})` |
237
+ | Remove a collaborator | `share_plan({plan_id, remove_collaborators: [user_id]})` |
238
+ | Invite someone to the org | `invite_member({organization_id, email})` (or by `user_id`) |
239
+ | Promote member to admin | `update_member_role({organization_id, membership_id, new_role: 'admin'})` |
240
+ | Remove a member | `remove_member({organization_id, membership_id, reason})` |
241
+
242
+ Email-based collaborator invites stay UI-only; `share_plan` accepts user_ids only. The dedicated `invite_member` call accepts email for org-level invites.
243
+
128
244
  ## Goal coaching
129
245
 
130
246
  When a user expresses intent — "I want to launch a feature", "we need better testing" — coach them into a structured goal before creating it.
@@ -190,18 +306,10 @@ recall_knowledge({
190
306
 
191
307
  `result_kind` options: `'facts'`, `'entities'`, `'episodes'`, `'all'`. Default is `'all'` — narrow it to control payload size.
192
308
 
193
- ## Migrating from v0.8.x
194
-
195
- v0.9.0 is a breaking release. The old 63-tool surface is gone. See [MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md) for the full mapping. Highlights:
196
-
197
- - `check_goals_health` + `get_my_tasks` + `get_recent_episodes` + `check_coherence_pending` → `briefing`
198
- - `quick_status` + `add_log` + `release_task` → `update_task`
199
- - `suggest_next_tasks` + `claim_task` + `get_task_context` → `claim_next_task`
200
- - `add_learning(entry_type='decision')` → `queue_decision` (real decision queue, not knowledge graph)
201
- - `get_goal` + `goal_path` + `goal_progress` + `assess_goal_quality` → `goal_state`
202
- - `recall_knowledge` + `find_entities` + `get_recent_episodes` + `check_contradictions` → `recall_knowledge`
309
+ ## Migration history
203
310
 
204
- CRUD-shaped admin tools (`create_node`, `update_plan`, `delete_*`) are removed in v0.9.0. They return as `ap_admin_*` namespace in v1.0.0. Use the AgentPlanner REST API directly if you need them now.
311
+ - **v0.8.x v0.9.0** clean break. 63 legacy CRUD tools collapsed into 15 BDI-aligned tools. See [docs/MIGRATION_v0.9.md](docs/MIGRATION_v0.9.md) for the full mapping.
312
+ - **v0.9.x → v1.0.0** — additive. v0.9 read/update tools unchanged. Adds the full mutation surface (creation, structural edits, sharing, collaboration) so humans can steer entirely through agent conversation. The previously planned `ap_admin_*` namespace is no longer needed — those operations are now first-class BDI tools, with the draft-status seam keeping autonomous agent creation reviewable. See [docs/MIGRATION_v1.0.md](docs/MIGRATION_v1.0.md).
205
313
 
206
314
  ## Principles
207
315
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-planner-mcp",
3
- "version": "0.9.1",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for AgentPlanner — AI agent orchestration with planning, dependencies, knowledge graphs, and human oversight",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -12,6 +12,7 @@
12
12
  "dev": "nodemon src/index.js",
13
13
  "dev:http": "MCP_TRANSPORT=http nodemon src/index.js",
14
14
  "test": "jest",
15
+ "validate:mcp-loop": "jest __tests__/agent-loop-facade.test.js --runInBand",
15
16
  "test:tools": "node test-tools.js",
16
17
  "setup": "node src/setup.js",
17
18
  "setup-claude-code": "node src/setup-claude-code.js",
package/src/api-client.js CHANGED
@@ -17,12 +17,29 @@ const getAuthScheme = (token) => {
17
17
 
18
18
  const authScheme = getAuthScheme(userApiToken);
19
19
 
20
+ // Identify this caller in the API server's tool_calls telemetry.
21
+ // Setup wizards (per client) should set MCP_CLIENT_LABEL to one of
22
+ // "Claude Desktop" | "Claude Code" | "Cursor" | "ChatGPT" | "OpenClaw"
23
+ // so the Settings → Integrations dashboard can group calls per client.
24
+ let pkgVersion;
25
+ try { pkgVersion = require('../package.json').version; } catch { pkgVersion = '0.0.0'; }
26
+ const clientLabel = process.env.MCP_CLIENT_LABEL || null;
27
+ const userAgent = clientLabel
28
+ ? `agent-planner-mcp/${pkgVersion} (${clientLabel})`
29
+ : `agent-planner-mcp/${pkgVersion}`;
30
+
20
31
  // Create API client instance
21
32
  const apiClient = axios.create({
22
33
  baseURL: process.env.API_URL || 'http://localhost:3000',
23
34
  headers: {
24
35
  'Content-Type': 'application/json',
25
- 'Authorization': userApiToken ? `${authScheme} ${userApiToken}` : undefined
36
+ 'Authorization': userApiToken ? `${authScheme} ${userApiToken}` : undefined,
37
+ 'User-Agent': userAgent,
38
+ // X-Client-Label takes precedence on the API side (see
39
+ // toolCallTelemetry.middleware) so MCP setup wizards can label
40
+ // calls precisely without polluting the User-Agent string.
41
+ ...(clientLabel ? { 'X-Client-Label': clientLabel } : {}),
42
+ 'X-MCP-Client': clientLabel || 'unknown',
26
43
  }
27
44
  });
28
45
 
@@ -738,6 +755,15 @@ const users = {
738
755
  },
739
756
  };
740
757
 
758
+ // ─── Agent Loop facade ────────────────────────────────────────
759
+ const agentLoop = {
760
+ briefing: async (params = {}) => (await apiClient.get('/agent/briefing', { params })).data,
761
+ startWorkSession: async (data = {}) => (await apiClient.post('/agent/work-sessions', data)).data,
762
+ completeWorkSession: async (sessionId, data = {}) => (await apiClient.post(`/agent/work-sessions/${sessionId}/complete`, data)).data,
763
+ blockWorkSession: async (sessionId, data = {}) => (await apiClient.post(`/agent/work-sessions/${sessionId}/block`, data)).data,
764
+ createIntention: async (data = {}) => (await apiClient.post('/agent/intentions', data)).data,
765
+ };
766
+
741
767
  // ─── Dependencies (cross-plan & external) ─────────────────────
742
768
  const dependencies = {
743
769
  /**
@@ -778,11 +804,21 @@ const dependencies = {
778
804
  */
779
805
  function createApiClient(token, options = {}) {
780
806
  const scheme = getAuthScheme(token);
807
+ // Telemetry headers — same shape as the default client. options.clientLabel
808
+ // wins over the global env var so HTTP-mode sessions can label themselves
809
+ // per connection (e.g. when the SSE handshake reveals the client).
810
+ const sessionLabel = options.clientLabel || process.env.MCP_CLIENT_LABEL || null;
811
+ const sessionUserAgent = sessionLabel
812
+ ? `agent-planner-mcp/${pkgVersion} (${sessionLabel})`
813
+ : `agent-planner-mcp/${pkgVersion}`;
781
814
  const client = axios.create({
782
815
  baseURL: options.apiUrl || process.env.API_URL || 'http://localhost:3000',
783
816
  headers: {
784
817
  'Content-Type': 'application/json',
785
- 'Authorization': token ? `${scheme} ${token}` : undefined
818
+ 'Authorization': token ? `${scheme} ${token}` : undefined,
819
+ 'User-Agent': sessionUserAgent,
820
+ ...(sessionLabel ? { 'X-Client-Label': sessionLabel } : {}),
821
+ 'X-MCP-Client': sessionLabel || 'unknown',
786
822
  }
787
823
  });
788
824
 
@@ -945,6 +981,13 @@ function createApiClient(token, options = {}) {
945
981
  return (await client.get(`/users/my-tasks${qs}`)).data;
946
982
  },
947
983
  },
984
+ agentLoop: {
985
+ briefing: async (params = {}) => (await client.get('/agent/briefing', { params })).data,
986
+ startWorkSession: async (data = {}) => (await client.post('/agent/work-sessions', data)).data,
987
+ completeWorkSession: async (sessionId, data = {}) => (await client.post(`/agent/work-sessions/${sessionId}/complete`, data)).data,
988
+ blockWorkSession: async (sessionId, data = {}) => (await client.post(`/agent/work-sessions/${sessionId}/block`, data)).data,
989
+ createIntention: async (data = {}) => (await client.post('/agent/intentions', data)).data,
990
+ },
948
991
  axiosInstance: client,
949
992
  };
950
993
  }
@@ -975,6 +1018,7 @@ module.exports = {
975
1018
  dependencies,
976
1019
  coherence,
977
1020
  users,
1021
+ agentLoop,
978
1022
  axiosInstance, // Export for direct API calls
979
1023
  createApiClient // Factory for per-session clients (HTTP mode)
980
1024
  };
package/src/setup.js CHANGED
@@ -158,13 +158,16 @@ function updateClaudeConfig(configPath, mcpServerPath, apiUrl, token) {
158
158
  config.mcpServers = {};
159
159
  }
160
160
 
161
- // Add or update planning-system server
161
+ // Add or update planning-system server.
162
+ // MCP_CLIENT_LABEL identifies this install in the Settings →
163
+ // Integrations dashboard's tool_calls telemetry stream.
162
164
  config.mcpServers['planning-system'] = {
163
165
  command: 'node',
164
166
  args: [path.join(mcpServerPath, 'src', 'index.js')],
165
167
  env: {
166
168
  API_URL: apiUrl,
167
- USER_API_TOKEN: token
169
+ USER_API_TOKEN: token,
170
+ MCP_CLIENT_LABEL: 'Claude Desktop'
168
171
  }
169
172
  };
170
173