@perstack/runtime 0.0.61 → 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 +87 -59
- package/dist/src/index.d.ts +427 -386
- package/dist/src/index.js +776 -404
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
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>;
|
|
@@ -77,14 +97,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
77
97
|
} & {
|
|
78
98
|
reason: string;
|
|
79
99
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
80
|
-
|
|
81
|
-
|
|
100
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
101
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
82
102
|
usage: _perstack_core.Usage;
|
|
83
103
|
}) | (_perstack_core.BaseEvent & {
|
|
84
|
-
type: "
|
|
104
|
+
type: "callTools";
|
|
85
105
|
} & {
|
|
86
106
|
newMessage: _perstack_core.ExpertMessage;
|
|
87
|
-
|
|
107
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
88
108
|
usage: _perstack_core.Usage;
|
|
89
109
|
}) | (_perstack_core.BaseEvent & {
|
|
90
110
|
type: "callInteractiveTool";
|
|
@@ -96,30 +116,31 @@ 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
|
-
type: "
|
|
122
|
+
type: "resolveToolResults";
|
|
103
123
|
} & {
|
|
104
|
-
|
|
124
|
+
toolResults: _perstack_core.ToolResult[];
|
|
105
125
|
}) | (_perstack_core.BaseEvent & {
|
|
106
126
|
type: "resolveThought";
|
|
107
127
|
} & {
|
|
108
128
|
toolResult: _perstack_core.ToolResult;
|
|
109
129
|
}) | (_perstack_core.BaseEvent & {
|
|
110
|
-
type: "
|
|
130
|
+
type: "attemptCompletion";
|
|
111
131
|
} & {
|
|
112
132
|
toolResult: _perstack_core.ToolResult;
|
|
113
133
|
}) | (_perstack_core.BaseEvent & {
|
|
114
|
-
type: "
|
|
134
|
+
type: "finishToolCall";
|
|
115
135
|
} & {
|
|
116
|
-
|
|
136
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
117
137
|
}) | (_perstack_core.BaseEvent & {
|
|
118
|
-
type: "
|
|
138
|
+
type: "resumeToolCalls";
|
|
119
139
|
} & {
|
|
120
|
-
|
|
140
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
141
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
121
142
|
}) | (_perstack_core.BaseEvent & {
|
|
122
|
-
type: "
|
|
143
|
+
type: "finishAllToolCalls";
|
|
123
144
|
} & {
|
|
124
145
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
125
146
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -150,7 +171,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
150
171
|
step: Step;
|
|
151
172
|
text: string;
|
|
152
173
|
usage: _perstack_core.Usage;
|
|
153
|
-
}), {}, never, never, never, never, "Init" | "PreparingForStep" | "GeneratingToolCall" | "
|
|
174
|
+
}), {}, never, never, never, never, "Init" | "PreparingForStep" | "GeneratingToolCall" | "CallingTool" | "FinishingStep" | "CallingInteractiveTool" | "CallingDelegate" | "ResolvingToolResult" | "ResolvingThought" | "GeneratingRunResult" | "Stopped", string, {
|
|
154
175
|
setting: RunSetting;
|
|
155
176
|
initialCheckpoint: Checkpoint;
|
|
156
177
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
@@ -195,14 +216,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
195
216
|
} & {
|
|
196
217
|
reason: string;
|
|
197
218
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
220
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
200
221
|
usage: _perstack_core.Usage;
|
|
201
222
|
}) | (_perstack_core.BaseEvent & {
|
|
202
|
-
type: "
|
|
223
|
+
type: "callTools";
|
|
203
224
|
} & {
|
|
204
225
|
newMessage: _perstack_core.ExpertMessage;
|
|
205
|
-
|
|
226
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
206
227
|
usage: _perstack_core.Usage;
|
|
207
228
|
}) | (_perstack_core.BaseEvent & {
|
|
208
229
|
type: "callInteractiveTool";
|
|
@@ -214,30 +235,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
214
235
|
type: "callDelegate";
|
|
215
236
|
} & {
|
|
216
237
|
newMessage: _perstack_core.ExpertMessage;
|
|
217
|
-
|
|
238
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
218
239
|
usage: _perstack_core.Usage;
|
|
219
240
|
}) | (_perstack_core.BaseEvent & {
|
|
220
|
-
type: "
|
|
241
|
+
type: "resolveToolResults";
|
|
221
242
|
} & {
|
|
222
|
-
|
|
243
|
+
toolResults: _perstack_core.ToolResult[];
|
|
223
244
|
}) | (_perstack_core.BaseEvent & {
|
|
224
245
|
type: "resolveThought";
|
|
225
246
|
} & {
|
|
226
247
|
toolResult: _perstack_core.ToolResult;
|
|
227
248
|
}) | (_perstack_core.BaseEvent & {
|
|
228
|
-
type: "
|
|
249
|
+
type: "attemptCompletion";
|
|
229
250
|
} & {
|
|
230
251
|
toolResult: _perstack_core.ToolResult;
|
|
231
252
|
}) | (_perstack_core.BaseEvent & {
|
|
232
|
-
type: "
|
|
253
|
+
type: "finishToolCall";
|
|
233
254
|
} & {
|
|
234
|
-
|
|
255
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
235
256
|
}) | (_perstack_core.BaseEvent & {
|
|
236
|
-
type: "
|
|
257
|
+
type: "resumeToolCalls";
|
|
237
258
|
} & {
|
|
238
|
-
|
|
259
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
260
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
239
261
|
}) | (_perstack_core.BaseEvent & {
|
|
240
|
-
type: "
|
|
262
|
+
type: "finishAllToolCalls";
|
|
241
263
|
} & {
|
|
242
264
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
243
265
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -282,14 +304,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
282
304
|
} & {
|
|
283
305
|
reason: string;
|
|
284
306
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
285
|
-
|
|
286
|
-
|
|
307
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
308
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
287
309
|
usage: _perstack_core.Usage;
|
|
288
310
|
}) | (_perstack_core.BaseEvent & {
|
|
289
|
-
type: "
|
|
311
|
+
type: "callTools";
|
|
290
312
|
} & {
|
|
291
313
|
newMessage: _perstack_core.ExpertMessage;
|
|
292
|
-
|
|
314
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
293
315
|
usage: _perstack_core.Usage;
|
|
294
316
|
}) | (_perstack_core.BaseEvent & {
|
|
295
317
|
type: "callInteractiveTool";
|
|
@@ -301,30 +323,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
301
323
|
type: "callDelegate";
|
|
302
324
|
} & {
|
|
303
325
|
newMessage: _perstack_core.ExpertMessage;
|
|
304
|
-
|
|
326
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
305
327
|
usage: _perstack_core.Usage;
|
|
306
328
|
}) | (_perstack_core.BaseEvent & {
|
|
307
|
-
type: "
|
|
329
|
+
type: "resolveToolResults";
|
|
308
330
|
} & {
|
|
309
|
-
|
|
331
|
+
toolResults: _perstack_core.ToolResult[];
|
|
310
332
|
}) | (_perstack_core.BaseEvent & {
|
|
311
333
|
type: "resolveThought";
|
|
312
334
|
} & {
|
|
313
335
|
toolResult: _perstack_core.ToolResult;
|
|
314
336
|
}) | (_perstack_core.BaseEvent & {
|
|
315
|
-
type: "
|
|
337
|
+
type: "attemptCompletion";
|
|
316
338
|
} & {
|
|
317
339
|
toolResult: _perstack_core.ToolResult;
|
|
318
340
|
}) | (_perstack_core.BaseEvent & {
|
|
319
|
-
type: "
|
|
341
|
+
type: "finishToolCall";
|
|
320
342
|
} & {
|
|
321
|
-
|
|
343
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
322
344
|
}) | (_perstack_core.BaseEvent & {
|
|
323
|
-
type: "
|
|
345
|
+
type: "resumeToolCalls";
|
|
324
346
|
} & {
|
|
325
|
-
|
|
347
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
348
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
326
349
|
}) | (_perstack_core.BaseEvent & {
|
|
327
|
-
type: "
|
|
350
|
+
type: "finishAllToolCalls";
|
|
328
351
|
} & {
|
|
329
352
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
330
353
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -399,14 +422,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
399
422
|
} & {
|
|
400
423
|
reason: string;
|
|
401
424
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
402
|
-
|
|
403
|
-
|
|
425
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
426
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
404
427
|
usage: _perstack_core.Usage;
|
|
405
428
|
}) | (_perstack_core.BaseEvent & {
|
|
406
|
-
type: "
|
|
429
|
+
type: "callTools";
|
|
407
430
|
} & {
|
|
408
431
|
newMessage: _perstack_core.ExpertMessage;
|
|
409
|
-
|
|
432
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
410
433
|
usage: _perstack_core.Usage;
|
|
411
434
|
}) | (_perstack_core.BaseEvent & {
|
|
412
435
|
type: "callInteractiveTool";
|
|
@@ -418,30 +441,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
418
441
|
type: "callDelegate";
|
|
419
442
|
} & {
|
|
420
443
|
newMessage: _perstack_core.ExpertMessage;
|
|
421
|
-
|
|
444
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
422
445
|
usage: _perstack_core.Usage;
|
|
423
446
|
}) | (_perstack_core.BaseEvent & {
|
|
424
|
-
type: "
|
|
447
|
+
type: "resolveToolResults";
|
|
425
448
|
} & {
|
|
426
|
-
|
|
449
|
+
toolResults: _perstack_core.ToolResult[];
|
|
427
450
|
}) | (_perstack_core.BaseEvent & {
|
|
428
451
|
type: "resolveThought";
|
|
429
452
|
} & {
|
|
430
453
|
toolResult: _perstack_core.ToolResult;
|
|
431
454
|
}) | (_perstack_core.BaseEvent & {
|
|
432
|
-
type: "
|
|
455
|
+
type: "attemptCompletion";
|
|
433
456
|
} & {
|
|
434
457
|
toolResult: _perstack_core.ToolResult;
|
|
435
458
|
}) | (_perstack_core.BaseEvent & {
|
|
436
|
-
type: "
|
|
459
|
+
type: "finishToolCall";
|
|
437
460
|
} & {
|
|
438
|
-
|
|
461
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
439
462
|
}) | (_perstack_core.BaseEvent & {
|
|
440
|
-
type: "
|
|
463
|
+
type: "resumeToolCalls";
|
|
441
464
|
} & {
|
|
442
|
-
|
|
465
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
466
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
443
467
|
}) | (_perstack_core.BaseEvent & {
|
|
444
|
-
type: "
|
|
468
|
+
type: "finishAllToolCalls";
|
|
445
469
|
} & {
|
|
446
470
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
447
471
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -504,14 +528,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
504
528
|
} & {
|
|
505
529
|
reason: string;
|
|
506
530
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
507
|
-
|
|
508
|
-
|
|
531
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
532
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
509
533
|
usage: _perstack_core.Usage;
|
|
510
534
|
}) | (_perstack_core.BaseEvent & {
|
|
511
|
-
type: "
|
|
535
|
+
type: "callTools";
|
|
512
536
|
} & {
|
|
513
537
|
newMessage: _perstack_core.ExpertMessage;
|
|
514
|
-
|
|
538
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
515
539
|
usage: _perstack_core.Usage;
|
|
516
540
|
}) | (_perstack_core.BaseEvent & {
|
|
517
541
|
type: "callInteractiveTool";
|
|
@@ -523,30 +547,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
523
547
|
type: "callDelegate";
|
|
524
548
|
} & {
|
|
525
549
|
newMessage: _perstack_core.ExpertMessage;
|
|
526
|
-
|
|
550
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
527
551
|
usage: _perstack_core.Usage;
|
|
528
552
|
}) | (_perstack_core.BaseEvent & {
|
|
529
|
-
type: "
|
|
553
|
+
type: "resolveToolResults";
|
|
530
554
|
} & {
|
|
531
|
-
|
|
555
|
+
toolResults: _perstack_core.ToolResult[];
|
|
532
556
|
}) | (_perstack_core.BaseEvent & {
|
|
533
557
|
type: "resolveThought";
|
|
534
558
|
} & {
|
|
535
559
|
toolResult: _perstack_core.ToolResult;
|
|
536
560
|
}) | (_perstack_core.BaseEvent & {
|
|
537
|
-
type: "
|
|
561
|
+
type: "attemptCompletion";
|
|
538
562
|
} & {
|
|
539
563
|
toolResult: _perstack_core.ToolResult;
|
|
540
564
|
}) | (_perstack_core.BaseEvent & {
|
|
541
|
-
type: "
|
|
565
|
+
type: "finishToolCall";
|
|
542
566
|
} & {
|
|
543
|
-
|
|
567
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
544
568
|
}) | (_perstack_core.BaseEvent & {
|
|
545
|
-
type: "
|
|
569
|
+
type: "resumeToolCalls";
|
|
546
570
|
} & {
|
|
547
|
-
|
|
571
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
572
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
548
573
|
}) | (_perstack_core.BaseEvent & {
|
|
549
|
-
type: "
|
|
574
|
+
type: "finishAllToolCalls";
|
|
550
575
|
} & {
|
|
551
576
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
552
577
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -579,12 +604,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
579
604
|
usage: _perstack_core.Usage;
|
|
580
605
|
}), undefined, never, never, never, never, never>;
|
|
581
606
|
};
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
readonly GeneratingToolCall: {
|
|
585
|
-
readonly on: {
|
|
586
|
-
readonly retry: {
|
|
587
|
-
readonly target: "FinishingStep";
|
|
607
|
+
readonly resumeToolCalls: {
|
|
608
|
+
readonly target: "CallingTool";
|
|
588
609
|
readonly actions: xstate.ActionFunction<{
|
|
589
610
|
setting: RunSetting;
|
|
590
611
|
step: Step;
|
|
@@ -592,13 +613,10 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
592
613
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
593
614
|
skillManagers: Record<string, BaseSkillManager>;
|
|
594
615
|
}, _perstack_core.BaseEvent & {
|
|
595
|
-
type: "
|
|
616
|
+
type: "resumeToolCalls";
|
|
596
617
|
} & {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
toolCall?: _perstack_core.ToolCall;
|
|
600
|
-
toolResult?: _perstack_core.ToolResult;
|
|
601
|
-
usage: _perstack_core.Usage;
|
|
618
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
619
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
602
620
|
}, (_perstack_core.BaseEvent & {
|
|
603
621
|
type: "startRun";
|
|
604
622
|
} & {
|
|
@@ -613,14 +631,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
613
631
|
} & {
|
|
614
632
|
reason: string;
|
|
615
633
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
616
|
-
|
|
617
|
-
|
|
634
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
635
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
618
636
|
usage: _perstack_core.Usage;
|
|
619
637
|
}) | (_perstack_core.BaseEvent & {
|
|
620
|
-
type: "
|
|
638
|
+
type: "callTools";
|
|
621
639
|
} & {
|
|
622
640
|
newMessage: _perstack_core.ExpertMessage;
|
|
623
|
-
|
|
641
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
624
642
|
usage: _perstack_core.Usage;
|
|
625
643
|
}) | (_perstack_core.BaseEvent & {
|
|
626
644
|
type: "callInteractiveTool";
|
|
@@ -632,30 +650,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
632
650
|
type: "callDelegate";
|
|
633
651
|
} & {
|
|
634
652
|
newMessage: _perstack_core.ExpertMessage;
|
|
635
|
-
|
|
653
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
636
654
|
usage: _perstack_core.Usage;
|
|
637
655
|
}) | (_perstack_core.BaseEvent & {
|
|
638
|
-
type: "
|
|
656
|
+
type: "resolveToolResults";
|
|
639
657
|
} & {
|
|
640
|
-
|
|
658
|
+
toolResults: _perstack_core.ToolResult[];
|
|
641
659
|
}) | (_perstack_core.BaseEvent & {
|
|
642
660
|
type: "resolveThought";
|
|
643
661
|
} & {
|
|
644
662
|
toolResult: _perstack_core.ToolResult;
|
|
645
663
|
}) | (_perstack_core.BaseEvent & {
|
|
646
|
-
type: "
|
|
664
|
+
type: "attemptCompletion";
|
|
647
665
|
} & {
|
|
648
666
|
toolResult: _perstack_core.ToolResult;
|
|
649
667
|
}) | (_perstack_core.BaseEvent & {
|
|
650
|
-
type: "
|
|
668
|
+
type: "finishToolCall";
|
|
651
669
|
} & {
|
|
652
|
-
|
|
670
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
653
671
|
}) | (_perstack_core.BaseEvent & {
|
|
654
|
-
type: "
|
|
672
|
+
type: "resumeToolCalls";
|
|
655
673
|
} & {
|
|
656
|
-
|
|
674
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
675
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
657
676
|
}) | (_perstack_core.BaseEvent & {
|
|
658
|
-
type: "
|
|
677
|
+
type: "finishAllToolCalls";
|
|
659
678
|
} & {
|
|
660
679
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
661
680
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -688,8 +707,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
688
707
|
usage: _perstack_core.Usage;
|
|
689
708
|
}), undefined, never, never, never, never, never>;
|
|
690
709
|
};
|
|
691
|
-
readonly
|
|
692
|
-
readonly target: "
|
|
710
|
+
readonly finishAllToolCalls: {
|
|
711
|
+
readonly target: "FinishingStep";
|
|
693
712
|
readonly actions: xstate.ActionFunction<{
|
|
694
713
|
setting: RunSetting;
|
|
695
714
|
step: Step;
|
|
@@ -697,11 +716,9 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
697
716
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
698
717
|
skillManagers: Record<string, BaseSkillManager>;
|
|
699
718
|
}, _perstack_core.BaseEvent & {
|
|
700
|
-
type: "
|
|
719
|
+
type: "finishAllToolCalls";
|
|
701
720
|
} & {
|
|
702
|
-
|
|
703
|
-
toolCall: _perstack_core.ToolCall;
|
|
704
|
-
usage: _perstack_core.Usage;
|
|
721
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
705
722
|
}, (_perstack_core.BaseEvent & {
|
|
706
723
|
type: "startRun";
|
|
707
724
|
} & {
|
|
@@ -716,14 +733,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
716
733
|
} & {
|
|
717
734
|
reason: string;
|
|
718
735
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
719
|
-
|
|
720
|
-
|
|
736
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
737
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
721
738
|
usage: _perstack_core.Usage;
|
|
722
739
|
}) | (_perstack_core.BaseEvent & {
|
|
723
|
-
type: "
|
|
740
|
+
type: "callTools";
|
|
724
741
|
} & {
|
|
725
742
|
newMessage: _perstack_core.ExpertMessage;
|
|
726
|
-
|
|
743
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
727
744
|
usage: _perstack_core.Usage;
|
|
728
745
|
}) | (_perstack_core.BaseEvent & {
|
|
729
746
|
type: "callInteractiveTool";
|
|
@@ -735,30 +752,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
735
752
|
type: "callDelegate";
|
|
736
753
|
} & {
|
|
737
754
|
newMessage: _perstack_core.ExpertMessage;
|
|
738
|
-
|
|
755
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
739
756
|
usage: _perstack_core.Usage;
|
|
740
757
|
}) | (_perstack_core.BaseEvent & {
|
|
741
|
-
type: "
|
|
758
|
+
type: "resolveToolResults";
|
|
742
759
|
} & {
|
|
743
|
-
|
|
760
|
+
toolResults: _perstack_core.ToolResult[];
|
|
744
761
|
}) | (_perstack_core.BaseEvent & {
|
|
745
762
|
type: "resolveThought";
|
|
746
763
|
} & {
|
|
747
764
|
toolResult: _perstack_core.ToolResult;
|
|
748
765
|
}) | (_perstack_core.BaseEvent & {
|
|
749
|
-
type: "
|
|
766
|
+
type: "attemptCompletion";
|
|
750
767
|
} & {
|
|
751
768
|
toolResult: _perstack_core.ToolResult;
|
|
752
769
|
}) | (_perstack_core.BaseEvent & {
|
|
753
|
-
type: "
|
|
770
|
+
type: "finishToolCall";
|
|
754
771
|
} & {
|
|
755
|
-
|
|
772
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
756
773
|
}) | (_perstack_core.BaseEvent & {
|
|
757
|
-
type: "
|
|
774
|
+
type: "resumeToolCalls";
|
|
758
775
|
} & {
|
|
759
|
-
|
|
776
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
777
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
760
778
|
}) | (_perstack_core.BaseEvent & {
|
|
761
|
-
type: "
|
|
779
|
+
type: "finishAllToolCalls";
|
|
762
780
|
} & {
|
|
763
781
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
764
782
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -791,8 +809,12 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
791
809
|
usage: _perstack_core.Usage;
|
|
792
810
|
}), undefined, never, never, never, never, never>;
|
|
793
811
|
};
|
|
794
|
-
|
|
795
|
-
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
readonly GeneratingToolCall: {
|
|
815
|
+
readonly on: {
|
|
816
|
+
readonly retry: {
|
|
817
|
+
readonly target: "FinishingStep";
|
|
796
818
|
readonly actions: xstate.ActionFunction<{
|
|
797
819
|
setting: RunSetting;
|
|
798
820
|
step: Step;
|
|
@@ -800,10 +822,12 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
800
822
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
801
823
|
skillManagers: Record<string, BaseSkillManager>;
|
|
802
824
|
}, _perstack_core.BaseEvent & {
|
|
803
|
-
type: "
|
|
825
|
+
type: "retry";
|
|
804
826
|
} & {
|
|
805
|
-
|
|
806
|
-
|
|
827
|
+
reason: string;
|
|
828
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
829
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
830
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
807
831
|
usage: _perstack_core.Usage;
|
|
808
832
|
}, (_perstack_core.BaseEvent & {
|
|
809
833
|
type: "startRun";
|
|
@@ -819,14 +843,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
819
843
|
} & {
|
|
820
844
|
reason: string;
|
|
821
845
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
822
|
-
|
|
823
|
-
|
|
846
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
847
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
824
848
|
usage: _perstack_core.Usage;
|
|
825
849
|
}) | (_perstack_core.BaseEvent & {
|
|
826
|
-
type: "
|
|
850
|
+
type: "callTools";
|
|
827
851
|
} & {
|
|
828
852
|
newMessage: _perstack_core.ExpertMessage;
|
|
829
|
-
|
|
853
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
830
854
|
usage: _perstack_core.Usage;
|
|
831
855
|
}) | (_perstack_core.BaseEvent & {
|
|
832
856
|
type: "callInteractiveTool";
|
|
@@ -838,30 +862,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
838
862
|
type: "callDelegate";
|
|
839
863
|
} & {
|
|
840
864
|
newMessage: _perstack_core.ExpertMessage;
|
|
841
|
-
|
|
865
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
842
866
|
usage: _perstack_core.Usage;
|
|
843
867
|
}) | (_perstack_core.BaseEvent & {
|
|
844
|
-
type: "
|
|
868
|
+
type: "resolveToolResults";
|
|
845
869
|
} & {
|
|
846
|
-
|
|
870
|
+
toolResults: _perstack_core.ToolResult[];
|
|
847
871
|
}) | (_perstack_core.BaseEvent & {
|
|
848
872
|
type: "resolveThought";
|
|
849
873
|
} & {
|
|
850
874
|
toolResult: _perstack_core.ToolResult;
|
|
851
875
|
}) | (_perstack_core.BaseEvent & {
|
|
852
|
-
type: "
|
|
876
|
+
type: "attemptCompletion";
|
|
853
877
|
} & {
|
|
854
878
|
toolResult: _perstack_core.ToolResult;
|
|
855
879
|
}) | (_perstack_core.BaseEvent & {
|
|
856
|
-
type: "
|
|
880
|
+
type: "finishToolCall";
|
|
857
881
|
} & {
|
|
858
|
-
|
|
882
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
859
883
|
}) | (_perstack_core.BaseEvent & {
|
|
860
|
-
type: "
|
|
884
|
+
type: "resumeToolCalls";
|
|
861
885
|
} & {
|
|
862
|
-
|
|
886
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
887
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
863
888
|
}) | (_perstack_core.BaseEvent & {
|
|
864
|
-
type: "
|
|
889
|
+
type: "finishAllToolCalls";
|
|
865
890
|
} & {
|
|
866
891
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
867
892
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -894,8 +919,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
894
919
|
usage: _perstack_core.Usage;
|
|
895
920
|
}), undefined, never, never, never, never, never>;
|
|
896
921
|
};
|
|
897
|
-
readonly
|
|
898
|
-
readonly target: "
|
|
922
|
+
readonly callTools: {
|
|
923
|
+
readonly target: "CallingTool";
|
|
899
924
|
readonly actions: xstate.ActionFunction<{
|
|
900
925
|
setting: RunSetting;
|
|
901
926
|
step: Step;
|
|
@@ -903,10 +928,10 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
903
928
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
904
929
|
skillManagers: Record<string, BaseSkillManager>;
|
|
905
930
|
}, _perstack_core.BaseEvent & {
|
|
906
|
-
type: "
|
|
931
|
+
type: "callTools";
|
|
907
932
|
} & {
|
|
908
933
|
newMessage: _perstack_core.ExpertMessage;
|
|
909
|
-
|
|
934
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
910
935
|
usage: _perstack_core.Usage;
|
|
911
936
|
}, (_perstack_core.BaseEvent & {
|
|
912
937
|
type: "startRun";
|
|
@@ -922,14 +947,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
922
947
|
} & {
|
|
923
948
|
reason: string;
|
|
924
949
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
925
|
-
|
|
926
|
-
|
|
950
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
951
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
927
952
|
usage: _perstack_core.Usage;
|
|
928
953
|
}) | (_perstack_core.BaseEvent & {
|
|
929
|
-
type: "
|
|
954
|
+
type: "callTools";
|
|
930
955
|
} & {
|
|
931
956
|
newMessage: _perstack_core.ExpertMessage;
|
|
932
|
-
|
|
957
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
933
958
|
usage: _perstack_core.Usage;
|
|
934
959
|
}) | (_perstack_core.BaseEvent & {
|
|
935
960
|
type: "callInteractiveTool";
|
|
@@ -941,30 +966,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
941
966
|
type: "callDelegate";
|
|
942
967
|
} & {
|
|
943
968
|
newMessage: _perstack_core.ExpertMessage;
|
|
944
|
-
|
|
969
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
945
970
|
usage: _perstack_core.Usage;
|
|
946
971
|
}) | (_perstack_core.BaseEvent & {
|
|
947
|
-
type: "
|
|
972
|
+
type: "resolveToolResults";
|
|
948
973
|
} & {
|
|
949
|
-
|
|
974
|
+
toolResults: _perstack_core.ToolResult[];
|
|
950
975
|
}) | (_perstack_core.BaseEvent & {
|
|
951
976
|
type: "resolveThought";
|
|
952
977
|
} & {
|
|
953
978
|
toolResult: _perstack_core.ToolResult;
|
|
954
979
|
}) | (_perstack_core.BaseEvent & {
|
|
955
|
-
type: "
|
|
980
|
+
type: "attemptCompletion";
|
|
956
981
|
} & {
|
|
957
982
|
toolResult: _perstack_core.ToolResult;
|
|
958
983
|
}) | (_perstack_core.BaseEvent & {
|
|
959
|
-
type: "
|
|
984
|
+
type: "finishToolCall";
|
|
960
985
|
} & {
|
|
961
|
-
|
|
986
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
962
987
|
}) | (_perstack_core.BaseEvent & {
|
|
963
|
-
type: "
|
|
988
|
+
type: "resumeToolCalls";
|
|
964
989
|
} & {
|
|
965
|
-
|
|
990
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
991
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
966
992
|
}) | (_perstack_core.BaseEvent & {
|
|
967
|
-
type: "
|
|
993
|
+
type: "finishAllToolCalls";
|
|
968
994
|
} & {
|
|
969
995
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
970
996
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -997,12 +1023,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
997
1023
|
usage: _perstack_core.Usage;
|
|
998
1024
|
}), undefined, never, never, never, never, never>;
|
|
999
1025
|
};
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
readonly CallingTool: {
|
|
1003
|
-
readonly on: {
|
|
1004
|
-
readonly resolveToolResult: {
|
|
1005
|
-
readonly target: "ResolvingToolResult";
|
|
1026
|
+
readonly callInteractiveTool: {
|
|
1027
|
+
readonly target: "CallingInteractiveTool";
|
|
1006
1028
|
readonly actions: xstate.ActionFunction<{
|
|
1007
1029
|
setting: RunSetting;
|
|
1008
1030
|
step: Step;
|
|
@@ -1010,9 +1032,11 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1010
1032
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1011
1033
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1012
1034
|
}, _perstack_core.BaseEvent & {
|
|
1013
|
-
type: "
|
|
1035
|
+
type: "callInteractiveTool";
|
|
1014
1036
|
} & {
|
|
1015
|
-
|
|
1037
|
+
newMessage: _perstack_core.ExpertMessage;
|
|
1038
|
+
toolCall: _perstack_core.ToolCall;
|
|
1039
|
+
usage: _perstack_core.Usage;
|
|
1016
1040
|
}, (_perstack_core.BaseEvent & {
|
|
1017
1041
|
type: "startRun";
|
|
1018
1042
|
} & {
|
|
@@ -1027,14 +1051,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1027
1051
|
} & {
|
|
1028
1052
|
reason: string;
|
|
1029
1053
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1030
|
-
|
|
1031
|
-
|
|
1054
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1055
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1032
1056
|
usage: _perstack_core.Usage;
|
|
1033
1057
|
}) | (_perstack_core.BaseEvent & {
|
|
1034
|
-
type: "
|
|
1058
|
+
type: "callTools";
|
|
1035
1059
|
} & {
|
|
1036
1060
|
newMessage: _perstack_core.ExpertMessage;
|
|
1037
|
-
|
|
1061
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1038
1062
|
usage: _perstack_core.Usage;
|
|
1039
1063
|
}) | (_perstack_core.BaseEvent & {
|
|
1040
1064
|
type: "callInteractiveTool";
|
|
@@ -1046,30 +1070,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1046
1070
|
type: "callDelegate";
|
|
1047
1071
|
} & {
|
|
1048
1072
|
newMessage: _perstack_core.ExpertMessage;
|
|
1049
|
-
|
|
1073
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1050
1074
|
usage: _perstack_core.Usage;
|
|
1051
1075
|
}) | (_perstack_core.BaseEvent & {
|
|
1052
|
-
type: "
|
|
1076
|
+
type: "resolveToolResults";
|
|
1053
1077
|
} & {
|
|
1054
|
-
|
|
1078
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1055
1079
|
}) | (_perstack_core.BaseEvent & {
|
|
1056
1080
|
type: "resolveThought";
|
|
1057
1081
|
} & {
|
|
1058
1082
|
toolResult: _perstack_core.ToolResult;
|
|
1059
1083
|
}) | (_perstack_core.BaseEvent & {
|
|
1060
|
-
type: "
|
|
1084
|
+
type: "attemptCompletion";
|
|
1061
1085
|
} & {
|
|
1062
1086
|
toolResult: _perstack_core.ToolResult;
|
|
1063
1087
|
}) | (_perstack_core.BaseEvent & {
|
|
1064
|
-
type: "
|
|
1088
|
+
type: "finishToolCall";
|
|
1065
1089
|
} & {
|
|
1066
|
-
|
|
1090
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1067
1091
|
}) | (_perstack_core.BaseEvent & {
|
|
1068
|
-
type: "
|
|
1092
|
+
type: "resumeToolCalls";
|
|
1069
1093
|
} & {
|
|
1070
|
-
|
|
1094
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1095
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1071
1096
|
}) | (_perstack_core.BaseEvent & {
|
|
1072
|
-
type: "
|
|
1097
|
+
type: "finishAllToolCalls";
|
|
1073
1098
|
} & {
|
|
1074
1099
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1075
1100
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1102,8 +1127,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1102
1127
|
usage: _perstack_core.Usage;
|
|
1103
1128
|
}), undefined, never, never, never, never, never>;
|
|
1104
1129
|
};
|
|
1105
|
-
readonly
|
|
1106
|
-
readonly target: "
|
|
1130
|
+
readonly callDelegate: {
|
|
1131
|
+
readonly target: "CallingDelegate";
|
|
1107
1132
|
readonly actions: xstate.ActionFunction<{
|
|
1108
1133
|
setting: RunSetting;
|
|
1109
1134
|
step: Step;
|
|
@@ -1111,9 +1136,11 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1111
1136
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1112
1137
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1113
1138
|
}, _perstack_core.BaseEvent & {
|
|
1114
|
-
type: "
|
|
1139
|
+
type: "callDelegate";
|
|
1115
1140
|
} & {
|
|
1116
|
-
|
|
1141
|
+
newMessage: _perstack_core.ExpertMessage;
|
|
1142
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1143
|
+
usage: _perstack_core.Usage;
|
|
1117
1144
|
}, (_perstack_core.BaseEvent & {
|
|
1118
1145
|
type: "startRun";
|
|
1119
1146
|
} & {
|
|
@@ -1128,14 +1155,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1128
1155
|
} & {
|
|
1129
1156
|
reason: string;
|
|
1130
1157
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1131
|
-
|
|
1132
|
-
|
|
1158
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1159
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1133
1160
|
usage: _perstack_core.Usage;
|
|
1134
1161
|
}) | (_perstack_core.BaseEvent & {
|
|
1135
|
-
type: "
|
|
1162
|
+
type: "callTools";
|
|
1136
1163
|
} & {
|
|
1137
1164
|
newMessage: _perstack_core.ExpertMessage;
|
|
1138
|
-
|
|
1165
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1139
1166
|
usage: _perstack_core.Usage;
|
|
1140
1167
|
}) | (_perstack_core.BaseEvent & {
|
|
1141
1168
|
type: "callInteractiveTool";
|
|
@@ -1147,30 +1174,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1147
1174
|
type: "callDelegate";
|
|
1148
1175
|
} & {
|
|
1149
1176
|
newMessage: _perstack_core.ExpertMessage;
|
|
1150
|
-
|
|
1177
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1151
1178
|
usage: _perstack_core.Usage;
|
|
1152
1179
|
}) | (_perstack_core.BaseEvent & {
|
|
1153
|
-
type: "
|
|
1180
|
+
type: "resolveToolResults";
|
|
1154
1181
|
} & {
|
|
1155
|
-
|
|
1182
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1156
1183
|
}) | (_perstack_core.BaseEvent & {
|
|
1157
1184
|
type: "resolveThought";
|
|
1158
1185
|
} & {
|
|
1159
1186
|
toolResult: _perstack_core.ToolResult;
|
|
1160
1187
|
}) | (_perstack_core.BaseEvent & {
|
|
1161
|
-
type: "
|
|
1188
|
+
type: "attemptCompletion";
|
|
1162
1189
|
} & {
|
|
1163
1190
|
toolResult: _perstack_core.ToolResult;
|
|
1164
1191
|
}) | (_perstack_core.BaseEvent & {
|
|
1165
|
-
type: "
|
|
1192
|
+
type: "finishToolCall";
|
|
1166
1193
|
} & {
|
|
1167
|
-
|
|
1194
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1168
1195
|
}) | (_perstack_core.BaseEvent & {
|
|
1169
|
-
type: "
|
|
1196
|
+
type: "resumeToolCalls";
|
|
1170
1197
|
} & {
|
|
1171
|
-
|
|
1198
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1199
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1172
1200
|
}) | (_perstack_core.BaseEvent & {
|
|
1173
|
-
type: "
|
|
1201
|
+
type: "finishAllToolCalls";
|
|
1174
1202
|
} & {
|
|
1175
1203
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1176
1204
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1203,8 +1231,12 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1203
1231
|
usage: _perstack_core.Usage;
|
|
1204
1232
|
}), undefined, never, never, never, never, never>;
|
|
1205
1233
|
};
|
|
1206
|
-
|
|
1207
|
-
|
|
1234
|
+
};
|
|
1235
|
+
};
|
|
1236
|
+
readonly CallingTool: {
|
|
1237
|
+
readonly on: {
|
|
1238
|
+
readonly resolveToolResults: {
|
|
1239
|
+
readonly target: "ResolvingToolResult";
|
|
1208
1240
|
readonly actions: xstate.ActionFunction<{
|
|
1209
1241
|
setting: RunSetting;
|
|
1210
1242
|
step: Step;
|
|
@@ -1212,9 +1244,9 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1212
1244
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1213
1245
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1214
1246
|
}, _perstack_core.BaseEvent & {
|
|
1215
|
-
type: "
|
|
1247
|
+
type: "resolveToolResults";
|
|
1216
1248
|
} & {
|
|
1217
|
-
|
|
1249
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1218
1250
|
}, (_perstack_core.BaseEvent & {
|
|
1219
1251
|
type: "startRun";
|
|
1220
1252
|
} & {
|
|
@@ -1229,14 +1261,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1229
1261
|
} & {
|
|
1230
1262
|
reason: string;
|
|
1231
1263
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1232
|
-
|
|
1233
|
-
|
|
1264
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1265
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1234
1266
|
usage: _perstack_core.Usage;
|
|
1235
1267
|
}) | (_perstack_core.BaseEvent & {
|
|
1236
|
-
type: "
|
|
1268
|
+
type: "callTools";
|
|
1237
1269
|
} & {
|
|
1238
1270
|
newMessage: _perstack_core.ExpertMessage;
|
|
1239
|
-
|
|
1271
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1240
1272
|
usage: _perstack_core.Usage;
|
|
1241
1273
|
}) | (_perstack_core.BaseEvent & {
|
|
1242
1274
|
type: "callInteractiveTool";
|
|
@@ -1248,30 +1280,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1248
1280
|
type: "callDelegate";
|
|
1249
1281
|
} & {
|
|
1250
1282
|
newMessage: _perstack_core.ExpertMessage;
|
|
1251
|
-
|
|
1283
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1252
1284
|
usage: _perstack_core.Usage;
|
|
1253
1285
|
}) | (_perstack_core.BaseEvent & {
|
|
1254
|
-
type: "
|
|
1286
|
+
type: "resolveToolResults";
|
|
1255
1287
|
} & {
|
|
1256
|
-
|
|
1288
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1257
1289
|
}) | (_perstack_core.BaseEvent & {
|
|
1258
1290
|
type: "resolveThought";
|
|
1259
1291
|
} & {
|
|
1260
1292
|
toolResult: _perstack_core.ToolResult;
|
|
1261
1293
|
}) | (_perstack_core.BaseEvent & {
|
|
1262
|
-
type: "
|
|
1294
|
+
type: "attemptCompletion";
|
|
1263
1295
|
} & {
|
|
1264
1296
|
toolResult: _perstack_core.ToolResult;
|
|
1265
1297
|
}) | (_perstack_core.BaseEvent & {
|
|
1266
|
-
type: "
|
|
1298
|
+
type: "finishToolCall";
|
|
1267
1299
|
} & {
|
|
1268
|
-
|
|
1300
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1269
1301
|
}) | (_perstack_core.BaseEvent & {
|
|
1270
|
-
type: "
|
|
1302
|
+
type: "resumeToolCalls";
|
|
1271
1303
|
} & {
|
|
1272
|
-
|
|
1304
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1305
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1273
1306
|
}) | (_perstack_core.BaseEvent & {
|
|
1274
|
-
type: "
|
|
1307
|
+
type: "finishAllToolCalls";
|
|
1275
1308
|
} & {
|
|
1276
1309
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1277
1310
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1304,8 +1337,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1304
1337
|
usage: _perstack_core.Usage;
|
|
1305
1338
|
}), undefined, never, never, never, never, never>;
|
|
1306
1339
|
};
|
|
1307
|
-
readonly
|
|
1308
|
-
readonly target: "
|
|
1340
|
+
readonly resolveThought: {
|
|
1341
|
+
readonly target: "ResolvingThought";
|
|
1309
1342
|
readonly actions: xstate.ActionFunction<{
|
|
1310
1343
|
setting: RunSetting;
|
|
1311
1344
|
step: Step;
|
|
@@ -1313,7 +1346,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1313
1346
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1314
1347
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1315
1348
|
}, _perstack_core.BaseEvent & {
|
|
1316
|
-
type: "
|
|
1349
|
+
type: "resolveThought";
|
|
1317
1350
|
} & {
|
|
1318
1351
|
toolResult: _perstack_core.ToolResult;
|
|
1319
1352
|
}, (_perstack_core.BaseEvent & {
|
|
@@ -1330,14 +1363,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1330
1363
|
} & {
|
|
1331
1364
|
reason: string;
|
|
1332
1365
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1333
|
-
|
|
1334
|
-
|
|
1366
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1367
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1335
1368
|
usage: _perstack_core.Usage;
|
|
1336
1369
|
}) | (_perstack_core.BaseEvent & {
|
|
1337
|
-
type: "
|
|
1370
|
+
type: "callTools";
|
|
1338
1371
|
} & {
|
|
1339
1372
|
newMessage: _perstack_core.ExpertMessage;
|
|
1340
|
-
|
|
1373
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1341
1374
|
usage: _perstack_core.Usage;
|
|
1342
1375
|
}) | (_perstack_core.BaseEvent & {
|
|
1343
1376
|
type: "callInteractiveTool";
|
|
@@ -1349,30 +1382,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1349
1382
|
type: "callDelegate";
|
|
1350
1383
|
} & {
|
|
1351
1384
|
newMessage: _perstack_core.ExpertMessage;
|
|
1352
|
-
|
|
1385
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1353
1386
|
usage: _perstack_core.Usage;
|
|
1354
1387
|
}) | (_perstack_core.BaseEvent & {
|
|
1355
|
-
type: "
|
|
1388
|
+
type: "resolveToolResults";
|
|
1356
1389
|
} & {
|
|
1357
|
-
|
|
1390
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1358
1391
|
}) | (_perstack_core.BaseEvent & {
|
|
1359
1392
|
type: "resolveThought";
|
|
1360
1393
|
} & {
|
|
1361
1394
|
toolResult: _perstack_core.ToolResult;
|
|
1362
1395
|
}) | (_perstack_core.BaseEvent & {
|
|
1363
|
-
type: "
|
|
1396
|
+
type: "attemptCompletion";
|
|
1364
1397
|
} & {
|
|
1365
1398
|
toolResult: _perstack_core.ToolResult;
|
|
1366
1399
|
}) | (_perstack_core.BaseEvent & {
|
|
1367
|
-
type: "
|
|
1400
|
+
type: "finishToolCall";
|
|
1368
1401
|
} & {
|
|
1369
|
-
|
|
1402
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1370
1403
|
}) | (_perstack_core.BaseEvent & {
|
|
1371
|
-
type: "
|
|
1404
|
+
type: "resumeToolCalls";
|
|
1372
1405
|
} & {
|
|
1373
|
-
|
|
1406
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1407
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1374
1408
|
}) | (_perstack_core.BaseEvent & {
|
|
1375
|
-
type: "
|
|
1409
|
+
type: "finishAllToolCalls";
|
|
1376
1410
|
} & {
|
|
1377
1411
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1378
1412
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1431,14 +1465,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1431
1465
|
} & {
|
|
1432
1466
|
reason: string;
|
|
1433
1467
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1434
|
-
|
|
1435
|
-
|
|
1468
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1469
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1436
1470
|
usage: _perstack_core.Usage;
|
|
1437
1471
|
}) | (_perstack_core.BaseEvent & {
|
|
1438
|
-
type: "
|
|
1472
|
+
type: "callTools";
|
|
1439
1473
|
} & {
|
|
1440
1474
|
newMessage: _perstack_core.ExpertMessage;
|
|
1441
|
-
|
|
1475
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1442
1476
|
usage: _perstack_core.Usage;
|
|
1443
1477
|
}) | (_perstack_core.BaseEvent & {
|
|
1444
1478
|
type: "callInteractiveTool";
|
|
@@ -1450,30 +1484,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1450
1484
|
type: "callDelegate";
|
|
1451
1485
|
} & {
|
|
1452
1486
|
newMessage: _perstack_core.ExpertMessage;
|
|
1453
|
-
|
|
1487
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1454
1488
|
usage: _perstack_core.Usage;
|
|
1455
1489
|
}) | (_perstack_core.BaseEvent & {
|
|
1456
|
-
type: "
|
|
1490
|
+
type: "resolveToolResults";
|
|
1457
1491
|
} & {
|
|
1458
|
-
|
|
1492
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1459
1493
|
}) | (_perstack_core.BaseEvent & {
|
|
1460
1494
|
type: "resolveThought";
|
|
1461
1495
|
} & {
|
|
1462
1496
|
toolResult: _perstack_core.ToolResult;
|
|
1463
1497
|
}) | (_perstack_core.BaseEvent & {
|
|
1464
|
-
type: "
|
|
1498
|
+
type: "attemptCompletion";
|
|
1465
1499
|
} & {
|
|
1466
1500
|
toolResult: _perstack_core.ToolResult;
|
|
1467
1501
|
}) | (_perstack_core.BaseEvent & {
|
|
1468
|
-
type: "
|
|
1502
|
+
type: "finishToolCall";
|
|
1469
1503
|
} & {
|
|
1470
|
-
|
|
1504
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1471
1505
|
}) | (_perstack_core.BaseEvent & {
|
|
1472
|
-
type: "
|
|
1506
|
+
type: "resumeToolCalls";
|
|
1473
1507
|
} & {
|
|
1474
|
-
|
|
1508
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1509
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1475
1510
|
}) | (_perstack_core.BaseEvent & {
|
|
1476
|
-
type: "
|
|
1511
|
+
type: "finishAllToolCalls";
|
|
1477
1512
|
} & {
|
|
1478
1513
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1479
1514
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1506,12 +1541,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1506
1541
|
usage: _perstack_core.Usage;
|
|
1507
1542
|
}), undefined, never, never, never, never, never>;
|
|
1508
1543
|
};
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
readonly ResolvingToolResult: {
|
|
1512
|
-
readonly on: {
|
|
1513
|
-
readonly finishToolCall: {
|
|
1514
|
-
readonly target: "FinishingStep";
|
|
1544
|
+
readonly callDelegate: {
|
|
1545
|
+
readonly target: "CallingDelegate";
|
|
1515
1546
|
readonly actions: xstate.ActionFunction<{
|
|
1516
1547
|
setting: RunSetting;
|
|
1517
1548
|
step: Step;
|
|
@@ -1519,9 +1550,11 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1519
1550
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1520
1551
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1521
1552
|
}, _perstack_core.BaseEvent & {
|
|
1522
|
-
type: "
|
|
1553
|
+
type: "callDelegate";
|
|
1523
1554
|
} & {
|
|
1524
|
-
|
|
1555
|
+
newMessage: _perstack_core.ExpertMessage;
|
|
1556
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1557
|
+
usage: _perstack_core.Usage;
|
|
1525
1558
|
}, (_perstack_core.BaseEvent & {
|
|
1526
1559
|
type: "startRun";
|
|
1527
1560
|
} & {
|
|
@@ -1536,14 +1569,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1536
1569
|
} & {
|
|
1537
1570
|
reason: string;
|
|
1538
1571
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1539
|
-
|
|
1540
|
-
|
|
1572
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1573
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1541
1574
|
usage: _perstack_core.Usage;
|
|
1542
1575
|
}) | (_perstack_core.BaseEvent & {
|
|
1543
|
-
type: "
|
|
1576
|
+
type: "callTools";
|
|
1544
1577
|
} & {
|
|
1545
1578
|
newMessage: _perstack_core.ExpertMessage;
|
|
1546
|
-
|
|
1579
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1547
1580
|
usage: _perstack_core.Usage;
|
|
1548
1581
|
}) | (_perstack_core.BaseEvent & {
|
|
1549
1582
|
type: "callInteractiveTool";
|
|
@@ -1555,30 +1588,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1555
1588
|
type: "callDelegate";
|
|
1556
1589
|
} & {
|
|
1557
1590
|
newMessage: _perstack_core.ExpertMessage;
|
|
1558
|
-
|
|
1591
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1559
1592
|
usage: _perstack_core.Usage;
|
|
1560
1593
|
}) | (_perstack_core.BaseEvent & {
|
|
1561
|
-
type: "
|
|
1594
|
+
type: "resolveToolResults";
|
|
1562
1595
|
} & {
|
|
1563
|
-
|
|
1596
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1564
1597
|
}) | (_perstack_core.BaseEvent & {
|
|
1565
1598
|
type: "resolveThought";
|
|
1566
1599
|
} & {
|
|
1567
1600
|
toolResult: _perstack_core.ToolResult;
|
|
1568
1601
|
}) | (_perstack_core.BaseEvent & {
|
|
1569
|
-
type: "
|
|
1602
|
+
type: "attemptCompletion";
|
|
1570
1603
|
} & {
|
|
1571
1604
|
toolResult: _perstack_core.ToolResult;
|
|
1572
1605
|
}) | (_perstack_core.BaseEvent & {
|
|
1573
|
-
type: "
|
|
1606
|
+
type: "finishToolCall";
|
|
1574
1607
|
} & {
|
|
1575
|
-
|
|
1608
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1576
1609
|
}) | (_perstack_core.BaseEvent & {
|
|
1577
|
-
type: "
|
|
1610
|
+
type: "resumeToolCalls";
|
|
1578
1611
|
} & {
|
|
1579
|
-
|
|
1612
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1613
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1580
1614
|
}) | (_perstack_core.BaseEvent & {
|
|
1581
|
-
type: "
|
|
1615
|
+
type: "finishAllToolCalls";
|
|
1582
1616
|
} & {
|
|
1583
1617
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1584
1618
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1611,12 +1645,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1611
1645
|
usage: _perstack_core.Usage;
|
|
1612
1646
|
}), undefined, never, never, never, never, never>;
|
|
1613
1647
|
};
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
readonly ResolvingThought: {
|
|
1617
|
-
readonly on: {
|
|
1618
|
-
readonly finishToolCall: {
|
|
1619
|
-
readonly target: "FinishingStep";
|
|
1648
|
+
readonly callInteractiveTool: {
|
|
1649
|
+
readonly target: "CallingInteractiveTool";
|
|
1620
1650
|
readonly actions: xstate.ActionFunction<{
|
|
1621
1651
|
setting: RunSetting;
|
|
1622
1652
|
step: Step;
|
|
@@ -1624,9 +1654,11 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1624
1654
|
eventListener: (event: RunEvent) => Promise<void>;
|
|
1625
1655
|
skillManagers: Record<string, BaseSkillManager>;
|
|
1626
1656
|
}, _perstack_core.BaseEvent & {
|
|
1627
|
-
type: "
|
|
1657
|
+
type: "callInteractiveTool";
|
|
1628
1658
|
} & {
|
|
1629
|
-
|
|
1659
|
+
newMessage: _perstack_core.ExpertMessage;
|
|
1660
|
+
toolCall: _perstack_core.ToolCall;
|
|
1661
|
+
usage: _perstack_core.Usage;
|
|
1630
1662
|
}, (_perstack_core.BaseEvent & {
|
|
1631
1663
|
type: "startRun";
|
|
1632
1664
|
} & {
|
|
@@ -1641,14 +1673,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1641
1673
|
} & {
|
|
1642
1674
|
reason: string;
|
|
1643
1675
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1644
|
-
|
|
1645
|
-
|
|
1676
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1677
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1646
1678
|
usage: _perstack_core.Usage;
|
|
1647
1679
|
}) | (_perstack_core.BaseEvent & {
|
|
1648
|
-
type: "
|
|
1680
|
+
type: "callTools";
|
|
1649
1681
|
} & {
|
|
1650
1682
|
newMessage: _perstack_core.ExpertMessage;
|
|
1651
|
-
|
|
1683
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1652
1684
|
usage: _perstack_core.Usage;
|
|
1653
1685
|
}) | (_perstack_core.BaseEvent & {
|
|
1654
1686
|
type: "callInteractiveTool";
|
|
@@ -1660,30 +1692,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1660
1692
|
type: "callDelegate";
|
|
1661
1693
|
} & {
|
|
1662
1694
|
newMessage: _perstack_core.ExpertMessage;
|
|
1663
|
-
|
|
1695
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1664
1696
|
usage: _perstack_core.Usage;
|
|
1665
1697
|
}) | (_perstack_core.BaseEvent & {
|
|
1666
|
-
type: "
|
|
1698
|
+
type: "resolveToolResults";
|
|
1667
1699
|
} & {
|
|
1668
|
-
|
|
1700
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1669
1701
|
}) | (_perstack_core.BaseEvent & {
|
|
1670
1702
|
type: "resolveThought";
|
|
1671
1703
|
} & {
|
|
1672
1704
|
toolResult: _perstack_core.ToolResult;
|
|
1673
1705
|
}) | (_perstack_core.BaseEvent & {
|
|
1674
|
-
type: "
|
|
1706
|
+
type: "attemptCompletion";
|
|
1675
1707
|
} & {
|
|
1676
1708
|
toolResult: _perstack_core.ToolResult;
|
|
1677
1709
|
}) | (_perstack_core.BaseEvent & {
|
|
1678
|
-
type: "
|
|
1710
|
+
type: "finishToolCall";
|
|
1679
1711
|
} & {
|
|
1680
|
-
|
|
1712
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1681
1713
|
}) | (_perstack_core.BaseEvent & {
|
|
1682
|
-
type: "
|
|
1714
|
+
type: "resumeToolCalls";
|
|
1683
1715
|
} & {
|
|
1684
|
-
|
|
1716
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1717
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1685
1718
|
}) | (_perstack_core.BaseEvent & {
|
|
1686
|
-
type: "
|
|
1719
|
+
type: "finishAllToolCalls";
|
|
1687
1720
|
} & {
|
|
1688
1721
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1689
1722
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1718,7 +1751,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1718
1751
|
};
|
|
1719
1752
|
};
|
|
1720
1753
|
};
|
|
1721
|
-
readonly
|
|
1754
|
+
readonly ResolvingToolResult: {
|
|
1722
1755
|
readonly on: {
|
|
1723
1756
|
readonly finishToolCall: {
|
|
1724
1757
|
readonly target: "FinishingStep";
|
|
@@ -1746,14 +1779,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1746
1779
|
} & {
|
|
1747
1780
|
reason: string;
|
|
1748
1781
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1749
|
-
|
|
1750
|
-
|
|
1782
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1783
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1751
1784
|
usage: _perstack_core.Usage;
|
|
1752
1785
|
}) | (_perstack_core.BaseEvent & {
|
|
1753
|
-
type: "
|
|
1786
|
+
type: "callTools";
|
|
1754
1787
|
} & {
|
|
1755
1788
|
newMessage: _perstack_core.ExpertMessage;
|
|
1756
|
-
|
|
1789
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1757
1790
|
usage: _perstack_core.Usage;
|
|
1758
1791
|
}) | (_perstack_core.BaseEvent & {
|
|
1759
1792
|
type: "callInteractiveTool";
|
|
@@ -1765,30 +1798,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1765
1798
|
type: "callDelegate";
|
|
1766
1799
|
} & {
|
|
1767
1800
|
newMessage: _perstack_core.ExpertMessage;
|
|
1768
|
-
|
|
1801
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1769
1802
|
usage: _perstack_core.Usage;
|
|
1770
1803
|
}) | (_perstack_core.BaseEvent & {
|
|
1771
|
-
type: "
|
|
1804
|
+
type: "resolveToolResults";
|
|
1772
1805
|
} & {
|
|
1773
|
-
|
|
1806
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1774
1807
|
}) | (_perstack_core.BaseEvent & {
|
|
1775
1808
|
type: "resolveThought";
|
|
1776
1809
|
} & {
|
|
1777
1810
|
toolResult: _perstack_core.ToolResult;
|
|
1778
1811
|
}) | (_perstack_core.BaseEvent & {
|
|
1779
|
-
type: "
|
|
1812
|
+
type: "attemptCompletion";
|
|
1780
1813
|
} & {
|
|
1781
1814
|
toolResult: _perstack_core.ToolResult;
|
|
1782
1815
|
}) | (_perstack_core.BaseEvent & {
|
|
1783
|
-
type: "
|
|
1816
|
+
type: "finishToolCall";
|
|
1784
1817
|
} & {
|
|
1785
|
-
|
|
1818
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1786
1819
|
}) | (_perstack_core.BaseEvent & {
|
|
1787
|
-
type: "
|
|
1820
|
+
type: "resumeToolCalls";
|
|
1788
1821
|
} & {
|
|
1789
|
-
|
|
1822
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1823
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1790
1824
|
}) | (_perstack_core.BaseEvent & {
|
|
1791
|
-
type: "
|
|
1825
|
+
type: "finishAllToolCalls";
|
|
1792
1826
|
} & {
|
|
1793
1827
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1794
1828
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1823,7 +1857,7 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1823
1857
|
};
|
|
1824
1858
|
};
|
|
1825
1859
|
};
|
|
1826
|
-
readonly
|
|
1860
|
+
readonly ResolvingThought: {
|
|
1827
1861
|
readonly on: {
|
|
1828
1862
|
readonly finishToolCall: {
|
|
1829
1863
|
readonly target: "FinishingStep";
|
|
@@ -1851,14 +1885,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1851
1885
|
} & {
|
|
1852
1886
|
reason: string;
|
|
1853
1887
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1854
|
-
|
|
1855
|
-
|
|
1888
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1889
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1856
1890
|
usage: _perstack_core.Usage;
|
|
1857
1891
|
}) | (_perstack_core.BaseEvent & {
|
|
1858
|
-
type: "
|
|
1892
|
+
type: "callTools";
|
|
1859
1893
|
} & {
|
|
1860
1894
|
newMessage: _perstack_core.ExpertMessage;
|
|
1861
|
-
|
|
1895
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1862
1896
|
usage: _perstack_core.Usage;
|
|
1863
1897
|
}) | (_perstack_core.BaseEvent & {
|
|
1864
1898
|
type: "callInteractiveTool";
|
|
@@ -1870,30 +1904,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1870
1904
|
type: "callDelegate";
|
|
1871
1905
|
} & {
|
|
1872
1906
|
newMessage: _perstack_core.ExpertMessage;
|
|
1873
|
-
|
|
1907
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1874
1908
|
usage: _perstack_core.Usage;
|
|
1875
1909
|
}) | (_perstack_core.BaseEvent & {
|
|
1876
|
-
type: "
|
|
1910
|
+
type: "resolveToolResults";
|
|
1877
1911
|
} & {
|
|
1878
|
-
|
|
1912
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1879
1913
|
}) | (_perstack_core.BaseEvent & {
|
|
1880
1914
|
type: "resolveThought";
|
|
1881
1915
|
} & {
|
|
1882
1916
|
toolResult: _perstack_core.ToolResult;
|
|
1883
1917
|
}) | (_perstack_core.BaseEvent & {
|
|
1884
|
-
type: "
|
|
1918
|
+
type: "attemptCompletion";
|
|
1885
1919
|
} & {
|
|
1886
1920
|
toolResult: _perstack_core.ToolResult;
|
|
1887
1921
|
}) | (_perstack_core.BaseEvent & {
|
|
1888
|
-
type: "
|
|
1922
|
+
type: "finishToolCall";
|
|
1889
1923
|
} & {
|
|
1890
|
-
|
|
1924
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1891
1925
|
}) | (_perstack_core.BaseEvent & {
|
|
1892
|
-
type: "
|
|
1926
|
+
type: "resumeToolCalls";
|
|
1893
1927
|
} & {
|
|
1894
|
-
|
|
1928
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
1929
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
1895
1930
|
}) | (_perstack_core.BaseEvent & {
|
|
1896
|
-
type: "
|
|
1931
|
+
type: "finishAllToolCalls";
|
|
1897
1932
|
} & {
|
|
1898
1933
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
1899
1934
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -1943,8 +1978,8 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1943
1978
|
} & {
|
|
1944
1979
|
reason: string;
|
|
1945
1980
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1946
|
-
|
|
1947
|
-
|
|
1981
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1982
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1948
1983
|
usage: _perstack_core.Usage;
|
|
1949
1984
|
}, (_perstack_core.BaseEvent & {
|
|
1950
1985
|
type: "startRun";
|
|
@@ -1960,14 +1995,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1960
1995
|
} & {
|
|
1961
1996
|
reason: string;
|
|
1962
1997
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
1963
|
-
|
|
1964
|
-
|
|
1998
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
1999
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
1965
2000
|
usage: _perstack_core.Usage;
|
|
1966
2001
|
}) | (_perstack_core.BaseEvent & {
|
|
1967
|
-
type: "
|
|
2002
|
+
type: "callTools";
|
|
1968
2003
|
} & {
|
|
1969
2004
|
newMessage: _perstack_core.ExpertMessage;
|
|
1970
|
-
|
|
2005
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1971
2006
|
usage: _perstack_core.Usage;
|
|
1972
2007
|
}) | (_perstack_core.BaseEvent & {
|
|
1973
2008
|
type: "callInteractiveTool";
|
|
@@ -1979,30 +2014,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
1979
2014
|
type: "callDelegate";
|
|
1980
2015
|
} & {
|
|
1981
2016
|
newMessage: _perstack_core.ExpertMessage;
|
|
1982
|
-
|
|
2017
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
1983
2018
|
usage: _perstack_core.Usage;
|
|
1984
2019
|
}) | (_perstack_core.BaseEvent & {
|
|
1985
|
-
type: "
|
|
2020
|
+
type: "resolveToolResults";
|
|
1986
2021
|
} & {
|
|
1987
|
-
|
|
2022
|
+
toolResults: _perstack_core.ToolResult[];
|
|
1988
2023
|
}) | (_perstack_core.BaseEvent & {
|
|
1989
2024
|
type: "resolveThought";
|
|
1990
2025
|
} & {
|
|
1991
2026
|
toolResult: _perstack_core.ToolResult;
|
|
1992
2027
|
}) | (_perstack_core.BaseEvent & {
|
|
1993
|
-
type: "
|
|
2028
|
+
type: "attemptCompletion";
|
|
1994
2029
|
} & {
|
|
1995
2030
|
toolResult: _perstack_core.ToolResult;
|
|
1996
2031
|
}) | (_perstack_core.BaseEvent & {
|
|
1997
|
-
type: "
|
|
2032
|
+
type: "finishToolCall";
|
|
1998
2033
|
} & {
|
|
1999
|
-
|
|
2034
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2000
2035
|
}) | (_perstack_core.BaseEvent & {
|
|
2001
|
-
type: "
|
|
2036
|
+
type: "resumeToolCalls";
|
|
2002
2037
|
} & {
|
|
2003
|
-
|
|
2038
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2039
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2004
2040
|
}) | (_perstack_core.BaseEvent & {
|
|
2005
|
-
type: "
|
|
2041
|
+
type: "finishAllToolCalls";
|
|
2006
2042
|
} & {
|
|
2007
2043
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2008
2044
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2064,14 +2100,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2064
2100
|
} & {
|
|
2065
2101
|
reason: string;
|
|
2066
2102
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
2067
|
-
|
|
2068
|
-
|
|
2103
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
2104
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
2069
2105
|
usage: _perstack_core.Usage;
|
|
2070
2106
|
}) | (_perstack_core.BaseEvent & {
|
|
2071
|
-
type: "
|
|
2107
|
+
type: "callTools";
|
|
2072
2108
|
} & {
|
|
2073
2109
|
newMessage: _perstack_core.ExpertMessage;
|
|
2074
|
-
|
|
2110
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2075
2111
|
usage: _perstack_core.Usage;
|
|
2076
2112
|
}) | (_perstack_core.BaseEvent & {
|
|
2077
2113
|
type: "callInteractiveTool";
|
|
@@ -2083,30 +2119,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2083
2119
|
type: "callDelegate";
|
|
2084
2120
|
} & {
|
|
2085
2121
|
newMessage: _perstack_core.ExpertMessage;
|
|
2086
|
-
|
|
2122
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2087
2123
|
usage: _perstack_core.Usage;
|
|
2088
2124
|
}) | (_perstack_core.BaseEvent & {
|
|
2089
|
-
type: "
|
|
2125
|
+
type: "resolveToolResults";
|
|
2090
2126
|
} & {
|
|
2091
|
-
|
|
2127
|
+
toolResults: _perstack_core.ToolResult[];
|
|
2092
2128
|
}) | (_perstack_core.BaseEvent & {
|
|
2093
2129
|
type: "resolveThought";
|
|
2094
2130
|
} & {
|
|
2095
2131
|
toolResult: _perstack_core.ToolResult;
|
|
2096
2132
|
}) | (_perstack_core.BaseEvent & {
|
|
2097
|
-
type: "
|
|
2133
|
+
type: "attemptCompletion";
|
|
2098
2134
|
} & {
|
|
2099
2135
|
toolResult: _perstack_core.ToolResult;
|
|
2100
2136
|
}) | (_perstack_core.BaseEvent & {
|
|
2101
|
-
type: "
|
|
2137
|
+
type: "finishToolCall";
|
|
2102
2138
|
} & {
|
|
2103
|
-
|
|
2139
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2104
2140
|
}) | (_perstack_core.BaseEvent & {
|
|
2105
|
-
type: "
|
|
2141
|
+
type: "resumeToolCalls";
|
|
2106
2142
|
} & {
|
|
2107
|
-
|
|
2143
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2144
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2108
2145
|
}) | (_perstack_core.BaseEvent & {
|
|
2109
|
-
type: "
|
|
2146
|
+
type: "finishAllToolCalls";
|
|
2110
2147
|
} & {
|
|
2111
2148
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2112
2149
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2170,14 +2207,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2170
2207
|
} & {
|
|
2171
2208
|
reason: string;
|
|
2172
2209
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
2173
|
-
|
|
2174
|
-
|
|
2210
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
2211
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
2175
2212
|
usage: _perstack_core.Usage;
|
|
2176
2213
|
}) | (_perstack_core.BaseEvent & {
|
|
2177
|
-
type: "
|
|
2214
|
+
type: "callTools";
|
|
2178
2215
|
} & {
|
|
2179
2216
|
newMessage: _perstack_core.ExpertMessage;
|
|
2180
|
-
|
|
2217
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2181
2218
|
usage: _perstack_core.Usage;
|
|
2182
2219
|
}) | (_perstack_core.BaseEvent & {
|
|
2183
2220
|
type: "callInteractiveTool";
|
|
@@ -2189,30 +2226,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2189
2226
|
type: "callDelegate";
|
|
2190
2227
|
} & {
|
|
2191
2228
|
newMessage: _perstack_core.ExpertMessage;
|
|
2192
|
-
|
|
2229
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2193
2230
|
usage: _perstack_core.Usage;
|
|
2194
2231
|
}) | (_perstack_core.BaseEvent & {
|
|
2195
|
-
type: "
|
|
2232
|
+
type: "resolveToolResults";
|
|
2196
2233
|
} & {
|
|
2197
|
-
|
|
2234
|
+
toolResults: _perstack_core.ToolResult[];
|
|
2198
2235
|
}) | (_perstack_core.BaseEvent & {
|
|
2199
2236
|
type: "resolveThought";
|
|
2200
2237
|
} & {
|
|
2201
2238
|
toolResult: _perstack_core.ToolResult;
|
|
2202
2239
|
}) | (_perstack_core.BaseEvent & {
|
|
2203
|
-
type: "
|
|
2240
|
+
type: "attemptCompletion";
|
|
2204
2241
|
} & {
|
|
2205
2242
|
toolResult: _perstack_core.ToolResult;
|
|
2206
2243
|
}) | (_perstack_core.BaseEvent & {
|
|
2207
|
-
type: "
|
|
2244
|
+
type: "finishToolCall";
|
|
2208
2245
|
} & {
|
|
2209
|
-
|
|
2246
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2210
2247
|
}) | (_perstack_core.BaseEvent & {
|
|
2211
|
-
type: "
|
|
2248
|
+
type: "resumeToolCalls";
|
|
2212
2249
|
} & {
|
|
2213
|
-
|
|
2250
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2251
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2214
2252
|
}) | (_perstack_core.BaseEvent & {
|
|
2215
|
-
type: "
|
|
2253
|
+
type: "finishAllToolCalls";
|
|
2216
2254
|
} & {
|
|
2217
2255
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2218
2256
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2276,14 +2314,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2276
2314
|
} & {
|
|
2277
2315
|
reason: string;
|
|
2278
2316
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
2279
|
-
|
|
2280
|
-
|
|
2317
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
2318
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
2281
2319
|
usage: _perstack_core.Usage;
|
|
2282
2320
|
}) | (_perstack_core.BaseEvent & {
|
|
2283
|
-
type: "
|
|
2321
|
+
type: "callTools";
|
|
2284
2322
|
} & {
|
|
2285
2323
|
newMessage: _perstack_core.ExpertMessage;
|
|
2286
|
-
|
|
2324
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2287
2325
|
usage: _perstack_core.Usage;
|
|
2288
2326
|
}) | (_perstack_core.BaseEvent & {
|
|
2289
2327
|
type: "callInteractiveTool";
|
|
@@ -2295,30 +2333,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2295
2333
|
type: "callDelegate";
|
|
2296
2334
|
} & {
|
|
2297
2335
|
newMessage: _perstack_core.ExpertMessage;
|
|
2298
|
-
|
|
2336
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2299
2337
|
usage: _perstack_core.Usage;
|
|
2300
2338
|
}) | (_perstack_core.BaseEvent & {
|
|
2301
|
-
type: "
|
|
2339
|
+
type: "resolveToolResults";
|
|
2302
2340
|
} & {
|
|
2303
|
-
|
|
2341
|
+
toolResults: _perstack_core.ToolResult[];
|
|
2304
2342
|
}) | (_perstack_core.BaseEvent & {
|
|
2305
2343
|
type: "resolveThought";
|
|
2306
2344
|
} & {
|
|
2307
2345
|
toolResult: _perstack_core.ToolResult;
|
|
2308
2346
|
}) | (_perstack_core.BaseEvent & {
|
|
2309
|
-
type: "
|
|
2347
|
+
type: "attemptCompletion";
|
|
2310
2348
|
} & {
|
|
2311
2349
|
toolResult: _perstack_core.ToolResult;
|
|
2312
2350
|
}) | (_perstack_core.BaseEvent & {
|
|
2313
|
-
type: "
|
|
2351
|
+
type: "finishToolCall";
|
|
2314
2352
|
} & {
|
|
2315
|
-
|
|
2353
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2316
2354
|
}) | (_perstack_core.BaseEvent & {
|
|
2317
|
-
type: "
|
|
2355
|
+
type: "resumeToolCalls";
|
|
2318
2356
|
} & {
|
|
2319
|
-
|
|
2357
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2358
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2320
2359
|
}) | (_perstack_core.BaseEvent & {
|
|
2321
|
-
type: "
|
|
2360
|
+
type: "finishAllToolCalls";
|
|
2322
2361
|
} & {
|
|
2323
2362
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2324
2363
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2383,14 +2422,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2383
2422
|
} & {
|
|
2384
2423
|
reason: string;
|
|
2385
2424
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
2386
|
-
|
|
2387
|
-
|
|
2425
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
2426
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
2388
2427
|
usage: _perstack_core.Usage;
|
|
2389
2428
|
}) | (_perstack_core.BaseEvent & {
|
|
2390
|
-
type: "
|
|
2429
|
+
type: "callTools";
|
|
2391
2430
|
} & {
|
|
2392
2431
|
newMessage: _perstack_core.ExpertMessage;
|
|
2393
|
-
|
|
2432
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2394
2433
|
usage: _perstack_core.Usage;
|
|
2395
2434
|
}) | (_perstack_core.BaseEvent & {
|
|
2396
2435
|
type: "callInteractiveTool";
|
|
@@ -2402,30 +2441,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2402
2441
|
type: "callDelegate";
|
|
2403
2442
|
} & {
|
|
2404
2443
|
newMessage: _perstack_core.ExpertMessage;
|
|
2405
|
-
|
|
2444
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2406
2445
|
usage: _perstack_core.Usage;
|
|
2407
2446
|
}) | (_perstack_core.BaseEvent & {
|
|
2408
|
-
type: "
|
|
2447
|
+
type: "resolveToolResults";
|
|
2409
2448
|
} & {
|
|
2410
|
-
|
|
2449
|
+
toolResults: _perstack_core.ToolResult[];
|
|
2411
2450
|
}) | (_perstack_core.BaseEvent & {
|
|
2412
2451
|
type: "resolveThought";
|
|
2413
2452
|
} & {
|
|
2414
2453
|
toolResult: _perstack_core.ToolResult;
|
|
2415
2454
|
}) | (_perstack_core.BaseEvent & {
|
|
2416
|
-
type: "
|
|
2455
|
+
type: "attemptCompletion";
|
|
2417
2456
|
} & {
|
|
2418
2457
|
toolResult: _perstack_core.ToolResult;
|
|
2419
2458
|
}) | (_perstack_core.BaseEvent & {
|
|
2420
|
-
type: "
|
|
2459
|
+
type: "finishToolCall";
|
|
2421
2460
|
} & {
|
|
2422
|
-
|
|
2461
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2423
2462
|
}) | (_perstack_core.BaseEvent & {
|
|
2424
|
-
type: "
|
|
2463
|
+
type: "resumeToolCalls";
|
|
2425
2464
|
} & {
|
|
2426
|
-
|
|
2465
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2466
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2427
2467
|
}) | (_perstack_core.BaseEvent & {
|
|
2428
|
-
type: "
|
|
2468
|
+
type: "finishAllToolCalls";
|
|
2429
2469
|
} & {
|
|
2430
2470
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2431
2471
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2486,14 +2526,14 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2486
2526
|
} & {
|
|
2487
2527
|
reason: string;
|
|
2488
2528
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ExpertMessage | _perstack_core.ToolMessage)[];
|
|
2489
|
-
|
|
2490
|
-
|
|
2529
|
+
toolCalls?: _perstack_core.ToolCall[];
|
|
2530
|
+
toolResults?: _perstack_core.ToolResult[];
|
|
2491
2531
|
usage: _perstack_core.Usage;
|
|
2492
2532
|
}) | (_perstack_core.BaseEvent & {
|
|
2493
|
-
type: "
|
|
2533
|
+
type: "callTools";
|
|
2494
2534
|
} & {
|
|
2495
2535
|
newMessage: _perstack_core.ExpertMessage;
|
|
2496
|
-
|
|
2536
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2497
2537
|
usage: _perstack_core.Usage;
|
|
2498
2538
|
}) | (_perstack_core.BaseEvent & {
|
|
2499
2539
|
type: "callInteractiveTool";
|
|
@@ -2505,30 +2545,31 @@ declare const runtimeStateMachine: xstate.StateMachine<{
|
|
|
2505
2545
|
type: "callDelegate";
|
|
2506
2546
|
} & {
|
|
2507
2547
|
newMessage: _perstack_core.ExpertMessage;
|
|
2508
|
-
|
|
2548
|
+
toolCalls: _perstack_core.ToolCall[];
|
|
2509
2549
|
usage: _perstack_core.Usage;
|
|
2510
2550
|
}) | (_perstack_core.BaseEvent & {
|
|
2511
|
-
type: "
|
|
2551
|
+
type: "resolveToolResults";
|
|
2512
2552
|
} & {
|
|
2513
|
-
|
|
2553
|
+
toolResults: _perstack_core.ToolResult[];
|
|
2514
2554
|
}) | (_perstack_core.BaseEvent & {
|
|
2515
2555
|
type: "resolveThought";
|
|
2516
2556
|
} & {
|
|
2517
2557
|
toolResult: _perstack_core.ToolResult;
|
|
2518
2558
|
}) | (_perstack_core.BaseEvent & {
|
|
2519
|
-
type: "
|
|
2559
|
+
type: "attemptCompletion";
|
|
2520
2560
|
} & {
|
|
2521
2561
|
toolResult: _perstack_core.ToolResult;
|
|
2522
2562
|
}) | (_perstack_core.BaseEvent & {
|
|
2523
|
-
type: "
|
|
2563
|
+
type: "finishToolCall";
|
|
2524
2564
|
} & {
|
|
2525
|
-
|
|
2565
|
+
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2526
2566
|
}) | (_perstack_core.BaseEvent & {
|
|
2527
|
-
type: "
|
|
2567
|
+
type: "resumeToolCalls";
|
|
2528
2568
|
} & {
|
|
2529
|
-
|
|
2569
|
+
pendingToolCalls: _perstack_core.ToolCall[];
|
|
2570
|
+
partialToolResults: _perstack_core.ToolResult[];
|
|
2530
2571
|
}) | (_perstack_core.BaseEvent & {
|
|
2531
|
-
type: "
|
|
2572
|
+
type: "finishAllToolCalls";
|
|
2532
2573
|
} & {
|
|
2533
2574
|
newMessages: (_perstack_core.UserMessage | _perstack_core.ToolMessage)[];
|
|
2534
2575
|
}) | (_perstack_core.BaseEvent & {
|
|
@@ -2574,4 +2615,4 @@ type RunSnapshot = SnapshotFrom<typeof runtimeStateMachine>;
|
|
|
2574
2615
|
|
|
2575
2616
|
declare const runtimeVersion: string;
|
|
2576
2617
|
|
|
2577
|
-
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 };
|