@scotthuang/agent-knock-knock 0.2.46 → 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.
@@ -70,7 +70,8 @@ export class TerminalAgentBridge {
70
70
  }
71
71
  async status(agent, terminalControl, options = {}) {
72
72
  const adapter = this.registry.require(agent);
73
- if (!adapter.capabilities.screenStatus) {
73
+ if (!adapter.capabilities.screenStatus ||
74
+ !terminalControl.capabilities.includes("screen_status")) {
74
75
  return unsupportedScreenStatus(adapter, terminalControl);
75
76
  }
76
77
  try {
@@ -113,9 +114,47 @@ export class TerminalAgentBridge {
113
114
  socketPath: terminalControl.socketPath
114
115
  });
115
116
  }
116
- async cancel(agent, terminalControl) {
117
+ async cancel(agent, terminalControl, options = {}) {
117
118
  const adapter = this.registry.require(agent);
118
- if (!adapter.capabilities.cancellation || adapter.cancelKeys.length === 0) {
119
+ if (adapter.capabilities.terminalApproval &&
120
+ adapter.resolveApproval &&
121
+ terminalControl.capabilities.includes("terminal_approval") &&
122
+ adapter.capabilities.screenStatus &&
123
+ terminalControl.capabilities.includes("screen_status")) {
124
+ const { inspection } = await this.captureInspection(adapter, terminalControl, options);
125
+ if (inspection.approval.approvable && inspection.approval.action.mode === "structured") {
126
+ const fingerprint = terminalApprovalFingerprint(adapter.agent, terminalControl, inspection);
127
+ if (!fingerprint) {
128
+ return {
129
+ cancelRequested: false,
130
+ reason: `${adapter.displayName} structured approval has no fingerprint`
131
+ };
132
+ }
133
+ const decision = await adapter.resolveApproval({
134
+ decision: "deny",
135
+ expectedFingerprint: fingerprint,
136
+ actualFingerprint: fingerprint,
137
+ inspection,
138
+ runtime: options.runtime,
139
+ interrupt: true
140
+ });
141
+ return {
142
+ cancelRequested: decision.resolved,
143
+ deniedApproval: decision.resolved,
144
+ requestId: decision.requestId,
145
+ reason: decision.reason
146
+ };
147
+ }
148
+ if (inspection.approval.blocked && !inspection.approval.approvable) {
149
+ return {
150
+ cancelRequested: false,
151
+ reason: inspection.approval.reason
152
+ };
153
+ }
154
+ }
155
+ if (!adapter.capabilities.cancellation ||
156
+ adapter.cancelKeys.length === 0 ||
157
+ !terminalControl.capabilities.includes("terminal_cancel")) {
119
158
  return {
120
159
  cancelRequested: false,
121
160
  reason: `${adapter.displayName} terminal cancellation is not supported`
@@ -132,7 +171,8 @@ export class TerminalAgentBridge {
132
171
  }
133
172
  async approve(agent, terminalControl, options = {}) {
134
173
  const adapter = this.registry.require(agent);
135
- if (!adapter.capabilities.terminalApproval) {
174
+ if (!adapter.capabilities.terminalApproval ||
175
+ !terminalControl.capabilities.includes("terminal_approval")) {
136
176
  return {
137
177
  approved: false,
138
178
  blocked: true,
@@ -150,7 +190,22 @@ export class TerminalAgentBridge {
150
190
  screenExcerpt: inspection.screenExcerpt
151
191
  };
152
192
  }
153
- if (inspection.approval.action.keys.length === 0) {
193
+ const decisionMode = inspection.approval.action.mode ?? "keys";
194
+ if (options.requiredDecisionMode && decisionMode !== options.requiredDecisionMode) {
195
+ return {
196
+ approved: false,
197
+ blocked: true,
198
+ reason: `${adapter.displayName} approval mode ${decisionMode} is not eligible for this decision`,
199
+ label: inspection.approval.action.label,
200
+ promptKind: inspection.approval.promptKind,
201
+ command: inspection.approval.command,
202
+ fingerprint: terminalApprovalFingerprint(adapter.agent, terminalControl, inspection),
203
+ screenExcerpt: inspection.screenExcerpt,
204
+ decisionMode,
205
+ requestId: inspection.approval.action.requestId
206
+ };
207
+ }
208
+ if (decisionMode === "keys" && inspection.approval.action.keys.length === 0) {
154
209
  return {
155
210
  approved: false,
156
211
  blocked: true,
@@ -175,7 +230,55 @@ export class TerminalAgentBridge {
175
230
  promptKind: inspection.approval.promptKind,
176
231
  command: inspection.approval.command,
177
232
  fingerprint,
178
- screenExcerpt: inspection.screenExcerpt
233
+ screenExcerpt: inspection.screenExcerpt,
234
+ decisionMode,
235
+ requestId: inspection.approval.action.requestId
236
+ };
237
+ }
238
+ if (decisionMode === "structured") {
239
+ if (!options.expectedFingerprint) {
240
+ return {
241
+ approved: false,
242
+ blocked: true,
243
+ reason: "structured approval requires the latest expected fingerprint",
244
+ label: inspection.approval.action.label,
245
+ promptKind: inspection.approval.promptKind,
246
+ command: inspection.approval.command,
247
+ fingerprint,
248
+ screenExcerpt: inspection.screenExcerpt,
249
+ decisionMode,
250
+ requestId: inspection.approval.action.requestId
251
+ };
252
+ }
253
+ if (!fingerprint || !adapter.resolveApproval) {
254
+ return {
255
+ approved: false,
256
+ blocked: true,
257
+ reason: `${adapter.displayName} structured approval resolver is unavailable`,
258
+ fingerprint,
259
+ screenExcerpt: inspection.screenExcerpt,
260
+ decisionMode,
261
+ requestId: inspection.approval.action.requestId
262
+ };
263
+ }
264
+ const resolved = await adapter.resolveApproval({
265
+ decision: "allow",
266
+ expectedFingerprint: options.expectedFingerprint,
267
+ actualFingerprint: fingerprint,
268
+ inspection,
269
+ runtime: options.runtime
270
+ });
271
+ return {
272
+ approved: resolved.resolved,
273
+ blocked: !resolved.resolved,
274
+ reason: resolved.reason,
275
+ label: inspection.approval.action.label,
276
+ promptKind: inspection.approval.promptKind,
277
+ command: inspection.approval.command,
278
+ fingerprint,
279
+ screenExcerpt: inspection.screenExcerpt,
280
+ decisionMode,
281
+ requestId: resolved.requestId ?? inspection.approval.action.requestId
179
282
  };
180
283
  }
181
284
  await this.terminalProvider.sendKeys(terminalControl.target, inspection.approval.action.keys, { socketPath: terminalControl.socketPath });
@@ -190,14 +293,17 @@ export class TerminalAgentBridge {
190
293
  promptKind: inspection.approval.promptKind,
191
294
  command: inspection.approval.command,
192
295
  fingerprint,
193
- screenExcerpt: inspection.screenExcerpt
296
+ screenExcerpt: inspection.screenExcerpt,
297
+ decisionMode,
298
+ requestId: inspection.approval.action.requestId
194
299
  };
195
300
  }
196
301
  async monitorPoll(options) {
197
302
  const adapter = this.registry.require(options.agent);
198
303
  let inspection;
199
304
  let status = unsupportedScreenStatus(adapter, options.terminalControl);
200
- if (adapter.capabilities.screenStatus) {
305
+ if (adapter.capabilities.screenStatus &&
306
+ options.terminalControl.capabilities.includes("screen_status")) {
201
307
  try {
202
308
  const captured = await this.captureInspection(adapter, options.terminalControl, options.screenOptions);
203
309
  inspection = captured.inspection;
@@ -210,14 +316,17 @@ export class TerminalAgentBridge {
210
316
  let durableCompletion;
211
317
  let durableError;
212
318
  try {
213
- durableCompletion = adapter.capabilities.durableCompletion && options.durableRequest
319
+ durableCompletion = adapter.capabilities.durableCompletion &&
320
+ options.terminalControl.capabilities.includes("durable_completion") &&
321
+ options.durableRequest
214
322
  ? await adapter.detectDurableCompletion?.(options.durableRequest)
215
323
  : undefined;
216
324
  }
217
325
  catch (error) {
218
326
  durableError = error instanceof Error ? error.message : String(error);
219
327
  }
220
- const screenCompletion = adapter.capabilities.screenCompletion
328
+ const screenCompletion = adapter.capabilities.screenCompletion &&
329
+ options.terminalControl.capabilities.includes("screen_completion")
221
330
  ? inspection?.completion
222
331
  : undefined;
223
332
  const limitations = [
@@ -247,7 +356,8 @@ export class TerminalAgentBridge {
247
356
  screen,
248
357
  requestText: options.requestText,
249
358
  screenChangedSinceSend: options.screenChangedSinceSend,
250
- maxExcerptLength: options.maxExcerptLength
359
+ maxExcerptLength: options.maxExcerptLength,
360
+ runtime: options.runtime
251
361
  })
252
362
  };
253
363
  }
@@ -256,6 +366,7 @@ export function terminalApprovalFingerprint(agent, terminalControl, inspection)
256
366
  if (!inspection.approval.approvable) {
257
367
  return undefined;
258
368
  }
369
+ const decisionMode = inspection.approval.action.mode ?? "keys";
259
370
  return createHash("sha256")
260
371
  .update(JSON.stringify({
261
372
  agent,
@@ -265,7 +376,11 @@ export function terminalApprovalFingerprint(agent, terminalControl, inspection)
265
376
  label: inspection.approval.action.label,
266
377
  prompt_kind: inspection.approval.promptKind,
267
378
  command: inspection.approval.command,
268
- screen_excerpt: inspection.screenExcerpt
379
+ tool_name: inspection.approval.toolName,
380
+ request_detail: inspection.approval.requestDetail,
381
+ screen_excerpt: decisionMode === "structured" ? undefined : inspection.screenExcerpt,
382
+ decision_mode: decisionMode,
383
+ request_id: inspection.approval.action.requestId
269
384
  }))
270
385
  .digest("hex");
271
386
  }
@@ -291,8 +406,12 @@ function statusFromInspection(adapter, terminalControl, inspection) {
291
406
  label: approval.approvable ? approval.action.label : undefined,
292
407
  prompt_kind: approval.promptKind,
293
408
  command: approval.command,
409
+ tool_name: approval.toolName,
410
+ request_detail: approval.requestDetail,
294
411
  reason: approval.approvable ? undefined : approval.reason,
295
- fingerprint
412
+ fingerprint,
413
+ decision_mode: approval.approvable ? approval.action.mode ?? "keys" : undefined,
414
+ request_id: approval.approvable ? approval.action.requestId : undefined
296
415
  },
297
416
  screen: {
298
417
  excerpt: inspection.screenExcerpt,
@@ -326,7 +445,9 @@ function approvalOutput(approval) {
326
445
  approvable: false,
327
446
  reason: approval.reason,
328
447
  promptKind: approval.promptKind,
329
- command: approval.command
448
+ command: approval.command,
449
+ toolName: approval.toolName,
450
+ requestDetail: approval.requestDetail
330
451
  };
331
452
  }
332
453
  return {
@@ -336,7 +457,11 @@ function approvalOutput(approval) {
336
457
  keys: approval.action.keys,
337
458
  label: approval.action.label,
338
459
  promptKind: approval.promptKind,
339
- command: approval.command
460
+ command: approval.command,
461
+ toolName: approval.toolName,
462
+ requestDetail: approval.requestDetail,
463
+ decisionMode: approval.action.mode ?? "keys",
464
+ requestId: approval.action.requestId
340
465
  };
341
466
  }
342
467
  function unsupportedScreenStatus(adapter, terminalControl) {
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-agent-bridge.js","sourceRoot":"","sources":["../../src/terminal-agent-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,qCAAqC,EAUtC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wCAAwC,EACxC,mBAAmB,EAEpB,MAAM,gCAAgC,CAAC;AA2DxC,MAAM,OAAO,mBAAmB;IACrB,QAAQ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apter.js";
2
+ import { claudeTerminalAgentAdapter } from "./claude-terminal-agent-adapter.js";
2
3
  import { createTerminalAgentAdapterRegistry } from "./terminal-agent-adapter.js";
3
4
  /** New production terminal agents opt in once here after providing a complete adapter. */
4
5
  const productionTerminalAgentAdapters = [
5
- codexTerminalAgentAdapter
6
+ codexTerminalAgentAdapter,
7
+ claudeTerminalAgentAdapter
6
8
  ];
7
9
  export function createProductionTerminalAgentRegistry(options = {}) {
8
10
  const overrides = new Map((options.overrides ?? []).map((adapter) => [adapter.agent, adapter]));
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-agent-registry.js","sourceRoot":"","sources":["../../src/terminal-agent-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EACL,kCAAkC,EAEnC,MAAM,6BAA6B,CAAC;AAGrC,0FAA0F;AAC1F,MAAM,+BAA+B,GAAoC;IACvE,yBAAyB;CAC1B,CAAC;AAEF,MAAM,UAAU,qCAAqC,CAAC,UAElD,EAAE;IACJ,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CACrE,CAAC;IACF,MAAM,QAAQ,GAAG,+BAA+B,CAAC,GAAG,CAClD,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CACrD,CAAC;IACF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,CAA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,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,kCAAkC,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,qCAAqC,EAAE,CAAC;AAEpF,MAAM,UAAU,uBAAuB,CAAC,KAA4B;IAClE,OAAO,4BAA4B,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "agent-knock-knock",
3
3
  "name": "Agent Knock Knock",
4
- "description": "Agent Knock Knock (AKK/akk) delegates OpenClaw coding work to local Codex, Claude, or Cursor agents. Use this plugin when the user says AKK, akk, Agent Knock Knock, asks to hand work to Codex, Claude, or Cursor, asks what agent tasks are running, asks what an AKK/Codex session is about, sends a follow-up to an agent task, renews monitoring for a stalled terminal task, recovers an unavailable agent session, cancels a running agent task, or closes an agent task. Default delegation target comes from plugin config defaultAgent and falls back to Codex when unset; explicit user agent requests override it.",
4
+ "description": "Agent Knock Knock (AKK/akk) delegates OpenClaw coding work to local Codex, Claude, or Cursor agents. Use this plugin when the user says AKK, akk, Agent Knock Knock, asks to hand work to Codex, Claude, or Cursor, asks what agent tasks are running, asks what an AKK, Codex, or Claude session is about, sends a follow-up to an agent task, renews monitoring for a stalled terminal task, recovers an unavailable agent session, cancels a running agent task, or closes an agent task. Default delegation target comes from plugin config defaultAgent and falls back to Codex when unset; explicit user agent requests override it.",
5
5
  "activation": {
6
6
  "onStartup": true
7
7
  },
@@ -171,7 +171,7 @@
171
171
  "autoApprove": {
172
172
  "type": "object",
173
173
  "additionalProperties": false,
174
- "description": "Deterministic terminal approval policy. Disabled by default and never exposed as model-controlled tool parameters.",
174
+ "description": "Deterministic Codex and Claude Code terminal approval policy. Disabled by default and never exposed as model-controlled tool parameters.",
175
175
  "properties": {
176
176
  "enabled": {
177
177
  "type": "boolean",
@@ -193,7 +193,7 @@
193
193
  "minItems": 1,
194
194
  "items": {
195
195
  "type": "string",
196
- "enum": ["codex"]
196
+ "enum": ["codex", "claude"]
197
197
  }
198
198
  },
199
199
  "workspaces": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scotthuang/agent-knock-knock",
3
- "version": "0.2.46",
3
+ "version": "0.2.47",
4
4
  "description": "OpenClaw plugin bridge for delegating work to local coding agents through ACPX.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -5,7 +5,7 @@ description: Delegate OpenClaw tasks to local Codex, Claude Code, and Cursor age
5
5
 
6
6
  # Agent Knock Knock
7
7
 
8
- Use this skill when the user says `AKK`, `akk`, `Agent Knock Knock`, asks OpenClaw to delegate coding work to Codex, Claude, or Cursor, asks what agent tasks are running, asks what a listed AKK/Codex session is about, sends a follow-up to an agent task, lists existing local coding-agent sessions, takes over an existing native Codex session, recovers an unavailable agent session, cancels a running agent task, or closes an agent task.
8
+ Use this skill when the user says `AKK`, `akk`, `Agent Knock Knock`, asks OpenClaw to delegate coding work to Codex, Claude, or Cursor, asks what agent tasks are running, asks what a listed AKK, Codex, or Claude session is about, sends a follow-up to an agent task, lists existing local coding-agent sessions, takes over an existing native Codex session, recovers an unavailable agent session, cancels a running agent task, or closes an agent task.
9
9
 
10
10
  Treat `AKK` and `akk` the same way.
11
11
 
@@ -35,7 +35,7 @@ Slash command forms:
35
35
  - `/akk cursor <task>`: delegate to Cursor.
36
36
  - `/akk list`: list open AKK sessions.
37
37
  - `/akk status <conversation-id>`: inspect one AKK session.
38
- - `/akk describe <conversation-id>`: summarize what one AKK-managed, native Codex, or terminal-controlled Codex session is about.
38
+ - `/akk describe <conversation-id>`: summarize what one AKK-managed, native, or terminal-controlled session is about.
39
39
  - `/akk send <conversation-id> <message>`: send a follow-up to one open AKK session.
40
40
  - `/akk cancel <conversation-id>`: request cooperative cancellation of the current in-flight prompt for one AKK session without closing it.
41
41
  - `/akk recover <conversation-id>`: recover a session that is waiting for a recovery decision by starting a new agent session with AKK's saved protocol history summary.
@@ -47,17 +47,17 @@ Natural-language forms:
47
47
  - `AKK Codex: <task>`: call `agent_knock_knock_delegate` with `agent="codex"`.
48
48
  - `AKK Claude: <task>`: call `agent_knock_knock_delegate` with `agent="claude"`.
49
49
  - `AKK Cursor: <task>`: call `agent_knock_knock_delegate` with `agent="cursor"`.
50
- - `AKK list`, `akk list`, questions such as "what AKK sessions are open", "which Codex sessions are currently running", "terminal-controlled Codex sessions", or requests to list active local coding-agent work: call `agent_knock_knock_list`.
50
+ - `AKK list`, `akk list`, questions such as "what AKK sessions are open", "which Codex or Claude sessions are currently running", "terminal-controlled sessions", or requests to list active local coding-agent work: call `agent_knock_knock_list`.
51
51
  - `AKK status <conversation-id>` or requests to view current output, execution result, terminal screen, or "what is it doing now": call `agent_knock_knock_status`. For `terminal_controlled` entries, status internally captures the terminal pane and returns `terminal_screen`; do not call tmux or shell commands directly to inspect the pane unless AKK status fails.
52
- - `AKK describe <conversation-id>`, `AKK summary <conversation-id>`, or requests such as "what is this session about", "what was this task doing", "remind me what this drawing/session is for", or "这个会话/绘画大概在做什么": call `agent_knock_knock_describe`. Prefer this over direct terminal/tmux inspection because AKK can combine saved conversation history, Codex rollout history, cwd-matched history, and terminal-screen fallback with explicit confidence.
53
- - `AKK send <conversation-id>: <message>` or follow-up requests for an existing open agent session: call `agent_knock_knock_send`. Also use `agent_knock_knock_send` when the user says to send/tell/ask/forward/add/continue a message or task to a listed AKK session, a listed Codex session, a terminal-controlled entry, a tmux target such as `my-work:0.1`, or "the one from the list". If the target comes from a `terminal_controlled` entry in `AKK list`, use that entry's `id` directly; AKK will type the message into the controlled terminal pane and submit it. Do not call `agent_knock_knock_delegate` for these requests unless the user explicitly asks for a new independent session.
54
- - `AKK cancel <conversation-id>` or requests to stop the current running work without closing the session: call `agent_knock_knock_cancel`. If the target comes from a `terminal_controlled` entry in `AKK list`, use that entry's `id` directly; AKK sends Control-C to the controlled terminal pane.
52
+ - `AKK describe <conversation-id>`, `AKK summary <conversation-id>`, or requests such as "what is this session about", "what was this task doing", "remind me what this drawing/session is for", or "这个会话/绘画大概在做什么": call `agent_knock_knock_describe`. Prefer this over direct terminal/tmux inspection because AKK can combine saved conversation history, agent-specific structured history when available, and terminal-screen fallback with explicit confidence.
53
+ - `AKK send <conversation-id>: <message>` or follow-up requests for an existing open agent session: call `agent_knock_knock_send`. Also use `agent_knock_knock_send` when the user says to send/tell/ask/forward/add/continue a message or task to a listed AKK session, a listed native session, a terminal-controlled entry, a tmux target such as `my-work:0.1`, or "the one from the list". If the target comes from a `terminal_controlled` entry in `AKK list`, use that entry's `id` directly; AKK submits only when the pane is at a verified idle prompt. For Claude Code, this background send returns a managed conversation ID and creates the lease required for structured approvals and completion callbacks; use that returned ID for subsequent actions. Do not call `agent_knock_knock_delegate` for these requests unless the user explicitly asks for a new independent session.
54
+ - `AKK cancel <conversation-id>` or requests to stop the current running work: call `agent_knock_knock_cancel`. If the target is terminal-controlled, use its listed `id` directly. AKK denies a pending structured Claude permission request; otherwise it uses the adapter's interrupt key (`Control-C` for Codex or `Escape` for Claude Code). If a Claude permission dialog cannot be revalidated, AKK sends no key and it must be resolved manually in the terminal.
55
55
  - `AKK renew <conversation-id>` or requests to extend/restart monitoring for a stalled but still-live terminal task: call `agent_knock_knock_renew`. This is only for an AKK-managed terminal bridge conversation already marked `stalled`; it does not send a message or key to Codex. Pass `minutes` only when the user requests a specific new inactivity timeout.
56
56
  - `AKK recover <conversation-id>`: call `agent_knock_knock_recover`.
57
57
  - `AKK close <conversation-id>`: call `agent_knock_knock_close`.
58
58
  - `AKK takeover Codex <session-id>` or requests to take over an active Codex CLI session: call `agent_knock_knock_agent_takeover` with `agent="codex"` and `strategy="terminate_then_resume"`.
59
59
  - `AKK terminal takeover Codex <session-id>` or requests to take over a Codex CLI that is running inside a controllable terminal provider without stopping it: call `agent_knock_knock_agent_takeover` with `agent="codex"` and `strategy="terminal_control"`.
60
- - `AKK approve <conversation-id>` or requests to approve the current visible Codex permission/command prompt for a terminal-controlled session: first call `agent_knock_knock_status` for that conversation and show the terminal screen excerpt to the user. Only after the user explicitly approves that prompt, call `agent_knock_knock_approve` with the exact `approval_state.fingerprint` as `expected_approval_fingerprint`. If an AKK callback says a terminal bridge session is waiting for approval, pass its approval fingerprint the same way; deny or stop that request with `agent_knock_knock_cancel`. If the target comes from a `terminal_controlled` entry in `AKK list`, use that entry's `id` directly; it does not need an AKK-managed state file before status or approval.
60
+ - `AKK approve <conversation-id>` or requests to approve a terminal-controlled permission or command prompt: first call `agent_knock_knock_status` and show the detected request details to the user. Only after the user explicitly approves that exact request, call `agent_knock_knock_approve` with its `approval_state.fingerprint` as `expected_approval_fingerprint`. Claude Code uses the structured `PermissionRequest` hook; Codex uses the current visible prompt. If an AKK callback says a terminal bridge session is waiting for approval, pass its fingerprint the same way; deny it with `agent_knock_knock_cancel`. Unknown, stale, ambiguous, or changed requests must never be approved. Status works directly for every listed `terminal_controlled` ID. Codex visible-prompt approval can also work without managed state; Claude approval requires the managed lease created by a prior background send.
61
61
  - `AKK takeover Codex <session-id> with fork`, `AKK fork takeover Codex <session-id>`, or requests to take over without stopping the original Codex CLI: call `agent_knock_knock_agent_takeover` with `agent="codex"` and `strategy="fork"`.
62
62
 
63
63
  Session reuse rule:
@@ -80,6 +80,7 @@ akk list
80
80
  akk describe task-20260618T010203Z-abcdef12
81
81
  akk send task-20260618T010203Z-abcdef12: continue with the smaller implementation
82
82
  akk send terminal:v2:tmux:codex:my-work:0.1:38140: hello 测试一下通信
83
+ akk send terminal:v2:tmux:claude:claude-work:0.1:29466: review the current changes
83
84
  给 AKK list 里的 my-work:0.1 发一条消息:继续刚才的任务
84
85
  再让刚才那个 Codex 分析 ~/chrome-debug 为什么占空间
85
86
  akk cancel task-20260618T010203Z-abcdef12
@@ -114,7 +115,7 @@ scripts/bidirectional-delegate.sh --request '<user task>'
114
115
 
115
116
  Do not use OpenClaw's internal session tools, such as `sessions_send`, to send the task or follow-up messages directly to Codex, Claude, or Cursor.
116
117
 
117
- All OpenClaw-to-agent task delivery must go through the Agent Knock Knock plugin tools, `scripts/bidirectional-delegate.sh`, or an equivalent `agent-knock-knock delegate` command. Standard ACPX delegation builds the required bootstrap prompt, embeds the OpenClaw callback command, creates durable conversation state, and records the initial task message. Terminal-control bridge conversations are different: AKK types only the user-facing message into the tmux Codex pane, monitors Codex rollout/terminal state, and sends the OpenClaw callback itself.
118
+ All OpenClaw-to-agent task delivery must go through the Agent Knock Knock plugin tools, `scripts/bidirectional-delegate.sh`, or an equivalent `agent-knock-knock delegate` command. Standard ACPX delegation builds the required bootstrap prompt, embeds the OpenClaw callback command, creates durable conversation state, and records the initial task message. Terminal-control bridge conversations are different: AKK types only the user-facing message into the tmux agent pane, monitors adapter and structured hook state, and sends the OpenClaw callback itself.
118
119
 
119
120
  For standard ACPX delegation, the coding agent must communicate back to OpenClaw by executing the callback command included in its bootstrap prompt. For terminal-control bridge conversations, AKK owns callback delivery. The coding agent should not rely on OpenClaw's session tools, chat memory, or an out-of-band reply path.
120
121
 
@@ -142,17 +143,17 @@ Make clear that `recover` is AKK replay recovery, not guaranteed native coding-a
142
143
 
143
144
  Do not start a replacement task without the user's explicit choice.
144
145
 
145
- ## Native Session Takeover
146
+ ## Native and tmux Sessions
146
147
 
147
- Native session takeover is for Codex sessions that were created outside AKK, such as a user-run terminal Codex CLI. It is separate from AKK managed conversation recovery.
148
+ Native stop/resume and fork takeover are for Codex sessions created outside AKK. tmux terminal control supports both Codex and Claude Code and is separate from AKK managed conversation recovery.
148
149
 
149
- Use `agent_knock_knock_list` when the user asks about current active native Codex sessions, terminal-controlled Codex sessions, or which local coding-agent work is currently open. The list result separates:
150
+ Use `agent_knock_knock_list` when the user asks about current native Codex sessions, terminal-controlled Codex or Claude Code sessions, or which local coding-agent work is currently open. The list result separates:
150
151
 
151
152
  - `delegated`: AKK-managed tasks.
152
153
  - `native`: discovered local native sessions that AKK cannot directly control.
153
154
  - `terminal_controlled`: discovered local native sessions in a controllable terminal provider. The current provider is tmux.
154
155
 
155
- Use `agent_knock_knock_describe` when the user asks what a listed session is about. AKK-managed sessions use durable AKK 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 return visible terminal/process context with lower confidence. Do not use raw tmux, shell, or peek tools for this summary unless `agent_knock_knock_describe` is unavailable or fails.
156
+ Use `agent_knock_knock_describe` when the user asks what a listed session is about. AKK-managed sessions use durable AKK conversation history. Terminal adapters use agent-specific structured history when available and otherwise return visible terminal/process context with lower confidence. Do not use raw tmux, shell, or peek tools for this summary unless `agent_knock_knock_describe` is unavailable or fails.
156
157
 
157
158
  Use `agent_knock_knock_agent_takeover` when the user wants AKK to take over an existing native Codex session. By default this tool is side-effect-free and returns a plan. When the plan is ready and the user explicitly wants AKK to manage the session, call it with `createConversation=true` to create an AKK conversation bound to the native session:
158
159
 
@@ -160,6 +161,8 @@ Use `agent_knock_knock_agent_takeover` when the user wants AKK to take over an e
160
161
  - `terminal_control`: use when the target Codex CLI is running inside a controllable terminal provider and the user wants AKK to operate the existing TUI without stopping or resuming it. The first call is side-effect-free. If the result is `requires_confirmation`, show the exact terminal target, pid, cwd, and current terminal-control metadata. Only after explicit user confirmation, call again with `strategy="terminal_control"`, `createConversation=true`, `confirmTerminal=true`, and `terminalTarget=<confirmed target>`. Follow-up `AKK send` messages will be typed into the terminal pane as concise user-facing task text; AKK monitors the Codex rollout/terminal state and sends the callback to OpenClaw itself. `AKK cancel` sends Control-C to the controlled terminal pane. Terminal-controlled entries from `AKK list` can be sent to, cancelled, approved, and inspected directly with their `id`; use `agent_knock_knock_status` to inspect the current terminal screen or execution result. Before `agent_knock_knock_approve`, show the user the latest terminal excerpt and pass its fingerprint as `expected_approval_fingerprint`.
161
162
  - `fork`: use when the user wants to avoid stopping the original Codex CLI. First call returns a bounded context package plus `summaryPrompt` and `nextAction`; use that prompt to summarize as OpenClaw, ask the user to confirm, and do not inject raw full rollout history directly. After the user confirms the summary, call `agent_knock_knock_agent_takeover` again with `strategy="fork"`, `createConversation=true`, and `forkSummary=<approved summary>` to create the forked AKK-managed session. Then use the returned `conversation_id` with `AKK send` for follow-up work.
162
163
 
164
+ Claude Code terminal entries are controlled directly by their `terminal:v2:tmux:claude:...` ids; do not offer Codex-only stop/resume or fork strategies for them. Treat the structured completion or error callback as authoritative. Do not report completion merely because the pane looks idle: AKK emits one completion from Claude's `Stop.last_assistant_message` only after background tasks and scheduled jobs are empty, and maps `StopFailure` to an error. If the Claude hooks are unavailable, AKK deliberately keeps completion and approval conservative.
165
+
163
166
  Do not present `fork` as a standalone command or standalone feature. It is a takeover strategy.
164
167
 
165
168
  Do not use `resume-anyway` or start a second live client on the same native Codex session while another Codex CLI is active. That can create mixed session history where multiple clients do not see each other's live context until a later resume.
@@ -177,7 +180,7 @@ Use structured JSON messages with these types:
177
180
  - `error`: runtime, tool, or protocol failure
178
181
  - `control`: budget warning or lifecycle control
179
182
 
180
- `cancel` is lifecycle control outside the agent message protocol. For delegated sessions, it asks ACPX to cooperatively cancel the current in-flight prompt for the existing Codex, Claude, or Cursor session. For terminal-controlled sessions, it sends Control-C to the controlled terminal pane. It does not close the AKK session; use `close` only when the session should no longer be reused.
183
+ `cancel` is lifecycle control outside the agent message protocol. For delegated sessions, it asks ACPX to cooperatively cancel the current in-flight prompt. For terminal-controlled sessions, it denies a pending structured permission when safe or uses the adapter's interrupt action, then marks that AKK task cancelled while leaving the tmux pane open.
181
184
 
182
185
  Only messages with `requires_response=true` consume response rounds.
183
186