@perstack/core 0.0.21 → 0.0.23

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,108 +1,343 @@
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;
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;
106
341
  type: z.ZodLiteral<"imageBinaryPart">;
107
342
  data: z.ZodString;
108
343
  mimeType: z.ZodString;
@@ -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 = "perstack" | "cursor" | "claude-code" | "gemini" | "docker";
727
+ declare const runtimeNameSchema: z.ZodEnum<{
728
+ perstack: "perstack";
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 */
@@ -617,6 +861,17 @@ declare const checkpointStatusSchema: z.ZodEnum<{
617
861
  stoppedByExceededMaxSteps: "stoppedByExceededMaxSteps";
618
862
  stoppedByError: "stoppedByError";
619
863
  }>;
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
+ }
620
875
  /**
621
876
  * A checkpoint represents a point-in-time snapshot of an Expert's execution state.
622
877
  * Used for resuming, debugging, and observability.
@@ -624,11 +879,13 @@ declare const checkpointStatusSchema: z.ZodEnum<{
624
879
  interface Checkpoint {
625
880
  /** Unique identifier for this checkpoint */
626
881
  id: string;
882
+ /** Job ID this checkpoint belongs to */
883
+ jobId: string;
627
884
  /** Run ID this checkpoint belongs to */
628
885
  runId: string;
629
886
  /** Current execution status */
630
887
  status: CheckpointStatus;
631
- /** Current step number */
888
+ /** Current step number within this Run */
632
889
  stepNumber: number;
633
890
  /** All messages in the conversation so far */
634
891
  messages: Message[];
@@ -641,21 +898,8 @@ interface Checkpoint {
641
898
  /** Expert version */
642
899
  version: string;
643
900
  };
644
- /** If delegating, information about the target Expert */
645
- delegateTo?: {
646
- /** The Expert being delegated to */
647
- expert: {
648
- key: string;
649
- name: string;
650
- version: string;
651
- };
652
- /** Tool call ID that triggered delegation */
653
- toolCallId: string;
654
- /** Name of the delegation tool */
655
- toolName: string;
656
- /** Query passed to the delegate */
657
- query: string;
658
- };
901
+ /** If delegating, information about the target Expert(s) - supports parallel delegation */
902
+ delegateTo?: DelegationTarget[];
659
903
  /** If delegated, information about the parent Expert */
660
904
  delegatedBy?: {
661
905
  /** The parent Expert that delegated */
@@ -681,9 +925,27 @@ interface Checkpoint {
681
925
  pendingToolCalls?: ToolCall[];
682
926
  /** Partial tool results collected before stopping (for resume) */
683
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
+ };
684
935
  }
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>;
685
946
  declare const checkpointSchema: z.ZodObject<{
686
947
  id: z.ZodString;
948
+ jobId: z.ZodString;
687
949
  runId: z.ZodString;
688
950
  status: z.ZodEnum<{
689
951
  init: "init";
@@ -772,408 +1034,138 @@ declare const checkpointSchema: z.ZodObject<{
772
1034
  text: z.ZodString;
773
1035
  }, z.core.$strip>, z.ZodObject<{
774
1036
  id: z.ZodString;
775
- type: z.ZodLiteral<"imageInlinePart">;
776
- encodedData: z.ZodString;
777
- mimeType: z.ZodString;
778
- }, z.core.$strip>, z.ZodObject<{
779
- id: z.ZodString;
780
- type: z.ZodLiteral<"fileInlinePart">;
781
- encodedData: z.ZodString;
782
- mimeType: z.ZodString;
783
- }, z.core.$strip>]>>;
784
- isError: z.ZodOptional<z.ZodBoolean>;
785
- }, z.core.$strip>>;
786
- cache: z.ZodOptional<z.ZodBoolean>;
787
- }, z.core.$strip>]>>;
788
- expert: z.ZodObject<{
789
- key: z.ZodString;
790
- name: z.ZodString;
791
- version: z.ZodString;
792
- }, z.core.$strip>;
793
- delegateTo: z.ZodOptional<z.ZodObject<{
794
- expert: z.ZodObject<{
795
- key: z.ZodString;
796
- name: z.ZodString;
797
- version: z.ZodString;
798
- }, z.core.$strip>;
799
- toolCallId: z.ZodString;
800
- toolName: z.ZodString;
801
- query: z.ZodString;
802
- }, z.core.$strip>>;
803
- delegatedBy: z.ZodOptional<z.ZodObject<{
804
- expert: z.ZodObject<{
805
- key: z.ZodString;
806
- name: z.ZodString;
807
- version: z.ZodString;
808
- }, z.core.$strip>;
809
- toolCallId: z.ZodString;
810
- toolName: z.ZodString;
811
- checkpointId: z.ZodString;
812
- }, z.core.$strip>>;
813
- usage: z.ZodObject<{
814
- inputTokens: z.ZodNumber;
815
- outputTokens: z.ZodNumber;
816
- reasoningTokens: z.ZodNumber;
817
- totalTokens: z.ZodNumber;
818
- cachedInputTokens: z.ZodNumber;
819
- }, z.core.$strip>;
820
- contextWindow: z.ZodOptional<z.ZodNumber>;
821
- contextWindowUsage: z.ZodOptional<z.ZodNumber>;
822
- pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
823
- id: z.ZodString;
824
- skillName: z.ZodString;
825
- toolName: z.ZodString;
826
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
827
- }, z.core.$strip>>>;
828
- partialToolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
829
- id: z.ZodString;
830
- skillName: z.ZodString;
831
- toolName: z.ZodString;
832
- result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
833
- id: z.ZodString;
834
- type: z.ZodLiteral<"textPart">;
835
- text: z.ZodString;
836
- }, z.core.$strip>, z.ZodObject<{
837
- id: z.ZodString;
838
- type: z.ZodLiteral<"imageUrlPart">;
839
- url: z.ZodURL;
840
- mimeType: z.ZodString;
841
- }, z.core.$strip>, z.ZodObject<{
842
- id: z.ZodString;
843
- type: z.ZodLiteral<"imageInlinePart">;
844
- encodedData: z.ZodString;
845
- mimeType: z.ZodString;
846
- }, z.core.$strip>, z.ZodObject<{
847
- id: z.ZodString;
848
- type: z.ZodLiteral<"imageBinaryPart">;
849
- data: z.ZodString;
850
- mimeType: z.ZodString;
851
- }, z.core.$strip>, z.ZodObject<{
852
- id: z.ZodString;
853
- type: z.ZodLiteral<"fileUrlPart">;
854
- url: z.ZodString;
855
- mimeType: z.ZodString;
856
- }, z.core.$strip>, z.ZodObject<{
857
- id: z.ZodString;
858
- type: z.ZodLiteral<"fileInlinePart">;
859
- encodedData: z.ZodString;
860
- mimeType: z.ZodString;
861
- }, z.core.$strip>, z.ZodObject<{
862
- id: z.ZodString;
863
- type: z.ZodLiteral<"fileBinaryPart">;
864
- data: z.ZodString;
865
- mimeType: z.ZodString;
866
- }, z.core.$strip>, z.ZodObject<{
867
- id: z.ZodString;
868
- type: z.ZodLiteral<"toolCallPart">;
869
- toolCallId: z.ZodString;
870
- toolName: z.ZodString;
871
- args: z.ZodUnknown;
872
- }, z.core.$strip>, z.ZodObject<{
873
- id: z.ZodString;
874
- type: z.ZodLiteral<"toolResultPart">;
875
- toolCallId: z.ZodString;
876
- toolName: z.ZodString;
877
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
878
- id: z.ZodString;
879
- type: z.ZodLiteral<"textPart">;
880
- text: z.ZodString;
881
- }, z.core.$strip>, z.ZodObject<{
882
- id: z.ZodString;
883
- type: z.ZodLiteral<"imageInlinePart">;
884
- encodedData: z.ZodString;
885
- mimeType: z.ZodString;
886
- }, z.core.$strip>, z.ZodObject<{
887
- id: z.ZodString;
888
- type: z.ZodLiteral<"fileInlinePart">;
889
- encodedData: z.ZodString;
890
- mimeType: z.ZodString;
891
- }, z.core.$strip>]>>;
892
- isError: z.ZodOptional<z.ZodBoolean>;
893
- }, z.core.$strip>], "type">>;
894
- }, z.core.$strip>>>;
895
- }, z.core.$strip>;
896
-
897
- /** MCP skill using stdio transport */
898
- interface McpStdioSkill {
899
- type: "mcpStdioSkill";
900
- /** Skill name (derived from key) */
901
- name: string;
902
- /** Human-readable description */
903
- description?: string;
904
- /** Usage rules for the LLM */
905
- rule?: string;
906
- /** Tool names to include (whitelist) */
907
- pick: string[];
908
- /** Tool names to exclude (blacklist) */
909
- omit: string[];
910
- /** Command to execute (e.g., "npx") */
911
- command: string;
912
- /** Package name for npx/uvx */
913
- packageName?: string;
914
- /** Additional arguments */
915
- args: string[];
916
- /** Environment variables required by this skill */
917
- requiredEnv: string[];
918
- /** Whether to delay initialization until first use */
919
- lazyInit: boolean;
920
- }
921
- declare const mcpStdioSkillSchema: z.ZodObject<{
922
- type: z.ZodLiteral<"mcpStdioSkill">;
923
- name: z.ZodString;
924
- description: z.ZodOptional<z.ZodString>;
925
- rule: z.ZodOptional<z.ZodString>;
926
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
927
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
928
- command: z.ZodString;
929
- packageName: z.ZodOptional<z.ZodString>;
930
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
931
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
932
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
933
- }, z.core.$strip>;
934
- /** MCP skill using SSE transport */
935
- interface McpSseSkill {
936
- type: "mcpSseSkill";
937
- /** Skill name (derived from key) */
938
- name: string;
939
- /** Human-readable description */
940
- description?: string;
941
- /** Usage rules for the LLM */
942
- rule?: string;
943
- /** Tool names to include (whitelist) */
944
- pick: string[];
945
- /** Tool names to exclude (blacklist) */
946
- omit: string[];
947
- /** SSE endpoint URL */
948
- endpoint: string;
949
- }
950
- declare const mcpSseSkillSchema: z.ZodObject<{
951
- type: z.ZodLiteral<"mcpSseSkill">;
952
- name: z.ZodString;
953
- description: z.ZodOptional<z.ZodString>;
954
- rule: z.ZodOptional<z.ZodString>;
955
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
956
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
957
- endpoint: z.ZodString;
958
- }, z.core.$strip>;
959
- /** Definition of an interactive tool within an interactive skill */
960
- interface InteractiveTool {
961
- /** Tool name */
962
- name: string;
963
- /** Human-readable description */
964
- description?: string;
965
- /** JSON Schema for tool input as a string */
966
- inputJsonSchema: string;
967
- }
968
- declare const interactiveToolSchema: z.ZodObject<{
969
- name: z.ZodString;
970
- description: z.ZodOptional<z.ZodString>;
971
- inputJsonSchema: z.ZodString;
972
- }, z.core.$strip>;
973
- /** Skill that requires human interaction to complete tool calls */
974
- interface InteractiveSkill {
975
- type: "interactiveSkill";
976
- /** Skill name (derived from key) */
977
- name: string;
978
- /** Human-readable description */
979
- description?: string;
980
- /** Usage rules for the LLM */
981
- rule?: string;
982
- /** Map of tool name to tool definition */
983
- tools: Record<string, InteractiveTool>;
984
- }
985
- declare const interactiveSkillSchema: z.ZodObject<{
986
- type: z.ZodLiteral<"interactiveSkill">;
987
- name: z.ZodString;
988
- description: z.ZodOptional<z.ZodString>;
989
- rule: z.ZodOptional<z.ZodString>;
990
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
991
- description: z.ZodOptional<z.ZodString>;
992
- inputJsonSchema: z.ZodString;
993
- }, z.core.$strip>>, z.ZodTransform<{
994
- [k: string]: {
995
- name: string;
996
- inputJsonSchema: string;
997
- description?: string | undefined;
998
- };
999
- }, Record<string, {
1000
- inputJsonSchema: string;
1001
- description?: string | undefined;
1002
- }>>>;
1003
- }, z.core.$strip>;
1004
- /** All possible skill types */
1005
- type Skill = McpStdioSkill | McpSseSkill | InteractiveSkill;
1006
- declare const skillSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1007
- type: z.ZodLiteral<"mcpStdioSkill">;
1008
- name: z.ZodString;
1009
- description: z.ZodOptional<z.ZodString>;
1010
- rule: z.ZodOptional<z.ZodString>;
1011
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1012
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1013
- command: z.ZodString;
1014
- packageName: z.ZodOptional<z.ZodString>;
1015
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1016
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1017
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1018
- }, z.core.$strip>, z.ZodObject<{
1019
- type: z.ZodLiteral<"mcpSseSkill">;
1020
- name: z.ZodString;
1021
- description: z.ZodOptional<z.ZodString>;
1022
- rule: z.ZodOptional<z.ZodString>;
1023
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1024
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1025
- endpoint: z.ZodString;
1026
- }, z.core.$strip>, z.ZodObject<{
1027
- type: z.ZodLiteral<"interactiveSkill">;
1028
- name: z.ZodString;
1029
- description: z.ZodOptional<z.ZodString>;
1030
- rule: z.ZodOptional<z.ZodString>;
1031
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1032
- description: z.ZodOptional<z.ZodString>;
1033
- inputJsonSchema: z.ZodString;
1034
- }, z.core.$strip>>, z.ZodTransform<{
1035
- [k: string]: {
1036
- name: string;
1037
- inputJsonSchema: string;
1038
- description?: string | undefined;
1039
- };
1040
- }, Record<string, {
1041
- inputJsonSchema: string;
1042
- description?: string | undefined;
1043
- }>>>;
1044
- }, z.core.$strip>], "type">;
1045
-
1046
- /**
1047
- * An Expert definition - an AI agent with specific skills and instructions.
1048
- * Experts can delegate to other Experts and use MCP tools.
1049
- */
1050
- interface Expert {
1051
- /** Unique key identifying this Expert (e.g., "my-expert" or "my-expert@1.0.0") */
1052
- key: string;
1053
- /** Display name for the Expert */
1054
- name: string;
1055
- /** Semantic version string */
1056
- version: string;
1057
- /** Human-readable description of what this Expert does */
1058
- description?: string;
1059
- /** System instruction defining the Expert's behavior */
1060
- instruction: string;
1061
- /** Map of skill name to skill configuration */
1062
- skills: Record<string, Skill>;
1063
- /** List of Expert keys this Expert can delegate to */
1064
- delegates: string[];
1065
- /** Tags for categorization and discovery */
1066
- tags: string[];
1067
- }
1068
- declare const expertSchema: z.ZodObject<{
1069
- key: z.ZodString;
1070
- name: z.ZodString;
1071
- version: z.ZodString;
1072
- description: z.ZodOptional<z.ZodString>;
1073
- instruction: z.ZodString;
1074
- skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1075
- type: z.ZodLiteral<"mcpStdioSkill">;
1076
- description: z.ZodOptional<z.ZodString>;
1077
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1078
- rule: z.ZodOptional<z.ZodString>;
1079
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1080
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1081
- command: z.ZodString;
1082
- packageName: z.ZodOptional<z.ZodString>;
1083
- requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1084
- lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1085
- }, z.core.$strip>, z.ZodObject<{
1086
- type: z.ZodLiteral<"mcpSseSkill">;
1087
- description: z.ZodOptional<z.ZodString>;
1088
- rule: z.ZodOptional<z.ZodString>;
1089
- pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1090
- omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1091
- endpoint: z.ZodString;
1092
- }, z.core.$strip>, z.ZodObject<{
1093
- type: z.ZodLiteral<"interactiveSkill">;
1094
- description: z.ZodOptional<z.ZodString>;
1095
- rule: z.ZodOptional<z.ZodString>;
1096
- tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
1097
- description: z.ZodOptional<z.ZodString>;
1098
- inputJsonSchema: z.ZodString;
1099
- }, z.core.$strip>>, z.ZodTransform<{
1100
- [k: string]: {
1101
- name: string;
1102
- inputJsonSchema: string;
1103
- description?: string | undefined;
1104
- };
1105
- }, Record<string, {
1106
- inputJsonSchema: string;
1107
- description?: string | undefined;
1108
- }>>>;
1109
- }, z.core.$strip>], "type">>>>, z.ZodTransform<{
1110
- [k: string]: {
1111
- type: "mcpStdioSkill";
1112
- name: string;
1113
- pick: string[];
1114
- omit: string[];
1115
- command: string;
1116
- args: string[];
1117
- requiredEnv: string[];
1118
- lazyInit: boolean;
1119
- description?: string | undefined;
1120
- rule?: string | undefined;
1121
- packageName?: string | undefined;
1122
- } | {
1123
- type: "mcpSseSkill";
1124
- name: string;
1125
- pick: string[];
1126
- omit: string[];
1127
- endpoint: string;
1128
- description?: string | undefined;
1129
- rule?: string | undefined;
1130
- } | {
1131
- type: "interactiveSkill";
1132
- name: string;
1133
- tools: {
1134
- [k: string]: {
1135
- name: string;
1136
- inputJsonSchema: string;
1137
- description?: string | undefined;
1138
- };
1139
- };
1140
- description?: string | undefined;
1141
- rule?: string | undefined;
1142
- };
1143
- }, Record<string, {
1144
- type: "mcpStdioSkill";
1145
- args: string[];
1146
- pick: string[];
1147
- omit: string[];
1148
- command: string;
1149
- requiredEnv: string[];
1150
- lazyInit: boolean;
1151
- description?: string | undefined;
1152
- rule?: string | undefined;
1153
- packageName?: string | undefined;
1154
- } | {
1155
- type: "mcpSseSkill";
1156
- pick: string[];
1157
- omit: string[];
1158
- endpoint: string;
1159
- description?: string | undefined;
1160
- rule?: string | undefined;
1161
- } | {
1162
- type: "interactiveSkill";
1163
- tools: {
1164
- [k: string]: {
1165
- name: string;
1166
- inputJsonSchema: string;
1167
- description?: string | undefined;
1168
- };
1169
- };
1170
- description?: string | undefined;
1171
- rule?: string | undefined;
1172
- }>>>;
1173
- delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
1174
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<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>>;
1075
+ usage: z.ZodObject<{
1076
+ inputTokens: z.ZodNumber;
1077
+ outputTokens: z.ZodNumber;
1078
+ reasoningTokens: z.ZodNumber;
1079
+ totalTokens: z.ZodNumber;
1080
+ cachedInputTokens: z.ZodNumber;
1081
+ }, z.core.$strip>;
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
+ perstack: "perstack";
1160
+ cursor: "cursor";
1161
+ "claude-code": "claude-code";
1162
+ gemini: "gemini";
1163
+ docker: "docker";
1164
+ }>>;
1165
+ }, z.core.$loose>>;
1175
1166
  }, z.core.$strip>;
1176
1167
 
1168
+ declare const domainPatternSchema: z.ZodString;
1177
1169
  declare const anthropicSettingSchema: z.ZodObject<{
1178
1170
  baseUrl: z.ZodOptional<z.ZodString>;
1179
1171
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -1306,6 +1298,7 @@ type PerstackConfigSkill = {
1306
1298
  packageName?: string;
1307
1299
  args?: string[];
1308
1300
  requiredEnv?: string[];
1301
+ allowedDomains?: string[];
1309
1302
  } | {
1310
1303
  type: "mcpSseSkill";
1311
1304
  description?: string;
@@ -1313,6 +1306,7 @@ type PerstackConfigSkill = {
1313
1306
  pick?: string[];
1314
1307
  omit?: string[];
1315
1308
  endpoint: string;
1309
+ allowedDomains?: string[];
1316
1310
  } | {
1317
1311
  type: "interactiveSkill";
1318
1312
  description?: string;
@@ -1350,6 +1344,8 @@ interface PerstackConfig {
1350
1344
  model?: string;
1351
1345
  /** Default temperature (0-1) */
1352
1346
  temperature?: number;
1347
+ /** Default execution runtime */
1348
+ runtime?: RuntimeName;
1353
1349
  /** Maximum steps per run */
1354
1350
  maxSteps?: number;
1355
1351
  /** Maximum retries on generation failure */
@@ -1424,6 +1420,13 @@ declare const perstackConfigSchema: z.ZodObject<{
1424
1420
  }, z.core.$strip>], "providerName">>;
1425
1421
  model: z.ZodOptional<z.ZodString>;
1426
1422
  temperature: z.ZodOptional<z.ZodNumber>;
1423
+ runtime: z.ZodOptional<z.ZodEnum<{
1424
+ perstack: "perstack";
1425
+ cursor: "cursor";
1426
+ "claude-code": "claude-code";
1427
+ gemini: "gemini";
1428
+ docker: "docker";
1429
+ }>>;
1427
1430
  maxSteps: z.ZodOptional<z.ZodNumber>;
1428
1431
  maxRetries: z.ZodOptional<z.ZodNumber>;
1429
1432
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -1442,6 +1445,7 @@ declare const perstackConfigSchema: z.ZodObject<{
1442
1445
  packageName: z.ZodOptional<z.ZodString>;
1443
1446
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1444
1447
  requiredEnv: z.ZodOptional<z.ZodArray<z.ZodString>>;
1448
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1445
1449
  }, z.core.$strip>, z.ZodObject<{
1446
1450
  type: z.ZodLiteral<"mcpSseSkill">;
1447
1451
  description: z.ZodOptional<z.ZodString>;
@@ -1449,6 +1453,7 @@ declare const perstackConfigSchema: z.ZodObject<{
1449
1453
  pick: z.ZodOptional<z.ZodArray<z.ZodString>>;
1450
1454
  omit: z.ZodOptional<z.ZodArray<z.ZodString>>;
1451
1455
  endpoint: z.ZodString;
1456
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1452
1457
  }, z.core.$strip>, z.ZodObject<{
1453
1458
  type: z.ZodLiteral<"interactiveSkill">;
1454
1459
  description: z.ZodOptional<z.ZodString>;
@@ -1475,11 +1480,11 @@ declare const providerNameSchema: z.ZodEnum<{
1475
1480
  anthropic: "anthropic";
1476
1481
  google: "google";
1477
1482
  openai: "openai";
1478
- deepseek: "deepseek";
1479
1483
  ollama: "ollama";
1480
1484
  "azure-openai": "azure-openai";
1481
1485
  "amazon-bedrock": "amazon-bedrock";
1482
1486
  "google-vertex": "google-vertex";
1487
+ deepseek: "deepseek";
1483
1488
  }>;
1484
1489
  /** Anthropic provider configuration */
1485
1490
  interface AnthropicProviderConfig {
@@ -1648,146 +1653,38 @@ declare const providerConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1648
1653
  baseUrl: z.ZodOptional<z.ZodString>;
1649
1654
  organization: z.ZodOptional<z.ZodString>;
1650
1655
  project: z.ZodOptional<z.ZodString>;
1651
- name: z.ZodOptional<z.ZodString>;
1652
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1653
- }, z.core.$strip>, z.ZodObject<{
1654
- providerName: z.ZodLiteral<"ollama">;
1655
- baseUrl: z.ZodOptional<z.ZodString>;
1656
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1657
- }, z.core.$strip>, z.ZodObject<{
1658
- providerName: z.ZodLiteral<"azure-openai">;
1659
- apiKey: z.ZodString;
1660
- resourceName: z.ZodOptional<z.ZodString>;
1661
- apiVersion: z.ZodOptional<z.ZodString>;
1662
- baseUrl: z.ZodOptional<z.ZodString>;
1663
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1664
- useDeploymentBasedUrls: z.ZodOptional<z.ZodBoolean>;
1665
- }, z.core.$strip>, z.ZodObject<{
1666
- providerName: z.ZodLiteral<"amazon-bedrock">;
1667
- accessKeyId: z.ZodString;
1668
- secretAccessKey: z.ZodString;
1669
- region: z.ZodString;
1670
- sessionToken: z.ZodOptional<z.ZodString>;
1671
- }, z.core.$strip>, z.ZodObject<{
1672
- providerName: z.ZodLiteral<"google-vertex">;
1673
- project: z.ZodOptional<z.ZodString>;
1674
- location: z.ZodOptional<z.ZodString>;
1675
- baseUrl: z.ZodOptional<z.ZodString>;
1676
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1677
- }, z.core.$strip>, z.ZodObject<{
1678
- providerName: z.ZodLiteral<"deepseek">;
1679
- apiKey: z.ZodString;
1680
- baseUrl: z.ZodOptional<z.ZodString>;
1681
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1682
- }, z.core.$strip>], "providerName">;
1683
-
1684
- /** Parsed command options after transformation */
1685
- interface CommandOptions {
1686
- /** Path to perstack.toml config file */
1687
- config?: string;
1688
- /** LLM provider to use */
1689
- provider?: ProviderName;
1690
- /** Model name */
1691
- model?: string;
1692
- /** Temperature (0-1) */
1693
- temperature?: number;
1694
- /** Maximum steps */
1695
- maxSteps?: number;
1696
- /** Maximum retries */
1697
- maxRetries?: number;
1698
- /** Timeout in milliseconds */
1699
- timeout?: number;
1700
- /** Custom run ID */
1701
- runId?: string;
1702
- /** Paths to .env files */
1703
- envPath?: string[];
1704
- /** Enable verbose logging */
1705
- verbose?: boolean;
1706
- /** Continue most recent run */
1707
- continue?: boolean;
1708
- /** Continue specific run by ID */
1709
- continueRun?: string;
1710
- /** Resume from specific checkpoint */
1711
- resumeFrom?: string;
1712
- /** Query is interactive tool call result */
1713
- interactiveToolCallResult?: boolean;
1714
- }
1715
- /** Input for the `perstack run` command */
1716
- interface RunCommandInput {
1717
- /** Expert key to run */
1718
- expertKey: string;
1719
- /** Query or prompt */
1720
- query: string;
1721
- /** Command options */
1722
- options: CommandOptions;
1723
- }
1724
- declare const runCommandInputSchema: z.ZodObject<{
1725
- expertKey: z.ZodString;
1726
- query: z.ZodString;
1727
- options: z.ZodObject<{
1728
- config: z.ZodOptional<z.ZodString>;
1729
- provider: z.ZodOptional<z.ZodEnum<{
1730
- anthropic: "anthropic";
1731
- google: "google";
1732
- openai: "openai";
1733
- deepseek: "deepseek";
1734
- ollama: "ollama";
1735
- "azure-openai": "azure-openai";
1736
- "amazon-bedrock": "amazon-bedrock";
1737
- "google-vertex": "google-vertex";
1738
- }>>;
1739
- model: z.ZodOptional<z.ZodString>;
1740
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1741
- maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1742
- maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1743
- timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1744
- runId: z.ZodOptional<z.ZodString>;
1745
- envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1746
- verbose: z.ZodOptional<z.ZodBoolean>;
1747
- continue: z.ZodOptional<z.ZodBoolean>;
1748
- continueRun: z.ZodOptional<z.ZodString>;
1749
- resumeFrom: z.ZodOptional<z.ZodString>;
1750
- interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
1751
- }, z.core.$strip>;
1752
- }, z.core.$strip>;
1753
- /** Input for the `perstack start` command */
1754
- interface StartCommandInput {
1755
- /** Expert key to run (optional, prompts if not provided) */
1756
- expertKey?: string;
1757
- /** Query or prompt (optional, prompts if not provided) */
1758
- query?: string;
1759
- /** Command options */
1760
- options: CommandOptions;
1761
- }
1762
- declare const startCommandInputSchema: z.ZodObject<{
1763
- expertKey: z.ZodOptional<z.ZodString>;
1764
- query: z.ZodOptional<z.ZodString>;
1765
- options: z.ZodObject<{
1766
- config: z.ZodOptional<z.ZodString>;
1767
- provider: z.ZodOptional<z.ZodEnum<{
1768
- anthropic: "anthropic";
1769
- google: "google";
1770
- openai: "openai";
1771
- deepseek: "deepseek";
1772
- ollama: "ollama";
1773
- "azure-openai": "azure-openai";
1774
- "amazon-bedrock": "amazon-bedrock";
1775
- "google-vertex": "google-vertex";
1776
- }>>;
1777
- model: z.ZodOptional<z.ZodString>;
1778
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1779
- maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1780
- maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1781
- timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
1782
- runId: z.ZodOptional<z.ZodString>;
1783
- envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1784
- verbose: z.ZodOptional<z.ZodBoolean>;
1785
- continue: z.ZodOptional<z.ZodBoolean>;
1786
- continueRun: z.ZodOptional<z.ZodString>;
1787
- resumeFrom: z.ZodOptional<z.ZodString>;
1788
- interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
1789
- }, z.core.$strip>;
1790
- }, z.core.$strip>;
1656
+ name: z.ZodOptional<z.ZodString>;
1657
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1658
+ }, z.core.$strip>, z.ZodObject<{
1659
+ providerName: z.ZodLiteral<"ollama">;
1660
+ baseUrl: z.ZodOptional<z.ZodString>;
1661
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1662
+ }, z.core.$strip>, z.ZodObject<{
1663
+ providerName: z.ZodLiteral<"azure-openai">;
1664
+ apiKey: z.ZodString;
1665
+ resourceName: z.ZodOptional<z.ZodString>;
1666
+ apiVersion: z.ZodOptional<z.ZodString>;
1667
+ baseUrl: z.ZodOptional<z.ZodString>;
1668
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1669
+ useDeploymentBasedUrls: z.ZodOptional<z.ZodBoolean>;
1670
+ }, z.core.$strip>, z.ZodObject<{
1671
+ providerName: z.ZodLiteral<"amazon-bedrock">;
1672
+ accessKeyId: z.ZodString;
1673
+ secretAccessKey: z.ZodString;
1674
+ region: z.ZodString;
1675
+ sessionToken: z.ZodOptional<z.ZodString>;
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">;
1791
1688
 
1792
1689
  /**
1793
1690
  * A single execution step in an Expert run.
@@ -2154,6 +2051,7 @@ interface RunInput {
2154
2051
  interactiveToolCallResult?: {
2155
2052
  toolCallId: string;
2156
2053
  toolName: string;
2054
+ skillName: string;
2157
2055
  text: string;
2158
2056
  };
2159
2057
  }
@@ -2163,6 +2061,8 @@ interface RunSetting {
2163
2061
  model: string;
2164
2062
  /** Provider configuration */
2165
2063
  providerConfig: ProviderConfig;
2064
+ /** Job ID this run belongs to */
2065
+ jobId: string;
2166
2066
  /** Unique run identifier */
2167
2067
  runId: string;
2168
2068
  /** Expert key to run */
@@ -2173,7 +2073,7 @@ interface RunSetting {
2173
2073
  experts: Record<string, Expert>;
2174
2074
  /** Temperature for generation (0-1) */
2175
2075
  temperature: number;
2176
- /** Maximum steps before stopping */
2076
+ /** Maximum steps before stopping (applies to Job's totalSteps) */
2177
2077
  maxSteps?: number;
2178
2078
  /** Maximum retries on generation failure */
2179
2079
  maxRetries: number;
@@ -2191,6 +2091,8 @@ interface RunSetting {
2191
2091
  perstackBaseSkillCommand?: string[];
2192
2092
  /** Environment variables to pass to skills */
2193
2093
  env: Record<string, string>;
2094
+ /** HTTP proxy URL for API requests */
2095
+ proxyUrl?: string;
2194
2096
  }
2195
2097
  /** Parameters for starting a run */
2196
2098
  interface RunParams {
@@ -2214,6 +2116,7 @@ type RunParamsInput = {
2214
2116
  setting: {
2215
2117
  model: string;
2216
2118
  providerConfig: ProviderConfig;
2119
+ jobId?: string;
2217
2120
  runId?: string;
2218
2121
  expertKey: string;
2219
2122
  input: RunInput;
@@ -2228,6 +2131,7 @@ type RunParamsInput = {
2228
2131
  perstackApiKey?: string;
2229
2132
  perstackBaseSkillCommand?: string[];
2230
2133
  env?: Record<string, string>;
2134
+ proxyUrl?: string;
2231
2135
  };
2232
2136
  checkpoint?: Checkpoint;
2233
2137
  };
@@ -2281,6 +2185,7 @@ declare const runSettingSchema: z.ZodObject<{
2281
2185
  baseUrl: z.ZodOptional<z.ZodString>;
2282
2186
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2283
2187
  }, z.core.$strip>], "providerName">;
2188
+ jobId: z.ZodString;
2284
2189
  runId: z.ZodString;
2285
2190
  expertKey: z.ZodString;
2286
2191
  input: z.ZodObject<{
@@ -2288,6 +2193,7 @@ declare const runSettingSchema: z.ZodObject<{
2288
2193
  interactiveToolCallResult: z.ZodOptional<z.ZodObject<{
2289
2194
  toolCallId: z.ZodString;
2290
2195
  toolName: z.ZodString;
2196
+ skillName: z.ZodString;
2291
2197
  text: z.ZodString;
2292
2198
  }, z.core.$strip>>;
2293
2199
  }, z.core.$strip>;
@@ -2300,12 +2206,12 @@ declare const runSettingSchema: z.ZodObject<{
2300
2206
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2301
2207
  type: z.ZodLiteral<"mcpStdioSkill">;
2302
2208
  description: z.ZodOptional<z.ZodString>;
2303
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2304
2209
  rule: z.ZodOptional<z.ZodString>;
2305
2210
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2306
2211
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2307
2212
  command: z.ZodString;
2308
2213
  packageName: z.ZodOptional<z.ZodString>;
2214
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2309
2215
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2310
2216
  lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2311
2217
  }, z.core.$strip>, z.ZodObject<{
@@ -2368,10 +2274,10 @@ declare const runSettingSchema: z.ZodObject<{
2368
2274
  };
2369
2275
  }, Record<string, {
2370
2276
  type: "mcpStdioSkill";
2371
- args: string[];
2372
2277
  pick: string[];
2373
2278
  omit: string[];
2374
2279
  command: string;
2280
+ args: string[];
2375
2281
  requiredEnv: string[];
2376
2282
  lazyInit: boolean;
2377
2283
  description?: string | undefined;
@@ -2409,6 +2315,7 @@ declare const runSettingSchema: z.ZodObject<{
2409
2315
  perstackApiKey: z.ZodOptional<z.ZodString>;
2410
2316
  perstackBaseSkillCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
2411
2317
  env: z.ZodRecord<z.ZodString, z.ZodString>;
2318
+ proxyUrl: z.ZodOptional<z.ZodString>;
2412
2319
  }, z.core.$strip>;
2413
2320
  declare const runParamsSchema: z.ZodObject<{
2414
2321
  setting: z.ZodObject<{
@@ -2461,6 +2368,7 @@ declare const runParamsSchema: z.ZodObject<{
2461
2368
  baseUrl: z.ZodOptional<z.ZodString>;
2462
2369
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2463
2370
  }, z.core.$strip>], "providerName">;
2371
+ jobId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2464
2372
  runId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2465
2373
  expertKey: z.ZodString;
2466
2374
  input: z.ZodObject<{
@@ -2468,23 +2376,24 @@ declare const runParamsSchema: z.ZodObject<{
2468
2376
  interactiveToolCallResult: z.ZodOptional<z.ZodObject<{
2469
2377
  toolCallId: z.ZodString;
2470
2378
  toolName: z.ZodString;
2379
+ skillName: z.ZodString;
2471
2380
  text: z.ZodString;
2472
2381
  }, z.core.$strip>>;
2473
2382
  }, z.core.$strip>;
2474
2383
  experts: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2475
- description: z.ZodOptional<z.ZodString>;
2476
2384
  name: z.ZodString;
2385
+ description: z.ZodOptional<z.ZodString>;
2477
2386
  version: z.ZodString;
2478
2387
  instruction: z.ZodString;
2479
2388
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2480
2389
  type: z.ZodLiteral<"mcpStdioSkill">;
2481
2390
  description: z.ZodOptional<z.ZodString>;
2482
- args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2483
2391
  rule: z.ZodOptional<z.ZodString>;
2484
2392
  pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2485
2393
  omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2486
2394
  command: z.ZodString;
2487
2395
  packageName: z.ZodOptional<z.ZodString>;
2396
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2488
2397
  requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2489
2398
  lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2490
2399
  }, z.core.$strip>, z.ZodObject<{
@@ -2547,10 +2456,10 @@ declare const runParamsSchema: z.ZodObject<{
2547
2456
  };
2548
2457
  }, Record<string, {
2549
2458
  type: "mcpStdioSkill";
2550
- args: string[];
2551
2459
  pick: string[];
2552
2460
  omit: string[];
2553
2461
  command: string;
2462
+ args: string[];
2554
2463
  requiredEnv: string[];
2555
2464
  lazyInit: boolean;
2556
2465
  description?: string | undefined;
@@ -2675,9 +2584,11 @@ declare const runParamsSchema: z.ZodObject<{
2675
2584
  perstackApiKey: z.ZodOptional<z.ZodString>;
2676
2585
  perstackBaseSkillCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
2677
2586
  env: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2587
+ proxyUrl: z.ZodOptional<z.ZodString>;
2678
2588
  }, z.core.$strip>;
2679
2589
  checkpoint: z.ZodOptional<z.ZodObject<{
2680
2590
  id: z.ZodString;
2591
+ jobId: z.ZodString;
2681
2592
  runId: z.ZodString;
2682
2593
  status: z.ZodEnum<{
2683
2594
  init: "init";
@@ -2784,7 +2695,7 @@ declare const runParamsSchema: z.ZodObject<{
2784
2695
  name: z.ZodString;
2785
2696
  version: z.ZodString;
2786
2697
  }, z.core.$strip>;
2787
- delegateTo: z.ZodOptional<z.ZodObject<{
2698
+ delegateTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
2788
2699
  expert: z.ZodObject<{
2789
2700
  key: z.ZodString;
2790
2701
  name: z.ZodString;
@@ -2793,7 +2704,7 @@ declare const runParamsSchema: z.ZodObject<{
2793
2704
  toolCallId: z.ZodString;
2794
2705
  toolName: z.ZodString;
2795
2706
  query: z.ZodString;
2796
- }, z.core.$strip>>;
2707
+ }, z.core.$strip>>>;
2797
2708
  delegatedBy: z.ZodOptional<z.ZodObject<{
2798
2709
  expert: z.ZodObject<{
2799
2710
  key: z.ZodString;
@@ -2886,6 +2797,15 @@ declare const runParamsSchema: z.ZodObject<{
2886
2797
  isError: z.ZodOptional<z.ZodBoolean>;
2887
2798
  }, z.core.$strip>], "type">>;
2888
2799
  }, z.core.$strip>>>;
2800
+ metadata: z.ZodOptional<z.ZodObject<{
2801
+ runtime: z.ZodOptional<z.ZodEnum<{
2802
+ perstack: "perstack";
2803
+ cursor: "cursor";
2804
+ "claude-code": "claude-code";
2805
+ gemini: "gemini";
2806
+ docker: "docker";
2807
+ }>>;
2808
+ }, z.core.$loose>>;
2889
2809
  }, z.core.$strip>>;
2890
2810
  }, z.core.$strip>;
2891
2811
  /**
@@ -2919,7 +2839,7 @@ type ExpertEventPayloads = {
2919
2839
  };
2920
2840
  callDelegate: {
2921
2841
  newMessage: ExpertMessage;
2922
- toolCall: ToolCall;
2842
+ toolCalls: ToolCall[];
2923
2843
  usage: Usage;
2924
2844
  };
2925
2845
  resolveToolResults: {
@@ -2973,6 +2893,8 @@ interface BaseEvent {
2973
2893
  expertKey: string;
2974
2894
  /** Unix timestamp when event was emitted */
2975
2895
  timestamp: number;
2896
+ /** Job ID this event belongs to */
2897
+ jobId: string;
2976
2898
  /** Run ID this event belongs to */
2977
2899
  runId: string;
2978
2900
  /** Step number when event was emitted */
@@ -2991,13 +2913,13 @@ type EventForType<T extends EventType> = Extract<RunEvent, {
2991
2913
  type: T;
2992
2914
  }>;
2993
2915
  /** Factory function to create typed events */
2994
- declare function createEvent<T extends EventType>(type: T): (setting: RunSetting, checkpoint: Checkpoint, data: Omit<EventForType<T>, "type" | "id" | "expertKey" | "timestamp" | "runId" | "stepNumber">) => EventForType<T>;
2916
+ declare function createEvent<T extends EventType>(type: T): (setting: RunSetting, checkpoint: Checkpoint, data: Omit<EventForType<T>, "type" | "id" | "expertKey" | "timestamp" | "jobId" | "runId" | "stepNumber">) => EventForType<T>;
2995
2917
  declare const startRun: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2996
2918
  type: "startRun";
2997
2919
  } & {
2998
2920
  initialCheckpoint: Checkpoint;
2999
2921
  inputMessages: (InstructionMessage | UserMessage | ToolMessage)[];
3000
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2922
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3001
2923
  type: "startRun";
3002
2924
  } & {
3003
2925
  initialCheckpoint: Checkpoint;
@@ -3007,7 +2929,7 @@ declare const startGeneration: (setting: RunSetting, checkpoint: Checkpoint, dat
3007
2929
  type: "startGeneration";
3008
2930
  } & {
3009
2931
  messages: Message[];
3010
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2932
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3011
2933
  type: "startGeneration";
3012
2934
  } & {
3013
2935
  messages: Message[];
@@ -3020,7 +2942,7 @@ declare const retry: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<Ba
3020
2942
  toolCalls?: ToolCall[];
3021
2943
  toolResults?: ToolResult[];
3022
2944
  usage: Usage;
3023
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2945
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3024
2946
  type: "retry";
3025
2947
  } & {
3026
2948
  reason: string;
@@ -3035,7 +2957,7 @@ declare const callTools: (setting: RunSetting, checkpoint: Checkpoint, data: Omi
3035
2957
  newMessage: ExpertMessage;
3036
2958
  toolCalls: ToolCall[];
3037
2959
  usage: Usage;
3038
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2960
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3039
2961
  type: "callTools";
3040
2962
  } & {
3041
2963
  newMessage: ExpertMessage;
@@ -3048,7 +2970,7 @@ declare const callInteractiveTool: (setting: RunSetting, checkpoint: Checkpoint,
3048
2970
  newMessage: ExpertMessage;
3049
2971
  toolCall: ToolCall;
3050
2972
  usage: Usage;
3051
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2973
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3052
2974
  type: "callInteractiveTool";
3053
2975
  } & {
3054
2976
  newMessage: ExpertMessage;
@@ -3059,20 +2981,20 @@ declare const callDelegate: (setting: RunSetting, checkpoint: Checkpoint, data:
3059
2981
  type: "callDelegate";
3060
2982
  } & {
3061
2983
  newMessage: ExpertMessage;
3062
- toolCall: ToolCall;
2984
+ toolCalls: ToolCall[];
3063
2985
  usage: Usage;
3064
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2986
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3065
2987
  type: "callDelegate";
3066
2988
  } & {
3067
2989
  newMessage: ExpertMessage;
3068
- toolCall: ToolCall;
2990
+ toolCalls: ToolCall[];
3069
2991
  usage: Usage;
3070
2992
  };
3071
2993
  declare const resolveToolResults: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3072
2994
  type: "resolveToolResults";
3073
2995
  } & {
3074
2996
  toolResults: ToolResult[];
3075
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2997
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3076
2998
  type: "resolveToolResults";
3077
2999
  } & {
3078
3000
  toolResults: ToolResult[];
@@ -3081,7 +3003,7 @@ declare const resolveThought: (setting: RunSetting, checkpoint: Checkpoint, data
3081
3003
  type: "resolveThought";
3082
3004
  } & {
3083
3005
  toolResult: ToolResult;
3084
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3006
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3085
3007
  type: "resolveThought";
3086
3008
  } & {
3087
3009
  toolResult: ToolResult;
@@ -3090,7 +3012,7 @@ declare const attemptCompletion: (setting: RunSetting, checkpoint: Checkpoint, d
3090
3012
  type: "attemptCompletion";
3091
3013
  } & {
3092
3014
  toolResult: ToolResult;
3093
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3015
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3094
3016
  type: "attemptCompletion";
3095
3017
  } & {
3096
3018
  toolResult: ToolResult;
@@ -3099,7 +3021,7 @@ declare const finishToolCall: (setting: RunSetting, checkpoint: Checkpoint, data
3099
3021
  type: "finishToolCall";
3100
3022
  } & {
3101
3023
  newMessages: (UserMessage | ToolMessage)[];
3102
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3024
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3103
3025
  type: "finishToolCall";
3104
3026
  } & {
3105
3027
  newMessages: (UserMessage | ToolMessage)[];
@@ -3109,7 +3031,7 @@ declare const resumeToolCalls: (setting: RunSetting, checkpoint: Checkpoint, dat
3109
3031
  } & {
3110
3032
  pendingToolCalls: ToolCall[];
3111
3033
  partialToolResults: ToolResult[];
3112
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3034
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3113
3035
  type: "resumeToolCalls";
3114
3036
  } & {
3115
3037
  pendingToolCalls: ToolCall[];
@@ -3119,7 +3041,7 @@ declare const finishAllToolCalls: (setting: RunSetting, checkpoint: Checkpoint,
3119
3041
  type: "finishAllToolCalls";
3120
3042
  } & {
3121
3043
  newMessages: (UserMessage | ToolMessage)[];
3122
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3044
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3123
3045
  type: "finishAllToolCalls";
3124
3046
  } & {
3125
3047
  newMessages: (UserMessage | ToolMessage)[];
@@ -3131,7 +3053,7 @@ declare const completeRun: (setting: RunSetting, checkpoint: Checkpoint, data: O
3131
3053
  step: Step;
3132
3054
  text: string;
3133
3055
  usage: Usage;
3134
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3056
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3135
3057
  type: "completeRun";
3136
3058
  } & {
3137
3059
  checkpoint: Checkpoint;
@@ -3144,7 +3066,7 @@ declare const stopRunByInteractiveTool: (setting: RunSetting, checkpoint: Checkp
3144
3066
  } & {
3145
3067
  checkpoint: Checkpoint;
3146
3068
  step: Step;
3147
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3069
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3148
3070
  type: "stopRunByInteractiveTool";
3149
3071
  } & {
3150
3072
  checkpoint: Checkpoint;
@@ -3155,7 +3077,7 @@ declare const stopRunByDelegate: (setting: RunSetting, checkpoint: Checkpoint, d
3155
3077
  } & {
3156
3078
  checkpoint: Checkpoint;
3157
3079
  step: Step;
3158
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3080
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3159
3081
  type: "stopRunByDelegate";
3160
3082
  } & {
3161
3083
  checkpoint: Checkpoint;
@@ -3166,7 +3088,7 @@ declare const stopRunByExceededMaxSteps: (setting: RunSetting, checkpoint: Check
3166
3088
  } & {
3167
3089
  checkpoint: Checkpoint;
3168
3090
  step: Step;
3169
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3091
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3170
3092
  type: "stopRunByExceededMaxSteps";
3171
3093
  } & {
3172
3094
  checkpoint: Checkpoint;
@@ -3178,7 +3100,7 @@ declare const continueToNextStep: (setting: RunSetting, checkpoint: Checkpoint,
3178
3100
  checkpoint: Checkpoint;
3179
3101
  step: Step;
3180
3102
  nextCheckpoint: Checkpoint;
3181
- }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3103
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3182
3104
  type: "continueToNextStep";
3183
3105
  } & {
3184
3106
  checkpoint: Checkpoint;
@@ -3191,6 +3113,8 @@ interface BaseRuntimeEvent {
3191
3113
  id: string;
3192
3114
  /** Unix timestamp */
3193
3115
  timestamp: number;
3116
+ /** Job ID */
3117
+ jobId: string;
3194
3118
  /** Run ID */
3195
3119
  runId: string;
3196
3120
  }
@@ -3198,6 +3122,7 @@ interface BaseRuntimeEvent {
3198
3122
  type RuntimeEventPayloads = {
3199
3123
  initializeRuntime: {
3200
3124
  runtimeVersion: string;
3125
+ runtime?: string;
3201
3126
  expertName: string;
3202
3127
  experts: string[];
3203
3128
  model: string;
@@ -3233,6 +3158,9 @@ type RuntimeEventPayloads = {
3233
3158
  skillDisconnected: {
3234
3159
  skillName: string;
3235
3160
  };
3161
+ streamingText: {
3162
+ text: string;
3163
+ };
3236
3164
  };
3237
3165
  /** All runtime event types */
3238
3166
  type RuntimeEventType = keyof RuntimeEventPayloads;
@@ -3247,7 +3175,295 @@ type RuntimeEventForType<T extends RuntimeEventType> = Extract<RuntimeEvent, {
3247
3175
  type: T;
3248
3176
  }>;
3249
3177
  /** Factory function to create runtime events */
3250
- declare function createRuntimeEvent<T extends RuntimeEventType>(type: T, runId: string, data: Omit<RuntimeEventForType<T>, "type" | "id" | "timestamp" | "runId">): RuntimeEventForType<T>;
3178
+ declare function createRuntimeEvent<T extends RuntimeEventType>(type: T, jobId: string, runId: string, data: Omit<RuntimeEventForType<T>, "type" | "id" | "timestamp" | "jobId" | "runId">): RuntimeEventForType<T>;
3179
+
3180
+ type AdapterRunParams = {
3181
+ setting: RunParamsInput["setting"];
3182
+ config?: PerstackConfig;
3183
+ checkpoint?: Checkpoint;
3184
+ eventListener?: (event: RunEvent | RuntimeEvent) => void;
3185
+ storeCheckpoint?: (checkpoint: Checkpoint) => Promise<void>;
3186
+ retrieveCheckpoint?: (jobId: string, checkpointId: string) => Promise<Checkpoint>;
3187
+ };
3188
+ type AdapterRunResult = {
3189
+ checkpoint: Checkpoint;
3190
+ events: (RunEvent | RuntimeEvent)[];
3191
+ };
3192
+ interface RuntimeAdapter {
3193
+ readonly name: string;
3194
+ checkPrerequisites(): Promise<PrerequisiteResult>;
3195
+ convertExpert(expert: Expert): RuntimeExpertConfig;
3196
+ run(params: AdapterRunParams): Promise<AdapterRunResult>;
3197
+ }
3198
+ type PrerequisiteResult = {
3199
+ ok: true;
3200
+ } | {
3201
+ ok: false;
3202
+ error: PrerequisiteError;
3203
+ };
3204
+ type PrerequisiteError = {
3205
+ type: "cli-not-found" | "auth-missing" | "version-mismatch";
3206
+ message: string;
3207
+ helpUrl?: string;
3208
+ };
3209
+ type RuntimeExpertConfig = {
3210
+ instruction: string;
3211
+ };
3212
+
3213
+ type ExecResult = {
3214
+ stdout: string;
3215
+ stderr: string;
3216
+ exitCode: number;
3217
+ };
3218
+ declare abstract class BaseAdapter implements RuntimeAdapter {
3219
+ abstract readonly name: string;
3220
+ abstract checkPrerequisites(): Promise<PrerequisiteResult>;
3221
+ abstract run(params: AdapterRunParams): Promise<AdapterRunResult>;
3222
+ convertExpert(expert: Expert): RuntimeExpertConfig;
3223
+ protected execCommand(args: string[]): Promise<ExecResult>;
3224
+ protected executeWithTimeout(proc: ChildProcess, timeout: number): Promise<ExecResult>;
3225
+ }
3226
+
3227
+ declare function createEmptyUsage(): Usage;
3228
+ type CreateCheckpointParams = {
3229
+ jobId: string;
3230
+ runId: string;
3231
+ expertKey: string;
3232
+ expert: {
3233
+ key: string;
3234
+ name: string;
3235
+ version: string;
3236
+ };
3237
+ output: string;
3238
+ runtime: RuntimeName;
3239
+ };
3240
+ declare function createNormalizedCheckpoint(params: CreateCheckpointParams): Checkpoint;
3241
+ declare function createRuntimeInitEvent(jobId: string, runId: string, expertName: string, runtime: RuntimeName, version: string, query?: string): RuntimeEvent;
3242
+ declare function createCompleteRunEvent(jobId: string, runId: string, expertKey: string, checkpoint: Checkpoint, output: string, startedAt?: number): RunEvent;
3243
+ declare function createStreamingTextEvent(jobId: string, runId: string, text: string): RuntimeEvent;
3244
+ declare function createCallToolsEvent(jobId: string, runId: string, expertKey: string, stepNumber: number, toolCalls: ToolCall[], _checkpoint: Checkpoint): RunEvent;
3245
+ declare function createResolveToolResultsEvent(jobId: string, runId: string, expertKey: string, stepNumber: number, toolResults: ToolResult[]): RunEvent;
3246
+ declare function createToolMessage(toolCallId: string, toolName: string, resultText: string): ToolMessage;
3247
+
3248
+ declare function registerAdapter(runtime: RuntimeName, factory: () => RuntimeAdapter): void;
3249
+ declare function getAdapter(runtime: RuntimeName): RuntimeAdapter;
3250
+ declare function isAdapterAvailable(runtime: RuntimeName): boolean;
3251
+ declare function getRegisteredRuntimes(): RuntimeName[];
3252
+
3253
+ declare const defaultPerstackApiBaseUrl = "https://api.perstack.ai";
3254
+ declare const organizationNameRegex: RegExp;
3255
+ declare const maxOrganizationNameLength = 128;
3256
+ declare const maxApplicationNameLength = 255;
3257
+ declare const expertKeyRegex: RegExp;
3258
+ declare const expertNameRegex: RegExp;
3259
+ declare const expertVersionRegex: RegExp;
3260
+ declare const tagNameRegex: RegExp;
3261
+ declare const maxExpertNameLength = 255;
3262
+ declare const maxExpertVersionTagLength = 255;
3263
+ declare const maxExpertKeyLength = 511;
3264
+ declare const maxExpertDescriptionLength: number;
3265
+ declare const maxExpertInstructionLength: number;
3266
+ declare const maxExpertSkillItems = 255;
3267
+ declare const maxExpertDelegateItems = 255;
3268
+ declare const maxExpertTagItems = 8;
3269
+ declare const defaultTemperature = 0;
3270
+ declare const defaultMaxSteps: undefined;
3271
+ declare const defaultMaxRetries = 5;
3272
+ declare const defaultTimeout: number;
3273
+ declare const maxExpertJobQueryLength: number;
3274
+ declare const maxExpertJobFileNameLength: number;
3275
+ declare const packageWithVersionRegex: RegExp;
3276
+ declare const urlSafeRegex: RegExp;
3277
+ declare const maxSkillNameLength = 255;
3278
+ declare const maxSkillDescriptionLength: number;
3279
+ declare const maxSkillRuleLength: number;
3280
+ declare const maxSkillPickOmitItems = 255;
3281
+ declare const maxSkillRequiredEnvItems = 255;
3282
+ declare const maxSkillToolNameLength = 255;
3283
+ declare const maxSkillEndpointLength: number;
3284
+ declare const maxSkillInputJsonSchemaLength: number;
3285
+ declare const maxSkillToolItems = 255;
3286
+ declare const maxCheckpointToolCallIdLength = 255;
3287
+ declare const envNameRegex: RegExp;
3288
+ declare const maxEnvNameLength = 255;
3289
+
3290
+ declare const knownModels: {
3291
+ provider: string;
3292
+ models: {
3293
+ name: string;
3294
+ contextWindow: number;
3295
+ maxOutputTokens: number;
3296
+ }[];
3297
+ }[];
3298
+
3299
+ type JobStatus = "running" | "completed" | "stoppedByMaxSteps" | "stoppedByInteractiveTool" | "stoppedByError";
3300
+ declare const jobStatusSchema: z.ZodEnum<{
3301
+ completed: "completed";
3302
+ stoppedByInteractiveTool: "stoppedByInteractiveTool";
3303
+ stoppedByError: "stoppedByError";
3304
+ running: "running";
3305
+ stoppedByMaxSteps: "stoppedByMaxSteps";
3306
+ }>;
3307
+ interface Job {
3308
+ id: string;
3309
+ status: JobStatus;
3310
+ coordinatorExpertKey: string;
3311
+ totalSteps: number;
3312
+ maxSteps?: number;
3313
+ usage: Usage;
3314
+ startedAt: number;
3315
+ finishedAt?: number;
3316
+ }
3317
+ declare const jobSchema: z.ZodObject<{
3318
+ id: z.ZodString;
3319
+ status: z.ZodEnum<{
3320
+ completed: "completed";
3321
+ stoppedByInteractiveTool: "stoppedByInteractiveTool";
3322
+ stoppedByError: "stoppedByError";
3323
+ running: "running";
3324
+ stoppedByMaxSteps: "stoppedByMaxSteps";
3325
+ }>;
3326
+ coordinatorExpertKey: z.ZodString;
3327
+ totalSteps: z.ZodNumber;
3328
+ maxSteps: z.ZodOptional<z.ZodNumber>;
3329
+ usage: z.ZodObject<{
3330
+ inputTokens: z.ZodNumber;
3331
+ outputTokens: z.ZodNumber;
3332
+ reasoningTokens: z.ZodNumber;
3333
+ totalTokens: z.ZodNumber;
3334
+ cachedInputTokens: z.ZodNumber;
3335
+ }, z.core.$strip>;
3336
+ startedAt: z.ZodNumber;
3337
+ finishedAt: z.ZodOptional<z.ZodNumber>;
3338
+ }, z.core.$strip>;
3339
+
3340
+ /** Parsed command options after transformation */
3341
+ interface CommandOptions {
3342
+ /** Path to perstack.toml config file */
3343
+ config?: string;
3344
+ /** LLM provider to use */
3345
+ provider?: ProviderName;
3346
+ /** Model name */
3347
+ model?: string;
3348
+ /** Temperature (0-1) */
3349
+ temperature?: number;
3350
+ /** Maximum steps */
3351
+ maxSteps?: number;
3352
+ /** Maximum retries */
3353
+ maxRetries?: number;
3354
+ /** Timeout in milliseconds */
3355
+ timeout?: number;
3356
+ /** Custom job ID */
3357
+ jobId?: string;
3358
+ /** Custom run ID */
3359
+ runId?: string;
3360
+ /** Paths to .env files */
3361
+ envPath?: string[];
3362
+ /** Enable verbose logging */
3363
+ verbose?: boolean;
3364
+ /** Continue most recent job */
3365
+ continue?: boolean;
3366
+ /** Continue specific job by ID */
3367
+ continueJob?: string;
3368
+ /** Resume from specific checkpoint (requires --continue or --continue-job) */
3369
+ resumeFrom?: string;
3370
+ /** Query is interactive tool call result */
3371
+ interactiveToolCallResult?: boolean;
3372
+ /** Execution runtime */
3373
+ runtime?: RuntimeName;
3374
+ }
3375
+ /** Input for the `perstack run` command */
3376
+ interface RunCommandInput {
3377
+ /** Expert key to run */
3378
+ expertKey: string;
3379
+ /** Query or prompt */
3380
+ query: string;
3381
+ /** Command options */
3382
+ options: CommandOptions;
3383
+ }
3384
+ declare const runCommandInputSchema: z.ZodObject<{
3385
+ expertKey: z.ZodString;
3386
+ query: z.ZodString;
3387
+ options: z.ZodObject<{
3388
+ config: z.ZodOptional<z.ZodString>;
3389
+ provider: z.ZodOptional<z.ZodEnum<{
3390
+ anthropic: "anthropic";
3391
+ google: "google";
3392
+ openai: "openai";
3393
+ ollama: "ollama";
3394
+ "azure-openai": "azure-openai";
3395
+ "amazon-bedrock": "amazon-bedrock";
3396
+ "google-vertex": "google-vertex";
3397
+ deepseek: "deepseek";
3398
+ }>>;
3399
+ model: z.ZodOptional<z.ZodString>;
3400
+ temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3401
+ maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3402
+ maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3403
+ timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3404
+ jobId: z.ZodOptional<z.ZodString>;
3405
+ runId: z.ZodOptional<z.ZodString>;
3406
+ envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
3407
+ verbose: z.ZodOptional<z.ZodBoolean>;
3408
+ continue: z.ZodOptional<z.ZodBoolean>;
3409
+ continueJob: z.ZodOptional<z.ZodString>;
3410
+ resumeFrom: z.ZodOptional<z.ZodString>;
3411
+ interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
3412
+ runtime: z.ZodOptional<z.ZodEnum<{
3413
+ perstack: "perstack";
3414
+ cursor: "cursor";
3415
+ "claude-code": "claude-code";
3416
+ gemini: "gemini";
3417
+ docker: "docker";
3418
+ }>>;
3419
+ }, z.core.$strip>;
3420
+ }, z.core.$strip>;
3421
+ /** Input for the `perstack start` command */
3422
+ interface StartCommandInput {
3423
+ /** Expert key to run (optional, prompts if not provided) */
3424
+ expertKey?: string;
3425
+ /** Query or prompt (optional, prompts if not provided) */
3426
+ query?: string;
3427
+ /** Command options */
3428
+ options: CommandOptions;
3429
+ }
3430
+ declare const startCommandInputSchema: z.ZodObject<{
3431
+ expertKey: z.ZodOptional<z.ZodString>;
3432
+ query: z.ZodOptional<z.ZodString>;
3433
+ options: z.ZodObject<{
3434
+ config: z.ZodOptional<z.ZodString>;
3435
+ provider: z.ZodOptional<z.ZodEnum<{
3436
+ anthropic: "anthropic";
3437
+ google: "google";
3438
+ openai: "openai";
3439
+ ollama: "ollama";
3440
+ "azure-openai": "azure-openai";
3441
+ "amazon-bedrock": "amazon-bedrock";
3442
+ "google-vertex": "google-vertex";
3443
+ deepseek: "deepseek";
3444
+ }>>;
3445
+ model: z.ZodOptional<z.ZodString>;
3446
+ temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3447
+ maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3448
+ maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3449
+ timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3450
+ jobId: z.ZodOptional<z.ZodString>;
3451
+ runId: z.ZodOptional<z.ZodString>;
3452
+ envPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
3453
+ verbose: z.ZodOptional<z.ZodBoolean>;
3454
+ continue: z.ZodOptional<z.ZodBoolean>;
3455
+ continueJob: z.ZodOptional<z.ZodString>;
3456
+ resumeFrom: z.ZodOptional<z.ZodString>;
3457
+ interactiveToolCallResult: z.ZodOptional<z.ZodBoolean>;
3458
+ runtime: z.ZodOptional<z.ZodEnum<{
3459
+ perstack: "perstack";
3460
+ cursor: "cursor";
3461
+ "claude-code": "claude-code";
3462
+ gemini: "gemini";
3463
+ docker: "docker";
3464
+ }>>;
3465
+ }, z.core.$strip>;
3466
+ }, z.core.$strip>;
3251
3467
 
3252
3468
  /** Discriminator for skill manager types */
3253
3469
  type SkillType = "mcp" | "interactive" | "delegate";
@@ -3314,4 +3530,4 @@ type Resource = {
3314
3530
  declare function formatZodError(error: ZodError): string;
3315
3531
  declare function parseWithFriendlyError<T>(schema: ZodSchema<T>, data: unknown, context?: string): T;
3316
3532
 
3317
- export { type AmazonBedrockProviderConfig, type AnthropicProviderConfig, type AzureOpenAiProviderConfig, type BaseEvent, type BasePart, type CallToolResultContent, type Checkpoint, type CheckpointStatus, type CommandOptions, type DeepseekProviderConfig, type DelegateSkillManagerParams, 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 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, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileUrlPartSchema, finishAllToolCalls, finishToolCall, formatZodError, googleGenerativeAiProviderConfigSchema, googleVertexProviderConfigSchema, headersSchema, imageBinaryPartSchema, imageInlinePartSchema, imageUrlPartSchema, instructionMessageSchema, interactiveSkillSchema, interactiveToolSchema, 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 };
3533
+ 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, 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, createStreamingTextEvent, createToolMessage, deepseekProviderConfigSchema, defaultMaxRetries, defaultMaxSteps, defaultPerstackApiBaseUrl, defaultTemperature, defaultTimeout, delegationTargetSchema, domainPatternSchema, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileUrlPartSchema, finishAllToolCalls, finishToolCall, formatZodError, getAdapter, 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 };