@renai-labs/sdk 0.1.0 → 0.1.1

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 (38) hide show
  1. package/dist/auth.d.ts +1 -0
  2. package/dist/auth.js +2 -1
  3. package/dist/client.js +12 -1
  4. package/dist/generated/@tanstack/react-query.gen.d.ts +915 -1201
  5. package/dist/generated/@tanstack/react-query.gen.js +1063 -1473
  6. package/dist/generated/client/client.gen.d.ts +1 -1
  7. package/dist/generated/client/client.gen.js +44 -46
  8. package/dist/generated/client/index.d.ts +8 -8
  9. package/dist/generated/client/index.js +5 -5
  10. package/dist/generated/client/types.gen.d.ts +18 -18
  11. package/dist/generated/client/utils.gen.d.ts +3 -3
  12. package/dist/generated/client/utils.gen.js +33 -35
  13. package/dist/generated/client.gen.d.ts +2 -2
  14. package/dist/generated/client.gen.js +1 -1
  15. package/dist/generated/core/auth.gen.d.ts +3 -3
  16. package/dist/generated/core/auth.gen.js +3 -3
  17. package/dist/generated/core/bodySerializer.gen.d.ts +1 -1
  18. package/dist/generated/core/bodySerializer.gen.js +3 -3
  19. package/dist/generated/core/params.gen.d.ts +3 -3
  20. package/dist/generated/core/params.gen.js +11 -9
  21. package/dist/generated/core/pathSerializer.gen.d.ts +4 -4
  22. package/dist/generated/core/pathSerializer.gen.js +37 -37
  23. package/dist/generated/core/queryKeySerializer.gen.js +8 -7
  24. package/dist/generated/core/serverSentEvents.gen.d.ts +3 -3
  25. package/dist/generated/core/serverSentEvents.gen.js +19 -19
  26. package/dist/generated/core/types.gen.d.ts +4 -4
  27. package/dist/generated/core/utils.gen.d.ts +1 -1
  28. package/dist/generated/core/utils.gen.js +17 -17
  29. package/dist/generated/internal/types.gen.d.ts +664 -0
  30. package/dist/generated/internal/types.gen.js +2 -0
  31. package/dist/generated/sdk.gen.d.ts +281 -343
  32. package/dist/generated/sdk.gen.js +930 -723
  33. package/dist/generated/types.gen.d.ts +2626 -2238
  34. package/dist/generated/zod.gen.d.ts +5569 -2277
  35. package/dist/generated/zod.gen.js +1757 -1118
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +1 -1
  38. package/package.json +11 -3
@@ -1,121 +1,302 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
- import * as z from 'zod';
3
- export const zGitRepo = z.object({
2
+ import * as z from "zod";
3
+ export const zProjectGitRepo = z.object({
4
+ url: z.string().min(1),
5
+ baseBranch: z.string().min(1).optional(),
6
+ mountPath: z.string().min(1).optional(),
7
+ });
8
+ export const zPermissionConfig = z.union([
9
+ z.object({
10
+ __originalKeys: z.array(z.string()).optional(),
11
+ read: z
12
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
13
+ .optional(),
14
+ edit: z
15
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
16
+ .optional(),
17
+ glob: z
18
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
19
+ .optional(),
20
+ grep: z
21
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
22
+ .optional(),
23
+ list: z
24
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
25
+ .optional(),
26
+ bash: z
27
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
28
+ .optional(),
29
+ task: z
30
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
31
+ .optional(),
32
+ external_directory: z
33
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
34
+ .optional(),
35
+ todowrite: z.enum(["allow", "deny", "ask"]).optional(),
36
+ question: z.enum(["allow", "deny", "ask"]).optional(),
37
+ webfetch: z.enum(["allow", "deny", "ask"]).optional(),
38
+ websearch: z.enum(["allow", "deny", "ask"]).optional(),
39
+ codesearch: z.enum(["allow", "deny", "ask"]).optional(),
40
+ lsp: z.union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))]).optional(),
41
+ doom_loop: z.enum(["allow", "deny", "ask"]).optional(),
42
+ skill: z
43
+ .union([z.enum(["allow", "deny", "ask"]), z.record(z.string(), z.enum(["allow", "deny", "ask"]))])
44
+ .optional(),
45
+ }),
46
+ z.enum(["allow", "deny", "ask"]),
47
+ ]);
48
+ export const zReplayPresignDownloadResponse = z.object({
4
49
  url: z.string(),
5
- mountPath: z.string()
50
+ expiresAt: z.iso
51
+ .datetime()
52
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
53
+ });
54
+ export const zReplayMessage = z.object({
55
+ info: z.record(z.string(), z.unknown()),
56
+ parts: z.array(z.record(z.string(), z.unknown())),
57
+ });
58
+ export const zReplayPublicSession = z.object({
59
+ id: z.string(),
60
+ title: z.string(),
61
+ createdAt: z.iso
62
+ .datetime()
63
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
6
64
  });
7
- export const zPermissionRule = z.object({
8
- permission: z.string(),
9
- pattern: z.string(),
10
- action: z.enum([
11
- 'allow',
12
- 'deny',
13
- 'ask'
14
- ])
65
+ export const zReplayPublicView = z.object({
66
+ id: z.string(),
67
+ slug: z.string(),
68
+ createdAt: z.iso
69
+ .datetime()
70
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
71
+ session: zReplayPublicSession,
72
+ messages: z.array(zReplayMessage),
15
73
  });
16
74
  export const zOAuthStartInput = z.object({
17
75
  mcpId: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
18
76
  scope: z.string().optional(),
19
- callbackUrl: z.url().optional()
77
+ callbackUrl: z.url().optional(),
20
78
  });
21
79
  export const zOAuthStartResult = z.object({
22
80
  authorizationUrl: z.string(),
23
81
  sessionId: z.string(),
24
- state: z.string()
82
+ state: z.string(),
25
83
  });
26
84
  export const zCredentialAuth = z.union([
27
85
  z.object({
28
- type: z.literal('bearer'),
29
- token: z.string()
86
+ type: z.literal("bearer"),
87
+ token: z.string(),
30
88
  }),
31
89
  z.object({
32
- type: z.literal('oauth'),
90
+ type: z.literal("oauth"),
33
91
  accessToken: z.string(),
34
92
  expiresAt: z.string().nullish(),
35
- refresh: z.object({
93
+ refresh: z
94
+ .object({
36
95
  clientId: z.string(),
37
96
  refreshToken: z.string(),
38
97
  clientSecret: z.string().optional(),
39
98
  tokenEndpoint: z.string().optional(),
40
- tokenEndpointAuth: z.enum([
41
- 'none',
42
- 'client_secret_basic',
43
- 'client_secret_post'
44
- ]).optional(),
99
+ tokenEndpointAuth: z.enum(["none", "client_secret_basic", "client_secret_post"]).optional(),
45
100
  scope: z.string().optional(),
46
- resource: z.string().optional()
47
- }).nullish()
101
+ resource: z.string().optional(),
102
+ })
103
+ .nullish(),
104
+ profile: z
105
+ .object({
106
+ service: z.literal("github"),
107
+ id: z.number(),
108
+ login: z.string(),
109
+ name: z.string().nullable(),
110
+ })
111
+ .nullish(),
48
112
  }),
49
113
  z.object({
50
- type: z.literal('env'),
51
- value: z.string()
52
- })
114
+ type: z.literal("env"),
115
+ value: z.string(),
116
+ }),
53
117
  ]);
54
118
  export const zCredentialAuthPublic = z.union([
55
119
  z.object({
56
- type: z.literal('bearer')
120
+ type: z.literal("bearer"),
57
121
  }),
58
122
  z.object({
59
- type: z.literal('oauth'),
123
+ type: z.literal("oauth"),
60
124
  expiresAt: z.string().nullish(),
61
- refresh: z.object({
125
+ refresh: z
126
+ .object({
62
127
  clientId: z.string(),
63
128
  tokenEndpoint: z.string().optional(),
64
- tokenEndpointAuth: z.enum([
65
- 'none',
66
- 'client_secret_basic',
67
- 'client_secret_post'
68
- ]).optional(),
129
+ tokenEndpointAuth: z.enum(["none", "client_secret_basic", "client_secret_post"]).optional(),
69
130
  scope: z.string().optional(),
70
- resource: z.string().optional()
71
- }).nullish()
131
+ resource: z.string().optional(),
132
+ })
133
+ .nullish(),
72
134
  }),
73
135
  z.object({
74
- type: z.literal('env')
75
- })
136
+ type: z.literal("env"),
137
+ }),
76
138
  ]);
77
139
  export const zCredential = z.object({
78
140
  id: z.string(),
79
141
  vaultId: z.string(),
80
142
  name: z.string(),
81
143
  mcpId: z.string().nullable(),
144
+ provider: z.enum(["github"]).nullable(),
82
145
  label: z.string().nullable(),
83
146
  keyPreview: z.string().nullable(),
84
147
  auth: zCredentialAuthPublic,
85
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
86
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
87
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
148
+ createdAt: z.iso
149
+ .datetime()
150
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
151
+ updatedAt: z.iso
152
+ .datetime()
153
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
154
+ archivedAt: z.iso
155
+ .datetime()
156
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
157
+ .nullable(),
88
158
  });
89
159
  export const zVault = z.object({
90
160
  id: z.string(),
91
161
  name: z.string(),
92
162
  description: z.string().nullable(),
163
+ isDefault: z.boolean(),
93
164
  orgId: z.string(),
94
165
  userId: z.string().nullable(),
95
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
96
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
97
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
166
+ createdAt: z.iso
167
+ .datetime()
168
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
169
+ updatedAt: z.iso
170
+ .datetime()
171
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
172
+ archivedAt: z.iso
173
+ .datetime()
174
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
175
+ .nullable(),
176
+ });
177
+ export const zSlackInstallationResponse = z.object({
178
+ id: z.string(),
179
+ orgId: z.string(),
180
+ installedById: z.string(),
181
+ teamId: z.string(),
182
+ teamName: z.string().nullable(),
183
+ botUserId: z.string(),
184
+ scope: z.string(),
185
+ createdAt: z.iso
186
+ .datetime()
187
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
188
+ updatedAt: z.iso
189
+ .datetime()
190
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
191
+ archivedAt: z.iso
192
+ .datetime()
193
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
194
+ .nullable(),
195
+ });
196
+ export const zSlackStatus = z.object({
197
+ hasInstallation: z.boolean(),
198
+ installations: z.array(zSlackInstallationResponse),
199
+ });
200
+ export const zWebhookTrigger = z.object({
201
+ id: z.string(),
202
+ projectId: z.string(),
203
+ projectAgentId: z.string(),
204
+ senderUserId: z.string(),
205
+ provider: z.enum(["slack", "generic"]),
206
+ providerInstallId: z.string().nullable(),
207
+ scopeFilter: z
208
+ .object({
209
+ channelId: z.string().optional(),
210
+ })
211
+ .nullable(),
212
+ secretHash: z.string().nullable(),
213
+ isEnabled: z.boolean(),
214
+ createdAt: z.iso
215
+ .datetime()
216
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
217
+ updatedAt: z.iso
218
+ .datetime()
219
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
220
+ archivedAt: z.iso
221
+ .datetime()
222
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
223
+ .nullable(),
224
+ });
225
+ export const zWebhookTriggerCreateResult = z.object({
226
+ trigger: zWebhookTrigger,
227
+ plaintextSecret: z.string().nullable(),
228
+ });
229
+ export const zCronTrigger = z.object({
230
+ id: z.string(),
231
+ projectId: z.string(),
232
+ projectAgentId: z.string(),
233
+ senderUserId: z.string(),
234
+ inputMessage: z.string(),
235
+ schedule: z.string(),
236
+ timezone: z.string().nullable(),
237
+ isEnabled: z.boolean(),
238
+ syncedAt: z.iso
239
+ .datetime()
240
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
241
+ .nullable(),
242
+ createdAt: z.iso
243
+ .datetime()
244
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
245
+ updatedAt: z.iso
246
+ .datetime()
247
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
248
+ archivedAt: z.iso
249
+ .datetime()
250
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
251
+ .nullable(),
252
+ });
253
+ export const zRequiredCredential = z.object({
254
+ name: z
255
+ .string()
256
+ .min(1)
257
+ .max(128)
258
+ .regex(/^[A-Z_][A-Z0-9_]*$/),
259
+ description: z.string().max(512).optional(),
98
260
  });
99
261
  export const zSkillVersion = z.object({
100
262
  id: z.string(),
101
263
  skillId: z.string(),
102
264
  version: z.string().regex(/^\d+\.\d+\.\d+$/),
103
265
  createdById: z.string(),
104
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
105
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
266
+ createdAt: z.iso
267
+ .datetime()
268
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
269
+ archivedAt: z.iso
270
+ .datetime()
271
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
272
+ .nullable(),
106
273
  source: z.union([
107
274
  z.object({
108
- type: z.literal('s3'),
109
- url: z.url()
275
+ type: z.literal("s3"),
276
+ url: z.url(),
110
277
  }),
111
278
  z.object({
112
- type: z.literal('git'),
279
+ type: z.literal("git"),
113
280
  url: z.url(),
114
281
  ref: z.string().optional(),
115
- path: z.string().optional()
116
- })
282
+ path: z.string().optional(),
283
+ }),
117
284
  ]),
118
- releaseNotes: z.string().nullable()
285
+ requiredCredentials: z.array(zRequiredCredential),
286
+ releaseNotes: z.string().nullable(),
287
+ });
288
+ export const zWebsiteMetadata = z.object({
289
+ title: z.string().optional(),
290
+ description: z.string().optional(),
291
+ longDescription: z.string().optional(),
292
+ image: z.url().optional(),
293
+ favicon: z.url().optional(),
294
+ supportUrl: z.url().optional(),
295
+ privacyPolicyUrl: z.url().optional(),
296
+ });
297
+ export const zRepository = z.object({
298
+ url: z.url().optional(),
299
+ source: z.string().optional(),
119
300
  });
120
301
  export const zSkill = z.object({
121
302
  id: z.string(),
@@ -123,66 +304,98 @@ export const zSkill = z.object({
123
304
  name: z.string(),
124
305
  description: z.string().nullable(),
125
306
  icon: z.string().nullable(),
307
+ docUrl: z.string().nullable(),
308
+ repository: zRepository.nullable(),
126
309
  orgId: z.string(),
127
310
  userId: z.string().nullable(),
128
311
  publisherId: z.string().nullable(),
312
+ websiteMetadata: zWebsiteMetadata.nullable(),
313
+ sortOrder: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
314
+ popularityScore: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
315
+ trendingScore: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
316
+ rank: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
129
317
  latestVersionId: z.string().nullable(),
130
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
131
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
132
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
318
+ createdAt: z.iso
319
+ .datetime()
320
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
321
+ updatedAt: z.iso
322
+ .datetime()
323
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
324
+ archivedAt: z.iso
325
+ .datetime()
326
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
327
+ .nullable(),
328
+ tags: z.array(z.string()).optional().default([]),
329
+ });
330
+ export const zSessionVolumeRef = z.object({
331
+ kind: z.enum(["outputs", "uploads"]),
332
+ filename: z.string().min(1),
333
+ });
334
+ export const zSessionFilesPresignDownloadResponse = z.object({
335
+ url: z.string(),
336
+ expiresAt: z.iso
337
+ .datetime()
338
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
339
+ });
340
+ export const zSessionFilesPresignUploadResponse = z.object({
341
+ uploadUrl: z.string(),
342
+ sandboxPath: z.string(),
343
+ podVolume: z.object({
344
+ projectId: z.string(),
345
+ sessionId: z.string(),
346
+ kind: z.enum(["outputs", "uploads"]),
347
+ filename: z.string(),
348
+ }),
349
+ expiresAt: z.iso
350
+ .datetime()
351
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
352
+ });
353
+ export const zAuthRequirementEnv = z.object({
354
+ name: z
355
+ .string()
356
+ .min(1)
357
+ .max(128)
358
+ .regex(/^[A-Z_][A-Z0-9_]*$/),
359
+ description: z.string().max(512).optional(),
360
+ satisfied: z.boolean(),
361
+ neededBy: z.array(z.object({
362
+ skillId: z.string(),
363
+ skillName: z.string(),
364
+ })),
133
365
  });
134
- export const zReplay = z.object({
135
- id: z.string(),
136
- orgId: z.string(),
137
- userId: z.string().nullable(),
138
- sessionId: z.string(),
139
- publisherId: z.string(),
366
+ export const zMcpAuthConfig = z.union([
367
+ z.object({
368
+ type: z.literal("oauth"),
369
+ scopes: z.array(z.string()).optional(),
370
+ tokenEndpoint: z.string().optional(),
371
+ authorizationEndpoint: z.string().optional(),
372
+ tokenEndpointAuth: z.enum(["none", "client_secret_basic", "client_secret_post"]).optional(),
373
+ }),
374
+ z.object({
375
+ type: z.literal("api_key"),
376
+ headerName: z.string().optional(),
377
+ queryParam: z.string().optional(),
378
+ }),
379
+ z.object({
380
+ type: z.literal("basic"),
381
+ }),
382
+ z.object({
383
+ type: z.literal("none"),
384
+ }),
385
+ ]);
386
+ export const zAuthRequirementMcp = z.object({
387
+ mcpId: z.string(),
140
388
  slug: z.string(),
141
- websiteMetadata: z.record(z.string(), z.unknown()).nullable(),
142
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
143
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
144
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
145
- });
146
- export const zApiTrigger = z.object({
147
- id: z.string(),
148
- routineId: z.string(),
149
- tokenHash: z.string().nullable(),
150
- isEnabled: z.boolean(),
151
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
152
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
153
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
154
- });
155
- export const zApiTriggerCreated = z.object({
156
- trigger: zApiTrigger,
157
- token: z.string()
158
- });
159
- export const zWebhookTrigger = z.object({
160
- id: z.string(),
161
- routineId: z.string(),
162
- source: z.string().nullable(),
163
- secret: z.string().nullable(),
164
- eventFilters: z.record(z.string(), z.string()).nullable(),
165
- isEnabled: z.boolean(),
166
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
167
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
168
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
169
- });
170
- export const zCronTrigger = z.object({
171
- id: z.string(),
172
- routineId: z.string(),
173
- schedule: z.string(),
174
- timezone: z.string().nullable(),
175
- isEnabled: z.boolean(),
176
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
177
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
178
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
389
+ name: z.string(),
390
+ icon: z.string().nullable(),
391
+ authType: z.enum(["none", "oauth", "api_key", "basic"]),
392
+ authConfig: zMcpAuthConfig.nullable(),
393
+ satisfied: z.boolean(),
394
+ neededByAgentIds: z.array(z.string()),
179
395
  });
180
- export const zOpencodeMessage = z.object({
181
- id: z.string(),
182
- sessionId: z.string(),
183
- data: z.record(z.string(), z.unknown()),
184
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
185
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
396
+ export const zAuthRequirements = z.object({
397
+ mcps: z.array(zAuthRequirementMcp),
398
+ envs: z.array(zAuthRequirementEnv),
186
399
  });
187
400
  export const zOpencodeSession = z.object({
188
401
  id: z.string(),
@@ -190,6 +403,7 @@ export const zOpencodeSession = z.object({
190
403
  projectId: z.string(),
191
404
  podId: z.string(),
192
405
  slug: z.string(),
406
+ workspaceId: z.string().nullable(),
193
407
  directory: z.string(),
194
408
  title: z.string(),
195
409
  version: z.string(),
@@ -198,82 +412,99 @@ export const zOpencodeSession = z.object({
198
412
  summaryAdditions: z.int().gte(-2147483648).lte(2147483647).nullable(),
199
413
  summaryDeletions: z.int().gte(-2147483648).lte(2147483647).nullable(),
200
414
  summaryFiles: z.int().gte(-2147483648).lte(2147483647).nullable(),
201
- summaryDiffs: z.array(z.object({
415
+ summaryDiffs: z
416
+ .array(z.object({
202
417
  path: z.string(),
203
418
  additions: z.number(),
204
- deletions: z.number()
205
- })).nullable(),
206
- revert: z.object({
419
+ deletions: z.number(),
420
+ }))
421
+ .nullable(),
422
+ revert: z
423
+ .object({
207
424
  messageId: z.string(),
208
425
  partId: z.string().optional(),
209
426
  snapshot: z.string().optional(),
210
- diff: z.string().optional()
211
- }).nullable(),
427
+ diff: z.string().optional(),
428
+ })
429
+ .nullable(),
212
430
  permission: z.record(z.string(), z.unknown()).nullable(),
213
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
214
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
215
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
216
- compactingAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
217
- });
218
- export const zRoutineRun = z.object({
219
- id: z.string(),
220
- routineId: z.string(),
221
- sessionId: z.string().nullable(),
222
- status: z.enum([
223
- 'pending',
224
- 'running',
225
- 'completed',
226
- 'failed',
227
- 'cancelled'
228
- ]),
229
- error: z.string().nullable(),
230
- startedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
231
- completedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
232
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
233
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
431
+ status: z.enum(["idle", "busy", "waiting", "error"]),
432
+ error: z
433
+ .object({
434
+ code: z.string(),
435
+ message: z.string(),
436
+ details: z.record(z.string(), z.unknown()).optional(),
437
+ })
438
+ .nullable(),
439
+ currentAgentId: z.string().nullable(),
440
+ createdAt: z.iso
441
+ .datetime()
442
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
443
+ updatedAt: z.iso
444
+ .datetime()
445
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
446
+ archivedAt: z.iso
447
+ .datetime()
448
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
449
+ .nullable(),
450
+ compactingAt: z.iso
451
+ .datetime()
452
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
453
+ .nullable(),
234
454
  });
235
- export const zRoutine = z.object({
455
+ export const zReplay = z.object({
236
456
  id: z.string(),
237
457
  orgId: z.string(),
238
458
  userId: z.string().nullable(),
239
- podId: z.string(),
240
- projectId: z.string(),
241
- projectAgentId: z.string(),
242
- name: z.string(),
243
- description: z.string().nullable(),
244
- prompt: z.string(),
245
- status: z.enum(['active', 'paused']),
246
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
247
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
248
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
459
+ sessionId: z.string(),
460
+ publisherId: z.string().nullable(),
461
+ slug: z.string(),
462
+ websiteMetadata: zWebsiteMetadata.nullable(),
463
+ createdAt: z.iso
464
+ .datetime()
465
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
466
+ updatedAt: z.iso
467
+ .datetime()
468
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
469
+ archivedAt: z.iso
470
+ .datetime()
471
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
472
+ .nullable(),
249
473
  });
250
474
  export const zProjectMemoryStore = z.object({
251
475
  id: z.string(),
252
476
  projectId: z.string(),
253
477
  memoryStoreId: z.string(),
254
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
255
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
256
- });
257
- export const zFileStoreResource = z.object({
258
- source: z.string(),
259
- mountPath: z.string()
478
+ createdAt: z.iso
479
+ .datetime()
480
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
481
+ updatedAt: z.iso
482
+ .datetime()
483
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
260
484
  });
261
485
  export const zProjectFileStore = z.object({
262
486
  id: z.string(),
263
487
  projectId: z.string(),
264
488
  fileStoreId: z.string(),
265
- resources: z.array(zFileStoreResource),
266
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
267
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
489
+ createdAt: z.iso
490
+ .datetime()
491
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
492
+ updatedAt: z.iso
493
+ .datetime()
494
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
268
495
  });
269
496
  export const zProjectAgent = z.object({
270
497
  id: z.string(),
271
498
  projectId: z.string(),
272
499
  agentId: z.string(),
273
500
  agentVersionId: z.string().nullable(),
274
- type: z.enum(['primary', 'subagent']),
275
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
276
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
501
+ type: z.enum(["primary", "subagent", "all"]),
502
+ createdAt: z.iso
503
+ .datetime()
504
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
505
+ updatedAt: z.iso
506
+ .datetime()
507
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
277
508
  });
278
509
  export const zProject = z.object({
279
510
  id: z.string(),
@@ -283,12 +514,18 @@ export const zProject = z.object({
283
514
  name: z.string(),
284
515
  description: z.string().nullable(),
285
516
  slug: z.string(),
286
- path: z.string().nullable(),
287
- permission: z.array(zPermissionRule),
288
- gitRepos: z.array(zGitRepo),
289
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
290
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
291
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
517
+ permission: zPermissionConfig,
518
+ gitRepo: zProjectGitRepo.nullable(),
519
+ createdAt: z.iso
520
+ .datetime()
521
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
522
+ updatedAt: z.iso
523
+ .datetime()
524
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
525
+ archivedAt: z.iso
526
+ .datetime()
527
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
528
+ .nullable(),
292
529
  });
293
530
  export const zSandbox = z.object({
294
531
  id: z.string(),
@@ -298,44 +535,90 @@ export const zSandbox = z.object({
298
535
  providerSandboxId: z.string().nullable(),
299
536
  internalHost: z.string().nullable(),
300
537
  publicHost: z.string().nullable(),
301
- status: z.enum([
302
- 'provisioning',
303
- 'ready',
304
- 'failed',
305
- 'terminated'
306
- ]),
307
- lastActivityAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
308
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
309
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
310
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
538
+ createdAt: z.iso
539
+ .datetime()
540
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
541
+ updatedAt: z.iso
542
+ .datetime()
543
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
544
+ archivedAt: z.iso
545
+ .datetime()
546
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
547
+ .nullable(),
548
+ });
549
+ export const zPodSandboxStatusResponse = z.union([
550
+ z.object({
551
+ status: z.literal("provisioning"),
552
+ workflowId: z.string(),
553
+ }),
554
+ z.object({
555
+ status: z.literal("ready"),
556
+ sandbox: zSandbox,
557
+ serverPassword: z.string(),
558
+ }),
559
+ z.object({
560
+ status: z.literal("absent"),
561
+ }),
562
+ z.object({
563
+ status: z.literal("failed"),
564
+ reason: z.string(),
565
+ }),
566
+ ]);
567
+ export const zPodSandboxProvisionResponse = z.object({
568
+ workflowId: z.string(),
569
+ status: z.literal("provisioning"),
311
570
  });
312
571
  export const zPodVault = z.object({
313
572
  id: z.string(),
314
573
  podId: z.string(),
315
574
  vaultId: z.string(),
316
575
  priority: z.int().gte(-2147483648).lte(2147483647),
317
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
318
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
576
+ createdAt: z.iso
577
+ .datetime()
578
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
579
+ updatedAt: z.iso
580
+ .datetime()
581
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
319
582
  });
320
583
  export const zPodMember = z.object({
321
584
  id: z.string(),
322
585
  podId: z.string(),
323
586
  userId: z.string(),
324
- role: z.enum(['owner', 'member']),
325
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
326
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
587
+ role: z.enum(["owner", "member"]),
588
+ createdAt: z.iso
589
+ .datetime()
590
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
591
+ updatedAt: z.iso
592
+ .datetime()
593
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
327
594
  });
328
595
  export const zPod = z.object({
329
596
  id: z.string(),
330
597
  name: z.string(),
598
+ slug: z.string(),
331
599
  description: z.string().nullable(),
332
600
  isPrivate: z.boolean(),
601
+ isDefault: z.boolean(),
333
602
  environmentId: z.string().nullable(),
334
603
  orgId: z.string(),
335
604
  userId: z.string().nullable(),
336
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
337
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
338
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
605
+ manifestUpdatedAt: z.iso
606
+ .datetime()
607
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
608
+ createdAt: z.iso
609
+ .datetime()
610
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
611
+ updatedAt: z.iso
612
+ .datetime()
613
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
614
+ archivedAt: z.iso
615
+ .datetime()
616
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
617
+ .nullable(),
618
+ });
619
+ export const zPodWithSandbox = z.object({
620
+ pod: zPod,
621
+ sandbox: zSandbox,
339
622
  });
340
623
  export const zPat = z.object({
341
624
  id: z.string(),
@@ -344,79 +627,120 @@ export const zPat = z.object({
344
627
  name: z.string(),
345
628
  tokenPrefix: z.string(),
346
629
  scopes: z.array(z.string()),
347
- lastUsedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
348
- expiresAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
349
- revokedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
350
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
351
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
630
+ lastUsedAt: z.iso
631
+ .datetime()
632
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
633
+ .nullable(),
634
+ expiresAt: z.iso
635
+ .datetime()
636
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
637
+ .nullable(),
638
+ revokedAt: z.iso
639
+ .datetime()
640
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
641
+ .nullable(),
642
+ createdAt: z.iso
643
+ .datetime()
644
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
645
+ updatedAt: z.iso
646
+ .datetime()
647
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
648
+ });
649
+ export const zOnboardingSetupPersonalOrg = z.object({
650
+ organizationId: z.string(),
651
+ alreadyExisted: z.boolean(),
652
+ });
653
+ export const zOnboardingStart = z.object({
654
+ podId: z.string(),
655
+ projectId: z.string(),
656
+ sessionId: z.string(),
657
+ });
658
+ export const zModelEntry = z.object({
659
+ key: z.string(),
660
+ name: z.string(),
661
+ description: z.string(),
662
+ size: z.enum(["large", "medium", "small"]).optional(),
663
+ });
664
+ export const zModelProvider = z.object({
665
+ key: z.string(),
666
+ name: z.string(),
667
+ models: z.array(zModelEntry),
668
+ });
669
+ export const zModelsResponse = z.object({
670
+ default_model: z.string(),
671
+ providers: z.array(zModelProvider),
352
672
  });
353
673
  export const zMemoryStoreFile = z.object({
354
674
  path: z.string(),
355
675
  size: z.int().gte(0).lte(9007199254740991),
356
- lastModified: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
676
+ lastModified: z.iso
677
+ .datetime()
678
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
679
+ .optional(),
680
+ contentSha256: z.string().optional(),
357
681
  });
358
682
  export const zMemoryStore = z.object({
359
683
  id: z.string(),
360
684
  name: z.string(),
361
685
  description: z.string().nullable(),
686
+ mountSlug: z.string(),
687
+ isDefault: z.boolean(),
362
688
  orgId: z.string(),
363
689
  userId: z.string().nullable(),
364
- prompt: z.string().nullable(),
365
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
366
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
367
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
690
+ createdAt: z.iso
691
+ .datetime()
692
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
693
+ updatedAt: z.iso
694
+ .datetime()
695
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
696
+ archivedAt: z.iso
697
+ .datetime()
698
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
699
+ .nullable(),
700
+ });
701
+ export const zMe = z.object({
702
+ user: z.object({
703
+ id: z.string(),
704
+ name: z.string(),
705
+ email: z
706
+ .email()
707
+ .regex(/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/),
708
+ }),
709
+ organization: z
710
+ .object({
711
+ id: z.string(),
712
+ name: z.string(),
713
+ slug: z.string(),
714
+ })
715
+ .nullable(),
716
+ role: z.string().nullable(),
717
+ scopes: z.array(z.string()),
718
+ method: z.enum(["session", "pat", "sandbox"]),
368
719
  });
369
720
  export const zOAuthSessionStatus = z.object({
370
721
  id: z.string(),
371
- status: z.enum([
372
- 'pending',
373
- 'active',
374
- 'failed',
375
- 'expired'
376
- ]),
377
- mcpId: z.string(),
722
+ status: z.enum(["pending", "active", "failed", "expired"]),
723
+ mcpId: z.string().nullable(),
378
724
  credentialId: z.string().nullable(),
379
725
  failureReason: z.string().nullable(),
380
- expiresAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
726
+ expiresAt: z.iso
727
+ .datetime()
728
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
381
729
  });
382
730
  export const zMcpOAuthConnectBody = z.object({
383
731
  scope: z.string().optional(),
384
- callbackUrl: z.url().optional()
732
+ callbackUrl: z.url().optional(),
385
733
  });
386
734
  export const zMcpOAuthConnectResult = z.union([
387
735
  z.object({
388
736
  alreadyConnected: z.literal(true),
389
- credentialId: z.string()
737
+ credentialId: z.string(),
390
738
  }),
391
739
  z.object({
392
740
  alreadyConnected: z.literal(false),
393
741
  authorizationUrl: z.string(),
394
- sessionId: z.string()
395
- })
396
- ]);
397
- export const zMcpAuthConfig = z.union([
398
- z.object({
399
- type: z.literal('oauth'),
400
- scopes: z.array(z.string()).optional(),
401
- tokenEndpoint: z.string().optional(),
402
- authorizationEndpoint: z.string().optional(),
403
- tokenEndpointAuth: z.enum([
404
- 'none',
405
- 'client_secret_basic',
406
- 'client_secret_post'
407
- ]).optional()
742
+ sessionId: z.string(),
408
743
  }),
409
- z.object({
410
- type: z.literal('api_key'),
411
- headerName: z.string().optional(),
412
- queryParam: z.string().optional()
413
- }),
414
- z.object({
415
- type: z.literal('basic')
416
- }),
417
- z.object({
418
- type: z.literal('none')
419
- })
420
744
  ]);
421
745
  export const zMcp = z.object({
422
746
  id: z.string(),
@@ -424,41 +748,107 @@ export const zMcp = z.object({
424
748
  name: z.string(),
425
749
  description: z.string().nullable(),
426
750
  icon: z.string().nullable(),
427
- mcpServerUrl: z.string(),
428
- type: z.enum(['url']),
429
- auth: z.enum([
430
- 'none',
431
- 'oauth',
432
- 'api_key',
433
- 'basic'
434
- ]),
751
+ mcpServerUrl: z.string().nullable(),
752
+ docUrl: z.string().nullable(),
753
+ type: z.enum(["remote", "local"]),
754
+ transport: z.enum(["streamable-http", "sse", "stdio"]),
755
+ command: z.string().nullable(),
756
+ args: z.array(z.string()),
757
+ version: z.string().nullable(),
758
+ repository: zRepository.nullable(),
759
+ tools: z.array(z.string()),
760
+ prompts: z.array(z.string()),
761
+ auth: z.enum(["none", "oauth", "api_key", "basic"]),
435
762
  authConfig: zMcpAuthConfig.nullable(),
436
763
  orgId: z.string(),
437
764
  userId: z.string().nullable(),
438
765
  publisherId: z.string().nullable(),
439
- websiteMetadata: z.record(z.string(), z.unknown()).nullable(),
440
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
441
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
442
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
766
+ websiteMetadata: zWebsiteMetadata.nullable(),
767
+ sortOrder: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
768
+ popularityScore: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
769
+ trendingScore: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
770
+ rank: z.int().gte(-9007199254740991).lte(9007199254740991).nullable(),
771
+ createdAt: z.iso
772
+ .datetime()
773
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
774
+ updatedAt: z.iso
775
+ .datetime()
776
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
777
+ archivedAt: z.iso
778
+ .datetime()
779
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
780
+ .nullable(),
781
+ tags: z.array(z.string()).optional().default([]),
782
+ });
783
+ export const zGithubInstallationResponse = z.object({
784
+ id: z.string(),
785
+ orgId: z.string(),
786
+ installedById: z.string().nullable(),
787
+ installationId: z.string(),
788
+ accountLogin: z.string(),
789
+ accountType: z.enum(["User", "Organization"]),
790
+ repositorySelection: z.enum(["all", "selected"]),
791
+ selectedRepos: z
792
+ .array(z.object({
793
+ fullName: z.string(),
794
+ }))
795
+ .nullable(),
796
+ appPermissions: z.record(z.string(), z.string()).nullable(),
797
+ createdAt: z.iso
798
+ .datetime()
799
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
800
+ updatedAt: z.iso
801
+ .datetime()
802
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
803
+ archivedAt: z.iso
804
+ .datetime()
805
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
806
+ .nullable(),
807
+ });
808
+ export const zGithubStatus = z.object({
809
+ hasInstallation: z.boolean(),
810
+ hasUserCredential: z.boolean(),
811
+ installations: z.array(zGithubInstallationResponse),
812
+ });
813
+ export const zStoreStartUploadResponse = z.object({
814
+ url: z.string(),
815
+ expiresAt: z.iso
816
+ .datetime()
817
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
443
818
  });
444
819
  export const zStorePresignResponse = z.object({
445
820
  url: z.string(),
446
- expiresAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
821
+ expiresAt: z.iso
822
+ .datetime()
823
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
447
824
  });
448
825
  export const zFileStoreFile = z.object({
449
826
  path: z.string(),
450
827
  size: z.int().gte(0).lte(9007199254740991),
451
- lastModified: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
828
+ lastModified: z.iso
829
+ .datetime()
830
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
831
+ .optional(),
832
+ contentSha256: z.string().optional(),
452
833
  });
453
834
  export const zFileStore = z.object({
454
835
  id: z.string(),
455
836
  name: z.string(),
456
837
  description: z.string().nullable(),
838
+ mountSlug: z.string(),
839
+ isDefault: z.boolean(),
457
840
  orgId: z.string(),
458
841
  userId: z.string().nullable(),
459
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
460
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
461
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
842
+ createdAt: z.iso
843
+ .datetime()
844
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
845
+ updatedAt: z.iso
846
+ .datetime()
847
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
848
+ archivedAt: z.iso
849
+ .datetime()
850
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
851
+ .nullable(),
462
852
  });
463
853
  export const zPackagesConfig = z.object({
464
854
  apt: z.array(z.string()).optional(),
@@ -466,18 +856,18 @@ export const zPackagesConfig = z.object({
466
856
  pip: z.array(z.string()).optional(),
467
857
  cargo: z.array(z.string()).optional(),
468
858
  gem: z.array(z.string()).optional(),
469
- go: z.array(z.string()).optional()
859
+ go: z.array(z.string()).optional(),
470
860
  });
471
861
  export const zNetworkingConfig = z.union([
472
862
  z.object({
473
- type: z.literal('unrestricted')
863
+ type: z.literal("unrestricted"),
474
864
  }),
475
865
  z.object({
476
- type: z.literal('limited'),
866
+ type: z.literal("limited"),
477
867
  allowMcpServers: z.boolean(),
478
868
  allowPackageManagers: z.boolean(),
479
- allowedHosts: z.array(z.string())
480
- })
869
+ allowedHosts: z.array(z.string()),
870
+ }),
481
871
  ]);
482
872
  export const zEnvironment = z.object({
483
873
  id: z.string(),
@@ -485,29 +875,42 @@ export const zEnvironment = z.object({
485
875
  description: z.string().nullable(),
486
876
  orgId: z.string(),
487
877
  userId: z.string().nullable(),
488
- hostingType: z.enum(['cloud']),
878
+ hostingType: z.enum(["cloud"]),
489
879
  networking: zNetworkingConfig,
490
880
  packages: zPackagesConfig,
491
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
492
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
493
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
881
+ createdAt: z.iso
882
+ .datetime()
883
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
884
+ updatedAt: z.iso
885
+ .datetime()
886
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
887
+ archivedAt: z.iso
888
+ .datetime()
889
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
890
+ .nullable(),
494
891
  });
495
892
  export const zDashboardByUserItem = z.object({
496
893
  user_id: z.string(),
497
894
  username: z.string(),
498
- task_count: z.number()
895
+ task_count: z.number(),
499
896
  });
500
897
  export const zDashboardByAgentItem = z.object({
501
898
  agent_id: z.string(),
502
899
  agent_name: z.string(),
503
900
  task_count: z.number(),
504
- success_rate: z.number()
901
+ success_rate: z.number(),
902
+ });
903
+ export const zDashboardTasksOverTimeUserSegment = z.object({
904
+ user_id: z.string(),
905
+ username: z.string(),
906
+ count: z.number(),
505
907
  });
506
908
  export const zDashboardTasksOverTimeItem = z.object({
507
909
  date: z.string(),
508
910
  completed: z.number(),
509
911
  error: z.number(),
510
- total: z.number()
912
+ total: z.number(),
913
+ by_user: z.array(zDashboardTasksOverTimeUserSegment),
511
914
  });
512
915
  export const zDashboardSummary = z.object({
513
916
  total_tasks: z.number(),
@@ -516,7 +919,7 @@ export const zDashboardSummary = z.object({
516
919
  active_tasks: z.number(),
517
920
  waiting_tasks: z.number(),
518
921
  success_rate: z.number(),
519
- autonomy_score: z.number()
922
+ autonomy_score: z.number(),
520
923
  });
521
924
  export const zDashboardResponse = z.object({
522
925
  summary: zDashboardSummary,
@@ -525,32 +928,46 @@ export const zDashboardResponse = z.object({
525
928
  by_user: z.array(zDashboardByUserItem),
526
929
  agents: z.array(z.object({
527
930
  id: z.string(),
528
- name: z.string()
931
+ name: z.string(),
529
932
  })),
530
933
  pods: z.array(z.object({
531
934
  id: z.string(),
532
- name: z.string()
935
+ name: z.string(),
533
936
  })),
534
937
  users: z.array(z.object({
535
938
  id: z.string(),
536
- name: z.string()
939
+ name: z.string(),
537
940
  })),
538
- period: z.enum([
539
- '7d',
540
- '30d',
541
- '90d'
542
- ])
941
+ period: z.enum(["7d", "30d", "90d"]),
543
942
  });
544
943
  export const zAgentVersion = z.object({
545
944
  id: z.string(),
546
945
  agentId: z.string(),
547
946
  version: z.string().regex(/^\d+\.\d+\.\d+$/),
548
947
  createdById: z.string(),
549
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
550
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
948
+ createdAt: z.iso
949
+ .datetime()
950
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
951
+ archivedAt: z.iso
952
+ .datetime()
953
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
954
+ .nullable(),
551
955
  description: z.string().nullable(),
552
956
  prompt: z.string().nullable(),
553
- releaseNotes: z.string().nullable()
957
+ model: z.string().nullable(),
958
+ releaseNotes: z.string().nullable(),
959
+ permission: zPermissionConfig,
960
+ });
961
+ export const zSearchResult = z.object({
962
+ id: z.string(),
963
+ slug: z.string(),
964
+ name: z.string(),
965
+ description: z.string().nullable(),
966
+ icon: z.string().nullable(),
967
+ source: z.enum(["user", "org", "registry"]),
968
+ updatedAt: z.iso
969
+ .datetime()
970
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
554
971
  });
555
972
  export const zAgent = z.object({
556
973
  id: z.string(),
@@ -560,132 +977,79 @@ export const zAgent = z.object({
560
977
  orgId: z.string(),
561
978
  userId: z.string().nullable(),
562
979
  publisherId: z.string().nullable(),
563
- websiteMetadata: z.record(z.string(), z.unknown()).nullable(),
980
+ websiteMetadata: zWebsiteMetadata.nullable(),
564
981
  latestVersionId: z.string().nullable(),
565
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
566
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
567
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
568
- });
569
- export const zComposioConnection = z.object({
570
- id: z.string(),
571
- orgId: z.string(),
572
- userId: z.string().nullable(),
573
- composioMcpId: z.string(),
574
- composioUserId: z.string(),
575
- connectedAccountId: z.string().nullable(),
576
- oauthStatus: z.enum([
577
- 'pending',
578
- 'active',
579
- 'failed',
580
- 'expired'
581
- ]),
582
- oauthState: z.string().nullable(),
583
- failureReason: z.string().nullable(),
584
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
585
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
586
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
587
- });
588
- export const zComposioMcp = z.object({
589
- id: z.string(),
590
- slug: z.string(),
591
- name: z.string(),
592
- description: z.string().nullable(),
593
- logo: z.string().nullable(),
594
- composioAuthConfigId: z.string(),
595
- syncedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable(),
596
- createdAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
597
- updatedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
598
- archivedAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullable()
599
- });
600
- export const zComposioMcpListQuery = z.object({
601
- limit: z.number().gte(1).lte(100).optional(),
602
- offset: z.number().gte(0).optional()
603
- });
604
- /**
605
- * List of Composio MCPs
606
- */
607
- export const zComposioMcpListResponse = z.array(zComposioMcp);
608
- export const zComposioMcpGetPath = z.object({
609
- id: z.string().regex(/^cmcp_[0-9A-HJKMNP-TV-Z]{26}$/)
610
- });
611
- /**
612
- * Composio MCP details
613
- */
614
- export const zComposioMcpGetResponse = zComposioMcp;
615
- export const zComposioConnectionListQuery = z.object({
616
- limit: z.number().gte(1).lte(100).optional(),
617
- offset: z.number().gte(0).optional()
618
- });
619
- /**
620
- * Connections
621
- */
622
- export const zComposioConnectionListResponse = z.array(zComposioConnection);
623
- export const zComposioConnectionInitiateBody = z.object({
624
- composioMcpId: z.string().regex(/^cmcp_[0-9A-HJKMNP-TV-Z]{26}$/),
625
- callbackUrl: z.url().optional()
626
- });
627
- /**
628
- * Redirect target or already-connected short-circuit
629
- */
630
- export const zComposioConnectionInitiateResponse = z.union([
631
- z.object({
632
- kind: z.literal('redirect'),
633
- redirectUrl: z.string(),
634
- connectionId: z.string(),
635
- state: z.string()
636
- }),
637
- z.object({
638
- kind: z.literal('already_connected'),
639
- connectionId: z.string()
640
- })
641
- ]);
642
- export const zComposioConnectionGetPath = z.object({
643
- id: z.string().regex(/^cmc_[0-9A-HJKMNP-TV-Z]{26}$/)
644
- });
645
- /**
646
- * Connection
647
- */
648
- export const zComposioConnectionGetResponse = zComposioConnection;
649
- export const zComposioConnectionRefreshPath = z.object({
650
- id: z.string().regex(/^cmc_[0-9A-HJKMNP-TV-Z]{26}$/)
982
+ createdAt: z.iso
983
+ .datetime()
984
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
985
+ updatedAt: z.iso
986
+ .datetime()
987
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/),
988
+ archivedAt: z.iso
989
+ .datetime()
990
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
991
+ .nullable(),
651
992
  });
652
993
  /**
653
- * Connection
994
+ * Pass 'user' to scope the operation to the authenticated user's private namespace. Omit for the org-wide namespace.
654
995
  */
655
- export const zComposioConnectionRefreshResponse = zComposioConnection;
656
- export const zComposioConnectionArchivePath = z.object({
657
- id: z.string().regex(/^cmc_[0-9A-HJKMNP-TV-Z]{26}$/)
658
- });
659
- /**
660
- * Archived connection
661
- */
662
- export const zComposioConnectionArchiveResponse = zComposioConnection;
996
+ export const zScopeQuery = z.enum(["user"]);
663
997
  export const zAgentListQuery = z.object({
664
- limit: z.number().gte(1).lte(100).optional(),
665
- offset: z.number().gte(0).optional()
998
+ scope: z.enum(["user"]).optional(),
999
+ limit: z.number().gte(1).lte(1000).optional(),
1000
+ offset: z.number().gte(0).optional(),
666
1001
  });
667
1002
  /**
668
1003
  * List of agents
669
1004
  */
670
1005
  export const zAgentListResponse = z.array(zAgent);
671
1006
  export const zAgentCreateBody = z.object({
672
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/),
673
1007
  name: z.string().min(1).max(256),
674
- icon: z.string().nullish().default(null)
1008
+ icon: z.string().nullish().default(null),
1009
+ tags: z.array(z.string()).optional(),
1010
+ });
1011
+ export const zAgentCreateQuery = z.object({
1012
+ scope: z.enum(["user"]).optional(),
675
1013
  });
676
1014
  /**
677
1015
  * Created agent
678
1016
  */
679
1017
  export const zAgentCreateResponse = zAgent;
1018
+ export const zAgentSearchBody = z.object({
1019
+ query: z.string().optional(),
1020
+ sources: z
1021
+ .array(z.enum(["user", "org", "registry"]))
1022
+ .min(1)
1023
+ .optional()
1024
+ .default(["user", "org", "registry"]),
1025
+ limit: z.int().gte(1).lte(50).optional().default(20),
1026
+ });
1027
+ export const zAgentSearchQuery = z.object({
1028
+ scope: z.enum(["user"]).optional(),
1029
+ });
1030
+ /**
1031
+ * Matching agents
1032
+ */
1033
+ export const zAgentSearchResponse = z.array(zSearchResult);
680
1034
  export const zAgentGetBySlugPath = z.object({
681
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/)
1035
+ slug: z
1036
+ .string()
1037
+ .min(1)
1038
+ .max(128)
1039
+ .regex(/^[a-z0-9-]+$/),
1040
+ });
1041
+ export const zAgentGetBySlugQuery = z.object({
1042
+ scope: z.enum(["user"]).optional(),
682
1043
  });
683
1044
  /**
684
1045
  * Agent details
685
1046
  */
686
1047
  export const zAgentGetBySlugResponse = zAgent;
687
1048
  export const zAgentGetPath = z.object({
688
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
1049
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1050
+ });
1051
+ export const zAgentGetQuery = z.object({
1052
+ scope: z.enum(["user"]).optional(),
689
1053
  });
690
1054
  /**
691
1055
  * Agent details
@@ -693,57 +1057,70 @@ export const zAgentGetPath = z.object({
693
1057
  export const zAgentGetResponse = zAgent;
694
1058
  export const zAgentUpdateBody = z.object({
695
1059
  name: z.string().optional(),
696
- icon: z.string().nullish()
1060
+ icon: z.string().nullish(),
1061
+ tags: z.array(z.string()).optional(),
697
1062
  });
698
1063
  export const zAgentUpdatePath = z.object({
699
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
1064
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1065
+ });
1066
+ export const zAgentUpdateQuery = z.object({
1067
+ scope: z.enum(["user"]).optional(),
700
1068
  });
701
1069
  /**
702
1070
  * Updated agent
703
1071
  */
704
1072
  export const zAgentUpdateResponse = zAgent;
705
1073
  export const zAgentArchivePath = z.object({
706
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
1074
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1075
+ });
1076
+ export const zAgentArchiveQuery = z.object({
1077
+ scope: z.enum(["user"]).optional(),
707
1078
  });
708
1079
  /**
709
1080
  * Archived agent
710
1081
  */
711
1082
  export const zAgentArchiveResponse = zAgent;
712
1083
  export const zAgentVersionListPath = z.object({
713
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
1084
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
714
1085
  });
715
1086
  export const zAgentVersionListQuery = z.object({
716
- limit: z.number().gte(1).lte(100).optional(),
717
- offset: z.number().gte(0).optional()
1087
+ scope: z.enum(["user"]).optional(),
1088
+ limit: z.number().gte(1).lte(1000).optional(),
1089
+ offset: z.number().gte(0).optional(),
718
1090
  });
719
1091
  /**
720
1092
  * List of agent versions
721
1093
  */
722
1094
  export const zAgentVersionListResponse = z.array(zAgentVersion);
723
1095
  export const zAgentVersionCreateBody = z.object({
724
- version: z.union([
725
- z.string(),
726
- z.enum([
727
- 'major',
728
- 'minor',
729
- 'patch'
730
- ])
731
- ]).optional().default('patch'),
732
- description: z.string().optional().default(''),
733
- prompt: z.string().optional().default(''),
734
- skills: z.array(z.object({
1096
+ version: z
1097
+ .union([z.string(), z.enum(["major", "minor", "patch"])])
1098
+ .optional()
1099
+ .default("patch"),
1100
+ description: z.string().optional().default(""),
1101
+ prompt: z.string().optional().default(""),
1102
+ model: z.string().nullish().default(null),
1103
+ permission: zPermissionConfig.optional(),
1104
+ skills: z
1105
+ .array(z.object({
735
1106
  skillId: z.string(),
736
1107
  skillVersionId: z.string().nullish().default(null),
737
- permission: z.array(zPermissionRule).optional().default([])
738
- })).optional().default([]),
739
- mcps: z.array(z.object({
1108
+ }))
1109
+ .optional()
1110
+ .default([]),
1111
+ mcps: z
1112
+ .array(z.object({
740
1113
  mcpId: z.string(),
741
- permission: z.array(zPermissionRule).optional().default([])
742
- })).optional().default([]),
743
- releaseNotes: z.string().max(4096).optional()
1114
+ }))
1115
+ .optional()
1116
+ .default([]),
1117
+ releaseNotes: z.string().max(4096).optional(),
744
1118
  });
745
1119
  export const zAgentVersionCreatePath = z.object({
746
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
1120
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1121
+ });
1122
+ export const zAgentVersionCreateQuery = z.object({
1123
+ scope: z.enum(["user"]).optional(),
747
1124
  });
748
1125
  /**
749
1126
  * Created agent version
@@ -751,7 +1128,10 @@ export const zAgentVersionCreatePath = z.object({
751
1128
  export const zAgentVersionCreateResponse = zAgentVersion;
752
1129
  export const zAgentVersionGetPath = z.object({
753
1130
  id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
754
- version: z.string().min(1).max(32)
1131
+ version: z.string().min(1).max(32),
1132
+ });
1133
+ export const zAgentVersionGetQuery = z.object({
1134
+ scope: z.enum(["user"]).optional(),
755
1135
  });
756
1136
  /**
757
1137
  * Agent version details
@@ -759,31 +1139,97 @@ export const zAgentVersionGetPath = z.object({
759
1139
  export const zAgentVersionGetResponse = zAgentVersion;
760
1140
  export const zAgentVersionArchivePath = z.object({
761
1141
  id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
762
- version: z.string().min(1).max(32)
1142
+ version: z.string().min(1).max(32),
1143
+ });
1144
+ export const zAgentVersionArchiveQuery = z.object({
1145
+ scope: z.enum(["user"]).optional(),
763
1146
  });
764
1147
  /**
765
1148
  * Archived agent version
766
1149
  */
767
1150
  export const zAgentVersionArchiveResponse = zAgentVersion;
1151
+ /**
1152
+ * Billing summary
1153
+ */
1154
+ export const zBillingGetResponse = z.object({
1155
+ plan: z.string(),
1156
+ creditsBalance: z.string(),
1157
+ balanceCents: z.number(),
1158
+ consumedCredits: z.string(),
1159
+ consumedAmountCents: z.number(),
1160
+ grantedCredits: z.string(),
1161
+ });
1162
+ export const zBillingInvoicesQuery = z.object({
1163
+ page: z.int().gte(1).lte(9007199254740991).optional().default(1),
1164
+ perPage: z.int().gte(1).lte(100).optional().default(10),
1165
+ });
1166
+ /**
1167
+ * Paginated invoice list
1168
+ */
1169
+ export const zBillingInvoicesResponse = z.object({
1170
+ invoices: z.array(z.object({
1171
+ id: z.string(),
1172
+ number: z.string(),
1173
+ status: z.string(),
1174
+ paymentStatus: z.string(),
1175
+ totalAmountCents: z.number(),
1176
+ currency: z.string(),
1177
+ issuingDate: z.string(),
1178
+ invoiceType: z.string(),
1179
+ })),
1180
+ meta: z.object({
1181
+ currentPage: z.number(),
1182
+ totalPages: z.number(),
1183
+ totalCount: z.number(),
1184
+ }),
1185
+ });
1186
+ export const zBillingDailyUsageQuery = z.object({
1187
+ days: z.int().gte(1).lte(90).optional().default(30),
1188
+ });
1189
+ /**
1190
+ * Daily usage
1191
+ */
1192
+ export const zBillingDailyUsageResponse = z.array(z.object({
1193
+ date: z.string(),
1194
+ creditsUsed: z.string(),
1195
+ }));
1196
+ export const zBillingInvoicePaymentUrlQuery = z.object({
1197
+ id: z.string().min(1),
1198
+ });
1199
+ /**
1200
+ * Payment URL
1201
+ */
1202
+ export const zBillingInvoicePaymentUrlResponse = z.object({
1203
+ url: z.string(),
1204
+ });
1205
+ export const zBillingUpdatePlanBody = z.object({
1206
+ newPlan: z.enum(["free", "plus", "pro"]),
1207
+ });
1208
+ /**
1209
+ * Plan updated
1210
+ */
1211
+ export const zBillingUpdatePlanResponse = z.object({
1212
+ status: z.string(),
1213
+ plan: z.string(),
1214
+ effective: z.string(),
1215
+ });
768
1216
  export const zDashboardGetQuery = z.object({
769
- period: z.enum([
770
- '7d',
771
- '30d',
772
- '90d'
773
- ]).optional().default('30d'),
1217
+ period: z.enum(["7d", "30d", "90d"]).optional().default("30d"),
774
1218
  podId: z.string().optional(),
775
1219
  agentId: z.string().optional(),
776
- userId: z.string().optional()
1220
+ userId: z.string().optional(),
1221
+ include: z.array(z.enum(["summary", "over_time", "over_time_by_user", "by_agent", "by_user", "filters"])).optional(),
777
1222
  });
778
1223
  /**
779
1224
  * Dashboard analytics
780
1225
  */
781
1226
  export const zDashboardGetResponse = zDashboardResponse;
782
1227
  export const zEnvironmentListQuery = z.object({
1228
+ scope: z.enum(["user"]).optional(),
783
1229
  orgId: z.string().optional(),
784
- limit: z.number().gte(1).lte(100).optional(),
1230
+ limit: z.number().gte(1).lte(1000).optional(),
785
1231
  offset: z.number().gte(0).optional(),
786
- userId: z.string().nullish()
1232
+ userId: z.string().nullish(),
787
1233
  });
788
1234
  /**
789
1235
  * List of environments
@@ -792,23 +1238,32 @@ export const zEnvironmentListResponse = z.array(zEnvironment);
792
1238
  export const zEnvironmentCreateBody = z.object({
793
1239
  name: z.string().min(1).max(256),
794
1240
  networking: zNetworkingConfig,
795
- description: z.string().optional().default(''),
796
- hostingType: z.enum(['cloud']).optional().default('cloud'),
797
- packages: zPackagesConfig.optional()
1241
+ description: z.string().optional().default(""),
1242
+ hostingType: z.enum(["cloud"]).optional().default("cloud"),
1243
+ packages: zPackagesConfig.optional(),
1244
+ });
1245
+ export const zEnvironmentCreateQuery = z.object({
1246
+ scope: z.enum(["user"]).optional(),
798
1247
  });
799
1248
  /**
800
1249
  * Created environment
801
1250
  */
802
1251
  export const zEnvironmentCreateResponse = zEnvironment;
803
1252
  export const zEnvironmentDeletePath = z.object({
804
- id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/)
1253
+ id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/),
1254
+ });
1255
+ export const zEnvironmentDeleteQuery = z.object({
1256
+ scope: z.enum(["user"]).optional(),
805
1257
  });
806
1258
  /**
807
1259
  * Deleted environment
808
1260
  */
809
1261
  export const zEnvironmentDeleteResponse = zEnvironment;
810
1262
  export const zEnvironmentGetPath = z.object({
811
- id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/)
1263
+ id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/),
1264
+ });
1265
+ export const zEnvironmentGetQuery = z.object({
1266
+ scope: z.enum(["user"]).optional(),
812
1267
  });
813
1268
  /**
814
1269
  * Environment details
@@ -818,27 +1273,34 @@ export const zEnvironmentUpdateBody = z.object({
818
1273
  name: z.string().min(1).max(256).optional(),
819
1274
  description: z.string().optional(),
820
1275
  networking: zNetworkingConfig.optional(),
821
- packages: zPackagesConfig.optional()
1276
+ packages: zPackagesConfig.optional(),
822
1277
  });
823
1278
  export const zEnvironmentUpdatePath = z.object({
824
- id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/)
1279
+ id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/),
1280
+ });
1281
+ export const zEnvironmentUpdateQuery = z.object({
1282
+ scope: z.enum(["user"]).optional(),
825
1283
  });
826
1284
  /**
827
1285
  * Updated environment
828
1286
  */
829
1287
  export const zEnvironmentUpdateResponse = zEnvironment;
830
1288
  export const zEnvironmentArchivePath = z.object({
831
- id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/)
1289
+ id: z.string().regex(/^env_[0-9A-HJKMNP-TV-Z]{26}$/),
1290
+ });
1291
+ export const zEnvironmentArchiveQuery = z.object({
1292
+ scope: z.enum(["user"]).optional(),
832
1293
  });
833
1294
  /**
834
1295
  * Archived environment
835
1296
  */
836
1297
  export const zEnvironmentArchiveResponse = zEnvironment;
837
1298
  export const zFileStoreListQuery = z.object({
1299
+ scope: z.enum(["user"]).optional(),
838
1300
  orgId: z.string().optional(),
839
- limit: z.number().gte(1).lte(100).optional(),
1301
+ limit: z.number().gte(1).lte(1000).optional(),
840
1302
  offset: z.number().gte(0).optional(),
841
- userId: z.string().nullish()
1303
+ userId: z.string().nullish(),
842
1304
  });
843
1305
  /**
844
1306
  * List of file stores
@@ -846,14 +1308,21 @@ export const zFileStoreListQuery = z.object({
846
1308
  export const zFileStoreListResponse = z.array(zFileStore);
847
1309
  export const zFileStoreCreateBody = z.object({
848
1310
  name: z.string().min(1).max(256),
849
- description: z.string().optional().default('')
1311
+ description: z.string().optional().default(""),
1312
+ isDefault: z.boolean().optional().default(false),
1313
+ });
1314
+ export const zFileStoreCreateQuery = z.object({
1315
+ scope: z.enum(["user"]).optional(),
850
1316
  });
851
1317
  /**
852
1318
  * Created file store
853
1319
  */
854
1320
  export const zFileStoreCreateResponse = zFileStore;
855
1321
  export const zFileStoreGetPath = z.object({
856
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1322
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1323
+ });
1324
+ export const zFileStoreGetQuery = z.object({
1325
+ scope: z.enum(["user"]).optional(),
857
1326
  });
858
1327
  /**
859
1328
  * File store details
@@ -861,131 +1330,247 @@ export const zFileStoreGetPath = z.object({
861
1330
  export const zFileStoreGetResponse = zFileStore;
862
1331
  export const zFileStoreUpdateBody = z.object({
863
1332
  name: z.string().min(1).max(256).optional(),
864
- description: z.string().optional()
1333
+ description: z.string().nullish(),
865
1334
  });
866
1335
  export const zFileStoreUpdatePath = z.object({
867
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1336
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1337
+ });
1338
+ export const zFileStoreUpdateQuery = z.object({
1339
+ scope: z.enum(["user"]).optional(),
868
1340
  });
869
1341
  /**
870
1342
  * Updated file store
871
1343
  */
872
1344
  export const zFileStoreUpdateResponse = zFileStore;
873
1345
  export const zFileStoreArchivePath = z.object({
874
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1346
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1347
+ });
1348
+ export const zFileStoreArchiveQuery = z.object({
1349
+ scope: z.enum(["user"]).optional(),
875
1350
  });
876
1351
  /**
877
1352
  * Archived file store
878
1353
  */
879
1354
  export const zFileStoreArchiveResponse = zFileStore;
880
1355
  export const zFileStoreFilesDeletePath = z.object({
881
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1356
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
882
1357
  });
883
1358
  export const zFileStoreFilesDeleteQuery = z.object({
884
- path: z.string().min(1)
1359
+ scope: z.enum(["user"]).optional(),
1360
+ path: z.string().min(1),
885
1361
  });
886
1362
  /**
887
1363
  * Deleted
888
1364
  */
889
1365
  export const zFileStoreFilesDeleteResponse = z.object({
890
- ok: z.literal(true)
1366
+ ok: z.literal(true),
891
1367
  });
892
1368
  export const zFileStoreFilesListPath = z.object({
893
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1369
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
894
1370
  });
895
1371
  export const zFileStoreFilesListQuery = z.object({
1372
+ scope: z.enum(["user"]).optional(),
896
1373
  prefix: z.string().optional(),
897
- limit: z.int().gt(0).lte(1000).optional()
1374
+ limit: z.int().gt(0).lte(1000).optional(),
898
1375
  });
899
1376
  /**
900
1377
  * Files under the given prefix
901
1378
  */
902
1379
  export const zFileStoreFilesListResponse = z.array(zFileStoreFile);
903
- export const zFileStoreFilesUploadPath = z.object({
904
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
905
- });
906
- /**
907
- * Uploaded file info
908
- */
909
- export const zFileStoreFilesUploadResponse = z.array(zFileStoreFile);
910
1380
  export const zFileStoreFilesPresignDownloadPath = z.object({
911
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1381
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
912
1382
  });
913
1383
  export const zFileStoreFilesPresignDownloadQuery = z.object({
1384
+ scope: z.enum(["user"]).optional(),
914
1385
  path: z.string().min(1),
915
- expiresInSeconds: z.int().gt(0).lte(9007199254740991).optional()
1386
+ expiresInSeconds: z.int().gt(0).lte(9007199254740991).optional(),
916
1387
  });
917
1388
  /**
918
1389
  * Presigned download URL
919
1390
  */
920
1391
  export const zFileStoreFilesPresignDownloadResponse = zStorePresignResponse;
921
- export const zFileStoreFilesRenameBody = z.object({
922
- from: z.string().min(1),
923
- to: z.string().min(1),
924
- overwrite: z.boolean().optional(),
925
- contentType: z.string().optional()
1392
+ export const zFileStoreFilesStartUploadBody = z.object({
1393
+ path: z.string().min(1),
1394
+ size: z.int().gte(0).lte(52428800),
1395
+ contentType: z.string().optional(),
1396
+ });
1397
+ export const zFileStoreFilesStartUploadPath = z.object({
1398
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
926
1399
  });
927
- export const zFileStoreFilesRenamePath = z.object({
928
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1400
+ export const zFileStoreFilesStartUploadQuery = z.object({
1401
+ scope: z.enum(["user"]).optional(),
929
1402
  });
930
1403
  /**
931
- * Renamed file info
1404
+ * Presigned PUT URL the browser uploads to directly
932
1405
  */
933
- export const zFileStoreFilesRenameResponse = zFileStoreFile;
934
- export const zFileStoreFilesPresignUploadBody = z.object({
1406
+ export const zFileStoreFilesStartUploadResponse = zStoreStartUploadResponse;
1407
+ export const zFileStoreFilesFinalizeUploadBody = z.object({
935
1408
  path: z.string().min(1),
936
- contentType: z.string().optional(),
937
- expiresInSeconds: z.int().gt(0).lte(9007199254740991).optional()
938
1409
  });
939
- export const zFileStoreFilesPresignUploadPath = z.object({
940
- id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
1410
+ export const zFileStoreFilesFinalizeUploadPath = z.object({
1411
+ id: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1412
+ });
1413
+ export const zFileStoreFilesFinalizeUploadQuery = z.object({
1414
+ scope: z.enum(["user"]).optional(),
941
1415
  });
942
1416
  /**
943
- * Presigned upload URL
1417
+ * Finalized file info
1418
+ */
1419
+ export const zFileStoreFilesFinalizeUploadResponse = zFileStoreFile;
1420
+ export const zGithubStatusQuery = z.object({
1421
+ scope: z.enum(["user"]).optional(),
1422
+ });
1423
+ /**
1424
+ * GitHub configuration status
1425
+ */
1426
+ export const zGithubStatusResponse = zGithubStatus;
1427
+ export const zGithubInstallationListQuery = z.object({
1428
+ scope: z.enum(["user"]).optional(),
1429
+ });
1430
+ /**
1431
+ * Installations
1432
+ */
1433
+ export const zGithubInstallationListResponse = z.array(zGithubInstallationResponse);
1434
+ export const zGithubInstallationReposListPath = z.object({
1435
+ id: z.string().regex(/^ghi_[0-9A-HJKMNP-TV-Z]{26}$/),
1436
+ });
1437
+ export const zGithubInstallationReposListQuery = z.object({
1438
+ scope: z.enum(["user"]).optional(),
1439
+ });
1440
+ /**
1441
+ * Repositories
1442
+ */
1443
+ export const zGithubInstallationReposListResponse = z.array(z.object({
1444
+ fullName: z.string(),
1445
+ }));
1446
+ export const zGithubInstallationRefreshPath = z.object({
1447
+ id: z.string().regex(/^ghi_[0-9A-HJKMNP-TV-Z]{26}$/),
1448
+ });
1449
+ export const zGithubInstallationRefreshQuery = z.object({
1450
+ scope: z.enum(["user"]).optional(),
1451
+ });
1452
+ /**
1453
+ * Updated installation snapshot
1454
+ */
1455
+ export const zGithubInstallationRefreshResponse = zGithubInstallationResponse;
1456
+ export const zGithubInstallationRemovePath = z.object({
1457
+ id: z.string().regex(/^ghi_[0-9A-HJKMNP-TV-Z]{26}$/),
1458
+ });
1459
+ export const zGithubInstallationRemoveQuery = z.object({
1460
+ scope: z.enum(["user"]).optional(),
1461
+ });
1462
+ /**
1463
+ * Removed
944
1464
  */
945
- export const zFileStoreFilesPresignUploadResponse = zStorePresignResponse;
1465
+ export const zGithubInstallationRemoveResponse = z.void();
946
1466
  export const zMcpListQuery = z.object({
947
- limit: z.number().gte(1).lte(100).optional(),
948
- offset: z.number().gte(0).optional()
1467
+ scope: z.enum(["user"]).optional(),
1468
+ limit: z.number().gte(1).lte(1000).optional(),
1469
+ offset: z.number().gte(0).optional(),
1470
+ sort: z.enum(["popular", "trending", "recent"]).optional(),
949
1471
  });
950
1472
  /**
951
1473
  * List of MCPs
952
1474
  */
953
1475
  export const zMcpListResponse = z.array(zMcp);
954
1476
  export const zMcpCreateBody = z.object({
955
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/),
956
1477
  name: z.string().min(1).max(256),
957
- mcpServerUrl: z.url(),
958
- description: z.string().optional().default(''),
1478
+ description: z.string().optional().default(""),
959
1479
  icon: z.string().nullish().default(null),
960
- type: z.enum(['url']).optional().default('url'),
961
- auth: z.enum([
962
- 'none',
963
- 'oauth',
964
- 'api_key',
965
- 'basic'
966
- ]).optional().default('none'),
967
- authConfig: zMcpAuthConfig.nullish().default(null)
1480
+ mcpServerUrl: z.url(),
1481
+ docUrl: z.url().nullish().default(null),
1482
+ type: z.enum(["remote", "local"]).optional().default("remote"),
1483
+ transport: z.enum(["streamable-http", "sse", "stdio"]).optional().default("streamable-http"),
1484
+ command: z.string().nullish().default(null),
1485
+ args: z.array(z.string()).optional().default([]),
1486
+ version: z.string().nullish().default(null),
1487
+ repository: zRepository.nullish().default(null),
1488
+ tools: z.array(z.string()).optional().default([]),
1489
+ prompts: z.array(z.string()).optional().default([]),
1490
+ auth: z.enum(["none", "oauth", "api_key", "basic"]).optional().default("none"),
1491
+ authConfig: zMcpAuthConfig.nullish().default(null),
1492
+ tags: z.array(z.string()).optional(),
1493
+ });
1494
+ export const zMcpCreateQuery = z.object({
1495
+ scope: z.enum(["user"]).optional(),
968
1496
  });
969
1497
  /**
970
1498
  * Created MCP
971
1499
  */
972
1500
  export const zMcpCreateResponse = zMcp;
1501
+ export const zMcpSearchBody = z.object({
1502
+ query: z.string().optional(),
1503
+ sources: z
1504
+ .array(z.enum(["user", "org", "registry"]))
1505
+ .min(1)
1506
+ .optional()
1507
+ .default(["user", "org", "registry"]),
1508
+ limit: z.int().gte(1).lte(50).optional().default(20),
1509
+ });
1510
+ export const zMcpSearchQuery = z.object({
1511
+ scope: z.enum(["user"]).optional(),
1512
+ });
1513
+ /**
1514
+ * Matching MCPs
1515
+ */
1516
+ export const zMcpSearchResponse = z.array(zSearchResult);
973
1517
  export const zMcpGetBySlugPath = z.object({
974
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/)
1518
+ slug: z
1519
+ .string()
1520
+ .min(1)
1521
+ .max(128)
1522
+ .regex(/^[a-z0-9-]+$/),
1523
+ });
1524
+ export const zMcpGetBySlugQuery = z.object({
1525
+ scope: z.enum(["user"]).optional(),
975
1526
  });
976
1527
  /**
977
1528
  * MCP details
978
1529
  */
979
1530
  export const zMcpGetBySlugResponse = zMcp;
980
1531
  export const zMcpGetPath = z.object({
981
- id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/)
1532
+ id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
1533
+ });
1534
+ export const zMcpGetQuery = z.object({
1535
+ scope: z.enum(["user"]).optional(),
982
1536
  });
983
1537
  /**
984
1538
  * MCP details
985
1539
  */
986
1540
  export const zMcpGetResponse = zMcp;
1541
+ export const zMcpUpdateBody = z.object({
1542
+ name: z.string().min(1).max(256).optional(),
1543
+ description: z.string().nullish(),
1544
+ icon: z.string().nullish(),
1545
+ mcpServerUrl: z.url().optional(),
1546
+ docUrl: z.url().nullish(),
1547
+ type: z.enum(["remote", "local"]).optional(),
1548
+ transport: z.enum(["streamable-http", "sse", "stdio"]).optional(),
1549
+ command: z.string().nullish(),
1550
+ args: z.array(z.string()).optional(),
1551
+ version: z.string().nullish(),
1552
+ repository: zRepository.nullish(),
1553
+ tools: z.array(z.string()).optional(),
1554
+ prompts: z.array(z.string()).optional(),
1555
+ auth: z.enum(["none", "oauth", "api_key", "basic"]).optional(),
1556
+ authConfig: zMcpAuthConfig.nullish(),
1557
+ tags: z.array(z.string()).optional(),
1558
+ });
1559
+ export const zMcpUpdatePath = z.object({
1560
+ id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
1561
+ });
1562
+ export const zMcpUpdateQuery = z.object({
1563
+ scope: z.enum(["user"]).optional(),
1564
+ });
1565
+ /**
1566
+ * Updated MCP
1567
+ */
1568
+ export const zMcpUpdateResponse = zMcp;
987
1569
  export const zMcpArchivePath = z.object({
988
- id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/)
1570
+ id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
1571
+ });
1572
+ export const zMcpArchiveQuery = z.object({
1573
+ scope: z.enum(["user"]).optional(),
989
1574
  });
990
1575
  /**
991
1576
  * Archived MCP
@@ -993,7 +1578,10 @@ export const zMcpArchivePath = z.object({
993
1578
  export const zMcpArchiveResponse = zMcp;
994
1579
  export const zMcpOauthConnectBody = zMcpOAuthConnectBody;
995
1580
  export const zMcpOauthConnectPath = z.object({
996
- id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/)
1581
+ id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
1582
+ });
1583
+ export const zMcpOauthConnectQuery = z.object({
1584
+ scope: z.enum(["user"]).optional(),
997
1585
  });
998
1586
  /**
999
1587
  * OAuth connect result
@@ -1001,17 +1589,25 @@ export const zMcpOauthConnectPath = z.object({
1001
1589
  export const zMcpOauthConnectResponse = zMcpOAuthConnectResult;
1002
1590
  export const zMcpOauthSessionPath = z.object({
1003
1591
  id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
1004
- sessionId: z.string().regex(/^oas_[0-9A-HJKMNP-TV-Z]{26}$/)
1592
+ sessionId: z.string().regex(/^oas_[0-9A-HJKMNP-TV-Z]{26}$/),
1593
+ });
1594
+ export const zMcpOauthSessionQuery = z.object({
1595
+ scope: z.enum(["user"]).optional(),
1005
1596
  });
1006
1597
  /**
1007
1598
  * OAuth session status
1008
1599
  */
1009
1600
  export const zMcpOauthSessionResponse = zOAuthSessionStatus;
1601
+ /**
1602
+ * Resolved auth context
1603
+ */
1604
+ export const zMeGetResponse = zMe;
1010
1605
  export const zMemoryStoreListQuery = z.object({
1606
+ scope: z.enum(["user"]).optional(),
1011
1607
  orgId: z.string().optional(),
1012
- limit: z.number().gte(1).lte(100).optional(),
1608
+ limit: z.number().gte(1).lte(1000).optional(),
1013
1609
  offset: z.number().gte(0).optional(),
1014
- userId: z.string().nullish()
1610
+ userId: z.string().nullish(),
1015
1611
  });
1016
1612
  /**
1017
1613
  * List of memory stores
@@ -1019,15 +1615,21 @@ export const zMemoryStoreListQuery = z.object({
1019
1615
  export const zMemoryStoreListResponse = z.array(zMemoryStore);
1020
1616
  export const zMemoryStoreCreateBody = z.object({
1021
1617
  name: z.string().min(1).max(256),
1022
- description: z.string().optional().default(''),
1023
- prompt: z.string().max(4096).nullish().default(null)
1618
+ description: z.string().optional().default(""),
1619
+ isDefault: z.boolean().optional().default(false),
1620
+ });
1621
+ export const zMemoryStoreCreateQuery = z.object({
1622
+ scope: z.enum(["user"]).optional(),
1024
1623
  });
1025
1624
  /**
1026
1625
  * Created memory store
1027
1626
  */
1028
1627
  export const zMemoryStoreCreateResponse = zMemoryStore;
1029
1628
  export const zMemoryStoreGetPath = z.object({
1030
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1629
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1630
+ });
1631
+ export const zMemoryStoreGetQuery = z.object({
1632
+ scope: z.enum(["user"]).optional(),
1031
1633
  });
1032
1634
  /**
1033
1635
  * Memory store details
@@ -1035,72 +1637,116 @@ export const zMemoryStoreGetPath = z.object({
1035
1637
  export const zMemoryStoreGetResponse = zMemoryStore;
1036
1638
  export const zMemoryStoreUpdateBody = z.object({
1037
1639
  name: z.string().min(1).max(256).optional(),
1038
- description: z.string().optional(),
1039
- prompt: z.string().max(4096).nullish()
1640
+ description: z.string().nullish(),
1040
1641
  });
1041
1642
  export const zMemoryStoreUpdatePath = z.object({
1042
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1643
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1644
+ });
1645
+ export const zMemoryStoreUpdateQuery = z.object({
1646
+ scope: z.enum(["user"]).optional(),
1043
1647
  });
1044
1648
  /**
1045
1649
  * Updated memory store
1046
1650
  */
1047
1651
  export const zMemoryStoreUpdateResponse = zMemoryStore;
1048
1652
  export const zMemoryStoreArchivePath = z.object({
1049
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1653
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1654
+ });
1655
+ export const zMemoryStoreArchiveQuery = z.object({
1656
+ scope: z.enum(["user"]).optional(),
1050
1657
  });
1051
1658
  /**
1052
1659
  * Archived memory store
1053
1660
  */
1054
1661
  export const zMemoryStoreArchiveResponse = zMemoryStore;
1055
1662
  export const zMemoryStoreFilesDeletePath = z.object({
1056
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1663
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1057
1664
  });
1058
1665
  export const zMemoryStoreFilesDeleteQuery = z.object({
1059
- path: z.string().min(1)
1666
+ scope: z.enum(["user"]).optional(),
1667
+ path: z.string().min(1),
1060
1668
  });
1061
1669
  /**
1062
1670
  * Deleted
1063
1671
  */
1064
1672
  export const zMemoryStoreFilesDeleteResponse = z.object({
1065
- ok: z.literal(true)
1673
+ ok: z.literal(true),
1066
1674
  });
1067
1675
  export const zMemoryStoreFilesListPath = z.object({
1068
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1676
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1069
1677
  });
1070
1678
  export const zMemoryStoreFilesListQuery = z.object({
1679
+ scope: z.enum(["user"]).optional(),
1071
1680
  prefix: z.string().optional(),
1072
- limit: z.int().gt(0).lte(1000).optional()
1681
+ limit: z.int().gt(0).lte(1000).optional(),
1073
1682
  });
1074
1683
  /**
1075
1684
  * Files under the given prefix
1076
1685
  */
1077
1686
  export const zMemoryStoreFilesListResponse = z.array(zMemoryStoreFile);
1078
- export const zMemoryStoreFilesUploadPath = z.object({
1079
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1687
+ export const zMemoryStoreFilesPresignDownloadPath = z.object({
1688
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1689
+ });
1690
+ export const zMemoryStoreFilesPresignDownloadQuery = z.object({
1691
+ scope: z.enum(["user"]).optional(),
1692
+ path: z.string().min(1),
1693
+ expiresInSeconds: z.int().gt(0).lte(9007199254740991).optional(),
1080
1694
  });
1081
1695
  /**
1082
- * Uploaded file info
1696
+ * Presigned download URL
1083
1697
  */
1084
- export const zMemoryStoreFilesUploadResponse = z.array(zMemoryStoreFile);
1085
- export const zMemoryStoreFilesDownloadPath = z.object({
1086
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1698
+ export const zMemoryStoreFilesPresignDownloadResponse = zStorePresignResponse;
1699
+ export const zMemoryStoreFilesStartUploadBody = z.object({
1700
+ path: z.string().min(1),
1701
+ size: z.int().gte(0).lte(52428800),
1702
+ contentType: z.string().optional(),
1703
+ });
1704
+ export const zMemoryStoreFilesStartUploadPath = z.object({
1705
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1706
+ });
1707
+ export const zMemoryStoreFilesStartUploadQuery = z.object({
1708
+ scope: z.enum(["user"]).optional(),
1709
+ });
1710
+ /**
1711
+ * Presigned PUT URL the browser uploads to directly
1712
+ */
1713
+ export const zMemoryStoreFilesStartUploadResponse = zStoreStartUploadResponse;
1714
+ export const zMemoryStoreFilesFinalizeUploadBody = z.object({
1715
+ path: z.string().min(1),
1087
1716
  });
1088
- export const zMemoryStoreFilesDownloadQuery = z.object({
1089
- path: z.string().min(1)
1717
+ export const zMemoryStoreFilesFinalizeUploadPath = z.object({
1718
+ id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1090
1719
  });
1091
- export const zMemoryStoreFilesRenameBody = z.object({
1092
- from: z.string().min(1),
1093
- to: z.string().min(1),
1094
- overwrite: z.boolean().optional(),
1095
- contentType: z.string().optional()
1720
+ export const zMemoryStoreFilesFinalizeUploadQuery = z.object({
1721
+ scope: z.enum(["user"]).optional(),
1096
1722
  });
1097
- export const zMemoryStoreFilesRenamePath = z.object({
1098
- id: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
1723
+ /**
1724
+ * Finalized file info
1725
+ */
1726
+ export const zMemoryStoreFilesFinalizeUploadResponse = zMemoryStoreFile;
1727
+ /**
1728
+ * Grouped model list
1729
+ */
1730
+ export const zModelListResponse = zModelsResponse;
1731
+ export const zOnboardingStartBody = z.object({
1732
+ prompt: z.string().min(1).max(8000),
1733
+ skillIds: z.array(z.string()).max(64).optional().default([]),
1734
+ mcpIds: z.array(z.string()).max(64).optional().default([]),
1099
1735
  });
1736
+ export const zOnboardingStartQuery = z.object({
1737
+ scope: z.enum(["user"]).optional(),
1738
+ });
1739
+ /**
1740
+ * Session created and prompt sent
1741
+ */
1742
+ export const zOnboardingStartResponse = zOnboardingStart;
1100
1743
  /**
1101
- * Renamed file info
1744
+ * Personal organization ready
1102
1745
  */
1103
- export const zMemoryStoreFilesRenameResponse = zMemoryStoreFile;
1746
+ export const zOnboardingSetupPersonalOrgResponse = zOnboardingSetupPersonalOrg;
1747
+ export const zPatListQuery = z.object({
1748
+ scope: z.enum(["user"]).optional(),
1749
+ });
1104
1750
  /**
1105
1751
  * List of PATs
1106
1752
  */
@@ -1108,27 +1754,38 @@ export const zPatListResponse = z.array(zPat);
1108
1754
  export const zPatCreateBody = z.object({
1109
1755
  name: z.string().min(1).max(128),
1110
1756
  scopes: z.array(z.string()).min(1),
1111
- expiresAt: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).nullish().default(null)
1757
+ expiresAt: z.iso
1758
+ .datetime()
1759
+ .regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/)
1760
+ .nullish()
1761
+ .default(null),
1762
+ });
1763
+ export const zPatCreateQuery = z.object({
1764
+ scope: z.enum(["user"]).optional(),
1112
1765
  });
1113
1766
  /**
1114
1767
  * Created PAT (token shown once)
1115
1768
  */
1116
1769
  export const zPatCreateResponse = z.object({
1117
1770
  pat: zPat,
1118
- token: z.string()
1771
+ token: z.string(),
1119
1772
  });
1120
1773
  export const zPatRevokePath = z.object({
1121
- id: z.string().regex(/^pat_[0-9A-HJKMNP-TV-Z]{26}$/)
1774
+ id: z.string().regex(/^pat_[0-9A-HJKMNP-TV-Z]{26}$/),
1775
+ });
1776
+ export const zPatRevokeQuery = z.object({
1777
+ scope: z.enum(["user"]).optional(),
1122
1778
  });
1123
1779
  /**
1124
1780
  * Revoked PAT
1125
1781
  */
1126
1782
  export const zPatRevokeResponse = zPat;
1127
1783
  export const zPodListQuery = z.object({
1784
+ scope: z.enum(["user"]).optional(),
1128
1785
  orgId: z.string().optional(),
1129
- limit: z.number().gte(1).lte(100).optional(),
1786
+ limit: z.number().gte(1).lte(1000).optional(),
1130
1787
  offset: z.number().gte(0).optional(),
1131
- userId: z.string().nullish()
1788
+ userId: z.string().nullish(),
1132
1789
  });
1133
1790
  /**
1134
1791
  * List of pods
@@ -1137,15 +1794,22 @@ export const zPodListResponse = z.array(zPod);
1137
1794
  export const zPodCreateBody = z.object({
1138
1795
  name: z.string().min(1).max(256),
1139
1796
  environmentId: z.string().nullish().default(null),
1140
- description: z.string().optional().default(''),
1141
- isPrivate: z.boolean().optional().default(true)
1797
+ description: z.string().optional().default(""),
1798
+ isPrivate: z.boolean().optional().default(true),
1799
+ isDefault: z.boolean().optional().default(false),
1800
+ });
1801
+ export const zPodCreateQuery = z.object({
1802
+ scope: z.enum(["user"]).optional(),
1142
1803
  });
1143
1804
  /**
1144
- * Created pod
1805
+ * Created pod with freshly provisioned sandbox
1145
1806
  */
1146
- export const zPodCreateResponse = zPod;
1807
+ export const zPodCreateResponse = zPodWithSandbox;
1147
1808
  export const zPodGetPath = z.object({
1148
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1809
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1810
+ });
1811
+ export const zPodGetQuery = z.object({
1812
+ scope: z.enum(["user"]).optional(),
1149
1813
  });
1150
1814
  /**
1151
1815
  * Pod details
@@ -1155,24 +1819,33 @@ export const zPodUpdateBody = z.object({
1155
1819
  name: z.string().min(1).max(256).optional(),
1156
1820
  description: z.string().optional(),
1157
1821
  isPrivate: z.boolean().optional(),
1158
- environmentId: z.string().nullish()
1822
+ environmentId: z.string().nullish(),
1159
1823
  });
1160
1824
  export const zPodUpdatePath = z.object({
1161
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1825
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1826
+ });
1827
+ export const zPodUpdateQuery = z.object({
1828
+ scope: z.enum(["user"]).optional(),
1162
1829
  });
1163
1830
  /**
1164
1831
  * Updated pod
1165
1832
  */
1166
1833
  export const zPodUpdateResponse = zPod;
1167
1834
  export const zPodArchivePath = z.object({
1168
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1835
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1836
+ });
1837
+ export const zPodArchiveQuery = z.object({
1838
+ scope: z.enum(["user"]).optional(),
1169
1839
  });
1170
1840
  /**
1171
1841
  * Archived pod
1172
1842
  */
1173
1843
  export const zPodArchiveResponse = zPod;
1174
1844
  export const zPodMemberListPath = z.object({
1175
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1845
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1846
+ });
1847
+ export const zPodMemberListQuery = z.object({
1848
+ scope: z.enum(["user"]).optional(),
1176
1849
  });
1177
1850
  /**
1178
1851
  * List of members
@@ -1180,10 +1853,13 @@ export const zPodMemberListPath = z.object({
1180
1853
  export const zPodMemberListResponse = z.array(zPodMember);
1181
1854
  export const zPodMemberAddBody = z.object({
1182
1855
  userId: z.string().regex(/^usr_[0-9A-HJKMNP-TV-Z]{26}$/),
1183
- role: z.enum(['owner', 'member']).optional().default('member')
1856
+ role: z.enum(["owner", "member"]).optional().default("member"),
1184
1857
  });
1185
1858
  export const zPodMemberAddPath = z.object({
1186
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1859
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1860
+ });
1861
+ export const zPodMemberAddQuery = z.object({
1862
+ scope: z.enum(["user"]).optional(),
1187
1863
  });
1188
1864
  /**
1189
1865
  * Added member
@@ -1191,14 +1867,20 @@ export const zPodMemberAddPath = z.object({
1191
1867
  export const zPodMemberAddResponse = zPodMember;
1192
1868
  export const zPodMemberRemovePath = z.object({
1193
1869
  id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1194
- userId: z.string().regex(/^usr_[0-9A-HJKMNP-TV-Z]{26}$/)
1870
+ userId: z.string().regex(/^usr_[0-9A-HJKMNP-TV-Z]{26}$/),
1871
+ });
1872
+ export const zPodMemberRemoveQuery = z.object({
1873
+ scope: z.enum(["user"]).optional(),
1195
1874
  });
1196
1875
  /**
1197
1876
  * Removed member
1198
1877
  */
1199
1878
  export const zPodMemberRemoveResponse = zPodMember;
1200
1879
  export const zPodVaultListPath = z.object({
1201
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1880
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1881
+ });
1882
+ export const zPodVaultListQuery = z.object({
1883
+ scope: z.enum(["user"]).optional(),
1202
1884
  });
1203
1885
  /**
1204
1886
  * List of vault associations
@@ -1206,10 +1888,13 @@ export const zPodVaultListPath = z.object({
1206
1888
  export const zPodVaultListResponse = z.array(zPodVault);
1207
1889
  export const zPodVaultAddBody = z.object({
1208
1890
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
1209
- priority: z.int().gte(-9007199254740991).lte(9007199254740991).optional().default(0)
1891
+ priority: z.int().gte(-9007199254740991).lte(9007199254740991).optional().default(0),
1210
1892
  });
1211
1893
  export const zPodVaultAddPath = z.object({
1212
- id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1894
+ id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1895
+ });
1896
+ export const zPodVaultAddQuery = z.object({
1897
+ scope: z.enum(["user"]).optional(),
1213
1898
  });
1214
1899
  /**
1215
1900
  * Added vault
@@ -1217,818 +1902,715 @@ export const zPodVaultAddPath = z.object({
1217
1902
  export const zPodVaultAddResponse = zPodVault;
1218
1903
  export const zPodVaultRemovePath = z.object({
1219
1904
  id: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1220
- vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
1905
+ vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
1906
+ });
1907
+ export const zPodVaultRemoveQuery = z.object({
1908
+ scope: z.enum(["user"]).optional(),
1221
1909
  });
1222
1910
  /**
1223
1911
  * Removed vault
1224
1912
  */
1225
1913
  export const zPodVaultRemoveResponse = zPodVault;
1226
- export const zPodSandboxCurrentPath = z.object({
1227
- podId: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1914
+ export const zPodSandboxProvisionPath = z.object({
1915
+ podId: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1916
+ });
1917
+ export const zPodSandboxProvisionQuery = z.object({
1918
+ scope: z.enum(["user"]).optional(),
1228
1919
  });
1229
1920
  /**
1230
- * Current sandbox
1921
+ * Workflow started or joined
1231
1922
  */
1232
- export const zPodSandboxCurrentResponse = zSandbox;
1233
- export const zPodSandboxProvisionPath = z.object({
1234
- podId: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1923
+ export const zPodSandboxProvisionResponse2 = zPodSandboxProvisionResponse;
1924
+ export const zPodSandboxStatusPath = z.object({
1925
+ podId: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1926
+ });
1927
+ export const zPodSandboxStatusQuery = z.object({
1928
+ scope: z.enum(["user"]).optional(),
1235
1929
  });
1236
1930
  /**
1237
- * Existing active sandbox (no-op)
1931
+ * Current sandbox state
1238
1932
  */
1239
- export const zPodSandboxProvisionResponse = zSandbox;
1240
- export const zPodProjectListPath = z.object({
1241
- podId: z.string()
1242
- });
1243
- export const zPodProjectListQuery = z.object({
1244
- limit: z.number().gte(1).lte(100).optional(),
1245
- offset: z.number().gte(0).optional()
1933
+ export const zPodSandboxStatusResponse2 = zPodSandboxStatusResponse;
1934
+ export const zProjectListQuery = z.object({
1935
+ scope: z.enum(["user"]).optional(),
1936
+ limit: z.number().gte(1).lte(1000).optional(),
1937
+ offset: z.number().gte(0).optional(),
1938
+ podId: z
1939
+ .string()
1940
+ .regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/)
1941
+ .optional(),
1246
1942
  });
1247
1943
  /**
1248
1944
  * List of projects
1249
1945
  */
1250
- export const zPodProjectListResponse = z.array(zProject);
1251
- export const zPodProjectCreateBody = z.object({
1946
+ export const zProjectListResponse = z.array(zProject);
1947
+ export const zProjectCreateBody = z.object({
1948
+ podId: z.string().regex(/^pod_[0-9A-HJKMNP-TV-Z]{26}$/),
1252
1949
  name: z.string().min(1).max(256),
1253
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/),
1254
- description: z.string().optional().default(''),
1255
- path: z.string().nullish().default(null),
1256
- permission: z.array(zPermissionRule).optional().default([]),
1257
- gitRepos: z.array(zGitRepo).optional().default([])
1950
+ description: z.string().optional().default(""),
1951
+ permission: zPermissionConfig.optional(),
1952
+ gitRepo: zProjectGitRepo.nullish().default(null),
1258
1953
  });
1259
- export const zPodProjectCreatePath = z.object({
1260
- podId: z.string()
1954
+ export const zProjectCreateQuery = z.object({
1955
+ scope: z.enum(["user"]).optional(),
1261
1956
  });
1262
1957
  /**
1263
1958
  * Created project
1264
1959
  */
1265
- export const zPodProjectCreateResponse = zProject;
1266
- export const zPodProjectGetPath = z.object({
1960
+ export const zProjectCreateResponse = zProject;
1961
+ export const zProjectGetPath = z.object({
1267
1962
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1268
- podId: z.string()
1963
+ });
1964
+ export const zProjectGetQuery = z.object({
1965
+ scope: z.enum(["user"]).optional(),
1269
1966
  });
1270
1967
  /**
1271
1968
  * Project details
1272
1969
  */
1273
- export const zPodProjectGetResponse = zProject;
1274
- export const zPodProjectUpdateBody = z.object({
1970
+ export const zProjectGetResponse = zProject;
1971
+ export const zProjectUpdateBody = z.object({
1275
1972
  name: z.string().min(1).max(256).optional(),
1276
1973
  description: z.string().optional(),
1277
- path: z.string().nullish(),
1278
- permission: z.array(zPermissionRule).optional(),
1279
- gitRepos: z.array(zGitRepo).optional()
1974
+ permission: zPermissionConfig.optional(),
1975
+ gitRepo: zProjectGitRepo.nullish(),
1280
1976
  });
1281
- export const zPodProjectUpdatePath = z.object({
1977
+ export const zProjectUpdatePath = z.object({
1282
1978
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1283
- podId: z.string()
1979
+ });
1980
+ export const zProjectUpdateQuery = z.object({
1981
+ scope: z.enum(["user"]).optional(),
1284
1982
  });
1285
1983
  /**
1286
1984
  * Updated project
1287
1985
  */
1288
- export const zPodProjectUpdateResponse = zProject;
1289
- export const zPodProjectArchivePath = z.object({
1986
+ export const zProjectUpdateResponse = zProject;
1987
+ export const zProjectAgentListPath = z.object({
1290
1988
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1291
- podId: z.string()
1292
1989
  });
1293
- /**
1294
- * Archived project
1295
- */
1296
- export const zPodProjectArchiveResponse = zProject;
1297
- export const zPodProjectAgentListPath = z.object({
1298
- id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1299
- podId: z.string()
1990
+ export const zProjectAgentListQuery = z.object({
1991
+ scope: z.enum(["user"]).optional(),
1300
1992
  });
1301
1993
  /**
1302
1994
  * List of agent memberships
1303
1995
  */
1304
- export const zPodProjectAgentListResponse = z.array(zProjectAgent);
1305
- export const zPodProjectAgentAddBody = z.object({
1996
+ export const zProjectAgentListResponse = z.array(zProjectAgent);
1997
+ export const zProjectAgentAddBody = z.object({
1306
1998
  agentId: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1307
1999
  agentVersionId: z.string().nullish().default(null),
1308
- type: z.enum(['primary', 'subagent']).optional().default('subagent')
2000
+ type: z.enum(["primary", "subagent", "all"]).optional().default("all"),
1309
2001
  });
1310
- export const zPodProjectAgentAddPath = z.object({
2002
+ export const zProjectAgentAddPath = z.object({
1311
2003
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1312
- podId: z.string()
2004
+ });
2005
+ export const zProjectAgentAddQuery = z.object({
2006
+ scope: z.enum(["user"]).optional(),
1313
2007
  });
1314
2008
  /**
1315
- * Added agent
2009
+ * Attached agent
1316
2010
  */
1317
- export const zPodProjectAgentAddResponse = zProjectAgent;
1318
- export const zPodProjectAgentRemovePath = z.object({
2011
+ export const zProjectAgentAddResponse = zProjectAgent;
2012
+ export const zProjectAgentRemovePath = z.object({
1319
2013
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1320
2014
  agentId: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
1321
- podId: z.string()
2015
+ });
2016
+ export const zProjectAgentRemoveQuery = z.object({
2017
+ scope: z.enum(["user"]).optional(),
1322
2018
  });
1323
2019
  /**
1324
- * Removed agent
2020
+ * Detached agent
1325
2021
  */
1326
- export const zPodProjectAgentRemoveResponse = zProjectAgent;
1327
- export const zPodProjectFileStoreListPath = z.object({
2022
+ export const zProjectAgentRemoveResponse = zProjectAgent;
2023
+ export const zProjectFileStoreListPath = z.object({
1328
2024
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1329
- podId: z.string()
2025
+ });
2026
+ export const zProjectFileStoreListQuery = z.object({
2027
+ scope: z.enum(["user"]).optional(),
1330
2028
  });
1331
2029
  /**
1332
2030
  * List of file store attachments
1333
2031
  */
1334
- export const zPodProjectFileStoreListResponse = z.array(zProjectFileStore);
1335
- export const zPodProjectFileStoreAddBody = z.object({
1336
- resources: z.array(zFileStoreResource).optional().default([]),
1337
- fileStoreId: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/)
2032
+ export const zProjectFileStoreListResponse = z.array(zProjectFileStore);
2033
+ export const zProjectFileStoreAddBody = z.object({
2034
+ fileStoreId: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1338
2035
  });
1339
- export const zPodProjectFileStoreAddPath = z.object({
2036
+ export const zProjectFileStoreAddPath = z.object({
1340
2037
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1341
- podId: z.string()
2038
+ });
2039
+ export const zProjectFileStoreAddQuery = z.object({
2040
+ scope: z.enum(["user"]).optional(),
1342
2041
  });
1343
2042
  /**
1344
2043
  * Attached file store
1345
2044
  */
1346
- export const zPodProjectFileStoreAddResponse = zProjectFileStore;
1347
- export const zPodProjectFileStoreRemovePath = z.object({
2045
+ export const zProjectFileStoreAddResponse = zProjectFileStore;
2046
+ export const zProjectFileStoreRemovePath = z.object({
1348
2047
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1349
2048
  fileStoreId: z.string().regex(/^fst_[0-9A-HJKMNP-TV-Z]{26}$/),
1350
- podId: z.string()
2049
+ });
2050
+ export const zProjectFileStoreRemoveQuery = z.object({
2051
+ scope: z.enum(["user"]).optional(),
1351
2052
  });
1352
2053
  /**
1353
2054
  * Detached file store
1354
2055
  */
1355
- export const zPodProjectFileStoreRemoveResponse = zProjectFileStore;
1356
- export const zPodProjectMemoryStoreListPath = z.object({
2056
+ export const zProjectFileStoreRemoveResponse = zProjectFileStore;
2057
+ export const zProjectMemoryStoreListPath = z.object({
1357
2058
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1358
- podId: z.string()
2059
+ });
2060
+ export const zProjectMemoryStoreListQuery = z.object({
2061
+ scope: z.enum(["user"]).optional(),
1359
2062
  });
1360
2063
  /**
1361
2064
  * List of memory store attachments
1362
2065
  */
1363
- export const zPodProjectMemoryStoreListResponse = z.array(zProjectMemoryStore);
1364
- export const zPodProjectMemoryStoreAddBody = z.object({
1365
- memoryStoreId: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/)
2066
+ export const zProjectMemoryStoreListResponse = z.array(zProjectMemoryStore);
2067
+ export const zProjectMemoryStoreAddBody = z.object({
2068
+ memoryStoreId: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1366
2069
  });
1367
- export const zPodProjectMemoryStoreAddPath = z.object({
2070
+ export const zProjectMemoryStoreAddPath = z.object({
1368
2071
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1369
- podId: z.string()
2072
+ });
2073
+ export const zProjectMemoryStoreAddQuery = z.object({
2074
+ scope: z.enum(["user"]).optional(),
1370
2075
  });
1371
2076
  /**
1372
2077
  * Attached memory store
1373
2078
  */
1374
- export const zPodProjectMemoryStoreAddResponse = zProjectMemoryStore;
1375
- export const zPodProjectMemoryStoreRemovePath = z.object({
2079
+ export const zProjectMemoryStoreAddResponse = zProjectMemoryStore;
2080
+ export const zProjectMemoryStoreRemovePath = z.object({
1376
2081
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1377
2082
  memoryStoreId: z.string().regex(/^mst_[0-9A-HJKMNP-TV-Z]{26}$/),
1378
- podId: z.string()
2083
+ });
2084
+ export const zProjectMemoryStoreRemoveQuery = z.object({
2085
+ scope: z.enum(["user"]).optional(),
1379
2086
  });
1380
2087
  /**
1381
2088
  * Detached memory store
1382
2089
  */
1383
- export const zPodProjectMemoryStoreRemoveResponse = zProjectMemoryStore;
1384
- export const zPodProjectRoutineListPath = z.object({
2090
+ export const zProjectMemoryStoreRemoveResponse = zProjectMemoryStore;
2091
+ export const zProjectArchivePath = z.object({
1385
2092
  id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1386
- podId: z.string()
1387
2093
  });
1388
- export const zPodProjectRoutineListQuery = z.object({
1389
- limit: z.number().gte(1).lte(100).optional(),
1390
- offset: z.number().gte(0).optional()
2094
+ export const zProjectArchiveQuery = z.object({
2095
+ scope: z.enum(["user"]).optional(),
1391
2096
  });
1392
2097
  /**
1393
- * List of routines in this project
2098
+ * Archived project
1394
2099
  */
1395
- export const zPodProjectRoutineListResponse = z.array(zRoutine);
1396
- export const zPodProjectRoutinesRunsListAllPath = z.object({
1397
- id: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1398
- podId: z.string()
1399
- });
1400
- export const zPodProjectRoutinesRunsListAllQuery = z.object({
1401
- status: z.enum([
1402
- 'pending',
1403
- 'running',
1404
- 'completed',
1405
- 'failed',
1406
- 'cancelled'
1407
- ]).optional(),
1408
- sessionId: z.string().nullish(),
1409
- limit: z.number().gte(1).lte(100).optional(),
2100
+ export const zProjectArchiveResponse = zProject;
2101
+ export const zReplayListQuery = z.object({
2102
+ scope: z.enum(["user"]).optional(),
2103
+ limit: z.number().gte(1).lte(1000).optional(),
1410
2104
  offset: z.number().gte(0).optional(),
1411
- createdAfter: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional(),
1412
- createdBefore: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
2105
+ publisherId: z.string().optional(),
2106
+ });
2107
+ /**
2108
+ * List
2109
+ */
2110
+ export const zReplayListResponse = z.array(zReplay);
2111
+ export const zReplayCreateBody = z.object({
2112
+ sessionId: z.string(),
2113
+ publisherId: z.string().nullish().default(null),
2114
+ websiteMetadata: zWebsiteMetadata.nullish().default(null),
2115
+ });
2116
+ export const zReplayCreateQuery = z.object({
2117
+ scope: z.enum(["user"]).optional(),
2118
+ });
2119
+ /**
2120
+ * Created
2121
+ */
2122
+ export const zReplayCreateResponse = zReplay;
2123
+ export const zReplayGetPath = z.object({
2124
+ id: z.string().regex(/^rpl_[0-9A-HJKMNP-TV-Z]{26}$/),
2125
+ });
2126
+ export const zReplayGetQuery = z.object({
2127
+ scope: z.enum(["user"]).optional(),
2128
+ });
2129
+ /**
2130
+ * Details
2131
+ */
2132
+ export const zReplayGetResponse = zReplay;
2133
+ export const zReplayArchivePath = z.object({
2134
+ id: z.string().regex(/^rpl_[0-9A-HJKMNP-TV-Z]{26}$/),
2135
+ });
2136
+ export const zReplayArchiveQuery = z.object({
2137
+ scope: z.enum(["user"]).optional(),
1413
2138
  });
1414
2139
  /**
1415
- * List of routine runs in this project
2140
+ * Archived
1416
2141
  */
1417
- export const zPodProjectRoutinesRunsListAllResponse = z.array(zRoutineRun);
1418
- export const zPodSessionListPath = z.object({
1419
- podId: z.string()
2142
+ export const zReplayArchiveResponse = zReplay;
2143
+ export const zReplayShareBody = z.object({
2144
+ sessionId: z.string(),
2145
+ websiteMetadata: zWebsiteMetadata.nullish(),
2146
+ });
2147
+ export const zReplayShareQuery = z.object({
2148
+ scope: z.enum(["user"]).optional(),
1420
2149
  });
1421
- export const zPodSessionListQuery = z.object({
2150
+ /**
2151
+ * Shared replay
2152
+ */
2153
+ export const zReplayShareResponse = zReplay;
2154
+ export const zSessionListQuery = z.object({
2155
+ scope: z.enum(["user"]).optional(),
2156
+ podId: z.string().optional(),
1422
2157
  projectId: z.string().optional(),
1423
2158
  createdById: z.string().optional(),
1424
- limit: z.number().gte(1).lte(100).optional(),
2159
+ limit: z.number().gte(1).lte(1000).optional(),
1425
2160
  offset: z.number().gte(0).optional(),
1426
- orgId: z.string().optional()
1427
2161
  });
1428
2162
  /**
1429
2163
  * List of sessions
1430
2164
  */
1431
- export const zPodSessionListResponse = z.array(zOpencodeSession);
1432
- export const zPodSessionCreateBody = z.object({
1433
- id: z.string(),
1434
- projectId: z.string(),
1435
- slug: z.string(),
1436
- directory: z.string(),
2165
+ export const zSessionListResponse = z.array(zOpencodeSession);
2166
+ export const zSessionCreateBody = z.object({
2167
+ podId: z.string().min(1),
2168
+ projectId: z.string().min(1),
1437
2169
  title: z.string().min(1).max(512),
1438
- version: z.string(),
1439
- shareUrl: z.string().nullish().default(null),
1440
- parentId: z.string().nullish().default(null)
1441
2170
  });
1442
- export const zPodSessionCreatePath = z.object({
1443
- podId: z.string()
2171
+ export const zSessionCreateQuery = z.object({
2172
+ scope: z.enum(["user"]).optional(),
1444
2173
  });
1445
2174
  /**
1446
2175
  * Created session
1447
2176
  */
1448
- export const zPodSessionCreateResponse = zOpencodeSession;
1449
- export const zPodSessionGetPath = z.object({
2177
+ export const zSessionCreateResponse = zOpencodeSession;
2178
+ export const zSessionGetPath = z.object({
1450
2179
  id: z.string().min(1),
1451
- podId: z.string()
2180
+ });
2181
+ export const zSessionGetQuery = z.object({
2182
+ scope: z.enum(["user"]).optional(),
1452
2183
  });
1453
2184
  /**
1454
2185
  * Session details
1455
2186
  */
1456
- export const zPodSessionGetResponse = zOpencodeSession;
1457
- export const zPodSessionUpdateBody = z.object({
2187
+ export const zSessionGetResponse = zOpencodeSession;
2188
+ export const zSessionUpdateBody = z.object({
1458
2189
  title: z.string().optional(),
1459
2190
  shareUrl: z.string().nullish(),
1460
2191
  summaryAdditions: z.number().nullish(),
1461
2192
  summaryDeletions: z.number().nullish(),
1462
- summaryFiles: z.number().nullish()
2193
+ summaryFiles: z.number().nullish(),
2194
+ status: z.enum(["idle", "busy", "waiting", "error"]).optional(),
2195
+ error: z
2196
+ .object({
2197
+ code: z.string(),
2198
+ message: z.string(),
2199
+ details: z.record(z.string(), z.unknown()).optional(),
2200
+ })
2201
+ .nullish(),
2202
+ currentProjectAgentId: z.string().optional(),
1463
2203
  });
1464
- export const zPodSessionUpdatePath = z.object({
2204
+ export const zSessionUpdatePath = z.object({
1465
2205
  id: z.string().min(1),
1466
- podId: z.string()
1467
2206
  });
1468
- /**
1469
- * Updated session
1470
- */
1471
- export const zPodSessionUpdateResponse = zOpencodeSession;
1472
- export const zPodSessionArchivePath = z.object({
1473
- id: z.string().min(1),
1474
- podId: z.string()
2207
+ export const zSessionUpdateQuery = z.object({
2208
+ scope: z.enum(["user"]).optional(),
1475
2209
  });
1476
2210
  /**
1477
- * Archived session
2211
+ * Updated session
1478
2212
  */
1479
- export const zPodSessionArchiveResponse = zOpencodeSession;
1480
- export const zPodSessionMessageListPath = z.object({
2213
+ export const zSessionUpdateResponse = zOpencodeSession;
2214
+ export const zSessionAuthRequirementsPath = z.object({
1481
2215
  id: z.string().min(1),
1482
- podId: z.string()
1483
2216
  });
1484
- export const zPodSessionMessageListQuery = z.object({
1485
- limit: z.number().gte(1).lte(100).optional(),
1486
- offset: z.number().gte(0).optional()
2217
+ export const zSessionAuthRequirementsQuery = z.object({
2218
+ scope: z.enum(["user"]).optional(),
1487
2219
  });
1488
2220
  /**
1489
- * List of messages
2221
+ * Auth requirements with satisfaction flags
1490
2222
  */
1491
- export const zPodSessionMessageListResponse = z.array(zOpencodeMessage);
1492
- export const zPodRoutineListPath = z.object({
1493
- podId: z.string()
2223
+ export const zSessionAuthRequirementsResponse = zAuthRequirements;
2224
+ export const zSessionArchivePath = z.object({
2225
+ id: z.string().min(1),
1494
2226
  });
1495
- export const zPodRoutineListQuery = z.object({
1496
- projectId: z.string().optional(),
1497
- limit: z.number().gte(1).lte(100).optional(),
1498
- offset: z.number().gte(0).optional()
2227
+ export const zSessionArchiveQuery = z.object({
2228
+ scope: z.enum(["user"]).optional(),
1499
2229
  });
1500
2230
  /**
1501
- * List of routines
2231
+ * Archived session
1502
2232
  */
1503
- export const zPodRoutineListResponse = z.array(zRoutine);
1504
- export const zPodRoutineCreateBody = z.object({
1505
- projectId: z.string(),
1506
- projectAgentId: z.string(),
1507
- name: z.string().min(1).max(256),
1508
- prompt: z.string().min(1),
1509
- description: z.string().nullish().default(''),
1510
- status: z.enum(['active', 'paused']).optional().default('active')
2233
+ export const zSessionArchiveResponse = zOpencodeSession;
2234
+ export const zSessionFilesPresignUploadBody = z.object({
2235
+ filename: z.string().min(1),
2236
+ contentType: z.string().min(1),
2237
+ size: z.int().gte(0).lte(9007199254740991),
1511
2238
  });
1512
- export const zPodRoutineCreatePath = z.object({
1513
- podId: z.string()
2239
+ export const zSessionFilesPresignUploadPath = z.object({
2240
+ id: z.string().min(1),
1514
2241
  });
1515
- /**
1516
- * Created routine
1517
- */
1518
- export const zPodRoutineCreateResponse = zRoutine;
1519
- export const zPodRoutineGetPath = z.object({
1520
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1521
- podId: z.string()
2242
+ export const zSessionFilesPresignUploadQuery = z.object({
2243
+ scope: z.enum(["user"]).optional(),
1522
2244
  });
1523
2245
  /**
1524
- * Routine details
2246
+ * Presigned upload URL
1525
2247
  */
1526
- export const zPodRoutineGetResponse = zRoutine;
1527
- export const zPodRoutineUpdateBody = z.object({
1528
- name: z.string().min(1).max(256).optional(),
1529
- description: z.string().nullish(),
1530
- prompt: z.string().min(1).optional(),
1531
- projectAgentId: z.string().optional(),
1532
- status: z.enum(['active', 'paused']).optional()
2248
+ export const zSessionFilesPresignUploadResponse2 = zSessionFilesPresignUploadResponse;
2249
+ export const zSessionFilesPresignDownloadBody = zSessionVolumeRef;
2250
+ export const zSessionFilesPresignDownloadPath = z.object({
2251
+ id: z.string().min(1),
1533
2252
  });
1534
- export const zPodRoutineUpdatePath = z.object({
1535
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1536
- podId: z.string()
2253
+ export const zSessionFilesPresignDownloadQuery = z.object({
2254
+ scope: z.enum(["user"]).optional(),
1537
2255
  });
1538
2256
  /**
1539
- * Updated routine
2257
+ * Presigned download URL
1540
2258
  */
1541
- export const zPodRoutineUpdateResponse = zRoutine;
1542
- export const zPodRoutineArchivePath = z.object({
1543
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1544
- podId: z.string()
2259
+ export const zSessionFilesPresignDownloadResponse2 = zSessionFilesPresignDownloadResponse;
2260
+ export const zSkillListQuery = z.object({
2261
+ scope: z.enum(["user"]).optional(),
2262
+ limit: z.number().gte(1).lte(1000).optional(),
2263
+ offset: z.number().gte(0).optional(),
2264
+ sort: z.enum(["popular", "trending", "recent"]).optional(),
1545
2265
  });
1546
2266
  /**
1547
- * Archived routine
2267
+ * List of skills
1548
2268
  */
1549
- export const zPodRoutineArchiveResponse = zRoutine;
1550
- export const zPodRoutinePausePath = z.object({
1551
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1552
- podId: z.string()
2269
+ export const zSkillListResponse = z.array(zSkill);
2270
+ export const zSkillCreateBody = z.object({
2271
+ name: z.string(),
2272
+ description: z.string().optional(),
2273
+ icon: z.string().optional(),
2274
+ tags: z.string().optional(),
2275
+ requiredCredentials: z.string().optional(),
2276
+ releaseNotes: z.string().optional(),
2277
+ source: z.string().optional(),
2278
+ files: z.array(z.string()),
1553
2279
  });
1554
- /**
1555
- * Paused routine
1556
- */
1557
- export const zPodRoutinePauseResponse = zRoutine;
1558
- export const zPodRoutineResumePath = z.object({
1559
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1560
- podId: z.string()
2280
+ export const zSkillCreateQuery = z.object({
2281
+ scope: z.enum(["user"]).optional(),
1561
2282
  });
1562
2283
  /**
1563
- * Resumed routine
2284
+ * Created skill
1564
2285
  */
1565
- export const zPodRoutineResumeResponse = zRoutine;
1566
- export const zPodRoutineCronTriggerListPath = z.object({
1567
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1568
- podId: z.string()
2286
+ export const zSkillCreateResponse = zSkill;
2287
+ export const zSkillSearchBody = z.object({
2288
+ query: z.string().optional(),
2289
+ sources: z
2290
+ .array(z.enum(["user", "org", "registry"]))
2291
+ .min(1)
2292
+ .optional()
2293
+ .default(["user", "org", "registry"]),
2294
+ limit: z.int().gte(1).lte(50).optional().default(20),
1569
2295
  });
1570
- export const zPodRoutineCronTriggerListQuery = z.object({
1571
- limit: z.number().gte(1).lte(100).optional(),
1572
- offset: z.number().gte(0).optional()
2296
+ export const zSkillSearchQuery = z.object({
2297
+ scope: z.enum(["user"]).optional(),
1573
2298
  });
1574
2299
  /**
1575
- * List of cron triggers
2300
+ * Matching skills
1576
2301
  */
1577
- export const zPodRoutineCronTriggerListResponse = z.array(zCronTrigger);
1578
- export const zPodRoutineCronTriggerCreateBody = z.object({
1579
- schedule: z.string().min(1),
1580
- timezone: z.string().nullish().default(null),
1581
- isEnabled: z.boolean().optional().default(true)
2302
+ export const zSkillSearchResponse = z.array(zSearchResult);
2303
+ export const zSkillGetBySlugPath = z.object({
2304
+ slug: z
2305
+ .string()
2306
+ .min(1)
2307
+ .max(128)
2308
+ .regex(/^[a-z0-9-]+$/),
1582
2309
  });
1583
- export const zPodRoutineCronTriggerCreatePath = z.object({
1584
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1585
- podId: z.string()
2310
+ export const zSkillGetBySlugQuery = z.object({
2311
+ scope: z.enum(["user"]).optional(),
1586
2312
  });
1587
2313
  /**
1588
- * Created cron trigger
2314
+ * Skill details
1589
2315
  */
1590
- export const zPodRoutineCronTriggerCreateResponse = zCronTrigger;
1591
- export const zPodRoutineCronTriggerGetPath = z.object({
1592
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1593
- triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1594
- podId: z.string()
2316
+ export const zSkillGetBySlugResponse = zSkill;
2317
+ export const zSkillGetPath = z.object({
2318
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2319
+ });
2320
+ export const zSkillGetQuery = z.object({
2321
+ scope: z.enum(["user"]).optional(),
1595
2322
  });
1596
2323
  /**
1597
- * Cron trigger details
2324
+ * Skill details
1598
2325
  */
1599
- export const zPodRoutineCronTriggerGetResponse = zCronTrigger;
1600
- export const zPodRoutineCronTriggerUpdateBody = z.object({
1601
- schedule: z.string().min(1).optional(),
1602
- timezone: z.string().nullish(),
1603
- isEnabled: z.boolean().optional()
2326
+ export const zSkillGetResponse = zSkill;
2327
+ export const zSkillUpdateBody = z.object({
2328
+ name: z.string().optional(),
2329
+ description: z.string().nullish(),
2330
+ icon: z.string().nullish(),
2331
+ docUrl: z.string().nullish(),
2332
+ repository: zRepository.nullish(),
2333
+ websiteMetadata: zWebsiteMetadata.nullish(),
2334
+ tags: z.array(z.string()).optional(),
1604
2335
  });
1605
- export const zPodRoutineCronTriggerUpdatePath = z.object({
1606
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1607
- triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1608
- podId: z.string()
2336
+ export const zSkillUpdatePath = z.object({
2337
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1609
2338
  });
1610
- /**
1611
- * Updated cron trigger
1612
- */
1613
- export const zPodRoutineCronTriggerUpdateResponse = zCronTrigger;
1614
- export const zPodRoutineCronTriggerArchivePath = z.object({
1615
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1616
- triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1617
- podId: z.string()
2339
+ export const zSkillUpdateQuery = z.object({
2340
+ scope: z.enum(["user"]).optional(),
1618
2341
  });
1619
2342
  /**
1620
- * Archived cron trigger
2343
+ * Updated skill
1621
2344
  */
1622
- export const zPodRoutineCronTriggerArchiveResponse = zCronTrigger;
1623
- export const zPodRoutineWebhookTriggerListPath = z.object({
1624
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1625
- podId: z.string()
2345
+ export const zSkillUpdateResponse = zSkill;
2346
+ export const zSkillArchivePath = z.object({
2347
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1626
2348
  });
1627
- export const zPodRoutineWebhookTriggerListQuery = z.object({
1628
- limit: z.number().gte(1).lte(100).optional(),
1629
- offset: z.number().gte(0).optional()
2349
+ export const zSkillArchiveQuery = z.object({
2350
+ scope: z.enum(["user"]).optional(),
1630
2351
  });
1631
2352
  /**
1632
- * List of webhook triggers
2353
+ * Archived skill
1633
2354
  */
1634
- export const zPodRoutineWebhookTriggerListResponse = z.array(zWebhookTrigger);
1635
- export const zPodRoutineWebhookTriggerCreateBody = z.object({
1636
- source: z.string().nullish().default(null),
1637
- secret: z.string().nullish().default(null),
1638
- eventFilters: z.record(z.string(), z.string()).nullish().default(null),
1639
- isEnabled: z.boolean().optional().default(true)
2355
+ export const zSkillArchiveResponse = zSkill;
2356
+ export const zSkillCopyBody = z.object({
2357
+ name: z.string(),
2358
+ version: z.string().optional(),
1640
2359
  });
1641
- export const zPodRoutineWebhookTriggerCreatePath = z.object({
1642
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1643
- podId: z.string()
2360
+ export const zSkillCopyPath = z.object({
2361
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1644
2362
  });
1645
- /**
1646
- * Created webhook trigger
1647
- */
1648
- export const zPodRoutineWebhookTriggerCreateResponse = zWebhookTrigger;
1649
- export const zPodRoutineWebhookTriggerGetPath = z.object({
1650
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1651
- triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1652
- podId: z.string()
2363
+ export const zSkillCopyQuery = z.object({
2364
+ scope: z.enum(["user"]).optional(),
1653
2365
  });
1654
2366
  /**
1655
- * Webhook trigger details
2367
+ * Copied skill
1656
2368
  */
1657
- export const zPodRoutineWebhookTriggerGetResponse = zWebhookTrigger;
1658
- export const zPodRoutineWebhookTriggerUpdateBody = z.object({
1659
- source: z.string().nullish(),
1660
- secret: z.string().nullish(),
1661
- eventFilters: z.record(z.string(), z.string()).nullish(),
1662
- isEnabled: z.boolean().optional()
2369
+ export const zSkillCopyResponse = zSkill;
2370
+ export const zSkillVersionListPath = z.object({
2371
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1663
2372
  });
1664
- export const zPodRoutineWebhookTriggerUpdatePath = z.object({
1665
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1666
- triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1667
- podId: z.string()
2373
+ export const zSkillVersionListQuery = z.object({
2374
+ scope: z.enum(["user"]).optional(),
2375
+ limit: z.number().gte(1).lte(1000).optional(),
2376
+ offset: z.number().gte(0).optional(),
1668
2377
  });
1669
2378
  /**
1670
- * Updated webhook trigger
2379
+ * List of skill versions
1671
2380
  */
1672
- export const zPodRoutineWebhookTriggerUpdateResponse = zWebhookTrigger;
1673
- export const zPodRoutineWebhookTriggerArchivePath = z.object({
1674
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1675
- triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1676
- podId: z.string()
2381
+ export const zSkillVersionListResponse = z.array(zSkillVersion);
2382
+ export const zSkillVersionCreateBody = z.object({
2383
+ version: z.string().optional(),
2384
+ releaseNotes: z.string().optional(),
2385
+ requiredCredentials: z.string().optional(),
2386
+ source: z.string().optional(),
2387
+ files: z.array(z.string()),
1677
2388
  });
1678
- /**
1679
- * Archived webhook trigger
1680
- */
1681
- export const zPodRoutineWebhookTriggerArchiveResponse = zWebhookTrigger;
1682
- export const zPodRoutineApiTriggerListPath = z.object({
1683
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1684
- podId: z.string()
2389
+ export const zSkillVersionCreatePath = z.object({
2390
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1685
2391
  });
1686
- export const zPodRoutineApiTriggerListQuery = z.object({
1687
- limit: z.number().gte(1).lte(100).optional(),
1688
- offset: z.number().gte(0).optional()
2392
+ export const zSkillVersionCreateQuery = z.object({
2393
+ scope: z.enum(["user"]).optional(),
1689
2394
  });
1690
2395
  /**
1691
- * List of API triggers
2396
+ * Created skill version
1692
2397
  */
1693
- export const zPodRoutineApiTriggerListResponse = z.array(zApiTrigger);
1694
- export const zPodRoutineApiTriggerCreateBody = z.object({
1695
- isEnabled: z.boolean().optional().default(true)
2398
+ export const zSkillVersionCreateResponse = zSkillVersion;
2399
+ export const zSkillVersionGetPath = z.object({
2400
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2401
+ version: z.string().min(1).max(32),
1696
2402
  });
1697
- export const zPodRoutineApiTriggerCreatePath = z.object({
1698
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1699
- podId: z.string()
2403
+ export const zSkillVersionGetQuery = z.object({
2404
+ scope: z.enum(["user"]).optional(),
1700
2405
  });
1701
2406
  /**
1702
- * Created API trigger with one-time plaintext token
2407
+ * Skill version details
1703
2408
  */
1704
- export const zPodRoutineApiTriggerCreateResponse = zApiTriggerCreated;
1705
- export const zPodRoutineApiTriggerRotatePath = z.object({
1706
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1707
- triggerId: z.string().regex(/^atrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1708
- podId: z.string()
2409
+ export const zSkillVersionGetResponse = zSkillVersion;
2410
+ export const zSkillVersionDataPath = z.object({
2411
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2412
+ version: z.string().min(1).max(32),
1709
2413
  });
1710
- /**
1711
- * Rotated API trigger with new plaintext token
1712
- */
1713
- export const zPodRoutineApiTriggerRotateResponse = zApiTriggerCreated;
1714
- export const zPodRoutineApiTriggerGetPath = z.object({
1715
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1716
- triggerId: z.string().regex(/^atrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1717
- podId: z.string()
2414
+ export const zSkillVersionDataQuery = z.object({
2415
+ scope: z.enum(["user"]).optional(),
2416
+ format: z.enum(["json", "presigned"]).optional(),
1718
2417
  });
1719
2418
  /**
1720
- * API trigger details
2419
+ * Extracted files, presigned URL, or git source descriptor
1721
2420
  */
1722
- export const zPodRoutineApiTriggerGetResponse = zApiTrigger;
1723
- export const zPodRoutineApiTriggerUpdateBody = z.object({
1724
- isEnabled: z.boolean().optional()
1725
- });
1726
- export const zPodRoutineApiTriggerUpdatePath = z.object({
1727
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1728
- triggerId: z.string().regex(/^atrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1729
- podId: z.string()
2421
+ export const zSkillVersionDataResponse = z.union([
2422
+ z.object({
2423
+ files: z.array(z.object({
2424
+ path: z.string(),
2425
+ content: z.string(),
2426
+ })),
2427
+ }),
2428
+ z.object({
2429
+ url: z.url(),
2430
+ }),
2431
+ z.object({
2432
+ type: z.literal("git"),
2433
+ url: z.url(),
2434
+ ref: z.string().optional(),
2435
+ path: z.string().optional(),
2436
+ }),
2437
+ ]);
2438
+ export const zSkillVersionArchivePath = z.object({
2439
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2440
+ version: z.string().min(1).max(32),
1730
2441
  });
1731
- /**
1732
- * Updated API trigger
1733
- */
1734
- export const zPodRoutineApiTriggerUpdateResponse = zApiTrigger;
1735
- export const zPodRoutineApiTriggerArchivePath = z.object({
1736
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1737
- triggerId: z.string().regex(/^atrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1738
- podId: z.string()
2442
+ export const zSkillVersionArchiveQuery = z.object({
2443
+ scope: z.enum(["user"]).optional(),
1739
2444
  });
1740
2445
  /**
1741
- * Archived API trigger
2446
+ * Archived skill version
1742
2447
  */
1743
- export const zPodRoutineApiTriggerArchiveResponse = zApiTrigger;
1744
- export const zPodRoutineRunsListPath = z.object({
1745
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1746
- podId: z.string()
1747
- });
1748
- export const zPodRoutineRunsListQuery = z.object({
1749
- status: z.enum([
1750
- 'pending',
1751
- 'running',
1752
- 'completed',
1753
- 'failed',
1754
- 'cancelled'
1755
- ]).optional(),
1756
- sessionId: z.string().nullish(),
1757
- limit: z.number().gte(1).lte(100).optional(),
2448
+ export const zSkillVersionArchiveResponse = zSkillVersion;
2449
+ export const zTriggerListQuery = z.object({
2450
+ scope: z.enum(["user"]).optional(),
2451
+ limit: z.number().gte(1).lte(1000).optional(),
1758
2452
  offset: z.number().gte(0).optional(),
1759
- createdAfter: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional(),
1760
- createdBefore: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
2453
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1761
2454
  });
1762
2455
  /**
1763
- * List of routine runs
1764
- */
1765
- export const zPodRoutineRunsListResponse = z.array(zRoutineRun);
1766
- export const zPodRoutineRunsCreateBody = z.record(z.string(), z.unknown());
1767
- export const zPodRoutineRunsCreatePath = z.object({
1768
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1769
- podId: z.string()
1770
- });
1771
- /**
1772
- * Created routine run
1773
- */
1774
- export const zPodRoutineRunsCreateResponse = zRoutineRun;
1775
- export const zPodRoutineRunsGetPath = z.object({
1776
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1777
- runId: z.string().regex(/^rtr_[0-9A-HJKMNP-TV-Z]{26}$/),
1778
- podId: z.string()
1779
- });
1780
- /**
1781
- * Routine run details
2456
+ * List of cron triggers
1782
2457
  */
1783
- export const zPodRoutineRunsGetResponse = zRoutineRun;
1784
- export const zPodRoutineRunsStartPath = z.object({
1785
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1786
- runId: z.string().regex(/^rtr_[0-9A-HJKMNP-TV-Z]{26}$/),
1787
- podId: z.string()
2458
+ export const zTriggerListResponse = z.array(zCronTrigger);
2459
+ export const zTriggerCreateBody = z.object({
2460
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
2461
+ projectAgentId: z.string(),
2462
+ senderUserId: z.string().optional(),
2463
+ inputMessage: z.string(),
2464
+ schedule: z.string(),
2465
+ timezone: z.string().nullish().default(null),
2466
+ isEnabled: z.boolean().optional().default(true),
1788
2467
  });
1789
- /**
1790
- * Run started
1791
- */
1792
- export const zPodRoutineRunsStartResponse = zRoutineRun;
1793
- export const zPodRoutineRunsCompletePath = z.object({
1794
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1795
- runId: z.string().regex(/^rtr_[0-9A-HJKMNP-TV-Z]{26}$/),
1796
- podId: z.string()
2468
+ export const zTriggerCreateQuery = z.object({
2469
+ scope: z.enum(["user"]).optional(),
1797
2470
  });
1798
2471
  /**
1799
- * Run completed
2472
+ * Created cron trigger
1800
2473
  */
1801
- export const zPodRoutineRunsCompleteResponse = zRoutineRun;
1802
- export const zPodRoutineRunsFailBody = z.object({
1803
- error: z.string().min(1)
2474
+ export const zTriggerCreateResponse = zCronTrigger;
2475
+ export const zTriggerGetPath = z.object({
2476
+ triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1804
2477
  });
1805
- export const zPodRoutineRunsFailPath = z.object({
1806
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1807
- runId: z.string().regex(/^rtr_[0-9A-HJKMNP-TV-Z]{26}$/),
1808
- podId: z.string()
2478
+ export const zTriggerGetQuery = z.object({
2479
+ scope: z.enum(["user"]).optional(),
2480
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1809
2481
  });
1810
2482
  /**
1811
- * Run failed
2483
+ * Cron trigger details
1812
2484
  */
1813
- export const zPodRoutineRunsFailResponse = zRoutineRun;
1814
- export const zPodRoutineRunsCancelPath = z.object({
1815
- id: z.string().regex(/^rtn_[0-9A-HJKMNP-TV-Z]{26}$/),
1816
- runId: z.string().regex(/^rtr_[0-9A-HJKMNP-TV-Z]{26}$/),
1817
- podId: z.string()
2485
+ export const zTriggerGetResponse = zCronTrigger;
2486
+ export const zTriggerUpdateBody = z.object({
2487
+ projectAgentId: z.string().optional(),
2488
+ senderUserId: z.string().optional(),
2489
+ inputMessage: z.string().optional(),
2490
+ schedule: z.string().optional(),
2491
+ timezone: z.string().nullish(),
2492
+ isEnabled: z.boolean().optional(),
2493
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1818
2494
  });
1819
- /**
1820
- * Run cancelled
1821
- */
1822
- export const zPodRoutineRunsCancelResponse = zRoutineRun;
1823
- export const zPodRoutinesRunsListAllPath = z.object({
1824
- podId: z.string()
2495
+ export const zTriggerUpdatePath = z.object({
2496
+ triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1825
2497
  });
1826
- export const zPodRoutinesRunsListAllQuery = z.object({
1827
- status: z.enum([
1828
- 'pending',
1829
- 'running',
1830
- 'completed',
1831
- 'failed',
1832
- 'cancelled'
1833
- ]).optional(),
1834
- sessionId: z.string().nullish(),
1835
- limit: z.number().gte(1).lte(100).optional(),
1836
- offset: z.number().gte(0).optional(),
1837
- createdAfter: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional(),
1838
- createdBefore: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
2498
+ export const zTriggerUpdateQuery = z.object({
2499
+ scope: z.enum(["user"]).optional(),
1839
2500
  });
1840
2501
  /**
1841
- * List of routine runs in this pod
2502
+ * Updated cron trigger
1842
2503
  */
1843
- export const zPodRoutinesRunsListAllResponse = z.array(zRoutineRun);
1844
- export const zReplayListQuery = z.object({
1845
- limit: z.number().gte(1).lte(100).optional(),
1846
- offset: z.number().gte(0).optional(),
1847
- publisherId: z.string().optional()
2504
+ export const zTriggerUpdateResponse = zCronTrigger;
2505
+ export const zTriggerArchiveBody = z.object({
2506
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1848
2507
  });
1849
- /**
1850
- * List
1851
- */
1852
- export const zReplayListResponse = z.array(zReplay);
1853
- export const zReplayCreateBody = z.object({
1854
- sessionId: z.string(),
1855
- publisherId: z.string(),
1856
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/),
1857
- websiteMetadata: z.record(z.string(), z.unknown()).nullish().default(null)
1858
- });
1859
- /**
1860
- * Created
1861
- */
1862
- export const zReplayCreateResponse = zReplay;
1863
- export const zReplayGetPath = z.object({
1864
- id: z.string().regex(/^rpl_[0-9A-HJKMNP-TV-Z]{26}$/)
2508
+ export const zTriggerArchivePath = z.object({
2509
+ triggerId: z.string().regex(/^ctrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1865
2510
  });
1866
- /**
1867
- * Details
1868
- */
1869
- export const zReplayGetResponse = zReplay;
1870
- export const zReplayArchivePath = z.object({
1871
- id: z.string().regex(/^rpl_[0-9A-HJKMNP-TV-Z]{26}$/)
2511
+ export const zTriggerArchiveQuery = z.object({
2512
+ scope: z.enum(["user"]).optional(),
1872
2513
  });
1873
2514
  /**
1874
- * Archived
2515
+ * Archived cron trigger
1875
2516
  */
1876
- export const zReplayArchiveResponse = zReplay;
1877
- export const zRoutinesRunsListAllQuery = z.object({
1878
- status: z.enum([
1879
- 'pending',
1880
- 'running',
1881
- 'completed',
1882
- 'failed',
1883
- 'cancelled'
1884
- ]).optional(),
1885
- sessionId: z.string().nullish(),
1886
- limit: z.number().gte(1).lte(100).optional(),
2517
+ export const zTriggerArchiveResponse = zCronTrigger;
2518
+ export const zWebhookTriggerListQuery = z.object({
2519
+ scope: z.enum(["user"]).optional(),
2520
+ limit: z.number().gte(1).lte(1000).optional(),
1887
2521
  offset: z.number().gte(0).optional(),
1888
- createdAfter: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional(),
1889
- createdBefore: z.iso.datetime().regex(/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/).optional()
1890
- });
1891
- /**
1892
- * List of routine runs for this user's routines
1893
- */
1894
- export const zRoutinesRunsListAllResponse = z.array(zRoutineRun);
1895
- export const zSessionListQuery = z.object({
1896
- projectId: z.string().optional(),
1897
- createdById: z.string().optional(),
1898
- limit: z.number().gte(1).lte(100).optional(),
1899
- offset: z.number().gte(0).optional()
1900
- });
1901
- /**
1902
- * List of sessions
1903
- */
1904
- export const zSessionListResponse = z.array(zOpencodeSession);
1905
- export const zSessionGetPath = z.object({
1906
- id: z.string().min(1)
1907
- });
1908
- /**
1909
- * Session details
1910
- */
1911
- export const zSessionGetResponse = zOpencodeSession;
1912
- export const zSkillListQuery = z.object({
1913
- limit: z.number().gte(1).lte(100).optional(),
1914
- offset: z.number().gte(0).optional()
2522
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1915
2523
  });
1916
2524
  /**
1917
- * List of skills
1918
- */
1919
- export const zSkillListResponse = z.array(zSkill);
1920
- /**
1921
- * Created skill
2525
+ * List of webhook triggers
1922
2526
  */
1923
- export const zSkillCreateResponse = zSkill;
1924
- export const zSkillGetBySlugPath = z.object({
1925
- slug: z.string().min(1).max(128).regex(/^[a-z0-9-]+$/)
2527
+ export const zWebhookTriggerListResponse = z.array(zWebhookTrigger);
2528
+ export const zWebhookTriggerCreateBody = z.object({
2529
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
2530
+ projectAgentId: z.string(),
2531
+ senderUserId: z.string(),
2532
+ provider: z.enum(["slack", "generic"]),
2533
+ providerInstallId: z.string().nullable(),
2534
+ scopeFilter: z
2535
+ .object({
2536
+ channelId: z.string().optional(),
2537
+ })
2538
+ .nullable(),
2539
+ isEnabled: z.boolean().optional().default(true),
1926
2540
  });
1927
- /**
1928
- * Skill details
1929
- */
1930
- export const zSkillGetBySlugResponse = zSkill;
1931
- export const zSkillGetPath = z.object({
1932
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2541
+ export const zWebhookTriggerCreateQuery = z.object({
2542
+ scope: z.enum(["user"]).optional(),
1933
2543
  });
1934
2544
  /**
1935
- * Skill details
2545
+ * Created webhook trigger (with plaintext secret for generic triggers)
1936
2546
  */
1937
- export const zSkillGetResponse = zSkill;
1938
- export const zSkillUpdateBody = z.object({
1939
- name: z.string().optional(),
1940
- description: z.string().nullish(),
1941
- icon: z.string().nullish()
2547
+ export const zWebhookTriggerCreateResponse = zWebhookTriggerCreateResult;
2548
+ export const zWebhookTriggerGetPath = z.object({
2549
+ triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1942
2550
  });
1943
- export const zSkillUpdatePath = z.object({
1944
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2551
+ export const zWebhookTriggerGetQuery = z.object({
2552
+ scope: z.enum(["user"]).optional(),
2553
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1945
2554
  });
1946
2555
  /**
1947
- * Updated skill
2556
+ * Webhook trigger details
1948
2557
  */
1949
- export const zSkillUpdateResponse = zSkill;
1950
- export const zSkillArchivePath = z.object({
1951
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2558
+ export const zWebhookTriggerGetResponse = zWebhookTrigger;
2559
+ export const zWebhookTriggerUpdateBody = z.object({
2560
+ projectAgentId: z.string().optional(),
2561
+ senderUserId: z.string().optional(),
2562
+ scopeFilter: z
2563
+ .object({
2564
+ channelId: z.string().optional(),
2565
+ })
2566
+ .nullish(),
2567
+ isEnabled: z.boolean().optional(),
2568
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1952
2569
  });
1953
- /**
1954
- * Archived skill
1955
- */
1956
- export const zSkillArchiveResponse = zSkill;
1957
- export const zSkillCopyBody = z.object({
1958
- name: z.string(),
1959
- version: z.string().optional()
2570
+ export const zWebhookTriggerUpdatePath = z.object({
2571
+ triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1960
2572
  });
1961
- export const zSkillCopyPath = z.object({
1962
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2573
+ export const zWebhookTriggerUpdateQuery = z.object({
2574
+ scope: z.enum(["user"]).optional(),
1963
2575
  });
1964
2576
  /**
1965
- * Copied skill
2577
+ * Updated webhook trigger
1966
2578
  */
1967
- export const zSkillCopyResponse = zSkill;
1968
- export const zSkillVersionListPath = z.object({
1969
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2579
+ export const zWebhookTriggerUpdateResponse = zWebhookTrigger;
2580
+ export const zWebhookTriggerArchiveBody = z.object({
2581
+ projectId: z.string().regex(/^prj_[0-9A-HJKMNP-TV-Z]{26}$/),
1970
2582
  });
1971
- export const zSkillVersionListQuery = z.object({
1972
- limit: z.number().gte(1).lte(100).optional(),
1973
- offset: z.number().gte(0).optional()
2583
+ export const zWebhookTriggerArchivePath = z.object({
2584
+ triggerId: z.string().regex(/^wtrg_[0-9A-HJKMNP-TV-Z]{26}$/),
1974
2585
  });
1975
- /**
1976
- * List of skill versions
1977
- */
1978
- export const zSkillVersionListResponse = z.array(zSkillVersion);
1979
- export const zSkillVersionCreatePath = z.object({
1980
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2586
+ export const zWebhookTriggerArchiveQuery = z.object({
2587
+ scope: z.enum(["user"]).optional(),
1981
2588
  });
1982
2589
  /**
1983
- * Created skill version
2590
+ * Archived webhook trigger
1984
2591
  */
1985
- export const zSkillVersionCreateResponse = zSkillVersion;
1986
- export const zSkillVersionGetPath = z.object({
1987
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1988
- version: z.string().min(1).max(32)
2592
+ export const zWebhookTriggerArchiveResponse = zWebhookTrigger;
2593
+ export const zSlackStatusQuery = z.object({
2594
+ scope: z.enum(["user"]).optional(),
1989
2595
  });
1990
2596
  /**
1991
- * Skill version details
2597
+ * Slack installation status
1992
2598
  */
1993
- export const zSkillVersionGetResponse = zSkillVersion;
1994
- export const zSkillVersionDataPath = z.object({
1995
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
1996
- version: z.string().min(1).max(32)
1997
- });
1998
- export const zSkillVersionDataQuery = z.object({
1999
- format: z.enum(['json', 'presigned']).optional()
2599
+ export const zSlackStatusResponse = zSlackStatus;
2600
+ export const zSlackInstallationRemovePath = z.object({
2601
+ id: z.string().regex(/^sli_[0-9A-HJKMNP-TV-Z]{26}$/),
2000
2602
  });
2001
- /**
2002
- * Extracted files, presigned URL, or git source descriptor
2003
- */
2004
- export const zSkillVersionDataResponse = z.union([
2005
- z.object({
2006
- files: z.array(z.object({
2007
- path: z.string(),
2008
- content: z.string()
2009
- }))
2010
- }),
2011
- z.object({
2012
- url: z.url()
2013
- }),
2014
- z.object({
2015
- type: z.literal('git'),
2016
- url: z.url(),
2017
- ref: z.string().optional(),
2018
- path: z.string().optional()
2019
- })
2020
- ]);
2021
- export const zSkillVersionArchivePath = z.object({
2022
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2023
- version: z.string().min(1).max(32)
2603
+ export const zSlackInstallationRemoveQuery = z.object({
2604
+ scope: z.enum(["user"]).optional(),
2024
2605
  });
2025
2606
  /**
2026
- * Archived skill version
2607
+ * Removed
2027
2608
  */
2028
- export const zSkillVersionArchiveResponse = zSkillVersion;
2609
+ export const zSlackInstallationRemoveResponse = z.void();
2029
2610
  export const zVaultListQuery = z.object({
2030
- limit: z.number().gte(1).lte(100).optional(),
2031
- offset: z.number().gte(0).optional()
2611
+ scope: z.enum(["user"]).optional(),
2612
+ limit: z.number().gte(1).lte(1000).optional(),
2613
+ offset: z.number().gte(0).optional(),
2032
2614
  });
2033
2615
  /**
2034
2616
  * List of vaults
@@ -2036,21 +2618,31 @@ export const zVaultListQuery = z.object({
2036
2618
  export const zVaultListResponse = z.array(zVault);
2037
2619
  export const zVaultCreateBody = z.object({
2038
2620
  name: z.string().min(1).max(256),
2039
- description: z.string().optional().default('')
2621
+ description: z.string().optional().default(""),
2622
+ isDefault: z.boolean().optional().default(false),
2623
+ });
2624
+ export const zVaultCreateQuery = z.object({
2625
+ scope: z.enum(["user"]).optional(),
2040
2626
  });
2041
2627
  /**
2042
2628
  * Created vault
2043
2629
  */
2044
2630
  export const zVaultCreateResponse = zVault;
2045
2631
  export const zVaultDeletePath = z.object({
2046
- id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2632
+ id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2633
+ });
2634
+ export const zVaultDeleteQuery = z.object({
2635
+ scope: z.enum(["user"]).optional(),
2047
2636
  });
2048
2637
  /**
2049
2638
  * Deleted vault
2050
2639
  */
2051
2640
  export const zVaultDeleteResponse = zVault;
2052
2641
  export const zVaultGetPath = z.object({
2053
- id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2642
+ id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2643
+ });
2644
+ export const zVaultGetQuery = z.object({
2645
+ scope: z.enum(["user"]).optional(),
2054
2646
  });
2055
2647
  /**
2056
2648
  * Vault details
@@ -2058,28 +2650,35 @@ export const zVaultGetPath = z.object({
2058
2650
  export const zVaultGetResponse = zVault;
2059
2651
  export const zVaultUpdateBody = z.object({
2060
2652
  name: z.string().min(1).max(256).optional(),
2061
- description: z.string().optional()
2653
+ description: z.string().optional(),
2062
2654
  });
2063
2655
  export const zVaultUpdatePath = z.object({
2064
- id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2656
+ id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2657
+ });
2658
+ export const zVaultUpdateQuery = z.object({
2659
+ scope: z.enum(["user"]).optional(),
2065
2660
  });
2066
2661
  /**
2067
2662
  * Updated vault
2068
2663
  */
2069
2664
  export const zVaultUpdateResponse = zVault;
2070
2665
  export const zVaultArchivePath = z.object({
2071
- id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2666
+ id: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2667
+ });
2668
+ export const zVaultArchiveQuery = z.object({
2669
+ scope: z.enum(["user"]).optional(),
2072
2670
  });
2073
2671
  /**
2074
2672
  * Archived vault
2075
2673
  */
2076
2674
  export const zVaultArchiveResponse = zVault;
2077
2675
  export const zCredentialListPath = z.object({
2078
- vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2676
+ vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2079
2677
  });
2080
2678
  export const zCredentialListQuery = z.object({
2081
- limit: z.number().gte(1).lte(100).optional(),
2082
- offset: z.number().gte(0).optional()
2679
+ scope: z.enum(["user"]).optional(),
2680
+ limit: z.number().gte(1).lte(1000).optional(),
2681
+ offset: z.number().gte(0).optional(),
2083
2682
  });
2084
2683
  /**
2085
2684
  * List of credentials
@@ -2088,11 +2687,20 @@ export const zCredentialListResponse = z.array(zCredential);
2088
2687
  export const zCredentialCreateBody = z.object({
2089
2688
  name: z.string().min(1).max(256),
2090
2689
  mcpId: z.string().nullish().default(null),
2091
- label: z.string().min(1).max(64).regex(/^[A-Z0-9_]+$/).nullish().default(null),
2092
- auth: zCredentialAuth
2690
+ label: z
2691
+ .string()
2692
+ .min(1)
2693
+ .max(64)
2694
+ .regex(/^[A-Z0-9_]+$/)
2695
+ .nullish()
2696
+ .default(null),
2697
+ auth: zCredentialAuth,
2093
2698
  });
2094
2699
  export const zCredentialCreatePath = z.object({
2095
- vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2700
+ vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2701
+ });
2702
+ export const zCredentialCreateQuery = z.object({
2703
+ scope: z.enum(["user"]).optional(),
2096
2704
  });
2097
2705
  /**
2098
2706
  * Created credential
@@ -2100,7 +2708,10 @@ export const zCredentialCreatePath = z.object({
2100
2708
  export const zCredentialCreateResponse = zCredential;
2101
2709
  export const zCredentialDeletePath = z.object({
2102
2710
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2103
- id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/)
2711
+ id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/),
2712
+ });
2713
+ export const zCredentialDeleteQuery = z.object({
2714
+ scope: z.enum(["user"]).optional(),
2104
2715
  });
2105
2716
  /**
2106
2717
  * Deleted credential
@@ -2108,7 +2719,10 @@ export const zCredentialDeletePath = z.object({
2108
2719
  export const zCredentialDeleteResponse = zCredential;
2109
2720
  export const zCredentialGetPath = z.object({
2110
2721
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2111
- id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/)
2722
+ id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/),
2723
+ });
2724
+ export const zCredentialGetQuery = z.object({
2725
+ scope: z.enum(["user"]).optional(),
2112
2726
  });
2113
2727
  /**
2114
2728
  * Credential details
@@ -2116,11 +2730,14 @@ export const zCredentialGetPath = z.object({
2116
2730
  export const zCredentialGetResponse = zCredential;
2117
2731
  export const zCredentialUpdateBody = z.object({
2118
2732
  name: z.string().min(1).max(256).optional(),
2119
- auth: zCredentialAuth.optional()
2733
+ auth: zCredentialAuth.optional(),
2120
2734
  });
2121
2735
  export const zCredentialUpdatePath = z.object({
2122
2736
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2123
- id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/)
2737
+ id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/),
2738
+ });
2739
+ export const zCredentialUpdateQuery = z.object({
2740
+ scope: z.enum(["user"]).optional(),
2124
2741
  });
2125
2742
  /**
2126
2743
  * Updated credential
@@ -2128,7 +2745,10 @@ export const zCredentialUpdatePath = z.object({
2128
2745
  export const zCredentialUpdateResponse = zCredential;
2129
2746
  export const zCredentialArchivePath = z.object({
2130
2747
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2131
- id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/)
2748
+ id: z.string().regex(/^crd_[0-9A-HJKMNP-TV-Z]{26}$/),
2749
+ });
2750
+ export const zCredentialArchiveQuery = z.object({
2751
+ scope: z.enum(["user"]).optional(),
2132
2752
  });
2133
2753
  /**
2134
2754
  * Archived credential
@@ -2136,7 +2756,10 @@ export const zCredentialArchivePath = z.object({
2136
2756
  export const zCredentialArchiveResponse = zCredential;
2137
2757
  export const zCredentialOauthStartBody = zOAuthStartInput;
2138
2758
  export const zCredentialOauthStartPath = z.object({
2139
- vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/)
2759
+ vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2760
+ });
2761
+ export const zCredentialOauthStartQuery = z.object({
2762
+ scope: z.enum(["user"]).optional(),
2140
2763
  });
2141
2764
  /**
2142
2765
  * Authorization URL for the user to visit
@@ -2144,69 +2767,85 @@ export const zCredentialOauthStartPath = z.object({
2144
2767
  export const zCredentialOauthStartResponse = zOAuthStartResult;
2145
2768
  export const zCredentialOauthSessionPath = z.object({
2146
2769
  vaultId: z.string().regex(/^vlt_[0-9A-HJKMNP-TV-Z]{26}$/),
2147
- sessionId: z.string().regex(/^oas_[0-9A-HJKMNP-TV-Z]{26}$/)
2770
+ sessionId: z.string().regex(/^oas_[0-9A-HJKMNP-TV-Z]{26}$/),
2771
+ });
2772
+ export const zCredentialOauthSessionQuery = z.object({
2773
+ scope: z.enum(["user"]).optional(),
2148
2774
  });
2149
2775
  /**
2150
2776
  * Session status snapshot
2151
2777
  */
2152
2778
  export const zCredentialOauthSessionResponse = zOAuthSessionStatus;
2153
2779
  export const zRegistryAgentListQuery = z.object({
2154
- limit: z.number().gte(1).lte(100).optional(),
2155
- offset: z.number().gte(0).optional()
2780
+ limit: z.number().gte(1).lte(1000).optional(),
2781
+ offset: z.number().gte(0).optional(),
2156
2782
  });
2157
2783
  /**
2158
2784
  * List of published agents
2159
2785
  */
2160
2786
  export const zRegistryAgentListResponse = z.array(zAgent);
2161
2787
  export const zRegistryAgentGetPath = z.object({
2162
- id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/)
2788
+ id: z.string().regex(/^agt_[0-9A-HJKMNP-TV-Z]{26}$/),
2163
2789
  });
2164
2790
  /**
2165
2791
  * Agent details
2166
2792
  */
2167
2793
  export const zRegistryAgentGetResponse = zAgent;
2168
2794
  export const zRegistrySkillListQuery = z.object({
2169
- limit: z.number().gte(1).lte(100).optional(),
2170
- offset: z.number().gte(0).optional()
2795
+ limit: z.number().gte(1).lte(1000).optional(),
2796
+ offset: z.number().gte(0).optional(),
2797
+ sort: z.enum(["popular", "trending", "recent"]).optional(),
2171
2798
  });
2172
2799
  /**
2173
2800
  * List of published skills
2174
2801
  */
2175
2802
  export const zRegistrySkillListResponse = z.array(zSkill);
2176
2803
  export const zRegistrySkillGetPath = z.object({
2177
- id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/)
2804
+ id: z.string().regex(/^skl_[0-9A-HJKMNP-TV-Z]{26}$/),
2178
2805
  });
2179
2806
  /**
2180
2807
  * Skill details
2181
2808
  */
2182
2809
  export const zRegistrySkillGetResponse = zSkill;
2183
2810
  export const zRegistryMcpListQuery = z.object({
2184
- limit: z.number().gte(1).lte(100).optional(),
2185
- offset: z.number().gte(0).optional()
2811
+ limit: z.number().gte(1).lte(1000).optional(),
2812
+ offset: z.number().gte(0).optional(),
2813
+ sort: z.enum(["popular", "trending", "recent"]).optional(),
2186
2814
  });
2187
2815
  /**
2188
2816
  * List of published MCPs
2189
2817
  */
2190
2818
  export const zRegistryMcpListResponse = z.array(zMcp);
2191
2819
  export const zRegistryMcpGetPath = z.object({
2192
- id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/)
2820
+ id: z.string().regex(/^mcp_[0-9A-HJKMNP-TV-Z]{26}$/),
2193
2821
  });
2194
2822
  /**
2195
2823
  * MCP details
2196
2824
  */
2197
2825
  export const zRegistryMcpGetResponse = zMcp;
2198
- export const zRegistryComposioMcpListQuery = z.object({
2199
- limit: z.number().gte(1).lte(100).optional(),
2200
- offset: z.number().gte(0).optional()
2826
+ export const zRegistryReplayGetPath = z.object({
2827
+ slug: z
2828
+ .string()
2829
+ .min(1)
2830
+ .max(128)
2831
+ .regex(/^[a-z0-9-]+$/),
2201
2832
  });
2202
2833
  /**
2203
- * List of Composio MCPs
2834
+ * Public replay view
2204
2835
  */
2205
- export const zRegistryComposioMcpListResponse = z.array(zComposioMcp);
2206
- export const zRegistryComposioMcpGetPath = z.object({
2207
- id: z.string().regex(/^cmcp_[0-9A-HJKMNP-TV-Z]{26}$/)
2836
+ export const zRegistryReplayGetResponse = zReplayPublicView;
2837
+ export const zRegistryReplayFilesPresignDownloadBody = z.object({
2838
+ kind: z.enum(["outputs", "uploads"]),
2839
+ filename: z.string().min(1),
2840
+ });
2841
+ export const zRegistryReplayFilesPresignDownloadPath = z.object({
2842
+ slug: z
2843
+ .string()
2844
+ .min(1)
2845
+ .max(128)
2846
+ .regex(/^[a-z0-9-]+$/),
2208
2847
  });
2209
2848
  /**
2210
- * Composio MCP details
2849
+ * Presigned download URL
2211
2850
  */
2212
- export const zRegistryComposioMcpGetResponse = zComposioMcp;
2851
+ export const zRegistryReplayFilesPresignDownloadResponse = zReplayPresignDownloadResponse;