@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,370 @@
1
+ import { findAgent, findCheckout, readLiveMetas, readAllAgents, readDoing, loadAgentEvents, startedAtFromAgentId, isPidAlive, isRunId, projectBranches } from '../store/index.js';
2
+ import { listProjectWorktrees } from '../worktrees.js';
3
+ import { projectGitHost } from '../store/git-host.js';
4
+ import { repositoryOffer } from '../store/repository.js';
5
+ import { readDocs } from '../dashboard/docs.js';
6
+ import { collectQueue } from '../dashboard/queue.js';
7
+ import { buildOverview, buildRecentAgents } from '../dashboard/overview.js';
8
+ import { buildInterventions } from '../dashboard/interventions.js';
9
+ import { buildOpenQuestions } from '../dashboard/open-questions.js';
10
+ import { buildActivity } from '../dashboard/activity.js';
11
+ import { buildDashboard } from '../dashboard/dashboard.js';
12
+ import { readGitStatus } from '../dashboard/git-status.js';
13
+ import { readRunHandoff, resolveAgentPr } from '../dashboard/agent-handoff.js';
14
+ import { crawlRepoFiles } from '../project.js';
15
+ import { contextBridgeBrowser, contextProjects, contextRemote, resolveProjectPath, resolveAgentPath } from './context.js';
16
+ import { relayOr } from './relay-agent.js';
17
+ import { bridgeQuestions } from '../dashboard/bridge-store.js';
18
+ import { readDaemonToken, readPreferences } from '../registry.js';
19
+ import { hostname } from 'node:os';
20
+ // The read model behind the dashboard (#405): the agent history, an agent's replay, and the
21
+ // surfaced PLAN/TODO docs — each keyed by project id and backed by
22
+ // the readers that own those files, so the dashboard stays a projection of the same files. They live beside the daemon rather than in the
23
+ // browser's own tree so it can serve them in-process; the dashboard calls them by name over
24
+ // `POST /_rpc/<name>`. The live agent stream is its own endpoint (`GET /_rpc/events`).
25
+ /**
26
+ * Resolve a project id and run a forgiving read against its workspace: an unknown project
27
+ * or a failing read both fall back to `empty`. The uniform readers below are one call each
28
+ * over this; the agent history and null-returning git readers stay bespoke (extra logic or a
29
+ * distinct empty).
30
+ */
31
+ async function withProject(projectId, read, empty) {
32
+ const cwd = await resolveProjectPath(projectId);
33
+ return cwd ? read(cwd).catch(() => empty) : empty;
34
+ }
35
+ /**
36
+ * The `withProject` twin for a run-scoped read: resolve the checkout a `agentId` names (its own
37
+ * worktree while live, else the project root, #738), then read forgivingly. An absent project
38
+ * or a failing read both fall back to `empty`.
39
+ */
40
+ async function withAgentPath(projectId, agentId, read, empty) {
41
+ const cwd = await resolveAgentPath(projectId, agentId);
42
+ return cwd ? read(cwd).catch(() => empty) : empty;
43
+ }
44
+ /** Run a cross-project rollup over every registered project, tolerating a failed registry read. */
45
+ async function withProjects(build) {
46
+ const projects = await contextProjects().list().catch(() => []);
47
+ return build(projects);
48
+ }
49
+ /**
50
+ * The project's runs, most-recent first (or `[]`). The archived (finished) runs
51
+ * from `agents/`, plus every live agent prepended — so the sidebar shows an in-progress
52
+ * run with a `running` status the moment it starts, not only after it closes.
53
+ *
54
+ * Since #736 a project has any number of live agents, each in its own worktree, so this reads
55
+ * them all (#738) instead of the single one that used to sit at the project path. They come
56
+ * back as {@link LiveAgent}s, carrying the `cwd` of the checkout that agent is editing.
57
+ *
58
+ * One row per id, and where both a live and an archived copy exist the live one wins (#768): a
59
+ * continued run (#762) has an archive from its first leg while being live again, and the archive
60
+ * would otherwise show a running agent as finished. The status is not filtered on: `readLiveMeta`
61
+ * may have just self-healed a dead agent to `stopped` (#716), and that freshly-archived row can
62
+ * lag `listAgents` by a poll — keeping it regardless leaves the row visible with no flicker.
63
+ *
64
+ * An agent relayed to a connected device (#1067) lives only in the daemon's memory, never on disk, so
65
+ * its in-memory stub is merged in too (#1077): that is what re-opens it after a dashboard reload
66
+ * instead of losing it.
67
+ */
68
+ export async function onAgents(projectId) {
69
+ // The relayed-agent stubs (#1077). Read up front by habit rather than by necessity now: the
70
+ // context was request-scoped and evaporated at the first await, so reading it late dropped
71
+ // every remote agent from the list on a reload. It is wired once at start-up (F3), so an await
72
+ // no longer costs anything — nothing here depends on this staying above one.
73
+ const remote = contextRemote()?.list(projectId) ?? [];
74
+ const cwd = await resolveProjectPath(projectId);
75
+ const local = cwd ? (await readAllAgents(cwd)).map(forDashboard) : [];
76
+ if (remote.length === 0)
77
+ return local;
78
+ // A relayed agent (#1067) lives only in the daemon's memory, not on disk; surface it in the list so
79
+ // a reload re-opens it instead of losing it. Remote wins an id tie (it is the live authority).
80
+ return [...remote, ...local.filter(agent => !remote.some(r => r.id === agent.id))];
81
+ }
82
+ /**
83
+ * A web run whose cloud session is waiting on a human — the bridge holds its parked question, or
84
+ * claude.ai's session list shows it awaiting input (#1332) — is marked waiting (#1668), so its row
85
+ * says so instead of "in cloud": the archive on disk cannot know, only the daemon's bridge store
86
+ * does. Every other run passes through untouched.
87
+ */
88
+ export function markCloudWaiting(agent) {
89
+ if (agent.target !== 'web' || !agent.sessionId || !bridgeQuestions().waiting(agent.sessionId))
90
+ return agent;
91
+ return { ...agent, cloudWaiting: true };
92
+ }
93
+ /**
94
+ * A run another machine's daemon started is marked as from another host (#1648): the data branch
95
+ * is shared precisely so other machines' runs show up here, and a row that looked exactly like
96
+ * one of this daemon's own sent the user reading the archive by hand to learn whose it was. A run
97
+ * with no recorded host predates the field and passes through untouched.
98
+ */
99
+ export function markOtherHost(agent, thisHost = hostname()) {
100
+ if (agent.host === undefined || agent.host === thisHost)
101
+ return agent;
102
+ return { ...agent, otherHost: true };
103
+ }
104
+ /**
105
+ * A run that ended clean while the process its card names is still alive on this host is marked
106
+ * saving: the tool that runs it saves the run's record and cleans up its checkout after the card says
107
+ * done, and a row that said "done" through that window read as finished with nothing coming. A
108
+ * run of another host, or with no recorded process, passes through untouched.
109
+ */
110
+ export function markSaving(agent, thisHost = hostname(), alive = isPidAlive) {
111
+ if (agent.status !== 'done' || agent.pid === undefined || agent.host !== thisHost || !alive(agent.pid))
112
+ return agent;
113
+ return { ...agent, saving: true };
114
+ }
115
+ /** Every annotation a run's record gets on its way to the dashboard: what the daemon knows and the disk cannot. */
116
+ function forDashboard(agent) {
117
+ return markSaving(markOtherHost(markCloudWaiting(agent)));
118
+ }
119
+ /**
120
+ * The agent ids that still have a worktree on disk (#737). An agent that failed or was stopped keeps
121
+ * its checkout so you can go look at what it was holding; this is how the dashboard knows which
122
+ * finished run has one to offer removing. Live agents are excluded — their worktree is in use.
123
+ */
124
+ export async function onRetainedWorktrees(projectId) {
125
+ const cwd = await resolveProjectPath(projectId);
126
+ if (!cwd)
127
+ return [];
128
+ const rows = await listProjectWorktrees(cwd, { sizes: false }).catch(() => []);
129
+ return rows.filter(row => !row.live).map(row => row.agentId);
130
+ }
131
+ /**
132
+ * Where a session is working (#798): the checkout it has, its branch, whether it is holding
133
+ * uncommitted changes, and — once it is no longer live — what that checkout costs on disk.
134
+ *
135
+ * The dashboard could not answer "where is this session working". The git status bar reads the
136
+ * *project*, so a session's own branch was visible nowhere, and a worktree an agent kept (#737) was
137
+ * a name in a list with no size and no way in.
138
+ *
139
+ * Every run works in a checkout of its own, so once that checkout is gone there is no tree left to
140
+ * be clean or dirty: the answer is then only what the run recorded, its branch and its pull
141
+ * request. It used to fall back to the project's root and report the user's own checkout (their
142
+ * branch, their "clean") as the run's.
143
+ */
144
+ export async function onAgentWorktree(projectId, agentId) {
145
+ return relayOr(agentId, 'onAgentWorktree', [projectId, agentId], async () => {
146
+ const root = await resolveProjectPath(projectId);
147
+ if (!root || !isRunId(agentId))
148
+ return null;
149
+ const checkout = await findCheckout(root, agentId, projectBranches);
150
+ if (!checkout) {
151
+ // The checkout's branch was the agent's; with no checkout the record is the only witness.
152
+ const agent = await findAgent(root, agentId).catch(() => undefined);
153
+ if (!agent)
154
+ return null;
155
+ const pr = await resolveAgentPr(root, agent).catch(() => ({ value: undefined, pending: false }));
156
+ return {
157
+ ...(agent.branch ? { branch: agent.branch } : {}),
158
+ ...(pr.value ? { pr: pr.value } : {}),
159
+ ...(pr.pending ? { prPending: true } : {}),
160
+ };
161
+ }
162
+ // Since-filtered like every run-scoped PR read (#1255): the checkout's branch is the agent's,
163
+ // but a reused pinned branch has a predecessor's PR history.
164
+ const since = startedAtFromAgentId(agentId);
165
+ const [status, live] = await Promise.all([
166
+ readGitStatus(checkout.path, { prRoot: root, ...(since !== undefined ? { since } : {}) }).catch(() => undefined),
167
+ readLiveMetas(root).catch(() => []),
168
+ ]);
169
+ // Size is only read for a checkout nothing is writing to: a live agent's tree changes under the
170
+ // poll, and a size over a build directory mid-build is a cost with no answer worth having. The
171
+ // provider's sized listing is where a checkout's size comes from (#1774).
172
+ const running = live.some(agent => agent.id === agentId && agent.status === 'running');
173
+ const size = running ? undefined : (await (await projectBranches(root).catch(() => undefined))?.list({ sizes: true }).catch(() => []))?.find(row => row.id === agentId)?.sizeBytes;
174
+ return {
175
+ checkout: { path: checkout.path, dirty: status?.dirty ?? false, ...(size !== undefined ? { sizeBytes: size } : {}) },
176
+ ...(status?.branch ? { branch: status.branch } : {}),
177
+ // A session's branch is exactly the thing that has a PR (#809), so the bar can show it
178
+ // like the project's does.
179
+ ...(status?.pr ? { pr: status.pr } : {}),
180
+ // Still being looked up rather than absent (#1028), so the bar can ask again shortly.
181
+ ...(status?.prPending ? { prPending: true } : {}),
182
+ };
183
+ }, null);
184
+ }
185
+ /** One archived agent's event log for replay (or `[]` when the agent or project is gone). */
186
+ export async function onAgent(projectId, agentId) {
187
+ return relayOr(agentId, 'onAgent', [projectId, agentId], async () => {
188
+ const cwd = await resolveProjectPath(projectId);
189
+ if (!cwd)
190
+ return [];
191
+ return (await loadAgentEvents(cwd, agentId).catch(() => undefined)) ?? [];
192
+ }, []);
193
+ }
194
+ /** What each of the named runs of a project is doing now, by id; a run that is not working has no entry. */
195
+ export async function onAgentsDoing(projectId, agentIds) {
196
+ const cwd = await resolveProjectPath(projectId);
197
+ if (!cwd)
198
+ return {};
199
+ return readDoing(cwd, agentIds).catch(() => ({}));
200
+ }
201
+ /** The surfaced PLAN/TODO docs at the workspace root, in sidebar order (or `[]`). */
202
+ export async function onDocs(projectId) {
203
+ return withProject(projectId, readDocs, []);
204
+ }
205
+ /** The aggregated open TODO queue across every registered project (#438), most-open first. */
206
+ export async function onQueue() {
207
+ return withProjects(collectQueue);
208
+ }
209
+ /** The cross-project Overview (#437): what is running now, the queue size, and recent projects. */
210
+ export async function onOverview() {
211
+ return withProjects(buildOverview);
212
+ }
213
+ /** Recent sessions pooled across every project (#shared-shell), newest first, for the home rail. */
214
+ export async function onRecentAgents() {
215
+ const recent = await withProjects(projects => buildRecentAgents(projects));
216
+ return recent.map(row => ({ ...row, agent: forDashboard(row.agent) }));
217
+ }
218
+ /**
219
+ * The cross-project interventions queue (#632, Queue #624): open PRs that need review, newest first,
220
+ * plus which projects were read whole (#1625).
221
+ *
222
+ * The panels render `items` and ignore the rest. The browser's notifier is the caller that cannot:
223
+ * it keeps a baseline of what was already waiting when the page opened, and a queue that came back
224
+ * empty because the git host was unreachable is not a baseline — taking it for one announces the whole
225
+ * backlog the moment the git host answers.
226
+ */
227
+ export async function onInterventions() {
228
+ return withProjects(buildInterventions);
229
+ }
230
+ /** Every session's open question with its full gate (#1455), longest-waiting first: the launcher's hub. */
231
+ export async function onOpenQuestions() {
232
+ return withProjects(buildOpenQuestions);
233
+ }
234
+ /**
235
+ * The cross-project "New activity" feed (#627): recent run started/finished transitions, newest
236
+ * first, with the projects that were read whole beside them (#1625) — see {@link onInterventions}.
237
+ */
238
+ export async function onActivity() {
239
+ return withProjects(buildActivity);
240
+ }
241
+ /** The Overview dashboard page (#471): the {@link onOverview} rollup plus agent counts, run-status totals, and activity. */
242
+ export async function onDashboard() {
243
+ return withProjects(buildDashboard);
244
+ }
245
+ /**
246
+ * The project's files for the `#` context picker (#504) and the Context's file count (#661): every
247
+ * file git sees (tracked + untracked, honoring .gitignore), repo-relative and sorted, via
248
+ * `git ls-files`. Localhost-only by nature — the relay has no checkout, so it resolves `[]`.
249
+ * Pass a live `agentId` to list that agent's worktree instead of the project root (#738). The
250
+ * Files tab reads its own list, through its module.
251
+ */
252
+ export async function onProjectFiles(projectId, agentId) {
253
+ return relayOr(agentId, 'onProjectFiles', [projectId, agentId], () => withAgentPath(projectId, agentId, crawlRepoFiles, []), []);
254
+ }
255
+ /** The project's page on its git host and the git host's name (#489, #1820), or null: no git host package, no remote there, or the relay. */
256
+ export async function onGitHostHome(projectId) {
257
+ const cwd = await resolveProjectPath(projectId);
258
+ if (!cwd)
259
+ return null;
260
+ const gitHost = await projectGitHost(cwd).catch(() => undefined);
261
+ return (await gitHost?.home()) ?? null;
262
+ }
263
+ /** The repository the project's provider offers to create for it (a project with no remote), or null: no provider, a remote already there, the host out of reach, or the relay. */
264
+ export async function onRepositoryOffer(projectId) {
265
+ const cwd = await resolveProjectPath(projectId);
266
+ if (!cwd)
267
+ return null;
268
+ return (await repositoryOffer(cwd)) ?? null;
269
+ }
270
+ /**
271
+ * The project's git status (#491): active branch, dirty flag, linked PR. Null when not a repo /
272
+ * relay. Pass a live `agentId` to read that agent's worktree, which is the branch and the dirty
273
+ * state that actually belong to it (#738). A run-scoped read is since-filtered (#1255): an agent on
274
+ * a reused pinned branch must not wear a predecessor's merged PR as its own badge.
275
+ */
276
+ export async function onGitStatus(projectId, agentId) {
277
+ return relayOr(agentId, 'onGitStatus', [projectId, agentId], async () => {
278
+ const cwd = await resolveAgentPath(projectId, agentId);
279
+ if (!cwd)
280
+ return null;
281
+ const since = agentId !== undefined ? startedAtFromAgentId(agentId) : undefined;
282
+ return (await readGitStatus(cwd, since !== undefined ? { since } : {})) ?? null;
283
+ }, null);
284
+ }
285
+ /**
286
+ * The end-of-session handoff (#799): the branch a finished session left its work on, what it
287
+ * committed, what it changed, and whether that has been pushed or opened as a PR.
288
+ *
289
+ * Read from the *project* checkout against the session's branch, not from the session's worktree.
290
+ * A clean agent's worktree is removed when it finishes, and `resolveAgentPath` then falls back to the
291
+ * project root — so a worktree-addressed read reports the project's own branch and the user's own
292
+ * uncommitted changes as though they were the session's. The branch is what outlives the agent, so
293
+ * the branch is what this asks about.
294
+ */
295
+ export async function onAgentHandoff(projectId, agentId) {
296
+ return relayOr(agentId, 'onAgentHandoff', [projectId, agentId], async () => {
297
+ const cwd = await resolveProjectPath(projectId);
298
+ if (!cwd || !isRunId(agentId))
299
+ return null;
300
+ const agent = await findAgent(cwd, agentId).catch(() => undefined);
301
+ return (agent && (await readRunHandoff(cwd, agent).catch(() => undefined))) ?? null;
302
+ }, null);
303
+ }
304
+ /**
305
+ * The question a Claude web session is parked on, as reported by the browser bridge (#1237).
306
+ *
307
+ * Keyed by cloud session id rather than agent id because that is what the bridge can see: it reads
308
+ * a claude.ai page, which knows its session and nothing about our runs. The agent view already
309
+ * derives that id from the agent's own `cloud <url>` event, so the join happens on the client
310
+ * without the daemon having to index runs by session.
311
+ *
312
+ * Returns null for anything unrecognised, so an agent with no bridge, no question, or a target that
313
+ * is not `web` renders exactly as it did before.
314
+ */
315
+ export async function onBridgeQuestion(sessionId) {
316
+ if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
317
+ return null;
318
+ return bridgeQuestions().get(sessionId) ?? null;
319
+ }
320
+ /**
321
+ * Whether anything has reached the browser bridge, and how it went (#1237).
322
+ *
323
+ * A misconfigured extension and an uninstalled one both leave no question behind, so "nothing is
324
+ * showing" cannot be diagnosed from the questions alone. A refused request at least proves
325
+ * something is trying, and its status says which half is wrong.
326
+ */
327
+ export async function onBridgeStatus() {
328
+ const store = bridgeQuestions();
329
+ return {
330
+ lastContact: store.lastContact() ?? null,
331
+ questions: store.list().length,
332
+ page: store.hello() ?? null,
333
+ version: store.version() ?? null,
334
+ };
335
+ }
336
+ /**
337
+ * The bridge token, for the setup step where a user pastes it into the extension (#1237).
338
+ *
339
+ * Only while the bridge is on, so a daemon with the feature off never hands the secret to a
340
+ * page. Revealing it here is not a new exposure: anyone who can load this dashboard can already
341
+ * start runs on this machine, and on a non-loopback bind their browser is holding the same token
342
+ * as a cookie. What it replaces is the alternative, which was telling people to open
343
+ * `~/.openagent.json` and copy a field out of it.
344
+ */
345
+ export async function onBridgeToken() {
346
+ const preferences = await readPreferences().catch(() => ({}));
347
+ if (preferences.bridge !== true)
348
+ return null;
349
+ return (await readDaemonToken().catch(() => undefined)) ?? null;
350
+ }
351
+ /**
352
+ * Where the answer picked for that session's question stands (#1237): queued for the
353
+ * extension, delivered, or failed with the extension's reason. Null when nothing was picked.
354
+ */
355
+ export async function onBridgeAnswer(sessionId) {
356
+ if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
357
+ return null;
358
+ return bridgeQuestions().answer(sessionId) ?? null;
359
+ }
360
+ /** What a Claude web session has said so far, as scraped by the browser bridge (#1237). */
361
+ export async function onBridgeEvents(sessionId) {
362
+ if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
363
+ return [];
364
+ return bridgeQuestions().events(sessionId);
365
+ }
366
+ /** Where the daemon's own bridge browser stands (#1332): off, starting (and on which step), running, or stopped and why. */
367
+ export async function onBridgeBrowser() {
368
+ return contextBridgeBrowser().status();
369
+ }
370
+ //# sourceMappingURL=reads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reads.js","sourceRoot":"","sources":["../../src/dashboard-rpc/reads.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAoC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnN,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAoB,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAqB,MAAM,sBAAsB,CAAA;AAClE,OAAO,EAAE,YAAY,EAAqB,MAAM,uBAAuB,CAAA;AACvE,OAAO,EA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CAAC;AAED,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAiB;IACpD,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAA;IAC/F,OAAO,eAAe,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AAC5C,CAAC;AAED,4HAA4H;AAC5H,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,OAAO,oBAAoB,EAAE,CAAC,MAAM,EAAE,CAAA;AACxC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Run a run-scoped RPC locally, or relay it to the device when `agentId` names an agent this daemon is
3
+ * relaying to a connected one (#1067 slice 2). For an ordinary local agent the remote lookup is empty and
4
+ * `local()` runs unchanged. For a remote agent there is no local checkout, so the call is forwarded to the
5
+ * device over the token; if the device is unreachable, `unreachable` is returned - the same empty/error
6
+ * shape `local()` gives on a failed read - so the caller never special-cases a remote agent.
7
+ */
8
+ export declare function relayOr<T>(agentId: string | undefined, fn: string, args: unknown[], local: () => Promise<T>, unreachable: T): Promise<T>;
9
+ //# sourceMappingURL=relay-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-agent.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/relay-agent.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,EAAE,EACf,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACvB,WAAW,EAAE,CAAC,GACb,OAAO,CAAC,CAAC,CAAC,CAQZ"}
@@ -0,0 +1,21 @@
1
+ import { contextRemote } from './context.js';
2
+ import { relayRpc } from '../dashboard/remote-run.js';
3
+ /**
4
+ * Run a run-scoped RPC locally, or relay it to the device when `agentId` names an agent this daemon is
5
+ * relaying to a connected one (#1067 slice 2). For an ordinary local agent the remote lookup is empty and
6
+ * `local()` runs unchanged. For a remote agent there is no local checkout, so the call is forwarded to the
7
+ * device over the token; if the device is unreachable, `unreachable` is returned - the same empty/error
8
+ * shape `local()` gives on a failed read - so the caller never special-cases a remote agent.
9
+ */
10
+ export async function relayOr(agentId, fn, args, local, unreachable) {
11
+ const target = contextRemote()?.target(agentId);
12
+ if (!target)
13
+ return local();
14
+ try {
15
+ return (await relayRpc(target, fn, args));
16
+ }
17
+ catch {
18
+ return unreachable;
19
+ }
20
+ }
21
+ //# sourceMappingURL=relay-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-agent.js","sourceRoot":"","sources":["../../src/dashboard-rpc/relay-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,OAA2B,EAC3B,EAAU,EACV,IAAe,EACf,KAAuB,EACvB,WAAc;IAEd,MAAM,MAAM,GAAG,aAAa,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,EAAE,CAAA;IAC3B,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,CAAM,CAAA;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** The names a relay caller may invoke. */
2
+ export declare const RELAY_RPC_NAMES: readonly string[];
3
+ /**
4
+ * Dispatch one relayed RPC against `homeId` (this device's own project). `args[0]` from the caller is
5
+ * the remote daemon's project id and is meaningless here, so it is replaced with `homeId`; the rest
6
+ * (path, agentId, ...) carry through unchanged. Throws on an unknown name.
7
+ */
8
+ export declare function dispatchRelayRpc(homeId: string, fn: string, args: unknown[]): Promise<unknown>;
9
+ //# sourceMappingURL=relay-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-dispatch.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/relay-dispatch.ts"],"names":[],"mappings":"AAwBA,2CAA2C;AAC3C,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAA2B,CAAA;AAExE;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAIpG"}
@@ -0,0 +1,24 @@
1
+ import { onProjectFiles, onGitStatus, onAgentWorktree, onAgentHandoff, onAgent } from './reads.js';
2
+ import { readModule } from './modules.js';
3
+ import { sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendMerge } from './control.js';
4
+ // Null-prototype, like RPC_HANDLERS (R1): the key is a request-controlled string, so a plain object
5
+ // would answer `constructor`/`toString`/`valueOf` off Object.prototype and invoke them as handlers.
6
+ const RELAY_FNS = Object.assign(Object.create(null), {
7
+ onProjectFiles, readModule,
8
+ onGitStatus, onAgentWorktree, onAgentHandoff, onAgent,
9
+ sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendMerge,
10
+ });
11
+ /** The names a relay caller may invoke. */
12
+ export const RELAY_RPC_NAMES = Object.keys(RELAY_FNS);
13
+ /**
14
+ * Dispatch one relayed RPC against `homeId` (this device's own project). `args[0]` from the caller is
15
+ * the remote daemon's project id and is meaningless here, so it is replaced with `homeId`; the rest
16
+ * (path, agentId, ...) carry through unchanged. Throws on an unknown name.
17
+ */
18
+ export async function dispatchRelayRpc(homeId, fn, args) {
19
+ const impl = RELAY_FNS[fn];
20
+ if (!impl)
21
+ throw new Error(`unknown relay rpc: ${fn}`);
22
+ return impl(homeId, ...args.slice(1));
23
+ }
24
+ //# sourceMappingURL=relay-dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-dispatch.js","sourceRoot":"","sources":["../../src/dashboard-rpc/relay-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAchG,oGAAoG;AACpG,oGAAoG;AACpG,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAA4B,EAAE;IAC9E,cAAc,EAAE,UAAU;IAC1B,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO;IACrD,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,EAAE,SAAS;CAClE,CAAuC,CAAA;AAExC,2CAA2C;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAsB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAExE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,EAAU,EAAE,IAAe;IAChF,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,CAAA;IAC1B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAA;IACtD,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACvC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Forward an async-iterable of events to a `send` sink until the source is exhausted or
3
+ * the returned stop function is called (#426). This is the bridge behind a relayed
4
+ * run's live feed: the agent is an `AsyncIterable` that replays its buffered history then follows
5
+ * live, and each value becomes one `send(event)`. Transport-agnostic on purpose — a plain
6
+ * callback, so the pump is driven and tested on its own, and the mount decides what a value
7
+ * becomes on the wire.
8
+ *
9
+ * `onDone` fires when the source runs out on its own — a relayed agent that finished. Without it a
10
+ * consumer cannot tell "nothing more is coming" from "nothing has happened yet", so an SSE
11
+ * response would stay open forever on a stream that was already over.
12
+ *
13
+ * Returns a stop function that halts forwarding and cancels the iterator, releasing the
14
+ * follower waiting on the next event. Idempotent. An absent source is a no-op.
15
+ */
16
+ export declare function forwardStream<T>(iterable: AsyncIterable<T> | undefined, send: (value: T) => void, onDone?: () => void): () => void;
17
+ //# sourceMappingURL=stream-forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-forward.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/stream-forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,EACtC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EACxB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,MAAM,IAAI,CAkBZ"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Forward an async-iterable of events to a `send` sink until the source is exhausted or
3
+ * the returned stop function is called (#426). This is the bridge behind a relayed
4
+ * run's live feed: the agent is an `AsyncIterable` that replays its buffered history then follows
5
+ * live, and each value becomes one `send(event)`. Transport-agnostic on purpose — a plain
6
+ * callback, so the pump is driven and tested on its own, and the mount decides what a value
7
+ * becomes on the wire.
8
+ *
9
+ * `onDone` fires when the source runs out on its own — a relayed agent that finished. Without it a
10
+ * consumer cannot tell "nothing more is coming" from "nothing has happened yet", so an SSE
11
+ * response would stay open forever on a stream that was already over.
12
+ *
13
+ * Returns a stop function that halts forwarding and cancels the iterator, releasing the
14
+ * follower waiting on the next event. Idempotent. An absent source is a no-op.
15
+ */
16
+ export function forwardStream(iterable, send, onDone) {
17
+ if (!iterable)
18
+ return () => { };
19
+ const iterator = iterable[Symbol.asyncIterator]();
20
+ let stopped = false;
21
+ void (async () => {
22
+ try {
23
+ for (let next = await iterator.next(); !next.done && !stopped; next = await iterator.next()) {
24
+ send(next.value);
25
+ }
26
+ }
27
+ catch {
28
+ // the stream closed or the consumer went away
29
+ }
30
+ if (!stopped)
31
+ onDone?.();
32
+ })();
33
+ return () => {
34
+ stopped = true;
35
+ void iterator.return?.();
36
+ };
37
+ }
38
+ //# sourceMappingURL=stream-forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-forward.js","sourceRoot":"","sources":["../../src/dashboard-rpc/stream-forward.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAsC,EACtC,IAAwB,EACxB,MAAmB;IAEnB,IAAI,CAAC,QAAQ;QAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAA;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IACjD,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,KAAK,CAAC,KAAK,IAAI,EAAE;QACf,IAAI,CAAC;YACH,KAAK,IAAI,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC5F,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,8CAA8C;QAChD,CAAC;QACD,IAAI,CAAC,OAAO;YAAE,MAAM,EAAE,EAAE,CAAA;IAC1B,CAAC,CAAC,EAAE,CAAA;IACJ,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAA;QACd,KAAK,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAA;IAC1B,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { DashboardContext } from '../dashboard/rpc-serve.js';
2
+ import type { DashboardOptions } from '../dashboard/server.js';
3
+ /**
4
+ * What the dashboard host wires (D3), as a test would have it: every capability present, the two
5
+ * that start work refusing, and the reads answering empty. There is one host and it wires every
6
+ * capability, so an RPC reads its context as simply there — a missing field is a wiring bug, and
7
+ * it throws. That makes this the one place a test says what the host would have wired, with only
8
+ * the parts it cares about overridden.
9
+ */
10
+ export declare function testDashboardContext(over?: Partial<DashboardContext>): DashboardContext;
11
+ /**
12
+ * The same wiring as {@link testDashboardContext}, in the shape {@link startDashboard} takes: a
13
+ * test asserting one route still stands up the same server the product does.
14
+ */
15
+ export declare function testDashboardOptions(over?: Partial<DashboardOptions>): DashboardOptions;
16
+ /**
17
+ * Wire the dashboard's capabilities for a test that calls an RPC directly.
18
+ *
19
+ * It sticks until the next call, where Telefunc's request context used to evaporate at the next
20
+ * macrotask (F3) — so a test no longer has to call this immediately before the RPC under test.
21
+ */
22
+ export declare function provideTestContext(over?: Partial<DashboardContext>): void;
23
+ //# sourceMappingURL=test-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-context.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/test-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAc3F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAG3F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,IAAI,CAE7E"}
@@ -0,0 +1,43 @@
1
+ import { setDashboardContext } from './context.js';
2
+ import { registryPreferencesStore } from '../registry.js';
3
+ import { defaultQuotaSource } from '../dashboard/quota.js';
4
+ /**
5
+ * What the dashboard host wires (D3), as a test would have it: every capability present, the two
6
+ * that start work refusing, and the reads answering empty. There is one host and it wires every
7
+ * capability, so an RPC reads its context as simply there — a missing field is a wiring bug, and
8
+ * it throws. That makes this the one place a test says what the host would have wired, with only
9
+ * the parts it cares about overridden.
10
+ */
11
+ export function testDashboardContext(over = {}) {
12
+ return {
13
+ startAgent: () => ({ ok: false, error: 'not wired in this test' }),
14
+ addProject: () => ({ ok: false, error: 'not wired in this test' }),
15
+ removeProject: () => ({ ok: false, error: 'not wired in this test' }),
16
+ eventsSource: () => undefined,
17
+ remote: { target: () => undefined, list: () => [] },
18
+ preferences: registryPreferencesStore(),
19
+ quota: defaultQuotaSource(),
20
+ models: { read: async () => ({ 'claude-code': { models: [] }, codex: { models: [] } }) },
21
+ projectErrors: () => ({ errors: [] }),
22
+ bridgeBrowser: { status: async () => ({ state: 'off' }), start: async () => { }, stop: async () => { }, act: async () => { } },
23
+ ...over,
24
+ };
25
+ }
26
+ /**
27
+ * The same wiring as {@link testDashboardContext}, in the shape {@link startDashboard} takes: a
28
+ * test asserting one route still stands up the same server the product does.
29
+ */
30
+ export function testDashboardOptions(over = {}) {
31
+ const { startAgent, addProject, removeProject, ...rest } = testDashboardContext();
32
+ return { port: 0, onStart: startAgent, onAddProject: addProject, onRemoveProject: removeProject, ...rest, ...over };
33
+ }
34
+ /**
35
+ * Wire the dashboard's capabilities for a test that calls an RPC directly.
36
+ *
37
+ * It sticks until the next call, where Telefunc's request context used to evaporate at the next
38
+ * macrotask (F3) — so a test no longer has to call this immediately before the RPC under test.
39
+ */
40
+ export function provideTestContext(over = {}) {
41
+ setDashboardContext(testDashboardContext(over));
42
+ }
43
+ //# sourceMappingURL=test-context.js.map
@@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