@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,137 @@
1
+ import { projectGitHost } from '../store/git-host.js';
2
+ import { cachedRead, invalidate } from './cache.js';
3
+ /** A provider's request as OpenAgent keeps it: the state upper-cased, the head as the request's commit. */
4
+ export function linkedPrOf(request) {
5
+ return {
6
+ number: request.number,
7
+ url: request.url,
8
+ state: request.state.toUpperCase(),
9
+ title: request.title,
10
+ ...(request.createdAt ? { createdAt: request.createdAt } : {}),
11
+ ...(request.head ? { headRefOid: request.head } : {}),
12
+ ...(request.mergeCommit ? { mergeCommit: request.mergeCommit } : {}),
13
+ };
14
+ }
15
+ /** A provider's open request as the interventions queue keeps it. */
16
+ export function openPrOf(request) {
17
+ return {
18
+ number: request.number,
19
+ title: request.title,
20
+ url: request.url,
21
+ isDraft: request.draft,
22
+ ...(request.branch ? { headRefName: request.branch } : {}),
23
+ ...(request.createdAt ? { createdAt: request.createdAt } : {}),
24
+ };
25
+ }
26
+ /**
27
+ * Every PR a branch name has ever had, newest first (#1251).
28
+ *
29
+ * The newest request for a head *in any state* is what a single view would answer, so a session
30
+ * whose prompt pins its branch name (`openagent/triage-quick`) inherits a predecessor's
31
+ * merged PR as its own. The list form keeps the whole history so {@link pickAgentPr} can decide
32
+ * which entry, if any, belongs to the agent asking. Resolves `[]` when the project has no git host or
33
+ * the git host could not answer — indistinguishable from "no PRs", which is what every caller would do
34
+ * with a failure anyway.
35
+ */
36
+ export async function prsForBranch(cwd, branch, gitHost = projectGitHost) {
37
+ return prsForBranchOrThrow(cwd, branch, gitHost).catch(() => []);
38
+ }
39
+ /**
40
+ * {@link prsForBranch} for a caller about to *open* a PR (#1601): a listing the git host could not
41
+ * answer throws instead of reading as "no PRs", because "none" and "could not tell" must not look
42
+ * alike there — the difference is a second draft PR on a branch that already has one. A project
43
+ * with no git host has none, truthfully.
44
+ */
45
+ export async function prsForBranchOrThrow(cwd, branch, gitHost = projectGitHost) {
46
+ const source = await gitHost(cwd);
47
+ if (!source)
48
+ return [];
49
+ const listed = await source.requests({ branch, state: 'all' });
50
+ if (!listed.ok)
51
+ throw new Error(listed.error);
52
+ return listed.requests.map(linkedPrOf);
53
+ }
54
+ /** The newest PR of `branch`, in any state, or undefined when it has none or the git host cannot tell. */
55
+ export async function prView(cwd, branch, gitHost = projectGitHost) {
56
+ return (await prsForBranch(cwd, branch, gitHost))[0];
57
+ }
58
+ /**
59
+ * The cached form of {@link prView} (#1028), and what the dashboard's panels use.
60
+ *
61
+ * A PR lookup costs a process where the git reads beside it cost ten milliseconds, and the answer
62
+ * changes about as often as someone opens a PR. Cached per checkout and branch, shared between
63
+ * the worktree bar and the handoff summary, and refreshed behind whoever asks. `pending` says the
64
+ * answer is not known yet rather than that there is no PR — the difference matters to a caller
65
+ * deciding whether to offer "Open PR". A read with no branch to ask about answers nothing at once.
66
+ */
67
+ export async function cachedPrView(cwd, branch) {
68
+ if (branch === undefined)
69
+ return { value: undefined, pending: false };
70
+ return cachedRead(prCacheKey(cwd, branch), () => prView(cwd, branch));
71
+ }
72
+ /** Forget a branch's PR, after an action that changes whether it has one. */
73
+ export function forgetPr(cwd, branch) {
74
+ invalidate(prCacheKey(cwd, branch));
75
+ }
76
+ /** The cached form of {@link prsForBranch}, shared through the same read-through cache (#1028). */
77
+ export async function cachedPrsForBranch(cwd, branch) {
78
+ return cachedRead(branchPrsCacheKey(cwd, branch), () => prsForBranch(cwd, branch));
79
+ }
80
+ /** Forget a branch's PR history, after an action that changes it (opening one). */
81
+ export function forgetBranchPrs(cwd, branch) {
82
+ invalidate(branchPrsCacheKey(cwd, branch));
83
+ }
84
+ /** An unprintable separator, so paths cannot collide with the keys. */
85
+ const KEY_SEP = String.fromCharCode(0);
86
+ function prCacheKey(cwd, branch) {
87
+ return ['pr', cwd, branch ?? ''].join(KEY_SEP);
88
+ }
89
+ function branchPrsCacheKey(cwd, branch) {
90
+ return ['prs', cwd, branch].join(KEY_SEP);
91
+ }
92
+ /**
93
+ * The PR that belongs to an agent, out of every PR its branch name has had (#1251/#1255).
94
+ *
95
+ * An OPEN PR always counts: a git host allows one open PR per head branch, so whatever is open on the
96
+ * run's branch is where its pushed commits land. A closed one counts only when it was created
97
+ * after the agent started (`since`, the agent's `startedAt`) — the oldest such entry, which is the one
98
+ * this agent's handoff opened. Anything older is a previous agent's PR wearing the same branch name,
99
+ * which is exactly what showed a merged two-day-old PR as a fresh session's own. Without `since`
100
+ * only an open PR is trusted.
101
+ *
102
+ * `order` exists for the one caller asking a different question (#1512). `'first'` answers
103
+ * identity — which PR did *this agent* open, so a later agent's must not be the answer. `'latest'`
104
+ * answers the handoff decision — which PR last saw the branch, so "did the session keep working
105
+ * past it" is readable off that PR's `headRefOid`; there the oldest entry would call work that a
106
+ * second PR already landed unlanded.
107
+ */
108
+ export function pickAgentPr(prs, since, order = 'first') {
109
+ const open = prs.find(pr => pr.state === 'OPEN');
110
+ if (open)
111
+ return open;
112
+ if (!since)
113
+ return undefined;
114
+ const closed = prs
115
+ .filter(pr => pr.createdAt && pr.createdAt >= since)
116
+ .sort((a, b) => ((a.createdAt ?? '') < (b.createdAt ?? '') ? -1 : 1));
117
+ return order === 'latest' ? closed.at(-1) : closed[0];
118
+ }
119
+ /**
120
+ * A project's open PRs, through its git host. Unlike the other reads here it *rejects* when the git host
121
+ * could not answer — no remote, not logged in, the git host unreachable — instead of resolving `[]`.
122
+ *
123
+ * "No PRs are open" and "I could not look" are different answers, and its caller keeps a baseline
124
+ * of what it has already announced (#1623): taking the second for the first makes the next
125
+ * successful read announce every already-open PR as new. The caller decides what a failure costs;
126
+ * it cannot decide what it never hears about. A project with no git host package has none open.
127
+ */
128
+ export async function openPrs(cwd, gitHost = projectGitHost) {
129
+ const source = await gitHost(cwd);
130
+ if (!source)
131
+ return [];
132
+ const listed = await source.requests({ state: 'open' });
133
+ if (!listed.ok)
134
+ throw new Error(listed.error);
135
+ return listed.requests.map(openPrOf);
136
+ }
137
+ //# sourceMappingURL=pull-requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-requests.js","sourceRoot":"","sources":["../../src/dashboard/pull-requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwC,MAAM,sBAAsB,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,UAAU,EAAe,MAAM,YAAY,CAAA;AAiEhE,2GAA2G;AAC3G,MAAM,UAAU,UAAU,CAAC,OAAuB;IAChD,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE,CAAA;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,QAAQ,CAAC,OAAuB;IAC9C,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,KAAK;QACtB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,E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import { type QueueFor } from '../store/queue.js';
3
+ /** One project's queue, as the dashboard reads it. */
4
+ export interface ProjectQueue {
5
+ projectId: string;
6
+ projectName: string;
7
+ /** The open entries, in order of work: each the task a future agent is started with. */
8
+ entries: string[];
9
+ }
10
+ /**
11
+ * The queue of every project that has one, most entries first: a project one of whose packages
12
+ * provides the queue is listed even with nothing queued (the card shows the projects it can speak
13
+ * for), and a project with no provider is left out (it has no queue, so nothing is said about it).
14
+ * `queueFor` is injectable so this is unit-testable off disk and processes.
15
+ */
16
+ export declare function collectQueue(projects: ProjectSummary[], queueFor?: QueueFor): Promise<ProjectQueue[]>;
17
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/dashboard/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAO/D,sDAAsD;AACtD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,wFAAwF;IACxF,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,QAAQ,GAAE,QAAuB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CASzH"}
@@ -0,0 +1,19 @@
1
+ import { projectQueue } from '../store/queue.js';
2
+ /**
3
+ * The queue of every project that has one, most entries first: a project one of whose packages
4
+ * provides the queue is listed even with nothing queued (the card shows the projects it can speak
5
+ * for), and a project with no provider is left out (it has no queue, so nothing is said about it).
6
+ * `queueFor` is injectable so this is unit-testable off disk and processes.
7
+ */
8
+ export async function collectQueue(projects, queueFor = projectQueue) {
9
+ const queues = [];
10
+ for (const project of projects) {
11
+ const source = await queueFor(project.path).catch(() => undefined);
12
+ if (!source)
13
+ continue;
14
+ const entries = await source.list().catch(() => []);
15
+ queues.push({ projectId: project.id, projectName: project.name, entries });
16
+ }
17
+ return queues.sort((a, b) => b.entries.length - a.entries.length);
18
+ }
19
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/dashboard/queue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,MAAM,mBAAmB,CAAA;AAe/D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAA0B,EAAE,QAAQ,GAAa,YAAY;IAC9F,MAAM,MAAM,GAAmB,EAAE,CAAA;IACjC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QAClE,IAAI,CAAC,MAAM;YAAE,SAAQ;QACrB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAa,EAAE,CAAC,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AACnE,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { QuotaPoller } from '../quota-poller.js';
2
+ import { type QuotaBoundary } from '../quota-boundary.js';
3
+ import type { DriverQuotaUnavailableReason, DriverQuotaWindow } from '@openagt/agent-driver';
4
+ /**
5
+ * Everything the dashboard needs to draw the usage panel (#533): the account's
6
+ * own windows, and where they stand against the quota boundary (#879).
7
+ */
8
+ export interface QuotaView {
9
+ /**
10
+ * The account's quota windows as the agent reported them (session, week, and
11
+ * a week per model). Empty when we have no reading at all — check
12
+ * {@link unavailable} before reading that as "nothing used".
13
+ */
14
+ windows: DriverQuotaWindow[];
15
+ /** When the reading was taken, epoch ms. Absent when there has never been one. */
16
+ readAt?: number;
17
+ /**
18
+ * Why there is no reading, when there isn't one. Present alongside stale
19
+ * `windows` too: the last good reading is kept through a blip, and this says
20
+ * the newest attempt failed, so the UI can mark it stale rather than blank it.
21
+ */
22
+ unavailable?: DriverQuotaUnavailableReason;
23
+ /**
24
+ * The quota boundary of the account's week (#879). Absent when there is no
25
+ * reading, or when the week's reset could not be placed — which is "we don't
26
+ * know", not "nothing is allowed".
27
+ */
28
+ boundary?: QuotaBoundary;
29
+ }
30
+ /** Where a dashboard reads the quota from. */
31
+ export interface QuotaSource {
32
+ read(): Promise<QuotaView>;
33
+ /** Stop any polling behind it. */
34
+ stop(): void;
35
+ }
36
+ /**
37
+ * A {@link QuotaSource} backed by a live poller.
38
+ *
39
+ * The boundary is measured per read rather than captured: it moves with the clock, so a cached
40
+ * one would be stale the moment the week's day rolls over. A read costs no reading of the
41
+ * account: the poller's last good windows are measured again.
42
+ */
43
+ export declare function pollerQuotaSource(poller: QuotaPoller, now?: () => number): QuotaSource;
44
+ /**
45
+ * The daemon's own quota source: it polls for the whole life of the dashboard,
46
+ * not just during an agent, because the panel has to show where the account stands
47
+ * even when nothing is running.
48
+ *
49
+ * Separate from the reading an agent takes for itself: that one dies with the agent, and
50
+ * nothing stops a running agent over quota anyway. This one exists to draw the bar.
51
+ */
52
+ export declare function defaultQuotaSource(): QuotaSource;
53
+ //# sourceMappingURL=quota.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota.d.ts","sourceRoot":"","sources":["../../src/dashboard/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE5F;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,4BAA4B,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAA;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,CAAA;IAC1B,kCAAkC;IAClC,IAAI,IAAI,IAAI,CAAA;CACb;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,GAAE,MAAM,MAAyB,GAAG,WAAW,CAgBxG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAKhD"}
@@ -0,0 +1,42 @@
1
+ import { QuotaPoller } from '../quota-poller.js';
2
+ import { weekBoundary } from '../quota-boundary.js';
3
+ import { ClaudeCodeDriver } from '@openagt/agent-driver-claude';
4
+ /**
5
+ * A {@link QuotaSource} backed by a live poller.
6
+ *
7
+ * The boundary is measured per read rather than captured: it moves with the clock, so a cached
8
+ * one would be stale the moment the week's day rolls over. A read costs no reading of the
9
+ * account: the poller's last good windows are measured again.
10
+ */
11
+ export function pollerQuotaSource(poller, now = () => Date.now()) {
12
+ return {
13
+ stop: () => poller.stop(),
14
+ read: async () => {
15
+ const envelope = poller.current();
16
+ const windows = envelope.lastGood?.windows ?? [];
17
+ const boundary = weekBoundary(windows, now());
18
+ const view = {
19
+ windows,
20
+ ...(boundary ? { boundary } : {}),
21
+ ...(envelope.lastGoodAt !== undefined ? { readAt: envelope.lastGoodAt } : {}),
22
+ ...(envelope.latest && !envelope.latest.available ? { unavailable: envelope.latest.reason } : {}),
23
+ };
24
+ return view;
25
+ },
26
+ };
27
+ }
28
+ /**
29
+ * The daemon's own quota source: it polls for the whole life of the dashboard,
30
+ * not just during an agent, because the panel has to show where the account stands
31
+ * even when nothing is running.
32
+ *
33
+ * Separate from the reading an agent takes for itself: that one dies with the agent, and
34
+ * nothing stops a running agent over quota anyway. This one exists to draw the bar.
35
+ */
36
+ export function defaultQuotaSource() {
37
+ const driver = new ClaudeCodeDriver();
38
+ const poller = new QuotaPoller({ read: () => driver.readQuota() });
39
+ poller.start();
40
+ return pollerQuotaSource(poller);
41
+ }
42
+ //# sourceMappingURL=quota.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quota.js","sourceRoot":"","sources":["../../src/dashboard/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAqC/D;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB,EAAE,GAAG,GAAiB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACzF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;QACzB,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;YACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAA;YAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;YAC7C,MAAM,IAAI,GAAc;gBACtB,OAAO;gBACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjC,GAAG,CAAC,QAAQ,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7E,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAClG,CAAA;YACD,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAA;IACrC,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAClE,MAAM,CAAC,KAAK,EAAE,CAAA;IACd,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAA;AAClC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { OpenAgentEvent } from '../events.js';
3
+ import type { StartAgentOptions, StartAgentResult } from './types.js';
4
+ /**
5
+ * The device-side of the remote-agent relay (#1067): the two endpoints a daemon exposes so another
6
+ * daemon (holding this device's token) can run a session here and watch it. They live under
7
+ * `/_relay`, behind the shared-token guard (#1051) in {@link startDashboard}. The guard admits a matching
8
+ * `oa_daemon` cookie without the browser-only `?token=` 302, so a daemon-to-daemon call passes with
9
+ * a cookie and a token-less caller is already 401'd before it reaches here.
10
+ *
11
+ * - `POST /_relay/start` starts an ordinary local agent and returns its {@link StartAgentResult}. It
12
+ * runs in this device's own home checkout (slice 1); which project it targets is a later slice.
13
+ * - `GET /_relay/events?run=<id>` streams that agent's events as newline-delimited JSON until it
14
+ * ends or the caller disconnects.
15
+ * - `GET /_relay/ping` (#1072) a cookie-guarded reachability probe: 200 and an empty body, starts
16
+ * nothing. The online/offline status the dashboard shows is the local daemon calling this on each
17
+ * saved device with its token; a token-less caller is already 401'd by the shared-token guard (#1051) above.
18
+ * - `POST /_relay/rpc` (#1067 slice 2) runs one whitelisted run-scoped RPC (a read/diff/steer/handoff/
19
+ * push/PR) against this device's own checkout for the daemon relaying an agent here, answering {result}.
20
+ */
21
+ export declare const RELAY_PREFIX = "/_relay";
22
+ /** What the daemon wires behind the relay endpoints: its own start closure and an events tail. */
23
+ export interface RelayHandlers {
24
+ start: (prompt: string, options: StartAgentOptions, projectId?: string) => StartAgentResult | Promise<StartAgentResult>;
25
+ tailEvents: (agentId: string, onEvent: (event: OpenAgentEvent) => void) => () => void;
26
+ /** Run one whitelisted read/steer/handoff RPC against THIS device's own checkout, for the daemon
27
+ * relaying an agent here (#1067 slice 2); the caller wraps the result as {result}. */
28
+ rpc?: (fn: string, args: unknown[]) => Promise<unknown>;
29
+ }
30
+ /** Route a `/_relay/*` request. A host that wired no relay handlers 404s every relay route. */
31
+ export declare function handleRelayRequest(req: IncomingMessage, res: ServerResponse, pathname: string, handlers: RelayHandlers | undefined): Promise<void>;
32
+ //# sourceMappingURL=relay-endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-endpoints.d.ts","sourceRoot":"","sources":["../../src/dashboard/relay-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGrE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,YAAY,CAAA;AAErC,kGAAkG;AAClG,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACvH,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,KAAK,MAAM,IAAI,CAAA;IACrF;2FACuF;IACvF,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACxD;AAUD,+FAA+F;AAC/F,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,aAAa,GAAG,SAAS,GAClC,OAAO,CAAC,IAAI,CAAC,CASf"}
@@ -0,0 +1,115 @@
1
+ import { end, readJsonBody, requireGet, sendJson } from './http.js';
2
+ /**
3
+ * The device-side of the remote-agent relay (#1067): the two endpoints a daemon exposes so another
4
+ * daemon (holding this device's token) can run a session here and watch it. They live under
5
+ * `/_relay`, behind the shared-token guard (#1051) in {@link startDashboard}. The guard admits a matching
6
+ * `oa_daemon` cookie without the browser-only `?token=` 302, so a daemon-to-daemon call passes with
7
+ * a cookie and a token-less caller is already 401'd before it reaches here.
8
+ *
9
+ * - `POST /_relay/start` starts an ordinary local agent and returns its {@link StartAgentResult}. It
10
+ * runs in this device's own home checkout (slice 1); which project it targets is a later slice.
11
+ * - `GET /_relay/events?run=<id>` streams that agent's events as newline-delimited JSON until it
12
+ * ends or the caller disconnects.
13
+ * - `GET /_relay/ping` (#1072) a cookie-guarded reachability probe: 200 and an empty body, starts
14
+ * nothing. The online/offline status the dashboard shows is the local daemon calling this on each
15
+ * saved device with its token; a token-less caller is already 401'd by the shared-token guard (#1051) above.
16
+ * - `POST /_relay/rpc` (#1067 slice 2) runs one whitelisted run-scoped RPC (a read/diff/steer/handoff/
17
+ * push/PR) against this device's own checkout for the daemon relaying an agent here, answering {result}.
18
+ */
19
+ export const RELAY_PREFIX = '/_relay';
20
+ const MAX_START_BODY = 256 * 1024;
21
+ /** Route a `/_relay/*` request. A host that wired no relay handlers 404s every relay route. */
22
+ export async function handleRelayRequest(req, res, pathname, handlers) {
23
+ // Ping is a pure reachability + auth probe (#1072): it needs no wired handlers and starts nothing,
24
+ // so it answers even on a host that enabled no relay. Reaching here means the cookie already passed.
25
+ if (pathname === `${RELAY_PREFIX}/ping`)
26
+ return handlePing(req, res);
27
+ if (!handlers)
28
+ return end(res, 404, 'relay not enabled');
29
+ if (pathname === `${RELAY_PREFIX}/start`)
30
+ return handleStart(req, res, handlers);
31
+ if (pathname === `${RELAY_PREFIX}/events`)
32
+ return handleEvents(req, res, handlers);
33
+ if (pathname === `${RELAY_PREFIX}/rpc`)
34
+ return handleRpc(req, res, handlers);
35
+ end(res, 404, 'not found');
36
+ }
37
+ /** `GET /_relay/ping` (#1072): answer 200 with an empty body. Starts nothing; only proves this
38
+ * daemon is reachable and the caller's cookie is valid (the shared-token guard (#1051) already enforced that). */
39
+ function handlePing(req, res) {
40
+ if (!requireGet(req, res))
41
+ return;
42
+ end(res, 200, '');
43
+ }
44
+ /** `POST /_relay/start`: read the agent request, start it locally, and answer with the result JSON. */
45
+ async function handleStart(req, res, handlers) {
46
+ if (req.method !== 'POST')
47
+ return end(res, 405, 'method not allowed', { allow: 'POST' });
48
+ let body;
49
+ try {
50
+ body = (await readJsonBody(req, MAX_START_BODY));
51
+ }
52
+ catch {
53
+ return end(res, 400, 'invalid request body');
54
+ }
55
+ const prompt = typeof body.prompt === 'string' ? body.prompt : '';
56
+ const options = (body.options && typeof body.options === 'object' ? body.options : {});
57
+ // Never relay onward from a relayed agent: strip any nested target before starting it here.
58
+ // And a start relayed to a device never names a branch: the caller's branches are not this machine's.
59
+ const { remote: _drop, base: _callers, ...local } = options;
60
+ let result;
61
+ try {
62
+ result = await handlers.start(prompt, local, undefined);
63
+ }
64
+ catch (err) {
65
+ result = { ok: false, error: err instanceof Error ? err.message : String(err) };
66
+ }
67
+ sendJson(res, result);
68
+ }
69
+ /** `GET /_relay/events?run=<id>`: stream the agent's events as newline-delimited JSON. */
70
+ function handleEvents(req, res, handlers) {
71
+ if (!requireGet(req, res))
72
+ return;
73
+ const agentId = new URL(req.url ?? '/', 'http://localhost').searchParams.get('run');
74
+ if (!agentId)
75
+ return end(res, 400, 'missing run id');
76
+ res.writeHead(200, { 'content-type': 'application/x-ndjson', 'cache-control': 'no-cache' });
77
+ const stop = handlers.tailEvents(agentId, event => {
78
+ // A dropped write (the caller went away mid-line) must not throw out of the tail callback.
79
+ try {
80
+ res.write(`${JSON.stringify(event)}\n`);
81
+ }
82
+ catch {
83
+ // the socket is gone; the close handler below tears the tail down
84
+ }
85
+ });
86
+ const close = () => stop();
87
+ res.on('close', close);
88
+ req.on('close', close);
89
+ }
90
+ const MAX_RPC_BODY = 256 * 1024;
91
+ /** POST /_relay/rpc: run one whitelisted RPC on this device and answer {result}. */
92
+ async function handleRpc(req, res, handlers) {
93
+ if (req.method !== 'POST')
94
+ return end(res, 405, 'method not allowed', { allow: 'POST' });
95
+ if (!handlers.rpc)
96
+ return end(res, 404, 'relay rpc not enabled');
97
+ let body;
98
+ try {
99
+ body = (await readJsonBody(req, MAX_RPC_BODY));
100
+ }
101
+ catch {
102
+ return end(res, 400, 'invalid request body');
103
+ }
104
+ const fn = typeof body.fn === 'string' ? body.fn : '';
105
+ const args = Array.isArray(body.args) ? body.args : [];
106
+ if (!fn)
107
+ return end(res, 400, 'missing rpc name');
108
+ try {
109
+ sendJson(res, { result: await handlers.rpc(fn, args) });
110
+ }
111
+ catch (err) {
112
+ end(res, 500, err instanceof Error ? err.message : 'rpc failed');
113
+ }
114
+ }
115
+ //# sourceMappingURL=relay-endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-endpoints.js","s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AAK,EAAE,MAAM,EAAE,CAAC,CAAA;IACxF,IAAI,CAAC,QAAQ,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,uBAAuB,CAAC,CAAA;IAChE,IAAI,IAAsC,CAAA;IAC1C,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,MAAM,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAqC,CAAA;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,sBAAsB,CAAC,CAAA;IAC9C,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACrD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;IACtD,IAAI,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,kBAAkB,CAAC,CAAA;IACjD,IAAI,CAAC;QACH,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;IACzD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;IAClE,CAAC;AACH,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { EventStream } from '../event-stream.js';
2
+ import type { OpenAgentEvent } from '../events.js';
3
+ import type { AgentMeta } from '../store/index.js';
4
+ import type { StartAgentOptions, StartAgentResult } from './types.js';
5
+ /**
6
+ * The server-side half of "run on a connected device" (#1067). The local daemon holds the saved
7
+ * device's token, so it - not the browser - drives the remote daemon: it POSTs the agent to the
8
+ * remote's `/_relay/start` and then fetch-streams the remote's `/_relay/events` back into a local
9
+ * {@link EventStream}, which the dashboard reads over its normal same-origin `onEvents` channel. So
10
+ * the browser never talks cross-origin and the token never leaves the two daemons (issue #1067 (b)).
11
+ *
12
+ * Authentication is the shared-token cookie (#1051), sent daemon-to-daemon: `Cookie: oa_daemon=<token>` with no
13
+ * `Origin` header. The remote's guard admits a matching cookie without the browser-only `?token=`
14
+ * 302, and its `/_rpc` CSRF check (absent Origin passes) is not even on these raw routes.
15
+ */
16
+ /** Where a relayed agent executes: the remote daemon's origin and its #1051 token. Memory-only. */
17
+ export interface RemoteTarget {
18
+ url: string;
19
+ token: string;
20
+ }
21
+ /** The body a relay start forwards to the remote's `/_relay/start`. */
22
+ export interface RelayStartBody {
23
+ prompt: string;
24
+ options: StartAgentOptions;
25
+ }
26
+ /**
27
+ * Health-check a saved device (#1072): a cookie'd `GET /_relay/ping`, true on any 2xx, false on a
28
+ * non-2xx, an unreachable host, or the timeout. The token stays in memory for the check only, never
29
+ * persisted, same as {@link startRemoteAgent}. This is how the browser's status dots learn reachable
30
+ * from not: it has the tokens, the daemon does the cross-origin request.
31
+ */
32
+ export declare function pingRemote(target: RemoteTarget): Promise<boolean>;
33
+ /**
34
+ * Start an agent on the remote daemon and return its {@link StartAgentResult} (with the remote's own run
35
+ * id). A non-2xx or a transport failure surfaces as an `ok: false` result the dashboard shows, the
36
+ * same shape a local refusal has, so the caller does not special-case remote errors.
37
+ */
38
+ export declare function startRemoteAgent(target: RemoteTarget, body: RelayStartBody): Promise<StartAgentResult>;
39
+ /**
40
+ * Relay one run-scoped RPC to the device that owns a remote agent (#1067 slice 2). The local daemon
41
+ * holds the device token, so a read/diff/handoff/push/PR for a relayed agent runs ON the device: POST
42
+ * {fn, args} to the remote's /_relay/rpc over the shared-token cookie (#1051) (no Origin), returning the device's
43
+ * result. Throws on an unreachable device or a non-2xx so the caller falls back to its own empty/error
44
+ * shape, the same way a failed local read does.
45
+ */
46
+ export declare function relayRpc(target: RemoteTarget, fn: string, args: unknown[]): Promise<unknown>;
47
+ /**
48
+ * Fetch-stream a remote agent's newline-delimited events into `onEvent` until the remote closes the
49
+ * body, the agent ends, or `cancel()` is called. A 401 (the token was rotated) ends the stream
50
+ * cleanly rather than as an error, so the dashboard sees a normal `done`, not a lost connection.
51
+ * Returns a cancel function; calling it aborts the fetch and releases the reader.
52
+ */
53
+ export declare function streamRemoteEvents(target: RemoteTarget, agentId: string, onEvent: (event: OpenAgentEvent) => void, onEnd?: () => void): () => void;
54
+ /**
55
+ * The local daemon's live relayed runs (#1067), keyed by the remote agent id. Registering an agent opens
56
+ * an {@link EventStream} the dashboard reads through `onEvents`, fed by {@link streamRemoteEvents}
57
+ * from the remote. This map is where a saved device's token lives daemon-side: in memory, for the
58
+ * run's lifetime.
59
+ *
60
+ * The `targets` map outlives the event pump (#1067 slice 2): a finished remote agent's post-run reads,
61
+ * open-PR and merge still have to reach the device after its event stream has ended, so the device
62
+ * target is kept until {@link dispose} clears it, not dropped when the stream closes.
63
+ *
64
+ * The `metas` map (#1077) holds a local {@link AgentMeta} stub per relayed agent so `onAgents` can show a
65
+ * remote run in the session list and re-open it after a dashboard reload; {@link list} projects it
66
+ * per project. Same lifetime as `targets`: it outlives the event stream and is cleared on dispose.
67
+ */
68
+ export declare class RelayedAgents {
69
+ private readonly agents;
70
+ private readonly targets;
71
+ private readonly metas;
72
+ /** Open a local stream for a remote agent and start pumping the remote's events into it. */
73
+ register(agentId: string, target: RemoteTarget, meta: AgentMeta, projectId: string): void;
74
+ /** The live event stream for a relayed agent, or undefined when this daemon is not relaying it. */
75
+ get(agentId: string | undefined): EventStream<OpenAgentEvent> | undefined;
76
+ /** The device a relayed agent runs on, kept past the event stream so post-run push/PR still reach it. */
77
+ target(agentId: string | undefined): RemoteTarget | undefined;
78
+ /** A project's relayed run stubs (#1077), newest-first, so `onAgents` can surface them in the list. */
79
+ list(projectId: string): AgentMeta[];
80
+ /** Fold each relayed event into the agent's list row via the store's own reducer (#1077), so the
81
+ * local stub mirrors the device: the terminal status on `end`, the waiting flag while it is parked
82
+ * (#785), the driver once its session starts. Events carry no write time, so this stamps its own. */
83
+ private apply;
84
+ /** Close a relayed agent's event stream (not its target). Idempotent. */
85
+ private endStream;
86
+ /** Stop every pump, close every stream, and forget every device target + list stub, on daemon shutdown. */
87
+ dispose(): void;
88
+ }
89
+ /**
90
+ * Fold one relayed event into the memory-only row of a run on a device: what the device's own
91
+ * card would say, kept here because that card is on the device. The events are the ones a run's
92
+ * diary yields: the agent's session id, its cost, its end.
93
+ */
94
+ export declare function foldRelayedEvent(meta: AgentMeta, event: OpenAgentEvent, at: string): AgentMeta;
95
+ //# sourceMappingURL=remote-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-run.d.ts","sourceRoot":"","sources":["../../src/dashboard/remote-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGrE;;;;;;;;;;GAUG;AAEH,mGAAmG;AACnG,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAOD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAUvE;AAOD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,MA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