syllable-sdk 1.0.13-rc.4 → 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 (152) hide show
  1. package/bin/mcp-server.js +1993 -55
  2. package/bin/mcp-server.js.map +33 -10
  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/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/{contexttask.js → steptools.js} +24 -22
  112. package/models/components/steptools.js.map +1 -0
  113. package/models/components/variable.d.ts +119 -0
  114. package/models/components/variable.d.ts.map +1 -0
  115. package/models/components/variable.js +186 -0
  116. package/models/components/variable.js.map +1 -0
  117. package/openapi.json +2436 -657
  118. package/package.json +1 -1
  119. package/src/lib/config.ts +2 -2
  120. package/src/mcp-server/mcp-server.ts +1 -1
  121. package/src/mcp-server/server.ts +1 -1
  122. package/src/models/components/bodyinsightsfolderuploadfile.ts +36 -25
  123. package/src/models/components/callaction.ts +331 -0
  124. package/src/models/components/caseexpression.ts +53 -0
  125. package/src/models/components/celexpression.ts +60 -0
  126. package/src/models/components/conditionaltext.ts +280 -0
  127. package/src/models/components/conditionalvalue.ts +477 -0
  128. package/src/models/components/context.ts +413 -16
  129. package/src/models/components/contexttaskmetadata.ts +67 -0
  130. package/src/models/components/contexttoolinfo.ts +59 -0
  131. package/src/models/components/eventtask.ts +102 -0
  132. package/src/models/components/eventtaskevents.ts +257 -0
  133. package/src/models/components/expressiontask.ts +333 -0
  134. package/src/models/components/expressiontaskevents.ts +430 -0
  135. package/src/models/components/incrementaction.ts +291 -0
  136. package/src/models/components/index.ts +24 -1
  137. package/src/models/components/inputparameter.ts +103 -0
  138. package/src/models/components/jmespathexpression.ts +86 -0
  139. package/src/models/components/loadtoolfromfiletask.ts +137 -0
  140. package/src/models/components/nextstep.ts +280 -0
  141. package/src/models/components/saveaction.ts +281 -0
  142. package/src/models/components/sayaction.ts +302 -0
  143. package/src/models/components/setvalueaction.ts +508 -0
  144. package/src/models/components/step.ts +174 -0
  145. package/src/models/components/stepeventactions.ts +619 -0
  146. package/src/models/components/stepstask.ts +102 -0
  147. package/src/models/components/steptools.ts +76 -0
  148. package/src/models/components/variable.ts +332 -0
  149. package/models/components/contexttask.d.ts +0 -32
  150. package/models/components/contexttask.d.ts.map +0 -1
  151. package/models/components/contexttask.js.map +0 -1
  152. package/src/models/components/contexttask.ts +0 -78
@@ -0,0 +1,257 @@
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 EventTaskEventsStart =
41
+ | (CallAction & { action: "call" })
42
+ | (IncrementAction & { action: "inc" })
43
+ | (SayAction & { action: "say" })
44
+ | (SetValueAction & { action: "set" })
45
+ | (SaveAction & { action: "save" });
46
+
47
+ export type EventTaskEvents = {
48
+ /**
49
+ * Actions to execute on the first input from the user.
50
+ */
51
+ start?:
52
+ | Array<
53
+ | (CallAction & { action: "call" })
54
+ | (IncrementAction & { action: "inc" })
55
+ | (SayAction & { action: "say" })
56
+ | (SetValueAction & { action: "set" })
57
+ | (SaveAction & { action: "save" })
58
+ >
59
+ | null
60
+ | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export const EventTaskEventsStart$inboundSchema: z.ZodType<
65
+ EventTaskEventsStart,
66
+ z.ZodTypeDef,
67
+ unknown
68
+ > = z.union([
69
+ CallAction$inboundSchema.and(
70
+ z.object({ action: z.literal("call") }).transform((v) => ({
71
+ action: v.action,
72
+ })),
73
+ ),
74
+ IncrementAction$inboundSchema.and(
75
+ z.object({ action: z.literal("inc") }).transform((v) => ({
76
+ action: v.action,
77
+ })),
78
+ ),
79
+ SayAction$inboundSchema.and(
80
+ z.object({ action: z.literal("say") }).transform((v) => ({
81
+ action: v.action,
82
+ })),
83
+ ),
84
+ SetValueAction$inboundSchema.and(
85
+ z.object({ action: z.literal("set") }).transform((v) => ({
86
+ action: v.action,
87
+ })),
88
+ ),
89
+ SaveAction$inboundSchema.and(
90
+ z.object({ action: z.literal("save") }).transform((v) => ({
91
+ action: v.action,
92
+ })),
93
+ ),
94
+ ]);
95
+ /** @internal */
96
+ export type EventTaskEventsStart$Outbound =
97
+ | (CallAction$Outbound & { action: "call" })
98
+ | (IncrementAction$Outbound & { action: "inc" })
99
+ | (SayAction$Outbound & { action: "say" })
100
+ | (SetValueAction$Outbound & { action: "set" })
101
+ | (SaveAction$Outbound & { action: "save" });
102
+
103
+ /** @internal */
104
+ export const EventTaskEventsStart$outboundSchema: z.ZodType<
105
+ EventTaskEventsStart$Outbound,
106
+ z.ZodTypeDef,
107
+ EventTaskEventsStart
108
+ > = z.union([
109
+ CallAction$outboundSchema.and(
110
+ z.object({ action: z.literal("call") }).transform((v) => ({
111
+ action: v.action,
112
+ })),
113
+ ),
114
+ IncrementAction$outboundSchema.and(
115
+ z.object({ action: z.literal("inc") }).transform((v) => ({
116
+ action: v.action,
117
+ })),
118
+ ),
119
+ SayAction$outboundSchema.and(
120
+ z.object({ action: z.literal("say") }).transform((v) => ({
121
+ action: v.action,
122
+ })),
123
+ ),
124
+ SetValueAction$outboundSchema.and(
125
+ z.object({ action: z.literal("set") }).transform((v) => ({
126
+ action: v.action,
127
+ })),
128
+ ),
129
+ SaveAction$outboundSchema.and(
130
+ z.object({ action: z.literal("save") }).transform((v) => ({
131
+ action: v.action,
132
+ })),
133
+ ),
134
+ ]);
135
+
136
+ export function eventTaskEventsStartToJSON(
137
+ eventTaskEventsStart: EventTaskEventsStart,
138
+ ): string {
139
+ return JSON.stringify(
140
+ EventTaskEventsStart$outboundSchema.parse(eventTaskEventsStart),
141
+ );
142
+ }
143
+ export function eventTaskEventsStartFromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<EventTaskEventsStart, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) => EventTaskEventsStart$inboundSchema.parse(JSON.parse(x)),
149
+ `Failed to parse 'EventTaskEventsStart' from JSON`,
150
+ );
151
+ }
152
+
153
+ /** @internal */
154
+ export const EventTaskEvents$inboundSchema: z.ZodType<
155
+ EventTaskEvents,
156
+ z.ZodTypeDef,
157
+ unknown
158
+ > = z.object({
159
+ start: z.nullable(
160
+ z.array(
161
+ z.union([
162
+ CallAction$inboundSchema.and(
163
+ z.object({ action: z.literal("call") }).transform((v) => ({
164
+ action: v.action,
165
+ })),
166
+ ),
167
+ IncrementAction$inboundSchema.and(
168
+ z.object({ action: z.literal("inc") }).transform((v) => ({
169
+ action: v.action,
170
+ })),
171
+ ),
172
+ SayAction$inboundSchema.and(
173
+ z.object({ action: z.literal("say") }).transform((v) => ({
174
+ action: v.action,
175
+ })),
176
+ ),
177
+ SetValueAction$inboundSchema.and(
178
+ z.object({ action: z.literal("set") }).transform((v) => ({
179
+ action: v.action,
180
+ })),
181
+ ),
182
+ SaveAction$inboundSchema.and(
183
+ z.object({ action: z.literal("save") }).transform((v) => ({
184
+ action: v.action,
185
+ })),
186
+ ),
187
+ ]),
188
+ ),
189
+ ).optional(),
190
+ });
191
+ /** @internal */
192
+ export type EventTaskEvents$Outbound = {
193
+ start?:
194
+ | Array<
195
+ | (CallAction$Outbound & { action: "call" })
196
+ | (IncrementAction$Outbound & { action: "inc" })
197
+ | (SayAction$Outbound & { action: "say" })
198
+ | (SetValueAction$Outbound & { action: "set" })
199
+ | (SaveAction$Outbound & { action: "save" })
200
+ >
201
+ | null
202
+ | undefined;
203
+ };
204
+
205
+ /** @internal */
206
+ export const EventTaskEvents$outboundSchema: z.ZodType<
207
+ EventTaskEvents$Outbound,
208
+ z.ZodTypeDef,
209
+ EventTaskEvents
210
+ > = z.object({
211
+ start: z.nullable(
212
+ z.array(
213
+ z.union([
214
+ CallAction$outboundSchema.and(
215
+ z.object({ action: z.literal("call") }).transform((v) => ({
216
+ action: v.action,
217
+ })),
218
+ ),
219
+ IncrementAction$outboundSchema.and(
220
+ z.object({ action: z.literal("inc") }).transform((v) => ({
221
+ action: v.action,
222
+ })),
223
+ ),
224
+ SayAction$outboundSchema.and(
225
+ z.object({ action: z.literal("say") }).transform((v) => ({
226
+ action: v.action,
227
+ })),
228
+ ),
229
+ SetValueAction$outboundSchema.and(
230
+ z.object({ action: z.literal("set") }).transform((v) => ({
231
+ action: v.action,
232
+ })),
233
+ ),
234
+ SaveAction$outboundSchema.and(
235
+ z.object({ action: z.literal("save") }).transform((v) => ({
236
+ action: v.action,
237
+ })),
238
+ ),
239
+ ]),
240
+ ),
241
+ ).optional(),
242
+ });
243
+
244
+ export function eventTaskEventsToJSON(
245
+ eventTaskEvents: EventTaskEvents,
246
+ ): string {
247
+ return JSON.stringify(EventTaskEvents$outboundSchema.parse(eventTaskEvents));
248
+ }
249
+ export function eventTaskEventsFromJSON(
250
+ jsonString: string,
251
+ ): SafeParseResult<EventTaskEvents, SDKValidationError> {
252
+ return safeParse(
253
+ jsonString,
254
+ (x) => EventTaskEvents$inboundSchema.parse(JSON.parse(x)),
255
+ `Failed to parse 'EventTaskEvents' from JSON`,
256
+ );
257
+ }
@@ -0,0 +1,333 @@
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
+ ContextTaskMetadata,
23
+ ContextTaskMetadata$inboundSchema,
24
+ ContextTaskMetadata$Outbound,
25
+ ContextTaskMetadata$outboundSchema,
26
+ } from "./contexttaskmetadata.js";
27
+ import {
28
+ ContextToolInfo,
29
+ ContextToolInfo$inboundSchema,
30
+ ContextToolInfo$Outbound,
31
+ ContextToolInfo$outboundSchema,
32
+ } from "./contexttoolinfo.js";
33
+ import {
34
+ ExpressionTaskEvents,
35
+ ExpressionTaskEvents$inboundSchema,
36
+ ExpressionTaskEvents$Outbound,
37
+ ExpressionTaskEvents$outboundSchema,
38
+ } from "./expressiontaskevents.js";
39
+ import {
40
+ InputParameter,
41
+ InputParameter$inboundSchema,
42
+ InputParameter$Outbound,
43
+ InputParameter$outboundSchema,
44
+ } from "./inputparameter.js";
45
+ import {
46
+ JMESPathExpression,
47
+ JMESPathExpression$inboundSchema,
48
+ JMESPathExpression$Outbound,
49
+ JMESPathExpression$outboundSchema,
50
+ } from "./jmespathexpression.js";
51
+ import {
52
+ Variable,
53
+ Variable$inboundSchema,
54
+ Variable$Outbound,
55
+ Variable$outboundSchema,
56
+ } from "./variable.js";
57
+
58
+ export type Expression1 =
59
+ | (CelExpression & { type: "cel" })
60
+ | (JMESPathExpression & { type: "jmespath" })
61
+ | (JMESPathExpression & { type: "jp" });
62
+
63
+ export type Expression =
64
+ | CaseExpression
65
+ | (CelExpression & { type: "cel" })
66
+ | (JMESPathExpression & { type: "jmespath" })
67
+ | (JMESPathExpression & { type: "jp" })
68
+ | string;
69
+
70
+ export type ExpressionTask = {
71
+ /**
72
+ * A unique identifier for the task.
73
+ */
74
+ id?: string | null | undefined;
75
+ config?: { [k: string]: any } | null | undefined;
76
+ variables?: Array<Variable> | null | undefined;
77
+ metadata?: ContextTaskMetadata | null | undefined;
78
+ tool?: ContextToolInfo | null | undefined;
79
+ type?: "expression" | undefined;
80
+ version?: "v1alpha" | undefined;
81
+ inputs?: Array<InputParameter> | undefined;
82
+ expression?:
83
+ | CaseExpression
84
+ | (CelExpression & { type: "cel" })
85
+ | (JMESPathExpression & { type: "jmespath" })
86
+ | (JMESPathExpression & { type: "jp" })
87
+ | string
88
+ | null
89
+ | undefined;
90
+ output?: any | null | undefined;
91
+ /**
92
+ * Actions to perform when events occur (enter, submit).
93
+ */
94
+ on?: ExpressionTaskEvents | undefined;
95
+ };
96
+
97
+ /** @internal */
98
+ export const Expression1$inboundSchema: z.ZodType<
99
+ Expression1,
100
+ z.ZodTypeDef,
101
+ unknown
102
+ > = z.union([
103
+ CelExpression$inboundSchema.and(
104
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
105
+ ),
106
+ JMESPathExpression$inboundSchema.and(
107
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
108
+ type: v.type,
109
+ })),
110
+ ),
111
+ JMESPathExpression$inboundSchema.and(
112
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
113
+ ),
114
+ ]);
115
+ /** @internal */
116
+ export type Expression1$Outbound =
117
+ | (CelExpression$Outbound & { type: "cel" })
118
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
119
+ | (JMESPathExpression$Outbound & { type: "jp" });
120
+
121
+ /** @internal */
122
+ export const Expression1$outboundSchema: z.ZodType<
123
+ Expression1$Outbound,
124
+ z.ZodTypeDef,
125
+ Expression1
126
+ > = z.union([
127
+ CelExpression$outboundSchema.and(
128
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
129
+ ),
130
+ JMESPathExpression$outboundSchema.and(
131
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
132
+ type: v.type,
133
+ })),
134
+ ),
135
+ JMESPathExpression$outboundSchema.and(
136
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
137
+ ),
138
+ ]);
139
+
140
+ export function expression1ToJSON(expression1: Expression1): string {
141
+ return JSON.stringify(Expression1$outboundSchema.parse(expression1));
142
+ }
143
+ export function expression1FromJSON(
144
+ jsonString: string,
145
+ ): SafeParseResult<Expression1, SDKValidationError> {
146
+ return safeParse(
147
+ jsonString,
148
+ (x) => Expression1$inboundSchema.parse(JSON.parse(x)),
149
+ `Failed to parse 'Expression1' from JSON`,
150
+ );
151
+ }
152
+
153
+ /** @internal */
154
+ export const Expression$inboundSchema: z.ZodType<
155
+ Expression,
156
+ z.ZodTypeDef,
157
+ unknown
158
+ > = z.union([
159
+ CaseExpression$inboundSchema,
160
+ z.union([
161
+ CelExpression$inboundSchema.and(
162
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
163
+ ),
164
+ JMESPathExpression$inboundSchema.and(
165
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
166
+ type: v.type,
167
+ })),
168
+ ),
169
+ JMESPathExpression$inboundSchema.and(
170
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
171
+ ),
172
+ ]),
173
+ z.string(),
174
+ ]);
175
+ /** @internal */
176
+ export type Expression$Outbound =
177
+ | CaseExpression$Outbound
178
+ | (CelExpression$Outbound & { type: "cel" })
179
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
180
+ | (JMESPathExpression$Outbound & { type: "jp" })
181
+ | string;
182
+
183
+ /** @internal */
184
+ export const Expression$outboundSchema: z.ZodType<
185
+ Expression$Outbound,
186
+ z.ZodTypeDef,
187
+ Expression
188
+ > = z.union([
189
+ CaseExpression$outboundSchema,
190
+ z.union([
191
+ CelExpression$outboundSchema.and(
192
+ z.object({ type: z.literal("cel") }).transform((v) => ({ type: v.type })),
193
+ ),
194
+ JMESPathExpression$outboundSchema.and(
195
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
196
+ type: v.type,
197
+ })),
198
+ ),
199
+ JMESPathExpression$outboundSchema.and(
200
+ z.object({ type: z.literal("jp") }).transform((v) => ({ type: v.type })),
201
+ ),
202
+ ]),
203
+ z.string(),
204
+ ]);
205
+
206
+ export function expressionToJSON(expression: Expression): string {
207
+ return JSON.stringify(Expression$outboundSchema.parse(expression));
208
+ }
209
+ export function expressionFromJSON(
210
+ jsonString: string,
211
+ ): SafeParseResult<Expression, SDKValidationError> {
212
+ return safeParse(
213
+ jsonString,
214
+ (x) => Expression$inboundSchema.parse(JSON.parse(x)),
215
+ `Failed to parse 'Expression' from JSON`,
216
+ );
217
+ }
218
+
219
+ /** @internal */
220
+ export const ExpressionTask$inboundSchema: z.ZodType<
221
+ ExpressionTask,
222
+ z.ZodTypeDef,
223
+ unknown
224
+ > = z.object({
225
+ id: z.nullable(z.string()).optional(),
226
+ config: z.nullable(z.record(z.any())).optional(),
227
+ variables: z.nullable(z.array(Variable$inboundSchema)).optional(),
228
+ metadata: z.nullable(ContextTaskMetadata$inboundSchema).optional(),
229
+ tool: z.nullable(ContextToolInfo$inboundSchema).optional(),
230
+ type: z.literal("expression").default("expression"),
231
+ version: z.literal("v1alpha").default("v1alpha"),
232
+ inputs: z.array(InputParameter$inboundSchema).optional(),
233
+ expression: z.nullable(
234
+ z.union([
235
+ CaseExpression$inboundSchema,
236
+ z.union([
237
+ CelExpression$inboundSchema.and(
238
+ z.object({ type: z.literal("cel") }).transform((v) => ({
239
+ type: v.type,
240
+ })),
241
+ ),
242
+ JMESPathExpression$inboundSchema.and(
243
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
244
+ type: v.type,
245
+ })),
246
+ ),
247
+ JMESPathExpression$inboundSchema.and(
248
+ z.object({ type: z.literal("jp") }).transform((v) => ({
249
+ type: v.type,
250
+ })),
251
+ ),
252
+ ]),
253
+ z.string(),
254
+ ]),
255
+ ).optional(),
256
+ output: z.nullable(z.any()).optional(),
257
+ on: ExpressionTaskEvents$inboundSchema.optional(),
258
+ });
259
+ /** @internal */
260
+ export type ExpressionTask$Outbound = {
261
+ id?: string | null | undefined;
262
+ config?: { [k: string]: any } | null | undefined;
263
+ variables?: Array<Variable$Outbound> | null | undefined;
264
+ metadata?: ContextTaskMetadata$Outbound | null | undefined;
265
+ tool?: ContextToolInfo$Outbound | null | undefined;
266
+ type: "expression";
267
+ version: "v1alpha";
268
+ inputs?: Array<InputParameter$Outbound> | undefined;
269
+ expression?:
270
+ | CaseExpression$Outbound
271
+ | (CelExpression$Outbound & { type: "cel" })
272
+ | (JMESPathExpression$Outbound & { type: "jmespath" })
273
+ | (JMESPathExpression$Outbound & { type: "jp" })
274
+ | string
275
+ | null
276
+ | undefined;
277
+ output?: any | null | undefined;
278
+ on?: ExpressionTaskEvents$Outbound | undefined;
279
+ };
280
+
281
+ /** @internal */
282
+ export const ExpressionTask$outboundSchema: z.ZodType<
283
+ ExpressionTask$Outbound,
284
+ z.ZodTypeDef,
285
+ ExpressionTask
286
+ > = z.object({
287
+ id: z.nullable(z.string()).optional(),
288
+ config: z.nullable(z.record(z.any())).optional(),
289
+ variables: z.nullable(z.array(Variable$outboundSchema)).optional(),
290
+ metadata: z.nullable(ContextTaskMetadata$outboundSchema).optional(),
291
+ tool: z.nullable(ContextToolInfo$outboundSchema).optional(),
292
+ type: z.literal("expression").default("expression" as const),
293
+ version: z.literal("v1alpha").default("v1alpha" as const),
294
+ inputs: z.array(InputParameter$outboundSchema).optional(),
295
+ expression: z.nullable(
296
+ z.union([
297
+ CaseExpression$outboundSchema,
298
+ z.union([
299
+ CelExpression$outboundSchema.and(
300
+ z.object({ type: z.literal("cel") }).transform((v) => ({
301
+ type: v.type,
302
+ })),
303
+ ),
304
+ JMESPathExpression$outboundSchema.and(
305
+ z.object({ type: z.literal("jmespath") }).transform((v) => ({
306
+ type: v.type,
307
+ })),
308
+ ),
309
+ JMESPathExpression$outboundSchema.and(
310
+ z.object({ type: z.literal("jp") }).transform((v) => ({
311
+ type: v.type,
312
+ })),
313
+ ),
314
+ ]),
315
+ z.string(),
316
+ ]),
317
+ ).optional(),
318
+ output: z.nullable(z.any()).optional(),
319
+ on: ExpressionTaskEvents$outboundSchema.optional(),
320
+ });
321
+
322
+ export function expressionTaskToJSON(expressionTask: ExpressionTask): string {
323
+ return JSON.stringify(ExpressionTask$outboundSchema.parse(expressionTask));
324
+ }
325
+ export function expressionTaskFromJSON(
326
+ jsonString: string,
327
+ ): SafeParseResult<ExpressionTask, SDKValidationError> {
328
+ return safeParse(
329
+ jsonString,
330
+ (x) => ExpressionTask$inboundSchema.parse(JSON.parse(x)),
331
+ `Failed to parse 'ExpressionTask' from JSON`,
332
+ );
333
+ }