@blazingagents/sdk 0.2.0 → 0.2.2

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 (52) hide show
  1. package/README.md +99 -344
  2. package/dist/contracts/api.d.ts +1 -1
  3. package/dist/contracts/api.js +1 -1
  4. package/dist/contracts/entities/agents.d.ts +14 -7
  5. package/dist/contracts/entities/agents.js +7 -3
  6. package/dist/contracts/entities/artifacts.d.ts +9 -9
  7. package/dist/contracts/entities/artifacts.js +5 -5
  8. package/dist/contracts/entities/chat.d.ts +7 -7
  9. package/dist/contracts/entities/chat.js +5 -5
  10. package/dist/contracts/entities/mcp-connections.d.ts +18 -18
  11. package/dist/contracts/entities/mcp-connections.js +13 -13
  12. package/dist/contracts/entities/memories.d.ts +5 -5
  13. package/dist/contracts/entities/memories.js +2 -2
  14. package/dist/contracts/entities/prompts.d.ts +4 -4
  15. package/dist/contracts/entities/prompts.js +2 -2
  16. package/dist/contracts/entities/providers.d.ts +12 -7
  17. package/dist/contracts/entities/providers.js +12 -6
  18. package/dist/contracts/entities/sessions.d.ts +10 -10
  19. package/dist/contracts/entities/sessions.js +6 -6
  20. package/dist/contracts/entities/skills.d.ts +18 -18
  21. package/dist/contracts/entities/skills.js +6 -6
  22. package/dist/contracts/entities/tasks.d.ts +56 -46
  23. package/dist/contracts/entities/tasks.js +25 -16
  24. package/dist/contracts/entities/tenants.d.ts +6 -6
  25. package/dist/contracts/entities/tenants.js +4 -4
  26. package/dist/contracts/entities/usage.d.ts +5 -5
  27. package/dist/contracts/entities/usage.js +3 -3
  28. package/dist/contracts/entities/workspaces.d.ts +9 -9
  29. package/dist/contracts/entities/workspaces.js +7 -2
  30. package/dist/contracts/index.d.ts +6 -4
  31. package/dist/contracts/index.js +4 -4
  32. package/dist/direct-chat-transport.d.ts +16 -0
  33. package/dist/direct-chat-transport.js +49 -0
  34. package/dist/generation.js +1 -0
  35. package/dist/http.d.ts +2 -0
  36. package/dist/http.js +2 -2
  37. package/dist/index.d.ts +3 -2
  38. package/dist/index.js +1 -0
  39. package/dist/resources/agents.js +11 -6
  40. package/dist/resources/artifacts.js +3 -2
  41. package/dist/resources/mcp-connections.js +4 -4
  42. package/dist/resources/memories.js +3 -2
  43. package/dist/resources/prompts.js +4 -3
  44. package/dist/resources/providers.js +10 -7
  45. package/dist/resources/sessions.js +4 -2
  46. package/dist/resources/skills.js +18 -10
  47. package/dist/resources/tasks.js +10 -5
  48. package/dist/resources/tenant.js +2 -2
  49. package/dist/resources/usage.js +4 -3
  50. package/dist/resources/workspaces.js +3 -2
  51. package/dist/types.d.ts +39 -33
  52. package/package.json +2 -2
@@ -22,7 +22,7 @@ export const sessionListItemSchema = z
22
22
  createdAt: z.iso.datetime({ offset: true }),
23
23
  updatedAt: z.iso.datetime({ offset: true }),
24
24
  })
25
- .strict();
25
+ .strip();
26
26
  export const sessionsListResponseSchema = paginatedResponseSchema(sessionListItemSchema);
27
27
  /**
28
28
  * `GET /v1/agents/{agentId}/sessions/{sessionId}/messages` — transcript as
@@ -58,7 +58,7 @@ export const sessionMessagesResponseSchema = z
58
58
  nextCursor: z.string().nullable(),
59
59
  latestCursor: z.string().nullable(),
60
60
  })
61
- .strict();
61
+ .strip();
62
62
  // Query params for the messages endpoint.
63
63
  export const sessionMessagesQuerySchema = z
64
64
  .object({
@@ -99,22 +99,22 @@ export const toolApprovalStateSchema = z
99
99
  toolCallId: z.string().min(1),
100
100
  toolName: z.string().min(1),
101
101
  })
102
- .strict();
102
+ .strip();
103
103
  export const toolApprovalContinuationSchema = z
104
104
  .object({
105
105
  id: z.string().min(1),
106
106
  state: toolApprovalContinuationStateSchema,
107
107
  })
108
- .strict();
108
+ .strip();
109
109
  export const toolApprovalsResponseSchema = z
110
110
  .object({
111
111
  data: z.array(toolApprovalStateSchema),
112
112
  continuation: toolApprovalContinuationSchema.nullable(),
113
113
  })
114
- .strict();
114
+ .strip();
115
115
  export const toolApprovalDecisionResponseSchema = z
116
116
  .object({
117
117
  continuationId: z.string().min(1),
118
118
  state: toolApprovalContinuationStateSchema,
119
119
  })
120
- .strict();
120
+ .strip();
@@ -19,12 +19,12 @@ export declare const skillSchema: z.ZodObject<{
19
19
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
20
  createdAt: z.ZodISODateTime;
21
21
  updatedAt: z.ZodISODateTime;
22
- }, z.core.$strict>;
22
+ }, z.core.$strip>;
23
23
  export declare const skillFilePathSchema: z.ZodString;
24
24
  export declare const skillFileSchema: z.ZodObject<{
25
25
  path: z.ZodString;
26
26
  sizeBytes: z.ZodNumber;
27
- }, z.core.$strict>;
27
+ }, z.core.$strip>;
28
28
  export declare const skillDetailSchema: z.ZodObject<{
29
29
  id: z.ZodString;
30
30
  tenantId: z.ZodString;
@@ -37,8 +37,8 @@ export declare const skillDetailSchema: z.ZodObject<{
37
37
  files: z.ZodArray<z.ZodObject<{
38
38
  path: z.ZodString;
39
39
  sizeBytes: z.ZodNumber;
40
- }, z.core.$strict>>;
41
- }, z.core.$strict>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>;
42
42
  export declare const skillResponseSchema: z.ZodObject<{
43
43
  id: z.ZodString;
44
44
  tenantId: z.ZodString;
@@ -51,8 +51,8 @@ export declare const skillResponseSchema: z.ZodObject<{
51
51
  files: z.ZodArray<z.ZodObject<{
52
52
  path: z.ZodString;
53
53
  sizeBytes: z.ZodNumber;
54
- }, z.core.$strict>>;
55
- }, z.core.$strict>;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>;
56
56
  export declare const skillsListQuerySchema: z.ZodObject<{
57
57
  cursor: z.ZodOptional<z.ZodString>;
58
58
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -67,9 +67,9 @@ export declare const skillsListResponseSchema: z.ZodObject<{
67
67
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
68
68
  createdAt: z.ZodISODateTime;
69
69
  updatedAt: z.ZodISODateTime;
70
- }, z.core.$strict>>;
70
+ }, z.core.$strip>>;
71
71
  nextCursor: z.ZodNullable<z.ZodString>;
72
- }, z.core.$strict>;
72
+ }, z.core.$strip>;
73
73
  export declare const createSkillBodySchema: z.ZodObject<{
74
74
  path: z.ZodLiteral<"SKILL.md">;
75
75
  content: z.ZodString;
@@ -105,17 +105,17 @@ export declare const skillCopyResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject
105
105
  files: z.ZodArray<z.ZodObject<{
106
106
  path: z.ZodString;
107
107
  sizeBytes: z.ZodNumber;
108
- }, z.core.$strict>>;
109
- }, z.core.$strict>;
110
- }, z.core.$strict>, z.ZodObject<{
108
+ }, z.core.$strip>>;
109
+ }, z.core.$strip>;
110
+ }, z.core.$strip>, z.ZodObject<{
111
111
  agentId: z.ZodString;
112
112
  status: z.ZodLiteral<"failed">;
113
113
  error: z.ZodObject<{
114
114
  code: z.ZodString;
115
115
  message: z.ZodString;
116
116
  details: z.ZodOptional<z.ZodUnknown>;
117
- }, z.core.$strict>;
118
- }, z.core.$strict>], "status">;
117
+ }, z.core.$strip>;
118
+ }, z.core.$strip>], "status">;
119
119
  export declare const skillCopyResultsSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
120
120
  agentId: z.ZodString;
121
121
  status: z.ZodLiteral<"created">;
@@ -131,17 +131,17 @@ export declare const skillCopyResultsSchema: z.ZodArray<z.ZodDiscriminatedUnion<
131
131
  files: z.ZodArray<z.ZodObject<{
132
132
  path: z.ZodString;
133
133
  sizeBytes: z.ZodNumber;
134
- }, z.core.$strict>>;
135
- }, z.core.$strict>;
136
- }, z.core.$strict>, z.ZodObject<{
134
+ }, z.core.$strip>>;
135
+ }, z.core.$strip>;
136
+ }, z.core.$strip>, z.ZodObject<{
137
137
  agentId: z.ZodString;
138
138
  status: z.ZodLiteral<"failed">;
139
139
  error: z.ZodObject<{
140
140
  code: z.ZodString;
141
141
  message: z.ZodString;
142
142
  details: z.ZodOptional<z.ZodUnknown>;
143
- }, z.core.$strict>;
144
- }, z.core.$strict>], "status">>;
143
+ }, z.core.$strip>;
144
+ }, z.core.$strip>], "status">>;
145
145
  export interface SkillMarkdownFrontmatterParseSuccess {
146
146
  frontmatter: SkillFrontmatter;
147
147
  success: true;
@@ -41,7 +41,7 @@ export const skillSchema = z
41
41
  createdAt: z.iso.datetime({ offset: true }),
42
42
  updatedAt: z.iso.datetime({ offset: true }),
43
43
  })
44
- .strict();
44
+ .strip();
45
45
  export const skillFilePathSchema = z
46
46
  .string()
47
47
  .min(1)
@@ -57,12 +57,12 @@ export const skillFileSchema = z
57
57
  path: skillFilePathSchema,
58
58
  sizeBytes: z.number().int().nonnegative(),
59
59
  })
60
- .strict();
60
+ .strip();
61
61
  export const skillDetailSchema = skillSchema
62
62
  .extend({
63
63
  files: z.array(skillFileSchema),
64
64
  })
65
- .strict();
65
+ .strip();
66
66
  export const skillResponseSchema = skillDetailSchema;
67
67
  export const skillsListQuerySchema = z
68
68
  .object({
@@ -106,7 +106,7 @@ const skillCopyCreatedResultSchema = z
106
106
  status: z.literal("created"),
107
107
  skill: skillDetailSchema,
108
108
  })
109
- .strict();
109
+ .strip();
110
110
  const skillCopyFailedResultSchema = z
111
111
  .object({
112
112
  agentId: agentIdSchema,
@@ -117,9 +117,9 @@ const skillCopyFailedResultSchema = z
117
117
  message: z.string().min(1),
118
118
  details: z.unknown().optional(),
119
119
  })
120
- .strict(),
120
+ .strip(),
121
121
  })
122
- .strict();
122
+ .strip();
123
123
  export const skillCopyResultSchema = z.discriminatedUnion("status", [
124
124
  skillCopyCreatedResultSchema,
125
125
  skillCopyFailedResultSchema,
@@ -132,20 +132,20 @@ export declare const taskSchema: z.ZodObject<{
132
132
  kind: z.ZodLiteral<"once">;
133
133
  config: z.ZodObject<{
134
134
  at: z.ZodISODateTime;
135
- }, z.core.$strict>;
136
- }, z.core.$strict>, z.ZodObject<{
135
+ }, z.core.$strip>;
136
+ }, z.core.$strip>, z.ZodObject<{
137
137
  kind: z.ZodLiteral<"interval">;
138
138
  config: z.ZodObject<{
139
139
  everyMs: z.ZodNumber;
140
- }, z.core.$strict>;
141
- }, z.core.$strict>, z.ZodObject<{
140
+ }, z.core.$strip>;
141
+ }, z.core.$strip>, z.ZodObject<{
142
142
  kind: z.ZodLiteral<"cron">;
143
143
  config: z.ZodObject<{
144
144
  expression: z.ZodString;
145
145
  staggerMs: z.ZodOptional<z.ZodNumber>;
146
146
  timezone: z.ZodDefault<z.ZodString>;
147
- }, z.core.$strict>;
148
- }, z.core.$strict>], "kind">>;
147
+ }, z.core.$strip>;
148
+ }, z.core.$strip>], "kind">>;
149
149
  enabled: z.ZodBoolean;
150
150
  activeRunId: z.ZodNullable<z.ZodString>;
151
151
  latestRunId: z.ZodNullable<z.ZodString>;
@@ -154,7 +154,7 @@ export declare const taskSchema: z.ZodObject<{
154
154
  deletedAt: z.ZodNullable<z.ZodISODateTime>;
155
155
  createdAt: z.ZodISODateTime;
156
156
  updatedAt: z.ZodISODateTime;
157
- }, z.core.$strict>;
157
+ }, z.core.$strip>;
158
158
  export declare const taskLatestRunSchema: z.ZodObject<{
159
159
  id: z.ZodString;
160
160
  status: z.ZodEnum<{
@@ -166,7 +166,7 @@ export declare const taskLatestRunSchema: z.ZodObject<{
166
166
  succeeded: "succeeded";
167
167
  }>;
168
168
  finishedAt: z.ZodNullable<z.ZodISODateTime>;
169
- }, z.core.$strict>;
169
+ }, z.core.$strip>;
170
170
  export declare const taskListItemSchema: z.ZodObject<{
171
171
  id: z.ZodString;
172
172
  tenantId: z.ZodString;
@@ -178,20 +178,20 @@ export declare const taskListItemSchema: z.ZodObject<{
178
178
  kind: z.ZodLiteral<"once">;
179
179
  config: z.ZodObject<{
180
180
  at: z.ZodISODateTime;
181
- }, z.core.$strict>;
182
- }, z.core.$strict>, z.ZodObject<{
181
+ }, z.core.$strip>;
182
+ }, z.core.$strip>, z.ZodObject<{
183
183
  kind: z.ZodLiteral<"interval">;
184
184
  config: z.ZodObject<{
185
185
  everyMs: z.ZodNumber;
186
- }, z.core.$strict>;
187
- }, z.core.$strict>, z.ZodObject<{
186
+ }, z.core.$strip>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
188
  kind: z.ZodLiteral<"cron">;
189
189
  config: z.ZodObject<{
190
190
  expression: z.ZodString;
191
191
  staggerMs: z.ZodOptional<z.ZodNumber>;
192
192
  timezone: z.ZodDefault<z.ZodString>;
193
- }, z.core.$strict>;
194
- }, z.core.$strict>], "kind">>;
193
+ }, z.core.$strip>;
194
+ }, z.core.$strip>], "kind">>;
195
195
  enabled: z.ZodBoolean;
196
196
  activeRunId: z.ZodNullable<z.ZodString>;
197
197
  latestRunId: z.ZodNullable<z.ZodString>;
@@ -211,8 +211,8 @@ export declare const taskListItemSchema: z.ZodObject<{
211
211
  succeeded: "succeeded";
212
212
  }>;
213
213
  finishedAt: z.ZodNullable<z.ZodISODateTime>;
214
- }, z.core.$strict>>;
215
- }, z.core.$strict>;
214
+ }, z.core.$strip>>;
215
+ }, z.core.$strip>;
216
216
  export declare const tasksListResponseSchema: z.ZodObject<{
217
217
  data: z.ZodArray<z.ZodObject<{
218
218
  id: z.ZodString;
@@ -225,20 +225,20 @@ export declare const tasksListResponseSchema: z.ZodObject<{
225
225
  kind: z.ZodLiteral<"once">;
226
226
  config: z.ZodObject<{
227
227
  at: z.ZodISODateTime;
228
- }, z.core.$strict>;
229
- }, z.core.$strict>, z.ZodObject<{
228
+ }, z.core.$strip>;
229
+ }, z.core.$strip>, z.ZodObject<{
230
230
  kind: z.ZodLiteral<"interval">;
231
231
  config: z.ZodObject<{
232
232
  everyMs: z.ZodNumber;
233
- }, z.core.$strict>;
234
- }, z.core.$strict>, z.ZodObject<{
233
+ }, z.core.$strip>;
234
+ }, z.core.$strip>, z.ZodObject<{
235
235
  kind: z.ZodLiteral<"cron">;
236
236
  config: z.ZodObject<{
237
237
  expression: z.ZodString;
238
238
  staggerMs: z.ZodOptional<z.ZodNumber>;
239
239
  timezone: z.ZodDefault<z.ZodString>;
240
- }, z.core.$strict>;
241
- }, z.core.$strict>], "kind">>;
240
+ }, z.core.$strip>;
241
+ }, z.core.$strip>], "kind">>;
242
242
  enabled: z.ZodBoolean;
243
243
  activeRunId: z.ZodNullable<z.ZodString>;
244
244
  latestRunId: z.ZodNullable<z.ZodString>;
@@ -258,10 +258,10 @@ export declare const tasksListResponseSchema: z.ZodObject<{
258
258
  succeeded: "succeeded";
259
259
  }>;
260
260
  finishedAt: z.ZodNullable<z.ZodISODateTime>;
261
- }, z.core.$strict>>;
262
- }, z.core.$strict>>;
261
+ }, z.core.$strip>>;
262
+ }, z.core.$strip>>;
263
263
  nextCursor: z.ZodNullable<z.ZodString>;
264
- }, z.core.$strict>;
264
+ }, z.core.$strip>;
265
265
  export declare const tasksListQuerySchema: z.ZodObject<{
266
266
  agentId: z.ZodOptional<z.ZodString>;
267
267
  userId: z.ZodOptional<z.ZodString>;
@@ -278,20 +278,20 @@ export declare const taskResponseSchema: z.ZodObject<{
278
278
  kind: z.ZodLiteral<"once">;
279
279
  config: z.ZodObject<{
280
280
  at: z.ZodISODateTime;
281
- }, z.core.$strict>;
282
- }, z.core.$strict>, z.ZodObject<{
281
+ }, z.core.$strip>;
282
+ }, z.core.$strip>, z.ZodObject<{
283
283
  kind: z.ZodLiteral<"interval">;
284
284
  config: z.ZodObject<{
285
285
  everyMs: z.ZodNumber;
286
- }, z.core.$strict>;
287
- }, z.core.$strict>, z.ZodObject<{
286
+ }, z.core.$strip>;
287
+ }, z.core.$strip>, z.ZodObject<{
288
288
  kind: z.ZodLiteral<"cron">;
289
289
  config: z.ZodObject<{
290
290
  expression: z.ZodString;
291
291
  staggerMs: z.ZodOptional<z.ZodNumber>;
292
292
  timezone: z.ZodDefault<z.ZodString>;
293
- }, z.core.$strict>;
294
- }, z.core.$strict>], "kind">>;
293
+ }, z.core.$strip>;
294
+ }, z.core.$strip>], "kind">>;
295
295
  enabled: z.ZodBoolean;
296
296
  activeRunId: z.ZodNullable<z.ZodString>;
297
297
  latestRunId: z.ZodNullable<z.ZodString>;
@@ -300,7 +300,7 @@ export declare const taskResponseSchema: z.ZodObject<{
300
300
  deletedAt: z.ZodNullable<z.ZodISODateTime>;
301
301
  createdAt: z.ZodISODateTime;
302
302
  updatedAt: z.ZodISODateTime;
303
- }, z.core.$strict>;
303
+ }, z.core.$strip>;
304
304
  export declare const taskRunSchema: z.ZodObject<{
305
305
  id: z.ZodString;
306
306
  taskId: z.ZodString;
@@ -326,7 +326,7 @@ export declare const taskRunSchema: z.ZodObject<{
326
326
  canceledAt: z.ZodNullable<z.ZodISODateTime>;
327
327
  createdAt: z.ZodISODateTime;
328
328
  updatedAt: z.ZodISODateTime;
329
- }, z.core.$strict>;
329
+ }, z.core.$strip>;
330
330
  export declare const taskRunResponseSchema: z.ZodObject<{
331
331
  id: z.ZodString;
332
332
  taskId: z.ZodString;
@@ -352,7 +352,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
352
352
  canceledAt: z.ZodNullable<z.ZodISODateTime>;
353
353
  createdAt: z.ZodISODateTime;
354
354
  updatedAt: z.ZodISODateTime;
355
- }, z.core.$strict>;
355
+ }, z.core.$strip>;
356
356
  export declare const taskRunsListResponseSchema: z.ZodObject<{
357
357
  data: z.ZodArray<z.ZodObject<{
358
358
  id: z.ZodString;
@@ -379,9 +379,9 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
379
379
  canceledAt: z.ZodNullable<z.ZodISODateTime>;
380
380
  createdAt: z.ZodISODateTime;
381
381
  updatedAt: z.ZodISODateTime;
382
- }, z.core.$strict>>;
382
+ }, z.core.$strip>>;
383
383
  nextCursor: z.ZodNullable<z.ZodString>;
384
- }, z.core.$strict>;
384
+ }, z.core.$strip>;
385
385
  export declare const createTaskResponseSchema: z.ZodObject<{
386
386
  task: z.ZodObject<{
387
387
  id: z.ZodString;
@@ -394,20 +394,20 @@ export declare const createTaskResponseSchema: z.ZodObject<{
394
394
  kind: z.ZodLiteral<"once">;
395
395
  config: z.ZodObject<{
396
396
  at: z.ZodISODateTime;
397
- }, z.core.$strict>;
398
- }, z.core.$strict>, z.ZodObject<{
397
+ }, z.core.$strip>;
398
+ }, z.core.$strip>, z.ZodObject<{
399
399
  kind: z.ZodLiteral<"interval">;
400
400
  config: z.ZodObject<{
401
401
  everyMs: z.ZodNumber;
402
- }, z.core.$strict>;
403
- }, z.core.$strict>, z.ZodObject<{
402
+ }, z.core.$strip>;
403
+ }, z.core.$strip>, z.ZodObject<{
404
404
  kind: z.ZodLiteral<"cron">;
405
405
  config: z.ZodObject<{
406
406
  expression: z.ZodString;
407
407
  staggerMs: z.ZodOptional<z.ZodNumber>;
408
408
  timezone: z.ZodDefault<z.ZodString>;
409
- }, z.core.$strict>;
410
- }, z.core.$strict>], "kind">>;
409
+ }, z.core.$strip>;
410
+ }, z.core.$strip>], "kind">>;
411
411
  enabled: z.ZodBoolean;
412
412
  activeRunId: z.ZodNullable<z.ZodString>;
413
413
  latestRunId: z.ZodNullable<z.ZodString>;
@@ -416,12 +416,12 @@ export declare const createTaskResponseSchema: z.ZodObject<{
416
416
  deletedAt: z.ZodNullable<z.ZodISODateTime>;
417
417
  createdAt: z.ZodISODateTime;
418
418
  updatedAt: z.ZodISODateTime;
419
- }, z.core.$strict>;
419
+ }, z.core.$strip>;
420
420
  runId: z.ZodNullable<z.ZodString>;
421
- }, z.core.$strict>;
421
+ }, z.core.$strip>;
422
422
  export declare const createTaskRunResponseSchema: z.ZodObject<{
423
423
  runId: z.ZodString;
424
- }, z.core.$strict>;
424
+ }, z.core.$strip>;
425
425
  export declare const taskRunMessagesResponseSchema: z.ZodObject<{
426
426
  data: z.ZodArray<z.ZodObject<{
427
427
  id: z.ZodString;
@@ -437,7 +437,17 @@ export declare const taskRunMessagesResponseSchema: z.ZodObject<{
437
437
  }, z.core.$loose>>;
438
438
  nextCursor: z.ZodNullable<z.ZodString>;
439
439
  latestCursor: z.ZodNullable<z.ZodString>;
440
- }, z.core.$strict>;
440
+ error: z.ZodNullable<z.ZodString>;
441
+ finishedAt: z.ZodNullable<z.ZodISODateTime>;
442
+ status: z.ZodEnum<{
443
+ blocked: "blocked";
444
+ canceled: "canceled";
445
+ failed: "failed";
446
+ queued: "queued";
447
+ running: "running";
448
+ succeeded: "succeeded";
449
+ }>;
450
+ }, z.core.$strip>;
441
451
  export type Task = z.infer<typeof taskSchema>;
442
452
  export type TaskListItem = z.infer<typeof taskListItemSchema>;
443
453
  export type TaskLatestRun = z.infer<typeof taskLatestRunSchema>;
@@ -6,7 +6,7 @@ import { MAX_TASK_NAME_LENGTH, MAX_TASK_PROMPT_LENGTH, MIN_TASK_INTERVAL_MS, } f
6
6
  import { atLeastOneFieldMessage, hasObjectKeys } from "../utils.js";
7
7
  import { agentVersionNumberSchema } from "./agents.js";
8
8
  import { metadataSchema, userIdSchema } from "./attribution.js";
9
- import { sessionMessageSchema } from "./sessions.js";
9
+ import { sessionMessagesResponseSchema } from "./sessions.js";
10
10
  /**
11
11
  * Schedule kinds — discriminated union, Cohand's kinds with croner-forked
12
12
  * next-run math. `staggerMs` is an optional cron load-spreading offset.
@@ -161,6 +161,15 @@ export const taskRunStatusSchema = z.enum([
161
161
  "failed",
162
162
  "canceled",
163
163
  ]);
164
+ /** Response schedules accept additive fields without relaxing schedule writes. */
165
+ const taskScheduleResponseSchema = z.discriminatedUnion("kind", [
166
+ z.object({ kind: z.literal("once"), config: taskOnceConfigSchema.strip() }),
167
+ z.object({
168
+ kind: z.literal("interval"),
169
+ config: taskIntervalConfigSchema.strip(),
170
+ }),
171
+ z.object({ kind: z.literal("cron"), config: taskCronConfigSchema.strip() }),
172
+ ]);
164
173
  // The task record — pure definition; state lives in its runs.
165
174
  export const taskSchema = z
166
175
  .object({
@@ -170,7 +179,7 @@ export const taskSchema = z
170
179
  agentVersion: agentVersionNumberSchema.nullable(),
171
180
  name: taskNameSchema,
172
181
  prompt: taskPromptSchema,
173
- schedule: taskScheduleInputSchema.nullable(),
182
+ schedule: taskScheduleResponseSchema.nullable(),
174
183
  enabled: z.boolean(),
175
184
  activeRunId: taskRunIdSchema.nullable(),
176
185
  latestRunId: taskRunIdSchema.nullable(),
@@ -180,7 +189,7 @@ export const taskSchema = z
180
189
  createdAt: z.iso.datetime({ offset: true }),
181
190
  updatedAt: z.iso.datetime({ offset: true }),
182
191
  })
183
- .strict();
192
+ .strip();
184
193
  // Compact run embed for list items — kills N+1 status polling.
185
194
  export const taskLatestRunSchema = z
186
195
  .object({
@@ -188,7 +197,7 @@ export const taskLatestRunSchema = z
188
197
  status: taskRunStatusSchema,
189
198
  finishedAt: z.iso.datetime({ offset: true }).nullable(),
190
199
  })
191
- .strict();
200
+ .strip();
192
201
  export const taskListItemSchema = taskSchema.extend({
193
202
  latestRun: taskLatestRunSchema.nullable(),
194
203
  });
@@ -224,7 +233,7 @@ export const taskRunSchema = z
224
233
  createdAt: z.iso.datetime({ offset: true }),
225
234
  updatedAt: z.iso.datetime({ offset: true }),
226
235
  })
227
- .strict();
236
+ .strip();
228
237
  export const taskRunResponseSchema = taskRunSchema;
229
238
  export const taskRunsListResponseSchema = paginatedResponseSchema(taskRunSchema);
230
239
  // `POST /v1/tasks` response — the created task + optional queued run id.
@@ -233,20 +242,20 @@ export const createTaskResponseSchema = z
233
242
  task: taskSchema,
234
243
  runId: taskRunIdSchema.nullable(),
235
244
  })
236
- .strict();
245
+ .strip();
237
246
  // `POST /v1/tasks/{taskId}/runs` response — the queued run id.
238
247
  export const createTaskRunResponseSchema = z
239
248
  .object({
240
249
  runId: taskRunIdSchema,
241
250
  })
242
- .strict();
243
- // `GET .../runs/{runId}/messages` — task-run session transcript, paginated.
244
- // Mirrors `sessionMessagesResponseSchema`: `latestCursor` is the tail
245
- // position (newest seq) for the poll loop's `?after=` cursor.
246
- export const taskRunMessagesResponseSchema = z
247
- .object({
248
- data: z.array(sessionMessageSchema),
249
- nextCursor: z.string().nullable(),
250
- latestCursor: z.string().nullable(),
251
+ .strip();
252
+ // `GET .../runs/{runId}/messages` — task-run session transcript, paginated,
253
+ // plus `status`, `error`, and `finishedAt` for a single client poll loop.
254
+ // `latestCursor` remains the tail position for the next `?after=` request.
255
+ export const taskRunMessagesResponseSchema = sessionMessagesResponseSchema
256
+ .extend({
257
+ error: z.string().nullable(),
258
+ finishedAt: z.iso.datetime({ offset: true }).nullable(),
259
+ status: taskRunStatusSchema,
251
260
  })
252
- .strict();
261
+ .strip();
@@ -10,7 +10,7 @@ export declare const tenantSchema: z.ZodObject<{
10
10
  name: z.ZodString;
11
11
  createdAt: z.ZodISODateTime;
12
12
  updatedAt: z.ZodISODateTime;
13
- }, z.core.$strict>;
13
+ }, z.core.$strip>;
14
14
  export declare const subscriptionStatusSchema: z.ZodEnum<{
15
15
  active: "active";
16
16
  inactive: "inactive";
@@ -26,7 +26,7 @@ export declare const tenantResponseSchema: z.ZodObject<{
26
26
  active: "active";
27
27
  inactive: "inactive";
28
28
  }>;
29
- }, z.core.$strict>;
29
+ }, z.core.$strip>;
30
30
  /**
31
31
  * Quota — `GET/PATCH /v1/tenant` carries the tenant's self-set quota.
32
32
  * `null` means unlimited (no quota row).
@@ -42,16 +42,16 @@ export declare const tenantSettingsSchema: z.ZodObject<{
42
42
  monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
43
43
  monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
44
44
  resetDay: z.ZodNumber;
45
- }, z.core.$strict>>;
46
- }, z.core.$strict>;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>;
47
47
  export declare const tenantSettingsResponseSchema: z.ZodObject<{
48
48
  name: z.ZodString;
49
49
  quota: z.ZodNullable<z.ZodObject<{
50
50
  monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
51
51
  monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
52
52
  resetDay: z.ZodNumber;
53
- }, z.core.$strict>>;
54
- }, z.core.$strict>;
53
+ }, z.core.$strip>>;
54
+ }, z.core.$strip>;
55
55
  export declare const updateTenantSettingsBodySchema: z.ZodObject<{
56
56
  name: z.ZodOptional<z.ZodString>;
57
57
  quota: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -15,11 +15,11 @@ export const tenantSchema = z
15
15
  createdAt: z.iso.datetime({ offset: true }),
16
16
  updatedAt: z.iso.datetime({ offset: true }),
17
17
  })
18
- .strict();
18
+ .strip();
19
19
  export const subscriptionStatusSchema = z.enum(["active", "inactive"]);
20
20
  export const tenantResponseSchema = tenantSchema
21
21
  .extend({ subscriptionStatus: subscriptionStatusSchema })
22
- .strict();
22
+ .strip();
23
23
  /**
24
24
  * Quota — `GET/PATCH /v1/tenant` carries the tenant's self-set quota.
25
25
  * `null` means unlimited (no quota row).
@@ -39,9 +39,9 @@ export const quotaSchema = z
39
39
  export const tenantSettingsSchema = z
40
40
  .object({
41
41
  name: z.string().trim().min(1).max(MAX_TENANT_NAME_LENGTH),
42
- quota: quotaSchema.nullable(),
42
+ quota: quotaSchema.strip().nullable(),
43
43
  })
44
- .strict();
44
+ .strip();
45
45
  export const tenantSettingsResponseSchema = tenantSettingsSchema;
46
46
  export const updateTenantSettingsBodySchema = z
47
47
  .object({
@@ -61,13 +61,13 @@ export declare const usageBucketSchema: z.ZodObject<{
61
61
  outputTokens: z.ZodNumber;
62
62
  requestCount: z.ZodNumber;
63
63
  durationMs: z.ZodNumber;
64
- }, z.core.$strict>;
64
+ }, z.core.$strip>;
65
65
  export declare const usageTotalsSchema: z.ZodObject<{
66
66
  inputTokens: z.ZodNumber;
67
67
  outputTokens: z.ZodNumber;
68
68
  requestCount: z.ZodNumber;
69
69
  durationMs: z.ZodNumber;
70
- }, z.core.$strict>;
70
+ }, z.core.$strip>;
71
71
  export declare const usageResponseSchema: z.ZodObject<{
72
72
  buckets: z.ZodArray<z.ZodObject<{
73
73
  day: z.ZodNullable<z.ZodString>;
@@ -80,14 +80,14 @@ export declare const usageResponseSchema: z.ZodObject<{
80
80
  outputTokens: z.ZodNumber;
81
81
  requestCount: z.ZodNumber;
82
82
  durationMs: z.ZodNumber;
83
- }, z.core.$strict>>;
83
+ }, z.core.$strip>>;
84
84
  totals: z.ZodObject<{
85
85
  inputTokens: z.ZodNumber;
86
86
  outputTokens: z.ZodNumber;
87
87
  requestCount: z.ZodNumber;
88
88
  durationMs: z.ZodNumber;
89
- }, z.core.$strict>;
90
- }, z.core.$strict>;
89
+ }, z.core.$strip>;
90
+ }, z.core.$strip>;
91
91
  export type UsageGroupBy = z.infer<typeof usageGroupBySchema>;
92
92
  export type UsageQuery = z.infer<typeof usageQuerySchema>;
93
93
  export type UsageBucket = z.infer<typeof usageBucketSchema>;
@@ -100,7 +100,7 @@ export const usageBucketSchema = z
100
100
  requestCount: z.number().int().nonnegative(),
101
101
  durationMs: z.number().int().nonnegative(),
102
102
  })
103
- .strict();
103
+ .strip();
104
104
  export const usageTotalsSchema = z
105
105
  .object({
106
106
  inputTokens: z.number().int().nonnegative(),
@@ -108,10 +108,10 @@ export const usageTotalsSchema = z
108
108
  requestCount: z.number().int().nonnegative(),
109
109
  durationMs: z.number().int().nonnegative(),
110
110
  })
111
- .strict();
111
+ .strip();
112
112
  export const usageResponseSchema = z
113
113
  .object({
114
114
  buckets: z.array(usageBucketSchema),
115
115
  totals: usageTotalsSchema,
116
116
  })
117
- .strict();
117
+ .strip();