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