syllable-sdk 1.0.13-rc.4 → 1.0.13-rc.6

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 (157) hide show
  1. package/bin/mcp-server.js +2001 -59
  2. package/bin/mcp-server.js.map +34 -11
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +2 -2
  6. package/lib/config.js +2 -2
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/server.js +1 -1
  9. package/models/components/bodyinsightsfolderuploadfile.d.ts +8 -8
  10. package/models/components/bodyinsightsfolderuploadfile.d.ts.map +1 -1
  11. package/models/components/bodyinsightsfolderuploadfile.js +11 -12
  12. package/models/components/bodyinsightsfolderuploadfile.js.map +1 -1
  13. package/models/components/callaction.d.ts +113 -0
  14. package/models/components/callaction.d.ts.map +1 -0
  15. package/models/components/callaction.js +174 -0
  16. package/models/components/callaction.js.map +1 -0
  17. package/models/components/caseexpression.d.ts +18 -0
  18. package/models/components/caseexpression.d.ts.map +1 -0
  19. package/models/components/caseexpression.js +59 -0
  20. package/models/components/caseexpression.js.map +1 -0
  21. package/models/components/celexpression.d.ts +28 -0
  22. package/models/components/celexpression.d.ts.map +1 -0
  23. package/models/components/celexpression.js +60 -0
  24. package/models/components/celexpression.js.map +1 -0
  25. package/models/components/conditionaltext.d.ts +85 -0
  26. package/models/components/conditionaltext.d.ts.map +1 -0
  27. package/models/components/conditionaltext.js +147 -0
  28. package/models/components/conditionaltext.js.map +1 -0
  29. package/models/components/conditionalvalue.d.ts +147 -0
  30. package/models/components/conditionalvalue.d.ts.map +1 -0
  31. package/models/components/conditionalvalue.js +248 -0
  32. package/models/components/conditionalvalue.js.map +1 -0
  33. package/models/components/context.d.ts +122 -8
  34. package/models/components/context.d.ts.map +1 -1
  35. package/models/components/context.js +199 -6
  36. package/models/components/context.js.map +1 -1
  37. package/models/components/contexttaskmetadata.d.ts +22 -0
  38. package/models/components/contexttaskmetadata.d.ts.map +1 -0
  39. package/models/components/contexttaskmetadata.js +69 -0
  40. package/models/components/contexttaskmetadata.js.map +1 -0
  41. package/models/components/contexttoolinfo.d.ts +25 -0
  42. package/models/components/contexttoolinfo.d.ts.map +1 -0
  43. package/models/components/contexttoolinfo.js +60 -0
  44. package/models/components/contexttoolinfo.js.map +1 -0
  45. package/models/components/eventtask.d.ts +42 -0
  46. package/models/components/eventtask.d.ts.map +1 -0
  47. package/models/components/eventtask.js +76 -0
  48. package/models/components/eventtask.js.map +1 -0
  49. package/models/components/eventtaskevents.d.ts +74 -0
  50. package/models/components/eventtaskevents.d.ts.map +1 -0
  51. package/models/components/eventtaskevents.js +139 -0
  52. package/models/components/eventtaskevents.js.map +1 -0
  53. package/models/components/expressiontask.d.ts +109 -0
  54. package/models/components/expressiontask.d.ts.map +1 -0
  55. package/models/components/expressiontask.js +170 -0
  56. package/models/components/expressiontask.js.map +1 -0
  57. package/models/components/expressiontaskevents.d.ts +131 -0
  58. package/models/components/expressiontaskevents.d.ts.map +1 -0
  59. package/models/components/expressiontaskevents.js +219 -0
  60. package/models/components/expressiontaskevents.js.map +1 -0
  61. package/models/components/incrementaction.d.ts +92 -0
  62. package/models/components/incrementaction.d.ts.map +1 -0
  63. package/models/components/incrementaction.js +151 -0
  64. package/models/components/incrementaction.js.map +1 -0
  65. package/models/components/index.d.ts +24 -1
  66. package/models/components/index.d.ts.map +1 -1
  67. package/models/components/index.js +24 -1
  68. package/models/components/index.js.map +1 -1
  69. package/models/components/inputparameter.d.ts +51 -0
  70. package/models/components/inputparameter.d.ts.map +1 -0
  71. package/models/components/inputparameter.js +87 -0
  72. package/models/components/inputparameter.js.map +1 -0
  73. package/models/components/jmespathexpression.d.ts +44 -0
  74. package/models/components/jmespathexpression.d.ts.map +1 -0
  75. package/models/components/jmespathexpression.js +71 -0
  76. package/models/components/jmespathexpression.js.map +1 -0
  77. package/models/components/loadtoolfromfiletask.d.ts +59 -0
  78. package/models/components/loadtoolfromfiletask.d.ts.map +1 -0
  79. package/models/components/loadtoolfromfiletask.js +88 -0
  80. package/models/components/loadtoolfromfiletask.js.map +1 -0
  81. package/models/components/nextstep.d.ts +93 -0
  82. package/models/components/nextstep.d.ts.map +1 -0
  83. package/models/components/nextstep.js +149 -0
  84. package/models/components/nextstep.js.map +1 -0
  85. package/models/components/saveaction.d.ts +92 -0
  86. package/models/components/saveaction.d.ts.map +1 -0
  87. package/models/components/saveaction.js +151 -0
  88. package/models/components/saveaction.js.map +1 -0
  89. package/models/components/sayaction.d.ts +108 -0
  90. package/models/components/sayaction.d.ts.map +1 -0
  91. package/models/components/sayaction.js +162 -0
  92. package/models/components/sayaction.js.map +1 -0
  93. package/models/components/session.d.ts +5 -0
  94. package/models/components/session.d.ts.map +1 -1
  95. package/models/components/session.js +4 -0
  96. package/models/components/session.js.map +1 -1
  97. package/models/components/setvalueaction.d.ts +154 -0
  98. package/models/components/setvalueaction.d.ts.map +1 -0
  99. package/models/components/setvalueaction.js +246 -0
  100. package/models/components/setvalueaction.js.map +1 -0
  101. package/models/components/step.d.ts +73 -0
  102. package/models/components/step.d.ts.map +1 -0
  103. package/models/components/step.js +103 -0
  104. package/models/components/step.js.map +1 -0
  105. package/models/components/stepeventactions.d.ts +185 -0
  106. package/models/components/stepeventactions.d.ts.map +1 -0
  107. package/models/components/stepeventactions.js +296 -0
  108. package/models/components/stepeventactions.js.map +1 -0
  109. package/models/components/stepstask.d.ts +42 -0
  110. package/models/components/stepstask.d.ts.map +1 -0
  111. package/models/components/stepstask.js +76 -0
  112. package/models/components/stepstask.js.map +1 -0
  113. package/models/components/steptools.d.ts +33 -0
  114. package/models/components/steptools.d.ts.map +1 -0
  115. package/models/components/{contexttask.js → steptools.js} +24 -22
  116. package/models/components/steptools.js.map +1 -0
  117. package/models/components/variable.d.ts +119 -0
  118. package/models/components/variable.d.ts.map +1 -0
  119. package/models/components/variable.js +186 -0
  120. package/models/components/variable.js.map +1 -0
  121. package/openapi.json +2453 -662
  122. package/package.json +1 -1
  123. package/src/lib/config.ts +2 -2
  124. package/src/mcp-server/mcp-server.ts +1 -1
  125. package/src/mcp-server/server.ts +1 -1
  126. package/src/models/components/bodyinsightsfolderuploadfile.ts +36 -25
  127. package/src/models/components/callaction.ts +331 -0
  128. package/src/models/components/caseexpression.ts +53 -0
  129. package/src/models/components/celexpression.ts +60 -0
  130. package/src/models/components/conditionaltext.ts +280 -0
  131. package/src/models/components/conditionalvalue.ts +477 -0
  132. package/src/models/components/context.ts +413 -16
  133. package/src/models/components/contexttaskmetadata.ts +67 -0
  134. package/src/models/components/contexttoolinfo.ts +59 -0
  135. package/src/models/components/eventtask.ts +102 -0
  136. package/src/models/components/eventtaskevents.ts +257 -0
  137. package/src/models/components/expressiontask.ts +333 -0
  138. package/src/models/components/expressiontaskevents.ts +430 -0
  139. package/src/models/components/incrementaction.ts +291 -0
  140. package/src/models/components/index.ts +24 -1
  141. package/src/models/components/inputparameter.ts +103 -0
  142. package/src/models/components/jmespathexpression.ts +86 -0
  143. package/src/models/components/loadtoolfromfiletask.ts +137 -0
  144. package/src/models/components/nextstep.ts +280 -0
  145. package/src/models/components/saveaction.ts +281 -0
  146. package/src/models/components/sayaction.ts +302 -0
  147. package/src/models/components/session.ts +9 -0
  148. package/src/models/components/setvalueaction.ts +508 -0
  149. package/src/models/components/step.ts +174 -0
  150. package/src/models/components/stepeventactions.ts +619 -0
  151. package/src/models/components/stepstask.ts +102 -0
  152. package/src/models/components/steptools.ts +76 -0
  153. package/src/models/components/variable.ts +332 -0
  154. package/models/components/contexttask.d.ts +0 -32
  155. package/models/components/contexttask.d.ts.map +0 -1
  156. package/models/components/contexttask.js.map +0 -1
  157. package/src/models/components/contexttask.ts +0 -78
@@ -7,36 +7,327 @@ import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
  import {
10
- ContextTask,
11
- ContextTask$inboundSchema,
12
- ContextTask$Outbound,
13
- ContextTask$outboundSchema,
14
- } from "./contexttask.js";
10
+ EventTask,
11
+ EventTask$inboundSchema,
12
+ EventTask$Outbound,
13
+ EventTask$outboundSchema,
14
+ } from "./eventtask.js";
15
+ import {
16
+ ExpressionTask,
17
+ ExpressionTask$inboundSchema,
18
+ ExpressionTask$Outbound,
19
+ ExpressionTask$outboundSchema,
20
+ } from "./expressiontask.js";
21
+ import {
22
+ LoadToolFromFileTask,
23
+ LoadToolFromFileTask$inboundSchema,
24
+ LoadToolFromFileTask$Outbound,
25
+ LoadToolFromFileTask$outboundSchema,
26
+ } from "./loadtoolfromfiletask.js";
27
+ import {
28
+ StepsTask,
29
+ StepsTask$inboundSchema,
30
+ StepsTask$Outbound,
31
+ StepsTask$outboundSchema,
32
+ } from "./stepstask.js";
33
+
34
+ export type Two =
35
+ | (LoadToolFromFileTask & { type: "import" })
36
+ | (EventTask & { type: "event" })
37
+ | (ExpressionTask & { type: "expression" })
38
+ | (StepsTask & { type: "steps" });
39
+
40
+ export type Task1 =
41
+ | (LoadToolFromFileTask & { type: "import" })
42
+ | (EventTask & { type: "event" })
43
+ | (ExpressionTask & { type: "expression" })
44
+ | (StepsTask & { type: "steps" });
15
45
 
16
46
  /**
17
47
  * Task implementation details
18
48
  */
19
- export type Task = ContextTask | Array<ContextTask>;
49
+ export type Task =
50
+ | (LoadToolFromFileTask & { type: "import" })
51
+ | (EventTask & { type: "event" })
52
+ | (ExpressionTask & { type: "expression" })
53
+ | (StepsTask & { type: "steps" })
54
+ | Array<
55
+ | (LoadToolFromFileTask & { type: "import" })
56
+ | (EventTask & { type: "event" })
57
+ | (ExpressionTask & { type: "expression" })
58
+ | (StepsTask & { type: "steps" })
59
+ >;
20
60
 
21
- /**
22
- * Context configuration carried alongside a context tool call.
23
- */
24
61
  export type Context = {
25
62
  /**
26
63
  * Task implementation details
27
64
  */
28
- task?: ContextTask | Array<ContextTask> | null | undefined;
65
+ task?:
66
+ | (LoadToolFromFileTask & { type: "import" })
67
+ | (EventTask & { type: "event" })
68
+ | (ExpressionTask & { type: "expression" })
69
+ | (StepsTask & { type: "steps" })
70
+ | Array<
71
+ | (LoadToolFromFileTask & { type: "import" })
72
+ | (EventTask & { type: "event" })
73
+ | (ExpressionTask & { type: "expression" })
74
+ | (StepsTask & { type: "steps" })
75
+ >
76
+ | null
77
+ | undefined;
29
78
  };
30
79
 
80
+ /** @internal */
81
+ export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z.union(
82
+ [
83
+ LoadToolFromFileTask$inboundSchema.and(
84
+ z.object({ type: z.literal("import") }).transform((v) => ({
85
+ type: v.type,
86
+ })),
87
+ ),
88
+ EventTask$inboundSchema.and(
89
+ z.object({ type: z.literal("event") }).transform((v) => ({
90
+ type: v.type,
91
+ })),
92
+ ),
93
+ ExpressionTask$inboundSchema.and(
94
+ z.object({ type: z.literal("expression") }).transform((v) => ({
95
+ type: v.type,
96
+ })),
97
+ ),
98
+ StepsTask$inboundSchema.and(
99
+ z.object({ type: z.literal("steps") }).transform((v) => ({
100
+ type: v.type,
101
+ })),
102
+ ),
103
+ ],
104
+ );
105
+ /** @internal */
106
+ export type Two$Outbound =
107
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
108
+ | (EventTask$Outbound & { type: "event" })
109
+ | (ExpressionTask$Outbound & { type: "expression" })
110
+ | (StepsTask$Outbound & { type: "steps" });
111
+
112
+ /** @internal */
113
+ export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
114
+ .union([
115
+ LoadToolFromFileTask$outboundSchema.and(
116
+ z.object({ type: z.literal("import") }).transform((v) => ({
117
+ type: v.type,
118
+ })),
119
+ ),
120
+ EventTask$outboundSchema.and(
121
+ z.object({ type: z.literal("event") }).transform((v) => ({
122
+ type: v.type,
123
+ })),
124
+ ),
125
+ ExpressionTask$outboundSchema.and(
126
+ z.object({ type: z.literal("expression") }).transform((v) => ({
127
+ type: v.type,
128
+ })),
129
+ ),
130
+ StepsTask$outboundSchema.and(
131
+ z.object({ type: z.literal("steps") }).transform((v) => ({
132
+ type: v.type,
133
+ })),
134
+ ),
135
+ ]);
136
+
137
+ export function twoToJSON(two: Two): string {
138
+ return JSON.stringify(Two$outboundSchema.parse(two));
139
+ }
140
+ export function twoFromJSON(
141
+ jsonString: string,
142
+ ): SafeParseResult<Two, SDKValidationError> {
143
+ return safeParse(
144
+ jsonString,
145
+ (x) => Two$inboundSchema.parse(JSON.parse(x)),
146
+ `Failed to parse 'Two' from JSON`,
147
+ );
148
+ }
149
+
150
+ /** @internal */
151
+ export const Task1$inboundSchema: z.ZodType<Task1, z.ZodTypeDef, unknown> = z
152
+ .union([
153
+ LoadToolFromFileTask$inboundSchema.and(
154
+ z.object({ type: z.literal("import") }).transform((v) => ({
155
+ type: v.type,
156
+ })),
157
+ ),
158
+ EventTask$inboundSchema.and(
159
+ z.object({ type: z.literal("event") }).transform((v) => ({
160
+ type: v.type,
161
+ })),
162
+ ),
163
+ ExpressionTask$inboundSchema.and(
164
+ z.object({ type: z.literal("expression") }).transform((v) => ({
165
+ type: v.type,
166
+ })),
167
+ ),
168
+ StepsTask$inboundSchema.and(
169
+ z.object({ type: z.literal("steps") }).transform((v) => ({
170
+ type: v.type,
171
+ })),
172
+ ),
173
+ ]);
174
+ /** @internal */
175
+ export type Task1$Outbound =
176
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
177
+ | (EventTask$Outbound & { type: "event" })
178
+ | (ExpressionTask$Outbound & { type: "expression" })
179
+ | (StepsTask$Outbound & { type: "steps" });
180
+
181
+ /** @internal */
182
+ export const Task1$outboundSchema: z.ZodType<
183
+ Task1$Outbound,
184
+ z.ZodTypeDef,
185
+ Task1
186
+ > = z.union([
187
+ LoadToolFromFileTask$outboundSchema.and(
188
+ z.object({ type: z.literal("import") }).transform((v) => ({
189
+ type: v.type,
190
+ })),
191
+ ),
192
+ EventTask$outboundSchema.and(
193
+ z.object({ type: z.literal("event") }).transform((v) => ({ type: v.type })),
194
+ ),
195
+ ExpressionTask$outboundSchema.and(
196
+ z.object({ type: z.literal("expression") }).transform((v) => ({
197
+ type: v.type,
198
+ })),
199
+ ),
200
+ StepsTask$outboundSchema.and(
201
+ z.object({ type: z.literal("steps") }).transform((v) => ({ type: v.type })),
202
+ ),
203
+ ]);
204
+
205
+ export function task1ToJSON(task1: Task1): string {
206
+ return JSON.stringify(Task1$outboundSchema.parse(task1));
207
+ }
208
+ export function task1FromJSON(
209
+ jsonString: string,
210
+ ): SafeParseResult<Task1, SDKValidationError> {
211
+ return safeParse(
212
+ jsonString,
213
+ (x) => Task1$inboundSchema.parse(JSON.parse(x)),
214
+ `Failed to parse 'Task1' from JSON`,
215
+ );
216
+ }
217
+
31
218
  /** @internal */
32
219
  export const Task$inboundSchema: z.ZodType<Task, z.ZodTypeDef, unknown> = z
33
- .union([ContextTask$inboundSchema, z.array(ContextTask$inboundSchema)]);
220
+ .union([
221
+ z.union([
222
+ LoadToolFromFileTask$inboundSchema.and(
223
+ z.object({ type: z.literal("import") }).transform((v) => ({
224
+ type: v.type,
225
+ })),
226
+ ),
227
+ EventTask$inboundSchema.and(
228
+ z.object({ type: z.literal("event") }).transform((v) => ({
229
+ type: v.type,
230
+ })),
231
+ ),
232
+ ExpressionTask$inboundSchema.and(
233
+ z.object({ type: z.literal("expression") }).transform((v) => ({
234
+ type: v.type,
235
+ })),
236
+ ),
237
+ StepsTask$inboundSchema.and(
238
+ z.object({ type: z.literal("steps") }).transform((v) => ({
239
+ type: v.type,
240
+ })),
241
+ ),
242
+ ]),
243
+ z.array(
244
+ z.union([
245
+ LoadToolFromFileTask$inboundSchema.and(
246
+ z.object({ type: z.literal("import") }).transform((v) => ({
247
+ type: v.type,
248
+ })),
249
+ ),
250
+ EventTask$inboundSchema.and(
251
+ z.object({ type: z.literal("event") }).transform((v) => ({
252
+ type: v.type,
253
+ })),
254
+ ),
255
+ ExpressionTask$inboundSchema.and(
256
+ z.object({ type: z.literal("expression") }).transform((v) => ({
257
+ type: v.type,
258
+ })),
259
+ ),
260
+ StepsTask$inboundSchema.and(
261
+ z.object({ type: z.literal("steps") }).transform((v) => ({
262
+ type: v.type,
263
+ })),
264
+ ),
265
+ ]),
266
+ ),
267
+ ]);
34
268
  /** @internal */
35
- export type Task$Outbound = ContextTask$Outbound | Array<ContextTask$Outbound>;
269
+ export type Task$Outbound =
270
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
271
+ | (EventTask$Outbound & { type: "event" })
272
+ | (ExpressionTask$Outbound & { type: "expression" })
273
+ | (StepsTask$Outbound & { type: "steps" })
274
+ | Array<
275
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
276
+ | (EventTask$Outbound & { type: "event" })
277
+ | (ExpressionTask$Outbound & { type: "expression" })
278
+ | (StepsTask$Outbound & { type: "steps" })
279
+ >;
36
280
 
37
281
  /** @internal */
38
282
  export const Task$outboundSchema: z.ZodType<Task$Outbound, z.ZodTypeDef, Task> =
39
- z.union([ContextTask$outboundSchema, z.array(ContextTask$outboundSchema)]);
283
+ z.union([
284
+ z.union([
285
+ LoadToolFromFileTask$outboundSchema.and(
286
+ z.object({ type: z.literal("import") }).transform((v) => ({
287
+ type: v.type,
288
+ })),
289
+ ),
290
+ EventTask$outboundSchema.and(
291
+ z.object({ type: z.literal("event") }).transform((v) => ({
292
+ type: v.type,
293
+ })),
294
+ ),
295
+ ExpressionTask$outboundSchema.and(
296
+ z.object({ type: z.literal("expression") }).transform((v) => ({
297
+ type: v.type,
298
+ })),
299
+ ),
300
+ StepsTask$outboundSchema.and(
301
+ z.object({ type: z.literal("steps") }).transform((v) => ({
302
+ type: v.type,
303
+ })),
304
+ ),
305
+ ]),
306
+ z.array(
307
+ z.union([
308
+ LoadToolFromFileTask$outboundSchema.and(
309
+ z.object({ type: z.literal("import") }).transform((v) => ({
310
+ type: v.type,
311
+ })),
312
+ ),
313
+ EventTask$outboundSchema.and(
314
+ z.object({ type: z.literal("event") }).transform((v) => ({
315
+ type: v.type,
316
+ })),
317
+ ),
318
+ ExpressionTask$outboundSchema.and(
319
+ z.object({ type: z.literal("expression") }).transform((v) => ({
320
+ type: v.type,
321
+ })),
322
+ ),
323
+ StepsTask$outboundSchema.and(
324
+ z.object({ type: z.literal("steps") }).transform((v) => ({
325
+ type: v.type,
326
+ })),
327
+ ),
328
+ ]),
329
+ ),
330
+ ]);
40
331
 
41
332
  export function taskToJSON(task: Task): string {
42
333
  return JSON.stringify(Task$outboundSchema.parse(task));
@@ -55,12 +346,71 @@ export function taskFromJSON(
55
346
  export const Context$inboundSchema: z.ZodType<Context, z.ZodTypeDef, unknown> =
56
347
  z.object({
57
348
  task: z.nullable(
58
- z.union([ContextTask$inboundSchema, z.array(ContextTask$inboundSchema)]),
349
+ z.union([
350
+ z.union([
351
+ LoadToolFromFileTask$inboundSchema.and(
352
+ z.object({ type: z.literal("import") }).transform((v) => ({
353
+ type: v.type,
354
+ })),
355
+ ),
356
+ EventTask$inboundSchema.and(
357
+ z.object({ type: z.literal("event") }).transform((v) => ({
358
+ type: v.type,
359
+ })),
360
+ ),
361
+ ExpressionTask$inboundSchema.and(
362
+ z.object({ type: z.literal("expression") }).transform((v) => ({
363
+ type: v.type,
364
+ })),
365
+ ),
366
+ StepsTask$inboundSchema.and(
367
+ z.object({ type: z.literal("steps") }).transform((v) => ({
368
+ type: v.type,
369
+ })),
370
+ ),
371
+ ]),
372
+ z.array(
373
+ z.union([
374
+ LoadToolFromFileTask$inboundSchema.and(
375
+ z.object({ type: z.literal("import") }).transform((v) => ({
376
+ type: v.type,
377
+ })),
378
+ ),
379
+ EventTask$inboundSchema.and(
380
+ z.object({ type: z.literal("event") }).transform((v) => ({
381
+ type: v.type,
382
+ })),
383
+ ),
384
+ ExpressionTask$inboundSchema.and(
385
+ z.object({ type: z.literal("expression") }).transform((v) => ({
386
+ type: v.type,
387
+ })),
388
+ ),
389
+ StepsTask$inboundSchema.and(
390
+ z.object({ type: z.literal("steps") }).transform((v) => ({
391
+ type: v.type,
392
+ })),
393
+ ),
394
+ ]),
395
+ ),
396
+ ]),
59
397
  ).optional(),
60
398
  });
61
399
  /** @internal */
62
400
  export type Context$Outbound = {
63
- task?: ContextTask$Outbound | Array<ContextTask$Outbound> | null | undefined;
401
+ task?:
402
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
403
+ | (EventTask$Outbound & { type: "event" })
404
+ | (ExpressionTask$Outbound & { type: "expression" })
405
+ | (StepsTask$Outbound & { type: "steps" })
406
+ | Array<
407
+ | (LoadToolFromFileTask$Outbound & { type: "import" })
408
+ | (EventTask$Outbound & { type: "event" })
409
+ | (ExpressionTask$Outbound & { type: "expression" })
410
+ | (StepsTask$Outbound & { type: "steps" })
411
+ >
412
+ | null
413
+ | undefined;
64
414
  };
65
415
 
66
416
  /** @internal */
@@ -70,7 +420,54 @@ export const Context$outboundSchema: z.ZodType<
70
420
  Context
71
421
  > = z.object({
72
422
  task: z.nullable(
73
- z.union([ContextTask$outboundSchema, z.array(ContextTask$outboundSchema)]),
423
+ z.union([
424
+ z.union([
425
+ LoadToolFromFileTask$outboundSchema.and(
426
+ z.object({ type: z.literal("import") }).transform((v) => ({
427
+ type: v.type,
428
+ })),
429
+ ),
430
+ EventTask$outboundSchema.and(
431
+ z.object({ type: z.literal("event") }).transform((v) => ({
432
+ type: v.type,
433
+ })),
434
+ ),
435
+ ExpressionTask$outboundSchema.and(
436
+ z.object({ type: z.literal("expression") }).transform((v) => ({
437
+ type: v.type,
438
+ })),
439
+ ),
440
+ StepsTask$outboundSchema.and(
441
+ z.object({ type: z.literal("steps") }).transform((v) => ({
442
+ type: v.type,
443
+ })),
444
+ ),
445
+ ]),
446
+ z.array(
447
+ z.union([
448
+ LoadToolFromFileTask$outboundSchema.and(
449
+ z.object({ type: z.literal("import") }).transform((v) => ({
450
+ type: v.type,
451
+ })),
452
+ ),
453
+ EventTask$outboundSchema.and(
454
+ z.object({ type: z.literal("event") }).transform((v) => ({
455
+ type: v.type,
456
+ })),
457
+ ),
458
+ ExpressionTask$outboundSchema.and(
459
+ z.object({ type: z.literal("expression") }).transform((v) => ({
460
+ type: v.type,
461
+ })),
462
+ ),
463
+ StepsTask$outboundSchema.and(
464
+ z.object({ type: z.literal("steps") }).transform((v) => ({
465
+ type: v.type,
466
+ })),
467
+ ),
468
+ ]),
469
+ ),
470
+ ]),
74
471
  ).optional(),
75
472
  });
76
473
 
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type ContextTaskMetadata = {
12
+ priority?: number | null | undefined;
13
+ /**
14
+ * Name of the ToolDefinition that defined this task
15
+ */
16
+ parentToolName?: string | null | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const ContextTaskMetadata$inboundSchema: z.ZodType<
21
+ ContextTaskMetadata,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ priority: z.nullable(z.number().int()).optional(),
26
+ parent_tool_name: z.nullable(z.string()).optional(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "parent_tool_name": "parentToolName",
30
+ });
31
+ });
32
+ /** @internal */
33
+ export type ContextTaskMetadata$Outbound = {
34
+ priority?: number | null | undefined;
35
+ parent_tool_name?: string | null | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export const ContextTaskMetadata$outboundSchema: z.ZodType<
40
+ ContextTaskMetadata$Outbound,
41
+ z.ZodTypeDef,
42
+ ContextTaskMetadata
43
+ > = z.object({
44
+ priority: z.nullable(z.number().int()).optional(),
45
+ parentToolName: z.nullable(z.string()).optional(),
46
+ }).transform((v) => {
47
+ return remap$(v, {
48
+ parentToolName: "parent_tool_name",
49
+ });
50
+ });
51
+
52
+ export function contextTaskMetadataToJSON(
53
+ contextTaskMetadata: ContextTaskMetadata,
54
+ ): string {
55
+ return JSON.stringify(
56
+ ContextTaskMetadata$outboundSchema.parse(contextTaskMetadata),
57
+ );
58
+ }
59
+ export function contextTaskMetadataFromJSON(
60
+ jsonString: string,
61
+ ): SafeParseResult<ContextTaskMetadata, SDKValidationError> {
62
+ return safeParse(
63
+ jsonString,
64
+ (x) => ContextTaskMetadata$inboundSchema.parse(JSON.parse(x)),
65
+ `Failed to parse 'ContextTaskMetadata' from JSON`,
66
+ );
67
+ }
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ContextToolInfo = {
11
+ /**
12
+ * The name of the generated tool.
13
+ */
14
+ name?: string | null | undefined;
15
+ /**
16
+ * The description of the tool.
17
+ */
18
+ description?: string | null | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const ContextToolInfo$inboundSchema: z.ZodType<
23
+ ContextToolInfo,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ name: z.nullable(z.string()).optional(),
28
+ description: z.nullable(z.string()).optional(),
29
+ });
30
+ /** @internal */
31
+ export type ContextToolInfo$Outbound = {
32
+ name?: string | null | undefined;
33
+ description?: string | null | undefined;
34
+ };
35
+
36
+ /** @internal */
37
+ export const ContextToolInfo$outboundSchema: z.ZodType<
38
+ ContextToolInfo$Outbound,
39
+ z.ZodTypeDef,
40
+ ContextToolInfo
41
+ > = z.object({
42
+ name: z.nullable(z.string()).optional(),
43
+ description: z.nullable(z.string()).optional(),
44
+ });
45
+
46
+ export function contextToolInfoToJSON(
47
+ contextToolInfo: ContextToolInfo,
48
+ ): string {
49
+ return JSON.stringify(ContextToolInfo$outboundSchema.parse(contextToolInfo));
50
+ }
51
+ export function contextToolInfoFromJSON(
52
+ jsonString: string,
53
+ ): SafeParseResult<ContextToolInfo, SDKValidationError> {
54
+ return safeParse(
55
+ jsonString,
56
+ (x) => ContextToolInfo$inboundSchema.parse(JSON.parse(x)),
57
+ `Failed to parse 'ContextToolInfo' from JSON`,
58
+ );
59
+ }
@@ -0,0 +1,102 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ ContextTaskMetadata,
11
+ ContextTaskMetadata$inboundSchema,
12
+ ContextTaskMetadata$Outbound,
13
+ ContextTaskMetadata$outboundSchema,
14
+ } from "./contexttaskmetadata.js";
15
+ import {
16
+ ContextToolInfo,
17
+ ContextToolInfo$inboundSchema,
18
+ ContextToolInfo$Outbound,
19
+ ContextToolInfo$outboundSchema,
20
+ } from "./contexttoolinfo.js";
21
+ import {
22
+ EventTaskEvents,
23
+ EventTaskEvents$inboundSchema,
24
+ EventTaskEvents$Outbound,
25
+ EventTaskEvents$outboundSchema,
26
+ } from "./eventtaskevents.js";
27
+ import {
28
+ Variable,
29
+ Variable$inboundSchema,
30
+ Variable$Outbound,
31
+ Variable$outboundSchema,
32
+ } from "./variable.js";
33
+
34
+ export type EventTask = {
35
+ /**
36
+ * A unique identifier for the task.
37
+ */
38
+ id?: string | null | undefined;
39
+ config?: { [k: string]: any } | null | undefined;
40
+ variables?: Array<Variable> | null | undefined;
41
+ metadata?: ContextTaskMetadata | null | undefined;
42
+ tool?: ContextToolInfo | null | undefined;
43
+ type?: "event" | undefined;
44
+ version?: "v1alpha" | undefined;
45
+ on?: EventTaskEvents | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const EventTask$inboundSchema: z.ZodType<
50
+ EventTask,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ id: z.nullable(z.string()).optional(),
55
+ config: z.nullable(z.record(z.any())).optional(),
56
+ variables: z.nullable(z.array(Variable$inboundSchema)).optional(),
57
+ metadata: z.nullable(ContextTaskMetadata$inboundSchema).optional(),
58
+ tool: z.nullable(ContextToolInfo$inboundSchema).optional(),
59
+ type: z.literal("event").default("event"),
60
+ version: z.literal("v1alpha").default("v1alpha"),
61
+ on: EventTaskEvents$inboundSchema.optional(),
62
+ });
63
+ /** @internal */
64
+ export type EventTask$Outbound = {
65
+ id?: string | null | undefined;
66
+ config?: { [k: string]: any } | null | undefined;
67
+ variables?: Array<Variable$Outbound> | null | undefined;
68
+ metadata?: ContextTaskMetadata$Outbound | null | undefined;
69
+ tool?: ContextToolInfo$Outbound | null | undefined;
70
+ type: "event";
71
+ version: "v1alpha";
72
+ on?: EventTaskEvents$Outbound | undefined;
73
+ };
74
+
75
+ /** @internal */
76
+ export const EventTask$outboundSchema: z.ZodType<
77
+ EventTask$Outbound,
78
+ z.ZodTypeDef,
79
+ EventTask
80
+ > = z.object({
81
+ id: z.nullable(z.string()).optional(),
82
+ config: z.nullable(z.record(z.any())).optional(),
83
+ variables: z.nullable(z.array(Variable$outboundSchema)).optional(),
84
+ metadata: z.nullable(ContextTaskMetadata$outboundSchema).optional(),
85
+ tool: z.nullable(ContextToolInfo$outboundSchema).optional(),
86
+ type: z.literal("event").default("event" as const),
87
+ version: z.literal("v1alpha").default("v1alpha" as const),
88
+ on: EventTaskEvents$outboundSchema.optional(),
89
+ });
90
+
91
+ export function eventTaskToJSON(eventTask: EventTask): string {
92
+ return JSON.stringify(EventTask$outboundSchema.parse(eventTask));
93
+ }
94
+ export function eventTaskFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<EventTask, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => EventTask$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'EventTask' from JSON`,
101
+ );
102
+ }