@scotthuang/agent-knock-knock 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1 - 2026-07-29
4
+
5
+ ### Changed
6
+
7
+ - Put one complete ClawHub-first path from installation through workspace setup, Gateway restart, tmux startup, diagnostics, and the first task at the top of the README.
8
+ - Separate direct `/akk` usage from optional natural-language tool access and keep the npm installer as an alternative path.
9
+
10
+ ### Fixed
11
+
12
+ - Fail closed with actionable setup guidance when the plugin workspace is missing or non-absolute instead of falling back to the Gateway working directory.
13
+ - Keep `/akk doctor` available to diagnose invalid workspace configuration.
14
+
15
+ ## 0.5.0 - 2026-07-29
16
+
17
+ ### Changed
18
+
19
+ - Make already-running, verified-idle Codex and Claude Code tmux panes the only delegation targets.
20
+ - Resolve bare `/akk <task>` only when exactly one eligible idle pane exists in the configured workspace, and use `/akk <selector>: <message>` for an explicit target.
21
+ - Enforce the configured workspace as a hard boundary even for explicit terminal IDs and recovery operations.
22
+ - Keep the main command surface focused on task routing, listing, status, and cancellation; keep diagnostics, approvals, and recovery operations in their relevant workflows.
23
+
24
+ ### Removed
25
+
26
+ - Remove configuration-based default-agent routing and the `--default-agent` installer option.
27
+ - Remove obsolete session inspection and attachment surfaces from the user-facing workflow.
28
+
3
29
  ## 0.4.0 - 2026-07-29
4
30
 
5
31
  ### Changed
package/README.md CHANGED
@@ -9,11 +9,46 @@ Agent Knock Knock lets OpenClaw control local Codex and Claude Code through shar
9
9
 
10
10
  **No hooks. No agent-side plugins. Just share a terminal and stay in control. No YOLO. Automate the trusted. Review the rest.**
11
11
 
12
+ ## Quick Start with ClawHub
13
+
14
+ AKK reuses Codex or Claude Code already running in tmux; it never launches a coding agent. You need OpenClaw `2026.6.5`+, tmux, and an authenticated `codex` or `claude` CLI, all running as the same OS user.
15
+
16
+ From the project AKK may edit:
17
+
18
+ ```bash
19
+ cd /absolute/path/to/project
20
+ openclaw plugins install clawhub:@scotthuang/agent-knock-knock
21
+ openclaw config set plugins.entries.agent-knock-knock.config.workspace "$(pwd -P)"
22
+ openclaw gateway restart
23
+ ```
24
+
25
+ Start the shared coding-agent terminal:
26
+
27
+ ```bash
28
+ tmux new-session -s akk-work -c "$(pwd -P)" codex
29
+ ```
30
+
31
+ Use `claude` instead of `codex` if preferred. Wait for the coding agent's idle prompt, then detach from tmux with `Ctrl-b`, followed by `d`.
32
+
33
+ From any configured OpenClaw channel, first send:
34
+
35
+ ```text
36
+ /akk doctor
37
+ ```
38
+
39
+ After doctor reports `AKK doctor: ready`, send a separate message:
40
+
41
+ ```text
42
+ /akk inspect this repository and summarize it
43
+ ```
44
+
45
+ The second command proves that AKK can find the pane, send work in the configured workspace, and return the result. Direct `/akk ...` commands need no OpenClaw tool-policy changes.
46
+
12
47
  ## See It in Action
13
48
 
14
49
  [![AKK orchestrating a Claude Code-to-Codex handoff through tmux](https://raw.githubusercontent.com/scotthuang/agent-knock-knock/main/docs/assets/akk-tmux-handoff-demo.gif)](https://github.com/scotthuang/agent-knock-knock/blob/main/docs/assets/akk-tmux-handoff-demo.mp4)
15
50
 
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. AKK keeps the agents' existing permission settings. Click the preview to watch in full quality.*
51
+ *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 control. AKK keeps the agents' existing permission settings. Click the preview to watch in full quality.*
17
52
 
18
53
  ## Use Cases
19
54
 
@@ -35,7 +70,26 @@ AKK connects OpenClaw to Codex or Claude Code already running inside tmux:
35
70
 
36
71
  AKK is local-first. It has no hosted control plane or telemetry and does not change the coding agent's configured permission mode.
37
72
 
38
- ## Install
73
+ ## Optional: Natural-Language Delegation
74
+
75
+ The quick start uses direct `/akk ...` commands, which bypass the model and work without plugin tool access. To let OpenClaw decide to use AKK from a natural-language request, grant the optional `agent-knock-knock` tools in the applicable tool policy.
76
+
77
+ If you use the default `coding` profile and do not already have `tools.allow`, add AKK without replacing the profile:
78
+
79
+ ```json5
80
+ {
81
+ tools: {
82
+ profile: "coding",
83
+ alsoAllow: ["agent-knock-knock"]
84
+ }
85
+ }
86
+ ```
87
+
88
+ 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.
89
+
90
+ Restart the Gateway after changing the tool policy.
91
+
92
+ ## Installation Details
39
93
 
40
94
  Requirements:
41
95
 
@@ -53,48 +107,22 @@ Requirements:
53
107
 
54
108
  The compatibility suite tests the normal installation floor and the Plugin API boundary with isolated state and the real packed artifact.
55
109
 
56
- ### Install from ClawHub (recommended)
57
-
58
- From the project the agents may edit:
59
-
60
- ```bash
61
- openclaw plugins install clawhub:@scotthuang/agent-knock-knock
62
- openclaw config set plugins.entries.agent-knock-knock.config.workspace "$PWD"
63
- openclaw config set plugins.entries.agent-knock-knock.config.defaultAgent codex
64
- openclaw gateway restart
65
- ```
66
-
67
- Use `claude` instead of `codex` when preferred.
68
-
69
110
  ClawHub installs the OpenClaw plugin, bundled AKK skill, and package-local relay CLI together. It 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 path below.
70
111
 
71
- AKK's plugin tools are optional OpenClaw tools and require an explicit tool-policy grant. If you use the default `coding` profile and do not already have `tools.allow`, add AKK without replacing the profile:
72
-
73
- ```json5
74
- {
75
- tools: {
76
- profile: "coding",
77
- alsoAllow: ["agent-knock-knock"]
78
- }
79
- }
80
- ```
81
-
82
- 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.
83
-
84
112
  If you also want standalone shell commands such as `agent-knock-knock doctor`, install the npm package globally without running `install-openclaw`:
85
113
 
86
114
  ```bash
87
115
  npm install -g @scotthuang/agent-knock-knock
88
116
  ```
89
117
 
90
- ### Install from npm
118
+ ### Alternative: Install from npm
91
119
 
92
120
  ```bash
93
121
  npm install -g @scotthuang/agent-knock-knock
94
- agent-knock-knock install-openclaw --workspace "$PWD" --default-agent codex --verify
122
+ agent-knock-knock install-openclaw --workspace "$(pwd -P)" --verify
95
123
  ```
96
124
 
97
- `install-openclaw` installs or updates the plugin, configures the workspace and default agent without replacing unrelated settings, installs the bundled skill, restarts the Gateway at most once, and optionally verifies the 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.
125
+ `install-openclaw` installs or updates the plugin, configures the workspace without replacing unrelated settings, installs the bundled skill, restarts the Gateway at most once, and optionally verifies the 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.
98
126
 
99
127
  If OpenClaw runs from a local checkout or another nonstandard location, pass its CLI explicitly:
100
128
 
@@ -102,7 +130,7 @@ If OpenClaw runs from a local checkout or another nonstandard location, pass its
102
130
  agent-knock-knock install-openclaw --openclaw-bin /path/to/openclaw/openclaw.mjs
103
131
  ```
104
132
 
105
- ## Start the Shared Terminal
133
+ ## Shared Terminal Details
106
134
 
107
135
  Install tmux on macOS:
108
136
 
@@ -119,7 +147,7 @@ sudo apt-get install tmux
119
147
  Then start Codex in a shared terminal:
120
148
 
121
149
  ```bash
122
- tmux new-session -s akk-work -c "$PWD" codex
150
+ tmux new-session -s akk-work -c "$(pwd -P)" codex
123
151
  ```
124
152
 
125
153
  Use `claude` instead of `codex` for Claude Code. Detach with `Ctrl-b`, then `d`. AKK discovers the pane automatically.
@@ -142,51 +170,45 @@ For one complete first run, follow [Agent Knock Knock in 5 minutes](https://gith
142
170
 
143
171
  ## Usage
144
172
 
145
- Use conversational `AKK` prompts on any chat surface. Explicit agent names override the configured default:
173
+ AKK sends work only to Codex or Claude Code panes that are already running in tmux, inside the configured workspace, and at a verified idle prompt. It never starts a coding agent for you.
174
+
175
+ If exactly one idle coding-agent pane matches the workspace, send a task directly:
146
176
 
147
177
  ```text
148
- AKK Codex: inspect this repository and summarize it
149
- AKK Claude: review the latest commit
150
- AKK describe latest
178
+ /akk inspect this repository and summarize it
151
179
  ```
152
180
 
153
- Surfaces with native commands use the same operations:
181
+ If more than one pane is available, name the target before the colon:
182
+
183
+ ```text
184
+ /akk codex: inspect this repository and summarize it
185
+ /akk claude: review the latest commit
186
+ /akk @a1b2c3d4: run the focused tests
187
+ ```
188
+
189
+ The core command surface is intentionally small:
154
190
 
155
191
  ```text
156
192
  /akk <task>
193
+ /akk <selector>: <message>
157
194
  /akk list
158
- /akk doctor
159
195
  /akk status [only|latest|codex|claude|@short-ref]
160
- /akk describe [session-selector]
161
- /akk send <session-selector>: <message>
162
- /akk approve <session-selector> --expected-approval-fingerprint <fingerprint>
163
196
  /akk cancel <session-selector>
164
- /akk renew <session-selector> [minutes]
165
- /akk retry-callback <session-selector>
166
- /akk close <session-selector> [--expected-message-id <id>] [reason]
167
197
  ```
168
198
 
169
- 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.
170
-
171
- You can also send directly to a terminal entry returned by `AKK list`:
172
-
173
- ```text
174
- AKK send codex: continue with the smaller implementation
175
- AKK send @a1b2c3d4: run the focused tests
176
- ```
199
+ Selectors fail closed: `only` works only with one actionable target, `latest` requires a unique newest target, and `codex` or `claude` must identify exactly one eligible pane. `AKK list` shows stable short references while JSON output retains the authoritative full IDs. Every send revalidates the pane, process, workspace, and idle state immediately before typing.
177
200
 
178
- AKK submits only when the selected pane is at a verified idle prompt. If no eligible Codex or Claude Code tmux pane is available, it stops and tells you how to start one instead of launching an invisible replacement.
201
+ The configured workspace is a hard boundary for OpenClaw tools and slash commands. Listing, inspection, sending, approval, cancellation, and recovery do not cross into another workspace even when given an explicit terminal ID.
179
202
 
180
- If `AKK list` reports an orphaned terminal dispatch after its managed state was lost, inspect the named pane first. Clear only that stale dispatch fence with the exact `/akk close ... --expected-message-id ...` recovery command returned by the list; AKK leaves both the coding agent and tmux pane running.
203
+ If no eligible pane exists, AKK stops with setup guidance. If a send is ambiguous, run `/akk list` and retry with the returned `@short-ref`.
181
204
 
182
205
  ## Configuration
183
206
 
184
- AKK reads these options from `plugins.entries.agent-knock-knock.config`. The npm installer writes the common options; the ClawHub section shows the equivalent setup.
207
+ AKK reads these options from `plugins.entries.agent-knock-knock.config`. The npm installer writes the common options; the ClawHub quick start shows the equivalent manual setup.
185
208
 
186
209
  | Option | Default | Purpose |
187
210
  | --- | --- | --- |
188
- | `defaultAgent` | `codex` | Agent used when a request does not name one: `codex` or `claude`. |
189
- | `workspace` | OpenClaw process directory | Working directory matched against eligible terminal panes. |
211
+ | `workspace` | Required before use | Absolute, canonical working directory matched against eligible terminal panes. Runtime operations fail closed when it is missing. |
190
212
  | `storeDir` | `~/.agent-knock-knock/conversations` | Conversation state location; relative plugin paths resolve from `workspace`. |
191
213
  | `openclawBin` | Auto-detected | OpenClaw CLI used for callback delivery. |
192
214
  | `codexHome` | Auto-detected | Optional Codex home used to identify Codex sessions running in tmux. |
@@ -204,7 +226,7 @@ For Claude Code, manual approval is deliberately narrow:
204
226
 
205
227
  - It is available only for the current AKK-managed turn.
206
228
  - 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.
207
- - 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.
229
+ - 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 @a1b2c3d4 --expected-approval-fingerprint <fresh-fingerprint>` using the fingerprint from that current notification; the hash-only callback is not sufficient for review.
208
230
  - AKK re-evaluates the evidence and revalidates the process and pane immediately before sending one Enter.
209
231
 
210
232
  Unknown, stale, changed, ambiguous, or unmanaged dialogs fail closed and must be resolved in the terminal.
@@ -244,6 +266,7 @@ With the global npm CLI installed, start with `agent-knock-knock doctor`. It run
244
266
  | Source changes do not appear | Build, reinstall from the checkout, and restart the Gateway. |
245
267
  | Terminal task is `stalled` | Inspect `status` and the terminal; use `/akk renew only <minutes>` only when exactly one live stalled task needs more monitoring time. |
246
268
  | Task is `callback_failed` | Run `/akk retry-callback only` when it is the only actionable failed callback, or use its `@short-ref`. |
269
+ | `AKK list` reports an orphaned terminal dispatch | Inspect the named pane first, then run the exact `/akk close ... --expected-message-id ...` recovery command returned by `list`. AKK leaves the coding agent and tmux pane running. |
247
270
  | Claude permission is not offered through AKK | Resolve unsupported dialogs in the terminal. The AKK path requires the exact supported one-time Bash prompt for the current managed turn. |
248
271
  | Claude request was not auto-approved | Check `autoApprove.enabled`, the agent, canonical workspace, and exact command vector. The request must also have matching current screen and local transcript evidence. |
249
272
  | Claude monitor becomes `stalled` | Check the Claude version and `status`, then inspect the terminal. Unknown transcript schemas, background work, identity changes, and ambiguous turns intentionally fail closed. |