@perstack/core 0.0.22 → 0.0.24

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.
@@ -1,109 +1,344 @@
1
+ import { ChildProcess } from 'node:child_process';
1
2
  import { z, ZodError, ZodSchema } from 'zod';
2
3
 
3
- declare const defaultPerstackApiBaseUrl = "https://api.perstack.ai";
4
- declare const organizationNameRegex: RegExp;
5
- declare const maxOrganizationNameLength = 128;
6
- declare const maxApplicationNameLength = 255;
7
- declare const expertKeyRegex: RegExp;
8
- declare const expertNameRegex: RegExp;
9
- declare const expertVersionRegex: RegExp;
10
- declare const tagNameRegex: RegExp;
11
- declare const maxExpertNameLength = 255;
12
- declare const maxExpertVersionTagLength = 255;
13
- declare const maxExpertKeyLength = 511;
14
- declare const maxExpertDescriptionLength: number;
15
- declare const maxExpertInstructionLength: number;
16
- declare const maxExpertSkillItems = 255;
17
- declare const maxExpertDelegateItems = 255;
18
- declare const maxExpertTagItems = 8;
19
- declare const defaultTemperature = 0;
20
- declare const defaultMaxSteps: undefined;
21
- declare const defaultMaxRetries = 5;
22
- declare const defaultTimeout: number;
23
- declare const maxExpertJobQueryLength: number;
24
- declare const maxExpertJobFileNameLength: number;
25
- declare const packageWithVersionRegex: RegExp;
26
- declare const urlSafeRegex: RegExp;
27
- declare const maxSkillNameLength = 255;
28
- declare const maxSkillDescriptionLength: number;
29
- declare const maxSkillRuleLength: number;
30
- declare const maxSkillPickOmitItems = 255;
31
- declare const maxSkillRequiredEnvItems = 255;
32
- declare const maxSkillToolNameLength = 255;
33
- declare const maxSkillEndpointLength: number;
34
- declare const maxSkillInputJsonSchemaLength: number;
35
- declare const maxSkillToolItems = 255;
36
- declare const maxCheckpointToolCallIdLength = 255;
37
- declare const envNameRegex: RegExp;
38
- declare const maxEnvNameLength = 255;
39
-
40
- declare const knownModels: {
41
- provider: string;
42
- models: {
43
- name: string;
44
- contextWindow: number;
45
- maxOutputTokens: number;
46
- }[];
47
- }[];
48
-
49
- /** Base properties shared by all message parts */
50
- interface BasePart {
51
- /** Unique identifier for this part */
52
- id: string;
4
+ /** MCP skill using stdio transport */
5
+ interface McpStdioSkill {
6
+ type: "mcpStdioSkill";
7
+ /** Skill name (derived from key) */
8
+ name: string;
9
+ /** Human-readable description */
10
+ description?: string;
11
+ /** Usage rules for the LLM */
12
+ rule?: string;
13
+ /** Tool names to include (whitelist) */
14
+ pick: string[];
15
+ /** Tool names to exclude (blacklist) */
16
+ omit: string[];
17
+ /** Command to execute (e.g., "npx") */
18
+ command: string;
19
+ /** Package name for npx/uvx */
20
+ packageName?: string;
21
+ /** Additional arguments */
22
+ args: string[];
23
+ /** Environment variables required by this skill */
24
+ requiredEnv: string[];
25
+ /** Whether to delay initialization until first use */
26
+ lazyInit: boolean;
53
27
  }
54
- declare const basePartSchema: z.ZodObject<{
55
- id: z.ZodString;
28
+ declare const mcpStdioSkillSchema: z.ZodObject<{
29
+ type: z.ZodLiteral<"mcpStdioSkill">;
30
+ name: z.ZodString;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ rule: z.ZodOptional<z.ZodString>;
33
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
34
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
35
+ command: z.ZodString;
36
+ packageName: z.ZodOptional<z.ZodString>;
37
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
38
+ requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
39
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
56
40
  }, z.core.$strip>;
57
- /** Plain text content */
58
- interface TextPart extends BasePart {
59
- type: "textPart";
60
- /** The text content */
61
- text: string;
41
+ /** MCP skill using SSE transport */
42
+ interface McpSseSkill {
43
+ type: "mcpSseSkill";
44
+ /** Skill name (derived from key) */
45
+ name: string;
46
+ /** Human-readable description */
47
+ description?: string;
48
+ /** Usage rules for the LLM */
49
+ rule?: string;
50
+ /** Tool names to include (whitelist) */
51
+ pick: string[];
52
+ /** Tool names to exclude (blacklist) */
53
+ omit: string[];
54
+ /** SSE endpoint URL */
55
+ endpoint: string;
62
56
  }
63
- declare const textPartSchema: z.ZodObject<{
64
- id: z.ZodString;
65
- type: z.ZodLiteral<"textPart">;
66
- text: z.ZodString;
57
+ declare const mcpSseSkillSchema: z.ZodObject<{
58
+ type: z.ZodLiteral<"mcpSseSkill">;
59
+ name: z.ZodString;
60
+ description: z.ZodOptional<z.ZodString>;
61
+ rule: z.ZodOptional<z.ZodString>;
62
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
63
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
64
+ endpoint: z.ZodString;
67
65
  }, z.core.$strip>;
68
- /** Image referenced by URL */
69
- interface ImageUrlPart extends BasePart {
70
- type: "imageUrlPart";
71
- /** URL to the image */
72
- url: string;
73
- /** MIME type of the image */
74
- mimeType: string;
66
+ /** Definition of an interactive tool within an interactive skill */
67
+ interface InteractiveTool {
68
+ /** Tool name */
69
+ name: string;
70
+ /** Human-readable description */
71
+ description?: string;
72
+ /** JSON Schema for tool input as a string */
73
+ inputJsonSchema: string;
75
74
  }
76
- declare const imageUrlPartSchema: z.ZodObject<{
77
- id: z.ZodString;
78
- type: z.ZodLiteral<"imageUrlPart">;
79
- url: z.ZodURL;
80
- mimeType: z.ZodString;
75
+ declare const interactiveToolSchema: z.ZodObject<{
76
+ name: z.ZodString;
77
+ description: z.ZodOptional<z.ZodString>;
78
+ inputJsonSchema: z.ZodString;
81
79
  }, z.core.$strip>;
82
- /** Image with base64-encoded inline data */
83
- interface ImageInlinePart extends BasePart {
84
- type: "imageInlinePart";
85
- /** Base64-encoded image data */
86
- encodedData: string;
87
- /** MIME type of the image */
88
- mimeType: string;
80
+ /** Skill that requires human interaction to complete tool calls */
81
+ interface InteractiveSkill {
82
+ type: "interactiveSkill";
83
+ /** Skill name (derived from key) */
84
+ name: string;
85
+ /** Human-readable description */
86
+ description?: string;
87
+ /** Usage rules for the LLM */
88
+ rule?: string;
89
+ /** Map of tool name to tool definition */
90
+ tools: Record<string, InteractiveTool>;
89
91
  }
90
- declare const imageInlinePartSchema: z.ZodObject<{
91
- id: z.ZodString;
92
- type: z.ZodLiteral<"imageInlinePart">;
93
- encodedData: z.ZodString;
94
- mimeType: z.ZodString;
92
+ declare const interactiveSkillSchema: z.ZodObject<{
93
+ type: z.ZodLiteral<"interactiveSkill">;
94
+ name: z.ZodString;
95
+ description: z.ZodOptional<z.ZodString>;
96
+ rule: z.ZodOptional<z.ZodString>;
97
+ tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
98
+ description: z.ZodOptional<z.ZodString>;
99
+ inputJsonSchema: z.ZodString;
100
+ }, z.core.$strip>>, z.ZodTransform<{
101
+ [k: string]: {
102
+ name: string;
103
+ inputJsonSchema: string;
104
+ description?: string | undefined;
105
+ };
106
+ }, Record<string, {
107
+ inputJsonSchema: string;
108
+ description?: string | undefined;
109
+ }>>>;
95
110
  }, z.core.$strip>;
96
- /** Image with binary data (internal use) */
97
- interface ImageBinaryPart extends BasePart {
98
- type: "imageBinaryPart";
99
- /** Binary data as string */
100
- data: string;
101
- /** MIME type of the image */
102
- mimeType: string;
111
+ /** All possible skill types */
112
+ type Skill = McpStdioSkill | McpSseSkill | InteractiveSkill;
113
+ declare const skillSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
114
+ type: z.ZodLiteral<"mcpStdioSkill">;
115
+ name: z.ZodString;
116
+ description: z.ZodOptional<z.ZodString>;
117
+ rule: z.ZodOptional<z.ZodString>;
118
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
119
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
120
+ command: z.ZodString;
121
+ packageName: z.ZodOptional<z.ZodString>;
122
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
123
+ requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
124
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ type: z.ZodLiteral<"mcpSseSkill">;
127
+ name: z.ZodString;
128
+ description: z.ZodOptional<z.ZodString>;
129
+ rule: z.ZodOptional<z.ZodString>;
130
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
131
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
132
+ endpoint: z.ZodString;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ type: z.ZodLiteral<"interactiveSkill">;
135
+ name: z.ZodString;
136
+ description: z.ZodOptional<z.ZodString>;
137
+ rule: z.ZodOptional<z.ZodString>;
138
+ tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
139
+ description: z.ZodOptional<z.ZodString>;
140
+ inputJsonSchema: z.ZodString;
141
+ }, z.core.$strip>>, z.ZodTransform<{
142
+ [k: string]: {
143
+ name: string;
144
+ inputJsonSchema: string;
145
+ description?: string | undefined;
146
+ };
147
+ }, Record<string, {
148
+ inputJsonSchema: string;
149
+ description?: string | undefined;
150
+ }>>>;
151
+ }, z.core.$strip>], "type">;
152
+
153
+ /**
154
+ * An Expert definition - an AI agent with specific skills and instructions.
155
+ * Experts can delegate to other Experts and use MCP tools.
156
+ */
157
+ interface Expert {
158
+ /** Unique key identifying this Expert (e.g., "my-expert" or "my-expert@1.0.0") */
159
+ key: string;
160
+ /** Display name for the Expert */
161
+ name: string;
162
+ /** Semantic version string */
163
+ version: string;
164
+ /** Human-readable description of what this Expert does */
165
+ description?: string;
166
+ /** System instruction defining the Expert's behavior */
167
+ instruction: string;
168
+ /** Map of skill name to skill configuration */
169
+ skills: Record<string, Skill>;
170
+ /** List of Expert keys this Expert can delegate to */
171
+ delegates: string[];
172
+ /** Tags for categorization and discovery */
173
+ tags: string[];
103
174
  }
104
- declare const imageBinaryPartSchema: z.ZodObject<{
105
- id: z.ZodString;
106
- type: z.ZodLiteral<"imageBinaryPart">;
175
+ declare const expertSchema: z.ZodObject<{
176
+ key: z.ZodString;
177
+ name: z.ZodString;
178
+ version: z.ZodString;
179
+ description: z.ZodOptional<z.ZodString>;
180
+ instruction: z.ZodString;
181
+ skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
182
+ type: z.ZodLiteral<"mcpStdioSkill">;
183
+ description: z.ZodOptional<z.ZodString>;
184
+ rule: z.ZodOptional<z.ZodString>;
185
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
186
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
187
+ command: z.ZodString;
188
+ packageName: z.ZodOptional<z.ZodString>;
189
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
190
+ requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
191
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ type: z.ZodLiteral<"mcpSseSkill">;
194
+ description: z.ZodOptional<z.ZodString>;
195
+ rule: z.ZodOptional<z.ZodString>;
196
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
197
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
198
+ endpoint: z.ZodString;
199
+ }, z.core.$strip>, z.ZodObject<{
200
+ type: z.ZodLiteral<"interactiveSkill">;
201
+ description: z.ZodOptional<z.ZodString>;
202
+ rule: z.ZodOptional<z.ZodString>;
203
+ tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
204
+ description: z.ZodOptional<z.ZodString>;
205
+ inputJsonSchema: z.ZodString;
206
+ }, z.core.$strip>>, z.ZodTransform<{
207
+ [k: string]: {
208
+ name: string;
209
+ inputJsonSchema: string;
210
+ description?: string | undefined;
211
+ };
212
+ }, Record<string, {
213
+ inputJsonSchema: string;
214
+ description?: string | undefined;
215
+ }>>>;
216
+ }, z.core.$strip>], "type">>>>, z.ZodTransform<{
217
+ [k: string]: {
218
+ type: "mcpStdioSkill";
219
+ name: string;
220
+ pick: string[];
221
+ omit: string[];
222
+ command: string;
223
+ args: string[];
224
+ requiredEnv: string[];
225
+ lazyInit: boolean;
226
+ description?: string | undefined;
227
+ rule?: string | undefined;
228
+ packageName?: string | undefined;
229
+ } | {
230
+ type: "mcpSseSkill";
231
+ name: string;
232
+ pick: string[];
233
+ omit: string[];
234
+ endpoint: string;
235
+ description?: string | undefined;
236
+ rule?: string | undefined;
237
+ } | {
238
+ type: "interactiveSkill";
239
+ name: string;
240
+ tools: {
241
+ [k: string]: {
242
+ name: string;
243
+ inputJsonSchema: string;
244
+ description?: string | undefined;
245
+ };
246
+ };
247
+ description?: string | undefined;
248
+ rule?: string | undefined;
249
+ };
250
+ }, Record<string, {
251
+ type: "mcpStdioSkill";
252
+ pick: string[];
253
+ omit: string[];
254
+ command: string;
255
+ args: string[];
256
+ requiredEnv: string[];
257
+ lazyInit: boolean;
258
+ description?: string | undefined;
259
+ rule?: string | undefined;
260
+ packageName?: string | undefined;
261
+ } | {
262
+ type: "mcpSseSkill";
263
+ pick: string[];
264
+ omit: string[];
265
+ endpoint: string;
266
+ description?: string | undefined;
267
+ rule?: string | undefined;
268
+ } | {
269
+ type: "interactiveSkill";
270
+ tools: {
271
+ [k: string]: {
272
+ name: string;
273
+ inputJsonSchema: string;
274
+ description?: string | undefined;
275
+ };
276
+ };
277
+ description?: string | undefined;
278
+ rule?: string | undefined;
279
+ }>>>;
280
+ delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
281
+ tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
282
+ }, z.core.$strip>;
283
+
284
+ /** Base properties shared by all message parts */
285
+ interface BasePart {
286
+ /** Unique identifier for this part */
287
+ id: string;
288
+ }
289
+ declare const basePartSchema: z.ZodObject<{
290
+ id: z.ZodString;
291
+ }, z.core.$strip>;
292
+ /** Plain text content */
293
+ interface TextPart extends BasePart {
294
+ type: "textPart";
295
+ /** The text content */
296
+ text: string;
297
+ }
298
+ declare const textPartSchema: z.ZodObject<{
299
+ id: z.ZodString;
300
+ type: z.ZodLiteral<"textPart">;
301
+ text: z.ZodString;
302
+ }, z.core.$strip>;
303
+ /** Image referenced by URL */
304
+ interface ImageUrlPart extends BasePart {
305
+ type: "imageUrlPart";
306
+ /** URL to the image */
307
+ url: string;
308
+ /** MIME type of the image */
309
+ mimeType: string;
310
+ }
311
+ declare const imageUrlPartSchema: z.ZodObject<{
312
+ id: z.ZodString;
313
+ type: z.ZodLiteral<"imageUrlPart">;
314
+ url: z.ZodURL;
315
+ mimeType: z.ZodString;
316
+ }, z.core.$strip>;
317
+ /** Image with base64-encoded inline data */
318
+ interface ImageInlinePart extends BasePart {
319
+ type: "imageInlinePart";
320
+ /** Base64-encoded image data */
321
+ encodedData: string;
322
+ /** MIME type of the image */
323
+ mimeType: string;
324
+ }
325
+ declare const imageInlinePartSchema: z.ZodObject<{
326
+ id: z.ZodString;
327
+ type: z.ZodLiteral<"imageInlinePart">;
328
+ encodedData: z.ZodString;
329
+ mimeType: z.ZodString;
330
+ }, z.core.$strip>;
331
+ /** Image with binary data (internal use) */
332
+ interface ImageBinaryPart extends BasePart {
333
+ type: "imageBinaryPart";
334
+ /** Binary data as string */
335
+ data: string;
336
+ /** MIME type of the image */
337
+ mimeType: string;
338
+ }
339
+ declare const imageBinaryPartSchema: z.ZodObject<{
340
+ id: z.ZodString;
341
+ type: z.ZodLiteral<"imageBinaryPart">;
107
342
  data: z.ZodString;
108
343
  mimeType: z.ZodString;
109
344
  }, z.core.$strip>;
@@ -488,6 +723,15 @@ declare const messageSchema: z.ZodUnion<readonly [z.ZodObject<{
488
723
  cache: z.ZodOptional<z.ZodBoolean>;
489
724
  }, z.core.$strip>]>;
490
725
 
726
+ type RuntimeName = "local" | "cursor" | "claude-code" | "gemini" | "docker";
727
+ declare const runtimeNameSchema: z.ZodEnum<{
728
+ local: "local";
729
+ cursor: "cursor";
730
+ "claude-code": "claude-code";
731
+ gemini: "gemini";
732
+ docker: "docker";
733
+ }>;
734
+
491
735
  /** A tool call made by an Expert during execution */
492
736
  interface ToolCall {
493
737
  /** Unique identifier for this tool call */
@@ -514,707 +758,320 @@ interface ToolResult {
514
758
  skillName: string;
515
759
  /** Name of the tool that was called */
516
760
  toolName: string;
517
- /** Content parts returned by the tool */
518
- result: MessagePart[];
519
- }
520
- declare const toolResultSchema: z.ZodObject<{
521
- id: z.ZodString;
522
- skillName: z.ZodString;
523
- toolName: z.ZodString;
524
- result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
525
- id: z.ZodString;
526
- type: z.ZodLiteral<"textPart">;
527
- text: z.ZodString;
528
- }, z.core.$strip>, z.ZodObject<{
529
- id: z.ZodString;
530
- type: z.ZodLiteral<"imageUrlPart">;
531
- url: z.ZodURL;
532
- mimeType: z.ZodString;
533
- }, z.core.$strip>, z.ZodObject<{
534
- id: z.ZodString;
535
- type: z.ZodLiteral<"imageInlinePart">;
536
- encodedData: z.ZodString;
537
- mimeType: z.ZodString;
538
- }, z.core.$strip>, z.ZodObject<{
539
- id: z.ZodString;
540
- type: z.ZodLiteral<"imageBinaryPart">;
541
- data: z.ZodString;
542
- mimeType: z.ZodString;
543
- }, z.core.$strip>, z.ZodObject<{
544
- id: z.ZodString;
545
- type: z.ZodLiteral<"fileUrlPart">;
546
- url: z.ZodString;
547
- mimeType: z.ZodString;
548
- }, z.core.$strip>, z.ZodObject<{
549
- id: z.ZodString;
550
- type: z.ZodLiteral<"fileInlinePart">;
551
- encodedData: z.ZodString;
552
- mimeType: z.ZodString;
553
- }, z.core.$strip>, z.ZodObject<{
554
- id: z.ZodString;
555
- type: z.ZodLiteral<"fileBinaryPart">;
556
- data: z.ZodString;
557
- mimeType: z.ZodString;
558
- }, z.core.$strip>, z.ZodObject<{
559
- id: z.ZodString;
560
- type: z.ZodLiteral<"toolCallPart">;
561
- toolCallId: z.ZodString;
562
- toolName: z.ZodString;
563
- args: z.ZodUnknown;
564
- }, z.core.$strip>, z.ZodObject<{
565
- id: z.ZodString;
566
- type: z.ZodLiteral<"toolResultPart">;
567
- toolCallId: z.ZodString;
568
- toolName: z.ZodString;
569
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
570
- id: z.ZodString;
571
- type: z.ZodLiteral<"textPart">;
572
- text: z.ZodString;
573
- }, z.core.$strip>, z.ZodObject<{
574
- id: z.ZodString;
575
- type: z.ZodLiteral<"imageInlinePart">;
576
- encodedData: z.ZodString;
577
- mimeType: z.ZodString;
578
- }, z.core.$strip>, z.ZodObject<{
579
- id: z.ZodString;
580
- type: z.ZodLiteral<"fileInlinePart">;
581
- encodedData: z.ZodString;
582
- mimeType: z.ZodString;
583
- }, z.core.$strip>]>>;
584
- isError: z.ZodOptional<z.ZodBoolean>;
585
- }, z.core.$strip>], "type">>;
586
- }, z.core.$strip>;
587
-
588
- /** Token usage statistics for a single step or run */
589
- interface Usage {
590
- /** Number of tokens in the input prompt */
591
- inputTokens: number;
592
- /** Number of tokens generated in the response */
593
- outputTokens: number;
594
- /** Number of tokens used for reasoning (extended thinking) */
595
- reasoningTokens: number;
596
- /** Total tokens (input + output) */
597
- totalTokens: number;
598
- /** Number of input tokens served from cache */
599
- cachedInputTokens: number;
600
- }
601
- declare const usageSchema: z.ZodObject<{
602
- inputTokens: z.ZodNumber;
603
- outputTokens: z.ZodNumber;
604
- reasoningTokens: z.ZodNumber;
605
- totalTokens: z.ZodNumber;
606
- cachedInputTokens: z.ZodNumber;
607
- }, z.core.$strip>;
608
-
609
- /** Status of a checkpoint in the execution lifecycle */
610
- type CheckpointStatus = "init" | "proceeding" | "completed" | "stoppedByInteractiveTool" | "stoppedByDelegate" | "stoppedByExceededMaxSteps" | "stoppedByError";
611
- declare const checkpointStatusSchema: z.ZodEnum<{
612
- init: "init";
613
- proceeding: "proceeding";
614
- completed: "completed";
615
- stoppedByInteractiveTool: "stoppedByInteractiveTool";
616
- stoppedByDelegate: "stoppedByDelegate";
617
- stoppedByExceededMaxSteps: "stoppedByExceededMaxSteps";
618
- stoppedByError: "stoppedByError";
619
- }>;
620
- /** Information about a delegation target */
621
- interface DelegationTarget {
622
- expert: {
623
- key: string;
624
- name: string;
625
- version: string;
626
- };
627
- toolCallId: string;
628
- toolName: string;
629
- query: string;
630
- }
631
- /**
632
- * A checkpoint represents a point-in-time snapshot of an Expert's execution state.
633
- * Used for resuming, debugging, and observability.
634
- */
635
- interface Checkpoint {
636
- /** Unique identifier for this checkpoint */
637
- id: string;
638
- /** Job ID this checkpoint belongs to */
639
- jobId: string;
640
- /** Run ID this checkpoint belongs to */
641
- runId: string;
642
- /** Current execution status */
643
- status: CheckpointStatus;
644
- /** Current step number within this Run */
645
- stepNumber: number;
646
- /** All messages in the conversation so far */
647
- messages: Message[];
648
- /** Expert executing this checkpoint */
649
- expert: {
650
- /** Expert key (e.g., "my-expert@1.0.0") */
651
- key: string;
652
- /** Expert name */
653
- name: string;
654
- /** Expert version */
655
- version: string;
656
- };
657
- /** If delegating, information about the target Expert(s) - supports parallel delegation */
658
- delegateTo?: DelegationTarget[];
659
- /** If delegated, information about the parent Expert */
660
- delegatedBy?: {
661
- /** The parent Expert that delegated */
662
- expert: {
663
- key: string;
664
- name: string;
665
- version: string;
666
- };
667
- /** Tool call ID from the parent */
668
- toolCallId: string;
669
- /** Name of the delegation tool */
670
- toolName: string;
671
- /** Checkpoint ID of the parent */
672
- checkpointId: string;
673
- };
674
- /** Accumulated token usage */
675
- usage: Usage;
676
- /** Model's context window size in tokens */
677
- contextWindow?: number;
678
- /** Context window usage ratio (0-1) */
679
- contextWindowUsage?: number;
680
- /** Tool calls waiting to be processed (for resume after delegate/interactive) */
681
- pendingToolCalls?: ToolCall[];
682
- /** Partial tool results collected before stopping (for resume) */
683
- partialToolResults?: ToolResult[];
684
- }
685
- declare const delegationTargetSchema: z.ZodObject<{
686
- expert: z.ZodObject<{
687
- key: z.ZodString;
688
- name: z.ZodString;
689
- version: z.ZodString;
690
- }, z.core.$strip>;
691
- toolCallId: z.ZodString;
692
- toolName: z.ZodString;
693
- query: z.ZodString;
694
- }, z.core.$strip>;
695
- declare const checkpointSchema: z.ZodObject<{
696
- id: z.ZodString;
697
- jobId: z.ZodString;
698
- runId: z.ZodString;
699
- status: z.ZodEnum<{
700
- init: "init";
701
- proceeding: "proceeding";
702
- completed: "completed";
703
- stoppedByInteractiveTool: "stoppedByInteractiveTool";
704
- stoppedByDelegate: "stoppedByDelegate";
705
- stoppedByExceededMaxSteps: "stoppedByExceededMaxSteps";
706
- stoppedByError: "stoppedByError";
707
- }>;
708
- stepNumber: z.ZodNumber;
709
- messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
710
- id: z.ZodString;
711
- type: z.ZodLiteral<"instructionMessage">;
712
- contents: z.ZodArray<z.ZodObject<{
713
- id: z.ZodString;
714
- type: z.ZodLiteral<"textPart">;
715
- text: z.ZodString;
716
- }, z.core.$strip>>;
717
- cache: z.ZodOptional<z.ZodBoolean>;
718
- }, z.core.$strip>, z.ZodObject<{
719
- id: z.ZodString;
720
- type: z.ZodLiteral<"userMessage">;
721
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
722
- id: z.ZodString;
723
- type: z.ZodLiteral<"textPart">;
724
- text: z.ZodString;
725
- }, z.core.$strip>, z.ZodObject<{
726
- id: z.ZodString;
727
- type: z.ZodLiteral<"imageUrlPart">;
728
- url: z.ZodURL;
729
- mimeType: z.ZodString;
730
- }, z.core.$strip>, z.ZodObject<{
731
- id: z.ZodString;
732
- type: z.ZodLiteral<"imageInlinePart">;
733
- encodedData: z.ZodString;
734
- mimeType: z.ZodString;
735
- }, z.core.$strip>, z.ZodObject<{
736
- id: z.ZodString;
737
- type: z.ZodLiteral<"imageBinaryPart">;
738
- data: z.ZodString;
739
- mimeType: z.ZodString;
740
- }, z.core.$strip>, z.ZodObject<{
741
- id: z.ZodString;
742
- type: z.ZodLiteral<"fileUrlPart">;
743
- url: z.ZodString;
744
- mimeType: z.ZodString;
745
- }, z.core.$strip>, z.ZodObject<{
746
- id: z.ZodString;
747
- type: z.ZodLiteral<"fileInlinePart">;
748
- encodedData: z.ZodString;
749
- mimeType: z.ZodString;
750
- }, z.core.$strip>, z.ZodObject<{
751
- id: z.ZodString;
752
- type: z.ZodLiteral<"fileBinaryPart">;
753
- data: z.ZodString;
754
- mimeType: z.ZodString;
755
- }, z.core.$strip>]>>;
756
- cache: z.ZodOptional<z.ZodBoolean>;
757
- }, z.core.$strip>, z.ZodObject<{
758
- id: z.ZodString;
759
- type: z.ZodLiteral<"expertMessage">;
760
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
761
- id: z.ZodString;
762
- type: z.ZodLiteral<"textPart">;
763
- text: z.ZodString;
764
- }, z.core.$strip>, z.ZodObject<{
765
- id: z.ZodString;
766
- type: z.ZodLiteral<"toolCallPart">;
767
- toolCallId: z.ZodString;
768
- toolName: z.ZodString;
769
- args: z.ZodUnknown;
770
- }, z.core.$strip>]>>;
771
- cache: z.ZodOptional<z.ZodBoolean>;
772
- }, z.core.$strip>, z.ZodObject<{
773
- id: z.ZodString;
774
- type: z.ZodLiteral<"toolMessage">;
775
- contents: z.ZodArray<z.ZodObject<{
776
- id: z.ZodString;
777
- type: z.ZodLiteral<"toolResultPart">;
778
- toolCallId: z.ZodString;
779
- toolName: z.ZodString;
780
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
781
- id: z.ZodString;
782
- type: z.ZodLiteral<"textPart">;
783
- text: z.ZodString;
784
- }, z.core.$strip>, z.ZodObject<{
785
- id: z.ZodString;
786
- type: z.ZodLiteral<"imageInlinePart">;
787
- encodedData: z.ZodString;
788
- mimeType: z.ZodString;
789
- }, z.core.$strip>, z.ZodObject<{
790
- id: z.ZodString;
791
- type: z.ZodLiteral<"fileInlinePart">;
792
- encodedData: z.ZodString;
793
- mimeType: z.ZodString;
794
- }, z.core.$strip>]>>;
795
- isError: z.ZodOptional<z.ZodBoolean>;
796
- }, z.core.$strip>>;
797
- cache: z.ZodOptional<z.ZodBoolean>;
798
- }, z.core.$strip>]>>;
799
- expert: z.ZodObject<{
800
- key: z.ZodString;
801
- name: z.ZodString;
802
- version: z.ZodString;
803
- }, z.core.$strip>;
804
- delegateTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
805
- expert: z.ZodObject<{
806
- key: z.ZodString;
807
- name: z.ZodString;
808
- version: z.ZodString;
809
- }, z.core.$strip>;
810
- toolCallId: z.ZodString;
811
- toolName: z.ZodString;
812
- query: z.ZodString;
813
- }, z.core.$strip>>>;
814
- delegatedBy: z.ZodOptional<z.ZodObject<{
815
- expert: z.ZodObject<{
816
- key: z.ZodString;
817
- name: z.ZodString;
818
- version: z.ZodString;
819
- }, z.core.$strip>;
820
- toolCallId: z.ZodString;
821
- toolName: z.ZodString;
822
- checkpointId: z.ZodString;
823
- }, z.core.$strip>>;
824
- usage: z.ZodObject<{
825
- inputTokens: z.ZodNumber;
826
- outputTokens: z.ZodNumber;
827
- reasoningTokens: z.ZodNumber;
828
- totalTokens: z.ZodNumber;
829
- cachedInputTokens: z.ZodNumber;
830
- }, z.core.$strip>;
831
- contextWindow: z.ZodOptional<z.ZodNumber>;
832
- contextWindowUsage: z.ZodOptional<z.ZodNumber>;
833
- pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
834
- id: z.ZodString;
835
- skillName: z.ZodString;
836
- toolName: z.ZodString;
837
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
838
- }, z.core.$strip>>>;
839
- partialToolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
840
- id: z.ZodString;
841
- skillName: z.ZodString;
842
- toolName: z.ZodString;
843
- result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
844
- id: z.ZodString;
845
- type: z.ZodLiteral<"textPart">;
846
- text: z.ZodString;
847
- }, z.core.$strip>, z.ZodObject<{
848
- id: z.ZodString;
849
- type: z.ZodLiteral<"imageUrlPart">;
850
- url: z.ZodURL;
851
- mimeType: z.ZodString;
852
- }, z.core.$strip>, z.ZodObject<{
853
- id: z.ZodString;
854
- type: z.ZodLiteral<"imageInlinePart">;
855
- encodedData: z.ZodString;
856
- mimeType: z.ZodString;
857
- }, z.core.$strip>, z.ZodObject<{
858
- id: z.ZodString;
859
- type: z.ZodLiteral<"imageBinaryPart">;
860
- data: z.ZodString;
861
- mimeType: z.ZodString;
862
- }, z.core.$strip>, z.ZodObject<{
863
- id: z.ZodString;
864
- type: z.ZodLiteral<"fileUrlPart">;
865
- url: z.ZodString;
866
- mimeType: z.ZodString;
867
- }, z.core.$strip>, z.ZodObject<{
868
- id: z.ZodString;
869
- type: z.ZodLiteral<"fileInlinePart">;
870
- encodedData: z.ZodString;
871
- mimeType: z.ZodString;
872
- }, z.core.$strip>, z.ZodObject<{
873
- id: z.ZodString;
874
- type: z.ZodLiteral<"fileBinaryPart">;
875
- data: z.ZodString;
876
- mimeType: z.ZodString;
877
- }, z.core.$strip>, z.ZodObject<{
878
- id: z.ZodString;
879
- type: z.ZodLiteral<"toolCallPart">;
880
- toolCallId: z.ZodString;
881
- toolName: z.ZodString;
882
- args: z.ZodUnknown;
883
- }, z.core.$strip>, z.ZodObject<{
884
- id: z.ZodString;
885
- type: z.ZodLiteral<"toolResultPart">;
886
- toolCallId: z.ZodString;
887
- toolName: z.ZodString;
888
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
889
- id: z.ZodString;
890
- type: z.ZodLiteral<"textPart">;
891
- text: z.ZodString;
892
- }, z.core.$strip>, z.ZodObject<{
893
- id: z.ZodString;
894
- type: z.ZodLiteral<"imageInlinePart">;
895
- encodedData: z.ZodString;
896
- mimeType: z.ZodString;
897
- }, z.core.$strip>, z.ZodObject<{
898
- id: z.ZodString;
899
- type: z.ZodLiteral<"fileInlinePart">;
900
- encodedData: z.ZodString;
901
- mimeType: z.ZodString;
902
- }, z.core.$strip>]>>;
903
- isError: z.ZodOptional<z.ZodBoolean>;
904
- }, z.core.$strip>], "type">>;
905
- }, z.core.$strip>>>;
906
- }, z.core.$strip>;
907
-
908
- /** MCP skill using stdio transport */
909
- interface McpStdioSkill {
910
- type: "mcpStdioSkill";
911
- /** Skill name (derived from key) */
912
- name: string;
913
- /** Human-readable description */
914
- description?: string;
915
- /** Usage rules for the LLM */
916
- rule?: string;
917
- /** Tool names to include (whitelist) */
918
- pick: string[];
919
- /** Tool names to exclude (blacklist) */
920
- omit: string[];
921
- /** Command to execute (e.g., "npx") */
922
- command: string;
923
- /** Package name for npx/uvx */
924
- packageName?: string;
925
- /** Additional arguments */
926
- args: string[];
927
- /** Environment variables required by this skill */
928
- requiredEnv: string[];
929
- /** Whether to delay initialization until first use */
930
- lazyInit: boolean;
931
- }
932
- declare const mcpStdioSkillSchema: z.ZodObject<{
933
- type: z.ZodLiteral<"mcpStdioSkill">;
934
- name: z.ZodString;
935
- description: z.ZodOptional<z.ZodString>;
936
- rule: z.ZodOptional<z.ZodString>;
937
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
938
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
939
- command: z.ZodString;
940
- packageName: z.ZodOptional<z.ZodString>;
941
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
942
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
943
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
944
- }, z.core.$strip>;
945
- /** MCP skill using SSE transport */
946
- interface McpSseSkill {
947
- type: "mcpSseSkill";
948
- /** Skill name (derived from key) */
949
- name: string;
950
- /** Human-readable description */
951
- description?: string;
952
- /** Usage rules for the LLM */
953
- rule?: string;
954
- /** Tool names to include (whitelist) */
955
- pick: string[];
956
- /** Tool names to exclude (blacklist) */
957
- omit: string[];
958
- /** SSE endpoint URL */
959
- endpoint: string;
960
- }
961
- declare const mcpSseSkillSchema: z.ZodObject<{
962
- type: z.ZodLiteral<"mcpSseSkill">;
963
- name: z.ZodString;
964
- description: z.ZodOptional<z.ZodString>;
965
- rule: z.ZodOptional<z.ZodString>;
966
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
967
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
968
- endpoint: z.ZodString;
969
- }, z.core.$strip>;
970
- /** Definition of an interactive tool within an interactive skill */
971
- interface InteractiveTool {
972
- /** Tool name */
973
- name: string;
974
- /** Human-readable description */
975
- description?: string;
976
- /** JSON Schema for tool input as a string */
977
- inputJsonSchema: string;
978
- }
979
- declare const interactiveToolSchema: z.ZodObject<{
980
- name: z.ZodString;
981
- description: z.ZodOptional<z.ZodString>;
982
- inputJsonSchema: z.ZodString;
983
- }, z.core.$strip>;
984
- /** Skill that requires human interaction to complete tool calls */
985
- interface InteractiveSkill {
986
- type: "interactiveSkill";
987
- /** Skill name (derived from key) */
988
- name: string;
989
- /** Human-readable description */
990
- description?: string;
991
- /** Usage rules for the LLM */
992
- rule?: string;
993
- /** Map of tool name to tool definition */
994
- tools: Record<string, InteractiveTool>;
995
- }
996
- declare const interactiveSkillSchema: z.ZodObject<{
997
- type: z.ZodLiteral<"interactiveSkill">;
998
- name: z.ZodString;
999
- description: z.ZodOptional<z.ZodString>;
1000
- rule: z.ZodOptional<z.ZodString>;
1001
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1002
- description: z.ZodOptional<z.ZodString>;
1003
- inputJsonSchema: z.ZodString;
1004
- }, z.core.$strip>>, z.ZodTransform<{
1005
- [k: string]: {
1006
- name: string;
1007
- inputJsonSchema: string;
1008
- description?: string | undefined;
1009
- };
1010
- }, Record<string, {
1011
- inputJsonSchema: string;
1012
- description?: string | undefined;
1013
- }>>>;
1014
- }, z.core.$strip>;
1015
- /** All possible skill types */
1016
- type Skill = McpStdioSkill | McpSseSkill | InteractiveSkill;
1017
- declare const skillSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1018
- type: z.ZodLiteral<"mcpStdioSkill">;
1019
- name: z.ZodString;
1020
- description: z.ZodOptional<z.ZodString>;
1021
- rule: z.ZodOptional<z.ZodString>;
1022
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1023
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1024
- command: z.ZodString;
1025
- packageName: z.ZodOptional<z.ZodString>;
1026
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1027
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1028
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1029
- }, z.core.$strip>, z.ZodObject<{
1030
- type: z.ZodLiteral<"mcpSseSkill">;
1031
- name: z.ZodString;
1032
- description: z.ZodOptional<z.ZodString>;
1033
- rule: z.ZodOptional<z.ZodString>;
1034
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1035
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1036
- endpoint: z.ZodString;
1037
- }, z.core.$strip>, z.ZodObject<{
1038
- type: z.ZodLiteral<"interactiveSkill">;
1039
- name: z.ZodString;
1040
- description: z.ZodOptional<z.ZodString>;
1041
- rule: z.ZodOptional<z.ZodString>;
1042
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1043
- description: z.ZodOptional<z.ZodString>;
1044
- inputJsonSchema: z.ZodString;
1045
- }, z.core.$strip>>, z.ZodTransform<{
1046
- [k: string]: {
1047
- name: string;
1048
- inputJsonSchema: string;
1049
- description?: string | undefined;
1050
- };
1051
- }, Record<string, {
1052
- inputJsonSchema: string;
1053
- description?: string | undefined;
1054
- }>>>;
1055
- }, z.core.$strip>], "type">;
1056
-
1057
- /**
1058
- * An Expert definition - an AI agent with specific skills and instructions.
1059
- * Experts can delegate to other Experts and use MCP tools.
1060
- */
1061
- interface Expert {
1062
- /** Unique key identifying this Expert (e.g., "my-expert" or "my-expert@1.0.0") */
1063
- key: string;
1064
- /** Display name for the Expert */
1065
- name: string;
1066
- /** Semantic version string */
1067
- version: string;
1068
- /** Human-readable description of what this Expert does */
1069
- description?: string;
1070
- /** System instruction defining the Expert's behavior */
1071
- instruction: string;
1072
- /** Map of skill name to skill configuration */
1073
- skills: Record<string, Skill>;
1074
- /** List of Expert keys this Expert can delegate to */
1075
- delegates: string[];
1076
- /** Tags for categorization and discovery */
1077
- tags: string[];
1078
- }
1079
- declare const expertSchema: z.ZodObject<{
1080
- key: z.ZodString;
1081
- name: z.ZodString;
1082
- version: z.ZodString;
1083
- description: z.ZodOptional<z.ZodString>;
1084
- instruction: z.ZodString;
1085
- skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1086
- type: z.ZodLiteral<"mcpStdioSkill">;
1087
- description: z.ZodOptional<z.ZodString>;
1088
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1089
- rule: z.ZodOptional<z.ZodString>;
1090
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1091
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1092
- command: z.ZodString;
1093
- packageName: z.ZodOptional<z.ZodString>;
1094
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1095
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1096
- }, z.core.$strip>, z.ZodObject<{
1097
- type: z.ZodLiteral<"mcpSseSkill">;
1098
- description: z.ZodOptional<z.ZodString>;
1099
- rule: z.ZodOptional<z.ZodString>;
1100
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1101
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1102
- endpoint: z.ZodString;
1103
- }, z.core.$strip>, z.ZodObject<{
1104
- type: z.ZodLiteral<"interactiveSkill">;
1105
- description: z.ZodOptional<z.ZodString>;
1106
- rule: z.ZodOptional<z.ZodString>;
1107
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1108
- description: z.ZodOptional<z.ZodString>;
1109
- inputJsonSchema: z.ZodString;
1110
- }, z.core.$strip>>, z.ZodTransform<{
1111
- [k: string]: {
1112
- name: string;
1113
- inputJsonSchema: string;
1114
- description?: string | undefined;
1115
- };
1116
- }, Record<string, {
1117
- inputJsonSchema: string;
1118
- description?: string | undefined;
1119
- }>>>;
1120
- }, z.core.$strip>], "type">>>>, z.ZodTransform<{
1121
- [k: string]: {
1122
- type: "mcpStdioSkill";
1123
- name: string;
1124
- pick: string[];
1125
- omit: string[];
1126
- command: string;
1127
- args: string[];
1128
- requiredEnv: string[];
1129
- lazyInit: boolean;
1130
- description?: string | undefined;
1131
- rule?: string | undefined;
1132
- packageName?: string | undefined;
1133
- } | {
1134
- type: "mcpSseSkill";
1135
- name: string;
1136
- pick: string[];
1137
- omit: string[];
1138
- endpoint: string;
1139
- description?: string | undefined;
1140
- rule?: string | undefined;
1141
- } | {
1142
- type: "interactiveSkill";
1143
- name: string;
1144
- tools: {
1145
- [k: string]: {
1146
- name: string;
1147
- inputJsonSchema: string;
1148
- description?: string | undefined;
1149
- };
1150
- };
1151
- description?: string | undefined;
1152
- rule?: string | undefined;
1153
- };
1154
- }, Record<string, {
1155
- type: "mcpStdioSkill";
1156
- args: string[];
1157
- pick: string[];
1158
- omit: string[];
1159
- command: string;
1160
- requiredEnv: string[];
1161
- lazyInit: boolean;
1162
- description?: string | undefined;
1163
- rule?: string | undefined;
1164
- packageName?: string | undefined;
1165
- } | {
1166
- type: "mcpSseSkill";
1167
- pick: string[];
1168
- omit: string[];
1169
- endpoint: string;
1170
- description?: string | undefined;
1171
- rule?: string | undefined;
1172
- } | {
1173
- type: "interactiveSkill";
1174
- tools: {
1175
- [k: string]: {
1176
- name: string;
1177
- inputJsonSchema: string;
1178
- description?: string | undefined;
1179
- };
1180
- };
1181
- description?: string | undefined;
1182
- rule?: string | undefined;
1183
- }>>>;
1184
- delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1185
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
761
+ /** Content parts returned by the tool */
762
+ result: MessagePart[];
763
+ }
764
+ declare const toolResultSchema: z.ZodObject<{
765
+ id: z.ZodString;
766
+ skillName: z.ZodString;
767
+ toolName: z.ZodString;
768
+ result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
769
+ id: z.ZodString;
770
+ type: z.ZodLiteral<"textPart">;
771
+ text: z.ZodString;
772
+ }, z.core.$strip>, z.ZodObject<{
773
+ id: z.ZodString;
774
+ type: z.ZodLiteral<"imageUrlPart">;
775
+ url: z.ZodURL;
776
+ mimeType: z.ZodString;
777
+ }, z.core.$strip>, z.ZodObject<{
778
+ id: z.ZodString;
779
+ type: z.ZodLiteral<"imageInlinePart">;
780
+ encodedData: z.ZodString;
781
+ mimeType: z.ZodString;
782
+ }, z.core.$strip>, z.ZodObject<{
783
+ id: z.ZodString;
784
+ type: z.ZodLiteral<"imageBinaryPart">;
785
+ data: z.ZodString;
786
+ mimeType: z.ZodString;
787
+ }, z.core.$strip>, z.ZodObject<{
788
+ id: z.ZodString;
789
+ type: z.ZodLiteral<"fileUrlPart">;
790
+ url: z.ZodString;
791
+ mimeType: z.ZodString;
792
+ }, z.core.$strip>, z.ZodObject<{
793
+ id: z.ZodString;
794
+ type: z.ZodLiteral<"fileInlinePart">;
795
+ encodedData: z.ZodString;
796
+ mimeType: z.ZodString;
797
+ }, z.core.$strip>, z.ZodObject<{
798
+ id: z.ZodString;
799
+ type: z.ZodLiteral<"fileBinaryPart">;
800
+ data: z.ZodString;
801
+ mimeType: z.ZodString;
802
+ }, z.core.$strip>, z.ZodObject<{
803
+ id: z.ZodString;
804
+ type: z.ZodLiteral<"toolCallPart">;
805
+ toolCallId: z.ZodString;
806
+ toolName: z.ZodString;
807
+ args: z.ZodUnknown;
808
+ }, z.core.$strip>, z.ZodObject<{
809
+ id: z.ZodString;
810
+ type: z.ZodLiteral<"toolResultPart">;
811
+ toolCallId: z.ZodString;
812
+ toolName: z.ZodString;
813
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
814
+ id: z.ZodString;
815
+ type: z.ZodLiteral<"textPart">;
816
+ text: z.ZodString;
817
+ }, z.core.$strip>, z.ZodObject<{
818
+ id: z.ZodString;
819
+ type: z.ZodLiteral<"imageInlinePart">;
820
+ encodedData: z.ZodString;
821
+ mimeType: z.ZodString;
822
+ }, z.core.$strip>, z.ZodObject<{
823
+ id: z.ZodString;
824
+ type: z.ZodLiteral<"fileInlinePart">;
825
+ encodedData: z.ZodString;
826
+ mimeType: z.ZodString;
827
+ }, z.core.$strip>]>>;
828
+ isError: z.ZodOptional<z.ZodBoolean>;
829
+ }, z.core.$strip>], "type">>;
1186
830
  }, z.core.$strip>;
1187
831
 
1188
- type JobStatus = "running" | "completed" | "stoppedByMaxSteps" | "stoppedByInteractiveTool" | "stoppedByError";
1189
- declare const jobStatusSchema: z.ZodEnum<{
832
+ /** Token usage statistics for a single step or run */
833
+ interface Usage {
834
+ /** Number of tokens in the input prompt */
835
+ inputTokens: number;
836
+ /** Number of tokens generated in the response */
837
+ outputTokens: number;
838
+ /** Number of tokens used for reasoning (extended thinking) */
839
+ reasoningTokens: number;
840
+ /** Total tokens (input + output) */
841
+ totalTokens: number;
842
+ /** Number of input tokens served from cache */
843
+ cachedInputTokens: number;
844
+ }
845
+ declare const usageSchema: z.ZodObject<{
846
+ inputTokens: z.ZodNumber;
847
+ outputTokens: z.ZodNumber;
848
+ reasoningTokens: z.ZodNumber;
849
+ totalTokens: z.ZodNumber;
850
+ cachedInputTokens: z.ZodNumber;
851
+ }, z.core.$strip>;
852
+
853
+ /** Status of a checkpoint in the execution lifecycle */
854
+ type CheckpointStatus = "init" | "proceeding" | "completed" | "stoppedByInteractiveTool" | "stoppedByDelegate" | "stoppedByExceededMaxSteps" | "stoppedByError";
855
+ declare const checkpointStatusSchema: z.ZodEnum<{
856
+ init: "init";
857
+ proceeding: "proceeding";
1190
858
  completed: "completed";
1191
859
  stoppedByInteractiveTool: "stoppedByInteractiveTool";
860
+ stoppedByDelegate: "stoppedByDelegate";
861
+ stoppedByExceededMaxSteps: "stoppedByExceededMaxSteps";
1192
862
  stoppedByError: "stoppedByError";
1193
- running: "running";
1194
- stoppedByMaxSteps: "stoppedByMaxSteps";
1195
863
  }>;
1196
- interface Job {
864
+ /** Information about a delegation target */
865
+ interface DelegationTarget {
866
+ expert: {
867
+ key: string;
868
+ name: string;
869
+ version: string;
870
+ };
871
+ toolCallId: string;
872
+ toolName: string;
873
+ query: string;
874
+ }
875
+ /**
876
+ * A checkpoint represents a point-in-time snapshot of an Expert's execution state.
877
+ * Used for resuming, debugging, and observability.
878
+ */
879
+ interface Checkpoint {
880
+ /** Unique identifier for this checkpoint */
1197
881
  id: string;
1198
- status: JobStatus;
1199
- coordinatorExpertKey: string;
1200
- totalSteps: number;
1201
- maxSteps?: number;
882
+ /** Job ID this checkpoint belongs to */
883
+ jobId: string;
884
+ /** Run ID this checkpoint belongs to */
885
+ runId: string;
886
+ /** Current execution status */
887
+ status: CheckpointStatus;
888
+ /** Current step number within this Run */
889
+ stepNumber: number;
890
+ /** All messages in the conversation so far */
891
+ messages: Message[];
892
+ /** Expert executing this checkpoint */
893
+ expert: {
894
+ /** Expert key (e.g., "my-expert@1.0.0") */
895
+ key: string;
896
+ /** Expert name */
897
+ name: string;
898
+ /** Expert version */
899
+ version: string;
900
+ };
901
+ /** If delegating, information about the target Expert(s) - supports parallel delegation */
902
+ delegateTo?: DelegationTarget[];
903
+ /** If delegated, information about the parent Expert */
904
+ delegatedBy?: {
905
+ /** The parent Expert that delegated */
906
+ expert: {
907
+ key: string;
908
+ name: string;
909
+ version: string;
910
+ };
911
+ /** Tool call ID from the parent */
912
+ toolCallId: string;
913
+ /** Name of the delegation tool */
914
+ toolName: string;
915
+ /** Checkpoint ID of the parent */
916
+ checkpointId: string;
917
+ };
918
+ /** Accumulated token usage */
1202
919
  usage: Usage;
1203
- startedAt: number;
1204
- finishedAt?: number;
920
+ /** Model's context window size in tokens */
921
+ contextWindow?: number;
922
+ /** Context window usage ratio (0-1) */
923
+ contextWindowUsage?: number;
924
+ /** Tool calls waiting to be processed (for resume after delegate/interactive) */
925
+ pendingToolCalls?: ToolCall[];
926
+ /** Partial tool results collected before stopping (for resume) */
927
+ partialToolResults?: ToolResult[];
928
+ /** Optional metadata for runtime-specific information */
929
+ metadata?: {
930
+ /** Runtime that executed this checkpoint */
931
+ runtime?: RuntimeName;
932
+ /** Additional runtime-specific data */
933
+ [key: string]: unknown;
934
+ };
1205
935
  }
1206
- declare const jobSchema: z.ZodObject<{
936
+ declare const delegationTargetSchema: z.ZodObject<{
937
+ expert: z.ZodObject<{
938
+ key: z.ZodString;
939
+ name: z.ZodString;
940
+ version: z.ZodString;
941
+ }, z.core.$strip>;
942
+ toolCallId: z.ZodString;
943
+ toolName: z.ZodString;
944
+ query: z.ZodString;
945
+ }, z.core.$strip>;
946
+ declare const checkpointSchema: z.ZodObject<{
1207
947
  id: z.ZodString;
948
+ jobId: z.ZodString;
949
+ runId: z.ZodString;
1208
950
  status: z.ZodEnum<{
951
+ init: "init";
952
+ proceeding: "proceeding";
1209
953
  completed: "completed";
1210
954
  stoppedByInteractiveTool: "stoppedByInteractiveTool";
955
+ stoppedByDelegate: "stoppedByDelegate";
956
+ stoppedByExceededMaxSteps: "stoppedByExceededMaxSteps";
1211
957
  stoppedByError: "stoppedByError";
1212
- running: "running";
1213
- stoppedByMaxSteps: "stoppedByMaxSteps";
1214
958
  }>;
1215
- coordinatorExpertKey: z.ZodString;
1216
- totalSteps: z.ZodNumber;
1217
- maxSteps: z.ZodOptional<z.ZodNumber>;
959
+ stepNumber: z.ZodNumber;
960
+ messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
961
+ id: z.ZodString;
962
+ type: z.ZodLiteral<"instructionMessage">;
963
+ contents: z.ZodArray<z.ZodObject<{
964
+ id: z.ZodString;
965
+ type: z.ZodLiteral<"textPart">;
966
+ text: z.ZodString;
967
+ }, z.core.$strip>>;
968
+ cache: z.ZodOptional<z.ZodBoolean>;
969
+ }, z.core.$strip>, z.ZodObject<{
970
+ id: z.ZodString;
971
+ type: z.ZodLiteral<"userMessage">;
972
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
973
+ id: z.ZodString;
974
+ type: z.ZodLiteral<"textPart">;
975
+ text: z.ZodString;
976
+ }, z.core.$strip>, z.ZodObject<{
977
+ id: z.ZodString;
978
+ type: z.ZodLiteral<"imageUrlPart">;
979
+ url: z.ZodURL;
980
+ mimeType: z.ZodString;
981
+ }, z.core.$strip>, z.ZodObject<{
982
+ id: z.ZodString;
983
+ type: z.ZodLiteral<"imageInlinePart">;
984
+ encodedData: z.ZodString;
985
+ mimeType: z.ZodString;
986
+ }, z.core.$strip>, z.ZodObject<{
987
+ id: z.ZodString;
988
+ type: z.ZodLiteral<"imageBinaryPart">;
989
+ data: z.ZodString;
990
+ mimeType: z.ZodString;
991
+ }, z.core.$strip>, z.ZodObject<{
992
+ id: z.ZodString;
993
+ type: z.ZodLiteral<"fileUrlPart">;
994
+ url: z.ZodString;
995
+ mimeType: z.ZodString;
996
+ }, z.core.$strip>, z.ZodObject<{
997
+ id: z.ZodString;
998
+ type: z.ZodLiteral<"fileInlinePart">;
999
+ encodedData: z.ZodString;
1000
+ mimeType: z.ZodString;
1001
+ }, z.core.$strip>, z.ZodObject<{
1002
+ id: z.ZodString;
1003
+ type: z.ZodLiteral<"fileBinaryPart">;
1004
+ data: z.ZodString;
1005
+ mimeType: z.ZodString;
1006
+ }, z.core.$strip>]>>;
1007
+ cache: z.ZodOptional<z.ZodBoolean>;
1008
+ }, z.core.$strip>, z.ZodObject<{
1009
+ id: z.ZodString;
1010
+ type: z.ZodLiteral<"expertMessage">;
1011
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1012
+ id: z.ZodString;
1013
+ type: z.ZodLiteral<"textPart">;
1014
+ text: z.ZodString;
1015
+ }, z.core.$strip>, z.ZodObject<{
1016
+ id: z.ZodString;
1017
+ type: z.ZodLiteral<"toolCallPart">;
1018
+ toolCallId: z.ZodString;
1019
+ toolName: z.ZodString;
1020
+ args: z.ZodUnknown;
1021
+ }, z.core.$strip>]>>;
1022
+ cache: z.ZodOptional<z.ZodBoolean>;
1023
+ }, z.core.$strip>, z.ZodObject<{
1024
+ id: z.ZodString;
1025
+ type: z.ZodLiteral<"toolMessage">;
1026
+ contents: z.ZodArray<z.ZodObject<{
1027
+ id: z.ZodString;
1028
+ type: z.ZodLiteral<"toolResultPart">;
1029
+ toolCallId: z.ZodString;
1030
+ toolName: z.ZodString;
1031
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1032
+ id: z.ZodString;
1033
+ type: z.ZodLiteral<"textPart">;
1034
+ text: z.ZodString;
1035
+ }, z.core.$strip>, z.ZodObject<{
1036
+ id: z.ZodString;
1037
+ type: z.ZodLiteral<"imageInlinePart">;
1038
+ encodedData: z.ZodString;
1039
+ mimeType: z.ZodString;
1040
+ }, z.core.$strip>, z.ZodObject<{
1041
+ id: z.ZodString;
1042
+ type: z.ZodLiteral<"fileInlinePart">;
1043
+ encodedData: z.ZodString;
1044
+ mimeType: z.ZodString;
1045
+ }, z.core.$strip>]>>;
1046
+ isError: z.ZodOptional<z.ZodBoolean>;
1047
+ }, z.core.$strip>>;
1048
+ cache: z.ZodOptional<z.ZodBoolean>;
1049
+ }, z.core.$strip>]>>;
1050
+ expert: z.ZodObject<{
1051
+ key: z.ZodString;
1052
+ name: z.ZodString;
1053
+ version: z.ZodString;
1054
+ }, z.core.$strip>;
1055
+ delegateTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
1056
+ expert: z.ZodObject<{
1057
+ key: z.ZodString;
1058
+ name: z.ZodString;
1059
+ version: z.ZodString;
1060
+ }, z.core.$strip>;
1061
+ toolCallId: z.ZodString;
1062
+ toolName: z.ZodString;
1063
+ query: z.ZodString;
1064
+ }, z.core.$strip>>>;
1065
+ delegatedBy: z.ZodOptional<z.ZodObject<{
1066
+ expert: z.ZodObject<{
1067
+ key: z.ZodString;
1068
+ name: z.ZodString;
1069
+ version: z.ZodString;
1070
+ }, z.core.$strip>;
1071
+ toolCallId: z.ZodString;
1072
+ toolName: z.ZodString;
1073
+ checkpointId: z.ZodString;
1074
+ }, z.core.$strip>>;
1218
1075
  usage: z.ZodObject<{
1219
1076
  inputTokens: z.ZodNumber;
1220
1077
  outputTokens: z.ZodNumber;
@@ -1222,10 +1079,93 @@ declare const jobSchema: z.ZodObject<{
1222
1079
  totalTokens: z.ZodNumber;
1223
1080
  cachedInputTokens: z.ZodNumber;
1224
1081
  }, z.core.$strip>;
1225
- startedAt: z.ZodNumber;
1226
- finishedAt: z.ZodOptional<z.ZodNumber>;
1082
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1083
+ contextWindowUsage: z.ZodOptional<z.ZodNumber>;
1084
+ pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1085
+ id: z.ZodString;
1086
+ skillName: z.ZodString;
1087
+ toolName: z.ZodString;
1088
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1089
+ }, z.core.$strip>>>;
1090
+ partialToolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
1091
+ id: z.ZodString;
1092
+ skillName: z.ZodString;
1093
+ toolName: z.ZodString;
1094
+ result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1095
+ id: z.ZodString;
1096
+ type: z.ZodLiteral<"textPart">;
1097
+ text: z.ZodString;
1098
+ }, z.core.$strip>, z.ZodObject<{
1099
+ id: z.ZodString;
1100
+ type: z.ZodLiteral<"imageUrlPart">;
1101
+ url: z.ZodURL;
1102
+ mimeType: z.ZodString;
1103
+ }, z.core.$strip>, z.ZodObject<{
1104
+ id: z.ZodString;
1105
+ type: z.ZodLiteral<"imageInlinePart">;
1106
+ encodedData: z.ZodString;
1107
+ mimeType: z.ZodString;
1108
+ }, z.core.$strip>, z.ZodObject<{
1109
+ id: z.ZodString;
1110
+ type: z.ZodLiteral<"imageBinaryPart">;
1111
+ data: z.ZodString;
1112
+ mimeType: z.ZodString;
1113
+ }, z.core.$strip>, z.ZodObject<{
1114
+ id: z.ZodString;
1115
+ type: z.ZodLiteral<"fileUrlPart">;
1116
+ url: z.ZodString;
1117
+ mimeType: z.ZodString;
1118
+ }, z.core.$strip>, z.ZodObject<{
1119
+ id: z.ZodString;
1120
+ type: z.ZodLiteral<"fileInlinePart">;
1121
+ encodedData: z.ZodString;
1122
+ mimeType: z.ZodString;
1123
+ }, z.core.$strip>, z.ZodObject<{
1124
+ id: z.ZodString;
1125
+ type: z.ZodLiteral<"fileBinaryPart">;
1126
+ data: z.ZodString;
1127
+ mimeType: z.ZodString;
1128
+ }, z.core.$strip>, z.ZodObject<{
1129
+ id: z.ZodString;
1130
+ type: z.ZodLiteral<"toolCallPart">;
1131
+ toolCallId: z.ZodString;
1132
+ toolName: z.ZodString;
1133
+ args: z.ZodUnknown;
1134
+ }, z.core.$strip>, z.ZodObject<{
1135
+ id: z.ZodString;
1136
+ type: z.ZodLiteral<"toolResultPart">;
1137
+ toolCallId: z.ZodString;
1138
+ toolName: z.ZodString;
1139
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1140
+ id: z.ZodString;
1141
+ type: z.ZodLiteral<"textPart">;
1142
+ text: z.ZodString;
1143
+ }, z.core.$strip>, z.ZodObject<{
1144
+ id: z.ZodString;
1145
+ type: z.ZodLiteral<"imageInlinePart">;
1146
+ encodedData: z.ZodString;
1147
+ mimeType: z.ZodString;
1148
+ }, z.core.$strip>, z.ZodObject<{
1149
+ id: z.ZodString;
1150
+ type: z.ZodLiteral<"fileInlinePart">;
1151
+ encodedData: z.ZodString;
1152
+ mimeType: z.ZodString;
1153
+ }, z.core.$strip>]>>;
1154
+ isError: z.ZodOptional<z.ZodBoolean>;
1155
+ }, z.core.$strip>], "type">>;
1156
+ }, z.core.$strip>>>;
1157
+ metadata: z.ZodOptional<z.ZodObject<{
1158
+ runtime: z.ZodOptional<z.ZodEnum<{
1159
+ local: "local";
1160
+ cursor: "cursor";
1161
+ "claude-code": "claude-code";
1162
+ gemini: "gemini";
1163
+ docker: "docker";
1164
+ }>>;
1165
+ }, z.core.$loose>>;
1227
1166
  }, z.core.$strip>;
1228
1167
 
1168
+ declare const domainPatternSchema: z.ZodString;
1229
1169
  declare const anthropicSettingSchema: z.ZodObject<{
1230
1170
  baseUrl: z.ZodOptional<z.ZodString>;
1231
1171
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1358,6 +1298,7 @@ type PerstackConfigSkill = {
1358
1298
  packageName?: string;
1359
1299
  args?: string[];
1360
1300
  requiredEnv?: string[];
1301
+ allowedDomains?: string[];
1361
1302
  } | {
1362
1303
  type: "mcpSseSkill";
1363
1304
  description?: string;
@@ -1365,6 +1306,7 @@ type PerstackConfigSkill = {
1365
1306
  pick?: string[];
1366
1307
  omit?: string[];
1367
1308
  endpoint: string;
1309
+ allowedDomains?: string[];
1368
1310
  } | {
1369
1311
  type: "interactiveSkill";
1370
1312
  description?: string;
@@ -1402,6 +1344,8 @@ interface PerstackConfig {
1402
1344
  model?: string;
1403
1345
  /** Default temperature (0-1) */
1404
1346
  temperature?: number;
1347
+ /** Default execution runtime */
1348
+ runtime?: RuntimeName;
1405
1349
  /** Maximum steps per run */
1406
1350
  maxSteps?: number;
1407
1351
  /** Maximum retries on generation failure */
@@ -1476,6 +1420,13 @@ declare const perstackConfigSchema: z.ZodObject<{
1476
1420
  }, z.core.$strip>], "providerName">>;
1477
1421
  model: z.ZodOptional<z.ZodString>;
1478
1422
  temperature: z.ZodOptional<z.ZodNumber>;
1423
+ runtime: z.ZodOptional<z.ZodEnum<{
1424
+ local: "local";
1425
+ cursor: "cursor";
1426
+ "claude-code": "claude-code";
1427
+ gemini: "gemini";
1428
+ docker: "docker";
1429
+ }>>;
1479
1430
  maxSteps: z.ZodOptional<z.ZodNumber>;
1480
1431
  maxRetries: z.ZodOptional<z.ZodNumber>;
1481
1432
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -1494,6 +1445,7 @@ declare const perstackConfigSchema: z.ZodObject<{
1494
1445
  packageName: z.ZodOptional<z.ZodString>;
1495
1446
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1496
1447
  requiredEnv: z.ZodOptional<z.ZodArray<z.ZodString>>;
1448
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1497
1449
  }, z.core.$strip>, z.ZodObject<{
1498
1450
  type: z.ZodLiteral<"mcpSseSkill">;
1499
1451
  description: z.ZodOptional<z.ZodString>;
@@ -1501,6 +1453,7 @@ declare const perstackConfigSchema: z.ZodObject<{
1501
1453
  pick: z.ZodOptional<z.ZodArray<z.ZodString>>;
1502
1454
  omit: z.ZodOptional<z.ZodArray<z.ZodString>>;
1503
1455
  endpoint: z.ZodString;
1456
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1504
1457
  }, z.core.$strip>, z.ZodObject<{
1505
1458
  type: z.ZodLiteral<"interactiveSkill">;
1506
1459
  description: z.ZodOptional<z.ZodString>;
@@ -1527,11 +1480,11 @@ declare const providerNameSchema: z.ZodEnum<{
1527
1480
  anthropic: "anthropic";
1528
1481
  google: "google";
1529
1482
  openai: "openai";
1530
- deepseek: "deepseek";
1531
1483
  ollama: "ollama";
1532
1484
  "azure-openai": "azure-openai";
1533
1485
  "amazon-bedrock": "amazon-bedrock";
1534
1486
  "google-vertex": "google-vertex";
1487
+ deepseek: "deepseek";
1535
1488
  }>;
1536
1489
  /** Anthropic provider configuration */
1537
1490
  interface AnthropicProviderConfig {
@@ -1720,130 +1673,18 @@ declare const providerConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1720
1673
  secretAccessKey: z.ZodString;
1721
1674
  region: z.ZodString;
1722
1675
  sessionToken: z.ZodOptional<z.ZodString>;
1723
- }, z.core.$strip>, z.ZodObject<{
1724
- providerName: z.ZodLiteral<"google-vertex">;
1725
- project: z.ZodOptional<z.ZodString>;
1726
- location: z.ZodOptional<z.ZodString>;
1727
- baseUrl: z.ZodOptional<z.ZodString>;
1728
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1729
- }, z.core.$strip>, z.ZodObject<{
1730
- providerName: z.ZodLiteral<"deepseek">;
1731
- apiKey: z.ZodString;
1732
- baseUrl: z.ZodOptional<z.ZodString>;
1733
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1734
- }, z.core.$strip>], "providerName">;
1735
-
1736
- /** Parsed command options after transformation */
1737
- interface CommandOptions {
1738
- /** Path to perstack.toml config file */
1739
- config?: string;
1740
- /** LLM provider to use */
1741
- provider?: ProviderName;
1742
- /** Model name */
1743
- model?: string;
1744
- /** Temperature (0-1) */
1745
- temperature?: number;
1746
- /** Maximum steps */
1747
- maxSteps?: number;
1748
- /** Maximum retries */
1749
- maxRetries?: number;
1750
- /** Timeout in milliseconds */
1751
- timeout?: number;
1752
- /** Custom job ID */
1753
- jobId?: string;
1754
- /** Custom run ID */
1755
- runId?: string;
1756
- /** Paths to .env files */
1757
- envPath?: string[];
1758
- /** Enable verbose logging */
1759
- verbose?: boolean;
1760
- /** Continue most recent job */
1761
- continue?: boolean;
1762
- /** Continue specific job by ID */
1763
- continueJob?: string;
1764
- /** Resume from specific checkpoint (requires --continue or --continue-job) */
1765
- resumeFrom?: string;
1766
- /** Query is interactive tool call result */
1767
- interactiveToolCallResult?: boolean;
1768
- }
1769
- /** Input for the `perstack run` command */
1770
- interface RunCommandInput {
1771
- /** Expert key to run */
1772
- expertKey: string;
1773
- /** Query or prompt */
1774
- query: string;
1775
- /** Command options */
1776
- options: CommandOptions;
1777
- }
1778
- declare const runCommandInputSchema: z.ZodObject<{
1779
- expertKey: z.ZodString;
1780
- query: z.ZodString;
1781
- options: z.ZodObject<{
1782
- config: z.ZodOptional<z.ZodString>;
1783
- provider: z.ZodOptional<z.ZodEnum<{
1784
- anthropic: "anthropic";
1785
- google: "google";
1786
- openai: "openai";
1787
- deepseek: "deepseek";
1788
- ollama: "ollama";
1789
- "azure-openai": "azure-openai";
1790
- "amazon-bedrock": "amazon-bedrock";
1791
- "google-vertex": "google-vertex";
1792
- }>>;
1793
- model: z.ZodOptional<z.ZodString>;
1794
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1795
- maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1796
- maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1797
- timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1798
- jobId: z.ZodOptional<z.ZodString>;
1799
- runId: z.ZodOptional<z.ZodString>;
1800
- envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1801
- verbose: z.ZodOptional<z.ZodBoolean>;
1802
- continue: z.ZodOptional<z.ZodBoolean>;
1803
- continueJob: z.ZodOptional<z.ZodString>;
1804
- resumeFrom: z.ZodOptional<z.ZodString>;
1805
- interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
1806
- }, z.core.$strip>;
1807
- }, z.core.$strip>;
1808
- /** Input for the `perstack start` command */
1809
- interface StartCommandInput {
1810
- /** Expert key to run (optional, prompts if not provided) */
1811
- expertKey?: string;
1812
- /** Query or prompt (optional, prompts if not provided) */
1813
- query?: string;
1814
- /** Command options */
1815
- options: CommandOptions;
1816
- }
1817
- declare const startCommandInputSchema: z.ZodObject<{
1818
- expertKey: z.ZodOptional<z.ZodString>;
1819
- query: z.ZodOptional<z.ZodString>;
1820
- options: z.ZodObject<{
1821
- config: z.ZodOptional<z.ZodString>;
1822
- provider: z.ZodOptional<z.ZodEnum<{
1823
- anthropic: "anthropic";
1824
- google: "google";
1825
- openai: "openai";
1826
- deepseek: "deepseek";
1827
- ollama: "ollama";
1828
- "azure-openai": "azure-openai";
1829
- "amazon-bedrock": "amazon-bedrock";
1830
- "google-vertex": "google-vertex";
1831
- }>>;
1832
- model: z.ZodOptional<z.ZodString>;
1833
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1834
- maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1835
- maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1836
- timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1837
- jobId: z.ZodOptional<z.ZodString>;
1838
- runId: z.ZodOptional<z.ZodString>;
1839
- envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1840
- verbose: z.ZodOptional<z.ZodBoolean>;
1841
- continue: z.ZodOptional<z.ZodBoolean>;
1842
- continueJob: z.ZodOptional<z.ZodString>;
1843
- resumeFrom: z.ZodOptional<z.ZodString>;
1844
- interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
1845
- }, z.core.$strip>;
1846
- }, z.core.$strip>;
1676
+ }, z.core.$strip>, z.ZodObject<{
1677
+ providerName: z.ZodLiteral<"google-vertex">;
1678
+ project: z.ZodOptional<z.ZodString>;
1679
+ location: z.ZodOptional<z.ZodString>;
1680
+ baseUrl: z.ZodOptional<z.ZodString>;
1681
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1682
+ }, z.core.$strip>, z.ZodObject<{
1683
+ providerName: z.ZodLiteral<"deepseek">;
1684
+ apiKey: z.ZodString;
1685
+ baseUrl: z.ZodOptional<z.ZodString>;
1686
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1687
+ }, z.core.$strip>], "providerName">;
1847
1688
 
1848
1689
  /**
1849
1690
  * A single execution step in an Expert run.
@@ -2233,7 +2074,7 @@ interface RunSetting {
2233
2074
  /** Temperature for generation (0-1) */
2234
2075
  temperature: number;
2235
2076
  /** Maximum steps before stopping (applies to Job's totalSteps) */
2236
- maxSteps?: number;
2077
+ maxSteps: number;
2237
2078
  /** Maximum retries on generation failure */
2238
2079
  maxRetries: number;
2239
2080
  /** Timeout per generation in milliseconds */
@@ -2250,6 +2091,10 @@ interface RunSetting {
2250
2091
  perstackBaseSkillCommand?: string[];
2251
2092
  /** Environment variables to pass to skills */
2252
2093
  env: Record<string, string>;
2094
+ /** HTTP proxy URL for API requests */
2095
+ proxyUrl?: string;
2096
+ /** Enable verbose output for build processes */
2097
+ verbose?: boolean;
2253
2098
  }
2254
2099
  /** Parameters for starting a run */
2255
2100
  interface RunParams {
@@ -2288,6 +2133,8 @@ type RunParamsInput = {
2288
2133
  perstackApiKey?: string;
2289
2134
  perstackBaseSkillCommand?: string[];
2290
2135
  env?: Record<string, string>;
2136
+ proxyUrl?: string;
2137
+ verbose?: boolean;
2291
2138
  };
2292
2139
  checkpoint?: Checkpoint;
2293
2140
  };
@@ -2362,12 +2209,12 @@ declare const runSettingSchema: z.ZodObject<{
2362
2209
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2363
2210
  type: z.ZodLiteral<"mcpStdioSkill">;
2364
2211
  description: z.ZodOptional<z.ZodString>;
2365
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2366
2212
  rule: z.ZodOptional<z.ZodString>;
2367
2213
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2368
2214
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2369
2215
  command: z.ZodString;
2370
2216
  packageName: z.ZodOptional<z.ZodString>;
2217
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2371
2218
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2372
2219
  lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2373
2220
  }, z.core.$strip>, z.ZodObject<{
@@ -2430,10 +2277,10 @@ declare const runSettingSchema: z.ZodObject<{
2430
2277
  };
2431
2278
  }, Record<string, {
2432
2279
  type: "mcpStdioSkill";
2433
- args: string[];
2434
2280
  pick: string[];
2435
2281
  omit: string[];
2436
2282
  command: string;
2283
+ args: string[];
2437
2284
  requiredEnv: string[];
2438
2285
  lazyInit: boolean;
2439
2286
  description?: string | undefined;
@@ -2462,7 +2309,7 @@ declare const runSettingSchema: z.ZodObject<{
2462
2309
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2463
2310
  }, z.core.$strip>>;
2464
2311
  temperature: z.ZodNumber;
2465
- maxSteps: z.ZodOptional<z.ZodNumber>;
2312
+ maxSteps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2466
2313
  maxRetries: z.ZodNumber;
2467
2314
  timeout: z.ZodNumber;
2468
2315
  startedAt: z.ZodNumber;
@@ -2471,6 +2318,8 @@ declare const runSettingSchema: z.ZodObject<{
2471
2318
  perstackApiKey: z.ZodOptional<z.ZodString>;
2472
2319
  perstackBaseSkillCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
2473
2320
  env: z.ZodRecord<z.ZodString, z.ZodString>;
2321
+ proxyUrl: z.ZodOptional<z.ZodString>;
2322
+ verbose: z.ZodOptional<z.ZodBoolean>;
2474
2323
  }, z.core.$strip>;
2475
2324
  declare const runParamsSchema: z.ZodObject<{
2476
2325
  setting: z.ZodObject<{
@@ -2536,19 +2385,19 @@ declare const runParamsSchema: z.ZodObject<{
2536
2385
  }, z.core.$strip>>;
2537
2386
  }, z.core.$strip>;
2538
2387
  experts: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2539
- description: z.ZodOptional<z.ZodString>;
2540
2388
  name: z.ZodString;
2389
+ description: z.ZodOptional<z.ZodString>;
2541
2390
  version: z.ZodString;
2542
2391
  instruction: z.ZodString;
2543
2392
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2544
2393
  type: z.ZodLiteral<"mcpStdioSkill">;
2545
2394
  description: z.ZodOptional<z.ZodString>;
2546
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2547
2395
  rule: z.ZodOptional<z.ZodString>;
2548
2396
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2549
2397
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2550
2398
  command: z.ZodString;
2551
2399
  packageName: z.ZodOptional<z.ZodString>;
2400
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2552
2401
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2553
2402
  lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2554
2403
  }, z.core.$strip>, z.ZodObject<{
@@ -2611,10 +2460,10 @@ declare const runParamsSchema: z.ZodObject<{
2611
2460
  };
2612
2461
  }, Record<string, {
2613
2462
  type: "mcpStdioSkill";
2614
- args: string[];
2615
2463
  pick: string[];
2616
2464
  omit: string[];
2617
2465
  command: string;
2466
+ args: string[];
2618
2467
  requiredEnv: string[];
2619
2468
  lazyInit: boolean;
2620
2469
  description?: string | undefined;
@@ -2730,7 +2579,7 @@ declare const runParamsSchema: z.ZodObject<{
2730
2579
  description?: string | undefined;
2731
2580
  }>>>;
2732
2581
  temperature: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2733
- maxSteps: z.ZodOptional<z.ZodNumber>;
2582
+ maxSteps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2734
2583
  maxRetries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2735
2584
  timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2736
2585
  startedAt: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
@@ -2739,6 +2588,8 @@ declare const runParamsSchema: z.ZodObject<{
2739
2588
  perstackApiKey: z.ZodOptional<z.ZodString>;
2740
2589
  perstackBaseSkillCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
2741
2590
  env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2591
+ proxyUrl: z.ZodOptional<z.ZodString>;
2592
+ verbose: z.ZodOptional<z.ZodBoolean>;
2742
2593
  }, z.core.$strip>;
2743
2594
  checkpoint: z.ZodOptional<z.ZodObject<{
2744
2595
  id: z.ZodString;
@@ -2951,6 +2802,15 @@ declare const runParamsSchema: z.ZodObject<{
2951
2802
  isError: z.ZodOptional<z.ZodBoolean>;
2952
2803
  }, z.core.$strip>], "type">>;
2953
2804
  }, z.core.$strip>>>;
2805
+ metadata: z.ZodOptional<z.ZodObject<{
2806
+ runtime: z.ZodOptional<z.ZodEnum<{
2807
+ local: "local";
2808
+ cursor: "cursor";
2809
+ "claude-code": "claude-code";
2810
+ gemini: "gemini";
2811
+ docker: "docker";
2812
+ }>>;
2813
+ }, z.core.$loose>>;
2954
2814
  }, z.core.$strip>>;
2955
2815
  }, z.core.$strip>;
2956
2816
  /**
@@ -3064,7 +2924,7 @@ declare const startRun: (setting: RunSetting, checkpoint: Checkpoint, data: Omit
3064
2924
  } & {
3065
2925
  initialCheckpoint: Checkpoint;
3066
2926
  inputMessages: (InstructionMessage | UserMessage | ToolMessage)[];
3067
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2927
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3068
2928
  type: "startRun";
3069
2929
  } & {
3070
2930
  initialCheckpoint: Checkpoint;
@@ -3074,7 +2934,7 @@ declare const startGeneration: (setting: RunSetting, checkpoint: Checkpoint, dat
3074
2934
  type: "startGeneration";
3075
2935
  } & {
3076
2936
  messages: Message[];
3077
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2937
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3078
2938
  type: "startGeneration";
3079
2939
  } & {
3080
2940
  messages: Message[];
@@ -3087,7 +2947,7 @@ declare const retry: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<Ba
3087
2947
  toolCalls?: ToolCall[];
3088
2948
  toolResults?: ToolResult[];
3089
2949
  usage: Usage;
3090
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2950
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3091
2951
  type: "retry";
3092
2952
  } & {
3093
2953
  reason: string;
@@ -3102,7 +2962,7 @@ declare const callTools: (setting: RunSetting, checkpoint: Checkpoint, data: Omi
3102
2962
  newMessage: ExpertMessage;
3103
2963
  toolCalls: ToolCall[];
3104
2964
  usage: Usage;
3105
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2965
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3106
2966
  type: "callTools";
3107
2967
  } & {
3108
2968
  newMessage: ExpertMessage;
@@ -3115,7 +2975,7 @@ declare const callInteractiveTool: (setting: RunSetting, checkpoint: Checkpoint,
3115
2975
  newMessage: ExpertMessage;
3116
2976
  toolCall: ToolCall;
3117
2977
  usage: Usage;
3118
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2978
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3119
2979
  type: "callInteractiveTool";
3120
2980
  } & {
3121
2981
  newMessage: ExpertMessage;
@@ -3128,7 +2988,7 @@ declare const callDelegate: (setting: RunSetting, checkpoint: Checkpoint, data:
3128
2988
  newMessage: ExpertMessage;
3129
2989
  toolCalls: ToolCall[];
3130
2990
  usage: Usage;
3131
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2991
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3132
2992
  type: "callDelegate";
3133
2993
  } & {
3134
2994
  newMessage: ExpertMessage;
@@ -3139,7 +2999,7 @@ declare const resolveToolResults: (setting: RunSetting, checkpoint: Checkpoint,
3139
2999
  type: "resolveToolResults";
3140
3000
  } & {
3141
3001
  toolResults: ToolResult[];
3142
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3002
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3143
3003
  type: "resolveToolResults";
3144
3004
  } & {
3145
3005
  toolResults: ToolResult[];
@@ -3148,7 +3008,7 @@ declare const resolveThought: (setting: RunSetting, checkpoint: Checkpoint, data
3148
3008
  type: "resolveThought";
3149
3009
  } & {
3150
3010
  toolResult: ToolResult;
3151
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3011
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3152
3012
  type: "resolveThought";
3153
3013
  } & {
3154
3014
  toolResult: ToolResult;
@@ -3157,7 +3017,7 @@ declare const attemptCompletion: (setting: RunSetting, checkpoint: Checkpoint, d
3157
3017
  type: "attemptCompletion";
3158
3018
  } & {
3159
3019
  toolResult: ToolResult;
3160
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3020
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3161
3021
  type: "attemptCompletion";
3162
3022
  } & {
3163
3023
  toolResult: ToolResult;
@@ -3166,7 +3026,7 @@ declare const finishToolCall: (setting: RunSetting, checkpoint: Checkpoint, data
3166
3026
  type: "finishToolCall";
3167
3027
  } & {
3168
3028
  newMessages: (UserMessage | ToolMessage)[];
3169
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3029
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3170
3030
  type: "finishToolCall";
3171
3031
  } & {
3172
3032
  newMessages: (UserMessage | ToolMessage)[];
@@ -3176,7 +3036,7 @@ declare const resumeToolCalls: (setting: RunSetting, checkpoint: Checkpoint, dat
3176
3036
  } & {
3177
3037
  pendingToolCalls: ToolCall[];
3178
3038
  partialToolResults: ToolResult[];
3179
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3039
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3180
3040
  type: "resumeToolCalls";
3181
3041
  } & {
3182
3042
  pendingToolCalls: ToolCall[];
@@ -3186,7 +3046,7 @@ declare const finishAllToolCalls: (setting: RunSetting, checkpoint: Checkpoint,
3186
3046
  type: "finishAllToolCalls";
3187
3047
  } & {
3188
3048
  newMessages: (UserMessage | ToolMessage)[];
3189
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3049
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3190
3050
  type: "finishAllToolCalls";
3191
3051
  } & {
3192
3052
  newMessages: (UserMessage | ToolMessage)[];
@@ -3198,7 +3058,7 @@ declare const completeRun: (setting: RunSetting, checkpoint: Checkpoint, data: O
3198
3058
  step: Step;
3199
3059
  text: string;
3200
3060
  usage: Usage;
3201
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3061
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3202
3062
  type: "completeRun";
3203
3063
  } & {
3204
3064
  checkpoint: Checkpoint;
@@ -3211,7 +3071,7 @@ declare const stopRunByInteractiveTool: (setting: RunSetting, checkpoint: Checkp
3211
3071
  } & {
3212
3072
  checkpoint: Checkpoint;
3213
3073
  step: Step;
3214
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3074
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3215
3075
  type: "stopRunByInteractiveTool";
3216
3076
  } & {
3217
3077
  checkpoint: Checkpoint;
@@ -3222,7 +3082,7 @@ declare const stopRunByDelegate: (setting: RunSetting, checkpoint: Checkpoint, d
3222
3082
  } & {
3223
3083
  checkpoint: Checkpoint;
3224
3084
  step: Step;
3225
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3085
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3226
3086
  type: "stopRunByDelegate";
3227
3087
  } & {
3228
3088
  checkpoint: Checkpoint;
@@ -3233,7 +3093,7 @@ declare const stopRunByExceededMaxSteps: (setting: RunSetting, checkpoint: Check
3233
3093
  } & {
3234
3094
  checkpoint: Checkpoint;
3235
3095
  step: Step;
3236
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3096
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3237
3097
  type: "stopRunByExceededMaxSteps";
3238
3098
  } & {
3239
3099
  checkpoint: Checkpoint;
@@ -3245,7 +3105,7 @@ declare const continueToNextStep: (setting: RunSetting, checkpoint: Checkpoint,
3245
3105
  checkpoint: Checkpoint;
3246
3106
  step: Step;
3247
3107
  nextCheckpoint: Checkpoint;
3248
- }, "id" | "type" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3108
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3249
3109
  type: "continueToNextStep";
3250
3110
  } & {
3251
3111
  checkpoint: Checkpoint;
@@ -3267,6 +3127,7 @@ interface BaseRuntimeEvent {
3267
3127
  type RuntimeEventPayloads = {
3268
3128
  initializeRuntime: {
3269
3129
  runtimeVersion: string;
3130
+ runtime?: string;
3270
3131
  expertName: string;
3271
3132
  experts: string[];
3272
3133
  model: string;
@@ -3302,6 +3163,29 @@ type RuntimeEventPayloads = {
3302
3163
  skillDisconnected: {
3303
3164
  skillName: string;
3304
3165
  };
3166
+ streamingText: {
3167
+ text: string;
3168
+ };
3169
+ /** Docker build progress event */
3170
+ dockerBuildProgress: {
3171
+ stage: "pulling" | "building" | "complete" | "error";
3172
+ service: string;
3173
+ message: string;
3174
+ progress?: number;
3175
+ };
3176
+ /** Docker container status event */
3177
+ dockerContainerStatus: {
3178
+ status: "starting" | "running" | "healthy" | "unhealthy" | "stopped" | "error";
3179
+ service: string;
3180
+ message?: string;
3181
+ };
3182
+ /** Proxy access event (allow/block) */
3183
+ proxyAccess: {
3184
+ action: "allowed" | "blocked";
3185
+ domain: string;
3186
+ port: number;
3187
+ reason?: string;
3188
+ };
3305
3189
  };
3306
3190
  /** All runtime event types */
3307
3191
  type RuntimeEventType = keyof RuntimeEventPayloads;
@@ -3318,6 +3202,300 @@ type RuntimeEventForType<T extends RuntimeEventType> = Extract<RuntimeEvent, {
3318
3202
  /** Factory function to create runtime events */
3319
3203
  declare function createRuntimeEvent<T extends RuntimeEventType>(type: T, jobId: string, runId: string, data: Omit<RuntimeEventForType<T>, "type" | "id" | "timestamp" | "jobId" | "runId">): RuntimeEventForType<T>;
3320
3204
 
3205
+ type AdapterRunParams = {
3206
+ setting: RunParamsInput["setting"];
3207
+ config?: PerstackConfig;
3208
+ checkpoint?: Checkpoint;
3209
+ eventListener?: (event: RunEvent | RuntimeEvent) => void;
3210
+ storeCheckpoint?: (checkpoint: Checkpoint) => Promise<void>;
3211
+ retrieveCheckpoint?: (jobId: string, checkpointId: string) => Promise<Checkpoint>;
3212
+ workspace?: string;
3213
+ };
3214
+ type AdapterRunResult = {
3215
+ checkpoint: Checkpoint;
3216
+ events: (RunEvent | RuntimeEvent)[];
3217
+ };
3218
+ interface RuntimeAdapter {
3219
+ readonly name: string;
3220
+ checkPrerequisites(): Promise<PrerequisiteResult>;
3221
+ convertExpert(expert: Expert): RuntimeExpertConfig;
3222
+ run(params: AdapterRunParams): Promise<AdapterRunResult>;
3223
+ }
3224
+ type PrerequisiteResult = {
3225
+ ok: true;
3226
+ } | {
3227
+ ok: false;
3228
+ error: PrerequisiteError;
3229
+ };
3230
+ type PrerequisiteError = {
3231
+ type: "cli-not-found" | "auth-missing" | "version-mismatch";
3232
+ message: string;
3233
+ helpUrl?: string;
3234
+ };
3235
+ type RuntimeExpertConfig = {
3236
+ instruction: string;
3237
+ };
3238
+
3239
+ type ExecResult = {
3240
+ stdout: string;
3241
+ stderr: string;
3242
+ exitCode: number;
3243
+ };
3244
+ declare abstract class BaseAdapter implements RuntimeAdapter {
3245
+ abstract readonly name: string;
3246
+ abstract checkPrerequisites(): Promise<PrerequisiteResult>;
3247
+ abstract run(params: AdapterRunParams): Promise<AdapterRunResult>;
3248
+ convertExpert(expert: Expert): RuntimeExpertConfig;
3249
+ protected execCommand(args: string[]): Promise<ExecResult>;
3250
+ protected executeWithTimeout(proc: ChildProcess, timeout: number): Promise<ExecResult>;
3251
+ }
3252
+
3253
+ declare function createEmptyUsage(): Usage;
3254
+ type CreateCheckpointParams = {
3255
+ jobId: string;
3256
+ runId: string;
3257
+ expertKey: string;
3258
+ expert: {
3259
+ key: string;
3260
+ name: string;
3261
+ version: string;
3262
+ };
3263
+ output: string;
3264
+ runtime: RuntimeName;
3265
+ };
3266
+ declare function createNormalizedCheckpoint(params: CreateCheckpointParams): Checkpoint;
3267
+ declare function createStartRunEvent(jobId: string, runId: string, expertKey: string, checkpoint: Checkpoint): RunEvent;
3268
+ declare function createRuntimeInitEvent(jobId: string, runId: string, expertName: string, runtime: RuntimeName, version: string, query?: string): RuntimeEvent;
3269
+ declare function createCompleteRunEvent(jobId: string, runId: string, expertKey: string, checkpoint: Checkpoint, output: string, startedAt?: number): RunEvent;
3270
+ declare function createStreamingTextEvent(jobId: string, runId: string, text: string): RuntimeEvent;
3271
+ declare function createCallToolsEvent(jobId: string, runId: string, expertKey: string, stepNumber: number, toolCalls: ToolCall[], _checkpoint: Checkpoint): RunEvent;
3272
+ declare function createResolveToolResultsEvent(jobId: string, runId: string, expertKey: string, stepNumber: number, toolResults: ToolResult[]): RunEvent;
3273
+ declare function createToolMessage(toolCallId: string, toolName: string, resultText: string): ToolMessage;
3274
+
3275
+ declare function registerAdapter(runtime: RuntimeName, factory: () => RuntimeAdapter): void;
3276
+ declare function getAdapter(runtime: RuntimeName): RuntimeAdapter;
3277
+ declare function isAdapterAvailable(runtime: RuntimeName): boolean;
3278
+ declare function getRegisteredRuntimes(): RuntimeName[];
3279
+
3280
+ declare const defaultPerstackApiBaseUrl = "https://api.perstack.ai";
3281
+ declare const organizationNameRegex: RegExp;
3282
+ declare const maxOrganizationNameLength = 128;
3283
+ declare const maxApplicationNameLength = 255;
3284
+ declare const expertKeyRegex: RegExp;
3285
+ declare const expertNameRegex: RegExp;
3286
+ declare const expertVersionRegex: RegExp;
3287
+ declare const tagNameRegex: RegExp;
3288
+ declare const maxExpertNameLength = 255;
3289
+ declare const maxExpertVersionTagLength = 255;
3290
+ declare const maxExpertKeyLength = 511;
3291
+ declare const maxExpertDescriptionLength: number;
3292
+ declare const maxExpertInstructionLength: number;
3293
+ declare const maxExpertSkillItems = 255;
3294
+ declare const maxExpertDelegateItems = 255;
3295
+ declare const maxExpertTagItems = 8;
3296
+ declare const defaultTemperature = 0;
3297
+ declare const defaultMaxSteps = 100;
3298
+ declare const defaultMaxRetries = 5;
3299
+ declare const defaultTimeout: number;
3300
+ declare const maxExpertJobQueryLength: number;
3301
+ declare const maxExpertJobFileNameLength: number;
3302
+ declare const packageWithVersionRegex: RegExp;
3303
+ declare const urlSafeRegex: RegExp;
3304
+ declare const maxSkillNameLength = 255;
3305
+ declare const maxSkillDescriptionLength: number;
3306
+ declare const maxSkillRuleLength: number;
3307
+ declare const maxSkillPickOmitItems = 255;
3308
+ declare const maxSkillRequiredEnvItems = 255;
3309
+ declare const maxSkillToolNameLength = 255;
3310
+ declare const maxSkillEndpointLength: number;
3311
+ declare const maxSkillInputJsonSchemaLength: number;
3312
+ declare const maxSkillToolItems = 255;
3313
+ declare const maxCheckpointToolCallIdLength = 255;
3314
+ declare const envNameRegex: RegExp;
3315
+ declare const maxEnvNameLength = 255;
3316
+
3317
+ declare const knownModels: {
3318
+ provider: string;
3319
+ models: {
3320
+ name: string;
3321
+ contextWindow: number;
3322
+ maxOutputTokens: number;
3323
+ }[];
3324
+ }[];
3325
+
3326
+ type JobStatus = "running" | "completed" | "stoppedByMaxSteps" | "stoppedByInteractiveTool" | "stoppedByError";
3327
+ declare const jobStatusSchema: z.ZodEnum<{
3328
+ completed: "completed";
3329
+ stoppedByInteractiveTool: "stoppedByInteractiveTool";
3330
+ stoppedByError: "stoppedByError";
3331
+ running: "running";
3332
+ stoppedByMaxSteps: "stoppedByMaxSteps";
3333
+ }>;
3334
+ interface Job {
3335
+ id: string;
3336
+ status: JobStatus;
3337
+ coordinatorExpertKey: string;
3338
+ totalSteps: number;
3339
+ maxSteps?: number;
3340
+ usage: Usage;
3341
+ startedAt: number;
3342
+ finishedAt?: number;
3343
+ }
3344
+ declare const jobSchema: z.ZodObject<{
3345
+ id: z.ZodString;
3346
+ status: z.ZodEnum<{
3347
+ completed: "completed";
3348
+ stoppedByInteractiveTool: "stoppedByInteractiveTool";
3349
+ stoppedByError: "stoppedByError";
3350
+ running: "running";
3351
+ stoppedByMaxSteps: "stoppedByMaxSteps";
3352
+ }>;
3353
+ coordinatorExpertKey: z.ZodString;
3354
+ totalSteps: z.ZodNumber;
3355
+ maxSteps: z.ZodOptional<z.ZodNumber>;
3356
+ usage: z.ZodObject<{
3357
+ inputTokens: z.ZodNumber;
3358
+ outputTokens: z.ZodNumber;
3359
+ reasoningTokens: z.ZodNumber;
3360
+ totalTokens: z.ZodNumber;
3361
+ cachedInputTokens: z.ZodNumber;
3362
+ }, z.core.$strip>;
3363
+ startedAt: z.ZodNumber;
3364
+ finishedAt: z.ZodOptional<z.ZodNumber>;
3365
+ }, z.core.$strip>;
3366
+
3367
+ /** Parsed command options after transformation */
3368
+ interface CommandOptions {
3369
+ /** Path to perstack.toml config file */
3370
+ config?: string;
3371
+ /** LLM provider to use */
3372
+ provider?: ProviderName;
3373
+ /** Model name */
3374
+ model?: string;
3375
+ /** Temperature (0-1) */
3376
+ temperature?: number;
3377
+ /** Maximum steps */
3378
+ maxSteps?: number;
3379
+ /** Maximum retries */
3380
+ maxRetries?: number;
3381
+ /** Timeout in milliseconds */
3382
+ timeout?: number;
3383
+ /** Custom job ID */
3384
+ jobId?: string;
3385
+ /** Custom run ID */
3386
+ runId?: string;
3387
+ /** Paths to .env files */
3388
+ envPath?: string[];
3389
+ /** Enable verbose logging */
3390
+ verbose?: boolean;
3391
+ /** Continue most recent job */
3392
+ continue?: boolean;
3393
+ /** Continue specific job by ID */
3394
+ continueJob?: string;
3395
+ /** Resume from specific checkpoint (requires --continue or --continue-job) */
3396
+ resumeFrom?: string;
3397
+ /** Query is interactive tool call result */
3398
+ interactiveToolCallResult?: boolean;
3399
+ /** Execution runtime */
3400
+ runtime?: RuntimeName;
3401
+ /** Workspace directory for Docker runtime */
3402
+ workspace?: string;
3403
+ }
3404
+ /** Input for the `perstack run` command */
3405
+ interface RunCommandInput {
3406
+ /** Expert key to run */
3407
+ expertKey: string;
3408
+ /** Query or prompt */
3409
+ query: string;
3410
+ /** Command options */
3411
+ options: CommandOptions;
3412
+ }
3413
+ declare const runCommandInputSchema: z.ZodObject<{
3414
+ expertKey: z.ZodString;
3415
+ query: z.ZodString;
3416
+ options: z.ZodObject<{
3417
+ config: z.ZodOptional<z.ZodString>;
3418
+ provider: z.ZodOptional<z.ZodEnum<{
3419
+ anthropic: "anthropic";
3420
+ google: "google";
3421
+ openai: "openai";
3422
+ ollama: "ollama";
3423
+ "azure-openai": "azure-openai";
3424
+ "amazon-bedrock": "amazon-bedrock";
3425
+ "google-vertex": "google-vertex";
3426
+ deepseek: "deepseek";
3427
+ }>>;
3428
+ model: z.ZodOptional<z.ZodString>;
3429
+ temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3430
+ maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3431
+ maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3432
+ timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3433
+ jobId: z.ZodOptional<z.ZodString>;
3434
+ runId: z.ZodOptional<z.ZodString>;
3435
+ envPath: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
3436
+ verbose: z.ZodOptional<z.ZodBoolean>;
3437
+ continue: z.ZodOptional<z.ZodBoolean>;
3438
+ continueJob: z.ZodOptional<z.ZodString>;
3439
+ resumeFrom: z.ZodOptional<z.ZodString>;
3440
+ interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
3441
+ runtime: z.ZodOptional<z.ZodEnum<{
3442
+ local: "local";
3443
+ cursor: "cursor";
3444
+ "claude-code": "claude-code";
3445
+ gemini: "gemini";
3446
+ docker: "docker";
3447
+ }>>;
3448
+ workspace: z.ZodOptional<z.ZodString>;
3449
+ }, z.core.$strip>;
3450
+ }, z.core.$strip>;
3451
+ /** Input for the `perstack start` command */
3452
+ interface StartCommandInput {
3453
+ /** Expert key to run (optional, prompts if not provided) */
3454
+ expertKey?: string;
3455
+ /** Query or prompt (optional, prompts if not provided) */
3456
+ query?: string;
3457
+ /** Command options */
3458
+ options: CommandOptions;
3459
+ }
3460
+ declare const startCommandInputSchema: z.ZodObject<{
3461
+ expertKey: z.ZodOptional<z.ZodString>;
3462
+ query: z.ZodOptional<z.ZodString>;
3463
+ options: z.ZodObject<{
3464
+ config: z.ZodOptional<z.ZodString>;
3465
+ provider: z.ZodOptional<z.ZodEnum<{
3466
+ anthropic: "anthropic";
3467
+ google: "google";
3468
+ openai: "openai";
3469
+ ollama: "ollama";
3470
+ "azure-openai": "azure-openai";
3471
+ "amazon-bedrock": "amazon-bedrock";
3472
+ "google-vertex": "google-vertex";
3473
+ deepseek: "deepseek";
3474
+ }>>;
3475
+ model: z.ZodOptional<z.ZodString>;
3476
+ temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3477
+ maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3478
+ maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3479
+ timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3480
+ jobId: z.ZodOptional<z.ZodString>;
3481
+ runId: z.ZodOptional<z.ZodString>;
3482
+ envPath: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
3483
+ verbose: z.ZodOptional<z.ZodBoolean>;
3484
+ continue: z.ZodOptional<z.ZodBoolean>;
3485
+ continueJob: z.ZodOptional<z.ZodString>;
3486
+ resumeFrom: z.ZodOptional<z.ZodString>;
3487
+ interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
3488
+ runtime: z.ZodOptional<z.ZodEnum<{
3489
+ local: "local";
3490
+ cursor: "cursor";
3491
+ "claude-code": "claude-code";
3492
+ gemini: "gemini";
3493
+ docker: "docker";
3494
+ }>>;
3495
+ workspace: z.ZodOptional<z.ZodString>;
3496
+ }, z.core.$strip>;
3497
+ }, z.core.$strip>;
3498
+
3321
3499
  /** Discriminator for skill manager types */
3322
3500
  type SkillType = "mcp" | "interactive" | "delegate";
3323
3501
  /** Parameters for initializing an MCP-based skill manager (stdio or SSE) */
@@ -3380,7 +3558,10 @@ type Resource = {
3380
3558
  blob?: string;
3381
3559
  };
3382
3560
 
3561
+ declare const SAFE_ENV_VARS: string[];
3562
+ declare function getFilteredEnv(additional?: Record<string, string>): Record<string, string>;
3563
+
3383
3564
  declare function formatZodError(error: ZodError): string;
3384
3565
  declare function parseWithFriendlyError<T>(schema: ZodSchema<T>, data: unknown, context?: string): T;
3385
3566
 
3386
- export { type AmazonBedrockProviderConfig, type AnthropicProviderConfig, type AzureOpenAiProviderConfig, type BaseEvent, type BasePart, type CallToolResultContent, type Checkpoint, type CheckpointStatus, type CommandOptions, type DeepseekProviderConfig, type DelegateSkillManagerParams, type DelegationTarget, type EventForType, type EventType, type Expert, type ExpertMessage, type FileBinaryPart, type FileInlinePart, type FileUrlPart, type GoogleGenerativeAiProviderConfig, type GoogleVertexProviderConfig, type Headers, type ImageBinaryPart, type ImageInlinePart, type ImageUrlPart, type InstructionMessage, type InteractiveSkill, type InteractiveSkillManagerParams, type InteractiveTool, type Job, type JobStatus, type McpSkillManagerParams, type McpSseSkill, type McpStdioSkill, type Message, type MessagePart, type OllamaProviderConfig, type OpenAiProviderConfig, type PerstackConfig, type PerstackConfigExpert, type PerstackConfigSkill, type ProviderConfig, type ProviderName, type ProviderTable, type Resource, type RunCommandInput, type RunEvent, type RunInput, type RunParams, type RunParamsInput, type RunSetting, type RuntimeEvent, type RuntimeEventForType, type RuntimeEventType, type Skill, type SkillManagerParams, type SkillType, type StartCommandInput, type Step, type TextPart, type ToolCall, type ToolCallPart, type ToolDefinition, type ToolMessage, type ToolResult, type ToolResultPart, type Usage, type UserMessage, amazonBedrockProviderConfigSchema, anthropicProviderConfigSchema, attemptCompletion, azureOpenAiProviderConfigSchema, basePartSchema, callDelegate, callInteractiveTool, callTools, checkpointSchema, checkpointStatusSchema, completeRun, continueToNextStep, createEvent, createRuntimeEvent, deepseekProviderConfigSchema, defaultMaxRetries, defaultMaxSteps, defaultPerstackApiBaseUrl, defaultTemperature, defaultTimeout, delegationTargetSchema, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileUrlPartSchema, finishAllToolCalls, finishToolCall, formatZodError, googleGenerativeAiProviderConfigSchema, googleVertexProviderConfigSchema, headersSchema, imageBinaryPartSchema, imageInlinePartSchema, imageUrlPartSchema, instructionMessageSchema, interactiveSkillSchema, interactiveToolSchema, jobSchema, jobStatusSchema, knownModels, maxApplicationNameLength, maxCheckpointToolCallIdLength, maxEnvNameLength, maxExpertDelegateItems, maxExpertDescriptionLength, maxExpertInstructionLength, maxExpertJobFileNameLength, maxExpertJobQueryLength, maxExpertKeyLength, maxExpertNameLength, maxExpertSkillItems, maxExpertTagItems, maxExpertVersionTagLength, maxOrganizationNameLength, maxSkillDescriptionLength, maxSkillEndpointLength, maxSkillInputJsonSchemaLength, maxSkillNameLength, maxSkillPickOmitItems, maxSkillRequiredEnvItems, maxSkillRuleLength, maxSkillToolItems, maxSkillToolNameLength, mcpSseSkillSchema, mcpStdioSkillSchema, messagePartSchema, messageSchema, ollamaProviderConfigSchema, openAiProviderConfigSchema, organizationNameRegex, packageWithVersionRegex, parseExpertKey, parseWithFriendlyError, perstackConfigSchema, providerConfigSchema, providerNameSchema, providerTableSchema, resolveThought, resolveToolResults, resumeToolCalls, retry, runCommandInputSchema, runParamsSchema, runSettingSchema, skillSchema, startCommandInputSchema, startGeneration, startRun, stepSchema, stopRunByDelegate, stopRunByExceededMaxSteps, stopRunByInteractiveTool, tagNameRegex, textPartSchema, toolCallPartSchema, toolCallSchema, toolMessageSchema, toolResultPartSchema, toolResultSchema, urlSafeRegex, usageSchema, userMessageSchema };
3567
+ export { type AdapterRunParams, type AdapterRunResult, type AmazonBedrockProviderConfig, type AnthropicProviderConfig, type AzureOpenAiProviderConfig, BaseAdapter, type BaseEvent, type BasePart, type CallToolResultContent, type Checkpoint, type CheckpointStatus, type CommandOptions, type CreateCheckpointParams, type DeepseekProviderConfig, type DelegateSkillManagerParams, type DelegationTarget, type EventForType, type EventType, type ExecResult, type Expert, type ExpertMessage, type FileBinaryPart, type FileInlinePart, type FileUrlPart, type GoogleGenerativeAiProviderConfig, type GoogleVertexProviderConfig, type Headers, type ImageBinaryPart, type ImageInlinePart, type ImageUrlPart, type InstructionMessage, type InteractiveSkill, type InteractiveSkillManagerParams, type InteractiveTool, type Job, type JobStatus, type McpSkillManagerParams, type McpSseSkill, type McpStdioSkill, type Message, type MessagePart, type OllamaProviderConfig, type OpenAiProviderConfig, type PerstackConfig, type PerstackConfigExpert, type PerstackConfigSkill, type PrerequisiteError, type PrerequisiteResult, type ProviderConfig, type ProviderName, type ProviderTable, type Resource, type RunCommandInput, type RunEvent, type RunInput, type RunParams, type RunParamsInput, type RunSetting, type RuntimeAdapter, type RuntimeEvent, type RuntimeEventForType, type RuntimeEventType, type RuntimeExpertConfig, type RuntimeName, SAFE_ENV_VARS, type Skill, type SkillManagerParams, type SkillType, type StartCommandInput, type Step, type TextPart, type ToolCall, type ToolCallPart, type ToolDefinition, type ToolMessage, type ToolResult, type ToolResultPart, type Usage, type UserMessage, amazonBedrockProviderConfigSchema, anthropicProviderConfigSchema, attemptCompletion, azureOpenAiProviderConfigSchema, basePartSchema, callDelegate, callInteractiveTool, callTools, checkpointSchema, checkpointStatusSchema, completeRun, continueToNextStep, createCallToolsEvent, createCompleteRunEvent, createEmptyUsage, createEvent, createNormalizedCheckpoint, createResolveToolResultsEvent, createRuntimeEvent, createRuntimeInitEvent, createStartRunEvent, createStreamingTextEvent, createToolMessage, deepseekProviderConfigSchema, defaultMaxRetries, defaultMaxSteps, defaultPerstackApiBaseUrl, defaultTemperature, defaultTimeout, delegationTargetSchema, domainPatternSchema, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileUrlPartSchema, finishAllToolCalls, finishToolCall, formatZodError, getAdapter, getFilteredEnv, getRegisteredRuntimes, googleGenerativeAiProviderConfigSchema, googleVertexProviderConfigSchema, headersSchema, imageBinaryPartSchema, imageInlinePartSchema, imageUrlPartSchema, instructionMessageSchema, interactiveSkillSchema, interactiveToolSchema, isAdapterAvailable, jobSchema, jobStatusSchema, knownModels, maxApplicationNameLength, maxCheckpointToolCallIdLength, maxEnvNameLength, maxExpertDelegateItems, maxExpertDescriptionLength, maxExpertInstructionLength, maxExpertJobFileNameLength, maxExpertJobQueryLength, maxExpertKeyLength, maxExpertNameLength, maxExpertSkillItems, maxExpertTagItems, maxExpertVersionTagLength, maxOrganizationNameLength, maxSkillDescriptionLength, maxSkillEndpointLength, maxSkillInputJsonSchemaLength, maxSkillNameLength, maxSkillPickOmitItems, maxSkillRequiredEnvItems, maxSkillRuleLength, maxSkillToolItems, maxSkillToolNameLength, mcpSseSkillSchema, mcpStdioSkillSchema, messagePartSchema, messageSchema, ollamaProviderConfigSchema, openAiProviderConfigSchema, organizationNameRegex, packageWithVersionRegex, parseExpertKey, parseWithFriendlyError, perstackConfigSchema, providerConfigSchema, providerNameSchema, providerTableSchema, registerAdapter, resolveThought, resolveToolResults, resumeToolCalls, retry, runCommandInputSchema, runParamsSchema, runSettingSchema, runtimeNameSchema, skillSchema, startCommandInputSchema, startGeneration, startRun, stepSchema, stopRunByDelegate, stopRunByExceededMaxSteps, stopRunByInteractiveTool, tagNameRegex, textPartSchema, toolCallPartSchema, toolCallSchema, toolMessageSchema, toolResultPartSchema, toolResultSchema, urlSafeRegex, usageSchema, userMessageSchema };