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
@@ -0,0 +1,281 @@
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
+ CaseExpression,
11
+ CaseExpression$inboundSchema,
12
+ CaseExpression$Outbound,
13
+ CaseExpression$outboundSchema,
14
+ } from "./caseexpression.js";
15
+ import {
16
+ CelExpression,
17
+ CelExpression$inboundSchema,
18
+ CelExpression$Outbound,
19
+ CelExpression$outboundSchema,
20
+ } from "./celexpression.js";
21
+ import {
22
+ JMESPathExpression,
23
+ JMESPathExpression$inboundSchema,
24
+ JMESPathExpression$Outbound,
25
+ JMESPathExpression$outboundSchema,
26
+ } from "./jmespathexpression.js";
27
+
28
+ export type SaveActionIf1 =
29
+ | (CelExpression & { type: "cel" })
30
+ | (JMESPathExpression & { type: "jmespath" })
31
+ | (JMESPathExpression & { type: "jp" });
32
+
33
+ /**
34
+ * An expression that must evaluate to true for the action to be applied.
35
+ */
36
+ export type SaveActionIf =
37
+ | CaseExpression
38
+ | (CelExpression & { type: "cel" })
39
+ | (JMESPathExpression & { type: "jmespath" })
40
+ | (JMESPathExpression & { type: "jp" })
41
+ | string;
42
+
43
+ export type SaveAction = {
44
+ /**
45
+ * An expression that must evaluate to true for the action to be applied.
46
+ */
47
+ if?:
48
+ | CaseExpression
49
+ | (CelExpression & { type: "cel" })
50
+ | (JMESPathExpression & { type: "jmespath" })
51
+ | (JMESPathExpression & { type: "jp" })
52
+ | string
53
+ | null
54
+ | undefined;
55
+ action?: "save" | undefined;
56
+ /**
57
+ * Target name to save (defaults to global variable).
58
+ */
59
+ name?: string | null | undefined;
60
+ /**
61
+ * Input field names to persist; None saves all collected inputs.
62
+ */
63
+ inputs?: Array<string> | null | undefined;
64
+ };
65
+
66
+ /** @internal */
67
+ export const SaveActionIf1$inboundSchema: z.ZodType<
68
+ SaveActionIf1,
69
+ z.ZodTypeDef,
70
+ unknown
71
+ > = z.union([
72
+ CelExpression$inboundSchema.and(
73
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
74
+ ),
75
+ JMESPathExpression$inboundSchema.and(
76
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
77
+ type: v.type,
78
+ })),
79
+ ),
80
+ JMESPathExpression$inboundSchema.and(
81
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
82
+ ),
83
+ ]);
84
+ /** @internal */
85
+ export type SaveActionIf1$Outbound =
86
+ | (CelExpression$Outbound & { type: "cel" })
87
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
88
+ | (JMESPathExpression$Outbound & { type: "jp" });
89
+
90
+ /** @internal */
91
+ export const SaveActionIf1$outboundSchema: z.ZodType<
92
+ SaveActionIf1$Outbound,
93
+ z.ZodTypeDef,
94
+ SaveActionIf1
95
+ > = z.union([
96
+ CelExpression$outboundSchema.and(
97
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
98
+ ),
99
+ JMESPathExpression$outboundSchema.and(
100
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
101
+ type: v.type,
102
+ })),
103
+ ),
104
+ JMESPathExpression$outboundSchema.and(
105
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
106
+ ),
107
+ ]);
108
+
109
+ export function saveActionIf1ToJSON(saveActionIf1: SaveActionIf1): string {
110
+ return JSON.stringify(SaveActionIf1$outboundSchema.parse(saveActionIf1));
111
+ }
112
+ export function saveActionIf1FromJSON(
113
+ jsonString: string,
114
+ ): SafeParseResult<SaveActionIf1, SDKValidationError> {
115
+ return safeParse(
116
+ jsonString,
117
+ (x) => SaveActionIf1$inboundSchema.parse(JSON.parse(x)),
118
+ `Failed to parse 'SaveActionIf1' from JSON`,
119
+ );
120
+ }
121
+
122
+ /** @internal */
123
+ export const SaveActionIf$inboundSchema: z.ZodType<
124
+ SaveActionIf,
125
+ z.ZodTypeDef,
126
+ unknown
127
+ > = z.union([
128
+ CaseExpression$inboundSchema,
129
+ z.union([
130
+ CelExpression$inboundSchema.and(
131
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
132
+ ),
133
+ JMESPathExpression$inboundSchema.and(
134
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
135
+ type: v.type,
136
+ })),
137
+ ),
138
+ JMESPathExpression$inboundSchema.and(
139
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
140
+ ),
141
+ ]),
142
+ z.string(),
143
+ ]);
144
+ /** @internal */
145
+ export type SaveActionIf$Outbound =
146
+ | CaseExpression$Outbound
147
+ | (CelExpression$Outbound & { type: "cel" })
148
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
149
+ | (JMESPathExpression$Outbound & { type: "jp" })
150
+ | string;
151
+
152
+ /** @internal */
153
+ export const SaveActionIf$outboundSchema: z.ZodType<
154
+ SaveActionIf$Outbound,
155
+ z.ZodTypeDef,
156
+ SaveActionIf
157
+ > = z.union([
158
+ CaseExpression$outboundSchema,
159
+ z.union([
160
+ CelExpression$outboundSchema.and(
161
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
162
+ ),
163
+ JMESPathExpression$outboundSchema.and(
164
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
165
+ type: v.type,
166
+ })),
167
+ ),
168
+ JMESPathExpression$outboundSchema.and(
169
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
170
+ ),
171
+ ]),
172
+ z.string(),
173
+ ]);
174
+
175
+ export function saveActionIfToJSON(saveActionIf: SaveActionIf): string {
176
+ return JSON.stringify(SaveActionIf$outboundSchema.parse(saveActionIf));
177
+ }
178
+ export function saveActionIfFromJSON(
179
+ jsonString: string,
180
+ ): SafeParseResult<SaveActionIf, SDKValidationError> {
181
+ return safeParse(
182
+ jsonString,
183
+ (x) => SaveActionIf$inboundSchema.parse(JSON.parse(x)),
184
+ `Failed to parse 'SaveActionIf' from JSON`,
185
+ );
186
+ }
187
+
188
+ /** @internal */
189
+ export const SaveAction$inboundSchema: z.ZodType<
190
+ SaveAction,
191
+ z.ZodTypeDef,
192
+ unknown
193
+ > = z.object({
194
+ if: z.nullable(
195
+ z.union([
196
+ CaseExpression$inboundSchema,
197
+ z.union([
198
+ CelExpression$inboundSchema.and(
199
+ z.object({ type: z.literal("cel") }).transform((v) => ({
200
+ type: v.type,
201
+ })),
202
+ ),
203
+ JMESPathExpression$inboundSchema.and(
204
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
205
+ type: v.type,
206
+ })),
207
+ ),
208
+ JMESPathExpression$inboundSchema.and(
209
+ z.object({ type: z.literal("jp") }).transform((v) => ({
210
+ type: v.type,
211
+ })),
212
+ ),
213
+ ]),
214
+ z.string(),
215
+ ]),
216
+ ).optional(),
217
+ action: z.literal("save").default("save"),
218
+ name: z.nullable(z.string()).optional(),
219
+ inputs: z.nullable(z.array(z.string())).optional(),
220
+ });
221
+ /** @internal */
222
+ export type SaveAction$Outbound = {
223
+ if?:
224
+ | CaseExpression$Outbound
225
+ | (CelExpression$Outbound & { type: "cel" })
226
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
227
+ | (JMESPathExpression$Outbound & { type: "jp" })
228
+ | string
229
+ | null
230
+ | undefined;
231
+ action: "save";
232
+ name?: string | null | undefined;
233
+ inputs?: Array<string> | null | undefined;
234
+ };
235
+
236
+ /** @internal */
237
+ export const SaveAction$outboundSchema: z.ZodType<
238
+ SaveAction$Outbound,
239
+ z.ZodTypeDef,
240
+ SaveAction
241
+ > = z.object({
242
+ if: z.nullable(
243
+ z.union([
244
+ CaseExpression$outboundSchema,
245
+ z.union([
246
+ CelExpression$outboundSchema.and(
247
+ z.object({ type: z.literal("cel") }).transform((v) => ({
248
+ type: v.type,
249
+ })),
250
+ ),
251
+ JMESPathExpression$outboundSchema.and(
252
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
253
+ type: v.type,
254
+ })),
255
+ ),
256
+ JMESPathExpression$outboundSchema.and(
257
+ z.object({ type: z.literal("jp") }).transform((v) => ({
258
+ type: v.type,
259
+ })),
260
+ ),
261
+ ]),
262
+ z.string(),
263
+ ]),
264
+ ).optional(),
265
+ action: z.literal("save").default("save" as const),
266
+ name: z.nullable(z.string()).optional(),
267
+ inputs: z.nullable(z.array(z.string())).optional(),
268
+ });
269
+
270
+ export function saveActionToJSON(saveAction: SaveAction): string {
271
+ return JSON.stringify(SaveAction$outboundSchema.parse(saveAction));
272
+ }
273
+ export function saveActionFromJSON(
274
+ jsonString: string,
275
+ ): SafeParseResult<SaveAction, SDKValidationError> {
276
+ return safeParse(
277
+ jsonString,
278
+ (x) => SaveAction$inboundSchema.parse(JSON.parse(x)),
279
+ `Failed to parse 'SaveAction' from JSON`,
280
+ );
281
+ }
@@ -0,0 +1,302 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CaseExpression,
12
+ CaseExpression$inboundSchema,
13
+ CaseExpression$Outbound,
14
+ CaseExpression$outboundSchema,
15
+ } from "./caseexpression.js";
16
+ import {
17
+ CelExpression,
18
+ CelExpression$inboundSchema,
19
+ CelExpression$Outbound,
20
+ CelExpression$outboundSchema,
21
+ } from "./celexpression.js";
22
+ import {
23
+ JMESPathExpression,
24
+ JMESPathExpression$inboundSchema,
25
+ JMESPathExpression$Outbound,
26
+ JMESPathExpression$outboundSchema,
27
+ } from "./jmespathexpression.js";
28
+
29
+ export type SayActionIf1 =
30
+ | (CelExpression & { type: "cel" })
31
+ | (JMESPathExpression & { type: "jmespath" })
32
+ | (JMESPathExpression & { type: "jp" });
33
+
34
+ /**
35
+ * An expression that must evaluate to true for the action to be applied.
36
+ */
37
+ export type SayActionIf =
38
+ | CaseExpression
39
+ | (CelExpression & { type: "cel" })
40
+ | (JMESPathExpression & { type: "jmespath" })
41
+ | (JMESPathExpression & { type: "jp" })
42
+ | string;
43
+
44
+ /**
45
+ * The role of the message.
46
+ */
47
+ export const Role = {
48
+ User: "user",
49
+ Assistant: "assistant",
50
+ } as const;
51
+ /**
52
+ * The role of the message.
53
+ */
54
+ export type Role = ClosedEnum<typeof Role>;
55
+
56
+ export type SayAction = {
57
+ /**
58
+ * An expression that must evaluate to true for the action to be applied.
59
+ */
60
+ if?:
61
+ | CaseExpression
62
+ | (CelExpression & { type: "cel" })
63
+ | (JMESPathExpression & { type: "jmespath" })
64
+ | (JMESPathExpression & { type: "jp" })
65
+ | string
66
+ | null
67
+ | undefined;
68
+ /**
69
+ * Text to apply if the condition is true.
70
+ */
71
+ text: string;
72
+ action?: "say" | undefined;
73
+ /**
74
+ * The role of the message.
75
+ */
76
+ role?: Role | undefined;
77
+ };
78
+
79
+ /** @internal */
80
+ export const SayActionIf1$inboundSchema: z.ZodType<
81
+ SayActionIf1,
82
+ z.ZodTypeDef,
83
+ unknown
84
+ > = z.union([
85
+ CelExpression$inboundSchema.and(
86
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
87
+ ),
88
+ JMESPathExpression$inboundSchema.and(
89
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
90
+ type: v.type,
91
+ })),
92
+ ),
93
+ JMESPathExpression$inboundSchema.and(
94
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
95
+ ),
96
+ ]);
97
+ /** @internal */
98
+ export type SayActionIf1$Outbound =
99
+ | (CelExpression$Outbound & { type: "cel" })
100
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
101
+ | (JMESPathExpression$Outbound & { type: "jp" });
102
+
103
+ /** @internal */
104
+ export const SayActionIf1$outboundSchema: z.ZodType<
105
+ SayActionIf1$Outbound,
106
+ z.ZodTypeDef,
107
+ SayActionIf1
108
+ > = z.union([
109
+ CelExpression$outboundSchema.and(
110
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
111
+ ),
112
+ JMESPathExpression$outboundSchema.and(
113
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
114
+ type: v.type,
115
+ })),
116
+ ),
117
+ JMESPathExpression$outboundSchema.and(
118
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
119
+ ),
120
+ ]);
121
+
122
+ export function sayActionIf1ToJSON(sayActionIf1: SayActionIf1): string {
123
+ return JSON.stringify(SayActionIf1$outboundSchema.parse(sayActionIf1));
124
+ }
125
+ export function sayActionIf1FromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<SayActionIf1, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => SayActionIf1$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'SayActionIf1' from JSON`,
132
+ );
133
+ }
134
+
135
+ /** @internal */
136
+ export const SayActionIf$inboundSchema: z.ZodType<
137
+ SayActionIf,
138
+ z.ZodTypeDef,
139
+ unknown
140
+ > = z.union([
141
+ CaseExpression$inboundSchema,
142
+ z.union([
143
+ CelExpression$inboundSchema.and(
144
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
145
+ ),
146
+ JMESPathExpression$inboundSchema.and(
147
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
148
+ type: v.type,
149
+ })),
150
+ ),
151
+ JMESPathExpression$inboundSchema.and(
152
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
153
+ ),
154
+ ]),
155
+ z.string(),
156
+ ]);
157
+ /** @internal */
158
+ export type SayActionIf$Outbound =
159
+ | CaseExpression$Outbound
160
+ | (CelExpression$Outbound & { type: "cel" })
161
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
162
+ | (JMESPathExpression$Outbound & { type: "jp" })
163
+ | string;
164
+
165
+ /** @internal */
166
+ export const SayActionIf$outboundSchema: z.ZodType<
167
+ SayActionIf$Outbound,
168
+ z.ZodTypeDef,
169
+ SayActionIf
170
+ > = z.union([
171
+ CaseExpression$outboundSchema,
172
+ z.union([
173
+ CelExpression$outboundSchema.and(
174
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
175
+ ),
176
+ JMESPathExpression$outboundSchema.and(
177
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
178
+ type: v.type,
179
+ })),
180
+ ),
181
+ JMESPathExpression$outboundSchema.and(
182
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
183
+ ),
184
+ ]),
185
+ z.string(),
186
+ ]);
187
+
188
+ export function sayActionIfToJSON(sayActionIf: SayActionIf): string {
189
+ return JSON.stringify(SayActionIf$outboundSchema.parse(sayActionIf));
190
+ }
191
+ export function sayActionIfFromJSON(
192
+ jsonString: string,
193
+ ): SafeParseResult<SayActionIf, SDKValidationError> {
194
+ return safeParse(
195
+ jsonString,
196
+ (x) => SayActionIf$inboundSchema.parse(JSON.parse(x)),
197
+ `Failed to parse 'SayActionIf' from JSON`,
198
+ );
199
+ }
200
+
201
+ /** @internal */
202
+ export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
203
+ Role,
204
+ );
205
+ /** @internal */
206
+ export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
207
+ Role$inboundSchema;
208
+
209
+ /** @internal */
210
+ export const SayAction$inboundSchema: z.ZodType<
211
+ SayAction,
212
+ z.ZodTypeDef,
213
+ unknown
214
+ > = z.object({
215
+ if: z.nullable(
216
+ z.union([
217
+ CaseExpression$inboundSchema,
218
+ z.union([
219
+ CelExpression$inboundSchema.and(
220
+ z.object({ type: z.literal("cel") }).transform((v) => ({
221
+ type: v.type,
222
+ })),
223
+ ),
224
+ JMESPathExpression$inboundSchema.and(
225
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
226
+ type: v.type,
227
+ })),
228
+ ),
229
+ JMESPathExpression$inboundSchema.and(
230
+ z.object({ type: z.literal("jp") }).transform((v) => ({
231
+ type: v.type,
232
+ })),
233
+ ),
234
+ ]),
235
+ z.string(),
236
+ ]),
237
+ ).optional(),
238
+ text: z.string(),
239
+ action: z.literal("say").default("say"),
240
+ role: Role$inboundSchema.default("assistant"),
241
+ });
242
+ /** @internal */
243
+ export type SayAction$Outbound = {
244
+ if?:
245
+ | CaseExpression$Outbound
246
+ | (CelExpression$Outbound & { type: "cel" })
247
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
248
+ | (JMESPathExpression$Outbound & { type: "jp" })
249
+ | string
250
+ | null
251
+ | undefined;
252
+ text: string;
253
+ action: "say";
254
+ role: string;
255
+ };
256
+
257
+ /** @internal */
258
+ export const SayAction$outboundSchema: z.ZodType<
259
+ SayAction$Outbound,
260
+ z.ZodTypeDef,
261
+ SayAction
262
+ > = z.object({
263
+ if: z.nullable(
264
+ z.union([
265
+ CaseExpression$outboundSchema,
266
+ z.union([
267
+ CelExpression$outboundSchema.and(
268
+ z.object({ type: z.literal("cel") }).transform((v) => ({
269
+ type: v.type,
270
+ })),
271
+ ),
272
+ JMESPathExpression$outboundSchema.and(
273
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
274
+ type: v.type,
275
+ })),
276
+ ),
277
+ JMESPathExpression$outboundSchema.and(
278
+ z.object({ type: z.literal("jp") }).transform((v) => ({
279
+ type: v.type,
280
+ })),
281
+ ),
282
+ ]),
283
+ z.string(),
284
+ ]),
285
+ ).optional(),
286
+ text: z.string(),
287
+ action: z.literal("say").default("say" as const),
288
+ role: Role$outboundSchema.default("assistant"),
289
+ });
290
+
291
+ export function sayActionToJSON(sayAction: SayAction): string {
292
+ return JSON.stringify(SayAction$outboundSchema.parse(sayAction));
293
+ }
294
+ export function sayActionFromJSON(
295
+ jsonString: string,
296
+ ): SafeParseResult<SayAction, SDKValidationError> {
297
+ return safeParse(
298
+ jsonString,
299
+ (x) => SayAction$inboundSchema.parse(JSON.parse(x)),
300
+ `Failed to parse 'SayAction' from JSON`,
301
+ );
302
+ }
@@ -92,6 +92,10 @@ export type Session = {
92
92
  * Whether the session is a test session
93
93
  */
94
94
  isTest?: boolean | null | undefined;
95
+ /**
96
+ * Whether the voice session was ended by the recipient (outbound) / caller (inbound). False if the user was transferred or there was an error. Unset if the session was not a voice session.
97
+ */
98
+ userTerminated?: boolean | null | undefined;
95
99
  };
96
100
 
97
101
  /** @internal */
@@ -119,6 +123,7 @@ export const Session$inboundSchema: z.ZodType<Session, z.ZodTypeDef, unknown> =
119
123
  target: z.nullable(z.string()).optional(),
120
124
  is_legacy: z.nullable(z.boolean()).optional(),
121
125
  is_test: z.nullable(z.boolean()).optional(),
126
+ user_terminated: z.nullable(z.boolean()).optional(),
122
127
  }).transform((v) => {
123
128
  return remap$(v, {
124
129
  "session_id": "sessionId",
@@ -137,6 +142,7 @@ export const Session$inboundSchema: z.ZodType<Session, z.ZodTypeDef, unknown> =
137
142
  "session_label_id": "sessionLabelId",
138
143
  "is_legacy": "isLegacy",
139
144
  "is_test": "isTest",
145
+ "user_terminated": "userTerminated",
140
146
  });
141
147
  });
142
148
  /** @internal */
@@ -161,6 +167,7 @@ export type Session$Outbound = {
161
167
  target?: string | null | undefined;
162
168
  is_legacy?: boolean | null | undefined;
163
169
  is_test?: boolean | null | undefined;
170
+ user_terminated?: boolean | null | undefined;
164
171
  };
165
172
 
166
173
  /** @internal */
@@ -189,6 +196,7 @@ export const Session$outboundSchema: z.ZodType<
189
196
  target: z.nullable(z.string()).optional(),
190
197
  isLegacy: z.nullable(z.boolean()).optional(),
191
198
  isTest: z.nullable(z.boolean()).optional(),
199
+ userTerminated: z.nullable(z.boolean()).optional(),
192
200
  }).transform((v) => {
193
201
  return remap$(v, {
194
202
  sessionId: "session_id",
@@ -207,6 +215,7 @@ export const Session$outboundSchema: z.ZodType<
207
215
  sessionLabelId: "session_label_id",
208
216
  isLegacy: "is_legacy",
209
217
  isTest: "is_test",
218
+ userTerminated: "user_terminated",
210
219
  });
211
220
  });
212
221