@scotthuang/agent-knock-knock 0.2.1 → 0.2.3
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 +12 -0
- package/README.md +45 -159
- package/dist/src/cli.js +309 -11
- package/dist/src/cli.js.map +1 -1
- package/dist/src/codex-session-provider.d.ts +12 -0
- package/dist/src/codex-session-provider.js.map +1 -1
- package/dist/src/openclaw-plugin.js +37 -2
- package/dist/src/openclaw-plugin.js.map +1 -1
- package/dist/src/terminal-control-provider.d.ts +56 -0
- package/dist/src/terminal-control-provider.js +154 -0
- package/dist/src/terminal-control-provider.js.map +1 -0
- package/openclaw.plugin.json +13 -1
- package/package.json +1 -1
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3 - 2026-06-24
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Added the tmux takeover tools to the OpenClaw plugin manifest contracts, allowing OpenClaw to expose `agent_knock_knock_agent_discover`, `agent_knock_knock_agent_takeover`, and `agent_knock_knock_approve` after installation.
|
|
8
|
+
|
|
9
|
+
## 0.2.2 - 2026-06-24
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added tmux-backed terminal-control takeover for native Codex sessions, including tmux pane metadata in active discovery, confirmed `terminal_control` attachment, direct follow-up sends to the existing pane, and a conservative `approve` command for the currently visible Codex approval prompt.
|
|
14
|
+
|
|
3
15
|
## 0.2.1 - 2026-06-22
|
|
4
16
|
|
|
5
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Channels such as WeChat and many direct-message surfaces do not provide that sam
|
|
|
12
12
|
|
|
13
13
|
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.
|
|
14
14
|
|
|
15
|
+
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.
|
|
16
|
+
|
|
15
17
|
## What It Provides
|
|
16
18
|
|
|
17
19
|
- ACPX-backed delegation to Codex, Claude Code, and Cursor
|
|
@@ -24,10 +26,6 @@ Agent Knock Knock fills that gap. It keeps local task state outside the chat cha
|
|
|
24
26
|
|
|
25
27
|
See [ROADMAP.md](ROADMAP.md) for planned reliability work and future orchestration features.
|
|
26
28
|
|
|
27
|
-
## Project Status
|
|
28
|
-
|
|
29
|
-
Agent Knock Knock is an early public project. The core local OpenClaw delegation flow is usable, and the package can be installed globally from npm. The OpenClaw plugin and skill are still installed locally by the `agent-knock-knock install-openclaw` helper rather than through an OpenClaw plugin registry.
|
|
30
|
-
|
|
31
29
|
## Architecture
|
|
32
30
|
|
|
33
31
|
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.
|
|
@@ -109,25 +107,7 @@ Run this after pulling new code or editing TypeScript/plugin files. The OpenClaw
|
|
|
109
107
|
|
|
110
108
|
## OpenClaw Plugin
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Natural-language routing is designed around the short name `AKK`; lowercase `akk` should be treated the same way. When a user says `AKK` without naming an agent, OpenClaw should omit the agent parameter and let the plugin use `defaultAgent`. If `defaultAgent` is not configured, AKK falls back to Codex. Explicit requests such as `AKK Claude`, `AKK Cursor`, or `AKK Codex` override the default.
|
|
115
|
-
|
|
116
|
-
Configure the default coding agent in the plugin config:
|
|
117
|
-
|
|
118
|
-
```json5
|
|
119
|
-
{
|
|
120
|
-
plugins: {
|
|
121
|
-
entries: {
|
|
122
|
-
"agent-knock-knock": {
|
|
123
|
-
config: {
|
|
124
|
-
defaultAgent: "codex" // "codex", "claude", or "cursor"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
```
|
|
110
|
+
Use `AKK` or `akk` in OpenClaw chat to delegate coding work. If no agent is named, AKK uses the plugin `defaultAgent`; if that is unset, it falls back to Codex. Explicit agent names override the default.
|
|
131
111
|
|
|
132
112
|
Useful chat-style prompts:
|
|
133
113
|
|
|
@@ -139,11 +119,10 @@ AKK Cursor: fix the flaky UI test
|
|
|
139
119
|
akk list
|
|
140
120
|
akk send <conversation-id>: continue with the smaller implementation
|
|
141
121
|
akk cancel <conversation-id>
|
|
142
|
-
akk recover <conversation-id>
|
|
143
122
|
akk close <conversation-id>
|
|
144
123
|
```
|
|
145
124
|
|
|
146
|
-
|
|
125
|
+
Surfaces that support OpenClaw native commands can use the same workflow through `/akk`:
|
|
147
126
|
|
|
148
127
|
```text
|
|
149
128
|
/akk <task>
|
|
@@ -154,152 +133,62 @@ The plugin also registers the `/akk` slash command for channel surfaces that sup
|
|
|
154
133
|
/akk status <conversation-id>
|
|
155
134
|
/akk send <conversation-id> <message>
|
|
156
135
|
/akk cancel <conversation-id>
|
|
157
|
-
/akk recover <conversation-id>
|
|
158
136
|
/akk close <conversation-id> [reason]
|
|
159
137
|
```
|
|
160
138
|
|
|
161
|
-
|
|
139
|
+
Optional default-agent config:
|
|
162
140
|
|
|
163
141
|
```json5
|
|
164
142
|
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"agent_knock_knock_close"
|
|
174
|
-
]
|
|
143
|
+
plugins: {
|
|
144
|
+
entries: {
|
|
145
|
+
"agent-knock-knock": {
|
|
146
|
+
config: {
|
|
147
|
+
defaultAgent: "codex" // "codex", "claude", or "cursor"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
175
151
|
}
|
|
176
152
|
}
|
|
177
153
|
```
|
|
178
154
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
The plugin also registers the Gateway method `agent-knock-knock.callback`. Coding-agent callback commands use this method to enqueue a durable next-turn injection for the OpenClaw session. Actionable callbacks such as `question`, `blocked`, `done`, `error`, or any message with `requires_response: true` are delivered into the OpenClaw session through Gateway `chat.send` with `deliver: true`, so OpenClaw receives only the structured protocol message and can route the final reply back through the original channel without polling the raw execution channel.
|
|
182
|
-
|
|
183
|
-
Coding-agent `done` callbacks mark the AKK conversation `idle`, not closed. Idle conversations remain visible in the default list and can receive `send` follow-ups until they are manually closed or lazily closed by the idle timeout. The default idle timeout is 10080 minutes.
|
|
184
|
-
|
|
185
|
-
New delegations create a fresh ACPX session by default, using a name like `akk-codex-20260620183511-88811e97`, `akk-claude-...`, or `akk-cursor-...`. This keeps concurrent AKK tasks isolated. Reuse happens through `AKK send <conversation-id>: <message>` against an existing AKK conversation, or by explicitly configuring/passing a fixed coding-agent session.
|
|
186
|
-
|
|
187
|
-
Background launches also start a small AKK monitor process. The monitor exits when the conversation receives a callback or otherwise leaves the agent-waiting state. If the executor process disappears before a callback, or if no callback arrives before `agentTimeoutMinutes`, the conversation is marked `stalled` and AKK attempts to notify the original OpenClaw session through the callback Gateway route. The default agent timeout is 60 minutes.
|
|
188
|
-
|
|
189
|
-
Some coding agents may not reliably resume a named ACPX session after their backing process disappears. By default, `AKK send <conversation-id>: <message>` automatically falls back to AKK replay recovery: it starts a fresh ACPX session, gives the agent a bounded summary of AKK's saved protocol history, and includes the pending message. The result includes `auto_recovered: true` when this happens.
|
|
190
|
-
|
|
191
|
-
If a caller uses the explicit recovery policy, or if automatic recovery cannot complete, the AKK conversation can enter `needs_recovery`. The user can then choose:
|
|
192
|
-
|
|
193
|
-
- `AKK recover <conversation-id>`: start a new coding-agent session with AKK's saved protocol history summary plus the pending message.
|
|
194
|
-
- `AKK close <conversation-id>`: close the AKK task without recovery.
|
|
195
|
-
- Start a new independent AKK delegation if the old task should not be recovered.
|
|
196
|
-
|
|
197
|
-
Recover is AKK replay recovery, not guaranteed native coding-agent session resume. Codex, Claude Code, and Cursor all use the same default `send` auto-recovery behavior when the existing ACPX session is unavailable.
|
|
198
|
-
|
|
199
|
-
Task status can include a safe executor trace with `--trace` or the OpenClaw status tool's `trace: true` parameter. Trace summaries show client lifecycle events, tool call names and statuses, permission-request markers, monitor events, and short sanitized output previews. Agent thinking content is never returned; it is counted and marked as redacted.
|
|
200
|
-
|
|
201
|
-
## CLI Examples
|
|
155
|
+
## Native Codex Takeover
|
|
202
156
|
|
|
203
|
-
|
|
157
|
+
Experimental: AKK can discover and take over Codex CLI sessions that were started outside AKK. This is useful when you started Codex in a terminal, left the machine, and want OpenClaw to continue managing that work from chat.
|
|
204
158
|
|
|
205
|
-
|
|
159
|
+
Discovery prompts:
|
|
206
160
|
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
Delegate a Codex task through ACPX:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
node dist/src/cli.js delegate \
|
|
215
|
-
--agent codex \
|
|
216
|
-
--request "Implement a small feature" \
|
|
217
|
-
--background
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
Delegate a Cursor task through ACPX:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
node dist/src/cli.js delegate \
|
|
224
|
-
--agent cursor \
|
|
225
|
-
--request "Implement a small feature" \
|
|
226
|
-
--background
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
List open coding-agent tasks:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
node dist/src/cli.js list
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
Inspect a task with a safe executor trace:
|
|
236
|
-
|
|
237
|
-
```bash
|
|
238
|
-
node dist/src/cli.js status \
|
|
239
|
-
--conversation <conversation-id> \
|
|
240
|
-
--trace
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Send a follow-up message to an existing task:
|
|
244
|
-
|
|
245
|
-
```bash
|
|
246
|
-
node dist/src/cli.js send \
|
|
247
|
-
--conversation <conversation-id> \
|
|
248
|
-
--message "Use the smaller implementation."
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Request cooperative cancellation of the current in-flight prompt:
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
node dist/src/cli.js cancel \
|
|
255
|
-
--conversation <conversation-id>
|
|
161
|
+
```text
|
|
162
|
+
AKK Codex sessions
|
|
163
|
+
AKK Codex active
|
|
164
|
+
AKK Codex capabilities
|
|
256
165
|
```
|
|
257
166
|
|
|
258
|
-
|
|
167
|
+
Takeover prompts:
|
|
259
168
|
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
|
|
169
|
+
```text
|
|
170
|
+
AKK safe resume Codex <native-session-id>
|
|
171
|
+
AKK takeover Codex <native-session-id>
|
|
172
|
+
AKK terminal takeover Codex <native-session-id>
|
|
173
|
+
AKK fork takeover Codex <native-session-id>
|
|
174
|
+
AKK approve <conversation-id>
|
|
263
175
|
```
|
|
264
176
|
|
|
265
|
-
|
|
177
|
+
Strategies:
|
|
266
178
|
|
|
267
|
-
|
|
179
|
+
- `safe resume`: attach a stopped/inactive Codex session to AKK.
|
|
180
|
+
- `takeover`: stop an active matching Codex CLI after explicit confirmation, then resume it under AKK.
|
|
181
|
+
- `terminal takeover`: attach an active Codex CLI running inside tmux after explicit confirmation. AKK sends follow-ups directly to the tmux pane and can approve the currently visible Codex approval prompt.
|
|
182
|
+
- `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.
|
|
268
183
|
|
|
269
|
-
|
|
270
|
-
node dist/src/cli.js agent discover \
|
|
271
|
-
--agent codex \
|
|
272
|
-
--scope active
|
|
273
|
-
|
|
274
|
-
node dist/src/cli.js agent takeover \
|
|
275
|
-
--agent codex \
|
|
276
|
-
--session-id <native-codex-session-id> \
|
|
277
|
-
--strategy terminate_then_resume
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
`terminate_then_resume` is intentionally two-step. The first command returns the exact pid, cwd, and session that would be stopped. After confirming that plan, execute the takeover:
|
|
184
|
+
For long-running local Codex sessions that you may want OpenClaw to operate from WeChat, run Codex inside tmux. AKK does not require tmux, but tmux enables terminal-control takeover without stopping the original process:
|
|
281
185
|
|
|
282
186
|
```bash
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
--session-id <native-codex-session-id> \
|
|
286
|
-
--strategy terminate_then_resume \
|
|
287
|
-
--create-conversation \
|
|
288
|
-
--confirm-terminate \
|
|
289
|
-
--expected-pid <confirmed-pid>
|
|
187
|
+
tmux new -s codex-work
|
|
188
|
+
codex
|
|
290
189
|
```
|
|
291
190
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
Some Codex TUI processes do not expose the native session id in argv. In that case the default takeover remains blocked as ambiguous. For a deliberate local test or an operator-confirmed handoff, add `--allow-cwd-only` with `--expected-pid`; AKK will still re-scan and require that pid to be active in the target session cwd before terminating it.
|
|
295
|
-
|
|
296
|
-
Close a task locally:
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
node dist/src/cli.js close \
|
|
300
|
-
--conversation <conversation-id> \
|
|
301
|
-
--reason "No longer needed"
|
|
302
|
-
```
|
|
191
|
+
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.
|
|
303
192
|
|
|
304
193
|
## Approval Behavior
|
|
305
194
|
|
|
@@ -381,21 +270,18 @@ Runtime logs are diagnostic-only and are safe to use for local troubleshooting.
|
|
|
381
270
|
|
|
382
271
|
## Defaults
|
|
383
272
|
|
|
384
|
-
-
|
|
385
|
-
- OpenClaw
|
|
386
|
-
- Delegated ACPX session: generated per new task, unless
|
|
387
|
-
-
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
- Cursor model, when needed: pass `model`/`cursorModel`
|
|
392
|
-
- Gateway URL: `ws://127.0.0.1:18789`
|
|
393
|
-
- Agent callback timeout: `60` minutes
|
|
394
|
-
- Soft response limit: `50`
|
|
395
|
-
- Hard response limit: `100`
|
|
273
|
+
- Default agent: configured with `defaultAgent`; fallback is `codex`
|
|
274
|
+
- OpenClaw session: inherited from the current OpenClaw session; fallback is `agent:main:main`
|
|
275
|
+
- Delegated ACPX session: generated per new task, unless `session`, `codexSession`, `claudeSession`, or `cursorSession` is configured
|
|
276
|
+
- Agent callback timeout: `60` minutes before a waiting task is marked `stalled`
|
|
277
|
+
- Idle timeout: `10080` minutes before an idle task is lazily closed
|
|
278
|
+
- Soft response limit: `50` rounds
|
|
279
|
+
- Hard response limit: `100` rounds
|
|
396
280
|
- Store directory: `~/.agent-knock-knock/conversations`
|
|
397
281
|
- Runtime log directory: `~/.agent-knock-knock/logs`
|
|
398
282
|
- Runtime log retention: `14` days
|
|
283
|
+
- Codex model: unset by default; configure `codexModel` only when your ACPX Codex setup requires one
|
|
284
|
+
- Cursor model: unset by default; configure `cursorModel` only when your ACPX Cursor setup requires one
|
|
399
285
|
|
|
400
286
|
## Release
|
|
401
287
|
|