@scotthuang/agent-knock-knock 0.2.44 → 0.2.47
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 +33 -0
- package/README.md +148 -242
- package/dist/src/approval-policy.d.ts +1 -0
- package/dist/src/approval-policy.js +6 -0
- 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 +1064 -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 +920 -0
- package/dist/src/claude-terminal-agent-adapter.js.map +1 -0
- package/dist/src/cli.js +1565 -772
- package/dist/src/cli.js.map +1 -1
- package/dist/src/codex-session-provider.d.ts +6 -32
- package/dist/src/codex-session-provider.js +2 -1
- package/dist/src/codex-session-provider.js.map +1 -1
- package/dist/src/codex-store-adapter.d.ts +3 -9
- package/dist/src/codex-store-adapter.js +5 -55
- package/dist/src/codex-store-adapter.js.map +1 -1
- package/dist/src/codex-terminal-agent-adapter.d.ts +34 -0
- package/dist/src/codex-terminal-agent-adapter.js +386 -0
- package/dist/src/codex-terminal-agent-adapter.js.map +1 -0
- package/dist/src/openclaw-plugin.js +60 -11
- package/dist/src/openclaw-plugin.js.map +1 -1
- package/dist/src/protocol.d.ts +1 -1
- package/dist/src/terminal-agent-adapter.d.ts +158 -0
- package/dist/src/terminal-agent-adapter.js +109 -0
- package/dist/src/terminal-agent-adapter.js.map +1 -0
- package/dist/src/terminal-agent-bridge.d.ts +114 -0
- package/dist/src/terminal-agent-bridge.js +487 -0
- package/dist/src/terminal-agent-bridge.js.map +1 -0
- package/dist/src/terminal-agent-registry.d.ts +7 -0
- package/dist/src/terminal-agent-registry.js +24 -0
- package/dist/src/terminal-agent-registry.js.map +1 -0
- package/dist/src/terminal-control-provider.d.ts +8 -6
- package/dist/src/terminal-control-provider.js +5 -5
- package/dist/src/terminal-control-provider.js.map +1 -1
- package/dist/src/terminal-process-source.d.ts +25 -0
- package/dist/src/terminal-process-source.js +77 -0
- package/dist/src/terminal-process-source.js.map +1 -0
- package/openclaw.plugin.json +7 -3
- package/package.json +1 -1
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +19 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.47 - 2026-07-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add tmux control for Claude Code, including discovery, safe idle-only sends, Hook-backed monitoring, structured allow/deny, and exact-rule auto approval.
|
|
8
|
+
- Add an idempotent `install-claude-hooks` command that preserves existing Claude settings and hooks.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
|
|
15
|
+
## 0.2.46 - 2026-07-22
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Add a registry-driven terminal-agent adapter layer, neutral process discovery, agent-aware terminal IDs, and a documented extension path while keeping legacy Codex IDs compatible.
|
|
20
|
+
|
|
21
|
+
### Security
|
|
22
|
+
|
|
23
|
+
- Fail closed on missing capabilities and revalidate the full ordered approval-key action against a freshly captured prompt before sending terminal input.
|
|
24
|
+
|
|
25
|
+
## 0.2.45 - 2026-07-20
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Persist terminal callback delivery state and add bounded automatic retries plus `AKK retry-callback` / `agent_knock_knock_retry_callback` for idempotent manual recovery after delivery failures.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- Require a request-hash-matched Codex rollout `task_complete` (or terminal-screen completion fallback) before closing terminal bridge tasks, preventing same-workspace assistant progress from another or unfinished turn from being reported as done.
|
|
34
|
+
- Keep terminal bridge tasks in `callback_pending` or `callback_failed` until their OpenClaw callback is actually delivered, and close them only after successful delivery.
|
|
35
|
+
|
|
3
36
|
## 0.2.44 - 2026-07-19
|
|
4
37
|
|
|
5
38
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,151 +2,102 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Agent Knock Knock lets OpenClaw delegate work to local
|
|
5
|
+
Agent Knock Knock (AKK) lets OpenClaw delegate work to local Codex, Claude Code, and Cursor agents, preserve each task for follow-ups, and route results back to chat—even on channels without threads. It can also discover native Codex sessions and control Codex or Claude Code already running in tmux.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Why This Exists
|
|
10
|
-
|
|
11
|
-
OpenClaw already has built-in session spawning, but persistent ACP sessions can depend on thread-bound channels such as Discord or Telegram. That model works well when the external channel can attach replies to a stable thread.
|
|
12
|
-
|
|
13
|
-
Channels such as WeChat and many direct-message surfaces do not provide that same thread primitive. Without an external thread, OpenClaw needs another durable place to remember which coding agents are working, which task each agent owns, and where follow-up messages should go.
|
|
14
|
-
|
|
15
|
-
Agent Knock Knock fills that gap. It keeps local task state outside the chat channel, uses ACPX / ACP to talk to coding agents, and gives OpenClaw tools to delegate, list, inspect, continue, cancel, and close work without relying on any external channel feature.
|
|
16
|
-
|
|
17
|
-
BTW, it can also [take over a Codex task](#native-codex-takeover) you started in a terminal, so when you are away from your computer, OpenClaw can still pick it up and keep going.
|
|
18
|
-
|
|
19
|
-
## What It Provides
|
|
20
|
-
|
|
21
|
-
- ACPX-backed delegation to Codex, Claude Code, and Cursor
|
|
22
|
-
- Reusable task sessions for follow-up messages after the first result
|
|
23
|
-
- Task listing, status inspection, follow-up send, cooperative cancellation, and local close
|
|
24
|
-
- Structured callbacks back into OpenClaw through the plugin Gateway method
|
|
25
|
-
- Conversation state stored in the user's home directory for recovery across OpenClaw turns
|
|
26
|
-
- Runtime diagnostics logs with local timestamps, redaction, and retention cleanup
|
|
27
|
-
- A short `AKK` routing convention for chat and `/akk` command surfaces
|
|
28
|
-
|
|
29
|
-
See [ROADMAP.md](ROADMAP.md) for planned reliability work and future orchestration features.
|
|
30
|
-
|
|
31
|
-
## Architecture
|
|
32
|
-
|
|
33
|
-
OpenClaw is the top-level orchestrator. Agent Knock Knock runs as the OpenClaw plugin bridge, uses ACPX / ACP to communicate with local coding agents, and keeps enough local task state for OpenClaw to manage many concurrent coding-agent sessions.
|
|
34
|
-
|
|
35
|
-
```mermaid
|
|
36
|
-
flowchart LR
|
|
37
|
-
user["User / chat surface"] --> openclaw["OpenClaw"]
|
|
38
|
-
openclaw --> plugin["Agent Knock Knock<br/>OpenClaw plugin"]
|
|
39
|
-
plugin --> state["Local task state<br/>~/.agent-knock-knock"]
|
|
40
|
-
plugin --> acpx["ACPX / ACP"]
|
|
41
|
-
plugin --> terminal["Terminal bridge<br/>tmux Codex"]
|
|
42
|
-
acpx --> codex["Codex"]
|
|
43
|
-
acpx --> claude["Claude Code"]
|
|
44
|
-
acpx --> cursor["Cursor"]
|
|
45
|
-
terminal --> codex
|
|
46
|
-
codex --> plugin
|
|
47
|
-
claude --> plugin
|
|
48
|
-
cursor --> plugin
|
|
49
|
-
plugin --> callback["OpenClaw callback"]
|
|
50
|
-
callback --> openclaw
|
|
51
|
-
```
|
|
7
|
+
## Install
|
|
52
8
|
|
|
53
|
-
|
|
9
|
+
Requirements:
|
|
54
10
|
|
|
55
11
|
- Node.js 20+
|
|
56
12
|
- OpenClaw installed and running
|
|
57
|
-
- ACPX installed globally
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm install -g acpx
|
|
61
|
-
acpx --version
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
- At least one local coding agent:
|
|
65
|
-
- Codex, if you want Codex delegation
|
|
66
|
-
- Claude Code, if you want Claude delegation
|
|
67
|
-
- Cursor, if you want Cursor delegation
|
|
68
|
-
|
|
69
|
-
Agent Knock Knock does not manage Codex, Claude Code, or Cursor authentication. Make sure the agent you want to use is already installed and logged in before delegating tasks.
|
|
70
|
-
|
|
71
|
-
## Install
|
|
72
|
-
|
|
73
|
-
Install Agent Knock Knock globally:
|
|
13
|
+
- [ACPX](https://github.com/openclaw/acpx) installed globally
|
|
14
|
+
- At least one authenticated coding agent: Codex, Claude Code, or Cursor
|
|
74
15
|
|
|
75
16
|
```bash
|
|
17
|
+
npm install -g acpx
|
|
76
18
|
npm install -g @scotthuang/agent-knock-knock
|
|
77
19
|
agent-knock-knock install-openclaw
|
|
78
20
|
agent-knock-knock doctor
|
|
79
21
|
```
|
|
80
22
|
|
|
81
|
-
`install-openclaw` installs or updates
|
|
23
|
+
`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.
|
|
82
24
|
|
|
83
|
-
|
|
25
|
+
To control Claude Code sessions in tmux, install AKK's structured hooks once:
|
|
84
26
|
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
1. Make sure Node.js 20+, OpenClaw, and at least one local coding agent such as Codex, Claude Code, or Cursor are installed.
|
|
88
|
-
2. Install ACPX globally if it is missing: npm install -g acpx.
|
|
89
|
-
3. Run npm install.
|
|
90
|
-
4. Run npm run build.
|
|
91
|
-
5. Link and enable the OpenClaw plugin from this repository.
|
|
92
|
-
6. Install the Agent Knock Knock skill template into ~/.openclaw/skills/agent-knock-knock/SKILL.md.
|
|
93
|
-
7. Restart the OpenClaw Gateway.
|
|
27
|
+
```bash
|
|
28
|
+
agent-knock-knock install-claude-hooks
|
|
94
29
|
```
|
|
95
30
|
|
|
96
|
-
|
|
31
|
+
The installer merges AKK hooks into `~/.claude/settings.json` and preserves existing settings and hooks. Rerun it if the AKK executable path changes.
|
|
97
32
|
|
|
98
|
-
|
|
33
|
+
If OpenClaw runs from a local checkout or another nonstandard location, pass its CLI explicitly:
|
|
99
34
|
|
|
100
35
|
```bash
|
|
101
|
-
|
|
102
|
-
npm run build
|
|
103
|
-
openclaw plugins install --link .
|
|
104
|
-
openclaw plugins enable agent-knock-knock
|
|
36
|
+
agent-knock-knock install-openclaw --openclaw-bin /path/to/openclaw/openclaw.mjs
|
|
105
37
|
```
|
|
106
38
|
|
|
107
|
-
|
|
39
|
+
For local AKK development:
|
|
108
40
|
|
|
109
41
|
```bash
|
|
110
|
-
|
|
111
|
-
|
|
42
|
+
npm install
|
|
43
|
+
npm run build
|
|
44
|
+
node dist/src/cli.js install-openclaw
|
|
112
45
|
```
|
|
113
46
|
|
|
114
|
-
|
|
47
|
+
Rerun the build and installer after pulling or editing plugin sources. OpenClaw loads the compiled files from `dist/`.
|
|
115
48
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
49
|
+
## Quick Start
|
|
50
|
+
|
|
51
|
+
Start a task from an OpenClaw chat, then use its conversation ID for follow-ups:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
AKK Codex: inspect this repository and summarize it
|
|
55
|
+
AKK status <conversation-id>
|
|
56
|
+
AKK send <conversation-id>: run the tests and fix any failures
|
|
57
|
+
AKK list
|
|
122
58
|
```
|
|
123
59
|
|
|
124
|
-
|
|
60
|
+
If no agent is named, AKK uses the configured `defaultAgent`, falling back to Codex.
|
|
61
|
+
|
|
62
|
+
## Why AKK
|
|
63
|
+
|
|
64
|
+
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.
|
|
65
|
+
|
|
66
|
+
OpenClaw remains the orchestrator. AKK provides the plugin bridge, ACPX/ACP transport, durable task state, tmux terminal control, and structured callbacks.
|
|
67
|
+
|
|
68
|
+
```mermaid
|
|
69
|
+
flowchart LR
|
|
70
|
+
user["User / chat surface"] --> openclaw["OpenClaw"]
|
|
71
|
+
openclaw --> plugin["AKK plugin"]
|
|
72
|
+
plugin --> state["Task state<br/>~/.agent-knock-knock"]
|
|
73
|
+
plugin --> acpx["ACPX/ACP"]
|
|
74
|
+
plugin --> terminal["tmux terminal bridge"]
|
|
75
|
+
acpx --> codex["Codex"]
|
|
76
|
+
acpx --> claude["Claude Code"]
|
|
77
|
+
acpx --> cursor["Cursor"]
|
|
78
|
+
terminal --> codex
|
|
79
|
+
terminal --> claude
|
|
80
|
+
codex --> plugin
|
|
81
|
+
claude --> plugin
|
|
82
|
+
cursor --> plugin
|
|
83
|
+
plugin --> callback["OpenClaw callback"]
|
|
84
|
+
callback --> openclaw
|
|
85
|
+
```
|
|
125
86
|
|
|
126
|
-
|
|
87
|
+
See [ROADMAP.md](ROADMAP.md) for planned reliability and orchestration work.
|
|
127
88
|
|
|
128
|
-
|
|
89
|
+
## Usage
|
|
129
90
|
|
|
130
|
-
|
|
91
|
+
Use conversational `AKK` prompts on any chat surface. Explicit agent names override the configured default:
|
|
131
92
|
|
|
132
93
|
```text
|
|
133
|
-
akk: fix the failing tests in this project
|
|
134
|
-
AKK Codex: review the current branch and propose a small fix
|
|
135
94
|
AKK Claude: review the latest commit
|
|
136
95
|
AKK Cursor: fix the flaky UI test
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
akk describe <conversation-id>
|
|
140
|
-
akk send <conversation-id>: continue with the smaller implementation
|
|
141
|
-
akk cancel <conversation-id>
|
|
142
|
-
akk renew <conversation-id> --minutes 180
|
|
143
|
-
akk recover <conversation-id>
|
|
144
|
-
akk close <conversation-id>
|
|
145
|
-
AKK terminal takeover Codex <native-session-id>
|
|
146
|
-
AKK approve <conversation-id>
|
|
96
|
+
AKK describe <conversation-id>
|
|
97
|
+
AKK recover <conversation-id>
|
|
147
98
|
```
|
|
148
99
|
|
|
149
|
-
Surfaces
|
|
100
|
+
Surfaces with native commands also support:
|
|
150
101
|
|
|
151
102
|
```text
|
|
152
103
|
/akk <task>
|
|
@@ -155,31 +106,18 @@ Surfaces that support OpenClaw native commands can use the same workflow through
|
|
|
155
106
|
/akk cursor <task>
|
|
156
107
|
/akk list
|
|
157
108
|
/akk status <conversation-id>
|
|
109
|
+
/akk describe <conversation-id>
|
|
158
110
|
/akk send <conversation-id> <message>
|
|
159
111
|
/akk cancel <conversation-id>
|
|
160
112
|
/akk renew <conversation-id> [minutes]
|
|
113
|
+
/akk retry-callback <conversation-id>
|
|
114
|
+
/akk recover <conversation-id>
|
|
161
115
|
/akk close <conversation-id> [reason]
|
|
162
116
|
```
|
|
163
117
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
```json5
|
|
167
|
-
{
|
|
168
|
-
plugins: {
|
|
169
|
-
entries: {
|
|
170
|
-
"agent-knock-knock": {
|
|
171
|
-
config: {
|
|
172
|
-
defaultAgent: "codex", // "codex", "claude", or "cursor"
|
|
173
|
-
agentTimeoutMinutes: 60, // terminal inactivity timeout
|
|
174
|
-
agentHardTimeoutMinutes: 720 // terminal task lifetime ceiling
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
118
|
+
## Configuration
|
|
181
119
|
|
|
182
|
-
|
|
120
|
+
Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/openclaw.json`:
|
|
183
121
|
|
|
184
122
|
```json5
|
|
185
123
|
{
|
|
@@ -187,21 +125,8 @@ Optional deterministic auto-approval policy for terminal-controlled Codex sessio
|
|
|
187
125
|
entries: {
|
|
188
126
|
"agent-knock-knock": {
|
|
189
127
|
config: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
rules: [
|
|
193
|
-
{
|
|
194
|
-
id: "project-read-status",
|
|
195
|
-
agents: ["codex"],
|
|
196
|
-
workspaces: ["/Users/scott/project"],
|
|
197
|
-
commands: [
|
|
198
|
-
["pwd"],
|
|
199
|
-
["git", "status"],
|
|
200
|
-
["git", "diff", "--stat"]
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
]
|
|
204
|
-
}
|
|
128
|
+
defaultAgent: "codex",
|
|
129
|
+
workspace: "/Users/scott/project"
|
|
205
130
|
}
|
|
206
131
|
}
|
|
207
132
|
}
|
|
@@ -209,118 +134,121 @@ Optional deterministic auto-approval policy for terminal-controlled Codex sessio
|
|
|
209
134
|
}
|
|
210
135
|
```
|
|
211
136
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
137
|
+
| Option | Default | Purpose |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| `defaultAgent` | `codex` | Agent used when a request does not name one. |
|
|
140
|
+
| `workspace` | OpenClaw process directory | Working directory for delegated tasks. |
|
|
141
|
+
| `storeDir` | `~/.agent-knock-knock/conversations` | Conversation state location. |
|
|
142
|
+
| `openclawBin` | Auto-detected | OpenClaw CLI used for callback delivery. |
|
|
143
|
+
| `codexAllProxy`, `cursorAllProxy`, `allProxy` | Unset | Per-agent or shared `ALL_PROXY` for ACPX launches. |
|
|
144
|
+
| `codexModel`, `cursorModel`, `model` | Unset | Per-agent or shared ACPX model override. |
|
|
145
|
+
| `defaultCodexSession`, `defaultClaudeSession`, `defaultCursorSession` | Generated per task | Named ACPX session to reuse. |
|
|
146
|
+
| `idleTimeoutMinutes` | `10080` | Time before an idle task is lazily closed. |
|
|
147
|
+
| `agentTimeoutMinutes` | `60` | Callback timeout; terminal bridges treat it as an inactivity timeout. |
|
|
148
|
+
| `agentHardTimeoutMinutes` | `720` | Maximum terminal bridge monitor lifetime. |
|
|
149
|
+
| `softLimit`, `hardLimit` | `50`, `100` | Response-requiring round limits. |
|
|
217
150
|
|
|
218
|
-
|
|
151
|
+
See [`openclaw.plugin.json`](openclaw.plugin.json) for the complete schema and compatibility aliases.
|
|
219
152
|
|
|
220
|
-
|
|
221
|
-
AKK list
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
`AKK list` returns separate groups for:
|
|
153
|
+
## Native Sessions and tmux Control
|
|
225
154
|
|
|
226
|
-
|
|
227
|
-
- `native`: local native sessions that AKK can discover but cannot directly control.
|
|
228
|
-
- `terminal_controlled`: local sessions running in a controllable terminal provider. The current provider is tmux. These entries include terminal metadata, command capabilities, and concise approval state when a visible approval prompt is detected.
|
|
229
|
-
- `terminal_controlled` entries can be addressed directly by their `id` from `AKK list` for `AKK send <id>`, `AKK status <id>`, `AKK cancel <id>`, and `AKK approve <id>`. They do not need an AKK state file before terminal control.
|
|
230
|
-
- Background sends to terminal-controlled Codex sessions use terminal bridge mode: AKK types only the user-facing task text into the tmux pane, monitors Codex rollout/terminal state, and delivers the OpenClaw callback itself when it observes completion.
|
|
231
|
-
- Terminal bridge timeout is activity-aware. Visible Codex work, active background terminals, rollout updates, and meaningful terminal changes extend the inactivity deadline. A separate hard lifetime still stops permanently running monitors.
|
|
232
|
-
- If a live terminal task is marked `stalled`, `AKK renew <conversation-id> --minutes <minutes>` restarts monitoring without sending text or keys to Codex. Renewal preserves the original callback destination and task hard deadline.
|
|
233
|
-
- `AKK status <terminal-controlled-id>` is the unified way to inspect current terminal output. AKK captures the terminal pane internally and returns `terminal_screen`; there is no separate public screen-capture command.
|
|
234
|
-
- `AKK describe <id>` summarizes what a listed session is about. AKK-managed sessions use saved conversation history; native and terminal-controlled Codex sessions use exact Codex rollout history when a session id is available, fall back to cwd-matched rollout history when needed, and otherwise report only visible terminal/process context with lower confidence.
|
|
155
|
+
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.
|
|
235
156
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
AKK takeover Codex <
|
|
240
|
-
AKK
|
|
241
|
-
AKK fork takeover Codex <native-session-id>
|
|
242
|
-
AKK approve <conversation-id>
|
|
243
|
-
```
|
|
157
|
+
| Strategy | Behavior |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| `AKK takeover Codex <session-id>` | After confirmation, stop and attach the matching CLI; the next send resumes it. |
|
|
160
|
+
| `AKK terminal takeover Codex <session-id>` | After confirmation, control the existing tmux session without stopping it. |
|
|
161
|
+
| `AKK fork takeover Codex <session-id>` | Keep the original running and create a new task from an OpenClaw-approved summary. |
|
|
244
162
|
|
|
245
|
-
|
|
163
|
+
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 and has a separate hard lifetime. Use `renew` for a stalled monitor and `retry-callback` if callback delivery remains failed.
|
|
246
164
|
|
|
247
|
-
- `
|
|
248
|
-
- `terminal takeover`: attach an active Codex CLI running inside a controllable terminal provider after explicit confirmation. AKK sends follow-ups directly to the terminal pane, can send Control-C for cancel, and can approve the currently visible Codex approval prompt.
|
|
249
|
-
- `fork takeover`: keep the original Codex CLI running, ask OpenClaw to summarize bounded source context, then create a new AKK-managed fork from that summary.
|
|
165
|
+
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.
|
|
250
166
|
|
|
251
|
-
|
|
167
|
+
Start sessions you may want to control remotely inside tmux:
|
|
252
168
|
|
|
253
169
|
```bash
|
|
254
170
|
tmux new -s codex-work
|
|
255
171
|
codex
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
Avoid starting a second live client on the same active Codex session. It can mix session history in ways that neither live client sees until a later resume.
|
|
259
172
|
|
|
260
|
-
|
|
173
|
+
tmux new -s claude-work
|
|
174
|
+
claude
|
|
175
|
+
```
|
|
261
176
|
|
|
262
|
-
AKK
|
|
177
|
+
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.
|
|
263
178
|
|
|
264
|
-
|
|
179
|
+
Avoid opening a second live client on the same agent session; concurrent clients can produce inconsistent visible history.
|
|
265
180
|
|
|
266
|
-
|
|
181
|
+
## Approvals
|
|
267
182
|
|
|
268
|
-
|
|
183
|
+
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.
|
|
269
184
|
|
|
270
|
-
|
|
185
|
+
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.
|
|
271
186
|
|
|
272
|
-
|
|
187
|
+
Trusted terminal commands can be auto-approved with a deterministic policy:
|
|
273
188
|
|
|
274
|
-
```
|
|
275
|
-
|
|
189
|
+
```json5
|
|
190
|
+
autoApprove: {
|
|
191
|
+
enabled: true,
|
|
192
|
+
rules: [{
|
|
193
|
+
id: "project-read-status",
|
|
194
|
+
agents: ["codex", "claude"],
|
|
195
|
+
workspaces: ["/Users/scott/project"],
|
|
196
|
+
commands: [
|
|
197
|
+
["pwd"],
|
|
198
|
+
["git", "status"],
|
|
199
|
+
["git", "diff", "--stat"]
|
|
200
|
+
]
|
|
201
|
+
}]
|
|
202
|
+
}
|
|
276
203
|
```
|
|
277
204
|
|
|
278
|
-
|
|
205
|
+
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.
|
|
279
206
|
|
|
280
|
-
|
|
281
|
-
npm run typecheck
|
|
282
|
-
```
|
|
207
|
+
## Troubleshooting
|
|
283
208
|
|
|
284
|
-
|
|
209
|
+
Start with `agent-knock-knock doctor`. It checks Node.js, OpenClaw, ACPX, at least one supported coding-agent command, and the packaged plugin files. The OpenClaw CLI must be on `PATH` or in a common user install directory for this check.
|
|
285
210
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
211
|
+
| Symptom | Action |
|
|
212
|
+
| --- | --- |
|
|
213
|
+
| Installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
|
|
214
|
+
| Source changes do not appear | Build, reinstall from the checkout, and restart the Gateway. |
|
|
215
|
+
| Terminal bridge task is `stalled` | Run `AKK renew <conversation-id> --minutes <minutes>`. |
|
|
216
|
+
| ACPX task is `stalled` | Inspect `status --trace`; close and redelegate if the executor cannot continue. |
|
|
217
|
+
| Task is `callback_failed` | Run `AKK retry-callback <conversation-id>`. |
|
|
218
|
+
| Codex delegation rejects the deprecated adapter | Remove the old override or select a supported adapter as described below. |
|
|
219
|
+
| Terminal takeover is unavailable | Run Codex or Claude Code inside tmux and check `AKK list` for a `terminal_controlled` entry. |
|
|
220
|
+
| Claude permission or completion is not detected | Run `agent-knock-knock install-claude-hooks`, then retry in the managed tmux session. |
|
|
289
221
|
|
|
290
|
-
|
|
222
|
+
For local diagnostics, use:
|
|
291
223
|
|
|
292
224
|
```bash
|
|
293
|
-
|
|
225
|
+
agent-knock-knock status --conversation <conversation-id> --trace
|
|
226
|
+
agent-knock-knock list --terminal-debug
|
|
227
|
+
agent-knock-knock list --managed-only # skip native and terminal discovery
|
|
294
228
|
```
|
|
295
229
|
|
|
296
|
-
|
|
230
|
+
### Codex ACP Adapter
|
|
297
231
|
|
|
298
|
-
|
|
299
|
-
npm run simulate:architecture
|
|
300
|
-
npm run simulate:weather
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Print a readable transcript from an NDJSON log:
|
|
232
|
+
Codex delegation uses `npx -y @agentclientprotocol/codex-acp@^1.1.0` 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:
|
|
304
233
|
|
|
305
234
|
```bash
|
|
306
|
-
|
|
235
|
+
export AKK_CODEX_ACPX_AGENT_COMMAND='your-compatible-adapter-command'
|
|
307
236
|
```
|
|
308
237
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
npm run transcript -- --log .agent-knock-knock/conversations/<conversation-id>/events.ndjson
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
Include raw model exchange events when debugging prompt/response payloads:
|
|
238
|
+
## Development
|
|
316
239
|
|
|
317
240
|
```bash
|
|
318
|
-
npm run
|
|
241
|
+
npm run build # compile TypeScript into dist/
|
|
242
|
+
npm run typecheck # check types without writing output
|
|
243
|
+
npm test # build and run the full test suite
|
|
244
|
+
npm run simulate:architecture # run a named two-agent simulation
|
|
245
|
+
npm run simulate:weather
|
|
246
|
+
npm run transcript -- --conversation ~/.agent-knock-knock/conversations/<conversation-id>
|
|
319
247
|
```
|
|
320
248
|
|
|
321
|
-
|
|
249
|
+
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.
|
|
322
250
|
|
|
323
|
-
|
|
251
|
+
## Storage and Logs
|
|
324
252
|
|
|
325
253
|
```text
|
|
326
254
|
~/.agent-knock-knock/
|
|
@@ -333,47 +261,25 @@ Conversation state is stored under the user's home directory so a new OpenClaw s
|
|
|
333
261
|
runtime-YYYY-MM-DD.ndjson
|
|
334
262
|
```
|
|
335
263
|
|
|
336
|
-
Use `--store-dir <dir>` to override the conversation store
|
|
337
|
-
|
|
338
|
-
Runtime logs are diagnostic-only and are safe to use for local troubleshooting. They keep local timestamps, preserve useful absolute paths, redact common secrets, and are cleaned up by retention policy. Use `AKK_LOG_DIR`, `AKK_LOG_LEVEL`, and `AKK_LOG_RETENTION_DAYS` to override the defaults.
|
|
339
|
-
|
|
340
|
-
## Defaults
|
|
264
|
+
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.
|
|
341
265
|
|
|
342
|
-
|
|
343
|
-
- OpenClaw session: inherited from the current OpenClaw session; fallback is `agent:main:main`
|
|
344
|
-
- Delegated ACPX session: generated per new task, unless `session`, `codexSession`, `claudeSession`, or `cursorSession` is configured
|
|
345
|
-
- Agent callback/terminal inactivity timeout: `60` minutes before an inactive waiting task is marked `stalled`
|
|
346
|
-
- Terminal bridge hard lifetime: `720` minutes for a still-running monitor with no approval or completion result, even if other activity continues
|
|
347
|
-
- Idle timeout: `10080` minutes before an idle task is lazily closed
|
|
348
|
-
- Soft response limit: `50` rounds
|
|
349
|
-
- Hard response limit: `100` rounds
|
|
350
|
-
- Store directory: `~/.agent-knock-knock/conversations`
|
|
351
|
-
- Runtime log directory: `~/.agent-knock-knock/logs`
|
|
352
|
-
- Runtime log retention: `14` days
|
|
353
|
-
- Codex model: unset by default; configure `codexModel` only when your ACPX Codex setup requires one
|
|
354
|
-
- Cursor model: unset by default; configure `cursorModel` only when your ACPX Cursor setup requires one
|
|
266
|
+
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.
|
|
355
267
|
|
|
356
268
|
## Release
|
|
357
269
|
|
|
358
|
-
`package.json` is the version source. Create
|
|
270
|
+
`package.json` is the version source. Create a release with npm's version command, then push the commit and tag:
|
|
359
271
|
|
|
360
272
|
```bash
|
|
361
|
-
npm version patch
|
|
273
|
+
npm version patch # or minor / major
|
|
362
274
|
git push
|
|
363
275
|
git push --tags
|
|
364
276
|
```
|
|
365
277
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
The release workflow requires an `NPM_TOKEN` repository secret with permission to publish the npm package. GitHub's built-in `GITHUB_TOKEN` is used for creating the GitHub Release.
|
|
369
|
-
|
|
370
|
-
## Contributing
|
|
371
|
-
|
|
372
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for local development, test, and pull request guidance.
|
|
278
|
+
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.
|
|
373
279
|
|
|
374
280
|
## Security
|
|
375
281
|
|
|
376
|
-
|
|
282
|
+
Do not open public issues for sensitive security reports. See [SECURITY.md](SECURITY.md).
|
|
377
283
|
|
|
378
284
|
## License
|
|
379
285
|
|
|
@@ -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
|
}
|