skedyul 1.2.41 → 1.2.44
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.
- package/dist/cli/commands/agents.d.ts +1 -0
- package/dist/cli/commands/chat.d.ts +1 -0
- package/dist/cli/commands/crm.d.ts +1 -0
- package/dist/cli/commands/skills.d.ts +1 -0
- package/dist/cli/index.js +17637 -6230
- package/dist/cli/utils/auth.js +495 -0
- package/dist/cli/utils/mock-context.d.ts +22 -0
- package/dist/cli/utils/sse.d.ts +100 -0
- package/dist/compiler/compiler.d.ts +12 -0
- package/dist/compiler/index.d.ts +2 -0
- package/dist/compiler/types.d.ts +173 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/schema-loader.d.ts +156 -0
- package/dist/config/types/model.d.ts +28 -0
- package/dist/context/index.d.ts +2 -0
- package/dist/context/resolver.d.ts +51 -0
- package/dist/context/types.d.ts +217 -0
- package/dist/dedicated/server.js +23 -10
- package/dist/esm/index.mjs +9630 -449
- package/dist/events/index.d.ts +1 -0
- package/dist/events/types.d.ts +528 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +9723 -460
- package/dist/memory/index.d.ts +4 -0
- package/dist/memory/service.d.ts +78 -0
- package/dist/memory/types.d.ts +169 -0
- package/dist/schemas/agent-schema-v3.d.ts +437 -0
- package/dist/schemas/agent-schema-v3.js +539 -0
- package/dist/schemas/agent-schema-v3.mjs +497 -0
- package/dist/schemas/agent-schema.d.ts +1504 -0
- package/dist/schemas/agent-schema.js +7896 -0
- package/dist/schemas/agent-schema.mjs +7867 -0
- package/dist/schemas/crm-schema.d.ts +448 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas.d.ts +69 -36
- package/dist/server.js +23 -10
- package/dist/serverless/server.mjs +23 -10
- package/dist/skills/index.d.ts +1 -0
- package/dist/skills/types.d.ts +355 -0
- package/dist/skills/types.js +281 -0
- package/dist/skills/types.mjs +234 -0
- package/dist/triggers/index.d.ts +2 -0
- package/dist/triggers/resolver.d.ts +31 -0
- package/dist/triggers/types.d.ts +313 -0
- package/dist/types/data-blocks.d.ts +105 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/tool-response.d.ts +16 -0
- package/dist/types/tool.d.ts +32 -8
- package/dist/workflows/index.d.ts +1 -0
- package/dist/workflows/types.d.ts +295 -0
- package/package.json +19 -1
|
@@ -0,0 +1,1504 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
/** Execution mode for tool calls - determines approval requirements */
|
|
3
|
+
export type ToolExecutionMode = 'ALLOW_ALL' | 'REQUIRE_APPROVAL';
|
|
4
|
+
/** Default timeout for tool call approval (1 day in milliseconds) */
|
|
5
|
+
export declare const DEFAULT_APPROVAL_TIMEOUT_MS = 86400000;
|
|
6
|
+
export type SystemToolBinding = {
|
|
7
|
+
kind: 'SYSTEM';
|
|
8
|
+
name: string;
|
|
9
|
+
handle?: string;
|
|
10
|
+
displayName?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Execution mode: ALLOW_ALL (default) or REQUIRE_APPROVAL */
|
|
13
|
+
executionMode?: ToolExecutionMode;
|
|
14
|
+
/** Approval timeout in ms (default: 86400000 = 1 day) */
|
|
15
|
+
approvalTimeoutMs?: number;
|
|
16
|
+
};
|
|
17
|
+
export type AgentToolBinding = {
|
|
18
|
+
kind: 'AGENT';
|
|
19
|
+
name: string;
|
|
20
|
+
handle?: string;
|
|
21
|
+
displayName?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Execution mode: ALLOW_ALL (default) or REQUIRE_APPROVAL */
|
|
24
|
+
executionMode?: ToolExecutionMode;
|
|
25
|
+
/** Approval timeout in ms (default: 86400000 = 1 day) */
|
|
26
|
+
approvalTimeoutMs?: number;
|
|
27
|
+
};
|
|
28
|
+
export type McpToolBinding = {
|
|
29
|
+
kind: 'MCP';
|
|
30
|
+
server: string;
|
|
31
|
+
tool: string;
|
|
32
|
+
handle?: string;
|
|
33
|
+
displayName?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
/** Execution mode: ALLOW_ALL (default) or REQUIRE_APPROVAL */
|
|
36
|
+
executionMode?: ToolExecutionMode;
|
|
37
|
+
/** Approval timeout in ms (default: 86400000 = 1 day) */
|
|
38
|
+
approvalTimeoutMs?: number;
|
|
39
|
+
};
|
|
40
|
+
export type ToolBinding = SystemToolBinding | AgentToolBinding | McpToolBinding;
|
|
41
|
+
export interface ToolReferenceInput {
|
|
42
|
+
tool: string;
|
|
43
|
+
handle?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Execution mode: ALLOW_ALL (default) or REQUIRE_APPROVAL */
|
|
47
|
+
executionMode?: ToolExecutionMode;
|
|
48
|
+
/** Approval timeout in ms (default: 86400000 = 1 day) */
|
|
49
|
+
approvalTimeoutMs?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Parse a tool reference string into its components.
|
|
53
|
+
*
|
|
54
|
+
* Supported formats:
|
|
55
|
+
* - New colon-separated format:
|
|
56
|
+
* - `system:crm:model:operation` → SYSTEM tool (e.g., system:crm:prospect:get)
|
|
57
|
+
* - `system:crm:model:operation:field` → SYSTEM tool (e.g., system:crm:prospect:update:stage)
|
|
58
|
+
* - `system:settings:key` → SYSTEM tool (e.g., system:settings:business_information)
|
|
59
|
+
* - `system:thread:operation` → SYSTEM tool (e.g., system:thread:create)
|
|
60
|
+
* - `system:threads:resource:operation` → SYSTEM tool (e.g., system:threads:message:create)
|
|
61
|
+
* - `agent:handle` → AGENT tool (e.g., agent:sales-assistant)
|
|
62
|
+
* - `app:server:tool` → MCP tool (e.g., app:hubspot:create_contact)
|
|
63
|
+
* - Legacy @-prefixed format:
|
|
64
|
+
* - `@crm/model/operation` → SYSTEM tool with name "model_operation"
|
|
65
|
+
* - `@agent/agent-handle` → AGENT tool with name "agent-handle"
|
|
66
|
+
* - `@app/server/tool` → MCP tool with server and tool name
|
|
67
|
+
* - Plain string (legacy) → SYSTEM tool with name as-is
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* parseToolReferenceString("system:crm:prospect:get")
|
|
71
|
+
* // → { kind: "SYSTEM", name: "system:crm:prospect:get" }
|
|
72
|
+
*
|
|
73
|
+
* parseToolReferenceString("system:threads:message:create")
|
|
74
|
+
* // → { kind: "SYSTEM", name: "system:threads:message:create" }
|
|
75
|
+
*
|
|
76
|
+
* parseToolReferenceString("agent:sales-assistant")
|
|
77
|
+
* // → { kind: "AGENT", name: "agent:sales-assistant" }
|
|
78
|
+
*
|
|
79
|
+
* parseToolReferenceString("app:hubspot:create_contact")
|
|
80
|
+
* // → { kind: "MCP", server: "hubspot", tool: "create_contact" }
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseToolReferenceString(ref: string): {
|
|
83
|
+
kind: 'SYSTEM';
|
|
84
|
+
name: string;
|
|
85
|
+
} | {
|
|
86
|
+
kind: 'AGENT';
|
|
87
|
+
name: string;
|
|
88
|
+
} | {
|
|
89
|
+
kind: 'MCP';
|
|
90
|
+
server: string;
|
|
91
|
+
tool: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Parse a tool reference input (string or object) into a ToolBinding.
|
|
95
|
+
*
|
|
96
|
+
* Accepts:
|
|
97
|
+
* - String: "@crm/prospect/prospect_get" or "prospect_get"
|
|
98
|
+
* - Object: { tool: "@crm/prospect/prospect_get", handle: "custom", name: "Display Name", description: "..." }
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* parseToolReference("@crm/prospect/prospect_get")
|
|
102
|
+
* // → { kind: "SYSTEM", name: "prospect_get" }
|
|
103
|
+
*
|
|
104
|
+
* parseToolReference({ tool: "@crm/prospect/prospect_update", handle: "capture_structured", name: "Capture Data", description: "..." })
|
|
105
|
+
* // → { kind: "SYSTEM", name: "prospect_update", handle: "capture_structured", displayName: "Capture Data", description: "..." }
|
|
106
|
+
*/
|
|
107
|
+
export declare function parseToolReference(input: string | ToolReferenceInput): ToolBinding;
|
|
108
|
+
/**
|
|
109
|
+
* Parse an array of tool references into ToolBinding array.
|
|
110
|
+
* Handles mixed formats (strings and objects) in the same array.
|
|
111
|
+
*/
|
|
112
|
+
export declare function parseToolReferences(inputs: Array<string | ToolReferenceInput>): ToolBinding[];
|
|
113
|
+
/**
|
|
114
|
+
* Tool stage - runs a system tool, MCP tool, or activity
|
|
115
|
+
* Replaces the old 'activity' type with a consistent shape
|
|
116
|
+
*/
|
|
117
|
+
declare const ToolStageZ: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
+
if: z.ZodOptional<z.ZodString>;
|
|
121
|
+
type: z.ZodLiteral<"tool">;
|
|
122
|
+
resource: z.ZodString;
|
|
123
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
/**
|
|
127
|
+
* Inline agent definition for agent stages.
|
|
128
|
+
* Contains all fields needed to configure the agent that runs in this stage.
|
|
129
|
+
*/
|
|
130
|
+
declare const StageAgentDefinitionZ: z.ZodObject<{
|
|
131
|
+
handle: z.ZodString;
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
description: z.ZodOptional<z.ZodString>;
|
|
134
|
+
system: z.ZodString;
|
|
135
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
136
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
137
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
139
|
+
tool: z.ZodString;
|
|
140
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
141
|
+
name: z.ZodOptional<z.ZodString>;
|
|
142
|
+
description: z.ZodOptional<z.ZodString>;
|
|
143
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
145
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
146
|
+
}>>;
|
|
147
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
149
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
150
|
+
name: z.ZodString;
|
|
151
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
152
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
153
|
+
description: z.ZodOptional<z.ZodString>;
|
|
154
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
155
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
156
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
157
|
+
}>>;
|
|
158
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
163
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
164
|
+
description: z.ZodOptional<z.ZodString>;
|
|
165
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
166
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
167
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
168
|
+
}>>;
|
|
169
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
171
|
+
kind: z.ZodLiteral<"MCP">;
|
|
172
|
+
server: z.ZodString;
|
|
173
|
+
tool: z.ZodString;
|
|
174
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
175
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
176
|
+
description: z.ZodOptional<z.ZodString>;
|
|
177
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
178
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
179
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
180
|
+
}>>;
|
|
181
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
}, z.core.$strip>]>]>>>;
|
|
183
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export type StageAgentDefinition = z.infer<typeof StageAgentDefinitionZ>;
|
|
186
|
+
/**
|
|
187
|
+
* Agent stage base schema (without refinement for use in discriminatedUnion)
|
|
188
|
+
*/
|
|
189
|
+
declare const AgentStageBaseZ: z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
192
|
+
if: z.ZodOptional<z.ZodString>;
|
|
193
|
+
type: z.ZodLiteral<"agent">;
|
|
194
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
handle: z.ZodString;
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
description: z.ZodOptional<z.ZodString>;
|
|
198
|
+
system: z.ZodString;
|
|
199
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
200
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
201
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
203
|
+
tool: z.ZodString;
|
|
204
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
205
|
+
name: z.ZodOptional<z.ZodString>;
|
|
206
|
+
description: z.ZodOptional<z.ZodString>;
|
|
207
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
209
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
210
|
+
}>>;
|
|
211
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
213
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
214
|
+
name: z.ZodString;
|
|
215
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
216
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
217
|
+
description: z.ZodOptional<z.ZodString>;
|
|
218
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
219
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
220
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
221
|
+
}>>;
|
|
222
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
224
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
227
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
228
|
+
description: z.ZodOptional<z.ZodString>;
|
|
229
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
230
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
231
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
232
|
+
}>>;
|
|
233
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
235
|
+
kind: z.ZodLiteral<"MCP">;
|
|
236
|
+
server: z.ZodString;
|
|
237
|
+
tool: z.ZodString;
|
|
238
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
239
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
240
|
+
description: z.ZodOptional<z.ZodString>;
|
|
241
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
242
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
243
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
244
|
+
}>>;
|
|
245
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
246
|
+
}, z.core.$strip>]>]>>>;
|
|
247
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
250
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
251
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
252
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
/**
|
|
255
|
+
* Agent stage - runs an agent with inline definition or external reference
|
|
256
|
+
*
|
|
257
|
+
* New format: Use `props` object with full agent definition inline
|
|
258
|
+
* Legacy format: Use `resource` string to reference an agent by handle
|
|
259
|
+
*/
|
|
260
|
+
declare const AgentStageZ: z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
263
|
+
if: z.ZodOptional<z.ZodString>;
|
|
264
|
+
type: z.ZodLiteral<"agent">;
|
|
265
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
266
|
+
handle: z.ZodString;
|
|
267
|
+
name: z.ZodString;
|
|
268
|
+
description: z.ZodOptional<z.ZodString>;
|
|
269
|
+
system: z.ZodString;
|
|
270
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
271
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
272
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
274
|
+
tool: z.ZodString;
|
|
275
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
276
|
+
name: z.ZodOptional<z.ZodString>;
|
|
277
|
+
description: z.ZodOptional<z.ZodString>;
|
|
278
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
279
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
280
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
281
|
+
}>>;
|
|
282
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
284
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
285
|
+
name: z.ZodString;
|
|
286
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
287
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
288
|
+
description: z.ZodOptional<z.ZodString>;
|
|
289
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
290
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
291
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
292
|
+
}>>;
|
|
293
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
294
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
295
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
298
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
299
|
+
description: z.ZodOptional<z.ZodString>;
|
|
300
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
301
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
302
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
303
|
+
}>>;
|
|
304
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
kind: z.ZodLiteral<"MCP">;
|
|
307
|
+
server: z.ZodString;
|
|
308
|
+
tool: z.ZodString;
|
|
309
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
310
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
311
|
+
description: z.ZodOptional<z.ZodString>;
|
|
312
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
314
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
315
|
+
}>>;
|
|
316
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
317
|
+
}, z.core.$strip>]>]>>>;
|
|
318
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
319
|
+
}, z.core.$strip>>;
|
|
320
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
321
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
322
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
323
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
/**
|
|
326
|
+
* Transform stage - computes derived values without external calls
|
|
327
|
+
*/
|
|
328
|
+
declare const TransformStageZ: z.ZodObject<{
|
|
329
|
+
id: z.ZodString;
|
|
330
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
331
|
+
if: z.ZodOptional<z.ZodString>;
|
|
332
|
+
type: z.ZodLiteral<"transform">;
|
|
333
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
/**
|
|
336
|
+
* Output stage - defines final output (terminal stage)
|
|
337
|
+
*/
|
|
338
|
+
declare const OutputStageZ: z.ZodObject<{
|
|
339
|
+
id: z.ZodString;
|
|
340
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
341
|
+
if: z.ZodOptional<z.ZodString>;
|
|
342
|
+
type: z.ZodLiteral<"output">;
|
|
343
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
344
|
+
}, z.core.$strip>;
|
|
345
|
+
/**
|
|
346
|
+
* Union of all stage types (uses base schemas for discriminatedUnion compatibility)
|
|
347
|
+
*/
|
|
348
|
+
declare const StageZ: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
349
|
+
id: z.ZodString;
|
|
350
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
351
|
+
if: z.ZodOptional<z.ZodString>;
|
|
352
|
+
type: z.ZodLiteral<"tool">;
|
|
353
|
+
resource: z.ZodString;
|
|
354
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
355
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
356
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
357
|
+
id: z.ZodString;
|
|
358
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
359
|
+
if: z.ZodOptional<z.ZodString>;
|
|
360
|
+
type: z.ZodLiteral<"agent">;
|
|
361
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
handle: z.ZodString;
|
|
363
|
+
name: z.ZodString;
|
|
364
|
+
description: z.ZodOptional<z.ZodString>;
|
|
365
|
+
system: z.ZodString;
|
|
366
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
367
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
368
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
369
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
370
|
+
tool: z.ZodString;
|
|
371
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
372
|
+
name: z.ZodOptional<z.ZodString>;
|
|
373
|
+
description: z.ZodOptional<z.ZodString>;
|
|
374
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
375
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
376
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
377
|
+
}>>;
|
|
378
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
380
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
381
|
+
name: z.ZodString;
|
|
382
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
383
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
384
|
+
description: z.ZodOptional<z.ZodString>;
|
|
385
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
386
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
387
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
388
|
+
}>>;
|
|
389
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
390
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
391
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
392
|
+
name: z.ZodString;
|
|
393
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
394
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
395
|
+
description: z.ZodOptional<z.ZodString>;
|
|
396
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
397
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
398
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
399
|
+
}>>;
|
|
400
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
401
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
402
|
+
kind: z.ZodLiteral<"MCP">;
|
|
403
|
+
server: z.ZodString;
|
|
404
|
+
tool: z.ZodString;
|
|
405
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
406
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
407
|
+
description: z.ZodOptional<z.ZodString>;
|
|
408
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
409
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
410
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
411
|
+
}>>;
|
|
412
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
413
|
+
}, z.core.$strip>]>]>>>;
|
|
414
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
415
|
+
}, z.core.$strip>>;
|
|
416
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
417
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
418
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
419
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
420
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
421
|
+
id: z.ZodString;
|
|
422
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
423
|
+
if: z.ZodOptional<z.ZodString>;
|
|
424
|
+
type: z.ZodLiteral<"transform">;
|
|
425
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
426
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
427
|
+
id: z.ZodString;
|
|
428
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
429
|
+
if: z.ZodOptional<z.ZodString>;
|
|
430
|
+
type: z.ZodLiteral<"output">;
|
|
431
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
432
|
+
}, z.core.$strip>], "type">;
|
|
433
|
+
export type ToolStage = z.infer<typeof ToolStageZ>;
|
|
434
|
+
export type AgentStage = z.infer<typeof AgentStageZ>;
|
|
435
|
+
export type AgentStageBase = z.infer<typeof AgentStageBaseZ>;
|
|
436
|
+
export type TransformStage = z.infer<typeof TransformStageZ>;
|
|
437
|
+
export type OutputStage = z.infer<typeof OutputStageZ>;
|
|
438
|
+
export type Stage = z.infer<typeof StageZ>;
|
|
439
|
+
export { StageAgentDefinitionZ, AgentStageBaseZ, ToolStageZ, TransformStageZ, OutputStageZ, StageZ };
|
|
440
|
+
/**
|
|
441
|
+
* Legacy activity stage - use 'tool' type instead
|
|
442
|
+
* @deprecated Use ToolStageZ with type: 'tool' and resource: 'activity-name'
|
|
443
|
+
*/
|
|
444
|
+
declare const LegacyActivityStageZ: z.ZodObject<{
|
|
445
|
+
id: z.ZodString;
|
|
446
|
+
type: z.ZodLiteral<"activity">;
|
|
447
|
+
activity: z.ZodString;
|
|
448
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
449
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
/**
|
|
452
|
+
* Legacy agent stage - use new AgentStageZ with 'resource' instead of 'agent'
|
|
453
|
+
* @deprecated Use AgentStageZ with resource: 'agent-handle'
|
|
454
|
+
*/
|
|
455
|
+
declare const LegacyAgentStageZ: z.ZodObject<{
|
|
456
|
+
id: z.ZodString;
|
|
457
|
+
type: z.ZodLiteral<"agent">;
|
|
458
|
+
agent: z.ZodString;
|
|
459
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
460
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
461
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
462
|
+
}, z.core.$strip>;
|
|
463
|
+
/**
|
|
464
|
+
* Legacy conditional stage - use 'if' on stages instead
|
|
465
|
+
* @deprecated Use 'if' property on individual stages
|
|
466
|
+
*/
|
|
467
|
+
declare const LegacyConditionalStageZ: z.ZodObject<{
|
|
468
|
+
id: z.ZodString;
|
|
469
|
+
type: z.ZodLiteral<"conditional">;
|
|
470
|
+
condition: z.ZodString;
|
|
471
|
+
then: z.ZodString;
|
|
472
|
+
else: z.ZodOptional<z.ZodString>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
/**
|
|
475
|
+
* Legacy transform stage - use new TransformStageZ with 'outputs' instead of 'set'
|
|
476
|
+
* @deprecated Use TransformStageZ with outputs: {...}
|
|
477
|
+
*/
|
|
478
|
+
declare const LegacyTransformStageZ: z.ZodObject<{
|
|
479
|
+
id: z.ZodString;
|
|
480
|
+
type: z.ZodLiteral<"transform">;
|
|
481
|
+
set: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
/**
|
|
484
|
+
* Legacy output stage - use new OutputStageZ with 'outputs' instead of 'value'
|
|
485
|
+
* @deprecated Use OutputStageZ with outputs: {...}
|
|
486
|
+
*/
|
|
487
|
+
declare const LegacyOutputStageZ: z.ZodObject<{
|
|
488
|
+
id: z.ZodString;
|
|
489
|
+
type: z.ZodLiteral<"output">;
|
|
490
|
+
value: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
491
|
+
}, z.core.$strip>;
|
|
492
|
+
/**
|
|
493
|
+
* Combined schema that accepts both new and legacy formats
|
|
494
|
+
* The runtime will normalize legacy formats to the new schema
|
|
495
|
+
*/
|
|
496
|
+
declare const StageWithLegacyZ: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
497
|
+
id: z.ZodString;
|
|
498
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
499
|
+
if: z.ZodOptional<z.ZodString>;
|
|
500
|
+
type: z.ZodLiteral<"tool">;
|
|
501
|
+
resource: z.ZodString;
|
|
502
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
503
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
504
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
505
|
+
id: z.ZodString;
|
|
506
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
507
|
+
if: z.ZodOptional<z.ZodString>;
|
|
508
|
+
type: z.ZodLiteral<"agent">;
|
|
509
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
510
|
+
handle: z.ZodString;
|
|
511
|
+
name: z.ZodString;
|
|
512
|
+
description: z.ZodOptional<z.ZodString>;
|
|
513
|
+
system: z.ZodString;
|
|
514
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
515
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
516
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
517
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
518
|
+
tool: z.ZodString;
|
|
519
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
520
|
+
name: z.ZodOptional<z.ZodString>;
|
|
521
|
+
description: z.ZodOptional<z.ZodString>;
|
|
522
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
523
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
524
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
525
|
+
}>>;
|
|
526
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
527
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
528
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
529
|
+
name: z.ZodString;
|
|
530
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
531
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
532
|
+
description: z.ZodOptional<z.ZodString>;
|
|
533
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
534
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
535
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
536
|
+
}>>;
|
|
537
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
538
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
539
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
540
|
+
name: z.ZodString;
|
|
541
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
542
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
543
|
+
description: z.ZodOptional<z.ZodString>;
|
|
544
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
545
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
546
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
547
|
+
}>>;
|
|
548
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
549
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
550
|
+
kind: z.ZodLiteral<"MCP">;
|
|
551
|
+
server: z.ZodString;
|
|
552
|
+
tool: z.ZodString;
|
|
553
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
554
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
555
|
+
description: z.ZodOptional<z.ZodString>;
|
|
556
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
557
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
558
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
559
|
+
}>>;
|
|
560
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
561
|
+
}, z.core.$strip>]>]>>>;
|
|
562
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
563
|
+
}, z.core.$strip>>;
|
|
564
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
565
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
566
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
567
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
568
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
569
|
+
id: z.ZodString;
|
|
570
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
571
|
+
if: z.ZodOptional<z.ZodString>;
|
|
572
|
+
type: z.ZodLiteral<"transform">;
|
|
573
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
574
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
575
|
+
id: z.ZodString;
|
|
576
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
577
|
+
if: z.ZodOptional<z.ZodString>;
|
|
578
|
+
type: z.ZodLiteral<"output">;
|
|
579
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
580
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
581
|
+
id: z.ZodString;
|
|
582
|
+
type: z.ZodLiteral<"activity">;
|
|
583
|
+
activity: z.ZodString;
|
|
584
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
585
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
586
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
587
|
+
id: z.ZodString;
|
|
588
|
+
type: z.ZodLiteral<"agent">;
|
|
589
|
+
agent: z.ZodString;
|
|
590
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
591
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
592
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
593
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
594
|
+
id: z.ZodString;
|
|
595
|
+
type: z.ZodLiteral<"conditional">;
|
|
596
|
+
condition: z.ZodString;
|
|
597
|
+
then: z.ZodString;
|
|
598
|
+
else: z.ZodOptional<z.ZodString>;
|
|
599
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
600
|
+
id: z.ZodString;
|
|
601
|
+
type: z.ZodLiteral<"transform">;
|
|
602
|
+
set: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
603
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
604
|
+
id: z.ZodString;
|
|
605
|
+
type: z.ZodLiteral<"output">;
|
|
606
|
+
value: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
607
|
+
}, z.core.$strip>]>;
|
|
608
|
+
export type LegacyActivityStage = z.infer<typeof LegacyActivityStageZ>;
|
|
609
|
+
export type LegacyAgentStage = z.infer<typeof LegacyAgentStageZ>;
|
|
610
|
+
export type LegacyConditionalStage = z.infer<typeof LegacyConditionalStageZ>;
|
|
611
|
+
export type LegacyTransformStage = z.infer<typeof LegacyTransformStageZ>;
|
|
612
|
+
export type LegacyOutputStage = z.infer<typeof LegacyOutputStageZ>;
|
|
613
|
+
export type StageWithLegacy = z.infer<typeof StageWithLegacyZ>;
|
|
614
|
+
/**
|
|
615
|
+
* Inline agent definition - full agent definition embedded in a multi-stage pipeline.
|
|
616
|
+
* Contains all fields needed to create/run the agent.
|
|
617
|
+
*/
|
|
618
|
+
declare const InlineAgentDefinitionZ: z.ZodObject<{
|
|
619
|
+
handle: z.ZodString;
|
|
620
|
+
name: z.ZodString;
|
|
621
|
+
description: z.ZodString;
|
|
622
|
+
system: z.ZodString;
|
|
623
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
624
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
625
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
626
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
627
|
+
tool: z.ZodString;
|
|
628
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
629
|
+
name: z.ZodOptional<z.ZodString>;
|
|
630
|
+
description: z.ZodOptional<z.ZodString>;
|
|
631
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
632
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
633
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
634
|
+
}>>;
|
|
635
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
636
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
637
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
638
|
+
name: z.ZodString;
|
|
639
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
640
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
641
|
+
description: z.ZodOptional<z.ZodString>;
|
|
642
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
643
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
644
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
645
|
+
}>>;
|
|
646
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
647
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
648
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
649
|
+
name: z.ZodString;
|
|
650
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
651
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
652
|
+
description: z.ZodOptional<z.ZodString>;
|
|
653
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
654
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
655
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
656
|
+
}>>;
|
|
657
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
658
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
659
|
+
kind: z.ZodLiteral<"MCP">;
|
|
660
|
+
server: z.ZodString;
|
|
661
|
+
tool: z.ZodString;
|
|
662
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
663
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
664
|
+
description: z.ZodOptional<z.ZodString>;
|
|
665
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
666
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
667
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
668
|
+
}>>;
|
|
669
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
670
|
+
}, z.core.$strip>]>]>>>;
|
|
671
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
672
|
+
}, z.core.$strip>;
|
|
673
|
+
export type InlineAgentDefinition = z.infer<typeof InlineAgentDefinitionZ>;
|
|
674
|
+
/**
|
|
675
|
+
* Agent input option for select-type inputs.
|
|
676
|
+
*/
|
|
677
|
+
declare const AgentInputOptionZ: z.ZodObject<{
|
|
678
|
+
value: z.ZodString;
|
|
679
|
+
label: z.ZodString;
|
|
680
|
+
}, z.core.$strip>;
|
|
681
|
+
/**
|
|
682
|
+
* Agent input field definition for UI collection.
|
|
683
|
+
* These inputs are collected from the user before the agent runs.
|
|
684
|
+
*/
|
|
685
|
+
declare const AgentInputFieldZ: z.ZodObject<{
|
|
686
|
+
key: z.ZodString;
|
|
687
|
+
label: z.ZodOptional<z.ZodString>;
|
|
688
|
+
description: z.ZodOptional<z.ZodString>;
|
|
689
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
691
|
+
number: "number";
|
|
692
|
+
text: "text";
|
|
693
|
+
textarea: "textarea";
|
|
694
|
+
select: "select";
|
|
695
|
+
}>>;
|
|
696
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
697
|
+
value: z.ZodString;
|
|
698
|
+
label: z.ZodString;
|
|
699
|
+
}, z.core.$strip>>>;
|
|
700
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
701
|
+
}, z.core.$strip>;
|
|
702
|
+
export type AgentInputOption = z.infer<typeof AgentInputOptionZ>;
|
|
703
|
+
export type AgentInputField = z.infer<typeof AgentInputFieldZ>;
|
|
704
|
+
/**
|
|
705
|
+
* Persona voice format configuration for message formatting rules.
|
|
706
|
+
*/
|
|
707
|
+
declare const PersonaVoiceFormatZ: z.ZodObject<{
|
|
708
|
+
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
709
|
+
noEmojis: z.ZodOptional<z.ZodBoolean>;
|
|
710
|
+
noHyphens: z.ZodOptional<z.ZodBoolean>;
|
|
711
|
+
noBulletPoints: z.ZodOptional<z.ZodBoolean>;
|
|
712
|
+
maxQuestionsPerMessage: z.ZodOptional<z.ZodNumber>;
|
|
713
|
+
noSignOffs: z.ZodOptional<z.ZodBoolean>;
|
|
714
|
+
}, z.core.$strip>;
|
|
715
|
+
/**
|
|
716
|
+
* Persona voice configuration for agent message styling.
|
|
717
|
+
*/
|
|
718
|
+
declare const PersonaVoiceZ: z.ZodObject<{
|
|
719
|
+
style: z.ZodString;
|
|
720
|
+
format: z.ZodOptional<z.ZodObject<{
|
|
721
|
+
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
722
|
+
noEmojis: z.ZodOptional<z.ZodBoolean>;
|
|
723
|
+
noHyphens: z.ZodOptional<z.ZodBoolean>;
|
|
724
|
+
noBulletPoints: z.ZodOptional<z.ZodBoolean>;
|
|
725
|
+
maxQuestionsPerMessage: z.ZodOptional<z.ZodNumber>;
|
|
726
|
+
noSignOffs: z.ZodOptional<z.ZodBoolean>;
|
|
727
|
+
}, z.core.$strip>>;
|
|
728
|
+
}, z.core.$strip>;
|
|
729
|
+
/**
|
|
730
|
+
* Persona configuration for agent voice and formatting.
|
|
731
|
+
*/
|
|
732
|
+
declare const PersonaZ: z.ZodObject<{
|
|
733
|
+
name: z.ZodString;
|
|
734
|
+
voice: z.ZodObject<{
|
|
735
|
+
style: z.ZodString;
|
|
736
|
+
format: z.ZodOptional<z.ZodObject<{
|
|
737
|
+
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
738
|
+
noEmojis: z.ZodOptional<z.ZodBoolean>;
|
|
739
|
+
noHyphens: z.ZodOptional<z.ZodBoolean>;
|
|
740
|
+
noBulletPoints: z.ZodOptional<z.ZodBoolean>;
|
|
741
|
+
maxQuestionsPerMessage: z.ZodOptional<z.ZodNumber>;
|
|
742
|
+
noSignOffs: z.ZodOptional<z.ZodBoolean>;
|
|
743
|
+
}, z.core.$strip>>;
|
|
744
|
+
}, z.core.$strip>;
|
|
745
|
+
}, z.core.$strip>;
|
|
746
|
+
export type PersonaVoiceFormat = z.infer<typeof PersonaVoiceFormatZ>;
|
|
747
|
+
export type PersonaVoice = z.infer<typeof PersonaVoiceZ>;
|
|
748
|
+
export type Persona = z.infer<typeof PersonaZ>;
|
|
749
|
+
/**
|
|
750
|
+
* Respond block for explicit message output.
|
|
751
|
+
* Must have either `content` (direct message) or `instructions` (persona transformation).
|
|
752
|
+
*/
|
|
753
|
+
declare const RespondBlockZ: z.ZodObject<{
|
|
754
|
+
if: z.ZodOptional<z.ZodString>;
|
|
755
|
+
content: z.ZodOptional<z.ZodString>;
|
|
756
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
757
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
758
|
+
}, z.core.$strip>;
|
|
759
|
+
export type RespondBlock = z.infer<typeof RespondBlockZ>;
|
|
760
|
+
/**
|
|
761
|
+
* Single-stage agent schema - traditional agent with system prompt and tools.
|
|
762
|
+
* This is the default agent type that runs the agentic loop.
|
|
763
|
+
*/
|
|
764
|
+
declare const SingleStageAgentZ: z.ZodObject<{
|
|
765
|
+
$schema: z.ZodOptional<z.ZodLiteral<"https://skedyul.com/schemas/agent/v1">>;
|
|
766
|
+
handle: z.ZodString;
|
|
767
|
+
name: z.ZodString;
|
|
768
|
+
description: z.ZodString;
|
|
769
|
+
isEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
770
|
+
system: z.ZodString;
|
|
771
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
772
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
773
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
774
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
775
|
+
tool: z.ZodString;
|
|
776
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
777
|
+
name: z.ZodOptional<z.ZodString>;
|
|
778
|
+
description: z.ZodOptional<z.ZodString>;
|
|
779
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
780
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
781
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
782
|
+
}>>;
|
|
783
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
784
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
785
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
786
|
+
name: z.ZodString;
|
|
787
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
788
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
789
|
+
description: z.ZodOptional<z.ZodString>;
|
|
790
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
791
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
792
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
793
|
+
}>>;
|
|
794
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
795
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
796
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
797
|
+
name: z.ZodString;
|
|
798
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
799
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
800
|
+
description: z.ZodOptional<z.ZodString>;
|
|
801
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
802
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
803
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
804
|
+
}>>;
|
|
805
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
806
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
807
|
+
kind: z.ZodLiteral<"MCP">;
|
|
808
|
+
server: z.ZodString;
|
|
809
|
+
tool: z.ZodString;
|
|
810
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
811
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
812
|
+
description: z.ZodOptional<z.ZodString>;
|
|
813
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
814
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
815
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
816
|
+
}>>;
|
|
817
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
818
|
+
}, z.core.$strip>]>]>>>;
|
|
819
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
820
|
+
key: z.ZodString;
|
|
821
|
+
label: z.ZodOptional<z.ZodString>;
|
|
822
|
+
description: z.ZodOptional<z.ZodString>;
|
|
823
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
824
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
825
|
+
number: "number";
|
|
826
|
+
text: "text";
|
|
827
|
+
textarea: "textarea";
|
|
828
|
+
select: "select";
|
|
829
|
+
}>>;
|
|
830
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
831
|
+
value: z.ZodString;
|
|
832
|
+
label: z.ZodString;
|
|
833
|
+
}, z.core.$strip>>>;
|
|
834
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
835
|
+
}, z.core.$strip>>>;
|
|
836
|
+
}, z.core.$strip>;
|
|
837
|
+
/**
|
|
838
|
+
* Multi-stage agent schema - orchestrates stages with inline agent definitions.
|
|
839
|
+
*
|
|
840
|
+
* Each agent stage contains its own agent definition inline, eliminating the need
|
|
841
|
+
* for a separate agents[] array. This makes the configuration more self-contained
|
|
842
|
+
* and easier to version.
|
|
843
|
+
*
|
|
844
|
+
* Stages are executed based on their 'needs' dependencies (DAG execution).
|
|
845
|
+
* Stages with no dependencies run first, then stages whose dependencies are met
|
|
846
|
+
* run in parallel waves until all stages complete.
|
|
847
|
+
*
|
|
848
|
+
* Message output is handled via the `system:threads:message:create` tool,
|
|
849
|
+
* which the agent can call to send messages to the thread. This decouples
|
|
850
|
+
* agent reasoning from message creation, giving operators visibility into
|
|
851
|
+
* the reasoning before any message is sent.
|
|
852
|
+
*/
|
|
853
|
+
declare const MultiStageAgentZ: z.ZodObject<{
|
|
854
|
+
$schema: z.ZodOptional<z.ZodLiteral<"https://skedyul.com/schemas/agent/v1">>;
|
|
855
|
+
handle: z.ZodString;
|
|
856
|
+
name: z.ZodString;
|
|
857
|
+
description: z.ZodString;
|
|
858
|
+
isEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
859
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
860
|
+
handle: z.ZodString;
|
|
861
|
+
name: z.ZodString;
|
|
862
|
+
description: z.ZodString;
|
|
863
|
+
system: z.ZodString;
|
|
864
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
865
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
866
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
867
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
868
|
+
tool: z.ZodString;
|
|
869
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
870
|
+
name: z.ZodOptional<z.ZodString>;
|
|
871
|
+
description: z.ZodOptional<z.ZodString>;
|
|
872
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
873
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
874
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
875
|
+
}>>;
|
|
876
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
877
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
878
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
879
|
+
name: z.ZodString;
|
|
880
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
881
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
882
|
+
description: z.ZodOptional<z.ZodString>;
|
|
883
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
884
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
885
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
886
|
+
}>>;
|
|
887
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
888
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
889
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
890
|
+
name: z.ZodString;
|
|
891
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
892
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
893
|
+
description: z.ZodOptional<z.ZodString>;
|
|
894
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
895
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
896
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
897
|
+
}>>;
|
|
898
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
899
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
900
|
+
kind: z.ZodLiteral<"MCP">;
|
|
901
|
+
server: z.ZodString;
|
|
902
|
+
tool: z.ZodString;
|
|
903
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
904
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
905
|
+
description: z.ZodOptional<z.ZodString>;
|
|
906
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
907
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
908
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
909
|
+
}>>;
|
|
910
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
911
|
+
}, z.core.$strip>]>]>>>;
|
|
912
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
913
|
+
}, z.core.$strip>>>;
|
|
914
|
+
stages: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
915
|
+
id: z.ZodString;
|
|
916
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
917
|
+
if: z.ZodOptional<z.ZodString>;
|
|
918
|
+
type: z.ZodLiteral<"tool">;
|
|
919
|
+
resource: z.ZodString;
|
|
920
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
921
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
922
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
923
|
+
id: z.ZodString;
|
|
924
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
925
|
+
if: z.ZodOptional<z.ZodString>;
|
|
926
|
+
type: z.ZodLiteral<"agent">;
|
|
927
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
928
|
+
handle: z.ZodString;
|
|
929
|
+
name: z.ZodString;
|
|
930
|
+
description: z.ZodOptional<z.ZodString>;
|
|
931
|
+
system: z.ZodString;
|
|
932
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
933
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
934
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
935
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
936
|
+
tool: z.ZodString;
|
|
937
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
938
|
+
name: z.ZodOptional<z.ZodString>;
|
|
939
|
+
description: z.ZodOptional<z.ZodString>;
|
|
940
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
941
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
942
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
943
|
+
}>>;
|
|
944
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
945
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
946
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
947
|
+
name: z.ZodString;
|
|
948
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
949
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
950
|
+
description: z.ZodOptional<z.ZodString>;
|
|
951
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
952
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
953
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
954
|
+
}>>;
|
|
955
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
956
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
957
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
958
|
+
name: z.ZodString;
|
|
959
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
960
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
961
|
+
description: z.ZodOptional<z.ZodString>;
|
|
962
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
963
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
964
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
965
|
+
}>>;
|
|
966
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
967
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
968
|
+
kind: z.ZodLiteral<"MCP">;
|
|
969
|
+
server: z.ZodString;
|
|
970
|
+
tool: z.ZodString;
|
|
971
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
972
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
973
|
+
description: z.ZodOptional<z.ZodString>;
|
|
974
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
975
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
976
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
977
|
+
}>>;
|
|
978
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
979
|
+
}, z.core.$strip>]>]>>>;
|
|
980
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
981
|
+
}, z.core.$strip>>;
|
|
982
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
983
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
984
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
985
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
986
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
987
|
+
id: z.ZodString;
|
|
988
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
989
|
+
if: z.ZodOptional<z.ZodString>;
|
|
990
|
+
type: z.ZodLiteral<"transform">;
|
|
991
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
992
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
993
|
+
id: z.ZodString;
|
|
994
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
995
|
+
if: z.ZodOptional<z.ZodString>;
|
|
996
|
+
type: z.ZodLiteral<"output">;
|
|
997
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
998
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
999
|
+
id: z.ZodString;
|
|
1000
|
+
type: z.ZodLiteral<"activity">;
|
|
1001
|
+
activity: z.ZodString;
|
|
1002
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1003
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1004
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1005
|
+
id: z.ZodString;
|
|
1006
|
+
type: z.ZodLiteral<"agent">;
|
|
1007
|
+
agent: z.ZodString;
|
|
1008
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
1009
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1010
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1011
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1012
|
+
id: z.ZodString;
|
|
1013
|
+
type: z.ZodLiteral<"conditional">;
|
|
1014
|
+
condition: z.ZodString;
|
|
1015
|
+
then: z.ZodString;
|
|
1016
|
+
else: z.ZodOptional<z.ZodString>;
|
|
1017
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1018
|
+
id: z.ZodString;
|
|
1019
|
+
type: z.ZodLiteral<"transform">;
|
|
1020
|
+
set: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1021
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1022
|
+
id: z.ZodString;
|
|
1023
|
+
type: z.ZodLiteral<"output">;
|
|
1024
|
+
value: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1025
|
+
}, z.core.$strip>]>>;
|
|
1026
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1027
|
+
type: z.ZodEnum<{
|
|
1028
|
+
string: "string";
|
|
1029
|
+
number: "number";
|
|
1030
|
+
boolean: "boolean";
|
|
1031
|
+
object: "object";
|
|
1032
|
+
array: "array";
|
|
1033
|
+
}>;
|
|
1034
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1035
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1036
|
+
}, z.core.$strip>>>;
|
|
1037
|
+
onError: z.ZodOptional<z.ZodEnum<{
|
|
1038
|
+
retry: "retry";
|
|
1039
|
+
fail: "fail";
|
|
1040
|
+
skip: "skip";
|
|
1041
|
+
}>>;
|
|
1042
|
+
persona: z.ZodOptional<z.ZodObject<{
|
|
1043
|
+
name: z.ZodString;
|
|
1044
|
+
voice: z.ZodObject<{
|
|
1045
|
+
style: z.ZodString;
|
|
1046
|
+
format: z.ZodOptional<z.ZodObject<{
|
|
1047
|
+
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
1048
|
+
noEmojis: z.ZodOptional<z.ZodBoolean>;
|
|
1049
|
+
noHyphens: z.ZodOptional<z.ZodBoolean>;
|
|
1050
|
+
noBulletPoints: z.ZodOptional<z.ZodBoolean>;
|
|
1051
|
+
maxQuestionsPerMessage: z.ZodOptional<z.ZodNumber>;
|
|
1052
|
+
noSignOffs: z.ZodOptional<z.ZodBoolean>;
|
|
1053
|
+
}, z.core.$strip>>;
|
|
1054
|
+
}, z.core.$strip>;
|
|
1055
|
+
}, z.core.$strip>>;
|
|
1056
|
+
respond: z.ZodOptional<z.ZodObject<{
|
|
1057
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1058
|
+
content: z.ZodOptional<z.ZodString>;
|
|
1059
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
1060
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
1061
|
+
}, z.core.$strip>>;
|
|
1062
|
+
}, z.core.$strip>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Unified agent schema - supports both single-stage and multi-stage agents.
|
|
1065
|
+
*
|
|
1066
|
+
* Single-stage agents have: system, tools, persona, personaName, llmModelId
|
|
1067
|
+
* Multi-stage agents have: stages, inputs, onError
|
|
1068
|
+
*
|
|
1069
|
+
* The presence of `stages` determines which type of agent this is.
|
|
1070
|
+
*/
|
|
1071
|
+
export declare const AgentSchemaZ: z.ZodUnion<readonly [z.ZodObject<{
|
|
1072
|
+
$schema: z.ZodOptional<z.ZodLiteral<"https://skedyul.com/schemas/agent/v1">>;
|
|
1073
|
+
handle: z.ZodString;
|
|
1074
|
+
name: z.ZodString;
|
|
1075
|
+
description: z.ZodString;
|
|
1076
|
+
isEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1077
|
+
system: z.ZodString;
|
|
1078
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
1079
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
1080
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
1081
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1082
|
+
tool: z.ZodString;
|
|
1083
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1084
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1085
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1086
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1087
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1088
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1089
|
+
}>>;
|
|
1090
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1091
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1092
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
1093
|
+
name: z.ZodString;
|
|
1094
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1095
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1096
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1097
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1098
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1099
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1100
|
+
}>>;
|
|
1101
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1103
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
1104
|
+
name: z.ZodString;
|
|
1105
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1106
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1107
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1108
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1109
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1110
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1111
|
+
}>>;
|
|
1112
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1114
|
+
kind: z.ZodLiteral<"MCP">;
|
|
1115
|
+
server: z.ZodString;
|
|
1116
|
+
tool: z.ZodString;
|
|
1117
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1118
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1120
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1121
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1122
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1123
|
+
}>>;
|
|
1124
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1125
|
+
}, z.core.$strip>]>]>>>;
|
|
1126
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1127
|
+
key: z.ZodString;
|
|
1128
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1129
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1130
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1131
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
1132
|
+
number: "number";
|
|
1133
|
+
text: "text";
|
|
1134
|
+
textarea: "textarea";
|
|
1135
|
+
select: "select";
|
|
1136
|
+
}>>;
|
|
1137
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1138
|
+
value: z.ZodString;
|
|
1139
|
+
label: z.ZodString;
|
|
1140
|
+
}, z.core.$strip>>>;
|
|
1141
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
1142
|
+
}, z.core.$strip>>>;
|
|
1143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1144
|
+
$schema: z.ZodOptional<z.ZodLiteral<"https://skedyul.com/schemas/agent/v1">>;
|
|
1145
|
+
handle: z.ZodString;
|
|
1146
|
+
name: z.ZodString;
|
|
1147
|
+
description: z.ZodString;
|
|
1148
|
+
isEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1149
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1150
|
+
handle: z.ZodString;
|
|
1151
|
+
name: z.ZodString;
|
|
1152
|
+
description: z.ZodString;
|
|
1153
|
+
system: z.ZodString;
|
|
1154
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
1155
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
1156
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
1157
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1158
|
+
tool: z.ZodString;
|
|
1159
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1160
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1161
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1162
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1163
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1164
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1165
|
+
}>>;
|
|
1166
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1167
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1168
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
1169
|
+
name: z.ZodString;
|
|
1170
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1171
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1172
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1173
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1174
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1175
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1176
|
+
}>>;
|
|
1177
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1179
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
1180
|
+
name: z.ZodString;
|
|
1181
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1182
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1183
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1184
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1185
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1186
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1187
|
+
}>>;
|
|
1188
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1190
|
+
kind: z.ZodLiteral<"MCP">;
|
|
1191
|
+
server: z.ZodString;
|
|
1192
|
+
tool: z.ZodString;
|
|
1193
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1194
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1196
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1197
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1198
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1199
|
+
}>>;
|
|
1200
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1201
|
+
}, z.core.$strip>]>]>>>;
|
|
1202
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1203
|
+
}, z.core.$strip>>>;
|
|
1204
|
+
stages: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1205
|
+
id: z.ZodString;
|
|
1206
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1207
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1208
|
+
type: z.ZodLiteral<"tool">;
|
|
1209
|
+
resource: z.ZodString;
|
|
1210
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1211
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1212
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1213
|
+
id: z.ZodString;
|
|
1214
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1215
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1216
|
+
type: z.ZodLiteral<"agent">;
|
|
1217
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
1218
|
+
handle: z.ZodString;
|
|
1219
|
+
name: z.ZodString;
|
|
1220
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1221
|
+
system: z.ZodString;
|
|
1222
|
+
personaName: z.ZodOptional<z.ZodString>;
|
|
1223
|
+
persona: z.ZodOptional<z.ZodString>;
|
|
1224
|
+
llmModelId: z.ZodOptional<z.ZodString>;
|
|
1225
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1226
|
+
tool: z.ZodString;
|
|
1227
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1228
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1229
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1230
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1231
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1232
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1233
|
+
}>>;
|
|
1234
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1235
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
1236
|
+
kind: z.ZodLiteral<"SYSTEM">;
|
|
1237
|
+
name: z.ZodString;
|
|
1238
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1239
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1240
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1241
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1242
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1243
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1244
|
+
}>>;
|
|
1245
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1246
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1247
|
+
kind: z.ZodLiteral<"AGENT">;
|
|
1248
|
+
name: z.ZodString;
|
|
1249
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1250
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1251
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1252
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1253
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1254
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1255
|
+
}>>;
|
|
1256
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1257
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1258
|
+
kind: z.ZodLiteral<"MCP">;
|
|
1259
|
+
server: z.ZodString;
|
|
1260
|
+
tool: z.ZodString;
|
|
1261
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
1262
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
1263
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1264
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
1265
|
+
ALLOW_ALL: "ALLOW_ALL";
|
|
1266
|
+
REQUIRE_APPROVAL: "REQUIRE_APPROVAL";
|
|
1267
|
+
}>>;
|
|
1268
|
+
approvalTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
1269
|
+
}, z.core.$strip>]>]>>>;
|
|
1270
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1271
|
+
}, z.core.$strip>>;
|
|
1272
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
1273
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
1274
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1275
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1276
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1277
|
+
id: z.ZodString;
|
|
1278
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1279
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1280
|
+
type: z.ZodLiteral<"transform">;
|
|
1281
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1282
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1283
|
+
id: z.ZodString;
|
|
1284
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1285
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1286
|
+
type: z.ZodLiteral<"output">;
|
|
1287
|
+
outputs: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1288
|
+
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
1289
|
+
id: z.ZodString;
|
|
1290
|
+
type: z.ZodLiteral<"activity">;
|
|
1291
|
+
activity: z.ZodString;
|
|
1292
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1293
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1294
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1295
|
+
id: z.ZodString;
|
|
1296
|
+
type: z.ZodLiteral<"agent">;
|
|
1297
|
+
agent: z.ZodString;
|
|
1298
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
1299
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1300
|
+
outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1301
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1302
|
+
id: z.ZodString;
|
|
1303
|
+
type: z.ZodLiteral<"conditional">;
|
|
1304
|
+
condition: z.ZodString;
|
|
1305
|
+
then: z.ZodString;
|
|
1306
|
+
else: z.ZodOptional<z.ZodString>;
|
|
1307
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1308
|
+
id: z.ZodString;
|
|
1309
|
+
type: z.ZodLiteral<"transform">;
|
|
1310
|
+
set: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1311
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1312
|
+
id: z.ZodString;
|
|
1313
|
+
type: z.ZodLiteral<"output">;
|
|
1314
|
+
value: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1315
|
+
}, z.core.$strip>]>>;
|
|
1316
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1317
|
+
type: z.ZodEnum<{
|
|
1318
|
+
string: "string";
|
|
1319
|
+
number: "number";
|
|
1320
|
+
boolean: "boolean";
|
|
1321
|
+
object: "object";
|
|
1322
|
+
array: "array";
|
|
1323
|
+
}>;
|
|
1324
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1325
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1326
|
+
}, z.core.$strip>>>;
|
|
1327
|
+
onError: z.ZodOptional<z.ZodEnum<{
|
|
1328
|
+
retry: "retry";
|
|
1329
|
+
fail: "fail";
|
|
1330
|
+
skip: "skip";
|
|
1331
|
+
}>>;
|
|
1332
|
+
persona: z.ZodOptional<z.ZodObject<{
|
|
1333
|
+
name: z.ZodString;
|
|
1334
|
+
voice: z.ZodObject<{
|
|
1335
|
+
style: z.ZodString;
|
|
1336
|
+
format: z.ZodOptional<z.ZodObject<{
|
|
1337
|
+
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
1338
|
+
noEmojis: z.ZodOptional<z.ZodBoolean>;
|
|
1339
|
+
noHyphens: z.ZodOptional<z.ZodBoolean>;
|
|
1340
|
+
noBulletPoints: z.ZodOptional<z.ZodBoolean>;
|
|
1341
|
+
maxQuestionsPerMessage: z.ZodOptional<z.ZodNumber>;
|
|
1342
|
+
noSignOffs: z.ZodOptional<z.ZodBoolean>;
|
|
1343
|
+
}, z.core.$strip>>;
|
|
1344
|
+
}, z.core.$strip>;
|
|
1345
|
+
}, z.core.$strip>>;
|
|
1346
|
+
respond: z.ZodOptional<z.ZodObject<{
|
|
1347
|
+
if: z.ZodOptional<z.ZodString>;
|
|
1348
|
+
content: z.ZodOptional<z.ZodString>;
|
|
1349
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
1350
|
+
requiresApproval: z.ZodOptional<z.ZodBoolean>;
|
|
1351
|
+
}, z.core.$strip>>;
|
|
1352
|
+
}, z.core.$strip>]>;
|
|
1353
|
+
export type SingleStageAgent = z.infer<typeof SingleStageAgentZ>;
|
|
1354
|
+
export type MultiStageAgent = z.infer<typeof MultiStageAgentZ>;
|
|
1355
|
+
export type AgentSchema = z.infer<typeof AgentSchemaZ>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Type guard to check if an agent is a multi-stage agent.
|
|
1358
|
+
*/
|
|
1359
|
+
export declare function isMultiStageAgent(agent: AgentSchema): agent is MultiStageAgent;
|
|
1360
|
+
/**
|
|
1361
|
+
* Type guard to check if an agent is a single-stage agent.
|
|
1362
|
+
*/
|
|
1363
|
+
export declare function isSingleStageAgent(agent: AgentSchema): agent is SingleStageAgent;
|
|
1364
|
+
/**
|
|
1365
|
+
* Define an agent with full type safety.
|
|
1366
|
+
* Use this in .agent.ts files for type checking and autocomplete.
|
|
1367
|
+
*
|
|
1368
|
+
* @example
|
|
1369
|
+
* ```typescript
|
|
1370
|
+
* import { defineAgent } from 'skedyul'
|
|
1371
|
+
*
|
|
1372
|
+
* export default defineAgent({
|
|
1373
|
+
* handle: 'sales-assistant',
|
|
1374
|
+
* name: 'Sales Assistant',
|
|
1375
|
+
* description: 'Helps with sales inquiries and lead qualification',
|
|
1376
|
+
* system: `You are a helpful sales assistant...`,
|
|
1377
|
+
* personaName: 'Alex',
|
|
1378
|
+
* persona: `Casual and friendly tone. Short sentences. Ask one question at a time.`,
|
|
1379
|
+
* tools: ['crm_search', 'send_email'],
|
|
1380
|
+
* })
|
|
1381
|
+
* ```
|
|
1382
|
+
*/
|
|
1383
|
+
export declare function defineAgent(agent: AgentSchema): AgentSchema;
|
|
1384
|
+
export interface AgentSchemaValidationResult {
|
|
1385
|
+
success: boolean;
|
|
1386
|
+
data?: AgentSchema;
|
|
1387
|
+
errors?: Array<{
|
|
1388
|
+
path: string;
|
|
1389
|
+
message: string;
|
|
1390
|
+
}>;
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Validate an agent schema and return detailed errors if invalid.
|
|
1394
|
+
*/
|
|
1395
|
+
export declare function validateAgentSchema(data: unknown): AgentSchemaValidationResult;
|
|
1396
|
+
/**
|
|
1397
|
+
* Parse an agent schema, throwing an error if invalid.
|
|
1398
|
+
*/
|
|
1399
|
+
export declare function parseAgentSchema(data: unknown): AgentSchema;
|
|
1400
|
+
/**
|
|
1401
|
+
* Safely parse an agent schema, returning null if invalid.
|
|
1402
|
+
*/
|
|
1403
|
+
export declare function safeParseAgentSchema(data: unknown): AgentSchema | null;
|
|
1404
|
+
/**
|
|
1405
|
+
* Parse agent YAML content into an AgentSchema.
|
|
1406
|
+
* Requires the `yaml` package to be installed.
|
|
1407
|
+
*/
|
|
1408
|
+
export declare function parseAgentYaml(yamlContent: string): Promise<AgentSchema>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Safely parse agent YAML content, returning null if invalid.
|
|
1411
|
+
*/
|
|
1412
|
+
export declare function safeParseAgentYaml(yamlContent: string): Promise<AgentSchema | null>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Serialize an AgentSchema to YAML format.
|
|
1415
|
+
*/
|
|
1416
|
+
export declare function serializeAgentToYaml(agent: AgentSchema): Promise<string>;
|
|
1417
|
+
/**
|
|
1418
|
+
* Result of a stage execution
|
|
1419
|
+
*/
|
|
1420
|
+
export interface StageResult {
|
|
1421
|
+
/** Execution status */
|
|
1422
|
+
status: 'completed' | 'skipped' | 'failed';
|
|
1423
|
+
/** Whether the stage was skipped due to 'if' condition being false */
|
|
1424
|
+
skipped?: boolean;
|
|
1425
|
+
/** Output values from the stage */
|
|
1426
|
+
outputs: Record<string, unknown>;
|
|
1427
|
+
/** Execution duration in milliseconds */
|
|
1428
|
+
durationMs?: number;
|
|
1429
|
+
/** Error message if status is 'failed' */
|
|
1430
|
+
error?: string;
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Context passed between stages in a multi-stage agent.
|
|
1434
|
+
*/
|
|
1435
|
+
export interface AgentContext {
|
|
1436
|
+
/** Immutable inputs passed to the agent */
|
|
1437
|
+
input: Record<string, unknown>;
|
|
1438
|
+
/** Stage results indexed by stage ID */
|
|
1439
|
+
stages: Record<string, StageResult>;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Normalize a stage from legacy format to the new unified schema.
|
|
1443
|
+
* This allows gradual migration while maintaining backward compatibility.
|
|
1444
|
+
*/
|
|
1445
|
+
export declare function normalizeStage(stage: StageWithLegacy): Stage | LegacyConditionalStage;
|
|
1446
|
+
/**
|
|
1447
|
+
* Normalize all stages in an array, converting legacy formats to new schema.
|
|
1448
|
+
*/
|
|
1449
|
+
export declare function normalizeStages(stages: StageWithLegacy[]): (Stage | LegacyConditionalStage)[];
|
|
1450
|
+
/**
|
|
1451
|
+
* Parsed resource reference with optional version pinning.
|
|
1452
|
+
*
|
|
1453
|
+
* Supports formats:
|
|
1454
|
+
* - `sales-clarifier` → latest version
|
|
1455
|
+
* - `sales-clarifier@latest` → explicitly latest version
|
|
1456
|
+
* - `sales-clarifier@v4` → pinned to version 4
|
|
1457
|
+
*/
|
|
1458
|
+
export interface ParsedResourceReference {
|
|
1459
|
+
/** The agent handle without version suffix */
|
|
1460
|
+
handle: string;
|
|
1461
|
+
/** The pinned version number (undefined if using latest) */
|
|
1462
|
+
version?: number;
|
|
1463
|
+
/** Whether this reference uses the latest version */
|
|
1464
|
+
isLatest: boolean;
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Parse a resource reference string that may include version pinning.
|
|
1468
|
+
*
|
|
1469
|
+
* Supported formats:
|
|
1470
|
+
* - `sales-clarifier` → { handle: "sales-clarifier", isLatest: true }
|
|
1471
|
+
* - `sales-clarifier@latest` → { handle: "sales-clarifier", isLatest: true }
|
|
1472
|
+
* - `sales-clarifier@v4` → { handle: "sales-clarifier", version: 4, isLatest: false }
|
|
1473
|
+
*
|
|
1474
|
+
* @example
|
|
1475
|
+
* parseResourceReference("sales-clarifier")
|
|
1476
|
+
* // → { handle: "sales-clarifier", isLatest: true }
|
|
1477
|
+
*
|
|
1478
|
+
* parseResourceReference("sales-clarifier@v4")
|
|
1479
|
+
* // → { handle: "sales-clarifier", version: 4, isLatest: false }
|
|
1480
|
+
*
|
|
1481
|
+
* parseResourceReference("sales-clarifier@latest")
|
|
1482
|
+
* // → { handle: "sales-clarifier", isLatest: true }
|
|
1483
|
+
*/
|
|
1484
|
+
export declare function parseResourceReference(resource: string): ParsedResourceReference;
|
|
1485
|
+
/**
|
|
1486
|
+
* Format a resource reference with version pinning.
|
|
1487
|
+
*
|
|
1488
|
+
* @example
|
|
1489
|
+
* formatResourceReference("sales-clarifier", 4)
|
|
1490
|
+
* // → "sales-clarifier@v4"
|
|
1491
|
+
*
|
|
1492
|
+
* formatResourceReference("sales-clarifier")
|
|
1493
|
+
* // → "sales-clarifier@latest"
|
|
1494
|
+
*/
|
|
1495
|
+
export declare function formatResourceReference(handle: string, version?: number): string;
|
|
1496
|
+
/**
|
|
1497
|
+
* Pin all agent stage resources in a multi-stage agent config to specific versions.
|
|
1498
|
+
* This is used during commit to lock versions for reproducibility.
|
|
1499
|
+
*
|
|
1500
|
+
* @param config - The agent config to update
|
|
1501
|
+
* @param versionMap - Map of agent handle to version number
|
|
1502
|
+
* @returns Updated config with pinned versions
|
|
1503
|
+
*/
|
|
1504
|
+
export declare function pinStageResourceVersions(config: AgentSchema, versionMap: Record<string, number>): AgentSchema;
|