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,2778 @@
1
+ import { z } from "zod";
2
+ export declare const SESSION_LOG_V1_SCHEMA_VERSION: "session-log-v1";
3
+ declare const SessionLogOwnerV1Schema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
4
+ family: z.ZodLiteral<"workflow">;
5
+ runId: z.ZodString;
6
+ runGeneration: z.ZodString;
7
+ stageId: z.ZodOptional<z.ZodString>;
8
+ callId: z.ZodOptional<z.ZodString>;
9
+ attempt: z.ZodOptional<z.ZodNumber>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ family: "workflow";
12
+ runId: string;
13
+ runGeneration: string;
14
+ stageId?: string | undefined;
15
+ callId?: string | undefined;
16
+ attempt?: number | undefined;
17
+ }, {
18
+ family: "workflow";
19
+ runId: string;
20
+ runGeneration: string;
21
+ stageId?: string | undefined;
22
+ callId?: string | undefined;
23
+ attempt?: number | undefined;
24
+ }>, {
25
+ family: "workflow";
26
+ runId: string;
27
+ runGeneration: string;
28
+ stageId?: string | undefined;
29
+ callId?: string | undefined;
30
+ attempt?: number | undefined;
31
+ }, {
32
+ family: "workflow";
33
+ runId: string;
34
+ runGeneration: string;
35
+ stageId?: string | undefined;
36
+ callId?: string | undefined;
37
+ attempt?: number | undefined;
38
+ }>, z.ZodEffects<z.ZodObject<{
39
+ family: z.ZodLiteral<"activity">;
40
+ activityId: z.ZodString;
41
+ activityGeneration: z.ZodString;
42
+ sessionId: z.ZodOptional<z.ZodString>;
43
+ threadId: z.ZodOptional<z.ZodString>;
44
+ turnId: z.ZodOptional<z.ZodString>;
45
+ }, "strict", z.ZodTypeAny, {
46
+ activityId: string;
47
+ family: "activity";
48
+ activityGeneration: string;
49
+ sessionId?: string | undefined;
50
+ threadId?: string | undefined;
51
+ turnId?: string | undefined;
52
+ }, {
53
+ activityId: string;
54
+ family: "activity";
55
+ activityGeneration: string;
56
+ sessionId?: string | undefined;
57
+ threadId?: string | undefined;
58
+ turnId?: string | undefined;
59
+ }>, {
60
+ activityId: string;
61
+ family: "activity";
62
+ activityGeneration: string;
63
+ sessionId?: string | undefined;
64
+ threadId?: string | undefined;
65
+ turnId?: string | undefined;
66
+ }, {
67
+ activityId: string;
68
+ family: "activity";
69
+ activityGeneration: string;
70
+ sessionId?: string | undefined;
71
+ threadId?: string | undefined;
72
+ turnId?: string | undefined;
73
+ }>, z.ZodEffects<z.ZodObject<{
74
+ family: z.ZodLiteral<"context">;
75
+ contextRunId: z.ZodEffects<z.ZodString, string, string>;
76
+ contextGeneration: z.ZodString;
77
+ executor: z.ZodOptional<z.ZodEnum<["curator", "finalizer"]>>;
78
+ executionId: z.ZodOptional<z.ZodString>;
79
+ attempt: z.ZodOptional<z.ZodNumber>;
80
+ }, "strict", z.ZodTypeAny, {
81
+ family: "context";
82
+ contextRunId: string;
83
+ contextGeneration: string;
84
+ attempt?: number | undefined;
85
+ executor?: "curator" | "finalizer" | undefined;
86
+ executionId?: string | undefined;
87
+ }, {
88
+ family: "context";
89
+ contextRunId: string;
90
+ contextGeneration: string;
91
+ attempt?: number | undefined;
92
+ executor?: "curator" | "finalizer" | undefined;
93
+ executionId?: string | undefined;
94
+ }>, {
95
+ family: "context";
96
+ contextRunId: string;
97
+ contextGeneration: string;
98
+ attempt?: number | undefined;
99
+ executor?: "curator" | "finalizer" | undefined;
100
+ executionId?: string | undefined;
101
+ }, {
102
+ family: "context";
103
+ contextRunId: string;
104
+ contextGeneration: string;
105
+ attempt?: number | undefined;
106
+ executor?: "curator" | "finalizer" | undefined;
107
+ executionId?: string | undefined;
108
+ }>]>;
109
+ declare const NormalizedEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
110
+ kind: z.ZodLiteral<"user">;
111
+ content: z.ZodString;
112
+ }, "strict", z.ZodTypeAny, {
113
+ content: string;
114
+ kind: "user";
115
+ }, {
116
+ content: string;
117
+ kind: "user";
118
+ }>, z.ZodObject<{
119
+ kind: z.ZodLiteral<"assistant">;
120
+ content: z.ZodString;
121
+ }, "strict", z.ZodTypeAny, {
122
+ content: string;
123
+ kind: "assistant";
124
+ }, {
125
+ content: string;
126
+ kind: "assistant";
127
+ }>, z.ZodObject<{
128
+ kind: z.ZodLiteral<"tool_call">;
129
+ toolName: z.ZodString;
130
+ callId: z.ZodString;
131
+ summary: z.ZodString;
132
+ arguments: z.ZodOptional<z.ZodEffects<z.ZodObject<{
133
+ content: z.ZodEffects<z.ZodString, string, string>;
134
+ omission: z.ZodEnum<["none", "size_limit", "structure_limit", "invalid"]>;
135
+ }, "strict", z.ZodTypeAny, {
136
+ content: string;
137
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
138
+ }, {
139
+ content: string;
140
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
141
+ }>, {
142
+ content: string;
143
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
144
+ }, {
145
+ content: string;
146
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
147
+ }>>;
148
+ }, "strict", z.ZodTypeAny, {
149
+ summary: string;
150
+ kind: "tool_call";
151
+ callId: string;
152
+ toolName: string;
153
+ arguments?: {
154
+ content: string;
155
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
156
+ } | undefined;
157
+ }, {
158
+ summary: string;
159
+ kind: "tool_call";
160
+ callId: string;
161
+ toolName: string;
162
+ arguments?: {
163
+ content: string;
164
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
165
+ } | undefined;
166
+ }>, z.ZodObject<{
167
+ kind: z.ZodLiteral<"tool_result">;
168
+ toolName: z.ZodString;
169
+ callId: z.ZodString;
170
+ outcome: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
171
+ summary: z.ZodString;
172
+ }, "strict", z.ZodTypeAny, {
173
+ summary: string;
174
+ kind: "tool_result";
175
+ outcome: "succeeded" | "failed" | "cancelled";
176
+ callId: string;
177
+ toolName: string;
178
+ }, {
179
+ summary: string;
180
+ kind: "tool_result";
181
+ outcome: "succeeded" | "failed" | "cancelled";
182
+ callId: string;
183
+ toolName: string;
184
+ }>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"approval_request">;
186
+ approvalId: z.ZodString;
187
+ action: z.ZodString;
188
+ risk: z.ZodEnum<["low", "medium", "high"]>;
189
+ }, "strict", z.ZodTypeAny, {
190
+ kind: "approval_request";
191
+ approvalId: string;
192
+ action: string;
193
+ risk: "high" | "medium" | "low";
194
+ }, {
195
+ kind: "approval_request";
196
+ approvalId: string;
197
+ action: string;
198
+ risk: "high" | "medium" | "low";
199
+ }>, z.ZodObject<{
200
+ kind: z.ZodLiteral<"approval_resolution">;
201
+ approvalId: z.ZodString;
202
+ decision: z.ZodEnum<["approved", "denied", "cancelled"]>;
203
+ }, "strict", z.ZodTypeAny, {
204
+ decision: "cancelled" | "approved" | "denied";
205
+ kind: "approval_resolution";
206
+ approvalId: string;
207
+ }, {
208
+ decision: "cancelled" | "approved" | "denied";
209
+ kind: "approval_resolution";
210
+ approvalId: string;
211
+ }>, z.ZodObject<{
212
+ kind: z.ZodLiteral<"error">;
213
+ code: z.ZodString;
214
+ message: z.ZodString;
215
+ retryable: z.ZodBoolean;
216
+ }, "strict", z.ZodTypeAny, {
217
+ code: string;
218
+ message: string;
219
+ kind: "error";
220
+ retryable: boolean;
221
+ }, {
222
+ code: string;
223
+ message: string;
224
+ kind: "error";
225
+ retryable: boolean;
226
+ }>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"lifecycle">;
228
+ state: z.ZodEnum<["pending", "queued", "resolving", "running", "parsing", "awaiting_approval", "succeeded", "partial", "failed", "cancelled", "interrupted", "timeout", "completed"]>;
229
+ }, "strict", z.ZodTypeAny, {
230
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
231
+ kind: "lifecycle";
232
+ }, {
233
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
234
+ kind: "lifecycle";
235
+ }>, z.ZodObject<{
236
+ kind: z.ZodLiteral<"usage">;
237
+ completeness: z.ZodEnum<["complete", "partial", "unknown"]>;
238
+ inputTokens: z.ZodNullable<z.ZodNumber>;
239
+ outputTokens: z.ZodNullable<z.ZodNumber>;
240
+ cachedInputTokens: z.ZodNullable<z.ZodNumber>;
241
+ reasoningTokens: z.ZodNullable<z.ZodNumber>;
242
+ }, "strict", z.ZodTypeAny, {
243
+ kind: "usage";
244
+ completeness: "unknown" | "partial" | "complete";
245
+ inputTokens: number | null;
246
+ outputTokens: number | null;
247
+ cachedInputTokens: number | null;
248
+ reasoningTokens: number | null;
249
+ }, {
250
+ kind: "usage";
251
+ completeness: "unknown" | "partial" | "complete";
252
+ inputTokens: number | null;
253
+ outputTokens: number | null;
254
+ cachedInputTokens: number | null;
255
+ reasoningTokens: number | null;
256
+ }>, z.ZodObject<{
257
+ kind: z.ZodLiteral<"reasoning">;
258
+ summary: z.ZodString;
259
+ }, "strict", z.ZodTypeAny, {
260
+ summary: string;
261
+ kind: "reasoning";
262
+ }, {
263
+ summary: string;
264
+ kind: "reasoning";
265
+ }>, z.ZodObject<{
266
+ kind: z.ZodLiteral<"unknown">;
267
+ originalKind: z.ZodString;
268
+ summary: z.ZodString;
269
+ forwardCaptured: z.ZodLiteral<true>;
270
+ }, "strict", z.ZodTypeAny, {
271
+ summary: string;
272
+ kind: "unknown";
273
+ originalKind: string;
274
+ forwardCaptured: true;
275
+ }, {
276
+ summary: string;
277
+ kind: "unknown";
278
+ originalKind: string;
279
+ forwardCaptured: true;
280
+ }>]>, {
281
+ content: string;
282
+ kind: "user";
283
+ } | {
284
+ content: string;
285
+ kind: "assistant";
286
+ } | {
287
+ summary: string;
288
+ kind: "tool_call";
289
+ callId: string;
290
+ toolName: string;
291
+ arguments?: {
292
+ content: string;
293
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
294
+ } | undefined;
295
+ } | {
296
+ summary: string;
297
+ kind: "tool_result";
298
+ outcome: "succeeded" | "failed" | "cancelled";
299
+ callId: string;
300
+ toolName: string;
301
+ } | {
302
+ kind: "approval_request";
303
+ approvalId: string;
304
+ action: string;
305
+ risk: "high" | "medium" | "low";
306
+ } | {
307
+ decision: "cancelled" | "approved" | "denied";
308
+ kind: "approval_resolution";
309
+ approvalId: string;
310
+ } | {
311
+ code: string;
312
+ message: string;
313
+ kind: "error";
314
+ retryable: boolean;
315
+ } | {
316
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
317
+ kind: "lifecycle";
318
+ } | {
319
+ kind: "usage";
320
+ completeness: "unknown" | "partial" | "complete";
321
+ inputTokens: number | null;
322
+ outputTokens: number | null;
323
+ cachedInputTokens: number | null;
324
+ reasoningTokens: number | null;
325
+ } | {
326
+ summary: string;
327
+ kind: "reasoning";
328
+ } | {
329
+ summary: string;
330
+ kind: "unknown";
331
+ originalKind: string;
332
+ forwardCaptured: true;
333
+ }, {
334
+ content: string;
335
+ kind: "user";
336
+ } | {
337
+ content: string;
338
+ kind: "assistant";
339
+ } | {
340
+ summary: string;
341
+ kind: "tool_call";
342
+ callId: string;
343
+ toolName: string;
344
+ arguments?: {
345
+ content: string;
346
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
347
+ } | undefined;
348
+ } | {
349
+ summary: string;
350
+ kind: "tool_result";
351
+ outcome: "succeeded" | "failed" | "cancelled";
352
+ callId: string;
353
+ toolName: string;
354
+ } | {
355
+ kind: "approval_request";
356
+ approvalId: string;
357
+ action: string;
358
+ risk: "high" | "medium" | "low";
359
+ } | {
360
+ decision: "cancelled" | "approved" | "denied";
361
+ kind: "approval_resolution";
362
+ approvalId: string;
363
+ } | {
364
+ code: string;
365
+ message: string;
366
+ kind: "error";
367
+ retryable: boolean;
368
+ } | {
369
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
370
+ kind: "lifecycle";
371
+ } | {
372
+ kind: "usage";
373
+ completeness: "unknown" | "partial" | "complete";
374
+ inputTokens: number | null;
375
+ outputTokens: number | null;
376
+ cachedInputTokens: number | null;
377
+ reasoningTokens: number | null;
378
+ } | {
379
+ summary: string;
380
+ kind: "reasoning";
381
+ } | {
382
+ summary: string;
383
+ kind: "unknown";
384
+ originalKind: string;
385
+ forwardCaptured: true;
386
+ }>;
387
+ declare const SessionLogEventV1Schema: z.ZodEffects<z.ZodObject<{
388
+ schemaVersion: z.ZodLiteral<"session-log-v1">;
389
+ sequence: z.ZodNumber;
390
+ timestamp: z.ZodString;
391
+ producerFamily: z.ZodEnum<["workflow", "activity", "context"]>;
392
+ owner: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
393
+ family: z.ZodLiteral<"workflow">;
394
+ runId: z.ZodString;
395
+ runGeneration: z.ZodString;
396
+ stageId: z.ZodOptional<z.ZodString>;
397
+ callId: z.ZodOptional<z.ZodString>;
398
+ attempt: z.ZodOptional<z.ZodNumber>;
399
+ }, "strict", z.ZodTypeAny, {
400
+ family: "workflow";
401
+ runId: string;
402
+ runGeneration: string;
403
+ stageId?: string | undefined;
404
+ callId?: string | undefined;
405
+ attempt?: number | undefined;
406
+ }, {
407
+ family: "workflow";
408
+ runId: string;
409
+ runGeneration: string;
410
+ stageId?: string | undefined;
411
+ callId?: string | undefined;
412
+ attempt?: number | undefined;
413
+ }>, {
414
+ family: "workflow";
415
+ runId: string;
416
+ runGeneration: string;
417
+ stageId?: string | undefined;
418
+ callId?: string | undefined;
419
+ attempt?: number | undefined;
420
+ }, {
421
+ family: "workflow";
422
+ runId: string;
423
+ runGeneration: string;
424
+ stageId?: string | undefined;
425
+ callId?: string | undefined;
426
+ attempt?: number | undefined;
427
+ }>, z.ZodEffects<z.ZodObject<{
428
+ family: z.ZodLiteral<"activity">;
429
+ activityId: z.ZodString;
430
+ activityGeneration: z.ZodString;
431
+ sessionId: z.ZodOptional<z.ZodString>;
432
+ threadId: z.ZodOptional<z.ZodString>;
433
+ turnId: z.ZodOptional<z.ZodString>;
434
+ }, "strict", z.ZodTypeAny, {
435
+ activityId: string;
436
+ family: "activity";
437
+ activityGeneration: string;
438
+ sessionId?: string | undefined;
439
+ threadId?: string | undefined;
440
+ turnId?: string | undefined;
441
+ }, {
442
+ activityId: string;
443
+ family: "activity";
444
+ activityGeneration: string;
445
+ sessionId?: string | undefined;
446
+ threadId?: string | undefined;
447
+ turnId?: string | undefined;
448
+ }>, {
449
+ activityId: string;
450
+ family: "activity";
451
+ activityGeneration: string;
452
+ sessionId?: string | undefined;
453
+ threadId?: string | undefined;
454
+ turnId?: string | undefined;
455
+ }, {
456
+ activityId: string;
457
+ family: "activity";
458
+ activityGeneration: string;
459
+ sessionId?: string | undefined;
460
+ threadId?: string | undefined;
461
+ turnId?: string | undefined;
462
+ }>, z.ZodEffects<z.ZodObject<{
463
+ family: z.ZodLiteral<"context">;
464
+ contextRunId: z.ZodEffects<z.ZodString, string, string>;
465
+ contextGeneration: z.ZodString;
466
+ executor: z.ZodOptional<z.ZodEnum<["curator", "finalizer"]>>;
467
+ executionId: z.ZodOptional<z.ZodString>;
468
+ attempt: z.ZodOptional<z.ZodNumber>;
469
+ }, "strict", z.ZodTypeAny, {
470
+ family: "context";
471
+ contextRunId: string;
472
+ contextGeneration: string;
473
+ attempt?: number | undefined;
474
+ executor?: "curator" | "finalizer" | undefined;
475
+ executionId?: string | undefined;
476
+ }, {
477
+ family: "context";
478
+ contextRunId: string;
479
+ contextGeneration: string;
480
+ attempt?: number | undefined;
481
+ executor?: "curator" | "finalizer" | undefined;
482
+ executionId?: string | undefined;
483
+ }>, {
484
+ family: "context";
485
+ contextRunId: string;
486
+ contextGeneration: string;
487
+ attempt?: number | undefined;
488
+ executor?: "curator" | "finalizer" | undefined;
489
+ executionId?: string | undefined;
490
+ }, {
491
+ family: "context";
492
+ contextRunId: string;
493
+ contextGeneration: string;
494
+ attempt?: number | undefined;
495
+ executor?: "curator" | "finalizer" | undefined;
496
+ executionId?: string | undefined;
497
+ }>]>;
498
+ lane: z.ZodObject<{
499
+ laneId: z.ZodString;
500
+ }, "strict", z.ZodTypeAny, {
501
+ laneId: string;
502
+ }, {
503
+ laneId: string;
504
+ }>;
505
+ authority: z.ZodLiteral<"observability_only">;
506
+ redaction: z.ZodEffects<z.ZodObject<{
507
+ ran: z.ZodLiteral<true>;
508
+ status: z.ZodEnum<["no_matches", "redacted"]>;
509
+ count: z.ZodNumber;
510
+ coverage: z.ZodOptional<z.ZodLiteral<"pattern_best_effort">>;
511
+ }, "strict", z.ZodTypeAny, {
512
+ status: "no_matches" | "redacted";
513
+ ran: true;
514
+ count: number;
515
+ coverage?: "pattern_best_effort" | undefined;
516
+ }, {
517
+ status: "no_matches" | "redacted";
518
+ ran: true;
519
+ count: number;
520
+ coverage?: "pattern_best_effort" | undefined;
521
+ }>, {
522
+ status: "no_matches" | "redacted";
523
+ ran: true;
524
+ count: number;
525
+ coverage?: "pattern_best_effort" | undefined;
526
+ }, {
527
+ status: "no_matches" | "redacted";
528
+ ran: true;
529
+ count: number;
530
+ coverage?: "pattern_best_effort" | undefined;
531
+ }>;
532
+ truncation: z.ZodEnum<["none", "head", "tail", "middle"]>;
533
+ completeness: z.ZodEnum<["complete", "partial", "unknown"]>;
534
+ parseWarnings: z.ZodEffects<z.ZodArray<z.ZodEnum<["unknown_event_type", "provider_payload_omitted", "malformed_field_omitted", "unsupported_field_omitted", "content_truncated", "corrupt_capture"]>, "many">, ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[], ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[]>;
535
+ event: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
536
+ kind: z.ZodLiteral<"user">;
537
+ content: z.ZodString;
538
+ }, "strict", z.ZodTypeAny, {
539
+ content: string;
540
+ kind: "user";
541
+ }, {
542
+ content: string;
543
+ kind: "user";
544
+ }>, z.ZodObject<{
545
+ kind: z.ZodLiteral<"assistant">;
546
+ content: z.ZodString;
547
+ }, "strict", z.ZodTypeAny, {
548
+ content: string;
549
+ kind: "assistant";
550
+ }, {
551
+ content: string;
552
+ kind: "assistant";
553
+ }>, z.ZodObject<{
554
+ kind: z.ZodLiteral<"tool_call">;
555
+ toolName: z.ZodString;
556
+ callId: z.ZodString;
557
+ summary: z.ZodString;
558
+ arguments: z.ZodOptional<z.ZodEffects<z.ZodObject<{
559
+ content: z.ZodEffects<z.ZodString, string, string>;
560
+ omission: z.ZodEnum<["none", "size_limit", "structure_limit", "invalid"]>;
561
+ }, "strict", z.ZodTypeAny, {
562
+ content: string;
563
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
564
+ }, {
565
+ content: string;
566
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
567
+ }>, {
568
+ content: string;
569
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
570
+ }, {
571
+ content: string;
572
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
573
+ }>>;
574
+ }, "strict", z.ZodTypeAny, {
575
+ summary: string;
576
+ kind: "tool_call";
577
+ callId: string;
578
+ toolName: string;
579
+ arguments?: {
580
+ content: string;
581
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
582
+ } | undefined;
583
+ }, {
584
+ summary: string;
585
+ kind: "tool_call";
586
+ callId: string;
587
+ toolName: string;
588
+ arguments?: {
589
+ content: string;
590
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
591
+ } | undefined;
592
+ }>, z.ZodObject<{
593
+ kind: z.ZodLiteral<"tool_result">;
594
+ toolName: z.ZodString;
595
+ callId: z.ZodString;
596
+ outcome: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
597
+ summary: z.ZodString;
598
+ }, "strict", z.ZodTypeAny, {
599
+ summary: string;
600
+ kind: "tool_result";
601
+ outcome: "succeeded" | "failed" | "cancelled";
602
+ callId: string;
603
+ toolName: string;
604
+ }, {
605
+ summary: string;
606
+ kind: "tool_result";
607
+ outcome: "succeeded" | "failed" | "cancelled";
608
+ callId: string;
609
+ toolName: string;
610
+ }>, z.ZodObject<{
611
+ kind: z.ZodLiteral<"approval_request">;
612
+ approvalId: z.ZodString;
613
+ action: z.ZodString;
614
+ risk: z.ZodEnum<["low", "medium", "high"]>;
615
+ }, "strict", z.ZodTypeAny, {
616
+ kind: "approval_request";
617
+ approvalId: string;
618
+ action: string;
619
+ risk: "high" | "medium" | "low";
620
+ }, {
621
+ kind: "approval_request";
622
+ approvalId: string;
623
+ action: string;
624
+ risk: "high" | "medium" | "low";
625
+ }>, z.ZodObject<{
626
+ kind: z.ZodLiteral<"approval_resolution">;
627
+ approvalId: z.ZodString;
628
+ decision: z.ZodEnum<["approved", "denied", "cancelled"]>;
629
+ }, "strict", z.ZodTypeAny, {
630
+ decision: "cancelled" | "approved" | "denied";
631
+ kind: "approval_resolution";
632
+ approvalId: string;
633
+ }, {
634
+ decision: "cancelled" | "approved" | "denied";
635
+ kind: "approval_resolution";
636
+ approvalId: string;
637
+ }>, z.ZodObject<{
638
+ kind: z.ZodLiteral<"error">;
639
+ code: z.ZodString;
640
+ message: z.ZodString;
641
+ retryable: z.ZodBoolean;
642
+ }, "strict", z.ZodTypeAny, {
643
+ code: string;
644
+ message: string;
645
+ kind: "error";
646
+ retryable: boolean;
647
+ }, {
648
+ code: string;
649
+ message: string;
650
+ kind: "error";
651
+ retryable: boolean;
652
+ }>, z.ZodObject<{
653
+ kind: z.ZodLiteral<"lifecycle">;
654
+ state: z.ZodEnum<["pending", "queued", "resolving", "running", "parsing", "awaiting_approval", "succeeded", "partial", "failed", "cancelled", "interrupted", "timeout", "completed"]>;
655
+ }, "strict", z.ZodTypeAny, {
656
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
657
+ kind: "lifecycle";
658
+ }, {
659
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
660
+ kind: "lifecycle";
661
+ }>, z.ZodObject<{
662
+ kind: z.ZodLiteral<"usage">;
663
+ completeness: z.ZodEnum<["complete", "partial", "unknown"]>;
664
+ inputTokens: z.ZodNullable<z.ZodNumber>;
665
+ outputTokens: z.ZodNullable<z.ZodNumber>;
666
+ cachedInputTokens: z.ZodNullable<z.ZodNumber>;
667
+ reasoningTokens: z.ZodNullable<z.ZodNumber>;
668
+ }, "strict", z.ZodTypeAny, {
669
+ kind: "usage";
670
+ completeness: "unknown" | "partial" | "complete";
671
+ inputTokens: number | null;
672
+ outputTokens: number | null;
673
+ cachedInputTokens: number | null;
674
+ reasoningTokens: number | null;
675
+ }, {
676
+ kind: "usage";
677
+ completeness: "unknown" | "partial" | "complete";
678
+ inputTokens: number | null;
679
+ outputTokens: number | null;
680
+ cachedInputTokens: number | null;
681
+ reasoningTokens: number | null;
682
+ }>, z.ZodObject<{
683
+ kind: z.ZodLiteral<"reasoning">;
684
+ summary: z.ZodString;
685
+ }, "strict", z.ZodTypeAny, {
686
+ summary: string;
687
+ kind: "reasoning";
688
+ }, {
689
+ summary: string;
690
+ kind: "reasoning";
691
+ }>, z.ZodObject<{
692
+ kind: z.ZodLiteral<"unknown">;
693
+ originalKind: z.ZodString;
694
+ summary: z.ZodString;
695
+ forwardCaptured: z.ZodLiteral<true>;
696
+ }, "strict", z.ZodTypeAny, {
697
+ summary: string;
698
+ kind: "unknown";
699
+ originalKind: string;
700
+ forwardCaptured: true;
701
+ }, {
702
+ summary: string;
703
+ kind: "unknown";
704
+ originalKind: string;
705
+ forwardCaptured: true;
706
+ }>]>, {
707
+ content: string;
708
+ kind: "user";
709
+ } | {
710
+ content: string;
711
+ kind: "assistant";
712
+ } | {
713
+ summary: string;
714
+ kind: "tool_call";
715
+ callId: string;
716
+ toolName: string;
717
+ arguments?: {
718
+ content: string;
719
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
720
+ } | undefined;
721
+ } | {
722
+ summary: string;
723
+ kind: "tool_result";
724
+ outcome: "succeeded" | "failed" | "cancelled";
725
+ callId: string;
726
+ toolName: string;
727
+ } | {
728
+ kind: "approval_request";
729
+ approvalId: string;
730
+ action: string;
731
+ risk: "high" | "medium" | "low";
732
+ } | {
733
+ decision: "cancelled" | "approved" | "denied";
734
+ kind: "approval_resolution";
735
+ approvalId: string;
736
+ } | {
737
+ code: string;
738
+ message: string;
739
+ kind: "error";
740
+ retryable: boolean;
741
+ } | {
742
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
743
+ kind: "lifecycle";
744
+ } | {
745
+ kind: "usage";
746
+ completeness: "unknown" | "partial" | "complete";
747
+ inputTokens: number | null;
748
+ outputTokens: number | null;
749
+ cachedInputTokens: number | null;
750
+ reasoningTokens: number | null;
751
+ } | {
752
+ summary: string;
753
+ kind: "reasoning";
754
+ } | {
755
+ summary: string;
756
+ kind: "unknown";
757
+ originalKind: string;
758
+ forwardCaptured: true;
759
+ }, {
760
+ content: string;
761
+ kind: "user";
762
+ } | {
763
+ content: string;
764
+ kind: "assistant";
765
+ } | {
766
+ summary: string;
767
+ kind: "tool_call";
768
+ callId: string;
769
+ toolName: string;
770
+ arguments?: {
771
+ content: string;
772
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
773
+ } | undefined;
774
+ } | {
775
+ summary: string;
776
+ kind: "tool_result";
777
+ outcome: "succeeded" | "failed" | "cancelled";
778
+ callId: string;
779
+ toolName: string;
780
+ } | {
781
+ kind: "approval_request";
782
+ approvalId: string;
783
+ action: string;
784
+ risk: "high" | "medium" | "low";
785
+ } | {
786
+ decision: "cancelled" | "approved" | "denied";
787
+ kind: "approval_resolution";
788
+ approvalId: string;
789
+ } | {
790
+ code: string;
791
+ message: string;
792
+ kind: "error";
793
+ retryable: boolean;
794
+ } | {
795
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
796
+ kind: "lifecycle";
797
+ } | {
798
+ kind: "usage";
799
+ completeness: "unknown" | "partial" | "complete";
800
+ inputTokens: number | null;
801
+ outputTokens: number | null;
802
+ cachedInputTokens: number | null;
803
+ reasoningTokens: number | null;
804
+ } | {
805
+ summary: string;
806
+ kind: "reasoning";
807
+ } | {
808
+ summary: string;
809
+ kind: "unknown";
810
+ originalKind: string;
811
+ forwardCaptured: true;
812
+ }>;
813
+ }, "strict", z.ZodTypeAny, {
814
+ schemaVersion: "session-log-v1";
815
+ completeness: "unknown" | "partial" | "complete";
816
+ sequence: number;
817
+ timestamp: string;
818
+ producerFamily: "workflow" | "context" | "activity";
819
+ owner: {
820
+ family: "workflow";
821
+ runId: string;
822
+ runGeneration: string;
823
+ stageId?: string | undefined;
824
+ callId?: string | undefined;
825
+ attempt?: number | undefined;
826
+ } | {
827
+ activityId: string;
828
+ family: "activity";
829
+ activityGeneration: string;
830
+ sessionId?: string | undefined;
831
+ threadId?: string | undefined;
832
+ turnId?: string | undefined;
833
+ } | {
834
+ family: "context";
835
+ contextRunId: string;
836
+ contextGeneration: string;
837
+ attempt?: number | undefined;
838
+ executor?: "curator" | "finalizer" | undefined;
839
+ executionId?: string | undefined;
840
+ };
841
+ lane: {
842
+ laneId: string;
843
+ };
844
+ authority: "observability_only";
845
+ redaction: {
846
+ status: "no_matches" | "redacted";
847
+ ran: true;
848
+ count: number;
849
+ coverage?: "pattern_best_effort" | undefined;
850
+ };
851
+ truncation: "none" | "head" | "tail" | "middle";
852
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
853
+ event: {
854
+ content: string;
855
+ kind: "user";
856
+ } | {
857
+ content: string;
858
+ kind: "assistant";
859
+ } | {
860
+ summary: string;
861
+ kind: "tool_call";
862
+ callId: string;
863
+ toolName: string;
864
+ arguments?: {
865
+ content: string;
866
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
867
+ } | undefined;
868
+ } | {
869
+ summary: string;
870
+ kind: "tool_result";
871
+ outcome: "succeeded" | "failed" | "cancelled";
872
+ callId: string;
873
+ toolName: string;
874
+ } | {
875
+ kind: "approval_request";
876
+ approvalId: string;
877
+ action: string;
878
+ risk: "high" | "medium" | "low";
879
+ } | {
880
+ decision: "cancelled" | "approved" | "denied";
881
+ kind: "approval_resolution";
882
+ approvalId: string;
883
+ } | {
884
+ code: string;
885
+ message: string;
886
+ kind: "error";
887
+ retryable: boolean;
888
+ } | {
889
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
890
+ kind: "lifecycle";
891
+ } | {
892
+ kind: "usage";
893
+ completeness: "unknown" | "partial" | "complete";
894
+ inputTokens: number | null;
895
+ outputTokens: number | null;
896
+ cachedInputTokens: number | null;
897
+ reasoningTokens: number | null;
898
+ } | {
899
+ summary: string;
900
+ kind: "reasoning";
901
+ } | {
902
+ summary: string;
903
+ kind: "unknown";
904
+ originalKind: string;
905
+ forwardCaptured: true;
906
+ };
907
+ }, {
908
+ schemaVersion: "session-log-v1";
909
+ completeness: "unknown" | "partial" | "complete";
910
+ sequence: number;
911
+ timestamp: string;
912
+ producerFamily: "workflow" | "context" | "activity";
913
+ owner: {
914
+ family: "workflow";
915
+ runId: string;
916
+ runGeneration: string;
917
+ stageId?: string | undefined;
918
+ callId?: string | undefined;
919
+ attempt?: number | undefined;
920
+ } | {
921
+ activityId: string;
922
+ family: "activity";
923
+ activityGeneration: string;
924
+ sessionId?: string | undefined;
925
+ threadId?: string | undefined;
926
+ turnId?: string | undefined;
927
+ } | {
928
+ family: "context";
929
+ contextRunId: string;
930
+ contextGeneration: string;
931
+ attempt?: number | undefined;
932
+ executor?: "curator" | "finalizer" | undefined;
933
+ executionId?: string | undefined;
934
+ };
935
+ lane: {
936
+ laneId: string;
937
+ };
938
+ authority: "observability_only";
939
+ redaction: {
940
+ status: "no_matches" | "redacted";
941
+ ran: true;
942
+ count: number;
943
+ coverage?: "pattern_best_effort" | undefined;
944
+ };
945
+ truncation: "none" | "head" | "tail" | "middle";
946
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
947
+ event: {
948
+ content: string;
949
+ kind: "user";
950
+ } | {
951
+ content: string;
952
+ kind: "assistant";
953
+ } | {
954
+ summary: string;
955
+ kind: "tool_call";
956
+ callId: string;
957
+ toolName: string;
958
+ arguments?: {
959
+ content: string;
960
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
961
+ } | undefined;
962
+ } | {
963
+ summary: string;
964
+ kind: "tool_result";
965
+ outcome: "succeeded" | "failed" | "cancelled";
966
+ callId: string;
967
+ toolName: string;
968
+ } | {
969
+ kind: "approval_request";
970
+ approvalId: string;
971
+ action: string;
972
+ risk: "high" | "medium" | "low";
973
+ } | {
974
+ decision: "cancelled" | "approved" | "denied";
975
+ kind: "approval_resolution";
976
+ approvalId: string;
977
+ } | {
978
+ code: string;
979
+ message: string;
980
+ kind: "error";
981
+ retryable: boolean;
982
+ } | {
983
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
984
+ kind: "lifecycle";
985
+ } | {
986
+ kind: "usage";
987
+ completeness: "unknown" | "partial" | "complete";
988
+ inputTokens: number | null;
989
+ outputTokens: number | null;
990
+ cachedInputTokens: number | null;
991
+ reasoningTokens: number | null;
992
+ } | {
993
+ summary: string;
994
+ kind: "reasoning";
995
+ } | {
996
+ summary: string;
997
+ kind: "unknown";
998
+ originalKind: string;
999
+ forwardCaptured: true;
1000
+ };
1001
+ }>, {
1002
+ schemaVersion: "session-log-v1";
1003
+ completeness: "unknown" | "partial" | "complete";
1004
+ sequence: number;
1005
+ timestamp: string;
1006
+ producerFamily: "workflow" | "context" | "activity";
1007
+ owner: {
1008
+ family: "workflow";
1009
+ runId: string;
1010
+ runGeneration: string;
1011
+ stageId?: string | undefined;
1012
+ callId?: string | undefined;
1013
+ attempt?: number | undefined;
1014
+ } | {
1015
+ activityId: string;
1016
+ family: "activity";
1017
+ activityGeneration: string;
1018
+ sessionId?: string | undefined;
1019
+ threadId?: string | undefined;
1020
+ turnId?: string | undefined;
1021
+ } | {
1022
+ family: "context";
1023
+ contextRunId: string;
1024
+ contextGeneration: string;
1025
+ attempt?: number | undefined;
1026
+ executor?: "curator" | "finalizer" | undefined;
1027
+ executionId?: string | undefined;
1028
+ };
1029
+ lane: {
1030
+ laneId: string;
1031
+ };
1032
+ authority: "observability_only";
1033
+ redaction: {
1034
+ status: "no_matches" | "redacted";
1035
+ ran: true;
1036
+ count: number;
1037
+ coverage?: "pattern_best_effort" | undefined;
1038
+ };
1039
+ truncation: "none" | "head" | "tail" | "middle";
1040
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
1041
+ event: {
1042
+ content: string;
1043
+ kind: "user";
1044
+ } | {
1045
+ content: string;
1046
+ kind: "assistant";
1047
+ } | {
1048
+ summary: string;
1049
+ kind: "tool_call";
1050
+ callId: string;
1051
+ toolName: string;
1052
+ arguments?: {
1053
+ content: string;
1054
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1055
+ } | undefined;
1056
+ } | {
1057
+ summary: string;
1058
+ kind: "tool_result";
1059
+ outcome: "succeeded" | "failed" | "cancelled";
1060
+ callId: string;
1061
+ toolName: string;
1062
+ } | {
1063
+ kind: "approval_request";
1064
+ approvalId: string;
1065
+ action: string;
1066
+ risk: "high" | "medium" | "low";
1067
+ } | {
1068
+ decision: "cancelled" | "approved" | "denied";
1069
+ kind: "approval_resolution";
1070
+ approvalId: string;
1071
+ } | {
1072
+ code: string;
1073
+ message: string;
1074
+ kind: "error";
1075
+ retryable: boolean;
1076
+ } | {
1077
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1078
+ kind: "lifecycle";
1079
+ } | {
1080
+ kind: "usage";
1081
+ completeness: "unknown" | "partial" | "complete";
1082
+ inputTokens: number | null;
1083
+ outputTokens: number | null;
1084
+ cachedInputTokens: number | null;
1085
+ reasoningTokens: number | null;
1086
+ } | {
1087
+ summary: string;
1088
+ kind: "reasoning";
1089
+ } | {
1090
+ summary: string;
1091
+ kind: "unknown";
1092
+ originalKind: string;
1093
+ forwardCaptured: true;
1094
+ };
1095
+ }, {
1096
+ schemaVersion: "session-log-v1";
1097
+ completeness: "unknown" | "partial" | "complete";
1098
+ sequence: number;
1099
+ timestamp: string;
1100
+ producerFamily: "workflow" | "context" | "activity";
1101
+ owner: {
1102
+ family: "workflow";
1103
+ runId: string;
1104
+ runGeneration: string;
1105
+ stageId?: string | undefined;
1106
+ callId?: string | undefined;
1107
+ attempt?: number | undefined;
1108
+ } | {
1109
+ activityId: string;
1110
+ family: "activity";
1111
+ activityGeneration: string;
1112
+ sessionId?: string | undefined;
1113
+ threadId?: string | undefined;
1114
+ turnId?: string | undefined;
1115
+ } | {
1116
+ family: "context";
1117
+ contextRunId: string;
1118
+ contextGeneration: string;
1119
+ attempt?: number | undefined;
1120
+ executor?: "curator" | "finalizer" | undefined;
1121
+ executionId?: string | undefined;
1122
+ };
1123
+ lane: {
1124
+ laneId: string;
1125
+ };
1126
+ authority: "observability_only";
1127
+ redaction: {
1128
+ status: "no_matches" | "redacted";
1129
+ ran: true;
1130
+ count: number;
1131
+ coverage?: "pattern_best_effort" | undefined;
1132
+ };
1133
+ truncation: "none" | "head" | "tail" | "middle";
1134
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
1135
+ event: {
1136
+ content: string;
1137
+ kind: "user";
1138
+ } | {
1139
+ content: string;
1140
+ kind: "assistant";
1141
+ } | {
1142
+ summary: string;
1143
+ kind: "tool_call";
1144
+ callId: string;
1145
+ toolName: string;
1146
+ arguments?: {
1147
+ content: string;
1148
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1149
+ } | undefined;
1150
+ } | {
1151
+ summary: string;
1152
+ kind: "tool_result";
1153
+ outcome: "succeeded" | "failed" | "cancelled";
1154
+ callId: string;
1155
+ toolName: string;
1156
+ } | {
1157
+ kind: "approval_request";
1158
+ approvalId: string;
1159
+ action: string;
1160
+ risk: "high" | "medium" | "low";
1161
+ } | {
1162
+ decision: "cancelled" | "approved" | "denied";
1163
+ kind: "approval_resolution";
1164
+ approvalId: string;
1165
+ } | {
1166
+ code: string;
1167
+ message: string;
1168
+ kind: "error";
1169
+ retryable: boolean;
1170
+ } | {
1171
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1172
+ kind: "lifecycle";
1173
+ } | {
1174
+ kind: "usage";
1175
+ completeness: "unknown" | "partial" | "complete";
1176
+ inputTokens: number | null;
1177
+ outputTokens: number | null;
1178
+ cachedInputTokens: number | null;
1179
+ reasoningTokens: number | null;
1180
+ } | {
1181
+ summary: string;
1182
+ kind: "reasoning";
1183
+ } | {
1184
+ summary: string;
1185
+ kind: "unknown";
1186
+ originalKind: string;
1187
+ forwardCaptured: true;
1188
+ };
1189
+ }>;
1190
+ declare const AvailabilitySchema: z.ZodDiscriminatedUnion<"availability", [z.ZodObject<{
1191
+ availability: z.ZodLiteral<"available">;
1192
+ }, "strict", z.ZodTypeAny, {
1193
+ availability: "available";
1194
+ }, {
1195
+ availability: "available";
1196
+ }>, z.ZodObject<{
1197
+ availability: z.ZodLiteral<"degraded">;
1198
+ reasons: z.ZodEffects<z.ZodArray<z.ZodEnum<["retention_gap", "truncated", "incomplete_capture", "parse_warning", "corrupt_capture"]>, "many">, ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[], ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[]>;
1199
+ }, "strict", z.ZodTypeAny, {
1200
+ availability: "degraded";
1201
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
1202
+ }, {
1203
+ availability: "degraded";
1204
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
1205
+ }>, z.ZodObject<{
1206
+ availability: z.ZodLiteral<"not_retained">;
1207
+ reason: z.ZodEnum<["retention_disabled", "retention_expired", "producer_did_not_retain"]>;
1208
+ }, "strict", z.ZodTypeAny, {
1209
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
1210
+ availability: "not_retained";
1211
+ }, {
1212
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
1213
+ availability: "not_retained";
1214
+ }>, z.ZodObject<{
1215
+ availability: z.ZodLiteral<"not_executed">;
1216
+ reason: z.ZodEnum<["not_requested", "disabled", "skipped", "cancelled_before_start"]>;
1217
+ }, "strict", z.ZodTypeAny, {
1218
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
1219
+ availability: "not_executed";
1220
+ }, {
1221
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
1222
+ availability: "not_executed";
1223
+ }>, z.ZodObject<{
1224
+ availability: z.ZodLiteral<"pruned">;
1225
+ reason: z.ZodEnum<["retention_limit", "age_limit", "size_limit", "event_limit", "operator_request"]>;
1226
+ }, "strict", z.ZodTypeAny, {
1227
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
1228
+ availability: "pruned";
1229
+ }, {
1230
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
1231
+ availability: "pruned";
1232
+ }>]>;
1233
+ declare const SessionLogPageV1Schema: z.ZodEffects<z.ZodObject<{
1234
+ schemaVersion: z.ZodLiteral<"session-log-v1">;
1235
+ owner: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
1236
+ family: z.ZodLiteral<"workflow">;
1237
+ runId: z.ZodString;
1238
+ runGeneration: z.ZodString;
1239
+ stageId: z.ZodOptional<z.ZodString>;
1240
+ callId: z.ZodOptional<z.ZodString>;
1241
+ attempt: z.ZodOptional<z.ZodNumber>;
1242
+ }, "strict", z.ZodTypeAny, {
1243
+ family: "workflow";
1244
+ runId: string;
1245
+ runGeneration: string;
1246
+ stageId?: string | undefined;
1247
+ callId?: string | undefined;
1248
+ attempt?: number | undefined;
1249
+ }, {
1250
+ family: "workflow";
1251
+ runId: string;
1252
+ runGeneration: string;
1253
+ stageId?: string | undefined;
1254
+ callId?: string | undefined;
1255
+ attempt?: number | undefined;
1256
+ }>, {
1257
+ family: "workflow";
1258
+ runId: string;
1259
+ runGeneration: string;
1260
+ stageId?: string | undefined;
1261
+ callId?: string | undefined;
1262
+ attempt?: number | undefined;
1263
+ }, {
1264
+ family: "workflow";
1265
+ runId: string;
1266
+ runGeneration: string;
1267
+ stageId?: string | undefined;
1268
+ callId?: string | undefined;
1269
+ attempt?: number | undefined;
1270
+ }>, z.ZodEffects<z.ZodObject<{
1271
+ family: z.ZodLiteral<"activity">;
1272
+ activityId: z.ZodString;
1273
+ activityGeneration: z.ZodString;
1274
+ sessionId: z.ZodOptional<z.ZodString>;
1275
+ threadId: z.ZodOptional<z.ZodString>;
1276
+ turnId: z.ZodOptional<z.ZodString>;
1277
+ }, "strict", z.ZodTypeAny, {
1278
+ activityId: string;
1279
+ family: "activity";
1280
+ activityGeneration: string;
1281
+ sessionId?: string | undefined;
1282
+ threadId?: string | undefined;
1283
+ turnId?: string | undefined;
1284
+ }, {
1285
+ activityId: string;
1286
+ family: "activity";
1287
+ activityGeneration: string;
1288
+ sessionId?: string | undefined;
1289
+ threadId?: string | undefined;
1290
+ turnId?: string | undefined;
1291
+ }>, {
1292
+ activityId: string;
1293
+ family: "activity";
1294
+ activityGeneration: string;
1295
+ sessionId?: string | undefined;
1296
+ threadId?: string | undefined;
1297
+ turnId?: string | undefined;
1298
+ }, {
1299
+ activityId: string;
1300
+ family: "activity";
1301
+ activityGeneration: string;
1302
+ sessionId?: string | undefined;
1303
+ threadId?: string | undefined;
1304
+ turnId?: string | undefined;
1305
+ }>, z.ZodEffects<z.ZodObject<{
1306
+ family: z.ZodLiteral<"context">;
1307
+ contextRunId: z.ZodEffects<z.ZodString, string, string>;
1308
+ contextGeneration: z.ZodString;
1309
+ executor: z.ZodOptional<z.ZodEnum<["curator", "finalizer"]>>;
1310
+ executionId: z.ZodOptional<z.ZodString>;
1311
+ attempt: z.ZodOptional<z.ZodNumber>;
1312
+ }, "strict", z.ZodTypeAny, {
1313
+ family: "context";
1314
+ contextRunId: string;
1315
+ contextGeneration: string;
1316
+ attempt?: number | undefined;
1317
+ executor?: "curator" | "finalizer" | undefined;
1318
+ executionId?: string | undefined;
1319
+ }, {
1320
+ family: "context";
1321
+ contextRunId: string;
1322
+ contextGeneration: string;
1323
+ attempt?: number | undefined;
1324
+ executor?: "curator" | "finalizer" | undefined;
1325
+ executionId?: string | undefined;
1326
+ }>, {
1327
+ family: "context";
1328
+ contextRunId: string;
1329
+ contextGeneration: string;
1330
+ attempt?: number | undefined;
1331
+ executor?: "curator" | "finalizer" | undefined;
1332
+ executionId?: string | undefined;
1333
+ }, {
1334
+ family: "context";
1335
+ contextRunId: string;
1336
+ contextGeneration: string;
1337
+ attempt?: number | undefined;
1338
+ executor?: "curator" | "finalizer" | undefined;
1339
+ executionId?: string | undefined;
1340
+ }>]>;
1341
+ lane: z.ZodObject<{
1342
+ laneId: z.ZodString;
1343
+ }, "strict", z.ZodTypeAny, {
1344
+ laneId: string;
1345
+ }, {
1346
+ laneId: string;
1347
+ }>;
1348
+ availability: z.ZodDiscriminatedUnion<"availability", [z.ZodObject<{
1349
+ availability: z.ZodLiteral<"available">;
1350
+ }, "strict", z.ZodTypeAny, {
1351
+ availability: "available";
1352
+ }, {
1353
+ availability: "available";
1354
+ }>, z.ZodObject<{
1355
+ availability: z.ZodLiteral<"degraded">;
1356
+ reasons: z.ZodEffects<z.ZodArray<z.ZodEnum<["retention_gap", "truncated", "incomplete_capture", "parse_warning", "corrupt_capture"]>, "many">, ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[], ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[]>;
1357
+ }, "strict", z.ZodTypeAny, {
1358
+ availability: "degraded";
1359
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
1360
+ }, {
1361
+ availability: "degraded";
1362
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
1363
+ }>, z.ZodObject<{
1364
+ availability: z.ZodLiteral<"not_retained">;
1365
+ reason: z.ZodEnum<["retention_disabled", "retention_expired", "producer_did_not_retain"]>;
1366
+ }, "strict", z.ZodTypeAny, {
1367
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
1368
+ availability: "not_retained";
1369
+ }, {
1370
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
1371
+ availability: "not_retained";
1372
+ }>, z.ZodObject<{
1373
+ availability: z.ZodLiteral<"not_executed">;
1374
+ reason: z.ZodEnum<["not_requested", "disabled", "skipped", "cancelled_before_start"]>;
1375
+ }, "strict", z.ZodTypeAny, {
1376
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
1377
+ availability: "not_executed";
1378
+ }, {
1379
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
1380
+ availability: "not_executed";
1381
+ }>, z.ZodObject<{
1382
+ availability: z.ZodLiteral<"pruned">;
1383
+ reason: z.ZodEnum<["retention_limit", "age_limit", "size_limit", "event_limit", "operator_request"]>;
1384
+ }, "strict", z.ZodTypeAny, {
1385
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
1386
+ availability: "pruned";
1387
+ }, {
1388
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
1389
+ availability: "pruned";
1390
+ }>]>;
1391
+ requestedSequence: z.ZodNumber;
1392
+ floorSequence: z.ZodNumber;
1393
+ nextSequence: z.ZodNumber;
1394
+ truncated: z.ZodBoolean;
1395
+ events: z.ZodArray<z.ZodEffects<z.ZodObject<{
1396
+ schemaVersion: z.ZodLiteral<"session-log-v1">;
1397
+ sequence: z.ZodNumber;
1398
+ timestamp: z.ZodString;
1399
+ producerFamily: z.ZodEnum<["workflow", "activity", "context"]>;
1400
+ owner: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
1401
+ family: z.ZodLiteral<"workflow">;
1402
+ runId: z.ZodString;
1403
+ runGeneration: z.ZodString;
1404
+ stageId: z.ZodOptional<z.ZodString>;
1405
+ callId: z.ZodOptional<z.ZodString>;
1406
+ attempt: z.ZodOptional<z.ZodNumber>;
1407
+ }, "strict", z.ZodTypeAny, {
1408
+ family: "workflow";
1409
+ runId: string;
1410
+ runGeneration: string;
1411
+ stageId?: string | undefined;
1412
+ callId?: string | undefined;
1413
+ attempt?: number | undefined;
1414
+ }, {
1415
+ family: "workflow";
1416
+ runId: string;
1417
+ runGeneration: string;
1418
+ stageId?: string | undefined;
1419
+ callId?: string | undefined;
1420
+ attempt?: number | undefined;
1421
+ }>, {
1422
+ family: "workflow";
1423
+ runId: string;
1424
+ runGeneration: string;
1425
+ stageId?: string | undefined;
1426
+ callId?: string | undefined;
1427
+ attempt?: number | undefined;
1428
+ }, {
1429
+ family: "workflow";
1430
+ runId: string;
1431
+ runGeneration: string;
1432
+ stageId?: string | undefined;
1433
+ callId?: string | undefined;
1434
+ attempt?: number | undefined;
1435
+ }>, z.ZodEffects<z.ZodObject<{
1436
+ family: z.ZodLiteral<"activity">;
1437
+ activityId: z.ZodString;
1438
+ activityGeneration: z.ZodString;
1439
+ sessionId: z.ZodOptional<z.ZodString>;
1440
+ threadId: z.ZodOptional<z.ZodString>;
1441
+ turnId: z.ZodOptional<z.ZodString>;
1442
+ }, "strict", z.ZodTypeAny, {
1443
+ activityId: string;
1444
+ family: "activity";
1445
+ activityGeneration: string;
1446
+ sessionId?: string | undefined;
1447
+ threadId?: string | undefined;
1448
+ turnId?: string | undefined;
1449
+ }, {
1450
+ activityId: string;
1451
+ family: "activity";
1452
+ activityGeneration: string;
1453
+ sessionId?: string | undefined;
1454
+ threadId?: string | undefined;
1455
+ turnId?: string | undefined;
1456
+ }>, {
1457
+ activityId: string;
1458
+ family: "activity";
1459
+ activityGeneration: string;
1460
+ sessionId?: string | undefined;
1461
+ threadId?: string | undefined;
1462
+ turnId?: string | undefined;
1463
+ }, {
1464
+ activityId: string;
1465
+ family: "activity";
1466
+ activityGeneration: string;
1467
+ sessionId?: string | undefined;
1468
+ threadId?: string | undefined;
1469
+ turnId?: string | undefined;
1470
+ }>, z.ZodEffects<z.ZodObject<{
1471
+ family: z.ZodLiteral<"context">;
1472
+ contextRunId: z.ZodEffects<z.ZodString, string, string>;
1473
+ contextGeneration: z.ZodString;
1474
+ executor: z.ZodOptional<z.ZodEnum<["curator", "finalizer"]>>;
1475
+ executionId: z.ZodOptional<z.ZodString>;
1476
+ attempt: z.ZodOptional<z.ZodNumber>;
1477
+ }, "strict", z.ZodTypeAny, {
1478
+ family: "context";
1479
+ contextRunId: string;
1480
+ contextGeneration: string;
1481
+ attempt?: number | undefined;
1482
+ executor?: "curator" | "finalizer" | undefined;
1483
+ executionId?: string | undefined;
1484
+ }, {
1485
+ family: "context";
1486
+ contextRunId: string;
1487
+ contextGeneration: string;
1488
+ attempt?: number | undefined;
1489
+ executor?: "curator" | "finalizer" | undefined;
1490
+ executionId?: string | undefined;
1491
+ }>, {
1492
+ family: "context";
1493
+ contextRunId: string;
1494
+ contextGeneration: string;
1495
+ attempt?: number | undefined;
1496
+ executor?: "curator" | "finalizer" | undefined;
1497
+ executionId?: string | undefined;
1498
+ }, {
1499
+ family: "context";
1500
+ contextRunId: string;
1501
+ contextGeneration: string;
1502
+ attempt?: number | undefined;
1503
+ executor?: "curator" | "finalizer" | undefined;
1504
+ executionId?: string | undefined;
1505
+ }>]>;
1506
+ lane: z.ZodObject<{
1507
+ laneId: z.ZodString;
1508
+ }, "strict", z.ZodTypeAny, {
1509
+ laneId: string;
1510
+ }, {
1511
+ laneId: string;
1512
+ }>;
1513
+ authority: z.ZodLiteral<"observability_only">;
1514
+ redaction: z.ZodEffects<z.ZodObject<{
1515
+ ran: z.ZodLiteral<true>;
1516
+ status: z.ZodEnum<["no_matches", "redacted"]>;
1517
+ count: z.ZodNumber;
1518
+ coverage: z.ZodOptional<z.ZodLiteral<"pattern_best_effort">>;
1519
+ }, "strict", z.ZodTypeAny, {
1520
+ status: "no_matches" | "redacted";
1521
+ ran: true;
1522
+ count: number;
1523
+ coverage?: "pattern_best_effort" | undefined;
1524
+ }, {
1525
+ status: "no_matches" | "redacted";
1526
+ ran: true;
1527
+ count: number;
1528
+ coverage?: "pattern_best_effort" | undefined;
1529
+ }>, {
1530
+ status: "no_matches" | "redacted";
1531
+ ran: true;
1532
+ count: number;
1533
+ coverage?: "pattern_best_effort" | undefined;
1534
+ }, {
1535
+ status: "no_matches" | "redacted";
1536
+ ran: true;
1537
+ count: number;
1538
+ coverage?: "pattern_best_effort" | undefined;
1539
+ }>;
1540
+ truncation: z.ZodEnum<["none", "head", "tail", "middle"]>;
1541
+ completeness: z.ZodEnum<["complete", "partial", "unknown"]>;
1542
+ parseWarnings: z.ZodEffects<z.ZodArray<z.ZodEnum<["unknown_event_type", "provider_payload_omitted", "malformed_field_omitted", "unsupported_field_omitted", "content_truncated", "corrupt_capture"]>, "many">, ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[], ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[]>;
1543
+ event: z.ZodEffects<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1544
+ kind: z.ZodLiteral<"user">;
1545
+ content: z.ZodString;
1546
+ }, "strict", z.ZodTypeAny, {
1547
+ content: string;
1548
+ kind: "user";
1549
+ }, {
1550
+ content: string;
1551
+ kind: "user";
1552
+ }>, z.ZodObject<{
1553
+ kind: z.ZodLiteral<"assistant">;
1554
+ content: z.ZodString;
1555
+ }, "strict", z.ZodTypeAny, {
1556
+ content: string;
1557
+ kind: "assistant";
1558
+ }, {
1559
+ content: string;
1560
+ kind: "assistant";
1561
+ }>, z.ZodObject<{
1562
+ kind: z.ZodLiteral<"tool_call">;
1563
+ toolName: z.ZodString;
1564
+ callId: z.ZodString;
1565
+ summary: z.ZodString;
1566
+ arguments: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1567
+ content: z.ZodEffects<z.ZodString, string, string>;
1568
+ omission: z.ZodEnum<["none", "size_limit", "structure_limit", "invalid"]>;
1569
+ }, "strict", z.ZodTypeAny, {
1570
+ content: string;
1571
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1572
+ }, {
1573
+ content: string;
1574
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1575
+ }>, {
1576
+ content: string;
1577
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1578
+ }, {
1579
+ content: string;
1580
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1581
+ }>>;
1582
+ }, "strict", z.ZodTypeAny, {
1583
+ summary: string;
1584
+ kind: "tool_call";
1585
+ callId: string;
1586
+ toolName: string;
1587
+ arguments?: {
1588
+ content: string;
1589
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1590
+ } | undefined;
1591
+ }, {
1592
+ summary: string;
1593
+ kind: "tool_call";
1594
+ callId: string;
1595
+ toolName: string;
1596
+ arguments?: {
1597
+ content: string;
1598
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1599
+ } | undefined;
1600
+ }>, z.ZodObject<{
1601
+ kind: z.ZodLiteral<"tool_result">;
1602
+ toolName: z.ZodString;
1603
+ callId: z.ZodString;
1604
+ outcome: z.ZodEnum<["succeeded", "failed", "cancelled"]>;
1605
+ summary: z.ZodString;
1606
+ }, "strict", z.ZodTypeAny, {
1607
+ summary: string;
1608
+ kind: "tool_result";
1609
+ outcome: "succeeded" | "failed" | "cancelled";
1610
+ callId: string;
1611
+ toolName: string;
1612
+ }, {
1613
+ summary: string;
1614
+ kind: "tool_result";
1615
+ outcome: "succeeded" | "failed" | "cancelled";
1616
+ callId: string;
1617
+ toolName: string;
1618
+ }>, z.ZodObject<{
1619
+ kind: z.ZodLiteral<"approval_request">;
1620
+ approvalId: z.ZodString;
1621
+ action: z.ZodString;
1622
+ risk: z.ZodEnum<["low", "medium", "high"]>;
1623
+ }, "strict", z.ZodTypeAny, {
1624
+ kind: "approval_request";
1625
+ approvalId: string;
1626
+ action: string;
1627
+ risk: "high" | "medium" | "low";
1628
+ }, {
1629
+ kind: "approval_request";
1630
+ approvalId: string;
1631
+ action: string;
1632
+ risk: "high" | "medium" | "low";
1633
+ }>, z.ZodObject<{
1634
+ kind: z.ZodLiteral<"approval_resolution">;
1635
+ approvalId: z.ZodString;
1636
+ decision: z.ZodEnum<["approved", "denied", "cancelled"]>;
1637
+ }, "strict", z.ZodTypeAny, {
1638
+ decision: "cancelled" | "approved" | "denied";
1639
+ kind: "approval_resolution";
1640
+ approvalId: string;
1641
+ }, {
1642
+ decision: "cancelled" | "approved" | "denied";
1643
+ kind: "approval_resolution";
1644
+ approvalId: string;
1645
+ }>, z.ZodObject<{
1646
+ kind: z.ZodLiteral<"error">;
1647
+ code: z.ZodString;
1648
+ message: z.ZodString;
1649
+ retryable: z.ZodBoolean;
1650
+ }, "strict", z.ZodTypeAny, {
1651
+ code: string;
1652
+ message: string;
1653
+ kind: "error";
1654
+ retryable: boolean;
1655
+ }, {
1656
+ code: string;
1657
+ message: string;
1658
+ kind: "error";
1659
+ retryable: boolean;
1660
+ }>, z.ZodObject<{
1661
+ kind: z.ZodLiteral<"lifecycle">;
1662
+ state: z.ZodEnum<["pending", "queued", "resolving", "running", "parsing", "awaiting_approval", "succeeded", "partial", "failed", "cancelled", "interrupted", "timeout", "completed"]>;
1663
+ }, "strict", z.ZodTypeAny, {
1664
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1665
+ kind: "lifecycle";
1666
+ }, {
1667
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1668
+ kind: "lifecycle";
1669
+ }>, z.ZodObject<{
1670
+ kind: z.ZodLiteral<"usage">;
1671
+ completeness: z.ZodEnum<["complete", "partial", "unknown"]>;
1672
+ inputTokens: z.ZodNullable<z.ZodNumber>;
1673
+ outputTokens: z.ZodNullable<z.ZodNumber>;
1674
+ cachedInputTokens: z.ZodNullable<z.ZodNumber>;
1675
+ reasoningTokens: z.ZodNullable<z.ZodNumber>;
1676
+ }, "strict", z.ZodTypeAny, {
1677
+ kind: "usage";
1678
+ completeness: "unknown" | "partial" | "complete";
1679
+ inputTokens: number | null;
1680
+ outputTokens: number | null;
1681
+ cachedInputTokens: number | null;
1682
+ reasoningTokens: number | null;
1683
+ }, {
1684
+ kind: "usage";
1685
+ completeness: "unknown" | "partial" | "complete";
1686
+ inputTokens: number | null;
1687
+ outputTokens: number | null;
1688
+ cachedInputTokens: number | null;
1689
+ reasoningTokens: number | null;
1690
+ }>, z.ZodObject<{
1691
+ kind: z.ZodLiteral<"reasoning">;
1692
+ summary: z.ZodString;
1693
+ }, "strict", z.ZodTypeAny, {
1694
+ summary: string;
1695
+ kind: "reasoning";
1696
+ }, {
1697
+ summary: string;
1698
+ kind: "reasoning";
1699
+ }>, z.ZodObject<{
1700
+ kind: z.ZodLiteral<"unknown">;
1701
+ originalKind: z.ZodString;
1702
+ summary: z.ZodString;
1703
+ forwardCaptured: z.ZodLiteral<true>;
1704
+ }, "strict", z.ZodTypeAny, {
1705
+ summary: string;
1706
+ kind: "unknown";
1707
+ originalKind: string;
1708
+ forwardCaptured: true;
1709
+ }, {
1710
+ summary: string;
1711
+ kind: "unknown";
1712
+ originalKind: string;
1713
+ forwardCaptured: true;
1714
+ }>]>, {
1715
+ content: string;
1716
+ kind: "user";
1717
+ } | {
1718
+ content: string;
1719
+ kind: "assistant";
1720
+ } | {
1721
+ summary: string;
1722
+ kind: "tool_call";
1723
+ callId: string;
1724
+ toolName: string;
1725
+ arguments?: {
1726
+ content: string;
1727
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1728
+ } | undefined;
1729
+ } | {
1730
+ summary: string;
1731
+ kind: "tool_result";
1732
+ outcome: "succeeded" | "failed" | "cancelled";
1733
+ callId: string;
1734
+ toolName: string;
1735
+ } | {
1736
+ kind: "approval_request";
1737
+ approvalId: string;
1738
+ action: string;
1739
+ risk: "high" | "medium" | "low";
1740
+ } | {
1741
+ decision: "cancelled" | "approved" | "denied";
1742
+ kind: "approval_resolution";
1743
+ approvalId: string;
1744
+ } | {
1745
+ code: string;
1746
+ message: string;
1747
+ kind: "error";
1748
+ retryable: boolean;
1749
+ } | {
1750
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1751
+ kind: "lifecycle";
1752
+ } | {
1753
+ kind: "usage";
1754
+ completeness: "unknown" | "partial" | "complete";
1755
+ inputTokens: number | null;
1756
+ outputTokens: number | null;
1757
+ cachedInputTokens: number | null;
1758
+ reasoningTokens: number | null;
1759
+ } | {
1760
+ summary: string;
1761
+ kind: "reasoning";
1762
+ } | {
1763
+ summary: string;
1764
+ kind: "unknown";
1765
+ originalKind: string;
1766
+ forwardCaptured: true;
1767
+ }, {
1768
+ content: string;
1769
+ kind: "user";
1770
+ } | {
1771
+ content: string;
1772
+ kind: "assistant";
1773
+ } | {
1774
+ summary: string;
1775
+ kind: "tool_call";
1776
+ callId: string;
1777
+ toolName: string;
1778
+ arguments?: {
1779
+ content: string;
1780
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1781
+ } | undefined;
1782
+ } | {
1783
+ summary: string;
1784
+ kind: "tool_result";
1785
+ outcome: "succeeded" | "failed" | "cancelled";
1786
+ callId: string;
1787
+ toolName: string;
1788
+ } | {
1789
+ kind: "approval_request";
1790
+ approvalId: string;
1791
+ action: string;
1792
+ risk: "high" | "medium" | "low";
1793
+ } | {
1794
+ decision: "cancelled" | "approved" | "denied";
1795
+ kind: "approval_resolution";
1796
+ approvalId: string;
1797
+ } | {
1798
+ code: string;
1799
+ message: string;
1800
+ kind: "error";
1801
+ retryable: boolean;
1802
+ } | {
1803
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1804
+ kind: "lifecycle";
1805
+ } | {
1806
+ kind: "usage";
1807
+ completeness: "unknown" | "partial" | "complete";
1808
+ inputTokens: number | null;
1809
+ outputTokens: number | null;
1810
+ cachedInputTokens: number | null;
1811
+ reasoningTokens: number | null;
1812
+ } | {
1813
+ summary: string;
1814
+ kind: "reasoning";
1815
+ } | {
1816
+ summary: string;
1817
+ kind: "unknown";
1818
+ originalKind: string;
1819
+ forwardCaptured: true;
1820
+ }>;
1821
+ }, "strict", z.ZodTypeAny, {
1822
+ schemaVersion: "session-log-v1";
1823
+ completeness: "unknown" | "partial" | "complete";
1824
+ sequence: number;
1825
+ timestamp: string;
1826
+ producerFamily: "workflow" | "context" | "activity";
1827
+ owner: {
1828
+ family: "workflow";
1829
+ runId: string;
1830
+ runGeneration: string;
1831
+ stageId?: string | undefined;
1832
+ callId?: string | undefined;
1833
+ attempt?: number | undefined;
1834
+ } | {
1835
+ activityId: string;
1836
+ family: "activity";
1837
+ activityGeneration: string;
1838
+ sessionId?: string | undefined;
1839
+ threadId?: string | undefined;
1840
+ turnId?: string | undefined;
1841
+ } | {
1842
+ family: "context";
1843
+ contextRunId: string;
1844
+ contextGeneration: string;
1845
+ attempt?: number | undefined;
1846
+ executor?: "curator" | "finalizer" | undefined;
1847
+ executionId?: string | undefined;
1848
+ };
1849
+ lane: {
1850
+ laneId: string;
1851
+ };
1852
+ authority: "observability_only";
1853
+ redaction: {
1854
+ status: "no_matches" | "redacted";
1855
+ ran: true;
1856
+ count: number;
1857
+ coverage?: "pattern_best_effort" | undefined;
1858
+ };
1859
+ truncation: "none" | "head" | "tail" | "middle";
1860
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
1861
+ event: {
1862
+ content: string;
1863
+ kind: "user";
1864
+ } | {
1865
+ content: string;
1866
+ kind: "assistant";
1867
+ } | {
1868
+ summary: string;
1869
+ kind: "tool_call";
1870
+ callId: string;
1871
+ toolName: string;
1872
+ arguments?: {
1873
+ content: string;
1874
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1875
+ } | undefined;
1876
+ } | {
1877
+ summary: string;
1878
+ kind: "tool_result";
1879
+ outcome: "succeeded" | "failed" | "cancelled";
1880
+ callId: string;
1881
+ toolName: string;
1882
+ } | {
1883
+ kind: "approval_request";
1884
+ approvalId: string;
1885
+ action: string;
1886
+ risk: "high" | "medium" | "low";
1887
+ } | {
1888
+ decision: "cancelled" | "approved" | "denied";
1889
+ kind: "approval_resolution";
1890
+ approvalId: string;
1891
+ } | {
1892
+ code: string;
1893
+ message: string;
1894
+ kind: "error";
1895
+ retryable: boolean;
1896
+ } | {
1897
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1898
+ kind: "lifecycle";
1899
+ } | {
1900
+ kind: "usage";
1901
+ completeness: "unknown" | "partial" | "complete";
1902
+ inputTokens: number | null;
1903
+ outputTokens: number | null;
1904
+ cachedInputTokens: number | null;
1905
+ reasoningTokens: number | null;
1906
+ } | {
1907
+ summary: string;
1908
+ kind: "reasoning";
1909
+ } | {
1910
+ summary: string;
1911
+ kind: "unknown";
1912
+ originalKind: string;
1913
+ forwardCaptured: true;
1914
+ };
1915
+ }, {
1916
+ schemaVersion: "session-log-v1";
1917
+ completeness: "unknown" | "partial" | "complete";
1918
+ sequence: number;
1919
+ timestamp: string;
1920
+ producerFamily: "workflow" | "context" | "activity";
1921
+ owner: {
1922
+ family: "workflow";
1923
+ runId: string;
1924
+ runGeneration: string;
1925
+ stageId?: string | undefined;
1926
+ callId?: string | undefined;
1927
+ attempt?: number | undefined;
1928
+ } | {
1929
+ activityId: string;
1930
+ family: "activity";
1931
+ activityGeneration: string;
1932
+ sessionId?: string | undefined;
1933
+ threadId?: string | undefined;
1934
+ turnId?: string | undefined;
1935
+ } | {
1936
+ family: "context";
1937
+ contextRunId: string;
1938
+ contextGeneration: string;
1939
+ attempt?: number | undefined;
1940
+ executor?: "curator" | "finalizer" | undefined;
1941
+ executionId?: string | undefined;
1942
+ };
1943
+ lane: {
1944
+ laneId: string;
1945
+ };
1946
+ authority: "observability_only";
1947
+ redaction: {
1948
+ status: "no_matches" | "redacted";
1949
+ ran: true;
1950
+ count: number;
1951
+ coverage?: "pattern_best_effort" | undefined;
1952
+ };
1953
+ truncation: "none" | "head" | "tail" | "middle";
1954
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
1955
+ event: {
1956
+ content: string;
1957
+ kind: "user";
1958
+ } | {
1959
+ content: string;
1960
+ kind: "assistant";
1961
+ } | {
1962
+ summary: string;
1963
+ kind: "tool_call";
1964
+ callId: string;
1965
+ toolName: string;
1966
+ arguments?: {
1967
+ content: string;
1968
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
1969
+ } | undefined;
1970
+ } | {
1971
+ summary: string;
1972
+ kind: "tool_result";
1973
+ outcome: "succeeded" | "failed" | "cancelled";
1974
+ callId: string;
1975
+ toolName: string;
1976
+ } | {
1977
+ kind: "approval_request";
1978
+ approvalId: string;
1979
+ action: string;
1980
+ risk: "high" | "medium" | "low";
1981
+ } | {
1982
+ decision: "cancelled" | "approved" | "denied";
1983
+ kind: "approval_resolution";
1984
+ approvalId: string;
1985
+ } | {
1986
+ code: string;
1987
+ message: string;
1988
+ kind: "error";
1989
+ retryable: boolean;
1990
+ } | {
1991
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
1992
+ kind: "lifecycle";
1993
+ } | {
1994
+ kind: "usage";
1995
+ completeness: "unknown" | "partial" | "complete";
1996
+ inputTokens: number | null;
1997
+ outputTokens: number | null;
1998
+ cachedInputTokens: number | null;
1999
+ reasoningTokens: number | null;
2000
+ } | {
2001
+ summary: string;
2002
+ kind: "reasoning";
2003
+ } | {
2004
+ summary: string;
2005
+ kind: "unknown";
2006
+ originalKind: string;
2007
+ forwardCaptured: true;
2008
+ };
2009
+ }>, {
2010
+ schemaVersion: "session-log-v1";
2011
+ completeness: "unknown" | "partial" | "complete";
2012
+ sequence: number;
2013
+ timestamp: string;
2014
+ producerFamily: "workflow" | "context" | "activity";
2015
+ owner: {
2016
+ family: "workflow";
2017
+ runId: string;
2018
+ runGeneration: string;
2019
+ stageId?: string | undefined;
2020
+ callId?: string | undefined;
2021
+ attempt?: number | undefined;
2022
+ } | {
2023
+ activityId: string;
2024
+ family: "activity";
2025
+ activityGeneration: string;
2026
+ sessionId?: string | undefined;
2027
+ threadId?: string | undefined;
2028
+ turnId?: string | undefined;
2029
+ } | {
2030
+ family: "context";
2031
+ contextRunId: string;
2032
+ contextGeneration: string;
2033
+ attempt?: number | undefined;
2034
+ executor?: "curator" | "finalizer" | undefined;
2035
+ executionId?: string | undefined;
2036
+ };
2037
+ lane: {
2038
+ laneId: string;
2039
+ };
2040
+ authority: "observability_only";
2041
+ redaction: {
2042
+ status: "no_matches" | "redacted";
2043
+ ran: true;
2044
+ count: number;
2045
+ coverage?: "pattern_best_effort" | undefined;
2046
+ };
2047
+ truncation: "none" | "head" | "tail" | "middle";
2048
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2049
+ event: {
2050
+ content: string;
2051
+ kind: "user";
2052
+ } | {
2053
+ content: string;
2054
+ kind: "assistant";
2055
+ } | {
2056
+ summary: string;
2057
+ kind: "tool_call";
2058
+ callId: string;
2059
+ toolName: string;
2060
+ arguments?: {
2061
+ content: string;
2062
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2063
+ } | undefined;
2064
+ } | {
2065
+ summary: string;
2066
+ kind: "tool_result";
2067
+ outcome: "succeeded" | "failed" | "cancelled";
2068
+ callId: string;
2069
+ toolName: string;
2070
+ } | {
2071
+ kind: "approval_request";
2072
+ approvalId: string;
2073
+ action: string;
2074
+ risk: "high" | "medium" | "low";
2075
+ } | {
2076
+ decision: "cancelled" | "approved" | "denied";
2077
+ kind: "approval_resolution";
2078
+ approvalId: string;
2079
+ } | {
2080
+ code: string;
2081
+ message: string;
2082
+ kind: "error";
2083
+ retryable: boolean;
2084
+ } | {
2085
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2086
+ kind: "lifecycle";
2087
+ } | {
2088
+ kind: "usage";
2089
+ completeness: "unknown" | "partial" | "complete";
2090
+ inputTokens: number | null;
2091
+ outputTokens: number | null;
2092
+ cachedInputTokens: number | null;
2093
+ reasoningTokens: number | null;
2094
+ } | {
2095
+ summary: string;
2096
+ kind: "reasoning";
2097
+ } | {
2098
+ summary: string;
2099
+ kind: "unknown";
2100
+ originalKind: string;
2101
+ forwardCaptured: true;
2102
+ };
2103
+ }, {
2104
+ schemaVersion: "session-log-v1";
2105
+ completeness: "unknown" | "partial" | "complete";
2106
+ sequence: number;
2107
+ timestamp: string;
2108
+ producerFamily: "workflow" | "context" | "activity";
2109
+ owner: {
2110
+ family: "workflow";
2111
+ runId: string;
2112
+ runGeneration: string;
2113
+ stageId?: string | undefined;
2114
+ callId?: string | undefined;
2115
+ attempt?: number | undefined;
2116
+ } | {
2117
+ activityId: string;
2118
+ family: "activity";
2119
+ activityGeneration: string;
2120
+ sessionId?: string | undefined;
2121
+ threadId?: string | undefined;
2122
+ turnId?: string | undefined;
2123
+ } | {
2124
+ family: "context";
2125
+ contextRunId: string;
2126
+ contextGeneration: string;
2127
+ attempt?: number | undefined;
2128
+ executor?: "curator" | "finalizer" | undefined;
2129
+ executionId?: string | undefined;
2130
+ };
2131
+ lane: {
2132
+ laneId: string;
2133
+ };
2134
+ authority: "observability_only";
2135
+ redaction: {
2136
+ status: "no_matches" | "redacted";
2137
+ ran: true;
2138
+ count: number;
2139
+ coverage?: "pattern_best_effort" | undefined;
2140
+ };
2141
+ truncation: "none" | "head" | "tail" | "middle";
2142
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2143
+ event: {
2144
+ content: string;
2145
+ kind: "user";
2146
+ } | {
2147
+ content: string;
2148
+ kind: "assistant";
2149
+ } | {
2150
+ summary: string;
2151
+ kind: "tool_call";
2152
+ callId: string;
2153
+ toolName: string;
2154
+ arguments?: {
2155
+ content: string;
2156
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2157
+ } | undefined;
2158
+ } | {
2159
+ summary: string;
2160
+ kind: "tool_result";
2161
+ outcome: "succeeded" | "failed" | "cancelled";
2162
+ callId: string;
2163
+ toolName: string;
2164
+ } | {
2165
+ kind: "approval_request";
2166
+ approvalId: string;
2167
+ action: string;
2168
+ risk: "high" | "medium" | "low";
2169
+ } | {
2170
+ decision: "cancelled" | "approved" | "denied";
2171
+ kind: "approval_resolution";
2172
+ approvalId: string;
2173
+ } | {
2174
+ code: string;
2175
+ message: string;
2176
+ kind: "error";
2177
+ retryable: boolean;
2178
+ } | {
2179
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2180
+ kind: "lifecycle";
2181
+ } | {
2182
+ kind: "usage";
2183
+ completeness: "unknown" | "partial" | "complete";
2184
+ inputTokens: number | null;
2185
+ outputTokens: number | null;
2186
+ cachedInputTokens: number | null;
2187
+ reasoningTokens: number | null;
2188
+ } | {
2189
+ summary: string;
2190
+ kind: "reasoning";
2191
+ } | {
2192
+ summary: string;
2193
+ kind: "unknown";
2194
+ originalKind: string;
2195
+ forwardCaptured: true;
2196
+ };
2197
+ }>, "many">;
2198
+ }, "strict", z.ZodTypeAny, {
2199
+ truncated: boolean;
2200
+ schemaVersion: "session-log-v1";
2201
+ owner: {
2202
+ family: "workflow";
2203
+ runId: string;
2204
+ runGeneration: string;
2205
+ stageId?: string | undefined;
2206
+ callId?: string | undefined;
2207
+ attempt?: number | undefined;
2208
+ } | {
2209
+ activityId: string;
2210
+ family: "activity";
2211
+ activityGeneration: string;
2212
+ sessionId?: string | undefined;
2213
+ threadId?: string | undefined;
2214
+ turnId?: string | undefined;
2215
+ } | {
2216
+ family: "context";
2217
+ contextRunId: string;
2218
+ contextGeneration: string;
2219
+ attempt?: number | undefined;
2220
+ executor?: "curator" | "finalizer" | undefined;
2221
+ executionId?: string | undefined;
2222
+ };
2223
+ lane: {
2224
+ laneId: string;
2225
+ };
2226
+ availability: {
2227
+ availability: "available";
2228
+ } | {
2229
+ availability: "degraded";
2230
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
2231
+ } | {
2232
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
2233
+ availability: "not_retained";
2234
+ } | {
2235
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
2236
+ availability: "not_executed";
2237
+ } | {
2238
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
2239
+ availability: "pruned";
2240
+ };
2241
+ requestedSequence: number;
2242
+ floorSequence: number;
2243
+ nextSequence: number;
2244
+ events: {
2245
+ schemaVersion: "session-log-v1";
2246
+ completeness: "unknown" | "partial" | "complete";
2247
+ sequence: number;
2248
+ timestamp: string;
2249
+ producerFamily: "workflow" | "context" | "activity";
2250
+ owner: {
2251
+ family: "workflow";
2252
+ runId: string;
2253
+ runGeneration: string;
2254
+ stageId?: string | undefined;
2255
+ callId?: string | undefined;
2256
+ attempt?: number | undefined;
2257
+ } | {
2258
+ activityId: string;
2259
+ family: "activity";
2260
+ activityGeneration: string;
2261
+ sessionId?: string | undefined;
2262
+ threadId?: string | undefined;
2263
+ turnId?: string | undefined;
2264
+ } | {
2265
+ family: "context";
2266
+ contextRunId: string;
2267
+ contextGeneration: string;
2268
+ attempt?: number | undefined;
2269
+ executor?: "curator" | "finalizer" | undefined;
2270
+ executionId?: string | undefined;
2271
+ };
2272
+ lane: {
2273
+ laneId: string;
2274
+ };
2275
+ authority: "observability_only";
2276
+ redaction: {
2277
+ status: "no_matches" | "redacted";
2278
+ ran: true;
2279
+ count: number;
2280
+ coverage?: "pattern_best_effort" | undefined;
2281
+ };
2282
+ truncation: "none" | "head" | "tail" | "middle";
2283
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2284
+ event: {
2285
+ content: string;
2286
+ kind: "user";
2287
+ } | {
2288
+ content: string;
2289
+ kind: "assistant";
2290
+ } | {
2291
+ summary: string;
2292
+ kind: "tool_call";
2293
+ callId: string;
2294
+ toolName: string;
2295
+ arguments?: {
2296
+ content: string;
2297
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2298
+ } | undefined;
2299
+ } | {
2300
+ summary: string;
2301
+ kind: "tool_result";
2302
+ outcome: "succeeded" | "failed" | "cancelled";
2303
+ callId: string;
2304
+ toolName: string;
2305
+ } | {
2306
+ kind: "approval_request";
2307
+ approvalId: string;
2308
+ action: string;
2309
+ risk: "high" | "medium" | "low";
2310
+ } | {
2311
+ decision: "cancelled" | "approved" | "denied";
2312
+ kind: "approval_resolution";
2313
+ approvalId: string;
2314
+ } | {
2315
+ code: string;
2316
+ message: string;
2317
+ kind: "error";
2318
+ retryable: boolean;
2319
+ } | {
2320
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2321
+ kind: "lifecycle";
2322
+ } | {
2323
+ kind: "usage";
2324
+ completeness: "unknown" | "partial" | "complete";
2325
+ inputTokens: number | null;
2326
+ outputTokens: number | null;
2327
+ cachedInputTokens: number | null;
2328
+ reasoningTokens: number | null;
2329
+ } | {
2330
+ summary: string;
2331
+ kind: "reasoning";
2332
+ } | {
2333
+ summary: string;
2334
+ kind: "unknown";
2335
+ originalKind: string;
2336
+ forwardCaptured: true;
2337
+ };
2338
+ }[];
2339
+ }, {
2340
+ truncated: boolean;
2341
+ schemaVersion: "session-log-v1";
2342
+ owner: {
2343
+ family: "workflow";
2344
+ runId: string;
2345
+ runGeneration: string;
2346
+ stageId?: string | undefined;
2347
+ callId?: string | undefined;
2348
+ attempt?: number | undefined;
2349
+ } | {
2350
+ activityId: string;
2351
+ family: "activity";
2352
+ activityGeneration: string;
2353
+ sessionId?: string | undefined;
2354
+ threadId?: string | undefined;
2355
+ turnId?: string | undefined;
2356
+ } | {
2357
+ family: "context";
2358
+ contextRunId: string;
2359
+ contextGeneration: string;
2360
+ attempt?: number | undefined;
2361
+ executor?: "curator" | "finalizer" | undefined;
2362
+ executionId?: string | undefined;
2363
+ };
2364
+ lane: {
2365
+ laneId: string;
2366
+ };
2367
+ availability: {
2368
+ availability: "available";
2369
+ } | {
2370
+ availability: "degraded";
2371
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
2372
+ } | {
2373
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
2374
+ availability: "not_retained";
2375
+ } | {
2376
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
2377
+ availability: "not_executed";
2378
+ } | {
2379
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
2380
+ availability: "pruned";
2381
+ };
2382
+ requestedSequence: number;
2383
+ floorSequence: number;
2384
+ nextSequence: number;
2385
+ events: {
2386
+ schemaVersion: "session-log-v1";
2387
+ completeness: "unknown" | "partial" | "complete";
2388
+ sequence: number;
2389
+ timestamp: string;
2390
+ producerFamily: "workflow" | "context" | "activity";
2391
+ owner: {
2392
+ family: "workflow";
2393
+ runId: string;
2394
+ runGeneration: string;
2395
+ stageId?: string | undefined;
2396
+ callId?: string | undefined;
2397
+ attempt?: number | undefined;
2398
+ } | {
2399
+ activityId: string;
2400
+ family: "activity";
2401
+ activityGeneration: string;
2402
+ sessionId?: string | undefined;
2403
+ threadId?: string | undefined;
2404
+ turnId?: string | undefined;
2405
+ } | {
2406
+ family: "context";
2407
+ contextRunId: string;
2408
+ contextGeneration: string;
2409
+ attempt?: number | undefined;
2410
+ executor?: "curator" | "finalizer" | undefined;
2411
+ executionId?: string | undefined;
2412
+ };
2413
+ lane: {
2414
+ laneId: string;
2415
+ };
2416
+ authority: "observability_only";
2417
+ redaction: {
2418
+ status: "no_matches" | "redacted";
2419
+ ran: true;
2420
+ count: number;
2421
+ coverage?: "pattern_best_effort" | undefined;
2422
+ };
2423
+ truncation: "none" | "head" | "tail" | "middle";
2424
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2425
+ event: {
2426
+ content: string;
2427
+ kind: "user";
2428
+ } | {
2429
+ content: string;
2430
+ kind: "assistant";
2431
+ } | {
2432
+ summary: string;
2433
+ kind: "tool_call";
2434
+ callId: string;
2435
+ toolName: string;
2436
+ arguments?: {
2437
+ content: string;
2438
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2439
+ } | undefined;
2440
+ } | {
2441
+ summary: string;
2442
+ kind: "tool_result";
2443
+ outcome: "succeeded" | "failed" | "cancelled";
2444
+ callId: string;
2445
+ toolName: string;
2446
+ } | {
2447
+ kind: "approval_request";
2448
+ approvalId: string;
2449
+ action: string;
2450
+ risk: "high" | "medium" | "low";
2451
+ } | {
2452
+ decision: "cancelled" | "approved" | "denied";
2453
+ kind: "approval_resolution";
2454
+ approvalId: string;
2455
+ } | {
2456
+ code: string;
2457
+ message: string;
2458
+ kind: "error";
2459
+ retryable: boolean;
2460
+ } | {
2461
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2462
+ kind: "lifecycle";
2463
+ } | {
2464
+ kind: "usage";
2465
+ completeness: "unknown" | "partial" | "complete";
2466
+ inputTokens: number | null;
2467
+ outputTokens: number | null;
2468
+ cachedInputTokens: number | null;
2469
+ reasoningTokens: number | null;
2470
+ } | {
2471
+ summary: string;
2472
+ kind: "reasoning";
2473
+ } | {
2474
+ summary: string;
2475
+ kind: "unknown";
2476
+ originalKind: string;
2477
+ forwardCaptured: true;
2478
+ };
2479
+ }[];
2480
+ }>, {
2481
+ truncated: boolean;
2482
+ schemaVersion: "session-log-v1";
2483
+ owner: {
2484
+ family: "workflow";
2485
+ runId: string;
2486
+ runGeneration: string;
2487
+ stageId?: string | undefined;
2488
+ callId?: string | undefined;
2489
+ attempt?: number | undefined;
2490
+ } | {
2491
+ activityId: string;
2492
+ family: "activity";
2493
+ activityGeneration: string;
2494
+ sessionId?: string | undefined;
2495
+ threadId?: string | undefined;
2496
+ turnId?: string | undefined;
2497
+ } | {
2498
+ family: "context";
2499
+ contextRunId: string;
2500
+ contextGeneration: string;
2501
+ attempt?: number | undefined;
2502
+ executor?: "curator" | "finalizer" | undefined;
2503
+ executionId?: string | undefined;
2504
+ };
2505
+ lane: {
2506
+ laneId: string;
2507
+ };
2508
+ availability: {
2509
+ availability: "available";
2510
+ } | {
2511
+ availability: "degraded";
2512
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
2513
+ } | {
2514
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
2515
+ availability: "not_retained";
2516
+ } | {
2517
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
2518
+ availability: "not_executed";
2519
+ } | {
2520
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
2521
+ availability: "pruned";
2522
+ };
2523
+ requestedSequence: number;
2524
+ floorSequence: number;
2525
+ nextSequence: number;
2526
+ events: {
2527
+ schemaVersion: "session-log-v1";
2528
+ completeness: "unknown" | "partial" | "complete";
2529
+ sequence: number;
2530
+ timestamp: string;
2531
+ producerFamily: "workflow" | "context" | "activity";
2532
+ owner: {
2533
+ family: "workflow";
2534
+ runId: string;
2535
+ runGeneration: string;
2536
+ stageId?: string | undefined;
2537
+ callId?: string | undefined;
2538
+ attempt?: number | undefined;
2539
+ } | {
2540
+ activityId: string;
2541
+ family: "activity";
2542
+ activityGeneration: string;
2543
+ sessionId?: string | undefined;
2544
+ threadId?: string | undefined;
2545
+ turnId?: string | undefined;
2546
+ } | {
2547
+ family: "context";
2548
+ contextRunId: string;
2549
+ contextGeneration: string;
2550
+ attempt?: number | undefined;
2551
+ executor?: "curator" | "finalizer" | undefined;
2552
+ executionId?: string | undefined;
2553
+ };
2554
+ lane: {
2555
+ laneId: string;
2556
+ };
2557
+ authority: "observability_only";
2558
+ redaction: {
2559
+ status: "no_matches" | "redacted";
2560
+ ran: true;
2561
+ count: number;
2562
+ coverage?: "pattern_best_effort" | undefined;
2563
+ };
2564
+ truncation: "none" | "head" | "tail" | "middle";
2565
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2566
+ event: {
2567
+ content: string;
2568
+ kind: "user";
2569
+ } | {
2570
+ content: string;
2571
+ kind: "assistant";
2572
+ } | {
2573
+ summary: string;
2574
+ kind: "tool_call";
2575
+ callId: string;
2576
+ toolName: string;
2577
+ arguments?: {
2578
+ content: string;
2579
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2580
+ } | undefined;
2581
+ } | {
2582
+ summary: string;
2583
+ kind: "tool_result";
2584
+ outcome: "succeeded" | "failed" | "cancelled";
2585
+ callId: string;
2586
+ toolName: string;
2587
+ } | {
2588
+ kind: "approval_request";
2589
+ approvalId: string;
2590
+ action: string;
2591
+ risk: "high" | "medium" | "low";
2592
+ } | {
2593
+ decision: "cancelled" | "approved" | "denied";
2594
+ kind: "approval_resolution";
2595
+ approvalId: string;
2596
+ } | {
2597
+ code: string;
2598
+ message: string;
2599
+ kind: "error";
2600
+ retryable: boolean;
2601
+ } | {
2602
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2603
+ kind: "lifecycle";
2604
+ } | {
2605
+ kind: "usage";
2606
+ completeness: "unknown" | "partial" | "complete";
2607
+ inputTokens: number | null;
2608
+ outputTokens: number | null;
2609
+ cachedInputTokens: number | null;
2610
+ reasoningTokens: number | null;
2611
+ } | {
2612
+ summary: string;
2613
+ kind: "reasoning";
2614
+ } | {
2615
+ summary: string;
2616
+ kind: "unknown";
2617
+ originalKind: string;
2618
+ forwardCaptured: true;
2619
+ };
2620
+ }[];
2621
+ }, {
2622
+ truncated: boolean;
2623
+ schemaVersion: "session-log-v1";
2624
+ owner: {
2625
+ family: "workflow";
2626
+ runId: string;
2627
+ runGeneration: string;
2628
+ stageId?: string | undefined;
2629
+ callId?: string | undefined;
2630
+ attempt?: number | undefined;
2631
+ } | {
2632
+ activityId: string;
2633
+ family: "activity";
2634
+ activityGeneration: string;
2635
+ sessionId?: string | undefined;
2636
+ threadId?: string | undefined;
2637
+ turnId?: string | undefined;
2638
+ } | {
2639
+ family: "context";
2640
+ contextRunId: string;
2641
+ contextGeneration: string;
2642
+ attempt?: number | undefined;
2643
+ executor?: "curator" | "finalizer" | undefined;
2644
+ executionId?: string | undefined;
2645
+ };
2646
+ lane: {
2647
+ laneId: string;
2648
+ };
2649
+ availability: {
2650
+ availability: "available";
2651
+ } | {
2652
+ availability: "degraded";
2653
+ reasons: ("truncated" | "corrupt_capture" | "retention_gap" | "incomplete_capture" | "parse_warning")[];
2654
+ } | {
2655
+ reason: "retention_disabled" | "retention_expired" | "producer_did_not_retain";
2656
+ availability: "not_retained";
2657
+ } | {
2658
+ reason: "disabled" | "skipped" | "not_requested" | "cancelled_before_start";
2659
+ availability: "not_executed";
2660
+ } | {
2661
+ reason: "size_limit" | "retention_limit" | "age_limit" | "event_limit" | "operator_request";
2662
+ availability: "pruned";
2663
+ };
2664
+ requestedSequence: number;
2665
+ floorSequence: number;
2666
+ nextSequence: number;
2667
+ events: {
2668
+ schemaVersion: "session-log-v1";
2669
+ completeness: "unknown" | "partial" | "complete";
2670
+ sequence: number;
2671
+ timestamp: string;
2672
+ producerFamily: "workflow" | "context" | "activity";
2673
+ owner: {
2674
+ family: "workflow";
2675
+ runId: string;
2676
+ runGeneration: string;
2677
+ stageId?: string | undefined;
2678
+ callId?: string | undefined;
2679
+ attempt?: number | undefined;
2680
+ } | {
2681
+ activityId: string;
2682
+ family: "activity";
2683
+ activityGeneration: string;
2684
+ sessionId?: string | undefined;
2685
+ threadId?: string | undefined;
2686
+ turnId?: string | undefined;
2687
+ } | {
2688
+ family: "context";
2689
+ contextRunId: string;
2690
+ contextGeneration: string;
2691
+ attempt?: number | undefined;
2692
+ executor?: "curator" | "finalizer" | undefined;
2693
+ executionId?: string | undefined;
2694
+ };
2695
+ lane: {
2696
+ laneId: string;
2697
+ };
2698
+ authority: "observability_only";
2699
+ redaction: {
2700
+ status: "no_matches" | "redacted";
2701
+ ran: true;
2702
+ count: number;
2703
+ coverage?: "pattern_best_effort" | undefined;
2704
+ };
2705
+ truncation: "none" | "head" | "tail" | "middle";
2706
+ parseWarnings: ("unknown_event_type" | "provider_payload_omitted" | "malformed_field_omitted" | "unsupported_field_omitted" | "content_truncated" | "corrupt_capture")[];
2707
+ event: {
2708
+ content: string;
2709
+ kind: "user";
2710
+ } | {
2711
+ content: string;
2712
+ kind: "assistant";
2713
+ } | {
2714
+ summary: string;
2715
+ kind: "tool_call";
2716
+ callId: string;
2717
+ toolName: string;
2718
+ arguments?: {
2719
+ content: string;
2720
+ omission: "none" | "invalid" | "size_limit" | "structure_limit";
2721
+ } | undefined;
2722
+ } | {
2723
+ summary: string;
2724
+ kind: "tool_result";
2725
+ outcome: "succeeded" | "failed" | "cancelled";
2726
+ callId: string;
2727
+ toolName: string;
2728
+ } | {
2729
+ kind: "approval_request";
2730
+ approvalId: string;
2731
+ action: string;
2732
+ risk: "high" | "medium" | "low";
2733
+ } | {
2734
+ decision: "cancelled" | "approved" | "denied";
2735
+ kind: "approval_resolution";
2736
+ approvalId: string;
2737
+ } | {
2738
+ code: string;
2739
+ message: string;
2740
+ kind: "error";
2741
+ retryable: boolean;
2742
+ } | {
2743
+ state: "partial" | "pending" | "running" | "succeeded" | "failed" | "cancelled" | "resolving" | "completed" | "timeout" | "parsing" | "queued" | "awaiting_approval" | "interrupted";
2744
+ kind: "lifecycle";
2745
+ } | {
2746
+ kind: "usage";
2747
+ completeness: "unknown" | "partial" | "complete";
2748
+ inputTokens: number | null;
2749
+ outputTokens: number | null;
2750
+ cachedInputTokens: number | null;
2751
+ reasoningTokens: number | null;
2752
+ } | {
2753
+ summary: string;
2754
+ kind: "reasoning";
2755
+ } | {
2756
+ summary: string;
2757
+ kind: "unknown";
2758
+ originalKind: string;
2759
+ forwardCaptured: true;
2760
+ };
2761
+ }[];
2762
+ }>;
2763
+ export declare function parseSessionLogOwnerV1(input: unknown): SessionLogOwnerV1;
2764
+ /**
2765
+ * Shape validation only. A successful parse proves neither secret absence nor
2766
+ * that redaction was effective; SLOG-01 owns construction and redaction.
2767
+ */
2768
+ export declare function parseSessionLogEventV1(input: unknown): SessionLogEventV1;
2769
+ /**
2770
+ * Shape validation only. It does not execute or verify redaction.
2771
+ */
2772
+ export declare function parseSessionLogPageV1(input: unknown): SessionLogPageV1;
2773
+ export type SessionLogOwnerV1 = z.infer<typeof SessionLogOwnerV1Schema>;
2774
+ export type SessionLogEventV1 = z.infer<typeof SessionLogEventV1Schema>;
2775
+ export type SessionLogPageV1 = z.infer<typeof SessionLogPageV1Schema>;
2776
+ export type SessionLogAvailabilityV1 = z.infer<typeof AvailabilitySchema>;
2777
+ export type SessionLogNormalizedEventV1 = z.infer<typeof NormalizedEventSchema>;
2778
+ export {};