@mcpbox/mcpbox-claude 0.1.4 → 0.1.6

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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "mcpbox",
3
+ "owner": {
4
+ "name": "tupical"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "mcpbox-claude",
9
+ "source": "./",
10
+ "description": "MCPBox agent stack for Claude Code. One MCP server (https://mcpbox.ru/v1/mcp) exposing the daruma tracker tools plus the platform pipeline (torii→satori→enma→yatagarasu→fujin→daruma). Ships /mcpbox:{tasks,plan,next,mine,status,close,sync,capture,doctor,mode} + pipeline commands, SessionStart/Stop/UserPromptSubmit hooks, and a managed CLAUDE.md policy covering the full maturity stack."
11
+ }
12
+ ]
13
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcpbox-claude",
3
- "description": "MCPBox × Claude Code glue. Drives the mcpbox MCP server (daruma tracker + full MeiSei pipeline torii→…→fujin→daruma). Ships /mcpbox:{tasks,plan,next,mine,status,close,sync,capture,doctor} and pipeline commands, SessionStart/Stop/UserPromptSubmit hooks, and a managed CLAUDE.md policy that makes mcpbox the default tracker AND pipeline substrate.",
4
- "version": "0.1.4",
3
+ "description": "MCPBox × Claude Code glue. Drives the mcpbox MCP server (daruma tracker + full MeiSei pipeline torii→…→fujin→daruma). Ships /mcpbox:{tasks,plan,next,mine,status,close,sync,capture,doctor,mode} and pipeline commands, SessionStart/Stop/UserPromptSubmit hooks, and a managed CLAUDE.md policy that makes mcpbox the default tracker AND pipeline substrate.",
4
+ "version": "0.1.6",
5
5
  "author": {
6
6
  "name": "tupical"
7
7
  },
package/README.md CHANGED
@@ -7,7 +7,7 @@ and drops a managed policy into each agent's native config file.
7
7
 
8
8
  Normally installed for you by `npx @mcpbox/mcpbox setup` (or
9
9
  `curl -fsSL https://mcpbox.ru/install.sh | sh`), which also registers the MCP
10
- server and picks Global vs Repository scope. Use this CLI directly to manage
10
+ server and picks Repository, Repository (user scope), or Global. Use this CLI directly to manage
11
11
  just the policy.
12
12
 
13
13
  ## What it manages
@@ -13,8 +13,9 @@
13
13
  // mcpbox server already exposes the pipeline tools; add an omc-team driver only
14
14
  // if a CLI-driven execution loop is actually requested.
15
15
 
16
- import { readFileSync } from "node:fs";
16
+ import { existsSync, readFileSync } from "node:fs";
17
17
  import { promises as fs } from "node:fs";
18
+ import { homedir } from "node:os";
18
19
  import { fileURLToPath } from "node:url";
19
20
  import { dirname, join, resolve } from "node:path";
20
21
  import { spawnSync } from "node:child_process";
@@ -50,6 +51,10 @@ Usage:
50
51
  mcpbox-claude kimi-uninit [--dir DIR]
51
52
  mcpbox-claude doctor [--json] Check the mcpbox MCP server + policy are wired.
52
53
  mcpbox-claude mode [off|lite|full] Get/set pipeline strictness (how raw ideas route).
54
+ mcpbox-claude export-marketplace [--dir DIR]
55
+ Mirror this package to a stable directory usable as
56
+ a Claude Code marketplace; prints the path.
57
+ Default: ~/.agents/mcpbox/marketplace
53
58
  mcpbox-claude --version | -v
54
59
  mcpbox-claude --help | -h
55
60
  `;
@@ -203,6 +208,25 @@ async function cmdDoctor(rest) {
203
208
  process.exit(ready ? 0 : 1);
204
209
  }
205
210
 
211
+ // The marketplace repo is private, so `claude plugin marketplace add
212
+ // tupical/mcpbox.ru` only resolves for users with access to it. This package is
213
+ // public and carries .claude-plugin/marketplace.json, so it can be the
214
+ // marketplace itself — but Claude Code reads a directory marketplace in place
215
+ // rather than copying it, and npx unpacks us into a disposable cache. Mirror
216
+ // the package to a stable path first.
217
+ async function cmdExportMarketplace(rest) {
218
+ const { projectDir } = parseDirFlag(rest);
219
+ const source = resolve(__dirname, "..");
220
+ const target = resolve(projectDir ?? join(homedir(), ".agents", "mcpbox", "marketplace"));
221
+ if (existsSync(target) && !existsSync(join(target, ".claude-plugin", "marketplace.json"))) {
222
+ throw new Error(`${target} exists and is not an mcpbox marketplace — refusing to overwrite it`);
223
+ }
224
+ await fs.rm(target, { recursive: true, force: true });
225
+ await fs.mkdir(dirname(target), { recursive: true });
226
+ await fs.cp(source, target, { recursive: true });
227
+ process.stdout.write(`${target}\n`);
228
+ }
229
+
206
230
  async function main(argv) {
207
231
  const [, , cmd, ...rest] = argv;
208
232
  switch (cmd) {
@@ -240,6 +264,8 @@ async function main(argv) {
240
264
  return cmdDoctor(rest);
241
265
  case "mode":
242
266
  return cmdMode(rest);
267
+ case "export-marketplace":
268
+ return cmdExportMarketplace(rest);
243
269
  default:
244
270
  process.stderr.write(`Unknown command: ${cmd}\n\n${HELP}`);
245
271
  process.exit(2);
@@ -11,15 +11,15 @@ never by materializing a daruma task directly. The server enforces the layer ord
11
11
  ## Steps
12
12
 
13
13
  1. If `$ARGUMENTS` is empty, ask for the raw idea/request and stop.
14
- 2. Open the run:
15
- - Autopilot (default): `mcpbox_pipeline_run { source, kind:"text", body:"<idea>" }`
16
- → returns `run_id`, lineage, `action_packet`.
17
- - Strict step mode (if the user wants control): open with `mcpbox_pipeline_run`, then
18
- one `mcpbox_pipeline_advance { run_id, layer }` per layer satori→enma→yatagarasu→fujin.
19
- Carry ONLY `run_id` between steps — do not paste intermediate artifacts.
20
- 3. On a layer failure / `422` / fujin maturity gate: return to the previous layer, fix its
21
- input, and re-`advance` — do not skip. The reason is in `mcpbox_trace_get`.
22
- 4. Once `fujin` produced a mature Action Packet: `mcpbox_pipeline_handoff { run_id, project_slug? }`
23
- → materializes the daruma task, returns `task_id`.
14
+ 2. Call `mcpbox_pipeline_run { source, kind:"text", body:"<idea>" }`. It returns
15
+ `run_id` immediately while all five hops run in the background. Poll
16
+ `mcpbox_trace_get { run_id }` until the status is no longer `running`.
17
+ 3. On failure, report the reason from `mcpbox_trace_get`; do not hand off an
18
+ incomplete run.
19
+ 4. Once `fujin` produced a mature Action Packet, call
20
+ `mcpbox_pipeline_handoff { run_id, action_packet, policy_snapshot, project_slug? }`,
21
+ taking `action_packet` from `artifacts.fujin.action_packet` and
22
+ `policy_snapshot` from `artifacts.policy_snapshot` in the trace. This
23
+ materializes the daruma task and returns `task_id`.
24
24
  5. Verify with `mcpbox_trace_get { run_id }` (expect `status=handed_off`, a `task_id`) and
25
25
  report the run_id + task_id.
@@ -1,7 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  // UserPromptSubmit hook: detect capture / sync / status / close / pipeline
3
3
  // intent in the user's prompt and prepend a short routing hint so the agent
4
- // routes to the right slash command rather than improvising.
4
+ // routes to the right place rather than improvising. The /mcpbox:* commands
5
+ // exist only in Claude Code, so each hint names the MCP tool as well — Codex,
6
+ // Cursor and Kimi can act on the hint without the plugin.
5
7
  //
6
8
  // Output goes to stdout — Claude Code injects it as a <system-reminder>; Kimi
7
9
  // Code appends it to the context on exit 0. Exit 0 always; this hook must
@@ -11,7 +13,11 @@
11
13
  // event JSON on stdin (Kimi Code passes the payload via stdin, and so does
12
14
  // Claude Code — this also covers Claude setups without the env var).
13
15
 
16
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
17
+ import { homedir } from "node:os";
18
+ import { dirname, join } from "node:path";
14
19
  import { pathToFileURL } from "node:url";
20
+
15
21
  import { readMode } from "../lib/mode.mjs";
16
22
 
17
23
  // Intent patterns. Order matters — first match wins. ASCII keywords use \b;
@@ -29,23 +35,23 @@ const PATTERNS = [
29
35
  },
30
36
  {
31
37
  re: /\b(list|show|view)\s+(all\s+|active\s+|open\s+)?(tasks|issues|backlog)\b|(?<![а-яёА-ЯЁ])(выпиши|покажи|перечисли|список)\s+(активные\s+)?(задачи|задач|таски|бэклог)(?![а-яёА-ЯЁ])/,
32
- hint: "[mcpbox] Detected task-list intent → /mcpbox:tasks (daruma_list status=active, scoped).",
38
+ hint: "[mcpbox] Detected task-list intent → /mcpbox:tasks in Claude, otherwise daruma_list status=active with a scope.",
33
39
  },
34
40
  {
35
41
  re: /\b(capture|record|lesson)\b|(?<![а-яёА-ЯЁ])(сохрани|запомни|урок)(?![а-яёА-ЯЁ])/,
36
- hint: "[mcpbox] Detected lesson-capture intent → /mcpbox:capture",
42
+ hint: "[mcpbox] Detected lesson-capture intent → /mcpbox:capture in Claude, otherwise write the lesson as a daruma comment/document.",
37
43
  },
38
44
  {
39
45
  re: /\b(sync|refresh\s+tasks)\b|(?<![а-яёА-ЯЁ])(синх|обнови\s+задачи)(?![а-яёА-ЯЁ])/,
40
- hint: "[mcpbox] Detected sync intent → /mcpbox:sync",
46
+ hint: "[mcpbox] Detected sync intent → /mcpbox:sync in Claude, otherwise re-read state with daruma_list / daruma_plan_get.",
41
47
  },
42
48
  {
43
49
  re: /\b(status|progress|what.?s\s+(open|next|left))\b|(?<![а-яёА-ЯЁ])(статус|прогресс|что\s+(открыто|осталось|дальше))(?![а-яёА-ЯЁ])/,
44
- hint: "[mcpbox] Detected status query → /mcpbox:status",
50
+ hint: "[mcpbox] Detected status query → /mcpbox:status in Claude, otherwise daruma_healthz + mcpbox_runs_list.",
45
51
  },
46
52
  {
47
53
  re: /\b(close|complete|mark\s+.*done)\b|(?<![а-яёА-ЯЁ])(закрой|закрыть|завершить|пометь\s+.*выполненной)(?![а-яёА-ЯЁ])/,
48
- hint: "[mcpbox] Detected close intent → /mcpbox:close",
54
+ hint: "[mcpbox] Detected close intent → /mcpbox:close in Claude, otherwise daruma_complete (or daruma_set_status).",
49
55
  },
50
56
  ];
51
57
 
@@ -93,25 +99,73 @@ function readStdin(timeoutMs = 3000) {
93
99
  }
94
100
 
95
101
  // Kimi's UserPromptSubmit payload carries the prompt text; the exact field
96
- // name is not documented, so accept the common shapes.
102
+ // name is not documented, so accept the common shapes. Kimi sends it as an
103
+ // array of content blocks — `prompt: [{type: "text", text: "…"}]` — which the
104
+ // string-only lookup missed, so every routing hint stayed silent there.
97
105
  export function promptFromHookPayload(payload) {
98
106
  if (!payload || typeof payload !== "object") return "";
99
107
  for (const key of ["prompt", "user_prompt", "userPrompt", "message", "text"]) {
100
- if (typeof payload[key] === "string" && payload[key].trim()) return payload[key];
108
+ const value = payload[key];
109
+ if (typeof value === "string" && value.trim()) return value;
110
+ if (Array.isArray(value)) {
111
+ const text = value
112
+ .map((block) => (typeof block === "string" ? block : block?.text ?? ""))
113
+ .filter((part) => typeof part === "string" && part.trim())
114
+ .join("\n");
115
+ if (text.trim()) return text;
116
+ }
101
117
  }
102
118
  return "";
103
119
  }
104
120
 
121
+ // Kimi never fires SessionStart (its hook block registers it, but the event
122
+ // does not arrive) and it reads AGENTS.md from the working directory ONLY —
123
+ // no walk up the tree, no user-level instruction file. A globally-installed
124
+ // policy therefore sits in ~/AGENTS.md where no real project sees it, and the
125
+ // agent answers "no such command" to `mcpbox mode`. UserPromptSubmit does
126
+ // fire, so for Kimi the policy rides in on the first prompt of a session.
127
+ // Claude registers this hook without --policy: it reads CLAUDE.md already.
128
+ async function policyForFirstPrompt(payload) {
129
+ if (!process.argv.includes("--policy")) return "";
130
+ // PLAIN: this path only ever serves non-Claude surfaces, which have no
131
+ // /mcpbox:* commands.
132
+ const { BLOCK_BODY_PLAIN, BEGIN } = await import("../lib/policy.mjs");
133
+ const cwd = typeof payload?.cwd === "string" && payload.cwd ? payload.cwd : process.cwd();
134
+ try {
135
+ // An AGENTS.md right here already carries the block — the agent is
136
+ // reading it, so a second copy would be pure noise.
137
+ if ((await readFile(join(cwd, "AGENTS.md"), "utf8")).includes(BEGIN)) return "";
138
+ } catch { /* no AGENTS.md here — the policy has to come from us */ }
139
+
140
+ const sessionId = typeof payload?.session_id === "string" ? payload.session_id : "";
141
+ if (!sessionId) return BLOCK_BODY_PLAIN; // no session to key on — better twice than never
142
+ // ponytail: one empty marker file per session, never swept. They are 0
143
+ // bytes; add a cleanup pass only if a long-lived install ever complains.
144
+ const marker = join(homedir(), ".agents", "mcpbox", "sessions", sessionId.replace(/[^\w.-]/g, "_"));
145
+ try {
146
+ await mkdir(dirname(marker), { recursive: true });
147
+ // wx fails if it exists → the policy already went out this session.
148
+ await writeFile(marker, "", { flag: "wx" });
149
+ } catch {
150
+ return "";
151
+ }
152
+ return BLOCK_BODY_PLAIN;
153
+ }
154
+
105
155
  async function main() {
106
156
  let prompt = process.env.CLAUDE_USER_PROMPT ?? "";
157
+ let payload = null;
107
158
  if (!prompt) {
108
159
  const raw = await readStdin();
109
160
  if (raw.trim()) {
110
161
  try {
111
- prompt = promptFromHookPayload(JSON.parse(raw));
162
+ payload = JSON.parse(raw);
163
+ prompt = promptFromHookPayload(payload);
112
164
  } catch { /* not JSON — no prompt to route */ }
113
165
  }
114
166
  }
167
+ const policy = await policyForFirstPrompt(payload);
168
+ if (policy) process.stdout.write(policy + "\n");
115
169
  const hint = promptSubmitHint(prompt, readMode());
116
170
  if (hint) process.stdout.write(hint + "\n");
117
171
  }
package/lib/codex.mjs CHANGED
@@ -6,7 +6,8 @@
6
6
  // is fenced with comment markers and replaced in place — surrounding
7
7
  // hand-written TOML is preserved.
8
8
  //
9
- // The policy body is BLOCK_BODY from lib/policy.mjs — one source of truth
9
+ // The policy body is BLOCK_BODY_PLAIN from lib/policy.mjs — one source of
10
+ // truth, minus the Claude-only slash commands this surface cannot run.
10
11
  // shared across CLAUDE.md / AGENTS.md / .cursor/rules. Slash-command and
11
12
  // tool-surface phrasing stays Claude-flavoured; that's a deliberate
12
13
  // non-issue, not per-surface forks to maintain.
@@ -14,7 +15,7 @@
14
15
  import { homedir } from "node:os";
15
16
  import { join, resolve } from "node:path";
16
17
  import {
17
- BLOCK_BODY,
18
+ BLOCK_BODY_PLAIN,
18
19
  MCP_URL,
19
20
  installManagedBlock,
20
21
  removeManagedBlock,
@@ -36,7 +37,7 @@ function codexConfigPath(configPath) {
36
37
  // AGENTS.md policy block in the project directory.
37
38
  export function installCodexPolicy({ projectDir } = {}) {
38
39
  const dir = projectDir ? resolve(projectDir) : process.cwd();
39
- return installManagedBlock({ target: join(dir, "AGENTS.md"), begin: BEGIN, end: END, block: BLOCK_BODY });
40
+ return installManagedBlock({ target: join(dir, "AGENTS.md"), begin: BEGIN, end: END, block: BLOCK_BODY_PLAIN });
40
41
  }
41
42
 
42
43
  export function removeCodexPolicy({ projectDir } = {}) {
package/lib/cursor.mjs CHANGED
@@ -5,12 +5,13 @@
5
5
  // 2. `.cursor/mcp.json` — upsert the `mcpbox` HTTP server entry, leaving any
6
6
  // other servers the user configured untouched.
7
7
  //
8
- // Rule body is BLOCK_BODY from lib/policy.mjs — the shared source of truth.
8
+ // Rule body is BLOCK_BODY_PLAIN from lib/policy.mjs — the shared source of
9
+ // truth, minus the Claude-only slash commands this surface cannot run.
9
10
 
10
11
  import { promises as fs } from "node:fs";
11
12
  import { dirname, join, resolve } from "node:path";
12
13
  import { fileURLToPath } from "node:url";
13
- import { BLOCK_BODY, MCP_URL } from "./policy.mjs";
14
+ import { BLOCK_BODY_PLAIN, MCP_URL } from "./policy.mjs";
14
15
 
15
16
  const RULE_FRONTMATTER = `---
16
17
  description: Workspace policy — mcpbox is the default tracker AND maturity pipeline (torii→…→fujin→daruma). Triggered by mentions of "трекер", "tracker", "task tracker", "backlog", "pipeline", "план", "задача". Overrides ad-hoc trackers and OMC plan files.
@@ -21,7 +22,7 @@ alwaysApply: true
21
22
  `;
22
23
 
23
24
  function ruleContent() {
24
- return RULE_FRONTMATTER + BLOCK_BODY;
25
+ return RULE_FRONTMATTER + BLOCK_BODY_PLAIN;
25
26
  }
26
27
 
27
28
  function rulePath(projectDir) {
package/lib/kimi.mjs CHANGED
@@ -1,7 +1,10 @@
1
1
  // Kimi Code CLI surface for the mcpbox harness — parity with the Claude
2
2
  // CLAUDE.md plugin and the Codex AGENTS.md surface. Three idempotent writes:
3
- // 1. AGENTS.md policy block (Kimi reads AGENTS.md every session in the
4
- // workspace) — same managed block as the Codex surface.
3
+ // 1. AGENTS.md policy block — same managed block as the Codex surface.
4
+ // Kimi reads AGENTS.md from the WORKING DIRECTORY only: no walk up the
5
+ // tree, no user-level instruction file. A global install therefore lands
6
+ // it in ~/AGENTS.md, which no real project ever sees — hence the
7
+ // UserPromptSubmit --policy injection below, which covers every cwd.
5
8
  // 2. `$KIMI_CODE_HOME/mcp.json` (default `~/.kimi-code/mcp.json`) — upsert
6
9
  // the `mcpbox` HTTP server entry, preserving other servers. A bare `url`
7
10
  // entry means HTTP transport in Kimi. User-level on purpose: one server
@@ -13,21 +16,24 @@
13
16
  // markers and replaced in place; surrounding hand-written TOML is
14
17
  // preserved.
15
18
  //
16
- // The policy body is BLOCK_BODY from lib/policy.mjs — one source of truth
17
- // shared across CLAUDE.md / AGENTS.md / .cursor/rules.
19
+ // The policy body is BLOCK_BODY_PLAIN from lib/policy.mjs — one source of
20
+ // truth shared across CLAUDE.md / AGENTS.md / .cursor/rules, minus the
21
+ // Claude-only slash commands this surface cannot run.
18
22
  //
19
23
  // Hook semantics in Kimi (https://www.kimi.com/code/docs/en/kimi-code-cli/customization/hooks.html):
20
- // stdin carries the event JSON; exit 0 + stdout appends text to the context;
21
- // SessionStart/UserPromptSubmit/Stop all exist. The hook scripts are the same
22
- // ones the Claude plugin ships (hooks/), copied into the Kimi home so the
23
- // config never references an ephemeral npx cache path.
24
+ // stdin carries the event JSON; exit 0 + stdout appends text to the context.
25
+ // Measured against Kimi 2026-08: UserPromptSubmit fires and its payload is
26
+ // {hook_event_name, session_id, cwd, prompt: [{type,text}]}; SessionStart is
27
+ // accepted in config.toml but never actually fires. The hook scripts are the
28
+ // same ones the Claude plugin ships (hooks/), copied into the Kimi home so
29
+ // the config never references an ephemeral npx cache path.
24
30
 
25
31
  import { promises as fs } from "node:fs";
26
32
  import { homedir } from "node:os";
27
33
  import { dirname, join, resolve } from "node:path";
28
34
  import { fileURLToPath } from "node:url";
29
35
  import {
30
- BLOCK_BODY,
36
+ BLOCK_BODY_PLAIN,
31
37
  MCP_URL,
32
38
  installManagedBlock,
33
39
  removeManagedBlock,
@@ -47,6 +53,8 @@ const HOOK_ASSETS = [
47
53
  ["hooks", "stop.mjs"],
48
54
  ["lib", "mcp-client.mjs"],
49
55
  ["lib", "mode.mjs"],
56
+ // user-prompt-submit.mjs --policy reads the policy body from here.
57
+ ["lib", "policy.mjs"],
50
58
  ];
51
59
 
52
60
  const MCP_ENTRY = { url: MCP_URL };
@@ -67,7 +75,7 @@ export function kimiHomeDir(home) {
67
75
 
68
76
  export function installKimiPolicy({ projectDir } = {}) {
69
77
  const dir = projectDir ? resolve(projectDir) : process.cwd();
70
- return installManagedBlock({ target: join(dir, "AGENTS.md"), begin: BEGIN, end: END, block: BLOCK_BODY });
78
+ return installManagedBlock({ target: join(dir, "AGENTS.md"), begin: BEGIN, end: END, block: BLOCK_BODY_PLAIN });
71
79
  }
72
80
 
73
81
  export function removeKimiPolicy({ projectDir } = {}) {
@@ -124,7 +132,8 @@ export async function removeKimiMcp({ mcpPath, kimiHome } = {}) {
124
132
  // TOML literal strings (single quotes) keep absolute paths with spaces or
125
133
  // backslashes intact without escaping.
126
134
  function hooksTomlBlock(assetsRoot) {
127
- const command = (file) => `command = 'node "${join(assetsRoot, "hooks", file)}"'`;
135
+ const command = (file, args = "") =>
136
+ `command = 'node "${join(assetsRoot, "hooks", file)}"${args}'`;
128
137
  return [
129
138
  "[[hooks]]",
130
139
  'event = "SessionStart"',
@@ -133,7 +142,10 @@ function hooksTomlBlock(assetsRoot) {
133
142
  "",
134
143
  "[[hooks]]",
135
144
  'event = "UserPromptSubmit"',
136
- command("user-prompt-submit.mjs"),
145
+ // --policy: Kimi reads AGENTS.md from the working directory only and
146
+ // never fires SessionStart, so the managed policy rides in on the first
147
+ // prompt of each session instead.
148
+ command("user-prompt-submit.mjs", " --policy"),
137
149
  "",
138
150
  "[[hooks]]",
139
151
  'event = "Stop"',
package/lib/policy.mjs CHANGED
@@ -24,7 +24,7 @@ import { join, resolve } from "node:path";
24
24
  const BEGIN = "<!-- mcpbox:policy:begin -->";
25
25
  const END = "<!-- mcpbox:policy:end -->";
26
26
 
27
- const BLOCK_BODY = `# MCPBox — default agent stack (project policy)
27
+ const BLOCK_HEAD = `# MCPBox — default agent stack (project policy)
28
28
 
29
29
  This project uses the **mcpbox** MCP server (\`https://mcpbox.ru/v1/mcp\`) as the
30
30
  single source of truth for tasks, plans, AI decomposition, **and** the full
@@ -193,14 +193,17 @@ daruma execution задача/план (терминальный слой
193
193
 
194
194
  ### Pipeline tools
195
195
 
196
- - \`mcpbox_pipeline_run\` — автопилот: один вызов прогоняет сырьё через все
197
- 5 слоёв torii→fujin. Возвращает \`run_id\`, lineage и \`action_packet\`.
196
+ - \`mcpbox_pipeline_run\` — автопилот: сразу возвращает \`run_id\`, а 5 хопов
197
+ torii→fujin идут в фоне; результат получай через \`mcpbox_trace_get\`. Для
198
+ handoff бери \`action_packet\` из \`artifacts.fujin.action_packet\`, а
199
+ \`policy_snapshot\` из \`artifacts.policy_snapshot\`.
198
200
  - \`mcpbox_pipeline_advance\` — **один хоп** за вызов \`{run_id, layer}\`; вход
199
201
  берётся из выхода предыдущего слоя того же прогона. Пропуск слоя / \`torii\`
200
202
  как цель → \`422\`.
201
203
  - \`mcpbox_pipeline_handoff\` — **единственный** путь материализации
202
- daruma-задачи из зрелого Action Packet \`{run_id?, action_packet?,
203
- project_slug?}\`.
204
+ daruma-задачи из зрелого Action Packet \`{run_id?, action_packet,
205
+ policy_snapshot?, project_slug?}\`; поля пакета и политики берутся из
206
+ \`mcpbox_trace_get\` по путям выше.
204
207
  - \`mcpbox_trace_get\` — трассировка прогона по \`run_id\`: статус, lineage,
205
208
  per-hop тайминги/ошибки, артефакты слоёв.
206
209
  - \`mcpbox_runs_list\` — список прогонов воркспейса (фильтр \`status\`, \`limit\`).
@@ -230,6 +233,13 @@ daruma execution задача/план (терминальный слой
230
233
  материализуй задачу \`mcpbox_pipeline_handoff\`. Не создавай задачу напрямую
231
234
  в обход pipeline, если запрос — сырьё.
232
235
 
236
+ `;
237
+
238
+ // The `/mcpbox:*` commands ship with the Claude Code plugin and exist nowhere
239
+ // else. Advertising them to Codex/Cursor/Kimi produced exactly the confusion
240
+ // you would expect — "no such command" — so those surfaces get the plain-text
241
+ // equivalents instead. Same capabilities, reachable without the plugin.
242
+ const SLASH_COMMANDS = `
233
243
  ### Useful slash commands
234
244
 
235
245
  - \`/mcpbox:tasks\` — open tasks as a compact table.
@@ -237,11 +247,32 @@ daruma execution задача/план (терминальный слой
237
247
  - \`/mcpbox:next\` — claim the next ready task.
238
248
  - \`/mcpbox:mine\` — tasks claimed by this session.
239
249
  - \`/mcpbox:status\` — server + pipeline health (\`daruma_healthz\`, recent runs).
240
- - \`mcpbox mode [off|lite|full]\` — show or set the shared pipeline mode.
250
+ - \`/mcpbox:mode [off|lite|full]\` — show or set the shared pipeline mode.
241
251
  - \`/mcpbox:pipeline-run "<idea>"\` — open a maturity run from raw input.
242
252
  - \`/mcpbox:trace <run_id>\` — trace a run's lineage and per-hop status.
243
253
  `;
244
254
 
255
+ const PLAIN_COMMANDS = `
256
+ ### Useful requests
257
+
258
+ This agent has no \`/mcpbox:*\` slash commands — those belong to the Claude
259
+ Code plugin. Ask in plain language; each maps to a tool you already have:
260
+
261
+ - "open tasks" — \`daruma_list status=active\` with a scope.
262
+ - "active plan" — \`daruma_plan_get\` (or \`daruma_plan_progress\`).
263
+ - "what's next" — \`daruma_plan_drain_next\`.
264
+ - "mcpbox status" — \`daruma_healthz\` plus \`mcpbox_runs_list\`.
265
+ - \`mcpbox mode [off|lite|full]\` — run
266
+ \`npx -y @mcpbox/mcpbox-claude@latest mode [value]\` and report the one-line
267
+ result (see Pipeline mode above).
268
+ - "open a pipeline run for <idea>" — \`mcpbox_pipeline_run\`.
269
+ - "trace <run_id>" — \`mcpbox_trace_get\`.
270
+ `;
271
+
272
+ // Claude reads the plugin's commands; every other surface gets plain text.
273
+ const BLOCK_BODY = BLOCK_HEAD + SLASH_COMMANDS;
274
+ export const BLOCK_BODY_PLAIN = BLOCK_HEAD + PLAIN_COMMANDS;
275
+
245
276
  // Idempotent write of a delimited managed block to `target`. Surrounding
246
277
  // hand-written content is preserved. Shared by the CLAUDE.md, AGENTS.md
247
278
  // (Codex), and .cursor/rules (Cursor) policy surfaces — see lib/codex.mjs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpbox/mcpbox-claude",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "MCPBox agent harness for Claude Code: managed policy (daruma tracker + full pipeline), hooks, and slash commands over the single mcpbox MCP server.",
5
5
  "type": "module",
6
6
  "publishConfig": {