@scotthuang/agent-knock-knock 0.2.46 → 0.2.48
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 +39 -0
- package/README.md +93 -55
- package/dist/src/approval-policy.d.ts +3 -1
- package/dist/src/approval-policy.js +18 -4
- package/dist/src/approval-policy.js.map +1 -1
- package/dist/src/claude-hook-installer.d.ts +65 -0
- package/dist/src/claude-hook-installer.js +410 -0
- package/dist/src/claude-hook-installer.js.map +1 -0
- package/dist/src/claude-hook-protocol.d.ts +89 -0
- package/dist/src/claude-hook-protocol.js +243 -0
- package/dist/src/claude-hook-protocol.js.map +1 -0
- package/dist/src/claude-hook-store.d.ts +247 -0
- package/dist/src/claude-hook-store.js +1075 -0
- package/dist/src/claude-hook-store.js.map +1 -0
- package/dist/src/claude-terminal-agent-adapter.d.ts +47 -0
- package/dist/src/claude-terminal-agent-adapter.js +935 -0
- package/dist/src/claude-terminal-agent-adapter.js.map +1 -0
- package/dist/src/cli.js +2065 -316
- package/dist/src/cli.js.map +1 -1
- package/dist/src/openclaw-plugin-helpers.d.ts +49 -0
- package/dist/src/openclaw-plugin-helpers.js +246 -0
- package/dist/src/openclaw-plugin-helpers.js.map +1 -0
- package/dist/src/openclaw-plugin.js +98 -275
- package/dist/src/openclaw-plugin.js.map +1 -1
- package/dist/src/runtime-log.js +54 -2
- package/dist/src/runtime-log.js.map +1 -1
- package/dist/src/store.js +432 -12
- package/dist/src/store.js.map +1 -1
- package/dist/src/terminal-agent-adapter.d.ts +37 -0
- package/dist/src/terminal-agent-adapter.js.map +1 -1
- package/dist/src/terminal-agent-bridge.d.ts +51 -4
- package/dist/src/terminal-agent-bridge.js +326 -43
- package/dist/src/terminal-agent-bridge.js.map +1 -1
- package/dist/src/terminal-agent-registry.js +3 -1
- package/dist/src/terminal-agent-registry.js.map +1 -1
- package/dist/src/terminal-control-provider.d.ts +3 -1
- package/dist/src/terminal-control-provider.js +41 -37
- package/dist/src/terminal-control-provider.js.map +1 -1
- package/dist/src/terminal-process-source.d.ts +12 -3
- package/dist/src/terminal-process-source.js +37 -6
- package/dist/src/terminal-process-source.js.map +1 -1
- package/openclaw.plugin.json +5 -5
- package/package.json +10 -5
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +19 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.48 - 2026-07-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add Node 22/24 CI, Dependabot coverage, contribution templates, and a social preview asset.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Refresh the README and project metadata around OpenClaw orchestration, ACPX delegation, and shared Codex/Claude tmux control.
|
|
12
|
+
- Pin the default Codex ACP adapter to the tested `@agentclientprotocol/codex-acp@1.1.7` release and require Node.js 22.14+.
|
|
13
|
+
- Keep the installed OpenClaw skill on token-free plugin callbacks instead of recommending the legacy direct-token script.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Respect the configured default agent and custom store for `/akk` commands, preserve callback delivery for slash-command tmux sends, and keep agent-specific settings out of unrelated follow-ups.
|
|
18
|
+
- Include native and terminal sessions in `/akk list`, resolve relative plugin stores from the configured workspace, and recognize Claude's native versioned executable path.
|
|
19
|
+
- Reconcile eligible tmux monitors after Gateway restarts, prevent duplicate monitors, preserve wrapper process ancestry across list and takeover, and safely migrate exact legacy Codex terminal identities.
|
|
20
|
+
- Make CLI help, version, doctor requirements, and failure exit status predictable.
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
|
|
24
|
+
- Require an exact live agent identity before tmux input, revalidate auto approvals inside the executor against the observed prompt, and avoid persisting unmanaged Claude hook payloads.
|
|
25
|
+
- Recheck keys-mode approval fingerprints immediately before input and use tmux bracketed paste for multiline tasks.
|
|
26
|
+
- Keep Gateway tokens out of normal plugin callbacks, coding-agent environments, CLI output, and child-process arguments.
|
|
27
|
+
- Store local task data with private permissions, atomic state replacement, tokenized control locks, serialized stale-lock recovery and event writes, path-containment checks, and symlink rejection.
|
|
28
|
+
- Refuse shared runtime-log directories without changing their permissions and append through no-follow file descriptors.
|
|
29
|
+
|
|
30
|
+
## 0.2.47 - 2026-07-23
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- Add tmux control for Claude Code, including discovery, safe idle-only sends, Hook-backed monitoring, structured allow/deny, and exact-rule auto approval.
|
|
35
|
+
- Add an idempotent `install-claude-hooks` command that preserves existing Claude settings and hooks.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Bind Claude permission and Stop/StopFailure events to strong runtime identity, terminal, conversation, message, and active lease; keep background work from completing early and deliver each terminal result once.
|
|
40
|
+
- Show a redacted permission target summary, preserve conservative manual fallback for unverifiable dialogs, and normalize only the exact source-tagged Tokenjuice Claude wrapper for policy matching.
|
|
41
|
+
|
|
3
42
|
## 0.2.46 - 2026-07-22
|
|
4
43
|
|
|
5
44
|
### Added
|
package/README.md
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Agent Knock Knock (AKK)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scotthuang/agent-knock-knock)
|
|
4
|
+
[](https://github.com/scotthuang/agent-knock-knock/actions/workflows/ci.yml)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
[](https://github.com/scotthuang/agent-knock-knock/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Agent Knock Knock turns OpenClaw into a control plane for local coding agents: delegate new work, preserve task state for follow-ups, and route results back to the original chat—even on channels without threads.
|
|
2
9
|
|
|
3
10
|

|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
AKK provides two complementary execution paths, plus Codex-native discovery and takeover:
|
|
13
|
+
|
|
14
|
+
| Path | Use it for | Agents |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| **ACPX / ACP** | Launch a new AKK-managed task with durable state and callbacks. | Codex, Claude Code, Cursor |
|
|
17
|
+
| **tmux bridge (experimental)** | Hand an existing live CLI session between OpenClaw and a human without starting another coding-agent process. | Codex, Claude Code |
|
|
18
|
+
| **Native discovery and takeover** | Discover, resume, or fork a local native session. | Codex |
|
|
19
|
+
|
|
20
|
+
[ACPX](https://github.com/openclaw/acpx) is the ACP client AKK uses for managed delegation; it is independent of tmux. Claude hooks are required only for structured approval and completion handling in Claude Code tmux sessions. Cursor tmux control is [not yet supported](https://github.com/scotthuang/agent-knock-knock/issues/42).
|
|
6
21
|
|
|
7
22
|
## Install
|
|
8
23
|
|
|
9
24
|
Requirements:
|
|
10
25
|
|
|
11
|
-
- Node.js
|
|
12
|
-
- OpenClaw
|
|
26
|
+
- Node.js 22.14+ (Node.js 24 recommended; use a version supported by your OpenClaw release)
|
|
27
|
+
- [OpenClaw](https://docs.openclaw.ai/) Gateway and plugin API `2026.3.24-beta.2` or newer
|
|
13
28
|
- [ACPX](https://github.com/openclaw/acpx) installed globally
|
|
14
29
|
- At least one authenticated coding agent: Codex, Claude Code, or Cursor
|
|
30
|
+
- For terminal control: a Unix-like host and `tmux`, with Codex or Claude Code running in a pane owned by the same user as OpenClaw
|
|
15
31
|
|
|
16
32
|
```bash
|
|
17
33
|
npm install -g acpx
|
|
@@ -22,25 +38,51 @@ agent-knock-knock doctor
|
|
|
22
38
|
|
|
23
39
|
`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.
|
|
24
40
|
|
|
41
|
+
> **Security:** ACPX delegations currently run with `--approve-all`. Treat them as trusted local automation, set an explicit workspace, and review the coding agent's own sandbox and credentials. tmux approval handling is separate and fails closed; terminal auto-approval is disabled by default.
|
|
42
|
+
|
|
43
|
+
AKK's normal plugin callback uses OpenClaw's own Gateway configuration and does not put the Gateway token in the coding-agent prompt or child-process arguments. Keep credentials out of a custom `callbackCommand`. The legacy direct CLI `--token` callback remains only for compatibility and embeds that credential in its callback command; do not use it for untrusted delegations.
|
|
44
|
+
|
|
45
|
+
To control Claude Code in tmux, install AKK's structured hooks once:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
agent-knock-knock install-claude-hooks
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The installer merges AKK hooks into `~/.claude/settings.json` and preserves existing settings and hooks. Rerun it if the AKK executable path changes. It is not needed for ACPX delegation.
|
|
52
|
+
|
|
25
53
|
If OpenClaw runs from a local checkout or another nonstandard location, pass its CLI explicitly:
|
|
26
54
|
|
|
27
55
|
```bash
|
|
28
56
|
agent-knock-knock install-openclaw --openclaw-bin /path/to/openclaw/openclaw.mjs
|
|
29
57
|
```
|
|
30
58
|
|
|
31
|
-
|
|
59
|
+
## Quick Start
|
|
32
60
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
First merge this configuration into `~/.openclaw/openclaw.json`, setting `workspace` to the absolute path of the project agents may modify:
|
|
62
|
+
|
|
63
|
+
```json5
|
|
64
|
+
// ~/.openclaw/openclaw.json
|
|
65
|
+
{
|
|
66
|
+
plugins: {
|
|
67
|
+
entries: {
|
|
68
|
+
"agent-knock-knock": {
|
|
69
|
+
config: {
|
|
70
|
+
defaultAgent: "codex",
|
|
71
|
+
workspace: "/absolute/path/to/project"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
37
77
|
```
|
|
38
78
|
|
|
39
|
-
|
|
79
|
+
Restart the Gateway after changing the configuration:
|
|
40
80
|
|
|
41
|
-
|
|
81
|
+
```bash
|
|
82
|
+
openclaw gateway restart
|
|
83
|
+
```
|
|
42
84
|
|
|
43
|
-
|
|
85
|
+
Then start a task from an OpenClaw chat and use the returned conversation ID for follow-ups:
|
|
44
86
|
|
|
45
87
|
```text
|
|
46
88
|
AKK Codex: inspect this repository and summarize it
|
|
@@ -55,19 +97,21 @@ If no agent is named, AKK uses the configured `defaultAgent`, falling back to Co
|
|
|
55
97
|
|
|
56
98
|
OpenClaw can spawn agents directly, but persistent sessions may depend on channel threads. WeChat and many direct-message surfaces do not provide that primitive. AKK keeps task state outside the chat channel so OpenClaw can recover, inspect, and continue coding-agent work from any supported surface.
|
|
57
99
|
|
|
58
|
-
OpenClaw remains the orchestrator. AKK provides the plugin bridge, ACPX/ACP transport, durable task state, tmux terminal control, and structured callbacks.
|
|
100
|
+
OpenClaw remains the orchestrator. AKK provides the plugin bridge, ACPX/ACP transport, durable task state, tmux terminal control, and structured callbacks. The tmux path is a handoff: avoid typing into a pane while AKK is driving the same turn.
|
|
59
101
|
|
|
60
102
|
```mermaid
|
|
61
103
|
flowchart LR
|
|
62
104
|
user["User / chat surface"] --> openclaw["OpenClaw"]
|
|
105
|
+
user <--> terminal["tmux terminal"]
|
|
63
106
|
openclaw --> plugin["AKK plugin"]
|
|
64
107
|
plugin --> state["Task state<br/>~/.agent-knock-knock"]
|
|
65
108
|
plugin --> acpx["ACPX/ACP"]
|
|
66
|
-
plugin
|
|
109
|
+
plugin <--> terminal
|
|
67
110
|
acpx --> codex["Codex"]
|
|
68
111
|
acpx --> claude["Claude Code"]
|
|
69
112
|
acpx --> cursor["Cursor"]
|
|
70
113
|
terminal --> codex
|
|
114
|
+
terminal --> claude
|
|
71
115
|
codex --> plugin
|
|
72
116
|
claude --> plugin
|
|
73
117
|
cursor --> plugin
|
|
@@ -75,7 +119,7 @@ flowchart LR
|
|
|
75
119
|
callback --> openclaw
|
|
76
120
|
```
|
|
77
121
|
|
|
78
|
-
See [
|
|
122
|
+
See the [roadmap](https://github.com/scotthuang/agent-knock-knock/blob/main/ROADMAP.md) for planned reliability and orchestration work.
|
|
79
123
|
|
|
80
124
|
## Usage
|
|
81
125
|
|
|
@@ -108,28 +152,13 @@ Surfaces with native commands also support:
|
|
|
108
152
|
|
|
109
153
|
## Configuration
|
|
110
154
|
|
|
111
|
-
Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/openclaw.json
|
|
112
|
-
|
|
113
|
-
```json5
|
|
114
|
-
{
|
|
115
|
-
plugins: {
|
|
116
|
-
entries: {
|
|
117
|
-
"agent-knock-knock": {
|
|
118
|
-
config: {
|
|
119
|
-
defaultAgent: "codex",
|
|
120
|
-
workspace: "/Users/scott/project"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
```
|
|
155
|
+
Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/openclaw.json`, as shown in the Quick Start.
|
|
127
156
|
|
|
128
157
|
| Option | Default | Purpose |
|
|
129
158
|
| --- | --- | --- |
|
|
130
159
|
| `defaultAgent` | `codex` | Agent used when a request does not name one. |
|
|
131
160
|
| `workspace` | OpenClaw process directory | Working directory for delegated tasks. |
|
|
132
|
-
| `storeDir` | `~/.agent-knock-knock/conversations` | Conversation state location
|
|
161
|
+
| `storeDir` | `~/.agent-knock-knock/conversations` | Conversation state location; relative plugin paths resolve from `workspace`. |
|
|
133
162
|
| `openclawBin` | Auto-detected | OpenClaw CLI used for callback delivery. |
|
|
134
163
|
| `codexAllProxy`, `cursorAllProxy`, `allProxy` | Unset | Per-agent or shared `ALL_PROXY` for ACPX launches. |
|
|
135
164
|
| `codexModel`, `cursorModel`, `model` | Unset | Per-agent or shared ACPX model override. |
|
|
@@ -141,9 +170,9 @@ Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/o
|
|
|
141
170
|
|
|
142
171
|
See [`openclaw.plugin.json`](openclaw.plugin.json) for the complete schema and compatibility aliases.
|
|
143
172
|
|
|
144
|
-
## Native
|
|
173
|
+
## Native Sessions and tmux Control
|
|
145
174
|
|
|
146
|
-
Experimental: AKK can discover Codex CLI sessions started outside AKK. `AKK list` separates managed `delegated` tasks, discovered `native` sessions, and tmux-backed `terminal_controlled` sessions.
|
|
175
|
+
Experimental: 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.
|
|
147
176
|
|
|
148
177
|
| Strategy | Behavior |
|
|
149
178
|
| --- | --- |
|
|
@@ -151,24 +180,29 @@ Experimental: AKK can discover Codex CLI sessions started outside AKK. `AKK list
|
|
|
151
180
|
| `AKK terminal takeover Codex <session-id>` | After confirmation, control the existing tmux session without stopping it. |
|
|
152
181
|
| `AKK fork takeover Codex <session-id>` | Keep the original running and create a new task from an OpenClaw-approved summary. |
|
|
153
182
|
|
|
154
|
-
A terminal-controlled ID works directly with `send`, `status`, `describe`, `cancel
|
|
183
|
+
A terminal-controlled ID works directly with `send`, `status`, `describe`, and `cancel`. Claude accepts new messages only at a verified idle prompt. Codex visible prompts can also be approved directly. Claude structured approval and durable monitoring require a managed lease: use `send --background` first (the OpenClaw send tool already does this), then use the returned managed conversation ID with `approve`, `cancel`, or `status`. Monitoring is activity-aware, survives Gateway restarts when AKK can revalidate the exact task, and has a separate hard lifetime. Use `renew` for a stalled monitor and `retry-callback` if callback delivery remains failed.
|
|
155
184
|
|
|
156
|
-
New terminal-controlled IDs use `terminal:v2:tmux:<agent>:<target>:<pid>`, for example `terminal:v2:tmux:
|
|
185
|
+
New terminal-controlled IDs use `terminal:v2:tmux:<agent>:<target>:<pid>`, for example `terminal:v2:tmux:claude:claude-work:0.1:33389`. Legacy `terminal:tmux:<target>:<pid>` IDs remain valid and are treated as Codex. Cursor tmux sessions are not yet supported.
|
|
157
186
|
|
|
158
187
|
Start sessions you may want to control remotely inside tmux:
|
|
159
188
|
|
|
160
189
|
```bash
|
|
161
190
|
tmux new -s codex-work
|
|
162
191
|
codex
|
|
192
|
+
|
|
193
|
+
tmux new -s claude-work
|
|
194
|
+
claude
|
|
163
195
|
```
|
|
164
196
|
|
|
165
|
-
|
|
197
|
+
For Claude Code, `send --background` creates the managed lease that binds hook events to the exact session, terminal, conversation, and message. A `Stop` event produces one callback from `last_assistant_message` only after background tasks and scheduled jobs have finished; `StopFailure` produces an actionable error. If hooks are unavailable or identity is stale or ambiguous, AKK can still discover, send, and inspect through tmux, but it will not approve or claim durable completion. `cancel` uses Escape only when no unverified permission dialog is visible; unsafe dialogs must be resolved manually in the terminal.
|
|
198
|
+
|
|
199
|
+
Avoid opening a second live client on the same agent session; concurrent clients can produce inconsistent visible history.
|
|
166
200
|
|
|
167
201
|
## Approvals
|
|
168
202
|
|
|
169
203
|
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.
|
|
170
204
|
|
|
171
|
-
For tmux-backed Codex, AKK reports visible approval prompts through OpenClaw
|
|
205
|
+
For tmux-backed Codex, AKK reports visible approval prompts. For Claude Code, the installed hook reports structured `PermissionRequest` events and AKK shows the tool name plus a redacted, bounded target summary without copying the full tool input. Inspect the current request through OpenClaw, then use `AKK approve <conversation-id>` to allow it or `AKK cancel <conversation-id>` to deny and stop. Unknown, stale, or ambiguous requests are never approved or interrupted by synthetic keys; resolve those dialogs manually in the terminal.
|
|
172
206
|
|
|
173
207
|
Trusted terminal commands can be auto-approved with a deterministic policy:
|
|
174
208
|
|
|
@@ -177,8 +211,8 @@ autoApprove: {
|
|
|
177
211
|
enabled: true,
|
|
178
212
|
rules: [{
|
|
179
213
|
id: "project-read-status",
|
|
180
|
-
agents: ["codex"],
|
|
181
|
-
workspaces: ["/
|
|
214
|
+
agents: ["codex", "claude"],
|
|
215
|
+
workspaces: ["/absolute/path/to/project"],
|
|
182
216
|
commands: [
|
|
183
217
|
["pwd"],
|
|
184
218
|
["git", "status"],
|
|
@@ -188,21 +222,23 @@ autoApprove: {
|
|
|
188
222
|
}
|
|
189
223
|
```
|
|
190
224
|
|
|
191
|
-
Place `autoApprove` inside the plugin `config` object. It is disabled by default and applies only to exact Codex
|
|
225
|
+
Place `autoApprove` inside the plugin `config` object. It is disabled by default and applies only to exact Codex run-command or Claude Code `Bash` argument vectors inside configured workspaces. Shell composition, substitutions, globs, environment assignments, unparseable commands, and out-of-workspace paths always require user approval. AKK revalidates the current request immediately before approval and records the matched rule and policy fingerprint. Enable it only with a trusted `PATH` and workspace: rules match command arguments, not executable hashes.
|
|
192
226
|
|
|
193
227
|
## Troubleshooting
|
|
194
228
|
|
|
195
|
-
Start with `agent-knock-knock doctor`. It checks Node.js
|
|
229
|
+
Start with `agent-knock-knock doctor`. It checks for Node.js 22.14+, OpenClaw, ACPX, at least one supported coding-agent command, and the packaged plugin files. It does not authenticate an agent, verify live Gateway/plugin connectivity, or run a real delegation. The OpenClaw CLI must be on `PATH` or in a common user install directory for this check.
|
|
196
230
|
|
|
197
231
|
| Symptom | Action |
|
|
198
232
|
| --- | --- |
|
|
199
233
|
| Installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
|
|
200
234
|
| Source changes do not appear | Build, reinstall from the checkout, and restart the Gateway. |
|
|
201
|
-
| Terminal bridge task is `stalled` | Run
|
|
235
|
+
| Terminal bridge task is `stalled` | Run `/akk renew <conversation-id> <minutes>` in a native-command chat, or ask OpenClaw to renew it. |
|
|
202
236
|
| ACPX task is `stalled` | Inspect `status --trace`; close and redelegate if the executor cannot continue. |
|
|
203
|
-
| Task is `callback_failed` | Run
|
|
237
|
+
| Task is `callback_failed` | Run `/akk retry-callback <conversation-id>` in a native-command chat. |
|
|
204
238
|
| Codex delegation rejects the deprecated adapter | Remove the old override or select a supported adapter as described below. |
|
|
205
|
-
| Terminal takeover is unavailable | Run Codex inside tmux and check `AKK list` for a `terminal_controlled` entry. |
|
|
239
|
+
| Terminal takeover is unavailable | Run Codex or Claude Code inside tmux and check `AKK list` for a `terminal_controlled` entry. |
|
|
240
|
+
| An upgraded tmux task reports no exact agent PID | List the live terminal session and attach it again; AKK migrates only an unambiguous legacy Codex session/pane match. |
|
|
241
|
+
| Claude permission or completion is not detected | Run `agent-knock-knock install-claude-hooks`, then retry in the managed tmux session. |
|
|
206
242
|
|
|
207
243
|
For local diagnostics, use:
|
|
208
244
|
|
|
@@ -214,7 +250,7 @@ agent-knock-knock list --managed-only # skip native and terminal discovery
|
|
|
214
250
|
|
|
215
251
|
### Codex ACP Adapter
|
|
216
252
|
|
|
217
|
-
Codex delegation uses `npx -y @agentclientprotocol/codex-acp
|
|
253
|
+
Codex delegation uses the tested, pinned adapter `npx -y @agentclientprotocol/codex-acp@1.1.7` by default and rejects the deprecated `@zed-industries/codex-acp`. The first run may take longer while `npx` downloads the adapter. To select another compatible adapter, set this in the environment that runs OpenClaw/AKK:
|
|
218
254
|
|
|
219
255
|
```bash
|
|
220
256
|
export AKK_CODEX_ACPX_AGENT_COMMAND='your-compatible-adapter-command'
|
|
@@ -231,7 +267,9 @@ npm run simulate:weather
|
|
|
231
267
|
npm run transcript -- --conversation ~/.agent-knock-knock/conversations/<conversation-id>
|
|
232
268
|
```
|
|
233
269
|
|
|
234
|
-
Pass `--include-raw` to the transcript command only when debugging model exchange events. See [CONTRIBUTING.md](CONTRIBUTING.md) for the development and pull request workflow.
|
|
270
|
+
Pass `--include-raw` to the transcript command only when debugging model exchange events. See [CONTRIBUTING.md](https://github.com/scotthuang/agent-knock-knock/blob/main/CONTRIBUTING.md) for the development and pull request workflow.
|
|
271
|
+
|
|
272
|
+
For local OpenClaw testing, run `node dist/src/cli.js install-openclaw` after each build or plugin-source update. OpenClaw loads the compiled files from `dist/`.
|
|
235
273
|
|
|
236
274
|
## Storage and Logs
|
|
237
275
|
|
|
@@ -246,26 +284,26 @@ Pass `--include-raw` to the transcript command only when debugging model exchang
|
|
|
246
284
|
runtime-YYYY-MM-DD.ndjson
|
|
247
285
|
```
|
|
248
286
|
|
|
249
|
-
Use `--store-dir <dir>` to override the conversation store; `--log-dir` remains a compatibility alias. Agent output and runtime logs are diagnostic-only and are not part of OpenClaw-agent communication.
|
|
287
|
+
Use `--store-dir <dir>` to override the conversation store with a dedicated private directory; `--log-dir` remains a compatibility alias. Agent output and runtime logs are diagnostic-only and are not part of OpenClaw-agent communication.
|
|
250
288
|
|
|
251
|
-
Runtime logs use local timestamps, redact common secrets, and are cleaned by retention policy. Configure them with `AKK_LOG_DIR`, `AKK_LOG_LEVEL`, and `AKK_LOG_RETENTION_DAYS`. Defaults are `~/.agent-knock-knock/logs` and 14 days.
|
|
289
|
+
AKK keeps its store and conversation directories at `0700` and state, event, agent-output, and runtime-log files at `0600`. Runtime logs use local timestamps, redact common secrets, and are cleaned by retention policy. Configure them with `AKK_LOG_DIR`, `AKK_LOG_LEVEL`, and `AKK_LOG_RETENTION_DAYS`. Defaults are `~/.agent-knock-knock/logs` and 14 days. A custom `AKK_LOG_DIR` must be empty or dedicated to AKK; shared directories are rejected without changing their permissions.
|
|
252
290
|
|
|
253
291
|
## Release
|
|
254
292
|
|
|
255
|
-
`package.json` is the version source.
|
|
293
|
+
`package.json` is the version source. Update it, `package-lock.json`, and the changelog in the release PR. After that commit reaches `main`, tag the exact version:
|
|
256
294
|
|
|
257
295
|
```bash
|
|
258
|
-
|
|
259
|
-
git
|
|
260
|
-
git push
|
|
296
|
+
AKK_RELEASE_VERSION="$(node -p "require('./package.json').version")"
|
|
297
|
+
git tag "v${AKK_RELEASE_VERSION}"
|
|
298
|
+
git push origin "v${AKK_RELEASE_VERSION}"
|
|
261
299
|
```
|
|
262
300
|
|
|
263
301
|
Tags matching `v*` run the release workflow, which tests the package, publishes it to npm, and creates a GitHub Release. Publishing requires an `NPM_TOKEN` repository secret.
|
|
264
302
|
|
|
265
303
|
## Security
|
|
266
304
|
|
|
267
|
-
Do not open public issues for sensitive security reports. See [
|
|
305
|
+
Do not open public issues for sensitive security reports. See the [security policy](https://github.com/scotthuang/agent-knock-knock/blob/main/SECURITY.md).
|
|
268
306
|
|
|
269
307
|
## License
|
|
270
308
|
|
|
271
|
-
MIT. See [LICENSE](LICENSE).
|
|
309
|
+
MIT. See [LICENSE](https://github.com/scotthuang/agent-knock-knock/blob/main/LICENSE).
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export interface ApprovalCandidate {
|
|
2
2
|
agent: string;
|
|
3
3
|
kind: string;
|
|
4
|
+
decisionMode?: "keys" | "structured";
|
|
4
5
|
command?: string;
|
|
5
6
|
cwd?: string;
|
|
6
7
|
fingerprint: string;
|
|
@@ -32,10 +33,11 @@ export declare function evaluateApprovalPolicy({ policy, candidate }: {
|
|
|
32
33
|
policy: unknown;
|
|
33
34
|
candidate: ApprovalCandidate;
|
|
34
35
|
}): ApprovalPolicyDecision;
|
|
35
|
-
export declare function autoApprovalCliArgs({ statePath, candidate, decision }: {
|
|
36
|
+
export declare function autoApprovalCliArgs({ statePath, candidate, decision, policy }: {
|
|
36
37
|
statePath: string;
|
|
37
38
|
candidate: ApprovalCandidate;
|
|
38
39
|
decision: ApprovalPolicyDecision;
|
|
40
|
+
policy: unknown;
|
|
39
41
|
}): string[] | undefined;
|
|
40
42
|
export declare function attemptAutoApproval({ message, policy, statePath, execute }: {
|
|
41
43
|
message: unknown;
|
|
@@ -23,6 +23,9 @@ export function approvalCandidateFromMessage(message) {
|
|
|
23
23
|
agent,
|
|
24
24
|
kind,
|
|
25
25
|
fingerprint,
|
|
26
|
+
...(candidate?.decision_mode === "structured" || candidate?.decision_mode === "keys"
|
|
27
|
+
? { decisionMode: candidate.decision_mode }
|
|
28
|
+
: {}),
|
|
26
29
|
command: stringValue(candidate?.command),
|
|
27
30
|
cwd: stringValue(candidate?.cwd),
|
|
28
31
|
terminalTarget: stringValue(candidate?.terminal_target)
|
|
@@ -36,6 +39,9 @@ export function evaluateApprovalPolicy({ policy, candidate }) {
|
|
|
36
39
|
if (candidate.kind !== "run_command") {
|
|
37
40
|
return ask(`approval kind is not supported: ${candidate.kind}`, policyFingerprint);
|
|
38
41
|
}
|
|
42
|
+
if (candidate.agent === "claude" && candidate.decisionMode !== "structured") {
|
|
43
|
+
return ask("Claude auto approval requires a structured hook request", policyFingerprint);
|
|
44
|
+
}
|
|
39
45
|
if (!candidate.command) {
|
|
40
46
|
return ask("approval command is unavailable", policyFingerprint);
|
|
41
47
|
}
|
|
@@ -72,8 +78,12 @@ export function evaluateApprovalPolicy({ policy, candidate }) {
|
|
|
72
78
|
}
|
|
73
79
|
return ask("no explicit auto-approval rule matched", policyFingerprint, parsed.argv);
|
|
74
80
|
}
|
|
75
|
-
export function autoApprovalCliArgs({ statePath, candidate, decision }) {
|
|
76
|
-
|
|
81
|
+
export function autoApprovalCliArgs({ statePath, candidate, decision, policy }) {
|
|
82
|
+
const serializedPolicy = JSON.stringify(policy);
|
|
83
|
+
if (decision.action !== "approve" ||
|
|
84
|
+
!decision.ruleId ||
|
|
85
|
+
!statePath ||
|
|
86
|
+
typeof serializedPolicy !== "string") {
|
|
77
87
|
return undefined;
|
|
78
88
|
}
|
|
79
89
|
return [
|
|
@@ -86,7 +96,9 @@ export function autoApprovalCliArgs({ statePath, candidate, decision }) {
|
|
|
86
96
|
"--policy-rule-id",
|
|
87
97
|
decision.ruleId,
|
|
88
98
|
"--policy-fingerprint",
|
|
89
|
-
decision.policyFingerprint
|
|
99
|
+
decision.policyFingerprint,
|
|
100
|
+
"--auto-approval-policy-json",
|
|
101
|
+
serializedPolicy
|
|
90
102
|
];
|
|
91
103
|
}
|
|
92
104
|
export function attemptAutoApproval({ message, policy, statePath, execute }) {
|
|
@@ -95,7 +107,9 @@ export function attemptAutoApproval({ message, policy, statePath, execute }) {
|
|
|
95
107
|
return undefined;
|
|
96
108
|
}
|
|
97
109
|
const decision = evaluateApprovalPolicy({ policy, candidate });
|
|
98
|
-
const cliArgs = statePath
|
|
110
|
+
const cliArgs = statePath
|
|
111
|
+
? autoApprovalCliArgs({ statePath, candidate, decision, policy })
|
|
112
|
+
: undefined;
|
|
99
113
|
if (!cliArgs || !decision.ruleId) {
|
|
100
114
|
return {
|
|
101
115
|
approved: false,
|
|
@@ -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;AAmC7B,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,CAAC;IAED,OAAO;QACL,KAAK;QACL,IAAI;QACJ,WAAW;QACX,OAAO,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AC,KAAa;IAC/B,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,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,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const CLAUDE_HOOK_EVENT_NAMES: readonly ["SessionStart", "UserPromptSubmit", "PermissionRequest", "Stop", "StopFailure", "Notification"];
|
|
2
|
+
export type InstalledClaudeHookEventName = typeof CLAUDE_HOOK_EVENT_NAMES[number];
|
|
3
|
+
export interface InstallClaudeHooksOptions {
|
|
4
|
+
/** Absolute path to the agent-knock-knock executable. */
|
|
5
|
+
executablePath: string;
|
|
6
|
+
/** Defaults to ~/.claude/settings.json. */
|
|
7
|
+
settingsPath?: string;
|
|
8
|
+
/** Computes and returns a summary without creating or changing any files. */
|
|
9
|
+
dryRun?: boolean;
|
|
10
|
+
/** Injectable for deterministic backup names in tests. */
|
|
11
|
+
now?: () => Date;
|
|
12
|
+
}
|
|
13
|
+
export interface ClaudeHookInstallSummary {
|
|
14
|
+
addedCount: number;
|
|
15
|
+
existingCount: number;
|
|
16
|
+
warningCount: number;
|
|
17
|
+
}
|
|
18
|
+
export interface InstallClaudeHooksResult {
|
|
19
|
+
settingsPath: string;
|
|
20
|
+
changed: boolean;
|
|
21
|
+
written: boolean;
|
|
22
|
+
dryRun: boolean;
|
|
23
|
+
created: boolean;
|
|
24
|
+
backupPath?: string;
|
|
25
|
+
addedEvents: InstalledClaudeHookEventName[];
|
|
26
|
+
existingEvents: InstalledClaudeHookEventName[];
|
|
27
|
+
warnings: string[];
|
|
28
|
+
summary: ClaudeHookInstallSummary;
|
|
29
|
+
}
|
|
30
|
+
export interface MergeClaudeHookSettingsResult {
|
|
31
|
+
settings: Record<string, unknown>;
|
|
32
|
+
changed: boolean;
|
|
33
|
+
addedEvents: InstalledClaudeHookEventName[];
|
|
34
|
+
existingEvents: InstalledClaudeHookEventName[];
|
|
35
|
+
warnings: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface TrustedClaudeTokenjuiceLauncher {
|
|
38
|
+
/** Exact absolute path configured by the trusted Claude PreToolUse hook. */
|
|
39
|
+
configuredPath: string;
|
|
40
|
+
/** Canonical target observed while loading that configuration. */
|
|
41
|
+
canonicalPath: string;
|
|
42
|
+
}
|
|
43
|
+
/** Returns Claude Code's user settings path without reading it. */
|
|
44
|
+
export declare function defaultClaudeSettingsPath(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Reads only Tokenjuice launcher provenance from Claude's trusted user settings.
|
|
47
|
+
* Invalid, missing, non-executable, or relative launchers are ignored so approval
|
|
48
|
+
* normalization fails closed without exposing settings contents.
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadTrustedClaudeTokenjuiceLaunchers(settingsPath?: string): TrustedClaudeTokenjuiceLauncher[];
|
|
51
|
+
export declare function extractClaudeTokenjuiceLaunchers(settingsValue: unknown): string[];
|
|
52
|
+
/**
|
|
53
|
+
* Adds AKK matcher groups without mutating the supplied settings object.
|
|
54
|
+
* Existing groups and sibling handlers are retained byte-for-byte when the
|
|
55
|
+
* result is serialized, apart from JSON's normal formatting.
|
|
56
|
+
*/
|
|
57
|
+
export declare function mergeClaudeHookSettings(settingsValue: unknown, executablePathValue: string): MergeClaudeHookSettingsResult;
|
|
58
|
+
/**
|
|
59
|
+
* Safely installs Claude Code user hooks. This function does not log settings
|
|
60
|
+
* contents and its result contains only paths, event names, counts, and
|
|
61
|
+
* non-sensitive warnings.
|
|
62
|
+
*/
|
|
63
|
+
export declare function installClaudeHooks(options: InstallClaudeHooksOptions): InstallClaudeHooksResult;
|
|
64
|
+
/** Compatibility-friendly explicit name for callers wiring an install command. */
|
|
65
|
+
export declare const installClaudeHookSettings: typeof installClaudeHooks;
|