@agentdeck/bridge 1.0.24 → 1.2.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.
Files changed (184) 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/adapters/openclaw.d.ts +74 -4
  11. package/dist/adapters/openclaw.d.ts.map +1 -1
  12. package/dist/adapters/openclaw.js +235 -43
  13. package/dist/adapters/openclaw.js.map +1 -1
  14. package/dist/agent-cli-diagnostics.d.ts +20 -0
  15. package/dist/agent-cli-diagnostics.d.ts.map +1 -0
  16. package/dist/agent-cli-diagnostics.js +100 -0
  17. package/dist/agent-cli-diagnostics.js.map +1 -0
  18. package/dist/apme/adapters/openclaw-hook.d.ts +38 -10
  19. package/dist/apme/adapters/openclaw-hook.d.ts.map +1 -1
  20. package/dist/apme/adapters/openclaw-hook.js +181 -37
  21. package/dist/apme/adapters/openclaw-hook.js.map +1 -1
  22. package/dist/apme/collector.d.ts +55 -2
  23. package/dist/apme/collector.d.ts.map +1 -1
  24. package/dist/apme/collector.js +324 -37
  25. package/dist/apme/collector.js.map +1 -1
  26. package/dist/apme/dashboard-html.d.ts.map +1 -1
  27. package/dist/apme/dashboard-html.js +275 -35
  28. package/dist/apme/dashboard-html.js.map +1 -1
  29. package/dist/apme/http.d.ts.map +1 -1
  30. package/dist/apme/http.js +33 -5
  31. package/dist/apme/http.js.map +1 -1
  32. package/dist/apme/index.d.ts.map +1 -1
  33. package/dist/apme/index.js +6 -2
  34. package/dist/apme/index.js.map +1 -1
  35. package/dist/apme/pareto.d.ts +2 -1
  36. package/dist/apme/pareto.d.ts.map +1 -1
  37. package/dist/apme/pareto.js +15 -4
  38. package/dist/apme/pareto.js.map +1 -1
  39. package/dist/apme/recommend.d.ts +24 -1
  40. package/dist/apme/recommend.d.ts.map +1 -1
  41. package/dist/apme/recommend.js +43 -7
  42. package/dist/apme/recommend.js.map +1 -1
  43. package/dist/apme/store.d.ts +47 -1
  44. package/dist/apme/store.d.ts.map +1 -1
  45. package/dist/apme/store.js +397 -99
  46. package/dist/apme/store.js.map +1 -1
  47. package/dist/bridge-core.d.ts +25 -1
  48. package/dist/bridge-core.d.ts.map +1 -1
  49. package/dist/bridge-core.js +50 -9
  50. package/dist/bridge-core.js.map +1 -1
  51. package/dist/card-feed.d.ts +46 -1
  52. package/dist/card-feed.d.ts.map +1 -1
  53. package/dist/card-feed.js +166 -6
  54. package/dist/card-feed.js.map +1 -1
  55. package/dist/cli.d.ts +56 -0
  56. package/dist/cli.d.ts.map +1 -1
  57. package/dist/cli.js +442 -34
  58. package/dist/cli.js.map +1 -1
  59. package/dist/codex-rate-limits-live.d.ts +180 -10
  60. package/dist/codex-rate-limits-live.d.ts.map +1 -1
  61. package/dist/codex-rate-limits-live.js +475 -22
  62. package/dist/codex-rate-limits-live.js.map +1 -1
  63. package/dist/daemon-build-identity.d.ts +124 -0
  64. package/dist/daemon-build-identity.d.ts.map +1 -0
  65. package/dist/daemon-build-identity.js +310 -0
  66. package/dist/daemon-build-identity.js.map +1 -0
  67. package/dist/daemon-server.d.ts +34 -6
  68. package/dist/daemon-server.d.ts.map +1 -1
  69. package/dist/daemon-server.js +876 -109
  70. package/dist/daemon-server.js.map +1 -1
  71. package/dist/daemon-takeover.d.ts +11 -0
  72. package/dist/daemon-takeover.d.ts.map +1 -1
  73. package/dist/daemon-takeover.js +62 -17
  74. package/dist/daemon-takeover.js.map +1 -1
  75. package/dist/daemon-ws-client.d.ts +1 -0
  76. package/dist/daemon-ws-client.d.ts.map +1 -1
  77. package/dist/daemon-ws-client.js +25 -16
  78. package/dist/daemon-ws-client.js.map +1 -1
  79. package/dist/daemon.js +1 -1
  80. package/dist/daemon.js.map +1 -1
  81. package/dist/esp32-serial.d.ts +18 -0
  82. package/dist/esp32-serial.d.ts.map +1 -1
  83. package/dist/esp32-serial.js +23 -1
  84. package/dist/esp32-serial.js.map +1 -1
  85. package/dist/font-pack.d.ts +15 -0
  86. package/dist/font-pack.d.ts.map +1 -0
  87. package/dist/font-pack.js +75 -0
  88. package/dist/font-pack.js.map +1 -0
  89. package/dist/glance-frame.d.ts.map +1 -1
  90. package/dist/glance-frame.js +5 -1
  91. package/dist/glance-frame.js.map +1 -1
  92. package/dist/hook-codex-sessions.d.ts +3 -1
  93. package/dist/hook-codex-sessions.d.ts.map +1 -1
  94. package/dist/hook-codex-sessions.js +27 -7
  95. package/dist/hook-codex-sessions.js.map +1 -1
  96. package/dist/http-auth-gate.d.ts.map +1 -1
  97. package/dist/http-auth-gate.js +9 -1
  98. package/dist/http-auth-gate.js.map +1 -1
  99. package/dist/index.js +2 -2
  100. package/dist/index.js.map +1 -1
  101. package/dist/learning-pack.d.ts +24 -0
  102. package/dist/learning-pack.d.ts.map +1 -0
  103. package/dist/learning-pack.js +125 -0
  104. package/dist/learning-pack.js.map +1 -0
  105. package/dist/legacy-rearm-ledger.d.ts +56 -0
  106. package/dist/legacy-rearm-ledger.d.ts.map +1 -0
  107. package/dist/legacy-rearm-ledger.js +66 -0
  108. package/dist/legacy-rearm-ledger.js.map +1 -0
  109. package/dist/mdns.d.ts +33 -0
  110. package/dist/mdns.d.ts.map +1 -1
  111. package/dist/mdns.js +92 -3
  112. package/dist/mdns.js.map +1 -1
  113. package/dist/openclaw-session.d.ts.map +1 -1
  114. package/dist/openclaw-session.js +13 -0
  115. package/dist/openclaw-session.js.map +1 -1
  116. package/dist/openclaw-timeline-feed.d.ts +84 -0
  117. package/dist/openclaw-timeline-feed.d.ts.map +1 -0
  118. package/dist/openclaw-timeline-feed.js +162 -0
  119. package/dist/openclaw-timeline-feed.js.map +1 -0
  120. package/dist/openclaw-transcript-timeline.d.ts +103 -0
  121. package/dist/openclaw-transcript-timeline.d.ts.map +1 -0
  122. package/dist/openclaw-transcript-timeline.js +328 -0
  123. package/dist/openclaw-transcript-timeline.js.map +1 -0
  124. package/dist/pairing-knocks.d.ts +80 -0
  125. package/dist/pairing-knocks.d.ts.map +1 -0
  126. package/dist/pairing-knocks.js +312 -0
  127. package/dist/pairing-knocks.js.map +1 -0
  128. package/dist/passive-observer.d.ts +21 -1
  129. package/dist/passive-observer.d.ts.map +1 -1
  130. package/dist/passive-observer.js +37 -3
  131. package/dist/passive-observer.js.map +1 -1
  132. package/dist/pixoo/micro-glyphs.d.ts +4 -0
  133. package/dist/pixoo/micro-glyphs.d.ts.map +1 -1
  134. package/dist/pixoo/micro-glyphs.js +29 -0
  135. package/dist/pixoo/micro-glyphs.js.map +1 -1
  136. package/dist/pixoo/pixoo-font.d.ts.map +1 -1
  137. package/dist/pixoo/pixoo-font.js +3 -1
  138. package/dist/pixoo/pixoo-font.js.map +1 -1
  139. package/dist/pixoo/pixoo-renderer.d.ts +1 -1
  140. package/dist/pixoo/pixoo-renderer.d.ts.map +1 -1
  141. package/dist/pixoo/pixoo-renderer.js +17 -2
  142. package/dist/pixoo/pixoo-renderer.js.map +1 -1
  143. package/dist/pty-manager.d.ts +9 -0
  144. package/dist/pty-manager.d.ts.map +1 -1
  145. package/dist/pty-manager.js +63 -4
  146. package/dist/pty-manager.js.map +1 -1
  147. package/dist/relayed-usage.d.ts +98 -0
  148. package/dist/relayed-usage.d.ts.map +1 -0
  149. package/dist/relayed-usage.js +103 -0
  150. package/dist/relayed-usage.js.map +1 -0
  151. package/dist/session-aggregator.d.ts +3 -0
  152. package/dist/session-aggregator.d.ts.map +1 -1
  153. package/dist/session-aggregator.js.map +1 -1
  154. package/dist/session-registry.d.ts +1 -0
  155. package/dist/session-registry.d.ts.map +1 -1
  156. package/dist/surface-protocol.d.ts +84 -0
  157. package/dist/surface-protocol.d.ts.map +1 -0
  158. package/dist/surface-protocol.js +237 -0
  159. package/dist/surface-protocol.js.map +1 -0
  160. package/dist/timeline-store.d.ts +1 -1
  161. package/dist/timeline-store.d.ts.map +1 -1
  162. package/dist/timeline-store.js +16 -1
  163. package/dist/timeline-store.js.map +1 -1
  164. package/dist/tui/dashboard.d.ts.map +1 -1
  165. package/dist/tui/dashboard.js +8 -1
  166. package/dist/tui/dashboard.js.map +1 -1
  167. package/dist/tui/renderer.d.ts.map +1 -1
  168. package/dist/tui/renderer.js +35 -0
  169. package/dist/tui/renderer.js.map +1 -1
  170. package/dist/weather-config.d.ts +17 -0
  171. package/dist/weather-config.d.ts.map +1 -0
  172. package/dist/weather-config.js +54 -0
  173. package/dist/weather-config.js.map +1 -0
  174. package/dist/weather.d.ts +44 -4
  175. package/dist/weather.d.ts.map +1 -1
  176. package/dist/weather.js +223 -15
  177. package/dist/weather.js.map +1 -1
  178. package/dist/ws-server.d.ts +18 -0
  179. package/dist/ws-server.d.ts.map +1 -1
  180. package/dist/ws-server.js +95 -7
  181. package/dist/ws-server.js.map +1 -1
  182. package/fm-helper/AgentDeckFMHelper.swift +51 -5
  183. package/package.json +4 -3
  184. package/src/timebox/sync_ble.py +35 -16
package/dist/mdns.d.ts CHANGED
@@ -1,4 +1,37 @@
1
1
  import type { AgentType } from './types.js';
2
+ /**
3
+ * True when a LAN peer could actually route to this IPv4 address.
4
+ *
5
+ * `bonjour-service` publishes one A record per non-internal IPv4 address it
6
+ * finds, with no routability test (`service.js` -> `records()`). That set is
7
+ * captured at PUBLISH time, and the daemon publishes seconds after start — so a
8
+ * machine whose second interface is still negotiating DHCP advertises its
9
+ * transient `169.254/16` APIPA address as a way to reach the daemon. Nothing
10
+ * ever retracts it: the address disappears from `os.networkInterfaces()`, so no
11
+ * later announcement carries it and no goodbye is ever sent for it, while every
12
+ * resolver that heard it keeps handing it out.
13
+ *
14
+ * Measured on this repo's own fleet (2026-08-23): the advertised host resolved
15
+ * to `192.168.68.100`, `192.168.68.60` AND `169.254.213.161` while no interface
16
+ * on the machine held that third address. A board that picks it dials a dead
17
+ * address at max backoff forever, and — because it never reaches the daemon —
18
+ * leaves no trace in the daemon's log at all. That is the failure mode this
19
+ * predicate exists to prevent, and the reason the filter belongs on the
20
+ * PUBLISHING side: a client cannot tell a stale record from a live one.
21
+ */
22
+ export declare function isRoutableIpv4(addr: string): boolean;
23
+ /**
24
+ * The IPv4 addresses this host would advertise, after the routability filter.
25
+ *
26
+ * This is the value the republish trigger watches. It deliberately returns the
27
+ * whole SET rather than one address: the publisher emits an A record per
28
+ * interface while `getLanIp()` names only the default-route one, so watching
29
+ * `getLanIp()` alone cannot see an address appear or vanish on any OTHER
30
+ * interface — which is exactly how the stale APIPA record above survived for
31
+ * hours with the recovery timer running the whole time. A change detector must
32
+ * watch what actually varies.
33
+ */
34
+ export declare function advertisedIpv4Addresses(): string[];
2
35
  /**
3
36
  * `bonjour-service` defaults SRV/A/AAAA records to `os.hostname()`. On macOS
4
37
  * that makes its user-space responder claim the same `.local` hostname as the
@@ -1 +1 @@
1
- {"version":3,"file":"mdns.d.ts","sourceRoot":"","sources":["../src/mdns.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAc5C;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,QAAwD,CAAC;AAEvF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAcvE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAQ7C;AAKD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,SAAS,GACnB,MAAM,IAAI,CAiJZ"}
1
+ {"version":3,"file":"mdns.d.ts","sourceRoot":"","sources":["../src/mdns.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAU5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAWlD;AAMD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,QAAwD,CAAC;AAEvF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAcvE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAQ7C;AAKD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,SAAS,GACnB,MAAM,IAAI,CA+KZ"}
package/dist/mdns.js CHANGED
@@ -1,8 +1,66 @@
1
1
  import Bonjour from 'bonjour-service';
2
2
  import { randomUUID } from 'node:crypto';
3
- import { hostname, userInfo } from 'node:os';
3
+ import { hostname, networkInterfaces, userInfo } from 'node:os';
4
4
  import { debug, log } from './logger.js';
5
5
  import { getLanIp, buildMdnsInstanceName, mdnsUserTag, sanitizeMdnsLabel, MDNS_TXT_SCHEMA_VERSION, } from '@agentdeck/shared';
6
+ /**
7
+ * True when a LAN peer could actually route to this IPv4 address.
8
+ *
9
+ * `bonjour-service` publishes one A record per non-internal IPv4 address it
10
+ * finds, with no routability test (`service.js` -> `records()`). That set is
11
+ * captured at PUBLISH time, and the daemon publishes seconds after start — so a
12
+ * machine whose second interface is still negotiating DHCP advertises its
13
+ * transient `169.254/16` APIPA address as a way to reach the daemon. Nothing
14
+ * ever retracts it: the address disappears from `os.networkInterfaces()`, so no
15
+ * later announcement carries it and no goodbye is ever sent for it, while every
16
+ * resolver that heard it keeps handing it out.
17
+ *
18
+ * Measured on this repo's own fleet (2026-08-23): the advertised host resolved
19
+ * to `192.168.68.100`, `192.168.68.60` AND `169.254.213.161` while no interface
20
+ * on the machine held that third address. A board that picks it dials a dead
21
+ * address at max backoff forever, and — because it never reaches the daemon —
22
+ * leaves no trace in the daemon's log at all. That is the failure mode this
23
+ * predicate exists to prevent, and the reason the filter belongs on the
24
+ * PUBLISHING side: a client cannot tell a stale record from a live one.
25
+ */
26
+ export function isRoutableIpv4(addr) {
27
+ // Link-local / APIPA. Self-assigned; never reachable from another host.
28
+ if (addr.startsWith('169.254.'))
29
+ return false;
30
+ // Loopback. `internal` already covers 127.0.0.1, but an alias on a
31
+ // non-internal interface would not be caught by that flag.
32
+ if (addr.startsWith('127.'))
33
+ return false;
34
+ if (addr === '0.0.0.0')
35
+ return false;
36
+ return true;
37
+ }
38
+ /**
39
+ * The IPv4 addresses this host would advertise, after the routability filter.
40
+ *
41
+ * This is the value the republish trigger watches. It deliberately returns the
42
+ * whole SET rather than one address: the publisher emits an A record per
43
+ * interface while `getLanIp()` names only the default-route one, so watching
44
+ * `getLanIp()` alone cannot see an address appear or vanish on any OTHER
45
+ * interface — which is exactly how the stale APIPA record above survived for
46
+ * hours with the recovery timer running the whole time. A change detector must
47
+ * watch what actually varies.
48
+ */
49
+ export function advertisedIpv4Addresses() {
50
+ const out = [];
51
+ for (const addrs of Object.values(networkInterfaces())) {
52
+ for (const addr of addrs ?? []) {
53
+ if (addr.family !== 'IPv4')
54
+ continue;
55
+ if (addr.internal || addr.mac === '00:00:00:00:00:00')
56
+ continue;
57
+ if (!isRoutableIpv4(addr.address))
58
+ continue;
59
+ out.push(addr.address);
60
+ }
61
+ }
62
+ return out.sort();
63
+ }
6
64
  let instance = null;
7
65
  const MDNS_RECOVERY_INTERVAL = 5_000; // 5s — tightens WiFi-change discovery gap (was 30s)
8
66
  /**
@@ -128,7 +186,7 @@ export function advertiseBridge(port, projectName, agentType) {
128
186
  project: projectName,
129
187
  agent: agentType,
130
188
  // TXT schema version — keep in lockstep with the Swift daemon's
131
- // advertisement (apple/AgentDeck/Daemon/Modules/MdnsModule.swift) so
189
+ // advertisement (apple/AgentDeck/Daemon/Server/MdnsAdvertisement.swift) so
132
190
  // clients see one contract regardless of which daemon owns the port.
133
191
  v: MDNS_TXT_SCHEMA_VERSION,
134
192
  port: String(port),
@@ -147,6 +205,24 @@ export function advertiseBridge(port, projectName, agentType) {
147
205
  port,
148
206
  txt,
149
207
  });
208
+ // Drop unroutable A records at the source. `records()` is recomputed on
209
+ // every announce AND on the goodbye, so wrapping the instance method
210
+ // covers both: what we never announce, we never have to retract.
211
+ //
212
+ // This is a wrap rather than a config flag because `bonjour-service`
213
+ // offers none — it hard-codes "every non-internal IPv4 address" — and
214
+ // the `interface` option below pins only the SOCKET, not the record set,
215
+ // so even the Windows egress pin ships the bogus addresses inside the
216
+ // packet it sends out the right adapter.
217
+ const svc = service;
218
+ const baseRecords = svc.records?.bind(service);
219
+ if (baseRecords) {
220
+ svc.records = () => baseRecords().filter((r) => {
221
+ if (r.type !== 'A')
222
+ return true;
223
+ return typeof r.data === 'string' && isRoutableIpv4(r.data);
224
+ });
225
+ }
150
226
  // Catch async publish errors — mDNS is non-critical
151
227
  service.on?.('error', (err) => {
152
228
  debug('mDNS', `Service error (ignored): ${err.message}`);
@@ -172,10 +248,16 @@ export function advertiseBridge(port, projectName, agentType) {
172
248
  return false;
173
249
  }
174
250
  }
175
- // Track published IP to detect changes (DHCP renewal, interface switch)
251
+ // Track the published ADDRESS SET, not just the default-route IP. A record
252
+ // per interface goes out, so an address appearing or vanishing on a
253
+ // non-default interface changes what we advertise while `getLanIp()` stays
254
+ // put — and that gap is what let a transient APIPA address stay advertised
255
+ // for hours with this very timer running. See `advertisedIpv4Addresses`.
176
256
  let publishedIp;
257
+ let publishedAddrs = '';
177
258
  function publishAndTrackIp() {
178
259
  publishedIp = getLanIp();
260
+ publishedAddrs = advertisedIpv4Addresses().join(',');
179
261
  return publish();
180
262
  }
181
263
  // Initial publish
@@ -208,6 +290,13 @@ export function advertiseBridge(port, projectName, agentType) {
208
290
  log(`[mDNS] IP changed (${publishedIp} → ${lanIp}) — re-publishing service`);
209
291
  publishAndTrackIp();
210
292
  }
293
+ else {
294
+ const addrs = advertisedIpv4Addresses().join(',');
295
+ if (addrs !== publishedAddrs) {
296
+ log(`[mDNS] Advertised address set changed (${publishedAddrs || 'none'} → ${addrs || 'none'}) — re-publishing service`);
297
+ publishAndTrackIp();
298
+ }
299
+ }
211
300
  }, MDNS_RECOVERY_INTERVAL);
212
301
  return () => {
213
302
  stopped = true;
package/dist/mdns.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdns.js","sourceRoot":"","sources":["../src/mdns.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,IAAI,QAAQ,GAAmB,IAAI,CAAC;AAEpC,MAAM,sBAAsB,GAAG,KAAK,CAAC,CAAC,oDAAoD;AAE1F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,UAAU,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC;AAEvF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mBAAmB,CAAC,G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AC,CAAC;gBACxH,iBAAiB,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAE3B,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAC;QACf,gBAAgB,GAAG,IAAI,CAAC;QACxB,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,aAAa,CAAC,CAAC;YAC7B,aAAa,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,cAAc,EAAE,EAAE,CAAC;QACnB,cAAc,GAAG,IAAI,CAAC;IACxB,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-session.d.ts","sourceRoot":"","sources":["../src/openclaw-session.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,EAAE,EAC3B,IAAI,EAAE,qBAAqB,GAC1B,eAAe,EAAE,CA0BnB"}
1
+ {"version":3,"file":"openclaw-session.d.ts","sourceRoot":"","sources":["../src/openclaw-session.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,EAAE,EAC3B,IAAI,EAAE,qBAAqB,GAC1B,eAAe,EAAE,CAsCnB"}
@@ -37,6 +37,19 @@ export function injectOpenClawSession(sessions, opts) {
37
37
  injected.controlMode = opts.controlMode;
38
38
  if (opts.approval) {
39
39
  injected.question = opts.approval.question;
40
+ // The question is the command; `questionDetail` is everything that makes it
41
+ // a decision — the policy reason approval was demanded, the cwd, and WHICH
42
+ // OpenClaw session asked. All three were parsed and then dropped here, so a
43
+ // deck asked the user to approve a bare `sed -n` with no reason and no way
44
+ // to tell a cron heartbeat apart from a model-eval run (measured
45
+ // 2026-08-23: every approval came from `agent:main:eval-…__r2`, while the
46
+ // row said only "OpenClaw").
47
+ const detailLines = [
48
+ ...(opts.approval.detail ? opts.approval.detail.split('\n') : []),
49
+ ...(opts.approval.sessionKey ? [`session: ${opts.approval.sessionKey}`] : []),
50
+ ].map((l) => l.trim()).filter(Boolean);
51
+ if (detailLines.length > 0)
52
+ injected.questionDetail = detailLines.join('\n');
40
53
  injected.options = opts.approval.options.map((o) => ({
41
54
  index: o.index, label: o.label, shortcut: o.shortcut,
42
55
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-session.js","sourceRoot":"","sources":["../src/openclaw-session.ts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AAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Feeds OpenClaw's own transcript into the daemon's live timeline.
3
+ *
4
+ * The Gateway stream says that OpenClaw answered; it does not say what it did
5
+ * to answer. Only tools that needed approval ever reached the strip, which is a
6
+ * biased sample rather than a log. This is the producer for the rest, read off
7
+ * the store OpenClaw writes anyway (`openclaw-transcript-timeline.ts`).
8
+ *
9
+ * Three bounds, each for a measured reason:
10
+ *
11
+ * - **Only recently-active sessions are read.** The store keeps every session
12
+ * forever — 103 of them on the machine this was built against, most long
13
+ * finished. Sessions are polled by `updatedAt`, newest first, inside
14
+ * `ACTIVE_WINDOW_MS`.
15
+ *
16
+ * - **A first sighting emits NOTHING.** This is the opposite of
17
+ * `KiroTimelineFeed`, deliberately: Kiro seeds the last turn because a Kiro
18
+ * session otherwise shows a live row beside a blank strip, which reads as
19
+ * broken. OpenClaw has no such gap — the Gateway stream is already filling
20
+ * the strip live — so seeding here would only inject minutes-old tool calls
21
+ * from finished eval runs into an activity log, competing with the live
22
+ * rows it is meant to supplement.
23
+ *
24
+ * - **Rows land on the existing `openclaw-gateway` row, not on new sessions.**
25
+ * One OpenClaw instance is one session everywhere else in AgentDeck, the
26
+ * deck is sized for sessions, and an eval suite opens a fresh session key
27
+ * per run — six in the three hours this was measured over. Which session key
28
+ * produced a row rides its `detail` instead, since that is the fact that
29
+ * distinguishes the chat the user is looking at from a cron job and from a
30
+ * model-eval run.
31
+ */
32
+ import type { TimelineEntry } from '@agentdeck/shared';
33
+ import { type OpenClawStoreSession } from './openclaw-transcript-timeline.js';
34
+ /**
35
+ * How often the daemon pumps this feed.
36
+ *
37
+ * Deliberately equal to the passive observer's `SCAN_INTERVAL_MS`: this feed is
38
+ * polled, so an OpenClaw tool call reaches the timeline seconds late rather
39
+ * than instantly, which is the same contract every transcript-observed agent
40
+ * already carries. It is exported so the daemon cannot quietly drift to a
41
+ * cadence nobody measured — the pump is synchronous fs work (~7 ms typical,
42
+ * ~28 ms worst case against a real store).
43
+ */
44
+ export declare const OPENCLAW_FEED_INTERVAL_MS = 5000;
45
+ export type OpenClawRowReader = (sessionId: string, opts: {
46
+ since?: number;
47
+ limit?: number;
48
+ }) => TimelineEntry[];
49
+ export type OpenClawSessionLister = () => OpenClawStoreSession[];
50
+ /**
51
+ * The human-facing half of a session key.
52
+ *
53
+ * `agent:main:eval-full-unified-mlx-2026-08-23-a03__openrouter-stealth-ox-alpha__r2`
54
+ * is what the store holds and it does not fit anywhere. The leading
55
+ * `agent:<agent>:` is constant for a given install and carries nothing, so it
56
+ * is dropped; what remains is the part that says which KIND of work this is.
57
+ */
58
+ export declare function shortSessionKey(sessionKey: string): string;
59
+ export declare class OpenClawTimelineFeed {
60
+ private readonly readRows;
61
+ private readonly listSessions;
62
+ /** sessionId → newest row timestamp already accounted for. */
63
+ private readonly watermark;
64
+ constructor(readRows?: OpenClawRowReader, listSessions?: OpenClawSessionLister);
65
+ /**
66
+ * Rows to emit for this tick, oldest-first across all sessions.
67
+ *
68
+ * `now` is injectable so a test can drive the activity window without a clock.
69
+ */
70
+ pump(now?: number): TimelineEntry[];
71
+ /** Tracked session count — for tests and diagnostics. */
72
+ get size(): number;
73
+ /**
74
+ * Stamp the row with the virtual Gateway session and say which OpenClaw
75
+ * session key produced it.
76
+ *
77
+ * The key leads `detail`: everything below it (the tool's own output, the
78
+ * model) is context, while "this came from a model-eval run and not from your
79
+ * chat" is the part that reorients the reader.
80
+ */
81
+ private attribute;
82
+ private enforceCeiling;
83
+ }
84
+ //# sourceMappingURL=openclaw-timeline-feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw-timeline-feed.d.ts","sourceRoot":"","sources":["../src/openclaw-timeline-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAG3C;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAW/C,MAAM,MAAM,iBAAiB,GAAG,CAC9B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,KACrC,aAAa,EAAE,CAAC;AACrB,MAAM,MAAM,qBAAqB,GAAG,MAAM,oBAAoB,EAAE,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,qBAAa,oBAAoB;IAK7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAL/B,8DAA8D;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;gBAGpC,QAAQ,GAAE,iBAA8C,EACxD,YAAY,GAAE,qBAA4C;IAG7E;;;;OAIG;IACH,IAAI,CAAC,GAAG,GAAE,MAAmB,GAAG,aAAa,EAAE;IA+C/C,yDAAyD;IACzD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,cAAc;CAQvB"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Feeds OpenClaw's own transcript into the daemon's live timeline.
3
+ *
4
+ * The Gateway stream says that OpenClaw answered; it does not say what it did
5
+ * to answer. Only tools that needed approval ever reached the strip, which is a
6
+ * biased sample rather than a log. This is the producer for the rest, read off
7
+ * the store OpenClaw writes anyway (`openclaw-transcript-timeline.ts`).
8
+ *
9
+ * Three bounds, each for a measured reason:
10
+ *
11
+ * - **Only recently-active sessions are read.** The store keeps every session
12
+ * forever — 103 of them on the machine this was built against, most long
13
+ * finished. Sessions are polled by `updatedAt`, newest first, inside
14
+ * `ACTIVE_WINDOW_MS`.
15
+ *
16
+ * - **A first sighting emits NOTHING.** This is the opposite of
17
+ * `KiroTimelineFeed`, deliberately: Kiro seeds the last turn because a Kiro
18
+ * session otherwise shows a live row beside a blank strip, which reads as
19
+ * broken. OpenClaw has no such gap — the Gateway stream is already filling
20
+ * the strip live — so seeding here would only inject minutes-old tool calls
21
+ * from finished eval runs into an activity log, competing with the live
22
+ * rows it is meant to supplement.
23
+ *
24
+ * - **Rows land on the existing `openclaw-gateway` row, not on new sessions.**
25
+ * One OpenClaw instance is one session everywhere else in AgentDeck, the
26
+ * deck is sized for sessions, and an eval suite opens a fresh session key
27
+ * per run — six in the three hours this was measured over. Which session key
28
+ * produced a row rides its `detail` instead, since that is the fact that
29
+ * distinguishes the chat the user is looking at from a cron job and from a
30
+ * model-eval run.
31
+ */
32
+ import { OPENCLAW_SESSION_ID } from './openclaw-session.js';
33
+ import { listOpenClawSessions, openClawTimelineForSession, } from './openclaw-transcript-timeline.js';
34
+ import { debug } from './logger.js';
35
+ /**
36
+ * How often the daemon pumps this feed.
37
+ *
38
+ * Deliberately equal to the passive observer's `SCAN_INTERVAL_MS`: this feed is
39
+ * polled, so an OpenClaw tool call reaches the timeline seconds late rather
40
+ * than instantly, which is the same contract every transcript-observed agent
41
+ * already carries. It is exported so the daemon cannot quietly drift to a
42
+ * cadence nobody measured — the pump is synchronous fs work (~7 ms typical,
43
+ * ~28 ms worst case against a real store).
44
+ */
45
+ export const OPENCLAW_FEED_INTERVAL_MS = 5_000;
46
+ /** How recently a session must have been written to be worth reading. */
47
+ const ACTIVE_WINDOW_MS = 30 * 60 * 1000;
48
+ /** Sessions read per tick, newest-first. An eval suite runs a handful at once. */
49
+ const MAX_SESSIONS_PER_TICK = 8;
50
+ /** Rows read per session per tick — measured traffic was 28 tool calls / 3 h. */
51
+ const ROWS_PER_TICK = 12;
52
+ /** Watermarks kept at most, newest-first: the store never forgets a session. */
53
+ const MAX_TRACKED = 64;
54
+ /**
55
+ * The human-facing half of a session key.
56
+ *
57
+ * `agent:main:eval-full-unified-mlx-2026-08-23-a03__openrouter-stealth-ox-alpha__r2`
58
+ * is what the store holds and it does not fit anywhere. The leading
59
+ * `agent:<agent>:` is constant for a given install and carries nothing, so it
60
+ * is dropped; what remains is the part that says which KIND of work this is.
61
+ */
62
+ export function shortSessionKey(sessionKey) {
63
+ const stripped = sessionKey.replace(/^agent:[^:]+:/, '');
64
+ return stripped || sessionKey;
65
+ }
66
+ export class OpenClawTimelineFeed {
67
+ readRows;
68
+ listSessions;
69
+ /** sessionId → newest row timestamp already accounted for. */
70
+ watermark = new Map();
71
+ constructor(readRows = openClawTimelineForSession, listSessions = listOpenClawSessions) {
72
+ this.readRows = readRows;
73
+ this.listSessions = listSessions;
74
+ }
75
+ /**
76
+ * Rows to emit for this tick, oldest-first across all sessions.
77
+ *
78
+ * `now` is injectable so a test can drive the activity window without a clock.
79
+ */
80
+ pump(now = Date.now()) {
81
+ let sessions;
82
+ try {
83
+ sessions = this.listSessions();
84
+ }
85
+ catch (err) {
86
+ debug('daemon', `openclaw-feed session list failed: ${String(err)}`);
87
+ return [];
88
+ }
89
+ const active = sessions
90
+ .filter((s) => now - s.updatedAt <= ACTIVE_WINDOW_MS)
91
+ .slice(0, MAX_SESSIONS_PER_TICK);
92
+ const live = new Set(active.map((s) => s.sessionId));
93
+ for (const id of [...this.watermark.keys()]) {
94
+ if (!live.has(id))
95
+ this.watermark.delete(id);
96
+ }
97
+ const out = [];
98
+ for (const session of active) {
99
+ const since = this.watermark.get(session.sessionId);
100
+ let rows;
101
+ try {
102
+ rows = this.readRows(session.sessionId, { since, limit: ROWS_PER_TICK });
103
+ }
104
+ catch (err) {
105
+ debug('daemon', `openclaw-feed read failed for ${session.sessionId}: ${String(err)}`);
106
+ continue;
107
+ }
108
+ if (rows.length === 0) {
109
+ // Seed an empty/unreadable session at 0 so its first real row is
110
+ // emitted rather than swallowed as history.
111
+ if (since === undefined)
112
+ this.watermark.set(session.sessionId, 0);
113
+ continue;
114
+ }
115
+ const newest = rows[rows.length - 1].ts;
116
+ this.watermark.set(session.sessionId, newest);
117
+ if (since === undefined) {
118
+ // First sighting: adopt the position, emit nothing. See the header —
119
+ // the Gateway stream is already filling this session's strip.
120
+ debug('daemon', `openclaw-feed seeded ${session.sessionId} at ${newest} (silent)`);
121
+ continue;
122
+ }
123
+ for (const row of rows)
124
+ out.push(this.attribute(row, session));
125
+ }
126
+ this.enforceCeiling();
127
+ return out.sort((a, b) => (a.ts < b.ts ? -1 : a.ts > b.ts ? 1 : 0));
128
+ }
129
+ /** Tracked session count — for tests and diagnostics. */
130
+ get size() {
131
+ return this.watermark.size;
132
+ }
133
+ /**
134
+ * Stamp the row with the virtual Gateway session and say which OpenClaw
135
+ * session key produced it.
136
+ *
137
+ * The key leads `detail`: everything below it (the tool's own output, the
138
+ * model) is context, while "this came from a model-eval run and not from your
139
+ * chat" is the part that reorients the reader.
140
+ */
141
+ attribute(row, session) {
142
+ const head = `session: ${shortSessionKey(session.sessionKey)}`;
143
+ return {
144
+ ...row,
145
+ sessionId: OPENCLAW_SESSION_ID,
146
+ agentType: 'openclaw',
147
+ projectName: 'OpenClaw',
148
+ detail: [head, row.detail].filter(Boolean).join('\n'),
149
+ };
150
+ }
151
+ enforceCeiling() {
152
+ if (this.watermark.size <= MAX_TRACKED)
153
+ return;
154
+ const byAge = [...this.watermark.entries()].sort((a, b) => a[1] - b[1]);
155
+ for (const [id] of byAge) {
156
+ if (this.watermark.size <= MAX_TRACKED)
157
+ break;
158
+ this.watermark.delete(id);
159
+ }
160
+ }
161
+ }
162
+ //# sourceMappingURL=openclaw-timeline-feed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw-timeline-feed.js","sourceRoot":"","sources":["../src/openclaw-timeline-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,0BAA0B,GAE3B,MA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ACpB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,WAAW;YAAE,OAAO;QAC/C,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,KAAK,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,WAAW;gBAAE,MAAM;YAC9C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Timeline rows read from OpenClaw's OWN on-disk session store.
3
+ *
4
+ * WHY THIS EXISTS. OpenClaw reaches this daemon through the Gateway WebSocket
5
+ * event stream and nothing else — the adapter's whole RPC surface is `connect`
6
+ * / `sessions.list` / `chat.send` / `chat.abort` / `exec.approval.*`. That
7
+ * stream carries the prompt, the final response, and the approvals it has to
8
+ * block on. It does NOT carry the individual tool calls, so the timeline showed
9
+ * "OpenClaw said something" with no account of what it actually did, and the
10
+ * only tools that ever appeared were the ones that happened to need approval —
11
+ * a biased sample, not a log.
12
+ *
13
+ * OpenClaw writes a full transcript per session (measured 2026-08-23 against
14
+ * OpenClaw 2026.7.1-2). This reads it, exactly the way `kiro-transcript-timeline`
15
+ * reads Kiro's — an agent that pushes nothing still has a producer.
16
+ *
17
+ * **Scope is deliberately the complement of the Gateway stream, not a
18
+ * duplicate of it.** Only `tool_exec` rows are emitted here. Prompts, responses
19
+ * and approval rows already arrive live over the Gateway and re-deriving them
20
+ * would double every turn in the strip.
21
+ *
22
+ * The record shapes below were copied off a real store, never invented — this
23
+ * repo has a specific history of parsers written against imagined fixtures that
24
+ * passed their tests and matched nothing real, so the test file pins the
25
+ * measured shape verbatim:
26
+ *
27
+ * {"type":"session","version":3,"id":"fef73899-…","timestamp":"2026-08-22T23:52:16.443Z",
28
+ * "cwd":"/Users/x/.openclaw/workspace"}
29
+ * {"type":"message","id":"577c04b8","parentId":"40296bc1",
30
+ * "timestamp":"2026-08-22T23:52:23.315Z",
31
+ * "message":{"role":"assistant","content":[
32
+ * {"type":"thinking","thinking":"…"},
33
+ * {"type":"toolCall","id":"38e16c61-…","name":"exec",
34
+ * "arguments":{"command":"ls ~/github/OpenClaw && …"}}],
35
+ * "provider":"openrouter","model":"stealth/ox-alpha","usage":{…}}}
36
+ * {"type":"message","id":"53079fbe","timestamp":"2026-08-22T23:52:23.376Z",
37
+ * "message":{"role":"toolResult","toolCallId":"38e16c61-…","toolName":"exec",
38
+ * "content":[{"type":"text","text":"CAPTURE_GUIDE.md\n…"}],
39
+ * "details":{"status":"completed","exitCode":0,"durationMs":13},"isError":false}}
40
+ *
41
+ * Three properties of that shape drive the code:
42
+ * - A line carries an ISO `timestamp` AND `message.timestamp` in epoch-ms.
43
+ * They agree; the ISO one is used, with the epoch one as the fallback,
44
+ * because a row with no time cannot be ordered against the live stream.
45
+ * - A tool call and its result are SEPARATE lines linked by `toolCallId`. The
46
+ * call names what was attempted and only the result knows whether it worked,
47
+ * so a row is emitted once, at the call, and completed from the result.
48
+ * - `isError` and `details.exitCode` disagree in the interesting direction: a
49
+ * command can exit 0 while the tool reports an error (and vice versa), so
50
+ * both are consulted rather than picking one.
51
+ */
52
+ import type { TimelineEntry } from '@agentdeck/shared';
53
+ export interface OpenClawStoreOptions {
54
+ /** Injectable for tests; defaults to `~/.openclaw`. */
55
+ stateDir?: string;
56
+ }
57
+ export interface OpenClawTimelineOptions extends OpenClawStoreOptions {
58
+ /** Epoch-ms lower bound; rows at or before it are dropped. */
59
+ since?: number;
60
+ /** Newest N rows kept. */
61
+ limit?: number;
62
+ }
63
+ /** One session as the index describes it. */
64
+ export interface OpenClawStoreSession {
65
+ /** `agent:main:main`, `agent:main:cron:<uuid>`, `agent:main:eval-…__r2`. */
66
+ sessionKey: string;
67
+ sessionId: string;
68
+ agent: string;
69
+ updatedAt: number;
70
+ }
71
+ export declare function openClawStateDir(opts?: OpenClawStoreOptions): string;
72
+ /**
73
+ * Sessions across every agent, newest-first.
74
+ *
75
+ * Reads each agent's `sessions.json`, whose keys ARE the session keys — the one
76
+ * fact that says whether a given piece of OpenClaw activity is the chat the
77
+ * user is looking at (`agent:main:main`), a scheduled job
78
+ * (`agent:main:cron:<id>`) or a model-eval run (`agent:main:eval-…__r2`). All
79
+ * three arrive at AgentDeck as the single literal "OpenClaw", which is why an
80
+ * approval raised by an eval harness looked like it came from a conversation
81
+ * the user could not find.
82
+ */
83
+ export declare function listOpenClawSessions(opts?: OpenClawStoreOptions): OpenClawStoreSession[];
84
+ /**
85
+ * The one line that says what a tool call is going to do.
86
+ *
87
+ * `exec` is the overwhelming majority and its `command` is the whole story.
88
+ * Anything else falls back to the first string-valued argument, then to the
89
+ * argument names — a tool this build has never seen must degrade to something
90
+ * true ("browser · url, selector") rather than render as nothing.
91
+ */
92
+ export declare function summarizeToolArguments(args: unknown): string;
93
+ /**
94
+ * `tool_exec` rows for one session's transcript, oldest-first.
95
+ *
96
+ * Emitted at the CALL, then completed in place from the matching result: the
97
+ * call is when the work started and is what orders correctly against the live
98
+ * Gateway rows, while only the result knows the outcome. Building the row at
99
+ * the result instead would stamp every tool with the time it finished and lose
100
+ * any call still running when the read happened.
101
+ */
102
+ export declare function openClawTimelineForSession(sessionId: string, opts?: OpenClawTimelineOptions): TimelineEntry[];
103
+ //# sourceMappingURL=openclaw-transcript-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclaw-transcript-timeline.d.ts","sourceRoot":"","sources":["../src/openclaw-transcript-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWvD,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAwB,SAAQ,oBAAoB;IACnE,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,oBAAyB,GAAG,MAAM,CAExE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,oBAAyB,GAAG,oBAAoB,EAAE,CAqC5F;AA2CD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAa5D;AAOD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,uBAA4B,GACjC,aAAa,EAAE,CA2HjB"}