@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,284 @@
1
+ import { sayToRun } from '../dashboard/run-inbox.js';
2
+ import { bridgeQuestions } from '../dashboard/bridge-store.js';
3
+ import { openInApp } from '../dashboard/open-in-app.js';
4
+ import { contextBridgeBrowser, contextPreferences, contextStartAgent, resolveProjectPath, resolveAgentPath } from './context.js';
5
+ import { relayOr } from './relay-agent.js';
6
+ import { hostname } from 'node:os';
7
+ import { findAgent, isPidAlive, isRunId, loadAgentEvents, projectRuns, readLiveMetas } from '../store/index.js';
8
+ import { withAgentLock } from '../agent-locks.js';
9
+ import { removeProjectWorktree, deleteProjectAgent } from '../worktrees.js';
10
+ import { mergeAgentPr, openAgentPullRequest, mergeAgentBranch, pushAgentBranch } from '../dashboard/agent-handoff.js';
11
+ import { pendingChoices } from '../open-choices.js';
12
+ import { createRepository } from '../store/repository.js';
13
+ import { providedDataChanged } from '../store/provided.js';
14
+ /**
15
+ * The key every action on one run locks under (`agent-locks.ts`): a Remove, a Delete and an Open
16
+ * PR on the same run each run their own git; serialized, whichever runs second finds the state
17
+ * the first one left and acts on that. The project and the run's id, not the checkout's path:
18
+ * the path is the branches provider's to know, and an Open PR on a run whose checkout is gone
19
+ * still locks the run.
20
+ */
21
+ export function agentLockKey(cwd, agentId) {
22
+ return `${cwd}\0${agentId}`;
23
+ }
24
+ // The write side behind the dashboard (#405, #1774). The daemon runs no agent, so every write here
25
+ // reaches a run through what the run's tool reads: Start is the project's `start` hook line; what
26
+ // a person says to a run (their words, their answer to its question) is a line in the run's inbox
27
+ // file while the run works, and the project's `resume` hook line once it has ended; Stop is a
28
+ // signal to the pid the run's card names. OpenAgent names no tool in any of them.
29
+ /**
30
+ * Stop a live agent (the Stop button): SIGINT to the process the run's own card names, when it is
31
+ * this machine's and alive. The card is the file the dashboard shows the run from, and its pid is
32
+ * whoever runs the agent; OpenAgent names no tool. Nothing else: a run without a live pid
33
+ * here has nothing to stop.
34
+ */
35
+ export async function sendStop(projectId, agentId) {
36
+ return relayOr(agentId, 'sendStop', [projectId, agentId], async () => {
37
+ const cwd = await resolveProjectPath(projectId);
38
+ if (!cwd || !agentId)
39
+ return;
40
+ const meta = (await readLiveMetas(cwd).catch(() => [])).find(agent => agent.id === agentId);
41
+ if (!meta || meta.status !== 'running' || meta.pid === undefined || meta.host !== hostname() || !isPidAlive(meta.pid))
42
+ return;
43
+ try {
44
+ process.kill(meta.pid, 'SIGINT');
45
+ }
46
+ catch {
47
+ // Gone between the probe and the signal.
48
+ }
49
+ }, undefined);
50
+ }
51
+ /**
52
+ * Answer the question a run stopped on (#304, #1774). `pick` is one option id, or the chosen
53
+ * subset of a multi-select; the answer handed to the run is the chosen labels, read off the
54
+ * question as the run's own diary holds it, so only what the agent offered can be answered.
55
+ */
56
+ export async function sendChoice(projectId, id, pick, agentId) {
57
+ return relayOr(agentId, 'sendChoice', [projectId, id, pick, agentId], async () => {
58
+ const cwd = await resolveProjectPath(projectId);
59
+ if (!cwd || !agentId || !isRunId(agentId))
60
+ return { ok: false, error: 'unknown session' };
61
+ const question = pendingChoices((await loadAgentEvents(cwd, agentId).catch(() => undefined)) ?? []).find(choice => choice.id === id);
62
+ if (!question)
63
+ return { ok: false, error: 'that question is no longer open' };
64
+ const picked = [pick].flat();
65
+ const labels = question.options.filter(option => picked.includes(option.id)).map(option => option.label);
66
+ if (labels.length !== picked.length)
67
+ return { ok: false, error: 'every pick must be one of the question\'s options' };
68
+ if (!question.multi && labels.length !== 1)
69
+ return { ok: false, error: 'pick exactly one option' };
70
+ return sayToRun(cwd, agentId, { kind: 'answer', question: question.title, answer: labels.length ? labels.join(', ') : '(none)' });
71
+ }, { ok: false, error: 'could not reach the device' });
72
+ }
73
+ /**
74
+ * Queue the user's pick for the question a Claude web session is parked on (#1237).
75
+ *
76
+ * Not a line for a run like {@link sendChoice}: a cloud agent has no run here to hand it to, so
77
+ * the pick goes to the bridge store, where the browser extension collects it, types
78
+ * it into the session's composer and submits. Only labels of the currently parked question are
79
+ * accepted — one, or a multi-select's subset — and the daemon composes the text typed from them,
80
+ * so this can never put arbitrary text in front of another product's agent. Local only, no
81
+ * relay: the bridge lives on the daemon the extension talks to.
82
+ */
83
+ export async function sendBridgeAnswer(sessionId, labels) {
84
+ if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
85
+ return { ok: false, error: 'unknown session' };
86
+ if (!Array.isArray(labels) || !labels.every(label => typeof label === 'string' && label.trim()))
87
+ return { ok: false, error: 'answer labels are required' };
88
+ const queued = bridgeQuestions().queueAnswer(sessionId, labels);
89
+ return typeof queued === 'string' ? { ok: false, error: queued } : { ok: true };
90
+ }
91
+ /** Withdraw a queued bridge answer (#1237). A no-op once the extension has delivered it. */
92
+ export async function sendBridgeAnswerCancel(sessionId) {
93
+ if (typeof sessionId !== 'string' || !/^session_[A-Za-z0-9]{1,128}$/.test(sessionId))
94
+ return;
95
+ bridgeQuestions().cancelAnswer(sessionId);
96
+ }
97
+ /**
98
+ * Say something to a run (#714, #1774): the person's own words, the next prompt of the same
99
+ * conversation. A run that is working takes them when its turn ends; an ended run is resumed
100
+ * with them. Empty messages are dropped.
101
+ */
102
+ export async function sendMessage(projectId, text, agentId) {
103
+ const message = text.trim();
104
+ if (!message)
105
+ return { ok: true };
106
+ return relayOr(agentId, 'sendMessage', [projectId, text, agentId], async () => {
107
+ const cwd = await resolveProjectPath(projectId);
108
+ if (!cwd || !agentId || !isRunId(agentId))
109
+ return { ok: false, error: 'unknown session' };
110
+ return sayToRun(cwd, agentId, { kind: 'message', text: message });
111
+ }, { ok: false, error: 'could not reach the device' });
112
+ }
113
+ /**
114
+ * Remove a retained worktree (#737). An agent that failed or was stopped keeps its checkout so you
115
+ * can inspect it; this is the explicit cleanup for one, since nothing removes them on a timer.
116
+ *
117
+ * The checks and the removal are {@link removeProjectWorktree}'s, shared with the CLI's removal
118
+ * path (#982) so the surfaces cannot drift again; this adds only the agent lock around them.
119
+ */
120
+ export async function sendRemoveWorktree(projectId, agentId) {
121
+ return withWorktreeRemoval(projectId, agentId, cwd => removeProjectWorktree(cwd, agentId));
122
+ }
123
+ /**
124
+ * Shared body of the two worktree-removing writes (#982/#1032): resolve the project and refuse
125
+ * when it has no local path. Only the removal action and its result shape differ.
126
+ */
127
+ async function withWorktreeRemoval(projectId, agentId, remove) {
128
+ const cwd = await resolveProjectPath(projectId);
129
+ if (!cwd)
130
+ return { ok: false, error: 'this project has no local path on this server' };
131
+ // Under the agent lock: a Remove/Delete and an Open PR on the same finished run each run their
132
+ // own git in its checkout; serialized, whichever runs second finds the state the first one left
133
+ // and acts on that.
134
+ return withAgentLock(agentLockKey(cwd, agentId), () => remove(cwd));
135
+ }
136
+ /**
137
+ * Delete a session (#1032): remove it from the dashboard, records and all — the sibling of
138
+ * {@link sendRemoveWorktree}, and the one destructive-of-history action, so its surface confirms
139
+ * first. The checks, the worktree removal and what it leaves behind (the branch and its
140
+ * commits) are all {@link deleteProjectAgent}'s; this adds only the agent lock around them.
141
+ */
142
+ export async function sendDeleteAgent(projectId, agentId) {
143
+ return withWorktreeRemoval(projectId, agentId, cwd => deleteProjectAgent(cwd, agentId));
144
+ }
145
+ /**
146
+ * Start a run in the project (#405, #1774): the project's own `start` hook line, reached through
147
+ * the daemon's wired `startAgent` (which relays to a connected device when the options name
148
+ * one). Answers the id of the run the hook began, or why there is none: a project without the
149
+ * line cannot start a run from here.
150
+ */
151
+ export async function sendStart(projectId, prompt, options = {}) {
152
+ // Throws on an unwired context (D3): there is one host and it wires everything, so "not
153
+ // enabled on this server" stopped being a state a request can find.
154
+ const startAgent = contextStartAgent();
155
+ const text = prompt.trim();
156
+ if (!text)
157
+ return { ok: false, error: 'a non-empty prompt is required' };
158
+ return startAgent(text, options, projectId);
159
+ }
160
+ /**
161
+ * Open a project in the OS file manager or an editor (#490). Localhost-only: the daemon
162
+ * spawns a local command against the project's own registered path. A public host has no
163
+ * local path to resolve, so it returns an error rather than spawning anything.
164
+ *
165
+ * With a `agentId` it opens that session's own checkout instead (#798) — the whole point of
166
+ * opening it is to look at what the agent is doing, which is not in the project's tree.
167
+ */
168
+ export async function sendOpenInApp(projectId, target, agentId) {
169
+ const cwd = agentId ? await resolveAgentPath(projectId, agentId) : await resolveProjectPath(projectId);
170
+ if (!cwd)
171
+ return { ok: false, error: 'this project has no local path on this server' };
172
+ // #727: honour the stored editor preference; absent falls back to $OPENAGENT_EDITOR, then `code`.
173
+ const editor = target === 'editor' ? (await contextPreferences()?.read().catch(() => ({})))?.editor : undefined;
174
+ return openInApp(cwd, target, undefined, editor);
175
+ }
176
+ /**
177
+ * The session's own branch, or undefined when the run/project is unknown. Shared by the two
178
+ * handoff actions so they address exactly what {@link onAgentHandoff} reports on.
179
+ */
180
+ async function handoffTargetFor(projectId, agentId) {
181
+ const cwd = await resolveProjectPath(projectId);
182
+ if (!cwd || !isRunId(agentId))
183
+ return undefined;
184
+ const agent = await findAgent(cwd, agentId).catch(() => undefined);
185
+ // The branch is read from the project repo; the tree the agent edited is its own checkout (#453),
186
+ // and for a session that has not committed, that is the only place its work exists.
187
+ const checkout = (await resolveAgentPath(projectId, agentId)) ?? cwd;
188
+ return agent ? { cwd, agent, checkout } : undefined;
189
+ }
190
+ /**
191
+ * Open a PR for a finished session's branch (#799): the project's branches provider pushes it
192
+ * first if the remote lacks it (#1774).
193
+ *
194
+ * The title and body come from what the agent already recorded: the branch the agent named its
195
+ * work with and the intent the user asked for. Nothing new is invented and nothing extra is asked
196
+ * of the user, which is the point of "offer the next step rather than describe it".
197
+ */
198
+ export async function sendOpenPullRequest(projectId, agentId, options = {}) {
199
+ return relayOr(agentId, 'sendOpenPullRequest', [projectId, agentId, options], async () => {
200
+ const target = await handoffTargetFor(projectId, agentId);
201
+ if (!target)
202
+ return { ok: false, error: 'unknown session' };
203
+ // Under the agent lock, so the provider's push inside `openAgentPullRequest` cannot race a
204
+ // Remove of the same checkout.
205
+ const opened = await withAgentLock(agentLockKey(target.cwd, agentId), () => openAgentPullRequest(target.cwd, target.agent, options.draft === true ? { draft: true } : {}));
206
+ // Record it on the finished run (E6), through the project's runs provider. The session's own
207
+ // process is gone by now, so there is no event stream to carry the fact — but it is the same
208
+ // fact, and every surface reads it from the same place either way rather than re-deriving it
209
+ // from branch names. No provider: there is no record to carry it, and the PR is still open.
210
+ if (opened.ok && opened.number !== undefined && opened.url) {
211
+ await (await projectRuns(target.cwd).catch(() => undefined))?.patch(agentId, { pr: { number: opened.number, url: opened.url } });
212
+ }
213
+ return opened;
214
+ }, { ok: false, error: 'could not reach the device' });
215
+ }
216
+ /**
217
+ * The user's Publish branch action (#1820): push a finished run's branch and open no pull request,
218
+ * the last step where the project has no git host package. Under the agent lock, as Open PR is, so the push cannot race a Remove.
219
+ */
220
+ export async function sendPush(projectId, agentId) {
221
+ return relayOr(agentId, 'sendPush', [projectId, agentId], async () => {
222
+ const target = await handoffTargetFor(projectId, agentId);
223
+ if (!target)
224
+ return { ok: false, error: 'unknown session' };
225
+ if (target.agent.status === 'running')
226
+ return { ok: false, error: 'that session is still going' };
227
+ return withAgentLock(agentLockKey(target.cwd, agentId), () => pushAgentBranch(target.cwd, target.agent));
228
+ }, { ok: false, error: 'could not reach the device' });
229
+ }
230
+ /**
231
+ * The user's "Create a repository" action, for a project with no remote: the project's repository
232
+ * provider creates it private, sets it as the origin and pushes. The git host is looked up again
233
+ * afterwards: the project has a page there now.
234
+ */
235
+ export async function sendCreateRepository(projectId) {
236
+ const cwd = await resolveProjectPath(projectId);
237
+ if (!cwd)
238
+ return { ok: false, error: 'this project has no local path on this server' };
239
+ const created = await createRepository(cwd);
240
+ if (created.ok)
241
+ providedDataChanged(cwd);
242
+ return created;
243
+ }
244
+ /**
245
+ * The user's "Merge into main" action: merge a finished run's branch into the project's default
246
+ * branch on this machine, for a project with no remote to push to. Under the agent lock, as the
247
+ * push is, so the merge cannot race a Remove.
248
+ */
249
+ export async function sendMergeBranch(projectId, agentId) {
250
+ return relayOr(agentId, 'sendMergeBranch', [projectId, agentId], async () => {
251
+ const target = await handoffTargetFor(projectId, agentId);
252
+ if (!target)
253
+ return { ok: false, error: 'unknown session' };
254
+ if (target.agent.status === 'running')
255
+ return { ok: false, error: 'that session is still going' };
256
+ return withAgentLock(agentLockKey(target.cwd, agentId), () => mergeAgentBranch(target.cwd, target.agent));
257
+ }, { ok: false, error: 'could not reach the device' });
258
+ }
259
+ /**
260
+ * The user's Merge action (#1391): merge a finished run's open pull request, directly. A run
261
+ * that is still working has no Merge: its agent is still writing its branch, and the button comes
262
+ * with the ended view.
263
+ */
264
+ export async function sendMerge(projectId, agentId) {
265
+ return relayOr(agentId, 'sendMerge', [projectId, agentId], async () => {
266
+ const target = await handoffTargetFor(projectId, agentId);
267
+ if (!target)
268
+ return { ok: false, error: 'unknown session' };
269
+ if (target.agent.status === 'running')
270
+ return { ok: false, error: 'that session is still going' };
271
+ return mergeAgentPr(target.cwd, target.agent);
272
+ }, { ok: false, error: 'could not reach the device' });
273
+ }
274
+ /**
275
+ * Ask the daemon's bridge browser to show its window (for the one-time sign-in), hide it again,
276
+ * or restart (#1332). Anything else is refused; a browser that is not running ignores show/hide.
277
+ */
278
+ export async function sendBridgeBrowser(action) {
279
+ if (action !== 'show' && action !== 'hide' && action !== 'restart')
280
+ return { ok: false, error: 'unknown action' };
281
+ await contextBridgeBrowser().act(action);
282
+ return { ok: true };
283
+ }
284
+ //# sourceMappingURL=control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/dashboard-rpc/control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,2BAA2B,CAAA;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAoC,MAAM,6BAA6B,CAAA;AACzF,OAAO,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E,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QACzD,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAA;QAC3D,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAA;QACjG,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IAC/C,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAA;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAA2B;IACjE,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACjH,MAAM,oBAAoB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AACrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** One device to health-check: its profile id plus the origin and token to reach it with. */
2
+ export interface DeviceCheck {
3
+ id: string;
4
+ url: string;
5
+ token: string;
6
+ }
7
+ /** Ping each saved device and map its id to whether it answered (#1072). Bad entries are dropped. */
8
+ export declare function checkDevices(devices: DeviceCheck[]): Promise<Record<string, boolean>>;
9
+ //# sourceMappingURL=devices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/devices.ts"],"names":[],"mappings":"AAOA,6FAA6F;AAC7F,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAOD,qGAAqG;AACrG,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAI3F"}
@@ -0,0 +1,12 @@
1
+ import { pingRemote } from '../dashboard/remote-run.js';
2
+ function isDeviceCheck(value) {
3
+ const d = value;
4
+ return !!d && typeof d.id === 'string' && typeof d.url === 'string' && typeof d.token === 'string';
5
+ }
6
+ /** Ping each saved device and map its id to whether it answered (#1072). Bad entries are dropped. */
7
+ export async function checkDevices(devices) {
8
+ const valid = (Array.isArray(devices) ? devices : []).filter(isDeviceCheck);
9
+ const entries = await Promise.all(valid.map(async (d) => [d.id, await pingRemote({ url: d.url, token: d.token })]));
10
+ return Object.fromEntries(entries);
11
+ }
12
+ //# sourceMappingURL=devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/dashboard-rpc/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAcvD,SAAS,aAAa,CAAC,KAAc;IACnC,MAAM,CAAC,GAAG,KAAoC,CAAA;IAC9C,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAA;AACpG,CAAC;AAED,qGAAqG;AACrG,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAsB;IACvD,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAC3E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAU,CAAC,CAAC,CAAA;IAC1H,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;AACpC,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Tail a JSONL log: read what is already in it, then follow appends. Each complete line is
3
+ * parsed and handed to `onEvent`; malformed lines are skipped. Returns a stop function that
4
+ * removes the watcher and the poll.
5
+ *
6
+ * The reading is {@link JsonlTailer} and the following is {@link followFile}. This used to be
7
+ * its own copy of both, which is how it ended up missing the tailer's same-length-rewrite
8
+ * detection (#567).
9
+ *
10
+ * `onReplayed` is told once the first pull — the replay of everything already logged — has
11
+ * been delivered (#1383). That boundary is what lets a reconnecting client buffer the replay
12
+ * and swap its feed atomically instead of blanking while history re-streams. The follower
13
+ * only starts after it, so no appended line can slip in ahead of the marker. Best-effort on
14
+ * a failed first read: the marker still fires (the poll retries the read), because a client
15
+ * waiting on it forever would freeze its feed.
16
+ *
17
+ * Kept transport-agnostic (a plain `onEvent` callback, not a stream) so the file
18
+ * side can be driven on its own; `events.ts` wires it to the SSE endpoint.
19
+ */
20
+ export declare function tailEvents<T = unknown>(path: string, onEvent: (event: T) => void, onReplayed?: () => void): () => void;
21
+ /**
22
+ * Reads the message a run is writing, from the live file beside its diary, for
23
+ * {@link tailAgentEvents}' `afterPull`: the file changes in the diary's directory, so the diary's
24
+ * watch reads it too. `send` gets the text when it changed, and `''` once the file is gone.
25
+ */
26
+ export declare function partialReader(send: (text: string) => void): (diary: string) => Promise<void>;
27
+ /** Where a relocating tail reads now: a file it follows, a finished run's lines, whole, or nowhere yet (`pending`: ask again shortly). */
28
+ export type TailTarget<T> = {
29
+ file: string;
30
+ } | {
31
+ finished: T[];
32
+ } | {
33
+ pending: true;
34
+ };
35
+ /**
36
+ * Tail a run's diary across its relocations: the same read-then-follow as {@link tailEvents},
37
+ * but where the diary is is asked again whenever the tailed file is not there.
38
+ *
39
+ * A run's diary does not sit still. While the run works it is a file in the run's checkout; when
40
+ * the run ends its tool records it and reclaims the checkout, and from then on the diary is the
41
+ * finished run's, read whole from the project's runs provider. A fixed-path tail whose file was
42
+ * retired went silent *without the final lines* whenever the last `fs.watch` signal was lost —
43
+ * the 1s poll then found the file gone and had nothing to read, so the feed never learned the run
44
+ * ended. This tail treats a missing file as the question it is: it asks `resolve` where the diary
45
+ * is now (`resolveAgentDiary` answers the finished run once the checkout is gone, #1472). A new
46
+ * file retargets the same tailer and follows it. A finished run's lines are the same lines the
47
+ * file had, in the same order, so the ones past the count already delivered are sent and the tail
48
+ * ends: a finished diary does not grow. The same file, or no answer, means the diary has not
49
+ * moved, and the tail keeps waiting where it is. A diary that is nowhere yet (`pending`: the run
50
+ * was started a moment ago and its tool has not made the checkout, or it is being continued and
51
+ * its checkout is on its way back) is asked for again on the same cadence until it has a home,
52
+ * and only then followed; the replay boundary is reported once what that home holds has been
53
+ * delivered, not before: a feed that reconnects swaps what it shows for the replay at the
54
+ * boundary, and a boundary reported with nothing delivered emptied a chat that was full, for as
55
+ * long as the diary took to have a home. Asking even when the file was never seen matters for a
56
+ * short run (#1774): started, ended and reclaimed between two polls, its diary was only ever
57
+ * visible as a finished run.
58
+ *
59
+ * `onReplayed` keeps {@link tailEvents}' once-per-subscription contract: a relocation is not a
60
+ * new replay boundary, so it never fires twice.
61
+ *
62
+ * `afterPull` is told the diary's path after each read of it: the files beside the diary change
63
+ * with it, and a caller reads them there, on the same watch.
64
+ */
65
+ export declare function tailAgentEvents<T = unknown>(resolve: (opts?: {
66
+ cached?: boolean;
67
+ }) => Promise<TailTarget<T> | undefined>, onEvent: (event: T) => void, onReplayed?: () => void, afterPull?: (diary: string) => Promise<void>): () => void;
68
+ //# sourceMappingURL=events-tail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events-tail.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/events-tail.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CActH;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAQ5F;AAED,0IAA0I;AAC1I,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,CAAC,EAAE,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAA;AAWpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EACzC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAC5E,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,EACvB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAC3C,MAAM,IAAI,CA8JZ"}