@perstack/core 0.0.19 → 0.0.21

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.
@@ -174,7 +174,7 @@ interface ToolResultPart extends BasePart {
174
174
  /** Name of the tool that was called */
175
175
  toolName: string;
176
176
  /** Content of the tool result */
177
- contents: (TextPart | ImageInlinePart)[];
177
+ contents: (TextPart | ImageInlinePart | FileInlinePart)[];
178
178
  /** Whether the tool call resulted in an error */
179
179
  isError?: boolean;
180
180
  }
@@ -192,6 +192,11 @@ declare const toolResultPartSchema: z.ZodObject<{
192
192
  type: z.ZodLiteral<"imageInlinePart">;
193
193
  encodedData: z.ZodString;
194
194
  mimeType: z.ZodString;
195
+ }, z.core.$strip>, z.ZodObject<{
196
+ id: z.ZodString;
197
+ type: z.ZodLiteral<"fileInlinePart">;
198
+ encodedData: z.ZodString;
199
+ mimeType: z.ZodString;
195
200
  }, z.core.$strip>]>>;
196
201
  isError: z.ZodOptional<z.ZodBoolean>;
197
202
  }, z.core.$strip>;
@@ -251,6 +256,11 @@ declare const messagePartSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
251
256
  type: z.ZodLiteral<"imageInlinePart">;
252
257
  encodedData: z.ZodString;
253
258
  mimeType: z.ZodString;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ id: z.ZodString;
261
+ type: z.ZodLiteral<"fileInlinePart">;
262
+ encodedData: z.ZodString;
263
+ mimeType: z.ZodString;
254
264
  }, z.core.$strip>]>>;
255
265
  isError: z.ZodOptional<z.ZodBoolean>;
256
266
  }, z.core.$strip>], "type">;
@@ -375,6 +385,11 @@ declare const toolMessageSchema: z.ZodObject<{
375
385
  type: z.ZodLiteral<"imageInlinePart">;
376
386
  encodedData: z.ZodString;
377
387
  mimeType: z.ZodString;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ id: z.ZodString;
390
+ type: z.ZodLiteral<"fileInlinePart">;
391
+ encodedData: z.ZodString;
392
+ mimeType: z.ZodString;
378
393
  }, z.core.$strip>]>>;
379
394
  isError: z.ZodOptional<z.ZodBoolean>;
380
395
  }, z.core.$strip>>;
@@ -462,12 +477,114 @@ declare const messageSchema: z.ZodUnion<readonly [z.ZodObject<{
462
477
  type: z.ZodLiteral<"imageInlinePart">;
463
478
  encodedData: z.ZodString;
464
479
  mimeType: z.ZodString;
480
+ }, z.core.$strip>, z.ZodObject<{
481
+ id: z.ZodString;
482
+ type: z.ZodLiteral<"fileInlinePart">;
483
+ encodedData: z.ZodString;
484
+ mimeType: z.ZodString;
465
485
  }, z.core.$strip>]>>;
466
486
  isError: z.ZodOptional<z.ZodBoolean>;
467
487
  }, z.core.$strip>>;
468
488
  cache: z.ZodOptional<z.ZodBoolean>;
469
489
  }, z.core.$strip>]>;
470
490
 
491
+ /** A tool call made by an Expert during execution */
492
+ interface ToolCall {
493
+ /** Unique identifier for this tool call */
494
+ id: string;
495
+ /** Name of the skill providing the tool */
496
+ skillName: string;
497
+ /** Name of the tool being called */
498
+ toolName: string;
499
+ /** Arguments passed to the tool */
500
+ args: Record<string, unknown>;
501
+ }
502
+ declare const toolCallSchema: z.ZodObject<{
503
+ id: z.ZodString;
504
+ skillName: z.ZodString;
505
+ toolName: z.ZodString;
506
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
507
+ }, z.core.$strip>;
508
+
509
+ /** Result returned from a tool call */
510
+ interface ToolResult {
511
+ /** Unique identifier for this result */
512
+ id: string;
513
+ /** Name of the skill that provided the tool */
514
+ skillName: string;
515
+ /** Name of the tool that was called */
516
+ toolName: string;
517
+ /** Content parts returned by the tool */
518
+ result: MessagePart[];
519
+ }
520
+ declare const toolResultSchema: z.ZodObject<{
521
+ id: z.ZodString;
522
+ skillName: z.ZodString;
523
+ toolName: z.ZodString;
524
+ result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
525
+ id: z.ZodString;
526
+ type: z.ZodLiteral<"textPart">;
527
+ text: z.ZodString;
528
+ }, z.core.$strip>, z.ZodObject<{
529
+ id: z.ZodString;
530
+ type: z.ZodLiteral<"imageUrlPart">;
531
+ url: z.ZodURL;
532
+ mimeType: z.ZodString;
533
+ }, z.core.$strip>, z.ZodObject<{
534
+ id: z.ZodString;
535
+ type: z.ZodLiteral<"imageInlinePart">;
536
+ encodedData: z.ZodString;
537
+ mimeType: z.ZodString;
538
+ }, z.core.$strip>, z.ZodObject<{
539
+ id: z.ZodString;
540
+ type: z.ZodLiteral<"imageBinaryPart">;
541
+ data: z.ZodString;
542
+ mimeType: z.ZodString;
543
+ }, z.core.$strip>, z.ZodObject<{
544
+ id: z.ZodString;
545
+ type: z.ZodLiteral<"fileUrlPart">;
546
+ url: z.ZodString;
547
+ mimeType: z.ZodString;
548
+ }, z.core.$strip>, z.ZodObject<{
549
+ id: z.ZodString;
550
+ type: z.ZodLiteral<"fileInlinePart">;
551
+ encodedData: z.ZodString;
552
+ mimeType: z.ZodString;
553
+ }, z.core.$strip>, z.ZodObject<{
554
+ id: z.ZodString;
555
+ type: z.ZodLiteral<"fileBinaryPart">;
556
+ data: z.ZodString;
557
+ mimeType: z.ZodString;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ id: z.ZodString;
560
+ type: z.ZodLiteral<"toolCallPart">;
561
+ toolCallId: z.ZodString;
562
+ toolName: z.ZodString;
563
+ args: z.ZodUnknown;
564
+ }, z.core.$strip>, z.ZodObject<{
565
+ id: z.ZodString;
566
+ type: z.ZodLiteral<"toolResultPart">;
567
+ toolCallId: z.ZodString;
568
+ toolName: z.ZodString;
569
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
570
+ id: z.ZodString;
571
+ type: z.ZodLiteral<"textPart">;
572
+ text: z.ZodString;
573
+ }, z.core.$strip>, z.ZodObject<{
574
+ id: z.ZodString;
575
+ type: z.ZodLiteral<"imageInlinePart">;
576
+ encodedData: z.ZodString;
577
+ mimeType: z.ZodString;
578
+ }, z.core.$strip>, z.ZodObject<{
579
+ id: z.ZodString;
580
+ type: z.ZodLiteral<"fileInlinePart">;
581
+ encodedData: z.ZodString;
582
+ mimeType: z.ZodString;
583
+ }, z.core.$strip>]>>;
584
+ isError: z.ZodOptional<z.ZodBoolean>;
585
+ }, z.core.$strip>], "type">>;
586
+ }, z.core.$strip>;
587
+
471
588
  /** Token usage statistics for a single step or run */
472
589
  interface Usage {
473
590
  /** Number of tokens in the input prompt */
@@ -560,6 +677,10 @@ interface Checkpoint {
560
677
  contextWindow?: number;
561
678
  /** Context window usage ratio (0-1) */
562
679
  contextWindowUsage?: number;
680
+ /** Tool calls waiting to be processed (for resume after delegate/interactive) */
681
+ pendingToolCalls?: ToolCall[];
682
+ /** Partial tool results collected before stopping (for resume) */
683
+ partialToolResults?: ToolResult[];
563
684
  }
564
685
  declare const checkpointSchema: z.ZodObject<{
565
686
  id: z.ZodString;
@@ -654,6 +775,11 @@ declare const checkpointSchema: z.ZodObject<{
654
775
  type: z.ZodLiteral<"imageInlinePart">;
655
776
  encodedData: z.ZodString;
656
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;
657
783
  }, z.core.$strip>]>>;
658
784
  isError: z.ZodOptional<z.ZodBoolean>;
659
785
  }, z.core.$strip>>;
@@ -693,6 +819,79 @@ declare const checkpointSchema: z.ZodObject<{
693
819
  }, z.core.$strip>;
694
820
  contextWindow: z.ZodOptional<z.ZodNumber>;
695
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>>>;
696
895
  }, z.core.$strip>;
697
896
 
698
897
  /** MCP skill using stdio transport */
@@ -1590,101 +1789,9 @@ declare const startCommandInputSchema: z.ZodObject<{
1590
1789
  }, z.core.$strip>;
1591
1790
  }, z.core.$strip>;
1592
1791
 
1593
- /** A tool call made by an Expert during execution */
1594
- interface ToolCall {
1595
- /** Unique identifier for this tool call */
1596
- id: string;
1597
- /** Name of the skill providing the tool */
1598
- skillName: string;
1599
- /** Name of the tool being called */
1600
- toolName: string;
1601
- /** Arguments passed to the tool */
1602
- args: Record<string, unknown>;
1603
- }
1604
- declare const toolCallSchema: z.ZodObject<{
1605
- id: z.ZodString;
1606
- skillName: z.ZodString;
1607
- toolName: z.ZodString;
1608
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1609
- }, z.core.$strip>;
1610
-
1611
- /** Result returned from a tool call */
1612
- interface ToolResult {
1613
- /** Unique identifier for this result */
1614
- id: string;
1615
- /** Name of the skill that provided the tool */
1616
- skillName: string;
1617
- /** Name of the tool that was called */
1618
- toolName: string;
1619
- /** Content parts returned by the tool */
1620
- result: MessagePart[];
1621
- }
1622
- declare const toolResultSchema: z.ZodObject<{
1623
- id: z.ZodString;
1624
- skillName: z.ZodString;
1625
- toolName: z.ZodString;
1626
- result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1627
- id: z.ZodString;
1628
- type: z.ZodLiteral<"textPart">;
1629
- text: z.ZodString;
1630
- }, z.core.$strip>, z.ZodObject<{
1631
- id: z.ZodString;
1632
- type: z.ZodLiteral<"imageUrlPart">;
1633
- url: z.ZodURL;
1634
- mimeType: z.ZodString;
1635
- }, z.core.$strip>, z.ZodObject<{
1636
- id: z.ZodString;
1637
- type: z.ZodLiteral<"imageInlinePart">;
1638
- encodedData: z.ZodString;
1639
- mimeType: z.ZodString;
1640
- }, z.core.$strip>, z.ZodObject<{
1641
- id: z.ZodString;
1642
- type: z.ZodLiteral<"imageBinaryPart">;
1643
- data: z.ZodString;
1644
- mimeType: z.ZodString;
1645
- }, z.core.$strip>, z.ZodObject<{
1646
- id: z.ZodString;
1647
- type: z.ZodLiteral<"fileUrlPart">;
1648
- url: z.ZodString;
1649
- mimeType: z.ZodString;
1650
- }, z.core.$strip>, z.ZodObject<{
1651
- id: z.ZodString;
1652
- type: z.ZodLiteral<"fileInlinePart">;
1653
- encodedData: z.ZodString;
1654
- mimeType: z.ZodString;
1655
- }, z.core.$strip>, z.ZodObject<{
1656
- id: z.ZodString;
1657
- type: z.ZodLiteral<"fileBinaryPart">;
1658
- data: z.ZodString;
1659
- mimeType: z.ZodString;
1660
- }, z.core.$strip>, z.ZodObject<{
1661
- id: z.ZodString;
1662
- type: z.ZodLiteral<"toolCallPart">;
1663
- toolCallId: z.ZodString;
1664
- toolName: z.ZodString;
1665
- args: z.ZodUnknown;
1666
- }, z.core.$strip>, z.ZodObject<{
1667
- id: z.ZodString;
1668
- type: z.ZodLiteral<"toolResultPart">;
1669
- toolCallId: z.ZodString;
1670
- toolName: z.ZodString;
1671
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1672
- id: z.ZodString;
1673
- type: z.ZodLiteral<"textPart">;
1674
- text: z.ZodString;
1675
- }, z.core.$strip>, z.ZodObject<{
1676
- id: z.ZodString;
1677
- type: z.ZodLiteral<"imageInlinePart">;
1678
- encodedData: z.ZodString;
1679
- mimeType: z.ZodString;
1680
- }, z.core.$strip>]>>;
1681
- isError: z.ZodOptional<z.ZodBoolean>;
1682
- }, z.core.$strip>], "type">>;
1683
- }, z.core.$strip>;
1684
-
1685
1792
  /**
1686
1793
  * A single execution step in an Expert run.
1687
- * Each step represents one LLM generation cycle, optionally followed by a tool call.
1794
+ * Each step represents one LLM generation cycle, optionally followed by tool calls.
1688
1795
  */
1689
1796
  interface Step {
1690
1797
  /** Sequential step number (1-indexed) */
@@ -1693,10 +1800,14 @@ interface Step {
1693
1800
  inputMessages?: (InstructionMessage | UserMessage | ToolMessage)[];
1694
1801
  /** Messages generated during this step */
1695
1802
  newMessages: Message[];
1696
- /** Tool call made during this step, if any */
1697
- toolCall?: ToolCall;
1698
- /** Result of the tool call, if any */
1699
- toolResult?: ToolResult;
1803
+ /** Tool calls made during this step, if any */
1804
+ toolCalls?: ToolCall[];
1805
+ /** Results of the tool calls, if any */
1806
+ toolResults?: ToolResult[];
1807
+ /** Tool calls waiting to be processed (sorted: MCP → Delegate → Interactive) */
1808
+ pendingToolCalls?: ToolCall[];
1809
+ /** Partial tool results collected so far (used during mixed tool call processing) */
1810
+ partialToolResults?: ToolResult[];
1700
1811
  /** Token usage for this step */
1701
1812
  usage: Usage;
1702
1813
  /** Unix timestamp (ms) when step started */
@@ -1771,6 +1882,11 @@ declare const stepSchema: z.ZodObject<{
1771
1882
  type: z.ZodLiteral<"imageInlinePart">;
1772
1883
  encodedData: z.ZodString;
1773
1884
  mimeType: z.ZodString;
1885
+ }, z.core.$strip>, z.ZodObject<{
1886
+ id: z.ZodString;
1887
+ type: z.ZodLiteral<"fileInlinePart">;
1888
+ encodedData: z.ZodString;
1889
+ mimeType: z.ZodString;
1774
1890
  }, z.core.$strip>]>>;
1775
1891
  isError: z.ZodOptional<z.ZodBoolean>;
1776
1892
  }, z.core.$strip>>;
@@ -1856,18 +1972,23 @@ declare const stepSchema: z.ZodObject<{
1856
1972
  type: z.ZodLiteral<"imageInlinePart">;
1857
1973
  encodedData: z.ZodString;
1858
1974
  mimeType: z.ZodString;
1975
+ }, z.core.$strip>, z.ZodObject<{
1976
+ id: z.ZodString;
1977
+ type: z.ZodLiteral<"fileInlinePart">;
1978
+ encodedData: z.ZodString;
1979
+ mimeType: z.ZodString;
1859
1980
  }, z.core.$strip>]>>;
1860
1981
  isError: z.ZodOptional<z.ZodBoolean>;
1861
1982
  }, z.core.$strip>>;
1862
1983
  cache: z.ZodOptional<z.ZodBoolean>;
1863
1984
  }, z.core.$strip>]>>;
1864
- toolCall: z.ZodOptional<z.ZodObject<{
1985
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
1865
1986
  id: z.ZodString;
1866
1987
  skillName: z.ZodString;
1867
1988
  toolName: z.ZodString;
1868
1989
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1869
- }, z.core.$strip>>;
1870
- toolResult: z.ZodOptional<z.ZodObject<{
1990
+ }, z.core.$strip>>>;
1991
+ toolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
1871
1992
  id: z.ZodString;
1872
1993
  skillName: z.ZodString;
1873
1994
  toolName: z.ZodString;
@@ -1925,10 +2046,88 @@ declare const stepSchema: z.ZodObject<{
1925
2046
  type: z.ZodLiteral<"imageInlinePart">;
1926
2047
  encodedData: z.ZodString;
1927
2048
  mimeType: z.ZodString;
2049
+ }, z.core.$strip>, z.ZodObject<{
2050
+ id: z.ZodString;
2051
+ type: z.ZodLiteral<"fileInlinePart">;
2052
+ encodedData: z.ZodString;
2053
+ mimeType: z.ZodString;
1928
2054
  }, z.core.$strip>]>>;
1929
2055
  isError: z.ZodOptional<z.ZodBoolean>;
1930
2056
  }, z.core.$strip>], "type">>;
1931
- }, z.core.$strip>>;
2057
+ }, z.core.$strip>>>;
2058
+ pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
2059
+ id: z.ZodString;
2060
+ skillName: z.ZodString;
2061
+ toolName: z.ZodString;
2062
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2063
+ }, z.core.$strip>>>;
2064
+ partialToolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
2065
+ id: z.ZodString;
2066
+ skillName: z.ZodString;
2067
+ toolName: z.ZodString;
2068
+ result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2069
+ id: z.ZodString;
2070
+ type: z.ZodLiteral<"textPart">;
2071
+ text: z.ZodString;
2072
+ }, z.core.$strip>, z.ZodObject<{
2073
+ id: z.ZodString;
2074
+ type: z.ZodLiteral<"imageUrlPart">;
2075
+ url: z.ZodURL;
2076
+ mimeType: z.ZodString;
2077
+ }, z.core.$strip>, z.ZodObject<{
2078
+ id: z.ZodString;
2079
+ type: z.ZodLiteral<"imageInlinePart">;
2080
+ encodedData: z.ZodString;
2081
+ mimeType: z.ZodString;
2082
+ }, z.core.$strip>, z.ZodObject<{
2083
+ id: z.ZodString;
2084
+ type: z.ZodLiteral<"imageBinaryPart">;
2085
+ data: z.ZodString;
2086
+ mimeType: z.ZodString;
2087
+ }, z.core.$strip>, z.ZodObject<{
2088
+ id: z.ZodString;
2089
+ type: z.ZodLiteral<"fileUrlPart">;
2090
+ url: z.ZodString;
2091
+ mimeType: z.ZodString;
2092
+ }, z.core.$strip>, z.ZodObject<{
2093
+ id: z.ZodString;
2094
+ type: z.ZodLiteral<"fileInlinePart">;
2095
+ encodedData: z.ZodString;
2096
+ mimeType: z.ZodString;
2097
+ }, z.core.$strip>, z.ZodObject<{
2098
+ id: z.ZodString;
2099
+ type: z.ZodLiteral<"fileBinaryPart">;
2100
+ data: z.ZodString;
2101
+ mimeType: z.ZodString;
2102
+ }, z.core.$strip>, z.ZodObject<{
2103
+ id: z.ZodString;
2104
+ type: z.ZodLiteral<"toolCallPart">;
2105
+ toolCallId: z.ZodString;
2106
+ toolName: z.ZodString;
2107
+ args: z.ZodUnknown;
2108
+ }, z.core.$strip>, z.ZodObject<{
2109
+ id: z.ZodString;
2110
+ type: z.ZodLiteral<"toolResultPart">;
2111
+ toolCallId: z.ZodString;
2112
+ toolName: z.ZodString;
2113
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2114
+ id: z.ZodString;
2115
+ type: z.ZodLiteral<"textPart">;
2116
+ text: z.ZodString;
2117
+ }, z.core.$strip>, z.ZodObject<{
2118
+ id: z.ZodString;
2119
+ type: z.ZodLiteral<"imageInlinePart">;
2120
+ encodedData: z.ZodString;
2121
+ mimeType: z.ZodString;
2122
+ }, z.core.$strip>, z.ZodObject<{
2123
+ id: z.ZodString;
2124
+ type: z.ZodLiteral<"fileInlinePart">;
2125
+ encodedData: z.ZodString;
2126
+ mimeType: z.ZodString;
2127
+ }, z.core.$strip>]>>;
2128
+ isError: z.ZodOptional<z.ZodBoolean>;
2129
+ }, z.core.$strip>], "type">>;
2130
+ }, z.core.$strip>>>;
1932
2131
  usage: z.ZodObject<{
1933
2132
  inputTokens: z.ZodNumber;
1934
2133
  outputTokens: z.ZodNumber;
@@ -2570,6 +2769,11 @@ declare const runParamsSchema: z.ZodObject<{
2570
2769
  type: z.ZodLiteral<"imageInlinePart">;
2571
2770
  encodedData: z.ZodString;
2572
2771
  mimeType: z.ZodString;
2772
+ }, z.core.$strip>, z.ZodObject<{
2773
+ id: z.ZodString;
2774
+ type: z.ZodLiteral<"fileInlinePart">;
2775
+ encodedData: z.ZodString;
2776
+ mimeType: z.ZodString;
2573
2777
  }, z.core.$strip>]>>;
2574
2778
  isError: z.ZodOptional<z.ZodBoolean>;
2575
2779
  }, z.core.$strip>>;
@@ -2609,6 +2813,79 @@ declare const runParamsSchema: z.ZodObject<{
2609
2813
  }, z.core.$strip>;
2610
2814
  contextWindow: z.ZodOptional<z.ZodNumber>;
2611
2815
  contextWindowUsage: z.ZodOptional<z.ZodNumber>;
2816
+ pendingToolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
2817
+ id: z.ZodString;
2818
+ skillName: z.ZodString;
2819
+ toolName: z.ZodString;
2820
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2821
+ }, z.core.$strip>>>;
2822
+ partialToolResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
2823
+ id: z.ZodString;
2824
+ skillName: z.ZodString;
2825
+ toolName: z.ZodString;
2826
+ result: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2827
+ id: z.ZodString;
2828
+ type: z.ZodLiteral<"textPart">;
2829
+ text: z.ZodString;
2830
+ }, z.core.$strip>, z.ZodObject<{
2831
+ id: z.ZodString;
2832
+ type: z.ZodLiteral<"imageUrlPart">;
2833
+ url: z.ZodURL;
2834
+ mimeType: z.ZodString;
2835
+ }, z.core.$strip>, z.ZodObject<{
2836
+ id: z.ZodString;
2837
+ type: z.ZodLiteral<"imageInlinePart">;
2838
+ encodedData: z.ZodString;
2839
+ mimeType: z.ZodString;
2840
+ }, z.core.$strip>, z.ZodObject<{
2841
+ id: z.ZodString;
2842
+ type: z.ZodLiteral<"imageBinaryPart">;
2843
+ data: z.ZodString;
2844
+ mimeType: z.ZodString;
2845
+ }, z.core.$strip>, z.ZodObject<{
2846
+ id: z.ZodString;
2847
+ type: z.ZodLiteral<"fileUrlPart">;
2848
+ url: z.ZodString;
2849
+ mimeType: z.ZodString;
2850
+ }, z.core.$strip>, z.ZodObject<{
2851
+ id: z.ZodString;
2852
+ type: z.ZodLiteral<"fileInlinePart">;
2853
+ encodedData: z.ZodString;
2854
+ mimeType: z.ZodString;
2855
+ }, z.core.$strip>, z.ZodObject<{
2856
+ id: z.ZodString;
2857
+ type: z.ZodLiteral<"fileBinaryPart">;
2858
+ data: z.ZodString;
2859
+ mimeType: z.ZodString;
2860
+ }, z.core.$strip>, z.ZodObject<{
2861
+ id: z.ZodString;
2862
+ type: z.ZodLiteral<"toolCallPart">;
2863
+ toolCallId: z.ZodString;
2864
+ toolName: z.ZodString;
2865
+ args: z.ZodUnknown;
2866
+ }, z.core.$strip>, z.ZodObject<{
2867
+ id: z.ZodString;
2868
+ type: z.ZodLiteral<"toolResultPart">;
2869
+ toolCallId: z.ZodString;
2870
+ toolName: z.ZodString;
2871
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
2872
+ id: z.ZodString;
2873
+ type: z.ZodLiteral<"textPart">;
2874
+ text: z.ZodString;
2875
+ }, z.core.$strip>, z.ZodObject<{
2876
+ id: z.ZodString;
2877
+ type: z.ZodLiteral<"imageInlinePart">;
2878
+ encodedData: z.ZodString;
2879
+ mimeType: z.ZodString;
2880
+ }, z.core.$strip>, z.ZodObject<{
2881
+ id: z.ZodString;
2882
+ type: z.ZodLiteral<"fileInlinePart">;
2883
+ encodedData: z.ZodString;
2884
+ mimeType: z.ZodString;
2885
+ }, z.core.$strip>]>>;
2886
+ isError: z.ZodOptional<z.ZodBoolean>;
2887
+ }, z.core.$strip>], "type">>;
2888
+ }, z.core.$strip>>>;
2612
2889
  }, z.core.$strip>>;
2613
2890
  }, z.core.$strip>;
2614
2891
  /**
@@ -2626,13 +2903,13 @@ type ExpertEventPayloads = {
2626
2903
  retry: {
2627
2904
  reason: string;
2628
2905
  newMessages: (UserMessage | ExpertMessage | ToolMessage)[];
2629
- toolCall?: ToolCall;
2630
- toolResult?: ToolResult;
2906
+ toolCalls?: ToolCall[];
2907
+ toolResults?: ToolResult[];
2631
2908
  usage: Usage;
2632
2909
  };
2633
- callTool: {
2910
+ callTools: {
2634
2911
  newMessage: ExpertMessage;
2635
- toolCall: ToolCall;
2912
+ toolCalls: ToolCall[];
2636
2913
  usage: Usage;
2637
2914
  };
2638
2915
  callInteractiveTool: {
@@ -2645,24 +2922,25 @@ type ExpertEventPayloads = {
2645
2922
  toolCall: ToolCall;
2646
2923
  usage: Usage;
2647
2924
  };
2648
- resolveToolResult: {
2649
- toolResult: ToolResult;
2925
+ resolveToolResults: {
2926
+ toolResults: ToolResult[];
2650
2927
  };
2651
2928
  resolveThought: {
2652
2929
  toolResult: ToolResult;
2653
2930
  };
2654
- resolvePdfFile: {
2655
- toolResult: ToolResult;
2656
- };
2657
- resolveImageFile: {
2658
- toolResult: ToolResult;
2659
- };
2660
2931
  attemptCompletion: {
2661
2932
  toolResult: ToolResult;
2662
2933
  };
2663
2934
  finishToolCall: {
2664
2935
  newMessages: (UserMessage | ToolMessage)[];
2665
2936
  };
2937
+ resumeToolCalls: {
2938
+ pendingToolCalls: ToolCall[];
2939
+ partialToolResults: ToolResult[];
2940
+ };
2941
+ finishAllToolCalls: {
2942
+ newMessages: (UserMessage | ToolMessage)[];
2943
+ };
2666
2944
  continueToNextStep: {
2667
2945
  checkpoint: Checkpoint;
2668
2946
  step: Step;
@@ -2739,29 +3017,29 @@ declare const retry: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<Ba
2739
3017
  } & {
2740
3018
  reason: string;
2741
3019
  newMessages: (UserMessage | ExpertMessage | ToolMessage)[];
2742
- toolCall?: ToolCall;
2743
- toolResult?: ToolResult;
3020
+ toolCalls?: ToolCall[];
3021
+ toolResults?: ToolResult[];
2744
3022
  usage: Usage;
2745
3023
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2746
3024
  type: "retry";
2747
3025
  } & {
2748
3026
  reason: string;
2749
3027
  newMessages: (UserMessage | ExpertMessage | ToolMessage)[];
2750
- toolCall?: ToolCall;
2751
- toolResult?: ToolResult;
3028
+ toolCalls?: ToolCall[];
3029
+ toolResults?: ToolResult[];
2752
3030
  usage: Usage;
2753
3031
  };
2754
- declare const callTool: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2755
- type: "callTool";
3032
+ declare const callTools: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3033
+ type: "callTools";
2756
3034
  } & {
2757
3035
  newMessage: ExpertMessage;
2758
- toolCall: ToolCall;
3036
+ toolCalls: ToolCall[];
2759
3037
  usage: Usage;
2760
3038
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2761
- type: "callTool";
3039
+ type: "callTools";
2762
3040
  } & {
2763
3041
  newMessage: ExpertMessage;
2764
- toolCall: ToolCall;
3042
+ toolCalls: ToolCall[];
2765
3043
  usage: Usage;
2766
3044
  };
2767
3045
  declare const callInteractiveTool: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
@@ -2790,14 +3068,14 @@ declare const callDelegate: (setting: RunSetting, checkpoint: Checkpoint, data:
2790
3068
  toolCall: ToolCall;
2791
3069
  usage: Usage;
2792
3070
  };
2793
- declare const resolveToolResult: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2794
- type: "resolveToolResult";
3071
+ declare const resolveToolResults: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3072
+ type: "resolveToolResults";
2795
3073
  } & {
2796
- toolResult: ToolResult;
3074
+ toolResults: ToolResult[];
2797
3075
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2798
- type: "resolveToolResult";
3076
+ type: "resolveToolResults";
2799
3077
  } & {
2800
- toolResult: ToolResult;
3078
+ toolResults: ToolResult[];
2801
3079
  };
2802
3080
  declare const resolveThought: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2803
3081
  type: "resolveThought";
@@ -2808,39 +3086,41 @@ declare const resolveThought: (setting: RunSetting, checkpoint: Checkpoint, data
2808
3086
  } & {
2809
3087
  toolResult: ToolResult;
2810
3088
  };
2811
- declare const resolvePdfFile: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2812
- type: "resolvePdfFile";
3089
+ declare const attemptCompletion: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3090
+ type: "attemptCompletion";
2813
3091
  } & {
2814
3092
  toolResult: ToolResult;
2815
3093
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2816
- type: "resolvePdfFile";
3094
+ type: "attemptCompletion";
2817
3095
  } & {
2818
3096
  toolResult: ToolResult;
2819
3097
  };
2820
- declare const resolveImageFile: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2821
- type: "resolveImageFile";
3098
+ declare const finishToolCall: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3099
+ type: "finishToolCall";
2822
3100
  } & {
2823
- toolResult: ToolResult;
3101
+ newMessages: (UserMessage | ToolMessage)[];
2824
3102
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2825
- type: "resolveImageFile";
3103
+ type: "finishToolCall";
2826
3104
  } & {
2827
- toolResult: ToolResult;
3105
+ newMessages: (UserMessage | ToolMessage)[];
2828
3106
  };
2829
- declare const attemptCompletion: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2830
- type: "attemptCompletion";
3107
+ declare const resumeToolCalls: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3108
+ type: "resumeToolCalls";
2831
3109
  } & {
2832
- toolResult: ToolResult;
3110
+ pendingToolCalls: ToolCall[];
3111
+ partialToolResults: ToolResult[];
2833
3112
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2834
- type: "attemptCompletion";
3113
+ type: "resumeToolCalls";
2835
3114
  } & {
2836
- toolResult: ToolResult;
3115
+ pendingToolCalls: ToolCall[];
3116
+ partialToolResults: ToolResult[];
2837
3117
  };
2838
- declare const finishToolCall: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
2839
- type: "finishToolCall";
3118
+ declare const finishAllToolCalls: (setting: RunSetting, checkpoint: Checkpoint, data: Omit<BaseEvent & {
3119
+ type: "finishAllToolCalls";
2840
3120
  } & {
2841
3121
  newMessages: (UserMessage | ToolMessage)[];
2842
3122
  }, "id" | "type" | "runId" | "stepNumber" | "expertKey" | "timestamp">) => BaseEvent & {
2843
- type: "finishToolCall";
3123
+ type: "finishAllToolCalls";
2844
3124
  } & {
2845
3125
  newMessages: (UserMessage | ToolMessage)[];
2846
3126
  };
@@ -2932,12 +3212,23 @@ type RuntimeEventPayloads = {
2932
3212
  text: string;
2933
3213
  };
2934
3214
  };
3215
+ skillStarting: {
3216
+ skillName: string;
3217
+ command: string;
3218
+ args: string[];
3219
+ };
2935
3220
  skillConnected: {
2936
3221
  skillName: string;
2937
3222
  serverInfo?: {
2938
3223
  name: string;
2939
3224
  version: string;
2940
3225
  };
3226
+ connectDurationMs?: number;
3227
+ totalDurationMs?: number;
3228
+ };
3229
+ skillStderr: {
3230
+ skillName: string;
3231
+ message: string;
2941
3232
  };
2942
3233
  skillDisconnected: {
2943
3234
  skillName: string;
@@ -3023,4 +3314,4 @@ type Resource = {
3023
3314
  declare function formatZodError(error: ZodError): string;
3024
3315
  declare function parseWithFriendlyError<T>(schema: ZodSchema<T>, data: unknown, context?: string): T;
3025
3316
 
3026
- 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, callTool, checkpointSchema, checkpointStatusSchema, completeRun, continueToNextStep, createEvent, createRuntimeEvent, deepseekProviderConfigSchema, defaultMaxRetries, defaultMaxSteps, defaultPerstackApiBaseUrl, defaultTemperature, defaultTimeout, envNameRegex, expertKeyRegex, expertMessageSchema, expertNameRegex, expertSchema, expertVersionRegex, fileBinaryPartSchema, fileInlinePartSchema, fileUrlPartSchema, 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, resolveImageFile, resolvePdfFile, resolveThought, resolveToolResult, retry, runCommandInputSchema, runParamsSchema, runSettingSchema, skillSchema, startCommandInputSchema, startGeneration, startRun, stepSchema, stopRunByDelegate, stopRunByExceededMaxSteps, stopRunByInteractiveTool, tagNameRegex, textPartSchema, toolCallPartSchema, toolCallSchema, toolMessageSchema, toolResultPartSchema, toolResultSchema, urlSafeRegex, usageSchema, userMessageSchema };
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 };