@scotthuang/agent-knock-knock 0.2.51 → 0.3.0-beta.2

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,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0-beta.2 - 2026-07-28
4
+
5
+ ### Added
6
+
7
+ - Add bounded real probes and OpenClaw config, plugin runtime, skill, workspace, and Gateway diagnostics to `doctor`.
8
+ - Add fail-closed session selectors, stable short references, and independent five-minute tmux and Managed ACPX quickstarts.
9
+ - Add deterministic onboarding coverage and explicitly opt-in live ACPX and tmux smoke scripts.
10
+
11
+ ### Changed
12
+
13
+ - Make `install-openclaw` configure workspace, default agent, and mode atomically, preserve approval policy, restart the Gateway at most once, and optionally verify readiness.
14
+ - Verify the packaged README after every ClawHub publish and the default README after stable releases.
15
+
16
+ ## 0.3.0-beta.1 - 2026-07-28
17
+
18
+ ### Added
19
+
20
+ - Add ClawHub package metadata, bundled skill discovery, a square catalog icon, and a package-local OpenClaw runtime entry.
21
+ - Add manifest/runtime contract tests and a ClawHub validation and dry-run release path.
22
+
23
+ ### Changed
24
+
25
+ - Compile against the tested OpenClaw `2026.7.1-2` SDK instead of a handwritten type shim.
26
+ - Separate ClawHub and npm installation guidance, including the explicit optional-tool grant required by a clean OpenClaw profile.
27
+ - Publish prerelease builds to npm's `next` dist-tag and mark their GitHub releases as prereleases.
28
+
29
+ ### Fixed
30
+
31
+ - Align the declared `/akk` command, bundled skill, and tool inventory with the capabilities registered at runtime.
32
+ - Resolve the bundled CLI relative to the loaded plugin entry so ClawHub installs do not depend on a global executable.
33
+
3
34
  ## 0.2.51 - 2026-07-25
4
35
 
5
36
  ### Added
package/README.md CHANGED
@@ -5,17 +5,23 @@
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
9
 
10
- **No hooks. No agent-side plugins. Just share a terminal and stay in control. No YOLO. Automate the trusted. Review the rest.**
11
-
12
- ![Agent Knock Knock cover: OpenClaw knocking on coding agents' door](docs/assets/agent-knock-knock-cover.jpg)
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.**
13
11
 
14
12
  ## See It in Action
15
13
 
16
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)
17
15
 
18
- *OpenClaw asks Claude Code to write a file, waits for AKK to report completion, then hands the result to Codex. Click the preview to watch in full quality.*
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.
23
+
24
+ ![Agent Knock Knock cover: OpenClaw knocking on coding agents' door](docs/assets/agent-knock-knock-cover.jpg)
19
25
 
20
26
  ## Choose an Execution Mode
21
27
 
@@ -26,20 +32,53 @@ Agent Knock Knock connects OpenClaw to local coding agents. Share a live termina
26
32
 
27
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.
28
34
 
35
+ For a complete first run, choose [tmux bridge in 5 minutes](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/quickstart-tmux.md) or [Managed ACPX in 5 minutes](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/quickstart-managed-acpx.md). Both guides use the npm installer so configuration, restart, and verification fit in one copy-paste path.
36
+
37
+ ### Permission Boundaries
38
+
39
+ The two modes intentionally use different permission models:
40
+
41
+ - **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.
42
+ - **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.
43
+
29
44
  ## Install
30
45
 
31
46
  Core requirements:
32
47
 
33
- - Node.js 22.14+ (Node.js 24 recommended; use a version supported by your OpenClaw release)
34
- - [OpenClaw](https://docs.openclaw.ai/) Gateway and plugin API `2026.3.24-beta.2` or newer
48
+ - A Node.js version supported by OpenClaw (Node.js 24.15+ on the 24.x line is recommended for the compatibility floor below)
49
+ - [OpenClaw](https://docs.openclaw.ai/) Gateway and plugin API `2026.7.1-2` or newer
35
50
  - At least one authenticated coding agent: Codex, Claude Code, or Cursor
36
51
 
52
+ ### Install from ClawHub (recommended)
53
+
37
54
  ```bash
38
- npm install -g @scotthuang/agent-knock-knock
39
- agent-knock-knock install-openclaw
55
+ openclaw plugins install clawhub:@scotthuang/agent-knock-knock@beta
56
+ openclaw config set plugins.entries.agent-knock-knock.config.workspace "$PWD"
57
+ openclaw config set plugins.entries.agent-knock-knock.config.defaultAgent codex
58
+ openclaw config set plugins.entries.agent-knock-knock.config.mode tmux
59
+ openclaw gateway restart
40
60
  ```
41
61
 
42
- `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.
62
+ The explicit `@beta` selector follows the `0.3.0` prerelease channel. Remove it after the stable ClawHub release is available.
63
+
64
+ 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.
65
+
66
+ If you also want standalone shell commands such as `agent-knock-knock doctor`, install the npm package globally without running `install-openclaw`:
67
+
68
+ ```bash
69
+ npm install -g @scotthuang/agent-knock-knock@next
70
+ ```
71
+
72
+ ### Install from npm (beta)
73
+
74
+ ```bash
75
+ npm install -g @scotthuang/agent-knock-knock@next
76
+ agent-knock-knock install-openclaw --workspace "$PWD" --default-agent codex --mode tmux --verify
77
+ ```
78
+
79
+ The npm `next` dist-tag follows the same prerelease line. Remove `@next` after `0.3.0` becomes stable.
80
+
81
+ `install-openclaw` installs or updates the plugin, atomically configures the selected workspace, agent, and mode without replacing unrelated settings, installs the AKK skill template, restarts the Gateway at most once, and optionally verifies the full runtime chain. It is safe to rerun. Without `--verify`, the result remains unverified rather than claiming readiness. Use `--skill-only` to skip plugin installation; add `--no-restart` to leave an explicit pending-restart state.
43
82
 
44
83
  If OpenClaw runs from a local checkout or another nonstandard location, pass its CLI explicitly:
45
84
 
@@ -47,6 +86,19 @@ If OpenClaw runs from a local checkout or another nonstandard location, pass its
47
86
  agent-knock-knock install-openclaw --openclaw-bin /path/to/openclaw/openclaw.mjs
48
87
  ```
49
88
 
89
+ 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:
90
+
91
+ ```json5
92
+ {
93
+ tools: {
94
+ profile: "coding",
95
+ alsoAllow: ["agent-knock-knock"]
96
+ }
97
+ }
98
+ ```
99
+
100
+ 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.
101
+
50
102
  Choose one execution mode, or install both.
51
103
 
52
104
  ### Option A: tmux bridge (recommended)
@@ -83,72 +135,34 @@ npm install -g acpx
83
135
 
84
136
  AKK uses ACPX to start managed Codex, Claude Code, or Cursor sessions from OpenClaw.
85
137
 
86
- Finally, check which modes are ready:
138
+ Finally, check which modes are ready if the global CLI is installed:
87
139
 
88
140
  ```bash
89
- agent-knock-knock doctor
141
+ agent-knock-knock doctor --mode tmux
90
142
  ```
91
143
 
92
- ### Trust and Privacy
93
-
94
- 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.
95
-
96
- 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, extract a redacted final answer, and correlate a pending Bash tool request with the current permission screen. The raw pending command remains inside the local approval executor for exact policy matching; AKK does not copy it into callbacks, conversation state, events, runtime logs, or redacted screen summaries. AKK does not upload the transcript or persist a copy of its raw contents. The final answer still travels through your configured local OpenClaw callback.
144
+ For a ClawHub-only installation, use the package-local chat diagnostic:
97
145
 
98
- 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.
99
-
100
- 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.
101
-
102
- ## Quick Start
103
-
104
- First merge this configuration into `~/.openclaw/openclaw.json`, setting `workspace` to the absolute path of the project agents may modify:
105
-
106
- ```json5
107
- // ~/.openclaw/openclaw.json
108
- {
109
- plugins: {
110
- entries: {
111
- "agent-knock-knock": {
112
- config: {
113
- defaultAgent: "codex",
114
- workspace: "/absolute/path/to/project"
115
- }
116
- }
117
- }
118
- }
119
- }
120
- ```
121
-
122
- Restart the Gateway after changing the configuration:
123
-
124
- ```bash
125
- openclaw gateway restart
146
+ ```text
147
+ /akk doctor tmux
126
148
  ```
127
149
 
128
- For the recommended tmux mode, start an agent in tmux, then ask AKK to list and send to the discovered terminal:
150
+ ### Trust and Privacy
129
151
 
130
- ```bash
131
- tmux new -s claude-work
132
- claude
133
- ```
152
+ 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.
134
153
 
135
- ```text
136
- AKK list
137
- AKK send <terminal-controlled-id>: inspect this repository and summarize it
138
- AKK status <managed-conversation-id>
139
- ```
154
+ 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.
140
155
 
141
- Attach to the same tmux session whenever you want to take over directly. Avoid typing while AKK is sending the same turn.
156
+ ## Five-Minute Quick Starts
142
157
 
143
- For Managed ACP, start a new task and use its conversation ID for follow-ups:
158
+ Choose one complete, copy-paste path:
144
159
 
145
- ```text
146
- AKK Codex: inspect this repository and summarize it
147
- AKK status <conversation-id>
148
- AKK send <conversation-id>: run the tests and fix any failures
149
- ```
160
+ | Path | Result |
161
+ | --- | --- |
162
+ | [tmux bridge in 5 minutes](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/quickstart-tmux.md) | Connect OpenClaw to an existing Codex or Claude Code terminal and keep direct human takeover. |
163
+ | [Managed ACPX in 5 minutes](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/quickstart-managed-acpx.md) | Start managed Codex, Claude Code, or Cursor background tasks with durable state and callbacks. |
150
164
 
151
- For new ACP tasks, omitting the agent uses `defaultAgent`, falling back to Codex.
165
+ The five-minute paths use the npm installer so installation, configuration, restart, and verification fit in one command. The ClawHub path above remains the OpenClaw-native distribution option and exposes the same package-local `/akk doctor`.
152
166
 
153
167
  ## How It Works
154
168
 
@@ -161,8 +175,8 @@ Use conversational `AKK` prompts on any chat surface. Explicit agent names overr
161
175
  ```text
162
176
  AKK Claude: review the latest commit
163
177
  AKK Cursor: fix the flaky UI test
164
- AKK describe <conversation-id>
165
- AKK recover <conversation-id>
178
+ AKK describe latest
179
+ AKK recover only
166
180
  ```
167
181
 
168
182
  Surfaces with native commands use the same operations:
@@ -170,15 +184,18 @@ Surfaces with native commands use the same operations:
170
184
  ```text
171
185
  /akk <task>
172
186
  /akk list
173
- /akk status <conversation-id>
174
- /akk describe <conversation-id>
175
- /akk send <conversation-id> <message>
176
- /akk cancel <conversation-id>
177
- /akk renew <conversation-id> [minutes]
178
- /akk retry-callback <conversation-id>
179
- /akk close <conversation-id> [reason]
187
+ /akk doctor [tmux|acpx|all]
188
+ /akk status [only|latest|codex|claude|cursor|@short-ref]
189
+ /akk describe [session-selector]
190
+ /akk send <session-selector>: <message>
191
+ /akk cancel <session-selector>
192
+ /akk renew <session-selector> [minutes]
193
+ /akk retry-callback <session-selector>
194
+ /akk close <session-selector> [reason]
180
195
  ```
181
196
 
197
+ Selectors fail closed: `only` works only with one actionable target, `latest` requires a unique newest target, and an agent name must identify exactly one actionable session. `AKK list` shows stable short references while JSON output retains the authoritative full IDs.
198
+
182
199
  Codex CLI sessions started outside AKK can also be resumed, opened in a terminal, or forked:
183
200
 
184
201
  ```text
@@ -189,11 +206,12 @@ AKK fork takeover Codex <session-id>
189
206
 
190
207
  ## Configuration
191
208
 
192
- Configure AKK under `plugins.entries.agent-knock-knock.config` in `~/.openclaw/openclaw.json`, as shown in the Quick Start.
209
+ AKK reads these options from `plugins.entries.agent-knock-knock.config`. The npm installer writes them for you; the ClawHub install section shows the equivalent `openclaw config set` commands.
193
210
 
194
211
  | Option | Default | Purpose |
195
212
  | --- | --- | --- |
196
213
  | `defaultAgent` | `codex` | Agent used when a request does not name one. |
214
+ | `mode` | `all` | Mode checked by `/akk doctor`: `tmux`, `acpx`, or `all`. |
197
215
  | `workspace` | OpenClaw process directory | Working directory for delegated tasks. |
198
216
  | `storeDir` | `~/.agent-knock-knock/conversations` | Conversation state location; relative plugin paths resolve from `workspace`. |
199
217
  | `openclawBin` | Auto-detected | OpenClaw CLI used for callback delivery. |
@@ -211,7 +229,7 @@ For tmux-backed Codex, AKK reports visible approval prompts. Claude approval is
211
229
 
212
230
  - It is available only for the current AKK-managed turn.
213
231
  - 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.
214
- - 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.
232
+ - 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 <@short-ref>`; the hash-only callback is not sufficient for review.
215
233
  - 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.
216
234
  - 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.
217
235
 
@@ -235,15 +253,15 @@ Place `autoApprove` inside the plugin `config` object. It is disabled by default
235
253
 
236
254
  ## Troubleshooting
237
255
 
238
- 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.
256
+ With the global npm CLI installed, start with `agent-knock-knock doctor --mode tmux|acpx|all`. It runs bounded version probes, validates the OpenClaw config and AKK workspace, verifies the installed/enabled/loaded plugin and bundled skill, and checks Gateway health separately. For a ClawHub-only installation, use `/akk doctor`.
239
257
 
240
258
  | Symptom | Action |
241
259
  | --- | --- |
242
- | Installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
260
+ | The npm installer or callbacks cannot find a local OpenClaw CLI | Set `openclawBin` and pass `--openclaw-bin` to `install-openclaw`. |
243
261
  | Source changes do not appear | Build, reinstall from the checkout, and restart the Gateway. |
244
- | Terminal bridge task is `stalled` | Inspect `status` and the terminal; use `/akk renew <conversation-id> <minutes>` only when more monitoring time is useful. |
262
+ | Terminal bridge task is `stalled` | Inspect `status` and the terminal; use `/akk renew only <minutes>` only when exactly one stalled task needs more monitoring time. |
245
263
  | ACPX task is `stalled` | Inspect `status --trace`; close and redelegate if the executor cannot continue. |
246
- | Task is `callback_failed` | Run `/akk retry-callback <conversation-id>` in a native-command chat. |
264
+ | Task is `callback_failed` | Run `/akk retry-callback only` when it is the only actionable failed callback, or use its `@short-ref`. |
247
265
  | Terminal takeover is unavailable | Run Codex or Claude Code inside tmux and check `AKK list` for a `terminal_controlled` entry. |
248
266
  | 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. |
249
267
  | 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. |
@@ -252,13 +270,22 @@ Start with `agent-knock-knock doctor`. It checks the core installation and repor
252
270
  For local diagnostics, use:
253
271
 
254
272
  ```bash
255
- agent-knock-knock status --conversation <conversation-id> --trace
273
+ agent-knock-knock status --conversation latest --trace
256
274
  agent-knock-knock list --terminal-debug
257
275
  agent-knock-knock list --managed-only
258
276
  ```
259
277
 
260
278
  Codex ACP uses the pinned `@agentclientprotocol/codex-acp` adapter. Override it only with a compatible command through `AKK_CODEX_ACPX_AGENT_COMMAND`.
261
279
 
280
+ Credentialed smoke tests stay outside normal CI. From a repository checkout, the ACPX smoke creates a nonce-scoped session and closes it; the tmux smoke requires the exact pane PID and a freshly verified idle pane before sending one real turn:
281
+
282
+ ```bash
283
+ AKK_RUN_LIVE_ACPX_SMOKE=1 npm run smoke:acpx -- --confirm-live --agent codex --workspace "$PWD"
284
+ AKK_RUN_LIVE_TMUX_SMOKE=1 npm run smoke:tmux -- --confirm-live --agent codex --target akk-work:0.0 --expected-pane-pid <pid>
285
+ ```
286
+
287
+ Both commands can use coding-agent credentials and may incur cost. Read the warning before opting in.
288
+
262
289
  ## Development
263
290
 
264
291
  ```bash
@@ -269,6 +296,20 @@ npm test # build and run the full test suite
269
296
 
270
297
  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.
271
298
 
299
+ ### ClawHub Maintainer Release
300
+
301
+ The first `0.3.0` beta publish is intentionally manual and must stay on ClawHub's `beta` tag:
302
+
303
+ ```bash
304
+ npm ci
305
+ npm run build
306
+ npm exec clawhub -- login
307
+ npm exec clawhub -- package publish . --family code-plugin --owner scotthuang --tags beta --dry-run --json
308
+ npm exec clawhub -- package publish . --family code-plugin --owner scotthuang --tags beta
309
+ ```
310
+
311
+ 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.
312
+
272
313
  ## Storage and Logs
273
314
 
274
315
  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.