@scotthuang/agent-knock-knock 0.10.3 → 0.11.0
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 +16 -0
- package/README.md +3 -3
- package/dist/src/cli.js +209 -22
- package/dist/src/cli.js.map +1 -1
- package/dist/src/native-thread-resume-snapshot.d.ts +87 -0
- package/dist/src/native-thread-resume-snapshot.js +451 -0
- package/dist/src/native-thread-resume-snapshot.js.map +1 -0
- package/dist/src/openclaw-plugin-helpers.d.ts +18 -1
- package/dist/src/openclaw-plugin-helpers.js +112 -13
- package/dist/src/openclaw-plugin-helpers.js.map +1 -1
- package/dist/src/openclaw-plugin.js +128 -16
- package/dist/src/openclaw-plugin.js.map +1 -1
- package/dist/src/terminal-agent-bridge.js +57 -4
- package/dist/src/terminal-agent-bridge.js.map +1 -1
- package/docs/quickstart-tmux.md +2 -2
- package/package.json +1 -1
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +6 -4
|
@@ -28,7 +28,7 @@ Core slash-command forms:
|
|
|
28
28
|
- `/akk list`: list live coding-agent terminals with their current or recent managed-turn context.
|
|
29
29
|
- `/akk threads <exact-terminal-id>`: list verified native threads that may be resumed in one exact terminal.
|
|
30
30
|
- `/akk new-thread <exact-terminal-id>` or `/akk clear-thread <exact-terminal-id>`: switch that idle terminal to a verified clean native context without creating a Turn.
|
|
31
|
-
- `/akk resume-thread <exact-terminal-id> [
|
|
31
|
+
- `/akk resume-thread <exact-terminal-id> [uuid|previous|number|@short-id|snapshot-handle]`: list candidates when the selection is omitted, or resume one exact snapshot-bound choice without creating a Turn. `previous` also accepts the human phrase `刚才那个`.
|
|
32
32
|
- `/akk status [turn-selector]`: inspect one live terminal or exact managed Turn.
|
|
33
33
|
- `/akk respond <turn-selector>: <answer>`: answer a coding-agent question inside a `waiting_for_openclaw` Turn.
|
|
34
34
|
- `/akk cancel <turn-selector>`: interrupt the exact Turn without closing its tmux pane.
|
|
@@ -45,7 +45,7 @@ Natural-language forms:
|
|
|
45
45
|
- Requests to list AKK or local coding-agent work: call `agent_knock_knock_list`.
|
|
46
46
|
- Requests to list resumable native threads for an exact terminal: call `agent_knock_knock_list_resumable_threads` with the terminal row's prefilled `terminal_id`.
|
|
47
47
|
- Explicit requests to start a new thread or clear context: call `agent_knock_knock_new_thread` only from an advertised `new_thread` action, preserving its exact `terminal_id` and `expected_binding_token`.
|
|
48
|
-
- Explicit requests to resume prior native context: first call `agent_knock_knock_list_resumable_threads`; then call `agent_knock_knock_resume_thread` with the same exact `terminal_id`, the complete UUID and opaque `candidate_token` from one `resumable=true` row, and the `expected_binding_token` from that same result.
|
|
48
|
+
- Explicit requests to resume prior native context: first call `agent_knock_knock_list_resumable_threads`; then call `agent_knock_knock_resume_thread` with the same exact `terminal_id`, the complete UUID and opaque `candidate_token` from one `resumable=true` row, and the `expected_binding_token` from that same result. For “previous” / “刚才那个”, proceed only when that fresh result contains `previous.available_actions.resume_thread`, and use that exact action; never substitute the newest row.
|
|
49
49
|
- Requests to inspect current output or ask what a task is doing: call `agent_knock_knock_status`.
|
|
50
50
|
- A later request for an existing listed AKK session: call `agent_knock_knock_send` with its authoritative `session_id` and `request=<message>`; this creates a new Turn in the same native context.
|
|
51
51
|
- Requests to continue the current thread are ordinary sends, not lifecycle actions.
|
|
@@ -75,7 +75,7 @@ For native-thread lifecycle discovery or mutation:
|
|
|
75
75
|
|
|
76
76
|
1. Start from the exact terminal row's currently advertised `list_resumable_threads` or `new_thread` action. Listing is read-only, requires only the full `terminal_id`, and creates no Turn.
|
|
77
77
|
2. Before either mutation, `new_thread` or `resume_thread`, the terminal must be verified idle and have no active or unresolved Turn. Preserve the exact `expected_binding_token` from the same current terminal action or lifecycle-list result. Never construct, guess, or reuse it after another terminal action.
|
|
78
|
-
3. For resume, list candidates first and invoke only the `resume_thread` action advertised by one candidate row with `resumable=true`. Preserve that row's complete `native_thread_id` and opaque `candidate_token`; never select by title, preview, recency, or a partial UUID, and never combine values from different snapshots.
|
|
78
|
+
3. For resume, list candidates first and invoke only the `resume_thread` action advertised by one candidate row with `resumable=true`. Preserve that row's complete `native_thread_id` and opaque `candidate_token`; never select by title, preview, recency, or a partial UUID, and never combine values from different snapshots. Structured tool calls always use the exact full action. Human slash-command numbers and collision-safe short IDs refer only to the latest candidate snapshot displayed in that same OpenClaw session; an opaque handle names one exact snapshot, and all expire or fail after relevant terminal state changes. If the user says “previous” or “刚才那个”, use only an advertised `previous` action derived from the latest committed transition; if absent, explain that AKK cannot prove it and ask the user to list/select instead.
|
|
79
79
|
4. Treat mutation success as a Session/native-context transition, not as task delivery. It creates or activates an AKK `session_id`, advances the terminal binding generation, and creates no `turn_id`. The next ordinary send creates the first Turn in that context.
|
|
80
80
|
5. If the agent/version is unsupported, a candidate is ambiguous or active elsewhere, the token is stale, or post-transition identity cannot be verified, fail closed and report the error. Do not fall back to raw terminal commands.
|
|
81
81
|
|
|
@@ -88,6 +88,8 @@ Useful examples:
|
|
|
88
88
|
/akk list
|
|
89
89
|
/akk threads terminal:v2:tmux:codex:akk-work:0.0:1234
|
|
90
90
|
/akk new-thread terminal:v2:tmux:codex:akk-work:0.0:1234
|
|
91
|
+
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 previous
|
|
92
|
+
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 2
|
|
91
93
|
/akk resume-thread terminal:v2:tmux:codex:akk-work:0.0:1234 11111111-1111-4111-8111-111111111111
|
|
92
94
|
/akk status only
|
|
93
95
|
/akk respond @a1b2c3d4: use the existing JSON format
|
|
@@ -151,7 +153,7 @@ A trusted, default-disabled plugin `autoApprove` policy may independently approv
|
|
|
151
153
|
|
|
152
154
|
`agent_knock_knock_list` is terminal-first: every eligible already-running Codex or Claude Code pane appears once in `terminals[]`, even when retained managed Turns reference it. The resource chain is terminal → verified native session → managed AKK `session_id` → Turns. `process_state` reports process liveness and `activity_state` reports the parsed screen state. `managed.current_turn` is the authoritative active Turn for that terminal; otherwise `managed.recent_turn` shows the newest retained context. Request `all=true` only when older `managed.history` or retained unavailable history is needed. By default, `unavailable_managed_turns[]` contains attention-needed records whose terminal is unavailable.
|
|
153
155
|
|
|
154
|
-
The top-level v5 `action_contracts` summarizes each tool's managed target and its narrow compatibility inputs; `available_actions` is the authoritative current-action source after listing. An existing managed Session's ordinary `send` targets `session_id` and starts a new managed Turn. On first attach only, `selector` may preserve a discovery target explicitly named by the user or the exact selector prefilled by an unmanaged raw-terminal row; it must never be passed as `session_id`. `respond` and every managed control target `turn_id`; `respond` is offered only for a Turn waiting on OpenClaw. The read-only `list_resumable_threads` action is advertised on the terminal row, requires only its full `terminal_id`, and returns a fresh `expected_binding_token` plus candidate rows. The `new_thread` mutation is advertised on the terminal row and requires that terminal ID and token; each resumable candidate row advertises its own `resume_thread` mutation with the same snapshot token, its complete `native_thread_id`, and its opaque `candidate_token`. Lifecycle discovery and mutations never create a Turn. A raw terminal may be controlled only through the exact action that its own row advertises; prefilled compatibility selectors, lifecycle IDs, and tokens must never be inferred, copied from another row, or reused from another snapshot. Start with the prefilled full argument, supply all `missing_required` fields, and use a returned `@short-ref` only for human-facing ordinary-send selection. Availability is a snapshot, so AKK revalidates it before side effects.
|
|
156
|
+
The top-level v5 `action_contracts` summarizes each tool's managed target and its narrow compatibility inputs; `available_actions` is the authoritative current-action source after listing. An existing managed Session's ordinary `send` targets `session_id` and starts a new managed Turn. On first attach only, `selector` may preserve a discovery target explicitly named by the user or the exact selector prefilled by an unmanaged raw-terminal row; it must never be passed as `session_id`. `respond` and every managed control target `turn_id`; `respond` is offered only for a Turn waiting on OpenClaw. The read-only `list_resumable_threads` action is advertised on the terminal row, requires only its full `terminal_id`, and returns a fresh `expected_binding_token` plus candidate rows. The `new_thread` mutation is advertised on the terminal row and requires that terminal ID and token; each resumable candidate row advertises its own `resume_thread` mutation with the same snapshot token, its complete `native_thread_id`, and its opaque `candidate_token`. A top-level `previous` block, when present, is the only authority for a “previous/刚才那个” request. Number, short ID, and snapshot handle fields are human-facing navigation only; never pass them to the exact resume tool. Lifecycle discovery and mutations never create a Turn. A raw terminal may be controlled only through the exact action that its own row advertises; prefilled compatibility selectors, lifecycle IDs, and tokens must never be inferred, copied from another row, or reused from another snapshot. Start with the prefilled full argument, supply all `missing_required` fields, and use a returned `@short-ref` only for human-facing ordinary-send selection. Availability is a snapshot, so AKK revalidates it before side effects.
|
|
155
157
|
|
|
156
158
|
Before every terminal operation, AKK revalidates the expected agent PID and tmux pane identity, then confirms that the process and pane working directories match. Sending new work additionally requires a verified idle prompt. Humans can attach to the same tmux session and continue directly at any time.
|
|
157
159
|
|