@canhta/dsh-autopilot 0.1.0-alpha.1

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 (448) hide show
  1. package/AGENTS.md +41 -0
  2. package/CONTEXT.md +39 -0
  3. package/LICENSE +21 -0
  4. package/README.md +95 -0
  5. package/cordis.patch.yml +13 -0
  6. package/deploy/dsh-autopilot.service +26 -0
  7. package/docs/CONTRIBUTING.md +60 -0
  8. package/docs/README.md +34 -0
  9. package/docs/agents/domain.md +7 -0
  10. package/docs/agents/issue-tracker.md +21 -0
  11. package/docs/agents/triage-labels.md +13 -0
  12. package/docs/assets/banner.png +0 -0
  13. package/docs/deployment.md +138 -0
  14. package/docs/engineering.md +43 -0
  15. package/docs/specs/execution.md +65 -0
  16. package/docs/specs/integrations.md +89 -0
  17. package/docs/specs/lifecycle.md +81 -0
  18. package/docs/specs/operations.md +89 -0
  19. package/docs/specs/plugin.md +49 -0
  20. package/docs/specs/providers.md +62 -0
  21. package/docs/specs/scope.md +35 -0
  22. package/docs/specs/ui-components.md +96 -0
  23. package/docs/specs/web-ui.md +64 -0
  24. package/lib/admission/cancellation-control.d.ts +11 -0
  25. package/lib/admission/cancellation-control.js +72 -0
  26. package/lib/admission/cancellation-control.js.map +1 -0
  27. package/lib/admission/candidates.d.ts +2 -0
  28. package/lib/admission/candidates.js +23 -0
  29. package/lib/admission/candidates.js.map +1 -0
  30. package/lib/admission/composition-claim.d.ts +10 -0
  31. package/lib/admission/composition-claim.js +13 -0
  32. package/lib/admission/composition-claim.js.map +1 -0
  33. package/lib/admission/constants.d.ts +12 -0
  34. package/lib/admission/constants.js +13 -0
  35. package/lib/admission/constants.js.map +1 -0
  36. package/lib/admission/deliveries.d.ts +6 -0
  37. package/lib/admission/deliveries.js +175 -0
  38. package/lib/admission/deliveries.js.map +1 -0
  39. package/lib/admission/delivery-control.d.ts +28 -0
  40. package/lib/admission/delivery-control.js +294 -0
  41. package/lib/admission/delivery-control.js.map +1 -0
  42. package/lib/admission/execution-control.d.ts +29 -0
  43. package/lib/admission/execution-control.js +177 -0
  44. package/lib/admission/execution-control.js.map +1 -0
  45. package/lib/admission/index.d.ts +4 -0
  46. package/lib/admission/index.js +4 -0
  47. package/lib/admission/index.js.map +1 -0
  48. package/lib/admission/model.d.ts +296 -0
  49. package/lib/admission/model.js +13 -0
  50. package/lib/admission/model.js.map +1 -0
  51. package/lib/admission/pause-control.d.ts +44 -0
  52. package/lib/admission/pause-control.js +220 -0
  53. package/lib/admission/pause-control.js.map +1 -0
  54. package/lib/admission/policy.d.ts +39 -0
  55. package/lib/admission/policy.js +238 -0
  56. package/lib/admission/policy.js.map +1 -0
  57. package/lib/admission/ports.d.ts +13 -0
  58. package/lib/admission/ports.js +2 -0
  59. package/lib/admission/ports.js.map +1 -0
  60. package/lib/admission/publication-control.d.ts +16 -0
  61. package/lib/admission/publication-control.js +153 -0
  62. package/lib/admission/publication-control.js.map +1 -0
  63. package/lib/admission/reconciler.d.ts +7 -0
  64. package/lib/admission/reconciler.js +121 -0
  65. package/lib/admission/reconciler.js.map +1 -0
  66. package/lib/admission/resume-control.d.ts +27 -0
  67. package/lib/admission/resume-control.js +213 -0
  68. package/lib/admission/resume-control.js.map +1 -0
  69. package/lib/admission/run-fence.d.ts +11 -0
  70. package/lib/admission/run-fence.js +49 -0
  71. package/lib/admission/run-fence.js.map +1 -0
  72. package/lib/admission/service.d.ts +130 -0
  73. package/lib/admission/service.js +415 -0
  74. package/lib/admission/service.js.map +1 -0
  75. package/lib/admission/state-domain.d.ts +11 -0
  76. package/lib/admission/state-domain.js +33 -0
  77. package/lib/admission/state-domain.js.map +1 -0
  78. package/lib/admission/state-integrity.d.ts +19 -0
  79. package/lib/admission/state-integrity.js +102 -0
  80. package/lib/admission/state-integrity.js.map +1 -0
  81. package/lib/admission/state-migration.d.ts +4 -0
  82. package/lib/admission/state-migration.js +46 -0
  83. package/lib/admission/state-migration.js.map +1 -0
  84. package/lib/admission/state.d.ts +4524 -0
  85. package/lib/admission/state.js +394 -0
  86. package/lib/admission/state.js.map +1 -0
  87. package/lib/admission.d.ts +1 -0
  88. package/lib/admission.js +2 -0
  89. package/lib/admission.js.map +1 -0
  90. package/lib/client-types/client/OperationsAtoms.d.ts +30 -0
  91. package/lib/client-types/client/OperationsPanel.d.ts +34 -0
  92. package/lib/client-types/client/RunsView.d.ts +14 -0
  93. package/lib/client-types/client/SettingsCapabilitySections.d.ts +16 -0
  94. package/lib/client-types/client/SettingsPanel.d.ts +40 -0
  95. package/lib/client-types/client/SettingsPolicySections.d.ts +13 -0
  96. package/lib/client-types/client/SettingsProviderSection.d.ts +21 -0
  97. package/lib/client-types/client/SummaryView.d.ts +10 -0
  98. package/lib/client-types/client/WorktreesView.d.ts +9 -0
  99. package/lib/client-types/client/index.d.ts +9 -0
  100. package/lib/client-types/client/locales/en.d.ts +154 -0
  101. package/lib/client-types/client/locales/index.d.ts +9 -0
  102. package/lib/client-types/client/locales/zh.d.ts +155 -0
  103. package/lib/client-types/client/settings-draft.d.ts +29 -0
  104. package/lib/client-types/client/state.d.ts +63 -0
  105. package/lib/client-types/code-host/index.d.ts +2 -0
  106. package/lib/client-types/code-host/model.d.ts +118 -0
  107. package/lib/client-types/code-host/registry.d.ts +23 -0
  108. package/lib/client-types/code-host/validation.d.ts +51 -0
  109. package/lib/client-types/code-host.d.ts +2 -0
  110. package/lib/client-types/config/index.d.ts +2 -0
  111. package/lib/client-types/config/settings.d.ts +51 -0
  112. package/lib/client-types/config.d.ts +2 -0
  113. package/lib/client-types/notification/index.d.ts +2 -0
  114. package/lib/client-types/notification/model.d.ts +57 -0
  115. package/lib/client-types/notification/registry.d.ts +16 -0
  116. package/lib/client-types/notification.d.ts +2 -0
  117. package/lib/client-types/providers/generation-registry.d.ts +20 -0
  118. package/lib/client-types/remote.d.ts +65 -0
  119. package/lib/client-types/tracker/index.d.ts +2 -0
  120. package/lib/client-types/tracker/model.d.ts +222 -0
  121. package/lib/client-types/tracker/registry.d.ts +49 -0
  122. package/lib/client-types/tracker/validation.d.ts +60 -0
  123. package/lib/client-types/tracker.d.ts +2 -0
  124. package/lib/client-types/web/contract.d.ts +958 -0
  125. package/lib/client.js +7961 -0
  126. package/lib/client.js.map +1 -0
  127. package/lib/code-host/index.d.ts +2 -0
  128. package/lib/code-host/index.js +3 -0
  129. package/lib/code-host/index.js.map +1 -0
  130. package/lib/code-host/model.d.ts +118 -0
  131. package/lib/code-host/model.js +23 -0
  132. package/lib/code-host/model.js.map +1 -0
  133. package/lib/code-host/registry.d.ts +23 -0
  134. package/lib/code-host/registry.js +90 -0
  135. package/lib/code-host/registry.js.map +1 -0
  136. package/lib/code-host/validation.d.ts +51 -0
  137. package/lib/code-host/validation.js +30 -0
  138. package/lib/code-host/validation.js.map +1 -0
  139. package/lib/code-host.d.ts +2 -0
  140. package/lib/code-host.js +3 -0
  141. package/lib/code-host.js.map +1 -0
  142. package/lib/config/index.d.ts +2 -0
  143. package/lib/config/index.js +3 -0
  144. package/lib/config/index.js.map +1 -0
  145. package/lib/config/settings.d.ts +51 -0
  146. package/lib/config/settings.js +195 -0
  147. package/lib/config/settings.js.map +1 -0
  148. package/lib/config.d.ts +2 -0
  149. package/lib/config.js +3 -0
  150. package/lib/config.js.map +1 -0
  151. package/lib/delivery/index.d.ts +1 -0
  152. package/lib/delivery/index.js +2 -0
  153. package/lib/delivery/index.js.map +1 -0
  154. package/lib/delivery/service.d.ts +29 -0
  155. package/lib/delivery/service.js +140 -0
  156. package/lib/delivery/service.js.map +1 -0
  157. package/lib/delivery.d.ts +2 -0
  158. package/lib/delivery.js +3 -0
  159. package/lib/delivery.js.map +1 -0
  160. package/lib/dispatch/composition.d.ts +18 -0
  161. package/lib/dispatch/composition.js +109 -0
  162. package/lib/dispatch/composition.js.map +1 -0
  163. package/lib/dispatch/contract.d.ts +2 -0
  164. package/lib/dispatch/contract.js +2 -0
  165. package/lib/dispatch/contract.js.map +1 -0
  166. package/lib/dispatch/execute.d.ts +10 -0
  167. package/lib/dispatch/execute.js +138 -0
  168. package/lib/dispatch/execute.js.map +1 -0
  169. package/lib/dispatch/execution-state.d.ts +12 -0
  170. package/lib/dispatch/execution-state.js +24 -0
  171. package/lib/dispatch/execution-state.js.map +1 -0
  172. package/lib/dispatch/git.d.ts +5 -0
  173. package/lib/dispatch/git.js +95 -0
  174. package/lib/dispatch/git.js.map +1 -0
  175. package/lib/dispatch/index.d.ts +2 -0
  176. package/lib/dispatch/index.js +2 -0
  177. package/lib/dispatch/index.js.map +1 -0
  178. package/lib/dispatch/report.d.ts +11 -0
  179. package/lib/dispatch/report.js +141 -0
  180. package/lib/dispatch/report.js.map +1 -0
  181. package/lib/dispatch/resume.d.ts +17 -0
  182. package/lib/dispatch/resume.js +89 -0
  183. package/lib/dispatch/resume.js.map +1 -0
  184. package/lib/dispatch/service.d.ts +56 -0
  185. package/lib/dispatch/service.js +231 -0
  186. package/lib/dispatch/service.js.map +1 -0
  187. package/lib/dispatch/usage.d.ts +10 -0
  188. package/lib/dispatch/usage.js +47 -0
  189. package/lib/dispatch/usage.js.map +1 -0
  190. package/lib/dispatch.d.ts +2 -0
  191. package/lib/dispatch.js +3 -0
  192. package/lib/dispatch.js.map +1 -0
  193. package/lib/github-code-host.d.ts +1 -0
  194. package/lib/github-code-host.js +2 -0
  195. package/lib/github-code-host.js.map +1 -0
  196. package/lib/github-issues.d.ts +1 -0
  197. package/lib/github-issues.js +2 -0
  198. package/lib/github-issues.js.map +1 -0
  199. package/lib/index.d.ts +21 -0
  200. package/lib/index.js +48 -0
  201. package/lib/index.js.map +1 -0
  202. package/lib/ingress.d.ts +2 -0
  203. package/lib/ingress.js +3 -0
  204. package/lib/ingress.js.map +1 -0
  205. package/lib/jira.d.ts +1 -0
  206. package/lib/jira.js +2 -0
  207. package/lib/jira.js.map +1 -0
  208. package/lib/mcp/contracts.d.ts +21 -0
  209. package/lib/mcp/contracts.js +33 -0
  210. package/lib/mcp/contracts.js.map +1 -0
  211. package/lib/mcp/cursor.d.ts +10 -0
  212. package/lib/mcp/cursor.js +68 -0
  213. package/lib/mcp/cursor.js.map +1 -0
  214. package/lib/mcp/definition.d.ts +8 -0
  215. package/lib/mcp/definition.js +43 -0
  216. package/lib/mcp/definition.js.map +1 -0
  217. package/lib/mcp/index.d.ts +6 -0
  218. package/lib/mcp/index.js +7 -0
  219. package/lib/mcp/index.js.map +1 -0
  220. package/lib/mcp/json.d.ts +4 -0
  221. package/lib/mcp/json.js +20 -0
  222. package/lib/mcp/json.js.map +1 -0
  223. package/lib/mcp/mount.d.ts +17 -0
  224. package/lib/mcp/mount.js +79 -0
  225. package/lib/mcp/mount.js.map +1 -0
  226. package/lib/mcp/read-tools.d.ts +27 -0
  227. package/lib/mcp/read-tools.js +149 -0
  228. package/lib/mcp/read-tools.js.map +1 -0
  229. package/lib/notification/index.d.ts +2 -0
  230. package/lib/notification/index.js +3 -0
  231. package/lib/notification/index.js.map +1 -0
  232. package/lib/notification/model.d.ts +57 -0
  233. package/lib/notification/model.js +20 -0
  234. package/lib/notification/model.js.map +1 -0
  235. package/lib/notification/registry.d.ts +16 -0
  236. package/lib/notification/registry.js +67 -0
  237. package/lib/notification/registry.js.map +1 -0
  238. package/lib/notification.d.ts +2 -0
  239. package/lib/notification.js +3 -0
  240. package/lib/notification.js.map +1 -0
  241. package/lib/ntfy-notification.d.ts +1 -0
  242. package/lib/ntfy-notification.js +2 -0
  243. package/lib/ntfy-notification.js.map +1 -0
  244. package/lib/operations/cleanup-inspector.d.ts +16 -0
  245. package/lib/operations/cleanup-inspector.js +132 -0
  246. package/lib/operations/cleanup-inspector.js.map +1 -0
  247. package/lib/operations/cleanup.d.ts +25 -0
  248. package/lib/operations/cleanup.js +151 -0
  249. package/lib/operations/cleanup.js.map +1 -0
  250. package/lib/operations/disposition.d.ts +46 -0
  251. package/lib/operations/disposition.js +89 -0
  252. package/lib/operations/disposition.js.map +1 -0
  253. package/lib/operations/health.d.ts +6 -0
  254. package/lib/operations/health.js +41 -0
  255. package/lib/operations/health.js.map +1 -0
  256. package/lib/operations/index.d.ts +6 -0
  257. package/lib/operations/index.js +7 -0
  258. package/lib/operations/index.js.map +1 -0
  259. package/lib/operations/inspection.d.ts +35 -0
  260. package/lib/operations/inspection.js +183 -0
  261. package/lib/operations/inspection.js.map +1 -0
  262. package/lib/operations/model.d.ts +77 -0
  263. package/lib/operations/model.js +2 -0
  264. package/lib/operations/model.js.map +1 -0
  265. package/lib/operations/recovery.d.ts +11 -0
  266. package/lib/operations/recovery.js +101 -0
  267. package/lib/operations/recovery.js.map +1 -0
  268. package/lib/operations/retention.d.ts +28 -0
  269. package/lib/operations/retention.js +105 -0
  270. package/lib/operations/retention.js.map +1 -0
  271. package/lib/operations/runtime-owner.d.ts +54 -0
  272. package/lib/operations/runtime-owner.js +281 -0
  273. package/lib/operations/runtime-owner.js.map +1 -0
  274. package/lib/operations/service.d.ts +55 -0
  275. package/lib/operations/service.js +154 -0
  276. package/lib/operations/service.js.map +1 -0
  277. package/lib/operations/state.d.ts +79 -0
  278. package/lib/operations/state.js +51 -0
  279. package/lib/operations/state.js.map +1 -0
  280. package/lib/operations/storage-composition.d.ts +16 -0
  281. package/lib/operations/storage-composition.js +61 -0
  282. package/lib/operations/storage-composition.js.map +1 -0
  283. package/lib/operations/store.d.ts +16 -0
  284. package/lib/operations/store.js +84 -0
  285. package/lib/operations/store.js.map +1 -0
  286. package/lib/operations.d.ts +2 -0
  287. package/lib/operations.js +3 -0
  288. package/lib/operations.js.map +1 -0
  289. package/lib/providers/generation-registry.d.ts +20 -0
  290. package/lib/providers/generation-registry.js +72 -0
  291. package/lib/providers/generation-registry.js.map +1 -0
  292. package/lib/providers/github-code-host/contracts.d.ts +224 -0
  293. package/lib/providers/github-code-host/contracts.js +144 -0
  294. package/lib/providers/github-code-host/contracts.js.map +1 -0
  295. package/lib/providers/github-code-host/index.d.ts +2 -0
  296. package/lib/providers/github-code-host/index.js +2 -0
  297. package/lib/providers/github-code-host/index.js.map +1 -0
  298. package/lib/providers/github-code-host/provider.d.ts +5 -0
  299. package/lib/providers/github-code-host/provider.js +289 -0
  300. package/lib/providers/github-code-host/provider.js.map +1 -0
  301. package/lib/providers/github-code-host/schemas.d.ts +81 -0
  302. package/lib/providers/github-code-host/schemas.js +39 -0
  303. package/lib/providers/github-code-host/schemas.js.map +1 -0
  304. package/lib/providers/github-code-host/settings.d.ts +16 -0
  305. package/lib/providers/github-code-host/settings.js +65 -0
  306. package/lib/providers/github-code-host/settings.js.map +1 -0
  307. package/lib/providers/github-issues/contracts.d.ts +151 -0
  308. package/lib/providers/github-issues/contracts.js +141 -0
  309. package/lib/providers/github-issues/contracts.js.map +1 -0
  310. package/lib/providers/github-issues/index.d.ts +1 -0
  311. package/lib/providers/github-issues/index.js +2 -0
  312. package/lib/providers/github-issues/index.js.map +1 -0
  313. package/lib/providers/github-issues/ingress.d.ts +8 -0
  314. package/lib/providers/github-issues/ingress.js +80 -0
  315. package/lib/providers/github-issues/ingress.js.map +1 -0
  316. package/lib/providers/github-issues/normalization.d.ts +11 -0
  317. package/lib/providers/github-issues/normalization.js +115 -0
  318. package/lib/providers/github-issues/normalization.js.map +1 -0
  319. package/lib/providers/github-issues/provider.d.ts +6 -0
  320. package/lib/providers/github-issues/provider.js +235 -0
  321. package/lib/providers/github-issues/provider.js.map +1 -0
  322. package/lib/providers/github-issues/schemas.d.ts +123 -0
  323. package/lib/providers/github-issues/schemas.js +58 -0
  324. package/lib/providers/github-issues/schemas.js.map +1 -0
  325. package/lib/providers/github-issues/settings.d.ts +27 -0
  326. package/lib/providers/github-issues/settings.js +154 -0
  327. package/lib/providers/github-issues/settings.js.map +1 -0
  328. package/lib/providers/jira/contracts.d.ts +193 -0
  329. package/lib/providers/jira/contracts.js +133 -0
  330. package/lib/providers/jira/contracts.js.map +1 -0
  331. package/lib/providers/jira/index.d.ts +1 -0
  332. package/lib/providers/jira/index.js +2 -0
  333. package/lib/providers/jira/index.js.map +1 -0
  334. package/lib/providers/jira/ingress.d.ts +4 -0
  335. package/lib/providers/jira/ingress.js +60 -0
  336. package/lib/providers/jira/ingress.js.map +1 -0
  337. package/lib/providers/jira/normalization.d.ts +8 -0
  338. package/lib/providers/jira/normalization.js +121 -0
  339. package/lib/providers/jira/normalization.js.map +1 -0
  340. package/lib/providers/jira/provider.d.ts +6 -0
  341. package/lib/providers/jira/provider.js +317 -0
  342. package/lib/providers/jira/provider.js.map +1 -0
  343. package/lib/providers/jira/schemas.d.ts +134 -0
  344. package/lib/providers/jira/schemas.js +76 -0
  345. package/lib/providers/jira/schemas.js.map +1 -0
  346. package/lib/providers/jira/settings.d.ts +32 -0
  347. package/lib/providers/jira/settings.js +163 -0
  348. package/lib/providers/jira/settings.js.map +1 -0
  349. package/lib/providers/notification-http.d.ts +13 -0
  350. package/lib/providers/notification-http.js +136 -0
  351. package/lib/providers/notification-http.js.map +1 -0
  352. package/lib/providers/ntfy-notification/index.d.ts +2 -0
  353. package/lib/providers/ntfy-notification/index.js +2 -0
  354. package/lib/providers/ntfy-notification/index.js.map +1 -0
  355. package/lib/providers/ntfy-notification/provider.d.ts +4 -0
  356. package/lib/providers/ntfy-notification/provider.js +89 -0
  357. package/lib/providers/ntfy-notification/provider.js.map +1 -0
  358. package/lib/providers/ntfy-notification/settings.d.ts +12 -0
  359. package/lib/providers/ntfy-notification/settings.js +34 -0
  360. package/lib/providers/ntfy-notification/settings.js.map +1 -0
  361. package/lib/providers/webhook-notification/index.d.ts +2 -0
  362. package/lib/providers/webhook-notification/index.js +2 -0
  363. package/lib/providers/webhook-notification/index.js.map +1 -0
  364. package/lib/providers/webhook-notification/provider.d.ts +4 -0
  365. package/lib/providers/webhook-notification/provider.js +57 -0
  366. package/lib/providers/webhook-notification/provider.js.map +1 -0
  367. package/lib/providers/webhook-notification/settings.d.ts +11 -0
  368. package/lib/providers/webhook-notification/settings.js +31 -0
  369. package/lib/providers/webhook-notification/settings.js.map +1 -0
  370. package/lib/publication/git.d.ts +7 -0
  371. package/lib/publication/git.js +154 -0
  372. package/lib/publication/git.js.map +1 -0
  373. package/lib/publication/index.d.ts +1 -0
  374. package/lib/publication/index.js +2 -0
  375. package/lib/publication/index.js.map +1 -0
  376. package/lib/publication/service.d.ts +27 -0
  377. package/lib/publication/service.js +166 -0
  378. package/lib/publication/service.js.map +1 -0
  379. package/lib/publication.d.ts +2 -0
  380. package/lib/publication.js +3 -0
  381. package/lib/publication.js.map +1 -0
  382. package/lib/reconciliation/index.d.ts +3 -0
  383. package/lib/reconciliation/index.js +4 -0
  384. package/lib/reconciliation/index.js.map +1 -0
  385. package/lib/reconciliation/ingress.d.ts +21 -0
  386. package/lib/reconciliation/ingress.js +168 -0
  387. package/lib/reconciliation/ingress.js.map +1 -0
  388. package/lib/reconciliation/service.d.ts +75 -0
  389. package/lib/reconciliation/service.js +228 -0
  390. package/lib/reconciliation/service.js.map +1 -0
  391. package/lib/reconciliation.d.ts +2 -0
  392. package/lib/reconciliation.js +3 -0
  393. package/lib/reconciliation.js.map +1 -0
  394. package/lib/remote.d.ts +65 -0
  395. package/lib/remote.js +135 -0
  396. package/lib/remote.js.map +1 -0
  397. package/lib/tracker/index.d.ts +2 -0
  398. package/lib/tracker/index.js +3 -0
  399. package/lib/tracker/index.js.map +1 -0
  400. package/lib/tracker/model.d.ts +222 -0
  401. package/lib/tracker/model.js +66 -0
  402. package/lib/tracker/model.js.map +1 -0
  403. package/lib/tracker/registry.d.ts +49 -0
  404. package/lib/tracker/registry.js +213 -0
  405. package/lib/tracker/registry.js.map +1 -0
  406. package/lib/tracker/validation.d.ts +60 -0
  407. package/lib/tracker/validation.js +52 -0
  408. package/lib/tracker/validation.js.map +1 -0
  409. package/lib/tracker.d.ts +2 -0
  410. package/lib/tracker.js +3 -0
  411. package/lib/tracker.js.map +1 -0
  412. package/lib/typert.d.ts +1 -0
  413. package/lib/typert.js +2 -0
  414. package/lib/typert.js.map +1 -0
  415. package/lib/web/commands.d.ts +18 -0
  416. package/lib/web/commands.js +231 -0
  417. package/lib/web/commands.js.map +1 -0
  418. package/lib/web/contract.d.ts +958 -0
  419. package/lib/web/contract.js +230 -0
  420. package/lib/web/contract.js.map +1 -0
  421. package/lib/web/contributions.d.ts +41 -0
  422. package/lib/web/contributions.js +61 -0
  423. package/lib/web/contributions.js.map +1 -0
  424. package/lib/web/integrations.d.ts +13 -0
  425. package/lib/web/integrations.js +95 -0
  426. package/lib/web/integrations.js.map +1 -0
  427. package/lib/web/projection.d.ts +10 -0
  428. package/lib/web/projection.js +192 -0
  429. package/lib/web/projection.js.map +1 -0
  430. package/lib/web/service.d.ts +31 -0
  431. package/lib/web/service.js +141 -0
  432. package/lib/web/service.js.map +1 -0
  433. package/lib/web.d.ts +5 -0
  434. package/lib/web.js +6 -0
  435. package/lib/web.js.map +1 -0
  436. package/lib/webhook-notification.d.ts +1 -0
  437. package/lib/webhook-notification.js +2 -0
  438. package/lib/webhook-notification.js.map +1 -0
  439. package/lib/workflow/index.d.ts +1 -0
  440. package/lib/workflow/index.js +2 -0
  441. package/lib/workflow/index.js.map +1 -0
  442. package/lib/workflow/service.d.ts +31 -0
  443. package/lib/workflow/service.js +220 -0
  444. package/lib/workflow/service.js.map +1 -0
  445. package/lib/workflow.d.ts +2 -0
  446. package/lib/workflow.js +3 -0
  447. package/lib/workflow.js.map +1 -0
  448. package/package.json +276 -0
@@ -0,0 +1,96 @@
1
+ # UI modules and components
2
+
3
+ This page owns Client decomposition, data/command behavior and functional acceptance. [Web UI](web-ui.md) owns navigation, visual rules, journeys and visual acceptance. Names below are Autopilot responsibilities, not instructions to create new components when DSH already supplies them.
4
+
5
+ Implement components using the [DSH Client discipline](../engineering.md#client-code), keeping data ownership and subscriptions outside presentation components.
6
+
7
+ ## Module ownership
8
+
9
+ | Module | Responsibility | Reads | Mutations |
10
+ | --- | --- | --- | --- |
11
+ | Operations shell | Selected view/run, integration/recovery visibility, global scheduler controls | Host health and scheduler summary | Scheduler pause/resume/drain, explicit reconcile |
12
+ | Runs | Browse waiting/active/history and inspect one execution | Paginated run summaries and selected run snapshot | Stop at checkpoint, resume operational pause, cancel quiescent queued/paused/blocked run |
13
+ | Schedule | Explain when admission can happen | Effective timezone/windows/cadence, next reconcile/dispatch, recent reconciliations | None; link to Settings |
14
+ | Budget | Explain spend authorization and paused work | Scoped caps, reservations, settled usage, coverage, window reset | None; link to Settings |
15
+ | Deliveries | Inspect notification failures without confusing them with execution failure | Paginated event/destination receipts | Retry selected failed delivery |
16
+ | Worktrees | Inspect retained Git work and safe removal eligibility | Managed worktrees plus explicit refreshed Git/PR inspection | Request preview, confirm valid cleanup |
17
+ | Settings contribution | Configure providers and operational policy | Effective values, revision, provider schemas/metadata/lookups | Validate/save configuration, explicit connection/test delivery actions |
18
+
19
+ Host state is authoritative. Modules use the existing DSH Remote client with Autopilot's generated query/command contributions; the browser persists only view preferences. Use the supported snapshot/stream facilities described in [plugin engineering](plugin.md#web-and-host-interface) for active views and selected details. Disposal cancels requests/subscriptions. Views neither dispatch workflows nor duplicate provider clients, and do not load full Session transcripts for a table. Query and command transitions are owned by the shared presentation components below.
20
+
21
+ ## Shell and list components
22
+
23
+ | Component | Content and interaction |
24
+ | --- | --- |
25
+ | `OperationsShell` | DSH main-slot content only; owns local view and selected-run state. Contains header, conditional attention strip, local tabs and one content region. Does not redraw DSH navigation or model chat. |
26
+ | `OperationsHeader` | Title, current project/provider identity, scheduler mode with reason, last refresh/reconcile age. One contextual primary control: Pause when enabled, Resume when paused. Drain/reconcile/settings remain labelled secondary actions. |
27
+ | `AttentionStrip` | Only actionable health/recovery/provider failures. A concise reason and one destination action; grouped count opens filtered runs/deliveries. No permanent decorative health banner. |
28
+ | `RunsToolbar` | Search issue key/summary, lifecycle filter, priority and age filters, attention-only toggle and visible result count. State persists when opening/closing details. Clear filters is available when results are empty. |
29
+ | `RunsTable` | Columns in order: issue key + summary; lifecycle + reason; priority; current phase; elapsed; spend qualification; updated age. Leading identity is flexible; numbers align right. Row activation opens details; explicit links and action buttons do not activate the row twice. Host pagination and stable ids; no drag-to-reprioritize control. |
30
+ | `RunDetailPanel` | Header with ticket identity, lifecycle/reason and allowed actions. First show required human action or pause condition; completed runs show PR and verification. Then Brief/dependencies, ordered event timeline, verification, workspace/Session, spend and deliveries as collapsible sections. No second dashboard inside the panel. |
31
+
32
+ Run detail uses composition: `BlockerCallout` renders numbered questions and the exact tracker action; `VerificationSummary` renders checks/results/skips and verified Git identity; `RunTimeline` renders timestamped normalized events, grouping repeated retries; `ResourceLinks` links to tracker, DSH Session, PR and worktree details. None derives success from prose or infers a next action from status color.
33
+
34
+ Supply Session evidence through existing DSH query and projection services. Restrict reads to the selected run's authorized Session/descendant identities, fetch bounded detail on demand and expose stale/unavailable evidence. Projection caches accelerate display; they do not determine run success, credit authorization or safe publication.
35
+
36
+ The panel footer uses the operator-command policy below. Preserve scroll/selection if an update arrives; announce significant state changes without moving focus.
37
+
38
+ ## Operator-command policy
39
+
40
+ | Action | Visible behavior |
41
+ | --- | --- |
42
+ | Pause scheduler | Explains that active work is pausing; displays unfinished pauses until checkpointed |
43
+ | Resume scheduler | Re-evaluates paused/queued work through normal gates |
44
+ | Drain | Stops new admission/dequeue while current runs finish |
45
+ | Reconcile now | Fetches current tracker state under ordinary admission policy |
46
+ | Cancel run | Available for quiescent queued/paused/blocked runs; retains worktree/history and cannot silently requeue on an unchanged tracker poll |
47
+ | Stop at checkpoint | Requests an operational pause and durable operator hold for the selected run |
48
+ | Resume paused run | Clears that run's operator hold and queues continuation only if all other gates permit; otherwise shows the unmet condition |
49
+ | Retry notification | Retries selected delivery without repeating code execution |
50
+ | Cleanup worktree | Shows exact removal preview and rejection reasons before confirmation |
51
+ | Open ticket / Session / PR | Opens the associated system record |
52
+
53
+ A blocked run shows `Waiting for a human in {trackerName}`, its questions and `Open in {trackerName}`. Human unblock authorization stays on tracker. Display the reason for unavailable actions; do not silently ignore them. Destructive cleanup requires confirmation of the preview, while ordinary reads do not.
54
+
55
+ The Host rechecks current state for every command. Audit mutations with operator identity when available, timestamp, request id, target and resulting revision.
56
+ Mapping repair is available only for failed tracker projections under [delivery repair](operations.md#repairing-a-broken-delivery-mapping). Show the old/new mapping and affected intent, validate and confirm; never expose it as an unblock shortcut.
57
+
58
+ ## Operational components
59
+
60
+ | Component | Content and interaction |
61
+ | --- | --- |
62
+ | `ScheduleSummary` | Text/table of effective windows and timezone, next reconciliation versus next admissible dispatch, disabled/draining/window-closed explanations, recent reconciliation outcomes. No cron-expression-only presentation or calendar editor. Edit opens the owning Settings section. |
63
+ | `BudgetLedger` | Per configured scope: cap, settled, reserved, remaining, reset time and enforcement mode. Unknown amounts remain unknown. A restrained labelled meter is permitted only with a known denominator; provider balance is separate. Show affected paused runs and coverage explanation; no forecast graph without data. |
64
+ | `DeliveryTable` | Event, linked run/ticket, destination label, delivery state, attempts/next retry and sanitized error. Inspect exposes redacted payload/receipt; retry uses the operator-command policy. |
65
+ | `WorktreeTable` | Ticket/run, branch, active/retained/missing/orphaned state, last inspection age, dirty/untracked/unpushed indicators, PR disposition, disk usage and cleanup eligibility. Unknown inspection values display explicitly. Select opens an inspector; refreshing inspection is an explicit read. |
66
+ | `WorktreeInspector` | Exact managed path and run association, Git findings, PR link/disposition, retention basis and blocking reasons. Preview cleanup is available only for an inspectable managed target; no recursive filesystem-delete button. |
67
+ | `CleanupDialog` | Host-issued target/revision, removable path/size, branch/data retained, checked Git/PR conditions and expiry/staleness. Cancel is the safe default; confirm names the worktree. Pending disables repeat submit. Stale preview requires re-inspection, not confirmation of old data. |
68
+ | `ProviderBindingFields` | Provider selector from installed registrations; provider-specific project/team/workspace/repository selectors and validated mappings. Keep stable ids internally and friendly names visibly. Show missing capabilities, access, compatibility and binding-switch restrictions before save. |
69
+ | `SettingsForm` | Sections: Providers & project; Schedule & capacity; Execution; Budget; Notifications; Retention & storage, using [Host configuration](operations.md#scheduling-and-configuration). Show defaults/effective values. One draft/revision with dirty state, validation, inline errors and save result; a stale edit returns conflict with a reload path, not an overwrite. Loading lookups cannot erase stored values. No silent autosave for operational policy. |
70
+
71
+ Notifications use a destination list with add/edit/test controls inside Settings. An explicit operator test previews destination, redacted payload and disclosure before sending, and labels the delivery as a test. Credentials use supported Host reference/status controls. Never hydrate existing secret values into the Client; show only configured/missing/source/writable/error metadata and allowed replacement actions.
72
+
73
+ ## Shared primitives and state
74
+
75
+ Compose public DSH primitives, Settings services and slots, theme and localization. The baseline exports no generic table, accessible tablist, schema form or credential editor; implement only the required domain composition over shared atoms and semantic HTML. Reusing a dialog still requires verifying focus management. Autopilot-specific shared components are limited to repeated domain presentation: `RunStateLabel`, `ProviderResourceLink`, `UsageValue`, `CommandFeedback` and `QueryState`. A domain label carries text/icon/color; unknown remains distinct from zero/success.
76
+
77
+ `QueryState` distinguishes first load, empty domain, empty filtered result, denied/unavailable, stale cached data and retryable error. Preserve last known data on disconnection and visibly mark its age; disable unsafe mutations. Do not replace a useful table with a full-screen spinner during each refresh.
78
+
79
+ On reconnect, fetch a current Host snapshot before enabling actions from cached data. `UsageValue` distinguishes provider-reported values, estimates, `Metering` and `Unknown`; absent evidence never renders as zero. Accompany local schedule times with their configured timezone.
80
+
81
+ `CommandFeedback` distinguishes request pending, Host accepted, action in progress, succeeded and rejected. For example accepted pause remains “Pausing” until the checkpoint is confirmed; accepted cleanup is not “Removed.” Persisted Host command identifiers handle duplicate submission. Errors explain what failed and how to recover, with diagnostic details collapsed.
82
+
83
+ UI language uses registered provider names on links, historical runs and instructions. Core copy says ticket, tracker, code host or PR as appropriate. Provider metadata/schema contributions own provider fields; optional Client enhancements cannot be required for a usable validated form. Unsupported required capabilities prevent activation with a reason, following [provider policy](providers.md#availability-and-deployment).
84
+
85
+ ## Component acceptance
86
+
87
+ Test components through operator-visible outcomes, not internal state variables. Include long issue titles, missing/renamed provider objects, empty/many runs, pagination, unknown usage, inaccessible PR, stale settings, in-flight command, disconnected Host and failed cleanup. Verify no click initiates model execution outside the Host policy.
88
+
89
+ - A fixture external provider supplies usable Settings without core UI changes; switching the supported provider pairs changes fields/labels but not run policy.
90
+ - Open Operations without selecting a Session; inspect queue and health.
91
+ - A pause command remains in progress until the Host confirms a checkpoint.
92
+ - Reconnect retrieves the latest completed run without replaying an old command.
93
+ - Human blockers have no Web authorization bypass; a completed PR with failed ntfy delivery shows both facts.
94
+ - Unknown usage/PR disposition is distinct from zero/closed; cleanup rejection identifies the blocking condition.
95
+
96
+ Capture integrated screenshots using [visual acceptance](web-ui.md#visual-acceptance). Component fixtures alone cannot prove slot mounting, theme compatibility or remote configuration.
@@ -0,0 +1,64 @@
1
+ # Web UI
2
+
3
+ ## Placement and data
4
+
5
+ Add `Autopilot` as a global DSH Web sidebar entry. The panel works without selecting a conversation. Settings are a separate DSH Settings contribution; link to them from Operations rather than building two configuration editors.
6
+
7
+ The default view is Queue & Runs, not a metrics dashboard. Use five local tabs: Queue & Runs, Schedule, Budget, Notifications, Worktrees. Keep provider and policy editing in DSH Settings. Do not add a second app-wide sidebar. [UI components](ui-components.md) owns the exact module/component responsibilities and query/command behavior.
8
+
9
+ The supported extension points and remote configuration restrictions are owned by [plugin engineering](plugin.md). Verify the selected access mode before claiming the Settings editor works through a VPS public URL. Its placement and its ability to persist settings are separate capabilities.
10
+
11
+ Data, command feedback and Settings behavior are defined in the [component specification](ui-components.md). This page owns navigation, visual rules, user journeys and visual acceptance.
12
+
13
+ ## Navigation and reading order
14
+
15
+ Navigate from a run to its evidence and external records without losing list position. Present human blockers, operational pauses and delivery failures distinctly. Use the [component catalog](ui-components.md) for table content, filters and commands.
16
+
17
+ ## Layout and visual direction
18
+
19
+ **Proposed visual specification:** a restrained operational tool integrated into DSH, with strong text hierarchy, aligned rows and generous space around decisions. The existing DSH theme and components are authoritative; numeric values below are fallback layout targets, not invented upstream token names. Validate against the actual shell before fixing CSS.
20
+
21
+ At wide desktop widths, selecting a run opens a nonmodal detail region beside the list and preserves list filters/scroll. Give the detail approximately 420–480 px only when the remaining list stays readable; otherwise use the full-width detail view with Back to runs. At narrow widths show ticket, state/reason and priority first; secondary columns move into details rather than squeezing unreadable cells. Use one overlay at a time; cleanup confirmation may replace an inspector overlay, not stack three dialogs.
22
+
23
+ ```text
24
+ DSH shell / existing navigation
25
+ ┌─────────────────────────────────────────────────────────────────┐
26
+ │ Autopilot · project/provider Running [Pause] ⋯ │
27
+ │ Conditional attention: one blocker / access issue → action │
28
+ │ Queue & Runs | Schedule | Budget | Notifications | Worktrees │
29
+ ├───────────────────────────────────────┬─────────────────────────┤
30
+ │ Search · state · priority · attention │ Ticket · state · links │
31
+ │ Ticket / state / phase / spend │ Required action or PR │
32
+ │ … run rows … │ Evidence / timeline │
33
+ │ Page controls │ Secondary details │
34
+ └───────────────────────────────────────┴─────────────────────────┘
35
+ ```
36
+
37
+ | Visual rule | Implementation requirement |
38
+ | --- | --- |
39
+ | Surfaces | Inherit DSH page/panel/input surfaces and borders. No decorative gradients, glass blur, neon glow, hero banner or nested card around every field. |
40
+ | Type | Inherit DSH font; use a compact hierarchy around 20 px page title, 14 px body/table and 12 px metadata where host tokens permit. Monospace only for paths, branch/commit ids and diagnostics; tabular numerals for aligned numbers. |
41
+ | Spacing | Use the host spacing scale; fallback 4/8/12/16/24 px. Aim for 16–24 px panel padding and 44–48 px readable rows. Avoid both giant empty cards and dense multi-line badge clusters. |
42
+ | Color | One inherited accent for active navigation/primary action. Neutral queued/paused/completed labels; accent implementing; amber human attention; red failure/destructive action. Pair every color with readable text and an icon where useful. A completed run with failed delivery shows both facts. |
43
+ | Controls | One primary action per region. Label consequential actions; icon-only controls need accessible names and tooltips. No ornamental emoji or duplicate buttons scattered across cards. |
44
+ | Motion | Subtle host-standard transitions only; honor reduced motion. No pulsing whole rows, animated counters or auto-scrolling timelines. |
45
+ | Data | No synthetic productivity scores, token-saving claims, trend charts without data or fake progress. Use compact text/table for counts, next schedule and spend; visual meters require a meaningful denominator. |
46
+
47
+ Use sample content long enough to reveal layout failures: long issue titles, multi-line blockers, large numbers, long branch names and non-English labels. Truncate only previews with an accessible full-value path; never hide the blocking reason, money qualification or destructive target. Dynamic updates must not reorder the row currently focused without a deliberate refresh path.
48
+
49
+ ## Primary interaction paths
50
+
51
+ 1. **First setup:** show what is missing and a Configure action; do not render a fake successful overview. Settings guides provider/project selection, mappings, execution/budget and notifications through section validation, not a mandatory new account/onboarding product. Valid setup does not silently enable spending; scheduler activation is explicit.
52
+ 2. **Normal operation:** enter Runs, identify current/waiting work, select a row, inspect evidence, open the external ticket/Session/PR. Closing detail restores list position.
53
+ 3. **Human blocker:** attention filter → selected run → questions and Open in the configured tracker. A reply alone does not clear the banner. Display observed authorization/eligibility only after Host confirmation.
54
+ 4. **Budget/schedule pause:** show the limiting condition and a link to its Settings section. Saving a limit is not proof of resumption; reflect queue/dispatch state from the Host.
55
+ 5. **Cleanup:** Worktrees → inspect exact target → preview with reasons → confirm → show actual result. A changed run/Git state invalidates the preview.
56
+ 6. **Provider change:** Settings explains dependent runs/intents and refuses an unsafe switch; do not offer a migration wizard or silently move history to another provider.
57
+
58
+ ## Visual acceptance
59
+
60
+ Before accepting Client implementation, collect screenshots within the real DSH shell at 1440×900, 1024×768 and 390×844, in light and dark themes. Include populated runs + selected details, human blocker, budget pause, failed delivery, cleanup preview/rejection, provider Settings and empty/disconnected states. These are review deliverables for implementation, not evidence already produced.
61
+
62
+ Check legibility and consistent alignment without page-level horizontal overflow; all important actions work with keyboard, visible focus and appropriate dialog focus return. Verify normal text contrast of at least 4.5:1 and meaningful non-text control contrast of 3:1, plus status comprehension without color. Test reduced motion, zoom/reflow, long localized copy and screen-reader names/live feedback. Review screenshots against the visual table above; reject the change if it introduces an unrelated design system or obscures operational decisions.
63
+
64
+ Functional scenarios belong to [component acceptance](ui-components.md#component-acceptance). Verify public DSH Web reuse against the pinned dependency and current upstream source.
@@ -0,0 +1,11 @@
1
+ import type { CancelledRun, RunId } from './model.js';
2
+ import type { AdmissionDependencies } from './ports.js';
3
+ export declare class CancellationControl {
4
+ private readonly dependencies;
5
+ constructor(dependencies: AdmissionDependencies);
6
+ /**
7
+ * Atomically end one quiescent queued, paused, or blocked run while retaining every durable identity and external
8
+ * intent. Cancellation performs no tracker, Session, Git, publication, or delivery effect and accepts no signal.
9
+ */
10
+ cancel(runId: RunId, requestId: string): Promise<CancelledRun>;
11
+ }
@@ -0,0 +1,72 @@
1
+ import { STATE_KEY } from './constants.js';
2
+ import { isPausedActiveRun, isPausedQueuedRun } from './policy.js';
3
+ import { operatorCommandSchema, runIdSchema, stateSchema } from './state.js';
4
+ export class CancellationControl {
5
+ dependencies;
6
+ constructor(dependencies) {
7
+ this.dependencies = dependencies;
8
+ }
9
+ /**
10
+ * Atomically end one quiescent queued, paused, or blocked run while retaining every durable identity and external
11
+ * intent. Cancellation performs no tracker, Session, Git, publication, or delivery effect and accepts no signal.
12
+ */
13
+ async cancel(runId, requestId) {
14
+ const parsedRunId = runIdSchema.parse(runId);
15
+ const parsedRequestId = operatorCommandSchema.shape.requestId.parse(requestId);
16
+ let cancelled;
17
+ await this.dependencies.table().update(STATE_KEY, (current) => {
18
+ const index = current.runs.findIndex((run) => run.runId === parsedRunId);
19
+ const run = current.runs[index];
20
+ if (run === undefined)
21
+ throw new Error(`run "${parsedRunId}" does not exist`);
22
+ if (run.state === 'cancelled') {
23
+ if (run.cancellation.requestId !== parsedRequestId) {
24
+ throw new Error(`run "${parsedRunId}" was already cancelled by another request`);
25
+ }
26
+ cancelled = structuredClone(run);
27
+ return current;
28
+ }
29
+ const nextRun = cancelRun(run, parsedRequestId);
30
+ cancelled = nextRun;
31
+ const next = structuredClone(current);
32
+ next.runs[index] = nextRun;
33
+ next.revision += 1;
34
+ return stateSchema.parse(next);
35
+ });
36
+ if (cancelled === undefined)
37
+ throw new Error(`run "${parsedRunId}" was not cancelled`);
38
+ return structuredClone(cancelled);
39
+ }
40
+ }
41
+ function cancelRun(run, requestId) {
42
+ const cancellationBase = { requestId, cancelledAt: new Date().toISOString() };
43
+ if (run.state === 'queued') {
44
+ return { ...structuredClone(run), state: 'cancelled', cancellation: { ...cancellationBase, from: 'queued' } };
45
+ }
46
+ if (isPausedQueuedRun(run)) {
47
+ return {
48
+ ...structuredClone(run),
49
+ state: 'cancelled',
50
+ cancellation: { ...cancellationBase, from: 'paused-queued' },
51
+ };
52
+ }
53
+ if (isPausedActiveRun(run)) {
54
+ return {
55
+ ...structuredClone(run),
56
+ state: 'cancelled',
57
+ cancellation: { ...cancellationBase, from: 'paused-active' },
58
+ };
59
+ }
60
+ if (run.state === 'blocked') {
61
+ if (run.outcome.kind !== 'blocked')
62
+ throw new Error(`run "${run.runId}" has an invalid blocked outcome`);
63
+ return {
64
+ ...structuredClone(run),
65
+ outcome: run.outcome,
66
+ state: 'cancelled',
67
+ cancellation: { ...cancellationBase, from: 'blocked' },
68
+ };
69
+ }
70
+ throw new Error(`run "${run.runId}" cannot be cancelled from ${run.state}`);
71
+ }
72
+ //# sourceMappingURL=cancellation-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancellation-control.js","sourceRoot":"","sources":["../../src/admission/cancellation-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAElE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE5E,MAAM,OAAO,mBAAmB;IACD,YAAY;IAAzC,YAA6B,YAAmC;4BAAnC,YAAY;IAA0B,CAAC;IAEpE;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,SAAiB;QAC1C,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5C,MAAM,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC9E,IAAI,SAAmC,CAAA;QACvC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,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readEveryCandidate(reader: TrackerReader, providerId: TrackerProviderId, signal?: AbortSignal): Promise<TrackerIssueSnapshot[]>;
@@ -0,0 +1,23 @@
1
+ import { TrackerProviderError } from '../tracker.js';
2
+ import { MAX_CANDIDATE_BYTES, MAX_CANDIDATES, textEncoder } from './constants.js';
3
+ export async function readEveryCandidate(reader, providerId, signal) {
4
+ const issues = [];
5
+ const seenCursors = new Set();
6
+ let totalCandidateBytes = 0;
7
+ let cursor;
8
+ do {
9
+ signal?.throwIfAborted();
10
+ const page = await reader.readCandidates(cursor, signal);
11
+ totalCandidateBytes += textEncoder.encode(JSON.stringify(page)).byteLength;
12
+ if (issues.length + page.issues.length > MAX_CANDIDATES || totalCandidateBytes > MAX_CANDIDATE_BYTES) {
13
+ throw new TrackerProviderError('invalid-response', `tracker provider "${providerId}" exceeded admission bounds`);
14
+ }
15
+ issues.push(...page.issues);
16
+ cursor = page.nextCursor;
17
+ if (cursor !== undefined && (!seenCursors.add(cursor) || seenCursors.size > 1000)) {
18
+ throw new TrackerProviderError('invalid-response', `tracker provider "${providerId}" returned a non-terminating cursor sequence`);
19
+ }
20
+ } while (cursor !== undefined);
21
+ return issues;
22
+ }
23
+ //# sourceMappingURL=candidates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"candidates.js","sourceRoot":"","sources":["../../src/admission/candidates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAqB,EACrB,UAA6B,EAC7B,MAAoB;IAEpB,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAA;IACrC,IAAI,mBAAmB,GAAG,CAAC,CAAA;IAC3B,IAAI,MAA0B,CAAA;IAC9B,GAAG,CAAC;QACF,MAAM,EAAE,cAAc,EAAE,CAAA;QACxB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACxD,mBAAmB,IAAI,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAA;QAC1E,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,cAAc,IAAI,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;YACrG,MAAM,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,qBAAqB,UAAU,6BAA6B,CAAC,CAAA;QAClH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3B,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;QACxB,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YAClF,MAAM,IAAI,oBAAoB,CAC5B,kBAAkB,EAClB,qBAAqB,UAAU,8CAA8C,CAC9E,CAAA;QACH,CAAC;IACH,CAAC,QAAQ,MAAM,KAAK,SAAS,EAAC;IAC9B,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { AgentExecutionComposition } from './model.js';
2
+ declare const preparedCompositionBrand: unique symbol;
3
+ /** One-shot proof that Dispatch resolved this composition through the live DSH services. */
4
+ export interface PreparedAgentComposition {
5
+ readonly [preparedCompositionBrand]: true;
6
+ readonly composition: AgentExecutionComposition;
7
+ }
8
+ export declare function issuePreparedAgentComposition(composition: AgentExecutionComposition): PreparedAgentComposition;
9
+ export declare function consumePreparedAgentComposition(claim: PreparedAgentComposition): AgentExecutionComposition;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ const liveClaims = new WeakSet();
2
+ export function issuePreparedAgentComposition(composition) {
3
+ const claim = { composition: structuredClone(composition) };
4
+ liveClaims.add(claim);
5
+ return claim;
6
+ }
7
+ export function consumePreparedAgentComposition(claim) {
8
+ if (!liveClaims.delete(claim)) {
9
+ throw new Error('agent composition was not prepared by the live DSH composition authority');
10
+ }
11
+ return structuredClone(claim.composition);
12
+ }
13
+ //# sourceMappingURL=composition-claim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition-claim.js","sourceRoot":"","sources":["../../src/admission/composition-claim.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,GAAG,IAAI,OAAO,EAAU,CAAA;AAExC,MAAM,UAAU,6BAA6B,CAAC,WAAsC;IAClF,MAAM,KAAK,GAAG,EAAE,WAAW,EAAE,eAAe,CAAC,WAAW,CAAC,EAA8B,CAAA;IACvF,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACrB,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,KAA+B;IAC7E,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAA;IAC7F,CAAC;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const MAX_INGRESS_RECEIPTS = 2048;
2
+ export declare const MAX_OPERATOR_COMMANDS = 64;
3
+ export declare const MAX_STATE_BYTES: number;
4
+ export declare const MAX_SUMMARY_BYTES = 2048;
5
+ export declare const MAX_BRIEF_BYTES: number;
6
+ export declare const MAX_CANDIDATES = 1000;
7
+ export declare const MAX_CANDIDATE_BYTES: number;
8
+ export declare const MAX_OUTCOME_TEXT_BYTES: number;
9
+ export declare const MAX_AUTOMATIC_EXTERNAL_ATTEMPTS = 5;
10
+ export declare const STATE_KEY: 'primary';
11
+ export declare const ID_PATTERN: RegExp;
12
+ export declare const textEncoder: TextEncoder;
@@ -0,0 +1,13 @@
1
+ export const MAX_INGRESS_RECEIPTS = 2048;
2
+ export const MAX_OPERATOR_COMMANDS = 64;
3
+ export const MAX_STATE_BYTES = 4 * 1024 * 1024;
4
+ export const MAX_SUMMARY_BYTES = 2048;
5
+ export const MAX_BRIEF_BYTES = 32 * 1024;
6
+ export const MAX_CANDIDATES = 1000;
7
+ export const MAX_CANDIDATE_BYTES = 16 * 1024 * 1024;
8
+ export const MAX_OUTCOME_TEXT_BYTES = 4 * 1024;
9
+ export const MAX_AUTOMATIC_EXTERNAL_ATTEMPTS = 5;
10
+ export const STATE_KEY = 'primary';
11
+ export const ID_PATTERN = /^[a-z0-9][a-z0-9._:-]*$/;
12
+ export const textEncoder = new TextEncoder();
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/admission/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAA;AACxC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AACnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,CAAA;AAC9C,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAA;AAChD,MAAM,CAAC,MAAM,SAAS,GAAG,SAAkB,CAAA;AAC3C,MAAM,CAAC,MAAM,UAAU,GAAG,yBAAyB,CAAA;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { AutopilotSettings } from '../config.js';
2
+ import { type NotificationEvent } from '../notification.js';
3
+ import type { AutopilotRun, DeliveryRecord, PublicationIntent, TerminalRun } from './model.js';
4
+ export declare function appendLifecycleDeliveries(run: AutopilotRun, settings: AutopilotSettings, type: NotificationEvent['type'], runRevision: number, timestamp: string): DeliveryRecord[];
5
+ export declare function publicationIntent(run: TerminalRun): PublicationIntent;
6
+ export declare function sanitizeDeliveryError(error: unknown): string;
@@ -0,0 +1,175 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { notificationDestinationId, notificationProviderId } from '../notification.js';
3
+ import { MAX_OUTCOME_TEXT_BYTES } from './constants.js';
4
+ import { truncateUtf8 } from './policy.js';
5
+ export function appendLifecycleDeliveries(run, settings, type, runRevision, timestamp) {
6
+ const eventId = stableId('event', run.runId, type, String(runRevision));
7
+ const event = lifecycleEvent(run, type, eventId, timestamp);
8
+ const deliveries = structuredClone(run.deliveries).map((delivery) => {
9
+ if (delivery.kind !== 'tracker-projection' || ['succeeded', 'retired'].includes(delivery.status))
10
+ return delivery;
11
+ const { exhaustedFrom: _exhaustedFrom, nextRetryAt: _nextRetryAt, owner: _owner, ...withoutOwner } = delivery;
12
+ return { ...withoutOwner, status: 'retired' };
13
+ });
14
+ const report = trackerDelivery(run, event, runRevision, 'report');
15
+ const projection = trackerDelivery(run, event, runRevision, 'projection');
16
+ deliveries.push(recordForTracker(run, eventId, report), recordForTracker(run, eventId, projection));
17
+ for (const subscription of settings.notificationSubscriptions) {
18
+ if (!subscription.events.includes(type))
19
+ continue;
20
+ const providerId = notificationProviderId(subscription.providerId);
21
+ const destinationId = notificationDestinationId(subscription.destinationId);
22
+ deliveries.push({
23
+ ...recordBase(stableId('delivery', eventId, providerId, destinationId), eventId),
24
+ kind: 'notification',
25
+ providerId,
26
+ destinationId,
27
+ payload: {
28
+ ...event,
29
+ summary: subscription.summaryDisclosure === 'full'
30
+ ? event.summary
31
+ : `${run.displayKey} ${type}; open the validated run link for details.`,
32
+ runUrl: renderUrl(settings.runUrlTemplate, '{runId}', run.runId),
33
+ issueUrl: renderUrl(settings.issueUrlTemplate, '{displayKey}', run.displayKey),
34
+ },
35
+ });
36
+ }
37
+ return deliveries;
38
+ }
39
+ export function publicationIntent(run) {
40
+ if (run.state !== 'publishing' || run.outcome.kind !== 'verified' || run.execution.git === undefined) {
41
+ throw new Error('publication intent requires a verified publishing run with exact Git facts');
42
+ }
43
+ const marker = `<!-- dsh-autopilot:run:${run.runId} -->`;
44
+ return {
45
+ id: `publication:${run.runId}`,
46
+ revision: 1,
47
+ providerId: run.execution.codeHost.providerId,
48
+ bindingId: run.execution.codeHost.bindingId,
49
+ repositoryId: run.execution.codeHost.repositoryId,
50
+ repository: run.execution.codeHost.repository,
51
+ baseBranch: run.execution.baseBranch,
52
+ headBranch: run.execution.branch,
53
+ baseHead: run.execution.git.baseHead,
54
+ localHead: run.execution.git.head,
55
+ marker,
56
+ title: run.outcome.suggestedPullRequest.title,
57
+ body: pullRequestBody(run, marker),
58
+ status: 'pending',
59
+ attempts: 0,
60
+ };
61
+ }
62
+ function lifecycleEvent(run, type, eventId, timestamp) {
63
+ const outcome = 'outcome' in run ? run.outcome : undefined;
64
+ const pullRequestUrl = 'publication' in run ? run.publication?.receipt?.url : undefined;
65
+ const tokens = 'budget' in run && !run.budget.usageUncertain ? run.budget.settledTokens : undefined;
66
+ return {
67
+ version: 1,
68
+ eventId,
69
+ runId: run.runId,
70
+ timestamp,
71
+ type,
72
+ issueIdentity: `${run.providerId}:${run.bindingId}:${run.issueId}`,
73
+ displayKey: run.displayKey,
74
+ summary: outcome?.summary ?? `${run.displayKey} ${type}`,
75
+ ...(type === 'blocked'
76
+ ? { actionNeeded: 'Resolve the reported blocker and apply a new attributable human readiness transition.' }
77
+ : {}),
78
+ ...(pullRequestUrl === undefined ? {} : { pullRequestUrl }),
79
+ usage: tokens === undefined
80
+ ? { kind: 'unknown' }
81
+ : {
82
+ kind: 'provider',
83
+ tokens,
84
+ },
85
+ };
86
+ }
87
+ function trackerDelivery(run, event, runRevision, kind) {
88
+ const deliveryId = stableId('tracker', event.eventId, kind);
89
+ if (kind === 'projection') {
90
+ return {
91
+ kind,
92
+ deliveryId,
93
+ eventId: event.eventId,
94
+ bindingId: run.bindingId,
95
+ issueId: run.issueId,
96
+ displayKey: run.displayKey,
97
+ readinessGeneration: run.readinessGeneration,
98
+ runRevision,
99
+ desiredState: event.type === 'started' ? 'implementing' : event.type,
100
+ };
101
+ }
102
+ return {
103
+ kind,
104
+ deliveryId,
105
+ eventId: event.eventId,
106
+ bindingId: run.bindingId,
107
+ issueId: run.issueId,
108
+ displayKey: run.displayKey,
109
+ body: trackerReport(run, event),
110
+ };
111
+ }
112
+ function trackerReport(run, event) {
113
+ const lines = [
114
+ `Generated by dsh-autopilot (AI-assisted execution).`,
115
+ `<!-- dsh-autopilot:event:${event.eventId} -->`,
116
+ '',
117
+ `Run ${run.runId} ${event.type}: ${event.summary}`,
118
+ ];
119
+ if ('outcome' in run) {
120
+ lines.push('', 'Evidence:', ...run.outcome.evidence.map((entry) => `- ${entry}`));
121
+ }
122
+ if (event.pullRequestUrl !== undefined)
123
+ lines.push('', `Pull request: ${event.pullRequestUrl}`);
124
+ if (event.actionNeeded !== undefined)
125
+ lines.push('', `Action needed: ${event.actionNeeded}`);
126
+ return truncateUtf8(lines.join('\n'), 32 * 1024);
127
+ }
128
+ function renderUrl(template, placeholder, value) {
129
+ const url = new URL(template.replace(placeholder, encodeURIComponent(value)));
130
+ if (url.protocol !== 'https:' || url.username !== '' || url.password !== '') {
131
+ throw new TypeError('notification links require validated HTTPS templates without credentials');
132
+ }
133
+ return url.href;
134
+ }
135
+ function pullRequestBody(run, marker) {
136
+ if (run.outcome.kind !== 'verified')
137
+ throw new Error('pull-request body requires a verified outcome');
138
+ const checks = run.outcome.verification.map(formatVerification);
139
+ const suffix = [
140
+ '',
141
+ '---',
142
+ `Tracker: ${run.displayKey}`,
143
+ `Autopilot run: ${run.runId}`,
144
+ '',
145
+ 'Verification:',
146
+ ...checks,
147
+ '',
148
+ marker,
149
+ ].join('\n');
150
+ const maximumSuggestionBytes = 32 * 1024 - Buffer.byteLength(suffix);
151
+ if (maximumSuggestionBytes < 1)
152
+ throw new RangeError('publication metadata exceeds its durable bound');
153
+ return `${truncateUtf8(run.outcome.suggestedPullRequest.body, maximumSuggestionBytes)}${suffix}`;
154
+ }
155
+ function formatVerification(result) {
156
+ const reason = result.reason === undefined ? '' : ` (${result.reason})`;
157
+ return `- ${result.status}: \`${result.command.replaceAll('`', "'")}\` — ${result.summary}${reason}`;
158
+ }
159
+ function recordForTracker(run, eventId, payload) {
160
+ const base = recordBase(stableId('delivery', payload.deliveryId), eventId);
161
+ return payload.kind === 'report'
162
+ ? { ...base, kind: 'tracker-report', providerId: run.providerId, payload }
163
+ : { ...base, kind: 'tracker-projection', providerId: run.providerId, payload };
164
+ }
165
+ function recordBase(id, eventId) {
166
+ return { id, eventId, revision: 1, status: 'pending', attempts: 0 };
167
+ }
168
+ function stableId(prefix, ...parts) {
169
+ return `${prefix}:${createHash('sha256').update(parts.join('\0')).digest('hex').slice(0, 40)}`;
170
+ }
171
+ export function sanitizeDeliveryError(error) {
172
+ const value = error instanceof Error ? error.message : String(error);
173
+ return (truncateUtf8(value.replaceAll(/https?:\/\/[^\s]+/g, '[redacted-url]'), MAX_OUTCOME_TEXT_BYTES) || 'delivery failed');
174
+ }
175
+ //# sourceMappingURL=deliveries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliveries.js","sourceRoot":"","sources":["../../src/admission/deliveries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAA0B,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE9G,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAA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CAAC,EAAE,sBAAsB,CAAC,IAAI,iBAAiB,CACpH,CAAA;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { NotificationReceipt } from '../notification.js';
2
+ import type { TrackerOutboundReceipt } from '../tracker.js';
3
+ import type { DeliveryRecord, RunId } from './model.js';
4
+ import type { AdmissionDependencies } from './ports.js';
5
+ export declare class DeliveryControl {
6
+ private readonly dependencies;
7
+ constructor(dependencies: AdmissionDependencies);
8
+ claim(deliveryId: string): Promise<{
9
+ runId: RunId;
10
+ delivery: DeliveryRecord;
11
+ owner: string;
12
+ }>;
13
+ assertOwner(runId: RunId, deliveryId: string, owner: string): void;
14
+ succeed(runId: RunId, deliveryId: string, owner: string, receipt: TrackerOutboundReceipt | NotificationReceipt): Promise<DeliveryRecord>;
15
+ fail(runId: RunId, deliveryId: string, owner: string, error: unknown, status: 'uncertain' | 'retryable-failure' | 'permanent-failure', retryAfterMs?: number): Promise<DeliveryRecord>;
16
+ retry(deliveryId: string): Promise<DeliveryRecord>;
17
+ /** Retire one failed mutable projection and atomically persist a revisioned replacement for current lifecycle state. */
18
+ repairProjection(deliveryId: string): Promise<DeliveryRecord>;
19
+ private updateOwned;
20
+ }
21
+ export declare class SupersededProjectionError extends Error {
22
+ readonly delivery: Extract<DeliveryRecord, {
23
+ kind: 'tracker-projection';
24
+ }>;
25
+ constructor(delivery: Extract<DeliveryRecord, {
26
+ kind: 'tracker-projection';
27
+ }>);
28
+ }