@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,105 @@
1
+ import type { PreferencesStore } from '../registry.js';
2
+ import type { QuotaSource } from './quota.js';
3
+ import type { ModelsSource } from './models.js';
4
+ import type { ProjectErrorsReader } from '../project-errors.js';
5
+ import type { BridgeBrowserOwner } from '../bridge-browser.js';
6
+ import type { AddProjectResult, RemoveProjectResult, StartAgentOptions, StartAgentResult } from './types.js';
7
+ import type { EventsSource, RemoteAgents } from './rpc-serve.js';
8
+ /** Options for {@link startDashboard}. */
9
+ export interface DashboardOptions {
10
+ /** Port to bind. Default `4200`; pass `0` for an ephemeral port. */
11
+ port?: number;
12
+ /** Host to bind. Default `127.0.0.1` (localhost only). */
13
+ host?: string;
14
+ /**
15
+ * Called when the browser starts a run (#345): the `sendStart` RPC reaches this through the
16
+ * wired dashboard context. Wire it to the project's start hook.
17
+ */
18
+ onStart: (prompt: string, options: StartAgentOptions, projectId?: string) => StartAgentResult | Promise<StartAgentResult>;
19
+ /**
20
+ * Called when the browser adds a project (#396): the `sendAddProject` RPC reaches this through
21
+ * the wired dashboard context. Wire it to install the repo and register it.
22
+ */
23
+ onAddProject: (path: string, share: boolean) => Promise<AddProjectResult> | AddProjectResult;
24
+ /** Called when the browser removes a project: the `sendRemoveProject` RPC reaches this through the wired dashboard context. */
25
+ onRemoveProject: (projectId: string, files: boolean) => Promise<RemoveProjectResult> | RemoveProjectResult;
26
+ /**
27
+ * The user-preferences store (#410): the `onPreferences` / `savePreferences` RPCs read and
28
+ * write it through the wired dashboard context.
29
+ */
30
+ preferences: PreferencesStore;
31
+ /** Where the usage panel reads the quota from (#533). */
32
+ quota: QuotaSource;
33
+ /** Which models each coding agent offers, for the agent and model menu. */
34
+ models: ModelsSource;
35
+ /** What a project currently suffers from (#1500), for the project list to carry. */
36
+ projectErrors: ProjectErrorsReader;
37
+ /** The daemon's own bridge browser (#1332): its status, and the show/hide/restart the settings page asks for. */
38
+ bridgeBrowser: BridgeBrowserOwner;
39
+ /**
40
+ * Serve the new dashboard bundle (#405) from this directory — the built SPA
41
+ * (`index.html` + `assets/**`). The daemon also mounts the dashboard's RPC surface
42
+ * at `/_rpc` (the calls + the live-event stream). Omit only for a broken install with
43
+ * no built bundle, where the server reports the bundle is missing.
44
+ */
45
+ clientBundleDir?: string;
46
+ /**
47
+ * The shared token that guards a non-loopback bind (#1051): with it set, every route (static
48
+ * bundle, `/_rpc`, `/_relay`) needs a valid `oa_daemon` cookie or a matching
49
+ * `?token=`, else 401. Omit for a loopback bind, where the guard is a no-op and local UX is
50
+ * byte-identical. A separate concern from the CSRF origin check in rpc-serve.ts.
51
+ */
52
+ token?: string;
53
+ /**
54
+ * The live-events source for a run this daemon is relaying from a connected device (#1067):
55
+ * a stream for such a run, else undefined so `onEvents` tails the run's diary off disk.
56
+ */
57
+ eventsSource: EventsSource;
58
+ /**
59
+ * The relayed-agent lookup the read RPCs consult (#1067 slice 2). A run-scoped RPC uses it to
60
+ * forward a remote agent's read/steer/handoff to the device that owns it.
61
+ */
62
+ remote: RemoteAgents;
63
+ /**
64
+ * Serve a relay-started run's events back to the daemon that relayed it here (#1067): the
65
+ * `/_relay/*` endpoints (start + events, plus the slice-2 `rpc`). All are fronted by the same
66
+ * `token` guard above, so a device without the cookie cannot start or read a run.
67
+ */
68
+ relay?: {
69
+ tailEvents: (agentId: string, onEvent: (event: import('../events.js').OpenAgentEvent) => void) => () => void;
70
+ /** Run one whitelisted run-scoped RPC against this daemon's own checkout (#1067 slice 2). */
71
+ rpc?: (fn: string, args: unknown[]) => Promise<unknown>;
72
+ };
73
+ /**
74
+ * The browser bridge (#1237): the token a Claude web extension presents to report the question
75
+ * its cloud session is parked on. Absent leaves every `/_bridge/*` route 404, which is default.
76
+ *
77
+ * Deliberately not {@link token}. That one guards a non-loopback bind and is absent on a normal
78
+ * loopback daemon, where what keeps other origins out of `/_rpc` is the same-origin check.
79
+ * The bridge is the one route meant to be reached from another origin, so neither protects it
80
+ * and it authenticates on its own.
81
+ */
82
+ bridgeToken?: string;
83
+ /**
84
+ * The cloud sessions the browser bridge should have a tab open for (#1237). Only the daemon
85
+ * wires one, since it is the process that can see every project's runs.
86
+ */
87
+ bridgeSessions?: () => Promise<import('./bridge-endpoints.js').BridgeSession[]>;
88
+ }
89
+ /** A running localhost dashboard: the built SPA + its RPC mount. */
90
+ export interface Dashboard {
91
+ /** The URL to open. */
92
+ readonly url: string;
93
+ /** Stop the server. Idempotent. */
94
+ close(): Promise<void>;
95
+ }
96
+ /**
97
+ * Start the localhost dashboard: a tiny `node:http` server that serves the built SPA (#405) and
98
+ * mounts its RPC surface at `/_rpc` — the calls and the live-event stream. The dashboard reads a
99
+ * run's own diary over that stream and steers the run through the files its tool reads, so there is
100
+ * no in-process event stream here; the server is a static-bundle + RPC host. The RPCs run in the
101
+ * daemon's own process, so `sendStart` / `sendAddProject` call the daemon's own closures via
102
+ * {@link DashboardOptions.onStart} / {@link DashboardOptions.onAddProject}.
103
+ */
104
+ export declare function startDashboard(opts: DashboardOptions): Promise<Dashboard>;
105
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/dashboard/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAK9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gB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AAc,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;QAC5G,6FAA6F;QAC7F,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;KACxD,CAAA;IACD;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,uBAAuB,EAAE,aAAa,EAAE,CAAC,CAAA;CAChF;AAED,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,uBAAuB;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAwIzE"}
@@ -0,0 +1,231 @@
1
+ import { createServer } from 'node:http';
2
+ import { timingSafeEqual } from 'node:crypto';
3
+ import { serveClientBundle } from './static.js';
4
+ import { makeRpcMount, RPC_PREFIX, isSameOriginRequest, isExpectedHost } from './rpc-serve.js';
5
+ import { requestPathname } from '../request-path.js';
6
+ import { MODULES_PREFIX, serveModuleFile } from './module-serve.js';
7
+ import { handleRelayRequest, RELAY_PREFIX } from './relay-endpoints.js';
8
+ import { BRIDGE_PREFIX, EXPECTED_EXTENSION_VERSION, handleBridgeRequest } from './bridge-endpoints.js';
9
+ import { bridgeQuestions } from './bridge-store.js';
10
+ import { bridgeStarts } from './bridge-starts.js';
11
+ import { WEB_START_PREFIX, handleWebStartRequest } from './web-start-endpoints.js';
12
+ /**
13
+ * Start the localhost dashboard: a tiny `node:http` server that serves the built SPA (#405) and
14
+ * mounts its RPC surface at `/_rpc` — the calls and the live-event stream. The dashboard reads a
15
+ * run's own diary over that stream and steers the run through the files its tool reads, so there is
16
+ * no in-process event stream here; the server is a static-bundle + RPC host. The RPCs run in the
17
+ * daemon's own process, so `sendStart` / `sendAddProject` call the daemon's own closures via
18
+ * {@link DashboardOptions.onStart} / {@link DashboardOptions.onAddProject}.
19
+ */
20
+ export function startDashboard(opts) {
21
+ const host = opts.host ?? '127.0.0.1';
22
+ const port = opts.port ?? 4200;
23
+ const clientBundleDir = opts.clientBundleDir;
24
+ // A broken install ships no built bundle (the published package always does), so serve
25
+ // 503 for everything rather than stand up a half-wired mount. Returning here lets the
26
+ // main path below treat the bundle, mount, and quota as present with no re-checks.
27
+ if (!clientBundleDir) {
28
+ const server = createServer((_req, res) => {
29
+ res.writeHead(503, { 'content-type': 'text/plain' });
30
+ res.end('the dashboard bundle is not installed');
31
+ });
32
+ return listenDashboard(server, host, port, () => closeServer(server));
33
+ }
34
+ // The usage panel polls for the dashboard's whole life, not just during an agent:
35
+ // it has to show where the account stands while nothing is running (#533).
36
+ const quota = opts.quota;
37
+ const rpcMount = makeRpcMount({
38
+ startAgent: opts.onStart,
39
+ addProject: opts.onAddProject,
40
+ removeProject: opts.onRemoveProject,
41
+ eventsSource: opts.eventsSource,
42
+ remote: opts.remote,
43
+ preferences: opts.preferences,
44
+ projectErrors: opts.projectErrors,
45
+ bridgeBrowser: opts.bridgeBrowser,
46
+ quota,
47
+ models: opts.models,
48
+ },
49
+ // The bound host, so the mount can reject a rebound `Host`: a page on evil.com whose DNS
50
+ // answers 127.0.0.1 is same-origin to the browser, so the Origin check alone lets it in.
51
+ { host });
52
+ // The device-to-daemon relay endpoints (#1067): wired only when an events tail is supplied.
53
+ // Fronted by the same token guard as every other route below.
54
+ const relayHandlers = opts.relay
55
+ ? { start: opts.onStart, tailEvents: opts.relay.tailEvents, ...(opts.relay.rpc ? { rpc: opts.relay.rpc } : {}) }
56
+ : undefined;
57
+ // The browser bridge (#1237). Off unless a token was supplied, and it carries that token itself
58
+ // rather than riding the shared-token guard (#1051), which a loopback daemon does not have.
59
+ const bridgeHandlers = opts.bridgeToken
60
+ ? {
61
+ token: opts.bridgeToken,
62
+ // The version gate (#1519): a stale extension is refused loudly rather than half-working.
63
+ expectedExtensionVersion: EXPECTED_EXTENSION_VERSION,
64
+ extensionVersion: (got, blocked) => bridgeQuestions().recordVersion(got, EXPECTED_EXTENSION_VERSION, blocked),
65
+ record: question => bridgeQuestions().record(question),
66
+ contact: (route, status) => bridgeQuestions().recordContact(route, status),
67
+ recordEvent: event => bridgeQuestions().recordEvent(event),
68
+ hello: hello => bridgeQuestions().recordHello(hello),
69
+ statuses: statuses => {
70
+ for (const status of statuses)
71
+ bridgeQuestions().recordStatus(status);
72
+ },
73
+ // Claimed on read (#1332), like a start: two Drivers asking must not both type it.
74
+ answer: sessionId => {
75
+ const pending = bridgeQuestions().claimAnswer(sessionId);
76
+ return pending ? { id: pending.id, text: pending.text } : undefined;
77
+ },
78
+ answered: (sessionId, id, ok, note) => bridgeQuestions().resolveAnswer(sessionId, id, ok, note),
79
+ // The session start-queue (#1328). The claim happens inside claimNext, not in the route:
80
+ // two polling tabs handed the same request would create two cloud sessions.
81
+ start: () => {
82
+ const next = bridgeStarts().claimNext();
83
+ return next ? { id: next.id, repo: next.repo, branch: next.branch, prompt: next.prompt, ...(next.model ? { model: next.model } : {}) } : undefined;
84
+ },
85
+ started: (id, ok, sessionId, note) => bridgeStarts().resolve(id, ok, sessionId, note),
86
+ ...(opts.bridgeSessions ? { sessions: opts.bridgeSessions } : {}),
87
+ }
88
+ : undefined;
89
+ // The run-facing side of the same queue (#1328): a spawned web run asks here, on the same token.
90
+ const webStartHandlers = opts.bridgeToken
91
+ ? {
92
+ token: opts.bridgeToken,
93
+ extensionAlive: () => bridgeQuestions().extensionAlive(),
94
+ request: input => bridgeStarts().request(input),
95
+ get: id => bridgeStarts().get(id),
96
+ }
97
+ : undefined;
98
+ const token = opts.token;
99
+ const server = createServer((req, res) => {
100
+ const pathname = requestPathname(req);
101
+ if (pathname === undefined) {
102
+ res.writeHead(400, { 'content-type': 'text/plain' }).end('bad request');
103
+ return;
104
+ }
105
+ // The browser bridge (#1237) is checked BEFORE the shared-token guard (#1051), and is the only route that is.
106
+ // That guard's browser affordance is a `?token=` redirect meant for a human following a link,
107
+ // which is meaningless to an extension posting JSON; the bridge presents its own bearer token
108
+ // instead, so letting it past here costs nothing and skips a 302 it could not follow.
109
+ if (pathname === BRIDGE_PREFIX || pathname.startsWith(`${BRIDGE_PREFIX}/`)) {
110
+ void handleBridgeRequest(req, res, pathname, bridgeHandlers);
111
+ return;
112
+ }
113
+ if (pathname === WEB_START_PREFIX || pathname.startsWith(`${WEB_START_PREFIX}/`)) {
114
+ void handleWebStartRequest(req, res, pathname, webStartHandlers);
115
+ return;
116
+ }
117
+ // #1051: one guard fronting every route on a non-loopback bind; a no-op when no token is set.
118
+ if (token !== undefined && !authorizeDaemonRequest(req, res, token))
119
+ return;
120
+ // The device relay (#1067): another daemon posts a start here and streams the run's events back.
121
+ // The token guard above is a no-op on a loopback bind, so — exactly like the RPC mount below —
122
+ // the relay carries its own CSRF + DNS-rebinding guard, or a page the user merely visited could
123
+ // POST /_relay/start to start a run (the real device caller sends no Origin and a loopback
124
+ // Host, so both checks pass it; only a browser's cross-origin/rebound request is turned away).
125
+ if (pathname === RELAY_PREFIX || pathname.startsWith(`${RELAY_PREFIX}/`)) {
126
+ if (!guardBrowserOrigin(req, res, host))
127
+ return;
128
+ void handleRelayRequest(req, res, pathname, relayHandlers);
129
+ return;
130
+ }
131
+ if (pathname === RPC_PREFIX || pathname.startsWith(`${RPC_PREFIX}/`)) {
132
+ void rpcMount(req, res);
133
+ return;
134
+ }
135
+ // A project's dashboard modules (#1774): only the files of a package the project brings as a module.
136
+ if (pathname.startsWith(`${MODULES_PREFIX}/`)) {
137
+ // Void-dispatched like the bundle: a throw here must answer, not take the daemon down (#938).
138
+ void serveModuleFile(req, res, pathname).catch(() => {
139
+ if (!res.headersSent)
140
+ res.writeHead(500, { 'content-type': 'text/plain' }).end('module file unreadable');
141
+ });
142
+ return;
143
+ }
144
+ void serveClientBundle(req, res, clientBundleDir);
145
+ });
146
+ return listenDashboard(server, host, port, async () => {
147
+ // Stop polling with the server: the poller outlives every agent by design,
148
+ // so nothing else would ever end it.
149
+ quota.stop();
150
+ await closeServer(server);
151
+ });
152
+ }
153
+ /** Bind the server and resolve a {@link Dashboard} handle; rejects if the port is already taken. */
154
+ function listenDashboard(server, host, port, close) {
155
+ return new Promise((resolvePromise, rejectPromise) => {
156
+ server.once('error', rejectPromise);
157
+ server.listen(port, host, () => {
158
+ server.removeListener('error', rejectPromise);
159
+ const address = server.address();
160
+ resolvePromise({ url: `http://${host}:${address.port}`, close });
161
+ });
162
+ });
163
+ }
164
+ function closeServer(server) {
165
+ // Force-close keep-alive + streaming sockets (e.g. an open /_relay/events body, #1067) so close() resolves instead of waiting on them.
166
+ server.closeAllConnections();
167
+ return new Promise(resolvePromise => server.close(() => resolvePromise()));
168
+ }
169
+ /**
170
+ * The CSRF + DNS-rebinding guard the RPC mount applies, lifted to the device relay, which
171
+ * dispatches outside it. The relay is state-changing (it starts a run on this machine) and is
172
+ * wired unconditionally on a loopback bind, where the shared-token guard is a no-op, so without
173
+ * this a page the user merely visited reaches it. Returns true to admit the request; on rejection
174
+ * it has already answered 403.
175
+ */
176
+ function guardBrowserOrigin(req, res, host) {
177
+ if (isSameOriginRequest(req) && isExpectedHost(req, host))
178
+ return true;
179
+ res.writeHead(403, { 'content-type': 'text/plain' }).end('forbidden');
180
+ return false;
181
+ }
182
+ /** The cookie a bootstrapped browser carries on every same-origin request (#1051). */
183
+ const DAEMON_COOKIE = 'oa_daemon';
184
+ /**
185
+ * The non-loopback bind guard (#1051): a request needs a valid `oa_daemon` cookie or a matching
186
+ * `?token=`, else 401. A valid `?token=` sets the cookie and 302s to the clean path so the token
187
+ * leaves the URL bar, history, and Referer after one hop; the cookie then rides RPC, the events
188
+ * Channel, and the MJPEG `<img>` screencast alike (all same-origin), which a bearer header cannot
189
+ * reach. Returns true to admit the request, false once it has answered (401 or the redirect).
190
+ */
191
+ function authorizeDaemonRequest(req, res, token) {
192
+ // Safe to re-parse: requestPathname already parsed this same url without throwing (#938).
193
+ const url = new URL(req.url ?? '/', 'http://localhost');
194
+ const queryToken = url.searchParams.get('token');
195
+ if (queryToken !== null && tokensMatch(queryToken, token)) {
196
+ url.searchParams.delete('token');
197
+ const query = url.searchParams.toString();
198
+ res.writeHead(302, {
199
+ // Lax, not Strict: the device-hop (#1052) is a cross-origin top-level nav, and a Strict cookie set on it is withheld from the redirect right after, so the clean path 401s. Lax still rides top-level GET navs; CSRF stays covered by the same-origin check on /_rpc.
200
+ 'set-cookie': `${DAEMON_COOKIE}=${token}; HttpOnly; SameSite=Lax; Path=/`,
201
+ location: url.pathname + (query ? `?${query}` : ''),
202
+ });
203
+ res.end();
204
+ return false;
205
+ }
206
+ const cookieToken = readCookie(req.headers.cookie, DAEMON_COOKIE);
207
+ if (cookieToken !== undefined && tokensMatch(cookieToken, token))
208
+ return true;
209
+ res.writeHead(401, { 'content-type': 'text/plain' });
210
+ res.end('unauthorized');
211
+ return false;
212
+ }
213
+ /** Constant-time token compare (#1051). The length check first, since `timingSafeEqual` throws on
214
+ * unequal-length buffers and a length mismatch cannot be a match anyway. */
215
+ function tokensMatch(a, b) {
216
+ const ab = Buffer.from(a);
217
+ const bb = Buffer.from(b);
218
+ return ab.length === bb.length && timingSafeEqual(ab, bb);
219
+ }
220
+ /** One cookie's value out of a `Cookie` header, or `undefined`. */
221
+ function readCookie(header, name) {
222
+ if (!header)
223
+ return undefined;
224
+ for (const part of header.split(';')) {
225
+ const eq = part.indexOf('=');
226
+ if (eq !== -1 && part.slice(0, eq).trim() === name)
227
+ return part.slice(eq + 1).trim();
228
+ }
229
+ return undefined;
230
+ }
231
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/dashboard/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAA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C,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IACtF,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ /**
3
+ * Serve `dir`'s static bundle for this request: the requested file when it exists,
4
+ * otherwise `index.html` (the SPA fallback, so client routes and unknown paths still
5
+ * boot the app). Path-traversal is guarded — a request that escapes `dir` falls back to
6
+ * `index.html` rather than reading outside the bundle.
7
+ */
8
+ export declare function serveClientBundle(req: IncomingMessage, res: ServerResponse, dir: string): Promise<void>;
9
+ //# sourceMappingURL=static.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../src/dashboard/static.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAwBhE;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB7G"}
@@ -0,0 +1,54 @@
1
+ import { readFile, stat } from 'node:fs/promises';
2
+ import { join, normalize, sep } from 'node:path';
3
+ import { contentTypeFor } from './content-type.js';
4
+ import { requestPathname } from '../request-path.js';
5
+ // Serve the built dashboard bundle (#405). The dashboard is a plain Vite SPA — one static
6
+ // `index.html` plus `assets/**` — so the daemon serves it as
7
+ // plain files with an SPA fallback (any non-asset path yields `index.html`, which boots
8
+ // the client router). Assets are copied into the
9
+ // OpenAgent package at build time (see scripts/bundle-dashboard.mjs).
10
+ /** Whether a real, readable file exists at `path`. */
11
+ async function isFile(path) {
12
+ return stat(path).then(s => s.isFile()).catch(() => false);
13
+ }
14
+ /** Decode a percent-encoded path; a malformed escape names no file, so it decodes to nothing. */
15
+ function tryDecode(pathname) {
16
+ try {
17
+ return decodeURIComponent(pathname);
18
+ }
19
+ catch {
20
+ return '';
21
+ }
22
+ }
23
+ /**
24
+ * Serve `dir`'s static bundle for this request: the requested file when it exists,
25
+ * otherwise `index.html` (the SPA fallback, so client routes and unknown paths still
26
+ * boot the app). Path-traversal is guarded — a request that escapes `dir` falls back to
27
+ * `index.html` rather than reading outside the bundle.
28
+ */
29
+ export async function serveClientBundle(req, res, dir) {
30
+ // Neither an unparseable request target nor a malformed escape (`/%zz`) may throw: this
31
+ // runs void-dispatched, so an exception here would be an unhandled rejection that takes
32
+ // the daemon down (#938). Both fall back to the SPA shell like any other unknown path.
33
+ const pathname = requestPathname(req) ?? '/';
34
+ const rel = tryDecode(pathname).replace(/^\/+/, '');
35
+ const root = normalize(dir);
36
+ const candidate = normalize(join(root, rel));
37
+ const within = candidate === root || candidate.startsWith(root + sep);
38
+ const target = within && rel && (await isFile(candidate)) ? candidate : join(root, 'index.html');
39
+ const body = await readFile(target).catch(() => undefined);
40
+ if (body === undefined) {
41
+ res.writeHead(404, { 'content-type': 'text/plain' });
42
+ res.end('dashboard bundle not built');
43
+ return;
44
+ }
45
+ const type = contentTypeFor(target);
46
+ // Only the fingerprinted files under `assets/` are immutable. Everything at a stable path
47
+ // (index.html, the host files a module imports as `/host/*.js`) must always revalidate: a
48
+ // browser that kept `/host/module.js` from the last version would hand every module a host
49
+ // missing whatever the new version added, until its cache expired a year later.
50
+ const cacheControl = target.startsWith(join(root, 'assets') + sep) ? 'public, max-age=31536000, immutable' : 'no-cache';
51
+ res.writeHead(200, { 'content-type': type, 'cache-control': cacheControl });
52
+ res.end(body);
53
+ }
54
+ //# sourceMappingURL=static.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/dashboard/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAEhD,OA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AAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAChG,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAC1D,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAA;QACpD,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;QACrC,OAAM;IACR,CAAC;IACD,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;IACnC,0FAA0F;IAC1F,0FAA0F;IAC1F,2FAA2F;IAC3F,gFAAgF;IAChF,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,UAAU,CAAA;IACvH,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAA;IAC3E,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}
@@ -0,0 +1,135 @@
1
+ import type { LinkedPr } from './pull-requests.js';
2
+ import type { PublishPick } from '../publish-levels.js';
3
+ /** The outcome of removing a retained worktree (#737). */
4
+ export type RemoveWorktreeResult = {
5
+ ok: true;
6
+ } | {
7
+ ok: false;
8
+ error: string;
9
+ };
10
+ /** The outcome of deleting a session — its records and worktree (#1032). */
11
+ export type DeleteAgentResult = {
12
+ ok: true;
13
+ } | {
14
+ ok: false;
15
+ error: string;
16
+ };
17
+ /**
18
+ * The outcome of an add-project attempt (#396): registered, or was already, or why not.
19
+ * `noRemote` says the person asked to share the agents' records and the repository has no remote
20
+ * to share with: they are kept on this machine.
21
+ */
22
+ export type AddProjectResult = {
23
+ ok: true;
24
+ alreadyActivated: boolean;
25
+ noRemote?: true;
26
+ } | {
27
+ ok: false;
28
+ error: string;
29
+ };
30
+ /**
31
+ * What removing OpenAgent's files from a project's folder did: what went, what stayed with the
32
+ * reason, and what could not be done, each line in words for a person. Paths are from the
33
+ * project's root.
34
+ */
35
+ export interface CleanupReport {
36
+ removed: string[];
37
+ kept: {
38
+ path: string;
39
+ reason: string;
40
+ }[];
41
+ failed: string[];
42
+ }
43
+ /** The outcome of removing a project from the list: gone from it, with what the clean-up did when one was asked for, or why not. */
44
+ export type RemoveProjectResult = {
45
+ ok: true;
46
+ cleanup?: CleanupReport;
47
+ } | {
48
+ ok: false;
49
+ error: string;
50
+ };
51
+ /**
52
+ * What the Onboarding checklist (#958) needs and no other read carries: the server's own
53
+ * working directory, offered as the one-click first project.
54
+ *
55
+ * Both fields are null where adding projects is not wired (the relay), so a public host
56
+ * never discloses its filesystem layout.
57
+ */
58
+ export interface OnboardingSuggestion {
59
+ /** The server's working directory, or null when it cannot be offered. */
60
+ cwd: string | null;
61
+ /** The project id for {@link cwd} when it is already registered, else null. */
62
+ cwdProjectId: string | null;
63
+ }
64
+ /**
65
+ * What a Start carries besides its prompt (#1774): the person's picks, handed to the project's
66
+ * `start` hook line as `DRIVER`, `MODEL`, `PUBLISH` and `BASE`. Absent leaves each to the tool the line names.
67
+ */
68
+ export interface StartAgentOptions {
69
+ /** The model to run on. */
70
+ model?: string;
71
+ /** Which coding agent the run is on: `claude-code` or `codex`. */
72
+ driver?: string;
73
+ /** The person's saved pick of how far the run takes its work when the agent finishes. Absent, none is saved: the daemon starts the run at `commit`. A saved pick the project is not offered is held to the furthest the project goes with no pull request. */
74
+ publish?: PublishPick;
75
+ /**
76
+ * The branch the agent's own branch starts from, as this machine has it, commits that are not
77
+ * pushed included: the launcher's "My local branch" pick. Absent, origin's default branch. A
78
+ * word that is no branch name refuses the Start. Not sent to a device: its branches are its own.
79
+ */
80
+ base?: string;
81
+ /**
82
+ * The follow-up's prompt: once the run ends done with a pull request, a fresh agent works its
83
+ * branch from it before the request merges. The launcher's "Post-merge cleanup" box.
84
+ */
85
+ then?: string;
86
+ /**
87
+ * Run this session on a connected device (#1067): the local daemon relays the start to the remote
88
+ * daemon at `url` (authenticating with `token` as the `oa_daemon` cookie) and streams its events
89
+ * back into the local agent view. The device `label` rides along (memory-only, like `url`/`token`) so
90
+ * the local session list + notice can show which device the agent is on after a reload (#1077).
91
+ * Memory-only relay config the dashboard sets at submit time from a saved device. NEVER persisted to
92
+ * Preferences or the registry: a device token is a per-browser secret. Absent = run locally.
93
+ * Stripped before the start is forwarded, so the remote starts an ordinary local run and does not
94
+ * relay onward.
95
+ */
96
+ remote?: {
97
+ url: string;
98
+ token: string;
99
+ label?: string;
100
+ };
101
+ }
102
+ /** The outcome of a Start attempt (#345): the id of the run the project's start hook began, or why there is none. */
103
+ export type StartAgentResult = {
104
+ ok: true;
105
+ agentId: string;
106
+ } | {
107
+ ok: false;
108
+ error: string;
109
+ };
110
+ /**
111
+ * Where a session is working (#798): its checkout, its branch, and what it is holding. Read by
112
+ * the dashboard so a session's action bar can say which worktree it has, rather than leaving the
113
+ * user to infer it from an agent id.
114
+ *
115
+ * Only what is true of the run: once its checkout is gone there is no tree to be clean or dirty,
116
+ * so {@link checkout} is absent and the branch is the one the run recorded.
117
+ */
118
+ export interface AgentWorktree {
119
+ /** The run's own checkout while it exists. */
120
+ checkout?: {
121
+ /** Absolute path of the checkout. */
122
+ path: string;
123
+ /** Uncommitted changes present in it. */
124
+ dirty: boolean;
125
+ /** Size on disk, bytes. Only read once nothing is writing to it, and best-effort even then. */
126
+ sizeBytes?: number;
127
+ };
128
+ /** The branch the run's work is on: its checkout's while it has one, else the one it recorded. */
129
+ branch?: string;
130
+ /** The PR opened for this run's branch (#809), when there is one. */
131
+ pr?: LinkedPr;
132
+ /** The PR is not known yet, rather than absent (#1028): the lookup is still running. */
133
+ prPending?: boolean;
134
+ }
135
+ //# sour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{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dashboard/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { BridgeStartInput, BridgeStartRequest } from './bridge-starts.js';
3
+ /**
4
+ * The run-facing side of the session start-queue (#1328): how a web run asks the daemon for a
5
+ * cloud session created by the browser extension, and learns what it became.
6
+ *
7
+ * A run is a separate process the daemon never started, so it cannot touch the daemon's queue
8
+ * directly; it reaches these routes at the URL it finds in its environment
9
+ * ({@link DAEMON_URL_ENV}), presenting the daemon token it reads from the registry. The
10
+ * extension's own side of the same queue lives on `/_bridge/start` and `/_bridge/started`.
11
+ *
12
+ * Nothing sets {@link DAEMON_URL_ENV} today (#1774): web runs left the launcher when the daemon
13
+ * stopped running agents, so the only caller of these routes is gone until web runs return, and
14
+ * then whatever line a project's start hook names will have to carry the URL. The extension's
15
+ * side of the queue is live either way, which is why these routes stay.
16
+ */
17
+ export declare const WEB_START_PREFIX = "/_web-start";
18
+ /** The environment variable a run finds its daemon's URL in. */
19
+ export declare const DAEMON_URL_ENV = "OPENAGENT_DAEMON_URL";
20
+ /** What the daemon wires behind the routes. Absent when the bridge is off, which 404s them. */
21
+ export interface WebStartHandlers {
22
+ /** The daemon token every call must present — the same one the extension holds. */
23
+ token: string;
24
+ /** Whether an extension has spoken to this daemon recently enough to be trusted with a request. */
25
+ extensionAlive: () => boolean;
26
+ /** Queue a request, or say what is wrong with it. */
27
+ request: (input: BridgeStartInput) => BridgeStartRequest | string;
28
+ get: (id: string) => BridgeStartRequest | undefined;
29
+ }
30
+ /** Route a `/_web-start*` request. */
31
+ export declare function handleWebStartRequest(req: IncomingMessage, res: ServerResponse, pathname: string, handlers: WebStartHandlers | undefined): Promise<void>;
32
+ //# sourceMappingURL=web-start-endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-start-endpoints.d.ts","sourceRoot":"","sources":["../../src/dashboard/web-start-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE9E;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,gBAAgB,gBAAgB,CAAA;AAE7C,gEAAgE;AAChE,eAAO,MAAM,cAAc,yBAAyB,CAAA;AAEpD,+FAA+F;AAC/F,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAA;IACb,mGAAmG;IACnG,cAAc,EAAE,MAAM,OAAO,CAAA;IAC7B,qDAAqD;IACrD,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,kBAAkB,GAAG,MAAM,CAAA;IACjE,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAA;CACpD;AAKD,sCAAsC;AACtC,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,gBAAgB,GAAG,SAAS,GACrC,OAAO,CAAC,IAAI,CAAC,CAOf"}