agent-planner-mcp 1.5.17 → 1.5.19
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/SKILL.md +20 -0
- package/package.json +1 -1
- package/src/index.js +5 -1
- package/src/server-http.js +4 -1
- package/src/server-instructions.js +26 -0
- package/src/tools/bdi/beliefs.js +2 -1
- package/src/tools/bdi/intentions.js +14 -8
- package/src/tools/bdi/utility.js +17 -9
package/SKILL.md
CHANGED
|
@@ -337,6 +337,26 @@ recall_knowledge({
|
|
|
337
337
|
- **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.
|
|
338
338
|
- **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).
|
|
339
339
|
|
|
340
|
+
## UI vocabulary → data model → tools
|
|
341
|
+
|
|
342
|
+
The web UI (agentplanner.io) and these tools are the same system in two languages. When a human refers to something they see on a screen, map it here:
|
|
343
|
+
|
|
344
|
+
| UI term | What it is | Tools |
|
|
345
|
+
|---|---|---|
|
|
346
|
+
| **Workspace** | Org-scoped folder that owns goals + plans | `list_workspaces`, `create_workspace` |
|
|
347
|
+
| **Blueprint** | Dehydrated, reusable plan shape; forks into a workspace | `list_blueprints`, `save_as_blueprint`, `fork_blueprint`, `delete_blueprint` |
|
|
348
|
+
| **Mission / Mission Control** | Home overview: goal health, decision queue, activity | `briefing` |
|
|
349
|
+
| **Goal** (a *Desire*) | What you're pursuing | `create_goal`, `derive_subgoal`, `list_goals`, `goal_state`, `update_goal` |
|
|
350
|
+
| **Plan** (an *Intention*) | Committed plan of action that achieves a goal | `form_intention` (create), `extend_intention` (add nodes), `update_plan`, `update_node`, `move_node` |
|
|
351
|
+
| **Knowledge / episode** (a *Belief*) | Facts the agents have learned | `add_learning`, `recall_knowledge` |
|
|
352
|
+
| **Health** | Per-goal `on_track` / `at_risk` / `stale` | `briefing`, `list_goals`, `goal_state` |
|
|
353
|
+
| **Tension / Contradiction** | A coherence conflict — new knowledge contradicts existing facts or tasks (UI "Tensions" card) | `plan_analysis` (coherence), `recall_knowledge` (current vs superseded facts) |
|
|
354
|
+
| **Decision queue / "Awaiting you"** | Human approvals pending | `queue_decision`, `resolve_decision` |
|
|
355
|
+
| **Committed vs Proposed** | A goal is *committed* once promoted (`promoted_at` set), *proposed* before | `update_goal({ committed })` |
|
|
356
|
+
| **Attainment vs Execution** | *Attainment* = success criteria met; *Execution* = tasks completed. Distinct numbers. | `record_criterion_progress` (attainment), `update_task` (execution) |
|
|
357
|
+
| **Critical path / Bottlenecks** | Longest blocking chain / high-fan-out incomplete tasks | `plan_analysis` |
|
|
358
|
+
| **RPI chain** | Research → Plan → Implement decomposition | `propose_research_chain` |
|
|
359
|
+
|
|
340
360
|
## Principles
|
|
341
361
|
|
|
342
362
|
- Tools are intent-shaped, not CRUD-shaped — name what you want to accomplish, not which row to mutate
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
|
3
3
|
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
4
4
|
const { MCPHTTPServer } = require('./server-http');
|
|
5
5
|
const { setupTools } = require('./tools');
|
|
6
|
+
const { SERVER_INSTRUCTIONS } = require('./server-instructions');
|
|
6
7
|
const { version } = require('../package.json');
|
|
7
8
|
require('dotenv').config();
|
|
8
9
|
|
|
@@ -77,7 +78,10 @@ async function main() {
|
|
|
77
78
|
}, {
|
|
78
79
|
capabilities: {
|
|
79
80
|
tools: {}
|
|
80
|
-
}
|
|
81
|
+
},
|
|
82
|
+
// Shown to the model on connect — the no-skill safety net mapping plain
|
|
83
|
+
// intents to the BDI tool names + pointing at get_started.
|
|
84
|
+
instructions: SERVER_INSTRUCTIONS
|
|
81
85
|
});
|
|
82
86
|
|
|
83
87
|
console.error('MCP Server created');
|
package/src/server-http.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
const express = require('express');
|
|
16
16
|
const { SessionManager } = require('./session-manager');
|
|
17
17
|
const { setupTools } = require('./tools');
|
|
18
|
+
const { SERVER_INSTRUCTIONS } = require('./server-instructions');
|
|
18
19
|
const { createApiClient } = require('./api-client');
|
|
19
20
|
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
20
21
|
const { createOAuthMetadata, mcpAuthMetadataRouter, getOAuthProtectedResourceMetadataUrl } = require('@modelcontextprotocol/sdk/server/auth/router.js');
|
|
@@ -522,7 +523,9 @@ class MCPHTTPServer {
|
|
|
522
523
|
}, {
|
|
523
524
|
capabilities: {
|
|
524
525
|
tools: {}
|
|
525
|
-
}
|
|
526
|
+
},
|
|
527
|
+
// Shown to the model on connect — the no-skill safety net (see index.js).
|
|
528
|
+
instructions: SERVER_INSTRUCTIONS
|
|
526
529
|
});
|
|
527
530
|
|
|
528
531
|
// Get per-session API client (bound to user's token), or create one for initialize requests
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-level MCP instructions — surfaced to the model the moment the server
|
|
3
|
+
* connects, independent of any externally-loaded skill. This is the safety net
|
|
4
|
+
* for agents that do NOT have the AgentPlanner SKILL.md: it maps plain intents
|
|
5
|
+
* to the BDI tool names (which were renamed at v0.9, e.g. "create a plan" is
|
|
6
|
+
* `form_intention`, not `create_plan`) and points to `get_started` for the rest.
|
|
7
|
+
*
|
|
8
|
+
* Keep this short — it's read on every connect. Deeper guidance lives in
|
|
9
|
+
* `get_started` (auto-derived from the live tool set, so it can't drift).
|
|
10
|
+
*/
|
|
11
|
+
const SERVER_INSTRUCTIONS = [
|
|
12
|
+
'AgentPlanner uses an intent-shaped, BDI-aligned tool vocabulary (renamed at v0.9 — there is no create_plan/quick_plan/create_node/quick_status).',
|
|
13
|
+
'New here or unsure which tool? Call `get_started` first — it returns the full tool map and recommended workflows.',
|
|
14
|
+
'',
|
|
15
|
+
'Common intents → tool:',
|
|
16
|
+
'- Create a goal → `create_goal` (a sub-goal → `derive_subgoal`)',
|
|
17
|
+
'- Create a plan with its task tree → `form_intention` (add tasks later → `extend_intention`; an R→P→I chain → `propose_research_chain`)',
|
|
18
|
+
'- Find and claim the next task → `claim_next_task`',
|
|
19
|
+
'- Update status / log progress / finish a task → `update_task` (folds the old quick_status + quick_log + add_log + release)',
|
|
20
|
+
'- Read a goal (details, progress, quality, bottlenecks) → `goal_state`; all goals’ health → `briefing` / `list_goals`',
|
|
21
|
+
'- Read a task in context → `task_context`; analyze a plan (critical path, bottlenecks, impact, coherence) → `plan_analysis`',
|
|
22
|
+
'- Record / recall knowledge → `add_learning` / `recall_knowledge`',
|
|
23
|
+
'- Queue a human decision → `queue_decision`; resolve one → `resolve_decision`',
|
|
24
|
+
].join('\n');
|
|
25
|
+
|
|
26
|
+
module.exports = { SERVER_INSTRUCTIONS };
|
package/src/tools/bdi/beliefs.js
CHANGED
|
@@ -617,7 +617,8 @@ const planAnalysisDefinition = {
|
|
|
617
617
|
name: 'plan_analysis',
|
|
618
618
|
description:
|
|
619
619
|
"Advanced plan reads: impact analysis (delay/block/remove), critical path, " +
|
|
620
|
-
"bottleneck list, or coherence check."
|
|
620
|
+
"bottleneck list, or coherence check. Replaces the legacy analyze_impact / " +
|
|
621
|
+
"get_critical_path / run_coherence_check / check_coherence_pending tools.",
|
|
621
622
|
inputSchema: {
|
|
622
623
|
type: 'object',
|
|
623
624
|
properties: {
|
|
@@ -791,7 +791,10 @@ const formIntentionDefinition = {
|
|
|
791
791
|
name: 'form_intention',
|
|
792
792
|
description:
|
|
793
793
|
"Create a plan that achieves a goal, including an initial phase/task " +
|
|
794
|
-
"tree, in one call.
|
|
794
|
+
"tree, in one call. This is the canonical way to CREATE A PLAN (replaces the " +
|
|
795
|
+
"legacy quick_plan / create_plan / import_plan_markdown; inline nodes replace " +
|
|
796
|
+
"create_node / quick_task; depends_on replaces create_dependency). " +
|
|
797
|
+
"Declare execution order inline: give nodes a `ref` and " +
|
|
795
798
|
"list prerequisite refs/titles in `depends_on` to create 'blocks' edges in " +
|
|
796
799
|
"the same call — don't ship a bare hierarchy. The response returns a " +
|
|
797
800
|
"`structure` summary and warns (`created_without_dependencies`) when a " +
|
|
@@ -961,19 +964,22 @@ async function formIntentionHandler(args, apiClient) {
|
|
|
961
964
|
}
|
|
962
965
|
}
|
|
963
966
|
|
|
964
|
-
// 3.
|
|
967
|
+
// 3. Create tree (top-level children parent to root via omitted parent_id).
|
|
968
|
+
const nodeResults = [];
|
|
969
|
+
const ctx = { refMap: new Map(), titleMap: new Map(), edgeIntents: [] };
|
|
970
|
+
await createSubtree(apiClient, plan.id, null, tree, nodeResults, ctx);
|
|
971
|
+
|
|
972
|
+
// 4. Link plan to goal (best-effort) — AFTER the tree exists. The link
|
|
973
|
+
// endpoint cascades 'achieves' edges to all CURRENT task nodes, so linking
|
|
974
|
+
// before node creation wired zero achievers (goal_state then showed empty
|
|
975
|
+
// linked_tasks and fell back to coarse linked-plan stats). Order matters.
|
|
965
976
|
try {
|
|
966
977
|
await apiClient.goals.linkPlan(goal_id, plan.id);
|
|
967
978
|
} catch (err) {
|
|
968
979
|
// Non-fatal — plan exists, link can be retried by user.
|
|
969
980
|
}
|
|
970
981
|
|
|
971
|
-
//
|
|
972
|
-
const nodeResults = [];
|
|
973
|
-
const ctx = { refMap: new Map(), titleMap: new Map(), edgeIntents: [] };
|
|
974
|
-
await createSubtree(apiClient, plan.id, null, tree, nodeResults, ctx);
|
|
975
|
-
|
|
976
|
-
// 4. Wire inline dependency edges. depends_on:[X] on N means X blocks N.
|
|
982
|
+
// 5. Wire inline dependency edges. depends_on:[X] on N means X blocks N.
|
|
977
983
|
const resolveRef = (ref) => {
|
|
978
984
|
if (ctx.refMap.has(ref)) return ctx.refMap.get(ref);
|
|
979
985
|
const byTitle = ctx.titleMap.get(ref);
|
package/src/tools/bdi/utility.js
CHANGED
|
@@ -8,9 +8,11 @@ const { version: MCP_VERSION } = require('../../../package.json');
|
|
|
8
8
|
const getStartedDefinition = {
|
|
9
9
|
name: 'get_started',
|
|
10
10
|
description:
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"Call this FIRST when you are new to AgentPlanner or unsure which tool to use " +
|
|
12
|
+
"(e.g. looking for create_plan / quick_plan — the answer is form_intention). " +
|
|
13
|
+
"Returns the live BDI tool-surface map and recommended workflows: mission " +
|
|
14
|
+
"control loop (Cowork), single-task session (Code/CLI), multi-agent claiming " +
|
|
15
|
+
"(OpenClaw). The map is derived from the actual tool set, so it can't drift.",
|
|
14
16
|
inputSchema: {
|
|
15
17
|
type: 'object',
|
|
16
18
|
properties: {
|
|
@@ -29,6 +31,17 @@ async function getStartedHandler(args, apiClient) {
|
|
|
29
31
|
api = { version: 'unavailable' };
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
// Derived from the actual module definitions so this map can't drift from the
|
|
35
|
+
// real tool set (it silently did — delete_blueprint and record_criterion_progress
|
|
36
|
+
// were both missing at points). Lazy require avoids any load-order cycle.
|
|
37
|
+
const namesOf = (mod) => (mod.definitions || []).map((d) => d.name);
|
|
38
|
+
const toolsByNamespace = {
|
|
39
|
+
beliefs: namesOf(require('./beliefs')),
|
|
40
|
+
desires: namesOf(require('./desires')),
|
|
41
|
+
intentions: namesOf(require('./intentions')),
|
|
42
|
+
workspaces: namesOf(require('./workspaces')),
|
|
43
|
+
};
|
|
44
|
+
|
|
32
45
|
return formatResponse({
|
|
33
46
|
as_of: asOf(),
|
|
34
47
|
mcp_version: MCP_VERSION,
|
|
@@ -39,12 +52,7 @@ async function getStartedHandler(args, apiClient) {
|
|
|
39
52
|
"AgentPlanner exposes a BDI-aligned MCP surface. Tools are grouped by " +
|
|
40
53
|
"Beliefs (state queries), Desires (goals), and Intentions (committed actions). " +
|
|
41
54
|
"Each tool answers one whole agentic question and returns an `as_of` timestamp.",
|
|
42
|
-
tools_by_namespace:
|
|
43
|
-
beliefs: ['briefing', 'list_plans', 'task_context', 'goal_state', 'recall_knowledge', 'search', 'plan_analysis'],
|
|
44
|
-
desires: ['list_goals', 'create_goal', 'update_goal', 'derive_subgoal', 'record_criterion_progress'],
|
|
45
|
-
intentions: ['form_intention', 'extend_intention', 'link_intentions', 'propose_research_chain', 'claim_next_task', 'update_task', 'update_node', 'release_task', 'queue_decision', 'resolve_decision', 'add_learning'],
|
|
46
|
-
workspaces: ['list_workspaces', 'create_workspace', 'list_blueprints', 'fork_blueprint', 'save_as_blueprint', 'delete_blueprint'],
|
|
47
|
-
},
|
|
55
|
+
tools_by_namespace: toolsByNamespace,
|
|
48
56
|
recommended_workflows: [
|
|
49
57
|
{
|
|
50
58
|
name: 'Set up new work a human asked for',
|