@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,41 @@
1
+ // Which watched sessions the Driver tab visits this cycle (#1332). Shared by the service worker,
2
+ // which decides, and the offline harness, which pins the rule; loaded as a plain script in both.
3
+ //
4
+ // The rule exists because claude.ai's list statuses are sticky: an in-app visit clears neither
5
+ // "Awaiting input" nor "Unread response" (measured 2026-08-25), so visiting every stopped session
6
+ // on every cycle would mean 50 visits every half minute for 50 agents. A session is visited when
7
+ // its status changed to awaiting, unread or idle since the last read; an awaiting one also when it
8
+ // has not been visited for a while — a question asked in prose carries no block, so the list's
9
+ // word is the only signal and a re-read is what catches it (#1707); and any session always when
10
+ // the dashboard queued an answer for it — that is the one thing the list cannot know.
11
+
12
+ /** How long a session the list keeps calling awaiting waits before being looked at again. */
13
+ const REVISIT_MS = 5 * 60_000
14
+
15
+ /** The list statuses that mean the session stopped: for its user, after a turn, or for good. */
16
+ const ON_CHANGE = new Set(['awaiting', 'unread', 'idle'])
17
+
18
+ /** The one status also revisited on age: the session may be asking without a block. */
19
+ const ON_AGE = new Set(['awaiting'])
20
+
21
+ /**
22
+ * `statuses`: what the list said, `[{sessionId, status}]`. `answers`: a map of session id to the
23
+ * queued answer. `seen`: a map of session id to `{status, visitedAt}` from earlier cycles. Returns
24
+ * the visits in list order, each `{id, status, answer?}`.
25
+ */
26
+ function planVisits(statuses, answers, seen, now, revisitMs = REVISIT_MS) {
27
+ const visits = []
28
+ for (const { sessionId, status } of statuses) {
29
+ const answer = answers.get(sessionId)
30
+ const last = seen.get(sessionId)
31
+ const changed = !last || last.status !== status
32
+ const stale = !last || now - (last.visitedAt ?? 0) >= revisitMs
33
+ const due = (ON_CHANGE.has(status) && changed) || (ON_AGE.has(status) && stale)
34
+ if (answer || due) visits.push({ id: sessionId, status, ...(answer ? { answer } : {}) })
35
+ }
36
+ return visits
37
+ }
38
+
39
+ // The worker loads this with importScripts, where a top-level function is already global; jsdom
40
+ // evaluates it the same way. Nothing else to export.
41
+ if (typeof globalThis !== 'undefined') globalThis.__oaPlanVisits = planVisits
@@ -0,0 +1,43 @@
1
+ // Whether the extension's own files changed on disk (#1711). Shared by the service worker, which
2
+ // reloads the extension when they did, and the offline harness, which pins the rule; loaded as a
3
+ // plain script in both.
4
+ //
5
+ // This exists because the extension is unpacked and edited in place, and Chrome re-reads an
6
+ // unpacked extension's files only on a reload — which used to be a human click on
7
+ // chrome://extensions after every change. The worker can read its own files as they are on disk
8
+ // right now (measured 2026-08-26: a fetch of the extension's own URL returns the current file,
9
+ // not a cached copy), so it fingerprints them at start, again every beat, and reloads itself on
10
+ // a difference.
11
+
12
+ /** Every file Chrome loads for this extension: the manifest, the worker and what it imports, the content script, and the options page and its script. */
13
+ const WATCHED_FILES = ['manifest.json', 'background.js', 'driver-plan.js', 'fingerprint.js', 'content.js', 'options.html', 'options.js']
14
+
15
+ /** FNV-1a over the text, as eight hex digits. Enough to tell an edit; nobody is attacking it. */
16
+ function hashText(text) {
17
+ let hash = 0x811c9dc5
18
+ for (let i = 0; i < text.length; i++) {
19
+ hash ^= text.charCodeAt(i)
20
+ hash = Math.imul(hash, 0x01000193) >>> 0
21
+ }
22
+ return hash.toString(16).padStart(8, '0')
23
+ }
24
+
25
+ /**
26
+ * The hash of each watched file, read through `readText(file)`. A file that cannot be read fails
27
+ * the whole fingerprint rather than standing in as a change: a reload on a read that merely
28
+ * failed this once would loop.
29
+ */
30
+ async function fingerprint(readText) {
31
+ const hashes = {}
32
+ for (const file of WATCHED_FILES) hashes[file] = hashText(await readText(file))
33
+ return hashes
34
+ }
35
+
36
+ /** The watched files whose hash differs between two fingerprints, in watched order. */
37
+ function changedFiles(before, after) {
38
+ return WATCHED_FILES.filter(file => before[file] !== after[file])
39
+ }
40
+
41
+ // The worker loads this with importScripts, where a top-level binding is already global; jsdom
42
+ // evaluates it the same way. Nothing else to export.
43
+ if (typeof globalThis !== 'undefined') globalThis.__oaFingerprint = { WATCHED_FILES, fingerprint, changedFiles }
@@ -0,0 +1,31 @@
1
+ {
2
+ "manifest_version": 3,
3
+ "name": "OpenAgent: Claude web bridge",
4
+ "version": "0.13.0",
5
+ "description": "Drives one pinned claude.ai tab through your Claude Code cloud sessions: the question a session is parked on shows up in your local OpenAgent dashboard, and the answer you pick there is typed back into the session.",
6
+ "permissions": [
7
+ "storage",
8
+ "tabs",
9
+ "alarms"
10
+ ],
11
+ "host_permissions": [
12
+ "http://localhost/*",
13
+ "http://127.0.0.1/*"
14
+ ],
15
+ "background": {
16
+ "service_worker": "background.js"
17
+ },
18
+ "options_page": "options.html",
19
+ "content_scripts": [
20
+ {
21
+ "matches": [
22
+ "https://claude.ai/*"
23
+ ],
24
+ "js": [
25
+ "content.js"
26
+ ],
27
+ "run_at": "document_idle",
28
+ "all_frames": true
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,48 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>OpenAgent bridge</title>
6
+ <style>
7
+ body { font: 14px/1.5 ui-sans-serif, system-ui, sans-serif; margin: 24px; max-width: 560px; color: #1f2430; }
8
+ h1 { font-size: 17px; margin: 0 0 4px; }
9
+ p { color: #5b6472; margin: 0 0 16px; }
10
+ label { display: block; font-weight: 600; margin: 14px 0 4px; }
11
+ input { width: 100%; padding: 7px 9px; border: 1px solid #c9cfd8; border-radius: 6px; font: inherit; box-sizing: border-box; }
12
+ button { margin-top: 16px; padding: 7px 14px; border: 0; border-radius: 6px; background: #2d3441; color: #fff; font: inherit; cursor: pointer; }
13
+ code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
14
+ #status { margin-top: 12px; min-height: 20px; color: #2f7a3f; }
15
+ #status.error { color: #b3261e; }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <h1>OpenAgent bridge</h1>
20
+ <p>
21
+ Reports the question a Claude Code cloud session is parked on to your local dashboard. Turn the
22
+ bridge on in OpenAgent first, then paste its token here.
23
+ </p>
24
+
25
+ <label for="daemon">Dashboard URL</label>
26
+ <input id="daemon" type="url" placeholder="http://localhost:4200" />
27
+
28
+ <label for="token">Bridge token</label>
29
+ <input id="token" type="password" placeholder="paste the token from OpenAgent" autocomplete="off" />
30
+
31
+ <label style="font-weight:600;margin-top:18px;display:flex;align-items:center;gap:8px">
32
+ <input id="autoOpen" type="checkbox" style="width:auto" />
33
+ Run the Driver tab
34
+ </label>
35
+ <p style="margin:4px 0 0;font-size:12px">
36
+ One pinned background tab that reads claude.ai's session list, visits the cloud sessions
37
+ waiting on you, and types your answers. Without it the bridge does nothing. Closing the tab
38
+ pauses it; the button below reopens it.
39
+ </p>
40
+
41
+ <button id="save">Save and test</button>
42
+ <button id="openNow" style="background:#4a5566;margin-left:8px">Open the Driver tab now</button>
43
+ <div id="status" role="status"></div>
44
+ <p id="lastCycle" style="margin:10px 0 0;font-size:12px"></p>
45
+
46
+ <script src="options.js"></script>
47
+ </body>
48
+ </html>
@@ -0,0 +1,122 @@
1
+ // Where the token is set. It lives in extension storage rather than in the page, so nothing on
2
+ // claude.ai can read the secret that talks to the daemon.
3
+
4
+ const DEFAULT_DAEMON = 'http://localhost:4200'
5
+ const daemonEl = document.getElementById('daemon')
6
+ const tokenEl = document.getElementById('token')
7
+ const statusEl = document.getElementById('status')
8
+ const autoOpenEl = document.getElementById('autoOpen')
9
+ const lastCycleEl = document.getElementById('lastCycle')
10
+
11
+ void chrome.storage.local.get(['daemonUrl', 'token', 'autoOpen']).then(({ daemonUrl, token, autoOpen }) => {
12
+ daemonEl.value = daemonUrl || DEFAULT_DAEMON
13
+ tokenEl.value = token || ''
14
+ // Default on once configured, but stored explicitly so the worker never has to guess.
15
+ autoOpenEl.checked = autoOpen !== false
16
+ })
17
+
18
+ /**
19
+ * What the worker's last cycle did, as it recorded it: this page is the one place to read why
20
+ * the bridge is doing nothing — or that the worker just reloaded the extension because its files
21
+ * changed on disk — without opening a service worker console. Kept live while the page is open:
22
+ * the worker records every cycle, and each record re-renders the line.
23
+ */
24
+ function showLastCycle(lastCycle) {
25
+ if (!lastCycle) {
26
+ lastCycleEl.textContent = 'No cycle has run yet.'
27
+ return
28
+ }
29
+ const at = lastCycle.at ? ` at ${new Date(lastCycle.at).toLocaleTimeString()}` : ''
30
+ lastCycleEl.textContent = `Last cycle${at}: ${lastCycle.ok ? '' : 'failed — '}${lastCycle.reason ?? 'no reason recorded'}`
31
+ }
32
+ void chrome.storage.local.get('lastCycle').then(({ lastCycle }) => showLastCycle(lastCycle))
33
+ chrome.storage.onChanged.addListener((changes, area) => {
34
+ if (area === 'local' && changes.lastCycle) showLastCycle(changes.lastCycle.newValue)
35
+ })
36
+
37
+ function say(message, isError) {
38
+ statusEl.textContent = message
39
+ statusEl.className = isError ? 'error' : ''
40
+ }
41
+
42
+ /**
43
+ * Are the host permissions actually granted?
44
+ *
45
+ * Declaring them in the manifest is not the same as holding them: Chrome lists each site under
46
+ * "Site access" with its own toggle, and for an unpacked extension they can sit off. The daemon
47
+ * sends no CORS headers by design, so without the localhost grant the worker's fetch is blocked
48
+ * before it leaves the browser and the daemon sees nothing at all. That looked like every other
49
+ * failure and cost an evening, so it is checked first now.
50
+ */
51
+ async function missingHosts(daemonUrl) {
52
+ const wanted = [`${daemonUrl}/`, 'https://claude.ai/']
53
+ const missing = []
54
+ for (const origin of wanted) {
55
+ const ok = await chrome.permissions.contains({ origins: [`${origin}*`] }).catch(() => false)
56
+ if (!ok) missing.push(origin)
57
+ }
58
+ return missing
59
+ }
60
+
61
+ document.getElementById('save').addEventListener('click', async () => {
62
+ const daemonUrl = (daemonEl.value || DEFAULT_DAEMON).replace(/\/+$/, '')
63
+ const token = tokenEl.value.trim()
64
+ if (!token) return say('Paste the bridge token first.', true)
65
+ await chrome.storage.local.set({ daemonUrl, token, autoOpen: autoOpenEl.checked })
66
+
67
+ // Save then prove it: a token that is merely stored tells the user nothing, and the two ways
68
+ // this goes wrong (bridge off, wrong token) are worth telling apart before they need it.
69
+ say('Saved. Testing…')
70
+ const missing = await missingHosts(daemonUrl)
71
+ if (missing.length) {
72
+ return say(
73
+ `Chrome has not granted access to ${missing.join(' and ')}. Open chrome://extensions, find this extension, and switch those on under Site access.`,
74
+ true,
75
+ )
76
+ }
77
+ try {
78
+ const version = { 'x-oa-extension-version': chrome.runtime.getManifest().version }
79
+ const res = await fetch(`${daemonUrl}/_bridge/ping`, { headers: { authorization: `Bearer ${token}`, ...version } })
80
+ if (res.status === 401) return say('The dashboard is reachable but rejected the token.', true)
81
+ if (res.status === 404) return say('Reached the dashboard, but the bridge is off. Turn it on in OpenAgent.', true)
82
+ // The daemon refuses a version-skewed extension on every route (#1519); its answer names
83
+ // both versions and the way out, so hand it over verbatim.
84
+ if (res.status === 426) return say(await res.text(), true)
85
+ if (!res.ok) return say(`The dashboard answered ${res.status}.`, true)
86
+ // A 200 is not enough. The dashboard serves its single-page app for any path it does not
87
+ // recognise, so a build with no bridge route answers 200 and a page of HTML, and treating
88
+ // that as success would report "connected" to someone whose bridge does not exist.
89
+ const body = (await res.text()).trim()
90
+ if (body !== 'ok') return say('That dashboard has no bridge route. Update OpenAgent, then try again.', true)
91
+
92
+ // Prove the read path too, not just auth. "Connected" on its own leaves the next question
93
+ // unanswered: does the daemon actually have anything for us to watch?
94
+ let watching = ''
95
+ try {
96
+ const list = await fetch(`${daemonUrl}/_bridge/sessions`, { headers: { authorization: `Bearer ${token}`, ...version } })
97
+ const sessions = list.ok ? ((await list.json())?.sessions ?? []) : []
98
+ watching = sessions.length
99
+ ? ` Watching ${sessions.length} recent cloud session${sessions.length === 1 ? '' : 's'}${autoOpenEl.checked ? ', the Driver tab serves them.' : ' (the Driver tab is off).'}`
100
+ : ' No recent cloud sessions to watch yet.'
101
+ } catch {
102
+ watching = ' Could not list sessions.'
103
+ }
104
+ say(`Connected. The bridge is on and the token works.${watching}`)
105
+ } catch {
106
+ say(`Could not reach ${daemonUrl}. Is the dashboard running?`, true)
107
+ }
108
+ })
109
+
110
+
111
+ // Run a Driver cycle on demand. The alarm fires twice a minute, which is a long time to sit
112
+ // wondering whether anything is wrong, and every reason it might do nothing is reported. This
113
+ // also resumes a Driver the user paused by closing its tab.
114
+ document.getElementById('openNow').addEventListener('click', () => {
115
+ say('Driving…')
116
+ chrome.runtime.sendMessage({ type: 'oa-open-now' }, result => {
117
+ if (chrome.runtime.lastError) return say(chrome.runtime.lastError.message ?? 'the worker did not answer', true)
118
+ if (!result) return say('The worker did not answer. Try reloading the extension.', true)
119
+ if (!result.ok) return say(`Did nothing: ${result.reason}`, true)
120
+ say(`Driver cycle done: ${result.reason}.`)
121
+ })
122
+ })
package/dist/cli.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ import { type VersionFetcher } from './update-check.js';
2
+ /** Where the CLI writes. Injectable so tests capture output. */
3
+ export interface CliIO {
4
+ out: (line: string) => void;
5
+ err: (line: string) => void;
6
+ }
7
+ export declare function openagentVersion(): string;
8
+ /** What the CLI itself accepts: four options, no verbs (D4). */
9
+ export interface CliArgs {
10
+ help: boolean;
11
+ version: boolean;
12
+ /** `--port <n>`: the port the dashboard binds. Default {@link DEFAULT_DAEMON_PORT}; `0` is ephemeral. */
13
+ port?: number;
14
+ /**
15
+ * `--host <addr>` (#1051): the dashboard's bind address. Default loopback; a non-loopback
16
+ * address exposes it to the network and gates every route behind the generated shared token.
17
+ */
18
+ host?: string;
19
+ error?: string;
20
+ }
21
+ /**
22
+ * Parse argv (without the node/script prefix). Pure and testable.
23
+ *
24
+ * Four options and nothing else: `--host` and `--port` because they are the two things a browser
25
+ * cannot be asked and a dashboard cannot serve about itself; `--help` and `--version` because a
26
+ * command with options owes the user both. The command runs no agent (#1774): a run is started
27
+ * from the dashboard, by the project's own start hook.
28
+ */
29
+ export declare function parseArgs(argv: string[]): CliArgs;
30
+ export declare function runCli(argv: string[], io?: CliIO): Promise<number>;
31
+ /**
32
+ * The startup footer every dashboard path prints (#312): where prompts come from, the version,
33
+ * and then — once npm answers — whether that version is the latest.
34
+ *
35
+ * The update line is deliberately not awaited before the static lines. #312 asks for the static
36
+ * info first, and the foreground path (bare `openagent`) blocks on the server forever, so a line
37
+ * printed after the await would never appear there at all. `checkForUpdate` is already forgiving:
38
+ * offline or slow (2.5s cap) resolves to 'unknown', which prints nothing.
39
+ */
40
+ export declare function printStartupFooter(io: CliIO, opts?: {
41
+ fetchLatest?: VersionFetcher;
42
+ }): Promise<void>;
43
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0D,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAK/G,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5B;AAcD,wBAAgB,gBAAgB,IAAI,MAAM,CAYzC;AAqBD,gEAAgE;AAChE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CA8BjD;AAED,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBnF;AAmDD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,cAAc,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxG"}
package/dist/cli.js ADDED
@@ -0,0 +1,186 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { checkForUpdate, formatUpdateStatus, nodeVersionFetcher } from './update-check.js';
5
+ import { isLoopbackHost, runDaemon, DEFAULT_DAEMON_HOST, DEFAULT_DAEMON_PORT } from './daemon.js';
6
+ import { ensureDaemonToken } from './registry.js';
7
+ import { errorMessage } from './error-message.js';
8
+ const defaultIO = {
9
+ out: line => process.stdout.write(line + '\n'),
10
+ err: line => process.stderr.write(line + '\n'),
11
+ };
12
+ /**
13
+ * The CLI version, read from the package's own `package.json` at runtime (#312).
14
+ * The compiled entry lives one level under the package root (`dist/` or
15
+ * `dist-test/`), so its `package.json` is always `../package.json`. Cached after
16
+ * the first read; falls back to `unknown` if the file is somehow unreadable.
17
+ */
18
+ let cachedVersion;
19
+ export function openagentVersion() {
20
+ if (cachedVersion !== undefined)
21
+ return cachedVersion;
22
+ try {
23
+ const pkgPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
24
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
25
+ // `unknown`, not `0.0.0`: the packages are unreleased and legitimately versioned `0.0.0`, so a
26
+ // numeric fallback would make a failed read indistinguishable from a correct one (#312).
27
+ cachedVersion = pkg.version ?? 'unknown';
28
+ }
29
+ catch {
30
+ cachedVersion = 'unknown';
31
+ }
32
+ return cachedVersion;
33
+ }
34
+ const HELP = `OpenAgent — turnkey AI orchestration that wraps a coding agent (Claude Code or Codex).
35
+
36
+ Usage:
37
+ openagent Serve the dashboard in the foreground. Ctrl+C closes it; the server
38
+ logs stream to this terminal.
39
+
40
+ Options:
41
+ --port <n> Dashboard port (default: 4200).
42
+ --host <addr> Bind address (default: 127.0.0.1, localhost only). A non-loopback
43
+ address (e.g. 0.0.0.0) exposes the dashboard to your network and
44
+ generates a shared token; the printed URL carries it, and any request
45
+ without it gets 401. Exposing a process spawner to the network is a
46
+ security decision (#806).
47
+ -h, --help Show this help.
48
+ -v, --version Print the version.
49
+
50
+ Everything else is the dashboard: it shows a project's runs from their files, and starts one
51
+ through the project's own start hook (.openagent/hooks.yml), which names the tool that runs it.`;
52
+ /**
53
+ * Parse argv (without the node/script prefix). Pure and testable.
54
+ *
55
+ * Four options and nothing else: `--host` and `--port` because they are the two things a browser
56
+ * cannot be asked and a dashboard cannot serve about itself; `--help` and `--version` because a
57
+ * command with options owes the user both. The command runs no agent (#1774): a run is started
58
+ * from the dashboard, by the project's own start hook.
59
+ */
60
+ export function parseArgs(argv) {
61
+ const opts = { help: false, version: false };
62
+ for (let i = 0; i < argv.length; i++) {
63
+ const arg = argv[i];
64
+ switch (arg) {
65
+ case '--help':
66
+ case '-h':
67
+ opts.help = true;
68
+ break;
69
+ case '--version':
70
+ case '-v':
71
+ opts.version = true;
72
+ break;
73
+ case '--port': {
74
+ const n = Number(argv[++i]);
75
+ if (Number.isInteger(n) && n >= 0)
76
+ opts.port = n;
77
+ else
78
+ opts.error = 'invalid --port: must be a non-negative integer';
79
+ break;
80
+ }
81
+ case '--host': {
82
+ const value = argv[++i];
83
+ if (value === undefined)
84
+ opts.error = 'invalid --host: missing address';
85
+ else
86
+ opts.host = value;
87
+ break;
88
+ }
89
+ default:
90
+ opts.error = arg.startsWith('-') ? `unknown option: ${arg}` : `unknown command: ${arg}`;
91
+ }
92
+ }
93
+ return opts;
94
+ }
95
+ export async function runCli(argv, io = defaultIO) {
96
+ const args = parseArgs(argv);
97
+ if (args.error) {
98
+ io.err(args.error);
99
+ io.err('Run `openagent --help` for usage.');
100
+ return 2;
101
+ }
102
+ if (args.help) {
103
+ io.out(HELP);
104
+ return 0;
105
+ }
106
+ if (args.version) {
107
+ io.out(openagentVersion());
108
+ return 0;
109
+ }
110
+ // Everything else is bare `openagent`: serve the dashboard in the foreground until Ctrl-C.
111
+ return runForegroundDaemonCmd(args, io);
112
+ }
113
+ /**
114
+ * Bare `openagent`: run the dashboard server in the foreground (#456), so its logs and any
115
+ * server-thrown errors are visible and Ctrl+C stops it. Blocks until the server is signalled
116
+ * (SIGINT/SIGTERM).
117
+ */
118
+ async function runForegroundDaemonCmd(args, io) {
119
+ const cwd = process.cwd();
120
+ const port = args.port ?? DEFAULT_DAEMON_PORT;
121
+ const host = args.host;
122
+ // #1051: pre-generate the shared token for a non-loopback bind so onListening (sync) can print
123
+ // the reachable URL; runDaemon reuses the same persisted token.
124
+ const token = host !== undefined && !isLoopbackHost(host) ? await ensureDaemonToken() : undefined;
125
+ try {
126
+ await runDaemon(cwd, {
127
+ port,
128
+ ...(host !== undefined ? { host } : {}),
129
+ onListening: state => {
130
+ io.out(`◆ dashboard running: ${state.url}`);
131
+ if (!isLoopbackHost(state.host ?? DEFAULT_DAEMON_HOST)) {
132
+ printNonLoopbackAccess(io, state.host ?? DEFAULT_DAEMON_HOST, state.url, token);
133
+ }
134
+ io.out(' Ctrl+C to stop the dashboard. Server logs stream below.');
135
+ // #312 asks bare `openagent` to print the commands + version too. onListening is sync and
136
+ // runDaemon then blocks until signalled, so this is fire-and-forget by necessity: the
137
+ // update line lands a moment later, above the server logs.
138
+ void printStartupFooter(io);
139
+ },
140
+ });
141
+ }
142
+ catch (err) {
143
+ io.err(`could not start the dashboard (${errorMessage(err)}).`);
144
+ return 1;
145
+ }
146
+ return 0;
147
+ }
148
+ /**
149
+ * The loud one-line warning and the token-bearing URL printed on any non-loopback daemon bind
150
+ * (#1051). A daemon that spawns processes is code execution for anyone who reaches the port, and
151
+ * the shared token is the only guard, so this says so before the daemon is left running. The bound
152
+ * host is a bind-all like `0.0.0.0`, so the user swaps it for the machine's actual reachable
153
+ * address (a Tailscale/LAN hostname); the token rides the URL for the first hop, then the cookie.
154
+ */
155
+ function printNonLoopbackAccess(io, host, url, token) {
156
+ io.err(`⚠ SECURITY: bound to ${host} (non-loopback). This exposes code execution to your network; the shared token is the only guard (#1051).`);
157
+ if (!token)
158
+ return;
159
+ io.out(` Open with the token (swap ${host} for this machine's reachable address, e.g. a Tailscale hostname):`);
160
+ io.out(` ${url}/?token=${token}`);
161
+ }
162
+ /**
163
+ * The startup footer every dashboard path prints (#312): where prompts come from, the version,
164
+ * and then — once npm answers — whether that version is the latest.
165
+ *
166
+ * The update line is deliberately not awaited before the static lines. #312 asks for the static
167
+ * info first, and the foreground path (bare `openagent`) blocks on the server forever, so a line
168
+ * printed after the await would never appear there at all. `checkForUpdate` is already forgiving:
169
+ * offline or slow (2.5s cap) resolves to 'unknown', which prints nothing.
170
+ */
171
+ export function printStartupFooter(io, opts = {}) {
172
+ const version = openagentVersion();
173
+ io.out('');
174
+ io.out('Type a prompt on the dashboard to start an agent, or use:');
175
+ io.out(' openagent --help All options');
176
+ io.out('');
177
+ io.out(`OpenAgent v${version}`);
178
+ return checkForUpdate(version, opts.fetchLatest ?? nodeVersionFetcher())
179
+ .then(status => {
180
+ const line = formatUpdateStatus(status);
181
+ if (line)
182
+ io.out(line);
183
+ })
184
+ .catch(() => { });
185
+ }
186
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAuB,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAQjD,MAAM,SA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QACvC,IAAI,IAAI;YAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AACpB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export { DRIVERS, DRIVER_LABELS, isDriverName, driverFromImpl, type DriverName } from './driver-names.js';
2
+ export { PUBLISH_LABELS, isPublishPick, offeredPublishPicks, publishPickIn, type PublishPick } from './publish-levels.js';
3
+ export { formatOpenAgentEvent } from './terminal.js';
4
+ export { formatBytes } from './format-bytes.js';
5
+ export { errorMessage } from './error-message.js';
6
+ export { pickedIds } from './events.js';
7
+ export { sessionInfo, agentErrors, type SessionInfo, type AgentError, } from './agent-view.js';
8
+ export { pendingChoices } from './open-choices.js';
9
+ export { interventionKey, activityKey } from './dashboard/keys.js';
10
+ export { SeenTracker } from './dashboard/keyed-watcher.js';
11
+ export type { ProjectionRead } from './dashboard/projects.js';
12
+ export { NOTIFICATION_DEFAULTS, MAX_SPEND_OFFSET, notifies, browserNotifyEnabled, notifyCategoryEnabled, type NotifyCategory } from './preference-defaults.js';
13
+ export { isLoopbackHost } from './loopback-host.js';
14
+ export { bridgeChoiceRequest } from './dashboard/bridge-question.js';
15
+ export { cloudRunState, cloudRunActive, CLOUD_SESSION_WINDOW_MS, type CloudRunState } from './cloud-run-state.js';
16
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,WAAW,EACX,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAIlE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAI9J,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA"}
package/dist/client.js ADDED
@@ -0,0 +1,30 @@
1
+ // Browser-safe entry for the dashboard client (#431). Only pure event projections live
2
+ // here — `formatOpenAgentEvent` and the run-view derivations — with no Node imports, so
3
+ // the client can import these at runtime without dragging the server barrel (relay,
4
+ // sandbox, node:fs/http, …) into the browser bundle. Types come from the root entry.
5
+ export { DRIVERS, DRIVER_LABELS, isDriverName, driverFromImpl } from './driver-names.js';
6
+ export { PUBLISH_LABELS, isPublishPick, offeredPublishPicks, publishPickIn } from './publish-levels.js';
7
+ export { formatOpenAgentEvent } from './terminal.js';
8
+ export { formatBytes } from './format-bytes.js';
9
+ export { errorMessage } from './error-message.js';
10
+ export { pickedIds } from './events.js';
11
+ export { sessionInfo, agentErrors, } from './agent-view.js';
12
+ // Which questions a run still waits on: one rule for the run page and the daemon's own reads.
13
+ export { pendingChoices } from './open-choices.js';
14
+ // The identity of a notification feed's item (#627). Pure, so the dashboard shares it with the
15
+ // item types rather than keeping a copy that drifts silently.
16
+ export { interventionKey, activityKey } from './dashboard/keys.js';
17
+ // The baseline half of the same engine (#1625): what counts as "already there" when a feed is first
18
+ // seen. The dashboard used to decide that by counting observations, which made a page loaded with no
19
+ // git host reach take an empty backlog for a real one. Pure, and its only import is a type.
20
+ export { SeenTracker } from './dashboard/keyed-watcher.js';
21
+ export { NOTIFICATION_DEFAULTS, MAX_SPEND_OFFSET, notifies, browserNotifyEnabled, notifyCategoryEnabled } from './preference-defaults.js';
22
+ // Whether an address is truly local (#1051). The daemon decides the token gate with it and the
23
+ // dashboard labels the connection with it, so they must agree on what "local" means — the browser
24
+ // kept its own looser copy, which answered `false` for every 127.0.0.0/8 address but the first.
25
+ export { isLoopbackHost } from './loopback-host.js';
26
+ // A bridged question as the gate panel renders it (#1554): pure, so the client projects it itself.
27
+ export { bridgeChoiceRequest } from './dashboard/bridge-question.js';
28
+ // What a web run's cloud side is doing, from its record (#1668): pure, so every surface derives the same word.
29
+ export { cloudRunState, cloudRunActive, CLOUD_SESSION_WINDOW_MS } from './cloud-run-state.js';
30
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wFAAwF;AACxF,oFAAoF;AACpF,qFAAqF;AACrF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAA;AACzG,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAA;AACzH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EACL,WAAW,EACX,WAAW,GAGZ,MAAM,iBAAiB,CAAA;AACxB,8FAA8F;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,+FAA+F;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAClE,oGAAoG;AACpG,qGAAqG;AACrG,4FAA4F;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAE1D,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,oBAAoB,EAAE,qBAAqB,EAAuB,MAAM,0BAA0B,CAAA;AAC9J,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,mGAAmG;AACnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,+GAA+G;AAC/G,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAsB,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,27 @@
1
+ import type { AgentMeta } from './store/agent-store.js';
2
+ /**
3
+ * How long after its start a run's cloud session is still assumed to be alive. The same window
4
+ * the browser bridge watches a session for (`bridge-sessions`): past it nothing could learn the
5
+ * session is parked, so "in cloud" would be a guess nobody can correct — hence "done".
6
+ */
7
+ export declare const CLOUD_SESSION_WINDOW_MS: number;
8
+ /**
9
+ * What the cloud side of a web run is doing.
10
+ *
11
+ * - `waiting`: the browser bridge holds a question the session is parked on
12
+ * - `merged`: the session's work was adopted (#1601) and its pull request merged by OpenAgent
13
+ * - `in-cloud`: no pull request yet and the run is inside the session window, so it may still be working
14
+ * - `done`: its pull request exists — the work landed, and the PR badge carries its live state — or the
15
+ * window passed with nothing adopted: the session finished or never pushed
16
+ */
17
+ export type CloudRunState = 'waiting' | 'merged' | 'in-cloud' | 'done';
18
+ /** The fields of a run's record the projection reads. */
19
+ export type CloudRunFacts = Pick<AgentMeta, 'target' | 'status' | 'startedAt' | 'pr' | 'mergeOutcome' | 'cloudWaiting'>;
20
+ /**
21
+ * The cloud state of a web run whose local half is over, or undefined for any other run — a
22
+ * local run, or a web run still handing off, stopped or failed — whose stored status is the word.
23
+ */
24
+ export declare function cloudRunState(meta: CloudRunFacts, now: number): CloudRunState | undefined;
25
+ /** Whether the cloud side still counts as an agent at work: in its session, or waiting on a human. */
26
+ export declare function cloudRunActive(state: CloudRunState | undefined): boolean;
27
+ //# sourceMappingURL=cloud-run-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-run-state.d.ts","sourceRoot":"","sources":["../src/cloud-run-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAUvD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAsB,CAAA;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;AAEtE,yDAAyD;AACzD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,IAAI,GAAG,cAAc,GAAG,cAAc,CAAC,CAAA;AAEvH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CASzF;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAExE"}