@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,10 @@
1
+ export { nodeStoreFs, listAgents, readAllAgents, findAgent, isPidAlive, readLiveMeta, loadAgentEvents, readLiveMetas, readDoing, readFinishedDiary, } from './agent-store.js';
2
+ export { findCheckout, resolveAgentCheckout, resolveAgentDiary } from './agent-checkout.js';
3
+ export { projectRuns, providedRuns, noRuns, parseRunCard, isRunId } from './runs.js';
4
+ export { projectBranches, providedBranches, noBranches, parseCheckouts, parseBranchStates } from './branches.js';
5
+ export { projectGitHost, providedGitHost, noGitHost, parseRequests } from './git-host.js';
6
+ export { projectQueue, providedQueue, noQueue, parseQueueEntries } from './queue.js';
7
+ export { providedDataChanged } from './provided.js';
8
+ export { fromRunCard, fromDiaryLine, eventsOf } from './run-record.js';
9
+ export { agentIdFromStartedAt, startedAtFromAgentId } from '../agent-id.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,iBAAiB,GAKlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAyB,MAAM,qBAAqB,CAAA;AAClH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAoJ,MAAM,WAAW,CAAA;AACtO,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAqN,MAAM,eAAe,CAAA;AACnU,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAoO,MAAM,eAAe,CAAA;AAC3T,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAqD,MAAM,YAAY,CAAA;AACvI,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A package's command just ran in the project at `root` (a module's, through the dashboard), and
3
+ * may have written what one of OpenAgent's provided readers caches: every provided reader
4
+ * forgets that project, so its next read runs the provider again. OpenAgent never knows which
5
+ * command writes what; forgetting is cheap and re-reading is what it does anyway.
6
+ */
7
+ export declare function providedDataChanged(root: string): void;
8
+ /** The kinds of OpenAgent's data a project's package may provide, one reader each (`git-host` is `git-host.ts`). */
9
+ export declare const PROVIDED_KINDS: readonly ['tickets', 'queue', 'runs', 'branches', 'git-host', 'repository'];
10
+ /**
11
+ * Why a kind of the project's data has no provider although packages declare it (#1820): two or
12
+ * more declare the kind and the project's package.json names none, or names one that does not
13
+ * declare it. One sentence per such kind, for the project's error banner; none when every kind is
14
+ * settled. Nobody declaring a kind is not a problem: the project has none of that data.
15
+ */
16
+ export declare function providerProblems(root: string): Promise<string[]>;
17
+ //# sourceMappingURL=provided.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided.d.ts","sourceRoot":"","sources":["../../src/store/provided.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMtD;AAED,oHAAoH;AACpH,eAAO,MAAM,cAAc,YAAI,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,CAAU,CAAA;AAEzG;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOtE"}
@@ -0,0 +1,37 @@
1
+ import { lookupProvided } from '../built-in.js';
2
+ import { projectBranches } from './branches.js';
3
+ import { projectGitHost } from './git-host.js';
4
+ import { projectQueue } from './queue.js';
5
+ import { projectRuns } from './runs.js';
6
+ import { projectTickets } from './tickets.js';
7
+ /**
8
+ * A package's command just ran in the project at `root` (a module's, through the dashboard), and
9
+ * may have written what one of OpenAgent's provided readers caches: every provided reader
10
+ * forgets that project, so its next read runs the provider again. OpenAgent never knows which
11
+ * command writes what; forgetting is cheap and re-reading is what it does anyway.
12
+ */
13
+ export function providedDataChanged(root) {
14
+ projectBranches.changed(root);
15
+ projectGitHost.changed(root);
16
+ projectQueue.changed(root);
17
+ projectRuns.changed(root);
18
+ projectTickets.changed(root);
19
+ }
20
+ /** The kinds of OpenAgent's data a project's package may provide, one reader each (`git-host` is `git-host.ts`). */
21
+ export const PROVIDED_KINDS = ['tickets', 'queue', 'runs', 'branches', 'git-host', 'repository'];
22
+ /**
23
+ * Why a kind of the project's data has no provider although packages declare it (#1820): two or
24
+ * more declare the kind and the project's package.json names none, or names one that does not
25
+ * declare it. One sentence per such kind, for the project's error banner; none when every kind is
26
+ * settled. Nobody declaring a kind is not a problem: the project has none of that data.
27
+ */
28
+ export async function providerProblems(root) {
29
+ const problems = [];
30
+ for (const kind of PROVIDED_KINDS) {
31
+ const { problem } = await lookupProvided(root, kind).catch(() => ({}));
32
+ if (problem)
33
+ problems.push(problem);
34
+ }
35
+ return problems;
36
+ }
37
+ //# sourceMappingURL=provided.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided.js","sourceRoot":"","sources":["../../src/store/provided.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC;AAED,oHAAoH;AACpH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,CAAU,CAAA;AAEzG;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAY;IACjD,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;QAClC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAyB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAC5F,IAAI,OAAO;YAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The agent queue, as OpenAgent reads it (#1774). OpenAgent keeps no queue and imports no
3
+ * queue package: a project's queue comes from whichever of its packages declares that it provides
4
+ * it — `"openagent": { "queue": "<command>" }` in the package's own package.json — and
5
+ * OpenAgent reads it by running that command. Swap the package for another that answers the same
6
+ * command line and prints the same shape, and nothing here changes. No package declares it: the
7
+ * project has no queue, and the dashboard shows it none.
8
+ *
9
+ * The command line a provider answers, printing one JSON document and exiting 0:
10
+ * `<command> --local` the open entries, in order of work, as an array of strings
11
+ * `--local` reads the copy on this machine, no network: OpenAgent polls.
12
+ *
13
+ * That is the whole contract. Writing the queue is not OpenAgent's: a module the queue package
14
+ * brings acts on it through its own command (`@openagt/dashboard/module`'s link actions), and OpenAgent
15
+ * only re-reads.
16
+ *
17
+ * The shape, owned here: an entry is one string, the task a future agent is started with, as the
18
+ * queue's own command prints it. A markdown link at its start names the work and where it points;
19
+ * how a dashboard reads that is the queue package's module's.
20
+ */
21
+ /** A project's queue: what a provider answers, read by OpenAgent. */
22
+ export interface QueueSource {
23
+ /** The open entries, in order of work; `[]` when none can be read. */
24
+ list(): Promise<string[]>;
25
+ }
26
+ /** The queue of the project at `root`, or `undefined` when none of its packages provides one. */
27
+ export type QueueFor = (root: string) => Promise<QueueSource | undefined>;
28
+ /** A {@link QueueFor} that also forgets what it read of one project, for when a module just wrote there. */
29
+ export type QueueReader = QueueFor & {
30
+ changed(root: string): void;
31
+ };
32
+ /** Entries read back from a provider's output: the non-empty strings of an array, trimmed; anything else is no entries. */
33
+ export declare function parseQueueEntries(output: unknown): string[];
34
+ /**
35
+ * The production {@link QueueReader}: the project's provider, looked up by its package.json, one
36
+ * source per project kept while the same command provides — so the cache holds across the many
37
+ * reads of one poll, and a project that installs, swaps or drops its provider is read the new way
38
+ * within {@link CACHE_MS}. `changed(root)` forgets that project's read, so the next read runs the
39
+ * command again: a module's command just ran there, and may have written.
40
+ */
41
+ export declare function providedQueue(now?: () => number): QueueReader;
42
+ /** OpenAgent's one reader of the queue, shared by every caller so they share its cache. */
43
+ export declare const projectQueue: QueueReader;
44
+ /** A {@link QueueFor} for a project with no provider: no queue. */
45
+ export declare const noQueue: QueueFor;
46
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/store/queue.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,sEAAsE;IACtE,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CAC1B;AAED,iGAAiG;AACjG,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;AAEzE,4GAA4G;AAC5G,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG;IAAE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAKpE,2HAA2H;AAC3H,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,CAG3D;AA0BD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAM,MAAiB,GAAG,WAAW,CAavE;AAED,2FAA2F;AAC3F,eAAO,MAAM,YAAY,EAAE,WAA6B,CAAA;AAExD,mEAAmE;AACnE,eAAO,MAAM,OAAO,EAAE,QAAgC,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { runPackageCommand } from '@openagt/agent-data';
2
+ import { providedCommand } from '../built-in.js';
3
+ /** How long a read is reused: the dashboard polls several reads of every project's queue every few seconds, and each is a process. */
4
+ const CACHE_MS = 5_000;
5
+ /** Entries read back from a provider's output: the non-empty strings of an array, trimmed; anything else is no entries. */
6
+ export function parseQueueEntries(output) {
7
+ if (!Array.isArray(output))
8
+ return [];
9
+ return output.filter((entry) => typeof entry === 'string').map(entry => entry.trim()).filter(Boolean);
10
+ }
11
+ /** The queue source over one provider command: each list one run of the command, reads cached per {@link CACHE_MS}. */
12
+ function commandQueue(root, command, now) {
13
+ let listed;
14
+ return {
15
+ drop() {
16
+ listed = undefined;
17
+ },
18
+ list() {
19
+ // Concurrent reads share one process; a read that failed is not kept.
20
+ if (listed && now() - listed.at < CACHE_MS)
21
+ return listed.entries;
22
+ const read = { at: now(), entries: Promise.resolve([]) };
23
+ read.entries = runPackageCommand(root, command, ['--local']).then(result => {
24
+ if (!result.ok || !Array.isArray(result.output)) {
25
+ if (listed === read)
26
+ listed = undefined;
27
+ return [];
28
+ }
29
+ return parseQueueEntries(result.output);
30
+ });
31
+ listed = read;
32
+ return read.entries;
33
+ },
34
+ };
35
+ }
36
+ /**
37
+ * The production {@link QueueReader}: the project's provider, looked up by its package.json, one
38
+ * source per project kept while the same command provides — so the cache holds across the many
39
+ * reads of one poll, and a project that installs, swaps or drops its provider is read the new way
40
+ * within {@link CACHE_MS}. `changed(root)` forgets that project's read, so the next read runs the
41
+ * command again: a module's command just ran there, and may have written.
42
+ */
43
+ export function providedQueue(now = Date.now) {
44
+ const sources = new Map();
45
+ const reader = async (root) => {
46
+ let known = sources.get(root);
47
+ if (!known || now() - known.at >= CACHE_MS) {
48
+ const command = await providedCommand(root, 'queue').catch(() => undefined);
49
+ const same = known?.command && command && known.command.bin === command.bin;
50
+ known = { at: now(), ...(command ? { command, source: same ? known.source : commandQueue(root, command, now) } : {}) };
51
+ sources.set(root, known);
52
+ }
53
+ return known.source;
54
+ };
55
+ return Object.assign(reader, { changed: (root) => sources.get(root)?.source?.drop() });
56
+ }
57
+ /** OpenAgent's one reader of the queue, shared by every caller so they share its cache. */
58
+ export const projectQueue = providedQueue();
59
+ /** A {@link QueueFor} for a project with no provider: no queue. */
60
+ export const noQueue = async () => undefined;
61
+ //# sourceMappingURL=queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/store/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmChD,sIAAsI;AACtI,MAAM,QAAQ,GAAG,KAAK,CAAA;AAEtB,2HAA2H;AAC3H,MA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,CAAC,MAAM,YAAY,GAAgB,aAAa,EAAE,CAAA;AAExD,mEAAmE;AACnE,MAAM,CAAC,MAAM,OAAO,GAAa,KAAK,IAAI,EAAE,CAAC,SAAS,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Creating a project's repository on a host, for a project that lives on this machine only. Like
3
+ * every provided kind, OpenAgent names no host: the package that declares
4
+ * `"openagent": { "repository": "<command>" }` creates it, and OpenAgent asks by running that
5
+ * command.
6
+ *
7
+ * The command line a provider answers, each printing one JSON document and exiting 0 (a refusal
8
+ * exits 1 with its reason on stderr):
9
+ * `<command> create --check` the repository the project would become, `{ repository, name }`
10
+ * (`name` is the host's), creating nothing; refused when the
11
+ * project has a remote already or the host cannot be reached
12
+ * `<command> create` create it private, set it as the project's origin and push;
13
+ * `{ repository, url, name }`
14
+ */
15
+ /** The repository a project would become, and the host it would be on. */
16
+ export interface RepositoryOffer {
17
+ /** `<account>/<name>`, as the host names it. */
18
+ repository: string;
19
+ /** The host's name, for a button: `GitHub`. */
20
+ name: string;
21
+ }
22
+ export type CreateRepositoryResult = {
23
+ ok: true;
24
+ url: string;
25
+ } | {
26
+ ok: false;
27
+ error: string;
28
+ };
29
+ /** What the project's repository provider offers to create, or undefined: no provider, a remote already there, or a host that cannot be reached. */
30
+ export declare function repositoryOffer(root: string): Promise<RepositoryOffer | undefined>;
31
+ /** Create the project's repository through its provider; a refusal is the provider's own line. */
32
+ export declare function createRepository(root: string): Promise<CreateRepositoryResult>;
33
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/store/repository.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7F,oJAAoJ;AACpJ,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAOxF;AAED,kGAAkG;AAClG,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAOpF"}
@@ -0,0 +1,25 @@
1
+ import { runPackageCommand } from '@openagt/agent-data';
2
+ import { providedCommand } from '../built-in.js';
3
+ /** What the project's repository provider offers to create, or undefined: no provider, a remote already there, or a host that cannot be reached. */
4
+ export async function repositoryOffer(root) {
5
+ const command = await providedCommand(root, 'repository').catch(() => undefined);
6
+ if (!command)
7
+ return undefined;
8
+ const result = await runPackageCommand(root, command, ['create', '--check']);
9
+ if (!result.ok || !result.output || typeof result.output !== 'object')
10
+ return undefined;
11
+ const { repository, name } = result.output;
12
+ return typeof repository === 'string' && typeof name === 'string' ? { repository, name } : undefined;
13
+ }
14
+ /** Create the project's repository through its provider; a refusal is the provider's own line. */
15
+ export async function createRepository(root) {
16
+ const command = await providedCommand(root, 'repository').catch(() => undefined);
17
+ if (!command)
18
+ return { ok: false, error: 'no package of this project creates a repository' };
19
+ const result = await runPackageCommand(root, command, ['create']);
20
+ if (!result.ok)
21
+ return { ok: false, error: result.error };
22
+ const url = result.output && typeof result.output === 'object' ? result.output['url'] : undefined;
23
+ return typeof url === 'string' ? { ok: true, url } : { ok: false, error: `${command.name} created no repository` };
24
+ }
25
+ //# sourceMappingURL=repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/store/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EA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CAAC,KAAK,EAAE,CAAA;IACzD,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAM,CAAC,MAAkC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9H,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,wBAAwB,EAAE,CAAA;AACpH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { AnyDiaryLine, RunCard } from './runs.js';
2
+ import type { OpenAgentEvent } from '../events.js';
3
+ import type { AgentMeta } from './agent-store.js';
4
+ /**
5
+ * A run's card and diary (`runs.ts`), read as OpenAgent's own shapes (#1769): the card as the
6
+ * meta every list shows, the diary as the events the run page replays and tails. The card's
7
+ * eleven plain fields and four kinds of diary line are the shape; whoever ran the agent keeps the
8
+ * rest of what it knows under one key, `caller`, and writes its other lines as they are.
9
+ * OpenAgent records no run of its own (#1774), so there is no writing half.
10
+ */
11
+ /** A card as OpenAgent's meta: `caller` unfolded, the card's own fields winning. */
12
+ export declare function fromRunCard(card: RunCard): AgentMeta;
13
+ /**
14
+ * One diary line as one OpenAgent event: what the agent said, its result, the run's end and its
15
+ * cost are the shape's four kinds; a line of any other kind is an OpenAgent event as written, and
16
+ * one whose kind is no longer an event (the kinds of runs recorded before OpenAgent stopped
17
+ * running agents) reads as nothing. The line's time, `at`, is the event's, whatever the kind.
18
+ */
19
+ export declare function fromDiaryLine(line: AnyDiaryLine): OpenAgentEvent | undefined;
20
+ /** A diary as the run's events, for a reader that replays them. */
21
+ export declare function eventsOf(lines: readonly AnyDiaryLine[]): OpenAgentEvent[];
22
+ //# sourceMappingURL=run-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-record.d.ts","sourceRoot":"","sources":["../../src/store/run-record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;;;GAMG;AAEH,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAGpD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,GAAG,SAAS,CAK5E;AAiFD,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,cAAc,EAAE,CAEzE"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * A run's card and diary (`runs.ts`), read as OpenAgent's own shapes (#1769): the card as the
3
+ * meta every list shows, the diary as the events the run page replays and tails. The card's
4
+ * eleven plain fields and four kinds of diary line are the shape; whoever ran the agent keeps the
5
+ * rest of what it knows under one key, `caller`, and writes its other lines as they are.
6
+ * OpenAgent records no run of its own (#1774), so there is no writing half.
7
+ */
8
+ /** A card as OpenAgent's meta: `caller` unfolded, the card's own fields winning. */
9
+ export function fromRunCard(card) {
10
+ const { caller, ...own } = card;
11
+ return { updatedAt: card.endedAt ?? card.startedAt, ...caller, ...own };
12
+ }
13
+ /**
14
+ * One diary line as one OpenAgent event: what the agent said, its result, the run's end and its
15
+ * cost are the shape's four kinds; a line of any other kind is an OpenAgent event as written, and
16
+ * one whose kind is no longer an event (the kinds of runs recorded before OpenAgent stopped
17
+ * running agents) reads as nothing. The line's time, `at`, is the event's, whatever the kind.
18
+ */
19
+ export function fromDiaryLine(line) {
20
+ const { at, ...rest } = line;
21
+ const event = eventOf(rest);
22
+ if (!event)
23
+ return undefined;
24
+ return typeof at === 'string' ? { ...event, at } : event;
25
+ }
26
+ /** Every kind of event there is: a line of another kind has nothing to show. */
27
+ const EVENT_KINDS = {
28
+ session: true,
29
+ 'session-update': true,
30
+ screen: true,
31
+ log: true,
32
+ error: true,
33
+ view: true,
34
+ 'pull-request': true,
35
+ branch: true,
36
+ 'cloud-anchor': true,
37
+ settled: true,
38
+ usage: true,
39
+ choice: true,
40
+ 'choice-resolved': true,
41
+ driver: true,
42
+ intent: true,
43
+ end: true,
44
+ };
45
+ /** A diary line with no time on it, as the event it reads as. */
46
+ function eventOf(line) {
47
+ switch (line.kind) {
48
+ case 'said':
49
+ return { kind: 'driver', event: { type: 'text', text: String(line['text']) } };
50
+ case 'result': {
51
+ const { kind: _kind, ...rest } = line;
52
+ return { kind: 'driver', event: { type: 'result', ...rest } };
53
+ }
54
+ case 'ended':
55
+ return {
56
+ kind: 'end',
57
+ ok: line['status'] === 'done',
58
+ ...(line['status'] === 'stopped' ? { stopped: true } : {}),
59
+ ...(line['status'] === 'waiting' ? { waiting: true } : {}),
60
+ ...(typeof line['detail'] === 'string' ? { detail: line['detail'] } : {}),
61
+ };
62
+ // An error line with a headline is the agent's own `error` block, from a run recorded before the
63
+ // daemon stopped running agents; any other is agent-driver's, a driver's message.
64
+ case 'error': {
65
+ if (typeof line['headline'] === 'string') {
66
+ return { kind: 'error', headline: line['headline'], ...(typeof line['detail'] === 'string' ? { detail: line['detail'] } : {}) };
67
+ }
68
+ const { kind: _kind, ...rest } = line;
69
+ return { kind: 'driver', event: { type: 'error', ...rest } };
70
+ }
71
+ // The lines agent-driver's own log writes (its `session-log.ts`): a driver event per kind, the
72
+ // agent's session id, and the question a turn ended on as the gate the dashboard shows.
73
+ case 'start':
74
+ case 'action':
75
+ case 'output':
76
+ case 'thought':
77
+ case 'rate-limit':
78
+ case 'notice': {
79
+ const { kind, ...rest } = line;
80
+ return { kind: 'driver', event: { type: kind, ...rest } };
81
+ }
82
+ case 'session':
83
+ if (typeof line['sessionId'] === 'string' && line['driver'] === undefined)
84
+ return { kind: 'session-update', sessionId: line['sessionId'] };
85
+ return line;
86
+ case 'question': {
87
+ const { kind: _kind, title, options, recommended, multi, file } = line;
88
+ return {
89
+ kind: 'choice',
90
+ id: 'await-choices',
91
+ title: String(title ?? 'Which option?'),
92
+ options: Array.isArray(options) ? options : [],
93
+ ...(typeof recommended === 'string' ? { recommended } : {}),
94
+ ...(multi === true ? { multi: true } : {}),
95
+ ...(typeof file === 'string' ? { file } : {}),
96
+ };
97
+ }
98
+ case 'cost':
99
+ return { kind: 'usage', costUsd: line['usd'] };
100
+ default:
101
+ return Object.hasOwn(EVENT_KINDS, line.kind) ? line : undefined;
102
+ }
103
+ }
104
+ /** A diary as the run's events, for a reader that replays them. */
105
+ export function eventsOf(lines) {
106
+ return lines.flatMap(line => fromDiaryLine(line) ?? []);
107
+ }
108
+ //# sourceMappingURL=run-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-record.js","sourceRoot":"","sources":["../../src/store/run-record.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH,oFAAoF;AACpF,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;IAC/B,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,GAAI,MAA6B,EAAE,GAAG,GAAG,EAAe,CAAA;AAC9G,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAkB;IAC9C,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAoB,CAAC,CAAA;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,OAAO,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA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;AACH,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,QAAQ,CAAC,KAA8B;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;AACzD,CAAC"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Finished runs, as OpenAgent reads them (#1774). OpenAgent keeps no run and imports no
3
+ * records package: a project's finished runs come from whichever of its packages declares that it
4
+ * provides them — `"openagent": { "runs": "<command>" }` in the package's own package.json — and
5
+ * OpenAgent reads them by running that command. Swap the package for another that answers
6
+ * the same command line and prints the same shapes, and nothing here changes. No package declares
7
+ * it: the project has no finished runs, only the ones still running in a checkout.
8
+ *
9
+ * The command line a provider answers, each printing one JSON document and exiting 0:
10
+ * `<command> --local --full --limit N` the runs, newest first, whole cards
11
+ * `<command> show <id> --local --full` one run: the whole card plus `diary`, every line
12
+ * `<command> delete <id>` remove a run
13
+ * `<command> patch <id> [--branch <b>] [--pr <n> --pr-url <url>] [--landed <commit> --from <commit>]` the late facts
14
+ * `--local` reads the copy on this machine, no network: OpenAgent polls.
15
+ *
16
+ * The shapes, owned here: {@link RunCard} and {@link AnyDiaryLine}. A running agent's own card in
17
+ * its checkout is the same shape, written by the tool that runs it.
18
+ */
19
+ /** How a run stands: still going, or how it ended. */
20
+ export type RunStatus = 'running' | 'done' | 'stopped' | 'failed' | 'waiting';
21
+ /**
22
+ * A run's card: what was asked, where the work went, how it ended, what it cost. `caller` is the
23
+ * bookkeeping of the program that ran the agent (its pid, host, session id, …), one key.
24
+ */
25
+ export interface RunCard {
26
+ id: string;
27
+ startedAt: string;
28
+ endedAt?: string;
29
+ status: RunStatus;
30
+ intent?: string;
31
+ driver?: string;
32
+ model?: string;
33
+ branch?: string;
34
+ pr?: {
35
+ number: number;
36
+ url: string;
37
+ };
38
+ ticket?: string;
39
+ cost?: number;
40
+ caller?: Record<string, unknown>;
41
+ }
42
+ /** The two late facts a finished run's card may still learn: the branch its work landed on, its pull request. */
43
+ export type RunPatch = Partial<Pick<RunCard, 'branch' | 'pr'>> & {
44
+ /** The run's work was merged and its branch deleted: its last commit, and the commit its work began at. */
45
+ landed?: {
46
+ commit: string;
47
+ from: string;
48
+ };
49
+ };
50
+ /** One line of a run's diary: a JSON object with a `kind`. */
51
+ export type AnyDiaryLine = {
52
+ kind: string;
53
+ } & Record<string, unknown>;
54
+ /** A finished run: its card and its whole diary. */
55
+ export interface FinishedRun {
56
+ card: RunCard;
57
+ diary: AnyDiaryLine[];
58
+ }
59
+ /** A project's finished runs: what a provider answers, read by OpenAgent. */
60
+ export interface RunsSource {
61
+ /**
62
+ * Every finished run's card, newest first; `[]` when none can be read. `fresh` skips a list read
63
+ * a moment ago: the caller knows the runs changed since.
64
+ */
65
+ list(opts?: {
66
+ fresh?: boolean;
67
+ }): Promise<RunCard[]>;
68
+ /** One run with its diary; `undefined` for no such run, or none readable. */
69
+ show(id: string): Promise<FinishedRun | undefined>;
70
+ /** Remove a run, or why it could not be. */
71
+ remove(id: string): Promise<RunsWrite>;
72
+ /** Set a run's late facts, or why they could not be. */
73
+ patch(id: string, patch: RunPatch): Promise<RunsWrite>;
74
+ }
75
+ /** What a change to the runs did: done, or the provider's reason it was not. */
76
+ export type RunsWrite = {
77
+ ok: true;
78
+ } | {
79
+ ok: false;
80
+ error: string;
81
+ };
82
+ /** The finished runs of the project at `root`, or `undefined` when none of its packages provides them. */
83
+ export type RunsFor = (root: string) => Promise<RunsSource | undefined>;
84
+ /** A {@link RunsFor} that also forgets what it read of one project, for when a module just wrote there. */
85
+ export type RunsReader = RunsFor & {
86
+ changed(root: string): void;
87
+ };
88
+ /** Whether a string can name a run: letters, digits, `-` and `_`, nothing a path can climb out with. */
89
+ export declare function isRunId(id: string): boolean;
90
+ /**
91
+ * A card read back: the fields of the shape, each kept only when it has the right type, plus
92
+ * `caller` as it is. `undefined` for anything that is not a card — not an object, or missing an
93
+ * id, a start or a status. Takes a card's JSON text or an already-parsed value.
94
+ */
95
+ export declare function parseRunCard(input: unknown): RunCard | undefined;
96
+ /**
97
+ * The production {@link RunsFor}: the project's provider, looked up by its package.json, one
98
+ * source per project kept while the same command provides — so the cache holds across the many
99
+ * reads of one poll, and a project that installs, swaps or drops its provider is read the new way
100
+ * within {@link CACHE_MS}. `changed(root)` forgets that project's reads, so the next read runs the
101
+ * command again: a module's command just ran there, and may have written.
102
+ */
103
+ export declare function providedRuns(now?: () => number): RunsReader;
104
+ /** OpenAgent's one reader of finished runs, shared by every caller so they share its cache. */
105
+ export declare const projectRuns: RunsReader;
106
+ /** A {@link RunsFor} for a project with no provider: no finished runs. */
107
+ export declare const noRuns: RunsFor;
108
+ //# sourceMappingURL=runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/store/runs.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE7E;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC;AAED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