@perstack/core 0.0.25 → 0.0.27

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,6 +1,99 @@
1
1
  import { ChildProcess } from 'node:child_process';
2
2
  import { z, ZodError, ZodSchema } from 'zod';
3
3
 
4
+ declare const anthropicProviderToolNameSchema: z.ZodEnum<{
5
+ webSearch: "webSearch";
6
+ webFetch: "webFetch";
7
+ codeExecution: "codeExecution";
8
+ }>;
9
+ type AnthropicProviderToolName = z.infer<typeof anthropicProviderToolNameSchema>;
10
+ declare const builtinAnthropicSkillSchema: z.ZodObject<{
11
+ type: z.ZodLiteral<"builtin">;
12
+ skillId: z.ZodEnum<{
13
+ pdf: "pdf";
14
+ docx: "docx";
15
+ pptx: "pptx";
16
+ xlsx: "xlsx";
17
+ }>;
18
+ }, z.core.$strip>;
19
+ type BuiltinAnthropicSkill = z.infer<typeof builtinAnthropicSkillSchema>;
20
+ declare const customAnthropicSkillSchema: z.ZodObject<{
21
+ type: z.ZodLiteral<"custom">;
22
+ name: z.ZodString;
23
+ definition: z.ZodString;
24
+ }, z.core.$strip>;
25
+ type CustomAnthropicSkill = z.infer<typeof customAnthropicSkillSchema>;
26
+ declare const anthropicProviderSkillSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ type: z.ZodLiteral<"builtin">;
28
+ skillId: z.ZodEnum<{
29
+ pdf: "pdf";
30
+ docx: "docx";
31
+ pptx: "pptx";
32
+ xlsx: "xlsx";
33
+ }>;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ type: z.ZodLiteral<"custom">;
36
+ name: z.ZodString;
37
+ definition: z.ZodString;
38
+ }, z.core.$strip>], "type">;
39
+ type AnthropicProviderSkill = z.infer<typeof anthropicProviderSkillSchema>;
40
+ declare const openaiProviderToolNameSchema: z.ZodEnum<{
41
+ webSearch: "webSearch";
42
+ fileSearch: "fileSearch";
43
+ codeInterpreter: "codeInterpreter";
44
+ imageGeneration: "imageGeneration";
45
+ }>;
46
+ type OpenAIProviderToolName = z.infer<typeof openaiProviderToolNameSchema>;
47
+ declare const googleProviderToolNameSchema: z.ZodEnum<{
48
+ codeExecution: "codeExecution";
49
+ fileSearch: "fileSearch";
50
+ googleSearch: "googleSearch";
51
+ urlContext: "urlContext";
52
+ googleMaps: "googleMaps";
53
+ }>;
54
+ type GoogleProviderToolName = z.infer<typeof googleProviderToolNameSchema>;
55
+ declare const azureOpenAIProviderToolNameSchema: z.ZodEnum<{
56
+ fileSearch: "fileSearch";
57
+ codeInterpreter: "codeInterpreter";
58
+ imageGeneration: "imageGeneration";
59
+ webSearchPreview: "webSearchPreview";
60
+ }>;
61
+ type AzureOpenAIProviderToolName = z.infer<typeof azureOpenAIProviderToolNameSchema>;
62
+ declare const vertexProviderToolNameSchema: z.ZodEnum<{
63
+ codeExecution: "codeExecution";
64
+ googleSearch: "googleSearch";
65
+ urlContext: "urlContext";
66
+ googleMaps: "googleMaps";
67
+ enterpriseWebSearch: "enterpriseWebSearch";
68
+ }>;
69
+ type VertexProviderToolName = z.infer<typeof vertexProviderToolNameSchema>;
70
+ declare const webSearchOptionsSchema: z.ZodObject<{
71
+ maxUses: z.ZodOptional<z.ZodNumber>;
72
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ }, z.core.$strip>;
74
+ declare const webFetchOptionsSchema: z.ZodObject<{
75
+ maxUses: z.ZodOptional<z.ZodNumber>;
76
+ }, z.core.$strip>;
77
+ declare const fileSearchOptionsSchema: z.ZodObject<{
78
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
80
+ }, z.core.$strip>;
81
+ declare const providerToolOptionsSchema: z.ZodOptional<z.ZodObject<{
82
+ webSearch: z.ZodOptional<z.ZodObject<{
83
+ maxUses: z.ZodOptional<z.ZodNumber>;
84
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ }, z.core.$strip>>;
86
+ webFetch: z.ZodOptional<z.ZodObject<{
87
+ maxUses: z.ZodOptional<z.ZodNumber>;
88
+ }, z.core.$strip>>;
89
+ fileSearch: z.ZodOptional<z.ZodObject<{
90
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>>;
94
+ type ProviderToolOptions = z.infer<typeof providerToolOptionsSchema>;
95
+ declare function hasCustomProviderSkills(skills?: AnthropicProviderSkill[]): boolean;
96
+
4
97
  /** MCP skill using stdio transport */
5
98
  interface McpStdioSkill {
6
99
  type: "mcpStdioSkill";
@@ -171,6 +264,12 @@ interface Expert {
171
264
  delegates: string[];
172
265
  /** Tags for categorization and discovery */
173
266
  tags: string[];
267
+ /** Provider-specific tool names to enable (e.g., "webSearch", "codeExecution") */
268
+ providerTools?: string[];
269
+ /** Anthropic Agent Skills configuration */
270
+ providerSkills?: AnthropicProviderSkill[];
271
+ /** Provider tool options (e.g., webSearch maxUses, allowedDomains) */
272
+ providerToolOptions?: ProviderToolOptions;
174
273
  }
175
274
  declare const expertSchema: z.ZodObject<{
176
275
  key: z.ZodString;
@@ -279,6 +378,33 @@ declare const expertSchema: z.ZodObject<{
279
378
  }>>>;
280
379
  delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
281
380
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
381
+ providerTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
382
+ providerSkills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
383
+ type: z.ZodLiteral<"builtin">;
384
+ skillId: z.ZodEnum<{
385
+ pdf: "pdf";
386
+ docx: "docx";
387
+ pptx: "pptx";
388
+ xlsx: "xlsx";
389
+ }>;
390
+ }, z.core.$strip>, z.ZodObject<{
391
+ type: z.ZodLiteral<"custom">;
392
+ name: z.ZodString;
393
+ definition: z.ZodString;
394
+ }, z.core.$strip>], "type">>>;
395
+ providerToolOptions: z.ZodOptional<z.ZodObject<{
396
+ webSearch: z.ZodOptional<z.ZodObject<{
397
+ maxUses: z.ZodOptional<z.ZodNumber>;
398
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
399
+ }, z.core.$strip>>;
400
+ webFetch: z.ZodOptional<z.ZodObject<{
401
+ maxUses: z.ZodOptional<z.ZodNumber>;
402
+ }, z.core.$strip>>;
403
+ fileSearch: z.ZodOptional<z.ZodObject<{
404
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
405
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
406
+ }, z.core.$strip>>;
407
+ }, z.core.$strip>>;
282
408
  }, z.core.$strip>;
283
409
 
284
410
  /** Base properties shared by all message parts */
@@ -401,6 +527,20 @@ declare const toolCallPartSchema: z.ZodObject<{
401
527
  toolName: z.ZodString;
402
528
  args: z.ZodUnknown;
403
529
  }, z.core.$strip>;
530
+ /** Thinking block from extended thinking / reasoning models */
531
+ interface ThinkingPart extends BasePart {
532
+ type: "thinkingPart";
533
+ /** The thinking content */
534
+ thinking: string;
535
+ /** Signature for redacted thinking blocks (Anthropic) */
536
+ signature?: string;
537
+ }
538
+ declare const thinkingPartSchema: z.ZodObject<{
539
+ id: z.ZodString;
540
+ type: z.ZodLiteral<"thinkingPart">;
541
+ thinking: z.ZodString;
542
+ signature: z.ZodOptional<z.ZodString>;
543
+ }, z.core.$strip>;
404
544
  /** Result of a tool call */
405
545
  interface ToolResultPart extends BasePart {
406
546
  type: "toolResultPart";
@@ -436,7 +576,7 @@ declare const toolResultPartSchema: z.ZodObject<{
436
576
  isError: z.ZodOptional<z.ZodBoolean>;
437
577
  }, z.core.$strip>;
438
578
  /** All possible message part types */
439
- type MessagePart = TextPart | ImageUrlPart | ImageInlinePart | ImageBinaryPart | FileUrlPart | FileInlinePart | FileBinaryPart | ToolCallPart | ToolResultPart;
579
+ type MessagePart = TextPart | ImageUrlPart | ImageInlinePart | ImageBinaryPart | FileUrlPart | FileInlinePart | FileBinaryPart | ToolCallPart | ToolResultPart | ThinkingPart;
440
580
  declare const messagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
441
581
  id: z.ZodString;
442
582
  type: z.ZodLiteral<"textPart">;
@@ -498,6 +638,11 @@ declare const messagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
498
638
  mimeType: z.ZodString;
499
639
  }, z.core.$strip>]>>;
500
640
  isError: z.ZodOptional<z.ZodBoolean>;
641
+ }, z.core.$strip>, z.ZodObject<{
642
+ id: z.ZodString;
643
+ type: z.ZodLiteral<"thinkingPart">;
644
+ thinking: z.ZodString;
645
+ signature: z.ZodOptional<z.ZodString>;
501
646
  }, z.core.$strip>], "type">;
502
647
 
503
648
  /** Base properties shared by all messages */
@@ -574,8 +719,8 @@ declare const userMessageSchema: z.ZodObject<{
574
719
  /** Message generated by the Expert (LLM response) */
575
720
  interface ExpertMessage extends BaseMessage {
576
721
  type: "expertMessage";
577
- /** Content generated by the Expert (text or tool calls) */
578
- contents: (TextPart | ToolCallPart)[];
722
+ /** Content generated by the Expert (text, tool calls, or thinking) */
723
+ contents: (TextPart | ToolCallPart | ThinkingPart)[];
579
724
  /** Whether to cache this message for prompt caching */
580
725
  cache?: boolean;
581
726
  }
@@ -592,6 +737,11 @@ declare const expertMessageSchema: z.ZodObject<{
592
737
  toolCallId: z.ZodString;
593
738
  toolName: z.ZodString;
594
739
  args: z.ZodUnknown;
740
+ }, z.core.$strip>, z.ZodObject<{
741
+ id: z.ZodString;
742
+ type: z.ZodLiteral<"thinkingPart">;
743
+ thinking: z.ZodString;
744
+ signature: z.ZodOptional<z.ZodString>;
595
745
  }, z.core.$strip>]>>;
596
746
  cache: z.ZodOptional<z.ZodBoolean>;
597
747
  }, z.core.$strip>;
@@ -693,6 +843,11 @@ declare const messageSchema: z.ZodUnion<readonly [z.ZodObject<{
693
843
  toolCallId: z.ZodString;
694
844
  toolName: z.ZodString;
695
845
  args: z.ZodUnknown;
846
+ }, z.core.$strip>, z.ZodObject<{
847
+ id: z.ZodString;
848
+ type: z.ZodLiteral<"thinkingPart">;
849
+ thinking: z.ZodString;
850
+ signature: z.ZodOptional<z.ZodString>;
696
851
  }, z.core.$strip>]>>;
697
852
  cache: z.ZodOptional<z.ZodBoolean>;
698
853
  }, z.core.$strip>, z.ZodObject<{
@@ -826,6 +981,11 @@ declare const toolResultSchema: z.ZodObject<{
826
981
  mimeType: z.ZodString;
827
982
  }, z.core.$strip>]>>;
828
983
  isError: z.ZodOptional<z.ZodBoolean>;
984
+ }, z.core.$strip>, z.ZodObject<{
985
+ id: z.ZodString;
986
+ type: z.ZodLiteral<"thinkingPart">;
987
+ thinking: z.ZodString;
988
+ signature: z.ZodOptional<z.ZodString>;
829
989
  }, z.core.$strip>], "type">>;
830
990
  }, z.core.$strip>;
831
991
 
@@ -932,6 +1092,15 @@ interface Checkpoint {
932
1092
  /** Additional runtime-specific data */
933
1093
  [key: string]: unknown;
934
1094
  };
1095
+ /** Error information when status is stoppedByError */
1096
+ error?: {
1097
+ name: string;
1098
+ message: string;
1099
+ statusCode?: number;
1100
+ isRetryable: boolean;
1101
+ };
1102
+ /** Consecutive retry count for current generation (reset on success) */
1103
+ retryCount?: number;
935
1104
  }
936
1105
  declare const delegationTargetSchema: z.ZodObject<{
937
1106
  expert: z.ZodObject<{
@@ -1018,6 +1187,11 @@ declare const checkpointSchema: z.ZodObject<{
1018
1187
  toolCallId: z.ZodString;
1019
1188
  toolName: z.ZodString;
1020
1189
  args: z.ZodUnknown;
1190
+ }, z.core.$strip>, z.ZodObject<{
1191
+ id: z.ZodString;
1192
+ type: z.ZodLiteral<"thinkingPart">;
1193
+ thinking: z.ZodString;
1194
+ signature: z.ZodOptional<z.ZodString>;
1021
1195
  }, z.core.$strip>]>>;
1022
1196
  cache: z.ZodOptional<z.ZodBoolean>;
1023
1197
  }, z.core.$strip>, z.ZodObject<{
@@ -1152,6 +1326,11 @@ declare const checkpointSchema: z.ZodObject<{
1152
1326
  mimeType: z.ZodString;
1153
1327
  }, z.core.$strip>]>>;
1154
1328
  isError: z.ZodOptional<z.ZodBoolean>;
1329
+ }, z.core.$strip>, z.ZodObject<{
1330
+ id: z.ZodString;
1331
+ type: z.ZodLiteral<"thinkingPart">;
1332
+ thinking: z.ZodString;
1333
+ signature: z.ZodOptional<z.ZodString>;
1155
1334
  }, z.core.$strip>], "type">>;
1156
1335
  }, z.core.$strip>>>;
1157
1336
  metadata: z.ZodOptional<z.ZodObject<{
@@ -1163,8 +1342,26 @@ declare const checkpointSchema: z.ZodObject<{
1163
1342
  docker: "docker";
1164
1343
  }>>;
1165
1344
  }, z.core.$loose>>;
1345
+ error: z.ZodOptional<z.ZodObject<{
1346
+ name: z.ZodString;
1347
+ message: z.ZodString;
1348
+ statusCode: z.ZodOptional<z.ZodNumber>;
1349
+ isRetryable: z.ZodBoolean;
1350
+ }, z.core.$strip>>;
1351
+ retryCount: z.ZodOptional<z.ZodNumber>;
1166
1352
  }, z.core.$strip>;
1167
1353
 
1354
+ /** Reasoning budget for native LLM reasoning (extended thinking / test-time scaling) */
1355
+ type ReasoningBudget = "none" | "minimal" | "low" | "medium" | "high" | number;
1356
+ /** Default reasoning budget - enables extended thinking by default */
1357
+ declare const defaultReasoningBudget: ReasoningBudget;
1358
+ declare const reasoningBudgetSchema: z.ZodUnion<readonly [z.ZodEnum<{
1359
+ none: "none";
1360
+ minimal: "minimal";
1361
+ low: "low";
1362
+ medium: "medium";
1363
+ high: "high";
1364
+ }>, z.ZodNumber]>;
1168
1365
  declare const domainPatternSchema: z.ZodString;
1169
1366
  declare const anthropicSettingSchema: z.ZodObject<{
1170
1367
  baseUrl: z.ZodOptional<z.ZodString>;
@@ -1299,6 +1496,7 @@ type PerstackConfigSkill = {
1299
1496
  args?: string[];
1300
1497
  requiredEnv?: string[];
1301
1498
  allowedDomains?: string[];
1499
+ lazyInit?: boolean;
1302
1500
  } | {
1303
1501
  type: "mcpSseSkill";
1304
1502
  description?: string;
@@ -1332,6 +1530,31 @@ interface PerstackConfigExpert {
1332
1530
  delegates?: string[];
1333
1531
  /** Tags for categorization */
1334
1532
  tags?: string[];
1533
+ /** Provider-specific tool names to enable */
1534
+ providerTools?: string[];
1535
+ /** Anthropic Agent Skills configuration */
1536
+ providerSkills?: Array<{
1537
+ type: "builtin";
1538
+ skillId: "pdf" | "docx" | "pptx" | "xlsx";
1539
+ } | {
1540
+ type: "custom";
1541
+ name: string;
1542
+ definition: string;
1543
+ }>;
1544
+ /** Provider tool options */
1545
+ providerToolOptions?: {
1546
+ webSearch?: {
1547
+ maxUses?: number;
1548
+ allowedDomains?: string[];
1549
+ };
1550
+ webFetch?: {
1551
+ maxUses?: number;
1552
+ };
1553
+ fileSearch?: {
1554
+ vectorStoreIds?: string[];
1555
+ maxNumResults?: number;
1556
+ };
1557
+ };
1335
1558
  }
1336
1559
  /**
1337
1560
  * Configuration loaded from perstack.toml.
@@ -1342,8 +1565,8 @@ interface PerstackConfig {
1342
1565
  provider?: ProviderTable;
1343
1566
  /** Default model name */
1344
1567
  model?: string;
1345
- /** Default temperature (0-1) */
1346
- temperature?: number;
1568
+ /** Reasoning budget for native LLM reasoning (extended thinking) */
1569
+ reasoningBudget?: ReasoningBudget;
1347
1570
  /** Default execution runtime */
1348
1571
  runtime?: RuntimeName;
1349
1572
  /** Maximum steps per run */
@@ -1419,7 +1642,13 @@ declare const perstackConfigSchema: z.ZodObject<{
1419
1642
  }, z.core.$strip>>;
1420
1643
  }, z.core.$strip>], "providerName">>;
1421
1644
  model: z.ZodOptional<z.ZodString>;
1422
- temperature: z.ZodOptional<z.ZodNumber>;
1645
+ reasoningBudget: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
1646
+ none: "none";
1647
+ minimal: "minimal";
1648
+ low: "low";
1649
+ medium: "medium";
1650
+ high: "high";
1651
+ }>, z.ZodNumber]>>;
1423
1652
  runtime: z.ZodOptional<z.ZodEnum<{
1424
1653
  local: "local";
1425
1654
  cursor: "cursor";
@@ -1446,6 +1675,7 @@ declare const perstackConfigSchema: z.ZodObject<{
1446
1675
  args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1447
1676
  requiredEnv: z.ZodOptional<z.ZodArray<z.ZodString>>;
1448
1677
  allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1678
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1449
1679
  }, z.core.$strip>, z.ZodObject<{
1450
1680
  type: z.ZodLiteral<"mcpSseSkill">;
1451
1681
  description: z.ZodOptional<z.ZodString>;
@@ -1465,6 +1695,33 @@ declare const perstackConfigSchema: z.ZodObject<{
1465
1695
  }, z.core.$strip>], "type">>>;
1466
1696
  delegates: z.ZodOptional<z.ZodArray<z.ZodString>>;
1467
1697
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1698
+ providerTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1699
+ providerSkills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1700
+ type: z.ZodLiteral<"builtin">;
1701
+ skillId: z.ZodEnum<{
1702
+ pdf: "pdf";
1703
+ docx: "docx";
1704
+ pptx: "pptx";
1705
+ xlsx: "xlsx";
1706
+ }>;
1707
+ }, z.core.$strip>, z.ZodObject<{
1708
+ type: z.ZodLiteral<"custom">;
1709
+ name: z.ZodString;
1710
+ definition: z.ZodString;
1711
+ }, z.core.$strip>], "type">>>;
1712
+ providerToolOptions: z.ZodOptional<z.ZodObject<{
1713
+ webSearch: z.ZodOptional<z.ZodObject<{
1714
+ maxUses: z.ZodOptional<z.ZodNumber>;
1715
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
1716
+ }, z.core.$strip>>;
1717
+ webFetch: z.ZodOptional<z.ZodObject<{
1718
+ maxUses: z.ZodOptional<z.ZodNumber>;
1719
+ }, z.core.$strip>>;
1720
+ fileSearch: z.ZodOptional<z.ZodObject<{
1721
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1722
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
1723
+ }, z.core.$strip>>;
1724
+ }, z.core.$strip>>;
1468
1725
  }, z.core.$strip>>>;
1469
1726
  perstackApiBaseUrl: z.ZodOptional<z.ZodURL>;
1470
1727
  perstackBaseSkillCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -1850,6 +2107,11 @@ declare const stepSchema: z.ZodObject<{
1850
2107
  toolCallId: z.ZodString;
1851
2108
  toolName: z.ZodString;
1852
2109
  args: z.ZodUnknown;
2110
+ }, z.core.$strip>, z.ZodObject<{
2111
+ id: z.ZodString;
2112
+ type: z.ZodLiteral<"thinkingPart">;
2113
+ thinking: z.ZodString;
2114
+ signature: z.ZodOptional<z.ZodString>;
1853
2115
  }, z.core.$strip>]>>;
1854
2116
  cache: z.ZodOptional<z.ZodBoolean>;
1855
2117
  }, z.core.$strip>, z.ZodObject<{
@@ -1950,6 +2212,11 @@ declare const stepSchema: z.ZodObject<{
1950
2212
  mimeType: z.ZodString;
1951
2213
  }, z.core.$strip>]>>;
1952
2214
  isError: z.ZodOptional<z.ZodBoolean>;
2215
+ }, z.core.$strip>, z.ZodObject<{
2216
+ id: z.ZodString;
2217
+ type: z.ZodLiteral<"thinkingPart">;
2218
+ thinking: z.ZodString;
2219
+ signature: z.ZodOptional<z.ZodString>;
1953
2220
  }, z.core.$strip>], "type">>;
1954
2221
  }, z.core.$strip>>>;
1955
2222
  pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2023,6 +2290,11 @@ declare const stepSchema: z.ZodObject<{
2023
2290
  mimeType: z.ZodString;
2024
2291
  }, z.core.$strip>]>>;
2025
2292
  isError: z.ZodOptional<z.ZodBoolean>;
2293
+ }, z.core.$strip>, z.ZodObject<{
2294
+ id: z.ZodString;
2295
+ type: z.ZodLiteral<"thinkingPart">;
2296
+ thinking: z.ZodString;
2297
+ signature: z.ZodOptional<z.ZodString>;
2026
2298
  }, z.core.$strip>], "type">>;
2027
2299
  }, z.core.$strip>>>;
2028
2300
  usage: z.ZodObject<{
@@ -2071,8 +2343,8 @@ interface RunSetting {
2071
2343
  input: RunInput;
2072
2344
  /** Map of expert keys to Expert definitions */
2073
2345
  experts: Record<string, Expert>;
2074
- /** Temperature for generation (0-1) */
2075
- temperature: number;
2346
+ /** Reasoning budget for native LLM reasoning (extended thinking). Defaults to "low". Use "none" or 0 to disable. */
2347
+ reasoningBudget: ReasoningBudget;
2076
2348
  /** Maximum steps before stopping (applies to Job's totalSteps) */
2077
2349
  maxSteps: number;
2078
2350
  /** Maximum retries on generation failure */
@@ -2123,7 +2395,7 @@ type RunParamsInput = {
2123
2395
  expertKey: string;
2124
2396
  input: RunInput;
2125
2397
  experts?: Record<string, ExpertInput>;
2126
- temperature?: number;
2398
+ reasoningBudget?: ReasoningBudget;
2127
2399
  maxSteps?: number;
2128
2400
  maxRetries?: number;
2129
2401
  timeout?: number;
@@ -2307,8 +2579,41 @@ declare const runSettingSchema: z.ZodObject<{
2307
2579
  }>>>;
2308
2580
  delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2309
2581
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2582
+ providerTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2583
+ providerSkills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2584
+ type: z.ZodLiteral<"builtin">;
2585
+ skillId: z.ZodEnum<{
2586
+ pdf: "pdf";
2587
+ docx: "docx";
2588
+ pptx: "pptx";
2589
+ xlsx: "xlsx";
2590
+ }>;
2591
+ }, z.core.$strip>, z.ZodObject<{
2592
+ type: z.ZodLiteral<"custom">;
2593
+ name: z.ZodString;
2594
+ definition: z.ZodString;
2595
+ }, z.core.$strip>], "type">>>;
2596
+ providerToolOptions: z.ZodOptional<z.ZodObject<{
2597
+ webSearch: z.ZodOptional<z.ZodObject<{
2598
+ maxUses: z.ZodOptional<z.ZodNumber>;
2599
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
2600
+ }, z.core.$strip>>;
2601
+ webFetch: z.ZodOptional<z.ZodObject<{
2602
+ maxUses: z.ZodOptional<z.ZodNumber>;
2603
+ }, z.core.$strip>>;
2604
+ fileSearch: z.ZodOptional<z.ZodObject<{
2605
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
2606
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
2607
+ }, z.core.$strip>>;
2608
+ }, z.core.$strip>>;
2310
2609
  }, z.core.$strip>>;
2311
- temperature: z.ZodNumber;
2610
+ reasoningBudget: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
2611
+ none: "none";
2612
+ minimal: "minimal";
2613
+ low: "low";
2614
+ medium: "medium";
2615
+ high: "high";
2616
+ }>, z.ZodNumber]>>;
2312
2617
  maxSteps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2313
2618
  maxRetries: z.ZodNumber;
2314
2619
  timeout: z.ZodNumber;
@@ -2387,6 +2692,19 @@ declare const runParamsSchema: z.ZodObject<{
2387
2692
  experts: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2388
2693
  name: z.ZodString;
2389
2694
  description: z.ZodOptional<z.ZodString>;
2695
+ providerToolOptions: z.ZodOptional<z.ZodObject<{
2696
+ webSearch: z.ZodOptional<z.ZodObject<{
2697
+ maxUses: z.ZodOptional<z.ZodNumber>;
2698
+ allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
2699
+ }, z.core.$strip>>;
2700
+ webFetch: z.ZodOptional<z.ZodObject<{
2701
+ maxUses: z.ZodOptional<z.ZodNumber>;
2702
+ }, z.core.$strip>>;
2703
+ fileSearch: z.ZodOptional<z.ZodObject<{
2704
+ vectorStoreIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
2705
+ maxNumResults: z.ZodOptional<z.ZodNumber>;
2706
+ }, z.core.$strip>>;
2707
+ }, z.core.$strip>>;
2390
2708
  version: z.ZodString;
2391
2709
  instruction: z.ZodString;
2392
2710
  skills: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2490,6 +2808,20 @@ declare const runParamsSchema: z.ZodObject<{
2490
2808
  }>>>;
2491
2809
  delegates: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2492
2810
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
2811
+ providerTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2812
+ providerSkills: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2813
+ type: z.ZodLiteral<"builtin">;
2814
+ skillId: z.ZodEnum<{
2815
+ pdf: "pdf";
2816
+ docx: "docx";
2817
+ pptx: "pptx";
2818
+ xlsx: "xlsx";
2819
+ }>;
2820
+ }, z.core.$strip>, z.ZodObject<{
2821
+ type: z.ZodLiteral<"custom">;
2822
+ name: z.ZodString;
2823
+ definition: z.ZodString;
2824
+ }, z.core.$strip>], "type">>>;
2493
2825
  }, z.core.$strip>>>>, z.ZodTransform<{
2494
2826
  [k: string]: {
2495
2827
  key: string;
@@ -2534,6 +2866,28 @@ declare const runParamsSchema: z.ZodObject<{
2534
2866
  delegates: string[];
2535
2867
  tags: string[];
2536
2868
  description?: string | undefined;
2869
+ providerTools?: string[] | undefined;
2870
+ providerSkills?: ({
2871
+ type: "builtin";
2872
+ skillId: "pdf" | "docx" | "pptx" | "xlsx";
2873
+ } | {
2874
+ type: "custom";
2875
+ name: string;
2876
+ definition: string;
2877
+ })[] | undefined;
2878
+ providerToolOptions?: {
2879
+ webSearch?: {
2880
+ maxUses?: number | undefined;
2881
+ allowedDomains?: string[] | undefined;
2882
+ } | undefined;
2883
+ webFetch?: {
2884
+ maxUses?: number | undefined;
2885
+ } | undefined;
2886
+ fileSearch?: {
2887
+ vectorStoreIds?: string[] | undefined;
2888
+ maxNumResults?: number | undefined;
2889
+ } | undefined;
2890
+ } | undefined;
2537
2891
  };
2538
2892
  }, Record<string, {
2539
2893
  name: string;
@@ -2577,8 +2931,36 @@ declare const runParamsSchema: z.ZodObject<{
2577
2931
  delegates: string[];
2578
2932
  tags: string[];
2579
2933
  description?: string | undefined;
2934
+ providerToolOptions?: {
2935
+ webSearch?: {
2936
+ maxUses?: number | undefined;
2937
+ allowedDomains?: string[] | undefined;
2938
+ } | undefined;
2939
+ webFetch?: {
2940
+ maxUses?: number | undefined;
2941
+ } | undefined;
2942
+ fileSearch?: {
2943
+ vectorStoreIds?: string[] | undefined;
2944
+ maxNumResults?: number | undefined;
2945
+ } | undefined;
2946
+ } | undefined;
2947
+ providerTools?: string[] | undefined;
2948
+ providerSkills?: ({
2949
+ type: "builtin";
2950
+ skillId: "pdf" | "docx" | "pptx" | "xlsx";
2951
+ } | {
2952
+ type: "custom";
2953
+ name: string;
2954
+ definition: string;
2955
+ })[] | undefined;
2580
2956
  }>>>;
2581
- temperature: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2957
+ reasoningBudget: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
2958
+ none: "none";
2959
+ minimal: "minimal";
2960
+ low: "low";
2961
+ medium: "medium";
2962
+ high: "high";
2963
+ }>, z.ZodNumber]>>>;
2582
2964
  maxSteps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2583
2965
  maxRetries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
2584
2966
  timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
@@ -2666,6 +3048,11 @@ declare const runParamsSchema: z.ZodObject<{
2666
3048
  toolCallId: z.ZodString;
2667
3049
  toolName: z.ZodString;
2668
3050
  args: z.ZodUnknown;
3051
+ }, z.core.$strip>, z.ZodObject<{
3052
+ id: z.ZodString;
3053
+ type: z.ZodLiteral<"thinkingPart">;
3054
+ thinking: z.ZodString;
3055
+ signature: z.ZodOptional<z.ZodString>;
2669
3056
  }, z.core.$strip>]>>;
2670
3057
  cache: z.ZodOptional<z.ZodBoolean>;
2671
3058
  }, z.core.$strip>, z.ZodObject<{
@@ -2800,6 +3187,11 @@ declare const runParamsSchema: z.ZodObject<{
2800
3187
  mimeType: z.ZodString;
2801
3188
  }, z.core.$strip>]>>;
2802
3189
  isError: z.ZodOptional<z.ZodBoolean>;
3190
+ }, z.core.$strip>, z.ZodObject<{
3191
+ id: z.ZodString;
3192
+ type: z.ZodLiteral<"thinkingPart">;
3193
+ thinking: z.ZodString;
3194
+ signature: z.ZodOptional<z.ZodString>;
2803
3195
  }, z.core.$strip>], "type">>;
2804
3196
  }, z.core.$strip>>>;
2805
3197
  metadata: z.ZodOptional<z.ZodObject<{
@@ -2811,6 +3203,13 @@ declare const runParamsSchema: z.ZodObject<{
2811
3203
  docker: "docker";
2812
3204
  }>>;
2813
3205
  }, z.core.$loose>>;
3206
+ error: z.ZodOptional<z.ZodObject<{
3207
+ name: z.ZodString;
3208
+ message: z.ZodString;
3209
+ statusCode: z.ZodOptional<z.ZodNumber>;
3210
+ isRetryable: z.ZodBoolean;
3211
+ }, z.core.$strip>>;
3212
+ retryCount: z.ZodOptional<z.ZodNumber>;
2814
3213
  }, z.core.$strip>>;
2815
3214
  }, z.core.$strip>;
2816
3215
  /**
@@ -2850,9 +3249,6 @@ type ExpertEventPayloads = {
2850
3249
  resolveToolResults: {
2851
3250
  toolResults: ToolResult[];
2852
3251
  };
2853
- resolveThought: {
2854
- toolResult: ToolResult;
2855
- };
2856
3252
  attemptCompletion: {
2857
3253
  toolResult: ToolResult;
2858
3254
  };
@@ -2883,6 +3279,16 @@ type ExpertEventPayloads = {
2883
3279
  checkpoint: Checkpoint;
2884
3280
  step: Step;
2885
3281
  };
3282
+ stopRunByError: {
3283
+ checkpoint: Checkpoint;
3284
+ step: Step;
3285
+ error: {
3286
+ name: string;
3287
+ message: string;
3288
+ statusCode?: number;
3289
+ isRetryable: boolean;
3290
+ };
3291
+ };
2886
3292
  completeRun: {
2887
3293
  checkpoint: Checkpoint;
2888
3294
  step: Step;
@@ -3004,15 +3410,6 @@ declare const resolveToolResults: (setting: RunSetting, checkpoint: Checkpoint,
3004
3410
  } & {
3005
3411
  toolResults: ToolResult[];
3006
3412
  };
3007
- declare const resolveThought: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3008
- type: "resolveThought";
3009
- } & {
3010
- toolResult: ToolResult;
3011
- }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3012
- type: "resolveThought";
3013
- } & {
3014
- toolResult: ToolResult;
3015
- };
3016
3413
  declare const attemptCompletion: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3017
3414
  type: "attemptCompletion";
3018
3415
  } & {
@@ -3099,6 +3496,29 @@ declare const stopRunByExceededMaxSteps: (setting: RunSetting, checkpoint: Check
3099
3496
  checkpoint: Checkpoint;
3100
3497
  step: Step;
3101
3498
  };
3499
+ declare const stopRunByError: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3500
+ type: "stopRunByError";
3501
+ } & {
3502
+ checkpoint: Checkpoint;
3503
+ step: Step;
3504
+ error: {
3505
+ name: string;
3506
+ message: string;
3507
+ statusCode?: number;
3508
+ isRetryable: boolean;
3509
+ };
3510
+ }, "type" | "id" | "jobId" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
3511
+ type: "stopRunByError";
3512
+ } & {
3513
+ checkpoint: Checkpoint;
3514
+ step: Step;
3515
+ error: {
3516
+ name: string;
3517
+ message: string;
3518
+ statusCode?: number;
3519
+ isRetryable: boolean;
3520
+ };
3521
+ };
3102
3522
  declare const continueToNextStep: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3103
3523
  type: "continueToNextStep";
3104
3524
  } & {
@@ -3131,7 +3551,6 @@ type RuntimeEventPayloads = {
3131
3551
  expertName: string;
3132
3552
  experts: string[];
3133
3553
  model: string;
3134
- temperature: number;
3135
3554
  maxSteps?: number;
3136
3555
  maxRetries: number;
3137
3556
  timeout: number;
@@ -3189,6 +3608,22 @@ type RuntimeEventPayloads = {
3189
3608
  port: number;
3190
3609
  reason?: string;
3191
3610
  };
3611
+ /** Reasoning completion event (extended thinking / test-time scaling) */
3612
+ completeReasoning: {
3613
+ text: string;
3614
+ };
3615
+ /** Start of reasoning stream (display hint) */
3616
+ startReasoning: Record<string, never>;
3617
+ /** Streaming reasoning delta */
3618
+ streamReasoning: {
3619
+ delta: string;
3620
+ };
3621
+ /** Start of run result stream (display hint) */
3622
+ startRunResult: Record<string, never>;
3623
+ /** Streaming run result delta */
3624
+ streamRunResult: {
3625
+ delta: string;
3626
+ };
3192
3627
  };
3193
3628
  /** All runtime event types */
3194
3629
  type RuntimeEventType = keyof RuntimeEventPayloads;
@@ -3211,6 +3646,7 @@ type AdapterRunParams = {
3211
3646
  checkpoint?: Checkpoint;
3212
3647
  eventListener?: (event: RunEvent | RuntimeEvent) => void;
3213
3648
  storeCheckpoint?: (checkpoint: Checkpoint) => Promise<void>;
3649
+ storeEvent?: (event: RunEvent) => Promise<void>;
3214
3650
  retrieveCheckpoint?: (jobId: string, checkpointId: string) => Promise<Checkpoint>;
3215
3651
  workspace?: string;
3216
3652
  /** Additional environment variable names to pass to Docker runtime */
@@ -3298,7 +3734,6 @@ declare const maxExpertInstructionLength: number;
3298
3734
  declare const maxExpertSkillItems = 255;
3299
3735
  declare const maxExpertDelegateItems = 255;
3300
3736
  declare const maxExpertTagItems = 8;
3301
- declare const defaultTemperature = 0;
3302
3737
  declare const defaultMaxSteps = 100;
3303
3738
  declare const defaultMaxRetries = 5;
3304
3739
  declare const defaultTimeout: number;
@@ -3369,6 +3804,149 @@ declare const jobSchema: z.ZodObject<{
3369
3804
  finishedAt: z.ZodOptional<z.ZodNumber>;
3370
3805
  }, z.core.$strip>;
3371
3806
 
3807
+ interface LockfileToolDefinition {
3808
+ skillName: string;
3809
+ name: string;
3810
+ description?: string;
3811
+ inputSchema: Record<string, unknown>;
3812
+ }
3813
+ declare const lockfileToolDefinitionSchema: z.ZodObject<{
3814
+ skillName: z.ZodString;
3815
+ name: z.ZodString;
3816
+ description: z.ZodOptional<z.ZodString>;
3817
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3818
+ }, z.core.$strip>;
3819
+ interface LockfileExpert {
3820
+ key: string;
3821
+ name: string;
3822
+ version: string;
3823
+ description?: string;
3824
+ instruction: string;
3825
+ skills: Record<string, Skill>;
3826
+ delegates: string[];
3827
+ tags: string[];
3828
+ toolDefinitions: LockfileToolDefinition[];
3829
+ }
3830
+ declare const lockfileExpertSchema: z.ZodObject<{
3831
+ key: z.ZodString;
3832
+ name: z.ZodString;
3833
+ version: z.ZodString;
3834
+ description: z.ZodOptional<z.ZodString>;
3835
+ instruction: z.ZodString;
3836
+ skills: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
3837
+ type: z.ZodLiteral<"mcpStdioSkill">;
3838
+ name: z.ZodString;
3839
+ description: z.ZodOptional<z.ZodString>;
3840
+ rule: z.ZodOptional<z.ZodString>;
3841
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3842
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3843
+ command: z.ZodString;
3844
+ packageName: z.ZodOptional<z.ZodString>;
3845
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3846
+ requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3847
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3848
+ }, z.core.$strip>, z.ZodObject<{
3849
+ type: z.ZodLiteral<"mcpSseSkill">;
3850
+ name: z.ZodString;
3851
+ description: z.ZodOptional<z.ZodString>;
3852
+ rule: z.ZodOptional<z.ZodString>;
3853
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3854
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3855
+ endpoint: z.ZodString;
3856
+ }, z.core.$strip>, z.ZodObject<{
3857
+ type: z.ZodLiteral<"interactiveSkill">;
3858
+ name: z.ZodString;
3859
+ description: z.ZodOptional<z.ZodString>;
3860
+ rule: z.ZodOptional<z.ZodString>;
3861
+ tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
3862
+ description: z.ZodOptional<z.ZodString>;
3863
+ inputJsonSchema: z.ZodString;
3864
+ }, z.core.$strip>>, z.ZodTransform<{
3865
+ [k: string]: {
3866
+ name: string;
3867
+ inputJsonSchema: string;
3868
+ description?: string | undefined;
3869
+ };
3870
+ }, Record<string, {
3871
+ inputJsonSchema: string;
3872
+ description?: string | undefined;
3873
+ }>>>;
3874
+ }, z.core.$strip>], "type">>;
3875
+ delegates: z.ZodArray<z.ZodString>;
3876
+ tags: z.ZodArray<z.ZodString>;
3877
+ toolDefinitions: z.ZodArray<z.ZodObject<{
3878
+ skillName: z.ZodString;
3879
+ name: z.ZodString;
3880
+ description: z.ZodOptional<z.ZodString>;
3881
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3882
+ }, z.core.$strip>>;
3883
+ }, z.core.$strip>;
3884
+ interface Lockfile {
3885
+ version: "1";
3886
+ generatedAt: number;
3887
+ configPath: string;
3888
+ experts: Record<string, LockfileExpert>;
3889
+ }
3890
+ declare const lockfileSchema: z.ZodObject<{
3891
+ version: z.ZodLiteral<"1">;
3892
+ generatedAt: z.ZodNumber;
3893
+ configPath: z.ZodString;
3894
+ experts: z.ZodRecord<z.ZodString, z.ZodObject<{
3895
+ key: z.ZodString;
3896
+ name: z.ZodString;
3897
+ version: z.ZodString;
3898
+ description: z.ZodOptional<z.ZodString>;
3899
+ instruction: z.ZodString;
3900
+ skills: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
3901
+ type: z.ZodLiteral<"mcpStdioSkill">;
3902
+ name: z.ZodString;
3903
+ description: z.ZodOptional<z.ZodString>;
3904
+ rule: z.ZodOptional<z.ZodString>;
3905
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3906
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3907
+ command: z.ZodString;
3908
+ packageName: z.ZodOptional<z.ZodString>;
3909
+ args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3910
+ requiredEnv: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3911
+ lazyInit: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
3912
+ }, z.core.$strip>, z.ZodObject<{
3913
+ type: z.ZodLiteral<"mcpSseSkill">;
3914
+ name: z.ZodString;
3915
+ description: z.ZodOptional<z.ZodString>;
3916
+ rule: z.ZodOptional<z.ZodString>;
3917
+ pick: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3918
+ omit: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
3919
+ endpoint: z.ZodString;
3920
+ }, z.core.$strip>, z.ZodObject<{
3921
+ type: z.ZodLiteral<"interactiveSkill">;
3922
+ name: z.ZodString;
3923
+ description: z.ZodOptional<z.ZodString>;
3924
+ rule: z.ZodOptional<z.ZodString>;
3925
+ tools: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodObject<{
3926
+ description: z.ZodOptional<z.ZodString>;
3927
+ inputJsonSchema: z.ZodString;
3928
+ }, z.core.$strip>>, z.ZodTransform<{
3929
+ [k: string]: {
3930
+ name: string;
3931
+ inputJsonSchema: string;
3932
+ description?: string | undefined;
3933
+ };
3934
+ }, Record<string, {
3935
+ inputJsonSchema: string;
3936
+ description?: string | undefined;
3937
+ }>>>;
3938
+ }, z.core.$strip>], "type">>;
3939
+ delegates: z.ZodArray<z.ZodString>;
3940
+ tags: z.ZodArray<z.ZodString>;
3941
+ toolDefinitions: z.ZodArray<z.ZodObject<{
3942
+ skillName: z.ZodString;
3943
+ name: z.ZodString;
3944
+ description: z.ZodOptional<z.ZodString>;
3945
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3946
+ }, z.core.$strip>>;
3947
+ }, z.core.$strip>>;
3948
+ }, z.core.$strip>;
3949
+
3372
3950
  /** Parsed command options after transformation */
3373
3951
  interface CommandOptions {
3374
3952
  /** Path to perstack.toml config file */
@@ -3377,8 +3955,8 @@ interface CommandOptions {
3377
3955
  provider?: ProviderName;
3378
3956
  /** Model name */
3379
3957
  model?: string;
3380
- /** Temperature (0-1) */
3381
- temperature?: number;
3958
+ /** Reasoning budget for native LLM reasoning (extended thinking) */
3959
+ reasoningBudget?: ReasoningBudget;
3382
3960
  /** Maximum steps */
3383
3961
  maxSteps?: number;
3384
3962
  /** Maximum retries */
@@ -3433,7 +4011,13 @@ declare const runCommandInputSchema: z.ZodObject<{
3433
4011
  deepseek: "deepseek";
3434
4012
  }>>;
3435
4013
  model: z.ZodOptional<z.ZodString>;
3436
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
4014
+ reasoningBudget: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | "none" | "minimal" | "low" | "medium" | "high" | undefined, string | undefined>>, z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
4015
+ none: "none";
4016
+ minimal: "minimal";
4017
+ low: "low";
4018
+ medium: "medium";
4019
+ high: "high";
4020
+ }>, z.ZodNumber]>>>;
3437
4021
  maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3438
4022
  maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3439
4023
  timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
@@ -3481,7 +4065,13 @@ declare const startCommandInputSchema: z.ZodObject<{
3481
4065
  deepseek: "deepseek";
3482
4066
  }>>;
3483
4067
  model: z.ZodOptional<z.ZodString>;
3484
- temperature: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
4068
+ reasoningBudget: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | "none" | "minimal" | "low" | "medium" | "high" | undefined, string | undefined>>, z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
4069
+ none: "none";
4070
+ minimal: "minimal";
4071
+ low: "low";
4072
+ medium: "medium";
4073
+ high: "high";
4074
+ }>, z.ZodNumber]>>>;
3485
4075
  maxSteps: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3486
4076
  maxRetries: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
3487
4077
  timeout: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<number | undefined, string | undefined>>;
@@ -3567,10 +4157,75 @@ type Resource = {
3567
4157
  blob?: string;
3568
4158
  };
3569
4159
 
4160
+ /**
4161
+ * Metadata for an event, used for listing events without loading full content.
4162
+ */
4163
+ type EventMeta = {
4164
+ timestamp: number;
4165
+ stepNumber: number;
4166
+ type: string;
4167
+ };
4168
+ /**
4169
+ * Abstract storage interface for persisting Perstack data.
4170
+ *
4171
+ * Implementations include:
4172
+ * - FileSystemStorage: Local filesystem storage (default)
4173
+ * - S3Storage: AWS S3 storage
4174
+ * - R2Storage: Cloudflare R2 storage
4175
+ */
4176
+ interface Storage {
4177
+ /**
4178
+ * Store a checkpoint.
4179
+ */
4180
+ storeCheckpoint(checkpoint: Checkpoint): Promise<void>;
4181
+ /**
4182
+ * Retrieve a checkpoint by job ID and checkpoint ID.
4183
+ * @throws Error if checkpoint not found
4184
+ */
4185
+ retrieveCheckpoint(jobId: string, checkpointId: string): Promise<Checkpoint>;
4186
+ /**
4187
+ * Get all checkpoints for a job, sorted by step number.
4188
+ */
4189
+ getCheckpointsByJobId(jobId: string): Promise<Checkpoint[]>;
4190
+ /**
4191
+ * Store an event.
4192
+ */
4193
+ storeEvent(event: RunEvent): Promise<void>;
4194
+ /**
4195
+ * Get event metadata for a run, sorted by step number.
4196
+ */
4197
+ getEventsByRun(jobId: string, runId: string): Promise<EventMeta[]>;
4198
+ /**
4199
+ * Get full event contents for a run, optionally filtered by max step.
4200
+ */
4201
+ getEventContents(jobId: string, runId: string, maxStep?: number): Promise<RunEvent[]>;
4202
+ /**
4203
+ * Store a job.
4204
+ */
4205
+ storeJob(job: Job): Promise<void>;
4206
+ /**
4207
+ * Retrieve a job by ID.
4208
+ * @returns Job or undefined if not found
4209
+ */
4210
+ retrieveJob(jobId: string): Promise<Job | undefined>;
4211
+ /**
4212
+ * Get all jobs, sorted by start time (newest first).
4213
+ */
4214
+ getAllJobs(): Promise<Job[]>;
4215
+ /**
4216
+ * Store a run setting. Updates updatedAt if run already exists.
4217
+ */
4218
+ storeRunSetting(setting: RunSetting): Promise<void>;
4219
+ /**
4220
+ * Get all run settings, sorted by updated time (newest first).
4221
+ */
4222
+ getAllRuns(): Promise<RunSetting[]>;
4223
+ }
4224
+
3570
4225
  declare const SAFE_ENV_VARS: string[];
3571
4226
  declare function getFilteredEnv(additional?: Record<string, string>): Record<string, string>;
3572
4227
 
3573
4228
  declare function formatZodError(error: ZodError): string;
3574
4229
  declare function parseWithFriendlyError<T>(schema: ZodSchema<T>, data: unknown, context?: string): T;
3575
4230
 
3576
- 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 };
4231
+ export { type AdapterRunParams, type AdapterRunResult, type AmazonBedrockProviderConfig, type AnthropicProviderConfig, type AnthropicProviderSkill, type AnthropicProviderToolName, type AzureOpenAIProviderToolName, type AzureOpenAiProviderConfig, BaseAdapter, type BaseEvent, type BasePart, type BuiltinAnthropicSkill, type CallToolResultContent, type Checkpoint, type CheckpointStatus, type CommandOptions, type CreateCheckpointParams, type CustomAnthropicSkill, type DeepseekProviderConfig, type DelegateSkillManagerParams, type DelegationTarget, type EventForType, type EventMeta, type EventType, type ExecResult, type Expert, type ExpertMessage, type FileBinaryPart, type FileInlinePart, type FileUrlPart, type GoogleGenerativeAiProviderConfig, type GoogleProviderToolName, type GoogleVertexProviderConfig, type Headers, type ImageBinaryPart, type ImageInlinePart, type ImageUrlPart, type InstructionMessage, type InteractiveSkill, type InteractiveSkillManagerParams, type InteractiveTool, type Job, type JobStatus, type Lockfile, type LockfileExpert, type LockfileToolDefinition, type McpSkillManagerParams, type McpSseSkill, type McpStdioSkill, type Message, type MessagePart, type OllamaProviderConfig, type OpenAIProviderToolName, type OpenAiProviderConfig, type PerstackConfig, type PerstackConfigExpert, type PerstackConfigSkill, type PrerequisiteError, type PrerequisiteResult, type ProviderConfig, type ProviderName, type ProviderTable, type ProviderToolOptions, type ReasoningBudget, 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 Storage, type TextPart, type ThinkingPart, type ToolCall, type ToolCallPart, type ToolDefinition, type ToolMessage, type ToolResult, type ToolResultPart, type Usage, type UserMessage, type VertexProviderToolName, amazonBedrockProviderConfigSchema, anthropicProviderConfigSchema, anthropicProviderSkillSchema, anthropicProviderToolNameSchema, attemptCompletion, azureOpenAIProviderToolNameSchema, azureOpenAiProviderConfigSchema, basePartSchema, builtinAnthropicSkillSchema, callDelegate, callInteractiveTool, callTools, checkpointSchema, checkpointStatusSchema, completeRun, continueToNextStep, createCallToolsEvent, createCompleteRunEvent, createEmptyUsage, createEvent, createNormalizedCheckpoint, createResolveToolResultsEvent, createRuntimeEvent, createRuntimeInitEvent, createStartRunEvent, createStreamingTextEvent, createToolMessage, customAnthropicSkillSchema, deepseekProviderConfigSchema, defaultMaxRetries, defaultMaxSteps, defaultPerstackApiBaseUrl, defaultReasoningBudget, defaultTimeout, delegationTargetSchema, domainPatternSchema, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileSearchOptionsSchema, fileUrlPartSchema, finishAllToolCalls, finishToolCall, formatZodError, getAdapter, getFilteredEnv, getRegisteredRuntimes, googleGenerativeAiProviderConfigSchema, googleProviderToolNameSchema, googleVertexProviderConfigSchema, hasCustomProviderSkills, headersSchema, imageBinaryPartSchema, imageInlinePartSchema, imageUrlPartSchema, instructionMessageSchema, interactiveSkillSchema, interactiveToolSchema, isAdapterAvailable, jobSchema, jobStatusSchema, knownModels, lockfileExpertSchema, lockfileSchema, lockfileToolDefinitionSchema, 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, openaiProviderToolNameSchema, organizationNameRegex, packageWithVersionRegex, parseExpertKey, parseWithFriendlyError, perstackConfigSchema, providerConfigSchema, providerNameSchema, providerTableSchema, providerToolOptionsSchema, reasoningBudgetSchema, registerAdapter, resolveToolResults, resumeToolCalls, retry, runCommandInputSchema, runParamsSchema, runSettingSchema, runtimeNameSchema, skillSchema, startCommandInputSchema, startGeneration, startRun, stepSchema, stopRunByDelegate, stopRunByError, stopRunByExceededMaxSteps, stopRunByInteractiveTool, tagNameRegex, textPartSchema, thinkingPartSchema, toolCallPartSchema, toolCallSchema, toolMessageSchema, toolResultPartSchema, toolResultSchema, urlSafeRegex, usageSchema, userMessageSchema, vertexProviderToolNameSchema, webFetchOptionsSchema, webSearchOptionsSchema };