@salesforce/sfdx-agent-harness-claude 0.21.0 → 0.23.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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to `@salesforce/sfdx-agent-harness-claude` are documented in this file.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
+ ## [0.23.0] - 2026-06-29
7
+
8
+ ### Fixes
9
+ - **harness-claude**: make multi-file skills reachable via load_skill @W-23231661 ([#627](https://github.com/forcedotcom/agentic-dx/pull/627))
10
+
11
+ ## [0.22.0] - 2026-06-29
12
+
13
+ ### Features
14
+ - **harness-claude**: consult tool-approval policy resolver at gate sites @W-23090029 ([#624](https://github.com/forcedotcom/agentic-dx/pull/624))
15
+
6
16
  ## [0.21.0] - 2026-06-24
7
17
 
8
18
  ### Chores
package/README.md CHANGED
@@ -38,16 +38,18 @@ internal architecture, see [ARCHITECTURE.md](ARCHITECTURE.md).
38
38
 
39
39
  ## Public API
40
40
 
41
- | Export | Kind | Description |
42
- | ----------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43
- | `ClaudeHarnessFactory` | class | `HarnessFactory` that produces a Claude-backed `AgentHarness` bound to a storage root. |
44
- | `ClaudeHarnessFactoryConfig` | interface | Configuration for `ClaudeHarnessFactory` (`permissionMode`, optional `queryDefaults`, `toolApprovalTimeoutMs`, `bypassApprovalTools`, `subprocessEnv`). |
45
- | `ClaudeHarnessPermissionMode` | type | Narrowed permission mode: `'bypassPermissions' \| 'acceptEdits' \| 'plan'`. |
46
- | `ClaudeAgentHarness` | type | Branded `AgentHarness` subtype carrying the Claude-specific config inference. Inferred at `manager.createAgent` automatically — annotation rarely needed. |
47
- | `ClaudeAgentConfig` | type | `AgentConfig` extended with Claude-only fields (`skillSearch`, `toolSearch`). |
48
- | `ClaudeSkillSearchConfig` | type | Shape of `ClaudeAgentConfig.skillSearch` (`topK`). Opts the in-process `skill_bridge` MCP server into search-on-demand mode. |
49
- | `ClaudeToolSearchConfig` | type | Shape of `ClaudeAgentConfig.toolSearch` (`alwaysActive`). Stamps `_meta['anthropic/alwaysLoad']` on matching tools so they bypass Claude tool-search deferral. |
50
- | `ClaudeQueryDefaults` | type | Consumer-overridable defaults for the Claude `query()` call (excludes `model`). |
41
+ | Export | Kind | Description |
42
+ | ------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
43
+ | `ClaudeHarnessFactory` | class | `HarnessFactory` that produces a Claude-backed `AgentHarness` bound to a storage root. |
44
+ | `ClaudeHarnessFactoryConfig` | interface | Configuration for `ClaudeHarnessFactory` (`permissionMode`, optional `queryDefaults`, `toolApprovalTimeoutMs`, deprecated `bypassApprovalTools`, `subprocessEnv`). |
45
+ | `CLAUDE_BUILT_IN_TOOL_POLICIES` | const | Frozen `ReadonlyArray<ToolPolicyRule>` the harness feeds the SDK's `resolveToolApprovalPolicy` as the `tiers.harness` slice — `require-approval` rules for Claude's mutating built-ins `Bash` / `Edit` / `MultiEdit` / `Write` / `NotebookEdit`. |
46
+ | `CLAUDE_BUILT_IN_TOOL_NAMES` | const | The five built-in tool names `CLAUDE_BUILT_IN_TOOL_POLICIES` covers. |
47
+ | `ClaudeHarnessPermissionMode` | type | Narrowed permission mode: `'bypassPermissions' \| 'acceptEdits' \| 'plan'`. |
48
+ | `ClaudeAgentHarness` | type | Branded `AgentHarness` subtype carrying the Claude-specific config inference. Inferred at `manager.createAgent` automatically — annotation rarely needed. |
49
+ | `ClaudeAgentConfig` | type | `AgentConfig` extended with Claude-only fields (`skillSearch`, `toolSearch`). |
50
+ | `ClaudeSkillSearchConfig` | type | Shape of `ClaudeAgentConfig.skillSearch` (`topK`). Opts the in-process `skill_bridge` MCP server into search-on-demand mode. |
51
+ | `ClaudeToolSearchConfig` | type | Shape of `ClaudeAgentConfig.toolSearch` (`alwaysActive`). Stamps `_meta['anthropic/alwaysLoad']` on matching tools so they bypass Claude tool-search deferral. |
52
+ | `ClaudeQueryDefaults` | type | Consumer-overridable defaults for the Claude `query()` call (excludes `model`). |
51
53
 
52
54
  ### Permission modes
53
55
 
@@ -59,9 +61,9 @@ prompt source:
59
61
  - `'plan'` — planning mode; the model proposes actions without executing.
60
62
 
61
63
  `'default'`, `'dontAsk'`, and `'auto'` are intentionally excluded because they require a prompt UI the harness does not
62
- provide. For human-in-the-loop gating, set `StreamOptions.requireToolApproval: true` per-call instead — the harness
63
- installs a `PreToolUse` SDK hook for that turn that gates every tool call through the SDK's `tool-approval-request` flow
64
- regardless of the factory-pinned permission mode.
64
+ provide. For human-in-the-loop gating, configure `AgentConfig.toolPolicies` (see "Tool-approval policy" below) — when
65
+ gating engages, the harness installs a `PreToolUse` SDK hook for the turn that resolves every tool call through the
66
+ SDK's policy resolver, regardless of the factory-pinned permission mode.
65
67
 
66
68
  ### HTTPS proxy routing
67
69
 
@@ -103,6 +105,11 @@ meta keeps both tools exempt from Claude tool-search deferral.
103
105
 
104
106
  When `skillSearch` is unset (the default), the existing description-enumeration behavior is preserved unchanged.
105
107
 
108
+ **Multi-file skills.** `load_skill` returns the `SKILL.md` body prefixed with the skill's on-disk location (its
109
+ directory and absolute `SKILL.md` path), so a skill whose body references sibling files (e.g. `references/api-guide.md`,
110
+ `assets/...`) gives the model an absolute anchor to read them — including when the skill lives outside the agent's
111
+ project directory. This holds in both the default and `skillSearch` modes.
112
+
106
113
  ### Tool-exposure policy (`toolSearch.alwaysActive`)
107
114
 
108
115
  The Claude Agent SDK enables tool-search deferral once the active tool surface crosses a threshold (≈ tens of tools);
@@ -153,26 +160,49 @@ capabilities and caps — an unsupported format, an oversized file, or too many
153
160
  `AgentSDKError(MULTIMODAL_NOT_SUPPORTED)`; a malformed input part rejects with `INVALID_MESSAGE_CONTENT`. The caps
154
161
  mirror the gateway SDK's conservative limits so a file behaves identically here and on the Mastra harness.
155
162
 
156
- ### Tool approval
163
+ ### Tool-approval policy
164
+
165
+ The harness gates harness-executed tools through the SDK's `resolveToolApprovalPolicy` (configure rules via
166
+ `AgentConfig.toolPolicies` / `AgentConfig.defaultToolDecision` — see the SDK README). The `PreToolUse` hook is the
167
+ decision site: for each non-consumer tool it resolves a decision and acts on it:
168
+
169
+ - **`allow`** — the tool runs without surfacing a `tool-approval-request`.
170
+ - **`deny`** — the SDK synthesizes a `tool_result(isError=true)` so the model can recover; no `tool-approval-request`
171
+ surfaces and the assistant turn continues.
172
+ - **`require-approval`** — a `tool-approval-request` is emitted and the SDK hook parks until the consumer settles via
173
+ `chatSession.approveToolCall(toolCallId)` / `declineToolCall(toolCallId)`.
174
+
175
+ Gating is **opt-in**: it engages only when the agent's config sets `toolPolicies` or `defaultToolDecision`, or the
176
+ `chat()` call sets the deprecated `requireToolApproval` or `batchApprovals`. With none configured, tools run without
177
+ gating (no `PreToolUse` hook is installed), matching the SDK's "no policy ⇒ no gating" default. The harness adds
178
+ `CLAUDE_BUILT_IN_TOOL_POLICIES` (`require-approval` rules for the mutating built-ins `Bash` / `Edit` / `MultiEdit` /
179
+ `Write` / `NotebookEdit`) as the `tiers.harness` slice and the SDK's `skill_bridge` meta-tool rules as `allow` defaults,
180
+ so capability-discovery never prompts and read-only built-ins (`Read` / `Glob` / `Grep` / `Task`) run free by absence.
181
+ Consumer-executed tools (`AgentConfig.tools`) always bypass the gate — their execution is the consumer's responsibility
182
+ via `submitToolResult`. Set `StreamOptions.batchApprovals: true` to surface parallel `require-approval` requests on one
183
+ stream for a batch-approval UI.
184
+
185
+ > `StreamOptions.requireToolApproval` is **deprecated** — superseded by per-tool `AgentConfig.toolPolicies`. It still
186
+ > works for one release: a truthy value engages all-or-nothing gating (every non-consumer tool requires approval), and
187
+ > `'batch'` maps onto `batchApprovals`.
157
188
 
158
- When `StreamOptions.requireToolApproval: true` is set on `chatSession.chat()`, the harness installs a `PreToolUse` hook
159
- that:
189
+ Unlike Mastra (which suspends every tool and re-stamps a declined native result), Claude's `deny` is the SDK's native
190
+ `permissionDecision: 'deny'` — the Claude Agent SDK synthesizes the `tool_result(isError=true)` itself, so no
191
+ re-stamping is needed.
160
192
 
161
- 1. Emits a `tool-approval-request` event on the `chat()`-returned `eventStream` carrying
162
- `{ toolCall: { toolCallId, toolName, args } }`.
163
- 2. Parks the SDK hook Promise until the consumer calls `chatSession.approveToolCall(toolCallId)` or
164
- `chatSession.declineToolCall(toolCallId)`. Settle methods return `Promise<void>`.
193
+ The `require-approval` flow on the `chat()`-returned `eventStream`:
194
+
195
+ 1. Emits a `tool-approval-request` event carrying `{ toolCall: { toolCallId, toolName, args } }`.
196
+ 2. Parks the SDK hook Promise until the consumer settles (`approveToolCall` / `declineToolCall` return `Promise<void>`).
165
197
  3. Continues delivering events on the **same** `eventStream` after the consumer settles — the resulting `tool-result`,
166
- the model's follow-up `text-delta` events, and the terminal `finish` all arrive on that one stream. The consumer
167
- keeps iterating until it sees `finish`.
198
+ the model's follow-up `text-delta` events, and the terminal `finish` all arrive on that one stream.
168
199
  - On **approve**: the SDK's `tool_use` runs and the `tool-result` lands on the stream.
169
200
  - On **decline**: the SDK synthesizes a `tool_result` with `isError: true`, the model receives the denial and emits
170
- an acknowledgement, then `finish`. The decline does **not** abort the assistant turn. The decline message is
171
- hard-coded to `'User declined the tool call.'`.
201
+ an acknowledgement, then `finish`. The decline does **not** abort the assistant turn.
172
202
 
173
203
  This is the post-#529 single-stream-per-turn contract — see the SDK README's "Tool Approval Flow" for consumer-facing
174
- patterns. Single-tool approve / decline, parallel batches (`requireToolApproval: 'batch'`), approval-timeout
175
- enforcement, `abortSignal` propagation, and shutdown / `destroyThread` cleanup all share that contract.
204
+ patterns. Single-tool approve / decline, parallel batches (`batchApprovals: true`), approval-timeout enforcement,
205
+ `abortSignal` propagation, and shutdown / `destroyThread` cleanup all share that contract.
176
206
 
177
207
  #### Abort signal
178
208
 
@@ -355,57 +385,50 @@ const agent = await manager.createAgent(projectRoot, {
355
385
 
356
386
  // In your event loop, answer the consumer tool's `tool-call` via
357
387
  // `session.submitToolResult({ toolCallId, toolName, result })`. Consumer
358
- // tools never reach the approval gate (the harness adds the consumer-tool
359
- // wire prefix to `bypassApprovalTools` automatically — see #529 step 2b).
360
- // They surface as a normal `tool-call` event with no preceding
361
- // `tool-approval-request`, even when `requireToolApproval: true`.
388
+ // tools never reach the approval gate — the options builder's `PreToolUse`
389
+ // matcher excludes the consumer-tool wire prefix unconditionally, so they
390
+ // surface as a normal `tool-call` event with no preceding
391
+ // `tool-approval-request`, regardless of any policy configured.
362
392
  ```
363
393
 
364
394
  This is the recommended pattern when the consumer wants identical behavior across Mastra and Claude. For Claude-only
365
395
  consumers who prefer to drive the built-in directly, see "Bypassing the approval gate for specific tools" below.
366
396
 
367
- ### Bypassing the approval gate for specific tools
397
+ ### Bypassing the approval gate for specific tools (deprecated)
398
+
399
+ > **Deprecated.** `ClaudeHarnessFactoryConfig.bypassApprovalTools` is superseded by per-tool `AgentConfig.toolPolicies`
400
+ > (e.g. `definePolicy({ AskUserQuestion: 'allow' })`). It still works for one release — the harness runtime-merges the
401
+ > list into the policy resolver as synthetic `'allow'` rules (the `tiers.factory` slice) and logs a once-per-process
402
+ > warning pointing at `toolPolicies`. It is removed in a later phase. Prefer `toolPolicies` for new code.
368
403
 
369
- When `requireToolApproval: true` is set, every built-in / MCP tool call reaches the coordinator's `PreToolUse` hook by
370
- default — including Claude built-ins like `AskUserQuestion`. (Consumer-declared tools from `AgentConfig.tools[i]`
371
- already bypass automatically — see "Tool approval" above.) `ClaudeHarnessFactoryConfig.bypassApprovalTools` opts
372
- additional tool names out of the gate.
404
+ When gating is active, every built-in / MCP tool call reaches the `PreToolUse` hook, which resolves it against the
405
+ policy resolver. (Consumer-declared tools from `AgentConfig.tools[i]` always bypass — see "Tool-approval policy" above.)
406
+ `bypassApprovalTools` opts specific tool names to `'allow'`:
373
407
 
374
408
  ```ts
375
409
  const harnessFactory = new ClaudeHarnessFactory({
376
410
  permissionMode: 'bypassPermissions',
377
- // Even when `requireToolApproval: true`, calls to these tools bypass the
378
- // PreToolUse hook. They still emit `tool-call` / `tool-result` ChatEvents,
379
- // so the consumer can drive their UX off the `tool-call` directly.
380
- bypassApprovalTools: [
381
- 'AskUserQuestion', // Claude built-in
382
- 'ask_user_tool', // consumer-declared (also bypassed automatically; listing here is harmless)
383
- ],
411
+ // DEPRECATED — equivalent to:
412
+ // toolPolicies: definePolicy({ AskUserQuestion: 'allow' })
413
+ // Calls to these tools resolve to 'allow'; they still emit `tool-call` /
414
+ // `tool-result` ChatEvents so the consumer can drive UX off the `tool-call`.
415
+ bypassApprovalTools: ['AskUserQuestion'],
384
416
  });
385
417
  ```
386
418
 
387
- Tool names use the **consumer-facing** form — the bare `AgentConfig.tools[i].name` for consumer-declared tools, the
388
- SDK-built-in name for Claude built-ins (no `mcp__<bridge>__` prefix needed). The harness expands each entry into the
389
- underlying wire-prefixed form (`mcp__sfdx-agent-sdk-consumer-tools__<name>`) where applicable so consumer tools bypass
390
- correctly without consumers needing to know the internal namespacing.
391
-
392
- `bypassApprovalTools` is encoded as a negative-lookahead regex on the SDK `PreToolUse` hook's `matcher` field, so
393
- non-matching tools fall through to the SDK's permission cache and run natively under the factory-pinned
394
- `permissionMode`. The flag is Claude-only by design; Mastra has no equivalent because its approval pipeline gates
395
- consumer-declared tools differently.
396
-
397
- For bypassed consumer tools, the chat stream emits the `tool-call` ChatEvent and a synthetic `finish('tool-calls')` on
398
- the same `eventStream` (the SDK contract for client-side tools — see `ToolDefinition` JSDoc). The consumer runs the tool
399
- locally and calls `submitToolResult` with the result; the agent loop continues on the same `eventStream` (post-#529
400
- single-stream-per-turn contract).
419
+ The names become synthetic `{ type: 'builtin', name, decision: 'allow' }` rules in the resolver's `tiers.factory` slice.
420
+ They sit below the SDK built-ins and the harness built-ins but above consumer `toolPolicies`, so a consumer `deny` of
421
+ the same tool still wins (cross-tier deny-wins). Bare-name form only — consumer-declared tools already bypass via the
422
+ always-on consumer-tool prefix, so the old dual-form (`mcp__sfdx-agent-sdk-consumer-tools__<name>`) expansion is no
423
+ longer needed.
401
424
 
402
425
  > **Note:** `permissionMode: 'plan'` denies mutating built-ins (`Edit`, `Write`, `Bash`, …) at the SDK's permission
403
- > cache rather than running them natively. Bypassing such a tool with `bypassApprovalTools` does not "unlock" it under
404
- > plan mode — the SDK still denies it. Plan mode applies to the whole subprocess; this flag only chooses whether the
405
- > harness's coordinator gets a say.
426
+ > cache rather than running them natively. Resolving such a tool to `'allow'` does not "unlock" it under plan mode — the
427
+ > SDK still denies it. Plan mode applies to the whole subprocess; the policy resolver only chooses whether the harness's
428
+ > coordinator gates the call.
406
429
 
407
- When `bypassApprovalTools` is undefined or empty (default), every built-in / MCP tool call reaches the coordinator — no
408
- behavior change for existing consumers. (Consumer-declared tools always bypass.)
430
+ When `bypassApprovalTools` is undefined or empty and no `toolPolicies` / `defaultToolDecision` is set, gating is off and
431
+ no `PreToolUse` hook is installed — no behavior change for existing consumers. (Consumer-declared tools always bypass.)
409
432
 
410
433
  ### Tool-result redaction
411
434
 
@@ -1,5 +1,5 @@
1
1
  import type { HookCallback, SDKMessage } from '@anthropic-ai/claude-agent-sdk';
2
- import { type ChatEvent } from '@salesforce/sfdx-agent-sdk';
2
+ import { type ChatEvent, type Decision, type ToolInvocation } from '@salesforce/sfdx-agent-sdk';
3
3
  import { GenSink } from '@salesforce/sfdx-agent-sdk/harness';
4
4
  import type { ClaudeEventAdapter, McpToolMetadataLookup } from './claude-event-adapter.js';
5
5
  export interface ClaudeApprovalCoordinatorOptions {
@@ -28,6 +28,31 @@ export interface ClaudeApprovalCoordinatorOptions {
28
28
  * to natural park collecting approvals.
29
29
  */
30
30
  mode?: 'serial' | 'batch';
31
+ /**
32
+ * Per-tool policy resolver (Phase 2b). When present, the approval gate is
33
+ * active: {@link preToolUseHook} resolves each fired tool to a
34
+ * {@link Decision} and routes it — `'allow'` ⇒ immediate
35
+ * `permissionDecision: 'allow'`; `'deny'` ⇒ immediate
36
+ * `permissionDecision: 'deny'` (the Claude Agent SDK synthesizes
37
+ * `tool_result(is_error=true)` natively, so no re-stamp is needed);
38
+ * `'require-approval'` ⇒ emit `tool-approval-request` and park. The harness
39
+ * supplies this (closing over the SDK's `resolveToolApprovalPolicy` +
40
+ * `CLAUDE_BUILT_IN_TOOL_POLICIES` + the deprecated `bypassApprovalTools`
41
+ * factory tier) only when its opt-in gating predicate engaged; the hook is
42
+ * wired iff this is present, so a missing resolver here can only be reached
43
+ * defensively (it falls back to `'require-approval'`).
44
+ */
45
+ lookupPolicy?: (invocation: ToolInvocation) => Decision;
46
+ /**
47
+ * Names of the consumer-executed tools (`AgentConfig.tools[i].name`) on
48
+ * this stream. Consumer tools bypass the gate by construction (the options
49
+ * builder's matcher already keeps them from firing the hook); this set is
50
+ * the defense-in-depth second enforcement point — if one somehow reached
51
+ * the hook or the batch front-load, it is silently auto-approved and the
52
+ * policy resolver is never consulted for it, so a stray `toolPolicies` rule
53
+ * can never gate a consumer tool. Mirrors Mastra's `consumerToolNames`.
54
+ */
55
+ consumerToolNames?: ReadonlySet<string>;
31
56
  /**
32
57
  * Logical bridge server name for the consumer-tools bridge. The
33
58
  * coordinator strips this prefix on `tool-call` / `tool-result`
@@ -47,6 +72,8 @@ export declare class ClaudeApprovalCoordinator {
47
72
  private readonly abortController;
48
73
  private readonly lookupMcpToolMetadata?;
49
74
  private readonly mode;
75
+ private readonly lookupPolicy?;
76
+ private readonly consumerToolNames;
50
77
  private readonly consumerToolBridgePrefix;
51
78
  /** Single per-turn sink. Issue #529 contract: one stream per turn. */
52
79
  private readonly initial;
@@ -216,13 +243,53 @@ export declare class ClaudeApprovalCoordinator {
216
243
  * AFTER the cache, so ~70% of tool calls slipped past the gate — see
217
244
  * #484).
218
245
  *
219
- * Consumer-executed tools never reach this hook because the options
220
- * builder unconditionally bypasses the consumer-tool wire prefix in the
221
- * matcher (#529 step 2b decouple). That keeps the parker path the
222
- * single source of truth for consumer-tool lifecycle and lets this
223
- * hook focus on built-in / external-MCP tool gating.
246
+ * **The hook is the decision site (Phase 2b).** The options builder's
247
+ * matcher only keeps consumer-executed tools from firing — every other
248
+ * tool reaches here, and the hook resolves it against the policy resolver
249
+ * ({@link lookupPolicy}) and routes the {@link Decision}:
250
+ * - `'allow'` ⇒ resolve `permissionDecision: 'allow'` immediately; no
251
+ * `tool-approval-request`.
252
+ * - `'deny'` ⇒ resolve `permissionDecision: 'deny'` immediately; no
253
+ * `tool-approval-request`, no `decision: 'block'` (the agentic loop
254
+ * continues so the model can recover from the `tool_result(is_error=
255
+ * true)` the Claude Agent SDK synthesizes natively from the deny —
256
+ * unlike Mastra, no re-stamp is needed).
257
+ * - `'require-approval'` ⇒ emit `tool-approval-request` and park.
258
+ *
259
+ * A static name matcher cannot make this decision — the Claude CLI injects
260
+ * an un-enumerable built-in catalog and annotation-driven rules aren't
261
+ * expressible as a name regex — so the matcher is a pure consumer-tool
262
+ * exclusion and the resolver is consulted per fire.
224
263
  */
225
264
  readonly preToolUseHook: HookCallback;
265
+ /**
266
+ * Build the {@link ToolInvocation} the policy resolver matches against from
267
+ * a Claude-namespaced wire tool name. The single source of the
268
+ * `(serverName, toolName, annotations)` identity that drives an approval
269
+ * decision — mirrors the enrichment the adapter stamps on
270
+ * `tool-call` / `tool-result` events so the decision can never diverge from
271
+ * what the consumer observes.
272
+ *
273
+ * Three shapes:
274
+ * - `mcp__skill_bridge__<tool>` ⇒ `{ toolName: <tool>, serverName:
275
+ * 'skill_bridge' }`. Claude carries this identity natively in the wire
276
+ * name (the in-process `skill_bridge` MCP server), so the SDK's
277
+ * `mcp:skill_bridge:*` allow rules match. The in-process server is NOT
278
+ * in the external MCP catalog, so {@link lookupMcpToolMetadata} can't
279
+ * resolve it — hence the explicit prefix check first.
280
+ * - `mcp__<server>__<tool>` for an external server ⇒ un-namespaced
281
+ * `{ toolName: <tool>, serverName: <server>, annotations? }`.
282
+ * - bare built-in (`Bash`, `Read`, …) ⇒ `{ toolName }` (no `serverName`,
283
+ * so it matches `{ type: 'builtin' }` rules).
284
+ */
285
+ private buildToolInvocation;
286
+ /**
287
+ * Policy decision for a tool by wire name. Used by {@link route}'s batch
288
+ * front-load to emit a `tool-approval-request` only for `require-approval`
289
+ * tools. The `'require-approval'` fallback is defensive (the front-load is
290
+ * reachable only when gating is active, so `lookupPolicy` is present).
291
+ */
292
+ private policyFor;
226
293
  private emitApprovalRequest;
227
294
  private enrichmentFor;
228
295
  private handleApprovalTimeout;
@@ -2,7 +2,7 @@
2
2
  * Copyright 2026, Salesforce, Inc. All rights reserved.
3
3
  * See LICENSE.txt for license terms.
4
4
  */
5
- import { AgentSDKError, AgentSDKErrorType, } from '@salesforce/sfdx-agent-sdk';
5
+ import { AgentSDKError, AgentSDKErrorType, SKILL_BRIDGE_SERVER_ID, } from '@salesforce/sfdx-agent-sdk';
6
6
  import { GenSink } from '@salesforce/sfdx-agent-sdk/harness';
7
7
  /**
8
8
  * Per-turn coordinator that subsumes the pre-#529 `ClaudeStreamBroker` +
@@ -41,6 +41,8 @@ export class ClaudeApprovalCoordinator {
41
41
  abortController;
42
42
  lookupMcpToolMetadata;
43
43
  mode;
44
+ lookupPolicy;
45
+ consumerToolNames;
44
46
  consumerToolBridgePrefix;
45
47
  /** Single per-turn sink. Issue #529 contract: one stream per turn. */
46
48
  initial = new GenSink();
@@ -137,6 +139,8 @@ export class ClaudeApprovalCoordinator {
137
139
  this.abortController = opts.abortController;
138
140
  this.lookupMcpToolMetadata = opts.lookupMcpToolMetadata;
139
141
  this.mode = opts.mode ?? 'serial';
142
+ this.lookupPolicy = opts.lookupPolicy;
143
+ this.consumerToolNames = opts.consumerToolNames ?? new Set();
140
144
  this.consumerToolBridgePrefix = opts.consumerToolsBridgeName
141
145
  ? `${MCP_PREFIX}${opts.consumerToolsBridgeName}__`
142
146
  : undefined;
@@ -313,11 +317,23 @@ export class ClaudeApprovalCoordinator {
313
317
  * AFTER the cache, so ~70% of tool calls slipped past the gate — see
314
318
  * #484).
315
319
  *
316
- * Consumer-executed tools never reach this hook because the options
317
- * builder unconditionally bypasses the consumer-tool wire prefix in the
318
- * matcher (#529 step 2b decouple). That keeps the parker path the
319
- * single source of truth for consumer-tool lifecycle and lets this
320
- * hook focus on built-in / external-MCP tool gating.
320
+ * **The hook is the decision site (Phase 2b).** The options builder's
321
+ * matcher only keeps consumer-executed tools from firing — every other
322
+ * tool reaches here, and the hook resolves it against the policy resolver
323
+ * ({@link lookupPolicy}) and routes the {@link Decision}:
324
+ * - `'allow'` ⇒ resolve `permissionDecision: 'allow'` immediately; no
325
+ * `tool-approval-request`.
326
+ * - `'deny'` ⇒ resolve `permissionDecision: 'deny'` immediately; no
327
+ * `tool-approval-request`, no `decision: 'block'` (the agentic loop
328
+ * continues so the model can recover from the `tool_result(is_error=
329
+ * true)` the Claude Agent SDK synthesizes natively from the deny —
330
+ * unlike Mastra, no re-stamp is needed).
331
+ * - `'require-approval'` ⇒ emit `tool-approval-request` and park.
332
+ *
333
+ * A static name matcher cannot make this decision — the Claude CLI injects
334
+ * an un-enumerable built-in catalog and annotation-driven rules aren't
335
+ * expressible as a name regex — so the matcher is a pure consumer-tool
336
+ * exclusion and the resolver is consulted per fire.
321
337
  */
322
338
  preToolUseHook = async (input, toolUseID) => {
323
339
  if (input.hook_event_name !== 'PreToolUse') {
@@ -332,6 +348,30 @@ export class ClaudeApprovalCoordinator {
332
348
  this.decisions.delete(toolCallId);
333
349
  return buffered;
334
350
  }
351
+ // Consumer-executed tools are never gated (defense-in-depth — the
352
+ // options builder's matcher already keeps them from firing this hook).
353
+ // Silent allow without consulting the resolver so a stray `toolPolicies`
354
+ // rule can't gate one.
355
+ if (this.consumerToolNames.has(toolName)) {
356
+ return allowOutput(toolInput);
357
+ }
358
+ // Resolve and route. `lookupPolicy` is present iff the harness's gating
359
+ // predicate engaged (the hook is wired only then), so the
360
+ // `'require-approval'` fallback below is defensive.
361
+ const decision = this.lookupPolicy
362
+ ? this.lookupPolicy(this.buildToolInvocation(toolName))
363
+ : 'require-approval';
364
+ if (decision === 'allow') {
365
+ return allowOutput(toolInput);
366
+ }
367
+ if (decision === 'deny') {
368
+ // Mark settled so a stray consumer approve/decline for this id is an
369
+ // idempotent no-op (issue #589). The SDK synthesizes the error
370
+ // tool_result; no `tool-approval-request` and no `decision: 'block'`.
371
+ this.settledByCoordinator.add(toolCallId);
372
+ return denyOutput('Denied by tool policy.');
373
+ }
374
+ // 'require-approval': existing emit-and-park behavior.
335
375
  // Defensive: in batch mode emission already happened in `route()` when
336
376
  // `tool-call(toolCallId)` arrived. In serial mode emit here. Either
337
377
  // way, only emit once per id.
@@ -343,6 +383,52 @@ export class ClaudeApprovalCoordinator {
343
383
  this.pendingApprovals.set(toolCallId, { resolve, reject, input: toolInput, timer });
344
384
  });
345
385
  };
386
+ /**
387
+ * Build the {@link ToolInvocation} the policy resolver matches against from
388
+ * a Claude-namespaced wire tool name. The single source of the
389
+ * `(serverName, toolName, annotations)` identity that drives an approval
390
+ * decision — mirrors the enrichment the adapter stamps on
391
+ * `tool-call` / `tool-result` events so the decision can never diverge from
392
+ * what the consumer observes.
393
+ *
394
+ * Three shapes:
395
+ * - `mcp__skill_bridge__<tool>` ⇒ `{ toolName: <tool>, serverName:
396
+ * 'skill_bridge' }`. Claude carries this identity natively in the wire
397
+ * name (the in-process `skill_bridge` MCP server), so the SDK's
398
+ * `mcp:skill_bridge:*` allow rules match. The in-process server is NOT
399
+ * in the external MCP catalog, so {@link lookupMcpToolMetadata} can't
400
+ * resolve it — hence the explicit prefix check first.
401
+ * - `mcp__<server>__<tool>` for an external server ⇒ un-namespaced
402
+ * `{ toolName: <tool>, serverName: <server>, annotations? }`.
403
+ * - bare built-in (`Bash`, `Read`, …) ⇒ `{ toolName }` (no `serverName`,
404
+ * so it matches `{ type: 'builtin' }` rules).
405
+ */
406
+ buildToolInvocation(toolName) {
407
+ const skillBridgePrefix = `${MCP_PREFIX}${SKILL_BRIDGE_SERVER_ID}__`;
408
+ if (toolName.startsWith(skillBridgePrefix)) {
409
+ return { toolName: toolName.slice(skillBridgePrefix.length), serverName: SKILL_BRIDGE_SERVER_ID };
410
+ }
411
+ const mcp = this.lookupMcpToolMetadata?.(toolName);
412
+ if (mcp) {
413
+ const prefix = `${MCP_PREFIX}${mcp.serverName}__`;
414
+ const bare = toolName.startsWith(prefix) ? toolName.slice(prefix.length) : toolName;
415
+ return {
416
+ toolName: bare,
417
+ serverName: mcp.serverName,
418
+ ...(mcp.annotations ? { annotations: mcp.annotations } : {}),
419
+ };
420
+ }
421
+ return { toolName };
422
+ }
423
+ /**
424
+ * Policy decision for a tool by wire name. Used by {@link route}'s batch
425
+ * front-load to emit a `tool-approval-request` only for `require-approval`
426
+ * tools. The `'require-approval'` fallback is defensive (the front-load is
427
+ * reachable only when gating is active, so `lookupPolicy` is present).
428
+ */
429
+ policyFor(toolName) {
430
+ return this.lookupPolicy ? this.lookupPolicy(this.buildToolInvocation(toolName)) : 'require-approval';
431
+ }
346
432
  emitApprovalRequest(toolCallId, toolName, args) {
347
433
  this.initial.push({
348
434
  type: 'tool-approval-request',
@@ -571,8 +657,15 @@ export class ClaudeApprovalCoordinator {
571
657
  // stream. In serial mode the hook itself emits when it fires.
572
658
  // Consumer tools never go through PreToolUse (bypassed at the
573
659
  // matcher), so we don't emit approval-requests for them here.
660
+ // Phase 2b: only `require-approval` tools get a request — an
661
+ // `allow`/`deny` tool must not surface a spurious approval card,
662
+ // and the hook routes those without parking. The hook re-resolves
663
+ // on fire (pure, cheap); `emittedApprovals` keeps it single-emit.
574
664
  const isConsumerTool = rewritten !== undefined;
575
- if (this.mode === 'batch' && !this.emittedApprovals.has(routed.toolCallId) && !isConsumerTool) {
665
+ if (this.mode === 'batch' &&
666
+ !this.emittedApprovals.has(routed.toolCallId) &&
667
+ !isConsumerTool &&
668
+ this.policyFor(routed.toolName) === 'require-approval') {
576
669
  this.emitApprovalRequest(routed.toolCallId, routed.toolName, routed.args);
577
670
  }
578
671
  // Issue #591: track in-flight MCP tool call so progress
@@ -658,4 +751,34 @@ export class ClaudeApprovalCoordinator {
658
751
  this.recentToolCallNameById.set(toolCallId, strippedToolName);
659
752
  }
660
753
  }
754
+ /**
755
+ * The `PreToolUse` hook output that lets a tool run. Mirrors the shape
756
+ * `approve()` settles a parked hook with — `permissionDecision: 'allow'` plus
757
+ * the (possibly model-rewritten) `updatedInput`.
758
+ */
759
+ function allowOutput(input) {
760
+ return {
761
+ hookSpecificOutput: {
762
+ hookEventName: 'PreToolUse',
763
+ permissionDecision: 'allow',
764
+ updatedInput: input,
765
+ },
766
+ };
767
+ }
768
+ /**
769
+ * The `PreToolUse` hook output that blocks a tool. Mirrors the shape
770
+ * `decline()` settles a parked hook with — `permissionDecision: 'deny'` with a
771
+ * reason, and deliberately NO `decision: 'block'`, so the agentic loop
772
+ * continues and the model recovers from the `tool_result(is_error=true)` the
773
+ * Claude Agent SDK synthesizes natively from the deny.
774
+ */
775
+ function denyOutput(reason) {
776
+ return {
777
+ hookSpecificOutput: {
778
+ hookEventName: 'PreToolUse',
779
+ permissionDecision: 'deny',
780
+ permissionDecisionReason: reason,
781
+ },
782
+ };
783
+ }
661
784
  //# sourceMappingURL=claude-approval-coordinator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-approval-coordinator.js","sourceRoot":"","sources":["../src/claude-approval-coordinator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,aAAa,EACb,iBAAiB,GAKpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,MAAM,UAAU,GAAG,OAAO,CAAC;AA0D3B,MAAM,OAAO,yBAAyB;IACjB,OAAO,CAAqB;IAC5B,qBAAqB,CAAS;IAC9B,eAAe,CAAkB;IACjC,qBAAqB,CAAyB;IAC9C,IAAI,CAAqB;IACzB,wBAAwB,CAAqB;IAE9D,sEAAsE;IACrD,OAAO,GAAuB,IAAI,OAAO,EAA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