@adhd/agent-mcp 1.1.3 → 2.0.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.
Files changed (123) hide show
  1. package/drizzle/0006_composed_prompts_cache.sql +24 -0
  2. package/drizzle/meta/0006_snapshot.json +651 -0
  3. package/drizzle/meta/_journal.json +8 -1
  4. package/package.json +5 -1
  5. package/src/__tests__/integration/harness.d.ts.map +1 -1
  6. package/src/__tests__/integration/harness.js +10 -8
  7. package/src/__tests__/integration/harness.js.map +1 -1
  8. package/src/clients/stdio-client.d.ts.map +1 -1
  9. package/src/clients/stdio-client.js +2 -1
  10. package/src/clients/stdio-client.js.map +1 -1
  11. package/src/config.d.ts +114 -0
  12. package/src/config.d.ts.map +1 -0
  13. package/src/config.js +287 -0
  14. package/src/config.js.map +1 -0
  15. package/src/db/client.d.ts.map +1 -1
  16. package/src/db/client.js +2 -3
  17. package/src/db/client.js.map +1 -1
  18. package/src/db/schema.d.ts +242 -0
  19. package/src/db/schema.d.ts.map +1 -1
  20. package/src/db/schema.js +38 -1
  21. package/src/db/schema.js.map +1 -1
  22. package/src/engine/hooks.d.ts +21 -6
  23. package/src/engine/hooks.d.ts.map +1 -1
  24. package/src/engine/hooks.js +47 -6
  25. package/src/engine/hooks.js.map +1 -1
  26. package/src/engine/orchestrator.d.ts.map +1 -1
  27. package/src/engine/orchestrator.js +3 -2
  28. package/src/engine/orchestrator.js.map +1 -1
  29. package/src/engine/policy.d.ts +24 -0
  30. package/src/engine/policy.d.ts.map +1 -1
  31. package/src/engine/policy.js +73 -6
  32. package/src/engine/policy.js.map +1 -1
  33. package/src/engine/prompt-resolver.d.ts +89 -0
  34. package/src/engine/prompt-resolver.d.ts.map +1 -0
  35. package/src/engine/prompt-resolver.js +96 -0
  36. package/src/engine/prompt-resolver.js.map +1 -0
  37. package/src/engine/queue.d.ts.map +1 -1
  38. package/src/engine/queue.js +2 -2
  39. package/src/engine/queue.js.map +1 -1
  40. package/src/index.d.ts +31 -3
  41. package/src/index.d.ts.map +1 -1
  42. package/src/index.js +131 -20
  43. package/src/index.js.map +1 -1
  44. package/src/logger.d.ts.map +1 -1
  45. package/src/logger.js +2 -1
  46. package/src/logger.js.map +1 -1
  47. package/src/plugins/loader.d.ts +19 -6
  48. package/src/plugins/loader.d.ts.map +1 -1
  49. package/src/plugins/loader.js +23 -13
  50. package/src/plugins/loader.js.map +1 -1
  51. package/src/providers/anthropic.d.ts +5 -5
  52. package/src/providers/anthropic.d.ts.map +1 -1
  53. package/src/providers/anthropic.js +53 -188
  54. package/src/providers/anthropic.js.map +1 -1
  55. package/src/providers/claudecli.d.ts +92 -5
  56. package/src/providers/claudecli.d.ts.map +1 -1
  57. package/src/providers/claudecli.js +224 -47
  58. package/src/providers/claudecli.js.map +1 -1
  59. package/src/providers/factory.d.ts +1 -1
  60. package/src/providers/factory.d.ts.map +1 -1
  61. package/src/providers/factory.js +6 -9
  62. package/src/providers/factory.js.map +1 -1
  63. package/src/providers/index.d.ts +1 -1
  64. package/src/providers/index.d.ts.map +1 -1
  65. package/src/providers/index.js +1 -1
  66. package/src/providers/index.js.map +1 -1
  67. package/src/providers/openai.d.ts +4 -2
  68. package/src/providers/openai.d.ts.map +1 -1
  69. package/src/providers/openai.js +29 -18
  70. package/src/providers/openai.js.map +1 -1
  71. package/src/providers/types.d.ts +1 -1
  72. package/src/server.d.ts +8 -0
  73. package/src/server.d.ts.map +1 -1
  74. package/src/server.js +19 -12
  75. package/src/server.js.map +1 -1
  76. package/src/store/agent-store.d.ts +13 -0
  77. package/src/store/agent-store.d.ts.map +1 -1
  78. package/src/store/agent-store.js +16 -3
  79. package/src/store/agent-store.js.map +1 -1
  80. package/src/store/composed-prompt-store.d.ts +24 -0
  81. package/src/store/composed-prompt-store.d.ts.map +1 -0
  82. package/src/store/composed-prompt-store.js +75 -0
  83. package/src/store/composed-prompt-store.js.map +1 -0
  84. package/src/store/index.d.ts +1 -0
  85. package/src/store/index.d.ts.map +1 -1
  86. package/src/store/index.js +1 -0
  87. package/src/store/index.js.map +1 -1
  88. package/src/store/session-store.d.ts +8 -0
  89. package/src/store/session-store.d.ts.map +1 -1
  90. package/src/store/session-store.js +3 -2
  91. package/src/store/session-store.js.map +1 -1
  92. package/src/streaming/sse-server.d.ts +2 -2
  93. package/src/streaming/sse-server.d.ts.map +1 -1
  94. package/src/streaming/sse-server.js +4 -4
  95. package/src/streaming/sse-server.js.map +1 -1
  96. package/src/tools/session.d.ts +12 -0
  97. package/src/tools/session.d.ts.map +1 -1
  98. package/src/tools/session.js +33 -1
  99. package/src/tools/session.js.map +1 -1
  100. package/src/tools/task.d.ts.map +1 -1
  101. package/src/tools/task.js +2 -2
  102. package/src/tools/task.js.map +1 -1
  103. package/src/tools/usage.d.ts.map +1 -1
  104. package/src/tools/usage.js +10 -3
  105. package/src/tools/usage.js.map +1 -1
  106. package/src/utils/load-env.d.ts +16 -0
  107. package/src/utils/load-env.d.ts.map +1 -0
  108. package/src/utils/load-env.js +27 -0
  109. package/src/utils/load-env.js.map +1 -0
  110. package/src/validation/agent.d.ts +150 -62
  111. package/src/validation/agent.d.ts.map +1 -1
  112. package/src/validation/agent.js +152 -37
  113. package/src/validation/agent.js.map +1 -1
  114. package/src/validation/errors.d.ts +1 -0
  115. package/src/validation/errors.d.ts.map +1 -1
  116. package/src/validation/errors.js +2 -0
  117. package/src/validation/errors.js.map +1 -1
  118. package/src/validation/execution.d.ts +13 -20
  119. package/src/validation/execution.d.ts.map +1 -1
  120. package/src/providers/lmstudio.d.ts +0 -8
  121. package/src/providers/lmstudio.d.ts.map +0 -1
  122. package/src/providers/lmstudio.js +0 -15
  123. package/src/providers/lmstudio.js.map +0 -1
@@ -21,6 +21,18 @@
21
21
  * ⚠️ --tools "" is NOT used — it disables MCP tools as well as built-ins.
22
22
  * ⚠️ --bare is NOT used — it blocks --mcp-config from loading entirely.
23
23
  *
24
+ * Agent-spec mode (config.systemPromptIsAgentSpec === true):
25
+ * The agent's systemPrompt is treated as a complete Claude Code agent markdown
26
+ * file (YAML frontmatter + body). Instead of --system-prompt + --disallowedTools,
27
+ * the provider writes it to an isolated temp project dir and passes
28
+ * --add-dir <tmpdir> --setting-sources project --agent <frontmatterName>
29
+ * so Claude *internally parses the frontmatter header* — including the `tools:`
30
+ * field — which then governs tool access and TAKES PRECEDENCE over the built-in
31
+ * disallow enumeration. `--agent` matches the frontmatter `name:`, not the
32
+ * filename; cwd is preserved so file/Bash tools keep their working root. Omit
33
+ * `tools:` in the header to inherit all tools; list `mcp__<server>__<tool>`
34
+ * entries to expose specific MCP tools. allowedBuiltinTools is ignored in this mode.
35
+ *
24
36
  * Tool loop: when Claude Code emits a tool_use block, we execute it via the
25
37
  * request.executeTool callback (wired by the orchestrator to the McpClientRegistry)
26
38
  * and write a tool_result message back to stdin. This continues until Claude
@@ -38,15 +50,81 @@ import type { McpServerConfig, ProviderConfig } from "../validation/index.js";
38
50
  type ClaudeCliConfig = Extract<ProviderConfig, {
39
51
  type: "claudecli";
40
52
  }>;
53
+ /**
54
+ * Compute the effective allowed built-in set and the `--disallowedTools` argv
55
+ * entries that must be passed to the `claude` CLI subprocess.
56
+ *
57
+ * This is the single source of truth for [inv:no-third-tool-model]: the
58
+ * allowed set is resolved in priority order:
59
+ * 1. `compiledTools` (AGENT_TOOL / compile.tools model) — wins when present.
60
+ * 2. `config.allowedBuiltinTools` — legacy / transition-window fallback.
61
+ *
62
+ * Extracted here so tests can assert the REAL produced argv without spawning
63
+ * a subprocess. `chat()` must call this function; no divergence allowed.
64
+ *
65
+ * @param compiledTools - Platform-alias array from `compileAgent().tools`, or
66
+ * `undefined` when the compiler integration is not available yet.
67
+ * @param allowedBuiltinTools - Per-agent legacy allowlist from config.
68
+ * @returns `{ effectiveAllowed, disallowedArgv }` where `disallowedArgv` is the
69
+ * flat `["--disallowedTools", "<name>", ...]` fragment ready to push into args.
70
+ */
71
+ export declare function computeClaudeBuiltinArgs(params: {
72
+ compiledTools: string[] | undefined;
73
+ allowedBuiltinTools: string[] | undefined;
74
+ }): {
75
+ effectiveAllowed: string[];
76
+ disallowedArgv: string[];
77
+ };
78
+ /**
79
+ * Extracts the `name:` field from the leading YAML frontmatter block of a Claude
80
+ * Code agent markdown system prompt. Only the first `---`-delimited block at the
81
+ * very top of the string is considered. Returns undefined when there is no leading
82
+ * frontmatter block or no `name:` key.
83
+ *
84
+ * Claude Code selects an agent (`--agent <name>`) by this frontmatter name — not
85
+ * the on-disk filename — so the provider must read it to build the correct flag.
86
+ */
87
+ export declare function extractAgentSpecName(md: string): string | undefined;
88
+ /**
89
+ * Ensures an agent-spec markdown carries a frontmatter `name:` so the subprocess
90
+ * can select it with `--agent`. Returns the markdown to write and the agent name
91
+ * to pass to `--agent`.
92
+ *
93
+ * - If the prompt already names the agent, it is used verbatim and the markdown is
94
+ * returned unchanged (the spec author's `tools:` header is the source of truth).
95
+ * - If a frontmatter block exists but lacks `name:`, a generated name is injected
96
+ * into it.
97
+ * - If there is no frontmatter at all, the prompt is wrapped in a minimal block
98
+ * (no `tools:` → Claude inherits all tools, matching pre-spec-mode behavior).
99
+ */
100
+ export declare function normalizeAgentSpec(md: string): {
101
+ content: string;
102
+ agentName: string;
103
+ };
41
104
  export declare class ClaudeCliProvider implements LLMProvider {
42
105
  private readonly config;
43
106
  private readonly mcpServers;
44
- constructor(config: ClaudeCliConfig, mcpServers?: Record<string, McpServerConfig>);
45
107
  /**
46
- * Build the subprocess environment. Inherits the parent process env and,
47
- * on macOS, tries to inject ANTHROPIC_AUTH_TOKEN from the Claude Code keychain.
48
- * This is required when --bare is set, because --bare skips the settings
49
- * discovery that normally loads Claude Code's auth configuration.
108
+ * Platform-alias tool list derived from the AGENT_TOOL / compiled.tools model.
109
+ *
110
+ * When supplied (via `compileAgent({ platform: "claude_code" }).tools`), this
111
+ * array is the single source of truth for which Claude Code built-ins are
112
+ * permitted — config.allowedBuiltinTools is ignored. When absent, the provider
113
+ * falls back to config.allowedBuiltinTools (legacy / transition-window path).
114
+ *
115
+ * [inv:no-third-tool-model] — one tool-permission source, not two.
116
+ */
117
+ private readonly compiledTools;
118
+ constructor(config: ClaudeCliConfig, mcpServers?: Record<string, McpServerConfig>, compiledTools?: string[]);
119
+ /**
120
+ * Build the subprocess environment for the claude CLI subprocess.
121
+ *
122
+ * Merges the live process.env (PATH, HOME, call-time vars) with the
123
+ * config snapshot (ADHD_AGENT_* vars loaded from the .env hierarchy at
124
+ * startup), with the config snapshot winning on conflicts. This ensures
125
+ * the subprocess inherits both the user's shell context and any overrides
126
+ * loaded via the .env hierarchy — and allows test-injected env vars (e.g.
127
+ * CAPTURE_FILE) to flow through to the subprocess without a module reload.
50
128
  */
51
129
  private buildSubprocessEnv;
52
130
  /**
@@ -60,6 +138,15 @@ export declare class ClaudeCliProvider implements LLMProvider {
60
138
  * Returns undefined if there are no servers to configure.
61
139
  */
62
140
  private writeMcpConfigFile;
141
+ /**
142
+ * Writes an agent-spec markdown system prompt to an isolated temp project dir
143
+ * as `<dir>/.claude/agents/<name>.md`, so the subprocess can discover and
144
+ * parse it via `--add-dir <dir> --setting-sources project --agent <name>`.
145
+ *
146
+ * Returns the temp dir (for `--add-dir`) and the frontmatter agent name (for
147
+ * `--agent`). The caller MUST delete the dir in its finally block.
148
+ */
149
+ private writeAgentSpecDir;
63
150
  chat(request: ProviderChatRequest): Promise<ProviderChatResponse>;
64
151
  }
65
152
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"claudecli.d.ts","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/claudecli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAcH,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAW,MAAM,wBAAwB,CAAC;AAIvF,KAAK,eAAe,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,I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C,EAAE,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAgBrF;AAID,qBAAa,iBAAkB,YAAW,WAAW;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuB;gBAGjD,MAAM,EAAE,eAAe,EACvB,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAM,EAChD,aAAa,CAAC,EAAE,MAAM,EAAE;IAO5B;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;;;;;;;OASG;YACW,kBAAkB;IA8BhC;;;;;;;OAOG;YACW,iBAAiB;IAYzB,IAAI,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAwO1E"}
@@ -21,6 +21,18 @@
21
21
  * ⚠️ --tools "" is NOT used — it disables MCP tools as well as built-ins.
22
22
  * ⚠️ --bare is NOT used — it blocks --mcp-config from loading entirely.
23
23
  *
24
+ * Agent-spec mode (config.systemPromptIsAgentSpec === true):
25
+ * The agent's systemPrompt is treated as a complete Claude Code agent markdown
26
+ * file (YAML frontmatter + body). Instead of --system-prompt + --disallowedTools,
27
+ * the provider writes it to an isolated temp project dir and passes
28
+ * --add-dir <tmpdir> --setting-sources project --agent <frontmatterName>
29
+ * so Claude *internally parses the frontmatter header* — including the `tools:`
30
+ * field — which then governs tool access and TAKES PRECEDENCE over the built-in
31
+ * disallow enumeration. `--agent` matches the frontmatter `name:`, not the
32
+ * filename; cwd is preserved so file/Bash tools keep their working root. Omit
33
+ * `tools:` in the header to inherit all tools; list `mcp__<server>__<tool>`
34
+ * entries to expose specific MCP tools. allowedBuiltinTools is ignored in this mode.
35
+ *
24
36
  * Tool loop: when Claude Code emits a tool_use block, we execute it via the
25
37
  * request.executeTool callback (wired by the orchestrator to the McpClientRegistry)
26
38
  * and write a tool_result message back to stdin. This continues until Claude
@@ -33,18 +45,17 @@
33
45
  * provider will throw PROVIDER_ERROR and the task will fail. Fall back to the
34
46
  * anthropic provider with useClaudeOauth: true for a fully supported path.
35
47
  */
36
- import { spawn, execFile } from "child_process";
48
+ import { spawn } from "child_process";
37
49
  import readline from "readline";
38
- import { promisify } from "util";
39
- import { writeFile, unlink } from "fs/promises";
50
+ import { writeFile, unlink, mkdtemp, mkdir, rm } from "fs/promises";
40
51
  import { tmpdir } from "os";
41
52
  import { join } from "path";
42
- const execFileAsync = promisify(execFile);
43
53
  import { generateId } from "../utils/ids.js";
44
54
  import { nowIso } from "../utils/timestamps.js";
45
55
  import { resolveToolCallName } from "../clients/tool-naming.js";
46
56
  import { ToolError } from "../validation/errors.js";
47
57
  import { logger } from "../logger.js";
58
+ import { config } from "../config.js";
48
59
  // ─── history encoding (for multi-task sessions) ───────────────────────────────
49
60
  /**
50
61
  * Encodes prior session messages as a text block prepended to the current prompt.
@@ -63,9 +74,19 @@ function buildUserMessage(messages) {
63
74
  const last = nonSystem[nonSystem.length - 1];
64
75
  const lines = ["[Conversation history]"];
65
76
  for (const msg of history) {
66
- const label = msg.role === "user" ? "User" :
67
- msg.role === "assistant" ? "Assistant" :
68
- msg.role === "tool" ? "Tool result" : "System";
77
+ let label;
78
+ if (msg.role === "user") {
79
+ label = "User";
80
+ }
81
+ else if (msg.role === "assistant") {
82
+ label = "Assistant";
83
+ }
84
+ else if (msg.role === "tool") {
85
+ label = "Tool result";
86
+ }
87
+ else {
88
+ label = "System";
89
+ }
69
90
  const body = msg.content ??
70
91
  (msg.toolCalls ? `[called tools: ${msg.toolCalls.map(tc => tc.tool).join(", ")}]` : "");
71
92
  lines.push(`${label}: ${body}`);
@@ -76,9 +97,25 @@ function buildUserMessage(messages) {
76
97
  // ─── built-in tool list ───────────────────────────────────────────────────────
77
98
  /**
78
99
  * Complete list of Claude Code built-in tool names (as of Claude Code 1.x).
79
- * All of these are disallowed by default for claudecli agents; only tools
80
- * listed in the agent's `allowedBuiltinTools` are permitted. MCP tools
81
- * (loaded via --mcp-config) are unaffected by this list.
100
+ *
101
+ * All of these are disallowed by default for claudecli agents. The permitted
102
+ * set is resolved from one of two sources in priority order:
103
+ *
104
+ * 1. compiledTools (AGENT_TOOL model) — the platform-alias array produced by
105
+ * `compileAgent({ platform: "claude_code" }).tools` via @adhd/agent-compiler.
106
+ * This is the strategic source of truth: each string is a `TOOL_PLATFORM_BINDING`
107
+ * alias for the `claude_code` platform, derived from AGENT_TOOL grants in the
108
+ * registry. When compiledTools is supplied to the constructor, it is used as
109
+ * the allowed set and config.allowedBuiltinTools is ignored.
110
+ *
111
+ * 2. config.allowedBuiltinTools — the per-agent legacy allowlist (still honoured
112
+ * when no compiled tool set is available, e.g. during the transition window
113
+ * before compiler-integration lands).
114
+ *
115
+ * [inv:no-third-tool-model] — claudecli must NOT maintain an independent third
116
+ * tool-permission list separate from AGENT_TOOL / compiled.tools.
117
+ *
118
+ * MCP tools (loaded via --mcp-config) are unaffected by this list.
82
119
  */
83
120
  const CLAUDE_CODE_BUILTIN_TOOLS = [
84
121
  "Bash",
@@ -97,40 +134,126 @@ const CLAUDE_CODE_BUILTIN_TOOLS = [
97
134
  "NotebookEdit",
98
135
  "Task",
99
136
  ];
137
+ // ─── built-in arg computation (pure, testable seam) ──────────────────────────
138
+ /**
139
+ * Compute the effective allowed built-in set and the `--disallowedTools` argv
140
+ * entries that must be passed to the `claude` CLI subprocess.
141
+ *
142
+ * This is the single source of truth for [inv:no-third-tool-model]: the
143
+ * allowed set is resolved in priority order:
144
+ * 1. `compiledTools` (AGENT_TOOL / compile.tools model) — wins when present.
145
+ * 2. `config.allowedBuiltinTools` — legacy / transition-window fallback.
146
+ *
147
+ * Extracted here so tests can assert the REAL produced argv without spawning
148
+ * a subprocess. `chat()` must call this function; no divergence allowed.
149
+ *
150
+ * @param compiledTools - Platform-alias array from `compileAgent().tools`, or
151
+ * `undefined` when the compiler integration is not available yet.
152
+ * @param allowedBuiltinTools - Per-agent legacy allowlist from config.
153
+ * @returns `{ effectiveAllowed, disallowedArgv }` where `disallowedArgv` is the
154
+ * flat `["--disallowedTools", "<name>", ...]` fragment ready to push into args.
155
+ */
156
+ export function computeClaudeBuiltinArgs(params) {
157
+ const effectiveAllowed = params.compiledTools !== undefined
158
+ ? params.compiledTools // AGENT_TOOL / compiled.tools model wins
159
+ : (params.allowedBuiltinTools ?? []);
160
+ const allowed = new Set(effectiveAllowed);
161
+ const disallowed = CLAUDE_CODE_BUILTIN_TOOLS.filter(t => !allowed.has(t));
162
+ const disallowedArgv = [];
163
+ for (const tool of disallowed) {
164
+ disallowedArgv.push("--disallowedTools", tool);
165
+ }
166
+ return { effectiveAllowed, disallowedArgv };
167
+ }
168
+ // ─── agent-spec (markdown frontmatter) helpers ───────────────────────────────
169
+ /** Fallback identity used when an agent-spec prompt has no frontmatter `name:`. */
170
+ const FALLBACK_SPEC_AGENT_NAME = "agent-mcp-runner";
171
+ const FALLBACK_SPEC_DESCRIPTION = "agent-mcp delegated agent";
172
+ /**
173
+ * Extracts the `name:` field from the leading YAML frontmatter block of a Claude
174
+ * Code agent markdown system prompt. Only the first `---`-delimited block at the
175
+ * very top of the string is considered. Returns undefined when there is no leading
176
+ * frontmatter block or no `name:` key.
177
+ *
178
+ * Claude Code selects an agent (`--agent <name>`) by this frontmatter name — not
179
+ * the on-disk filename — so the provider must read it to build the correct flag.
180
+ */
181
+ export function extractAgentSpecName(md) {
182
+ const block = /^\uFEFF?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(md);
183
+ if (!block)
184
+ return undefined;
185
+ const nameLine = /^[ \t]*name:[ \t]*(.+?)[ \t]*$/m.exec(block[1]);
186
+ if (!nameLine)
187
+ return undefined;
188
+ return nameLine[1].replace(/^["']|["']$/g, "").trim() || undefined;
189
+ }
190
+ /**
191
+ * Ensures an agent-spec markdown carries a frontmatter `name:` so the subprocess
192
+ * can select it with `--agent`. Returns the markdown to write and the agent name
193
+ * to pass to `--agent`.
194
+ *
195
+ * - If the prompt already names the agent, it is used verbatim and the markdown is
196
+ * returned unchanged (the spec author's `tools:` header is the source of truth).
197
+ * - If a frontmatter block exists but lacks `name:`, a generated name is injected
198
+ * into it.
199
+ * - If there is no frontmatter at all, the prompt is wrapped in a minimal block
200
+ * (no `tools:` → Claude inherits all tools, matching pre-spec-mode behavior).
201
+ */
202
+ export function normalizeAgentSpec(md) {
203
+ const existing = extractAgentSpecName(md);
204
+ if (existing)
205
+ return { content: md, agentName: existing };
206
+ const hasFrontmatter = /^\uFEFF?---[ \t]*\r?\n/.test(md);
207
+ if (hasFrontmatter) {
208
+ const content = md.replace(/^(\uFEFF?---[ \t]*\r?\n)/, `$1name: ${FALLBACK_SPEC_AGENT_NAME}\n`);
209
+ return { content, agentName: FALLBACK_SPEC_AGENT_NAME };
210
+ }
211
+ const content = `---\nname: ${FALLBACK_SPEC_AGENT_NAME}\n` +
212
+ `description: ${FALLBACK_SPEC_DESCRIPTION}\n---\n${md}`;
213
+ return { content, agentName: FALLBACK_SPEC_AGENT_NAME };
214
+ }
100
215
  // ─── provider ────────────────────────────────────────────────────────────────
101
216
  export class ClaudeCliProvider {
102
217
  config;
103
218
  mcpServers;
104
- constructor(config, mcpServers = {}) {
219
+ /**
220
+ * Platform-alias tool list derived from the AGENT_TOOL / compiled.tools model.
221
+ *
222
+ * When supplied (via `compileAgent({ platform: "claude_code" }).tools`), this
223
+ * array is the single source of truth for which Claude Code built-ins are
224
+ * permitted — config.allowedBuiltinTools is ignored. When absent, the provider
225
+ * falls back to config.allowedBuiltinTools (legacy / transition-window path).
226
+ *
227
+ * [inv:no-third-tool-model] — one tool-permission source, not two.
228
+ */
229
+ compiledTools;
230
+ constructor(config, mcpServers = {}, compiledTools) {
105
231
  this.config = config;
106
232
  this.mcpServers = mcpServers;
233
+ this.compiledTools = compiledTools;
107
234
  }
108
235
  /**
109
- * Build the subprocess environment. Inherits the parent process env and,
110
- * on macOS, tries to inject ANTHROPIC_AUTH_TOKEN from the Claude Code keychain.
111
- * This is required when --bare is set, because --bare skips the settings
112
- * discovery that normally loads Claude Code's auth configuration.
236
+ * Build the subprocess environment for the claude CLI subprocess.
237
+ *
238
+ * Merges the live process.env (PATH, HOME, call-time vars) with the
239
+ * config snapshot (ADHD_AGENT_* vars loaded from the .env hierarchy at
240
+ * startup), with the config snapshot winning on conflicts. This ensures
241
+ * the subprocess inherits both the user's shell context and any overrides
242
+ * loaded via the .env hierarchy — and allows test-injected env vars (e.g.
243
+ * CAPTURE_FILE) to flow through to the subprocess without a module reload.
113
244
  */
114
- async buildSubprocessEnv() {
115
- const env = { ...process.env };
116
- // If an explicit auth token env var is already present, nothing to do
117
- if (env["ANTHROPIC_AUTH_TOKEN"] || env["ANTHROPIC_API_KEY"]) {
118
- return { env };
245
+ buildSubprocessEnv() {
246
+ const result = {};
247
+ // Start with the live env for full context (PATH, HOME, etc.)
248
+ for (const [k, v] of Object.entries(process.env)) {
249
+ if (v !== undefined)
250
+ result[k] = v;
119
251
  }
120
- let keychainError;
121
- // Try macOS keychain same store as useClaudeOauth in AnthropicProvider
122
- try {
123
- const { stdout } = await execFileAsync("security", ["find-generic-password", "-s", "Claude Code-credentials", "-w"], { encoding: "utf8" });
124
- const parsed = JSON.parse(stdout.trim());
125
- const token = parsed.claudeAiOauth?.accessToken;
126
- if (token)
127
- env["ANTHROPIC_AUTH_TOKEN"] = token;
252
+ // Overlay the config snapshot so ADHD_AGENT_* values from .env files win
253
+ for (const [k, v] of Object.entries(config.subprocessEnv())) {
254
+ result[k] = v;
128
255
  }
129
- catch (err) {
130
- keychainError = err instanceof Error ? err.message : String(err);
131
- logger.warn({ keychainError }, "claudecli: keychain read failed; subprocess will use inherited env");
132
- }
133
- return { env, keychainError };
256
+ return result;
134
257
  }
135
258
  /**
136
259
  * Write the agent's McpServerConfig map to a temp JSON file in the format
@@ -173,6 +296,25 @@ export class ClaudeCliProvider {
173
296
  await writeFile(filePath, JSON.stringify({ mcpServers: mapped }), "utf8");
174
297
  return filePath;
175
298
  }
299
+ /**
300
+ * Writes an agent-spec markdown system prompt to an isolated temp project dir
301
+ * as `<dir>/.claude/agents/<name>.md`, so the subprocess can discover and
302
+ * parse it via `--add-dir <dir> --setting-sources project --agent <name>`.
303
+ *
304
+ * Returns the temp dir (for `--add-dir`) and the frontmatter agent name (for
305
+ * `--agent`). The caller MUST delete the dir in its finally block.
306
+ */
307
+ async writeAgentSpecDir(md) {
308
+ const { content, agentName } = normalizeAgentSpec(md);
309
+ const dir = await mkdtemp(join(tmpdir(), "agent-mcp-spec-"));
310
+ const agentsDir = join(dir, ".claude", "agents");
311
+ await mkdir(agentsDir, { recursive: true });
312
+ // The filename does not affect selection (Claude matches the frontmatter
313
+ // name), but sanitize it so an exotic agent name can't escape the dir.
314
+ const safeFile = `${agentName.replace(/[^a-zA-Z0-9_-]/g, "_") || "agent"}.md`;
315
+ await writeFile(join(agentsDir, safeFile), content, "utf8");
316
+ return { dir, agentName };
317
+ }
176
318
  async chat(request) {
177
319
  const claudePath = this.config.claudePath ?? "claude";
178
320
  const systemMessages = request.messages.filter(m => m.role === "system");
@@ -183,10 +325,27 @@ export class ClaudeCliProvider {
183
325
  // we do NOT use --bare. CLAUDE.md will be injected but --system-prompt
184
326
  // replaces the full default system prompt, keeping the agent's identity.
185
327
  const mcpConfigPath = await this.writeMcpConfigFile();
186
- // Compute the disallowed built-in list: everything in CLAUDE_CODE_BUILTIN_TOOLS
187
- // that is NOT listed in the agent's allowedBuiltinTools allowlist.
188
- const allowed = new Set(this.config.allowedBuiltinTools ?? []);
189
- const disallowed = CLAUDE_CODE_BUILTIN_TOOLS.filter(t => !allowed.has(t));
328
+ // Agent-spec mode: the system prompt IS a Claude Code agent markdown file
329
+ // (frontmatter + body). We write it to a temp project dir and let Claude
330
+ // internally parse its `tools:` header, which then governs tool access and
331
+ // takes precedence over --disallowedTools. Requires a system prompt to wrap.
332
+ const specMode = this.config.systemPromptIsAgentSpec === true && !!systemPrompt;
333
+ let agentSpecDir;
334
+ let agentSpecName;
335
+ if (specMode && systemPrompt) {
336
+ const written = await this.writeAgentSpecDir(systemPrompt);
337
+ agentSpecDir = written.dir;
338
+ agentSpecName = written.agentName;
339
+ }
340
+ // Compute the disallowed built-in list via the extracted pure seam.
341
+ // Source of truth priority ([inv:no-third-tool-model]) is enforced inside
342
+ // computeClaudeBuiltinArgs — compiledTools wins over allowedBuiltinTools.
343
+ // Used only in the legacy (non-spec) path below; in spec mode the agent
344
+ // md `tools:` header is the single source of truth.
345
+ const { disallowedArgv } = computeClaudeBuiltinArgs({
346
+ compiledTools: this.compiledTools,
347
+ allowedBuiltinTools: this.config.allowedBuiltinTools,
348
+ });
190
349
  const args = [
191
350
  "-p",
192
351
  "--dangerously-skip-permissions", // no interactive permission prompts
@@ -194,14 +353,27 @@ export class ClaudeCliProvider {
194
353
  "--output-format", "stream-json",
195
354
  "--verbose",
196
355
  ];
197
- // Block every built-in that the agent definition doesn't explicitly allow.
198
- // --disallowedTools accepts individual tool names as separate flag pairs.
199
- // MCP tools are not affected they're loaded via --mcp-config separately.
200
- for (const tool of disallowed) {
201
- args.push("--disallowedTools", tool);
356
+ if (specMode && agentSpecDir && agentSpecName) {
357
+ // Header-driven tools: Claude parses the agent md's frontmatter `tools:`
358
+ // and applies it as the authoritative allowlist. We must NOT pass
359
+ // --disallowedTools or --system-prompt here — the spec header is the
360
+ // single source of truth. --add-dir makes the temp `.claude/agents/<name>.md`
361
+ // discoverable; --setting-sources project loads it; --agent selects it by
362
+ // its frontmatter name (cwd is preserved, so file/Bash tools keep their root).
363
+ args.push("--add-dir", agentSpecDir, "--setting-sources", "project", "--agent", agentSpecName);
364
+ if (this.config.allowedBuiltinTools?.length) {
365
+ logger.warn({ agent: agentSpecName }, "claudecli: allowedBuiltinTools is ignored when systemPromptIsAgentSpec is set; the agent spec's `tools:` header governs tool access");
366
+ }
367
+ }
368
+ else {
369
+ // Legacy denylist behavior: block every built-in the agent definition
370
+ // doesn't explicitly allow, via the compiledTools-aware seam
371
+ // ([inv:no-third-tool-model] — compiledTools wins over allowedBuiltinTools).
372
+ // MCP tools are unaffected — loaded via --mcp-config separately.
373
+ args.push(...disallowedArgv);
374
+ if (systemPrompt)
375
+ args.push("--system-prompt", systemPrompt);
202
376
  }
203
- if (systemPrompt)
204
- args.push("--system-prompt", systemPrompt);
205
377
  if (this.config.model)
206
378
  args.push("--model", this.config.model);
207
379
  if (mcpConfigPath) {
@@ -209,7 +381,7 @@ export class ClaudeCliProvider {
209
381
  // alongside our explicit config (avoids double-spawning agent-mcp)
210
382
  args.push("--mcp-config", mcpConfigPath, "--strict-mcp-config");
211
383
  }
212
- const { env: subEnv, keychainError } = await this.buildSubprocessEnv();
384
+ const subEnv = this.buildSubprocessEnv();
213
385
  const proc = spawn(claudePath, args, {
214
386
  stdio: ["pipe", "pipe", "pipe"],
215
387
  env: subEnv,
@@ -305,8 +477,9 @@ export class ClaudeCliProvider {
305
477
  }
306
478
  proc.stdin.end();
307
479
  if (!finalResult) {
308
- throw new ToolError("PROVIDER_AUTH_ERROR", `Claude CLI returned empty result${keychainError ? `. Keychain error: ${keychainError}` : ""}. ` +
309
- `Set ANTHROPIC_AUTH_TOKEN (run \`claude setup-token\` to obtain an OAuth access token) or use authTokenEnv in the provider config`);
480
+ throw new ToolError("PROVIDER_AUTH_ERROR", "Claude CLI returned empty result. " +
481
+ "Ensure `claude auth status` shows a valid login. " +
482
+ "To use the Anthropic API instead, set ADHD_AGENT_ANTHROPIC_SECRET in your ~/.adhd/.env.");
310
483
  }
311
484
  const message = {
312
485
  id: generateId(),
@@ -327,6 +500,10 @@ export class ClaudeCliProvider {
327
500
  if (mcpConfigPath) {
328
501
  unlink(mcpConfigPath).catch(() => { });
329
502
  }
503
+ // Clean up the temp agent-spec project dir
504
+ if (agentSpecDir) {
505
+ rm(agentSpecDir, { recursive: true, force: true }).catch(() => { });
506
+ }
330
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GAAG,EAAE,GAAqB,CAAC,CAAC,CAAC;YAC1F,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
@@ -6,5 +6,5 @@ import type { LLMProvider } from "./types.js";
6
6
  * @param mcpServers - The agent's MCP server configs. Only used by ClaudeCliProvider
7
7
  * to build the --mcp-config inline JSON passed to the claude subprocess.
8
8
  */
9
- export declare function createProvider(config: ProviderConfig, mcpServers?: Record<string, McpServerConfig>): LLMProvider;
9
+ export declare function createProvider(providerConfig: ProviderConfig, mcpServers?: Record<string, McpServerConfig>): LLMProvider;
10
10
  //# sourceMappingURL=factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAK9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,MAAM,EAAE,cAAc,EACtB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAC7C,WAAW,CAeb"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;GAKG;AACH,wBAAgB,cAAc,CAC1B,cAAc,EAAE,cAAc,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAC7C,WAAW,CAab"}
@@ -1,6 +1,5 @@
1
1
  import { AnthropicProvider } from "./anthropic.js";
2
2
  import { ClaudeCliProvider } from "./claudecli.js";
3
- import { LMStudioProvider } from "./lmstudio.js";
4
3
  import { OpenAIProvider } from "./openai.js";
5
4
  /**
6
5
  * Creates an LLM provider from a ProviderConfig discriminated union.
@@ -8,18 +7,16 @@ import { OpenAIProvider } from "./openai.js";
8
7
  * @param mcpServers - The agent's MCP server configs. Only used by ClaudeCliProvider
9
8
  * to build the --mcp-config inline JSON passed to the claude subprocess.
10
9
  */
11
- export function createProvider(config, mcpServers) {
12
- switch (config.type) {
10
+ export function createProvider(providerConfig, mcpServers) {
11
+ switch (providerConfig.type) {
13
12
  case "anthropic":
14
- return new AnthropicProvider(config);
13
+ return new AnthropicProvider(providerConfig);
15
14
  case "claudecli":
16
- return new ClaudeCliProvider(config, mcpServers ?? {});
15
+ return new ClaudeCliProvider(providerConfig, mcpServers ?? {});
17
16
  case "openai":
18
- return new OpenAIProvider(config);
19
- case "lmstudio":
20
- return new LMStudioProvider(config);
17
+ return new OpenAIProvider(providerConfig);
21
18
  default: {
22
- const exhaustive = config;
19
+ const exhaustive = providerConfig;
23
20
  throw new Error(`Unknown provider type: ${exhaustive.type}`);
24
21
  }
25
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC1B,MAAsB,EACtB,UAA4C;IAE5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,WAAW;YACZ,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,KAAK,WAAW;YACZ,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;QAC3D,KAAK,QAAQ;YACT,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QACtC,KAAK,UAAU;YACX,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,CAAC,CAAC;YACN,MAAM,UAAU,GAAU,MAAM,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,0BAA2B,UAA+B,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,CAAC;IACL,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC1B,cAA8B,EAC9B,UAA4C;IAE5C,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;QAC1B,KAAK,WAAW;YACZ,OAAO,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACjD,KAAK,WAAW;YACZ,OAAO,IAAI,iBAAiB,CAAC,cAAc,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;QACnE,KAAK,QAAQ;YACT,OAAO,IAAI,cAAc,CAAC,cAAc,CAAC,CAAC;QAC9C,OAAO,CAAC,CAAC,CAAC;YACN,MAAM,UAAU,GAAU,cAAc,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,0BAA2B,UAA+B,CAAC,IAAI,EAAE,CAAC,CAAC;QACvF,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export { AnthropicProvider } from "./anthropic.js";
2
2
  export { OpenAIProvider } from "./openai.js";
3
- export { LMStudioProvider } from "./lmstudio.js";
3
+ export { ClaudeCliProvider, computeClaudeBuiltinArgs } from "./claudecli.js";
4
4
  export { createProvider } from "./factory.js";
5
5
  export type { LLMProvider, ProviderChatRequest, ProviderChatResponse, ToolDefinition } from "./types.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { AnthropicProvider } from "./anthropic.js";
2
2
  export { OpenAIProvider } from "./openai.js";
3
- export { LMStudioProvider } from "./lmstudio.js";
3
+ export { ClaudeCliProvider, computeClaudeBuiltinArgs } from "./claudecli.js";
4
4
  export { createProvider } from "./factory.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ai/agent-mcp/src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}