@scotthuang/agent-knock-knock 0.2.50 → 0.3.0-beta.1

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
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0-beta.1 - 2026-07-28
4
+
5
+ ### Added
6
+
7
+ - Add ClawHub package metadata, bundled skill discovery, a square catalog icon, and a package-local OpenClaw runtime entry.
8
+ - Add manifest/runtime contract tests and a ClawHub validation and dry-run release path.
9
+
10
+ ### Changed
11
+
12
+ - Compile against the tested OpenClaw `2026.7.1-2` SDK instead of a handwritten type shim.
13
+ - Separate ClawHub and npm installation guidance, including the explicit optional-tool grant required by a clean OpenClaw profile.
14
+ - Publish prerelease builds to npm's `next` dist-tag and mark their GitHub releases as prereleases.
15
+
16
+ ### Fixed
17
+
18
+ - Align the declared `/akk` command, bundled skill, and tool inventory with the capabilities registered at runtime.
19
+ - Resolve the bundled CLI relative to the loaded plugin entry so ClawHub installs do not depend on a global executable.
20
+
21
+ ## 0.2.51 - 2026-07-25
22
+
23
+ ### Added
24
+
25
+ - Add disabled-by-default exact command and workspace auto-approval for hookless Claude Code tmux turns by intersecting the current one-time Bash dialog with owner-private local transcript evidence.
26
+
27
+ ### Changed
28
+
29
+ - Allow trusted `autoApprove` rules to target Claude as well as Codex, while leaving unmatched, unsupported, or ambiguous requests on the manual approval path.
30
+
31
+ ### Fixed
32
+
33
+ - Deliver Gateway callback attempts outside conversation locks and recover interrupted approval-notification outboxes with stable message identities without duplicating message events.
34
+ - Preserve terminal monitor ownership across inline auto-approval, callback retries, and post-delivery crashes, and track consumed Claude dialogs by transcript request identity plus an observed prompt-generation boundary so redraws cannot replay Enter while later identical requests remain approvable.
35
+
36
+ ### Security
37
+
38
+ - Keep raw Claude commands executor-local and expose only bounded hashes and opaque identities through callbacks, state, events, logs, and screen summaries.
39
+ - Re-evaluate the exact policy and recapture the prompt, selected one-time action, transcript evidence, and process identity after the one-shot dispatch reservation before sending one Enter; stale, changed, replayed, or uncertain requests fail closed.
40
+ - Restrict pending-approval transcript evidence to compatible Claude Code `2.1.x` releases at `2.1.198` or later while retaining forward-compatible durable completion detection.
41
+
3
42
  ## 0.2.50 - 2026-07-24
4
43
 
5
44
  ### Changed
package/README.md CHANGED
@@ -5,7 +5,21 @@
5
5
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.14-339933)](https://nodejs.org/)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/scotthuang/agent-knock-knock/blob/main/LICENSE)
7
7
 
8
- Agent Knock Knock connects OpenClaw to local coding agents. Share a live terminal through tmux, delegate managed work through ACP, and continue the same task from chat or the terminal.
8
+ Agent Knock Knock lets you control local Codex and Claude Code from any configured OpenClaw channel, then take over the same live tmux session without losing context. For managed background work, Managed ACP (via ACPX) also supports Cursor.
9
+
10
+ **Local-first, with no hosted control plane or telemetry. tmux mode keeps the coding agent's existing permission settings; Managed ACP uses a separate background permission model.**
11
+
12
+ ## See It in Action
13
+
14
+ [![AKK orchestrating a Claude Code-to-Codex handoff through tmux](docs/assets/akk-tmux-handoff-demo.gif)](docs/assets/akk-tmux-handoff-demo.mp4)
15
+
16
+ *OpenClaw asks Claude Code to write a file, waits for AKK to report completion, then hands the result to Codex. Both terminals remain available for direct human takeover. The demo uses the agents' existing permission settings; AKK does not switch them. Click the preview to watch in full quality.*
17
+
18
+ ## Use Cases
19
+
20
+ **Delegate from anywhere.** Use any configured OpenClaw channel to hand work to a local coding agent wherever you are. AKK keeps the task running outside the chat, reports when the agent needs input or finishes, and lets you continue from chat or the shared terminal.
21
+
22
+ **Orchestrate specialist agents.** OpenClaw can coordinate agent handoffs: Claude Code can plan, Codex can implement, and Claude Code can review. In tmux mode, AKK can also automatically approve trusted permission requests under rules you define. At any point, you can take over the shared terminal, keep working yourself, then hand the same task back to OpenClaw—with context intact.
9
23
 
10
24
  ![Agent Knock Knock cover: OpenClaw knocking on coding agents' door](docs/assets/agent-knock-knock-cover.jpg)
11
25
 
@@ -13,32 +27,53 @@ Agent Knock Knock connects OpenClaw to local coding agents. Share a live termina
13
27
 
14
28
  | Mode | Best for | Agents | Requires |
15
29
  | --- | --- | --- | --- |
16
- | **tmux bridge (recommended, experimental)** | Share one live CLI session. OpenClaw and a human can hand the task back and forth. | Codex, Claude Code | `tmux` |
30
+ | **tmux bridge (recommended)** | Share one live CLI session. OpenClaw and a human can hand the task back and forth. | Codex, Claude Code | `tmux` |
17
31
  | **Managed ACP** | Start background tasks with durable ACP state and callbacks. | Codex, Claude Code, Cursor | [ACPX](https://github.com/openclaw/acpx) |
18
32
 
19
33
  Install either mode or both. tmux does not require ACPX. Cursor tmux control is [not yet supported](https://github.com/scotthuang/agent-knock-knock/issues/42). AKK can also discover, resume, or fork local Codex sessions; that is a Codex capability, not a third installation mode.
20
34
 
35
+ ### Permission Boundaries
36
+
37
+ The two modes intentionally use different permission models:
38
+
39
+ - **tmux bridge:** AKK does not change the coding agent's configured permission mode. For supported prompts in an AKK-managed turn, disabled-by-default exact-command rules may auto-approve a trusted request; unmatched or uncertain requests stay manual.
40
+ - **Managed ACP:** AKK starts ACPX-backed agents with `--approve-all`; the tmux prompt inspection and exact-command `autoApprove` policy do not apply to this mode. Claude Code may still surface permission requests through ACPX, while some Codex sandbox-sensitive operations fail directly. Keep managed work inside an explicit workspace.
41
+
21
42
  ## Install
22
43
 
23
44
  Core requirements:
24
45
 
25
46
  - Node.js 22.14+ (Node.js 24 recommended; use a version supported by your OpenClaw release)
26
- - [OpenClaw](https://docs.openclaw.ai/) Gateway and plugin API `2026.3.24-beta.2` or newer
47
+ - [OpenClaw](https://docs.openclaw.ai/) Gateway and plugin API `2026.7.1-2` or newer
27
48
  - At least one authenticated coding agent: Codex, Claude Code, or Cursor
28
49
 
50
+ ### Install from ClawHub (recommended)
51
+
29
52
  ```bash
30
- npm install -g @scotthuang/agent-knock-knock
31
- agent-knock-knock install-openclaw
53
+ openclaw plugins install clawhub:@scotthuang/agent-knock-knock@beta
54
+ openclaw gateway restart
32
55
  ```
33
56
 
34
- `install-openclaw` installs or updates the plugin, enables it, installs the AKK skill template, and restarts the OpenClaw Gateway. It is safe to rerun. Use `--skill-only` to skip plugin installation; add `--no-restart` to skip the automatic Gateway restart.
57
+ The explicit `@beta` selector follows the `0.3.0` prerelease channel. Remove it after the stable ClawHub release is available.
58
+
59
+ ClawHub installs the OpenClaw plugin, bundled AKK skill, and package-local relay CLI together. OpenClaw invokes that bundled CLI directly, but ClawHub does not add the `agent-knock-knock` command to your shell `PATH`. Do not run `install-openclaw` after a ClawHub install; that command belongs to the npm installation path below and would repeat the plugin setup.
60
+
61
+ If you also want standalone shell commands such as `agent-knock-knock doctor`, install the npm package globally without running `install-openclaw`:
35
62
 
36
- Then enable at least one execution mode:
63
+ ```bash
64
+ npm install -g @scotthuang/agent-knock-knock@next
65
+ ```
66
+
67
+ ### Install from npm (beta)
68
+
69
+ ```bash
70
+ npm install -g @scotthuang/agent-knock-knock@next
71
+ agent-knock-knock install-openclaw
72
+ ```
37
73
 
38
- - **tmux (recommended):** install `tmux` on a Unix-like host and run Codex or Claude Code in a pane owned by the same user as OpenClaw.
39
- - **Managed ACP:** install ACPX with `npm install -g acpx`.
74
+ The npm `next` dist-tag follows the same prerelease line. Remove `@next` after `0.3.0` becomes stable.
40
75
 
41
- Claude tmux support requires no hooks and does not modify Claude Code settings. Hook-free completion monitoring is verified on Claude Code `2.1.198` and `2.1.218`; newer versions are accepted when their interactive transcripts preserve the required identity and completion structure.
76
+ `install-openclaw` installs or updates the plugin, enables it, installs the AKK skill template, and restarts the OpenClaw Gateway. It is safe to rerun. Use `--skill-only` to skip plugin installation; add `--no-restart` to skip the automatic Gateway restart.
42
77
 
43
78
  If OpenClaw runs from a local checkout or another nonstandard location, pass its CLI explicitly:
44
79
 
@@ -46,21 +81,72 @@ If OpenClaw runs from a local checkout or another nonstandard location, pass its
46
81
  agent-knock-knock install-openclaw --openclaw-bin /path/to/openclaw/openclaw.mjs
47
82
  ```
48
83
 
49
- Finally, check which modes are ready:
84
+ AKK's agent tools are optional and require an explicit OpenClaw tool-policy opt-in. If you use the default `coding` profile and do not already have `tools.allow`, add AKK without replacing the profile:
85
+
86
+ ```json5
87
+ {
88
+ tools: {
89
+ profile: "coding",
90
+ alsoAllow: ["agent-knock-knock"]
91
+ }
92
+ }
93
+ ```
94
+
95
+ If your configuration already has a restrictive `tools.allow` list, add `"agent-knock-knock"` to that existing list instead. Do not set `allow` and `alsoAllow` at the same scope.
96
+
97
+ Choose one execution mode, or install both.
98
+
99
+ ### Option A: tmux bridge (recommended)
100
+
101
+ Install tmux on macOS:
102
+
103
+ ```bash
104
+ brew install tmux
105
+ ```
106
+
107
+ Or on Debian/Ubuntu:
108
+
109
+ ```bash
110
+ sudo apt-get install tmux
111
+ ```
112
+
113
+ Then start a shared terminal session:
114
+
115
+ ```bash
116
+ tmux new -s coding
117
+ ```
118
+
119
+ Run `codex` or `claude` inside the tmux session. AKK will discover it automatically when OpenClaw and the coding agent run as the same user.
120
+
121
+ Claude tmux support requires no hooks and does not modify Claude Code settings. Hook-free completion monitoring is verified on Claude Code `2.1.198` and `2.1.218`; newer versions remain eligible when their interactive transcripts preserve the required identity and completion structure. Hookless auto-approval is deliberately narrower: approval evidence currently requires Claude Code `2.1.x` at `2.1.198` or later, and any other version falls back to manual handling.
122
+
123
+ ### Option B: Managed ACP
124
+
125
+ Install ACPX:
126
+
127
+ ```bash
128
+ npm install -g acpx
129
+ ```
130
+
131
+ AKK uses ACPX to start managed Codex, Claude Code, or Cursor sessions from OpenClaw.
132
+
133
+ Finally, check which modes are ready if the global CLI is installed:
50
134
 
51
135
  ```bash
52
136
  agent-knock-knock doctor
53
137
  ```
54
138
 
55
- ### Trust and Privacy
139
+ For a ClawHub-only installation, verify that OpenClaw loaded the packaged runtime:
56
140
 
57
- AKK is local-first: its state, logs, and terminal control stay on your machine. AKK has no hosted control plane or telemetry, and its tmux integration does not modify coding-agent settings.
141
+ ```bash
142
+ openclaw plugins inspect agent-knock-knock --runtime
143
+ ```
58
144
 
59
- For a managed Claude tmux turn, AKK reads only the bytes appended to Claude Code's owner-private local JSONL transcript after the send boundary. It uses them locally to bind the exact prompt and extract a redacted final answer; it does not upload the transcript or persist a copy of its raw contents. The final answer still travels through your configured local OpenClaw callback.
145
+ ### Trust and Privacy
60
146
 
61
- This does not mean task content can never leave the machine. OpenClaw and each coding agent or model provider still process content according to your configuration. Managed ACP tasks currently use ACPX `--approve-all`; treat them as trusted automation, set an explicit workspace, and review the agent's sandbox and credentials.
147
+ AKK is local-first. It has no hosted control plane or telemetry, does not modify coding-agent settings, and keeps its state, logs, terminal control, and approval decisions on your machine. Sensitive approval commands are never included in callbacks or AKK logs.
62
148
 
63
- AKK's normal callback uses the OpenClaw Gateway configuration without putting its token in the agent prompt or child-process arguments. Keep credentials out of a custom `callbackCommand`. The legacy direct CLI `--token` callback embeds that credential in its callback command and should not be used for untrusted delegations.
149
+ Your task content is still processed by OpenClaw and the coding-agent or model providers you configure. Use explicit workspaces, review agent permissions, and keep secrets out of custom callback commands.
64
150
 
65
151
  ## Quick Start
66
152
 
@@ -69,6 +155,10 @@ First merge this configuration into `~/.openclaw/openclaw.json`, setting `worksp
69
155
  ```json5
70
156
  // ~/.openclaw/openclaw.json
71
157
  {
158
+ tools: {
159
+ profile: "coding",
160
+ alsoAllow: ["agent-knock-knock"]
161
+ },
72
162
  plugins: {
73
163
  entries: {
74
164
  "agent-knock-knock": {
@@ -142,6 +232,14 @@ Surfaces with native commands use the same operations:
142
232
  /akk close <conversation-id> [reason]
143
233
  ```
144
234
 
235
+ Codex CLI sessions started outside AKK can also be resumed, opened in a terminal, or forked:
236
+
237
+ ```text
238
+ AKK takeover Codex <session-id>
239
+ AKK terminal takeover Codex <session-id>
240
+ AKK fork takeover Codex <session-id>
241
+ ```
242
+
145
243
  ## Configuration
146
244
 
147
245
  Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/openclaw.json`, as shown in the Quick Start.
@@ -158,24 +256,6 @@ Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/o
158
256
 
159
257
  See [`openclaw.plugin.json`](openclaw.plugin.json) for the complete schema and compatibility aliases.
160
258
 
161
- ## Native Sessions and tmux Control
162
-
163
- AKK can discover Codex CLI sessions started outside AKK and control Codex or Claude Code sessions in tmux. `AKK list` separates managed `delegated` tasks, discovered `native` sessions, and tmux-backed `terminal_controlled` sessions. Native stop/resume and fork takeover remain Codex-only:
164
-
165
- ```text
166
- AKK takeover Codex <session-id>
167
- AKK terminal takeover Codex <session-id>
168
- AKK fork takeover Codex <session-id>
169
- ```
170
-
171
- A terminal-controlled ID works with `send`, `status`, `describe`, `approve`, and `cancel`. Claude accepts new messages only at a verified idle prompt. Use `send --background` (the OpenClaw send tool does this automatically) to bind a managed turn, then use the returned conversation ID with `approve`, `cancel`, or `status`.
172
-
173
- Claude tmux support is hook-free: AKK can discover the session, send at a verified idle prompt, report status, handle a narrowly verified approval, and detect completion for a verified local transcript schema. Before sending, AKK binds the Claude PID, process start time, session ID, cwd, and transcript file boundary. Completion requires the exact managed prompt, its UUID chain, an `end_turn` assistant response, a matching `turn_duration`, an idle unchanged process, and two stable monitor polls.
174
-
175
- This detector is deliberately conservative. An unknown Claude version or schema, partial or replaced transcript, ambiguous prompt, unresolved tool call, sidechain, or background work does not become `done`; the monitor remains pending and may eventually become `stalled`. `Agent`, `SendMessage`, and scheduled/background tool turns currently take this safe path because their child lifecycle is not fully visible in the main transcript. A visible idle prompt alone is never completion evidence.
176
-
177
- Avoid opening a second live client on the same agent session; concurrent clients can produce inconsistent visible history.
178
-
179
259
  ## Approvals
180
260
 
181
261
  AKK runs ACPX-backed agents with `--approve-all`. Claude Code surfaces permission requests through ACPX, but some Codex sandbox-sensitive operations fail directly. Keep Codex background work inside its workspace, or prefer Claude Code when a task requires ACPX-approved access elsewhere.
@@ -183,41 +263,43 @@ AKK runs ACPX-backed agents with `--approve-all`. Claude Code surfaces permissio
183
263
  For tmux-backed Codex, AKK reports visible approval prompts. Claude approval is deliberately narrower:
184
264
 
185
265
  - It is available only for the current AKK-managed turn.
186
- - AKK accepts only an exact, current Bash dialog with the one-time **Yes** choice already highlighted. Persistent permission choices are rejected.
187
- - A human must explicitly run `AKK approve <conversation-id>`. AKK never auto-approves Claude tmux requests.
188
- - The request is short-lived, fingerprinted to the terminal and managed-turn identity, and captured and validated again immediately before AKK sends Enter. Each dispatch is reserved first; an uncertain outcome fails closed and must be resolved in the terminal.
266
+ - AKK accepts only an exact, current Bash dialog with the one-time **Yes** choice already highlighted, correlated to one unresolved foreground Bash tool request in the anchored owner-private transcript. Persistent permission choices are rejected.
267
+ - When no trusted rule matches, the callback takes the manual path. The user must personally inspect the named tmux pane, explicitly confirm the exact request, and then run `AKK approve <conversation-id>`; the hash-only callback is not sufficient for review.
268
+ - A disabled-by-default `autoApprove` rule may approve Claude only when its agent, canonical workspace, and exact argument vector all match the freshly re-read local evidence.
269
+ - AKK re-evaluates the policy, reserves the one-shot dispatch, recaptures the one-time choice and transcript evidence, and revalidates the process and pane before sending one Enter. A stale, changed, replayed, or uncertain request fails closed and must be resolved in the terminal.
189
270
 
190
271
  Unknown, stale, changed, ambiguous, or unmanaged dialogs fail closed and must be resolved in the terminal.
191
272
 
192
- Trusted Codex terminal commands can optionally be auto-approved with a deterministic policy:
273
+ Trusted Codex and hookless Claude terminal commands can optionally be auto-approved with a deterministic policy:
193
274
 
194
275
  ```json5
195
276
  autoApprove: {
196
277
  enabled: true,
197
278
  rules: [{
198
279
  id: "project-read-status",
199
- agents: ["codex"],
280
+ agents: ["codex", "claude"],
200
281
  workspaces: ["/absolute/path/to/project"],
201
282
  commands: [["pwd"], ["git", "status"], ["git", "diff", "--stat"]]
202
283
  }]
203
284
  }
204
285
  ```
205
286
 
206
- Place `autoApprove` inside the plugin `config` object. It is disabled by default and matches only exact Codex argument vectors in configured workspaces. Shell composition, substitutions, globs, environment assignments, unparseable commands, and out-of-workspace paths require manual approval. Rules match arguments, not executable hashes.
287
+ Place `autoApprove` inside the plugin `config` object. It is disabled by default and matches only exact argument vectors in configured workspaces. Shell composition, substitutions, globs, environment assignments, unparseable commands, and out-of-workspace paths require manual approval. Rules match arguments, not executable hashes. For Claude, the raw command never leaves the local executor; callbacks expose only bounded hashes and opaque request identities.
207
288
 
208
289
  ## Troubleshooting
209
290
 
210
- Start with `agent-knock-knock doctor`. It checks the core installation and reports ACPX and tmux readiness separately; either execution mode is enough. It does not authenticate an agent, verify live Gateway/plugin connectivity, or run a real task.
291
+ With the global npm CLI installed, start with `agent-knock-knock doctor`. It checks the core installation and reports ACPX and tmux readiness separately; either execution mode is enough. It does not authenticate an agent, verify live Gateway/plugin connectivity, or run a real task. For a ClawHub-only installation, start with `openclaw plugins inspect agent-knock-knock --runtime`.
211
292
 
212
293
  | Symptom | Action |
213
294
  | --- | --- |
214
- | Installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
295
+ | The npm installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
215
296
  | Source changes do not appear | Build, reinstall from the checkout, and restart the Gateway. |
216
297
  | Terminal bridge task is `stalled` | Inspect `status` and the terminal; use `/akk renew <conversation-id> <minutes>` only when more monitoring time is useful. |
217
298
  | ACPX task is `stalled` | Inspect `status --trace`; close and redelegate if the executor cannot continue. |
218
299
  | Task is `callback_failed` | Run `/akk retry-callback <conversation-id>` in a native-command chat. |
219
300
  | Terminal takeover is unavailable | Run Codex or Claude Code inside tmux and check `AKK list` for a `terminal_controlled` entry. |
220
301
  | Claude permission is not offered through AKK | Use the managed conversation returned by a background send. If the dialog is not the exact supported one-time Bash prompt, resolve it in the terminal. |
302
+ | Claude request was not auto-approved | Check `autoApprove.enabled`, `agents: ["claude"]`, the canonical workspace, and the exact command vector. The request must also be a current one-time Bash prompt with matching local transcript evidence from a supported Claude `2.1.x` version. |
221
303
  | Claude tmux monitor becomes `stalled` | Check the Claude version and `status`, then inspect the terminal. Unknown transcript schemas, background work, identity changes, and ambiguous turns intentionally fail closed. |
222
304
 
223
305
  For local diagnostics, use:
@@ -240,6 +322,20 @@ npm test # build and run the full test suite
240
322
 
241
323
  See [CONTRIBUTING.md](https://github.com/scotthuang/agent-knock-knock/blob/main/CONTRIBUTING.md) for the development and pull request workflow. For local OpenClaw testing, rebuild, run `node dist/src/cli.js install-openclaw`, and restart the Gateway.
242
324
 
325
+ ### ClawHub Maintainer Release
326
+
327
+ The first `0.3.0` beta publish is intentionally manual and must stay on ClawHub's `beta` tag:
328
+
329
+ ```bash
330
+ npm ci
331
+ npm run build
332
+ npm exec clawhub -- login
333
+ npm exec clawhub -- package publish . --family code-plugin --owner scotthuang --tags beta --dry-run --json
334
+ npm exec clawhub -- package publish . --family code-plugin --owner scotthuang --tags beta
335
+ ```
336
+
337
+ After that first release creates the package, configure this repository as its trusted publisher. Future publishes use the manually dispatched `ClawHub Publish` workflow, which defaults to a dry run and derives `beta` versus `latest` from the package version.
338
+
243
339
  ## Storage and Logs
244
340
 
245
341
  State lives under `~/.agent-knock-knock/`. Directories use mode `0700`; state and log files use `0600`. Runtime logs redact common secrets and default to 14-day retention. Configure storage and logging with `--store-dir`, `AKK_LOG_DIR`, `AKK_LOG_LEVEL`, and `AKK_LOG_RETENTION_DAYS`; use a dedicated custom log directory.
@@ -6,6 +6,8 @@ export interface ApprovalCandidate {
6
6
  cwd?: string;
7
7
  fingerprint: string;
8
8
  terminalTarget?: string;
9
+ evidenceSource?: "claude_transcript";
10
+ evidenceFingerprint?: string;
9
11
  }
10
12
  export interface ApprovalPolicyDecision {
11
13
  action: "approve" | "ask";
@@ -21,7 +23,8 @@ export interface SimpleCommandParseResult {
21
23
  }
22
24
  export interface AutoApprovalAttempt {
23
25
  approved: boolean;
24
- action: "approved" | "ask";
26
+ handled: boolean;
27
+ action: "approved" | "already_approved" | "ask";
25
28
  reason: string;
26
29
  rule_id?: string;
27
30
  policy_fingerprint: string;
@@ -16,6 +16,9 @@ export function approvalCandidateFromMessage(message) {
16
16
  const agent = stringValue(candidate?.agent);
17
17
  const kind = stringValue(candidate?.kind);
18
18
  const fingerprint = stringValue(candidate?.fingerprint);
19
+ const policyEvidence = isRecord(candidate?.policy_evidence)
20
+ ? candidate.policy_evidence
21
+ : undefined;
19
22
  if (!agent || !kind || !fingerprint) {
20
23
  return undefined;
21
24
  }
@@ -28,7 +31,13 @@ export function approvalCandidateFromMessage(message) {
28
31
  : {}),
29
32
  command: stringValue(candidate?.command),
30
33
  cwd: stringValue(candidate?.cwd),
31
- terminalTarget: stringValue(candidate?.terminal_target)
34
+ terminalTarget: stringValue(candidate?.terminal_target),
35
+ ...(policyEvidence?.source === "claude_transcript"
36
+ ? { evidenceSource: "claude_transcript" }
37
+ : {}),
38
+ ...(stringValue(policyEvidence?.evidence_fingerprint)
39
+ ? { evidenceFingerprint: stringValue(policyEvidence?.evidence_fingerprint) }
40
+ : {})
32
41
  };
33
42
  }
34
43
  export function evaluateApprovalPolicy({ policy, candidate }) {
@@ -39,8 +48,11 @@ export function evaluateApprovalPolicy({ policy, candidate }) {
39
48
  if (candidate.kind !== "run_command") {
40
49
  return ask(`approval kind is not supported: ${candidate.kind}`, policyFingerprint);
41
50
  }
42
- if (candidate.agent === "claude") {
43
- return ask("Claude tmux approval always requires explicit user confirmation", policyFingerprint);
51
+ if (candidate.agent === "claude" &&
52
+ (candidate.decisionMode !== "keys" ||
53
+ candidate.evidenceSource !== "claude_transcript" ||
54
+ !isSha256Hex(candidate.evidenceFingerprint))) {
55
+ return ask("Claude auto approval requires verified local transcript evidence for a keys-mode request", policyFingerprint);
44
56
  }
45
57
  if (!candidate.command) {
46
58
  return ask("approval command is unavailable", policyFingerprint);
@@ -107,32 +119,103 @@ export function attemptAutoApproval({ message, policy, statePath, execute }) {
107
119
  return undefined;
108
120
  }
109
121
  const decision = evaluateApprovalPolicy({ policy, candidate });
122
+ const deferredDecision = deferredClaudeAutoApprovalDecision({
123
+ policy,
124
+ candidate,
125
+ decision
126
+ });
110
127
  const cliArgs = statePath
111
- ? autoApprovalCliArgs({ statePath, candidate, decision, policy })
128
+ ? decision.action === "approve"
129
+ ? autoApprovalCliArgs({ statePath, candidate, decision, policy })
130
+ : deferredDecision
131
+ ? deferredAutoApprovalCliArgs({
132
+ statePath,
133
+ candidate,
134
+ policy,
135
+ policyFingerprint: deferredDecision.policyFingerprint
136
+ })
137
+ : undefined
112
138
  : undefined;
113
- if (!cliArgs || !decision.ruleId) {
139
+ if (!cliArgs) {
114
140
  return {
115
141
  approved: false,
142
+ handled: false,
116
143
  action: "ask",
117
- reason: decision.reason,
144
+ reason: deferredDecision?.reason ?? decision.reason,
118
145
  rule_id: decision.ruleId,
119
- policy_fingerprint: decision.policyFingerprint,
146
+ policy_fingerprint: deferredDecision?.policyFingerprint ?? decision.policyFingerprint,
120
147
  approval_fingerprint: candidate.fingerprint
121
148
  };
122
149
  }
123
150
  const result = execute(cliArgs);
151
+ const effectiveRuleId = stringValue(result.policy_rule_id) ?? decision.ruleId;
152
+ const effectivePolicyFingerprint = stringValue(result.policy_fingerprint) ??
153
+ deferredDecision?.policyFingerprint ??
154
+ decision.policyFingerprint;
155
+ const approved = result.approved === true;
156
+ const alreadyApproved = result.already_approved === true;
124
157
  return {
125
- approved: result.approved === true,
126
- action: result.approved === true ? "approved" : "ask",
127
- reason: result.approved === true
128
- ? decision.reason
158
+ approved,
159
+ handled: approved || alreadyApproved,
160
+ action: approved
161
+ ? "approved"
162
+ : alreadyApproved
163
+ ? "already_approved"
164
+ : "ask",
165
+ reason: approved
166
+ ? stringValue(result.reason) ??
167
+ (effectiveRuleId
168
+ ? `matched auto-approval rule ${effectiveRuleId}`
169
+ : "executor approved the verified local Claude request")
129
170
  : stringValue(result.reason) ?? "automatic approval was not executed",
130
- rule_id: decision.ruleId,
131
- policy_fingerprint: decision.policyFingerprint,
171
+ rule_id: effectiveRuleId,
172
+ policy_fingerprint: effectivePolicyFingerprint,
132
173
  approval_fingerprint: candidate.fingerprint,
133
174
  monitor_pid: typeof result.monitor_pid === "number" ? result.monitor_pid : null
134
175
  };
135
176
  }
177
+ function deferredClaudeAutoApprovalDecision({ policy, candidate, decision }) {
178
+ if (decision.action === "approve" ||
179
+ candidate.agent !== "claude" ||
180
+ candidate.kind !== "run_command" ||
181
+ candidate.decisionMode !== "keys" ||
182
+ candidate.evidenceSource !== "claude_transcript" ||
183
+ !isSha256Hex(candidate.evidenceFingerprint) ||
184
+ !candidate.cwd) {
185
+ return undefined;
186
+ }
187
+ const policyFingerprint = fingerprintValue(policy);
188
+ if (!isRecord(policy) || policy.enabled !== true) {
189
+ return undefined;
190
+ }
191
+ const hasEligibleRule = (Array.isArray(policy.rules) ? policy.rules : [])
192
+ .map(normalizeRule)
193
+ .filter((rule) => Boolean(rule))
194
+ .some((rule) => rule.agents.includes("claude") &&
195
+ rule.workspaces.some((workspace) => isPathWithin(candidate.cwd, workspace)));
196
+ if (!hasEligibleRule) {
197
+ return undefined;
198
+ }
199
+ return ask("Claude command policy will be evaluated from fresh local transcript evidence by the executor", policyFingerprint);
200
+ }
201
+ function deferredAutoApprovalCliArgs({ statePath, candidate, policy, policyFingerprint }) {
202
+ const serializedPolicy = JSON.stringify(policy);
203
+ if (!statePath || typeof serializedPolicy !== "string") {
204
+ return undefined;
205
+ }
206
+ return [
207
+ "approve",
208
+ "--state",
209
+ statePath,
210
+ "--expected-approval-fingerprint",
211
+ candidate.fingerprint,
212
+ "--auto-approved",
213
+ "--policy-fingerprint",
214
+ policyFingerprint,
215
+ "--auto-approval-policy-json",
216
+ serializedPolicy
217
+ ];
218
+ }
136
219
  export function parseSimpleShellCommand(command) {
137
220
  const text = String(command ?? "").trim();
138
221
  if (!text) {
@@ -329,6 +412,9 @@ function stringArray(value) {
329
412
  function stringValue(value) {
330
413
  return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
331
414
  }
415
+ function isSha256Hex(value) {
416
+ return typeof value === "string" && /^[0-9a-f]{64}$/u.test(value);
417
+ }
332
418
  function isRecord(value) {
333
419
  return value !== null && typeof value === "object" && !Array.isArray(value);
334
420
  }
@@ -1 +1 @@
1
- {"version":3,"file":"approval-policy.js","sourceRoot":"","sources":["../../src/approval-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAoC7B,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,IACE,OAAO,CAAC,IAAI,KAAK,UAAU;QAC3B,QAAQ,EAAE,MAAM,KAAK,iBAAiB;QACtC,QAAQ,EAAE,MAAM,KAAK,mBAAmB,EACxC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IACnG,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACxD,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CA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,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAClF,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChI,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACzF,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
@@ -26,6 +26,26 @@ export interface DetectClaudeTranscriptCompletionOptions {
26
26
  agentRows: readonly ClaudeAgentRow[];
27
27
  maxTurnBytes?: number;
28
28
  }
29
+ /**
30
+ * Process-local evidence for one pending, foreground Claude Bash permission.
31
+ * `command` is intentionally raw so the caller can apply the exact command
32
+ * policy, but callers must not persist this object or add it to callbacks.
33
+ */
34
+ export interface ClaudeTranscriptPendingApprovalEvidence {
35
+ source: "claude_transcript";
36
+ kind: "run_command";
37
+ command: string;
38
+ cwd: string;
39
+ toolName: "Bash";
40
+ toolUseId: string;
41
+ promptUuid: string;
42
+ assistantUuid: string;
43
+ claudeVersion: string;
44
+ transcriptFileId: string;
45
+ commandSha256: string;
46
+ evidenceFingerprint: string;
47
+ observedEndOffsetBytes: number;
48
+ }
29
49
  export declare function defaultClaudeHome(): string;
30
50
  /**
31
51
  * Records the immutable file boundary immediately before AKK submits a turn.
@@ -38,3 +58,10 @@ export declare function captureClaudeTranscriptAnchor(options: CaptureClaudeTran
38
58
  * background-work, and chain ambiguity.
39
59
  */
40
60
  export declare function detectClaudeTranscriptCompletion(request: TerminalDurableCompletionRequest, options: DetectClaudeTranscriptCompletionOptions): TerminalCompletionEvidence | undefined;
61
+ /**
62
+ * Detects exactly one unresolved foreground Bash tool use for the current
63
+ * AKK-managed Claude turn. It uses the same anchored, owner-private,
64
+ * no-follow, bounded, stable transcript read as durable completion and fails
65
+ * closed on identity changes, completed turns, background work, or ambiguity.
66
+ */
67
+ export declare function detectClaudeTranscriptPendingApproval(request: TerminalDurableCompletionRequest, options: DetectClaudeTranscriptCompletionOptions): ClaudeTranscriptPendingApprovalEvidence | undefined;