@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,39 @@
1
+ /**
2
+ * The plan/backlog document categories the dashboard surfaces in its sidebar
3
+ * (#319, part of the MVP UI #309), so the human can read them beside the agent.
4
+ *
5
+ * These are written per session as `PLAN_<SESSION>.agent.md` (the plan for now) and
6
+ * `TODO_<SESSION>.agent.md` (the backlog), where SESSION is a git-branch slug — by
7
+ * OpenAgent's own system prompt back when it ran the agent (#323/#326), and by
8
+ * whatever a project's own skills tell an agent to write now. The flat fallback is `PLAN.md`
9
+ * at the root; the `TODO` category has no flat file: the agent queue is not a document of the
10
+ * checkout but a project package's data, and the dashboard shows it on that package's own page
11
+ * and the Overview's AI Queue card (#1774), not here. Scoped and flat-root names are matched
12
+ * against a flat readdir of the root, never taken from user input, so there is no path
13
+ * traversal to guard against.
14
+ */
15
+ export declare const DOC_CATEGORIES: readonly [{
16
+ readonly flat: 'PLAN.md';
17
+ readonly scoped: RegExp;
18
+ }, {
19
+ readonly scoped: RegExp;
20
+ }];
21
+ /** One surfaced document: its filename and current contents. */
22
+ export interface WorkspaceDoc {
23
+ name: string;
24
+ content: string;
25
+ }
26
+ /**
27
+ * The workspace-root filenames to surface, in sidebar order: per category the flat
28
+ * file (if present) then its session-scoped files (sorted). Every name is a bare
29
+ * readdir entry matched against a fixed pattern, so none can traverse. Returns
30
+ * empty when the workspace is missing or unreadable.
31
+ */
32
+ /**
33
+ * Read the surfaced plan/todo docs, in sidebar order: per category the flat file (if the
34
+ * category has one and it is present) then its session-scoped files (sorted), every one a
35
+ * workspace-root file. Missing or blank files are skipped; a file over the size cap is
36
+ * truncated. Never throws — a read error just omits that doc.
37
+ */
38
+ export declare function readDocs(cwd: string): Promise<WorkspaceDoc[]>;
39
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/dashboard/docs.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;aACvB,IAAI,EAAE,SAAS;aAAE,MAAM;;aACvB,MAAM;EACA,CAAA;AAEV,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAKD;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAoBnE"}
@@ -0,0 +1,59 @@
1
+ import { readFile, readdir } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * The plan/backlog document categories the dashboard surfaces in its sidebar
5
+ * (#319, part of the MVP UI #309), so the human can read them beside the agent.
6
+ *
7
+ * These are written per session as `PLAN_<SESSION>.agent.md` (the plan for now) and
8
+ * `TODO_<SESSION>.agent.md` (the backlog), where SESSION is a git-branch slug — by
9
+ * OpenAgent's own system prompt back when it ran the agent (#323/#326), and by
10
+ * whatever a project's own skills tell an agent to write now. The flat fallback is `PLAN.md`
11
+ * at the root; the `TODO` category has no flat file: the agent queue is not a document of the
12
+ * checkout but a project package's data, and the dashboard shows it on that package's own page
13
+ * and the Overview's AI Queue card (#1774), not here. Scoped and flat-root names are matched
14
+ * against a flat readdir of the root, never taken from user input, so there is no path
15
+ * traversal to guard against.
16
+ */
17
+ export const DOC_CATEGORIES = [
18
+ { flat: 'PLAN.md', scoped: /^PLAN_[a-z0-9-]+\.agent\.md$/ },
19
+ { scoped: /^TODO_[a-z0-9-]+\.agent\.md$/ },
20
+ ];
21
+ /** Cap a single doc so a runaway file can't bloat the docs payload. */
22
+ const MAX_DOC_BYTES = 200_000;
23
+ /**
24
+ * The workspace-root filenames to surface, in sidebar order: per category the flat
25
+ * file (if present) then its session-scoped files (sorted). Every name is a bare
26
+ * readdir entry matched against a fixed pattern, so none can traverse. Returns
27
+ * empty when the workspace is missing or unreadable.
28
+ */
29
+ /**
30
+ * Read the surfaced plan/todo docs, in sidebar order: per category the flat file (if the
31
+ * category has one and it is present) then its session-scoped files (sorted), every one a
32
+ * workspace-root file. Missing or blank files are skipped; a file over the size cap is
33
+ * truncated. Never throws — a read error just omits that doc.
34
+ */
35
+ export async function readDocs(cwd) {
36
+ let entries;
37
+ try {
38
+ entries = await readdir(cwd);
39
+ }
40
+ catch {
41
+ return [];
42
+ }
43
+ const present = new Set(entries);
44
+ const docs = [];
45
+ const push = (name, content) => {
46
+ if (!content?.trim())
47
+ return;
48
+ docs.push({ name, content: content.length > MAX_DOC_BYTES ? content.slice(0, MAX_DOC_BYTES) + '\n\n… (truncated)' : content });
49
+ };
50
+ for (const cat of DOC_CATEGORIES) {
51
+ if ('flat' in cat && present.has(cat.flat))
52
+ push(cat.flat, await readFile(join(cwd, cat.flat), 'utf8').catch(() => undefined));
53
+ for (const name of entries.filter(e => cat.scoped.test(e)).sort()) {
54
+ push(name, await readFile(join(cwd, name), 'utf8').catch(() => undefined));
55
+ }
56
+ }
57
+ return docs;
58
+ }
59
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/dashboard/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,8BAA8B,EAAE;IAC3D,EAAE,MAAM,EAAE,8BAA8B,EAAE;CAClC,CAAA;AAQV,uEAAuE;AACvE,MAAM,aAAa,GAAG,OAAO,CAAA;AAE7B;;;;;GAKG;AACH;;;;;GAKG;AACH,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CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;QAC5E,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { type GitRunner } from '@openagt/agent-data';
2
+ import { type LinkedPr, type PrLookup } from './pull-requests.js';
3
+ /** A project's git status for the panel. */
4
+ export interface GitStatus {
5
+ branch: string;
6
+ /** Uncommitted changes present. */
7
+ dirty: boolean;
8
+ pr?: LinkedPr;
9
+ /** The PR is not known yet, rather than absent (#1028): the lookup is still running. */
10
+ prPending?: boolean;
11
+ }
12
+ /** Injectable seams so {@link readGitStatus} is unit-testable off disk. */
13
+ export interface GitStatusDeps {
14
+ git?: GitRunner;
15
+ pr?: PrLookup;
16
+ /**
17
+ * The agent's start, when the status is read for an agent's checkout (#1255). The default lookup
18
+ * answers the newest PR for the branch *in any state* — so an agent on a reused pinned branch
19
+ * (`openagent/triage-quick`) wears a predecessor's merged PR as its own badge.
20
+ * With `since` set the PR is picked from the branch's whole history by {@link pickAgentPr}
21
+ * instead: an open PR, or a closed one no older than the agent itself.
22
+ */
23
+ since?: string;
24
+ /** The branch's full PR history, for the {@link GitStatusDeps.since} path (default {@link cachedPrsForBranch}). */
25
+ prs?: (cwd: string, branch: string) => Promise<LinkedPr[]>;
26
+ /**
27
+ * The project's folder, for a status read in a run's checkout: the branch's PR history is looked
28
+ * up and cached by it, as the run's handoff reads it, so the lookup the bar made while the run
29
+ * worked is warm once the run ends and its Open PR is asked about.
30
+ */
31
+ prRoot?: string;
32
+ }
33
+ /**
34
+ * The branch `cwd` has checked out, by its short name; `HEAD` when it is on no branch. Undefined
35
+ * when `cwd` is not a git repo, or git failed.
36
+ */
37
+ export declare function currentBranch(cwd: string, git?: GitRunner): Promise<string | undefined>;
38
+ /**
39
+ * Read a project's git status: the current branch and dirty flag (from git), plus the linked
40
+ * PR (best-effort). Returns undefined when the path is not a git repo. Forgiving — a failed
41
+ * `git status` reads as clean, and a failed PR lookup simply omits the PR.
42
+ */
43
+ export declare function readGitStatus(cwd: string, deps?: GitStatusDeps): Promise<GitStatus | undefined>;
44
+ //# sourceMappingURL=git-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-status.d.ts","sourceRoot":"","sources":["../../src/dashboard/git-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAiD,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAOhH,4CAA4C;AAC5C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,KAAK,EAAE,OAAO,CAAA;IACd,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mHAAmH;IACnH,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,SAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE9G;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAUzG"}
@@ -0,0 +1,37 @@
1
+ import { nodeGitRunner } from '@openagt/agent-data';
2
+ import { cachedPrView, cachedPrsForBranch, pickAgentPr } from './pull-requests.js';
3
+ /**
4
+ * The branch `cwd` has checked out, by its short name; `HEAD` when it is on no branch. Undefined
5
+ * when `cwd` is not a git repo, or git failed.
6
+ */
7
+ export async function currentBranch(cwd, git = nodeGitRunner()) {
8
+ return git(['rev-parse', '--abbrev-ref', 'HEAD'], cwd).then(out => out.trim(), () => undefined);
9
+ }
10
+ /**
11
+ * Read a project's git status: the current branch and dirty flag (from git), plus the linked
12
+ * PR (best-effort). Returns undefined when the path is not a git repo. Forgiving — a failed
13
+ * `git status` reads as clean, and a failed PR lookup simply omits the PR.
14
+ */
15
+ export async function readGitStatus(cwd, deps = {}) {
16
+ const git = deps.git ?? nodeGitRunner();
17
+ const branch = await currentBranch(cwd, git);
18
+ if (branch === undefined)
19
+ return undefined; // not a git repo (or git failed)
20
+ const dirty = (await git(['status', '--porcelain'], cwd).catch(() => '')).trim().length > 0;
21
+ // The branch and the dirty flag are what this row is for, and they are ten milliseconds of git.
22
+ // The PR is a git host read an order of magnitude slower, so it is read through the cache and is
23
+ // allowed to arrive late (#1028) rather than holding the whole row back on every poll.
24
+ const pr = await linkedPr(cwd, branch, deps);
25
+ return { branch, dirty, ...(pr.value ? { pr: pr.value } : {}), ...(pr.pending ? { prPending: true } : {}) };
26
+ }
27
+ /** The PR half of the status: the injected seam, the run-scoped history pick, or the plain view. */
28
+ async function linkedPr(cwd, branch, deps) {
29
+ if (deps.pr)
30
+ return { value: await deps.pr(cwd).catch(() => undefined), pending: false };
31
+ if (deps.since === undefined)
32
+ return cachedPrView(cwd, branch).catch(() => ({ value: undefined, pending: false }));
33
+ if (deps.prs)
34
+ return { value: pickAgentPr(await deps.prs(cwd, branch).catch(() => []), deps.since), pending: false };
35
+ return cachedPrsForBranch(deps.prRoot ?? cwd, branch).then(read => ({ value: pickAgentPr(read.value ?? [], deps.since), pending: read.pending }), () => ({ value: undefined, pending: false }));
36
+ }
37
+ //# sourceMappingURL=git-status.js.map
@@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S,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAC7C,CAAA;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ /**
3
+ * The plumbing every one of the daemon's non-RPC HTTP surfaces shares: the browser bridge
4
+ * (`/_bridge`), the web-start queue (`/_web-start`) and the device relay (`/_relay`).
5
+ *
6
+ * All three answer plain-text statuses, JSON payloads, and read capped JSON request bodies, and
7
+ * each carried its own copy — two body readers that differed only in which message they rejected
8
+ * with, and three identical status responders.
9
+ */
10
+ /** Answer with a plain-text status line. */
11
+ export declare function end(res: ServerResponse, status: number, message: string, headers?: Record<string, string>): void;
12
+ /** Answer with a JSON payload. */
13
+ export declare function sendJson(res: ServerResponse, payload: unknown, status?: number): void;
14
+ /**
15
+ * Read a JSON body, refusing anything past the cap rather than buffering it. Rejects with
16
+ * `body too large` on overflow and `body must be JSON` on anything unparseable — the messages the
17
+ * bridge and web-start routes answer 400 with, so a caller learns which of the two it hit.
18
+ */
19
+ export declare function readJsonBody(req: IncomingMessage, maxBytes: number): Promise<unknown>;
20
+ /**
21
+ * The preamble every POST route runs: refuse a non-POST, then read the body. Answers the request
22
+ * itself on either failure and resolves `undefined`, so a caller's whole check is
23
+ * `const body = await readPost(...); if (body === undefined) return`. JSON has no `undefined`, so
24
+ * the sentinel cannot collide with a body that parsed.
25
+ */
26
+ export declare function readPost(req: IncomingMessage, res: ServerResponse, maxBytes: number): Promise<unknown>;
27
+ /** Refuse anything but a GET, answering 405 itself. `false` means the request is already answered. */
28
+ export declare function requireGet(req: IncomingMessage, res: ServerResponse): boolean;
29
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/dashboard/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE;;;;;;;GAOG;AAEH,4CAA4C;AAC5C,wBAAgB,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,IAAI,CAGpH;AAED,kCAAkC;AAClC,wBAAgB,QAAQ,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAM,GAAG,IAAI,CAGlF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBrF;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW5G;AAED,sGAAsG;AACtG,wBAAgB,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAI7E"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The plumbing every one of the daemon's non-RPC HTTP surfaces shares: the browser bridge
3
+ * (`/_bridge`), the web-start queue (`/_web-start`) and the device relay (`/_relay`).
4
+ *
5
+ * All three answer plain-text statuses, JSON payloads, and read capped JSON request bodies, and
6
+ * each carried its own copy — two body readers that differed only in which message they rejected
7
+ * with, and three identical status responders.
8
+ */
9
+ /** Answer with a plain-text status line. */
10
+ export function end(res, status, message, headers = {}) {
11
+ res.writeHead(status, { 'content-type': 'text/plain', ...headers });
12
+ res.end(message);
13
+ }
14
+ /** Answer with a JSON payload. */
15
+ export function sendJson(res, payload, status = 200) {
16
+ res.writeHead(status, { 'content-type': 'application/json' });
17
+ res.end(JSON.stringify(payload));
18
+ }
19
+ /**
20
+ * Read a JSON body, refusing anything past the cap rather than buffering it. Rejects with
21
+ * `body too large` on overflow and `body must be JSON` on anything unparseable — the messages the
22
+ * bridge and web-start routes answer 400 with, so a caller learns which of the two it hit.
23
+ */
24
+ export function readJsonBody(req, maxBytes) {
25
+ return new Promise((resolve, reject) => {
26
+ let size = 0;
27
+ const chunks = [];
28
+ req.on('data', (chunk) => {
29
+ size += chunk.length;
30
+ if (size > maxBytes) {
31
+ reject(new Error('body too large'));
32
+ req.destroy();
33
+ return;
34
+ }
35
+ chunks.push(chunk);
36
+ });
37
+ req.on('end', () => {
38
+ try {
39
+ resolve(JSON.parse(Buffer.concat(chunks).toString('utf8')));
40
+ }
41
+ catch {
42
+ reject(new Error('body must be JSON'));
43
+ }
44
+ });
45
+ req.on('error', () => reject(new Error('read failed')));
46
+ });
47
+ }
48
+ /**
49
+ * The preamble every POST route runs: refuse a non-POST, then read the body. Answers the request
50
+ * itself on either failure and resolves `undefined`, so a caller's whole check is
51
+ * `const body = await readPost(...); if (body === undefined) return`. JSON has no `undefined`, so
52
+ * the sentinel cannot collide with a body that parsed.
53
+ */
54
+ export async function readPost(req, res, maxBytes) {
55
+ if (req.method !== 'POST') {
56
+ end(res, 405, 'method not allowed', { allow: 'POST' });
57
+ return undefined;
58
+ }
59
+ try {
60
+ return await readJsonBody(req, maxBytes);
61
+ }
62
+ catch (err) {
63
+ end(res, 400, err.message);
64
+ return undefined;
65
+ }
66
+ }
67
+ /** Refuse anything but a GET, answering 405 itself. `false` means the request is already answered. */
68
+ export function requireGet(req, res) {
69
+ if (req.method === 'GET')
70
+ return true;
71
+ end(res, 405, 'method not allowed', { allow: 'GET' });
72
+ return false;
73
+ }
74
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/dashboard/http.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,4CAA4C;AAC5C,MAAM,UAAU,GAAG,CAAC,GAAmB,EAAE,MAAc,EAAE,OAAe,EAAE,OAAO,GAA2B,EAAE;IAC5G,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAA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,CAAC,CAAC,CAAA;QACF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,GAAoB,EAAE,GAAmB,EAAE,QAAgB;IACxF,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QACtD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC1C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,GAAG,EAAE,GAAG,EAAG,GAAa,CAAC,OAAO,CAAC,CAAA;QACrC,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,GAAoB,EAAE,GAAmB;IAClE,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,IAAI,CAAA;IACrC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACrD,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,24 @@
1
+ export { startDashboard, type Dashboard, type DashboardOptions } from './server.js';
2
+ export type { StartAgentOptions, StartAgentResult, AddProjectResult, RemoveProjectResult, CleanupReport, OnboardingSuggestion, AgentWorktree } from './types.js';
3
+ export { summarizeProject, defaultProjectsProvider, type ProjectSummary, type ProjectionRead, type ProjectsProvider, type SummarizeDeps, } from './projects.js';
4
+ export { resolveDashboardBundle } from './bundle.js';
5
+ export { makeRpcMount, RPC_PREFIX, isSameOriginRequest, isExpectedHost, type EventsSource } from './rpc-serve.js';
6
+ export { serveClientBundle } from './static.js';
7
+ export { readDocs, DOC_CATEGORIES, type WorkspaceDoc } from './docs.js';
8
+ export { collectQueue, type ProjectQueue } from './queue.js';
9
+ export { buildOverview, buildRecentAgents, type Overview, type ActiveAgent as ActiveAgent, type RecentProject, type RecentAgent as RecentAgent, type OverviewDeps } from './overview.js';
10
+ export { buildDashboard, type DashboardData, type ProjectStat, type DashboardDeps } from './dashboard.js';
11
+ export { readGitStatus, type GitStatus } from './git-status.js';
12
+ export { prView, prsForBranch, openPrs, pickAgentPr, type LinkedPr, type OpenPr, type PrLookup, type BranchPrLookup, type PrLister } from './pull-requests.js';
13
+ export { readAgentHandoff, agentBranchFor, openAgentPullRequest, type AgentHandoff, type HandoffCommit, type HandoffFile, type HandoffResult, type AgentHandoffDeps, } from './agent-handoff.js';
14
+ export { buildInterventions, interventionKey, type Intervention, type InterventionsDeps, } from './interventions.js';
15
+ export { buildOpenQuestions, type OpenQuestion, type OpenQuestionsDeps } from './open-questions.js';
16
+ export { bridgeChoiceRequest, type BridgeOption, type BridgeQuestion } from './bridge-question.js';
17
+ export { buildActivity, activityKey, type Activity, type ActivityDeps } from './activity.js';
18
+ export { SeenTracker } from './keyed-watcher.js';
19
+ export { BRIDGE_PREFIX, handleBridgeRequest, type BridgeHandlers, type BridgeSession, type BridgeEvent, type BridgeHello, type BridgeStart } from './bridge-endpoints.js';
20
+ export { bridgeStarts, resetBridgeStarts, BridgeStarts, START_CLAIM_TTL_MS, MAX_START_PROMPT, type BridgeStartRequest, type BridgeStartState, type BridgeStartInput } from './bridge-starts.js';
21
+ export { WEB_START_PREFIX, DAEMON_URL_ENV, handleWebStartRequest, type WebStartHandlers } from './web-start-endpoints.js';
22
+ export { bridgeSessionsFrom, BRIDGE_SESSION_WINDOW_MS } from './bridge-sessions.js';
23
+ export { bridgeQuestions, resetBridgeQuestions, BridgeQuestions, type BridgeContact, type BridgeAnswer } from './bridge-store.js';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnF,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAChK,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,IAAI,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,IAAI,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACxL,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzG,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAA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,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,23 @@
1
+ export { startDashboard } from './server.js';
2
+ export { summarizeProject, defaultProjectsProvider, } from './projects.js';
3
+ export { resolveDashboardBundle } from './bundle.js';
4
+ export { makeRpcMount, RPC_PREFIX, isSameOriginRequest, isExpectedHost } from './rpc-serve.js';
5
+ export { serveClientBundle } from './static.js';
6
+ export { readDocs, DOC_CATEGORIES } from './docs.js';
7
+ export { collectQueue } from './queue.js';
8
+ export { buildOverview, buildRecentAgents } from './overview.js';
9
+ export { buildDashboard } from './dashboard.js';
10
+ export { readGitStatus } from './git-status.js';
11
+ export { prView, prsForBranch, openPrs, pickAgentPr } from './pull-requests.js';
12
+ export { readAgentHandoff, agentBranchFor, openAgentPullRequest, } from './agent-handoff.js';
13
+ export { buildInterventions, interventionKey, } from './interventions.js';
14
+ export { buildOpenQuestions } from './open-questions.js';
15
+ export { bridgeChoiceRequest } from './bridge-question.js';
16
+ export { buildActivity, activityKey } from './activity.js';
17
+ export { SeenTracker } from './keyed-watcher.js';
18
+ export { BRIDGE_PREFIX, handleBridgeRequest } from './bridge-endpoints.js';
19
+ export { bridgeStarts, resetBridgeStarts, BridgeStarts, START_CLAIM_TTL_MS, MAX_START_PROMPT } from './bridge-starts.js';
20
+ export { WEB_START_PREFIX, DAEMON_URL_ENV, handleWebStartRequest } from './web-start-endpoints.js';
21
+ export { bridgeSessionsFrom, BRIDGE_SESSION_WINDOW_MS } from './bridge-sessions.js';
22
+ export { bridgeQuestions, resetBridgeQuestions, BridgeQuestions } from './bridge-store.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAyC,MAAM,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qB,EAAyB,MAAM,0BAA0B,CAAA;AACzH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAyC,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { type LiveAgent, type AgentMeta } from '../store/index.js';
2
+ import type { OpenAgentEvent } from '../events.js';
3
+ import type { ProjectSummary, ProjectionRead } from './projects.js';
4
+ import { type BranchesFor } from '../store/branches.js';
5
+ import { type PrLister } from './pull-requests.js';
6
+ export { interventionKey } from './keys.js';
7
+ /**
8
+ * One item awaiting the human. Two kinds: an open `pr` to review/merge or close, and an
9
+ * `awaiting` run paused on a choice gate. The card and the browser hook both iterate the flat
10
+ * list, branching on `kind` for the fields that differ.
11
+ */
12
+ export interface Intervention {
13
+ projectId: string;
14
+ projectName: string;
15
+ /**
16
+ * `pr` = an open PR to review/merge or close; `awaiting` = a run waiting on the question it ended on (#636/#1774);
17
+ * `unpushed` = a finished agent whose branch has commits that were never pushed (#860).
18
+ */
19
+ kind: 'pr' | 'awaiting' | 'unpushed';
20
+ title: string;
21
+ /** The PR on the git host (`pr` only): where a click takes the user. */
22
+ url?: string;
23
+ /** The PR number (`pr` only). */
24
+ number?: number;
25
+ /** The question's id (`awaiting` only) — its stable identity, so it notifies exactly once. */
26
+ awaitId?: string;
27
+ /** Which run this is about (`awaiting` #738 / `unpushed`): a project has several agents. */
28
+ agentId?: string;
29
+ /** The branch the work is sitting on (`unpushed` only). */
30
+ branch?: string;
31
+ /** How many commits are waiting (`unpushed` only). */
32
+ commits?: number;
33
+ /** When the PR was opened (`pr`) or the agent last updated (the other two), ISO, for ordering. */
34
+ createdAt?: string;
35
+ }
36
+ /** Injectable seam so {@link buildInterventions} is unit-testable off disk. */
37
+ export interface InterventionsDeps {
38
+ prs?: PrLister;
39
+ /** The reader of the runs that have a checkout (default {@link readLiveMetas}): a waiting run keeps its own; drives the `awaiting` source (#636). */
40
+ liveAgents?: (cwd: string) => Promise<LiveAgent[]>;
41
+ /** One run's events, by the project's path and the run's id (default {@link loadAgentEvents}): where a waiting run's question is read. */
42
+ events?: (cwd: string, agentId: string) => Promise<OpenAgentEvent[] | undefined>;
43
+ /** The finished-agent reader (default {@link listAgents}); drives the `unpushed` source (#860). */
44
+ agents?: (cwd: string) => Promise<AgentMeta[]>;
45
+ /** The project's checkouts and branches (default the project's provider, {@link projectBranches}): where a branch's state is read; drives the `unpushed` source (#860). */
46
+ branches?: BranchesFor;
47
+ /**
48
+ * How many of a project's most recent finished agents to inspect for unpushed work. Each one costs
49
+ * a handful of git reads, and this runs on a poll, so old history is not re-walked every minute:
50
+ * work that has sat unpushed for dozens of agents is not news, and the agent list stays the record.
51
+ */
52
+ handoffLimit?: number;
53
+ }
54
+ /**
55
+ * Build the cross-project interventions queue: every registered project's open PRs, plus any run
56
+ * currently paused on a choice gate (#636), newest first. Forgiving — a project with no remote
57
+ * (or an unreadable one) simply contributes nothing. Hand-opened draft PRs are excluded: they are
58
+ * not yet asking for review. A draft on an agent's branch is not (#1102): an agent publishes a
59
+ * draft when a person should look first, and cloud work adoption opens its PRs as drafts.
60
+ *
61
+ * Which projects were read whole comes back alongside the items (#1623): forgiveness here is what
62
+ * lets one unreachable project keep the queue useful, and it is also what would let that project's
63
+ * whole backlog announce itself as new the moment it came back. The queue's panels ignore this;
64
+ * the notification watcher is the caller that cannot.
65
+ */
66
+ export declare function buildInterventions(projects: ProjectSummary[], deps?: InterventionsDeps): Promise<ProjectionRead<Intervention>>;
67
+ //# sourceMappingURL=interventions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interventions.d.ts","sourceRoot":"","sources":["../../src/dashboard/interventions.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AA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A2K;IAC3K,QAAQ,CAAC,EAAE,WAAW,CAAA;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAKD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EAAE,EAC1B,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CA6EvC"}
@@ -0,0 +1,169 @@
1
+ import { listAgents, loadAgentEvents, readLiveMetas } from '../store/index.js';
2
+ import { pendingChoices } from '../open-choices.js';
3
+ import { agentBranchFor } from './agent-handoff.js';
4
+ import { projectBranches } from '../store/branches.js';
5
+ import { openPrs } from './pull-requests.js';
6
+ import { interventionKey } from './keys.js';
7
+ // Pure identity + diff, in the leaf `keys.ts` so the dashboard shares them rather than copying.
8
+ export { interventionKey } from './keys.js';
9
+ /** How many recent finished agents are inspected per project by default. */
10
+ const HANDOFF_LIMIT = 5;
11
+ /**
12
+ * Build the cross-project interventions queue: every registered project's open PRs, plus any run
13
+ * currently paused on a choice gate (#636), newest first. Forgiving — a project with no remote
14
+ * (or an unreadable one) simply contributes nothing. Hand-opened draft PRs are excluded: they are
15
+ * not yet asking for review. A draft on an agent's branch is not (#1102): an agent publishes a
16
+ * draft when a person should look first, and cloud work adoption opens its PRs as drafts.
17
+ *
18
+ * Which projects were read whole comes back alongside the items (#1623): forgiveness here is what
19
+ * lets one unreachable project keep the queue useful, and it is also what would let that project's
20
+ * whole backlog announce itself as new the moment it came back. The queue's panels ignore this;
21
+ * the notification watcher is the caller that cannot.
22
+ */
23
+ export async function buildInterventions(projects, deps = {}) {
24
+ const prs = deps.prs ?? openPrs;
25
+ const liveAgents = deps.liveAgents ?? readLiveMetas;
26
+ const events = deps.events ?? loadAgentEvents;
27
+ const items = [];
28
+ const whole = [];
29
+ for (const project of projects) {
30
+ // A project is read whole only when every one of its sources answered. Each `unread()` below is
31
+ // a source that did not, and contributed nothing for a reason other than nothing being there.
32
+ let sawEverything = true;
33
+ const unread = () => {
34
+ sawEverything = false;
35
+ return [];
36
+ };
37
+ const open = await prs(project.path).catch(unread);
38
+ // The branches the project's runs are on, recorded or in a checkout (#1774): what tells a
39
+ // run's draft from one opened by hand. Read only when a draft asks.
40
+ let runBranches;
41
+ const isRunBranch = async (branch) => {
42
+ runBranches ??= new Set([...(await (deps.agents ?? listAgents)(project.path).catch(() => [])), ...(await liveAgents(project.path).catch(() => []))].flatMap(agent => (agent.branch ? [agent.branch] : [])));
43
+ return runBranches.has(branch);
44
+ };
45
+ for (const pr of open) {
46
+ // A draft opened by hand is not asking for review, so it stays off the queue. A draft on a
47
+ // run's branch is the opposite (#1102): the agent, or cloud work adoption, opened it as a
48
+ // draft so it does not ping reviewers, and if the queue then dropped it too, nothing
49
+ // would tell anyone the work exists — which is the whole of #860 again.
50
+ if (pr.isDraft && !(pr.headRefName !== undefined && (await isRunBranch(pr.headRefName))))
51
+ continue;
52
+ items.push({
53
+ projectId: project.id,
54
+ projectName: project.name,
55
+ kind: 'pr',
56
+ number: pr.number,
57
+ title: pr.title,
58
+ url: pr.url,
59
+ ...(pr.createdAt ? { createdAt: pr.createdAt } : {}),
60
+ });
61
+ }
62
+ // A run that ended on a question waits for the user, a "needs you" too (#636): it ended
63
+ // `waiting`, its checkout kept for the answer (#1774). The question is read off the run's own
64
+ // diary by the rule the run page and the open-questions list use, so the ping names the question
65
+ // they offer; a waiting run whose diary shows none is skipped. A project has several runs
66
+ // (#736), so each waiting run contributes its own item — keyed on the question's id, plus the
67
+ // agent id so two runs are told apart.
68
+ for (const meta of await liveAgents(project.path).catch(unread)) {
69
+ if (meta.status !== 'waiting')
70
+ continue;
71
+ const choice = pendingChoices((await events(project.path, meta.id).catch(() => undefined)) ?? []).at(-1);
72
+ if (!choice)
73
+ continue;
74
+ items.push({
75
+ projectId: project.id,
76
+ projectName: project.name,
77
+ kind: 'awaiting',
78
+ title: choice.title,
79
+ awaitId: choice.id,
80
+ agentId: meta.id,
81
+ ...(meta.updatedAt ? { createdAt: meta.updatedAt } : {}),
82
+ });
83
+ }
84
+ // A finished agent whose work never left the machine is a "needs you" too (#860). Until now the
85
+ // queue only knew about a PR that is *already on the git host* and an agent parked on a gate, so an agent
86
+ // that committed real code and stopped produced neither, and nothing told anyone: the overview
87
+ // drops it (it filters on `running`) and the handoff panel is behind clicking into that agent.
88
+ //
89
+ // Surfacing only: this says there is a decision waiting, it does not take it. A run publishes
90
+ // nothing by itself, so every finished run with work of its own reaches here until a person
91
+ // publishes it, or the agent does on their ask.
92
+ for (const item of await unpushedFor(project, deps, unread).catch(unread))
93
+ items.push(item);
94
+ if (sawEverything)
95
+ whole.push(project.id);
96
+ }
97
+ items.sort((a, b) => (b.createdAt ?? '').localeCompare(a.createdAt ?? ''));
98
+ // The same repo can be registered under two projects (e.g. a monorepo root + a subdir), so a
99
+ // PR would otherwise appear once per entry. Collapse by identity, keeping the first (newest-sorted).
100
+ const seen = new Set();
101
+ const unique = items.filter(item => (seen.has(interventionKey(item)) ? false : (seen.add(interventionKey(item)), true)));
102
+ return { items: unique, whole };
103
+ }
104
+ /**
105
+ * The finished agents of a project whose branch still holds unpushed, unmerged commits (#860).
106
+ *
107
+ * Only the most recent {@link InterventionsDeps.handoffLimit} finished agents are inspected, and
108
+ * their branches in one read of the project's branches provider: each read is a process, and
109
+ * this runs on a poll. A run started from another branch is the exception: its branch is read on
110
+ * its own, measured from the commit its own work begins at, as its page measures it; counted from
111
+ * the default branch it would be credited that other branch's commits too. The provider answers git facts only, so the git host PR lookup the handoff
112
+ * summary makes per branch is never paid here: an open PR means the branch was pushed, so
113
+ * `pushed` already excludes it, and the `pr` kind above is what surfaces it.
114
+ */
115
+ async function unpushedFor(project, deps, unread) {
116
+ const agents = deps.agents ?? listAgents;
117
+ const branches = deps.branches ?? projectBranches;
118
+ const finished = (await agents(project.path))
119
+ // A subagent's branch is its main agent's to land, never a person's to push.
120
+ .filter(agent => agent.status !== 'running' && agent.parent === undefined)
121
+ .sort((a, b) => (b.startedAt ?? '').localeCompare(a.startedAt ?? ''))
122
+ .slice(0, deps.handoffLimit ?? HANDOFF_LIMIT)
123
+ .flatMap(agent => {
124
+ const branch = agentBranchFor(agent);
125
+ return branch === undefined ? [] : [{ agent, branch }];
126
+ });
127
+ if (finished.length === 0)
128
+ return [];
129
+ // No provider: the project has no checkouts and no branch state to read; nothing is waiting.
130
+ const source = await branches(project.path).catch(() => undefined);
131
+ if (!source)
132
+ return [];
133
+ // One read per commit the branches are measured from; the runs that name none share one.
134
+ const asks = new Map();
135
+ for (const { agent, branch } of finished)
136
+ asks.set(agent.baseCommit, [...(asks.get(agent.baseCommit) ?? []), branch]);
137
+ const states = new Map();
138
+ try {
139
+ for (const shown of await Promise.all([...asks].map(([from, asked]) => source.show(asked, from)))) {
140
+ for (const state of shown)
141
+ states.set(state.branch, state);
142
+ }
143
+ }
144
+ catch {
145
+ unread();
146
+ return [];
147
+ }
148
+ const items = [];
149
+ for (const { agent, branch } of finished) {
150
+ const state = states.get(branch);
151
+ // Every condition is a reason this is *not* waiting on anyone: the branch is gone, the session
152
+ // wrote nothing, it already landed, it is already on the remote, or there is nowhere to push.
153
+ if (!state || !state.exists || state.commits.length === 0 || state.files.length === 0 || state.merged || state.pushed || !state.hasRemote)
154
+ continue;
155
+ items.push({
156
+ projectId: project.id,
157
+ projectName: project.name,
158
+ kind: 'unpushed',
159
+ // What was asked, else the name the provider gave the branch, else the branch: never a prefix cut off here.
160
+ title: agent.intent?.trim() || state.name || branch,
161
+ agentId: agent.id,
162
+ branch,
163
+ commits: state.commits.length,
164
+ ...(agent.updatedAt ? { createdAt: agent.updatedAt } : {}),
165
+ });
166
+ }
167
+ return items;
168
+ }
169
+ //# sourceMappingURL=interventions.js.map