@agentdeck/bridge 1.1.0 → 1.2.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.
Files changed (199) hide show
  1. package/README.md +14 -6
  2. package/assets/fonts/NOTICE-PocketSansWorld.md +10 -0
  3. package/assets/fonts/OFL-PocketSansWorld.txt +93 -0
  4. package/assets/fonts/PocketSansWorld_12.cpfont +0 -0
  5. package/assets/fonts/pocket-sans-world.manifest.json +49 -0
  6. package/assets/learning/LICENSE-CC-BY-SA-4.0.txt +10 -0
  7. package/assets/learning/NOTICE.md +33 -0
  8. package/assets/learning/jp-n3-ko.manifest.json +27 -0
  9. package/assets/learning/jp-n3-ko.pdl +0 -0
  10. package/dist/agent-cli-diagnostics.d.ts +20 -0
  11. package/dist/agent-cli-diagnostics.d.ts.map +1 -0
  12. package/dist/agent-cli-diagnostics.js +100 -0
  13. package/dist/agent-cli-diagnostics.js.map +1 -0
  14. package/dist/apme/classifier.d.ts.map +1 -1
  15. package/dist/apme/classifier.js +18 -10
  16. package/dist/apme/classifier.js.map +1 -1
  17. package/dist/apme/claude-transcript-reader.d.ts +36 -0
  18. package/dist/apme/claude-transcript-reader.d.ts.map +1 -1
  19. package/dist/apme/claude-transcript-reader.js +78 -2
  20. package/dist/apme/claude-transcript-reader.js.map +1 -1
  21. package/dist/apme/collector.d.ts +126 -3
  22. package/dist/apme/collector.d.ts.map +1 -1
  23. package/dist/apme/collector.js +450 -41
  24. package/dist/apme/collector.js.map +1 -1
  25. package/dist/apme/dashboard-html.d.ts.map +1 -1
  26. package/dist/apme/dashboard-html.js +278 -36
  27. package/dist/apme/dashboard-html.js.map +1 -1
  28. package/dist/apme/graph.d.ts +1 -1
  29. package/dist/apme/graph.d.ts.map +1 -1
  30. package/dist/apme/graph.js +51 -1
  31. package/dist/apme/graph.js.map +1 -1
  32. package/dist/apme/http.d.ts.map +1 -1
  33. package/dist/apme/http.js +37 -5
  34. package/dist/apme/http.js.map +1 -1
  35. package/dist/apme/index.d.ts +4 -0
  36. package/dist/apme/index.d.ts.map +1 -1
  37. package/dist/apme/index.js +19 -3
  38. package/dist/apme/index.js.map +1 -1
  39. package/dist/apme/runner.d.ts +90 -0
  40. package/dist/apme/runner.d.ts.map +1 -1
  41. package/dist/apme/runner.js +524 -48
  42. package/dist/apme/runner.js.map +1 -1
  43. package/dist/apme/sample-to-timeline.d.ts.map +1 -1
  44. package/dist/apme/sample-to-timeline.js +5 -0
  45. package/dist/apme/sample-to-timeline.js.map +1 -1
  46. package/dist/apme/settings.d.ts +8 -0
  47. package/dist/apme/settings.d.ts.map +1 -1
  48. package/dist/apme/settings.js +4 -0
  49. package/dist/apme/settings.js.map +1 -1
  50. package/dist/apme/store.d.ts +118 -9
  51. package/dist/apme/store.d.ts.map +1 -1
  52. package/dist/apme/store.js +342 -44
  53. package/dist/apme/store.js.map +1 -1
  54. package/dist/apme/task-gradeability.d.ts +82 -0
  55. package/dist/apme/task-gradeability.d.ts.map +1 -0
  56. package/dist/apme/task-gradeability.js +126 -0
  57. package/dist/apme/task-gradeability.js.map +1 -0
  58. package/dist/awaiting-overlay.d.ts +13 -26
  59. package/dist/awaiting-overlay.d.ts.map +1 -1
  60. package/dist/awaiting-overlay.js +7 -40
  61. package/dist/awaiting-overlay.js.map +1 -1
  62. package/dist/bridge-core.d.ts +15 -0
  63. package/dist/bridge-core.d.ts.map +1 -1
  64. package/dist/bridge-core.js +30 -4
  65. package/dist/bridge-core.js.map +1 -1
  66. package/dist/claude-permission-rules.d.ts +20 -32
  67. package/dist/claude-permission-rules.d.ts.map +1 -1
  68. package/dist/claude-permission-rules.js +19 -102
  69. package/dist/claude-permission-rules.js.map +1 -1
  70. package/dist/claude-usage-recovery.d.ts +54 -0
  71. package/dist/claude-usage-recovery.d.ts.map +1 -0
  72. package/dist/claude-usage-recovery.js +200 -0
  73. package/dist/claude-usage-recovery.js.map +1 -0
  74. package/dist/cli.d.ts +11 -0
  75. package/dist/cli.d.ts.map +1 -1
  76. package/dist/cli.js +81 -14
  77. package/dist/cli.js.map +1 -1
  78. package/dist/codex-rate-limits-live.d.ts +180 -10
  79. package/dist/codex-rate-limits-live.d.ts.map +1 -1
  80. package/dist/codex-rate-limits-live.js +475 -22
  81. package/dist/codex-rate-limits-live.js.map +1 -1
  82. package/dist/codex-rollout-response.d.ts +43 -0
  83. package/dist/codex-rollout-response.d.ts.map +1 -1
  84. package/dist/codex-rollout-response.js +67 -0
  85. package/dist/codex-rollout-response.js.map +1 -1
  86. package/dist/coordination-evidence.d.ts +150 -0
  87. package/dist/coordination-evidence.d.ts.map +1 -0
  88. package/dist/coordination-evidence.js +455 -0
  89. package/dist/coordination-evidence.js.map +1 -0
  90. package/dist/daemon-server.d.ts.map +1 -1
  91. package/dist/daemon-server.js +592 -35
  92. package/dist/daemon-server.js.map +1 -1
  93. package/dist/daemon-ws-client.d.ts +1 -0
  94. package/dist/daemon-ws-client.d.ts.map +1 -1
  95. package/dist/daemon-ws-client.js +25 -16
  96. package/dist/daemon-ws-client.js.map +1 -1
  97. package/dist/daemon.js +1 -1
  98. package/dist/deferred-reply-read.d.ts +24 -0
  99. package/dist/deferred-reply-read.d.ts.map +1 -0
  100. package/dist/deferred-reply-read.js +42 -0
  101. package/dist/deferred-reply-read.js.map +1 -0
  102. package/dist/esp32-serial.d.ts +15 -0
  103. package/dist/esp32-serial.d.ts.map +1 -1
  104. package/dist/esp32-serial.js +61 -2
  105. package/dist/esp32-serial.js.map +1 -1
  106. package/dist/font-pack.d.ts +15 -0
  107. package/dist/font-pack.d.ts.map +1 -0
  108. package/dist/font-pack.js +75 -0
  109. package/dist/font-pack.js.map +1 -0
  110. package/dist/glance-frame.d.ts.map +1 -1
  111. package/dist/glance-frame.js +2 -0
  112. package/dist/glance-frame.js.map +1 -1
  113. package/dist/hook-codex-sessions.d.ts +9 -0
  114. package/dist/hook-codex-sessions.d.ts.map +1 -1
  115. package/dist/hook-codex-sessions.js +35 -2
  116. package/dist/hook-codex-sessions.js.map +1 -1
  117. package/dist/hook-opencode-sessions.d.ts +62 -0
  118. package/dist/hook-opencode-sessions.d.ts.map +1 -0
  119. package/dist/hook-opencode-sessions.js +180 -0
  120. package/dist/hook-opencode-sessions.js.map +1 -0
  121. package/dist/hook-response-source.d.ts +40 -0
  122. package/dist/hook-response-source.d.ts.map +1 -0
  123. package/dist/hook-response-source.js +31 -0
  124. package/dist/hook-response-source.js.map +1 -0
  125. package/dist/http-auth-gate.d.ts.map +1 -1
  126. package/dist/http-auth-gate.js +9 -1
  127. package/dist/http-auth-gate.js.map +1 -1
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +6 -3
  130. package/dist/index.js.map +1 -1
  131. package/dist/learning-pack.d.ts +24 -0
  132. package/dist/learning-pack.d.ts.map +1 -0
  133. package/dist/learning-pack.js +125 -0
  134. package/dist/learning-pack.js.map +1 -0
  135. package/dist/mdns.js +1 -1
  136. package/dist/mdns.js.map +1 -1
  137. package/dist/native-dependency-diagnostics.d.ts +29 -0
  138. package/dist/native-dependency-diagnostics.d.ts.map +1 -0
  139. package/dist/native-dependency-diagnostics.js +95 -0
  140. package/dist/native-dependency-diagnostics.js.map +1 -0
  141. package/dist/observed-steering.d.ts +4 -4
  142. package/dist/observed-steering.d.ts.map +1 -1
  143. package/dist/observed-steering.js +28 -32
  144. package/dist/observed-steering.js.map +1 -1
  145. package/dist/openclaw-gateway-stability.d.ts +94 -0
  146. package/dist/openclaw-gateway-stability.d.ts.map +1 -0
  147. package/dist/openclaw-gateway-stability.js +176 -0
  148. package/dist/openclaw-gateway-stability.js.map +1 -0
  149. package/dist/pairing-knocks.d.ts +80 -0
  150. package/dist/pairing-knocks.d.ts.map +1 -0
  151. package/dist/pairing-knocks.js +312 -0
  152. package/dist/pairing-knocks.js.map +1 -0
  153. package/dist/passive-observer.d.ts +5 -0
  154. package/dist/passive-observer.d.ts.map +1 -1
  155. package/dist/passive-observer.js +6 -0
  156. package/dist/passive-observer.js.map +1 -1
  157. package/dist/pixoo/micro-glyphs.d.ts +4 -0
  158. package/dist/pixoo/micro-glyphs.d.ts.map +1 -1
  159. package/dist/pixoo/micro-glyphs.js +29 -0
  160. package/dist/pixoo/micro-glyphs.js.map +1 -1
  161. package/dist/pixoo/pixoo-font.d.ts.map +1 -1
  162. package/dist/pixoo/pixoo-font.js +3 -1
  163. package/dist/pixoo/pixoo-font.js.map +1 -1
  164. package/dist/pixoo/pixoo-renderer.d.ts +1 -1
  165. package/dist/pixoo/pixoo-renderer.d.ts.map +1 -1
  166. package/dist/pixoo/pixoo-renderer.js +17 -2
  167. package/dist/pixoo/pixoo-renderer.js.map +1 -1
  168. package/dist/pty-manager.d.ts +9 -0
  169. package/dist/pty-manager.d.ts.map +1 -1
  170. package/dist/pty-manager.js +63 -4
  171. package/dist/pty-manager.js.map +1 -1
  172. package/dist/relayed-usage.d.ts +30 -0
  173. package/dist/relayed-usage.d.ts.map +1 -1
  174. package/dist/relayed-usage.js +25 -2
  175. package/dist/relayed-usage.js.map +1 -1
  176. package/dist/review-runner.js +1 -1
  177. package/dist/subagent-timeline.d.ts +27 -0
  178. package/dist/subagent-timeline.d.ts.map +1 -1
  179. package/dist/subagent-timeline.js +52 -5
  180. package/dist/subagent-timeline.js.map +1 -1
  181. package/dist/surface-protocol.d.ts.map +1 -1
  182. package/dist/surface-protocol.js +2 -0
  183. package/dist/surface-protocol.js.map +1 -1
  184. package/dist/tui/dashboard.d.ts.map +1 -1
  185. package/dist/tui/dashboard.js +8 -1
  186. package/dist/tui/dashboard.js.map +1 -1
  187. package/dist/usage-api.d.ts +3 -0
  188. package/dist/usage-api.d.ts.map +1 -1
  189. package/dist/usage-api.js +101 -36
  190. package/dist/usage-api.js.map +1 -1
  191. package/dist/usage-event.d.ts.map +1 -1
  192. package/dist/usage-event.js +2 -1
  193. package/dist/usage-event.js.map +1 -1
  194. package/dist/ws-server.d.ts +18 -0
  195. package/dist/ws-server.d.ts.map +1 -1
  196. package/dist/ws-server.js +40 -2
  197. package/dist/ws-server.js.map +1 -1
  198. package/package.json +6 -5
  199. package/src/timebox/sync_ble.py +35 -16
@@ -50,6 +50,49 @@ export interface CodexTurnOutcome {
50
50
  * that never produced any.
51
51
  */
52
52
  export declare function codexTurnOutcomeFromRollout(sessionId: string, sessionsRoot?: string): CodexTurnOutcome;
53
+ /**
54
+ * Same read, from a path the caller already holds. Codex's own hooks carry
55
+ * `transcript_path`, and for Codex that path IS the rollout — so the daemon
56
+ * need not locate it by id. (It used to hand that path to the CLAUDE
57
+ * transcript reader instead, which returned '' for every Codex turn: 3 of
58
+ * 128 codex stop-turns in a week held a response, measured 2026-09-03.)
59
+ */
60
+ export declare function codexTurnOutcomeFromRolloutPath(path: string): CodexTurnOutcome;
61
+ /** What the rollout proves about a turn that opened at or after `sinceMs`. */
62
+ export interface CodexTurnCompletion {
63
+ /** Rollout record timestamp of the `task_complete`, epoch ms. */
64
+ completedAt: number;
65
+ /** `last_agent_message` of that record, empty when Codex wrote none. */
66
+ text: string;
67
+ /** The failure Codex wrote on that record, when the turn ended in one
68
+ * (an API 404, a usage limit). Such a turn fires no Stop hook at all —
69
+ * measured 2026-09-03, six consecutive turns against a dead endpoint all
70
+ * reached the next prompt open and read as dropped hooks. */
71
+ error?: string;
72
+ /** Codex's own classification of that failure, e.g. `usage_limit_exceeded`. */
73
+ errorKind?: string;
74
+ }
75
+ /**
76
+ * Did the turn that started at or after `sinceMs` COMPLETE, per the rollout?
77
+ *
78
+ * The rollout is Codex's own record of the turn, written by the process that
79
+ * ran it, so it can answer a question no hook can: whether a turn whose Stop
80
+ * never reached this daemon nevertheless finished. The daemon needs that
81
+ * answer exactly once — at startup, for a turn it finds still open in the
82
+ * store. Measured 2026-09-03: of 52 turns the reaper had closed under an open
83
+ * state, 45 straddled a daemon restart, and the rollouts behind them held a
84
+ * `task_complete` for every one; the Stop had been posted to a port nobody
85
+ * was listening on.
86
+ *
87
+ * Reads the tail newest-first and stops at the first record older than
88
+ * `sinceMs` (records carry their own ISO `timestamp`), so a completion
89
+ * belonging to an EARLIER turn can never be returned for this one — the same
90
+ * discipline as the Claude transcript probe. A `task_started` newer than the
91
+ * completion means a further turn opened after it; the completion still
92
+ * stands for the turn asked about. Never throws; null means "no evidence",
93
+ * which callers must not resolve as a verdict.
94
+ */
95
+ export declare function codexTurnCompletionSince(sessionId: string, sinceMs: number, sessionsRoot?: string): CodexTurnCompletion | null;
53
96
  /**
54
97
  * Back-compat shim: the turn's reply text only.
55
98
  * Prefer `codexTurnOutcomeFromRollout`, which also reports failures.
@@ -1 +1 @@
1
- {"version":3,"file":"codex-rollout-response.d.ts","sourceRoot":"","sources":["../src/codex-rollout-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA0BH,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB1F;AAuBD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAqDtG;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjG"}
1
+ {"version":3,"file":"codex-rollout-response.d.ts","sourceRoot":"","sources":["../src/codex-rollout-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA0BH,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB1F;AAuBD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAItG;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAmD9E;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb;;;kEAG8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CA6B9H;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjG"}
@@ -120,6 +120,16 @@ export function codexTurnOutcomeFromRollout(sessionId, sessionsRoot) {
120
120
  const path = locateCodexRollout(sessionId, sessionsRoot);
121
121
  if (!path)
122
122
  return { text: '' };
123
+ return codexTurnOutcomeFromRolloutPath(path);
124
+ }
125
+ /**
126
+ * Same read, from a path the caller already holds. Codex's own hooks carry
127
+ * `transcript_path`, and for Codex that path IS the rollout — so the daemon
128
+ * need not locate it by id. (It used to hand that path to the CLAUDE
129
+ * transcript reader instead, which returned '' for every Codex turn: 3 of
130
+ * 128 codex stop-turns in a week held a response, measured 2026-09-03.)
131
+ */
132
+ export function codexTurnOutcomeFromRolloutPath(path) {
123
133
  const lines = readTail(path, TAIL_BYTES).split('\n');
124
134
  let text = '';
125
135
  let error;
@@ -173,6 +183,63 @@ export function codexTurnOutcomeFromRollout(sessionId, sessionsRoot) {
173
183
  debug('codex-rollout', `no agent_message or error in tail of ${path}`);
174
184
  return { text, error, errorKind };
175
185
  }
186
+ /**
187
+ * Did the turn that started at or after `sinceMs` COMPLETE, per the rollout?
188
+ *
189
+ * The rollout is Codex's own record of the turn, written by the process that
190
+ * ran it, so it can answer a question no hook can: whether a turn whose Stop
191
+ * never reached this daemon nevertheless finished. The daemon needs that
192
+ * answer exactly once — at startup, for a turn it finds still open in the
193
+ * store. Measured 2026-09-03: of 52 turns the reaper had closed under an open
194
+ * state, 45 straddled a daemon restart, and the rollouts behind them held a
195
+ * `task_complete` for every one; the Stop had been posted to a port nobody
196
+ * was listening on.
197
+ *
198
+ * Reads the tail newest-first and stops at the first record older than
199
+ * `sinceMs` (records carry their own ISO `timestamp`), so a completion
200
+ * belonging to an EARLIER turn can never be returned for this one — the same
201
+ * discipline as the Claude transcript probe. A `task_started` newer than the
202
+ * completion means a further turn opened after it; the completion still
203
+ * stands for the turn asked about. Never throws; null means "no evidence",
204
+ * which callers must not resolve as a verdict.
205
+ */
206
+ export function codexTurnCompletionSince(sessionId, sinceMs, sessionsRoot) {
207
+ const path = locateCodexRollout(sessionId, sessionsRoot);
208
+ if (!path)
209
+ return null;
210
+ const lines = readTail(path, TAIL_BYTES).split('\n');
211
+ for (let i = lines.length - 1; i >= 0; i--) {
212
+ const line = lines[i].trim();
213
+ if (!line)
214
+ continue;
215
+ let record;
216
+ try {
217
+ record = JSON.parse(line);
218
+ }
219
+ catch {
220
+ continue; // torn first line of the tail window
221
+ }
222
+ const ts = typeof record.timestamp === 'string' ? Date.parse(record.timestamp) : NaN;
223
+ // A record older than the turn: everything above it is older still.
224
+ if (Number.isFinite(ts) && ts < sinceMs)
225
+ return null;
226
+ if (record.type !== 'event_msg')
227
+ continue;
228
+ const payload = record.payload;
229
+ if (!payload || typeof payload !== 'object' || payload.type !== 'task_complete')
230
+ continue;
231
+ if (!Number.isFinite(ts))
232
+ continue; // a completion with no time cannot be placed
233
+ const text = typeof payload.last_agent_message === 'string' ? payload.last_agent_message.trim() : '';
234
+ const failure = payload.error;
235
+ const error = failure && typeof failure === 'object' ? cleanErrorText(failure.message) : undefined;
236
+ const errorKind = failure && typeof failure === 'object' && typeof failure.codex_error_info === 'string'
237
+ ? failure.codex_error_info
238
+ : undefined;
239
+ return { completedAt: ts, text, ...(error ? { error } : {}), ...(errorKind ? { errorKind } : {}) };
240
+ }
241
+ return null;
242
+ }
176
243
  /**
177
244
  * Back-compat shim: the turn's reply text only.
178
245
  * Prefer `codexTurnOutcomeFromRollout`, which also reports failures.
@@ -1 +1 @@
1
- {"version":3,"file":"codex-rollout-response.js","sourceRoot":"","sources":["../src/codex-rollout-response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,oDAAoD;AACpD,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,yEAAyE;AACzE,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,CAAC;AAE9B,SAAS,WAAW,CAAC,KAAe;IAClC,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC9B,IAAI,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O,OAAO,CAAC,gBAAgB,KAAK,QAAQ;YACtG,CAAC,CAAC,OAAO,CAAC,gBAAgB;YAC1B,CAAC,CAAC,SAAS,CAAC;QACd,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACrG,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAAC,SAAiB,EAAE,YAAqB;IACvF,OAAO,2BAA2B,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC;AACnE,CAAC"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Cross-session coordination evidence.
3
+ *
4
+ * A harness divides work in more ways than `SubagentStart`. Measured on
5
+ * 2026-09-06 while a user asked why their epoch-of-tech creatures "looked
6
+ * idle": the parent had closed its turn ("waiting for the matrix"), six
7
+ * `claude -p --model glm-5.3` workers it launched from a background Bash had
8
+ * each become a separate observed session with no link back, twelve
9
+ * `SendMessage` calls had crossed between it and a sibling, and a 22-minute
10
+ * `run_bot_matrix.sh` it would be re-invoked by was still running under
11
+ * launchd with the parent's scratchpad path in its argv. Every surface showed
12
+ * `idle`, and the collaboration lens drew one Explore branch.
13
+ *
14
+ * Each of those facts is OBSERVABLE without guessing, and this module turns
15
+ * them into `RelationEvent`s plus a per-session `CoordinationSummary`:
16
+ *
17
+ * - `spawned` — a peer session whose process is a descendant of this
18
+ * session's process (`process_ancestry`), or the intent to spawn one
19
+ * seen on a Bash tool call (`bash_claude_p`) before the child exists.
20
+ * - `messaged` — the sender's `SendMessage` tool input (`send_message_tool`)
21
+ * and the receiver's `<cross-session-message from="uds:…/<pid>.sock"
22
+ * from-name="…">` envelope (`cross_session_message`). The sender pid in
23
+ * the envelope resolves to a session through the process table.
24
+ * - `waiting_on` — a process (not itself an agent session) whose argv names
25
+ * this session's scratchpad directory (`background_process`), i.e. a
26
+ * `run_in_background` job the harness will re-invoke the session for.
27
+ *
28
+ * What it deliberately does not do: link two sessions because they share a
29
+ * project, or read a "worker" out of prose. A relation whose peer cannot be
30
+ * resolved carries only the name/pid the evidence itself had.
31
+ */
32
+ export interface RelationObservation {
33
+ sessionId: string;
34
+ relation: 'spawned' | 'messaged' | 'waiting_on';
35
+ direction: 'in' | 'out';
36
+ phase: 'open' | 'closed';
37
+ peerSessionId?: string | null;
38
+ peerName?: string | null;
39
+ evidence: string;
40
+ detail?: string | null;
41
+ ts: number;
42
+ key: string;
43
+ }
44
+ export interface CoordinationSummaryLike {
45
+ backgroundJobs: number;
46
+ spawnedActive: number;
47
+ spawnedCompleted: number;
48
+ messagesIn: number;
49
+ messagesOut: number;
50
+ lastPeerName?: string;
51
+ lastRelationAt?: number;
52
+ }
53
+ export interface ProcessRow {
54
+ pid: number;
55
+ ppid: number;
56
+ command: string;
57
+ }
58
+ export interface ObservedPeer {
59
+ /** Bare session id (uuid), never the `observed:<agent>:` form. */
60
+ sessionId: string;
61
+ pid: number;
62
+ }
63
+ /** What a receiver sees at the top of a cross-session prompt. Captured live
64
+ * from Claude Code 2.1.261 — the attribute order and the `uds:` socket path
65
+ * (whose basename is the SENDER's pid) are the real shape. */
66
+ export interface CrossSessionEnvelope {
67
+ fromPid: number | null;
68
+ fromName: string | null;
69
+ fromMode: string | null;
70
+ /** The message body after the harness preamble, capped. */
71
+ body: string;
72
+ }
73
+ /** Parse a received prompt for the cross-session envelope; null when the
74
+ * prompt is an ordinary user turn. */
75
+ export declare function parseCrossSessionEnvelope(prompt: string): CrossSessionEnvelope | null;
76
+ export interface SendMessageTarget {
77
+ peerName: string | null;
78
+ peerPid: number | null;
79
+ summary: string | null;
80
+ }
81
+ /** The `to` of a Claude Code `SendMessage` tool call: either a session name
82
+ * or a `uds:/…/<pid>.sock` address. */
83
+ export declare function parseSendMessageInput(input: unknown): SendMessageTarget | null;
84
+ /** A Bash command that launches a headless agent worker. Only the spellings
85
+ * we have measured: `claude -p` / `claude --print`. */
86
+ export declare function isAgentSpawnCommand(command: unknown): boolean;
87
+ /** The interactive/headless agent binaries a session runs as. Used to stop
88
+ * the hook-pid walk and to keep an agent's own descendants out of the
89
+ * background-job set. */
90
+ export declare function isAgentProcessCommand(command: string): boolean;
91
+ /** Scratchpad directory Claude Code hands a session (the `SP=` every
92
+ * background job in the measured transcript inherited). The session id is
93
+ * the last path segment before `/scratchpad`. */
94
+ export declare function commandNamesSession(command: string, sessionId: string): boolean;
95
+ export declare function commandLabel(command: string): string;
96
+ /** Walk the parent chain from `pid` (exclusive) up to `maxDepth` levels and
97
+ * return the first ancestor that is an observed peer session. */
98
+ export declare function findAncestorSession(processes: ProcessRow[], pid: number, peers: ObservedPeer[], maxDepth?: number): ObservedPeer | null;
99
+ /**
100
+ * Per-session reducer. Two inputs — hook facts (`noteMessageOut`,
101
+ * `noteMessageIn`, `noteToolCall`) and the periodic process table
102
+ * (`observe`) — and two outputs: `RelationObservation`s to persist on the
103
+ * session's APME task, and `summary()` for the `sessions_list` wire. The
104
+ * summary is kept here rather than derived from the rows it emits, for the
105
+ * same reason the subagent census is (the rows are lossy on purpose).
106
+ */
107
+ export declare class CoordinationTracker {
108
+ private readonly now;
109
+ private readonly sessions;
110
+ /** Session names learned from envelopes: name → sender session id. */
111
+ private readonly nameToSession;
112
+ private readonly sessionToName;
113
+ /** Latest pid → session map from the observer, for uds resolution. */
114
+ private pidToSession;
115
+ /** Session → agent pid learned from the hook header (`X-AgentDeck-Pid`),
116
+ * the path a sandboxed daemon has no file-based alternative to. */
117
+ private readonly hookPids;
118
+ constructor(now?: () => number);
119
+ private entry;
120
+ private touch;
121
+ /** A hook arrived with the posting shell's parent pid. The shell's parent
122
+ * is normally the agent process itself; if a wrapper sits in between, walk
123
+ * up to the nearest agent process so the registered pid is the one whose
124
+ * children are the session's workers. */
125
+ registerPid(sessionId: string, pid: number, processes?: ProcessRow[]): void;
126
+ /** Observer peers plus hook-registered pids for sessions the observer did
127
+ * not resolve (a session whose `sessions/<pid>.json` is unreadable, or the
128
+ * whole roster on a daemon with no file access). The observer's pid wins
129
+ * when both exist. */
130
+ mergePeers(observed: ObservedPeer[]): ObservedPeer[];
131
+ /** The receiver's side of a message: the prompt carried the envelope. */
132
+ noteMessageIn(sessionId: string, prompt: string): RelationObservation | null;
133
+ /** A tool call the session made: SendMessage → `messaged` out; a Bash that
134
+ * launches `claude -p` → a `spawned` intent (open, peer unknown yet). */
135
+ noteToolCall(sessionId: string, toolName: unknown, toolInput: unknown): RelationObservation | null;
136
+ /**
137
+ * Reconcile against the process table. `peers` are the observed agent
138
+ * sessions with their pids (bare ids). Emits: `spawned` open on the parent
139
+ * when a peer's ancestry reaches another peer, `spawned` closed when such a
140
+ * child's process is gone, `waiting_on` open/closed for background jobs.
141
+ */
142
+ observe(processes: ProcessRow[], peers: ObservedPeer[]): RelationObservation[];
143
+ /** The session ended: its jobs and children are no longer its concern. */
144
+ forget(sessionId: string): void;
145
+ /** `null` when the session has never had a relation — the caller omits the
146
+ * wire field; once it has, zeros are emitted explicitly. */
147
+ summary(sessionId: string): CoordinationSummaryLike | null;
148
+ summaries(): Map<string, CoordinationSummaryLike>;
149
+ }
150
+ //# sourceMappingURL=coordination-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordination-evidence.d.ts","sourceRoot":"","sources":["../src/coordination-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;IAChD,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;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