moderado 0.3.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 (275) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +208 -0
  3. package/dist/args.d.ts +26 -0
  4. package/dist/args.d.ts.map +1 -0
  5. package/dist/args.js +108 -0
  6. package/dist/args.js.map +1 -0
  7. package/dist/commands/chat.d.ts +121 -0
  8. package/dist/commands/chat.d.ts.map +1 -0
  9. package/dist/commands/chat.js +1484 -0
  10. package/dist/commands/chat.js.map +1 -0
  11. package/dist/commands/doctor.d.ts +3 -0
  12. package/dist/commands/doctor.d.ts.map +1 -0
  13. package/dist/commands/doctor.js +61 -0
  14. package/dist/commands/doctor.js.map +1 -0
  15. package/dist/commands/init.d.ts +27 -0
  16. package/dist/commands/init.d.ts.map +1 -0
  17. package/dist/commands/init.js +172 -0
  18. package/dist/commands/init.js.map +1 -0
  19. package/dist/commands/interactive_menu.d.ts +3 -0
  20. package/dist/commands/interactive_menu.d.ts.map +1 -0
  21. package/dist/commands/interactive_menu.js +98 -0
  22. package/dist/commands/interactive_menu.js.map +1 -0
  23. package/dist/commands/models.d.ts +8 -0
  24. package/dist/commands/models.d.ts.map +1 -0
  25. package/dist/commands/models.js +81 -0
  26. package/dist/commands/models.js.map +1 -0
  27. package/dist/commands/run.d.ts +3 -0
  28. package/dist/commands/run.d.ts.map +1 -0
  29. package/dist/commands/run.js +140 -0
  30. package/dist/commands/run.js.map +1 -0
  31. package/dist/config.d.ts +44 -0
  32. package/dist/config.d.ts.map +1 -0
  33. package/dist/config.js +195 -0
  34. package/dist/config.js.map +1 -0
  35. package/dist/credentials.d.ts +14 -0
  36. package/dist/credentials.d.ts.map +1 -0
  37. package/dist/credentials.js +23 -0
  38. package/dist/credentials.js.map +1 -0
  39. package/dist/diagnostic_log.d.ts +2 -0
  40. package/dist/diagnostic_log.d.ts.map +1 -0
  41. package/dist/diagnostic_log.js +21 -0
  42. package/dist/diagnostic_log.js.map +1 -0
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +83 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/model_pricing.d.ts +4 -0
  48. package/dist/model_pricing.d.ts.map +1 -0
  49. package/dist/model_pricing.js +10 -0
  50. package/dist/model_pricing.js.map +1 -0
  51. package/dist/sessions.d.ts +203 -0
  52. package/dist/sessions.d.ts.map +1 -0
  53. package/dist/sessions.js +82 -0
  54. package/dist/sessions.js.map +1 -0
  55. package/dist/ui/box.d.ts +14 -0
  56. package/dist/ui/box.d.ts.map +1 -0
  57. package/dist/ui/box.js +52 -0
  58. package/dist/ui/box.js.map +1 -0
  59. package/dist/ui/file_mentions.d.ts +38 -0
  60. package/dist/ui/file_mentions.d.ts.map +1 -0
  61. package/dist/ui/file_mentions.js +119 -0
  62. package/dist/ui/file_mentions.js.map +1 -0
  63. package/dist/ui/help_modal.d.ts +2 -0
  64. package/dist/ui/help_modal.d.ts.map +1 -0
  65. package/dist/ui/help_modal.js +101 -0
  66. package/dist/ui/help_modal.js.map +1 -0
  67. package/dist/ui/model_selector.d.ts +48 -0
  68. package/dist/ui/model_selector.d.ts.map +1 -0
  69. package/dist/ui/model_selector.js +829 -0
  70. package/dist/ui/model_selector.js.map +1 -0
  71. package/dist/ui/popup.d.ts +78 -0
  72. package/dist/ui/popup.d.ts.map +1 -0
  73. package/dist/ui/popup.js +274 -0
  74. package/dist/ui/popup.js.map +1 -0
  75. package/dist/ui/prompt.d.ts +21 -0
  76. package/dist/ui/prompt.d.ts.map +1 -0
  77. package/dist/ui/prompt.js +128 -0
  78. package/dist/ui/prompt.js.map +1 -0
  79. package/dist/ui/provider_connect.d.ts +33 -0
  80. package/dist/ui/provider_connect.d.ts.map +1 -0
  81. package/dist/ui/provider_connect.js +175 -0
  82. package/dist/ui/provider_connect.js.map +1 -0
  83. package/dist/ui/renderer.d.ts +19 -0
  84. package/dist/ui/renderer.d.ts.map +1 -0
  85. package/dist/ui/renderer.js +147 -0
  86. package/dist/ui/renderer.js.map +1 -0
  87. package/dist/ui/session_screen.d.ts +32 -0
  88. package/dist/ui/session_screen.d.ts.map +1 -0
  89. package/dist/ui/session_screen.js +148 -0
  90. package/dist/ui/session_screen.js.map +1 -0
  91. package/dist/ui/session_terminal.d.ts +46 -0
  92. package/dist/ui/session_terminal.d.ts.map +1 -0
  93. package/dist/ui/session_terminal.js +342 -0
  94. package/dist/ui/session_terminal.js.map +1 -0
  95. package/dist/ui/terminal_approval.d.ts +14 -0
  96. package/dist/ui/terminal_approval.d.ts.map +1 -0
  97. package/dist/ui/terminal_approval.js +98 -0
  98. package/dist/ui/terminal_approval.js.map +1 -0
  99. package/dist/ui/welcome.d.ts +130 -0
  100. package/dist/ui/welcome.d.ts.map +1 -0
  101. package/dist/ui/welcome.js +990 -0
  102. package/dist/ui/welcome.js.map +1 -0
  103. package/dist/vendor/contracts/approvals.d.ts +91 -0
  104. package/dist/vendor/contracts/approvals.d.ts.map +1 -0
  105. package/dist/vendor/contracts/approvals.js +22 -0
  106. package/dist/vendor/contracts/approvals.js.map +1 -0
  107. package/dist/vendor/contracts/events.d.ts +1215 -0
  108. package/dist/vendor/contracts/events.d.ts.map +1 -0
  109. package/dist/vendor/contracts/events.js +94 -0
  110. package/dist/vendor/contracts/events.js.map +1 -0
  111. package/dist/vendor/contracts/index.d.ts +7 -0
  112. package/dist/vendor/contracts/index.d.ts.map +1 -0
  113. package/dist/vendor/contracts/index.js +7 -0
  114. package/dist/vendor/contracts/index.js.map +1 -0
  115. package/dist/vendor/contracts/messages.d.ts +181 -0
  116. package/dist/vendor/contracts/messages.d.ts.map +1 -0
  117. package/dist/vendor/contracts/messages.js +40 -0
  118. package/dist/vendor/contracts/messages.js.map +1 -0
  119. package/dist/vendor/contracts/models.d.ts +117 -0
  120. package/dist/vendor/contracts/models.d.ts.map +1 -0
  121. package/dist/vendor/contracts/models.js +37 -0
  122. package/dist/vendor/contracts/models.js.map +1 -0
  123. package/dist/vendor/contracts/provider.d.ts +121 -0
  124. package/dist/vendor/contracts/provider.d.ts.map +1 -0
  125. package/dist/vendor/contracts/provider.js +64 -0
  126. package/dist/vendor/contracts/provider.js.map +1 -0
  127. package/dist/vendor/contracts/tools.d.ts +305 -0
  128. package/dist/vendor/contracts/tools.d.ts.map +1 -0
  129. package/dist/vendor/contracts/tools.js +65 -0
  130. package/dist/vendor/contracts/tools.js.map +1 -0
  131. package/dist/vendor/core/agent.d.ts +39 -0
  132. package/dist/vendor/core/agent.d.ts.map +1 -0
  133. package/dist/vendor/core/agent.js +710 -0
  134. package/dist/vendor/core/agent.js.map +1 -0
  135. package/dist/vendor/core/host_event_stream.d.ts +9 -0
  136. package/dist/vendor/core/host_event_stream.d.ts.map +1 -0
  137. package/dist/vendor/core/host_event_stream.js +12 -0
  138. package/dist/vendor/core/host_event_stream.js.map +1 -0
  139. package/dist/vendor/core/index.d.ts +7 -0
  140. package/dist/vendor/core/index.d.ts.map +1 -0
  141. package/dist/vendor/core/index.js +7 -0
  142. package/dist/vendor/core/index.js.map +1 -0
  143. package/dist/vendor/core/policy.d.ts +19 -0
  144. package/dist/vendor/core/policy.d.ts.map +1 -0
  145. package/dist/vendor/core/policy.js +31 -0
  146. package/dist/vendor/core/policy.js.map +1 -0
  147. package/dist/vendor/core/router.d.ts +26 -0
  148. package/dist/vendor/core/router.d.ts.map +1 -0
  149. package/dist/vendor/core/router.js +222 -0
  150. package/dist/vendor/core/router.js.map +1 -0
  151. package/dist/vendor/core/subagent.d.ts +29 -0
  152. package/dist/vendor/core/subagent.d.ts.map +1 -0
  153. package/dist/vendor/core/subagent.js +66 -0
  154. package/dist/vendor/core/subagent.js.map +1 -0
  155. package/dist/vendor/core/think_filter.d.ts +14 -0
  156. package/dist/vendor/core/think_filter.d.ts.map +1 -0
  157. package/dist/vendor/core/think_filter.js +136 -0
  158. package/dist/vendor/core/think_filter.js.map +1 -0
  159. package/dist/vendor/providers/fake/fake_provider.d.ts +16 -0
  160. package/dist/vendor/providers/fake/fake_provider.d.ts.map +1 -0
  161. package/dist/vendor/providers/fake/fake_provider.js +89 -0
  162. package/dist/vendor/providers/fake/fake_provider.js.map +1 -0
  163. package/dist/vendor/providers/index.d.ts +6 -0
  164. package/dist/vendor/providers/index.d.ts.map +1 -0
  165. package/dist/vendor/providers/index.js +6 -0
  166. package/dist/vendor/providers/index.js.map +1 -0
  167. package/dist/vendor/providers/model_discovery.d.ts +28 -0
  168. package/dist/vendor/providers/model_discovery.d.ts.map +1 -0
  169. package/dist/vendor/providers/model_discovery.js +106 -0
  170. package/dist/vendor/providers/model_discovery.js.map +1 -0
  171. package/dist/vendor/providers/nvidia/nvidia_adapter.d.ts +23 -0
  172. package/dist/vendor/providers/nvidia/nvidia_adapter.d.ts.map +1 -0
  173. package/dist/vendor/providers/nvidia/nvidia_adapter.js +197 -0
  174. package/dist/vendor/providers/nvidia/nvidia_adapter.js.map +1 -0
  175. package/dist/vendor/providers/nvidia/sse_parser.d.ts +3 -0
  176. package/dist/vendor/providers/nvidia/sse_parser.d.ts.map +1 -0
  177. package/dist/vendor/providers/nvidia/sse_parser.js +84 -0
  178. package/dist/vendor/providers/nvidia/sse_parser.js.map +1 -0
  179. package/dist/vendor/providers/openai_compatible_adapter.d.ts +10 -0
  180. package/dist/vendor/providers/openai_compatible_adapter.d.ts.map +1 -0
  181. package/dist/vendor/providers/openai_compatible_adapter.js +8 -0
  182. package/dist/vendor/providers/openai_compatible_adapter.js.map +1 -0
  183. package/dist/vendor/tools/checkpoints.d.ts +27 -0
  184. package/dist/vendor/tools/checkpoints.d.ts.map +1 -0
  185. package/dist/vendor/tools/checkpoints.js +145 -0
  186. package/dist/vendor/tools/checkpoints.js.map +1 -0
  187. package/dist/vendor/tools/diagnostics.d.ts +11 -0
  188. package/dist/vendor/tools/diagnostics.d.ts.map +1 -0
  189. package/dist/vendor/tools/diagnostics.js +16 -0
  190. package/dist/vendor/tools/diagnostics.js.map +1 -0
  191. package/dist/vendor/tools/diff.d.ts +7 -0
  192. package/dist/vendor/tools/diff.d.ts.map +1 -0
  193. package/dist/vendor/tools/diff.js +48 -0
  194. package/dist/vendor/tools/diff.js.map +1 -0
  195. package/dist/vendor/tools/errors.d.ts +17 -0
  196. package/dist/vendor/tools/errors.d.ts.map +1 -0
  197. package/dist/vendor/tools/errors.js +33 -0
  198. package/dist/vendor/tools/errors.js.map +1 -0
  199. package/dist/vendor/tools/git_workspace.d.ts +14 -0
  200. package/dist/vendor/tools/git_workspace.d.ts.map +1 -0
  201. package/dist/vendor/tools/git_workspace.js +42 -0
  202. package/dist/vendor/tools/git_workspace.js.map +1 -0
  203. package/dist/vendor/tools/index.d.ts +22 -0
  204. package/dist/vendor/tools/index.d.ts.map +1 -0
  205. package/dist/vendor/tools/index.js +22 -0
  206. package/dist/vendor/tools/index.js.map +1 -0
  207. package/dist/vendor/tools/jail.d.ts +17 -0
  208. package/dist/vendor/tools/jail.d.ts.map +1 -0
  209. package/dist/vendor/tools/jail.js +221 -0
  210. package/dist/vendor/tools/jail.js.map +1 -0
  211. package/dist/vendor/tools/lsp.d.ts +3 -0
  212. package/dist/vendor/tools/lsp.d.ts.map +1 -0
  213. package/dist/vendor/tools/lsp.js +43 -0
  214. package/dist/vendor/tools/lsp.js.map +1 -0
  215. package/dist/vendor/tools/mcp.d.ts +9 -0
  216. package/dist/vendor/tools/mcp.d.ts.map +1 -0
  217. package/dist/vendor/tools/mcp.js +54 -0
  218. package/dist/vendor/tools/mcp.js.map +1 -0
  219. package/dist/vendor/tools/mcp_adapter.d.ts +15 -0
  220. package/dist/vendor/tools/mcp_adapter.d.ts.map +1 -0
  221. package/dist/vendor/tools/mcp_adapter.js +29 -0
  222. package/dist/vendor/tools/mcp_adapter.js.map +1 -0
  223. package/dist/vendor/tools/registry.d.ts +10 -0
  224. package/dist/vendor/tools/registry.d.ts.map +1 -0
  225. package/dist/vendor/tools/registry.js +126 -0
  226. package/dist/vendor/tools/registry.js.map +1 -0
  227. package/dist/vendor/tools/tools/apply_patch.d.ts +3 -0
  228. package/dist/vendor/tools/tools/apply_patch.d.ts.map +1 -0
  229. package/dist/vendor/tools/tools/apply_patch.js +49 -0
  230. package/dist/vendor/tools/tools/apply_patch.js.map +1 -0
  231. package/dist/vendor/tools/tools/edit_file.d.ts +3 -0
  232. package/dist/vendor/tools/tools/edit_file.d.ts.map +1 -0
  233. package/dist/vendor/tools/tools/edit_file.js +71 -0
  234. package/dist/vendor/tools/tools/edit_file.js.map +1 -0
  235. package/dist/vendor/tools/tools/git_diff.d.ts +3 -0
  236. package/dist/vendor/tools/tools/git_diff.d.ts.map +1 -0
  237. package/dist/vendor/tools/tools/git_diff.js +91 -0
  238. package/dist/vendor/tools/tools/git_diff.js.map +1 -0
  239. package/dist/vendor/tools/tools/language_intelligence.d.ts +4 -0
  240. package/dist/vendor/tools/tools/language_intelligence.d.ts.map +1 -0
  241. package/dist/vendor/tools/tools/language_intelligence.js +13 -0
  242. package/dist/vendor/tools/tools/language_intelligence.js.map +1 -0
  243. package/dist/vendor/tools/tools/list_files.d.ts +9 -0
  244. package/dist/vendor/tools/tools/list_files.d.ts.map +1 -0
  245. package/dist/vendor/tools/tools/list_files.js +165 -0
  246. package/dist/vendor/tools/tools/list_files.js.map +1 -0
  247. package/dist/vendor/tools/tools/read_file.d.ts +3 -0
  248. package/dist/vendor/tools/tools/read_file.d.ts.map +1 -0
  249. package/dist/vendor/tools/tools/read_file.js +72 -0
  250. package/dist/vendor/tools/tools/read_file.js.map +1 -0
  251. package/dist/vendor/tools/tools/run_command.d.ts +12 -0
  252. package/dist/vendor/tools/tools/run_command.d.ts.map +1 -0
  253. package/dist/vendor/tools/tools/run_command.js +421 -0
  254. package/dist/vendor/tools/tools/run_command.js.map +1 -0
  255. package/dist/vendor/tools/tools/run_diagnostics.d.ts +3 -0
  256. package/dist/vendor/tools/tools/run_diagnostics.d.ts.map +1 -0
  257. package/dist/vendor/tools/tools/run_diagnostics.js +11 -0
  258. package/dist/vendor/tools/tools/run_diagnostics.js.map +1 -0
  259. package/dist/vendor/tools/tools/search_files.d.ts +3 -0
  260. package/dist/vendor/tools/tools/search_files.d.ts.map +1 -0
  261. package/dist/vendor/tools/tools/search_files.js +120 -0
  262. package/dist/vendor/tools/tools/search_files.js.map +1 -0
  263. package/dist/vendor/tools/tools/web_search.d.ts +46 -0
  264. package/dist/vendor/tools/tools/web_search.d.ts.map +1 -0
  265. package/dist/vendor/tools/tools/web_search.js +187 -0
  266. package/dist/vendor/tools/tools/web_search.js.map +1 -0
  267. package/dist/vendor/tools/tools/write_file.d.ts +3 -0
  268. package/dist/vendor/tools/tools/write_file.d.ts.map +1 -0
  269. package/dist/vendor/tools/tools/write_file.js +52 -0
  270. package/dist/vendor/tools/tools/write_file.js.map +1 -0
  271. package/dist/windows_credentials.d.ts +15 -0
  272. package/dist/windows_credentials.d.ts.map +1 -0
  273. package/dist/windows_credentials.js +23 -0
  274. package/dist/windows_credentials.js.map +1 -0
  275. package/package.json +28 -0
@@ -0,0 +1,1215 @@
1
+ import { z } from 'zod';
2
+ export declare const ProgressEventSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"progress">;
4
+ step: z.ZodNumber;
5
+ maxSteps: z.ZodNumber;
6
+ status: z.ZodString;
7
+ timestamp: z.ZodNumber;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: "progress";
10
+ status: string;
11
+ timestamp: number;
12
+ step: number;
13
+ maxSteps: number;
14
+ }, {
15
+ type: "progress";
16
+ status: string;
17
+ timestamp: number;
18
+ step: number;
19
+ maxSteps: number;
20
+ }>;
21
+ export type ProgressEvent = z.infer<typeof ProgressEventSchema>;
22
+ export declare const ModelChangeEventSchema: z.ZodObject<{
23
+ type: z.ZodLiteral<"model_change">;
24
+ previousModelId: z.ZodOptional<z.ZodString>;
25
+ newModelId: z.ZodString;
26
+ reason: z.ZodEnum<["initial_selection", "fallback_rate_limit", "fallback_unavailable", "user_pinned"]>;
27
+ accessClass: z.ZodEnum<["free_trial", "paid", "local", "unknown"]>;
28
+ timestamp: z.ZodNumber;
29
+ }, "strip", z.ZodTypeAny, {
30
+ type: "model_change";
31
+ timestamp: number;
32
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
33
+ newModelId: string;
34
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
35
+ previousModelId?: string | undefined;
36
+ }, {
37
+ type: "model_change";
38
+ timestamp: number;
39
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
40
+ newModelId: string;
41
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
42
+ previousModelId?: string | undefined;
43
+ }>;
44
+ export type ModelChangeEvent = z.infer<typeof ModelChangeEventSchema>;
45
+ export declare const AssistantDeltaEventSchema: z.ZodObject<{
46
+ type: z.ZodLiteral<"assistant_delta">;
47
+ delta: z.ZodString;
48
+ timestamp: z.ZodNumber;
49
+ }, "strip", z.ZodTypeAny, {
50
+ type: "assistant_delta";
51
+ timestamp: number;
52
+ delta: string;
53
+ }, {
54
+ type: "assistant_delta";
55
+ timestamp: number;
56
+ delta: string;
57
+ }>;
58
+ export type AssistantDeltaEvent = z.infer<typeof AssistantDeltaEventSchema>;
59
+ export declare const ReasoningDeltaEventSchema: z.ZodObject<{
60
+ type: z.ZodLiteral<"reasoning_delta">;
61
+ delta: z.ZodString;
62
+ timestamp: z.ZodNumber;
63
+ }, "strip", z.ZodTypeAny, {
64
+ type: "reasoning_delta";
65
+ timestamp: number;
66
+ delta: string;
67
+ }, {
68
+ type: "reasoning_delta";
69
+ timestamp: number;
70
+ delta: string;
71
+ }>;
72
+ export type ReasoningDeltaEvent = z.infer<typeof ReasoningDeltaEventSchema>;
73
+ export declare const ToolCallInitiatedEventSchema: z.ZodObject<{
74
+ type: z.ZodLiteral<"tool_call_initiated">;
75
+ toolCallId: z.ZodString;
76
+ toolName: z.ZodString;
77
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
78
+ timestamp: z.ZodNumber;
79
+ }, "strip", z.ZodTypeAny, {
80
+ type: "tool_call_initiated";
81
+ toolName: string;
82
+ timestamp: number;
83
+ toolCallId: string;
84
+ parameters: Record<string, unknown>;
85
+ }, {
86
+ type: "tool_call_initiated";
87
+ toolName: string;
88
+ timestamp: number;
89
+ toolCallId: string;
90
+ parameters: Record<string, unknown>;
91
+ }>;
92
+ export type ToolCallInitiatedEvent = z.infer<typeof ToolCallInitiatedEventSchema>;
93
+ export declare const ApprovalRequestEventSchema: z.ZodObject<{
94
+ type: z.ZodLiteral<"approval_request">;
95
+ request: z.ZodObject<{
96
+ requestId: z.ZodString;
97
+ toolName: z.ZodString;
98
+ actionSummary: z.ZodString;
99
+ exactPayload: z.ZodObject<{
100
+ targetFile: z.ZodOptional<z.ZodString>;
101
+ diffPreview: z.ZodOptional<z.ZodString>;
102
+ contentPreview: z.ZodOptional<z.ZodString>;
103
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
104
+ cwd: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ targetFile?: string | undefined;
107
+ diffPreview?: string | undefined;
108
+ contentPreview?: string | undefined;
109
+ command?: string[] | undefined;
110
+ cwd?: string | undefined;
111
+ }, {
112
+ targetFile?: string | undefined;
113
+ diffPreview?: string | undefined;
114
+ contentPreview?: string | undefined;
115
+ command?: string[] | undefined;
116
+ cwd?: string | undefined;
117
+ }>;
118
+ timestamp: z.ZodNumber;
119
+ }, "strip", z.ZodTypeAny, {
120
+ requestId: string;
121
+ toolName: string;
122
+ actionSummary: string;
123
+ exactPayload: {
124
+ targetFile?: string | undefined;
125
+ diffPreview?: string | undefined;
126
+ contentPreview?: string | undefined;
127
+ command?: string[] | undefined;
128
+ cwd?: string | undefined;
129
+ };
130
+ timestamp: number;
131
+ }, {
132
+ requestId: string;
133
+ toolName: string;
134
+ actionSummary: string;
135
+ exactPayload: {
136
+ targetFile?: string | undefined;
137
+ diffPreview?: string | undefined;
138
+ contentPreview?: string | undefined;
139
+ command?: string[] | undefined;
140
+ cwd?: string | undefined;
141
+ };
142
+ timestamp: number;
143
+ }>;
144
+ timestamp: z.ZodNumber;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: "approval_request";
147
+ timestamp: number;
148
+ request: {
149
+ requestId: string;
150
+ toolName: string;
151
+ actionSummary: string;
152
+ exactPayload: {
153
+ targetFile?: string | undefined;
154
+ diffPreview?: string | undefined;
155
+ contentPreview?: string | undefined;
156
+ command?: string[] | undefined;
157
+ cwd?: string | undefined;
158
+ };
159
+ timestamp: number;
160
+ };
161
+ }, {
162
+ type: "approval_request";
163
+ timestamp: number;
164
+ request: {
165
+ requestId: string;
166
+ toolName: string;
167
+ actionSummary: string;
168
+ exactPayload: {
169
+ targetFile?: string | undefined;
170
+ diffPreview?: string | undefined;
171
+ contentPreview?: string | undefined;
172
+ command?: string[] | undefined;
173
+ cwd?: string | undefined;
174
+ };
175
+ timestamp: number;
176
+ };
177
+ }>;
178
+ export type ApprovalRequestEvent = z.infer<typeof ApprovalRequestEventSchema>;
179
+ export declare const ApprovalResolvedEventSchema: z.ZodObject<{
180
+ type: z.ZodLiteral<"approval_resolved">;
181
+ requestId: z.ZodString;
182
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
183
+ reason: z.ZodOptional<z.ZodString>;
184
+ timestamp: z.ZodNumber;
185
+ }, "strip", z.ZodTypeAny, {
186
+ type: "approval_resolved";
187
+ status: "approved" | "denied" | "aborted";
188
+ requestId: string;
189
+ timestamp: number;
190
+ reason?: string | undefined;
191
+ }, {
192
+ type: "approval_resolved";
193
+ status: "approved" | "denied" | "aborted";
194
+ requestId: string;
195
+ timestamp: number;
196
+ reason?: string | undefined;
197
+ }>;
198
+ export type ApprovalResolvedEvent = z.infer<typeof ApprovalResolvedEventSchema>;
199
+ export declare const ToolResultEventSchema: z.ZodObject<{
200
+ type: z.ZodLiteral<"tool_result">;
201
+ toolCallId: z.ZodString;
202
+ result: z.ZodObject<{
203
+ toolName: z.ZodString;
204
+ status: z.ZodEnum<["success", "error", "denied"]>;
205
+ output: z.ZodString;
206
+ truncated: z.ZodOptional<z.ZodBoolean>;
207
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ status: "denied" | "success" | "error";
210
+ toolName: string;
211
+ output: string;
212
+ truncated?: boolean | undefined;
213
+ metadata?: Record<string, unknown> | undefined;
214
+ }, {
215
+ status: "denied" | "success" | "error";
216
+ toolName: string;
217
+ output: string;
218
+ truncated?: boolean | undefined;
219
+ metadata?: Record<string, unknown> | undefined;
220
+ }>;
221
+ timestamp: z.ZodNumber;
222
+ }, "strip", z.ZodTypeAny, {
223
+ type: "tool_result";
224
+ timestamp: number;
225
+ toolCallId: string;
226
+ result: {
227
+ status: "denied" | "success" | "error";
228
+ toolName: string;
229
+ output: string;
230
+ truncated?: boolean | undefined;
231
+ metadata?: Record<string, unknown> | undefined;
232
+ };
233
+ }, {
234
+ type: "tool_result";
235
+ timestamp: number;
236
+ toolCallId: string;
237
+ result: {
238
+ status: "denied" | "success" | "error";
239
+ toolName: string;
240
+ output: string;
241
+ truncated?: boolean | undefined;
242
+ metadata?: Record<string, unknown> | undefined;
243
+ };
244
+ }>;
245
+ export type ToolResultEvent = z.infer<typeof ToolResultEventSchema>;
246
+ export declare const DiagnosticResultEventSchema: z.ZodObject<{
247
+ type: z.ZodLiteral<"diagnostic_result">;
248
+ toolCallId: z.ZodString;
249
+ diagnostics: z.ZodArray<z.ZodObject<{
250
+ severity: z.ZodEnum<["error", "warning", "info"]>;
251
+ message: z.ZodString;
252
+ file: z.ZodOptional<z.ZodString>;
253
+ line: z.ZodOptional<z.ZodNumber>;
254
+ column: z.ZodOptional<z.ZodNumber>;
255
+ code: z.ZodOptional<z.ZodString>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ message: string;
258
+ severity: "error" | "warning" | "info";
259
+ code?: string | undefined;
260
+ line?: number | undefined;
261
+ column?: number | undefined;
262
+ file?: string | undefined;
263
+ }, {
264
+ message: string;
265
+ severity: "error" | "warning" | "info";
266
+ code?: string | undefined;
267
+ line?: number | undefined;
268
+ column?: number | undefined;
269
+ file?: string | undefined;
270
+ }>, "many">;
271
+ exitCode: z.ZodNumber;
272
+ timestamp: z.ZodNumber;
273
+ }, "strip", z.ZodTypeAny, {
274
+ type: "diagnostic_result";
275
+ timestamp: number;
276
+ toolCallId: string;
277
+ diagnostics: {
278
+ message: string;
279
+ severity: "error" | "warning" | "info";
280
+ code?: string | undefined;
281
+ line?: number | undefined;
282
+ column?: number | undefined;
283
+ file?: string | undefined;
284
+ }[];
285
+ exitCode: number;
286
+ }, {
287
+ type: "diagnostic_result";
288
+ timestamp: number;
289
+ toolCallId: string;
290
+ diagnostics: {
291
+ message: string;
292
+ severity: "error" | "warning" | "info";
293
+ code?: string | undefined;
294
+ line?: number | undefined;
295
+ column?: number | undefined;
296
+ file?: string | undefined;
297
+ }[];
298
+ exitCode: number;
299
+ }>;
300
+ export type DiagnosticResultEvent = z.infer<typeof DiagnosticResultEventSchema>;
301
+ export declare const CompletionEventSchema: z.ZodObject<{
302
+ type: z.ZodLiteral<"completion">;
303
+ status: z.ZodEnum<["completed", "step_limit_reached", "timeout", "cancelled", "failed"]>;
304
+ totalSteps: z.ZodNumber;
305
+ summary: z.ZodOptional<z.ZodString>;
306
+ timestamp: z.ZodNumber;
307
+ }, "strip", z.ZodTypeAny, {
308
+ type: "completion";
309
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
310
+ timestamp: number;
311
+ totalSteps: number;
312
+ summary?: string | undefined;
313
+ }, {
314
+ type: "completion";
315
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
316
+ timestamp: number;
317
+ totalSteps: number;
318
+ summary?: string | undefined;
319
+ }>;
320
+ export type CompletionEvent = z.infer<typeof CompletionEventSchema>;
321
+ export declare const ErrorEventSchema: z.ZodObject<{
322
+ type: z.ZodLiteral<"error">;
323
+ code: z.ZodString;
324
+ message: z.ZodString;
325
+ recoverable: z.ZodDefault<z.ZodBoolean>;
326
+ timestamp: z.ZodNumber;
327
+ }, "strip", z.ZodTypeAny, {
328
+ code: string;
329
+ message: string;
330
+ type: "error";
331
+ timestamp: number;
332
+ recoverable: boolean;
333
+ }, {
334
+ code: string;
335
+ message: string;
336
+ type: "error";
337
+ timestamp: number;
338
+ recoverable?: boolean | undefined;
339
+ }>;
340
+ export type ErrorEvent = z.infer<typeof ErrorEventSchema>;
341
+ export declare const CancellationEventSchema: z.ZodObject<{
342
+ type: z.ZodLiteral<"cancellation">;
343
+ reason: z.ZodString;
344
+ timestamp: z.ZodNumber;
345
+ }, "strip", z.ZodTypeAny, {
346
+ type: "cancellation";
347
+ timestamp: number;
348
+ reason: string;
349
+ }, {
350
+ type: "cancellation";
351
+ timestamp: number;
352
+ reason: string;
353
+ }>;
354
+ export type CancellationEvent = z.infer<typeof CancellationEventSchema>;
355
+ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
356
+ type: z.ZodLiteral<"progress">;
357
+ step: z.ZodNumber;
358
+ maxSteps: z.ZodNumber;
359
+ status: z.ZodString;
360
+ timestamp: z.ZodNumber;
361
+ }, "strip", z.ZodTypeAny, {
362
+ type: "progress";
363
+ status: string;
364
+ timestamp: number;
365
+ step: number;
366
+ maxSteps: number;
367
+ }, {
368
+ type: "progress";
369
+ status: string;
370
+ timestamp: number;
371
+ step: number;
372
+ maxSteps: number;
373
+ }>, z.ZodObject<{
374
+ type: z.ZodLiteral<"model_change">;
375
+ previousModelId: z.ZodOptional<z.ZodString>;
376
+ newModelId: z.ZodString;
377
+ reason: z.ZodEnum<["initial_selection", "fallback_rate_limit", "fallback_unavailable", "user_pinned"]>;
378
+ accessClass: z.ZodEnum<["free_trial", "paid", "local", "unknown"]>;
379
+ timestamp: z.ZodNumber;
380
+ }, "strip", z.ZodTypeAny, {
381
+ type: "model_change";
382
+ timestamp: number;
383
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
384
+ newModelId: string;
385
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
386
+ previousModelId?: string | undefined;
387
+ }, {
388
+ type: "model_change";
389
+ timestamp: number;
390
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
391
+ newModelId: string;
392
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
393
+ previousModelId?: string | undefined;
394
+ }>, z.ZodObject<{
395
+ type: z.ZodLiteral<"assistant_delta">;
396
+ delta: z.ZodString;
397
+ timestamp: z.ZodNumber;
398
+ }, "strip", z.ZodTypeAny, {
399
+ type: "assistant_delta";
400
+ timestamp: number;
401
+ delta: string;
402
+ }, {
403
+ type: "assistant_delta";
404
+ timestamp: number;
405
+ delta: string;
406
+ }>, z.ZodObject<{
407
+ type: z.ZodLiteral<"reasoning_delta">;
408
+ delta: z.ZodString;
409
+ timestamp: z.ZodNumber;
410
+ }, "strip", z.ZodTypeAny, {
411
+ type: "reasoning_delta";
412
+ timestamp: number;
413
+ delta: string;
414
+ }, {
415
+ type: "reasoning_delta";
416
+ timestamp: number;
417
+ delta: string;
418
+ }>, z.ZodObject<{
419
+ type: z.ZodLiteral<"tool_call_initiated">;
420
+ toolCallId: z.ZodString;
421
+ toolName: z.ZodString;
422
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
423
+ timestamp: z.ZodNumber;
424
+ }, "strip", z.ZodTypeAny, {
425
+ type: "tool_call_initiated";
426
+ toolName: string;
427
+ timestamp: number;
428
+ toolCallId: string;
429
+ parameters: Record<string, unknown>;
430
+ }, {
431
+ type: "tool_call_initiated";
432
+ toolName: string;
433
+ timestamp: number;
434
+ toolCallId: string;
435
+ parameters: Record<string, unknown>;
436
+ }>, z.ZodObject<{
437
+ type: z.ZodLiteral<"approval_request">;
438
+ request: z.ZodObject<{
439
+ requestId: z.ZodString;
440
+ toolName: z.ZodString;
441
+ actionSummary: z.ZodString;
442
+ exactPayload: z.ZodObject<{
443
+ targetFile: z.ZodOptional<z.ZodString>;
444
+ diffPreview: z.ZodOptional<z.ZodString>;
445
+ contentPreview: z.ZodOptional<z.ZodString>;
446
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
447
+ cwd: z.ZodOptional<z.ZodString>;
448
+ }, "strip", z.ZodTypeAny, {
449
+ targetFile?: string | undefined;
450
+ diffPreview?: string | undefined;
451
+ contentPreview?: string | undefined;
452
+ command?: string[] | undefined;
453
+ cwd?: string | undefined;
454
+ }, {
455
+ targetFile?: string | undefined;
456
+ diffPreview?: string | undefined;
457
+ contentPreview?: string | undefined;
458
+ command?: string[] | undefined;
459
+ cwd?: string | undefined;
460
+ }>;
461
+ timestamp: z.ZodNumber;
462
+ }, "strip", z.ZodTypeAny, {
463
+ requestId: string;
464
+ toolName: string;
465
+ actionSummary: string;
466
+ exactPayload: {
467
+ targetFile?: string | undefined;
468
+ diffPreview?: string | undefined;
469
+ contentPreview?: string | undefined;
470
+ command?: string[] | undefined;
471
+ cwd?: string | undefined;
472
+ };
473
+ timestamp: number;
474
+ }, {
475
+ requestId: string;
476
+ toolName: string;
477
+ actionSummary: string;
478
+ exactPayload: {
479
+ targetFile?: string | undefined;
480
+ diffPreview?: string | undefined;
481
+ contentPreview?: string | undefined;
482
+ command?: string[] | undefined;
483
+ cwd?: string | undefined;
484
+ };
485
+ timestamp: number;
486
+ }>;
487
+ timestamp: z.ZodNumber;
488
+ }, "strip", z.ZodTypeAny, {
489
+ type: "approval_request";
490
+ timestamp: number;
491
+ request: {
492
+ requestId: string;
493
+ toolName: string;
494
+ actionSummary: string;
495
+ exactPayload: {
496
+ targetFile?: string | undefined;
497
+ diffPreview?: string | undefined;
498
+ contentPreview?: string | undefined;
499
+ command?: string[] | undefined;
500
+ cwd?: string | undefined;
501
+ };
502
+ timestamp: number;
503
+ };
504
+ }, {
505
+ type: "approval_request";
506
+ timestamp: number;
507
+ request: {
508
+ requestId: string;
509
+ toolName: string;
510
+ actionSummary: string;
511
+ exactPayload: {
512
+ targetFile?: string | undefined;
513
+ diffPreview?: string | undefined;
514
+ contentPreview?: string | undefined;
515
+ command?: string[] | undefined;
516
+ cwd?: string | undefined;
517
+ };
518
+ timestamp: number;
519
+ };
520
+ }>, z.ZodObject<{
521
+ type: z.ZodLiteral<"approval_resolved">;
522
+ requestId: z.ZodString;
523
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
524
+ reason: z.ZodOptional<z.ZodString>;
525
+ timestamp: z.ZodNumber;
526
+ }, "strip", z.ZodTypeAny, {
527
+ type: "approval_resolved";
528
+ status: "approved" | "denied" | "aborted";
529
+ requestId: string;
530
+ timestamp: number;
531
+ reason?: string | undefined;
532
+ }, {
533
+ type: "approval_resolved";
534
+ status: "approved" | "denied" | "aborted";
535
+ requestId: string;
536
+ timestamp: number;
537
+ reason?: string | undefined;
538
+ }>, z.ZodObject<{
539
+ type: z.ZodLiteral<"tool_result">;
540
+ toolCallId: z.ZodString;
541
+ result: z.ZodObject<{
542
+ toolName: z.ZodString;
543
+ status: z.ZodEnum<["success", "error", "denied"]>;
544
+ output: z.ZodString;
545
+ truncated: z.ZodOptional<z.ZodBoolean>;
546
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
547
+ }, "strip", z.ZodTypeAny, {
548
+ status: "denied" | "success" | "error";
549
+ toolName: string;
550
+ output: string;
551
+ truncated?: boolean | undefined;
552
+ metadata?: Record<string, unknown> | undefined;
553
+ }, {
554
+ status: "denied" | "success" | "error";
555
+ toolName: string;
556
+ output: string;
557
+ truncated?: boolean | undefined;
558
+ metadata?: Record<string, unknown> | undefined;
559
+ }>;
560
+ timestamp: z.ZodNumber;
561
+ }, "strip", z.ZodTypeAny, {
562
+ type: "tool_result";
563
+ timestamp: number;
564
+ toolCallId: string;
565
+ result: {
566
+ status: "denied" | "success" | "error";
567
+ toolName: string;
568
+ output: string;
569
+ truncated?: boolean | undefined;
570
+ metadata?: Record<string, unknown> | undefined;
571
+ };
572
+ }, {
573
+ type: "tool_result";
574
+ timestamp: number;
575
+ toolCallId: string;
576
+ result: {
577
+ status: "denied" | "success" | "error";
578
+ toolName: string;
579
+ output: string;
580
+ truncated?: boolean | undefined;
581
+ metadata?: Record<string, unknown> | undefined;
582
+ };
583
+ }>, z.ZodObject<{
584
+ type: z.ZodLiteral<"diagnostic_result">;
585
+ toolCallId: z.ZodString;
586
+ diagnostics: z.ZodArray<z.ZodObject<{
587
+ severity: z.ZodEnum<["error", "warning", "info"]>;
588
+ message: z.ZodString;
589
+ file: z.ZodOptional<z.ZodString>;
590
+ line: z.ZodOptional<z.ZodNumber>;
591
+ column: z.ZodOptional<z.ZodNumber>;
592
+ code: z.ZodOptional<z.ZodString>;
593
+ }, "strip", z.ZodTypeAny, {
594
+ message: string;
595
+ severity: "error" | "warning" | "info";
596
+ code?: string | undefined;
597
+ line?: number | undefined;
598
+ column?: number | undefined;
599
+ file?: string | undefined;
600
+ }, {
601
+ message: string;
602
+ severity: "error" | "warning" | "info";
603
+ code?: string | undefined;
604
+ line?: number | undefined;
605
+ column?: number | undefined;
606
+ file?: string | undefined;
607
+ }>, "many">;
608
+ exitCode: z.ZodNumber;
609
+ timestamp: z.ZodNumber;
610
+ }, "strip", z.ZodTypeAny, {
611
+ type: "diagnostic_result";
612
+ timestamp: number;
613
+ toolCallId: string;
614
+ diagnostics: {
615
+ message: string;
616
+ severity: "error" | "warning" | "info";
617
+ code?: string | undefined;
618
+ line?: number | undefined;
619
+ column?: number | undefined;
620
+ file?: string | undefined;
621
+ }[];
622
+ exitCode: number;
623
+ }, {
624
+ type: "diagnostic_result";
625
+ timestamp: number;
626
+ toolCallId: string;
627
+ diagnostics: {
628
+ message: string;
629
+ severity: "error" | "warning" | "info";
630
+ code?: string | undefined;
631
+ line?: number | undefined;
632
+ column?: number | undefined;
633
+ file?: string | undefined;
634
+ }[];
635
+ exitCode: number;
636
+ }>, z.ZodObject<{
637
+ type: z.ZodLiteral<"completion">;
638
+ status: z.ZodEnum<["completed", "step_limit_reached", "timeout", "cancelled", "failed"]>;
639
+ totalSteps: z.ZodNumber;
640
+ summary: z.ZodOptional<z.ZodString>;
641
+ timestamp: z.ZodNumber;
642
+ }, "strip", z.ZodTypeAny, {
643
+ type: "completion";
644
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
645
+ timestamp: number;
646
+ totalSteps: number;
647
+ summary?: string | undefined;
648
+ }, {
649
+ type: "completion";
650
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
651
+ timestamp: number;
652
+ totalSteps: number;
653
+ summary?: string | undefined;
654
+ }>, z.ZodObject<{
655
+ type: z.ZodLiteral<"error">;
656
+ code: z.ZodString;
657
+ message: z.ZodString;
658
+ recoverable: z.ZodDefault<z.ZodBoolean>;
659
+ timestamp: z.ZodNumber;
660
+ }, "strip", z.ZodTypeAny, {
661
+ code: string;
662
+ message: string;
663
+ type: "error";
664
+ timestamp: number;
665
+ recoverable: boolean;
666
+ }, {
667
+ code: string;
668
+ message: string;
669
+ type: "error";
670
+ timestamp: number;
671
+ recoverable?: boolean | undefined;
672
+ }>, z.ZodObject<{
673
+ type: z.ZodLiteral<"cancellation">;
674
+ reason: z.ZodString;
675
+ timestamp: z.ZodNumber;
676
+ }, "strip", z.ZodTypeAny, {
677
+ type: "cancellation";
678
+ timestamp: number;
679
+ reason: string;
680
+ }, {
681
+ type: "cancellation";
682
+ timestamp: number;
683
+ reason: string;
684
+ }>]>;
685
+ export type AgentEvent = z.infer<typeof AgentEventSchema>;
686
+ export declare const HostEventEnvelopeSchema: z.ZodObject<{
687
+ protocolVersion: z.ZodLiteral<1>;
688
+ sessionId: z.ZodString;
689
+ sequence: z.ZodNumber;
690
+ timestamp: z.ZodNumber;
691
+ event: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
692
+ type: z.ZodLiteral<"progress">;
693
+ step: z.ZodNumber;
694
+ maxSteps: z.ZodNumber;
695
+ status: z.ZodString;
696
+ timestamp: z.ZodNumber;
697
+ }, "strip", z.ZodTypeAny, {
698
+ type: "progress";
699
+ status: string;
700
+ timestamp: number;
701
+ step: number;
702
+ maxSteps: number;
703
+ }, {
704
+ type: "progress";
705
+ status: string;
706
+ timestamp: number;
707
+ step: number;
708
+ maxSteps: number;
709
+ }>, z.ZodObject<{
710
+ type: z.ZodLiteral<"model_change">;
711
+ previousModelId: z.ZodOptional<z.ZodString>;
712
+ newModelId: z.ZodString;
713
+ reason: z.ZodEnum<["initial_selection", "fallback_rate_limit", "fallback_unavailable", "user_pinned"]>;
714
+ accessClass: z.ZodEnum<["free_trial", "paid", "local", "unknown"]>;
715
+ timestamp: z.ZodNumber;
716
+ }, "strip", z.ZodTypeAny, {
717
+ type: "model_change";
718
+ timestamp: number;
719
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
720
+ newModelId: string;
721
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
722
+ previousModelId?: string | undefined;
723
+ }, {
724
+ type: "model_change";
725
+ timestamp: number;
726
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
727
+ newModelId: string;
728
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
729
+ previousModelId?: string | undefined;
730
+ }>, z.ZodObject<{
731
+ type: z.ZodLiteral<"assistant_delta">;
732
+ delta: z.ZodString;
733
+ timestamp: z.ZodNumber;
734
+ }, "strip", z.ZodTypeAny, {
735
+ type: "assistant_delta";
736
+ timestamp: number;
737
+ delta: string;
738
+ }, {
739
+ type: "assistant_delta";
740
+ timestamp: number;
741
+ delta: string;
742
+ }>, z.ZodObject<{
743
+ type: z.ZodLiteral<"reasoning_delta">;
744
+ delta: z.ZodString;
745
+ timestamp: z.ZodNumber;
746
+ }, "strip", z.ZodTypeAny, {
747
+ type: "reasoning_delta";
748
+ timestamp: number;
749
+ delta: string;
750
+ }, {
751
+ type: "reasoning_delta";
752
+ timestamp: number;
753
+ delta: string;
754
+ }>, z.ZodObject<{
755
+ type: z.ZodLiteral<"tool_call_initiated">;
756
+ toolCallId: z.ZodString;
757
+ toolName: z.ZodString;
758
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
759
+ timestamp: z.ZodNumber;
760
+ }, "strip", z.ZodTypeAny, {
761
+ type: "tool_call_initiated";
762
+ toolName: string;
763
+ timestamp: number;
764
+ toolCallId: string;
765
+ parameters: Record<string, unknown>;
766
+ }, {
767
+ type: "tool_call_initiated";
768
+ toolName: string;
769
+ timestamp: number;
770
+ toolCallId: string;
771
+ parameters: Record<string, unknown>;
772
+ }>, z.ZodObject<{
773
+ type: z.ZodLiteral<"approval_request">;
774
+ request: z.ZodObject<{
775
+ requestId: z.ZodString;
776
+ toolName: z.ZodString;
777
+ actionSummary: z.ZodString;
778
+ exactPayload: z.ZodObject<{
779
+ targetFile: z.ZodOptional<z.ZodString>;
780
+ diffPreview: z.ZodOptional<z.ZodString>;
781
+ contentPreview: z.ZodOptional<z.ZodString>;
782
+ command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
783
+ cwd: z.ZodOptional<z.ZodString>;
784
+ }, "strip", z.ZodTypeAny, {
785
+ targetFile?: string | undefined;
786
+ diffPreview?: string | undefined;
787
+ contentPreview?: string | undefined;
788
+ command?: string[] | undefined;
789
+ cwd?: string | undefined;
790
+ }, {
791
+ targetFile?: string | undefined;
792
+ diffPreview?: string | undefined;
793
+ contentPreview?: string | undefined;
794
+ command?: string[] | undefined;
795
+ cwd?: string | undefined;
796
+ }>;
797
+ timestamp: z.ZodNumber;
798
+ }, "strip", z.ZodTypeAny, {
799
+ requestId: string;
800
+ toolName: string;
801
+ actionSummary: string;
802
+ exactPayload: {
803
+ targetFile?: string | undefined;
804
+ diffPreview?: string | undefined;
805
+ contentPreview?: string | undefined;
806
+ command?: string[] | undefined;
807
+ cwd?: string | undefined;
808
+ };
809
+ timestamp: number;
810
+ }, {
811
+ requestId: string;
812
+ toolName: string;
813
+ actionSummary: string;
814
+ exactPayload: {
815
+ targetFile?: string | undefined;
816
+ diffPreview?: string | undefined;
817
+ contentPreview?: string | undefined;
818
+ command?: string[] | undefined;
819
+ cwd?: string | undefined;
820
+ };
821
+ timestamp: number;
822
+ }>;
823
+ timestamp: z.ZodNumber;
824
+ }, "strip", z.ZodTypeAny, {
825
+ type: "approval_request";
826
+ timestamp: number;
827
+ request: {
828
+ requestId: string;
829
+ toolName: string;
830
+ actionSummary: string;
831
+ exactPayload: {
832
+ targetFile?: string | undefined;
833
+ diffPreview?: string | undefined;
834
+ contentPreview?: string | undefined;
835
+ command?: string[] | undefined;
836
+ cwd?: string | undefined;
837
+ };
838
+ timestamp: number;
839
+ };
840
+ }, {
841
+ type: "approval_request";
842
+ timestamp: number;
843
+ request: {
844
+ requestId: string;
845
+ toolName: string;
846
+ actionSummary: string;
847
+ exactPayload: {
848
+ targetFile?: string | undefined;
849
+ diffPreview?: string | undefined;
850
+ contentPreview?: string | undefined;
851
+ command?: string[] | undefined;
852
+ cwd?: string | undefined;
853
+ };
854
+ timestamp: number;
855
+ };
856
+ }>, z.ZodObject<{
857
+ type: z.ZodLiteral<"approval_resolved">;
858
+ requestId: z.ZodString;
859
+ status: z.ZodEnum<["approved", "denied", "aborted"]>;
860
+ reason: z.ZodOptional<z.ZodString>;
861
+ timestamp: z.ZodNumber;
862
+ }, "strip", z.ZodTypeAny, {
863
+ type: "approval_resolved";
864
+ status: "approved" | "denied" | "aborted";
865
+ requestId: string;
866
+ timestamp: number;
867
+ reason?: string | undefined;
868
+ }, {
869
+ type: "approval_resolved";
870
+ status: "approved" | "denied" | "aborted";
871
+ requestId: string;
872
+ timestamp: number;
873
+ reason?: string | undefined;
874
+ }>, z.ZodObject<{
875
+ type: z.ZodLiteral<"tool_result">;
876
+ toolCallId: z.ZodString;
877
+ result: z.ZodObject<{
878
+ toolName: z.ZodString;
879
+ status: z.ZodEnum<["success", "error", "denied"]>;
880
+ output: z.ZodString;
881
+ truncated: z.ZodOptional<z.ZodBoolean>;
882
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
883
+ }, "strip", z.ZodTypeAny, {
884
+ status: "denied" | "success" | "error";
885
+ toolName: string;
886
+ output: string;
887
+ truncated?: boolean | undefined;
888
+ metadata?: Record<string, unknown> | undefined;
889
+ }, {
890
+ status: "denied" | "success" | "error";
891
+ toolName: string;
892
+ output: string;
893
+ truncated?: boolean | undefined;
894
+ metadata?: Record<string, unknown> | undefined;
895
+ }>;
896
+ timestamp: z.ZodNumber;
897
+ }, "strip", z.ZodTypeAny, {
898
+ type: "tool_result";
899
+ timestamp: number;
900
+ toolCallId: string;
901
+ result: {
902
+ status: "denied" | "success" | "error";
903
+ toolName: string;
904
+ output: string;
905
+ truncated?: boolean | undefined;
906
+ metadata?: Record<string, unknown> | undefined;
907
+ };
908
+ }, {
909
+ type: "tool_result";
910
+ timestamp: number;
911
+ toolCallId: string;
912
+ result: {
913
+ status: "denied" | "success" | "error";
914
+ toolName: string;
915
+ output: string;
916
+ truncated?: boolean | undefined;
917
+ metadata?: Record<string, unknown> | undefined;
918
+ };
919
+ }>, z.ZodObject<{
920
+ type: z.ZodLiteral<"diagnostic_result">;
921
+ toolCallId: z.ZodString;
922
+ diagnostics: z.ZodArray<z.ZodObject<{
923
+ severity: z.ZodEnum<["error", "warning", "info"]>;
924
+ message: z.ZodString;
925
+ file: z.ZodOptional<z.ZodString>;
926
+ line: z.ZodOptional<z.ZodNumber>;
927
+ column: z.ZodOptional<z.ZodNumber>;
928
+ code: z.ZodOptional<z.ZodString>;
929
+ }, "strip", z.ZodTypeAny, {
930
+ message: string;
931
+ severity: "error" | "warning" | "info";
932
+ code?: string | undefined;
933
+ line?: number | undefined;
934
+ column?: number | undefined;
935
+ file?: string | undefined;
936
+ }, {
937
+ message: string;
938
+ severity: "error" | "warning" | "info";
939
+ code?: string | undefined;
940
+ line?: number | undefined;
941
+ column?: number | undefined;
942
+ file?: string | undefined;
943
+ }>, "many">;
944
+ exitCode: z.ZodNumber;
945
+ timestamp: z.ZodNumber;
946
+ }, "strip", z.ZodTypeAny, {
947
+ type: "diagnostic_result";
948
+ timestamp: number;
949
+ toolCallId: string;
950
+ diagnostics: {
951
+ message: string;
952
+ severity: "error" | "warning" | "info";
953
+ code?: string | undefined;
954
+ line?: number | undefined;
955
+ column?: number | undefined;
956
+ file?: string | undefined;
957
+ }[];
958
+ exitCode: number;
959
+ }, {
960
+ type: "diagnostic_result";
961
+ timestamp: number;
962
+ toolCallId: string;
963
+ diagnostics: {
964
+ message: string;
965
+ severity: "error" | "warning" | "info";
966
+ code?: string | undefined;
967
+ line?: number | undefined;
968
+ column?: number | undefined;
969
+ file?: string | undefined;
970
+ }[];
971
+ exitCode: number;
972
+ }>, z.ZodObject<{
973
+ type: z.ZodLiteral<"completion">;
974
+ status: z.ZodEnum<["completed", "step_limit_reached", "timeout", "cancelled", "failed"]>;
975
+ totalSteps: z.ZodNumber;
976
+ summary: z.ZodOptional<z.ZodString>;
977
+ timestamp: z.ZodNumber;
978
+ }, "strip", z.ZodTypeAny, {
979
+ type: "completion";
980
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
981
+ timestamp: number;
982
+ totalSteps: number;
983
+ summary?: string | undefined;
984
+ }, {
985
+ type: "completion";
986
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
987
+ timestamp: number;
988
+ totalSteps: number;
989
+ summary?: string | undefined;
990
+ }>, z.ZodObject<{
991
+ type: z.ZodLiteral<"error">;
992
+ code: z.ZodString;
993
+ message: z.ZodString;
994
+ recoverable: z.ZodDefault<z.ZodBoolean>;
995
+ timestamp: z.ZodNumber;
996
+ }, "strip", z.ZodTypeAny, {
997
+ code: string;
998
+ message: string;
999
+ type: "error";
1000
+ timestamp: number;
1001
+ recoverable: boolean;
1002
+ }, {
1003
+ code: string;
1004
+ message: string;
1005
+ type: "error";
1006
+ timestamp: number;
1007
+ recoverable?: boolean | undefined;
1008
+ }>, z.ZodObject<{
1009
+ type: z.ZodLiteral<"cancellation">;
1010
+ reason: z.ZodString;
1011
+ timestamp: z.ZodNumber;
1012
+ }, "strip", z.ZodTypeAny, {
1013
+ type: "cancellation";
1014
+ timestamp: number;
1015
+ reason: string;
1016
+ }, {
1017
+ type: "cancellation";
1018
+ timestamp: number;
1019
+ reason: string;
1020
+ }>]>;
1021
+ }, "strip", z.ZodTypeAny, {
1022
+ timestamp: number;
1023
+ protocolVersion: 1;
1024
+ sessionId: string;
1025
+ sequence: number;
1026
+ event: {
1027
+ type: "progress";
1028
+ status: string;
1029
+ timestamp: number;
1030
+ step: number;
1031
+ maxSteps: number;
1032
+ } | {
1033
+ type: "model_change";
1034
+ timestamp: number;
1035
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
1036
+ newModelId: string;
1037
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
1038
+ previousModelId?: string | undefined;
1039
+ } | {
1040
+ type: "assistant_delta";
1041
+ timestamp: number;
1042
+ delta: string;
1043
+ } | {
1044
+ type: "reasoning_delta";
1045
+ timestamp: number;
1046
+ delta: string;
1047
+ } | {
1048
+ type: "tool_call_initiated";
1049
+ toolName: string;
1050
+ timestamp: number;
1051
+ toolCallId: string;
1052
+ parameters: Record<string, unknown>;
1053
+ } | {
1054
+ type: "approval_request";
1055
+ timestamp: number;
1056
+ request: {
1057
+ requestId: string;
1058
+ toolName: string;
1059
+ actionSummary: string;
1060
+ exactPayload: {
1061
+ targetFile?: string | undefined;
1062
+ diffPreview?: string | undefined;
1063
+ contentPreview?: string | undefined;
1064
+ command?: string[] | undefined;
1065
+ cwd?: string | undefined;
1066
+ };
1067
+ timestamp: number;
1068
+ };
1069
+ } | {
1070
+ type: "approval_resolved";
1071
+ status: "approved" | "denied" | "aborted";
1072
+ requestId: string;
1073
+ timestamp: number;
1074
+ reason?: string | undefined;
1075
+ } | {
1076
+ type: "tool_result";
1077
+ timestamp: number;
1078
+ toolCallId: string;
1079
+ result: {
1080
+ status: "denied" | "success" | "error";
1081
+ toolName: string;
1082
+ output: string;
1083
+ truncated?: boolean | undefined;
1084
+ metadata?: Record<string, unknown> | undefined;
1085
+ };
1086
+ } | {
1087
+ type: "diagnostic_result";
1088
+ timestamp: number;
1089
+ toolCallId: string;
1090
+ diagnostics: {
1091
+ message: string;
1092
+ severity: "error" | "warning" | "info";
1093
+ code?: string | undefined;
1094
+ line?: number | undefined;
1095
+ column?: number | undefined;
1096
+ file?: string | undefined;
1097
+ }[];
1098
+ exitCode: number;
1099
+ } | {
1100
+ type: "completion";
1101
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
1102
+ timestamp: number;
1103
+ totalSteps: number;
1104
+ summary?: string | undefined;
1105
+ } | {
1106
+ code: string;
1107
+ message: string;
1108
+ type: "error";
1109
+ timestamp: number;
1110
+ recoverable: boolean;
1111
+ } | {
1112
+ type: "cancellation";
1113
+ timestamp: number;
1114
+ reason: string;
1115
+ };
1116
+ }, {
1117
+ timestamp: number;
1118
+ protocolVersion: 1;
1119
+ sessionId: string;
1120
+ sequence: number;
1121
+ event: {
1122
+ type: "progress";
1123
+ status: string;
1124
+ timestamp: number;
1125
+ step: number;
1126
+ maxSteps: number;
1127
+ } | {
1128
+ type: "model_change";
1129
+ timestamp: number;
1130
+ reason: "initial_selection" | "fallback_rate_limit" | "fallback_unavailable" | "user_pinned";
1131
+ newModelId: string;
1132
+ accessClass: "free_trial" | "paid" | "local" | "unknown";
1133
+ previousModelId?: string | undefined;
1134
+ } | {
1135
+ type: "assistant_delta";
1136
+ timestamp: number;
1137
+ delta: string;
1138
+ } | {
1139
+ type: "reasoning_delta";
1140
+ timestamp: number;
1141
+ delta: string;
1142
+ } | {
1143
+ type: "tool_call_initiated";
1144
+ toolName: string;
1145
+ timestamp: number;
1146
+ toolCallId: string;
1147
+ parameters: Record<string, unknown>;
1148
+ } | {
1149
+ type: "approval_request";
1150
+ timestamp: number;
1151
+ request: {
1152
+ requestId: string;
1153
+ toolName: string;
1154
+ actionSummary: string;
1155
+ exactPayload: {
1156
+ targetFile?: string | undefined;
1157
+ diffPreview?: string | undefined;
1158
+ contentPreview?: string | undefined;
1159
+ command?: string[] | undefined;
1160
+ cwd?: string | undefined;
1161
+ };
1162
+ timestamp: number;
1163
+ };
1164
+ } | {
1165
+ type: "approval_resolved";
1166
+ status: "approved" | "denied" | "aborted";
1167
+ requestId: string;
1168
+ timestamp: number;
1169
+ reason?: string | undefined;
1170
+ } | {
1171
+ type: "tool_result";
1172
+ timestamp: number;
1173
+ toolCallId: string;
1174
+ result: {
1175
+ status: "denied" | "success" | "error";
1176
+ toolName: string;
1177
+ output: string;
1178
+ truncated?: boolean | undefined;
1179
+ metadata?: Record<string, unknown> | undefined;
1180
+ };
1181
+ } | {
1182
+ type: "diagnostic_result";
1183
+ timestamp: number;
1184
+ toolCallId: string;
1185
+ diagnostics: {
1186
+ message: string;
1187
+ severity: "error" | "warning" | "info";
1188
+ code?: string | undefined;
1189
+ line?: number | undefined;
1190
+ column?: number | undefined;
1191
+ file?: string | undefined;
1192
+ }[];
1193
+ exitCode: number;
1194
+ } | {
1195
+ type: "completion";
1196
+ status: "completed" | "step_limit_reached" | "timeout" | "cancelled" | "failed";
1197
+ timestamp: number;
1198
+ totalSteps: number;
1199
+ summary?: string | undefined;
1200
+ } | {
1201
+ code: string;
1202
+ message: string;
1203
+ type: "error";
1204
+ timestamp: number;
1205
+ recoverable?: boolean | undefined;
1206
+ } | {
1207
+ type: "cancellation";
1208
+ timestamp: number;
1209
+ reason: string;
1210
+ };
1211
+ }>;
1212
+ export type HostEventEnvelope = z.infer<typeof HostEventEnvelopeSchema>;
1213
+ export type AgentEventListener = (event: AgentEvent) => void;
1214
+ export type HostEventListener = (envelope: HostEventEnvelope) => void;
1215
+ //# sourceMappingURL=events.d.ts.map