@astrosheep/keiyaku 4.5.7 → 4.5.8

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 (234) hide show
  1. package/README.md +10 -0
  2. package/build/integrations/marketplace/plugins/keiyaku/.claude-plugin/plugin.json +1 -1
  3. package/build/integrations/marketplace/plugins/keiyaku/.codex-plugin/plugin.json +1 -1
  4. package/build/integrations/marketplace/plugins/keiyaku/opencode.js +3 -2
  5. package/build/integrations/marketplace/plugins/keiyaku/package.json +1 -1
  6. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +10 -9
  7. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +22 -1
  8. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-babysit/SKILL.md +35 -96
  9. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-bind/SKILL.md +28 -49
  10. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-task/SKILL.md +21 -15
  11. package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-workflow/SKILL.md +148 -89
  12. package/build/src/akuma/abort.d.ts +2 -1
  13. package/build/src/akuma/abort.js +6 -23
  14. package/build/src/akuma/akuma-handle.js +4 -2
  15. package/build/src/akuma/akuma-observe.d.ts +2 -0
  16. package/build/src/akuma/akuma-observe.js +1 -0
  17. package/build/src/akuma/akuma-product.js +9 -7
  18. package/build/src/akuma/akuma.d.ts +372 -9
  19. package/build/src/akuma/akuma.js +31 -1
  20. package/build/src/akuma/allowed.d.ts +1 -1
  21. package/build/src/akuma/allowed.js +1 -0
  22. package/build/src/akuma/body.d.ts +6 -4
  23. package/build/src/akuma/body.js +5 -3
  24. package/build/src/akuma/call-request.d.ts +80 -0
  25. package/build/src/akuma/call-request.js +211 -0
  26. package/build/src/akuma/heart/facts.d.ts +6 -78
  27. package/build/src/akuma/heart/index.d.ts +1 -1
  28. package/build/src/akuma/heart/request-authority.d.ts +5 -4
  29. package/build/src/akuma/heart/request-authority.js +20 -34
  30. package/build/src/akuma/heart/request-rows.js +12 -23
  31. package/build/src/akuma/heart/schema.d.ts +1 -1
  32. package/build/src/akuma/heart/schema.js +5 -13
  33. package/build/src/akuma/index.d.ts +1 -1
  34. package/build/src/akuma/index.js +1 -1
  35. package/build/src/akuma/projection-read.d.ts +1 -0
  36. package/build/src/akuma/projection-read.js +8 -1
  37. package/build/src/akuma/projection.d.ts +856 -137
  38. package/build/src/akuma/projection.js +190 -0
  39. package/build/src/akuma/provider.d.ts +30 -3
  40. package/build/src/akuma/provider.js +104 -0
  41. package/build/src/akuma/providers/acp/core.d.ts +2 -2
  42. package/build/src/akuma/providers/acp/core.js +13 -6
  43. package/build/src/akuma/providers/acp/index.js +5 -4
  44. package/build/src/akuma/providers/claude/index.d.ts +3 -3
  45. package/build/src/akuma/providers/claude/index.js +16 -5
  46. package/build/src/akuma/providers/codex-app-server/events.js +1 -1
  47. package/build/src/akuma/providers/codex-app-server/index.js +18 -6
  48. package/build/src/akuma/providers/grok-build/index.js +5 -4
  49. package/build/src/akuma/providers/opencode-sdk/index.js +66 -25
  50. package/build/src/akuma/providers/opencode-sdk/session.d.ts +3 -2
  51. package/build/src/akuma/providers/opencode-sdk/session.js +28 -11
  52. package/build/src/akuma/providers/pi/index.js +42 -14
  53. package/build/src/akuma/request-lifecycle.d.ts +3 -9
  54. package/build/src/akuma/request-lifecycle.js +4 -4
  55. package/build/src/akuma/request-rendezvous.d.ts +26 -0
  56. package/build/src/akuma/request-rendezvous.js +100 -0
  57. package/build/src/akuma/request-serve.d.ts +5 -65
  58. package/build/src/akuma/request-serve.js +81 -208
  59. package/build/src/akuma/request-wire.d.ts +109 -115
  60. package/build/src/akuma/request-wire.js +63 -318
  61. package/build/src/akuma/requests.d.ts +19 -47
  62. package/build/src/akuma/requests.js +51 -107
  63. package/build/src/akuma/turn-drive.d.ts +5 -3
  64. package/build/src/akuma/turn-drive.js +32 -10
  65. package/build/src/akuma-body.d.ts +7 -2
  66. package/build/src/akuma-body.js +68 -46
  67. package/build/src/cli/accepted.d.ts +1 -1
  68. package/build/src/cli/accepted.js +2 -2
  69. package/build/src/cli/commands/akuma-invoke.d.ts +2 -0
  70. package/build/src/cli/commands/akuma-invoke.js +17 -9
  71. package/build/src/cli/commands/akuma.js +7 -7
  72. package/build/src/cli/commands/contract-invoke.d.ts +3 -2
  73. package/build/src/cli/commands/contract-invoke.js +26 -19
  74. package/build/src/cli/commands/contract.d.ts +13 -13
  75. package/build/src/cli/commands/contract.js +32 -17
  76. package/build/src/cli/commands/install.d.ts +1 -1
  77. package/build/src/cli/commands/install.js +1 -1
  78. package/build/src/cli/commands/task-invoke.d.ts +3 -0
  79. package/build/src/cli/commands/task-invoke.js +23 -140
  80. package/build/src/cli/commands/task.js +54 -20
  81. package/build/src/cli/invoke.js +39 -25
  82. package/build/src/cli/main.js +2 -1
  83. package/build/src/cli/parse.d.ts +2 -2
  84. package/build/src/cli/parse.js +37 -22
  85. package/build/src/cli/render/akuma-activity.d.ts +4 -1
  86. package/build/src/cli/render/akuma-activity.js +45 -30
  87. package/build/src/cli/render/akuma-tool.d.ts +5 -1
  88. package/build/src/cli/render/akuma.js +5 -9
  89. package/build/src/cli/render/audit.js +1 -1
  90. package/build/src/cli/render/catalog.js +80 -21
  91. package/build/src/cli/render/contract-observation.d.ts +2 -0
  92. package/build/src/cli/render/contract-observation.js +11 -0
  93. package/build/src/cli/render/contract.js +25 -65
  94. package/build/src/cli/render/kanshi-akuma.d.ts +8 -0
  95. package/build/src/cli/render/kanshi-akuma.js +111 -0
  96. package/build/src/cli/render/kanshi.js +108 -213
  97. package/build/src/cli/render/receipt.d.ts +1 -2
  98. package/build/src/cli/render/receipt.js +76 -26
  99. package/build/src/cli/render/refusal.js +2 -10
  100. package/build/src/cli/render/region.js +5 -2
  101. package/build/src/cli/render/settings.d.ts +1 -1
  102. package/build/src/cli/render/settings.js +27 -8
  103. package/build/src/cli/render/task.js +22 -5
  104. package/build/src/cli/render/terminal.d.ts +28 -0
  105. package/build/src/cli/render/terminal.js +65 -0
  106. package/build/src/cli/result.d.ts +3 -3
  107. package/build/src/cli/runtime.js +3 -1
  108. package/build/src/cli/selectors.d.ts +2 -1
  109. package/build/src/cli/selectors.js +4 -3
  110. package/build/src/cli/square-edge.js +120 -36
  111. package/build/src/cli/usage.js +2 -1
  112. package/build/src/contract-guidance.d.ts +5 -0
  113. package/build/src/contract-guidance.js +121 -0
  114. package/build/src/contract-worktree.d.ts +0 -1
  115. package/build/src/contract-worktree.js +32 -83
  116. package/build/src/coordination/sqlite-transaction-lock.d.ts +1 -0
  117. package/build/src/coordination/sqlite-transaction-lock.js +5 -0
  118. package/build/src/core/facts/codec.d.ts +2 -0
  119. package/build/src/core/facts/codec.js +4 -0
  120. package/build/src/core/verbs/placement.d.ts +6 -1
  121. package/build/src/core/verbs/placement.js +5 -3
  122. package/build/src/dispatch/index.d.ts +0 -2
  123. package/build/src/dispatch/index.js +54 -55
  124. package/build/src/git/admission.js +2 -2
  125. package/build/src/git/hooks.d.ts +9 -15
  126. package/build/src/git/hooks.js +23 -317
  127. package/build/src/git/nuke.d.ts +2 -1
  128. package/build/src/git/nuke.js +36 -18
  129. package/build/src/git/private-state-seat.d.ts +12 -0
  130. package/build/src/git/private-state-seat.js +39 -0
  131. package/build/src/git/process.d.ts +6 -0
  132. package/build/src/git/process.js +19 -7
  133. package/build/src/git/read-observation.js +29 -20
  134. package/build/src/git/reconcile.d.ts +11 -0
  135. package/build/src/git/reconcile.js +64 -11
  136. package/build/src/git/repository.d.ts +6 -2
  137. package/build/src/git/repository.js +8 -0
  138. package/build/src/git/target-placement.d.ts +1 -0
  139. package/build/src/git/target-placement.js +5 -0
  140. package/build/src/git/tender.d.ts +1 -0
  141. package/build/src/git/terminal-reconcile.d.ts +1 -1
  142. package/build/src/git/terminal-reconcile.js +22 -20
  143. package/build/src/git/workspace.d.ts +14 -0
  144. package/build/src/git/workspace.js +44 -0
  145. package/build/src/kanshi/index.d.ts +1 -1
  146. package/build/src/kanshi/read.js +16 -16
  147. package/build/src/kanshi/report.d.ts +2 -2
  148. package/build/src/library/address.d.ts +9 -3
  149. package/build/src/library/address.js +3 -2
  150. package/build/src/library/akuma-creation.d.ts +4 -3
  151. package/build/src/library/akuma-creation.js +19 -13
  152. package/build/src/library/audit.d.ts +1 -1
  153. package/build/src/library/audit.js +5 -3
  154. package/build/src/library/catalog.d.ts +3 -1
  155. package/build/src/library/catalog.js +20 -6
  156. package/build/src/library/composition.d.ts +371 -0
  157. package/build/src/library/composition.js +28 -0
  158. package/build/src/library/configuration.js +8 -2
  159. package/build/src/library/continuation.js +66 -30
  160. package/build/src/library/contract-bind.js +10 -2
  161. package/build/src/library/contract-forwarding-reconciliation-result.d.ts +96 -0
  162. package/build/src/library/contract-forwarding-reconciliation-result.js +83 -0
  163. package/build/src/library/contract-forwarding-result.d.ts +6723 -0
  164. package/build/src/library/contract-forwarding-result.js +521 -0
  165. package/build/src/library/contract-forwarding.d.ts +72 -0
  166. package/build/src/library/contract-forwarding.js +125 -0
  167. package/build/src/library/contract-handle.d.ts +36 -0
  168. package/build/src/library/contract-handle.js +313 -0
  169. package/build/src/library/contract-operations.d.ts +1044 -67
  170. package/build/src/library/contract-operations.js +190 -118
  171. package/build/src/library/contract.d.ts +11 -32
  172. package/build/src/library/contract.js +16 -289
  173. package/build/src/library/fleet-result.d.ts +1454 -0
  174. package/build/src/library/fleet-result.js +96 -0
  175. package/build/src/library/fleet.d.ts +112 -54
  176. package/build/src/library/fleet.js +211 -71
  177. package/build/src/library/input.d.ts +2 -0
  178. package/build/src/library/input.js +4 -0
  179. package/build/src/library/keiyaku.d.ts +371 -20
  180. package/build/src/library/keiyaku.js +8 -21
  181. package/build/src/library/mutation.d.ts +3 -3
  182. package/build/src/library/mutation.js +5 -9
  183. package/build/src/library/nuke.d.ts +1 -1
  184. package/build/src/library/nuke.js +4 -3
  185. package/build/src/library/reconcile.d.ts +4 -0
  186. package/build/src/library/reconcile.js +2 -0
  187. package/build/src/library/refusal.d.ts +0 -9
  188. package/build/src/library/refusal.js +0 -7
  189. package/build/src/protocol/amend.js +56 -50
  190. package/build/src/protocol/attempt.d.ts +2 -0
  191. package/build/src/protocol/attempt.js +8 -1
  192. package/build/src/protocol/completion.js +7 -0
  193. package/build/src/protocol/deliver.js +6 -2
  194. package/build/src/protocol/operations.d.ts +4 -1
  195. package/build/src/protocol/operations.js +5 -2
  196. package/build/src/protocol/placement.d.ts +1 -0
  197. package/build/src/protocol/placement.js +52 -38
  198. package/build/src/protocol/read/observation.d.ts +1 -4
  199. package/build/src/protocol/read/observation.js +2 -15
  200. package/build/src/protocol/reintegrate.js +62 -58
  201. package/build/src/protocol/review.js +5 -0
  202. package/build/src/protocol/run.js +17 -13
  203. package/build/src/runtime/proc/run.d.ts +8 -0
  204. package/build/src/runtime/proc/run.js +27 -0
  205. package/build/src/runtime/proc/termination.js +26 -22
  206. package/build/src/runtime/proc/windows-launch.exe +0 -0
  207. package/build/src/settlement/holder.d.ts +2 -1
  208. package/build/src/settlement/holder.js +15 -4
  209. package/build/src/settlement/settle.js +99 -33
  210. package/build/src/task/board.d.ts +68 -27
  211. package/build/src/task/board.js +31 -1
  212. package/build/src/task/catalog.d.ts +4 -0
  213. package/build/src/task/catalog.js +23 -0
  214. package/build/src/task/compose-language.js +33 -7
  215. package/build/src/task/compose-parser.d.ts +1 -1
  216. package/build/src/task/compose-parser.js +1 -1
  217. package/build/src/task/compose.js +2 -0
  218. package/build/src/task/index.d.ts +12 -4
  219. package/build/src/task/index.js +97 -16
  220. package/build/src/task/mutation-result.d.ts +923 -0
  221. package/build/src/task/mutation-result.js +140 -0
  222. package/build/src/task/mutation.d.ts +552 -28
  223. package/build/src/task/mutation.js +304 -97
  224. package/build/src/task/operations.d.ts +1 -4
  225. package/build/src/task/operations.js +0 -6
  226. package/build/src/task/public.d.ts +2 -0
  227. package/build/src/task/public.js +1 -0
  228. package/build/src/workspace-place.d.ts +7 -2
  229. package/build/src/workspace-place.js +34 -24
  230. package/build/src/world.d.ts +1 -0
  231. package/build/src/world.js +11 -0
  232. package/package.json +8 -6
  233. package/build/src/akuma/request-execution.d.ts +0 -8
  234. package/build/src/akuma/request-execution.js +0 -98
@@ -1,101 +1,854 @@
1
- import { type ToolCall, type ToolResult } from "./provider.js";
2
- import type { TellDelivery, TellFact, TimelineFact } from "./heart/index.js";
3
- export type TurnOutcome = Readonly<{
4
- kind: "answered";
5
- historyId: string;
6
- answer: string;
7
- }> | Readonly<{
8
- kind: "failed";
9
- historyId: string;
10
- diagnostic: string;
11
- }>;
12
- export type TurnStartRow = Readonly<{
13
- kind: "turn";
14
- sequence: number;
15
- turnSequence: number;
16
- bodySequence: number;
17
- at: string;
18
- }>;
19
- type CallRow = Readonly<{
20
- kind: "call";
21
- sequence: number;
22
- turnSequence: number;
23
- at: string;
24
- text: string;
25
- }>;
26
- type SaidRow = Readonly<{
27
- kind: "said";
28
- sequence: number;
29
- turnSequence: number;
30
- at: string;
31
- text: string;
32
- truncated?: true;
33
- }>;
34
- type ThoughtRow = Readonly<{
35
- kind: "thought";
36
- sequence: number;
37
- turnSequence: number;
38
- at: string;
39
- text: string;
40
- truncated?: true;
41
- }>;
42
- type NoteRow = Readonly<{
43
- kind: "note";
44
- sequence: number;
45
- turnSequence: number;
46
- at: string;
47
- text: string;
48
- truncated?: true;
49
- }>;
1
+ import type { TimelineFact } from "./heart/index.js";
2
+ import { z } from "zod";
3
+ declare const turnRowSchema: z.ZodObject<{
4
+ kind: z.ZodLiteral<"turn">;
5
+ sequence: z.ZodNumber;
6
+ turnSequence: z.ZodNumber;
7
+ bodySequence: z.ZodNumber;
8
+ at: z.ZodString;
9
+ }, z.core.$strict>;
10
+ declare const callRowSchema: z.ZodObject<{
11
+ kind: z.ZodLiteral<"call">;
12
+ sequence: z.ZodNumber;
13
+ turnSequence: z.ZodNumber;
14
+ at: z.ZodString;
15
+ text: z.ZodString;
16
+ }, z.core.$strict>;
17
+ declare const textRowSchema: (kind: "said" | "thought" | "note") => z.ZodObject<{
18
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
19
+ sequence: z.ZodNumber;
20
+ turnSequence: z.ZodNumber;
21
+ at: z.ZodString;
22
+ text: z.ZodString;
23
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
24
+ }, z.core.$strict>;
25
+ declare const tellRowSchema: z.ZodObject<{
26
+ kind: z.ZodLiteral<"tell">;
27
+ sequence: z.ZodNumber;
28
+ at: z.ZodString;
29
+ tellId: z.ZodString;
30
+ text: z.ZodString;
31
+ state: z.ZodEnum<{
32
+ pending: "pending";
33
+ told: "told";
34
+ }>;
35
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodObject<{
36
+ deliveredAt: z.ZodString;
37
+ route: z.ZodEnum<{
38
+ live: "live";
39
+ launch: "launch";
40
+ }>;
41
+ turnSequence: z.ZodNumber;
42
+ receipt: z.ZodOptional<z.ZodEnum<{
43
+ required: "required";
44
+ unavailable: "unavailable";
45
+ }>>;
46
+ }, z.core.$strict>>>;
47
+ }, z.core.$strict>;
48
+ declare const outcomeSchema: z.ZodUnion<readonly [z.ZodObject<{
49
+ kind: z.ZodLiteral<"answered">;
50
+ historyId: z.ZodString;
51
+ answer: z.ZodString;
52
+ }, z.core.$strict>, z.ZodObject<{
53
+ kind: z.ZodLiteral<"failed">;
54
+ historyId: z.ZodString;
55
+ diagnostic: z.ZodString;
56
+ }, z.core.$strict>]>;
57
+ declare const outcomeRowSchema: z.ZodObject<{
58
+ kind: z.ZodLiteral<"outcome">;
59
+ sequence: z.ZodNumber;
60
+ turnSequence: z.ZodNumber;
61
+ at: z.ZodString;
62
+ outcome: z.ZodUnion<readonly [z.ZodObject<{
63
+ kind: z.ZodLiteral<"answered">;
64
+ historyId: z.ZodString;
65
+ answer: z.ZodString;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ kind: z.ZodLiteral<"failed">;
68
+ historyId: z.ZodString;
69
+ diagnostic: z.ZodString;
70
+ }, z.core.$strict>]>;
71
+ }, z.core.$strict>;
72
+ declare const activeToolRowSchema: z.ZodObject<{
73
+ kind: z.ZodLiteral<"tool">;
74
+ sequence: z.ZodNumber;
75
+ turnSequence: z.ZodNumber;
76
+ at: z.ZodString;
77
+ name: z.ZodString;
78
+ call: z.ZodUnion<readonly [z.ZodObject<{
79
+ kind: z.ZodLiteral<"run">;
80
+ command: z.ZodString;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"read">;
83
+ path: z.ZodString;
84
+ offset: z.ZodOptional<z.ZodNumber>;
85
+ limit: z.ZodOptional<z.ZodNumber>;
86
+ }, z.core.$strict>, z.ZodObject<{
87
+ kind: z.ZodLiteral<"search">;
88
+ query: z.ZodString;
89
+ scope: z.ZodOptional<z.ZodEnum<{
90
+ content: "content";
91
+ files: "files";
92
+ web: "web";
93
+ }>>;
94
+ path: z.ZodOptional<z.ZodString>;
95
+ glob: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strict>, z.ZodObject<{
97
+ kind: z.ZodLiteral<"fileChange">;
98
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
99
+ op: z.ZodEnum<{
100
+ add: "add";
101
+ update: "update";
102
+ delete: "delete";
103
+ unspecified: "unspecified";
104
+ }>;
105
+ path: z.ZodString;
106
+ diffstat: z.ZodOptional<z.ZodObject<{
107
+ added: z.ZodNumber;
108
+ removed: z.ZodNumber;
109
+ }, z.core.$strict>>;
110
+ }, z.core.$strict>>>;
111
+ }, z.core.$strict>, z.ZodObject<{
112
+ kind: z.ZodLiteral<"other">;
113
+ display: z.ZodString;
114
+ }, z.core.$strict>]>;
115
+ state: z.ZodLiteral<"active">;
116
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
117
+ }, z.core.$strict>;
118
+ declare const completedToolRowSchema: z.ZodObject<{
119
+ kind: z.ZodLiteral<"tool">;
120
+ sequence: z.ZodNumber;
121
+ turnSequence: z.ZodNumber;
122
+ at: z.ZodString;
123
+ completedAt: z.ZodOptional<z.ZodString>;
124
+ durationMs: z.ZodOptional<z.ZodNumber>;
125
+ name: z.ZodString;
126
+ call: z.ZodUnion<readonly [z.ZodObject<{
127
+ kind: z.ZodLiteral<"run">;
128
+ command: z.ZodString;
129
+ }, z.core.$strict>, z.ZodObject<{
130
+ kind: z.ZodLiteral<"read">;
131
+ path: z.ZodString;
132
+ offset: z.ZodOptional<z.ZodNumber>;
133
+ limit: z.ZodOptional<z.ZodNumber>;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ kind: z.ZodLiteral<"search">;
136
+ query: z.ZodString;
137
+ scope: z.ZodOptional<z.ZodEnum<{
138
+ content: "content";
139
+ files: "files";
140
+ web: "web";
141
+ }>>;
142
+ path: z.ZodOptional<z.ZodString>;
143
+ glob: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ kind: z.ZodLiteral<"fileChange">;
146
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
147
+ op: z.ZodEnum<{
148
+ add: "add";
149
+ update: "update";
150
+ delete: "delete";
151
+ unspecified: "unspecified";
152
+ }>;
153
+ path: z.ZodString;
154
+ diffstat: z.ZodOptional<z.ZodObject<{
155
+ added: z.ZodNumber;
156
+ removed: z.ZodNumber;
157
+ }, z.core.$strict>>;
158
+ }, z.core.$strict>>>;
159
+ }, z.core.$strict>, z.ZodObject<{
160
+ kind: z.ZodLiteral<"other">;
161
+ display: z.ZodString;
162
+ }, z.core.$strict>]>;
163
+ state: z.ZodObject<{
164
+ status: z.ZodEnum<{
165
+ error: "error";
166
+ ok: "ok";
167
+ }>;
168
+ message: z.ZodOptional<z.ZodString>;
169
+ exitCode: z.ZodOptional<z.ZodNumber>;
170
+ }, z.core.$strict>;
171
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
172
+ }, z.core.$strict>;
173
+ declare const unsettledToolRowSchema: z.ZodObject<{
174
+ kind: z.ZodLiteral<"tool">;
175
+ sequence: z.ZodNumber;
176
+ turnSequence: z.ZodNumber;
177
+ at: z.ZodString;
178
+ name: z.ZodString;
179
+ call: z.ZodUnion<readonly [z.ZodObject<{
180
+ kind: z.ZodLiteral<"run">;
181
+ command: z.ZodString;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ kind: z.ZodLiteral<"read">;
184
+ path: z.ZodString;
185
+ offset: z.ZodOptional<z.ZodNumber>;
186
+ limit: z.ZodOptional<z.ZodNumber>;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ kind: z.ZodLiteral<"search">;
189
+ query: z.ZodString;
190
+ scope: z.ZodOptional<z.ZodEnum<{
191
+ content: "content";
192
+ files: "files";
193
+ web: "web";
194
+ }>>;
195
+ path: z.ZodOptional<z.ZodString>;
196
+ glob: z.ZodOptional<z.ZodString>;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ kind: z.ZodLiteral<"fileChange">;
199
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
200
+ op: z.ZodEnum<{
201
+ add: "add";
202
+ update: "update";
203
+ delete: "delete";
204
+ unspecified: "unspecified";
205
+ }>;
206
+ path: z.ZodString;
207
+ diffstat: z.ZodOptional<z.ZodObject<{
208
+ added: z.ZodNumber;
209
+ removed: z.ZodNumber;
210
+ }, z.core.$strict>>;
211
+ }, z.core.$strict>>>;
212
+ }, z.core.$strict>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"other">;
214
+ display: z.ZodString;
215
+ }, z.core.$strict>]>;
216
+ state: z.ZodLiteral<"unsettled">;
217
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
218
+ }, z.core.$strict>;
219
+ declare const openSnapshotRowSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
220
+ kind: z.ZodLiteral<"call">;
221
+ sequence: z.ZodNumber;
222
+ turnSequence: z.ZodNumber;
223
+ at: z.ZodString;
224
+ text: z.ZodString;
225
+ }, z.core.$strict>, z.ZodObject<{
226
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
227
+ sequence: z.ZodNumber;
228
+ turnSequence: z.ZodNumber;
229
+ at: z.ZodString;
230
+ text: z.ZodString;
231
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
232
+ }, z.core.$strict>, z.ZodObject<{
233
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
234
+ sequence: z.ZodNumber;
235
+ turnSequence: z.ZodNumber;
236
+ at: z.ZodString;
237
+ text: z.ZodString;
238
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
241
+ sequence: z.ZodNumber;
242
+ turnSequence: z.ZodNumber;
243
+ at: z.ZodString;
244
+ text: z.ZodString;
245
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ kind: z.ZodLiteral<"tell">;
248
+ sequence: z.ZodNumber;
249
+ at: z.ZodString;
250
+ tellId: z.ZodString;
251
+ text: z.ZodString;
252
+ state: z.ZodEnum<{
253
+ pending: "pending";
254
+ told: "told";
255
+ }>;
256
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodObject<{
257
+ deliveredAt: z.ZodString;
258
+ route: z.ZodEnum<{
259
+ live: "live";
260
+ launch: "launch";
261
+ }>;
262
+ turnSequence: z.ZodNumber;
263
+ receipt: z.ZodOptional<z.ZodEnum<{
264
+ required: "required";
265
+ unavailable: "unavailable";
266
+ }>>;
267
+ }, z.core.$strict>>>;
268
+ }, z.core.$strict>]>, z.ZodObject<{
269
+ kind: z.ZodLiteral<"tool">;
270
+ sequence: z.ZodNumber;
271
+ turnSequence: z.ZodNumber;
272
+ at: z.ZodString;
273
+ name: z.ZodString;
274
+ call: z.ZodUnion<readonly [z.ZodObject<{
275
+ kind: z.ZodLiteral<"run">;
276
+ command: z.ZodString;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ kind: z.ZodLiteral<"read">;
279
+ path: z.ZodString;
280
+ offset: z.ZodOptional<z.ZodNumber>;
281
+ limit: z.ZodOptional<z.ZodNumber>;
282
+ }, z.core.$strict>, z.ZodObject<{
283
+ kind: z.ZodLiteral<"search">;
284
+ query: z.ZodString;
285
+ scope: z.ZodOptional<z.ZodEnum<{
286
+ content: "content";
287
+ files: "files";
288
+ web: "web";
289
+ }>>;
290
+ path: z.ZodOptional<z.ZodString>;
291
+ glob: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strict>, z.ZodObject<{
293
+ kind: z.ZodLiteral<"fileChange">;
294
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
295
+ op: z.ZodEnum<{
296
+ add: "add";
297
+ update: "update";
298
+ delete: "delete";
299
+ unspecified: "unspecified";
300
+ }>;
301
+ path: z.ZodString;
302
+ diffstat: z.ZodOptional<z.ZodObject<{
303
+ added: z.ZodNumber;
304
+ removed: z.ZodNumber;
305
+ }, z.core.$strict>>;
306
+ }, z.core.$strict>>>;
307
+ }, z.core.$strict>, z.ZodObject<{
308
+ kind: z.ZodLiteral<"other">;
309
+ display: z.ZodString;
310
+ }, z.core.$strict>]>;
311
+ state: z.ZodLiteral<"active">;
312
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
313
+ }, z.core.$strict>, z.ZodObject<{
314
+ kind: z.ZodLiteral<"tool">;
315
+ sequence: z.ZodNumber;
316
+ turnSequence: z.ZodNumber;
317
+ at: z.ZodString;
318
+ completedAt: z.ZodOptional<z.ZodString>;
319
+ durationMs: z.ZodOptional<z.ZodNumber>;
320
+ name: z.ZodString;
321
+ call: z.ZodUnion<readonly [z.ZodObject<{
322
+ kind: z.ZodLiteral<"run">;
323
+ command: z.ZodString;
324
+ }, z.core.$strict>, z.ZodObject<{
325
+ kind: z.ZodLiteral<"read">;
326
+ path: z.ZodString;
327
+ offset: z.ZodOptional<z.ZodNumber>;
328
+ limit: z.ZodOptional<z.ZodNumber>;
329
+ }, z.core.$strict>, z.ZodObject<{
330
+ kind: z.ZodLiteral<"search">;
331
+ query: z.ZodString;
332
+ scope: z.ZodOptional<z.ZodEnum<{
333
+ content: "content";
334
+ files: "files";
335
+ web: "web";
336
+ }>>;
337
+ path: z.ZodOptional<z.ZodString>;
338
+ glob: z.ZodOptional<z.ZodString>;
339
+ }, z.core.$strict>, z.ZodObject<{
340
+ kind: z.ZodLiteral<"fileChange">;
341
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
342
+ op: z.ZodEnum<{
343
+ add: "add";
344
+ update: "update";
345
+ delete: "delete";
346
+ unspecified: "unspecified";
347
+ }>;
348
+ path: z.ZodString;
349
+ diffstat: z.ZodOptional<z.ZodObject<{
350
+ added: z.ZodNumber;
351
+ removed: z.ZodNumber;
352
+ }, z.core.$strict>>;
353
+ }, z.core.$strict>>>;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ kind: z.ZodLiteral<"other">;
356
+ display: z.ZodString;
357
+ }, z.core.$strict>]>;
358
+ state: z.ZodObject<{
359
+ status: z.ZodEnum<{
360
+ error: "error";
361
+ ok: "ok";
362
+ }>;
363
+ message: z.ZodOptional<z.ZodString>;
364
+ exitCode: z.ZodOptional<z.ZodNumber>;
365
+ }, z.core.$strict>;
366
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
367
+ }, z.core.$strict>]>;
368
+ declare const idleSnapshotRowSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
369
+ kind: z.ZodLiteral<"call">;
370
+ sequence: z.ZodNumber;
371
+ turnSequence: z.ZodNumber;
372
+ at: z.ZodString;
373
+ text: z.ZodString;
374
+ }, z.core.$strict>, z.ZodObject<{
375
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
376
+ sequence: z.ZodNumber;
377
+ turnSequence: z.ZodNumber;
378
+ at: z.ZodString;
379
+ text: z.ZodString;
380
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
381
+ }, z.core.$strict>, z.ZodObject<{
382
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
383
+ sequence: z.ZodNumber;
384
+ turnSequence: z.ZodNumber;
385
+ at: z.ZodString;
386
+ text: z.ZodString;
387
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
388
+ }, z.core.$strict>, z.ZodObject<{
389
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
390
+ sequence: z.ZodNumber;
391
+ turnSequence: z.ZodNumber;
392
+ at: z.ZodString;
393
+ text: z.ZodString;
394
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ kind: z.ZodLiteral<"tell">;
397
+ sequence: z.ZodNumber;
398
+ at: z.ZodString;
399
+ tellId: z.ZodString;
400
+ text: z.ZodString;
401
+ state: z.ZodEnum<{
402
+ pending: "pending";
403
+ told: "told";
404
+ }>;
405
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodObject<{
406
+ deliveredAt: z.ZodString;
407
+ route: z.ZodEnum<{
408
+ live: "live";
409
+ launch: "launch";
410
+ }>;
411
+ turnSequence: z.ZodNumber;
412
+ receipt: z.ZodOptional<z.ZodEnum<{
413
+ required: "required";
414
+ unavailable: "unavailable";
415
+ }>>;
416
+ }, z.core.$strict>>>;
417
+ }, z.core.$strict>]>, z.ZodObject<{
418
+ kind: z.ZodLiteral<"tool">;
419
+ sequence: z.ZodNumber;
420
+ turnSequence: z.ZodNumber;
421
+ at: z.ZodString;
422
+ completedAt: z.ZodOptional<z.ZodString>;
423
+ durationMs: z.ZodOptional<z.ZodNumber>;
424
+ name: z.ZodString;
425
+ call: z.ZodUnion<readonly [z.ZodObject<{
426
+ kind: z.ZodLiteral<"run">;
427
+ command: z.ZodString;
428
+ }, z.core.$strict>, z.ZodObject<{
429
+ kind: z.ZodLiteral<"read">;
430
+ path: z.ZodString;
431
+ offset: z.ZodOptional<z.ZodNumber>;
432
+ limit: z.ZodOptional<z.ZodNumber>;
433
+ }, z.core.$strict>, z.ZodObject<{
434
+ kind: z.ZodLiteral<"search">;
435
+ query: z.ZodString;
436
+ scope: z.ZodOptional<z.ZodEnum<{
437
+ content: "content";
438
+ files: "files";
439
+ web: "web";
440
+ }>>;
441
+ path: z.ZodOptional<z.ZodString>;
442
+ glob: z.ZodOptional<z.ZodString>;
443
+ }, z.core.$strict>, z.ZodObject<{
444
+ kind: z.ZodLiteral<"fileChange">;
445
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
446
+ op: z.ZodEnum<{
447
+ add: "add";
448
+ update: "update";
449
+ delete: "delete";
450
+ unspecified: "unspecified";
451
+ }>;
452
+ path: z.ZodString;
453
+ diffstat: z.ZodOptional<z.ZodObject<{
454
+ added: z.ZodNumber;
455
+ removed: z.ZodNumber;
456
+ }, z.core.$strict>>;
457
+ }, z.core.$strict>>>;
458
+ }, z.core.$strict>, z.ZodObject<{
459
+ kind: z.ZodLiteral<"other">;
460
+ display: z.ZodString;
461
+ }, z.core.$strict>]>;
462
+ state: z.ZodObject<{
463
+ status: z.ZodEnum<{
464
+ error: "error";
465
+ ok: "ok";
466
+ }>;
467
+ message: z.ZodOptional<z.ZodString>;
468
+ exitCode: z.ZodOptional<z.ZodNumber>;
469
+ }, z.core.$strict>;
470
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
471
+ }, z.core.$strict>]>;
472
+ declare const snapshotEntrySchema: <Row extends z.ZodType>(row: Row) => z.ZodUnion<readonly [z.ZodObject<{
473
+ kind: z.ZodLiteral<"gap">;
474
+ count: z.ZodNumber;
475
+ }, z.core.$strict>, z.ZodObject<{
476
+ kind: z.ZodLiteral<"row">;
477
+ row: Row;
478
+ }, z.core.$strict>]>;
479
+ declare const reportedFileChangeSchema: z.ZodObject<{
480
+ sequence: z.ZodNumber;
481
+ at: z.ZodString;
482
+ op: z.ZodEnum<{
483
+ add: "add";
484
+ update: "update";
485
+ delete: "delete";
486
+ unspecified: "unspecified";
487
+ }>;
488
+ path: z.ZodString;
489
+ diffstat: z.ZodOptional<z.ZodObject<{
490
+ added: z.ZodNumber;
491
+ removed: z.ZodNumber;
492
+ }, z.core.$strict>>;
493
+ }, z.core.$strict>;
494
+ export declare const activitySnapshotSchema: z.ZodUnion<readonly [z.ZodObject<{
495
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
496
+ sequence: z.ZodNumber;
497
+ at: z.ZodString;
498
+ op: z.ZodEnum<{
499
+ add: "add";
500
+ update: "update";
501
+ delete: "delete";
502
+ unspecified: "unspecified";
503
+ }>;
504
+ path: z.ZodString;
505
+ diffstat: z.ZodOptional<z.ZodObject<{
506
+ added: z.ZodNumber;
507
+ removed: z.ZodNumber;
508
+ }, z.core.$strict>>;
509
+ }, z.core.$strict>>>;
510
+ reportedChangesOmitted: z.ZodNumber;
511
+ kind: z.ZodLiteral<"unborn">;
512
+ entries: z.ZodReadonly<z.ZodTuple<[], null>>;
513
+ omitted: z.ZodLiteral<0>;
514
+ }, z.core.$strict>, z.ZodObject<{
515
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
516
+ sequence: z.ZodNumber;
517
+ at: z.ZodString;
518
+ op: z.ZodEnum<{
519
+ add: "add";
520
+ update: "update";
521
+ delete: "delete";
522
+ unspecified: "unspecified";
523
+ }>;
524
+ path: z.ZodString;
525
+ diffstat: z.ZodOptional<z.ZodObject<{
526
+ added: z.ZodNumber;
527
+ removed: z.ZodNumber;
528
+ }, z.core.$strict>>;
529
+ }, z.core.$strict>>>;
530
+ reportedChangesOmitted: z.ZodNumber;
531
+ kind: z.ZodLiteral<"open">;
532
+ turn: z.ZodObject<{
533
+ kind: z.ZodLiteral<"turn">;
534
+ sequence: z.ZodNumber;
535
+ turnSequence: z.ZodNumber;
536
+ bodySequence: z.ZodNumber;
537
+ at: z.ZodString;
538
+ }, z.core.$strict>;
539
+ entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
540
+ kind: z.ZodLiteral<"gap">;
541
+ count: z.ZodNumber;
542
+ }, z.core.$strict>, z.ZodObject<{
543
+ kind: z.ZodLiteral<"row">;
544
+ row: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
545
+ kind: z.ZodLiteral<"call">;
546
+ sequence: z.ZodNumber;
547
+ turnSequence: z.ZodNumber;
548
+ at: z.ZodString;
549
+ text: z.ZodString;
550
+ }, z.core.$strict>, z.ZodObject<{
551
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
552
+ sequence: z.ZodNumber;
553
+ turnSequence: z.ZodNumber;
554
+ at: z.ZodString;
555
+ text: z.ZodString;
556
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
557
+ }, z.core.$strict>, z.ZodObject<{
558
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
559
+ sequence: z.ZodNumber;
560
+ turnSequence: z.ZodNumber;
561
+ at: z.ZodString;
562
+ text: z.ZodString;
563
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
564
+ }, z.core.$strict>, z.ZodObject<{
565
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
566
+ sequence: z.ZodNumber;
567
+ turnSequence: z.ZodNumber;
568
+ at: z.ZodString;
569
+ text: z.ZodString;
570
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
571
+ }, z.core.$strict>, z.ZodObject<{
572
+ kind: z.ZodLiteral<"tell">;
573
+ sequence: z.ZodNumber;
574
+ at: z.ZodString;
575
+ tellId: z.ZodString;
576
+ text: z.ZodString;
577
+ state: z.ZodEnum<{
578
+ pending: "pending";
579
+ told: "told";
580
+ }>;
581
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodObject<{
582
+ deliveredAt: z.ZodString;
583
+ route: z.ZodEnum<{
584
+ live: "live";
585
+ launch: "launch";
586
+ }>;
587
+ turnSequence: z.ZodNumber;
588
+ receipt: z.ZodOptional<z.ZodEnum<{
589
+ required: "required";
590
+ unavailable: "unavailable";
591
+ }>>;
592
+ }, z.core.$strict>>>;
593
+ }, z.core.$strict>]>, z.ZodObject<{
594
+ kind: z.ZodLiteral<"tool">;
595
+ sequence: z.ZodNumber;
596
+ turnSequence: z.ZodNumber;
597
+ at: z.ZodString;
598
+ name: z.ZodString;
599
+ call: z.ZodUnion<readonly [z.ZodObject<{
600
+ kind: z.ZodLiteral<"run">;
601
+ command: z.ZodString;
602
+ }, z.core.$strict>, z.ZodObject<{
603
+ kind: z.ZodLiteral<"read">;
604
+ path: z.ZodString;
605
+ offset: z.ZodOptional<z.ZodNumber>;
606
+ limit: z.ZodOptional<z.ZodNumber>;
607
+ }, z.core.$strict>, z.ZodObject<{
608
+ kind: z.ZodLiteral<"search">;
609
+ query: z.ZodString;
610
+ scope: z.ZodOptional<z.ZodEnum<{
611
+ content: "content";
612
+ files: "files";
613
+ web: "web";
614
+ }>>;
615
+ path: z.ZodOptional<z.ZodString>;
616
+ glob: z.ZodOptional<z.ZodString>;
617
+ }, z.core.$strict>, z.ZodObject<{
618
+ kind: z.ZodLiteral<"fileChange">;
619
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
620
+ op: z.ZodEnum<{
621
+ add: "add";
622
+ update: "update";
623
+ delete: "delete";
624
+ unspecified: "unspecified";
625
+ }>;
626
+ path: z.ZodString;
627
+ diffstat: z.ZodOptional<z.ZodObject<{
628
+ added: z.ZodNumber;
629
+ removed: z.ZodNumber;
630
+ }, z.core.$strict>>;
631
+ }, z.core.$strict>>>;
632
+ }, z.core.$strict>, z.ZodObject<{
633
+ kind: z.ZodLiteral<"other">;
634
+ display: z.ZodString;
635
+ }, z.core.$strict>]>;
636
+ state: z.ZodLiteral<"active">;
637
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
638
+ }, z.core.$strict>, z.ZodObject<{
639
+ kind: z.ZodLiteral<"tool">;
640
+ sequence: z.ZodNumber;
641
+ turnSequence: z.ZodNumber;
642
+ at: z.ZodString;
643
+ completedAt: z.ZodOptional<z.ZodString>;
644
+ durationMs: z.ZodOptional<z.ZodNumber>;
645
+ name: z.ZodString;
646
+ call: z.ZodUnion<readonly [z.ZodObject<{
647
+ kind: z.ZodLiteral<"run">;
648
+ command: z.ZodString;
649
+ }, z.core.$strict>, z.ZodObject<{
650
+ kind: z.ZodLiteral<"read">;
651
+ path: z.ZodString;
652
+ offset: z.ZodOptional<z.ZodNumber>;
653
+ limit: z.ZodOptional<z.ZodNumber>;
654
+ }, z.core.$strict>, z.ZodObject<{
655
+ kind: z.ZodLiteral<"search">;
656
+ query: z.ZodString;
657
+ scope: z.ZodOptional<z.ZodEnum<{
658
+ content: "content";
659
+ files: "files";
660
+ web: "web";
661
+ }>>;
662
+ path: z.ZodOptional<z.ZodString>;
663
+ glob: z.ZodOptional<z.ZodString>;
664
+ }, z.core.$strict>, z.ZodObject<{
665
+ kind: z.ZodLiteral<"fileChange">;
666
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
667
+ op: z.ZodEnum<{
668
+ add: "add";
669
+ update: "update";
670
+ delete: "delete";
671
+ unspecified: "unspecified";
672
+ }>;
673
+ path: z.ZodString;
674
+ diffstat: z.ZodOptional<z.ZodObject<{
675
+ added: z.ZodNumber;
676
+ removed: z.ZodNumber;
677
+ }, z.core.$strict>>;
678
+ }, z.core.$strict>>>;
679
+ }, z.core.$strict>, z.ZodObject<{
680
+ kind: z.ZodLiteral<"other">;
681
+ display: z.ZodString;
682
+ }, z.core.$strict>]>;
683
+ state: z.ZodObject<{
684
+ status: z.ZodEnum<{
685
+ error: "error";
686
+ ok: "ok";
687
+ }>;
688
+ message: z.ZodOptional<z.ZodString>;
689
+ exitCode: z.ZodOptional<z.ZodNumber>;
690
+ }, z.core.$strict>;
691
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
692
+ }, z.core.$strict>]>;
693
+ }, z.core.$strict>]>>>;
694
+ omitted: z.ZodNumber;
695
+ }, z.core.$strict>, z.ZodObject<{
696
+ reportedChanges: z.ZodReadonly<z.ZodArray<z.ZodObject<{
697
+ sequence: z.ZodNumber;
698
+ at: z.ZodString;
699
+ op: z.ZodEnum<{
700
+ add: "add";
701
+ update: "update";
702
+ delete: "delete";
703
+ unspecified: "unspecified";
704
+ }>;
705
+ path: z.ZodString;
706
+ diffstat: z.ZodOptional<z.ZodObject<{
707
+ added: z.ZodNumber;
708
+ removed: z.ZodNumber;
709
+ }, z.core.$strict>>;
710
+ }, z.core.$strict>>>;
711
+ reportedChangesOmitted: z.ZodNumber;
712
+ kind: z.ZodLiteral<"idle">;
713
+ outcome: z.ZodOptional<z.ZodObject<{
714
+ kind: z.ZodLiteral<"outcome">;
715
+ sequence: z.ZodNumber;
716
+ turnSequence: z.ZodNumber;
717
+ at: z.ZodString;
718
+ outcome: z.ZodUnion<readonly [z.ZodObject<{
719
+ kind: z.ZodLiteral<"answered">;
720
+ historyId: z.ZodString;
721
+ answer: z.ZodString;
722
+ }, z.core.$strict>, z.ZodObject<{
723
+ kind: z.ZodLiteral<"failed">;
724
+ historyId: z.ZodString;
725
+ diagnostic: z.ZodString;
726
+ }, z.core.$strict>]>;
727
+ }, z.core.$strict>>;
728
+ entries: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
729
+ kind: z.ZodLiteral<"gap">;
730
+ count: z.ZodNumber;
731
+ }, z.core.$strict>, z.ZodObject<{
732
+ kind: z.ZodLiteral<"row">;
733
+ row: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
734
+ kind: z.ZodLiteral<"call">;
735
+ sequence: z.ZodNumber;
736
+ turnSequence: z.ZodNumber;
737
+ at: z.ZodString;
738
+ text: z.ZodString;
739
+ }, z.core.$strict>, z.ZodObject<{
740
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
741
+ sequence: z.ZodNumber;
742
+ turnSequence: z.ZodNumber;
743
+ at: z.ZodString;
744
+ text: z.ZodString;
745
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
746
+ }, z.core.$strict>, z.ZodObject<{
747
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
748
+ sequence: z.ZodNumber;
749
+ turnSequence: z.ZodNumber;
750
+ at: z.ZodString;
751
+ text: z.ZodString;
752
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
753
+ }, z.core.$strict>, z.ZodObject<{
754
+ kind: z.ZodLiteral<"note" | "thought" | "said">;
755
+ sequence: z.ZodNumber;
756
+ turnSequence: z.ZodNumber;
757
+ at: z.ZodString;
758
+ text: z.ZodString;
759
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
760
+ }, z.core.$strict>, z.ZodObject<{
761
+ kind: z.ZodLiteral<"tell">;
762
+ sequence: z.ZodNumber;
763
+ at: z.ZodString;
764
+ tellId: z.ZodString;
765
+ text: z.ZodString;
766
+ state: z.ZodEnum<{
767
+ pending: "pending";
768
+ told: "told";
769
+ }>;
770
+ deliveries: z.ZodReadonly<z.ZodArray<z.ZodObject<{
771
+ deliveredAt: z.ZodString;
772
+ route: z.ZodEnum<{
773
+ live: "live";
774
+ launch: "launch";
775
+ }>;
776
+ turnSequence: z.ZodNumber;
777
+ receipt: z.ZodOptional<z.ZodEnum<{
778
+ required: "required";
779
+ unavailable: "unavailable";
780
+ }>>;
781
+ }, z.core.$strict>>>;
782
+ }, z.core.$strict>]>, z.ZodObject<{
783
+ kind: z.ZodLiteral<"tool">;
784
+ sequence: z.ZodNumber;
785
+ turnSequence: z.ZodNumber;
786
+ at: z.ZodString;
787
+ completedAt: z.ZodOptional<z.ZodString>;
788
+ durationMs: z.ZodOptional<z.ZodNumber>;
789
+ name: z.ZodString;
790
+ call: z.ZodUnion<readonly [z.ZodObject<{
791
+ kind: z.ZodLiteral<"run">;
792
+ command: z.ZodString;
793
+ }, z.core.$strict>, z.ZodObject<{
794
+ kind: z.ZodLiteral<"read">;
795
+ path: z.ZodString;
796
+ offset: z.ZodOptional<z.ZodNumber>;
797
+ limit: z.ZodOptional<z.ZodNumber>;
798
+ }, z.core.$strict>, z.ZodObject<{
799
+ kind: z.ZodLiteral<"search">;
800
+ query: z.ZodString;
801
+ scope: z.ZodOptional<z.ZodEnum<{
802
+ content: "content";
803
+ files: "files";
804
+ web: "web";
805
+ }>>;
806
+ path: z.ZodOptional<z.ZodString>;
807
+ glob: z.ZodOptional<z.ZodString>;
808
+ }, z.core.$strict>, z.ZodObject<{
809
+ kind: z.ZodLiteral<"fileChange">;
810
+ changes: z.ZodReadonly<z.ZodArray<z.ZodObject<{
811
+ op: z.ZodEnum<{
812
+ add: "add";
813
+ update: "update";
814
+ delete: "delete";
815
+ unspecified: "unspecified";
816
+ }>;
817
+ path: z.ZodString;
818
+ diffstat: z.ZodOptional<z.ZodObject<{
819
+ added: z.ZodNumber;
820
+ removed: z.ZodNumber;
821
+ }, z.core.$strict>>;
822
+ }, z.core.$strict>>>;
823
+ }, z.core.$strict>, z.ZodObject<{
824
+ kind: z.ZodLiteral<"other">;
825
+ display: z.ZodString;
826
+ }, z.core.$strict>]>;
827
+ state: z.ZodObject<{
828
+ status: z.ZodEnum<{
829
+ error: "error";
830
+ ok: "ok";
831
+ }>;
832
+ message: z.ZodOptional<z.ZodString>;
833
+ exitCode: z.ZodOptional<z.ZodNumber>;
834
+ }, z.core.$strict>;
835
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
836
+ }, z.core.$strict>]>;
837
+ }, z.core.$strict>]>>>;
838
+ omitted: z.ZodNumber;
839
+ }, z.core.$strict>]>;
840
+ export type TurnOutcome = z.infer<typeof outcomeSchema>;
841
+ export type TurnStartRow = z.infer<typeof turnRowSchema>;
842
+ type CallRow = z.infer<typeof callRowSchema>;
843
+ type SaidRow = z.infer<ReturnType<typeof textRowSchema>>;
844
+ type ThoughtRow = z.infer<ReturnType<typeof textRowSchema>>;
845
+ type NoteRow = z.infer<ReturnType<typeof textRowSchema>>;
50
846
  type TurnNarrationRow = CallRow | SaidRow | ThoughtRow | NoteRow;
51
- export type TellRow = Readonly<{
52
- kind: "tell";
53
- sequence: number;
54
- at: string;
55
- tellId: string;
56
- text: string;
57
- state: TellFact["state"];
58
- deliveries: readonly TellDelivery[];
59
- }>;
60
- export type OutcomeRow = Readonly<{
61
- kind: "outcome";
62
- sequence: number;
63
- turnSequence: number;
64
- at: string;
65
- outcome: TurnOutcome;
66
- }>;
67
- export type ActiveToolRow = Readonly<{
68
- kind: "tool";
69
- sequence: number;
70
- turnSequence: number;
71
- at: string;
72
- name: string;
73
- call: ToolCall;
74
- state: "active";
75
- truncated?: true;
76
- }>;
77
- export type CompletedToolRow = Readonly<{
78
- kind: "tool";
79
- sequence: number;
80
- turnSequence: number;
81
- at: string;
82
- completedAt?: string;
83
- durationMs?: number;
84
- name: string;
85
- call: ToolCall;
86
- state: ToolResult;
87
- truncated?: true;
88
- }>;
89
- export type UnsettledToolRow = Readonly<{
90
- kind: "tool";
91
- sequence: number;
92
- turnSequence: number;
93
- at: string;
94
- name: string;
95
- call: ToolCall;
96
- state: "unsettled";
97
- truncated?: true;
98
- }>;
847
+ export type TellRow = z.infer<typeof tellRowSchema>;
848
+ export type OutcomeRow = z.infer<typeof outcomeRowSchema>;
849
+ export type ActiveToolRow = z.infer<typeof activeToolRowSchema>;
850
+ export type CompletedToolRow = z.infer<typeof completedToolRowSchema>;
851
+ export type UnsettledToolRow = z.infer<typeof unsettledToolRowSchema>;
99
852
  export type OpenTurnRow = TurnNarrationRow | ActiveToolRow | CompletedToolRow;
100
853
  export type ClosedTurnRow = TurnNarrationRow | UnsettledToolRow | CompletedToolRow;
101
854
  export type OpenTurn = Readonly<{
@@ -111,47 +864,13 @@ export type ClosedTurn = Readonly<{
111
864
  }>;
112
865
  export type ProjectedTurn = OpenTurn | ClosedTurn;
113
866
  export type ActivityRow = TurnStartRow | OpenTurnRow | ClosedTurnRow | TellRow | OutcomeRow;
114
- type SnapshotFactRow = TurnNarrationRow | TellRow;
115
- export type OpenSnapshotRow = SnapshotFactRow | ActiveToolRow | CompletedToolRow;
116
- export type IdleSnapshotRow = SnapshotFactRow | CompletedToolRow;
867
+ export type OpenSnapshotRow = z.infer<typeof openSnapshotRowSchema>;
868
+ export type IdleSnapshotRow = z.infer<typeof idleSnapshotRowSchema>;
117
869
  export type SnapshotRow = OpenSnapshotRow | IdleSnapshotRow;
118
- export type ActivitySnapshotEntry<Row extends SnapshotRow = SnapshotRow> = Readonly<{
119
- kind: "row";
120
- row: Row;
121
- }> | Readonly<{
122
- kind: "gap";
123
- count: number;
124
- }>;
125
- export type ReportedFileChange = Readonly<{
126
- sequence: number;
127
- at: string;
128
- op: "add" | "update" | "delete" | "unspecified";
129
- path: string;
130
- diffstat?: Readonly<{
131
- added: number;
132
- removed: number;
133
- }>;
134
- }>;
135
- type ReportedChangeSummary = Readonly<{
136
- reportedChanges: readonly ReportedFileChange[];
137
- reportedChangesOmitted: number;
138
- }>;
139
- export type Snapshot = Readonly<{
140
- kind: "unborn";
141
- entries: readonly [];
142
- omitted: 0;
143
- } & ReportedChangeSummary> | Readonly<{
144
- kind: "open";
145
- turn: TurnStartRow;
146
- entries: readonly ActivitySnapshotEntry<OpenSnapshotRow>[];
147
- omitted: number;
148
- } & ReportedChangeSummary> | Readonly<{
149
- kind: "idle";
150
- outcome?: OutcomeRow;
151
- entries: readonly ActivitySnapshotEntry<IdleSnapshotRow>[];
152
- omitted: number;
153
- } & ReportedChangeSummary>;
154
- export type ActivitySnapshot = Snapshot;
870
+ export type ActivitySnapshotEntry<Row extends SnapshotRow = SnapshotRow> = z.infer<ReturnType<typeof snapshotEntrySchema<z.ZodType<Row>>>>;
871
+ export type ReportedFileChange = z.infer<typeof reportedFileChangeSchema>;
872
+ export type Snapshot = z.infer<typeof activitySnapshotSchema>;
873
+ export type ActivitySnapshot = z.infer<typeof activitySnapshotSchema>;
155
874
  export type ActivityHistory = Readonly<{
156
875
  rows: readonly ActivityRow[];
157
876
  omitted: number;