clinkx 0.3.0 → 1.1.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 (669) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/LICENSE +10 -0
  3. package/README.md +154 -26
  4. package/clinkx-workflows/dist/allowed-roots.d.ts +1 -0
  5. package/clinkx-workflows/dist/allowed-roots.js +5 -0
  6. package/clinkx-workflows/dist/allowed-roots.js.map +1 -0
  7. package/clinkx-workflows/dist/artifacts.d.ts +20 -1
  8. package/clinkx-workflows/dist/artifacts.js +38 -9
  9. package/clinkx-workflows/dist/artifacts.js.map +1 -1
  10. package/clinkx-workflows/dist/backend.d.ts +4 -0
  11. package/clinkx-workflows/dist/chairman-knobs.d.ts +24 -0
  12. package/clinkx-workflows/dist/chairman-knobs.js +27 -0
  13. package/clinkx-workflows/dist/chairman-knobs.js.map +1 -0
  14. package/clinkx-workflows/dist/citation-check.d.ts +40 -0
  15. package/clinkx-workflows/dist/citation-check.js +348 -0
  16. package/clinkx-workflows/dist/citation-check.js.map +1 -0
  17. package/clinkx-workflows/dist/clink-client.d.ts +12 -1
  18. package/clinkx-workflows/dist/clink-client.js +56 -5
  19. package/clinkx-workflows/dist/clink-client.js.map +1 -1
  20. package/clinkx-workflows/dist/config.d.ts +173 -16
  21. package/clinkx-workflows/dist/config.js +417 -26
  22. package/clinkx-workflows/dist/config.js.map +1 -1
  23. package/clinkx-workflows/dist/contained-file.d.ts +172 -0
  24. package/clinkx-workflows/dist/contained-file.js +483 -0
  25. package/clinkx-workflows/dist/contained-file.js.map +1 -0
  26. package/clinkx-workflows/dist/context-builder-lifecycle-contract.d.ts +416 -0
  27. package/clinkx-workflows/dist/context-builder-lifecycle-contract.js +328 -0
  28. package/clinkx-workflows/dist/context-builder-lifecycle-contract.js.map +1 -0
  29. package/clinkx-workflows/dist/context-builder-lifecycle-router.d.ts +24 -0
  30. package/clinkx-workflows/dist/context-builder-lifecycle-router.js +39 -0
  31. package/clinkx-workflows/dist/context-builder-lifecycle-router.js.map +1 -0
  32. package/clinkx-workflows/dist/context-cache-key.d.ts +53 -0
  33. package/clinkx-workflows/dist/context-cache-key.js +91 -0
  34. package/clinkx-workflows/dist/context-cache-key.js.map +1 -0
  35. package/clinkx-workflows/dist/context-mode-resolver.d.ts +27 -0
  36. package/clinkx-workflows/dist/context-mode-resolver.js +126 -0
  37. package/clinkx-workflows/dist/context-mode-resolver.js.map +1 -0
  38. package/clinkx-workflows/dist/context-preflight.d.ts +189 -0
  39. package/clinkx-workflows/dist/context-preflight.js +91 -0
  40. package/clinkx-workflows/dist/context-preflight.js.map +1 -0
  41. package/clinkx-workflows/dist/council-execution-policy.d.ts +68 -0
  42. package/clinkx-workflows/dist/council-execution-policy.js +110 -0
  43. package/clinkx-workflows/dist/council-execution-policy.js.map +1 -0
  44. package/clinkx-workflows/dist/council-expander.d.ts +10 -9
  45. package/clinkx-workflows/dist/council-expander.js +20 -10
  46. package/clinkx-workflows/dist/council-expander.js.map +1 -1
  47. package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +5718 -0
  48. package/clinkx-workflows/dist/dashboard/activity-contract.js +157 -0
  49. package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -0
  50. package/clinkx-workflows/dist/dashboard/activity-lease.d.ts +25 -0
  51. package/clinkx-workflows/dist/dashboard/activity-lease.js +34 -0
  52. package/clinkx-workflows/dist/dashboard/activity-lease.js.map +1 -0
  53. package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +90 -0
  54. package/clinkx-workflows/dist/dashboard/activity-reader.js +493 -0
  55. package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
  56. package/clinkx-workflows/dist/dashboard/api-routes.d.ts +40 -0
  57. package/clinkx-workflows/dist/dashboard/api-routes.js +1155 -0
  58. package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -0
  59. package/clinkx-workflows/dist/dashboard/artifact-index.d.ts +37 -0
  60. package/clinkx-workflows/dist/dashboard/artifact-index.js +145 -0
  61. package/clinkx-workflows/dist/dashboard/artifact-index.js.map +1 -0
  62. package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +31 -0
  63. package/clinkx-workflows/dist/dashboard/auth/challenge-store.js +65 -0
  64. package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -0
  65. package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +26 -0
  66. package/clinkx-workflows/dist/dashboard/auth/controller.js +596 -0
  67. package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -0
  68. package/clinkx-workflows/dist/dashboard/auth/credential-store.d.ts +60 -0
  69. package/clinkx-workflows/dist/dashboard/auth/credential-store.js +776 -0
  70. package/clinkx-workflows/dist/dashboard/auth/credential-store.js.map +1 -0
  71. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.d.ts +9 -0
  72. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js +44 -0
  73. package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js.map +1 -0
  74. package/clinkx-workflows/dist/dashboard/auth/session-store.d.ts +17 -0
  75. package/clinkx-workflows/dist/dashboard/auth/session-store.js +77 -0
  76. package/clinkx-workflows/dist/dashboard/auth/session-store.js.map +1 -0
  77. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.d.ts +25 -0
  78. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js +71 -0
  79. package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js.map +1 -0
  80. package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.d.ts +3865 -0
  81. package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js +69 -0
  82. package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js.map +1 -0
  83. package/clinkx-workflows/dist/dashboard/context-run-liveness.d.ts +37 -0
  84. package/clinkx-workflows/dist/dashboard/context-run-liveness.js +49 -0
  85. package/clinkx-workflows/dist/dashboard/context-run-liveness.js.map +1 -0
  86. package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +256 -0
  87. package/clinkx-workflows/dist/dashboard/context-run-reader.js +1301 -0
  88. package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
  89. package/clinkx-workflows/dist/dashboard/contracts.d.ts +28483 -0
  90. package/clinkx-workflows/dist/dashboard/contracts.js +1284 -0
  91. package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -0
  92. package/clinkx-workflows/dist/dashboard/generation.d.ts +14 -0
  93. package/clinkx-workflows/dist/dashboard/generation.js +41 -0
  94. package/clinkx-workflows/dist/dashboard/generation.js.map +1 -0
  95. package/clinkx-workflows/dist/dashboard/index.d.ts +32 -0
  96. package/clinkx-workflows/dist/dashboard/index.js +20 -0
  97. package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
  98. package/clinkx-workflows/dist/dashboard/invocation-contract.d.ts +786 -0
  99. package/clinkx-workflows/dist/dashboard/invocation-contract.js +201 -0
  100. package/clinkx-workflows/dist/dashboard/invocation-contract.js.map +1 -0
  101. package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +114 -0
  102. package/clinkx-workflows/dist/dashboard/lazy-content.js +799 -0
  103. package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
  104. package/clinkx-workflows/dist/dashboard/native-transcript/contract.d.ts +90 -0
  105. package/clinkx-workflows/dist/dashboard/native-transcript/contract.js +31 -0
  106. package/clinkx-workflows/dist/dashboard/native-transcript/contract.js.map +1 -0
  107. package/clinkx-workflows/dist/dashboard/native-transcript/projection.d.ts +12 -0
  108. package/clinkx-workflows/dist/dashboard/native-transcript/projection.js +286 -0
  109. package/clinkx-workflows/dist/dashboard/native-transcript/projection.js.map +1 -0
  110. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +446 -0
  111. package/clinkx-workflows/dist/dashboard/progress-report-contract.js +221 -0
  112. package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -0
  113. package/clinkx-workflows/dist/dashboard/progress-report-reader.d.ts +50 -0
  114. package/clinkx-workflows/dist/dashboard/progress-report-reader.js +529 -0
  115. package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -0
  116. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +89 -0
  117. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js +71 -0
  118. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js.map +1 -0
  119. package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +29 -0
  120. package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +111 -0
  121. package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
  122. package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.d.ts +194 -0
  123. package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js +89 -0
  124. package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js.map +1 -0
  125. package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.d.ts +26 -0
  126. package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js +102 -0
  127. package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js.map +1 -0
  128. package/clinkx-workflows/dist/dashboard/read-model.d.ts +86 -0
  129. package/clinkx-workflows/dist/dashboard/read-model.js +440 -0
  130. package/clinkx-workflows/dist/dashboard/read-model.js.map +1 -0
  131. package/clinkx-workflows/dist/dashboard/request-admission.d.ts +31 -0
  132. package/clinkx-workflows/dist/dashboard/request-admission.js +130 -0
  133. package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
  134. package/clinkx-workflows/dist/dashboard/scanner.d.ts +78 -0
  135. package/clinkx-workflows/dist/dashboard/scanner.js +1154 -0
  136. package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
  137. package/clinkx-workflows/dist/dashboard/server-factory.d.ts +63 -0
  138. package/clinkx-workflows/dist/dashboard/server-factory.js +483 -0
  139. package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
  140. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2778 -0
  141. package/clinkx-workflows/dist/dashboard/session-log-contract.js +506 -0
  142. package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -0
  143. package/clinkx-workflows/dist/dashboard/session-log-identity.d.ts +21 -0
  144. package/clinkx-workflows/dist/dashboard/session-log-identity.js +101 -0
  145. package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -0
  146. package/clinkx-workflows/dist/dashboard/session-log-journal.d.ts +43 -0
  147. package/clinkx-workflows/dist/dashboard/session-log-journal.js +529 -0
  148. package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -0
  149. package/clinkx-workflows/dist/dashboard/session-log-reader.d.ts +61 -0
  150. package/clinkx-workflows/dist/dashboard/session-log-reader.js +378 -0
  151. package/clinkx-workflows/dist/dashboard/session-log-reader.js.map +1 -0
  152. package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +14 -0
  153. package/clinkx-workflows/dist/dashboard/session-log-redaction.js +1101 -0
  154. package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -0
  155. package/clinkx-workflows/dist/dashboard/session-log-retention.d.ts +23 -0
  156. package/clinkx-workflows/dist/dashboard/session-log-retention.js +212 -0
  157. package/clinkx-workflows/dist/dashboard/session-log-retention.js.map +1 -0
  158. package/clinkx-workflows/dist/dashboard/static-responses.d.ts +10 -0
  159. package/clinkx-workflows/dist/dashboard/static-responses.js +94 -0
  160. package/clinkx-workflows/dist/dashboard/static-responses.js.map +1 -0
  161. package/clinkx-workflows/dist/dashboard/worker-lock-observer.d.ts +28 -0
  162. package/clinkx-workflows/dist/dashboard/worker-lock-observer.js +241 -0
  163. package/clinkx-workflows/dist/dashboard/worker-lock-observer.js.map +1 -0
  164. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  165. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  166. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  167. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  168. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  169. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  170. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  171. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  172. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  173. package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  174. package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +106 -0
  175. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  176. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  177. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  178. package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
  179. package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +1 -0
  180. package/clinkx-workflows/dist/dashboard-ui/contracts/council-plan-review-input-v1.json +158 -0
  181. package/clinkx-workflows/dist/dashboard-ui/index.html +15 -0
  182. package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Mono-OFL.txt +93 -0
  183. package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Sans-OFL.txt +93 -0
  184. package/clinkx-workflows/dist/dashboard-ui/licenses/JetBrains-Mono-OFL.txt +93 -0
  185. package/clinkx-workflows/dist/dashboard-ui/licenses/NOTICE.md +32 -0
  186. package/clinkx-workflows/dist/dashboard-ui/theme-init.js +8 -0
  187. package/clinkx-workflows/dist/definition-normalizer.d.ts +19 -0
  188. package/clinkx-workflows/dist/definition-normalizer.js.map +1 -1
  189. package/clinkx-workflows/dist/delegate-finalizer-policy.d.ts +26 -0
  190. package/clinkx-workflows/dist/delegate-finalizer-policy.js +72 -0
  191. package/clinkx-workflows/dist/delegate-finalizer-policy.js.map +1 -0
  192. package/clinkx-workflows/dist/delegate-signature.d.ts +14 -0
  193. package/clinkx-workflows/dist/delegate-signature.js +14 -0
  194. package/clinkx-workflows/dist/delegate-signature.js.map +1 -0
  195. package/clinkx-workflows/dist/delegate-validate.d.ts +108 -0
  196. package/clinkx-workflows/dist/delegate-validate.js +148 -0
  197. package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
  198. package/clinkx-workflows/dist/engine.d.ts +251 -0
  199. package/clinkx-workflows/dist/engine.js +1342 -92
  200. package/clinkx-workflows/dist/engine.js.map +1 -1
  201. package/clinkx-workflows/dist/errors.d.ts +24 -2
  202. package/clinkx-workflows/dist/errors.js +30 -2
  203. package/clinkx-workflows/dist/errors.js.map +1 -1
  204. package/clinkx-workflows/dist/fidelity.d.ts +47 -1
  205. package/clinkx-workflows/dist/fidelity.js +54 -1
  206. package/clinkx-workflows/dist/fidelity.js.map +1 -1
  207. package/clinkx-workflows/dist/fingerprint.d.ts +25 -7
  208. package/clinkx-workflows/dist/fingerprint.js +33 -10
  209. package/clinkx-workflows/dist/fingerprint.js.map +1 -1
  210. package/clinkx-workflows/dist/index.d.ts +19 -0
  211. package/clinkx-workflows/dist/index.js +68 -1
  212. package/clinkx-workflows/dist/index.js.map +1 -1
  213. package/clinkx-workflows/dist/loader.d.ts +9 -3
  214. package/clinkx-workflows/dist/loader.js +92 -21
  215. package/clinkx-workflows/dist/loader.js.map +1 -1
  216. package/clinkx-workflows/dist/logger.d.ts +1 -1
  217. package/clinkx-workflows/dist/logger.js +17 -3
  218. package/clinkx-workflows/dist/logger.js.map +1 -1
  219. package/clinkx-workflows/dist/monotonic-clock.d.ts +19 -0
  220. package/clinkx-workflows/dist/monotonic-clock.js +22 -0
  221. package/clinkx-workflows/dist/monotonic-clock.js.map +1 -0
  222. package/clinkx-workflows/dist/plan-review/admission.d.ts +160 -0
  223. package/clinkx-workflows/dist/plan-review/admission.js +290 -0
  224. package/clinkx-workflows/dist/plan-review/admission.js.map +1 -0
  225. package/clinkx-workflows/dist/plan-review/context-policy.d.ts +55 -0
  226. package/clinkx-workflows/dist/plan-review/context-policy.js +146 -0
  227. package/clinkx-workflows/dist/plan-review/context-policy.js.map +1 -0
  228. package/clinkx-workflows/dist/plan-review/contract.d.ts +763 -0
  229. package/clinkx-workflows/dist/plan-review/contract.js +289 -0
  230. package/clinkx-workflows/dist/plan-review/contract.js.map +1 -0
  231. package/clinkx-workflows/dist/plan-review/digest.d.ts +68 -0
  232. package/clinkx-workflows/dist/plan-review/digest.js +241 -0
  233. package/clinkx-workflows/dist/plan-review/digest.js.map +1 -0
  234. package/clinkx-workflows/dist/plan-review/discovery.d.ts +45 -0
  235. package/clinkx-workflows/dist/plan-review/discovery.js +36 -0
  236. package/clinkx-workflows/dist/plan-review/discovery.js.map +1 -0
  237. package/clinkx-workflows/dist/plan-review/execution-contract.d.ts +298 -0
  238. package/clinkx-workflows/dist/plan-review/execution-contract.js +194 -0
  239. package/clinkx-workflows/dist/plan-review/execution-contract.js.map +1 -0
  240. package/clinkx-workflows/dist/plan-review/expander.d.ts +48 -0
  241. package/clinkx-workflows/dist/plan-review/expander.js +243 -0
  242. package/clinkx-workflows/dist/plan-review/expander.js.map +1 -0
  243. package/clinkx-workflows/dist/plan-review/projector.d.ts +126 -0
  244. package/clinkx-workflows/dist/plan-review/projector.js +437 -0
  245. package/clinkx-workflows/dist/plan-review/projector.js.map +1 -0
  246. package/clinkx-workflows/dist/plan-review/publication.d.ts +95 -0
  247. package/clinkx-workflows/dist/plan-review/publication.js +182 -0
  248. package/clinkx-workflows/dist/plan-review/publication.js.map +1 -0
  249. package/clinkx-workflows/dist/plan-review/ranking-reducer.d.ts +34 -0
  250. package/clinkx-workflows/dist/plan-review/ranking-reducer.js +139 -0
  251. package/clinkx-workflows/dist/plan-review/ranking-reducer.js.map +1 -0
  252. package/clinkx-workflows/dist/plan-review/resume.d.ts +38 -0
  253. package/clinkx-workflows/dist/plan-review/resume.js +122 -0
  254. package/clinkx-workflows/dist/plan-review/resume.js.map +1 -0
  255. package/clinkx-workflows/dist/plan-review/rubric.d.ts +7 -0
  256. package/clinkx-workflows/dist/plan-review/rubric.js +24 -0
  257. package/clinkx-workflows/dist/plan-review/rubric.js.map +1 -0
  258. package/clinkx-workflows/dist/plan-review/run-state.d.ts +398 -0
  259. package/clinkx-workflows/dist/plan-review/run-state.js +183 -0
  260. package/clinkx-workflows/dist/plan-review/run-state.js.map +1 -0
  261. package/clinkx-workflows/dist/plan-review/runtime-policy.d.ts +74 -0
  262. package/clinkx-workflows/dist/plan-review/runtime-policy.js +186 -0
  263. package/clinkx-workflows/dist/plan-review/runtime-policy.js.map +1 -0
  264. package/clinkx-workflows/dist/plan-review/snapshot.d.ts +81 -0
  265. package/clinkx-workflows/dist/plan-review/snapshot.js +170 -0
  266. package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -0
  267. package/clinkx-workflows/dist/plan-review/stage-error.d.ts +19 -0
  268. package/clinkx-workflows/dist/plan-review/stage-error.js +20 -0
  269. package/clinkx-workflows/dist/plan-review/stage-error.js.map +1 -0
  270. package/clinkx-workflows/dist/post-processors/index.d.ts +20 -0
  271. package/clinkx-workflows/dist/post-processors/index.js +21 -0
  272. package/clinkx-workflows/dist/post-processors/index.js.map +1 -0
  273. package/clinkx-workflows/dist/prompt-budget.d.ts +7 -0
  274. package/clinkx-workflows/dist/prompt-budget.js +7 -1
  275. package/clinkx-workflows/dist/prompt-budget.js.map +1 -1
  276. package/clinkx-workflows/dist/reducers/index.js +2 -0
  277. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  278. package/clinkx-workflows/dist/roster-contract.d.ts +889 -0
  279. package/clinkx-workflows/dist/roster-contract.js +180 -0
  280. package/clinkx-workflows/dist/roster-contract.js.map +1 -0
  281. package/clinkx-workflows/dist/rosters.d.ts +14 -0
  282. package/clinkx-workflows/dist/rosters.js +169 -0
  283. package/clinkx-workflows/dist/rosters.js.map +1 -0
  284. package/clinkx-workflows/dist/run-health.d.ts +7 -0
  285. package/clinkx-workflows/dist/run-health.js +25 -0
  286. package/clinkx-workflows/dist/run-health.js.map +1 -0
  287. package/clinkx-workflows/dist/run-lock-heartbeat.d.ts +2 -0
  288. package/clinkx-workflows/dist/run-lock-heartbeat.js +3 -0
  289. package/clinkx-workflows/dist/run-lock-heartbeat.js.map +1 -0
  290. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.d.ts +34 -0
  291. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js +74 -0
  292. package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js.map +1 -0
  293. package/clinkx-workflows/dist/run-summary/cards/index.js +5 -0
  294. package/clinkx-workflows/dist/run-summary/cards/index.js.map +1 -1
  295. package/clinkx-workflows/dist/run-summary.d.ts +13 -0
  296. package/clinkx-workflows/dist/run-summary.js +29 -1
  297. package/clinkx-workflows/dist/run-summary.js.map +1 -1
  298. package/clinkx-workflows/dist/schema.d.ts +140 -21
  299. package/clinkx-workflows/dist/schema.js +34 -1
  300. package/clinkx-workflows/dist/schema.js.map +1 -1
  301. package/clinkx-workflows/dist/seed-terms.d.ts +30 -0
  302. package/clinkx-workflows/dist/seed-terms.js +176 -0
  303. package/clinkx-workflows/dist/seed-terms.js.map +1 -0
  304. package/clinkx-workflows/dist/server.d.ts +5 -2
  305. package/clinkx-workflows/dist/server.js +84 -52
  306. package/clinkx-workflows/dist/server.js.map +1 -1
  307. package/clinkx-workflows/dist/shutdown.d.ts +29 -18
  308. package/clinkx-workflows/dist/shutdown.js +90 -64
  309. package/clinkx-workflows/dist/shutdown.js.map +1 -1
  310. package/clinkx-workflows/dist/state-schema.d.ts +61 -0
  311. package/clinkx-workflows/dist/state.d.ts +175 -3
  312. package/clinkx-workflows/dist/state.js +1398 -44
  313. package/clinkx-workflows/dist/state.js.map +1 -1
  314. package/clinkx-workflows/dist/stdio-watchdog.d.ts +52 -0
  315. package/clinkx-workflows/dist/stdio-watchdog.js +212 -0
  316. package/clinkx-workflows/dist/stdio-watchdog.js.map +1 -0
  317. package/clinkx-workflows/dist/transport.d.ts +15 -0
  318. package/clinkx-workflows/dist/transport.js +19 -10
  319. package/clinkx-workflows/dist/transport.js.map +1 -1
  320. package/clinkx-workflows/dist/types.d.ts +20 -2
  321. package/clinkx-workflows/dist/validators/council.d.ts +334 -101
  322. package/clinkx-workflows/dist/validators/council.js +52 -13
  323. package/clinkx-workflows/dist/validators/council.js.map +1 -1
  324. package/clinkx-workflows/dist/validators/index.d.ts +1 -0
  325. package/clinkx-workflows/dist/validators/index.js +3 -0
  326. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  327. package/clinkx-workflows/dist/validators/plan-review.d.ts +398 -0
  328. package/clinkx-workflows/dist/validators/plan-review.js +316 -0
  329. package/clinkx-workflows/dist/validators/plan-review.js.map +1 -0
  330. package/clinkx-workflows/dist/workflow-receipt.js +188 -4
  331. package/clinkx-workflows/dist/workflow-receipt.js.map +1 -1
  332. package/clinkx-workflows/dist/workflow-tools.d.ts +118 -3
  333. package/clinkx-workflows/dist/workflow-tools.js +2110 -175
  334. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  335. package/clinkx-workflows/dist/workspace-signature.d.ts +16 -0
  336. package/clinkx-workflows/dist/workspace-signature.js +388 -0
  337. package/clinkx-workflows/dist/workspace-signature.js.map +1 -0
  338. package/clinkx-workflows/templates/council/answer-chairman.txt +3 -0
  339. package/clinkx-workflows/templates/council/answer-cross-reviewer.txt +3 -0
  340. package/clinkx-workflows/templates/council/answer-specialist.txt +5 -1
  341. package/clinkx-workflows/templates/council/chairman.txt +3 -0
  342. package/clinkx-workflows/templates/council/code-review-chairman.txt +16 -0
  343. package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +7 -1
  344. package/clinkx-workflows/templates/council/code-review-reviewer.txt +22 -3
  345. package/clinkx-workflows/templates/council/debug-chairman.txt +3 -0
  346. package/clinkx-workflows/templates/council/debug-cross-reviewer.txt +3 -0
  347. package/clinkx-workflows/templates/council/debug-debugger.txt +5 -1
  348. package/clinkx-workflows/templates/council/discover-analyst.txt +5 -1
  349. package/clinkx-workflows/templates/council/discover-chairman.txt +3 -0
  350. package/clinkx-workflows/templates/council/discover-cross-reviewer.txt +3 -0
  351. package/clinkx-workflows/templates/council/member.txt +5 -1
  352. package/clinkx-workflows/templates/council/plan-review-chairman.txt +71 -0
  353. package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +54 -0
  354. package/clinkx-workflows/templates/council/plan-review-reviewer.txt +63 -0
  355. package/clinkx-workflows/templates/council/reviewer.txt +3 -0
  356. package/clinkx-workflows/templates/plan-review/chairman.txt +48 -0
  357. package/clinkx-workflows/templates/plan-review/cross-review.txt +52 -0
  358. package/clinkx-workflows/templates/plan-review/ranking.txt +16 -0
  359. package/clinkx-workflows/templates/plan-review/reviewer.txt +57 -0
  360. package/clinkx-workflows/workflows/council-answer.yaml +100 -8
  361. package/clinkx-workflows/workflows/council-code-review.yaml +106 -8
  362. package/clinkx-workflows/workflows/council-debug.yaml +100 -8
  363. package/clinkx-workflows/workflows/council-default.yaml +104 -8
  364. package/clinkx-workflows/workflows/council-discover.yaml +100 -8
  365. package/clinkx-workflows/workflows/council-plan-review.yaml +253 -0
  366. package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
  367. package/conf/adapters/agy.json +56 -0
  368. package/conf/adapters/claude.json +12 -0
  369. package/conf/adapters/codex-app-server.json +44 -0
  370. package/conf/adapters/codex.json +14 -2
  371. package/conf/adapters/glm.json +24 -3
  372. package/conf/adapters/grok.json +67 -0
  373. package/conf/adapters/hapi/agy.json +59 -0
  374. package/conf/adapters/hapi/claude.json +12 -0
  375. package/conf/adapters/hapi/codex.json +14 -2
  376. package/conf/adapters/hapi/glm.json +25 -4
  377. package/conf/rosters/default-council.json +21 -0
  378. package/dist/activity-journal.d.ts +56 -0
  379. package/dist/activity-journal.js +706 -0
  380. package/dist/activity-journal.js.map +1 -0
  381. package/dist/allowed-roots.d.ts +41 -0
  382. package/dist/allowed-roots.js +125 -3
  383. package/dist/allowed-roots.js.map +1 -1
  384. package/dist/codex/activity-session-log.d.ts +14 -0
  385. package/dist/codex/activity-session-log.js +206 -0
  386. package/dist/codex/activity-session-log.js.map +1 -0
  387. package/dist/codex/agent-tools.d.ts +23 -0
  388. package/dist/codex/agent-tools.js +1306 -0
  389. package/dist/codex/agent-tools.js.map +1 -0
  390. package/dist/codex/app-server-client.d.ts +79 -0
  391. package/dist/codex/app-server-client.js +593 -0
  392. package/dist/codex/app-server-client.js.map +1 -0
  393. package/dist/codex/app-server-registry.d.ts +407 -0
  394. package/dist/codex/app-server-registry.js +1493 -0
  395. package/dist/codex/app-server-registry.js.map +1 -0
  396. package/dist/codex/client-types.d.ts +115 -0
  397. package/dist/codex/client-types.js +2 -0
  398. package/dist/codex/client-types.js.map +1 -0
  399. package/dist/codex/protocol.d.ts +5375 -0
  400. package/dist/codex/protocol.js +614 -0
  401. package/dist/codex/protocol.js.map +1 -0
  402. package/dist/codex/session.d.ts +263 -0
  403. package/dist/codex/session.js +466 -0
  404. package/dist/codex/session.js.map +1 -0
  405. package/dist/config.d.ts +386 -23
  406. package/dist/config.js +184 -15
  407. package/dist/config.js.map +1 -1
  408. package/dist/context-builder/anchors.d.ts +1 -0
  409. package/dist/context-builder/anchors.js +3 -0
  410. package/dist/context-builder/anchors.js.map +1 -1
  411. package/dist/context-builder/bundle.d.ts +48 -2
  412. package/dist/context-builder/bundle.js +388 -2417
  413. package/dist/context-builder/bundle.js.map +1 -1
  414. package/dist/context-builder/codemap.d.ts +5 -0
  415. package/dist/context-builder/codemap.js +387 -13
  416. package/dist/context-builder/codemap.js.map +1 -1
  417. package/dist/context-builder/config.d.ts +1 -0
  418. package/dist/context-builder/config.js +12 -0
  419. package/dist/context-builder/config.js.map +1 -1
  420. package/dist/context-builder/context-run-catalog.d.ts +17 -0
  421. package/dist/context-builder/context-run-catalog.js +99 -0
  422. package/dist/context-builder/context-run-catalog.js.map +1 -0
  423. package/dist/context-builder/delegate-finalizer-effective.d.ts +33 -0
  424. package/dist/context-builder/delegate-finalizer-effective.js +82 -0
  425. package/dist/context-builder/delegate-finalizer-effective.js.map +1 -0
  426. package/dist/context-builder/delegate-packet.d.ts +55 -0
  427. package/dist/context-builder/delegate-packet.js +430 -74
  428. package/dist/context-builder/delegate-packet.js.map +1 -1
  429. package/dist/context-builder/delegate-reconstruction.d.ts +29 -0
  430. package/dist/context-builder/delegate-reconstruction.js +110 -41
  431. package/dist/context-builder/delegate-reconstruction.js.map +1 -1
  432. package/dist/context-builder/delegate-validation.d.ts +41 -1
  433. package/dist/context-builder/delegate-validation.js +237 -48
  434. package/dist/context-builder/delegate-validation.js.map +1 -1
  435. package/dist/context-builder/delegate.d.ts +11 -0
  436. package/dist/context-builder/delegate.js +210 -58
  437. package/dist/context-builder/delegate.js.map +1 -1
  438. package/dist/context-builder/diagnostics.d.ts +11 -2
  439. package/dist/context-builder/diagnostics.js +39 -6
  440. package/dist/context-builder/diagnostics.js.map +1 -1
  441. package/dist/context-builder/discovery-progress.d.ts +25 -0
  442. package/dist/context-builder/discovery-progress.js +64 -0
  443. package/dist/context-builder/discovery-progress.js.map +1 -0
  444. package/dist/context-builder/discovery-watchdog.d.ts +15 -0
  445. package/dist/context-builder/discovery-watchdog.js +39 -0
  446. package/dist/context-builder/discovery-watchdog.js.map +1 -0
  447. package/dist/context-builder/discovery.d.ts +36 -1
  448. package/dist/context-builder/discovery.js +584 -172
  449. package/dist/context-builder/discovery.js.map +1 -1
  450. package/dist/context-builder/external-gaps.d.ts +73 -0
  451. package/dist/context-builder/external-gaps.js +248 -0
  452. package/dist/context-builder/external-gaps.js.map +1 -0
  453. package/dist/context-builder/globs.d.ts +1 -0
  454. package/dist/context-builder/globs.js +25 -10
  455. package/dist/context-builder/globs.js.map +1 -1
  456. package/dist/context-builder/handler.d.ts +67 -2
  457. package/dist/context-builder/handler.js +1810 -2440
  458. package/dist/context-builder/handler.js.map +1 -1
  459. package/dist/context-builder/invocation-sidecar.d.ts +41 -0
  460. package/dist/context-builder/invocation-sidecar.js +189 -0
  461. package/dist/context-builder/invocation-sidecar.js.map +1 -0
  462. package/dist/context-builder/lifecycle-contract.d.ts +424 -0
  463. package/dist/context-builder/lifecycle-contract.js +523 -0
  464. package/dist/context-builder/lifecycle-contract.js.map +1 -0
  465. package/dist/context-builder/lifecycle-journal.d.ts +62 -0
  466. package/dist/context-builder/lifecycle-journal.js +88 -0
  467. package/dist/context-builder/lifecycle-journal.js.map +1 -0
  468. package/dist/context-builder/lifecycle-observer.d.ts +102 -0
  469. package/dist/context-builder/lifecycle-observer.js +258 -0
  470. package/dist/context-builder/lifecycle-observer.js.map +1 -0
  471. package/dist/context-builder/lifecycle-reconcile.d.ts +32 -0
  472. package/dist/context-builder/lifecycle-reconcile.js +191 -0
  473. package/dist/context-builder/lifecycle-reconcile.js.map +1 -0
  474. package/dist/context-builder/lifecycle-recovery.d.ts +2 -0
  475. package/dist/context-builder/lifecycle-recovery.js +14 -0
  476. package/dist/context-builder/lifecycle-recovery.js.map +1 -0
  477. package/dist/context-builder/mutation-lock.d.ts +32 -0
  478. package/dist/context-builder/mutation-lock.js +321 -0
  479. package/dist/context-builder/mutation-lock.js.map +1 -0
  480. package/dist/context-builder/path-signals.js +9 -5
  481. package/dist/context-builder/path-signals.js.map +1 -1
  482. package/dist/context-builder/progress.d.ts +3 -1
  483. package/dist/context-builder/progress.js +23 -0
  484. package/dist/context-builder/progress.js.map +1 -1
  485. package/dist/context-builder/receipt.d.ts +6 -4
  486. package/dist/context-builder/receipt.js +12 -1
  487. package/dist/context-builder/receipt.js.map +1 -1
  488. package/dist/context-builder/refine-handler.d.ts +14 -0
  489. package/dist/context-builder/refine-handler.js +790 -0
  490. package/dist/context-builder/refine-handler.js.map +1 -0
  491. package/dist/context-builder/review-coverage.d.ts +116 -0
  492. package/dist/context-builder/review-coverage.js +544 -0
  493. package/dist/context-builder/review-coverage.js.map +1 -0
  494. package/dist/context-builder/schema.d.ts +315 -2
  495. package/dist/context-builder/schema.js +133 -7
  496. package/dist/context-builder/schema.js.map +1 -1
  497. package/dist/context-builder/secrets.d.ts +59 -0
  498. package/dist/context-builder/secrets.js +2255 -44
  499. package/dist/context-builder/secrets.js.map +1 -1
  500. package/dist/context-builder/selection.d.ts +7 -3
  501. package/dist/context-builder/selection.js +200 -738
  502. package/dist/context-builder/selection.js.map +1 -1
  503. package/dist/context-builder/session-log-identity.d.ts +1 -0
  504. package/dist/context-builder/session-log-identity.js +66 -0
  505. package/dist/context-builder/session-log-identity.js.map +1 -0
  506. package/dist/context-builder/slice-range-math.d.ts +16 -0
  507. package/dist/context-builder/slice-range-math.js +137 -0
  508. package/dist/context-builder/slice-range-math.js.map +1 -0
  509. package/dist/context-builder/status.d.ts +23 -2
  510. package/dist/context-builder/status.js +60 -4
  511. package/dist/context-builder/status.js.map +1 -1
  512. package/dist/context-builder/storage.d.ts +59 -2
  513. package/dist/context-builder/storage.js +500 -168
  514. package/dist/context-builder/storage.js.map +1 -1
  515. package/dist/context-builder/token-estimate.d.ts +13 -2
  516. package/dist/context-builder/token-estimate.js +77 -4
  517. package/dist/context-builder/token-estimate.js.map +1 -1
  518. package/dist/context-builder/versions.d.ts +44 -0
  519. package/dist/context-builder/versions.js +45 -0
  520. package/dist/context-builder/versions.js.map +1 -0
  521. package/dist/context-builder/workflow-runner.d.ts +75 -0
  522. package/dist/context-builder/workflow-runner.js +1241 -0
  523. package/dist/context-builder/workflow-runner.js.map +1 -0
  524. package/dist/context-builder/write-watchdog.d.ts +14 -0
  525. package/dist/context-builder/write-watchdog.js +38 -0
  526. package/dist/context-builder/write-watchdog.js.map +1 -0
  527. package/dist/dashboard-adapter-catalog.d.ts +9 -0
  528. package/dist/dashboard-adapter-catalog.js +53 -0
  529. package/dist/dashboard-adapter-catalog.js.map +1 -0
  530. package/dist/dashboard-cli.d.ts +81 -0
  531. package/dist/dashboard-cli.js +623 -0
  532. package/dist/dashboard-cli.js.map +1 -0
  533. package/dist/dashboard-companion/client.d.ts +37 -0
  534. package/dist/dashboard-companion/client.js +229 -0
  535. package/dist/dashboard-companion/client.js.map +1 -0
  536. package/dist/dashboard-companion/config.d.ts +8 -0
  537. package/dist/dashboard-companion/config.js +52 -0
  538. package/dist/dashboard-companion/config.js.map +1 -0
  539. package/dist/dashboard-companion/http-proxy.d.ts +10 -0
  540. package/dist/dashboard-companion/http-proxy.js +234 -0
  541. package/dist/dashboard-companion/http-proxy.js.map +1 -0
  542. package/dist/dashboard-companion/protocol.d.ts +80 -0
  543. package/dist/dashboard-companion/protocol.js +458 -0
  544. package/dist/dashboard-companion/protocol.js.map +1 -0
  545. package/dist/dashboard-companion/standalone-assets.d.ts +12 -0
  546. package/dist/dashboard-companion/standalone-assets.js +72 -0
  547. package/dist/dashboard-companion/standalone-assets.js.map +1 -0
  548. package/dist/dashboard-companion/standalone-entry.d.ts +1 -0
  549. package/dist/dashboard-companion/standalone-entry.js +17 -0
  550. package/dist/dashboard-companion/standalone-entry.js.map +1 -0
  551. package/dist/dashboard-gateway/config.d.ts +9 -0
  552. package/dist/dashboard-gateway/config.js +44 -0
  553. package/dist/dashboard-gateway/config.js.map +1 -0
  554. package/dist/dashboard-gateway/index.d.ts +12 -0
  555. package/dist/dashboard-gateway/index.js +786 -0
  556. package/dist/dashboard-gateway/index.js.map +1 -0
  557. package/dist/dashboard-gateway/main.d.ts +1 -0
  558. package/dist/dashboard-gateway/main.js +25 -0
  559. package/dist/dashboard-gateway/main.js.map +1 -0
  560. package/dist/dashboard-pairing-token.d.ts +1 -0
  561. package/dist/dashboard-pairing-token.js +5 -0
  562. package/dist/dashboard-pairing-token.js.map +1 -0
  563. package/dist/elaris/client.d.ts +73 -0
  564. package/dist/elaris/client.js +825 -0
  565. package/dist/elaris/client.js.map +1 -0
  566. package/dist/elaris/config.d.ts +18 -0
  567. package/dist/elaris/config.js +75 -0
  568. package/dist/elaris/config.js.map +1 -0
  569. package/dist/elaris/errors.d.ts +41 -0
  570. package/dist/elaris/errors.js +205 -0
  571. package/dist/elaris/errors.js.map +1 -0
  572. package/dist/elaris/github-repo.d.ts +18 -0
  573. package/dist/elaris/github-repo.js +89 -0
  574. package/dist/elaris/github-repo.js.map +1 -0
  575. package/dist/elaris/index.d.ts +10 -0
  576. package/dist/elaris/index.js +11 -0
  577. package/dist/elaris/index.js.map +1 -0
  578. package/dist/elaris/redact.d.ts +89 -0
  579. package/dist/elaris/redact.js +423 -0
  580. package/dist/elaris/redact.js.map +1 -0
  581. package/dist/elaris/run-id.d.ts +5 -0
  582. package/dist/elaris/run-id.js +20 -0
  583. package/dist/elaris/run-id.js.map +1 -0
  584. package/dist/elaris/status.d.ts +45 -0
  585. package/dist/elaris/status.js +122 -0
  586. package/dist/elaris/status.js.map +1 -0
  587. package/dist/elaris/tool-schemas.d.ts +314 -0
  588. package/dist/elaris/tool-schemas.js +208 -0
  589. package/dist/elaris/tool-schemas.js.map +1 -0
  590. package/dist/elaris/tools.d.ts +73 -0
  591. package/dist/elaris/tools.js +1065 -0
  592. package/dist/elaris/tools.js.map +1 -0
  593. package/dist/elaris/types.d.ts +1541 -0
  594. package/dist/elaris/types.js +252 -0
  595. package/dist/elaris/types.js.map +1 -0
  596. package/dist/errors.d.ts +16 -0
  597. package/dist/errors.js +19 -0
  598. package/dist/errors.js.map +1 -1
  599. package/dist/handler.d.ts +4 -0
  600. package/dist/handler.js +15 -2
  601. package/dist/handler.js.map +1 -1
  602. package/dist/index.d.ts +20 -2
  603. package/dist/index.js +154 -6
  604. package/dist/index.js.map +1 -1
  605. package/dist/local-clink-backend.d.ts +3 -0
  606. package/dist/local-clink-backend.js +4 -0
  607. package/dist/local-clink-backend.js.map +1 -1
  608. package/dist/logger.d.ts +1 -1
  609. package/dist/logger.js +18 -3
  610. package/dist/logger.js.map +1 -1
  611. package/dist/package-info.d.ts +2 -0
  612. package/dist/package-info.js +18 -0
  613. package/dist/package-info.js.map +1 -0
  614. package/dist/parsers/agy-stream-json.d.ts +14 -0
  615. package/dist/parsers/agy-stream-json.js +172 -0
  616. package/dist/parsers/agy-stream-json.js.map +1 -0
  617. package/dist/parsers/codex-jsonl.js +48 -3
  618. package/dist/parsers/codex-jsonl.js.map +1 -1
  619. package/dist/parsers/extract.d.ts +10 -1
  620. package/dist/parsers/extract.js +16 -4
  621. package/dist/parsers/extract.js.map +1 -1
  622. package/dist/parsers/observed-invocation.d.ts +20 -0
  623. package/dist/parsers/observed-invocation.js +42 -0
  624. package/dist/parsers/observed-invocation.js.map +1 -0
  625. package/dist/pipeline.d.ts +17 -0
  626. package/dist/pipeline.js +181 -10
  627. package/dist/pipeline.js.map +1 -1
  628. package/dist/progress-report/lock.d.ts +74 -0
  629. package/dist/progress-report/lock.js +343 -0
  630. package/dist/progress-report/lock.js.map +1 -0
  631. package/dist/progress-report/schema.d.ts +808 -0
  632. package/dist/progress-report/schema.js +119 -0
  633. package/dist/progress-report/schema.js.map +1 -0
  634. package/dist/progress-report/store.d.ts +66 -0
  635. package/dist/progress-report/store.js +766 -0
  636. package/dist/progress-report/store.js.map +1 -0
  637. package/dist/progress-report/tools.d.ts +20 -0
  638. package/dist/progress-report/tools.js +141 -0
  639. package/dist/progress-report/tools.js.map +1 -0
  640. package/dist/prompt-mode.d.ts +1 -1
  641. package/dist/prompt-mode.js +7 -2
  642. package/dist/prompt-mode.js.map +1 -1
  643. package/dist/run-dir.d.ts +24 -0
  644. package/dist/run-dir.js +201 -2
  645. package/dist/run-dir.js.map +1 -1
  646. package/dist/runner.d.ts +20 -0
  647. package/dist/runner.js +192 -16
  648. package/dist/runner.js.map +1 -1
  649. package/dist/safety.d.ts +54 -4
  650. package/dist/safety.js +186 -5
  651. package/dist/safety.js.map +1 -1
  652. package/dist/schema.d.ts +15 -7
  653. package/dist/schema.js +20 -0
  654. package/dist/schema.js.map +1 -1
  655. package/dist/server.d.ts +7 -1
  656. package/dist/server.js +451 -23
  657. package/dist/server.js.map +1 -1
  658. package/dist/session-log-stream.d.ts +18 -0
  659. package/dist/session-log-stream.js +566 -0
  660. package/dist/session-log-stream.js.map +1 -0
  661. package/dist/stdio-activity.d.ts +28 -0
  662. package/dist/stdio-activity.js +72 -0
  663. package/dist/stdio-activity.js.map +1 -0
  664. package/package.json +47 -5
  665. package/conf/adapters/gemini.json +0 -44
  666. package/conf/adapters/hapi/gemini.json +0 -47
  667. package/dist/parsers/gemini-json.d.ts +0 -2
  668. package/dist/parsers/gemini-json.js +0 -72
  669. package/dist/parsers/gemini-json.js.map +0 -1
@@ -0,0 +1,446 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Producer-side contract for the agent progress report document.
4
+ *
5
+ * This is the on-disk shape written by the producer (the progress-report
6
+ * skill). Field names are snake_case. The dashboard reader projects this
7
+ * document into the camelCase wire document defined in `contracts.ts`.
8
+ *
9
+ * Phase 0 of the dashboard integration owns only this schema, the session-id
10
+ * grammar, and the fixtures. The independent-section parse and the
11
+ * snake_case -> camelCase projection live in the reader (Phase 2).
12
+ */
13
+ export declare const PROGRESS_REPORT_SCHEMA_VERSION: "progress-report-v1";
14
+ /**
15
+ * Session identifier grammar: an ASCII slug starting alphanumeric, followed
16
+ * by up to 63 alphanumerics, underscores, or hyphens (64 chars total).
17
+ */
18
+ export declare const ProgressReportSessionIdSchema: z.ZodString;
19
+ export type ProgressReportSessionId = z.infer<typeof ProgressReportSessionIdSchema>;
20
+ /** Short identifiers: name/role/agent/path/id. */
21
+ export declare const BoundedIdSchema: z.ZodEffects<z.ZodString, string, string>;
22
+ /** Mid-length free text: msg/activity/note. */
23
+ export declare const BoundedMessageSchema: z.ZodEffects<z.ZodString, string, string>;
24
+ /** Long free text: title/goal. */
25
+ export declare const BoundedTitleSchema: z.ZodEffects<z.ZodString, string, string>;
26
+ /**
27
+ * Absolute filesystem path for session.project_folder. The publisher requires it
28
+ * absolute (os.path.isabs); the dashboard contract and tolerant reader enforce
29
+ * the same invariant via the Node host's path.isAbsolute so a relative value is
30
+ * malformed (rejected wholesale / omitted) rather than silently admitted.
31
+ */
32
+ export declare const ProjectFolderPathSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
33
+ /**
34
+ * Canonical nonnegative safe-integer: an integer, `>= 0`, and `<=
35
+ * Number.MAX_SAFE_INTEGER`.
36
+ *
37
+ * `.min(0)` (or `.nonnegative()`) alone is NOT sufficient. `Number.MAX_SAFE_INTEGER + 1`
38
+ * (2^53) is exactly representable as a double, so Zod's `.int()` (`Number.isInteger`)
39
+ * accepts it and `.nonnegative()` only checks `>= 0` — leaving the browser's
40
+ * `Number.isSafeInteger` gate with no server-side parity. Capping at
41
+ * `Number.MAX_SAFE_INTEGER` closes that gap: the producer contract, the tolerant
42
+ * reader, and the wire/list response schemas all admit exactly the safe
43
+ * nonnegative integers the client already accepts. The three constraints together
44
+ * are equivalent to `Number.isSafeInteger(x) && x >= 0` for integers.
45
+ *
46
+ * Used for every progress-report nonnegative counter (file `adds`/`dels`, test
47
+ * `passed`/`failed`/`skipped`, list `agentCount`, `taskCounts.total`/`done`).
48
+ * Counters that can legitimately be signed are intentionally NOT covered here.
49
+ */
50
+ export declare const NonnegativeSafeIntegerSchema: z.ZodNumber;
51
+ export declare const StrictRfc3339TimestampSchema: z.ZodEffects<z.ZodString, string, string>;
52
+ export declare const SessionStatusSchema: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
53
+ export declare const AgentStatusSchema: z.ZodEnum<["working", "idle", "blocked", "done"]>;
54
+ export declare const LogKindSchema: z.ZodEnum<["info", "success", "warn", "error"]>;
55
+ export declare const SessionSectionSchema: z.ZodObject<{
56
+ id: z.ZodString;
57
+ title: z.ZodEffects<z.ZodString, string, string>;
58
+ goal: z.ZodEffects<z.ZodString, string, string>;
59
+ status: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
60
+ started_at: z.ZodEffects<z.ZodString, string, string>;
61
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
62
+ project_folder: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
63
+ }, "strict", z.ZodTypeAny, {
64
+ status: "running" | "failed" | "paused" | "blocked" | "done";
65
+ id: string;
66
+ updated_at: string;
67
+ started_at: string;
68
+ title: string;
69
+ goal: string;
70
+ project_folder: string;
71
+ }, {
72
+ status: "running" | "failed" | "paused" | "blocked" | "done";
73
+ id: string;
74
+ updated_at: string;
75
+ started_at: string;
76
+ title: string;
77
+ goal: string;
78
+ project_folder: string;
79
+ }>;
80
+ export declare const AgentSectionSchema: z.ZodObject<{
81
+ name: z.ZodEffects<z.ZodString, string, string>;
82
+ role: z.ZodEffects<z.ZodString, string, string>;
83
+ status: z.ZodEnum<["working", "idle", "blocked", "done"]>;
84
+ activity: z.ZodEffects<z.ZodString, string, string>;
85
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
86
+ }, "strict", z.ZodTypeAny, {
87
+ status: "idle" | "working" | "blocked" | "done";
88
+ role: string;
89
+ name: string;
90
+ updated_at: string;
91
+ activity: string;
92
+ }, {
93
+ status: "idle" | "working" | "blocked" | "done";
94
+ role: string;
95
+ name: string;
96
+ updated_at: string;
97
+ activity: string;
98
+ }>;
99
+ export declare const TaskSectionSchema: z.ZodObject<{
100
+ id: z.ZodEffects<z.ZodString, string, string>;
101
+ title: z.ZodEffects<z.ZodString, string, string>;
102
+ status: z.ZodEnum<["pending", "active", "done", "blocked", "failed"]>;
103
+ agent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
104
+ note: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
105
+ }, "strict", z.ZodTypeAny, {
106
+ status: "pending" | "failed" | "blocked" | "done" | "active";
107
+ id: string;
108
+ title: string;
109
+ note?: string | undefined;
110
+ agent?: string | undefined;
111
+ }, {
112
+ status: "pending" | "failed" | "blocked" | "done" | "active";
113
+ id: string;
114
+ title: string;
115
+ note?: string | undefined;
116
+ agent?: string | undefined;
117
+ }>;
118
+ export declare const LogEntrySchema: z.ZodObject<{
119
+ t: z.ZodEffects<z.ZodString, string, string>;
120
+ agent: z.ZodEffects<z.ZodString, string, string>;
121
+ kind: z.ZodEnum<["info", "success", "warn", "error"]>;
122
+ msg: z.ZodEffects<z.ZodString, string, string>;
123
+ }, "strict", z.ZodTypeAny, {
124
+ kind: "info" | "error" | "warn" | "success";
125
+ agent: string;
126
+ t: string;
127
+ msg: string;
128
+ }, {
129
+ kind: "info" | "error" | "warn" | "success";
130
+ agent: string;
131
+ t: string;
132
+ msg: string;
133
+ }>;
134
+ export declare const FileChangeEntrySchema: z.ZodObject<{
135
+ path: z.ZodEffects<z.ZodString, string, string>;
136
+ change: z.ZodEnum<["added", "modified", "deleted"]>;
137
+ adds: z.ZodNumber;
138
+ dels: z.ZodNumber;
139
+ }, "strict", z.ZodTypeAny, {
140
+ path: string;
141
+ change: "added" | "modified" | "deleted";
142
+ adds: number;
143
+ dels: number;
144
+ }, {
145
+ path: string;
146
+ change: "added" | "modified" | "deleted";
147
+ adds: number;
148
+ dels: number;
149
+ }>;
150
+ export declare const TestsSectionSchema: z.ZodObject<{
151
+ passed: z.ZodNumber;
152
+ failed: z.ZodNumber;
153
+ skipped: z.ZodNumber;
154
+ failing: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
155
+ last_run: z.ZodEffects<z.ZodString, string, string>;
156
+ }, "strict", z.ZodTypeAny, {
157
+ failed: number;
158
+ skipped: number;
159
+ passed: number;
160
+ failing: string[];
161
+ last_run: string;
162
+ }, {
163
+ failed: number;
164
+ skipped: number;
165
+ passed: number;
166
+ failing: string[];
167
+ last_run: string;
168
+ }>;
169
+ export declare const BlockerEntrySchema: z.ZodObject<{
170
+ msg: z.ZodEffects<z.ZodString, string, string>;
171
+ raised_by: z.ZodEffects<z.ZodString, string, string>;
172
+ needs_human: z.ZodBoolean;
173
+ }, "strict", z.ZodTypeAny, {
174
+ msg: string;
175
+ raised_by: string;
176
+ needs_human: boolean;
177
+ }, {
178
+ msg: string;
179
+ raised_by: string;
180
+ needs_human: boolean;
181
+ }>;
182
+ export declare const DecisionEntrySchema: z.ZodObject<{
183
+ t: z.ZodEffects<z.ZodString, string, string>;
184
+ by: z.ZodEffects<z.ZodString, string, string>;
185
+ msg: z.ZodEffects<z.ZodString, string, string>;
186
+ }, "strict", z.ZodTypeAny, {
187
+ t: string;
188
+ msg: string;
189
+ by: string;
190
+ }, {
191
+ t: string;
192
+ msg: string;
193
+ by: string;
194
+ }>;
195
+ export declare const ProgressReportDocumentSchema: z.ZodObject<{
196
+ schema_version: z.ZodLiteral<"progress-report-v1">;
197
+ session: z.ZodObject<{
198
+ id: z.ZodString;
199
+ title: z.ZodEffects<z.ZodString, string, string>;
200
+ goal: z.ZodEffects<z.ZodString, string, string>;
201
+ status: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
202
+ started_at: z.ZodEffects<z.ZodString, string, string>;
203
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
204
+ project_folder: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
205
+ }, "strict", z.ZodTypeAny, {
206
+ status: "running" | "failed" | "paused" | "blocked" | "done";
207
+ id: string;
208
+ updated_at: string;
209
+ started_at: string;
210
+ title: string;
211
+ goal: string;
212
+ project_folder: string;
213
+ }, {
214
+ status: "running" | "failed" | "paused" | "blocked" | "done";
215
+ id: string;
216
+ updated_at: string;
217
+ started_at: string;
218
+ title: string;
219
+ goal: string;
220
+ project_folder: string;
221
+ }>;
222
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
223
+ name: z.ZodEffects<z.ZodString, string, string>;
224
+ role: z.ZodEffects<z.ZodString, string, string>;
225
+ status: z.ZodEnum<["working", "idle", "blocked", "done"]>;
226
+ activity: z.ZodEffects<z.ZodString, string, string>;
227
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
228
+ }, "strict", z.ZodTypeAny, {
229
+ status: "idle" | "working" | "blocked" | "done";
230
+ role: string;
231
+ name: string;
232
+ updated_at: string;
233
+ activity: string;
234
+ }, {
235
+ status: "idle" | "working" | "blocked" | "done";
236
+ role: string;
237
+ name: string;
238
+ updated_at: string;
239
+ activity: string;
240
+ }>, "many">>;
241
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
242
+ id: z.ZodEffects<z.ZodString, string, string>;
243
+ title: z.ZodEffects<z.ZodString, string, string>;
244
+ status: z.ZodEnum<["pending", "active", "done", "blocked", "failed"]>;
245
+ agent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
246
+ note: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
247
+ }, "strict", z.ZodTypeAny, {
248
+ status: "pending" | "failed" | "blocked" | "done" | "active";
249
+ id: string;
250
+ title: string;
251
+ note?: string | undefined;
252
+ agent?: string | undefined;
253
+ }, {
254
+ status: "pending" | "failed" | "blocked" | "done" | "active";
255
+ id: string;
256
+ title: string;
257
+ note?: string | undefined;
258
+ agent?: string | undefined;
259
+ }>, "many">>;
260
+ log: z.ZodOptional<z.ZodArray<z.ZodObject<{
261
+ t: z.ZodEffects<z.ZodString, string, string>;
262
+ agent: z.ZodEffects<z.ZodString, string, string>;
263
+ kind: z.ZodEnum<["info", "success", "warn", "error"]>;
264
+ msg: z.ZodEffects<z.ZodString, string, string>;
265
+ }, "strict", z.ZodTypeAny, {
266
+ kind: "info" | "error" | "warn" | "success";
267
+ agent: string;
268
+ t: string;
269
+ msg: string;
270
+ }, {
271
+ kind: "info" | "error" | "warn" | "success";
272
+ agent: string;
273
+ t: string;
274
+ msg: string;
275
+ }>, "many">>;
276
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
277
+ path: z.ZodEffects<z.ZodString, string, string>;
278
+ change: z.ZodEnum<["added", "modified", "deleted"]>;
279
+ adds: z.ZodNumber;
280
+ dels: z.ZodNumber;
281
+ }, "strict", z.ZodTypeAny, {
282
+ path: string;
283
+ change: "added" | "modified" | "deleted";
284
+ adds: number;
285
+ dels: number;
286
+ }, {
287
+ path: string;
288
+ change: "added" | "modified" | "deleted";
289
+ adds: number;
290
+ dels: number;
291
+ }>, "many">>;
292
+ tests: z.ZodOptional<z.ZodObject<{
293
+ passed: z.ZodNumber;
294
+ failed: z.ZodNumber;
295
+ skipped: z.ZodNumber;
296
+ failing: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
297
+ last_run: z.ZodEffects<z.ZodString, string, string>;
298
+ }, "strict", z.ZodTypeAny, {
299
+ failed: number;
300
+ skipped: number;
301
+ passed: number;
302
+ failing: string[];
303
+ last_run: string;
304
+ }, {
305
+ failed: number;
306
+ skipped: number;
307
+ passed: number;
308
+ failing: string[];
309
+ last_run: string;
310
+ }>>;
311
+ blockers: z.ZodOptional<z.ZodArray<z.ZodObject<{
312
+ msg: z.ZodEffects<z.ZodString, string, string>;
313
+ raised_by: z.ZodEffects<z.ZodString, string, string>;
314
+ needs_human: z.ZodBoolean;
315
+ }, "strict", z.ZodTypeAny, {
316
+ msg: string;
317
+ raised_by: string;
318
+ needs_human: boolean;
319
+ }, {
320
+ msg: string;
321
+ raised_by: string;
322
+ needs_human: boolean;
323
+ }>, "many">>;
324
+ decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
325
+ t: z.ZodEffects<z.ZodString, string, string>;
326
+ by: z.ZodEffects<z.ZodString, string, string>;
327
+ msg: z.ZodEffects<z.ZodString, string, string>;
328
+ }, "strict", z.ZodTypeAny, {
329
+ t: string;
330
+ msg: string;
331
+ by: string;
332
+ }, {
333
+ t: string;
334
+ msg: string;
335
+ by: string;
336
+ }>, "many">>;
337
+ }, "strict", z.ZodTypeAny, {
338
+ schema_version: "progress-report-v1";
339
+ session: {
340
+ status: "running" | "failed" | "paused" | "blocked" | "done";
341
+ id: string;
342
+ updated_at: string;
343
+ started_at: string;
344
+ title: string;
345
+ goal: string;
346
+ project_folder: string;
347
+ };
348
+ blockers?: {
349
+ msg: string;
350
+ raised_by: string;
351
+ needs_human: boolean;
352
+ }[] | undefined;
353
+ tasks?: {
354
+ status: "pending" | "failed" | "blocked" | "done" | "active";
355
+ id: string;
356
+ title: string;
357
+ note?: string | undefined;
358
+ agent?: string | undefined;
359
+ }[] | undefined;
360
+ agents?: {
361
+ status: "idle" | "working" | "blocked" | "done";
362
+ role: string;
363
+ name: string;
364
+ updated_at: string;
365
+ activity: string;
366
+ }[] | undefined;
367
+ log?: {
368
+ kind: "info" | "error" | "warn" | "success";
369
+ agent: string;
370
+ t: string;
371
+ msg: string;
372
+ }[] | undefined;
373
+ files?: {
374
+ path: string;
375
+ change: "added" | "modified" | "deleted";
376
+ adds: number;
377
+ dels: number;
378
+ }[] | undefined;
379
+ tests?: {
380
+ failed: number;
381
+ skipped: number;
382
+ passed: number;
383
+ failing: string[];
384
+ last_run: string;
385
+ } | undefined;
386
+ decisions?: {
387
+ t: string;
388
+ msg: string;
389
+ by: string;
390
+ }[] | undefined;
391
+ }, {
392
+ schema_version: "progress-report-v1";
393
+ session: {
394
+ status: "running" | "failed" | "paused" | "blocked" | "done";
395
+ id: string;
396
+ updated_at: string;
397
+ started_at: string;
398
+ title: string;
399
+ goal: string;
400
+ project_folder: string;
401
+ };
402
+ blockers?: {
403
+ msg: string;
404
+ raised_by: string;
405
+ needs_human: boolean;
406
+ }[] | undefined;
407
+ tasks?: {
408
+ status: "pending" | "failed" | "blocked" | "done" | "active";
409
+ id: string;
410
+ title: string;
411
+ note?: string | undefined;
412
+ agent?: string | undefined;
413
+ }[] | undefined;
414
+ agents?: {
415
+ status: "idle" | "working" | "blocked" | "done";
416
+ role: string;
417
+ name: string;
418
+ updated_at: string;
419
+ activity: string;
420
+ }[] | undefined;
421
+ log?: {
422
+ kind: "info" | "error" | "warn" | "success";
423
+ agent: string;
424
+ t: string;
425
+ msg: string;
426
+ }[] | undefined;
427
+ files?: {
428
+ path: string;
429
+ change: "added" | "modified" | "deleted";
430
+ adds: number;
431
+ dels: number;
432
+ }[] | undefined;
433
+ tests?: {
434
+ failed: number;
435
+ skipped: number;
436
+ passed: number;
437
+ failing: string[];
438
+ last_run: string;
439
+ } | undefined;
440
+ decisions?: {
441
+ t: string;
442
+ msg: string;
443
+ by: string;
444
+ }[] | undefined;
445
+ }>;
446
+ export type ProgressReportDocument = z.infer<typeof ProgressReportDocumentSchema>;
@@ -0,0 +1,221 @@
1
+ import { isAbsolute } from "node:path";
2
+ import { z } from "zod";
3
+ /**
4
+ * Producer-side contract for the agent progress report document.
5
+ *
6
+ * This is the on-disk shape written by the producer (the progress-report
7
+ * skill). Field names are snake_case. The dashboard reader projects this
8
+ * document into the camelCase wire document defined in `contracts.ts`.
9
+ *
10
+ * Phase 0 of the dashboard integration owns only this schema, the session-id
11
+ * grammar, and the fixtures. The independent-section parse and the
12
+ * snake_case -> camelCase projection live in the reader (Phase 2).
13
+ */
14
+ export const PROGRESS_REPORT_SCHEMA_VERSION = "progress-report-v1";
15
+ // --- Session identifier grammar (task 0-8) ------------------------------
16
+ /**
17
+ * Session identifier grammar: an ASCII slug starting alphanumeric, followed
18
+ * by up to 63 alphanumerics, underscores, or hyphens (64 chars total).
19
+ */
20
+ export const ProgressReportSessionIdSchema = z
21
+ .string()
22
+ .regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/);
23
+ // --- Bounded string primitives (task 0-7) -------------------------------
24
+ /**
25
+ * Bound a string by Unicode CODE POINTS, not UTF-16 code units (Zod's `.max()`
26
+ * default). An astral-plane character (e.g. an emoji) is one code point but two
27
+ * UTF-16 code units. A `.max(N)` code-unit bound would therefore reject an
28
+ * astral-heavy string before it reaches the producer's N-code-point limit.
29
+ * Counting code points here keeps the producer contract and tolerant reader on
30
+ * the same bound as Python's code-point-counting `len()`.
31
+ *
32
+ * Allocation-free and early-exiting: the JS string iterator combines each
33
+ * well-formed surrogate pair into one code point without materializing an array,
34
+ * and this returns false the instant the count exceeds `max`. A near-cap
35
+ * malformed string therefore validates in O(max) time and O(1) space instead of
36
+ * allocating an `Array.from(value)` whose length is the whole string (the
37
+ * previous implementation). Byte caps are tracked separately and unaffected.
38
+ */
39
+ function atMostCodePoints(max) {
40
+ return (value) => {
41
+ let count = 0;
42
+ // Iterate code points directly off the string iterator (no array allocation,
43
+ // no unused loop binding) and stop the instant the bound is exceeded.
44
+ const codePoints = value[Symbol.iterator]();
45
+ while (!codePoints.next().done) {
46
+ count += 1;
47
+ if (count > max)
48
+ return false;
49
+ }
50
+ return true;
51
+ };
52
+ }
53
+ /** Short identifiers: name/role/agent/path/id. */
54
+ export const BoundedIdSchema = z
55
+ .string()
56
+ .min(1)
57
+ .refine(atMostCodePoints(256), { message: "must be at most 256 Unicode code points" });
58
+ /** Mid-length free text: msg/activity/note. */
59
+ export const BoundedMessageSchema = z
60
+ .string()
61
+ .min(1)
62
+ .refine(atMostCodePoints(300), { message: "must be at most 300 Unicode code points" });
63
+ /** Long free text: title/goal. */
64
+ export const BoundedTitleSchema = z
65
+ .string()
66
+ .min(1)
67
+ .refine(atMostCodePoints(500), { message: "must be at most 500 Unicode code points" });
68
+ /**
69
+ * Absolute filesystem path for session.project_folder. The publisher requires it
70
+ * absolute (os.path.isabs); the dashboard contract and tolerant reader enforce
71
+ * the same invariant via the Node host's path.isAbsolute so a relative value is
72
+ * malformed (rejected wholesale / omitted) rather than silently admitted.
73
+ */
74
+ export const ProjectFolderPathSchema = z
75
+ .string()
76
+ .min(1)
77
+ .refine(atMostCodePoints(500), { message: "must be at most 500 Unicode code points" })
78
+ .refine(isAbsolute, { message: "session.project_folder must be an absolute path" });
79
+ /**
80
+ * Canonical nonnegative safe-integer: an integer, `>= 0`, and `<=
81
+ * Number.MAX_SAFE_INTEGER`.
82
+ *
83
+ * `.min(0)` (or `.nonnegative()`) alone is NOT sufficient. `Number.MAX_SAFE_INTEGER + 1`
84
+ * (2^53) is exactly representable as a double, so Zod's `.int()` (`Number.isInteger`)
85
+ * accepts it and `.nonnegative()` only checks `>= 0` — leaving the browser's
86
+ * `Number.isSafeInteger` gate with no server-side parity. Capping at
87
+ * `Number.MAX_SAFE_INTEGER` closes that gap: the producer contract, the tolerant
88
+ * reader, and the wire/list response schemas all admit exactly the safe
89
+ * nonnegative integers the client already accepts. The three constraints together
90
+ * are equivalent to `Number.isSafeInteger(x) && x >= 0` for integers.
91
+ *
92
+ * Used for every progress-report nonnegative counter (file `adds`/`dels`, test
93
+ * `passed`/`failed`/`skipped`, list `agentCount`, `taskCounts.total`/`done`).
94
+ * Counters that can legitimately be signed are intentionally NOT covered here.
95
+ */
96
+ export const NonnegativeSafeIntegerSchema = z
97
+ .number()
98
+ .int()
99
+ .min(0)
100
+ .max(Number.MAX_SAFE_INTEGER);
101
+ /**
102
+ * Strict RFC3339 timestamp: uppercase T/Z, a 4-digit calendar year 0001-9999,
103
+ * real calendar validation, legal UTC-offset bounds, and a finite epoch. Shared
104
+ * by the producer contract, the tolerant reader, and the progress-report wire
105
+ * schemas so every layer agrees on what a timestamp means and the list
106
+ * comparator's `Date.parse` is always defined.
107
+ *
108
+ * `z.string().datetime({ offset: true })` already rejects impossible calendar
109
+ * dates (e.g. `2026-02-30`) but accepts out-of-range offsets such as `+24:00`,
110
+ * for which `Date.parse` is `NaN`, and the year 0000, whose epoch is finite on
111
+ * V8 but rejected by Python `datetime` (MINYEAR=1). This refine additionally
112
+ * bounds the year (0001-9999) and offset (hours 0-23, minutes 0-59) and
113
+ * requires a finite epoch, matching the publisher's canonical rule.
114
+ */
115
+ const RFC3339_YEAR_PATTERN = /^(\d{4})-/;
116
+ const RFC3339_OFFSET_PATTERN = /([+-])(\d{2}):(\d{2})$/;
117
+ function isValidRfc3339Instant(value) {
118
+ const yearMatch = RFC3339_YEAR_PATTERN.exec(value);
119
+ if (yearMatch === null)
120
+ return false;
121
+ const year = Number(yearMatch[1]);
122
+ if (year < 1 || year > 9999)
123
+ return false;
124
+ const match = RFC3339_OFFSET_PATTERN.exec(value);
125
+ if (match !== null) {
126
+ const offsetHours = Number(match[2]);
127
+ const offsetMinutes = Number(match[3]);
128
+ if (offsetHours > 23 || offsetMinutes > 59)
129
+ return false;
130
+ }
131
+ return Number.isFinite(Date.parse(value));
132
+ }
133
+ export const StrictRfc3339TimestampSchema = z
134
+ .string()
135
+ .datetime({ offset: true })
136
+ .refine(isValidRfc3339Instant, { message: "invalid RFC3339 timestamp" });
137
+ const TimestampSchema = StrictRfc3339TimestampSchema;
138
+ // --- Enum literals (authoritative from SKILL.md) ------------------------
139
+ export const SessionStatusSchema = z.enum([
140
+ "running",
141
+ "paused",
142
+ "blocked",
143
+ "done",
144
+ "failed",
145
+ ]);
146
+ export const AgentStatusSchema = z.enum(["working", "idle", "blocked", "done"]);
147
+ const TaskStatusSchema = z.enum([
148
+ "pending",
149
+ "active",
150
+ "done",
151
+ "blocked",
152
+ "failed",
153
+ ]);
154
+ export const LogKindSchema = z.enum(["info", "success", "warn", "error"]);
155
+ const FileChangeSchema = z.enum(["added", "modified", "deleted"]);
156
+ // --- Section schemas (8 sections, 1 required + 7 optional) --------------
157
+ export const SessionSectionSchema = z.object({
158
+ id: ProgressReportSessionIdSchema,
159
+ title: BoundedTitleSchema,
160
+ goal: BoundedTitleSchema,
161
+ status: SessionStatusSchema,
162
+ started_at: TimestampSchema,
163
+ updated_at: TimestampSchema,
164
+ project_folder: ProjectFolderPathSchema,
165
+ }).strict();
166
+ export const AgentSectionSchema = z.object({
167
+ name: BoundedIdSchema,
168
+ role: BoundedIdSchema,
169
+ status: AgentStatusSchema,
170
+ activity: BoundedMessageSchema,
171
+ updated_at: TimestampSchema,
172
+ }).strict();
173
+ export const TaskSectionSchema = z.object({
174
+ id: BoundedIdSchema,
175
+ title: BoundedTitleSchema,
176
+ status: TaskStatusSchema,
177
+ agent: BoundedIdSchema.optional(),
178
+ note: BoundedMessageSchema.optional(),
179
+ }).strict();
180
+ export const LogEntrySchema = z.object({
181
+ t: TimestampSchema,
182
+ agent: BoundedIdSchema,
183
+ kind: LogKindSchema,
184
+ msg: BoundedMessageSchema,
185
+ }).strict();
186
+ export const FileChangeEntrySchema = z.object({
187
+ path: BoundedIdSchema,
188
+ change: FileChangeSchema,
189
+ adds: NonnegativeSafeIntegerSchema,
190
+ dels: NonnegativeSafeIntegerSchema,
191
+ }).strict();
192
+ export const TestsSectionSchema = z.object({
193
+ passed: NonnegativeSafeIntegerSchema,
194
+ failed: NonnegativeSafeIntegerSchema,
195
+ skipped: NonnegativeSafeIntegerSchema,
196
+ failing: z.array(BoundedMessageSchema).max(100),
197
+ last_run: TimestampSchema,
198
+ }).strict();
199
+ export const BlockerEntrySchema = z.object({
200
+ msg: BoundedMessageSchema,
201
+ raised_by: BoundedIdSchema,
202
+ needs_human: z.boolean(),
203
+ }).strict();
204
+ export const DecisionEntrySchema = z.object({
205
+ t: TimestampSchema,
206
+ by: BoundedIdSchema,
207
+ msg: BoundedMessageSchema,
208
+ }).strict();
209
+ // --- Producer document (task 0-1) ---------------------------------------
210
+ export const ProgressReportDocumentSchema = z.object({
211
+ schema_version: z.literal(PROGRESS_REPORT_SCHEMA_VERSION),
212
+ session: SessionSectionSchema,
213
+ agents: z.array(AgentSectionSchema).max(50).optional(),
214
+ tasks: z.array(TaskSectionSchema).max(200).optional(),
215
+ log: z.array(LogEntrySchema).max(200).optional(),
216
+ files: z.array(FileChangeEntrySchema).max(500).optional(),
217
+ tests: TestsSectionSchema.optional(),
218
+ blockers: z.array(BlockerEntrySchema).max(50).optional(),
219
+ decisions: z.array(DecisionEntrySchema).max(100).optional(),
220
+ }).strict();
221
+ //# sourceMappingURL=progress-report-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-report-contract.js","sourceRoot":"","sources":["../../src/dashboard/progress-report-contract.ts"],"names":[],"mappings":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