syllable-sdk 1.0.13-rc.3 → 1.0.13-rc.5

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 (168) hide show
  1. package/bin/mcp-server.js +2809 -806
  2. package/bin/mcp-server.js.map +34 -9
  3. package/examples/package-lock.json +1 -1
  4. package/jsr.json +1 -1
  5. package/lib/config.d.ts +3 -3
  6. package/lib/config.js +3 -3
  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 +150 -0
  34. package/models/components/context.d.ts.map +1 -0
  35. package/models/components/context.js +265 -0
  36. package/models/components/context.js.map +1 -0
  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 +25 -0
  66. package/models/components/index.d.ts.map +1 -1
  67. package/models/components/index.js +25 -0
  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/setvalueaction.d.ts +154 -0
  94. package/models/components/setvalueaction.d.ts.map +1 -0
  95. package/models/components/setvalueaction.js +246 -0
  96. package/models/components/setvalueaction.js.map +1 -0
  97. package/models/components/step.d.ts +73 -0
  98. package/models/components/step.d.ts.map +1 -0
  99. package/models/components/step.js +103 -0
  100. package/models/components/step.js.map +1 -0
  101. package/models/components/stepeventactions.d.ts +185 -0
  102. package/models/components/stepeventactions.d.ts.map +1 -0
  103. package/models/components/stepeventactions.js +296 -0
  104. package/models/components/stepeventactions.js.map +1 -0
  105. package/models/components/stepstask.d.ts +42 -0
  106. package/models/components/stepstask.d.ts.map +1 -0
  107. package/models/components/stepstask.js +76 -0
  108. package/models/components/stepstask.js.map +1 -0
  109. package/models/components/steptools.d.ts +33 -0
  110. package/models/components/steptools.d.ts.map +1 -0
  111. package/models/components/steptools.js +71 -0
  112. package/models/components/steptools.js.map +1 -0
  113. package/models/components/tooldefinition.d.ts +6 -0
  114. package/models/components/tooldefinition.d.ts.map +1 -1
  115. package/models/components/tooldefinition.js +3 -0
  116. package/models/components/tooldefinition.js.map +1 -1
  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 +2138 -291
  122. package/package.json +1 -1
  123. package/src/lib/config.ts +3 -3
  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 +485 -0
  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 +25 -0
  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/setvalueaction.ts +508 -0
  148. package/src/models/components/step.ts +174 -0
  149. package/src/models/components/stepeventactions.ts +619 -0
  150. package/src/models/components/stepstask.ts +102 -0
  151. package/src/models/components/steptools.ts +76 -0
  152. package/src/models/components/tooldefinition.ts +13 -0
  153. package/src/models/components/variable.ts +332 -0
  154. package/src/types/enums.ts +1 -21
  155. package/src/types/index.ts +2 -1
  156. package/src/types/unrecognized.ts +27 -0
  157. package/types/enums.d.ts +1 -8
  158. package/types/enums.d.ts.map +1 -1
  159. package/types/enums.js +3 -21
  160. package/types/enums.js.map +1 -1
  161. package/types/index.d.ts +2 -1
  162. package/types/index.d.ts.map +1 -1
  163. package/types/index.js +15 -0
  164. package/types/index.js.map +1 -1
  165. package/types/unrecognized.d.ts +10 -0
  166. package/types/unrecognized.d.ts.map +1 -0
  167. package/types/unrecognized.js +26 -0
  168. package/types/unrecognized.js.map +1 -0
@@ -0,0 +1,619 @@
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
+ CallAction,
11
+ CallAction$inboundSchema,
12
+ CallAction$Outbound,
13
+ CallAction$outboundSchema,
14
+ } from "./callaction.js";
15
+ import {
16
+ IncrementAction,
17
+ IncrementAction$inboundSchema,
18
+ IncrementAction$Outbound,
19
+ IncrementAction$outboundSchema,
20
+ } from "./incrementaction.js";
21
+ import {
22
+ SaveAction,
23
+ SaveAction$inboundSchema,
24
+ SaveAction$Outbound,
25
+ SaveAction$outboundSchema,
26
+ } from "./saveaction.js";
27
+ import {
28
+ SayAction,
29
+ SayAction$inboundSchema,
30
+ SayAction$Outbound,
31
+ SayAction$outboundSchema,
32
+ } from "./sayaction.js";
33
+ import {
34
+ SetValueAction,
35
+ SetValueAction$inboundSchema,
36
+ SetValueAction$Outbound,
37
+ SetValueAction$outboundSchema,
38
+ } from "./setvalueaction.js";
39
+
40
+ export type StepEventActionsStart =
41
+ | (CallAction & { action: "call" })
42
+ | (IncrementAction & { action: "inc" })
43
+ | (SayAction & { action: "say" })
44
+ | (SetValueAction & { action: "set" })
45
+ | (SaveAction & { action: "save" });
46
+
47
+ export type Enter =
48
+ | (CallAction & { action: "call" })
49
+ | (IncrementAction & { action: "inc" })
50
+ | (SayAction & { action: "say" })
51
+ | (SetValueAction & { action: "set" })
52
+ | (SaveAction & { action: "save" });
53
+
54
+ export type StepEventActionsSubmit =
55
+ | (CallAction & { action: "call" })
56
+ | (IncrementAction & { action: "inc" })
57
+ | (SayAction & { action: "say" })
58
+ | (SetValueAction & { action: "set" })
59
+ | (SaveAction & { action: "save" });
60
+
61
+ /**
62
+ * Actions to perform when events occur (enter, submit).
63
+ */
64
+ export type StepEventActions = {
65
+ /**
66
+ * Actions to execute on the first input from the user.
67
+ */
68
+ start?:
69
+ | Array<
70
+ | (CallAction & { action: "call" })
71
+ | (IncrementAction & { action: "inc" })
72
+ | (SayAction & { action: "say" })
73
+ | (SetValueAction & { action: "set" })
74
+ | (SaveAction & { action: "save" })
75
+ >
76
+ | null
77
+ | undefined;
78
+ /**
79
+ * Actions to execute when entering a step (before collecting inputs).
80
+ */
81
+ enter?:
82
+ | Array<
83
+ | (CallAction & { action: "call" })
84
+ | (IncrementAction & { action: "inc" })
85
+ | (SayAction & { action: "say" })
86
+ | (SetValueAction & { action: "set" })
87
+ | (SaveAction & { action: "save" })
88
+ >
89
+ | null
90
+ | undefined;
91
+ /**
92
+ * Actions to execute when the tool/step is submitted by the LLM.
93
+ */
94
+ submit?:
95
+ | Array<
96
+ | (CallAction & { action: "call" })
97
+ | (IncrementAction & { action: "inc" })
98
+ | (SayAction & { action: "say" })
99
+ | (SetValueAction & { action: "set" })
100
+ | (SaveAction & { action: "save" })
101
+ >
102
+ | null
103
+ | undefined;
104
+ };
105
+
106
+ /** @internal */
107
+ export const StepEventActionsStart$inboundSchema: z.ZodType<
108
+ StepEventActionsStart,
109
+ z.ZodTypeDef,
110
+ unknown
111
+ > = z.union([
112
+ CallAction$inboundSchema.and(
113
+ z.object({ action: z.literal("call") }).transform((v) => ({
114
+ action: v.action,
115
+ })),
116
+ ),
117
+ IncrementAction$inboundSchema.and(
118
+ z.object({ action: z.literal("inc") }).transform((v) => ({
119
+ action: v.action,
120
+ })),
121
+ ),
122
+ SayAction$inboundSchema.and(
123
+ z.object({ action: z.literal("say") }).transform((v) => ({
124
+ action: v.action,
125
+ })),
126
+ ),
127
+ SetValueAction$inboundSchema.and(
128
+ z.object({ action: z.literal("set") }).transform((v) => ({
129
+ action: v.action,
130
+ })),
131
+ ),
132
+ SaveAction$inboundSchema.and(
133
+ z.object({ action: z.literal("save") }).transform((v) => ({
134
+ action: v.action,
135
+ })),
136
+ ),
137
+ ]);
138
+ /** @internal */
139
+ export type StepEventActionsStart$Outbound =
140
+ | (CallAction$Outbound & { action: "call" })
141
+ | (IncrementAction$Outbound & { action: "inc" })
142
+ | (SayAction$Outbound & { action: "say" })
143
+ | (SetValueAction$Outbound & { action: "set" })
144
+ | (SaveAction$Outbound & { action: "save" });
145
+
146
+ /** @internal */
147
+ export const StepEventActionsStart$outboundSchema: z.ZodType<
148
+ StepEventActionsStart$Outbound,
149
+ z.ZodTypeDef,
150
+ StepEventActionsStart
151
+ > = z.union([
152
+ CallAction$outboundSchema.and(
153
+ z.object({ action: z.literal("call") }).transform((v) => ({
154
+ action: v.action,
155
+ })),
156
+ ),
157
+ IncrementAction$outboundSchema.and(
158
+ z.object({ action: z.literal("inc") }).transform((v) => ({
159
+ action: v.action,
160
+ })),
161
+ ),
162
+ SayAction$outboundSchema.and(
163
+ z.object({ action: z.literal("say") }).transform((v) => ({
164
+ action: v.action,
165
+ })),
166
+ ),
167
+ SetValueAction$outboundSchema.and(
168
+ z.object({ action: z.literal("set") }).transform((v) => ({
169
+ action: v.action,
170
+ })),
171
+ ),
172
+ SaveAction$outboundSchema.and(
173
+ z.object({ action: z.literal("save") }).transform((v) => ({
174
+ action: v.action,
175
+ })),
176
+ ),
177
+ ]);
178
+
179
+ export function stepEventActionsStartToJSON(
180
+ stepEventActionsStart: StepEventActionsStart,
181
+ ): string {
182
+ return JSON.stringify(
183
+ StepEventActionsStart$outboundSchema.parse(stepEventActionsStart),
184
+ );
185
+ }
186
+ export function stepEventActionsStartFromJSON(
187
+ jsonString: string,
188
+ ): SafeParseResult<StepEventActionsStart, SDKValidationError> {
189
+ return safeParse(
190
+ jsonString,
191
+ (x) => StepEventActionsStart$inboundSchema.parse(JSON.parse(x)),
192
+ `Failed to parse 'StepEventActionsStart' from JSON`,
193
+ );
194
+ }
195
+
196
+ /** @internal */
197
+ export const Enter$inboundSchema: z.ZodType<Enter, z.ZodTypeDef, unknown> = z
198
+ .union([
199
+ CallAction$inboundSchema.and(
200
+ z.object({ action: z.literal("call") }).transform((v) => ({
201
+ action: v.action,
202
+ })),
203
+ ),
204
+ IncrementAction$inboundSchema.and(
205
+ z.object({ action: z.literal("inc") }).transform((v) => ({
206
+ action: v.action,
207
+ })),
208
+ ),
209
+ SayAction$inboundSchema.and(
210
+ z.object({ action: z.literal("say") }).transform((v) => ({
211
+ action: v.action,
212
+ })),
213
+ ),
214
+ SetValueAction$inboundSchema.and(
215
+ z.object({ action: z.literal("set") }).transform((v) => ({
216
+ action: v.action,
217
+ })),
218
+ ),
219
+ SaveAction$inboundSchema.and(
220
+ z.object({ action: z.literal("save") }).transform((v) => ({
221
+ action: v.action,
222
+ })),
223
+ ),
224
+ ]);
225
+ /** @internal */
226
+ export type Enter$Outbound =
227
+ | (CallAction$Outbound & { action: "call" })
228
+ | (IncrementAction$Outbound & { action: "inc" })
229
+ | (SayAction$Outbound & { action: "say" })
230
+ | (SetValueAction$Outbound & { action: "set" })
231
+ | (SaveAction$Outbound & { action: "save" });
232
+
233
+ /** @internal */
234
+ export const Enter$outboundSchema: z.ZodType<
235
+ Enter$Outbound,
236
+ z.ZodTypeDef,
237
+ Enter
238
+ > = z.union([
239
+ CallAction$outboundSchema.and(
240
+ z.object({ action: z.literal("call") }).transform((v) => ({
241
+ action: v.action,
242
+ })),
243
+ ),
244
+ IncrementAction$outboundSchema.and(
245
+ z.object({ action: z.literal("inc") }).transform((v) => ({
246
+ action: v.action,
247
+ })),
248
+ ),
249
+ SayAction$outboundSchema.and(
250
+ z.object({ action: z.literal("say") }).transform((v) => ({
251
+ action: v.action,
252
+ })),
253
+ ),
254
+ SetValueAction$outboundSchema.and(
255
+ z.object({ action: z.literal("set") }).transform((v) => ({
256
+ action: v.action,
257
+ })),
258
+ ),
259
+ SaveAction$outboundSchema.and(
260
+ z.object({ action: z.literal("save") }).transform((v) => ({
261
+ action: v.action,
262
+ })),
263
+ ),
264
+ ]);
265
+
266
+ export function enterToJSON(enter: Enter): string {
267
+ return JSON.stringify(Enter$outboundSchema.parse(enter));
268
+ }
269
+ export function enterFromJSON(
270
+ jsonString: string,
271
+ ): SafeParseResult<Enter, SDKValidationError> {
272
+ return safeParse(
273
+ jsonString,
274
+ (x) => Enter$inboundSchema.parse(JSON.parse(x)),
275
+ `Failed to parse 'Enter' from JSON`,
276
+ );
277
+ }
278
+
279
+ /** @internal */
280
+ export const StepEventActionsSubmit$inboundSchema: z.ZodType<
281
+ StepEventActionsSubmit,
282
+ z.ZodTypeDef,
283
+ unknown
284
+ > = z.union([
285
+ CallAction$inboundSchema.and(
286
+ z.object({ action: z.literal("call") }).transform((v) => ({
287
+ action: v.action,
288
+ })),
289
+ ),
290
+ IncrementAction$inboundSchema.and(
291
+ z.object({ action: z.literal("inc") }).transform((v) => ({
292
+ action: v.action,
293
+ })),
294
+ ),
295
+ SayAction$inboundSchema.and(
296
+ z.object({ action: z.literal("say") }).transform((v) => ({
297
+ action: v.action,
298
+ })),
299
+ ),
300
+ SetValueAction$inboundSchema.and(
301
+ z.object({ action: z.literal("set") }).transform((v) => ({
302
+ action: v.action,
303
+ })),
304
+ ),
305
+ SaveAction$inboundSchema.and(
306
+ z.object({ action: z.literal("save") }).transform((v) => ({
307
+ action: v.action,
308
+ })),
309
+ ),
310
+ ]);
311
+ /** @internal */
312
+ export type StepEventActionsSubmit$Outbound =
313
+ | (CallAction$Outbound & { action: "call" })
314
+ | (IncrementAction$Outbound & { action: "inc" })
315
+ | (SayAction$Outbound & { action: "say" })
316
+ | (SetValueAction$Outbound & { action: "set" })
317
+ | (SaveAction$Outbound & { action: "save" });
318
+
319
+ /** @internal */
320
+ export const StepEventActionsSubmit$outboundSchema: z.ZodType<
321
+ StepEventActionsSubmit$Outbound,
322
+ z.ZodTypeDef,
323
+ StepEventActionsSubmit
324
+ > = z.union([
325
+ CallAction$outboundSchema.and(
326
+ z.object({ action: z.literal("call") }).transform((v) => ({
327
+ action: v.action,
328
+ })),
329
+ ),
330
+ IncrementAction$outboundSchema.and(
331
+ z.object({ action: z.literal("inc") }).transform((v) => ({
332
+ action: v.action,
333
+ })),
334
+ ),
335
+ SayAction$outboundSchema.and(
336
+ z.object({ action: z.literal("say") }).transform((v) => ({
337
+ action: v.action,
338
+ })),
339
+ ),
340
+ SetValueAction$outboundSchema.and(
341
+ z.object({ action: z.literal("set") }).transform((v) => ({
342
+ action: v.action,
343
+ })),
344
+ ),
345
+ SaveAction$outboundSchema.and(
346
+ z.object({ action: z.literal("save") }).transform((v) => ({
347
+ action: v.action,
348
+ })),
349
+ ),
350
+ ]);
351
+
352
+ export function stepEventActionsSubmitToJSON(
353
+ stepEventActionsSubmit: StepEventActionsSubmit,
354
+ ): string {
355
+ return JSON.stringify(
356
+ StepEventActionsSubmit$outboundSchema.parse(stepEventActionsSubmit),
357
+ );
358
+ }
359
+ export function stepEventActionsSubmitFromJSON(
360
+ jsonString: string,
361
+ ): SafeParseResult<StepEventActionsSubmit, SDKValidationError> {
362
+ return safeParse(
363
+ jsonString,
364
+ (x) => StepEventActionsSubmit$inboundSchema.parse(JSON.parse(x)),
365
+ `Failed to parse 'StepEventActionsSubmit' from JSON`,
366
+ );
367
+ }
368
+
369
+ /** @internal */
370
+ export const StepEventActions$inboundSchema: z.ZodType<
371
+ StepEventActions,
372
+ z.ZodTypeDef,
373
+ unknown
374
+ > = z.object({
375
+ start: z.nullable(
376
+ z.array(
377
+ z.union([
378
+ CallAction$inboundSchema.and(
379
+ z.object({ action: z.literal("call") }).transform((v) => ({
380
+ action: v.action,
381
+ })),
382
+ ),
383
+ IncrementAction$inboundSchema.and(
384
+ z.object({ action: z.literal("inc") }).transform((v) => ({
385
+ action: v.action,
386
+ })),
387
+ ),
388
+ SayAction$inboundSchema.and(
389
+ z.object({ action: z.literal("say") }).transform((v) => ({
390
+ action: v.action,
391
+ })),
392
+ ),
393
+ SetValueAction$inboundSchema.and(
394
+ z.object({ action: z.literal("set") }).transform((v) => ({
395
+ action: v.action,
396
+ })),
397
+ ),
398
+ SaveAction$inboundSchema.and(
399
+ z.object({ action: z.literal("save") }).transform((v) => ({
400
+ action: v.action,
401
+ })),
402
+ ),
403
+ ]),
404
+ ),
405
+ ).optional(),
406
+ enter: z.nullable(
407
+ z.array(
408
+ z.union([
409
+ CallAction$inboundSchema.and(
410
+ z.object({ action: z.literal("call") }).transform((v) => ({
411
+ action: v.action,
412
+ })),
413
+ ),
414
+ IncrementAction$inboundSchema.and(
415
+ z.object({ action: z.literal("inc") }).transform((v) => ({
416
+ action: v.action,
417
+ })),
418
+ ),
419
+ SayAction$inboundSchema.and(
420
+ z.object({ action: z.literal("say") }).transform((v) => ({
421
+ action: v.action,
422
+ })),
423
+ ),
424
+ SetValueAction$inboundSchema.and(
425
+ z.object({ action: z.literal("set") }).transform((v) => ({
426
+ action: v.action,
427
+ })),
428
+ ),
429
+ SaveAction$inboundSchema.and(
430
+ z.object({ action: z.literal("save") }).transform((v) => ({
431
+ action: v.action,
432
+ })),
433
+ ),
434
+ ]),
435
+ ),
436
+ ).optional(),
437
+ submit: z.nullable(
438
+ z.array(
439
+ z.union([
440
+ CallAction$inboundSchema.and(
441
+ z.object({ action: z.literal("call") }).transform((v) => ({
442
+ action: v.action,
443
+ })),
444
+ ),
445
+ IncrementAction$inboundSchema.and(
446
+ z.object({ action: z.literal("inc") }).transform((v) => ({
447
+ action: v.action,
448
+ })),
449
+ ),
450
+ SayAction$inboundSchema.and(
451
+ z.object({ action: z.literal("say") }).transform((v) => ({
452
+ action: v.action,
453
+ })),
454
+ ),
455
+ SetValueAction$inboundSchema.and(
456
+ z.object({ action: z.literal("set") }).transform((v) => ({
457
+ action: v.action,
458
+ })),
459
+ ),
460
+ SaveAction$inboundSchema.and(
461
+ z.object({ action: z.literal("save") }).transform((v) => ({
462
+ action: v.action,
463
+ })),
464
+ ),
465
+ ]),
466
+ ),
467
+ ).optional(),
468
+ });
469
+ /** @internal */
470
+ export type StepEventActions$Outbound = {
471
+ start?:
472
+ | Array<
473
+ | (CallAction$Outbound & { action: "call" })
474
+ | (IncrementAction$Outbound & { action: "inc" })
475
+ | (SayAction$Outbound & { action: "say" })
476
+ | (SetValueAction$Outbound & { action: "set" })
477
+ | (SaveAction$Outbound & { action: "save" })
478
+ >
479
+ | null
480
+ | undefined;
481
+ enter?:
482
+ | Array<
483
+ | (CallAction$Outbound & { action: "call" })
484
+ | (IncrementAction$Outbound & { action: "inc" })
485
+ | (SayAction$Outbound & { action: "say" })
486
+ | (SetValueAction$Outbound & { action: "set" })
487
+ | (SaveAction$Outbound & { action: "save" })
488
+ >
489
+ | null
490
+ | undefined;
491
+ submit?:
492
+ | Array<
493
+ | (CallAction$Outbound & { action: "call" })
494
+ | (IncrementAction$Outbound & { action: "inc" })
495
+ | (SayAction$Outbound & { action: "say" })
496
+ | (SetValueAction$Outbound & { action: "set" })
497
+ | (SaveAction$Outbound & { action: "save" })
498
+ >
499
+ | null
500
+ | undefined;
501
+ };
502
+
503
+ /** @internal */
504
+ export const StepEventActions$outboundSchema: z.ZodType<
505
+ StepEventActions$Outbound,
506
+ z.ZodTypeDef,
507
+ StepEventActions
508
+ > = z.object({
509
+ start: z.nullable(
510
+ z.array(
511
+ z.union([
512
+ CallAction$outboundSchema.and(
513
+ z.object({ action: z.literal("call") }).transform((v) => ({
514
+ action: v.action,
515
+ })),
516
+ ),
517
+ IncrementAction$outboundSchema.and(
518
+ z.object({ action: z.literal("inc") }).transform((v) => ({
519
+ action: v.action,
520
+ })),
521
+ ),
522
+ SayAction$outboundSchema.and(
523
+ z.object({ action: z.literal("say") }).transform((v) => ({
524
+ action: v.action,
525
+ })),
526
+ ),
527
+ SetValueAction$outboundSchema.and(
528
+ z.object({ action: z.literal("set") }).transform((v) => ({
529
+ action: v.action,
530
+ })),
531
+ ),
532
+ SaveAction$outboundSchema.and(
533
+ z.object({ action: z.literal("save") }).transform((v) => ({
534
+ action: v.action,
535
+ })),
536
+ ),
537
+ ]),
538
+ ),
539
+ ).optional(),
540
+ enter: z.nullable(
541
+ z.array(
542
+ z.union([
543
+ CallAction$outboundSchema.and(
544
+ z.object({ action: z.literal("call") }).transform((v) => ({
545
+ action: v.action,
546
+ })),
547
+ ),
548
+ IncrementAction$outboundSchema.and(
549
+ z.object({ action: z.literal("inc") }).transform((v) => ({
550
+ action: v.action,
551
+ })),
552
+ ),
553
+ SayAction$outboundSchema.and(
554
+ z.object({ action: z.literal("say") }).transform((v) => ({
555
+ action: v.action,
556
+ })),
557
+ ),
558
+ SetValueAction$outboundSchema.and(
559
+ z.object({ action: z.literal("set") }).transform((v) => ({
560
+ action: v.action,
561
+ })),
562
+ ),
563
+ SaveAction$outboundSchema.and(
564
+ z.object({ action: z.literal("save") }).transform((v) => ({
565
+ action: v.action,
566
+ })),
567
+ ),
568
+ ]),
569
+ ),
570
+ ).optional(),
571
+ submit: z.nullable(
572
+ z.array(
573
+ z.union([
574
+ CallAction$outboundSchema.and(
575
+ z.object({ action: z.literal("call") }).transform((v) => ({
576
+ action: v.action,
577
+ })),
578
+ ),
579
+ IncrementAction$outboundSchema.and(
580
+ z.object({ action: z.literal("inc") }).transform((v) => ({
581
+ action: v.action,
582
+ })),
583
+ ),
584
+ SayAction$outboundSchema.and(
585
+ z.object({ action: z.literal("say") }).transform((v) => ({
586
+ action: v.action,
587
+ })),
588
+ ),
589
+ SetValueAction$outboundSchema.and(
590
+ z.object({ action: z.literal("set") }).transform((v) => ({
591
+ action: v.action,
592
+ })),
593
+ ),
594
+ SaveAction$outboundSchema.and(
595
+ z.object({ action: z.literal("save") }).transform((v) => ({
596
+ action: v.action,
597
+ })),
598
+ ),
599
+ ]),
600
+ ),
601
+ ).optional(),
602
+ });
603
+
604
+ export function stepEventActionsToJSON(
605
+ stepEventActions: StepEventActions,
606
+ ): string {
607
+ return JSON.stringify(
608
+ StepEventActions$outboundSchema.parse(stepEventActions),
609
+ );
610
+ }
611
+ export function stepEventActionsFromJSON(
612
+ jsonString: string,
613
+ ): SafeParseResult<StepEventActions, SDKValidationError> {
614
+ return safeParse(
615
+ jsonString,
616
+ (x) => StepEventActions$inboundSchema.parse(JSON.parse(x)),
617
+ `Failed to parse 'StepEventActions' from JSON`,
618
+ );
619
+ }
@@ -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
+ Step,
23
+ Step$inboundSchema,
24
+ Step$Outbound,
25
+ Step$outboundSchema,
26
+ } from "./step.js";
27
+ import {
28
+ Variable,
29
+ Variable$inboundSchema,
30
+ Variable$Outbound,
31
+ Variable$outboundSchema,
32
+ } from "./variable.js";
33
+
34
+ export type StepsTask = {
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?: "steps" | undefined;
44
+ version?: "v1alpha" | undefined;
45
+ steps?: Array<Step> | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const StepsTask$inboundSchema: z.ZodType<
50
+ StepsTask,
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("steps").default("steps"),
60
+ version: z.literal("v1alpha").default("v1alpha"),
61
+ steps: z.array(Step$inboundSchema).optional(),
62
+ });
63
+ /** @internal */
64
+ export type StepsTask$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: "steps";
71
+ version: "v1alpha";
72
+ steps?: Array<Step$Outbound> | undefined;
73
+ };
74
+
75
+ /** @internal */
76
+ export const StepsTask$outboundSchema: z.ZodType<
77
+ StepsTask$Outbound,
78
+ z.ZodTypeDef,
79
+ StepsTask
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("steps").default("steps" as const),
87
+ version: z.literal("v1alpha").default("v1alpha" as const),
88
+ steps: z.array(Step$outboundSchema).optional(),
89
+ });
90
+
91
+ export function stepsTaskToJSON(stepsTask: StepsTask): string {
92
+ return JSON.stringify(StepsTask$outboundSchema.parse(stepsTask));
93
+ }
94
+ export function stepsTaskFromJSON(
95
+ jsonString: string,
96
+ ): SafeParseResult<StepsTask, SDKValidationError> {
97
+ return safeParse(
98
+ jsonString,
99
+ (x) => StepsTask$inboundSchema.parse(JSON.parse(x)),
100
+ `Failed to parse 'StepsTask' from JSON`,
101
+ );
102
+ }