@perstack/runtime 0.0.62 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -44
- package/dist/src/index.d.ts +53 -33
- package/dist/src/index.js +424 -141
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,22 +12,22 @@ npm install @perstack/runtime
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
The primary entry point is the `run` function. It takes a `
|
|
15
|
+
The primary entry point is the `run` function. It takes a `JobSetting` object and an optional `RunOptions` object.
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
18
|
import { run } from "@perstack/runtime"
|
|
19
|
-
import { type
|
|
19
|
+
import { type JobSetting } from "@perstack/core"
|
|
20
20
|
|
|
21
|
-
// Configure the
|
|
22
|
-
const setting:
|
|
23
|
-
|
|
21
|
+
// Configure the job
|
|
22
|
+
const setting: JobSetting = {
|
|
23
|
+
jobId: "job-123",
|
|
24
24
|
expertKey: "researcher",
|
|
25
25
|
input: { text: "Research quantum computing" },
|
|
26
26
|
// ... configuration for model, experts, etc.
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// Execute the
|
|
30
|
-
const
|
|
29
|
+
// Execute the job
|
|
30
|
+
const finalJob = await run({ setting }, {
|
|
31
31
|
eventListener: (event) => {
|
|
32
32
|
console.log(`[${event.type}]`, event)
|
|
33
33
|
}
|
|
@@ -43,8 +43,9 @@ type RunEvent = {
|
|
|
43
43
|
type: EventType // e.g., "startRun", "callTools"
|
|
44
44
|
id: string // Unique event ID
|
|
45
45
|
timestamp: number // Unix timestamp
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
jobId: string // ID of the Job
|
|
47
|
+
runId: string // ID of the current Run
|
|
48
|
+
stepNumber: number // Current step number within this Run
|
|
48
49
|
// ... plus payload specific to the event type
|
|
49
50
|
}
|
|
50
51
|
```
|
|
@@ -72,11 +73,11 @@ eventListener: (event) => {
|
|
|
72
73
|
|
|
73
74
|
The runtime manages skills through specialized Skill Managers. Each skill type has its own manager class:
|
|
74
75
|
|
|
75
|
-
| Type | Manager | Purpose
|
|
76
|
-
| --------------- | ------------------------- |
|
|
77
|
-
| MCP (stdio/SSE) | `McpSkillManager` | External tools via MCP protocol
|
|
78
|
-
| Interactive | `InteractiveSkillManager` | User input tools (
|
|
79
|
-
| Delegate | `DelegateSkillManager` | Expert-to-Expert calls
|
|
76
|
+
| Type | Manager | Purpose |
|
|
77
|
+
| --------------- | ------------------------- | ----------------------------------- |
|
|
78
|
+
| MCP (stdio/SSE) | `McpSkillManager` | External tools via MCP protocol |
|
|
79
|
+
| Interactive | `InteractiveSkillManager` | User input tools (Coordinator only) |
|
|
80
|
+
| Delegate | `DelegateSkillManager` | Expert-to-Expert calls |
|
|
80
81
|
|
|
81
82
|
All managers extend `BaseSkillManager` which provides:
|
|
82
83
|
- `init()` — Initialize the skill (connect MCP servers, parse definitions)
|
|
@@ -84,6 +85,8 @@ All managers extend `BaseSkillManager` which provides:
|
|
|
84
85
|
- `getToolDefinitions()` — Get available tools
|
|
85
86
|
- `callTool()` — Execute a tool call
|
|
86
87
|
|
|
88
|
+
**Note:** Interactive skills are only available to the Coordinator Expert. See [Experts documentation](https://docs.perstack.ai/understanding-perstack/experts#why-no-interactive-tools-for-delegates) for details.
|
|
89
|
+
|
|
87
90
|
### Initialization Flow
|
|
88
91
|
|
|
89
92
|
```
|
|
@@ -92,7 +95,7 @@ getSkillManagers(expert, experts, setting)
|
|
|
92
95
|
├─► Initialize MCP skills (parallel)
|
|
93
96
|
│ └─► McpSkillManager × N
|
|
94
97
|
│
|
|
95
|
-
├─► Initialize Interactive skills (
|
|
98
|
+
├─► Initialize Interactive skills (Coordinator only)
|
|
96
99
|
│ └─► InteractiveSkillManager × N
|
|
97
100
|
│
|
|
98
101
|
└─► Initialize Delegate skills (parallel)
|
|
@@ -113,15 +116,20 @@ graph TD
|
|
|
113
116
|
User((User)) -->|Provides| Input[Input / Query]
|
|
114
117
|
|
|
115
118
|
subgraph Runtime [Runtime Engine]
|
|
116
|
-
subgraph
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
subgraph Job [Job]
|
|
120
|
+
subgraph Run1 [Run: Coordinator]
|
|
121
|
+
State[State Machine]
|
|
122
|
+
Context[Execution Context]
|
|
123
|
+
|
|
124
|
+
subgraph Skills [Skill Layer]
|
|
125
|
+
SM[Skill Manager]
|
|
126
|
+
MCP[MCP Client]
|
|
127
|
+
MCPServer[MCP Server]
|
|
128
|
+
end
|
|
124
129
|
end
|
|
130
|
+
|
|
131
|
+
Run2["Run: Delegate A"]
|
|
132
|
+
Run3["Run: Delegate B"]
|
|
125
133
|
end
|
|
126
134
|
end
|
|
127
135
|
|
|
@@ -130,8 +138,8 @@ graph TD
|
|
|
130
138
|
Workspace[Workspace / FS]
|
|
131
139
|
end
|
|
132
140
|
|
|
133
|
-
Def -->|Instantiates|
|
|
134
|
-
Input -->|Starts|
|
|
141
|
+
Def -->|Instantiates| Run1
|
|
142
|
+
Input -->|Starts| Run1
|
|
135
143
|
|
|
136
144
|
State -->|Reasoning| LLM
|
|
137
145
|
State -->|Act| SM
|
|
@@ -139,13 +147,34 @@ graph TD
|
|
|
139
147
|
MCP -->|Connect| MCPServer
|
|
140
148
|
MCPServer -->|Access| Workspace
|
|
141
149
|
|
|
142
|
-
SM -.->|Delegate|
|
|
143
|
-
|
|
144
|
-
State ~~~ Context
|
|
150
|
+
SM -.->|Delegate| Run2
|
|
151
|
+
SM -.->|Delegate| Run3
|
|
145
152
|
```
|
|
146
153
|
|
|
147
154
|
## Core Concepts
|
|
148
155
|
|
|
156
|
+
### Execution Hierarchy
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Job (jobId)
|
|
160
|
+
├── Run 1 (Coordinator Expert)
|
|
161
|
+
│ └── Checkpoints...
|
|
162
|
+
├── Run 2 (Delegated Expert A)
|
|
163
|
+
│ └── Checkpoints...
|
|
164
|
+
└── Run 3 (Delegated Expert B)
|
|
165
|
+
└── Checkpoints...
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
| Concept | Description |
|
|
169
|
+
| -------------- | -------------------------------------------- |
|
|
170
|
+
| **Job** | Top-level execution unit. Contains all Runs. |
|
|
171
|
+
| **Run** | Single Expert execution. |
|
|
172
|
+
| **Checkpoint** | Snapshot at step end. Enables pause/resume. |
|
|
173
|
+
|
|
174
|
+
For details on step counting, Coordinator vs. Delegated Expert differences, and the full execution model, see [Runtime](https://docs.perstack.ai/understanding-perstack/runtime).
|
|
175
|
+
|
|
176
|
+
### Events, Steps, Checkpoints
|
|
177
|
+
|
|
149
178
|
The runtime's execution model can be visualized as a timeline where **Events** are points, **Steps** are the lines connecting them, and **Checkpoints** are the anchors.
|
|
150
179
|
|
|
151
180
|
```mermaid
|
|
@@ -164,13 +193,13 @@ graph LR
|
|
|
164
193
|
style CP2 fill:#f96,stroke:#333,stroke-width:4px
|
|
165
194
|
```
|
|
166
195
|
|
|
167
|
-
|
|
196
|
+
#### 1. Events
|
|
168
197
|
**Events** are granular moments in time that occur *during* execution. They represent specific actions or observations, such as "started reasoning", "called tool", or "finished tool".
|
|
169
198
|
|
|
170
|
-
|
|
199
|
+
#### 2. Step
|
|
171
200
|
A **Step** is the continuous process that connects these events. It represents one atomic cycle of the agent's loop (Reasoning -> Act -> Observe, repeat).
|
|
172
201
|
|
|
173
|
-
|
|
202
|
+
#### 3. Checkpoint
|
|
174
203
|
A **Checkpoint** is the immutable result at the end of a Step. It serves as the anchor point that:
|
|
175
204
|
- Finalizes the previous Step.
|
|
176
205
|
- Becomes the starting point for the next Step.
|
|
@@ -194,7 +223,7 @@ stateDiagram-v2
|
|
|
194
223
|
CallingTools --> ResolvingToolResults: resolveToolResults
|
|
195
224
|
CallingTools --> ResolvingThought: resolveThought
|
|
196
225
|
CallingTools --> GeneratingRunResult: attemptCompletion
|
|
197
|
-
CallingTools --> CallingDelegate:
|
|
226
|
+
CallingTools --> CallingDelegate: callDelegates
|
|
198
227
|
CallingTools --> CallingInteractiveTool: callInteractiveTool
|
|
199
228
|
|
|
200
229
|
ResolvingToolResults --> FinishingStep: finishToolCall
|
|
@@ -216,24 +245,24 @@ Events trigger state transitions. They are emitted by the runtime logic or exter
|
|
|
216
245
|
- **Lifecycle**: `startRun`, `startGeneration`, `continueToNextStep`, `completeRun`
|
|
217
246
|
- **Tool Execution**: `callTools`, `resolveToolResults`, `finishToolCall`, `resumeToolCalls`, `finishAllToolCalls`
|
|
218
247
|
- **Special Types**: `resolveThought`
|
|
219
|
-
- **
|
|
248
|
+
- **Delegation**: `callDelegate` (triggers new Run(s) for delegate(s), parallel when multiple)
|
|
249
|
+
- **Interactive**: `callInteractiveTool` (Coordinator only)
|
|
220
250
|
- **Interruption**: `stopRunByInteractiveTool`, `stopRunByDelegate`, `stopRunByExceededMaxSteps`
|
|
221
251
|
- **Error Handling**: `retry`
|
|
222
252
|
|
|
223
253
|
## Checkpoint Status
|
|
224
254
|
|
|
225
|
-
The `status` field in a Checkpoint indicates the current state
|
|
255
|
+
The `status` field in a Checkpoint indicates the current state:
|
|
226
256
|
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
- **stoppedByDelegate**: The run is paused, waiting for a delegated sub-agent to complete.
|
|
232
|
-
- **stoppedByExceededMaxSteps**: The run stopped because it reached the maximum allowed steps.
|
|
233
|
-
- **stoppedByError**: The run stopped due to an unrecoverable error.
|
|
257
|
+
- `init`, `proceeding` — Run lifecycle
|
|
258
|
+
- `completed` — Task finished successfully
|
|
259
|
+
- `stoppedByInteractiveTool`, `stoppedByDelegate` — Waiting for external input
|
|
260
|
+
- `stoppedByExceededMaxSteps`, `stoppedByError` — Run stopped
|
|
234
261
|
|
|
235
|
-
|
|
262
|
+
For stop reasons and error handling, see [Error Handling](https://docs.perstack.ai/using-experts/error-handling).
|
|
236
263
|
|
|
237
|
-
|
|
238
|
-
- [State Management](https://perstack.ai/docs/using-experts/state-management) - Understanding checkpoints and state
|
|
264
|
+
## Related Documentation
|
|
239
265
|
|
|
266
|
+
- [Runtime](https://docs.perstack.ai/understanding-perstack/runtime) — Full execution model
|
|
267
|
+
- [State Management](https://docs.perstack.ai/using-experts/state-management) — Jobs, Runs, and Checkpoints
|
|
268
|
+
- [Running Experts](https://docs.perstack.ai/using-experts/running-experts) — CLI usage
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import * as _perstack_core from '@perstack/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Checkpoint, RunEvent, Job, ProviderConfig, ProviderName, Usage, RunSetting, Expert, RunParamsInput, Step, RuntimeEvent, ToolDefinition, SkillType, McpStdioSkill, McpSseSkill, InteractiveSkill, TextPart, ImageInlinePart, FileInlinePart } from '@perstack/core';
|
|
3
3
|
import { LanguageModel } from 'ai';
|
|
4
4
|
import * as xstate from 'xstate';
|
|
5
5
|
import { SnapshotFrom, ActorRefFrom } from 'xstate';
|
|
6
6
|
|
|
7
|
+
declare function getCheckpointDir(jobId: string): string;
|
|
8
|
+
declare function getCheckpointPath(jobId: string, checkpointId: string): string;
|
|
9
|
+
declare function getCheckpointsByJobId(jobId: string): Checkpoint[];
|
|
10
|
+
declare function getEventsByRun(jobId: string, runId: string): {
|
|
11
|
+
timestamp: number;
|
|
12
|
+
stepNumber: number;
|
|
13
|
+
type: string;
|
|
14
|
+
}[];
|
|
15
|
+
declare function getEventContents(jobId: string, runId: string, maxStepNumber?: number): RunEvent[];
|
|
16
|
+
|
|
17
|
+
declare function getJobsDir(): string;
|
|
18
|
+
declare function getJobDir(jobId: string): string;
|
|
19
|
+
declare function storeJob(job: Job): void;
|
|
20
|
+
declare function retrieveJob(jobId: string): Job | undefined;
|
|
21
|
+
declare function getAllJobs(): Job[];
|
|
22
|
+
declare function createInitialJob(jobId: string, expertKey: string, maxSteps?: number): Job;
|
|
23
|
+
|
|
7
24
|
declare function getModel(modelId: string, providerConfig: ProviderConfig): LanguageModel;
|
|
8
25
|
declare function getContextWindow(providerName: ProviderName, modelId: string): number | undefined;
|
|
9
26
|
declare function calculateContextWindowUsage(usage: Usage, contextWindow: number): number;
|
|
@@ -16,8 +33,9 @@ type FileSystem = {
|
|
|
16
33
|
readFile: (path: string, encoding: BufferEncoding) => Promise<string>;
|
|
17
34
|
writeFile: (path: string, data: string, encoding: BufferEncoding) => Promise<void>;
|
|
18
35
|
};
|
|
19
|
-
type GetRunDirFn = (runId: string) => string;
|
|
20
|
-
declare function defaultGetRunDir(runId: string): string;
|
|
36
|
+
type GetRunDirFn = (jobId: string, runId: string) => string;
|
|
37
|
+
declare function defaultGetRunDir(jobId: string, runId: string): string;
|
|
38
|
+
declare function getAllRuns(): RunSetting[];
|
|
21
39
|
|
|
22
40
|
type ResolveExpertToRunFn = (expertKey: string, experts: Record<string, Expert>, clientOptions: {
|
|
23
41
|
perstackApiBaseUrl: string;
|
|
@@ -26,12 +44,13 @@ type ResolveExpertToRunFn = (expertKey: string, experts: Record<string, Expert>,
|
|
|
26
44
|
|
|
27
45
|
declare function run(runInput: RunParamsInput, options?: {
|
|
28
46
|
shouldContinueRun?: (setting: RunSetting, checkpoint: Checkpoint, step: Step) => Promise<boolean>;
|
|
29
|
-
retrieveCheckpoint?: (
|
|
30
|
-
storeCheckpoint?: (checkpoint: Checkpoint
|
|
47
|
+
retrieveCheckpoint?: (jobId: string, checkpointId: string) => Promise<Checkpoint>;
|
|
48
|
+
storeCheckpoint?: (checkpoint: Checkpoint) => Promise<void>;
|
|
31
49
|
eventListener?: (event: RunEvent | RuntimeEvent) => void;
|
|
32
50
|
resolveExpertToRun?: ResolveExpertToRunFn;
|
|
33
51
|
fileSystem?: FileSystem;
|
|
34
52
|
getRunDir?: GetRunDirFn;
|
|
53
|
+
returnOnDelegationComplete?: boolean;
|
|
35
54
|
}): Promise<Checkpoint>;
|
|
36
55
|
|
|
37
56
|
declare abstract class BaseSkillManager {
|
|
@@ -44,9 +63,10 @@ declare abstract class BaseSkillManager {
|
|
|
44
63
|
readonly skill?: McpStdioSkill | McpSseSkill;
|
|
45
64
|
readonly interactiveSkill?: InteractiveSkill;
|
|
46
65
|
readonly expert?: Expert;
|
|
66
|
+
protected _jobId: string;
|
|
47
67
|
protected _runId: string;
|
|
48
68
|
protected _eventListener?: (event: RunEvent | RuntimeEvent) => void;
|
|
49
|
-
constructor(runId: string, eventListener?: (event: RunEvent | RuntimeEvent) => void);
|
|
69
|
+
constructor(jobId: string, runId: string, eventListener?: (event: RunEvent | RuntimeEvent) => void);
|
|
50
70
|
init(): Promise<void>;
|
|
51
71
|
isInitialized(): boolean;
|
|
52
72
|
protected _performInit(): Promise<void>;
|
|
@@ -96,7 +116,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
96
116
|
type: "callDelegate";
|
|
97
117
|
} & {
|
|
98
118
|
newMessage: _perstack_core.ExpertMessage;
|
|
99
|
-
|
|
119
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
100
120
|
usage: _perstack_core.Usage;
|
|
101
121
|
}) | (_perstack_core.BaseEvent & {
|
|
102
122
|
type: "resolveToolResults";
|
|
@@ -215,7 +235,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
215
235
|
type: "callDelegate";
|
|
216
236
|
} & {
|
|
217
237
|
newMessage: _perstack_core.ExpertMessage;
|
|
218
|
-
|
|
238
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
219
239
|
usage: _perstack_core.Usage;
|
|
220
240
|
}) | (_perstack_core.BaseEvent & {
|
|
221
241
|
type: "resolveToolResults";
|
|
@@ -303,7 +323,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
303
323
|
type: "callDelegate";
|
|
304
324
|
} & {
|
|
305
325
|
newMessage: _perstack_core.ExpertMessage;
|
|
306
|
-
|
|
326
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
307
327
|
usage: _perstack_core.Usage;
|
|
308
328
|
}) | (_perstack_core.BaseEvent & {
|
|
309
329
|
type: "resolveToolResults";
|
|
@@ -421,7 +441,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
421
441
|
type: "callDelegate";
|
|
422
442
|
} & {
|
|
423
443
|
newMessage: _perstack_core.ExpertMessage;
|
|
424
|
-
|
|
444
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
425
445
|
usage: _perstack_core.Usage;
|
|
426
446
|
}) | (_perstack_core.BaseEvent & {
|
|
427
447
|
type: "resolveToolResults";
|
|
@@ -527,7 +547,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
527
547
|
type: "callDelegate";
|
|
528
548
|
} & {
|
|
529
549
|
newMessage: _perstack_core.ExpertMessage;
|
|
530
|
-
|
|
550
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
531
551
|
usage: _perstack_core.Usage;
|
|
532
552
|
}) | (_perstack_core.BaseEvent & {
|
|
533
553
|
type: "resolveToolResults";
|
|
@@ -630,7 +650,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
630
650
|
type: "callDelegate";
|
|
631
651
|
} & {
|
|
632
652
|
newMessage: _perstack_core.ExpertMessage;
|
|
633
|
-
|
|
653
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
634
654
|
usage: _perstack_core.Usage;
|
|
635
655
|
}) | (_perstack_core.BaseEvent & {
|
|
636
656
|
type: "resolveToolResults";
|
|
@@ -732,7 +752,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
732
752
|
type: "callDelegate";
|
|
733
753
|
} & {
|
|
734
754
|
newMessage: _perstack_core.ExpertMessage;
|
|
735
|
-
|
|
755
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
736
756
|
usage: _perstack_core.Usage;
|
|
737
757
|
}) | (_perstack_core.BaseEvent & {
|
|
738
758
|
type: "resolveToolResults";
|
|
@@ -842,7 +862,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
842
862
|
type: "callDelegate";
|
|
843
863
|
} & {
|
|
844
864
|
newMessage: _perstack_core.ExpertMessage;
|
|
845
|
-
|
|
865
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
846
866
|
usage: _perstack_core.Usage;
|
|
847
867
|
}) | (_perstack_core.BaseEvent & {
|
|
848
868
|
type: "resolveToolResults";
|
|
@@ -946,7 +966,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
946
966
|
type: "callDelegate";
|
|
947
967
|
} & {
|
|
948
968
|
newMessage: _perstack_core.ExpertMessage;
|
|
949
|
-
|
|
969
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
950
970
|
usage: _perstack_core.Usage;
|
|
951
971
|
}) | (_perstack_core.BaseEvent & {
|
|
952
972
|
type: "resolveToolResults";
|
|
@@ -1050,7 +1070,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1050
1070
|
type: "callDelegate";
|
|
1051
1071
|
} & {
|
|
1052
1072
|
newMessage: _perstack_core.ExpertMessage;
|
|
1053
|
-
|
|
1073
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1054
1074
|
usage: _perstack_core.Usage;
|
|
1055
1075
|
}) | (_perstack_core.BaseEvent & {
|
|
1056
1076
|
type: "resolveToolResults";
|
|
@@ -1119,7 +1139,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1119
1139
|
type: "callDelegate";
|
|
1120
1140
|
} & {
|
|
1121
1141
|
newMessage: _perstack_core.ExpertMessage;
|
|
1122
|
-
|
|
1142
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1123
1143
|
usage: _perstack_core.Usage;
|
|
1124
1144
|
}, (_perstack_core.BaseEvent & {
|
|
1125
1145
|
type: "startRun";
|
|
@@ -1154,7 +1174,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1154
1174
|
type: "callDelegate";
|
|
1155
1175
|
} & {
|
|
1156
1176
|
newMessage: _perstack_core.ExpertMessage;
|
|
1157
|
-
|
|
1177
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1158
1178
|
usage: _perstack_core.Usage;
|
|
1159
1179
|
}) | (_perstack_core.BaseEvent & {
|
|
1160
1180
|
type: "resolveToolResults";
|
|
@@ -1260,7 +1280,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1260
1280
|
type: "callDelegate";
|
|
1261
1281
|
} & {
|
|
1262
1282
|
newMessage: _perstack_core.ExpertMessage;
|
|
1263
|
-
|
|
1283
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1264
1284
|
usage: _perstack_core.Usage;
|
|
1265
1285
|
}) | (_perstack_core.BaseEvent & {
|
|
1266
1286
|
type: "resolveToolResults";
|
|
@@ -1362,7 +1382,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1362
1382
|
type: "callDelegate";
|
|
1363
1383
|
} & {
|
|
1364
1384
|
newMessage: _perstack_core.ExpertMessage;
|
|
1365
|
-
|
|
1385
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1366
1386
|
usage: _perstack_core.Usage;
|
|
1367
1387
|
}) | (_perstack_core.BaseEvent & {
|
|
1368
1388
|
type: "resolveToolResults";
|
|
@@ -1464,7 +1484,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1464
1484
|
type: "callDelegate";
|
|
1465
1485
|
} & {
|
|
1466
1486
|
newMessage: _perstack_core.ExpertMessage;
|
|
1467
|
-
|
|
1487
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1468
1488
|
usage: _perstack_core.Usage;
|
|
1469
1489
|
}) | (_perstack_core.BaseEvent & {
|
|
1470
1490
|
type: "resolveToolResults";
|
|
@@ -1533,7 +1553,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1533
1553
|
type: "callDelegate";
|
|
1534
1554
|
} & {
|
|
1535
1555
|
newMessage: _perstack_core.ExpertMessage;
|
|
1536
|
-
|
|
1556
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1537
1557
|
usage: _perstack_core.Usage;
|
|
1538
1558
|
}, (_perstack_core.BaseEvent & {
|
|
1539
1559
|
type: "startRun";
|
|
@@ -1568,7 +1588,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1568
1588
|
type: "callDelegate";
|
|
1569
1589
|
} & {
|
|
1570
1590
|
newMessage: _perstack_core.ExpertMessage;
|
|
1571
|
-
|
|
1591
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1572
1592
|
usage: _perstack_core.Usage;
|
|
1573
1593
|
}) | (_perstack_core.BaseEvent & {
|
|
1574
1594
|
type: "resolveToolResults";
|
|
@@ -1672,7 +1692,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1672
1692
|
type: "callDelegate";
|
|
1673
1693
|
} & {
|
|
1674
1694
|
newMessage: _perstack_core.ExpertMessage;
|
|
1675
|
-
|
|
1695
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1676
1696
|
usage: _perstack_core.Usage;
|
|
1677
1697
|
}) | (_perstack_core.BaseEvent & {
|
|
1678
1698
|
type: "resolveToolResults";
|
|
@@ -1778,7 +1798,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1778
1798
|
type: "callDelegate";
|
|
1779
1799
|
} & {
|
|
1780
1800
|
newMessage: _perstack_core.ExpertMessage;
|
|
1781
|
-
|
|
1801
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1782
1802
|
usage: _perstack_core.Usage;
|
|
1783
1803
|
}) | (_perstack_core.BaseEvent & {
|
|
1784
1804
|
type: "resolveToolResults";
|
|
@@ -1884,7 +1904,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1884
1904
|
type: "callDelegate";
|
|
1885
1905
|
} & {
|
|
1886
1906
|
newMessage: _perstack_core.ExpertMessage;
|
|
1887
|
-
|
|
1907
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1888
1908
|
usage: _perstack_core.Usage;
|
|
1889
1909
|
}) | (_perstack_core.BaseEvent & {
|
|
1890
1910
|
type: "resolveToolResults";
|
|
@@ -1994,7 +2014,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1994
2014
|
type: "callDelegate";
|
|
1995
2015
|
} & {
|
|
1996
2016
|
newMessage: _perstack_core.ExpertMessage;
|
|
1997
|
-
|
|
2017
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1998
2018
|
usage: _perstack_core.Usage;
|
|
1999
2019
|
}) | (_perstack_core.BaseEvent & {
|
|
2000
2020
|
type: "resolveToolResults";
|
|
@@ -2099,7 +2119,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2099
2119
|
type: "callDelegate";
|
|
2100
2120
|
} & {
|
|
2101
2121
|
newMessage: _perstack_core.ExpertMessage;
|
|
2102
|
-
|
|
2122
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2103
2123
|
usage: _perstack_core.Usage;
|
|
2104
2124
|
}) | (_perstack_core.BaseEvent & {
|
|
2105
2125
|
type: "resolveToolResults";
|
|
@@ -2206,7 +2226,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2206
2226
|
type: "callDelegate";
|
|
2207
2227
|
} & {
|
|
2208
2228
|
newMessage: _perstack_core.ExpertMessage;
|
|
2209
|
-
|
|
2229
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2210
2230
|
usage: _perstack_core.Usage;
|
|
2211
2231
|
}) | (_perstack_core.BaseEvent & {
|
|
2212
2232
|
type: "resolveToolResults";
|
|
@@ -2313,7 +2333,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2313
2333
|
type: "callDelegate";
|
|
2314
2334
|
} & {
|
|
2315
2335
|
newMessage: _perstack_core.ExpertMessage;
|
|
2316
|
-
|
|
2336
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2317
2337
|
usage: _perstack_core.Usage;
|
|
2318
2338
|
}) | (_perstack_core.BaseEvent & {
|
|
2319
2339
|
type: "resolveToolResults";
|
|
@@ -2421,7 +2441,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2421
2441
|
type: "callDelegate";
|
|
2422
2442
|
} & {
|
|
2423
2443
|
newMessage: _perstack_core.ExpertMessage;
|
|
2424
|
-
|
|
2444
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2425
2445
|
usage: _perstack_core.Usage;
|
|
2426
2446
|
}) | (_perstack_core.BaseEvent & {
|
|
2427
2447
|
type: "resolveToolResults";
|
|
@@ -2525,7 +2545,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2525
2545
|
type: "callDelegate";
|
|
2526
2546
|
} & {
|
|
2527
2547
|
newMessage: _perstack_core.ExpertMessage;
|
|
2528
|
-
|
|
2548
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2529
2549
|
usage: _perstack_core.Usage;
|
|
2530
2550
|
}) | (_perstack_core.BaseEvent & {
|
|
2531
2551
|
type: "resolveToolResults";
|
|
@@ -2595,4 +2615,4 @@ type RunSnapshot = SnapshotFrom<typeof runtimeStateMachine>;
|
|
|
2595
2615
|
|
|
2596
2616
|
declare const runtimeVersion: string;
|
|
2597
2617
|
|
|
2598
|
-
export { type RunActor, type RunSnapshot, StateMachineLogics, calculateContextWindowUsage, getContextWindow, getModel, defaultGetRunDir as getRunDir, run, runtimeStateMachine, runtimeVersion };
|
|
2618
|
+
export { type RunActor, type RunSnapshot, StateMachineLogics, calculateContextWindowUsage, createInitialJob, getAllJobs, getAllRuns, getCheckpointDir, getCheckpointPath, getCheckpointsByJobId, getContextWindow, getEventContents, getEventsByRun, getJobDir, getJobsDir, getModel, defaultGetRunDir as getRunDir, retrieveJob, run, runtimeStateMachine, runtimeVersion, storeJob };
|