@otto-code/protocol 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +12 -0
  2. package/dist/agent-attention-notification.d.ts +41 -0
  3. package/dist/agent-attention-notification.js +140 -0
  4. package/dist/agent-labels.d.ts +7 -0
  5. package/dist/agent-labels.js +11 -0
  6. package/dist/agent-lifecycle.d.ts +3 -0
  7. package/dist/agent-lifecycle.js +8 -0
  8. package/dist/agent-personalities.d.ts +32 -0
  9. package/dist/agent-personalities.js +69 -0
  10. package/dist/agent-state-bucket.d.ts +14 -0
  11. package/dist/agent-state-bucket.js +41 -0
  12. package/dist/agent-title-limits.d.ts +2 -0
  13. package/dist/agent-title-limits.js +2 -0
  14. package/dist/agent-types.d.ts +479 -0
  15. package/dist/agent-types.js +22 -0
  16. package/dist/artifacts/rpc-schemas.d.ts +396 -0
  17. package/dist/artifacts/rpc-schemas.js +175 -0
  18. package/dist/artifacts/types.d.ts +166 -0
  19. package/dist/artifacts/types.js +73 -0
  20. package/dist/binary-frames/demux.d.ts +11 -0
  21. package/dist/binary-frames/demux.js +23 -0
  22. package/dist/binary-frames/file-transfer.d.ts +50 -0
  23. package/dist/binary-frames/file-transfer.js +107 -0
  24. package/dist/binary-frames/index.d.ts +4 -0
  25. package/dist/binary-frames/index.js +4 -0
  26. package/dist/binary-frames/terminal.d.ts +31 -0
  27. package/dist/binary-frames/terminal.js +99 -0
  28. package/dist/branch-slug.d.ts +14 -0
  29. package/dist/branch-slug.js +49 -0
  30. package/dist/browser-automation/capabilities.d.ts +7 -0
  31. package/dist/browser-automation/capabilities.js +31 -0
  32. package/dist/browser-automation/rpc-schemas.d.ts +1329 -0
  33. package/dist/browser-automation/rpc-schemas.js +555 -0
  34. package/dist/chat/rpc-schemas.d.ts +158 -0
  35. package/dist/chat/rpc-schemas.js +103 -0
  36. package/dist/chat/types.d.ts +30 -0
  37. package/dist/chat/types.js +22 -0
  38. package/dist/client-capabilities.d.ts +8 -0
  39. package/dist/client-capabilities.js +16 -0
  40. package/dist/connection-offer.d.ts +36 -0
  41. package/dist/connection-offer.js +53 -0
  42. package/dist/daemon-endpoints.d.ts +47 -0
  43. package/dist/daemon-endpoints.js +201 -0
  44. package/dist/default-personalities.d.ts +3 -0
  45. package/dist/default-personalities.js +127 -0
  46. package/dist/effort.d.ts +32 -0
  47. package/dist/effort.js +99 -0
  48. package/dist/error-utils.d.ts +11 -0
  49. package/dist/error-utils.js +27 -0
  50. package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
  51. package/dist/generated/validation/ws-outbound.aot.js +48755 -0
  52. package/dist/git-hosting.d.ts +21 -0
  53. package/dist/git-hosting.js +36 -0
  54. package/dist/git-remote.d.ts +18 -0
  55. package/dist/git-remote.js +84 -0
  56. package/dist/host-connection-schema.d.ts +11 -0
  57. package/dist/host-connection-schema.js +9 -0
  58. package/dist/literal-union.d.ts +2 -0
  59. package/dist/literal-union.js +2 -0
  60. package/dist/loop/rpc-schemas.d.ts +636 -0
  61. package/dist/loop/rpc-schemas.js +163 -0
  62. package/dist/messages.d.ts +38505 -0
  63. package/dist/messages.js +4719 -0
  64. package/dist/otto-config-schema.d.ts +136 -0
  65. package/dist/otto-config-schema.js +96 -0
  66. package/dist/path-utils.d.ts +2 -0
  67. package/dist/path-utils.js +16 -0
  68. package/dist/provider-config.d.ts +266 -0
  69. package/dist/provider-config.js +238 -0
  70. package/dist/provider-icon-names.d.ts +5 -0
  71. package/dist/provider-icon-names.js +52 -0
  72. package/dist/provider-manifest.d.ts +34 -0
  73. package/dist/provider-manifest.js +227 -0
  74. package/dist/schedule/cron-expression.d.ts +13 -0
  75. package/dist/schedule/cron-expression.js +97 -0
  76. package/dist/schedule/rpc-schemas.d.ts +667 -0
  77. package/dist/schedule/rpc-schemas.js +155 -0
  78. package/dist/schedule/types.d.ts +236 -0
  79. package/dist/schedule/types.js +84 -0
  80. package/dist/terminal-activity.d.ts +21 -0
  81. package/dist/terminal-activity.js +25 -0
  82. package/dist/terminal-input-mode.d.ts +26 -0
  83. package/dist/terminal-input-mode.js +151 -0
  84. package/dist/terminal-key-input.d.ts +13 -0
  85. package/dist/terminal-key-input.js +201 -0
  86. package/dist/terminal-profiles.d.ts +6 -0
  87. package/dist/terminal-profiles.js +28 -0
  88. package/dist/terminal-snapshot.d.ts +3 -0
  89. package/dist/terminal-snapshot.js +178 -0
  90. package/dist/terminal-stream-protocol.d.ts +2 -0
  91. package/dist/terminal-stream-protocol.js +2 -0
  92. package/dist/terminal-subscription-key.d.ts +2 -0
  93. package/dist/terminal-subscription-key.js +9 -0
  94. package/dist/tool-call-display.d.ts +11 -0
  95. package/dist/tool-call-display.js +135 -0
  96. package/dist/tool-name-normalization.d.ts +9 -0
  97. package/dist/tool-name-normalization.js +82 -0
  98. package/dist/validation/ws-outbound-schema-metadata.d.ts +7256 -0
  99. package/dist/validation/ws-outbound-schema-metadata.js +3 -0
  100. package/dist/validation/ws-outbound.d.ts +12 -0
  101. package/dist/validation/ws-outbound.js +8 -0
  102. package/package.json +42 -0
@@ -0,0 +1,396 @@
1
+ import { z } from "zod";
2
+ import type { CreateArtifactInput } from "./types.js";
3
+ export declare const ArtifactListRequestSchema: z.ZodObject<{
4
+ type: z.ZodLiteral<"artifact.list.request">;
5
+ projectId: z.ZodOptional<z.ZodString>;
6
+ requestId: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export declare const ArtifactCreateRequestSchema: z.ZodObject<{
9
+ type: z.ZodLiteral<"artifact.create.request">;
10
+ name: z.ZodString;
11
+ description: z.ZodString;
12
+ projectId: z.ZodString;
13
+ provider: z.ZodString;
14
+ model: z.ZodOptional<z.ZodString>;
15
+ modeId: z.ZodOptional<z.ZodString>;
16
+ thinkingOptionId: z.ZodOptional<z.ZodString>;
17
+ systemPrompt: z.ZodOptional<z.ZodString>;
18
+ spinner: z.ZodOptional<z.ZodObject<{
19
+ glowA: z.ZodString;
20
+ glowB: z.ZodString;
21
+ }, z.core.$loose>>;
22
+ requestId: z.ZodString;
23
+ }, z.core.$strip>;
24
+ export declare const ArtifactUpdateRequestSchema: z.ZodObject<{
25
+ type: z.ZodLiteral<"artifact.update.request">;
26
+ artifactId: z.ZodString;
27
+ name: z.ZodOptional<z.ZodString>;
28
+ description: z.ZodOptional<z.ZodString>;
29
+ projectId: z.ZodOptional<z.ZodString>;
30
+ provider: z.ZodOptional<z.ZodString>;
31
+ model: z.ZodOptional<z.ZodString>;
32
+ thinkingOptionId: z.ZodOptional<z.ZodString>;
33
+ requestId: z.ZodString;
34
+ }, z.core.$strip>;
35
+ export declare const ArtifactRegenerateRequestSchema: z.ZodObject<{
36
+ type: z.ZodLiteral<"artifact.regenerate.request">;
37
+ artifactId: z.ZodString;
38
+ requestId: z.ZodString;
39
+ }, z.core.$strip>;
40
+ export declare const ArtifactCancelRequestSchema: z.ZodObject<{
41
+ type: z.ZodLiteral<"artifact.cancel.request">;
42
+ artifactId: z.ZodString;
43
+ requestId: z.ZodString;
44
+ }, z.core.$strip>;
45
+ export declare const ArtifactDeleteRequestSchema: z.ZodObject<{
46
+ type: z.ZodLiteral<"artifact.delete.request">;
47
+ artifactId: z.ZodString;
48
+ requestId: z.ZodString;
49
+ }, z.core.$strip>;
50
+ export declare const ArtifactStarRequestSchema: z.ZodObject<{
51
+ type: z.ZodLiteral<"artifact.star.request">;
52
+ artifactId: z.ZodString;
53
+ starred: z.ZodBoolean;
54
+ requestId: z.ZodString;
55
+ }, z.core.$strip>;
56
+ export declare const ArtifactGetContentRequestSchema: z.ZodObject<{
57
+ type: z.ZodLiteral<"artifact.get-content.request">;
58
+ artifactId: z.ZodString;
59
+ requestId: z.ZodString;
60
+ }, z.core.$strip>;
61
+ export declare const ArtifactListResponseSchema: z.ZodObject<{
62
+ type: z.ZodLiteral<"artifact.list.response">;
63
+ payload: z.ZodObject<{
64
+ artifacts: z.ZodArray<z.ZodObject<{
65
+ id: z.ZodString;
66
+ name: z.ZodString;
67
+ description: z.ZodString;
68
+ projectId: z.ZodString;
69
+ filePath: z.ZodString;
70
+ kind: z.ZodEnum<{
71
+ html: "html";
72
+ }>;
73
+ starred: z.ZodBoolean;
74
+ status: z.ZodEnum<{
75
+ error: "error";
76
+ generating: "generating";
77
+ ready: "ready";
78
+ }>;
79
+ createdAt: z.ZodString;
80
+ updatedAt: z.ZodString;
81
+ generationAgentId: z.ZodNullable<z.ZodString>;
82
+ generationProvider: z.ZodNullable<z.ZodString>;
83
+ generationModel: z.ZodNullable<z.ZodString>;
84
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
87
+ glowA: z.ZodString;
88
+ glowB: z.ZodString;
89
+ }, z.core.$loose>>>;
90
+ errorMessage: z.ZodNullable<z.ZodString>;
91
+ }, z.core.$strip>>;
92
+ success: z.ZodBoolean;
93
+ error: z.ZodOptional<z.ZodString>;
94
+ requestId: z.ZodString;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>;
97
+ export declare const ArtifactCreateResponseSchema: z.ZodObject<{
98
+ type: z.ZodLiteral<"artifact.create.response">;
99
+ payload: z.ZodObject<{
100
+ artifact: z.ZodObject<{
101
+ id: z.ZodString;
102
+ name: z.ZodString;
103
+ description: z.ZodString;
104
+ projectId: z.ZodString;
105
+ filePath: z.ZodString;
106
+ kind: z.ZodEnum<{
107
+ html: "html";
108
+ }>;
109
+ starred: z.ZodBoolean;
110
+ status: z.ZodEnum<{
111
+ error: "error";
112
+ generating: "generating";
113
+ ready: "ready";
114
+ }>;
115
+ createdAt: z.ZodString;
116
+ updatedAt: z.ZodString;
117
+ generationAgentId: z.ZodNullable<z.ZodString>;
118
+ generationProvider: z.ZodNullable<z.ZodString>;
119
+ generationModel: z.ZodNullable<z.ZodString>;
120
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
121
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
123
+ glowA: z.ZodString;
124
+ glowB: z.ZodString;
125
+ }, z.core.$loose>>>;
126
+ errorMessage: z.ZodNullable<z.ZodString>;
127
+ }, z.core.$strip>;
128
+ success: z.ZodBoolean;
129
+ error: z.ZodOptional<z.ZodString>;
130
+ requestId: z.ZodString;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>;
133
+ export declare const ArtifactDeleteResponseSchema: z.ZodObject<{
134
+ type: z.ZodLiteral<"artifact.delete.response">;
135
+ payload: z.ZodObject<{
136
+ success: z.ZodBoolean;
137
+ error: z.ZodOptional<z.ZodString>;
138
+ requestId: z.ZodString;
139
+ }, z.core.$strip>;
140
+ }, z.core.$strip>;
141
+ export declare const ArtifactStarResponseSchema: z.ZodObject<{
142
+ type: z.ZodLiteral<"artifact.star.response">;
143
+ payload: z.ZodObject<{
144
+ artifact: z.ZodObject<{
145
+ id: z.ZodString;
146
+ name: z.ZodString;
147
+ description: z.ZodString;
148
+ projectId: z.ZodString;
149
+ filePath: z.ZodString;
150
+ kind: z.ZodEnum<{
151
+ html: "html";
152
+ }>;
153
+ starred: z.ZodBoolean;
154
+ status: z.ZodEnum<{
155
+ error: "error";
156
+ generating: "generating";
157
+ ready: "ready";
158
+ }>;
159
+ createdAt: z.ZodString;
160
+ updatedAt: z.ZodString;
161
+ generationAgentId: z.ZodNullable<z.ZodString>;
162
+ generationProvider: z.ZodNullable<z.ZodString>;
163
+ generationModel: z.ZodNullable<z.ZodString>;
164
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
167
+ glowA: z.ZodString;
168
+ glowB: z.ZodString;
169
+ }, z.core.$loose>>>;
170
+ errorMessage: z.ZodNullable<z.ZodString>;
171
+ }, z.core.$strip>;
172
+ success: z.ZodBoolean;
173
+ error: z.ZodOptional<z.ZodString>;
174
+ requestId: z.ZodString;
175
+ }, z.core.$strip>;
176
+ }, z.core.$strip>;
177
+ export declare const ArtifactUpdateResponseSchema: z.ZodObject<{
178
+ type: z.ZodLiteral<"artifact.update.response">;
179
+ payload: z.ZodObject<{
180
+ artifact: z.ZodObject<{
181
+ id: z.ZodString;
182
+ name: z.ZodString;
183
+ description: z.ZodString;
184
+ projectId: z.ZodString;
185
+ filePath: z.ZodString;
186
+ kind: z.ZodEnum<{
187
+ html: "html";
188
+ }>;
189
+ starred: z.ZodBoolean;
190
+ status: z.ZodEnum<{
191
+ error: "error";
192
+ generating: "generating";
193
+ ready: "ready";
194
+ }>;
195
+ createdAt: z.ZodString;
196
+ updatedAt: z.ZodString;
197
+ generationAgentId: z.ZodNullable<z.ZodString>;
198
+ generationProvider: z.ZodNullable<z.ZodString>;
199
+ generationModel: z.ZodNullable<z.ZodString>;
200
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
201
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
202
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
203
+ glowA: z.ZodString;
204
+ glowB: z.ZodString;
205
+ }, z.core.$loose>>>;
206
+ errorMessage: z.ZodNullable<z.ZodString>;
207
+ }, z.core.$strip>;
208
+ success: z.ZodBoolean;
209
+ error: z.ZodOptional<z.ZodString>;
210
+ requestId: z.ZodString;
211
+ }, z.core.$strip>;
212
+ }, z.core.$strip>;
213
+ export declare const ArtifactRegenerateResponseSchema: z.ZodObject<{
214
+ type: z.ZodLiteral<"artifact.regenerate.response">;
215
+ payload: z.ZodObject<{
216
+ artifact: z.ZodObject<{
217
+ id: z.ZodString;
218
+ name: z.ZodString;
219
+ description: z.ZodString;
220
+ projectId: z.ZodString;
221
+ filePath: z.ZodString;
222
+ kind: z.ZodEnum<{
223
+ html: "html";
224
+ }>;
225
+ starred: z.ZodBoolean;
226
+ status: z.ZodEnum<{
227
+ error: "error";
228
+ generating: "generating";
229
+ ready: "ready";
230
+ }>;
231
+ createdAt: z.ZodString;
232
+ updatedAt: z.ZodString;
233
+ generationAgentId: z.ZodNullable<z.ZodString>;
234
+ generationProvider: z.ZodNullable<z.ZodString>;
235
+ generationModel: z.ZodNullable<z.ZodString>;
236
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
239
+ glowA: z.ZodString;
240
+ glowB: z.ZodString;
241
+ }, z.core.$loose>>>;
242
+ errorMessage: z.ZodNullable<z.ZodString>;
243
+ }, z.core.$strip>;
244
+ success: z.ZodBoolean;
245
+ error: z.ZodOptional<z.ZodString>;
246
+ requestId: z.ZodString;
247
+ }, z.core.$strip>;
248
+ }, z.core.$strip>;
249
+ export declare const ArtifactCancelResponseSchema: z.ZodObject<{
250
+ type: z.ZodLiteral<"artifact.cancel.response">;
251
+ payload: z.ZodObject<{
252
+ artifact: z.ZodObject<{
253
+ id: z.ZodString;
254
+ name: z.ZodString;
255
+ description: z.ZodString;
256
+ projectId: z.ZodString;
257
+ filePath: z.ZodString;
258
+ kind: z.ZodEnum<{
259
+ html: "html";
260
+ }>;
261
+ starred: z.ZodBoolean;
262
+ status: z.ZodEnum<{
263
+ error: "error";
264
+ generating: "generating";
265
+ ready: "ready";
266
+ }>;
267
+ createdAt: z.ZodString;
268
+ updatedAt: z.ZodString;
269
+ generationAgentId: z.ZodNullable<z.ZodString>;
270
+ generationProvider: z.ZodNullable<z.ZodString>;
271
+ generationModel: z.ZodNullable<z.ZodString>;
272
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
275
+ glowA: z.ZodString;
276
+ glowB: z.ZodString;
277
+ }, z.core.$loose>>>;
278
+ errorMessage: z.ZodNullable<z.ZodString>;
279
+ }, z.core.$strip>;
280
+ success: z.ZodBoolean;
281
+ error: z.ZodOptional<z.ZodString>;
282
+ requestId: z.ZodString;
283
+ }, z.core.$strip>;
284
+ }, z.core.$strip>;
285
+ export declare const ArtifactGetContentResponseSchema: z.ZodObject<{
286
+ type: z.ZodLiteral<"artifact.get-content.response">;
287
+ payload: z.ZodObject<{
288
+ content: z.ZodString;
289
+ success: z.ZodBoolean;
290
+ error: z.ZodOptional<z.ZodString>;
291
+ requestId: z.ZodString;
292
+ }, z.core.$strip>;
293
+ }, z.core.$strip>;
294
+ export declare const ArtifactCreatedNotificationSchema: z.ZodObject<{
295
+ type: z.ZodLiteral<"artifact.created.notification">;
296
+ payload: z.ZodObject<{
297
+ artifact: z.ZodObject<{
298
+ id: z.ZodString;
299
+ name: z.ZodString;
300
+ description: z.ZodString;
301
+ projectId: z.ZodString;
302
+ filePath: z.ZodString;
303
+ kind: z.ZodEnum<{
304
+ html: "html";
305
+ }>;
306
+ starred: z.ZodBoolean;
307
+ status: z.ZodEnum<{
308
+ error: "error";
309
+ generating: "generating";
310
+ ready: "ready";
311
+ }>;
312
+ createdAt: z.ZodString;
313
+ updatedAt: z.ZodString;
314
+ generationAgentId: z.ZodNullable<z.ZodString>;
315
+ generationProvider: z.ZodNullable<z.ZodString>;
316
+ generationModel: z.ZodNullable<z.ZodString>;
317
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
320
+ glowA: z.ZodString;
321
+ glowB: z.ZodString;
322
+ }, z.core.$loose>>>;
323
+ errorMessage: z.ZodNullable<z.ZodString>;
324
+ }, z.core.$strip>;
325
+ }, z.core.$strip>;
326
+ }, z.core.$strip>;
327
+ export declare const ArtifactUpdatedNotificationSchema: z.ZodObject<{
328
+ type: z.ZodLiteral<"artifact.updated.notification">;
329
+ payload: z.ZodObject<{
330
+ artifact: z.ZodObject<{
331
+ id: z.ZodString;
332
+ name: z.ZodString;
333
+ description: z.ZodString;
334
+ projectId: z.ZodString;
335
+ filePath: z.ZodString;
336
+ kind: z.ZodEnum<{
337
+ html: "html";
338
+ }>;
339
+ starred: z.ZodBoolean;
340
+ status: z.ZodEnum<{
341
+ error: "error";
342
+ generating: "generating";
343
+ ready: "ready";
344
+ }>;
345
+ createdAt: z.ZodString;
346
+ updatedAt: z.ZodString;
347
+ generationAgentId: z.ZodNullable<z.ZodString>;
348
+ generationProvider: z.ZodNullable<z.ZodString>;
349
+ generationModel: z.ZodNullable<z.ZodString>;
350
+ generationModeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
+ generationThinkingOptionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
352
+ generationSpinner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
353
+ glowA: z.ZodString;
354
+ glowB: z.ZodString;
355
+ }, z.core.$loose>>>;
356
+ errorMessage: z.ZodNullable<z.ZodString>;
357
+ }, z.core.$strip>;
358
+ }, z.core.$strip>;
359
+ }, z.core.$strip>;
360
+ export declare const ArtifactDeletedNotificationSchema: z.ZodObject<{
361
+ type: z.ZodLiteral<"artifact.deleted.notification">;
362
+ payload: z.ZodObject<{
363
+ artifactId: z.ZodString;
364
+ }, z.core.$strip>;
365
+ }, z.core.$strip>;
366
+ export type ArtifactListRequest = z.infer<typeof ArtifactListRequestSchema>;
367
+ export type ArtifactCreateRequest = z.infer<typeof ArtifactCreateRequestSchema>;
368
+ export type ArtifactUpdateRequest = z.infer<typeof ArtifactUpdateRequestSchema>;
369
+ export type ArtifactRegenerateRequest = z.infer<typeof ArtifactRegenerateRequestSchema>;
370
+ export type ArtifactCancelRequest = z.infer<typeof ArtifactCancelRequestSchema>;
371
+ export type ArtifactDeleteRequest = z.infer<typeof ArtifactDeleteRequestSchema>;
372
+ export type ArtifactStarRequest = z.infer<typeof ArtifactStarRequestSchema>;
373
+ export type ArtifactGetContentRequest = z.infer<typeof ArtifactGetContentRequestSchema>;
374
+ export type ArtifactListResponse = z.infer<typeof ArtifactListResponseSchema>;
375
+ export type ArtifactCreateResponse = z.infer<typeof ArtifactCreateResponseSchema>;
376
+ export type ArtifactUpdateResponse = z.infer<typeof ArtifactUpdateResponseSchema>;
377
+ export type ArtifactRegenerateResponse = z.infer<typeof ArtifactRegenerateResponseSchema>;
378
+ export type ArtifactCancelResponse = z.infer<typeof ArtifactCancelResponseSchema>;
379
+ export type ArtifactDeleteResponse = z.infer<typeof ArtifactDeleteResponseSchema>;
380
+ export type ArtifactStarResponse = z.infer<typeof ArtifactStarResponseSchema>;
381
+ export type ArtifactGetContentResponse = z.infer<typeof ArtifactGetContentResponseSchema>;
382
+ export type ArtifactCreatedNotification = z.infer<typeof ArtifactCreatedNotificationSchema>;
383
+ export type ArtifactUpdatedNotification = z.infer<typeof ArtifactUpdatedNotificationSchema>;
384
+ export type ArtifactDeletedNotification = z.infer<typeof ArtifactDeletedNotificationSchema>;
385
+ export type ArtifactRequest = ArtifactListRequest | ArtifactCreateRequest | ArtifactUpdateRequest | ArtifactRegenerateRequest | ArtifactCancelRequest | ArtifactDeleteRequest | ArtifactStarRequest | ArtifactGetContentRequest;
386
+ export type ArtifactResponse = ArtifactListResponse | ArtifactCreateResponse | ArtifactUpdateResponse | ArtifactRegenerateResponse | ArtifactCancelResponse | ArtifactDeleteResponse | ArtifactStarResponse | ArtifactGetContentResponse;
387
+ export type ArtifactNotification = ArtifactCreatedNotification | ArtifactUpdatedNotification | ArtifactDeletedNotification;
388
+ export declare function validateArtifactCreateRequest(data: unknown): {
389
+ ok: true;
390
+ input: CreateArtifactInput;
391
+ requestId: string;
392
+ } | {
393
+ ok: false;
394
+ error: string;
395
+ };
396
+ //# sourceMappingURL=rpc-schemas.d.ts.map
@@ -0,0 +1,175 @@
1
+ import { z } from "zod";
2
+ import { ArtifactMetadataSchema, ArtifactSpinnerSchema } from "./types.js";
3
+ // ============================================================================
4
+ // Client → Daemon (Requests)
5
+ // ============================================================================
6
+ export const ArtifactListRequestSchema = z.object({
7
+ type: z.literal("artifact.list.request"),
8
+ projectId: z.string().optional(),
9
+ requestId: z.string(),
10
+ });
11
+ export const ArtifactCreateRequestSchema = z.object({
12
+ type: z.literal("artifact.create.request"),
13
+ name: z.string(),
14
+ description: z.string(),
15
+ projectId: z.string(),
16
+ provider: z.string(),
17
+ model: z.string().optional(),
18
+ modeId: z.string().optional(),
19
+ thinkingOptionId: z.string().optional(),
20
+ systemPrompt: z.string().optional(),
21
+ // Snapshotted spinner colors of the chosen Agent Personality (optional).
22
+ spinner: ArtifactSpinnerSchema.optional(),
23
+ requestId: z.string(),
24
+ });
25
+ // Update edits an artifact's metadata (name/description/project/provider/
26
+ // model/thinking) WITHOUT re-running generation — editing never regenerates;
27
+ // the user triggers that separately. Every field except artifactId is
28
+ // optional; only provided fields overwrite.
29
+ export const ArtifactUpdateRequestSchema = z.object({
30
+ type: z.literal("artifact.update.request"),
31
+ artifactId: z.string(),
32
+ name: z.string().optional(),
33
+ description: z.string().optional(),
34
+ projectId: z.string().optional(),
35
+ provider: z.string().optional(),
36
+ model: z.string().optional(),
37
+ thinkingOptionId: z.string().optional(),
38
+ requestId: z.string(),
39
+ });
40
+ // Regenerate re-runs generation for an existing artifact using its stored
41
+ // config. It carries no field updates — edit those first via update.request.
42
+ export const ArtifactRegenerateRequestSchema = z.object({
43
+ type: z.literal("artifact.regenerate.request"),
44
+ artifactId: z.string(),
45
+ requestId: z.string(),
46
+ });
47
+ // Cancel stops an in-progress generation and recovers the artifact so it is no
48
+ // longer stuck "generating" (the local agent may never emit a recognizable
49
+ // document). The artifact lands in an error state and can be regenerated.
50
+ export const ArtifactCancelRequestSchema = z.object({
51
+ type: z.literal("artifact.cancel.request"),
52
+ artifactId: z.string(),
53
+ requestId: z.string(),
54
+ });
55
+ export const ArtifactDeleteRequestSchema = z.object({
56
+ type: z.literal("artifact.delete.request"),
57
+ artifactId: z.string(),
58
+ requestId: z.string(),
59
+ });
60
+ export const ArtifactStarRequestSchema = z.object({
61
+ type: z.literal("artifact.star.request"),
62
+ artifactId: z.string(),
63
+ starred: z.boolean(),
64
+ requestId: z.string(),
65
+ });
66
+ export const ArtifactGetContentRequestSchema = z.object({
67
+ type: z.literal("artifact.get-content.request"),
68
+ artifactId: z.string(),
69
+ requestId: z.string(),
70
+ });
71
+ // ============================================================================
72
+ // Daemon → Client (Responses)
73
+ // ============================================================================
74
+ export const ArtifactListResponseSchema = z.object({
75
+ type: z.literal("artifact.list.response"),
76
+ payload: z.object({
77
+ artifacts: z.array(ArtifactMetadataSchema),
78
+ success: z.boolean(),
79
+ error: z.string().optional(),
80
+ requestId: z.string(),
81
+ }),
82
+ });
83
+ export const ArtifactCreateResponseSchema = z.object({
84
+ type: z.literal("artifact.create.response"),
85
+ payload: z.object({
86
+ artifact: ArtifactMetadataSchema,
87
+ success: z.boolean(),
88
+ error: z.string().optional(),
89
+ requestId: z.string(),
90
+ }),
91
+ });
92
+ export const ArtifactDeleteResponseSchema = z.object({
93
+ type: z.literal("artifact.delete.response"),
94
+ payload: z.object({
95
+ success: z.boolean(),
96
+ error: z.string().optional(),
97
+ requestId: z.string(),
98
+ }),
99
+ });
100
+ export const ArtifactStarResponseSchema = z.object({
101
+ type: z.literal("artifact.star.response"),
102
+ payload: z.object({
103
+ artifact: ArtifactMetadataSchema,
104
+ success: z.boolean(),
105
+ error: z.string().optional(),
106
+ requestId: z.string(),
107
+ }),
108
+ });
109
+ export const ArtifactUpdateResponseSchema = z.object({
110
+ type: z.literal("artifact.update.response"),
111
+ payload: z.object({
112
+ artifact: ArtifactMetadataSchema,
113
+ success: z.boolean(),
114
+ error: z.string().optional(),
115
+ requestId: z.string(),
116
+ }),
117
+ });
118
+ export const ArtifactRegenerateResponseSchema = z.object({
119
+ type: z.literal("artifact.regenerate.response"),
120
+ payload: z.object({
121
+ artifact: ArtifactMetadataSchema,
122
+ success: z.boolean(),
123
+ error: z.string().optional(),
124
+ requestId: z.string(),
125
+ }),
126
+ });
127
+ export const ArtifactCancelResponseSchema = z.object({
128
+ type: z.literal("artifact.cancel.response"),
129
+ payload: z.object({
130
+ artifact: ArtifactMetadataSchema,
131
+ success: z.boolean(),
132
+ error: z.string().optional(),
133
+ requestId: z.string(),
134
+ }),
135
+ });
136
+ export const ArtifactGetContentResponseSchema = z.object({
137
+ type: z.literal("artifact.get-content.response"),
138
+ payload: z.object({
139
+ content: z.string(),
140
+ success: z.boolean(),
141
+ error: z.string().optional(),
142
+ requestId: z.string(),
143
+ }),
144
+ });
145
+ // ============================================================================
146
+ // Daemon → Client (Push Notifications)
147
+ // ============================================================================
148
+ export const ArtifactCreatedNotificationSchema = z.object({
149
+ type: z.literal("artifact.created.notification"),
150
+ payload: z.object({
151
+ artifact: ArtifactMetadataSchema,
152
+ }),
153
+ });
154
+ export const ArtifactUpdatedNotificationSchema = z.object({
155
+ type: z.literal("artifact.updated.notification"),
156
+ payload: z.object({
157
+ artifact: ArtifactMetadataSchema,
158
+ }),
159
+ });
160
+ export const ArtifactDeletedNotificationSchema = z.object({
161
+ type: z.literal("artifact.deleted.notification"),
162
+ payload: z.object({
163
+ artifactId: z.string(),
164
+ }),
165
+ });
166
+ // Input validation helper — extracts CreateArtifactInput from a create request
167
+ export function validateArtifactCreateRequest(data) {
168
+ const result = ArtifactCreateRequestSchema.safeParse(data);
169
+ if (!result.success) {
170
+ return { ok: false, error: result.error.message };
171
+ }
172
+ const { type: _type, requestId, ...rest } = result.data;
173
+ return { ok: true, input: rest, requestId };
174
+ }
175
+ //# sourceMappingURL=rpc-schemas.js.map