mtmsdk 0.0.36 → 0.0.39

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 (243) hide show
  1. package/dist/api_hatchet/client/client.gen.d.ts.map +1 -1
  2. package/dist/api_hatchet/client/client.gen.js +8 -1
  3. package/dist/api_hatchet/client/client.gen.js.map +1 -1
  4. package/dist/api_hatchet/index.d.ts +2 -2
  5. package/dist/api_hatchet/index.d.ts.map +1 -1
  6. package/dist/api_hatchet/index.js +2 -2
  7. package/dist/api_hatchet/index.js.map +1 -1
  8. package/dist/api_hatchet/zod.gen.d.ts +3 -3
  9. package/dist/api_hatchet/zod.gen.js +53 -53
  10. package/dist/api_hatchet/zod.gen.js.map +1 -1
  11. package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts +73 -979
  12. package/dist/gomtmapi_v2/@tanstack/react-query.gen.d.ts.map +1 -1
  13. package/dist/gomtmapi_v2/@tanstack/react-query.gen.js +208 -1000
  14. package/dist/gomtmapi_v2/@tanstack/react-query.gen.js.map +1 -1
  15. package/dist/gomtmapi_v2/client/client.gen.d.ts.map +1 -1
  16. package/dist/gomtmapi_v2/client/client.gen.js +8 -1
  17. package/dist/gomtmapi_v2/client/client.gen.js.map +1 -1
  18. package/dist/gomtmapi_v2/index.d.ts +2 -2
  19. package/dist/gomtmapi_v2/index.d.ts.map +1 -1
  20. package/dist/gomtmapi_v2/index.js +1 -1
  21. package/dist/gomtmapi_v2/index.js.map +1 -1
  22. package/dist/gomtmapi_v2/schemas.gen.d.ts +305 -1415
  23. package/dist/gomtmapi_v2/schemas.gen.d.ts.map +1 -1
  24. package/dist/gomtmapi_v2/schemas.gen.js +282 -1407
  25. package/dist/gomtmapi_v2/schemas.gen.js.map +1 -1
  26. package/dist/gomtmapi_v2/sdk.gen.d.ts +63 -513
  27. package/dist/gomtmapi_v2/sdk.gen.d.ts.map +1 -1
  28. package/dist/gomtmapi_v2/sdk.gen.js +94 -537
  29. package/dist/gomtmapi_v2/sdk.gen.js.map +1 -1
  30. package/dist/gomtmapi_v2/types.gen.d.ts +443 -1531
  31. package/dist/gomtmapi_v2/types.gen.d.ts.map +1 -1
  32. package/dist/gomtmapi_v2/zod.gen.d.ts +293 -1292
  33. package/dist/gomtmapi_v2/zod.gen.d.ts.map +1 -1
  34. package/dist/gomtmapi_v2/zod.gen.js +187 -793
  35. package/dist/gomtmapi_v2/zod.gen.js.map +1 -1
  36. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts +4 -158
  37. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts.map +1 -1
  38. package/dist/mtgate_api/@tanstack/react-query.gen.js +17 -212
  39. package/dist/mtgate_api/@tanstack/react-query.gen.js.map +1 -1
  40. package/dist/mtgate_api/client/client.gen.d.ts.map +1 -1
  41. package/dist/mtgate_api/client/client.gen.js +8 -1
  42. package/dist/mtgate_api/client/client.gen.js.map +1 -1
  43. package/dist/mtgate_api/index.d.ts +2 -2
  44. package/dist/mtgate_api/index.d.ts.map +1 -1
  45. package/dist/mtgate_api/index.js +1 -1
  46. package/dist/mtgate_api/index.js.map +1 -1
  47. package/dist/mtgate_api/schemas.gen.d.ts +0 -396
  48. package/dist/mtgate_api/schemas.gen.d.ts.map +1 -1
  49. package/dist/mtgate_api/schemas.gen.js +0 -439
  50. package/dist/mtgate_api/schemas.gen.js.map +1 -1
  51. package/dist/mtgate_api/sdk.gen.d.ts +1 -26
  52. package/dist/mtgate_api/sdk.gen.d.ts.map +1 -1
  53. package/dist/mtgate_api/sdk.gen.js +0 -67
  54. package/dist/mtgate_api/sdk.gen.js.map +1 -1
  55. package/dist/mtgate_api/types.gen.d.ts +0 -310
  56. package/dist/mtgate_api/types.gen.d.ts.map +1 -1
  57. package/dist/mtgate_api/zod.gen.d.ts +0 -771
  58. package/dist/mtgate_api/zod.gen.d.ts.map +1 -1
  59. package/dist/mtgate_api/zod.gen.js +0 -249
  60. package/dist/mtgate_api/zod.gen.js.map +1 -1
  61. package/dist/mtmai_api/client/client.gen.d.ts.map +1 -1
  62. package/dist/mtmai_api/client/client.gen.js +8 -1
  63. package/dist/mtmai_api/client/client.gen.js.map +1 -1
  64. package/dist/mtmai_api/index.d.ts +2 -2
  65. package/dist/mtmai_api/index.d.ts.map +1 -1
  66. package/dist/mtmai_api/index.js +2 -2
  67. package/dist/mtmai_api/index.js.map +1 -1
  68. package/dist/opencode/@tanstack/react-query.gen.d.ts +1903 -0
  69. package/dist/opencode/@tanstack/react-query.gen.d.ts.map +1 -0
  70. package/dist/opencode/@tanstack/react-query.gen.js +1696 -0
  71. package/dist/opencode/@tanstack/react-query.gen.js.map +1 -0
  72. package/dist/opencode/client/client.gen.d.ts +3 -0
  73. package/dist/opencode/client/client.gen.d.ts.map +1 -0
  74. package/dist/opencode/client/client.gen.js +236 -0
  75. package/dist/opencode/client/client.gen.js.map +1 -0
  76. package/dist/opencode/client/index.d.ts +9 -0
  77. package/dist/opencode/client/index.d.ts.map +1 -0
  78. package/dist/opencode/client/index.js +7 -0
  79. package/dist/opencode/client/index.js.map +1 -0
  80. package/dist/opencode/client/types.gen.d.ts +118 -0
  81. package/dist/opencode/client/types.gen.d.ts.map +1 -0
  82. package/dist/opencode/client/types.gen.js +3 -0
  83. package/dist/opencode/client/types.gen.js.map +1 -0
  84. package/dist/opencode/client/utils.gen.d.ts +34 -0
  85. package/dist/opencode/client/utils.gen.d.ts.map +1 -0
  86. package/dist/opencode/client/utils.gen.js +232 -0
  87. package/dist/opencode/client/utils.gen.js.map +1 -0
  88. package/dist/opencode/client.gen.d.ts +13 -0
  89. package/dist/opencode/client.gen.d.ts.map +1 -0
  90. package/dist/opencode/client.gen.js +4 -0
  91. package/dist/opencode/client.gen.js.map +1 -0
  92. package/dist/opencode/core/auth.gen.d.ts +19 -0
  93. package/dist/opencode/core/auth.gen.d.ts.map +1 -0
  94. package/dist/opencode/core/auth.gen.js +15 -0
  95. package/dist/opencode/core/auth.gen.js.map +1 -0
  96. package/dist/opencode/core/bodySerializer.gen.d.ts +26 -0
  97. package/dist/opencode/core/bodySerializer.gen.d.ts.map +1 -0
  98. package/dist/opencode/core/bodySerializer.gen.js +58 -0
  99. package/dist/opencode/core/bodySerializer.gen.js.map +1 -0
  100. package/dist/opencode/core/params.gen.d.ts +44 -0
  101. package/dist/opencode/core/params.gen.d.ts.map +1 -0
  102. package/dist/opencode/core/params.gen.js +101 -0
  103. package/dist/opencode/core/params.gen.js.map +1 -0
  104. package/dist/opencode/core/pathSerializer.gen.d.ts +34 -0
  105. package/dist/opencode/core/pathSerializer.gen.d.ts.map +1 -0
  106. package/dist/opencode/core/pathSerializer.gen.js +115 -0
  107. package/dist/opencode/core/pathSerializer.gen.js.map +1 -0
  108. package/dist/opencode/core/queryKeySerializer.gen.d.ts +19 -0
  109. package/dist/opencode/core/queryKeySerializer.gen.d.ts.map +1 -0
  110. package/dist/opencode/core/queryKeySerializer.gen.js +100 -0
  111. package/dist/opencode/core/queryKeySerializer.gen.js.map +1 -0
  112. package/dist/opencode/core/serverSentEvents.gen.d.ts +72 -0
  113. package/dist/opencode/core/serverSentEvents.gen.d.ts.map +1 -0
  114. package/dist/opencode/core/serverSentEvents.gen.js +138 -0
  115. package/dist/opencode/core/serverSentEvents.gen.js.map +1 -0
  116. package/dist/opencode/core/types.gen.d.ts +79 -0
  117. package/dist/opencode/core/types.gen.d.ts.map +1 -0
  118. package/dist/opencode/core/types.gen.js +3 -0
  119. package/dist/opencode/core/types.gen.js.map +1 -0
  120. package/dist/opencode/core/utils.gen.d.ts +20 -0
  121. package/dist/opencode/core/utils.gen.d.ts.map +1 -0
  122. package/dist/opencode/core/utils.gen.js +88 -0
  123. package/dist/opencode/core/utils.gen.js.map +1 -0
  124. package/dist/opencode/index.d.ts +3 -0
  125. package/dist/opencode/index.d.ts.map +1 -0
  126. package/dist/opencode/index.js +4 -0
  127. package/dist/opencode/index.js.map +1 -0
  128. package/dist/opencode/schemas.gen.d.ts +4823 -0
  129. package/dist/opencode/schemas.gen.d.ts.map +1 -0
  130. package/dist/opencode/schemas.gen.js +5816 -0
  131. package/dist/opencode/schemas.gen.js.map +1 -0
  132. package/dist/opencode/sdk.gen.d.ts +562 -0
  133. package/dist/opencode/sdk.gen.d.ts.map +1 -0
  134. package/dist/opencode/sdk.gen.js +766 -0
  135. package/dist/opencode/sdk.gen.js.map +1 -0
  136. package/dist/opencode/types.gen.d.ts +4213 -0
  137. package/dist/opencode/types.gen.d.ts.map +1 -0
  138. package/dist/opencode/types.gen.js +25 -0
  139. package/dist/opencode/types.gen.js.map +1 -0
  140. package/dist/opencode/zod.gen.d.ts +17243 -0
  141. package/dist/opencode/zod.gen.d.ts.map +1 -0
  142. package/dist/opencode/zod.gen.js +2876 -0
  143. package/dist/opencode/zod.gen.js.map +1 -0
  144. package/dist/sbapi/client/client.gen.d.ts.map +1 -1
  145. package/dist/sbapi/client/client.gen.js +8 -1
  146. package/dist/sbapi/client/client.gen.js.map +1 -1
  147. package/dist/sbapi/index.d.ts +2 -2
  148. package/dist/sbapi/index.d.ts.map +1 -1
  149. package/dist/sbapi/index.js +1 -1
  150. package/dist/sbapi/index.js.map +1 -1
  151. package/dist/sbmng/@tanstack/react-query.gen.d.ts +2418 -0
  152. package/dist/sbmng/@tanstack/react-query.gen.d.ts.map +1 -0
  153. package/dist/sbmng/@tanstack/react-query.gen.js +2657 -0
  154. package/dist/sbmng/@tanstack/react-query.gen.js.map +1 -0
  155. package/dist/sbmng/client/client.gen.d.ts +3 -0
  156. package/dist/sbmng/client/client.gen.d.ts.map +1 -0
  157. package/dist/sbmng/client/client.gen.js +236 -0
  158. package/dist/sbmng/client/client.gen.js.map +1 -0
  159. package/dist/sbmng/client/index.d.ts +9 -0
  160. package/dist/sbmng/client/index.d.ts.map +1 -0
  161. package/dist/sbmng/client/index.js +7 -0
  162. package/dist/sbmng/client/index.js.map +1 -0
  163. package/dist/sbmng/client/types.gen.d.ts +118 -0
  164. package/dist/sbmng/client/types.gen.d.ts.map +1 -0
  165. package/dist/sbmng/client/types.gen.js +3 -0
  166. package/dist/sbmng/client/types.gen.js.map +1 -0
  167. package/dist/sbmng/client/utils.gen.d.ts +34 -0
  168. package/dist/sbmng/client/utils.gen.d.ts.map +1 -0
  169. package/dist/sbmng/client/utils.gen.js +232 -0
  170. package/dist/sbmng/client/utils.gen.js.map +1 -0
  171. package/dist/sbmng/client.gen.d.ts +13 -0
  172. package/dist/sbmng/client.gen.d.ts.map +1 -0
  173. package/dist/sbmng/client.gen.js +4 -0
  174. package/dist/sbmng/client.gen.js.map +1 -0
  175. package/dist/sbmng/core/auth.gen.d.ts +19 -0
  176. package/dist/sbmng/core/auth.gen.d.ts.map +1 -0
  177. package/dist/sbmng/core/auth.gen.js +15 -0
  178. package/dist/sbmng/core/auth.gen.js.map +1 -0
  179. package/dist/sbmng/core/bodySerializer.gen.d.ts +26 -0
  180. package/dist/sbmng/core/bodySerializer.gen.d.ts.map +1 -0
  181. package/dist/sbmng/core/bodySerializer.gen.js +58 -0
  182. package/dist/sbmng/core/bodySerializer.gen.js.map +1 -0
  183. package/dist/sbmng/core/params.gen.d.ts +44 -0
  184. package/dist/sbmng/core/params.gen.d.ts.map +1 -0
  185. package/dist/sbmng/core/params.gen.js +101 -0
  186. package/dist/sbmng/core/params.gen.js.map +1 -0
  187. package/dist/sbmng/core/pathSerializer.gen.d.ts +34 -0
  188. package/dist/sbmng/core/pathSerializer.gen.d.ts.map +1 -0
  189. package/dist/sbmng/core/pathSerializer.gen.js +115 -0
  190. package/dist/sbmng/core/pathSerializer.gen.js.map +1 -0
  191. package/dist/sbmng/core/queryKeySerializer.gen.d.ts +19 -0
  192. package/dist/sbmng/core/queryKeySerializer.gen.d.ts.map +1 -0
  193. package/dist/sbmng/core/queryKeySerializer.gen.js +100 -0
  194. package/dist/sbmng/core/queryKeySerializer.gen.js.map +1 -0
  195. package/dist/sbmng/core/serverSentEvents.gen.d.ts +72 -0
  196. package/dist/sbmng/core/serverSentEvents.gen.d.ts.map +1 -0
  197. package/dist/sbmng/core/serverSentEvents.gen.js +138 -0
  198. package/dist/sbmng/core/serverSentEvents.gen.js.map +1 -0
  199. package/dist/sbmng/core/types.gen.d.ts +79 -0
  200. package/dist/sbmng/core/types.gen.d.ts.map +1 -0
  201. package/dist/sbmng/core/types.gen.js +3 -0
  202. package/dist/sbmng/core/types.gen.js.map +1 -0
  203. package/dist/sbmng/core/utils.gen.d.ts +20 -0
  204. package/dist/sbmng/core/utils.gen.d.ts.map +1 -0
  205. package/dist/sbmng/core/utils.gen.js +88 -0
  206. package/dist/sbmng/core/utils.gen.js.map +1 -0
  207. package/dist/sbmng/index.d.ts +3 -0
  208. package/dist/sbmng/index.d.ts.map +1 -0
  209. package/dist/sbmng/index.js +3 -0
  210. package/dist/sbmng/index.js.map +1 -0
  211. package/dist/sbmng/schemas.gen.d.ts +7220 -0
  212. package/dist/sbmng/schemas.gen.d.ts.map +1 -0
  213. package/dist/sbmng/schemas.gen.js +9392 -0
  214. package/dist/sbmng/schemas.gen.js.map +1 -0
  215. package/dist/sbmng/sdk.gen.d.ts +743 -0
  216. package/dist/sbmng/sdk.gen.d.ts.map +1 -0
  217. package/dist/sbmng/sdk.gen.js +1543 -0
  218. package/dist/sbmng/sdk.gen.js.map +1 -0
  219. package/dist/sbmng/types.gen.d.ts +7003 -0
  220. package/dist/sbmng/types.gen.d.ts.map +1 -0
  221. package/dist/sbmng/types.gen.js +3 -0
  222. package/dist/sbmng/types.gen.js.map +1 -0
  223. package/dist/supabase/context.d.ts +14 -0
  224. package/dist/supabase/context.d.ts.map +1 -0
  225. package/dist/supabase/context.js +33 -0
  226. package/dist/supabase/context.js.map +1 -0
  227. package/dist/supabase/supabase-client.d.ts +1625 -304
  228. package/dist/supabase/supabase-client.d.ts.map +1 -1
  229. package/dist/supabase/supabase.d.ts +3551 -909
  230. package/dist/supabase/supabase.d.ts.map +1 -1
  231. package/dist/supabase/supabase.js +1 -34
  232. package/dist/supabase/supabase.js.map +1 -1
  233. package/dist/types/database.types.d.ts +1656 -314
  234. package/dist/types/database.types.d.ts.map +1 -1
  235. package/dist/types/database.types.js +3 -1
  236. package/dist/types/database.types.js.map +1 -1
  237. package/dist/types/index.d.ts +30 -1
  238. package/dist/types/index.d.ts.map +1 -1
  239. package/package.json +45 -42
  240. package/dist/supabase/supabase-browser.d.ts +0 -4
  241. package/dist/supabase/supabase-browser.d.ts.map +0 -1
  242. package/dist/supabase/supabase-browser.js +0 -20
  243. package/dist/supabase/supabase-browser.js.map +0 -1
@@ -0,0 +1,2876 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { z } from 'zod';
3
+ export const zEventInstallationUpdated = z.object({
4
+ type: z.literal('installation.updated'),
5
+ properties: z.object({
6
+ version: z.string()
7
+ })
8
+ });
9
+ export const zEventInstallationUpdateAvailable = z.object({
10
+ type: z.literal('installation.update-available'),
11
+ properties: z.object({
12
+ version: z.string()
13
+ })
14
+ });
15
+ export const zProject = z.object({
16
+ id: z.string(),
17
+ worktree: z.string(),
18
+ vcs: z.optional(z.literal('git')),
19
+ name: z.optional(z.string()),
20
+ icon: z.optional(z.object({
21
+ url: z.optional(z.string()),
22
+ color: z.optional(z.string())
23
+ })),
24
+ time: z.object({
25
+ created: z.number(),
26
+ updated: z.number(),
27
+ initialized: z.optional(z.number())
28
+ }),
29
+ sandboxes: z.array(z.string())
30
+ });
31
+ export const zEventProjectUpdated = z.object({
32
+ type: z.literal('project.updated'),
33
+ properties: zProject
34
+ });
35
+ export const zEventServerInstanceDisposed = z.object({
36
+ type: z.literal('server.instance.disposed'),
37
+ properties: z.object({
38
+ directory: z.string()
39
+ })
40
+ });
41
+ export const zEventLspClientDiagnostics = z.object({
42
+ type: z.literal('lsp.client.diagnostics'),
43
+ properties: z.object({
44
+ serverID: z.string(),
45
+ path: z.string()
46
+ })
47
+ });
48
+ export const zEventLspUpdated = z.object({
49
+ type: z.literal('lsp.updated'),
50
+ properties: z.record(z.string(), z.unknown())
51
+ });
52
+ export const zFileDiff = z.object({
53
+ file: z.string(),
54
+ before: z.string(),
55
+ after: z.string(),
56
+ additions: z.number(),
57
+ deletions: z.number()
58
+ });
59
+ export const zUserMessage = z.object({
60
+ id: z.string(),
61
+ sessionID: z.string(),
62
+ role: z.literal('user'),
63
+ time: z.object({
64
+ created: z.number()
65
+ }),
66
+ summary: z.optional(z.object({
67
+ title: z.optional(z.string()),
68
+ body: z.optional(z.string()),
69
+ diffs: z.array(zFileDiff)
70
+ })),
71
+ agent: z.string(),
72
+ model: z.object({
73
+ providerID: z.string(),
74
+ modelID: z.string()
75
+ }),
76
+ system: z.optional(z.string()),
77
+ tools: z.optional(z.record(z.string(), z.boolean())),
78
+ variant: z.optional(z.string())
79
+ });
80
+ export const zProviderAuthError = z.object({
81
+ name: z.literal('ProviderAuthError'),
82
+ data: z.object({
83
+ providerID: z.string(),
84
+ message: z.string()
85
+ })
86
+ });
87
+ export const zUnknownError = z.object({
88
+ name: z.literal('UnknownError'),
89
+ data: z.object({
90
+ message: z.string()
91
+ })
92
+ });
93
+ export const zMessageOutputLengthError = z.object({
94
+ name: z.literal('MessageOutputLengthError'),
95
+ data: z.record(z.string(), z.unknown())
96
+ });
97
+ export const zMessageAbortedError = z.object({
98
+ name: z.literal('MessageAbortedError'),
99
+ data: z.object({
100
+ message: z.string()
101
+ })
102
+ });
103
+ export const zApiError = z.object({
104
+ name: z.literal('APIError'),
105
+ data: z.object({
106
+ message: z.string(),
107
+ statusCode: z.optional(z.number()),
108
+ isRetryable: z.boolean(),
109
+ responseHeaders: z.optional(z.record(z.string(), z.string())),
110
+ responseBody: z.optional(z.string()),
111
+ metadata: z.optional(z.record(z.string(), z.string()))
112
+ })
113
+ });
114
+ export const zAssistantMessage = z.object({
115
+ id: z.string(),
116
+ sessionID: z.string(),
117
+ role: z.literal('assistant'),
118
+ time: z.object({
119
+ created: z.number(),
120
+ completed: z.optional(z.number())
121
+ }),
122
+ error: z.optional(z.union([
123
+ zProviderAuthError,
124
+ zUnknownError,
125
+ zMessageOutputLengthError,
126
+ zMessageAbortedError,
127
+ zApiError
128
+ ])),
129
+ parentID: z.string(),
130
+ modelID: z.string(),
131
+ providerID: z.string(),
132
+ mode: z.string(),
133
+ agent: z.string(),
134
+ path: z.object({
135
+ cwd: z.string(),
136
+ root: z.string()
137
+ }),
138
+ summary: z.optional(z.boolean()),
139
+ cost: z.number(),
140
+ tokens: z.object({
141
+ input: z.number(),
142
+ output: z.number(),
143
+ reasoning: z.number(),
144
+ cache: z.object({
145
+ read: z.number(),
146
+ write: z.number()
147
+ })
148
+ }),
149
+ finish: z.optional(z.string())
150
+ });
151
+ export const zMessage = z.union([
152
+ zUserMessage,
153
+ zAssistantMessage
154
+ ]);
155
+ export const zEventMessageUpdated = z.object({
156
+ type: z.literal('message.updated'),
157
+ properties: z.object({
158
+ info: zMessage
159
+ })
160
+ });
161
+ export const zEventMessageRemoved = z.object({
162
+ type: z.literal('message.removed'),
163
+ properties: z.object({
164
+ sessionID: z.string(),
165
+ messageID: z.string()
166
+ })
167
+ });
168
+ export const zTextPart = z.object({
169
+ id: z.string(),
170
+ sessionID: z.string(),
171
+ messageID: z.string(),
172
+ type: z.literal('text'),
173
+ text: z.string(),
174
+ synthetic: z.optional(z.boolean()),
175
+ ignored: z.optional(z.boolean()),
176
+ time: z.optional(z.object({
177
+ start: z.number(),
178
+ end: z.optional(z.number())
179
+ })),
180
+ metadata: z.optional(z.record(z.string(), z.unknown()))
181
+ });
182
+ export const zReasoningPart = z.object({
183
+ id: z.string(),
184
+ sessionID: z.string(),
185
+ messageID: z.string(),
186
+ type: z.literal('reasoning'),
187
+ text: z.string(),
188
+ metadata: z.optional(z.record(z.string(), z.unknown())),
189
+ time: z.object({
190
+ start: z.number(),
191
+ end: z.optional(z.number())
192
+ })
193
+ });
194
+ export const zFilePartSourceText = z.object({
195
+ value: z.string(),
196
+ start: z.int().gte(-9007199254740991).lte(9007199254740991),
197
+ end: z.int().gte(-9007199254740991).lte(9007199254740991)
198
+ });
199
+ export const zFileSource = z.object({
200
+ text: zFilePartSourceText,
201
+ type: z.literal('file'),
202
+ path: z.string()
203
+ });
204
+ export const zRange = z.object({
205
+ start: z.object({
206
+ line: z.number(),
207
+ character: z.number()
208
+ }),
209
+ end: z.object({
210
+ line: z.number(),
211
+ character: z.number()
212
+ })
213
+ });
214
+ export const zSymbolSource = z.object({
215
+ text: zFilePartSourceText,
216
+ type: z.literal('symbol'),
217
+ path: z.string(),
218
+ range: zRange,
219
+ name: z.string(),
220
+ kind: z.int().gte(-9007199254740991).lte(9007199254740991)
221
+ });
222
+ export const zResourceSource = z.object({
223
+ text: zFilePartSourceText,
224
+ type: z.literal('resource'),
225
+ clientName: z.string(),
226
+ uri: z.string()
227
+ });
228
+ export const zFilePartSource = z.union([
229
+ zFileSource,
230
+ zSymbolSource,
231
+ zResourceSource
232
+ ]);
233
+ export const zFilePart = z.object({
234
+ id: z.string(),
235
+ sessionID: z.string(),
236
+ messageID: z.string(),
237
+ type: z.literal('file'),
238
+ mime: z.string(),
239
+ filename: z.optional(z.string()),
240
+ url: z.string(),
241
+ source: z.optional(zFilePartSource)
242
+ });
243
+ export const zToolStatePending = z.object({
244
+ status: z.literal('pending'),
245
+ input: z.record(z.string(), z.unknown()),
246
+ raw: z.string()
247
+ });
248
+ export const zToolStateRunning = z.object({
249
+ status: z.literal('running'),
250
+ input: z.record(z.string(), z.unknown()),
251
+ title: z.optional(z.string()),
252
+ metadata: z.optional(z.record(z.string(), z.unknown())),
253
+ time: z.object({
254
+ start: z.number()
255
+ })
256
+ });
257
+ export const zToolStateCompleted = z.object({
258
+ status: z.literal('completed'),
259
+ input: z.record(z.string(), z.unknown()),
260
+ output: z.string(),
261
+ title: z.string(),
262
+ metadata: z.record(z.string(), z.unknown()),
263
+ time: z.object({
264
+ start: z.number(),
265
+ end: z.number(),
266
+ compacted: z.optional(z.number())
267
+ }),
268
+ attachments: z.optional(z.array(zFilePart))
269
+ });
270
+ export const zToolStateError = z.object({
271
+ status: z.literal('error'),
272
+ input: z.record(z.string(), z.unknown()),
273
+ error: z.string(),
274
+ metadata: z.optional(z.record(z.string(), z.unknown())),
275
+ time: z.object({
276
+ start: z.number(),
277
+ end: z.number()
278
+ })
279
+ });
280
+ export const zToolState = z.union([
281
+ zToolStatePending,
282
+ zToolStateRunning,
283
+ zToolStateCompleted,
284
+ zToolStateError
285
+ ]);
286
+ export const zToolPart = z.object({
287
+ id: z.string(),
288
+ sessionID: z.string(),
289
+ messageID: z.string(),
290
+ type: z.literal('tool'),
291
+ callID: z.string(),
292
+ tool: z.string(),
293
+ state: zToolState,
294
+ metadata: z.optional(z.record(z.string(), z.unknown()))
295
+ });
296
+ export const zStepStartPart = z.object({
297
+ id: z.string(),
298
+ sessionID: z.string(),
299
+ messageID: z.string(),
300
+ type: z.literal('step-start'),
301
+ snapshot: z.optional(z.string())
302
+ });
303
+ export const zStepFinishPart = z.object({
304
+ id: z.string(),
305
+ sessionID: z.string(),
306
+ messageID: z.string(),
307
+ type: z.literal('step-finish'),
308
+ reason: z.string(),
309
+ snapshot: z.optional(z.string()),
310
+ cost: z.number(),
311
+ tokens: z.object({
312
+ input: z.number(),
313
+ output: z.number(),
314
+ reasoning: z.number(),
315
+ cache: z.object({
316
+ read: z.number(),
317
+ write: z.number()
318
+ })
319
+ })
320
+ });
321
+ export const zSnapshotPart = z.object({
322
+ id: z.string(),
323
+ sessionID: z.string(),
324
+ messageID: z.string(),
325
+ type: z.literal('snapshot'),
326
+ snapshot: z.string()
327
+ });
328
+ export const zPatchPart = z.object({
329
+ id: z.string(),
330
+ sessionID: z.string(),
331
+ messageID: z.string(),
332
+ type: z.literal('patch'),
333
+ hash: z.string(),
334
+ files: z.array(z.string())
335
+ });
336
+ export const zAgentPart = z.object({
337
+ id: z.string(),
338
+ sessionID: z.string(),
339
+ messageID: z.string(),
340
+ type: z.literal('agent'),
341
+ name: z.string(),
342
+ source: z.optional(z.object({
343
+ value: z.string(),
344
+ start: z.int().gte(-9007199254740991).lte(9007199254740991),
345
+ end: z.int().gte(-9007199254740991).lte(9007199254740991)
346
+ }))
347
+ });
348
+ export const zRetryPart = z.object({
349
+ id: z.string(),
350
+ sessionID: z.string(),
351
+ messageID: z.string(),
352
+ type: z.literal('retry'),
353
+ attempt: z.number(),
354
+ error: zApiError,
355
+ time: z.object({
356
+ created: z.number()
357
+ })
358
+ });
359
+ export const zCompactionPart = z.object({
360
+ id: z.string(),
361
+ sessionID: z.string(),
362
+ messageID: z.string(),
363
+ type: z.literal('compaction'),
364
+ auto: z.boolean()
365
+ });
366
+ export const zPart = z.union([
367
+ zTextPart,
368
+ z.object({
369
+ id: z.string(),
370
+ sessionID: z.string(),
371
+ messageID: z.string(),
372
+ type: z.literal('subtask'),
373
+ prompt: z.string(),
374
+ description: z.string(),
375
+ agent: z.string(),
376
+ model: z.optional(z.object({
377
+ providerID: z.string(),
378
+ modelID: z.string()
379
+ })),
380
+ command: z.optional(z.string())
381
+ }),
382
+ zReasoningPart,
383
+ zFilePart,
384
+ zToolPart,
385
+ zStepStartPart,
386
+ zStepFinishPart,
387
+ zSnapshotPart,
388
+ zPatchPart,
389
+ zAgentPart,
390
+ zRetryPart,
391
+ zCompactionPart
392
+ ]);
393
+ export const zEventMessagePartUpdated = z.object({
394
+ type: z.literal('message.part.updated'),
395
+ properties: z.object({
396
+ part: zPart,
397
+ delta: z.optional(z.string())
398
+ })
399
+ });
400
+ export const zEventMessagePartRemoved = z.object({
401
+ type: z.literal('message.part.removed'),
402
+ properties: z.object({
403
+ sessionID: z.string(),
404
+ messageID: z.string(),
405
+ partID: z.string()
406
+ })
407
+ });
408
+ export const zPermissionRequest = z.object({
409
+ id: z.string().regex(/^per.*/),
410
+ sessionID: z.string().regex(/^ses.*/),
411
+ permission: z.string(),
412
+ patterns: z.array(z.string()),
413
+ metadata: z.record(z.string(), z.unknown()),
414
+ always: z.array(z.string()),
415
+ tool: z.optional(z.object({
416
+ messageID: z.string(),
417
+ callID: z.string()
418
+ }))
419
+ });
420
+ export const zEventPermissionAsked = z.object({
421
+ type: z.literal('permission.asked'),
422
+ properties: zPermissionRequest
423
+ });
424
+ export const zEventPermissionReplied = z.object({
425
+ type: z.literal('permission.replied'),
426
+ properties: z.object({
427
+ sessionID: z.string(),
428
+ requestID: z.string(),
429
+ reply: z.enum([
430
+ 'once',
431
+ 'always',
432
+ 'reject'
433
+ ])
434
+ })
435
+ });
436
+ export const zSessionStatus = z.union([
437
+ z.object({
438
+ type: z.literal('idle')
439
+ }),
440
+ z.object({
441
+ type: z.literal('retry'),
442
+ attempt: z.number(),
443
+ message: z.string(),
444
+ next: z.number()
445
+ }),
446
+ z.object({
447
+ type: z.literal('busy')
448
+ })
449
+ ]);
450
+ export const zEventSessionStatus = z.object({
451
+ type: z.literal('session.status'),
452
+ properties: z.object({
453
+ sessionID: z.string(),
454
+ status: zSessionStatus
455
+ })
456
+ });
457
+ export const zEventSessionIdle = z.object({
458
+ type: z.literal('session.idle'),
459
+ properties: z.object({
460
+ sessionID: z.string()
461
+ })
462
+ });
463
+ export const zQuestionOption = z.object({
464
+ label: z.string(),
465
+ description: z.string()
466
+ });
467
+ export const zQuestionInfo = z.object({
468
+ question: z.string(),
469
+ header: z.string().max(12),
470
+ options: z.array(zQuestionOption),
471
+ multiple: z.optional(z.boolean()),
472
+ custom: z.optional(z.boolean())
473
+ });
474
+ export const zQuestionRequest = z.object({
475
+ id: z.string().regex(/^que.*/),
476
+ sessionID: z.string().regex(/^ses.*/),
477
+ questions: z.array(zQuestionInfo),
478
+ tool: z.optional(z.object({
479
+ messageID: z.string(),
480
+ callID: z.string()
481
+ }))
482
+ });
483
+ export const zEventQuestionAsked = z.object({
484
+ type: z.literal('question.asked'),
485
+ properties: zQuestionRequest
486
+ });
487
+ export const zQuestionAnswer = z.array(z.string());
488
+ export const zEventQuestionReplied = z.object({
489
+ type: z.literal('question.replied'),
490
+ properties: z.object({
491
+ sessionID: z.string(),
492
+ requestID: z.string(),
493
+ answers: z.array(zQuestionAnswer)
494
+ })
495
+ });
496
+ export const zEventQuestionRejected = z.object({
497
+ type: z.literal('question.rejected'),
498
+ properties: z.object({
499
+ sessionID: z.string(),
500
+ requestID: z.string()
501
+ })
502
+ });
503
+ export const zEventSessionCompacted = z.object({
504
+ type: z.literal('session.compacted'),
505
+ properties: z.object({
506
+ sessionID: z.string()
507
+ })
508
+ });
509
+ export const zEventFileEdited = z.object({
510
+ type: z.literal('file.edited'),
511
+ properties: z.object({
512
+ file: z.string()
513
+ })
514
+ });
515
+ export const zTodo = z.object({
516
+ content: z.string(),
517
+ status: z.string(),
518
+ priority: z.string(),
519
+ id: z.string()
520
+ });
521
+ export const zEventTodoUpdated = z.object({
522
+ type: z.literal('todo.updated'),
523
+ properties: z.object({
524
+ sessionID: z.string(),
525
+ todos: z.array(zTodo)
526
+ })
527
+ });
528
+ export const zEventTuiPromptAppend = z.object({
529
+ type: z.literal('tui.prompt.append'),
530
+ properties: z.object({
531
+ text: z.string()
532
+ })
533
+ });
534
+ export const zEventTuiCommandExecute = z.object({
535
+ type: z.literal('tui.command.execute'),
536
+ properties: z.object({
537
+ command: z.union([
538
+ z.enum([
539
+ 'session.list',
540
+ 'session.new',
541
+ 'session.share',
542
+ 'session.interrupt',
543
+ 'session.compact',
544
+ 'session.page.up',
545
+ 'session.page.down',
546
+ 'session.half.page.up',
547
+ 'session.half.page.down',
548
+ 'session.first',
549
+ 'session.last',
550
+ 'prompt.clear',
551
+ 'prompt.submit',
552
+ 'agent.cycle'
553
+ ]),
554
+ z.string()
555
+ ])
556
+ })
557
+ });
558
+ export const zEventTuiToastShow = z.object({
559
+ type: z.literal('tui.toast.show'),
560
+ properties: z.object({
561
+ title: z.optional(z.string()),
562
+ message: z.string(),
563
+ variant: z.enum([
564
+ 'info',
565
+ 'success',
566
+ 'warning',
567
+ 'error'
568
+ ]),
569
+ duration: z.optional(z.number()).default(5000)
570
+ })
571
+ });
572
+ export const zEventTuiSessionSelect = z.object({
573
+ type: z.literal('tui.session.select'),
574
+ properties: z.object({
575
+ sessionID: z.string().regex(/^ses/)
576
+ })
577
+ });
578
+ export const zEventMcpToolsChanged = z.object({
579
+ type: z.literal('mcp.tools.changed'),
580
+ properties: z.object({
581
+ server: z.string()
582
+ })
583
+ });
584
+ export const zEventMcpBrowserOpenFailed = z.object({
585
+ type: z.literal('mcp.browser.open.failed'),
586
+ properties: z.object({
587
+ mcpName: z.string(),
588
+ url: z.string()
589
+ })
590
+ });
591
+ export const zEventCommandExecuted = z.object({
592
+ type: z.literal('command.executed'),
593
+ properties: z.object({
594
+ name: z.string(),
595
+ sessionID: z.string().regex(/^ses.*/),
596
+ arguments: z.string(),
597
+ messageID: z.string().regex(/^msg.*/)
598
+ })
599
+ });
600
+ export const zPermissionAction = z.enum([
601
+ 'allow',
602
+ 'deny',
603
+ 'ask'
604
+ ]);
605
+ export const zPermissionRule = z.object({
606
+ permission: z.string(),
607
+ pattern: z.string(),
608
+ action: zPermissionAction
609
+ });
610
+ export const zPermissionRuleset = z.array(zPermissionRule);
611
+ export const zSession = z.object({
612
+ id: z.string().regex(/^ses.*/),
613
+ slug: z.string(),
614
+ projectID: z.string(),
615
+ directory: z.string(),
616
+ parentID: z.optional(z.string().regex(/^ses.*/)),
617
+ summary: z.optional(z.object({
618
+ additions: z.number(),
619
+ deletions: z.number(),
620
+ files: z.number(),
621
+ diffs: z.optional(z.array(zFileDiff))
622
+ })),
623
+ share: z.optional(z.object({
624
+ url: z.string()
625
+ })),
626
+ title: z.string(),
627
+ version: z.string(),
628
+ time: z.object({
629
+ created: z.number(),
630
+ updated: z.number(),
631
+ compacting: z.optional(z.number()),
632
+ archived: z.optional(z.number())
633
+ }),
634
+ permission: z.optional(zPermissionRuleset),
635
+ revert: z.optional(z.object({
636
+ messageID: z.string(),
637
+ partID: z.optional(z.string()),
638
+ snapshot: z.optional(z.string()),
639
+ diff: z.optional(z.string())
640
+ }))
641
+ });
642
+ export const zEventSessionCreated = z.object({
643
+ type: z.literal('session.created'),
644
+ properties: z.object({
645
+ info: zSession
646
+ })
647
+ });
648
+ export const zEventSessionUpdated = z.object({
649
+ type: z.literal('session.updated'),
650
+ properties: z.object({
651
+ info: zSession
652
+ })
653
+ });
654
+ export const zEventSessionDeleted = z.object({
655
+ type: z.literal('session.deleted'),
656
+ properties: z.object({
657
+ info: zSession
658
+ })
659
+ });
660
+ export const zEventSessionDiff = z.object({
661
+ type: z.literal('session.diff'),
662
+ properties: z.object({
663
+ sessionID: z.string(),
664
+ diff: z.array(zFileDiff)
665
+ })
666
+ });
667
+ export const zEventSessionError = z.object({
668
+ type: z.literal('session.error'),
669
+ properties: z.object({
670
+ sessionID: z.optional(z.string()),
671
+ error: z.optional(z.union([
672
+ zProviderAuthError,
673
+ zUnknownError,
674
+ zMessageOutputLengthError,
675
+ zMessageAbortedError,
676
+ zApiError
677
+ ]))
678
+ })
679
+ });
680
+ export const zEventFileWatcherUpdated = z.object({
681
+ type: z.literal('file.watcher.updated'),
682
+ properties: z.object({
683
+ file: z.string(),
684
+ event: z.union([
685
+ z.literal('add'),
686
+ z.literal('change'),
687
+ z.literal('unlink')
688
+ ])
689
+ })
690
+ });
691
+ export const zEventVcsBranchUpdated = z.object({
692
+ type: z.literal('vcs.branch.updated'),
693
+ properties: z.object({
694
+ branch: z.optional(z.string())
695
+ })
696
+ });
697
+ export const zPty = z.object({
698
+ id: z.string().regex(/^pty.*/),
699
+ title: z.string(),
700
+ command: z.string(),
701
+ args: z.array(z.string()),
702
+ cwd: z.string(),
703
+ status: z.enum(['running', 'exited']),
704
+ pid: z.number()
705
+ });
706
+ export const zEventPtyCreated = z.object({
707
+ type: z.literal('pty.created'),
708
+ properties: z.object({
709
+ info: zPty
710
+ })
711
+ });
712
+ export const zEventPtyUpdated = z.object({
713
+ type: z.literal('pty.updated'),
714
+ properties: z.object({
715
+ info: zPty
716
+ })
717
+ });
718
+ export const zEventPtyExited = z.object({
719
+ type: z.literal('pty.exited'),
720
+ properties: z.object({
721
+ id: z.string().regex(/^pty.*/),
722
+ exitCode: z.number()
723
+ })
724
+ });
725
+ export const zEventPtyDeleted = z.object({
726
+ type: z.literal('pty.deleted'),
727
+ properties: z.object({
728
+ id: z.string().regex(/^pty.*/)
729
+ })
730
+ });
731
+ export const zEventServerConnected = z.object({
732
+ type: z.literal('server.connected'),
733
+ properties: z.record(z.string(), z.unknown())
734
+ });
735
+ export const zEventGlobalDisposed = z.object({
736
+ type: z.literal('global.disposed'),
737
+ properties: z.record(z.string(), z.unknown())
738
+ });
739
+ export const zEvent = z.union([
740
+ zEventInstallationUpdated,
741
+ zEventInstallationUpdateAvailable,
742
+ zEventProjectUpdated,
743
+ zEventServerInstanceDisposed,
744
+ zEventLspClientDiagnostics,
745
+ zEventLspUpdated,
746
+ zEventMessageUpdated,
747
+ zEventMessageRemoved,
748
+ zEventMessagePartUpdated,
749
+ zEventMessagePartRemoved,
750
+ zEventPermissionAsked,
751
+ zEventPermissionReplied,
752
+ zEventSessionStatus,
753
+ zEventSessionIdle,
754
+ zEventQuestionAsked,
755
+ zEventQuestionReplied,
756
+ zEventQuestionRejected,
757
+ zEventSessionCompacted,
758
+ zEventFileEdited,
759
+ zEventTodoUpdated,
760
+ zEventTuiPromptAppend,
761
+ zEventTuiCommandExecute,
762
+ zEventTuiToastShow,
763
+ zEventTuiSessionSelect,
764
+ zEventMcpToolsChanged,
765
+ zEventMcpBrowserOpenFailed,
766
+ zEventCommandExecuted,
767
+ zEventSessionCreated,
768
+ zEventSessionUpdated,
769
+ zEventSessionDeleted,
770
+ zEventSessionDiff,
771
+ zEventSessionError,
772
+ zEventFileWatcherUpdated,
773
+ zEventVcsBranchUpdated,
774
+ zEventPtyCreated,
775
+ zEventPtyUpdated,
776
+ zEventPtyExited,
777
+ zEventPtyDeleted,
778
+ zEventServerConnected,
779
+ zEventGlobalDisposed
780
+ ]);
781
+ export const zGlobalEvent = z.object({
782
+ directory: z.string(),
783
+ payload: zEvent
784
+ });
785
+ export const zBadRequestError = z.object({
786
+ data: z.unknown(),
787
+ errors: z.array(z.record(z.string(), z.unknown())),
788
+ success: z.literal(false)
789
+ });
790
+ export const zNotFoundError = z.object({
791
+ name: z.literal('NotFoundError'),
792
+ data: z.object({
793
+ message: z.string()
794
+ })
795
+ });
796
+ /**
797
+ * Custom keybind configurations
798
+ */
799
+ export const zKeybindsConfig = z.object({
800
+ leader: z.optional(z.string()).default('ctrl+x'),
801
+ app_exit: z.optional(z.string()).default('ctrl+c,ctrl+d,<leader>q'),
802
+ editor_open: z.optional(z.string()).default('<leader>e'),
803
+ theme_list: z.optional(z.string()).default('<leader>t'),
804
+ sidebar_toggle: z.optional(z.string()).default('<leader>b'),
805
+ scrollbar_toggle: z.optional(z.string()).default('none'),
806
+ username_toggle: z.optional(z.string()).default('none'),
807
+ status_view: z.optional(z.string()).default('<leader>s'),
808
+ session_export: z.optional(z.string()).default('<leader>x'),
809
+ session_new: z.optional(z.string()).default('<leader>n'),
810
+ session_list: z.optional(z.string()).default('<leader>l'),
811
+ session_timeline: z.optional(z.string()).default('<leader>g'),
812
+ session_fork: z.optional(z.string()).default('none'),
813
+ session_rename: z.optional(z.string()).default('ctrl+r'),
814
+ session_delete: z.optional(z.string()).default('ctrl+d'),
815
+ stash_delete: z.optional(z.string()).default('ctrl+d'),
816
+ model_provider_list: z.optional(z.string()).default('ctrl+a'),
817
+ model_favorite_toggle: z.optional(z.string()).default('ctrl+f'),
818
+ session_share: z.optional(z.string()).default('none'),
819
+ session_unshare: z.optional(z.string()).default('none'),
820
+ session_interrupt: z.optional(z.string()).default('escape'),
821
+ session_compact: z.optional(z.string()).default('<leader>c'),
822
+ messages_page_up: z.optional(z.string()).default('pageup'),
823
+ messages_page_down: z.optional(z.string()).default('pagedown'),
824
+ messages_half_page_up: z.optional(z.string()).default('ctrl+alt+u'),
825
+ messages_half_page_down: z.optional(z.string()).default('ctrl+alt+d'),
826
+ messages_first: z.optional(z.string()).default('ctrl+g,home'),
827
+ messages_last: z.optional(z.string()).default('ctrl+alt+g,end'),
828
+ messages_next: z.optional(z.string()).default('none'),
829
+ messages_previous: z.optional(z.string()).default('none'),
830
+ messages_last_user: z.optional(z.string()).default('none'),
831
+ messages_copy: z.optional(z.string()).default('<leader>y'),
832
+ messages_undo: z.optional(z.string()).default('<leader>u'),
833
+ messages_redo: z.optional(z.string()).default('<leader>r'),
834
+ messages_toggle_conceal: z.optional(z.string()).default('<leader>h'),
835
+ tool_details: z.optional(z.string()).default('none'),
836
+ model_list: z.optional(z.string()).default('<leader>m'),
837
+ model_cycle_recent: z.optional(z.string()).default('f2'),
838
+ model_cycle_recent_reverse: z.optional(z.string()).default('shift+f2'),
839
+ model_cycle_favorite: z.optional(z.string()).default('none'),
840
+ model_cycle_favorite_reverse: z.optional(z.string()).default('none'),
841
+ command_list: z.optional(z.string()).default('ctrl+p'),
842
+ agent_list: z.optional(z.string()).default('<leader>a'),
843
+ agent_cycle: z.optional(z.string()).default('tab'),
844
+ agent_cycle_reverse: z.optional(z.string()).default('shift+tab'),
845
+ variant_cycle: z.optional(z.string()).default('ctrl+t'),
846
+ input_clear: z.optional(z.string()).default('ctrl+c'),
847
+ input_paste: z.optional(z.string()).default('ctrl+v'),
848
+ input_submit: z.optional(z.string()).default('return'),
849
+ input_newline: z.optional(z.string()).default('shift+return,ctrl+return,alt+return,ctrl+j'),
850
+ input_move_left: z.optional(z.string()).default('left,ctrl+b'),
851
+ input_move_right: z.optional(z.string()).default('right,ctrl+f'),
852
+ input_move_up: z.optional(z.string()).default('up'),
853
+ input_move_down: z.optional(z.string()).default('down'),
854
+ input_select_left: z.optional(z.string()).default('shift+left'),
855
+ input_select_right: z.optional(z.string()).default('shift+right'),
856
+ input_select_up: z.optional(z.string()).default('shift+up'),
857
+ input_select_down: z.optional(z.string()).default('shift+down'),
858
+ input_line_home: z.optional(z.string()).default('ctrl+a'),
859
+ input_line_end: z.optional(z.string()).default('ctrl+e'),
860
+ input_select_line_home: z.optional(z.string()).default('ctrl+shift+a'),
861
+ input_select_line_end: z.optional(z.string()).default('ctrl+shift+e'),
862
+ input_visual_line_home: z.optional(z.string()).default('alt+a'),
863
+ input_visual_line_end: z.optional(z.string()).default('alt+e'),
864
+ input_select_visual_line_home: z.optional(z.string()).default('alt+shift+a'),
865
+ input_select_visual_line_end: z.optional(z.string()).default('alt+shift+e'),
866
+ input_buffer_home: z.optional(z.string()).default('home'),
867
+ input_buffer_end: z.optional(z.string()).default('end'),
868
+ input_select_buffer_home: z.optional(z.string()).default('shift+home'),
869
+ input_select_buffer_end: z.optional(z.string()).default('shift+end'),
870
+ input_delete_line: z.optional(z.string()).default('ctrl+shift+d'),
871
+ input_delete_to_line_end: z.optional(z.string()).default('ctrl+k'),
872
+ input_delete_to_line_start: z.optional(z.string()).default('ctrl+u'),
873
+ input_backspace: z.optional(z.string()).default('backspace,shift+backspace'),
874
+ input_delete: z.optional(z.string()).default('ctrl+d,delete,shift+delete'),
875
+ input_undo: z.optional(z.string()).default('ctrl+-,super+z'),
876
+ input_redo: z.optional(z.string()).default('ctrl+.,super+shift+z'),
877
+ input_word_forward: z.optional(z.string()).default('alt+f,alt+right,ctrl+right'),
878
+ input_word_backward: z.optional(z.string()).default('alt+b,alt+left,ctrl+left'),
879
+ input_select_word_forward: z.optional(z.string()).default('alt+shift+f,alt+shift+right'),
880
+ input_select_word_backward: z.optional(z.string()).default('alt+shift+b,alt+shift+left'),
881
+ input_delete_word_forward: z.optional(z.string()).default('alt+d,alt+delete,ctrl+delete'),
882
+ input_delete_word_backward: z.optional(z.string()).default('ctrl+w,ctrl+backspace,alt+backspace'),
883
+ history_previous: z.optional(z.string()).default('up'),
884
+ history_next: z.optional(z.string()).default('down'),
885
+ session_child_cycle: z.optional(z.string()).default('<leader>right'),
886
+ session_child_cycle_reverse: z.optional(z.string()).default('<leader>left'),
887
+ session_parent: z.optional(z.string()).default('<leader>up'),
888
+ terminal_suspend: z.optional(z.string()).default('ctrl+z'),
889
+ terminal_title_toggle: z.optional(z.string()).default('none'),
890
+ tips_toggle: z.optional(z.string()).default('<leader>h')
891
+ });
892
+ /**
893
+ * Log level
894
+ */
895
+ export const zLogLevel = z.enum([
896
+ 'DEBUG',
897
+ 'INFO',
898
+ 'WARN',
899
+ 'ERROR'
900
+ ]);
901
+ /**
902
+ * Server configuration for opencode serve and web commands
903
+ */
904
+ export const zServerConfig = z.object({
905
+ port: z.optional(z.int().gt(0).lte(9007199254740991)),
906
+ hostname: z.optional(z.string()),
907
+ mdns: z.optional(z.boolean()),
908
+ cors: z.optional(z.array(z.string()))
909
+ });
910
+ export const zPermissionActionConfig = z.enum([
911
+ 'ask',
912
+ 'allow',
913
+ 'deny'
914
+ ]);
915
+ export const zPermissionObjectConfig = z.record(z.string(), zPermissionActionConfig);
916
+ export const zPermissionRuleConfig = z.union([
917
+ zPermissionActionConfig,
918
+ zPermissionObjectConfig
919
+ ]);
920
+ export const zPermissionConfig = z.union([
921
+ z.object({
922
+ __originalKeys: z.optional(z.array(z.string())),
923
+ read: z.optional(zPermissionRuleConfig),
924
+ edit: z.optional(zPermissionRuleConfig),
925
+ glob: z.optional(zPermissionRuleConfig),
926
+ grep: z.optional(zPermissionRuleConfig),
927
+ list: z.optional(zPermissionRuleConfig),
928
+ bash: z.optional(zPermissionRuleConfig),
929
+ task: z.optional(zPermissionRuleConfig),
930
+ external_directory: z.optional(zPermissionRuleConfig),
931
+ todowrite: z.optional(zPermissionActionConfig),
932
+ todoread: z.optional(zPermissionActionConfig),
933
+ question: z.optional(zPermissionActionConfig),
934
+ webfetch: z.optional(zPermissionActionConfig),
935
+ websearch: z.optional(zPermissionActionConfig),
936
+ codesearch: z.optional(zPermissionActionConfig),
937
+ lsp: z.optional(zPermissionRuleConfig),
938
+ doom_loop: z.optional(zPermissionActionConfig)
939
+ }),
940
+ zPermissionActionConfig
941
+ ]);
942
+ export const zAgentConfig = z.object({
943
+ model: z.optional(z.string()),
944
+ temperature: z.optional(z.number()),
945
+ top_p: z.optional(z.number()),
946
+ prompt: z.optional(z.string()),
947
+ tools: z.optional(z.record(z.string(), z.boolean())),
948
+ disable: z.optional(z.boolean()),
949
+ description: z.optional(z.string()),
950
+ mode: z.optional(z.enum([
951
+ 'subagent',
952
+ 'primary',
953
+ 'all'
954
+ ])),
955
+ hidden: z.optional(z.boolean()),
956
+ options: z.optional(z.record(z.string(), z.unknown())),
957
+ color: z.optional(z.string().regex(/^#[0-9a-fA-F]{6}$/)),
958
+ steps: z.optional(z.int().gt(0).lte(9007199254740991)),
959
+ maxSteps: z.optional(z.int().gt(0).lte(9007199254740991)),
960
+ permission: z.optional(zPermissionConfig)
961
+ });
962
+ export const zProviderConfig = z.object({
963
+ api: z.optional(z.string()),
964
+ name: z.optional(z.string()),
965
+ env: z.optional(z.array(z.string())),
966
+ id: z.optional(z.string()),
967
+ npm: z.optional(z.string()),
968
+ models: z.optional(z.record(z.string(), z.object({
969
+ id: z.optional(z.string()),
970
+ name: z.optional(z.string()),
971
+ family: z.optional(z.string()),
972
+ release_date: z.optional(z.string()),
973
+ attachment: z.optional(z.boolean()),
974
+ reasoning: z.optional(z.boolean()),
975
+ temperature: z.optional(z.boolean()),
976
+ tool_call: z.optional(z.boolean()),
977
+ interleaved: z.optional(z.union([
978
+ z.literal(true),
979
+ z.object({
980
+ field: z.enum(['reasoning_content', 'reasoning_details'])
981
+ })
982
+ ])),
983
+ cost: z.optional(z.object({
984
+ input: z.number(),
985
+ output: z.number(),
986
+ cache_read: z.optional(z.number()),
987
+ cache_write: z.optional(z.number()),
988
+ context_over_200k: z.optional(z.object({
989
+ input: z.number(),
990
+ output: z.number(),
991
+ cache_read: z.optional(z.number()),
992
+ cache_write: z.optional(z.number())
993
+ }))
994
+ })),
995
+ limit: z.optional(z.object({
996
+ context: z.number(),
997
+ input: z.optional(z.number()),
998
+ output: z.number()
999
+ })),
1000
+ modalities: z.optional(z.object({
1001
+ input: z.array(z.enum([
1002
+ 'text',
1003
+ 'audio',
1004
+ 'image',
1005
+ 'video',
1006
+ 'pdf'
1007
+ ])),
1008
+ output: z.array(z.enum([
1009
+ 'text',
1010
+ 'audio',
1011
+ 'image',
1012
+ 'video',
1013
+ 'pdf'
1014
+ ]))
1015
+ })),
1016
+ experimental: z.optional(z.boolean()),
1017
+ status: z.optional(z.enum([
1018
+ 'alpha',
1019
+ 'beta',
1020
+ 'deprecated'
1021
+ ])),
1022
+ options: z.optional(z.record(z.string(), z.unknown())),
1023
+ headers: z.optional(z.record(z.string(), z.string())),
1024
+ provider: z.optional(z.object({
1025
+ npm: z.string()
1026
+ })),
1027
+ variants: z.optional(z.record(z.string(), z.object({
1028
+ disabled: z.optional(z.boolean())
1029
+ })))
1030
+ }))),
1031
+ whitelist: z.optional(z.array(z.string())),
1032
+ blacklist: z.optional(z.array(z.string())),
1033
+ options: z.optional(z.object({
1034
+ apiKey: z.optional(z.string()),
1035
+ baseURL: z.optional(z.string()),
1036
+ enterpriseUrl: z.optional(z.string()),
1037
+ setCacheKey: z.optional(z.boolean()),
1038
+ timeout: z.optional(z.union([
1039
+ z.int().gt(0).lte(9007199254740991),
1040
+ z.literal(false)
1041
+ ]))
1042
+ }))
1043
+ });
1044
+ export const zMcpLocalConfig = z.object({
1045
+ type: z.literal('local'),
1046
+ command: z.array(z.string()),
1047
+ environment: z.optional(z.record(z.string(), z.string())),
1048
+ enabled: z.optional(z.boolean()),
1049
+ timeout: z.optional(z.int().gt(0).lte(9007199254740991))
1050
+ });
1051
+ export const zMcpOAuthConfig = z.object({
1052
+ clientId: z.optional(z.string()),
1053
+ clientSecret: z.optional(z.string()),
1054
+ scope: z.optional(z.string()),
1055
+ redirectUri: z.optional(z.string())
1056
+ });
1057
+ export const zMcpRemoteConfig = z.object({
1058
+ type: z.literal('remote'),
1059
+ url: z.string(),
1060
+ enabled: z.optional(z.boolean()),
1061
+ headers: z.optional(z.record(z.string(), z.string())),
1062
+ oauth: z.optional(z.union([
1063
+ zMcpOAuthConfig,
1064
+ z.literal(false)
1065
+ ])),
1066
+ timeout: z.optional(z.int().gt(0).lte(9007199254740991))
1067
+ });
1068
+ /**
1069
+ * @deprecated Always uses stretch layout.
1070
+ */
1071
+ export const zLayoutConfig = z.enum(['auto', 'stretch']);
1072
+ export const zConfig = z.object({
1073
+ $schema: z.optional(z.string()),
1074
+ theme: z.optional(z.string()),
1075
+ keybinds: z.optional(zKeybindsConfig),
1076
+ logLevel: z.optional(zLogLevel),
1077
+ tui: z.optional(z.object({
1078
+ scroll_speed: z.optional(z.number().gte(0.001)),
1079
+ scroll_acceleration: z.optional(z.object({
1080
+ enabled: z.boolean()
1081
+ })),
1082
+ diff_style: z.optional(z.enum(['auto', 'stacked']))
1083
+ })),
1084
+ server: z.optional(zServerConfig),
1085
+ command: z.optional(z.record(z.string(), z.object({
1086
+ template: z.string(),
1087
+ description: z.optional(z.string()),
1088
+ agent: z.optional(z.string()),
1089
+ model: z.optional(z.string()),
1090
+ subtask: z.optional(z.boolean())
1091
+ }))),
1092
+ watcher: z.optional(z.object({
1093
+ ignore: z.optional(z.array(z.string()))
1094
+ })),
1095
+ plugin: z.optional(z.array(z.string())),
1096
+ snapshot: z.optional(z.boolean()),
1097
+ share: z.optional(z.enum([
1098
+ 'manual',
1099
+ 'auto',
1100
+ 'disabled'
1101
+ ])),
1102
+ autoshare: z.optional(z.boolean()),
1103
+ autoupdate: z.optional(z.union([
1104
+ z.boolean(),
1105
+ z.literal('notify')
1106
+ ])),
1107
+ disabled_providers: z.optional(z.array(z.string())),
1108
+ enabled_providers: z.optional(z.array(z.string())),
1109
+ model: z.optional(z.string()),
1110
+ small_model: z.optional(z.string()),
1111
+ default_agent: z.optional(z.string()),
1112
+ username: z.optional(z.string()),
1113
+ mode: z.optional(z.object({
1114
+ build: z.optional(zAgentConfig),
1115
+ plan: z.optional(zAgentConfig)
1116
+ })),
1117
+ agent: z.optional(z.object({
1118
+ plan: z.optional(zAgentConfig),
1119
+ build: z.optional(zAgentConfig),
1120
+ general: z.optional(zAgentConfig),
1121
+ explore: z.optional(zAgentConfig),
1122
+ title: z.optional(zAgentConfig),
1123
+ summary: z.optional(zAgentConfig),
1124
+ compaction: z.optional(zAgentConfig)
1125
+ })),
1126
+ provider: z.optional(z.record(z.string(), zProviderConfig)),
1127
+ mcp: z.optional(z.record(z.string(), z.union([
1128
+ z.union([
1129
+ zMcpLocalConfig,
1130
+ zMcpRemoteConfig
1131
+ ]),
1132
+ z.object({
1133
+ enabled: z.boolean()
1134
+ })
1135
+ ]))),
1136
+ formatter: z.optional(z.union([
1137
+ z.literal(false),
1138
+ z.record(z.string(), z.object({
1139
+ disabled: z.optional(z.boolean()),
1140
+ command: z.optional(z.array(z.string())),
1141
+ environment: z.optional(z.record(z.string(), z.string())),
1142
+ extensions: z.optional(z.array(z.string()))
1143
+ }))
1144
+ ])),
1145
+ lsp: z.optional(z.union([
1146
+ z.literal(false),
1147
+ z.record(z.string(), z.union([
1148
+ z.object({
1149
+ disabled: z.literal(true)
1150
+ }),
1151
+ z.object({
1152
+ command: z.array(z.string()),
1153
+ extensions: z.optional(z.array(z.string())),
1154
+ disabled: z.optional(z.boolean()),
1155
+ env: z.optional(z.record(z.string(), z.string())),
1156
+ initialization: z.optional(z.record(z.string(), z.unknown()))
1157
+ })
1158
+ ]))
1159
+ ])),
1160
+ instructions: z.optional(z.array(z.string())),
1161
+ layout: z.optional(zLayoutConfig),
1162
+ permission: z.optional(zPermissionConfig),
1163
+ tools: z.optional(z.record(z.string(), z.boolean())),
1164
+ enterprise: z.optional(z.object({
1165
+ url: z.optional(z.string())
1166
+ })),
1167
+ compaction: z.optional(z.object({
1168
+ auto: z.optional(z.boolean()),
1169
+ prune: z.optional(z.boolean())
1170
+ })),
1171
+ experimental: z.optional(z.object({
1172
+ hook: z.optional(z.object({
1173
+ file_edited: z.optional(z.record(z.string(), z.array(z.object({
1174
+ command: z.array(z.string()),
1175
+ environment: z.optional(z.record(z.string(), z.string()))
1176
+ })))),
1177
+ session_completed: z.optional(z.array(z.object({
1178
+ command: z.array(z.string()),
1179
+ environment: z.optional(z.record(z.string(), z.string()))
1180
+ })))
1181
+ })),
1182
+ chatMaxRetries: z.optional(z.number()),
1183
+ disable_paste_summary: z.optional(z.boolean()),
1184
+ batch_tool: z.optional(z.boolean()),
1185
+ openTelemetry: z.optional(z.boolean()),
1186
+ primary_tools: z.optional(z.array(z.string())),
1187
+ continue_loop_on_deny: z.optional(z.boolean()),
1188
+ mcp_timeout: z.optional(z.int().gt(0).lte(9007199254740991))
1189
+ }))
1190
+ });
1191
+ export const zToolIds = z.array(z.string());
1192
+ export const zToolListItem = z.object({
1193
+ id: z.string(),
1194
+ description: z.string(),
1195
+ parameters: z.unknown()
1196
+ });
1197
+ export const zToolList = z.array(zToolListItem);
1198
+ export const zPath = z.object({
1199
+ home: z.string(),
1200
+ state: z.string(),
1201
+ config: z.string(),
1202
+ worktree: z.string(),
1203
+ directory: z.string()
1204
+ });
1205
+ export const zWorktree = z.object({
1206
+ name: z.string(),
1207
+ branch: z.string(),
1208
+ directory: z.string()
1209
+ });
1210
+ export const zWorktreeCreateInput = z.object({
1211
+ name: z.optional(z.string()),
1212
+ startCommand: z.optional(z.string())
1213
+ });
1214
+ export const zVcsInfo = z.object({
1215
+ branch: z.string()
1216
+ });
1217
+ export const zTextPartInput = z.object({
1218
+ id: z.optional(z.string()),
1219
+ type: z.literal('text'),
1220
+ text: z.string(),
1221
+ synthetic: z.optional(z.boolean()),
1222
+ ignored: z.optional(z.boolean()),
1223
+ time: z.optional(z.object({
1224
+ start: z.number(),
1225
+ end: z.optional(z.number())
1226
+ })),
1227
+ metadata: z.optional(z.record(z.string(), z.unknown()))
1228
+ });
1229
+ export const zFilePartInput = z.object({
1230
+ id: z.optional(z.string()),
1231
+ type: z.literal('file'),
1232
+ mime: z.string(),
1233
+ filename: z.optional(z.string()),
1234
+ url: z.string(),
1235
+ source: z.optional(zFilePartSource)
1236
+ });
1237
+ export const zAgentPartInput = z.object({
1238
+ id: z.optional(z.string()),
1239
+ type: z.literal('agent'),
1240
+ name: z.string(),
1241
+ source: z.optional(z.object({
1242
+ value: z.string(),
1243
+ start: z.int().gte(-9007199254740991).lte(9007199254740991),
1244
+ end: z.int().gte(-9007199254740991).lte(9007199254740991)
1245
+ }))
1246
+ });
1247
+ export const zSubtaskPartInput = z.object({
1248
+ id: z.optional(z.string()),
1249
+ type: z.literal('subtask'),
1250
+ prompt: z.string(),
1251
+ description: z.string(),
1252
+ agent: z.string(),
1253
+ model: z.optional(z.object({
1254
+ providerID: z.string(),
1255
+ modelID: z.string()
1256
+ })),
1257
+ command: z.optional(z.string())
1258
+ });
1259
+ export const zCommand = z.object({
1260
+ name: z.string(),
1261
+ description: z.optional(z.string()),
1262
+ agent: z.optional(z.string()),
1263
+ model: z.optional(z.string()),
1264
+ mcp: z.optional(z.boolean()),
1265
+ template: z.string(),
1266
+ subtask: z.optional(z.boolean()),
1267
+ hints: z.array(z.string())
1268
+ });
1269
+ export const zModel = z.object({
1270
+ id: z.string(),
1271
+ providerID: z.string(),
1272
+ api: z.object({
1273
+ id: z.string(),
1274
+ url: z.string(),
1275
+ npm: z.string()
1276
+ }),
1277
+ name: z.string(),
1278
+ family: z.optional(z.string()),
1279
+ capabilities: z.object({
1280
+ temperature: z.boolean(),
1281
+ reasoning: z.boolean(),
1282
+ attachment: z.boolean(),
1283
+ toolcall: z.boolean(),
1284
+ input: z.object({
1285
+ text: z.boolean(),
1286
+ audio: z.boolean(),
1287
+ image: z.boolean(),
1288
+ video: z.boolean(),
1289
+ pdf: z.boolean()
1290
+ }),
1291
+ output: z.object({
1292
+ text: z.boolean(),
1293
+ audio: z.boolean(),
1294
+ image: z.boolean(),
1295
+ video: z.boolean(),
1296
+ pdf: z.boolean()
1297
+ }),
1298
+ interleaved: z.union([
1299
+ z.boolean(),
1300
+ z.object({
1301
+ field: z.enum(['reasoning_content', 'reasoning_details'])
1302
+ })
1303
+ ])
1304
+ }),
1305
+ cost: z.object({
1306
+ input: z.number(),
1307
+ output: z.number(),
1308
+ cache: z.object({
1309
+ read: z.number(),
1310
+ write: z.number()
1311
+ }),
1312
+ experimentalOver200K: z.optional(z.object({
1313
+ input: z.number(),
1314
+ output: z.number(),
1315
+ cache: z.object({
1316
+ read: z.number(),
1317
+ write: z.number()
1318
+ })
1319
+ }))
1320
+ }),
1321
+ limit: z.object({
1322
+ context: z.number(),
1323
+ input: z.optional(z.number()),
1324
+ output: z.number()
1325
+ }),
1326
+ status: z.enum([
1327
+ 'alpha',
1328
+ 'beta',
1329
+ 'deprecated',
1330
+ 'active'
1331
+ ]),
1332
+ options: z.record(z.string(), z.unknown()),
1333
+ headers: z.record(z.string(), z.string()),
1334
+ release_date: z.string(),
1335
+ variants: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())))
1336
+ });
1337
+ export const zProvider = z.object({
1338
+ id: z.string(),
1339
+ name: z.string(),
1340
+ source: z.enum([
1341
+ 'env',
1342
+ 'config',
1343
+ 'custom',
1344
+ 'api'
1345
+ ]),
1346
+ env: z.array(z.string()),
1347
+ key: z.optional(z.string()),
1348
+ options: z.record(z.string(), z.unknown()),
1349
+ models: z.record(z.string(), zModel)
1350
+ });
1351
+ export const zProviderAuthMethod = z.object({
1352
+ type: z.union([
1353
+ z.literal('oauth'),
1354
+ z.literal('api')
1355
+ ]),
1356
+ label: z.string()
1357
+ });
1358
+ export const zProviderAuthAuthorization = z.object({
1359
+ url: z.string(),
1360
+ method: z.union([
1361
+ z.literal('auto'),
1362
+ z.literal('code')
1363
+ ]),
1364
+ instructions: z.string()
1365
+ });
1366
+ export const zSymbol = z.object({
1367
+ name: z.string(),
1368
+ kind: z.number(),
1369
+ location: z.object({
1370
+ uri: z.string(),
1371
+ range: zRange
1372
+ })
1373
+ });
1374
+ export const zFileNode = z.object({
1375
+ name: z.string(),
1376
+ path: z.string(),
1377
+ absolute: z.string(),
1378
+ type: z.enum(['file', 'directory']),
1379
+ ignored: z.boolean()
1380
+ });
1381
+ export const zFileContent = z.object({
1382
+ type: z.literal('text'),
1383
+ content: z.string(),
1384
+ diff: z.optional(z.string()),
1385
+ patch: z.optional(z.object({
1386
+ oldFileName: z.string(),
1387
+ newFileName: z.string(),
1388
+ oldHeader: z.optional(z.string()),
1389
+ newHeader: z.optional(z.string()),
1390
+ hunks: z.array(z.object({
1391
+ oldStart: z.number(),
1392
+ oldLines: z.number(),
1393
+ newStart: z.number(),
1394
+ newLines: z.number(),
1395
+ lines: z.array(z.string())
1396
+ })),
1397
+ index: z.optional(z.string())
1398
+ })),
1399
+ encoding: z.optional(z.literal('base64')),
1400
+ mimeType: z.optional(z.string())
1401
+ });
1402
+ export const zFile = z.object({
1403
+ path: z.string(),
1404
+ added: z.int().gte(-9007199254740991).lte(9007199254740991),
1405
+ removed: z.int().gte(-9007199254740991).lte(9007199254740991),
1406
+ status: z.enum([
1407
+ 'added',
1408
+ 'deleted',
1409
+ 'modified'
1410
+ ])
1411
+ });
1412
+ export const zAgent = z.object({
1413
+ name: z.string(),
1414
+ description: z.optional(z.string()),
1415
+ mode: z.enum([
1416
+ 'subagent',
1417
+ 'primary',
1418
+ 'all'
1419
+ ]),
1420
+ native: z.optional(z.boolean()),
1421
+ hidden: z.optional(z.boolean()),
1422
+ topP: z.optional(z.number()),
1423
+ temperature: z.optional(z.number()),
1424
+ color: z.optional(z.string()),
1425
+ permission: zPermissionRuleset,
1426
+ model: z.optional(z.object({
1427
+ modelID: z.string(),
1428
+ providerID: z.string()
1429
+ })),
1430
+ prompt: z.optional(z.string()),
1431
+ options: z.record(z.string(), z.unknown()),
1432
+ steps: z.optional(z.int().gt(0).lte(9007199254740991))
1433
+ });
1434
+ export const zMcpStatusConnected = z.object({
1435
+ status: z.literal('connected')
1436
+ });
1437
+ export const zMcpStatusDisabled = z.object({
1438
+ status: z.literal('disabled')
1439
+ });
1440
+ export const zMcpStatusFailed = z.object({
1441
+ status: z.literal('failed'),
1442
+ error: z.string()
1443
+ });
1444
+ export const zMcpStatusNeedsAuth = z.object({
1445
+ status: z.literal('needs_auth')
1446
+ });
1447
+ export const zMcpStatusNeedsClientRegistration = z.object({
1448
+ status: z.literal('needs_client_registration'),
1449
+ error: z.string()
1450
+ });
1451
+ export const zMcpStatus = z.union([
1452
+ zMcpStatusConnected,
1453
+ zMcpStatusDisabled,
1454
+ zMcpStatusFailed,
1455
+ zMcpStatusNeedsAuth,
1456
+ zMcpStatusNeedsClientRegistration
1457
+ ]);
1458
+ export const zMcpResource = z.object({
1459
+ name: z.string(),
1460
+ uri: z.string(),
1461
+ description: z.optional(z.string()),
1462
+ mimeType: z.optional(z.string()),
1463
+ client: z.string()
1464
+ });
1465
+ export const zLspStatus = z.object({
1466
+ id: z.string(),
1467
+ name: z.string(),
1468
+ root: z.string(),
1469
+ status: z.union([
1470
+ z.literal('connected'),
1471
+ z.literal('error')
1472
+ ])
1473
+ });
1474
+ export const zFormatterStatus = z.object({
1475
+ name: z.string(),
1476
+ extensions: z.array(z.string()),
1477
+ enabled: z.boolean()
1478
+ });
1479
+ export const zOAuth = z.object({
1480
+ type: z.literal('oauth'),
1481
+ refresh: z.string(),
1482
+ access: z.string(),
1483
+ expires: z.number(),
1484
+ accountId: z.optional(z.string()),
1485
+ enterpriseUrl: z.optional(z.string())
1486
+ });
1487
+ export const zApiAuth = z.object({
1488
+ type: z.literal('api'),
1489
+ key: z.string()
1490
+ });
1491
+ export const zWellKnownAuth = z.object({
1492
+ type: z.literal('wellknown'),
1493
+ key: z.string(),
1494
+ token: z.string()
1495
+ });
1496
+ export const zAuth = z.union([
1497
+ zOAuth,
1498
+ zApiAuth,
1499
+ zWellKnownAuth
1500
+ ]);
1501
+ export const zGlobalHealthData = z.object({
1502
+ body: z.optional(z.never()),
1503
+ path: z.optional(z.never()),
1504
+ query: z.optional(z.never())
1505
+ });
1506
+ /**
1507
+ * Health information
1508
+ */
1509
+ export const zGlobalHealthResponse = z.object({
1510
+ healthy: z.literal(true),
1511
+ version: z.string()
1512
+ });
1513
+ export const zGlobalEventData = z.object({
1514
+ body: z.optional(z.never()),
1515
+ path: z.optional(z.never()),
1516
+ query: z.optional(z.never())
1517
+ });
1518
+ /**
1519
+ * Event stream
1520
+ */
1521
+ export const zGlobalEventResponse = zGlobalEvent;
1522
+ export const zGlobalDisposeData = z.object({
1523
+ body: z.optional(z.never()),
1524
+ path: z.optional(z.never()),
1525
+ query: z.optional(z.never())
1526
+ });
1527
+ /**
1528
+ * Global disposed
1529
+ */
1530
+ export const zGlobalDisposeResponse = z.boolean();
1531
+ export const zProjectListData = z.object({
1532
+ body: z.optional(z.never()),
1533
+ path: z.optional(z.never()),
1534
+ query: z.optional(z.object({
1535
+ directory: z.optional(z.string())
1536
+ }))
1537
+ });
1538
+ /**
1539
+ * List of projects
1540
+ */
1541
+ export const zProjectListResponse = z.array(zProject);
1542
+ export const zProjectCurrentData = z.object({
1543
+ body: z.optional(z.never()),
1544
+ path: z.optional(z.never()),
1545
+ query: z.optional(z.object({
1546
+ directory: z.optional(z.string())
1547
+ }))
1548
+ });
1549
+ /**
1550
+ * Current project information
1551
+ */
1552
+ export const zProjectCurrentResponse = zProject;
1553
+ export const zProjectUpdateData = z.object({
1554
+ body: z.optional(z.object({
1555
+ name: z.optional(z.string()),
1556
+ icon: z.optional(z.object({
1557
+ url: z.optional(z.string()),
1558
+ color: z.optional(z.string())
1559
+ }))
1560
+ })),
1561
+ path: z.object({
1562
+ projectID: z.string()
1563
+ }),
1564
+ query: z.optional(z.object({
1565
+ directory: z.optional(z.string())
1566
+ }))
1567
+ });
1568
+ /**
1569
+ * Updated project information
1570
+ */
1571
+ export const zProjectUpdateResponse = zProject;
1572
+ export const zPtyListData = z.object({
1573
+ body: z.optional(z.never()),
1574
+ path: z.optional(z.never()),
1575
+ query: z.optional(z.object({
1576
+ directory: z.optional(z.string())
1577
+ }))
1578
+ });
1579
+ /**
1580
+ * List of sessions
1581
+ */
1582
+ export const zPtyListResponse = z.array(zPty);
1583
+ export const zPtyCreateData = z.object({
1584
+ body: z.optional(z.object({
1585
+ command: z.optional(z.string()),
1586
+ args: z.optional(z.array(z.string())),
1587
+ cwd: z.optional(z.string()),
1588
+ title: z.optional(z.string()),
1589
+ env: z.optional(z.record(z.string(), z.string()))
1590
+ })),
1591
+ path: z.optional(z.never()),
1592
+ query: z.optional(z.object({
1593
+ directory: z.optional(z.string())
1594
+ }))
1595
+ });
1596
+ /**
1597
+ * Created session
1598
+ */
1599
+ export const zPtyCreateResponse = zPty;
1600
+ export const zPtyRemoveData = z.object({
1601
+ body: z.optional(z.never()),
1602
+ path: z.object({
1603
+ ptyID: z.string()
1604
+ }),
1605
+ query: z.optional(z.object({
1606
+ directory: z.optional(z.string())
1607
+ }))
1608
+ });
1609
+ /**
1610
+ * Session removed
1611
+ */
1612
+ export const zPtyRemoveResponse = z.boolean();
1613
+ export const zPtyGetData = z.object({
1614
+ body: z.optional(z.never()),
1615
+ path: z.object({
1616
+ ptyID: z.string()
1617
+ }),
1618
+ query: z.optional(z.object({
1619
+ directory: z.optional(z.string())
1620
+ }))
1621
+ });
1622
+ /**
1623
+ * Session info
1624
+ */
1625
+ export const zPtyGetResponse = zPty;
1626
+ export const zPtyUpdateData = z.object({
1627
+ body: z.optional(z.object({
1628
+ title: z.optional(z.string()),
1629
+ size: z.optional(z.object({
1630
+ rows: z.number(),
1631
+ cols: z.number()
1632
+ }))
1633
+ })),
1634
+ path: z.object({
1635
+ ptyID: z.string()
1636
+ }),
1637
+ query: z.optional(z.object({
1638
+ directory: z.optional(z.string())
1639
+ }))
1640
+ });
1641
+ /**
1642
+ * Updated session
1643
+ */
1644
+ export const zPtyUpdateResponse = zPty;
1645
+ export const zPtyConnectData = z.object({
1646
+ body: z.optional(z.never()),
1647
+ path: z.object({
1648
+ ptyID: z.string()
1649
+ }),
1650
+ query: z.optional(z.object({
1651
+ directory: z.optional(z.string())
1652
+ }))
1653
+ });
1654
+ /**
1655
+ * Connected session
1656
+ */
1657
+ export const zPtyConnectResponse = z.boolean();
1658
+ export const zConfigGetData = z.object({
1659
+ body: z.optional(z.never()),
1660
+ path: z.optional(z.never()),
1661
+ query: z.optional(z.object({
1662
+ directory: z.optional(z.string())
1663
+ }))
1664
+ });
1665
+ /**
1666
+ * Get config info
1667
+ */
1668
+ export const zConfigGetResponse = zConfig;
1669
+ export const zConfigUpdateData = z.object({
1670
+ body: z.optional(zConfig),
1671
+ path: z.optional(z.never()),
1672
+ query: z.optional(z.object({
1673
+ directory: z.optional(z.string())
1674
+ }))
1675
+ });
1676
+ /**
1677
+ * Successfully updated config
1678
+ */
1679
+ export const zConfigUpdateResponse = zConfig;
1680
+ export const zToolIdsData = z.object({
1681
+ body: z.optional(z.never()),
1682
+ path: z.optional(z.never()),
1683
+ query: z.optional(z.object({
1684
+ directory: z.optional(z.string())
1685
+ }))
1686
+ });
1687
+ /**
1688
+ * Tool IDs
1689
+ */
1690
+ export const zToolIdsResponse = zToolIds;
1691
+ export const zToolListData = z.object({
1692
+ body: z.optional(z.never()),
1693
+ path: z.optional(z.never()),
1694
+ query: z.object({
1695
+ directory: z.optional(z.string()),
1696
+ provider: z.string(),
1697
+ model: z.string()
1698
+ })
1699
+ });
1700
+ /**
1701
+ * Tools
1702
+ */
1703
+ export const zToolListResponse = zToolList;
1704
+ export const zInstanceDisposeData = z.object({
1705
+ body: z.optional(z.never()),
1706
+ path: z.optional(z.never()),
1707
+ query: z.optional(z.object({
1708
+ directory: z.optional(z.string())
1709
+ }))
1710
+ });
1711
+ /**
1712
+ * Instance disposed
1713
+ */
1714
+ export const zInstanceDisposeResponse = z.boolean();
1715
+ export const zPathGetData = z.object({
1716
+ body: z.optional(z.never()),
1717
+ path: z.optional(z.never()),
1718
+ query: z.optional(z.object({
1719
+ directory: z.optional(z.string())
1720
+ }))
1721
+ });
1722
+ /**
1723
+ * Path
1724
+ */
1725
+ export const zPathGetResponse = zPath;
1726
+ export const zWorktreeListData = z.object({
1727
+ body: z.optional(z.never()),
1728
+ path: z.optional(z.never()),
1729
+ query: z.optional(z.object({
1730
+ directory: z.optional(z.string())
1731
+ }))
1732
+ });
1733
+ /**
1734
+ * List of worktree directories
1735
+ */
1736
+ export const zWorktreeListResponse = z.array(z.string());
1737
+ export const zWorktreeCreateData = z.object({
1738
+ body: z.optional(zWorktreeCreateInput),
1739
+ path: z.optional(z.never()),
1740
+ query: z.optional(z.object({
1741
+ directory: z.optional(z.string())
1742
+ }))
1743
+ });
1744
+ /**
1745
+ * Worktree created
1746
+ */
1747
+ export const zWorktreeCreateResponse = zWorktree;
1748
+ export const zVcsGetData = z.object({
1749
+ body: z.optional(z.never()),
1750
+ path: z.optional(z.never()),
1751
+ query: z.optional(z.object({
1752
+ directory: z.optional(z.string())
1753
+ }))
1754
+ });
1755
+ /**
1756
+ * VCS info
1757
+ */
1758
+ export const zVcsGetResponse = zVcsInfo;
1759
+ export const zSessionListData = z.object({
1760
+ body: z.optional(z.never()),
1761
+ path: z.optional(z.never()),
1762
+ query: z.optional(z.object({
1763
+ directory: z.optional(z.string()),
1764
+ roots: z.optional(z.boolean()),
1765
+ start: z.optional(z.number()),
1766
+ search: z.optional(z.string()),
1767
+ limit: z.optional(z.number())
1768
+ }))
1769
+ });
1770
+ /**
1771
+ * List of sessions
1772
+ */
1773
+ export const zSessionListResponse = z.array(zSession);
1774
+ export const zSessionCreateData = z.object({
1775
+ body: z.optional(z.object({
1776
+ parentID: z.optional(z.string().regex(/^ses.*/)),
1777
+ title: z.optional(z.string()),
1778
+ permission: z.optional(zPermissionRuleset)
1779
+ })),
1780
+ path: z.optional(z.never()),
1781
+ query: z.optional(z.object({
1782
+ directory: z.optional(z.string())
1783
+ }))
1784
+ });
1785
+ /**
1786
+ * Successfully created session
1787
+ */
1788
+ export const zSessionCreateResponse = zSession;
1789
+ export const zSessionStatusData = z.object({
1790
+ body: z.optional(z.never()),
1791
+ path: z.optional(z.never()),
1792
+ query: z.optional(z.object({
1793
+ directory: z.optional(z.string())
1794
+ }))
1795
+ });
1796
+ /**
1797
+ * Get session status
1798
+ */
1799
+ export const zSessionStatusResponse = z.record(z.string(), zSessionStatus);
1800
+ export const zSessionDeleteData = z.object({
1801
+ body: z.optional(z.never()),
1802
+ path: z.object({
1803
+ sessionID: z.string().regex(/^ses.*/)
1804
+ }),
1805
+ query: z.optional(z.object({
1806
+ directory: z.optional(z.string())
1807
+ }))
1808
+ });
1809
+ /**
1810
+ * Successfully deleted session
1811
+ */
1812
+ export const zSessionDeleteResponse = z.boolean();
1813
+ export const zSessionGetData = z.object({
1814
+ body: z.optional(z.never()),
1815
+ path: z.object({
1816
+ sessionID: z.string().regex(/^ses.*/)
1817
+ }),
1818
+ query: z.optional(z.object({
1819
+ directory: z.optional(z.string())
1820
+ }))
1821
+ });
1822
+ /**
1823
+ * Get session
1824
+ */
1825
+ export const zSessionGetResponse = zSession;
1826
+ export const zSessionUpdateData = z.object({
1827
+ body: z.optional(z.object({
1828
+ title: z.optional(z.string()),
1829
+ time: z.optional(z.object({
1830
+ archived: z.optional(z.number())
1831
+ }))
1832
+ })),
1833
+ path: z.object({
1834
+ sessionID: z.string()
1835
+ }),
1836
+ query: z.optional(z.object({
1837
+ directory: z.optional(z.string())
1838
+ }))
1839
+ });
1840
+ /**
1841
+ * Successfully updated session
1842
+ */
1843
+ export const zSessionUpdateResponse = zSession;
1844
+ export const zSessionChildrenData = z.object({
1845
+ body: z.optional(z.never()),
1846
+ path: z.object({
1847
+ sessionID: z.string().regex(/^ses.*/)
1848
+ }),
1849
+ query: z.optional(z.object({
1850
+ directory: z.optional(z.string())
1851
+ }))
1852
+ });
1853
+ /**
1854
+ * List of children
1855
+ */
1856
+ export const zSessionChildrenResponse = z.array(zSession);
1857
+ export const zSessionTodoData = z.object({
1858
+ body: z.optional(z.never()),
1859
+ path: z.object({
1860
+ sessionID: z.string()
1861
+ }),
1862
+ query: z.optional(z.object({
1863
+ directory: z.optional(z.string())
1864
+ }))
1865
+ });
1866
+ /**
1867
+ * Todo list
1868
+ */
1869
+ export const zSessionTodoResponse = z.array(zTodo);
1870
+ export const zSessionInitData = z.object({
1871
+ body: z.optional(z.object({
1872
+ modelID: z.string(),
1873
+ providerID: z.string(),
1874
+ messageID: z.string().regex(/^msg.*/)
1875
+ })),
1876
+ path: z.object({
1877
+ sessionID: z.string()
1878
+ }),
1879
+ query: z.optional(z.object({
1880
+ directory: z.optional(z.string())
1881
+ }))
1882
+ });
1883
+ /**
1884
+ * 200
1885
+ */
1886
+ export const zSessionInitResponse = z.boolean();
1887
+ export const zSessionForkData = z.object({
1888
+ body: z.optional(z.object({
1889
+ messageID: z.optional(z.string().regex(/^msg.*/))
1890
+ })),
1891
+ path: z.object({
1892
+ sessionID: z.string().regex(/^ses.*/)
1893
+ }),
1894
+ query: z.optional(z.object({
1895
+ directory: z.optional(z.string())
1896
+ }))
1897
+ });
1898
+ /**
1899
+ * 200
1900
+ */
1901
+ export const zSessionForkResponse = zSession;
1902
+ export const zSessionAbortData = z.object({
1903
+ body: z.optional(z.never()),
1904
+ path: z.object({
1905
+ sessionID: z.string()
1906
+ }),
1907
+ query: z.optional(z.object({
1908
+ directory: z.optional(z.string())
1909
+ }))
1910
+ });
1911
+ /**
1912
+ * Aborted session
1913
+ */
1914
+ export const zSessionAbortResponse = z.boolean();
1915
+ export const zSessionUnshareData = z.object({
1916
+ body: z.optional(z.never()),
1917
+ path: z.object({
1918
+ sessionID: z.string().regex(/^ses.*/)
1919
+ }),
1920
+ query: z.optional(z.object({
1921
+ directory: z.optional(z.string())
1922
+ }))
1923
+ });
1924
+ /**
1925
+ * Successfully unshared session
1926
+ */
1927
+ export const zSessionUnshareResponse = zSession;
1928
+ export const zSessionShareData = z.object({
1929
+ body: z.optional(z.never()),
1930
+ path: z.object({
1931
+ sessionID: z.string()
1932
+ }),
1933
+ query: z.optional(z.object({
1934
+ directory: z.optional(z.string())
1935
+ }))
1936
+ });
1937
+ /**
1938
+ * Successfully shared session
1939
+ */
1940
+ export const zSessionShareResponse = zSession;
1941
+ export const zSessionDiffData = z.object({
1942
+ body: z.optional(z.never()),
1943
+ path: z.object({
1944
+ sessionID: z.string()
1945
+ }),
1946
+ query: z.optional(z.object({
1947
+ directory: z.optional(z.string()),
1948
+ messageID: z.optional(z.string().regex(/^msg.*/))
1949
+ }))
1950
+ });
1951
+ /**
1952
+ * List of diffs
1953
+ */
1954
+ export const zSessionDiffResponse = z.array(zFileDiff);
1955
+ export const zSessionSummarizeData = z.object({
1956
+ body: z.optional(z.object({
1957
+ providerID: z.string(),
1958
+ modelID: z.string(),
1959
+ auto: z.optional(z.boolean()).default(false)
1960
+ })),
1961
+ path: z.object({
1962
+ sessionID: z.string()
1963
+ }),
1964
+ query: z.optional(z.object({
1965
+ directory: z.optional(z.string())
1966
+ }))
1967
+ });
1968
+ /**
1969
+ * Summarized session
1970
+ */
1971
+ export const zSessionSummarizeResponse = z.boolean();
1972
+ export const zSessionMessagesData = z.object({
1973
+ body: z.optional(z.never()),
1974
+ path: z.object({
1975
+ sessionID: z.string()
1976
+ }),
1977
+ query: z.optional(z.object({
1978
+ directory: z.optional(z.string()),
1979
+ limit: z.optional(z.number())
1980
+ }))
1981
+ });
1982
+ /**
1983
+ * List of messages
1984
+ */
1985
+ export const zSessionMessagesResponse = z.array(z.object({
1986
+ info: zMessage,
1987
+ parts: z.array(zPart)
1988
+ }));
1989
+ export const zSessionPromptData = z.object({
1990
+ body: z.optional(z.object({
1991
+ messageID: z.optional(z.string().regex(/^msg.*/)),
1992
+ model: z.optional(z.object({
1993
+ providerID: z.string(),
1994
+ modelID: z.string()
1995
+ })),
1996
+ agent: z.optional(z.string()),
1997
+ noReply: z.optional(z.boolean()),
1998
+ tools: z.optional(z.record(z.string(), z.boolean())),
1999
+ system: z.optional(z.string()),
2000
+ variant: z.optional(z.string()),
2001
+ parts: z.array(z.union([
2002
+ zTextPartInput,
2003
+ zFilePartInput,
2004
+ zAgentPartInput,
2005
+ zSubtaskPartInput
2006
+ ]))
2007
+ })),
2008
+ path: z.object({
2009
+ sessionID: z.string()
2010
+ }),
2011
+ query: z.optional(z.object({
2012
+ directory: z.optional(z.string())
2013
+ }))
2014
+ });
2015
+ /**
2016
+ * Created message
2017
+ */
2018
+ export const zSessionPromptResponse = z.object({
2019
+ info: zAssistantMessage,
2020
+ parts: z.array(zPart)
2021
+ });
2022
+ export const zSessionMessageData = z.object({
2023
+ body: z.optional(z.never()),
2024
+ path: z.object({
2025
+ sessionID: z.string(),
2026
+ messageID: z.string()
2027
+ }),
2028
+ query: z.optional(z.object({
2029
+ directory: z.optional(z.string())
2030
+ }))
2031
+ });
2032
+ /**
2033
+ * Message
2034
+ */
2035
+ export const zSessionMessageResponse = z.object({
2036
+ info: zMessage,
2037
+ parts: z.array(zPart)
2038
+ });
2039
+ export const zPartDeleteData = z.object({
2040
+ body: z.optional(z.never()),
2041
+ path: z.object({
2042
+ sessionID: z.string(),
2043
+ messageID: z.string(),
2044
+ partID: z.string()
2045
+ }),
2046
+ query: z.optional(z.object({
2047
+ directory: z.optional(z.string())
2048
+ }))
2049
+ });
2050
+ /**
2051
+ * Successfully deleted part
2052
+ */
2053
+ export const zPartDeleteResponse = z.boolean();
2054
+ export const zPartUpdateData = z.object({
2055
+ body: z.optional(zPart),
2056
+ path: z.object({
2057
+ sessionID: z.string(),
2058
+ messageID: z.string(),
2059
+ partID: z.string()
2060
+ }),
2061
+ query: z.optional(z.object({
2062
+ directory: z.optional(z.string())
2063
+ }))
2064
+ });
2065
+ /**
2066
+ * Successfully updated part
2067
+ */
2068
+ export const zPartUpdateResponse = zPart;
2069
+ export const zSessionPromptAsyncData = z.object({
2070
+ body: z.optional(z.object({
2071
+ messageID: z.optional(z.string().regex(/^msg.*/)),
2072
+ model: z.optional(z.object({
2073
+ providerID: z.string(),
2074
+ modelID: z.string()
2075
+ })),
2076
+ agent: z.optional(z.string()),
2077
+ noReply: z.optional(z.boolean()),
2078
+ tools: z.optional(z.record(z.string(), z.boolean())),
2079
+ system: z.optional(z.string()),
2080
+ variant: z.optional(z.string()),
2081
+ parts: z.array(z.union([
2082
+ zTextPartInput,
2083
+ zFilePartInput,
2084
+ zAgentPartInput,
2085
+ zSubtaskPartInput
2086
+ ]))
2087
+ })),
2088
+ path: z.object({
2089
+ sessionID: z.string()
2090
+ }),
2091
+ query: z.optional(z.object({
2092
+ directory: z.optional(z.string())
2093
+ }))
2094
+ });
2095
+ /**
2096
+ * Prompt accepted
2097
+ */
2098
+ export const zSessionPromptAsyncResponse = z.void();
2099
+ export const zSessionCommandData = z.object({
2100
+ body: z.optional(z.object({
2101
+ messageID: z.optional(z.string().regex(/^msg.*/)),
2102
+ agent: z.optional(z.string()),
2103
+ model: z.optional(z.string()),
2104
+ arguments: z.string(),
2105
+ command: z.string(),
2106
+ variant: z.optional(z.string()),
2107
+ parts: z.optional(z.array(z.object({
2108
+ id: z.optional(z.string()),
2109
+ type: z.literal('file'),
2110
+ mime: z.string(),
2111
+ filename: z.optional(z.string()),
2112
+ url: z.string(),
2113
+ source: z.optional(zFilePartSource)
2114
+ })))
2115
+ })),
2116
+ path: z.object({
2117
+ sessionID: z.string()
2118
+ }),
2119
+ query: z.optional(z.object({
2120
+ directory: z.optional(z.string())
2121
+ }))
2122
+ });
2123
+ /**
2124
+ * Created message
2125
+ */
2126
+ export const zSessionCommandResponse = z.object({
2127
+ info: zAssistantMessage,
2128
+ parts: z.array(zPart)
2129
+ });
2130
+ export const zSessionShellData = z.object({
2131
+ body: z.optional(z.object({
2132
+ agent: z.string(),
2133
+ model: z.optional(z.object({
2134
+ providerID: z.string(),
2135
+ modelID: z.string()
2136
+ })),
2137
+ command: z.string()
2138
+ })),
2139
+ path: z.object({
2140
+ sessionID: z.string()
2141
+ }),
2142
+ query: z.optional(z.object({
2143
+ directory: z.optional(z.string())
2144
+ }))
2145
+ });
2146
+ /**
2147
+ * Created message
2148
+ */
2149
+ export const zSessionShellResponse = zAssistantMessage;
2150
+ export const zSessionRevertData = z.object({
2151
+ body: z.optional(z.object({
2152
+ messageID: z.string().regex(/^msg.*/),
2153
+ partID: z.optional(z.string().regex(/^prt.*/))
2154
+ })),
2155
+ path: z.object({
2156
+ sessionID: z.string()
2157
+ }),
2158
+ query: z.optional(z.object({
2159
+ directory: z.optional(z.string())
2160
+ }))
2161
+ });
2162
+ /**
2163
+ * Updated session
2164
+ */
2165
+ export const zSessionRevertResponse = zSession;
2166
+ export const zSessionUnrevertData = z.object({
2167
+ body: z.optional(z.never()),
2168
+ path: z.object({
2169
+ sessionID: z.string()
2170
+ }),
2171
+ query: z.optional(z.object({
2172
+ directory: z.optional(z.string())
2173
+ }))
2174
+ });
2175
+ /**
2176
+ * Updated session
2177
+ */
2178
+ export const zSessionUnrevertResponse = zSession;
2179
+ export const zPermissionRespondData = z.object({
2180
+ body: z.optional(z.object({
2181
+ response: z.enum([
2182
+ 'once',
2183
+ 'always',
2184
+ 'reject'
2185
+ ])
2186
+ })),
2187
+ path: z.object({
2188
+ sessionID: z.string(),
2189
+ permissionID: z.string()
2190
+ }),
2191
+ query: z.optional(z.object({
2192
+ directory: z.optional(z.string())
2193
+ }))
2194
+ });
2195
+ /**
2196
+ * Permission processed successfully
2197
+ */
2198
+ export const zPermissionRespondResponse = z.boolean();
2199
+ export const zPermissionReplyData = z.object({
2200
+ body: z.optional(z.object({
2201
+ reply: z.enum([
2202
+ 'once',
2203
+ 'always',
2204
+ 'reject'
2205
+ ]),
2206
+ message: z.optional(z.string())
2207
+ })),
2208
+ path: z.object({
2209
+ requestID: z.string()
2210
+ }),
2211
+ query: z.optional(z.object({
2212
+ directory: z.optional(z.string())
2213
+ }))
2214
+ });
2215
+ /**
2216
+ * Permission processed successfully
2217
+ */
2218
+ export const zPermissionReplyResponse = z.boolean();
2219
+ export const zPermissionListData = z.object({
2220
+ body: z.optional(z.never()),
2221
+ path: z.optional(z.never()),
2222
+ query: z.optional(z.object({
2223
+ directory: z.optional(z.string())
2224
+ }))
2225
+ });
2226
+ /**
2227
+ * List of pending permissions
2228
+ */
2229
+ export const zPermissionListResponse = z.array(zPermissionRequest);
2230
+ export const zQuestionListData = z.object({
2231
+ body: z.optional(z.never()),
2232
+ path: z.optional(z.never()),
2233
+ query: z.optional(z.object({
2234
+ directory: z.optional(z.string())
2235
+ }))
2236
+ });
2237
+ /**
2238
+ * List of pending questions
2239
+ */
2240
+ export const zQuestionListResponse = z.array(zQuestionRequest);
2241
+ export const zQuestionReplyData = z.object({
2242
+ body: z.optional(z.object({
2243
+ answers: z.array(zQuestionAnswer)
2244
+ })),
2245
+ path: z.object({
2246
+ requestID: z.string()
2247
+ }),
2248
+ query: z.optional(z.object({
2249
+ directory: z.optional(z.string())
2250
+ }))
2251
+ });
2252
+ /**
2253
+ * Question answered successfully
2254
+ */
2255
+ export const zQuestionReplyResponse = z.boolean();
2256
+ export const zQuestionRejectData = z.object({
2257
+ body: z.optional(z.never()),
2258
+ path: z.object({
2259
+ requestID: z.string()
2260
+ }),
2261
+ query: z.optional(z.object({
2262
+ directory: z.optional(z.string())
2263
+ }))
2264
+ });
2265
+ /**
2266
+ * Question rejected successfully
2267
+ */
2268
+ export const zQuestionRejectResponse = z.boolean();
2269
+ export const zCommandListData = z.object({
2270
+ body: z.optional(z.never()),
2271
+ path: z.optional(z.never()),
2272
+ query: z.optional(z.object({
2273
+ directory: z.optional(z.string())
2274
+ }))
2275
+ });
2276
+ /**
2277
+ * List of commands
2278
+ */
2279
+ export const zCommandListResponse = z.array(zCommand);
2280
+ export const zConfigProvidersData = z.object({
2281
+ body: z.optional(z.never()),
2282
+ path: z.optional(z.never()),
2283
+ query: z.optional(z.object({
2284
+ directory: z.optional(z.string())
2285
+ }))
2286
+ });
2287
+ /**
2288
+ * List of providers
2289
+ */
2290
+ export const zConfigProvidersResponse = z.object({
2291
+ providers: z.array(zProvider),
2292
+ default: z.record(z.string(), z.string())
2293
+ });
2294
+ export const zProviderListData = z.object({
2295
+ body: z.optional(z.never()),
2296
+ path: z.optional(z.never()),
2297
+ query: z.optional(z.object({
2298
+ directory: z.optional(z.string())
2299
+ }))
2300
+ });
2301
+ /**
2302
+ * List of providers
2303
+ */
2304
+ export const zProviderListResponse = z.object({
2305
+ all: z.array(z.object({
2306
+ api: z.optional(z.string()),
2307
+ name: z.string(),
2308
+ env: z.array(z.string()),
2309
+ id: z.string(),
2310
+ npm: z.optional(z.string()),
2311
+ models: z.record(z.string(), z.object({
2312
+ id: z.string(),
2313
+ name: z.string(),
2314
+ family: z.optional(z.string()),
2315
+ release_date: z.string(),
2316
+ attachment: z.boolean(),
2317
+ reasoning: z.boolean(),
2318
+ temperature: z.boolean(),
2319
+ tool_call: z.boolean(),
2320
+ interleaved: z.optional(z.union([
2321
+ z.literal(true),
2322
+ z.object({
2323
+ field: z.enum(['reasoning_content', 'reasoning_details'])
2324
+ })
2325
+ ])),
2326
+ cost: z.optional(z.object({
2327
+ input: z.number(),
2328
+ output: z.number(),
2329
+ cache_read: z.optional(z.number()),
2330
+ cache_write: z.optional(z.number()),
2331
+ context_over_200k: z.optional(z.object({
2332
+ input: z.number(),
2333
+ output: z.number(),
2334
+ cache_read: z.optional(z.number()),
2335
+ cache_write: z.optional(z.number())
2336
+ }))
2337
+ })),
2338
+ limit: z.object({
2339
+ context: z.number(),
2340
+ input: z.optional(z.number()),
2341
+ output: z.number()
2342
+ }),
2343
+ modalities: z.optional(z.object({
2344
+ input: z.array(z.enum([
2345
+ 'text',
2346
+ 'audio',
2347
+ 'image',
2348
+ 'video',
2349
+ 'pdf'
2350
+ ])),
2351
+ output: z.array(z.enum([
2352
+ 'text',
2353
+ 'audio',
2354
+ 'image',
2355
+ 'video',
2356
+ 'pdf'
2357
+ ]))
2358
+ })),
2359
+ experimental: z.optional(z.boolean()),
2360
+ status: z.optional(z.enum([
2361
+ 'alpha',
2362
+ 'beta',
2363
+ 'deprecated'
2364
+ ])),
2365
+ options: z.record(z.string(), z.unknown()),
2366
+ headers: z.optional(z.record(z.string(), z.string())),
2367
+ provider: z.optional(z.object({
2368
+ npm: z.string()
2369
+ })),
2370
+ variants: z.optional(z.record(z.string(), z.record(z.string(), z.unknown())))
2371
+ }))
2372
+ })),
2373
+ default: z.record(z.string(), z.string()),
2374
+ connected: z.array(z.string())
2375
+ });
2376
+ export const zProviderAuthData = z.object({
2377
+ body: z.optional(z.never()),
2378
+ path: z.optional(z.never()),
2379
+ query: z.optional(z.object({
2380
+ directory: z.optional(z.string())
2381
+ }))
2382
+ });
2383
+ /**
2384
+ * Provider auth methods
2385
+ */
2386
+ export const zProviderAuthResponse = z.record(z.string(), z.array(zProviderAuthMethod));
2387
+ export const zProviderOauthAuthorizeData = z.object({
2388
+ body: z.optional(z.object({
2389
+ method: z.number()
2390
+ })),
2391
+ path: z.object({
2392
+ providerID: z.string()
2393
+ }),
2394
+ query: z.optional(z.object({
2395
+ directory: z.optional(z.string())
2396
+ }))
2397
+ });
2398
+ /**
2399
+ * Authorization URL and method
2400
+ */
2401
+ export const zProviderOauthAuthorizeResponse = zProviderAuthAuthorization;
2402
+ export const zProviderOauthCallbackData = z.object({
2403
+ body: z.optional(z.object({
2404
+ method: z.number(),
2405
+ code: z.optional(z.string())
2406
+ })),
2407
+ path: z.object({
2408
+ providerID: z.string()
2409
+ }),
2410
+ query: z.optional(z.object({
2411
+ directory: z.optional(z.string())
2412
+ }))
2413
+ });
2414
+ /**
2415
+ * OAuth callback processed successfully
2416
+ */
2417
+ export const zProviderOauthCallbackResponse = z.boolean();
2418
+ export const zFindTextData = z.object({
2419
+ body: z.optional(z.never()),
2420
+ path: z.optional(z.never()),
2421
+ query: z.object({
2422
+ directory: z.optional(z.string()),
2423
+ pattern: z.string()
2424
+ })
2425
+ });
2426
+ /**
2427
+ * Matches
2428
+ */
2429
+ export const zFindTextResponse = z.array(z.object({
2430
+ path: z.object({
2431
+ text: z.string()
2432
+ }),
2433
+ lines: z.object({
2434
+ text: z.string()
2435
+ }),
2436
+ line_number: z.number(),
2437
+ absolute_offset: z.number(),
2438
+ submatches: z.array(z.object({
2439
+ match: z.object({
2440
+ text: z.string()
2441
+ }),
2442
+ start: z.number(),
2443
+ end: z.number()
2444
+ }))
2445
+ }));
2446
+ export const zFindFilesData = z.object({
2447
+ body: z.optional(z.never()),
2448
+ path: z.optional(z.never()),
2449
+ query: z.object({
2450
+ directory: z.optional(z.string()),
2451
+ query: z.string(),
2452
+ dirs: z.optional(z.enum(['true', 'false'])),
2453
+ type: z.optional(z.enum(['file', 'directory'])),
2454
+ limit: z.optional(z.int().gte(1).lte(200))
2455
+ })
2456
+ });
2457
+ /**
2458
+ * File paths
2459
+ */
2460
+ export const zFindFilesResponse = z.array(z.string());
2461
+ export const zFindSymbolsData = z.object({
2462
+ body: z.optional(z.never()),
2463
+ path: z.optional(z.never()),
2464
+ query: z.object({
2465
+ directory: z.optional(z.string()),
2466
+ query: z.string()
2467
+ })
2468
+ });
2469
+ /**
2470
+ * Symbols
2471
+ */
2472
+ export const zFindSymbolsResponse = z.array(zSymbol);
2473
+ export const zFileListData = z.object({
2474
+ body: z.optional(z.never()),
2475
+ path: z.optional(z.never()),
2476
+ query: z.object({
2477
+ directory: z.optional(z.string()),
2478
+ path: z.string()
2479
+ })
2480
+ });
2481
+ /**
2482
+ * Files and directories
2483
+ */
2484
+ export const zFileListResponse = z.array(zFileNode);
2485
+ export const zFileReadData = z.object({
2486
+ body: z.optional(z.never()),
2487
+ path: z.optional(z.never()),
2488
+ query: z.object({
2489
+ directory: z.optional(z.string()),
2490
+ path: z.string()
2491
+ })
2492
+ });
2493
+ /**
2494
+ * File content
2495
+ */
2496
+ export const zFileReadResponse = zFileContent;
2497
+ export const zFileStatusData = z.object({
2498
+ body: z.optional(z.never()),
2499
+ path: z.optional(z.never()),
2500
+ query: z.optional(z.object({
2501
+ directory: z.optional(z.string())
2502
+ }))
2503
+ });
2504
+ /**
2505
+ * File status
2506
+ */
2507
+ export const zFileStatusResponse = z.array(zFile);
2508
+ export const zAppLogData = z.object({
2509
+ body: z.optional(z.object({
2510
+ service: z.string(),
2511
+ level: z.enum([
2512
+ 'debug',
2513
+ 'info',
2514
+ 'error',
2515
+ 'warn'
2516
+ ]),
2517
+ message: z.string(),
2518
+ extra: z.optional(z.record(z.string(), z.unknown()))
2519
+ })),
2520
+ path: z.optional(z.never()),
2521
+ query: z.optional(z.object({
2522
+ directory: z.optional(z.string())
2523
+ }))
2524
+ });
2525
+ /**
2526
+ * Log entry written successfully
2527
+ */
2528
+ export const zAppLogResponse = z.boolean();
2529
+ export const zAppAgentsData = z.object({
2530
+ body: z.optional(z.never()),
2531
+ path: z.optional(z.never()),
2532
+ query: z.optional(z.object({
2533
+ directory: z.optional(z.string())
2534
+ }))
2535
+ });
2536
+ /**
2537
+ * List of agents
2538
+ */
2539
+ export const zAppAgentsResponse = z.array(zAgent);
2540
+ export const zMcpStatusData = z.object({
2541
+ body: z.optional(z.never()),
2542
+ path: z.optional(z.never()),
2543
+ query: z.optional(z.object({
2544
+ directory: z.optional(z.string())
2545
+ }))
2546
+ });
2547
+ /**
2548
+ * MCP server status
2549
+ */
2550
+ export const zMcpStatusResponse = z.record(z.string(), zMcpStatus);
2551
+ export const zMcpAddData = z.object({
2552
+ body: z.optional(z.object({
2553
+ name: z.string(),
2554
+ config: z.union([
2555
+ zMcpLocalConfig,
2556
+ zMcpRemoteConfig
2557
+ ])
2558
+ })),
2559
+ path: z.optional(z.never()),
2560
+ query: z.optional(z.object({
2561
+ directory: z.optional(z.string())
2562
+ }))
2563
+ });
2564
+ /**
2565
+ * MCP server added successfully
2566
+ */
2567
+ export const zMcpAddResponse = z.record(z.string(), zMcpStatus);
2568
+ export const zMcpAuthRemoveData = z.object({
2569
+ body: z.optional(z.never()),
2570
+ path: z.object({
2571
+ name: z.string()
2572
+ }),
2573
+ query: z.optional(z.object({
2574
+ directory: z.optional(z.string())
2575
+ }))
2576
+ });
2577
+ /**
2578
+ * OAuth credentials removed
2579
+ */
2580
+ export const zMcpAuthRemoveResponse = z.object({
2581
+ success: z.literal(true)
2582
+ });
2583
+ export const zMcpAuthStartData = z.object({
2584
+ body: z.optional(z.never()),
2585
+ path: z.object({
2586
+ name: z.string()
2587
+ }),
2588
+ query: z.optional(z.object({
2589
+ directory: z.optional(z.string())
2590
+ }))
2591
+ });
2592
+ /**
2593
+ * OAuth flow started
2594
+ */
2595
+ export const zMcpAuthStartResponse = z.object({
2596
+ authorizationUrl: z.string()
2597
+ });
2598
+ export const zMcpAuthCallbackData = z.object({
2599
+ body: z.optional(z.object({
2600
+ code: z.string()
2601
+ })),
2602
+ path: z.object({
2603
+ name: z.string()
2604
+ }),
2605
+ query: z.optional(z.object({
2606
+ directory: z.optional(z.string())
2607
+ }))
2608
+ });
2609
+ /**
2610
+ * OAuth authentication completed
2611
+ */
2612
+ export const zMcpAuthCallbackResponse = zMcpStatus;
2613
+ export const zMcpAuthAuthenticateData = z.object({
2614
+ body: z.optional(z.never()),
2615
+ path: z.object({
2616
+ name: z.string()
2617
+ }),
2618
+ query: z.optional(z.object({
2619
+ directory: z.optional(z.string())
2620
+ }))
2621
+ });
2622
+ /**
2623
+ * OAuth authentication completed
2624
+ */
2625
+ export const zMcpAuthAuthenticateResponse = zMcpStatus;
2626
+ export const zMcpConnectData = z.object({
2627
+ body: z.optional(z.never()),
2628
+ path: z.object({
2629
+ name: z.string()
2630
+ }),
2631
+ query: z.optional(z.object({
2632
+ directory: z.optional(z.string())
2633
+ }))
2634
+ });
2635
+ /**
2636
+ * MCP server connected successfully
2637
+ */
2638
+ export const zMcpConnectResponse = z.boolean();
2639
+ export const zMcpDisconnectData = z.object({
2640
+ body: z.optional(z.never()),
2641
+ path: z.object({
2642
+ name: z.string()
2643
+ }),
2644
+ query: z.optional(z.object({
2645
+ directory: z.optional(z.string())
2646
+ }))
2647
+ });
2648
+ /**
2649
+ * MCP server disconnected successfully
2650
+ */
2651
+ export const zMcpDisconnectResponse = z.boolean();
2652
+ export const zExperimentalResourceListData = z.object({
2653
+ body: z.optional(z.never()),
2654
+ path: z.optional(z.never()),
2655
+ query: z.optional(z.object({
2656
+ directory: z.optional(z.string())
2657
+ }))
2658
+ });
2659
+ /**
2660
+ * MCP resources
2661
+ */
2662
+ export const zExperimentalResourceListResponse = z.record(z.string(), zMcpResource);
2663
+ export const zLspStatusData = z.object({
2664
+ body: z.optional(z.never()),
2665
+ path: z.optional(z.never()),
2666
+ query: z.optional(z.object({
2667
+ directory: z.optional(z.string())
2668
+ }))
2669
+ });
2670
+ /**
2671
+ * LSP server status
2672
+ */
2673
+ export const zLspStatusResponse = z.array(zLspStatus);
2674
+ export const zFormatterStatusData = z.object({
2675
+ body: z.optional(z.never()),
2676
+ path: z.optional(z.never()),
2677
+ query: z.optional(z.object({
2678
+ directory: z.optional(z.string())
2679
+ }))
2680
+ });
2681
+ /**
2682
+ * Formatter status
2683
+ */
2684
+ export const zFormatterStatusResponse = z.array(zFormatterStatus);
2685
+ export const zTuiAppendPromptData = z.object({
2686
+ body: z.optional(z.object({
2687
+ text: z.string()
2688
+ })),
2689
+ path: z.optional(z.never()),
2690
+ query: z.optional(z.object({
2691
+ directory: z.optional(z.string())
2692
+ }))
2693
+ });
2694
+ /**
2695
+ * Prompt processed successfully
2696
+ */
2697
+ export const zTuiAppendPromptResponse = z.boolean();
2698
+ export const zTuiOpenHelpData = z.object({
2699
+ body: z.optional(z.never()),
2700
+ path: z.optional(z.never()),
2701
+ query: z.optional(z.object({
2702
+ directory: z.optional(z.string())
2703
+ }))
2704
+ });
2705
+ /**
2706
+ * Help dialog opened successfully
2707
+ */
2708
+ export const zTuiOpenHelpResponse = z.boolean();
2709
+ export const zTuiOpenSessionsData = z.object({
2710
+ body: z.optional(z.never()),
2711
+ path: z.optional(z.never()),
2712
+ query: z.optional(z.object({
2713
+ directory: z.optional(z.string())
2714
+ }))
2715
+ });
2716
+ /**
2717
+ * Session dialog opened successfully
2718
+ */
2719
+ export const zTuiOpenSessionsResponse = z.boolean();
2720
+ export const zTuiOpenThemesData = z.object({
2721
+ body: z.optional(z.never()),
2722
+ path: z.optional(z.never()),
2723
+ query: z.optional(z.object({
2724
+ directory: z.optional(z.string())
2725
+ }))
2726
+ });
2727
+ /**
2728
+ * Theme dialog opened successfully
2729
+ */
2730
+ export const zTuiOpenThemesResponse = z.boolean();
2731
+ export const zTuiOpenModelsData = z.object({
2732
+ body: z.optional(z.never()),
2733
+ path: z.optional(z.never()),
2734
+ query: z.optional(z.object({
2735
+ directory: z.optional(z.string())
2736
+ }))
2737
+ });
2738
+ /**
2739
+ * Model dialog opened successfully
2740
+ */
2741
+ export const zTuiOpenModelsResponse = z.boolean();
2742
+ export const zTuiSubmitPromptData = z.object({
2743
+ body: z.optional(z.never()),
2744
+ path: z.optional(z.never()),
2745
+ query: z.optional(z.object({
2746
+ directory: z.optional(z.string())
2747
+ }))
2748
+ });
2749
+ /**
2750
+ * Prompt submitted successfully
2751
+ */
2752
+ export const zTuiSubmitPromptResponse = z.boolean();
2753
+ export const zTuiClearPromptData = z.object({
2754
+ body: z.optional(z.never()),
2755
+ path: z.optional(z.never()),
2756
+ query: z.optional(z.object({
2757
+ directory: z.optional(z.string())
2758
+ }))
2759
+ });
2760
+ /**
2761
+ * Prompt cleared successfully
2762
+ */
2763
+ export const zTuiClearPromptResponse = z.boolean();
2764
+ export const zTuiExecuteCommandData = z.object({
2765
+ body: z.optional(z.object({
2766
+ command: z.string()
2767
+ })),
2768
+ path: z.optional(z.never()),
2769
+ query: z.optional(z.object({
2770
+ directory: z.optional(z.string())
2771
+ }))
2772
+ });
2773
+ /**
2774
+ * Command executed successfully
2775
+ */
2776
+ export const zTuiExecuteCommandResponse = z.boolean();
2777
+ export const zTuiShowToastData = z.object({
2778
+ body: z.optional(z.object({
2779
+ title: z.optional(z.string()),
2780
+ message: z.string(),
2781
+ variant: z.enum([
2782
+ 'info',
2783
+ 'success',
2784
+ 'warning',
2785
+ 'error'
2786
+ ]),
2787
+ duration: z.optional(z.number()).default(5000)
2788
+ })),
2789
+ path: z.optional(z.never()),
2790
+ query: z.optional(z.object({
2791
+ directory: z.optional(z.string())
2792
+ }))
2793
+ });
2794
+ /**
2795
+ * Toast notification shown successfully
2796
+ */
2797
+ export const zTuiShowToastResponse = z.boolean();
2798
+ export const zTuiPublishData = z.object({
2799
+ body: z.optional(z.union([
2800
+ zEventTuiPromptAppend,
2801
+ zEventTuiCommandExecute,
2802
+ zEventTuiToastShow,
2803
+ zEventTuiSessionSelect
2804
+ ])),
2805
+ path: z.optional(z.never()),
2806
+ query: z.optional(z.object({
2807
+ directory: z.optional(z.string())
2808
+ }))
2809
+ });
2810
+ /**
2811
+ * Event published successfully
2812
+ */
2813
+ export const zTuiPublishResponse = z.boolean();
2814
+ export const zTuiSelectSessionData = z.object({
2815
+ body: z.optional(z.object({
2816
+ sessionID: z.string().regex(/^ses/)
2817
+ })),
2818
+ path: z.optional(z.never()),
2819
+ query: z.optional(z.object({
2820
+ directory: z.optional(z.string())
2821
+ }))
2822
+ });
2823
+ /**
2824
+ * Session selected successfully
2825
+ */
2826
+ export const zTuiSelectSessionResponse = z.boolean();
2827
+ export const zTuiControlNextData = z.object({
2828
+ body: z.optional(z.never()),
2829
+ path: z.optional(z.never()),
2830
+ query: z.optional(z.object({
2831
+ directory: z.optional(z.string())
2832
+ }))
2833
+ });
2834
+ /**
2835
+ * Next TUI request
2836
+ */
2837
+ export const zTuiControlNextResponse = z.object({
2838
+ path: z.string(),
2839
+ body: z.unknown()
2840
+ });
2841
+ export const zTuiControlResponseData = z.object({
2842
+ body: z.optional(z.unknown()),
2843
+ path: z.optional(z.never()),
2844
+ query: z.optional(z.object({
2845
+ directory: z.optional(z.string())
2846
+ }))
2847
+ });
2848
+ /**
2849
+ * Response submitted successfully
2850
+ */
2851
+ export const zTuiControlResponseResponse = z.boolean();
2852
+ export const zAuthSetData = z.object({
2853
+ body: z.optional(zAuth),
2854
+ path: z.object({
2855
+ providerID: z.string()
2856
+ }),
2857
+ query: z.optional(z.object({
2858
+ directory: z.optional(z.string())
2859
+ }))
2860
+ });
2861
+ /**
2862
+ * Successfully set authentication credentials
2863
+ */
2864
+ export const zAuthSetResponse = z.boolean();
2865
+ export const zEventSubscribeData = z.object({
2866
+ body: z.optional(z.never()),
2867
+ path: z.optional(z.never()),
2868
+ query: z.optional(z.object({
2869
+ directory: z.optional(z.string())
2870
+ }))
2871
+ });
2872
+ /**
2873
+ * Event stream
2874
+ */
2875
+ export const zEventSubscribeResponse = zEvent;
2876
+ //# sourceMappingURL=zod.gen.js.map