@openagt/dashboard 0.0.0-stage → 0.9.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 (610) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -2
  3. package/dist/agent-id.d.ts +13 -0
  4. package/dist/agent-id.d.ts.map +1 -0
  5. package/dist/agent-id.js +20 -0
  6. package/dist/agent-id.js.map +1 -0
  7. package/dist/agent-locks.d.ts +3 -0
  8. package/dist/agent-locks.d.ts.map +1 -0
  9. package/dist/agent-locks.js +40 -0
  10. package/dist/agent-locks.js.map +1 -0
  11. package/dist/agent-view.d.ts +39 -0
  12. package/dist/agent-view.d.ts.map +1 -0
  13. package/dist/agent-view.js +45 -0
  14. package/dist/agent-view.js.map +1 -0
  15. package/dist/bin.d.ts +3 -0
  16. package/dist/bin.d.ts.map +1 -0
  17. package/dist/bin.js +11 -0
  18. package/dist/bin.js.map +1 -0
  19. package/dist/branch-name.d.ts +8 -0
  20. package/dist/branch-name.d.ts.map +1 -0
  21. package/dist/branch-name.js +20 -0
  22. package/dist/branch-name.js.map +1 -0
  23. package/dist/bridge-browser.d.ts +217 -0
  24. package/dist/bridge-browser.d.ts.map +1 -0
  25. package/dist/bridge-browser.js +520 -0
  26. package/dist/bridge-browser.js.map +1 -0
  27. package/dist/browser-stream.d.ts +20 -0
  28. package/dist/browser-stream.d.ts.map +1 -0
  29. package/dist/browser-stream.js +51 -0
  30. package/dist/browser-stream.js.map +1 -0
  31. package/dist/browser.d.ts +16 -0
  32. package/dist/browser.d.ts.map +1 -0
  33. package/dist/browser.js +38 -0
  34. package/dist/browser.js.map +1 -0
  35. package/dist/built-in.d.ts +38 -0
  36. package/dist/built-in.d.ts.map +1 -0
  37. package/dist/built-in.js +119 -0
  38. package/dist/built-in.js.map +1 -0
  39. package/dist/chrome-extension/background.js +532 -0
  40. package/dist/chrome-extension/content.js +1475 -0
  41. package/dist/chrome-extension/driver-plan.js +41 -0
  42. package/dist/chrome-extension/fingerprint.js +43 -0
  43. package/dist/chrome-extension/manifest.json +31 -0
  44. package/dist/chrome-extension/options.html +48 -0
  45. package/dist/chrome-extension/options.js +122 -0
  46. package/dist/cli.d.ts +43 -0
  47. package/dist/cli.d.ts.map +1 -0
  48. package/dist/cli.js +186 -0
  49. package/dist/cli.js.map +1 -0
  50. package/dist/client.d.ts +16 -0
  51. package/dist/client.d.ts.map +1 -0
  52. package/dist/client.js +30 -0
  53. package/dist/client.js.map +1 -0
  54. package/dist/cloud-run-state.d.ts +27 -0
  55. package/dist/cloud-run-state.d.ts.map +1 -0
  56. package/dist/cloud-run-state.js +36 -0
  57. package/dist/cloud-run-state.js.map +1 -0
  58. package/dist/cloud-scratch-refs.d.ts +85 -0
  59. package/dist/cloud-scratch-refs.d.ts.map +1 -0
  60. package/dist/cloud-scratch-refs.js +275 -0
  61. package/dist/cloud-scratch-refs.js.map +1 -0
  62. package/dist/cloud-work.d.ts +66 -0
  63. package/dist/cloud-work.d.ts.map +1 -0
  64. package/dist/cloud-work.js +204 -0
  65. package/dist/cloud-work.js.map +1 -0
  66. package/dist/daemon-runtime.d.ts +42 -0
  67. package/dist/daemon-runtime.d.ts.map +1 -0
  68. package/dist/daemon-runtime.js +183 -0
  69. package/dist/daemon-runtime.js.map +1 -0
  70. package/dist/daemon-services.d.ts +37 -0
  71. package/dist/daemon-services.d.ts.map +1 -0
  72. package/dist/daemon-services.js +126 -0
  73. package/dist/daemon-services.js.map +1 -0
  74. package/dist/daemon-tick.d.ts +68 -0
  75. package/dist/daemon-tick.d.ts.map +1 -0
  76. package/dist/daemon-tick.js +97 -0
  77. package/dist/daemon-tick.js.map +1 -0
  78. package/dist/daemon.d.ts +65 -0
  79. package/dist/daemon.d.ts.map +1 -0
  80. package/dist/daemon.js +202 -0
  81. package/dist/daemon.js.map +1 -0
  82. package/dist/dashboard/activity.d.ts +41 -0
  83. package/dist/dashboard/activity.d.ts.map +1 -0
  84. package/dist/dashboard/activity.js +56 -0
  85. package/dist/dashboard/activity.js.map +1 -0
  86. package/dist/dashboard/agent-handoff.d.ts +244 -0
  87. package/dist/dashboard/agent-handoff.d.ts.map +1 -0
  88. package/dist/dashboard/agent-handoff.js +310 -0
  89. package/dist/dashboard/agent-handoff.js.map +1 -0
  90. package/dist/dashboard/bridge-endpoints.d.ts +158 -0
  91. package/dist/dashboard/bridge-endpoints.d.ts.map +1 -0
  92. package/dist/dashboard/bridge-endpoints.js +382 -0
  93. package/dist/dashboard/bridge-endpoints.js.map +1 -0
  94. package/dist/dashboard/bridge-question.d.ts +33 -0
  95. package/dist/dashboard/bridge-question.d.ts.map +1 -0
  96. package/dist/dashboard/bridge-question.js +20 -0
  97. package/dist/dashboard/bridge-question.js.map +1 -0
  98. package/dist/dashboard/bridge-sessions.d.ts +25 -0
  99. package/dist/dashboard/bridge-sessions.d.ts.map +1 -0
  100. package/dist/dashboard/bridge-sessions.js +46 -0
  101. package/dist/dashboard/bridge-sessions.js.map +1 -0
  102. package/dist/dashboard/bridge-starts.d.ts +61 -0
  103. package/dist/dashboard/bridge-starts.d.ts.map +1 -0
  104. package/dist/dashboard/bridge-starts.js +94 -0
  105. package/dist/dashboard/bridge-starts.js.map +1 -0
  106. package/dist/dashboard/bridge-store.d.ts +179 -0
  107. package/dist/dashboard/bridge-store.d.ts.map +1 -0
  108. package/dist/dashboard/bridge-store.js +262 -0
  109. package/dist/dashboard/bridge-store.js.map +1 -0
  110. package/dist/dashboard/bundle.d.ts +12 -0
  111. package/dist/dashboard/bundle.d.ts.map +1 -0
  112. package/dist/dashboard/bundle.js +22 -0
  113. package/dist/dashboard/bundle.js.map +1 -0
  114. package/dist/dashboard/cache.d.ts +47 -0
  115. package/dist/dashboard/cache.d.ts.map +1 -0
  116. package/dist/dashboard/cache.js +87 -0
  117. package/dist/dashboard/cache.js.map +1 -0
  118. package/dist/dashboard/content-type.d.ts +3 -0
  119. package/dist/dashboard/content-type.d.ts.map +1 -0
  120. package/dist/dashboard/content-type.js +31 -0
  121. package/dist/dashboard/content-type.js.map +1 -0
  122. package/dist/dashboard/dashboard.d.ts +38 -0
  123. package/dist/dashboard/dashboard.d.ts.map +1 -0
  124. package/dist/dashboard/dashboard.js +42 -0
  125. package/dist/dashboard/dashboard.js.map +1 -0
  126. package/dist/dashboard/docs.d.ts +39 -0
  127. package/dist/dashboard/docs.d.ts.map +1 -0
  128. package/dist/dashboard/docs.js +59 -0
  129. package/dist/dashboard/docs.js.map +1 -0
  130. package/dist/dashboard/git-status.d.ts +44 -0
  131. package/dist/dashboard/git-status.d.ts.map +1 -0
  132. package/dist/dashboard/git-status.js +37 -0
  133. package/dist/dashboard/git-status.js.map +1 -0
  134. package/dist/dashboard/http.d.ts +29 -0
  135. package/dist/dashboard/http.d.ts.map +1 -0
  136. package/dist/dashboard/http.js +74 -0
  137. package/dist/dashboard/http.js.map +1 -0
  138. package/dist/dashboard/index.d.ts +24 -0
  139. package/dist/dashboard/index.d.ts.map +1 -0
  140. package/dist/dashboard/index.js +23 -0
  141. package/dist/dashboard/index.js.map +1 -0
  142. package/dist/dashboard/interventions.d.ts +67 -0
  143. package/dist/dashboard/interventions.d.ts.map +1 -0
  144. package/dist/dashboard/interventions.js +169 -0
  145. package/dist/dashboard/interventions.js.map +1 -0
  146. package/dist/dashboard/keyed-watcher.d.ts +29 -0
  147. package/dist/dashboard/keyed-watcher.d.ts.map +1 -0
  148. package/dist/dashboard/keyed-watcher.js +42 -0
  149. package/dist/dashboard/keyed-watcher.js.map +1 -0
  150. package/dist/dashboard/keys.d.ts +31 -0
  151. package/dist/dashboard/keys.d.ts.map +1 -0
  152. package/dist/dashboard/keys.js +37 -0
  153. package/dist/dashboard/keys.js.map +1 -0
  154. package/dist/dashboard/models.d.ts +25 -0
  155. package/dist/dashboard/models.d.ts.map +1 -0
  156. package/dist/dashboard/models.js +30 -0
  157. package/dist/dashboard/models.js.map +1 -0
  158. package/dist/dashboard/module-host.d.ts +44 -0
  159. package/dist/dashboard/module-host.d.ts.map +1 -0
  160. package/dist/dashboard/module-host.js +91 -0
  161. package/dist/dashboard/module-host.js.map +1 -0
  162. package/dist/dashboard/module-serve.d.ts +15 -0
  163. package/dist/dashboard/module-serve.d.ts.map +1 -0
  164. package/dist/dashboard/module-serve.js +45 -0
  165. package/dist/dashboard/module-serve.js.map +1 -0
  166. package/dist/dashboard/open-in-app.d.ts +43 -0
  167. package/dist/dashboard/open-in-app.d.ts.map +1 -0
  168. package/dist/dashboard/open-in-app.js +98 -0
  169. package/dist/dashboard/open-in-app.js.map +1 -0
  170. package/dist/dashboard/open-questions.d.ts +45 -0
  171. package/dist/dashboard/open-questions.d.ts.map +1 -0
  172. package/dist/dashboard/open-questions.js +62 -0
  173. package/dist/dashboard/open-questions.js.map +1 -0
  174. package/dist/dashboard/overview.d.ts +78 -0
  175. package/dist/dashboard/overview.d.ts.map +1 -0
  176. package/dist/dashboard/overview.js +87 -0
  177. package/dist/dashboard/overview.js.map +1 -0
  178. package/dist/dashboard/projects.d.ts +101 -0
  179. package/dist/dashboard/projects.d.ts.map +1 -0
  180. package/dist/dashboard/projects.js +63 -0
  181. package/dist/dashboard/projects.js.map +1 -0
  182. package/dist/dashboard/pull-requests.d.ts +127 -0
  183. package/dist/dashboard/pull-requests.d.ts.map +1 -0
  184. package/dist/dashboard/pull-requests.js +137 -0
  185. package/dist/dashboard/pull-requests.js.map +1 -0
  186. package/dist/dashboard/queue.d.ts +17 -0
  187. package/dist/dashboard/queue.d.ts.map +1 -0
  188. package/dist/dashboard/queue.js +19 -0
  189. package/dist/dashboard/queue.js.map +1 -0
  190. package/dist/dashboard/quota.d.ts +53 -0
  191. package/dist/dashboard/quota.d.ts.map +1 -0
  192. package/dist/dashboard/quota.js +42 -0
  193. package/dist/dashboard/quota.js.map +1 -0
  194. package/dist/dashboard/relay-endpoints.d.ts +32 -0
  195. package/dist/dashboard/relay-endpoints.d.ts.map +1 -0
  196. package/dist/dashboard/relay-endpoints.js +115 -0
  197. package/dist/dashboard/relay-endpoints.js.map +1 -0
  198. package/dist/dashboard/remote-run.d.ts +95 -0
  199. package/dist/dashboard/remote-run.d.ts.map +1 -0
  200. package/dist/dashboard/remote-run.js +235 -0
  201. package/dist/dashboard/remote-run.js.map +1 -0
  202. package/dist/dashboard/rpc-serve.d.ts +106 -0
  203. package/dist/dashboard/rpc-serve.d.ts.map +1 -0
  204. package/dist/dashboard/rpc-serve.js +180 -0
  205. package/dist/dashboard/rpc-serve.js.map +1 -0
  206. package/dist/dashboard/run-inbox.d.ts +31 -0
  207. package/dist/dashboard/run-inbox.d.ts.map +1 -0
  208. package/dist/dashboard/run-inbox.js +51 -0
  209. package/dist/dashboard/run-inbox.js.map +1 -0
  210. package/dist/dashboard/server.d.ts +105 -0
  211. package/dist/dashboard/server.d.ts.map +1 -0
  212. package/dist/dashboard/server.js +231 -0
  213. package/dist/dashboard/server.js.map +1 -0
  214. package/dist/dashboard/static.d.ts +9 -0
  215. package/dist/dashboard/static.d.ts.map +1 -0
  216. package/dist/dashboard/static.js +54 -0
  217. package/dist/dashboard/static.js.map +1 -0
  218. package/dist/dashboard/types.d.ts +135 -0
  219. package/dist/dashboard/types.d.ts.map +1 -0
  220. package/dist/dashboard/types.js +2 -0
  221. package/dist/dashboard/types.js.map +1 -0
  222. package/dist/dashboard/web-start-endpoints.d.ts +32 -0
  223. package/dist/dashboard/web-start-endpoints.d.ts.map +1 -0
  224. package/dist/dashboard/web-start-endpoints.js +75 -0
  225. package/dist/dashboard/web-start-endpoints.js.map +1 -0
  226. package/dist/dashboard-bundle/assets/client-CbBRB9m4.js +9 -0
  227. package/dist/dashboard-bundle/assets/jsx-runtime-By8HlURe.js +1 -0
  228. package/dist/dashboard-bundle/assets/main-B98UOA3_.js +140 -0
  229. package/dist/dashboard-bundle/assets/main-ByRjbCiA.css +2 -0
  230. package/dist/dashboard-bundle/assets/module-v213KWfH.js +21 -0
  231. package/dist/dashboard-bundle/assets/react-CZI7_Jkm.js +1 -0
  232. package/dist/dashboard-bundle/assets/react-dom-cJyBB_A4.js +1 -0
  233. package/dist/dashboard-bundle/assets/rolldown-runtime-QTnfLwEv.js +1 -0
  234. package/dist/dashboard-bundle/host/module.js +1 -0
  235. package/dist/dashboard-bundle/host/react-dom-client.js +1 -0
  236. package/dist/dashboard-bundle/host/react-dom.js +1 -0
  237. package/dist/dashboard-bundle/host/react-jsx-runtime.js +1 -0
  238. package/dist/dashboard-bundle/host/react.js +1 -0
  239. package/dist/dashboard-bundle/index.html +42 -0
  240. package/dist/dashboard-bundle/logo-animated.svg +34 -0
  241. package/dist/dashboard-bundle/logo.svg +16 -0
  242. package/dist/dashboard-rpc/context.d.ts +56 -0
  243. package/dist/dashboard-rpc/context.d.ts.map +1 -0
  244. package/dist/dashboard-rpc/context.js +106 -0
  245. package/dist/dashboard-rpc/context.js.map +1 -0
  246. package/dist/dashboard-rpc/control.d.ts +124 -0
  247. package/dist/dashboard-rpc/control.d.ts.map +1 -0
  248. package/dist/dashboard-rpc/control.js +284 -0
  249. package/dist/dashboard-rpc/control.js.map +1 -0
  250. package/dist/dashboard-rpc/devices.d.ts +9 -0
  251. package/dist/dashboard-rpc/devices.d.ts.map +1 -0
  252. package/dist/dashboard-rpc/devices.js +12 -0
  253. package/dist/dashboard-rpc/devices.js.map +1 -0
  254. package/dist/dashboard-rpc/events-tail.d.ts +68 -0
  255. package/dist/dashboard-rpc/events-tail.d.ts.map +1 -0
  256. package/dist/dashboard-rpc/events-tail.js +257 -0
  257. package/dist/dashboard-rpc/events-tail.js.map +1 -0
  258. package/dist/dashboard-rpc/events.d.ts +39 -0
  259. package/dist/dashboard-rpc/events.d.ts.map +1 -0
  260. package/dist/dashboard-rpc/events.js +47 -0
  261. package/dist/dashboard-rpc/events.js.map +1 -0
  262. package/dist/dashboard-rpc/index.d.ts +29 -0
  263. package/dist/dashboard-rpc/index.d.ts.map +1 -0
  264. package/dist/dashboard-rpc/index.js +40 -0
  265. package/dist/dashboard-rpc/index.js.map +1 -0
  266. package/dist/dashboard-rpc/models.d.ts +4 -0
  267. package/dist/dashboard-rpc/models.d.ts.map +1 -0
  268. package/dist/dashboard-rpc/models.js +8 -0
  269. package/dist/dashboard-rpc/models.js.map +1 -0
  270. package/dist/dashboard-rpc/modules.d.ts +45 -0
  271. package/dist/dashboard-rpc/modules.d.ts.map +1 -0
  272. package/dist/dashboard-rpc/modules.js +79 -0
  273. package/dist/dashboard-rpc/modules.js.map +1 -0
  274. package/dist/dashboard-rpc/preferences.d.ts +41 -0
  275. package/dist/dashboard-rpc/preferences.d.ts.map +1 -0
  276. package/dist/dashboard-rpc/preferences.js +65 -0
  277. package/dist/dashboard-rpc/preferences.js.map +1 -0
  278. package/dist/dashboard-rpc/projects.d.ts +85 -0
  279. package/dist/dashboard-rpc/projects.d.ts.map +1 -0
  280. package/dist/dashboard-rpc/projects.js +129 -0
  281. package/dist/dashboard-rpc/projects.js.map +1 -0
  282. package/dist/dashboard-rpc/quota.d.ts +4 -0
  283. package/dist/dashboard-rpc/quota.d.ts.map +1 -0
  284. package/dist/dashboard-rpc/quota.js +15 -0
  285. package/dist/dashboard-rpc/quota.js.map +1 -0
  286. package/dist/dashboard-rpc/reads.d.ts +185 -0
  287. package/dist/dashboard-rpc/reads.d.ts.map +1 -0
  288. package/dist/dashboard-rpc/reads.js +370 -0
  289. package/dist/dashboard-rpc/reads.js.map +1 -0
  290. package/dist/dashboard-rpc/relay-agent.d.ts +9 -0
  291. package/dist/dashboard-rpc/relay-agent.d.ts.map +1 -0
  292. package/dist/dashboard-rpc/relay-agent.js +21 -0
  293. package/dist/dashboard-rpc/relay-agent.js.map +1 -0
  294. package/dist/dashboard-rpc/relay-dispatch.d.ts +9 -0
  295. package/dist/dashboard-rpc/relay-dispatch.d.ts.map +1 -0
  296. package/dist/dashboard-rpc/relay-dispatch.js +24 -0
  297. package/dist/dashboard-rpc/relay-dispatch.js.map +1 -0
  298. package/dist/dashboard-rpc/stream-forward.d.ts +17 -0
  299. package/dist/dashboard-rpc/stream-forward.d.ts.map +1 -0
  300. package/dist/dashboard-rpc/stream-forward.js +38 -0
  301. package/dist/dashboard-rpc/stream-forward.js.map +1 -0
  302. package/dist/dashboard-rpc/test-context.d.ts +23 -0
  303. package/dist/dashboard-rpc/test-context.d.ts.map +1 -0
  304. package/dist/dashboard-rpc/test-context.js +43 -0
  305. package/dist/dashboard-rpc/test-context.js.map +1 -0
  306. package/dist/driver-names.d.ts +22 -0
  307. package/dist/driver-names.d.ts.map +1 -0
  308. package/dist/driver-names.js +29 -0
  309. package/dist/driver-names.js.map +1 -0
  310. package/dist/error-message.d.ts +8 -0
  311. package/dist/error-message.d.ts.map +1 -0
  312. package/dist/error-message.js +10 -0
  313. package/dist/error-message.js.map +1 -0
  314. package/dist/event-stream.d.ts +33 -0
  315. package/dist/event-stream.d.ts.map +1 -0
  316. package/dist/event-stream.js +104 -0
  317. package/dist/event-stream.js.map +1 -0
  318. package/dist/events.d.ts +236 -0
  319. package/dist/events.d.ts.map +1 -0
  320. package/dist/events.js +5 -0
  321. package/dist/events.js.map +1 -0
  322. package/dist/format-bytes.d.ts +3 -0
  323. package/dist/format-bytes.d.ts.map +1 -0
  324. package/dist/format-bytes.js +18 -0
  325. package/dist/format-bytes.js.map +1 -0
  326. package/dist/has-remote.d.ts +8 -0
  327. package/dist/has-remote.d.ts.map +1 -0
  328. package/dist/has-remote.js +10 -0
  329. package/dist/has-remote.js.map +1 -0
  330. package/dist/index.d.ts +42 -0
  331. package/dist/index.d.ts.map +1 -0
  332. package/dist/index.js +16 -0
  333. package/dist/index.js.map +1 -0
  334. package/dist/install.d.ts +31 -0
  335. package/dist/install.d.ts.map +1 -0
  336. package/dist/install.js +54 -0
  337. package/dist/install.js.map +1 -0
  338. package/dist/jsonl-tail.d.ts +59 -0
  339. package/dist/jsonl-tail.d.ts.map +1 -0
  340. package/dist/jsonl-tail.js +152 -0
  341. package/dist/jsonl-tail.js.map +1 -0
  342. package/dist/loopback-host.d.ts +20 -0
  343. package/dist/loopback-host.d.ts.map +1 -0
  344. package/dist/loopback-host.js +31 -0
  345. package/dist/loopback-host.js.map +1 -0
  346. package/dist/module-server.d.ts +56 -0
  347. package/dist/module-types/dashboard/components/DiffStat.d.ts +6 -0
  348. package/dist/module-types/dashboard/components/DriverModelMenu.d.ts +23 -0
  349. package/dist/module-types/dashboard/components/LinkActions.d.ts +26 -0
  350. package/dist/module-types/dashboard/components/Markdown.d.ts +4 -0
  351. package/dist/module-types/dashboard/components/SettingsRows.d.ts +37 -0
  352. package/dist/module-types/dashboard/components/StartAgentButton.d.ts +39 -0
  353. package/dist/module-types/dashboard/components/ui/badge.d.ts +2 -0
  354. package/dist/module-types/dashboard/components/ui/button.d.ts +10 -0
  355. package/dist/module-types/dashboard/components/ui/card.d.ts +5 -0
  356. package/dist/module-types/dashboard/components/ui/checkbox.d.ts +7 -0
  357. package/dist/module-types/dashboard/components/ui/dropdown-menu.d.ts +16 -0
  358. package/dist/module-types/dashboard/components/ui/input.d.ts +2 -0
  359. package/dist/module-types/dashboard/components/ui/option-label.d.ts +4 -0
  360. package/dist/module-types/dashboard/components/ui/popover.d.ts +8 -0
  361. package/dist/module-types/dashboard/components/ui/scroll-area.d.ts +10 -0
  362. package/dist/module-types/dashboard/components/ui/separator.d.ts +3 -0
  363. package/dist/module-types/dashboard/components/ui/skeleton.d.ts +2 -0
  364. package/dist/module-types/dashboard/components/ui/slider.d.ts +9 -0
  365. package/dist/module-types/dashboard/components/ui/tooltip.d.ts +11 -0
  366. package/dist/module-types/dashboard/lib/agent-settings.d.ts +2 -0
  367. package/dist/module-types/dashboard/lib/draft-handoff.d.ts +15 -0
  368. package/dist/module-types/dashboard/lib/format-date.d.ts +51 -0
  369. package/dist/module-types/dashboard/lib/host-services.d.ts +12 -0
  370. package/dist/module-types/dashboard/lib/models.d.ts +24 -0
  371. package/dist/module-types/dashboard/lib/route.d.ts +38 -0
  372. package/dist/module-types/dashboard/lib/rpc.d.ts +31 -0
  373. package/dist/module-types/dashboard/lib/use-action.d.ts +25 -0
  374. package/dist/module-types/dashboard/lib/use-async.d.ts +45 -0
  375. package/dist/module-types/dashboard/lib/use-modules.d.ts +79 -0
  376. package/dist/module-types/dashboard/lib/utils.d.ts +3 -0
  377. package/dist/module-types/dashboard/module/index.d.ts +335 -0
  378. package/dist/module-types/dashboard/rpc/models.d.ts +2 -0
  379. package/dist/module-types/dashboard/rpc/modules.d.ts +5 -0
  380. package/dist/module-types/src/agent-id.d.ts +12 -0
  381. package/dist/module-types/src/agent-locks.d.ts +2 -0
  382. package/dist/module-types/src/agent-view.d.ts +38 -0
  383. package/dist/module-types/src/bridge-browser.d.ts +216 -0
  384. package/dist/module-types/src/browser-stream.d.ts +19 -0
  385. package/dist/module-types/src/browser.d.ts +15 -0
  386. package/dist/module-types/src/built-in.d.ts +37 -0
  387. package/dist/module-types/src/client.d.ts +15 -0
  388. package/dist/module-types/src/cloud-run-state.d.ts +26 -0
  389. package/dist/module-types/src/dashboard/activity.d.ts +40 -0
  390. package/dist/module-types/src/dashboard/agent-handoff.d.ts +243 -0
  391. package/dist/module-types/src/dashboard/bridge-endpoints.d.ts +157 -0
  392. package/dist/module-types/src/dashboard/bridge-question.d.ts +32 -0
  393. package/dist/module-types/src/dashboard/bridge-store.d.ts +178 -0
  394. package/dist/module-types/src/dashboard/cache.d.ts +46 -0
  395. package/dist/module-types/src/dashboard/content-type.d.ts +2 -0
  396. package/dist/module-types/src/dashboard/dashboard.d.ts +37 -0
  397. package/dist/module-types/src/dashboard/docs.d.ts +38 -0
  398. package/dist/module-types/src/dashboard/git-status.d.ts +43 -0
  399. package/dist/module-types/src/dashboard/http.d.ts +28 -0
  400. package/dist/module-types/src/dashboard/interventions.d.ts +66 -0
  401. package/dist/module-types/src/dashboard/keyed-watcher.d.ts +28 -0
  402. package/dist/module-types/src/dashboard/keys.d.ts +30 -0
  403. package/dist/module-types/src/dashboard/models.d.ts +24 -0
  404. package/dist/module-types/src/dashboard/module-host.d.ts +43 -0
  405. package/dist/module-types/src/dashboard/module-serve.d.ts +14 -0
  406. package/dist/module-types/src/dashboard/open-in-app.d.ts +42 -0
  407. package/dist/module-types/src/dashboard/open-questions.d.ts +44 -0
  408. package/dist/module-types/src/dashboard/overview.d.ts +77 -0
  409. package/dist/module-types/src/dashboard/projects.d.ts +100 -0
  410. package/dist/module-types/src/dashboard/pull-requests.d.ts +126 -0
  411. package/dist/module-types/src/dashboard/queue.d.ts +16 -0
  412. package/dist/module-types/src/dashboard/quota.d.ts +52 -0
  413. package/dist/module-types/src/dashboard/remote-run.d.ts +94 -0
  414. package/dist/module-types/src/dashboard/rpc-serve.d.ts +105 -0
  415. package/dist/module-types/src/dashboard/run-inbox.d.ts +30 -0
  416. package/dist/module-types/src/dashboard/types.d.ts +134 -0
  417. package/dist/module-types/src/dashboard-rpc/context.d.ts +55 -0
  418. package/dist/module-types/src/dashboard-rpc/control.d.ts +123 -0
  419. package/dist/module-types/src/dashboard-rpc/devices.d.ts +8 -0
  420. package/dist/module-types/src/dashboard-rpc/events-tail.d.ts +67 -0
  421. package/dist/module-types/src/dashboard-rpc/events.d.ts +38 -0
  422. package/dist/module-types/src/dashboard-rpc/index.d.ts +28 -0
  423. package/dist/module-types/src/dashboard-rpc/models.d.ts +3 -0
  424. package/dist/module-types/src/dashboard-rpc/modules.d.ts +44 -0
  425. package/dist/module-types/src/dashboard-rpc/preferences.d.ts +40 -0
  426. package/dist/module-types/src/dashboard-rpc/projects.d.ts +84 -0
  427. package/dist/module-types/src/dashboard-rpc/quota.d.ts +3 -0
  428. package/dist/module-types/src/dashboard-rpc/reads.d.ts +184 -0
  429. package/dist/module-types/src/dashboard-rpc/relay-agent.d.ts +8 -0
  430. package/dist/module-types/src/dashboard-rpc/stream-forward.d.ts +16 -0
  431. package/dist/module-types/src/driver-names.d.ts +21 -0
  432. package/dist/module-types/src/error-message.d.ts +7 -0
  433. package/dist/module-types/src/event-stream.d.ts +32 -0
  434. package/dist/module-types/src/events.d.ts +235 -0
  435. package/dist/module-types/src/format-bytes.d.ts +2 -0
  436. package/dist/module-types/src/has-remote.d.ts +7 -0
  437. package/dist/module-types/src/index.d.ts +41 -0
  438. package/dist/module-types/src/jsonl-tail.d.ts +58 -0
  439. package/dist/module-types/src/loopback-host.d.ts +19 -0
  440. package/dist/module-types/src/node-fs.d.ts +32 -0
  441. package/dist/module-types/src/open-choices.d.ts +14 -0
  442. package/dist/module-types/src/openagent-dir.d.ts +10 -0
  443. package/dist/module-types/src/openagent-gitignore.d.ts +11 -0
  444. package/dist/module-types/src/pick-directory.d.ts +29 -0
  445. package/dist/module-types/src/preference-defaults.d.ts +42 -0
  446. package/dist/module-types/src/project-commands.d.ts +23 -0
  447. package/dist/module-types/src/project-errors.d.ts +59 -0
  448. package/dist/module-types/src/project-hooks.d.ts +129 -0
  449. package/dist/module-types/src/project-modules.d.ts +49 -0
  450. package/dist/module-types/src/project-presets.d.ts +29 -0
  451. package/dist/module-types/src/project.d.ts +28 -0
  452. package/dist/module-types/src/publish-levels.d.ts +32 -0
  453. package/dist/module-types/src/quota-boundary.d.ts +64 -0
  454. package/dist/module-types/src/quota-poller.d.ts +82 -0
  455. package/dist/module-types/src/registry.d.ts +226 -0
  456. package/dist/module-types/src/store/agent-checkout.d.ts +53 -0
  457. package/dist/module-types/src/store/agent-store.d.ts +266 -0
  458. package/dist/module-types/src/store/branches.d.ts +163 -0
  459. package/dist/module-types/src/store/git-host.d.ts +113 -0
  460. package/dist/module-types/src/store/index.d.ts +9 -0
  461. package/dist/module-types/src/store/provided.d.ts +16 -0
  462. package/dist/module-types/src/store/queue.d.ts +45 -0
  463. package/dist/module-types/src/store/repository.d.ts +32 -0
  464. package/dist/module-types/src/store/run-record.d.ts +21 -0
  465. package/dist/module-types/src/store/runs.d.ts +107 -0
  466. package/dist/module-types/src/store/tickets.d.ts +72 -0
  467. package/dist/module-types/src/terminal.d.ts +3 -0
  468. package/dist/module-types/src/worktrees.d.ts +89 -0
  469. package/dist/module.css +50 -0
  470. package/dist/node-fs.d.ts +33 -0
  471. package/dist/node-fs.d.ts.map +1 -0
  472. package/dist/node-fs.js +57 -0
  473. package/dist/node-fs.js.map +1 -0
  474. package/dist/open-choices.d.ts +15 -0
  475. package/dist/open-choices.d.ts.map +1 -0
  476. package/dist/open-choices.js +31 -0
  477. package/dist/open-choices.js.map +1 -0
  478. package/dist/openagent-dir.d.ts +11 -0
  479. package/dist/openagent-dir.d.ts.map +1 -0
  480. package/dist/openagent-dir.js +11 -0
  481. package/dist/openagent-dir.js.map +1 -0
  482. package/dist/openagent-gitignore.d.ts +12 -0
  483. package/dist/openagent-gitignore.d.ts.map +1 -0
  484. package/dist/openagent-gitignore.js +19 -0
  485. package/dist/openagent-gitignore.js.map +1 -0
  486. package/dist/pick-directory.d.ts +30 -0
  487. package/dist/pick-directory.d.ts.map +1 -0
  488. package/dist/pick-directory.js +102 -0
  489. package/dist/pick-directory.js.map +1 -0
  490. package/dist/preference-defaults.d.ts +43 -0
  491. package/dist/preference-defaults.d.ts.map +1 -0
  492. package/dist/preference-defaults.js +34 -0
  493. package/dist/preference-defaults.js.map +1 -0
  494. package/dist/project-commands.d.ts +24 -0
  495. package/dist/project-commands.d.ts.map +1 -0
  496. package/dist/project-commands.js +57 -0
  497. package/dist/project-commands.js.map +1 -0
  498. package/dist/project-errors.d.ts +60 -0
  499. package/dist/project-errors.d.ts.map +1 -0
  500. package/dist/project-errors.js +51 -0
  501. package/dist/project-errors.js.map +1 -0
  502. package/dist/project-hooks.d.ts +130 -0
  503. package/dist/project-hooks.d.ts.map +1 -0
  504. package/dist/project-hooks.js +232 -0
  505. package/dist/project-hooks.js.map +1 -0
  506. package/dist/project-modules.d.ts +50 -0
  507. package/dist/project-modules.d.ts.map +1 -0
  508. package/dist/project-modules.js +110 -0
  509. package/dist/project-modules.js.map +1 -0
  510. package/dist/project-pass.d.ts +32 -0
  511. package/dist/project-pass.d.ts.map +1 -0
  512. package/dist/project-pass.js +45 -0
  513. package/dist/project-pass.js.map +1 -0
  514. package/dist/project-presets.d.ts +30 -0
  515. package/dist/project-presets.d.ts.map +1 -0
  516. package/dist/project-presets.js +74 -0
  517. package/dist/project-presets.js.map +1 -0
  518. package/dist/project.d.ts +29 -0
  519. package/dist/project.d.ts.map +1 -0
  520. package/dist/project.js +41 -0
  521. package/dist/project.js.map +1 -0
  522. package/dist/publish-levels.d.ts +33 -0
  523. package/dist/publish-levels.d.ts.map +1 -0
  524. package/dist/publish-levels.js +53 -0
  525. package/dist/publish-levels.js.map +1 -0
  526. package/dist/quota-boundary.d.ts +65 -0
  527. package/dist/quota-boundary.d.ts.map +1 -0
  528. package/dist/quota-boundary.js +135 -0
  529. package/dist/quota-boundary.js.map +1 -0
  530. package/dist/quota-poller.d.ts +83 -0
  531. package/dist/quota-poller.d.ts.map +1 -0
  532. package/dist/quota-poller.js +118 -0
  533. package/dist/quota-poller.js.map +1 -0
  534. package/dist/registry.d.ts +227 -0
  535. package/dist/registry.d.ts.map +1 -0
  536. package/dist/registry.js +364 -0
  537. package/dist/registry.js.map +1 -0
  538. package/dist/remove-files.d.ts +24 -0
  539. package/dist/remove-files.d.ts.map +1 -0
  540. package/dist/remove-files.js +98 -0
  541. package/dist/remove-files.js.map +1 -0
  542. package/dist/request-path.d.ts +10 -0
  543. package/dist/request-path.d.ts.map +1 -0
  544. package/dist/request-path.js +16 -0
  545. package/dist/request-path.js.map +1 -0
  546. package/dist/store/agent-checkout.d.ts +54 -0
  547. package/dist/store/agent-checkout.d.ts.map +1 -0
  548. package/dist/store/agent-checkout.js +61 -0
  549. package/dist/store/agent-checkout.js.map +1 -0
  550. package/dist/store/agent-store.d.ts +267 -0
  551. package/dist/store/agent-store.d.ts.map +1 -0
  552. package/dist/store/agent-store.js +190 -0
  553. package/dist/store/agent-store.js.map +1 -0
  554. package/dist/store/branches.d.ts +164 -0
  555. package/dist/store/branches.d.ts.map +1 -0
  556. package/dist/store/branches.js +187 -0
  557. package/dist/store/branches.js.map +1 -0
  558. package/dist/store/git-host.d.ts +114 -0
  559. package/dist/store/git-host.d.ts.map +1 -0
  560. package/dist/store/git-host.js +103 -0
  561. package/dist/store/git-host.js.map +1 -0
  562. package/dist/store/index.d.ts +10 -0
  563. package/dist/store/index.d.ts.map +1 -0
  564. package/dist/store/index.js +10 -0
  565. package/dist/store/index.js.map +1 -0
  566. package/dist/store/provided.d.ts +17 -0
  567. package/dist/store/provided.d.ts.map +1 -0
  568. package/dist/store/provided.js +37 -0
  569. package/dist/store/provided.js.map +1 -0
  570. package/dist/store/queue.d.ts +46 -0
  571. package/dist/store/queue.d.ts.map +1 -0
  572. package/dist/store/queue.js +61 -0
  573. package/dist/store/queue.js.map +1 -0
  574. package/dist/store/repository.d.ts +33 -0
  575. package/dist/store/repository.d.ts.map +1 -0
  576. package/dist/store/repository.js +25 -0
  577. package/dist/store/repository.js.map +1 -0
  578. package/dist/store/run-record.d.ts +22 -0
  579. package/dist/store/run-record.d.ts.map +1 -0
  580. package/dist/store/run-record.js +108 -0
  581. package/dist/store/run-record.js.map +1 -0
  582. package/dist/store/runs.d.ts +108 -0
  583. package/dist/store/runs.d.ts.map +1 -0
  584. package/dist/store/runs.js +146 -0
  585. package/dist/store/runs.js.map +1 -0
  586. package/dist/store/test-branches.d.ts +18 -0
  587. package/dist/store/test-branches.d.ts.map +1 -0
  588. package/dist/store/test-branches.js +59 -0
  589. package/dist/store/test-branches.js.map +1 -0
  590. package/dist/store/test-runs.d.ts +15 -0
  591. package/dist/store/test-runs.d.ts.map +1 -0
  592. package/dist/store/test-runs.js +37 -0
  593. package/dist/store/test-runs.js.map +1 -0
  594. package/dist/store/tickets.d.ts +73 -0
  595. package/dist/store/tickets.d.ts.map +1 -0
  596. package/dist/store/tickets.js +67 -0
  597. package/dist/store/tickets.js.map +1 -0
  598. package/dist/terminal.d.ts +4 -0
  599. package/dist/terminal.d.ts.map +1 -0
  600. package/dist/terminal.js +97 -0
  601. package/dist/terminal.js.map +1 -0
  602. package/dist/update-check.d.ts +44 -0
  603. package/dist/update-check.d.ts.map +1 -0
  604. package/dist/update-check.js +71 -0
  605. package/dist/update-check.js.map +1 -0
  606. package/dist/worktrees.d.ts +90 -0
  607. package/dist/worktrees.d.ts.map +1 -0
  608. package/dist/worktrees.js +123 -0
  609. package/dist/worktrees.js.map +1 -0
  610. package/package.json +103 -3
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A bridged question as the gate panel renders it (#1554): the same `ChoiceRequest` a local
3
+ * agent's `choice` event carries, with the labels standing in for ids — a claude.ai page has no
4
+ * ids, and the label is what can be typed back into it.
5
+ */
6
+ export function bridgeChoiceRequest(question) {
7
+ return {
8
+ id: `bridge:${question.sessionId}`,
9
+ title: question.title,
10
+ options: question.options.map(option => ({
11
+ id: option.label,
12
+ label: option.label,
13
+ ...(option.detail ? { detail: option.detail } : {}),
14
+ ...(option.default ? { default: true } : {}),
15
+ })),
16
+ ...(question.recommended ? { recommended: question.recommended } : {}),
17
+ ...(question.multi ? { multi: true } : {}),
18
+ };
19
+ }
20
+ //# sourceMappingURL=bridge-question.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-question.js","sourceRoot":"","sources":["../../src/dashboard/bridge-question.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,OAAO;QACL,EAAE,EAAE,UAAU,QAAQ,CAAC,SAAS,EAAE;QAClC,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvC,EAAE,EAAE,MAAM,CAAC,KAAK;YAChB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C,CAAC,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3C,CAAA;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { AgentMeta } from '../store/index.js';
2
+ import type { BridgeSession } from './bridge-endpoints.js';
3
+ /** How far back a cloud agent's session is still served: the session window, shared with its cloud state (#1668). */
4
+ export declare const BRIDGE_SESSION_WINDOW_MS: number;
5
+ /**
6
+ * Which cloud sessions the extension's Driver tab should be serving (#1237, #1332).
7
+ *
8
+ * Every web run's session inside the window, newest first, and all of them: one Driver tab serves
9
+ * the whole list by reading claude.ai's own session list and visiting only the sessions that need
10
+ * it (#1332), so a long list costs a sidebar read rather than a tab each — which is why the cap
11
+ * of three tabs this used to impose is gone.
12
+ *
13
+ * Recency is still the filter on this side, because a web run's own status says nothing: #1231
14
+ * ends the agent at the hand-off, so every one of them reads `done` whether its session is parked
15
+ * on a question or finished an hour ago. The read-back that tells those apart is the list status
16
+ * the Driver reports, and that lives in the bridge store, not on the record.
17
+ *
18
+ * `queuedFor` names every session the dashboard holds an answer for. Those are served whatever
19
+ * the window says — appended after the recent ones when no run of the window carries them —
20
+ * because a pick is made on a question the page reported, and the page reports whichever session
21
+ * the user happens to be on: outside the window, or no run's at all. A pick nothing serves would
22
+ * sit queued forever.
23
+ */
24
+ export declare function bridgeSessionsFrom(agents: readonly AgentMeta[], now: Date, queuedFor: readonly string[], windowMs?: number): BridgeSession[];
25
+ //# sourceMappingURL=bridge-sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-sessions.d.ts","sourceRoot":"","sources":["../../src/dashboard/bridge-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D,qHAAqH;AACrH,eAAO,MAAM,wBAAwB,QAA0B,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,QAAQ,SAA2B,GAClC,aAAa,EAAE,CAmBjB"}
@@ -0,0 +1,46 @@
1
+ import { CLOUD_SESSION_WINDOW_MS } from '../cloud-run-state.js';
2
+ /** How far back a cloud agent's session is still served: the session window, shared with its cloud state (#1668). */
3
+ export const BRIDGE_SESSION_WINDOW_MS = CLOUD_SESSION_WINDOW_MS;
4
+ /**
5
+ * Which cloud sessions the extension's Driver tab should be serving (#1237, #1332).
6
+ *
7
+ * Every web run's session inside the window, newest first, and all of them: one Driver tab serves
8
+ * the whole list by reading claude.ai's own session list and visiting only the sessions that need
9
+ * it (#1332), so a long list costs a sidebar read rather than a tab each — which is why the cap
10
+ * of three tabs this used to impose is gone.
11
+ *
12
+ * Recency is still the filter on this side, because a web run's own status says nothing: #1231
13
+ * ends the agent at the hand-off, so every one of them reads `done` whether its session is parked
14
+ * on a question or finished an hour ago. The read-back that tells those apart is the list status
15
+ * the Driver reports, and that lives in the bridge store, not on the record.
16
+ *
17
+ * `queuedFor` names every session the dashboard holds an answer for. Those are served whatever
18
+ * the window says — appended after the recent ones when no run of the window carries them —
19
+ * because a pick is made on a question the page reported, and the page reports whichever session
20
+ * the user happens to be on: outside the window, or no run's at all. A pick nothing serves would
21
+ * sit queued forever.
22
+ */
23
+ export function bridgeSessionsFrom(agents, now, queuedFor, windowMs = BRIDGE_SESSION_WINDOW_MS) {
24
+ const queued = new Set(queuedFor);
25
+ const cutoff = now.getTime() - windowMs;
26
+ const seen = new Set();
27
+ const out = [];
28
+ for (const agent of agents) {
29
+ if (agent.target !== 'web' || !agent.sessionId)
30
+ continue;
31
+ const at = Date.parse(agent.startedAt ?? '');
32
+ if (!Number.isFinite(at) || at < cutoff)
33
+ continue;
34
+ if (seen.has(agent.sessionId))
35
+ continue;
36
+ seen.add(agent.sessionId);
37
+ out.push({
38
+ session: { id: agent.sessionId, url: `https://claude.ai/code/${agent.sessionId}`, answerQueued: queued.has(agent.sessionId) },
39
+ at,
40
+ });
41
+ }
42
+ const recent = out.sort((a, b) => b.at - a.at).map(entry => entry.session);
43
+ const extra = queuedFor.filter(id => !seen.has(id)).map(id => ({ id, url: `https://claude.ai/code/${id}`, answerQueued: true }));
44
+ return [...recent, ...extra];
45
+ }
46
+ //# sourceMappingURL=bridge-sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-sessions.js","sourceRoot":"","sources":["../../src/dashboard/bridge-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,qHAAqH;AACrH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA4B,EAC5B,GAAS,EACT,SAA4B,EAC5B,QAAQ,GAAG,wBAAwB;IAEnC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAA;IACjC,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAA;IACvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,GAAG,GAA6C,EAAE,CAAA;IACxD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,SAAQ;QACxD,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAA;QAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,MAAM;YAAE,SAAQ;QACjD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;YAAE,SAAQ;QACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACzB,GAAG,CAAC,IAAI,CAAC;YACP,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,0BAA0B,KAAK,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;YAC7H,EAAE;SACH,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1E,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,0BAA0B,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAChI,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAA;AAC9B,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The session start-queue (#1328): cloud sessions the daemon wants the browser extension to
3
+ * create on claude.ai, because a session created through the page's repo picker is repo-bound
4
+ * and can push and open pull requests, which is what a hand-off is for.
5
+ *
6
+ * A run asks for a session and polls until it exists; the extension claims the oldest request,
7
+ * drives the page, and reports the session it became. The claim is the one subtle part: two
8
+ * polling tabs handed the same request would create two cloud sessions on the user's account,
9
+ * so a request leaves the queue in the same step that serves it, and comes back only if nobody
10
+ * reports on it within {@link START_CLAIM_TTL_MS} — a browser that quit mid-creation must retry,
11
+ * not brick the run.
12
+ */
13
+ export type BridgeStartState = 'queued' | 'claimed' | 'created' | 'failed';
14
+ export interface BridgeStartRequest {
15
+ id: string;
16
+ /** `owner/name`, as the repo picker lists it. */
17
+ repo: string;
18
+ /** The branch the session opens on — the run's pushed hand-off ref. */
19
+ branch: string;
20
+ prompt: string;
21
+ /** The model the run was started with (#1697), when it was; absent leaves claude.ai's default. */
22
+ model?: string;
23
+ queuedAt: string;
24
+ state: BridgeStartState;
25
+ claimedAt?: string;
26
+ sessionId?: string;
27
+ url?: string;
28
+ note?: string;
29
+ }
30
+ export interface BridgeStartInput {
31
+ repo: string;
32
+ branch: string;
33
+ prompt: string;
34
+ model?: string;
35
+ }
36
+ /** How long a claim stands before the request is offered again. */
37
+ export declare const START_CLAIM_TTL_MS = 90000;
38
+ /** The hand-off prompt is the session's whole task and everything it needs to know, so it can be long. */
39
+ export declare const MAX_START_PROMPT = 200000;
40
+ /** A model is a short name or id the extension matches against claude.ai's model menu (#1697). */
41
+ export declare const MAX_START_MODEL = 100;
42
+ export declare class BridgeStarts {
43
+ private readonly byId;
44
+ /** Queue a request, or say what is wrong with it. */
45
+ request(input: BridgeStartInput, now?: Date): BridgeStartRequest | string;
46
+ /** The oldest request nobody holds, claimed for the caller; an expired claim counts as unheld. */
47
+ claimNext(now?: Date): BridgeStartRequest | undefined;
48
+ /**
49
+ * The extension's word on a claimed request. Success without a session id is a failure: a run
50
+ * pointing nowhere is not a usable outcome. A report on a request nobody holds is ignored — a
51
+ * tab that died after its claim expired must not overwrite the retry that replaced it.
52
+ */
53
+ resolve(id: string, ok: boolean, sessionId?: string, note?: string): void;
54
+ get(id: string): BridgeStartRequest | undefined;
55
+ list(): BridgeStartRequest[];
56
+ clear(id: string): void;
57
+ }
58
+ /** The daemon's one queue: the run's request and the extension's claim must meet in the same store. */
59
+ export declare function bridgeStarts(): BridgeStarts;
60
+ export declare function resetBridgeStarts(): void;
61
+ //# sourceMappingURL=bridge-starts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-starts.d.ts","sourceRoot":"","sources":["../../src/dashboard/bridge-starts.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAA;AAE1E,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,kGAAkG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,gBAAgB,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,QAAS,CAAA;AAKxC,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,SAAU,CAAA;AACvC,kGAAkG;AAClG,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAE7D,qDAAqD;IACrD,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAa,GAAG,kBAAkB,GAAG,MAAM,CAqB9E;IAED,kGAAkG;IAClG,SAAS,CAAC,GAAG,OAAa,GAAG,kBAAkB,GAAG,SAAS,CAU1D;IAED;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAaxE;IAED,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAE9C;IAED,IAAI,IAAI,kBAAkB,EAAE,CAE3B;IAED,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAEtB;CACF;AAID,uGAAuG;AACvG,wBAAgB,YAAY,IAAI,YAAY,CAG3C;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,94 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ /** How long a claim stands before the request is offered again. */
3
+ export const START_CLAIM_TTL_MS = 90_000;
4
+ const REPO = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
5
+ const DOTS_ONLY = /^\.+$/;
6
+ const BRANCH = /^[A-Za-z0-9._\-/]{1,255}$/;
7
+ /** The hand-off prompt is the session's whole task and everything it needs to know, so it can be long. */
8
+ export const MAX_START_PROMPT = 200_000;
9
+ /** A model is a short name or id the extension matches against claude.ai's model menu (#1697). */
10
+ export const MAX_START_MODEL = 100;
11
+ export class BridgeStarts {
12
+ byId = new Map();
13
+ /** Queue a request, or say what is wrong with it. */
14
+ request(input, now = new Date()) {
15
+ const repo = input.repo.trim();
16
+ if (!REPO.test(repo) || repo.split('/').some(segment => DOTS_ONLY.test(segment)))
17
+ return 'repo must look like owner/name';
18
+ const branch = input.branch.trim();
19
+ if (!BRANCH.test(branch))
20
+ return 'branch must be a git branch name';
21
+ const prompt = input.prompt.trim();
22
+ if (!prompt)
23
+ return 'prompt must not be empty';
24
+ if (prompt.length > MAX_START_PROMPT)
25
+ return `prompt must be at most ${MAX_START_PROMPT} characters`;
26
+ const model = input.model?.trim();
27
+ if (model && model.length > MAX_START_MODEL)
28
+ return `model must be at most ${MAX_START_MODEL} characters`;
29
+ const start = {
30
+ id: randomUUID(),
31
+ repo,
32
+ branch,
33
+ prompt,
34
+ ...(model ? { model } : {}),
35
+ queuedAt: now.toISOString(),
36
+ state: 'queued',
37
+ };
38
+ this.byId.set(start.id, start);
39
+ return start;
40
+ }
41
+ /** The oldest request nobody holds, claimed for the caller; an expired claim counts as unheld. */
42
+ claimNext(now = new Date()) {
43
+ const stale = now.getTime() - START_CLAIM_TTL_MS;
44
+ const waiting = [...this.byId.values()]
45
+ .filter(start => start.state === 'queued' || (start.state === 'claimed' && Date.parse(start.claimedAt ?? '') <= stale))
46
+ .sort((a, b) => a.queuedAt.localeCompare(b.queuedAt));
47
+ const next = waiting[0];
48
+ if (!next)
49
+ return undefined;
50
+ const claimed = { ...next, state: 'claimed', claimedAt: now.toISOString() };
51
+ this.byId.set(claimed.id, claimed);
52
+ return claimed;
53
+ }
54
+ /**
55
+ * The extension's word on a claimed request. Success without a session id is a failure: a run
56
+ * pointing nowhere is not a usable outcome. A report on a request nobody holds is ignored — a
57
+ * tab that died after its claim expired must not overwrite the retry that replaced it.
58
+ */
59
+ resolve(id, ok, sessionId, note) {
60
+ const start = this.byId.get(id);
61
+ if (!start || start.state !== 'claimed')
62
+ return;
63
+ if (ok && !sessionId) {
64
+ this.byId.set(id, { ...start, state: 'failed', note: note ?? 'reported success without a session id' });
65
+ return;
66
+ }
67
+ this.byId.set(id, {
68
+ ...start,
69
+ state: ok ? 'created' : 'failed',
70
+ ...(sessionId ? { sessionId, url: `https://claude.ai/code/${sessionId}` } : {}),
71
+ ...(note ? { note } : {}),
72
+ });
73
+ }
74
+ get(id) {
75
+ return this.byId.get(id);
76
+ }
77
+ list() {
78
+ return [...this.byId.values()].sort((a, b) => b.queuedAt.localeCompare(a.queuedAt));
79
+ }
80
+ clear(id) {
81
+ this.byId.delete(id);
82
+ }
83
+ }
84
+ let instance;
85
+ /** The daemon's one queue: the run's request and the extension's claim must meet in the same store. */
86
+ export function bridgeStarts() {
87
+ if (!instance)
88
+ instance = new BridgeStarts();
89
+ return instance;
90
+ }
91
+ export function resetBridgeStarts() {
92
+ instance = undefined;
93
+ }
94
+ //# sourceMappingURL=bridge-starts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-starts.js","sourceRoot":"","sources":["../../src/dashboard/bridge-starts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAyCxC,mEAAmE;AACnE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC,MAAM,IAAI,GAAG,oCAAoC,CAAA;AACjD,MAAM,SAAS,GAAG,OAAO,CAAA;AACzB,MAAM,MAAM,GAAG,2BAA2B,CAAA;AAC1C,0GAA0G;AAC1G,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AACvC,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC,MAAM,OAAO,YAAY;IACN,IAAI,GAAG,IAAI,GAAG,EAA8B,CAAA;IAE7D,qDAAqD;IACrD,OAAO,CAAC,KAAuB,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAAE,OAAO,gCAAgC,CAAA;QACzH,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE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CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1B,CAAC,CAAA;IACJ,CAAC;IAED,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IACrF,CAAC;IAED,KAAK,CAAC,EAAU;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;CACF;AAED,IAAI,QAAkC,CAAA;AAEtC,uGAAuG;AACvG,MAAM,UAAU,YAAY;IAC1B,IAAI,CAAC,QAAQ;QAAE,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAA;IAC5C,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,QAAQ,GAAG,SAAS,CAAA;AACtB,CAAC"}
@@ -0,0 +1,179 @@
1
+ import type { BridgeEvent, BridgeHello, BridgeQuestion, BridgeSessionStatus } from './bridge-endpoints.js';
2
+ /**
3
+ * An answer picked in the dashboard, on its way back to the session (#1237).
4
+ *
5
+ * `queued` until the extension fetches it, delivers it into the composer and acknowledges;
6
+ * then `sent`, or `failed` with the extension's reason. The id is what the acknowledgement
7
+ * references, so a stale ack from a tab that died mid-delivery cannot resolve a newer answer.
8
+ */
9
+ export interface BridgeAnswer {
10
+ id: string;
11
+ sessionId: string;
12
+ /** The label(s) picked — one, or a `multi` question's subset (possibly none). */
13
+ labels: string[];
14
+ /**
15
+ * What the extension types into the session (#1554): the same continuation a local gate
16
+ * re-prompts with, so a cloud session hears its answer exactly as a local one does — and, on a
17
+ * `stop` pick, that the user is taking over, since nothing of ours can end a session over there.
18
+ */
19
+ text: string;
20
+ queuedAt: string;
21
+ /**
22
+ * When a Driver collected it to type (#1332). Two Drivers can serve one daemon — the user's own
23
+ * Chrome and the daemon's bridge browser — and an answer handed to both would be typed twice.
24
+ */
25
+ claimedAt?: string;
26
+ state: 'queued' | 'sent' | 'failed';
27
+ note?: string;
28
+ }
29
+ /** How long a collected answer stays with the Driver that collected it before it is offered again. */
30
+ export declare const ANSWER_CLAIM_TTL_MS = 90000;
31
+ /**
32
+ * The questions a Claude web session is parked on, keyed by its cloud session id (#1237).
33
+ *
34
+ * A cloud agent has no live local session to hang a choice gate on: #1231 ends the agent at the
35
+ * hand-off, so by the time the agent asks anything the agent is already `done`. The join back to
36
+ * an agent is `AgentMeta.sessionId`, which a web agent already carries because `CloudSession` reports
37
+ * the cloud id on its result.
38
+ *
39
+ * In memory on purpose. A question is only answerable while the session that asked it is still
40
+ * parked, and the bridge that reported it re-reports on reconnect, so surviving a daemon restart
41
+ * would preserve a question that may already have been answered elsewhere.
42
+ */
43
+ /** The last time anything spoke to the bridge, and how it went. */
44
+ export interface BridgeContact {
45
+ at: string;
46
+ route: string;
47
+ status: number;
48
+ }
49
+ /** The extension's last version claim, and whether the doorway turned it away (#1519). */
50
+ export interface BridgeVersion {
51
+ got: string;
52
+ expected: string;
53
+ blocked: boolean;
54
+ at: string;
55
+ }
56
+ /**
57
+ * What a cloud session is told when the user picks a `stop` option (#358, #1554). It lives on
58
+ * claude.ai where nothing of ours can end it, so the bridge types this instead of a continuation:
59
+ * the decision, and that the user is taking over from here.
60
+ */
61
+ export declare function takeoverPrompt(question: string, answer: string): string;
62
+ export declare class BridgeQuestions {
63
+ private readonly bySession;
64
+ private contact;
65
+ /**
66
+ * Note that something reached the bridge, whatever the outcome.
67
+ *
68
+ * Failures are recorded too, and that is the point: an extension that is misconfigured looks
69
+ * exactly like one that is not installed, because both leave no question behind. A refused
70
+ * request at least proves something is trying.
71
+ */
72
+ recordContact(route: string, status: number): void;
73
+ private versionState;
74
+ /**
75
+ * What version the extension last claimed and whether it was refused for it (#1519).
76
+ *
77
+ * The accepted claims are recorded too, which is what clears a blocked banner: the moment an
78
+ * updated extension gets through, the last word is no longer a refusal.
79
+ */
80
+ recordVersion(got: string, expected: string, blocked: boolean): void;
81
+ /** The last version claim, or undefined while nothing has stated one. */
82
+ version(): BridgeVersion | undefined;
83
+ private helloState;
84
+ /** What the injected page script last said about itself. */
85
+ recordHello(hello: BridgeHello): void;
86
+ /** The page script's last report, or undefined if none has ever arrived. */
87
+ hello(): BridgeHello | undefined;
88
+ /** The last contact, or undefined if nothing has ever reached the bridge. */
89
+ lastContact(): BridgeContact | undefined;
90
+ private readonly statusBySession;
91
+ /**
92
+ * What claude.ai's session list last said about a session (#1332), as the Driver tab read it.
93
+ *
94
+ * This is the read-back a web run's own record cannot give: the run ends at its hand-off, so
95
+ * the record says `done` whether the session is parked on its user or finished hours ago.
96
+ */
97
+ recordStatus(status: BridgeSessionStatus): void;
98
+ /** The session's last list status, or undefined while the Driver has never reported one. */
99
+ status(sessionId: string): BridgeSessionStatus | undefined;
100
+ /**
101
+ * Whether the session is waiting on a human: the bridge holds the question it is parked on, or
102
+ * claude.ai's list shows it awaiting input — a question asked in prose carries no block for
103
+ * the bridge to hold, and the list is the only thing that says the session stopped for it.
104
+ *
105
+ * A list status older than the session window no longer counts: the Driver stops reading a
106
+ * session past the window, so its last word would otherwise stand forever.
107
+ */
108
+ waiting(sessionId: string, now?: Date): boolean;
109
+ /**
110
+ * Whether an extension is around (#1328): something reached the bridge and was let in within
111
+ * the window. The worker polls every half minute while it lives, so a longer silence means
112
+ * there is nobody to drain a request.
113
+ */
114
+ extensionAlive(now?: Date, windowMs?: number): boolean;
115
+ private readonly eventsBySession;
116
+ /**
117
+ * Record one transcript entry, keyed by its position.
118
+ *
119
+ * Keyed rather than appended because the page is re-read on every DOM change, so the same
120
+ * message arrives repeatedly and a growing list would be mostly duplicates. Position also lets
121
+ * a later read replace an earlier one, which is what a message still being streamed needs.
122
+ */
123
+ recordEvent(event: BridgeEvent): void;
124
+ /** That session's transcript so far, in order. */
125
+ events(sessionId: string): BridgeEvent[];
126
+ private readonly answersBySession;
127
+ /** The fingerprint of the question each session's `sent` answer resolved. */
128
+ private readonly answeredBySession;
129
+ /**
130
+ * Record the question a session is parked on, replacing any earlier one for that session.
131
+ *
132
+ * A question identical to one an answer was already delivered for is dropped: the extension's
133
+ * worker forgets what it sent when it restarts, and the answered block stays in the page's DOM,
134
+ * so the same question would otherwise resurface as parked right after being answered.
135
+ */
136
+ record(question: BridgeQuestion): void;
137
+ /**
138
+ * Queue an answer picked in the dashboard (#1237). Refuses anything but labels of the question
139
+ * currently parked — exactly one unless the question is `multi` — so the only text this can
140
+ * ever put in a composer is composed from what the session itself offered.
141
+ */
142
+ queueAnswer(sessionId: string, labels: string[]): BridgeAnswer | string;
143
+ /** Withdraw a queued answer. Too late once a Driver has collected it or the extension has delivered it. */
144
+ cancelAnswer(sessionId: string, now?: number): boolean;
145
+ /** The answer waiting for the extension to deliver, if any — collected by a Driver or not. */
146
+ pendingAnswer(sessionId: string): BridgeAnswer | undefined;
147
+ /** Whether a Driver holds the answer: collected, and not so long ago that it is presumed lost. */
148
+ private claimed;
149
+ /**
150
+ * Hand the queued answer to the Driver asking, once (#1332): the next Driver asking within the
151
+ * claim's lifetime gets nothing, so a session served by two browsers is not answered twice. A
152
+ * claim nobody acknowledged — the Driver died mid-delivery — expires, and the answer is offered
153
+ * again.
154
+ */
155
+ claimAnswer(sessionId: string, now?: number): BridgeAnswer | undefined;
156
+ /**
157
+ * Every session with an answer waiting to be delivered. The Driver serves these whatever the
158
+ * session window says: the page reports whichever session the user is on, so a pick can be for
159
+ * a session no listed run carries, and one nothing serves would sit queued forever.
160
+ */
161
+ pendingAnswerSessions(): string[];
162
+ /** The session's answer in whatever state, for the dashboard to render. */
163
+ answer(sessionId: string): BridgeAnswer | undefined;
164
+ /**
165
+ * The extension's word on what happened to a delivery. On success the question is resolved:
166
+ * it is dropped, and re-reports of the same block are ignored (see {@link record}).
167
+ */
168
+ resolveAnswer(sessionId: string, id: string, ok: boolean, note?: string): void;
169
+ /** The question that session is parked on, if the bridge has reported one. */
170
+ get(sessionId: string): BridgeQuestion | undefined;
171
+ /** Every parked question, newest first. */
172
+ list(): BridgeQuestion[];
173
+ /** Drop a session's question, once it is answered or its agent is gone. */
174
+ clear(sessionId: string): void;
175
+ }
176
+ export declare function bridgeQuestions(): BridgeQuestions;
177
+ /** Replace the store. Tests only: a module singleton would otherwise leak between them. */
178
+ export declare function resetBridgeQuestions(): void;
179
+ //# sourceMappingURL=bridge-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-store.d.ts","sourceRoot":"","sources":["../../src/dashboard/bridge-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAG1G;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,sGAAsG;AACtG,eAAO,MAAM,mBAAmB,QAAS,CAAA;AAKzC;;;;;;;;;;;GAWG;AACH,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,0FAA0F;AAC1F,MA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