@linnlabs/linnkit 0.32.2 → 0.33.0
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/CHANGELOG.md +31 -0
- package/dist/cli.cjs +312 -50
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +312 -50
- package/dist/cli.js.map +1 -1
- package/dist/context-manager.cjs +1 -0
- package/dist/context-manager.cjs.map +1 -1
- package/dist/context-manager.js +1 -0
- package/dist/context-manager.js.map +1 -1
- package/dist/contracts/agentSpec.d.cts +30 -30
- package/dist/contracts/agentSpec.d.ts +30 -30
- package/dist/contracts/audit.d.cts +32 -32
- package/dist/contracts/audit.d.ts +32 -32
- package/dist/contracts/contextPolicy.d.cts +36 -36
- package/dist/contracts/contextPolicy.d.ts +36 -36
- package/dist/contracts/events.d.cts +968 -968
- package/dist/contracts/events.d.ts +968 -968
- package/dist/contracts/execution.d.cts +8 -8
- package/dist/contracts/execution.d.ts +8 -8
- package/dist/contracts/messages.d.cts +204 -204
- package/dist/contracts/messages.d.ts +204 -204
- package/dist/contracts/sse.d.cts +891 -891
- package/dist/contracts/sse.d.ts +891 -891
- package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
- package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
- package/dist/contracts/token-accounting.d.cts +28 -28
- package/dist/contracts/token-accounting.d.ts +28 -28
- package/dist/index.cjs +383 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +383 -66
- package/dist/index.js.map +1 -1
- package/dist/quickstart/toolRuntime.d.cts +1 -1
- package/dist/quickstart/toolRuntime.d.ts +1 -1
- package/dist/quickstart/types.d.cts +1 -1
- package/dist/quickstart/types.d.ts +1 -1
- package/dist/quickstart.cjs +312 -50
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +312 -50
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +11 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +11 -0
- package/dist/runtime-kernel/events/agentEvents.d.cts +98 -98
- package/dist/runtime-kernel/events/agentEvents.d.ts +98 -98
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +15 -1
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +15 -1
- package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.cts +34 -0
- package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.ts +34 -0
- package/dist/runtime-kernel/graph-engine/engine.d.cts +13 -2
- package/dist/runtime-kernel/graph-engine/engine.d.ts +13 -2
- package/dist/runtime-kernel/graph-engine/index.d.cts +2 -1
- package/dist/runtime-kernel/graph-engine/index.d.ts +2 -1
- package/dist/runtime-kernel/graph-engine/types.d.cts +8 -0
- package/dist/runtime-kernel/graph-engine/types.d.ts +8 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +14 -2
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +14 -2
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +1 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +1 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +9 -5
- package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +9 -5
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +2 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +2 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +7 -1
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +7 -1
- package/dist/runtime-kernel.cjs +383 -66
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.d.cts +2 -1
- package/dist/runtime-kernel.d.ts +2 -1
- package/dist/runtime-kernel.js +381 -67
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/testkit.cjs +383 -66
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +383 -66
- package/dist/testkit.js.map +1 -1
- package/docs/integration/01-installation.md +1 -1
- package/docs/integration/child-runs.md +12 -0
- package/docs/integration/persistence.md +23 -0
- package/docs/integration/run-supervisor.md +12 -2
- package/package.json +4 -4
|
@@ -9,6 +9,8 @@ import { ChildRunParentContext } from './types.cjs';
|
|
|
9
9
|
import { TelemetryPort } from '../telemetry/telemetryPort.cjs';
|
|
10
10
|
import { ModelResolverLike } from '../llm/modelResolver.cjs';
|
|
11
11
|
import { RuntimeEventSink, RuntimeEventCommitPort, GraphNode } from '../graph-engine/types.cjs';
|
|
12
|
+
import { Checkpointer } from '../graph-engine/checkpointer/base.cjs';
|
|
13
|
+
import { ExecutionCheckpointPort, ToolRecoveryPort } from '../graph-engine/definitions/runContinuation.cjs';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* @file src/agent/runtime-kernel/child-runs/childRunInvoker.ts
|
|
@@ -53,6 +55,13 @@ interface ChildRunInvokeConfig {
|
|
|
53
55
|
seedHistoryEvents?: RuntimeEvent[];
|
|
54
56
|
maxSteps?: number;
|
|
55
57
|
modelId?: string;
|
|
58
|
+
/** 由 Host 提供同一 child run 的持久断点与事务 writer;不再使用内存临时图。 */
|
|
59
|
+
persistence?: {
|
|
60
|
+
readonly checkpointer: Checkpointer;
|
|
61
|
+
readonly executionCheckpointPort: ExecutionCheckpointPort;
|
|
62
|
+
readonly toolRecoveryPort?: ToolRecoveryPort;
|
|
63
|
+
readonly expectedRevision?: number;
|
|
64
|
+
};
|
|
56
65
|
}
|
|
57
66
|
interface ChildRunInvokeResult {
|
|
58
67
|
runId?: RunId;
|
|
@@ -95,6 +104,8 @@ declare class ChildRunInvoker {
|
|
|
95
104
|
auditPort?: AuditPort;
|
|
96
105
|
});
|
|
97
106
|
invoke(config: ChildRunInvokeConfig): Promise<ChildRunInvokeResult>;
|
|
107
|
+
private createGraph;
|
|
108
|
+
private continueChild;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
export { ChildRunInvoker };
|
|
@@ -9,6 +9,8 @@ import { ChildRunParentContext } from './types.js';
|
|
|
9
9
|
import { TelemetryPort } from '../telemetry/telemetryPort.js';
|
|
10
10
|
import { ModelResolverLike } from '../llm/modelResolver.js';
|
|
11
11
|
import { RuntimeEventSink, RuntimeEventCommitPort, GraphNode } from '../graph-engine/types.js';
|
|
12
|
+
import { Checkpointer } from '../graph-engine/checkpointer/base.js';
|
|
13
|
+
import { ExecutionCheckpointPort, ToolRecoveryPort } from '../graph-engine/definitions/runContinuation.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* @file src/agent/runtime-kernel/child-runs/childRunInvoker.ts
|
|
@@ -53,6 +55,13 @@ interface ChildRunInvokeConfig {
|
|
|
53
55
|
seedHistoryEvents?: RuntimeEvent[];
|
|
54
56
|
maxSteps?: number;
|
|
55
57
|
modelId?: string;
|
|
58
|
+
/** 由 Host 提供同一 child run 的持久断点与事务 writer;不再使用内存临时图。 */
|
|
59
|
+
persistence?: {
|
|
60
|
+
readonly checkpointer: Checkpointer;
|
|
61
|
+
readonly executionCheckpointPort: ExecutionCheckpointPort;
|
|
62
|
+
readonly toolRecoveryPort?: ToolRecoveryPort;
|
|
63
|
+
readonly expectedRevision?: number;
|
|
64
|
+
};
|
|
56
65
|
}
|
|
57
66
|
interface ChildRunInvokeResult {
|
|
58
67
|
runId?: RunId;
|
|
@@ -95,6 +104,8 @@ declare class ChildRunInvoker {
|
|
|
95
104
|
auditPort?: AuditPort;
|
|
96
105
|
});
|
|
97
106
|
invoke(config: ChildRunInvokeConfig): Promise<ChildRunInvokeResult>;
|
|
107
|
+
private createGraph;
|
|
108
|
+
private continueChild;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
export { ChildRunInvoker };
|
|
@@ -12,19 +12,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
12
12
|
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
13
13
|
thought_message_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
14
14
|
}, "strict", z.ZodTypeAny, {
|
|
15
|
-
id: string;
|
|
16
15
|
type: "thought";
|
|
17
|
-
|
|
16
|
+
id: string;
|
|
18
17
|
timestamp: number;
|
|
18
|
+
content: string;
|
|
19
19
|
is_complete: boolean;
|
|
20
20
|
thought_message_id?: string | undefined;
|
|
21
21
|
delta?: string | undefined;
|
|
22
22
|
meta?: Record<string, unknown> | undefined;
|
|
23
23
|
}, {
|
|
24
|
-
id: string;
|
|
25
24
|
type: "thought";
|
|
26
|
-
|
|
25
|
+
id: string;
|
|
27
26
|
timestamp: number;
|
|
27
|
+
content: string;
|
|
28
28
|
is_complete: boolean;
|
|
29
29
|
thought_message_id?: string | undefined;
|
|
30
30
|
delta?: string | undefined;
|
|
@@ -329,6 +329,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
329
329
|
}[] | undefined;
|
|
330
330
|
}>]>, "many">>;
|
|
331
331
|
}, "strict", z.ZodTypeAny, {
|
|
332
|
+
args?: Record<string, unknown> | undefined;
|
|
332
333
|
tool_calls?: unknown[] | undefined;
|
|
333
334
|
provider_continuations?: {
|
|
334
335
|
kind: string;
|
|
@@ -388,8 +389,8 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
388
389
|
payload: SerializableJsonValue;
|
|
389
390
|
}[] | undefined;
|
|
390
391
|
})[] | undefined;
|
|
391
|
-
args?: Record<string, unknown> | undefined;
|
|
392
392
|
}, {
|
|
393
|
+
args?: Record<string, unknown> | undefined;
|
|
393
394
|
tool_calls?: unknown[] | undefined;
|
|
394
395
|
provider_continuations?: {
|
|
395
396
|
kind: string;
|
|
@@ -449,19 +450,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
449
450
|
payload: SerializableJsonValue;
|
|
450
451
|
}[] | undefined;
|
|
451
452
|
})[] | undefined;
|
|
452
|
-
args?: Record<string, unknown> | undefined;
|
|
453
453
|
}>>;
|
|
454
454
|
}, "strict", z.ZodTypeAny, {
|
|
455
|
+
type: "tool_call_decision";
|
|
455
456
|
id: string;
|
|
457
|
+
timestamp: number;
|
|
456
458
|
status: "error" | "loading" | "success";
|
|
457
|
-
type: "tool_call_decision";
|
|
458
|
-
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
459
459
|
tool_name: string;
|
|
460
|
-
|
|
461
|
-
phase: "
|
|
460
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
461
|
+
phase: "start" | "update" | "complete" | "error";
|
|
462
462
|
tool_args: Record<string, unknown>;
|
|
463
463
|
tool_calls?: unknown[] | undefined;
|
|
464
464
|
payload?: {
|
|
465
|
+
args?: Record<string, unknown> | undefined;
|
|
465
466
|
tool_calls?: unknown[] | undefined;
|
|
466
467
|
provider_continuations?: {
|
|
467
468
|
kind: string;
|
|
@@ -521,20 +522,20 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
521
522
|
payload: SerializableJsonValue;
|
|
522
523
|
}[] | undefined;
|
|
523
524
|
})[] | undefined;
|
|
524
|
-
args?: Record<string, unknown> | undefined;
|
|
525
525
|
} | undefined;
|
|
526
526
|
meta?: Record<string, unknown> | undefined;
|
|
527
527
|
}, {
|
|
528
|
+
type: "tool_call_decision";
|
|
528
529
|
id: string;
|
|
530
|
+
timestamp: number;
|
|
529
531
|
status: "error" | "loading" | "success";
|
|
530
|
-
type: "tool_call_decision";
|
|
531
|
-
tool_call_id: string;
|
|
532
532
|
tool_name: string;
|
|
533
|
-
|
|
534
|
-
phase: "
|
|
533
|
+
tool_call_id: string;
|
|
534
|
+
phase: "start" | "update" | "complete" | "error";
|
|
535
535
|
tool_args: Record<string, unknown>;
|
|
536
536
|
tool_calls?: unknown[] | undefined;
|
|
537
537
|
payload?: {
|
|
538
|
+
args?: Record<string, unknown> | undefined;
|
|
538
539
|
tool_calls?: unknown[] | undefined;
|
|
539
540
|
provider_continuations?: {
|
|
540
541
|
kind: string;
|
|
@@ -594,7 +595,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
594
595
|
payload: SerializableJsonValue;
|
|
595
596
|
}[] | undefined;
|
|
596
597
|
})[] | undefined;
|
|
597
|
-
args?: Record<string, unknown> | undefined;
|
|
598
598
|
} | undefined;
|
|
599
599
|
meta?: Record<string, unknown> | undefined;
|
|
600
600
|
}>, z.ZodObject<{
|
|
@@ -611,25 +611,25 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
611
611
|
} & {
|
|
612
612
|
type: z.ZodLiteral<"tool_process">;
|
|
613
613
|
}, "strict", z.ZodTypeAny, {
|
|
614
|
+
type: "tool_process";
|
|
614
615
|
id: string;
|
|
616
|
+
timestamp: number;
|
|
615
617
|
status: "error" | "loading" | "success";
|
|
616
|
-
type: "tool_process";
|
|
617
|
-
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
618
618
|
tool_name: string;
|
|
619
|
-
|
|
620
|
-
phase: "
|
|
619
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
620
|
+
phase: "start" | "update" | "complete" | "error";
|
|
621
621
|
tool_args: Record<string, unknown>;
|
|
622
622
|
tool_calls?: unknown[] | undefined;
|
|
623
623
|
payload?: Record<string, unknown> | undefined;
|
|
624
624
|
meta?: Record<string, unknown> | undefined;
|
|
625
625
|
}, {
|
|
626
|
+
type: "tool_process";
|
|
626
627
|
id: string;
|
|
628
|
+
timestamp: number;
|
|
627
629
|
status: "error" | "loading" | "success";
|
|
628
|
-
type: "tool_process";
|
|
629
|
-
tool_call_id: string;
|
|
630
630
|
tool_name: string;
|
|
631
|
-
|
|
632
|
-
phase: "
|
|
631
|
+
tool_call_id: string;
|
|
632
|
+
phase: "start" | "update" | "complete" | "error";
|
|
633
633
|
tool_args: Record<string, unknown>;
|
|
634
634
|
tool_calls?: unknown[] | undefined;
|
|
635
635
|
payload?: Record<string, unknown> | undefined;
|
|
@@ -682,15 +682,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
682
682
|
label?: string | undefined;
|
|
683
683
|
}>, "many">>;
|
|
684
684
|
}, "strict", z.ZodTypeAny, {
|
|
685
|
-
id: string;
|
|
686
685
|
type: "observation";
|
|
687
|
-
|
|
688
|
-
tool_name: string;
|
|
686
|
+
id: string;
|
|
689
687
|
timestamp: number;
|
|
688
|
+
tool_name: string;
|
|
689
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
690
690
|
success: boolean;
|
|
691
691
|
observation: string;
|
|
692
|
-
data?: unknown;
|
|
693
|
-
error?: string | undefined;
|
|
694
692
|
attachments?: {
|
|
695
693
|
id: string;
|
|
696
694
|
kind: "image";
|
|
@@ -703,18 +701,18 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
703
701
|
fileName?: string | undefined;
|
|
704
702
|
label?: string | undefined;
|
|
705
703
|
}[] | undefined;
|
|
704
|
+
error?: string | undefined;
|
|
705
|
+
data?: unknown;
|
|
706
706
|
error_code?: string | undefined;
|
|
707
707
|
duration_ms?: number | undefined;
|
|
708
708
|
}, {
|
|
709
|
-
id: string;
|
|
710
709
|
type: "observation";
|
|
711
|
-
|
|
712
|
-
tool_name: string;
|
|
710
|
+
id: string;
|
|
713
711
|
timestamp: number;
|
|
712
|
+
tool_name: string;
|
|
713
|
+
tool_call_id: string;
|
|
714
714
|
success: boolean;
|
|
715
715
|
observation: string;
|
|
716
|
-
data?: unknown;
|
|
717
|
-
error?: string | undefined;
|
|
718
716
|
attachments?: {
|
|
719
717
|
id: string;
|
|
720
718
|
kind: "image";
|
|
@@ -727,6 +725,8 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
727
725
|
fileName?: string | undefined;
|
|
728
726
|
label?: string | undefined;
|
|
729
727
|
}[] | undefined;
|
|
728
|
+
error?: string | undefined;
|
|
729
|
+
data?: unknown;
|
|
730
730
|
error_code?: string | undefined;
|
|
731
731
|
duration_ms?: number | undefined;
|
|
732
732
|
}>, z.ZodObject<{
|
|
@@ -1023,11 +1023,11 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1023
1023
|
}>]>, "many">>;
|
|
1024
1024
|
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1025
1025
|
}, "strict", z.ZodTypeAny, {
|
|
1026
|
-
id: string;
|
|
1027
1026
|
type: "final_answer";
|
|
1028
|
-
|
|
1027
|
+
id: string;
|
|
1029
1028
|
timestamp: number;
|
|
1030
1029
|
answer_id: string;
|
|
1030
|
+
completion_reason: "tool_call" | "terminal" | "interrupted";
|
|
1031
1031
|
answer: string;
|
|
1032
1032
|
provider_continuations?: {
|
|
1033
1033
|
kind: string;
|
|
@@ -1089,11 +1089,11 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1089
1089
|
})[] | undefined;
|
|
1090
1090
|
meta?: Record<string, unknown> | undefined;
|
|
1091
1091
|
}, {
|
|
1092
|
-
id: string;
|
|
1093
1092
|
type: "final_answer";
|
|
1094
|
-
|
|
1093
|
+
id: string;
|
|
1095
1094
|
timestamp: number;
|
|
1096
1095
|
answer_id: string;
|
|
1096
|
+
completion_reason: "tool_call" | "terminal" | "interrupted";
|
|
1097
1097
|
answer: string;
|
|
1098
1098
|
provider_continuations?: {
|
|
1099
1099
|
kind: string;
|
|
@@ -1164,18 +1164,18 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1164
1164
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
1165
1165
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1166
1166
|
}, "strict", z.ZodTypeAny, {
|
|
1167
|
-
id: string;
|
|
1168
1167
|
type: "error";
|
|
1169
|
-
|
|
1168
|
+
id: string;
|
|
1170
1169
|
timestamp: number;
|
|
1170
|
+
error: string;
|
|
1171
1171
|
error_code?: string | undefined;
|
|
1172
1172
|
details?: Record<string, unknown> | undefined;
|
|
1173
1173
|
retryable?: boolean | undefined;
|
|
1174
1174
|
}, {
|
|
1175
|
-
id: string;
|
|
1176
1175
|
type: "error";
|
|
1177
|
-
|
|
1176
|
+
id: string;
|
|
1178
1177
|
timestamp: number;
|
|
1178
|
+
error: string;
|
|
1179
1179
|
error_code?: string | undefined;
|
|
1180
1180
|
details?: Record<string, unknown> | undefined;
|
|
1181
1181
|
retryable?: boolean | undefined;
|
|
@@ -1189,18 +1189,18 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1189
1189
|
seq: z.ZodNumber;
|
|
1190
1190
|
is_last: z.ZodOptional<z.ZodBoolean>;
|
|
1191
1191
|
}, "strict", z.ZodTypeAny, {
|
|
1192
|
-
id: string;
|
|
1193
1192
|
type: "stream_chunk";
|
|
1194
|
-
|
|
1193
|
+
id: string;
|
|
1195
1194
|
timestamp: number;
|
|
1195
|
+
content: string;
|
|
1196
1196
|
answer_id: string;
|
|
1197
1197
|
seq: number;
|
|
1198
1198
|
is_last?: boolean | undefined;
|
|
1199
1199
|
}, {
|
|
1200
|
-
id: string;
|
|
1201
1200
|
type: "stream_chunk";
|
|
1202
|
-
|
|
1201
|
+
id: string;
|
|
1203
1202
|
timestamp: number;
|
|
1203
|
+
content: string;
|
|
1204
1204
|
answer_id: string;
|
|
1205
1205
|
seq: number;
|
|
1206
1206
|
is_last?: boolean | undefined;
|
|
@@ -1212,14 +1212,14 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1212
1212
|
answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
1213
1213
|
thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
1214
1214
|
}, "strict", z.ZodTypeAny, {
|
|
1215
|
-
id: string;
|
|
1216
1215
|
type: "stream_reset";
|
|
1216
|
+
id: string;
|
|
1217
1217
|
timestamp: number;
|
|
1218
1218
|
answer_id?: string | undefined;
|
|
1219
1219
|
thought_message_ids?: string[] | undefined;
|
|
1220
1220
|
}, {
|
|
1221
|
-
id: string;
|
|
1222
1221
|
type: "stream_reset";
|
|
1222
|
+
id: string;
|
|
1223
1223
|
timestamp: number;
|
|
1224
1224
|
answer_id?: string | undefined;
|
|
1225
1225
|
thought_message_ids?: string[] | undefined;
|
|
@@ -1275,8 +1275,8 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1275
1275
|
payload: SerializableJsonValue;
|
|
1276
1276
|
}>, "many">;
|
|
1277
1277
|
}, "strict", z.ZodTypeAny, {
|
|
1278
|
-
id: string;
|
|
1279
1278
|
type: "provider_continuation";
|
|
1279
|
+
id: string;
|
|
1280
1280
|
timestamp: number;
|
|
1281
1281
|
continuations: {
|
|
1282
1282
|
kind: string;
|
|
@@ -1291,8 +1291,8 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1291
1291
|
payload: SerializableJsonValue;
|
|
1292
1292
|
}[];
|
|
1293
1293
|
}, {
|
|
1294
|
-
id: string;
|
|
1295
1294
|
type: "provider_continuation";
|
|
1295
|
+
id: string;
|
|
1296
1296
|
timestamp: number;
|
|
1297
1297
|
continuations: {
|
|
1298
1298
|
kind: string;
|
|
@@ -1307,25 +1307,26 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1307
1307
|
payload: SerializableJsonValue;
|
|
1308
1308
|
}[];
|
|
1309
1309
|
}>]>, {
|
|
1310
|
-
id: string;
|
|
1311
1310
|
type: "thought";
|
|
1312
|
-
|
|
1311
|
+
id: string;
|
|
1313
1312
|
timestamp: number;
|
|
1313
|
+
content: string;
|
|
1314
1314
|
is_complete: boolean;
|
|
1315
1315
|
thought_message_id?: string | undefined;
|
|
1316
1316
|
delta?: string | undefined;
|
|
1317
1317
|
meta?: Record<string, unknown> | undefined;
|
|
1318
1318
|
} | {
|
|
1319
|
+
type: "tool_call_decision";
|
|
1319
1320
|
id: string;
|
|
1321
|
+
timestamp: number;
|
|
1320
1322
|
status: "error" | "loading" | "success";
|
|
1321
|
-
type: "tool_call_decision";
|
|
1322
|
-
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
1323
1323
|
tool_name: string;
|
|
1324
|
-
|
|
1325
|
-
phase: "
|
|
1324
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
1325
|
+
phase: "start" | "update" | "complete" | "error";
|
|
1326
1326
|
tool_args: Record<string, unknown>;
|
|
1327
1327
|
tool_calls?: unknown[] | undefined;
|
|
1328
1328
|
payload?: {
|
|
1329
|
+
args?: Record<string, unknown> | undefined;
|
|
1329
1330
|
tool_calls?: unknown[] | undefined;
|
|
1330
1331
|
provider_continuations?: {
|
|
1331
1332
|
kind: string;
|
|
@@ -1385,31 +1386,28 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1385
1386
|
payload: SerializableJsonValue;
|
|
1386
1387
|
}[] | undefined;
|
|
1387
1388
|
})[] | undefined;
|
|
1388
|
-
args?: Record<string, unknown> | undefined;
|
|
1389
1389
|
} | undefined;
|
|
1390
1390
|
meta?: Record<string, unknown> | undefined;
|
|
1391
1391
|
} | {
|
|
1392
|
+
type: "tool_process";
|
|
1392
1393
|
id: string;
|
|
1394
|
+
timestamp: number;
|
|
1393
1395
|
status: "error" | "loading" | "success";
|
|
1394
|
-
type: "tool_process";
|
|
1395
|
-
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
1396
1396
|
tool_name: string;
|
|
1397
|
-
|
|
1398
|
-
phase: "
|
|
1397
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
1398
|
+
phase: "start" | "update" | "complete" | "error";
|
|
1399
1399
|
tool_args: Record<string, unknown>;
|
|
1400
1400
|
tool_calls?: unknown[] | undefined;
|
|
1401
1401
|
payload?: Record<string, unknown> | undefined;
|
|
1402
1402
|
meta?: Record<string, unknown> | undefined;
|
|
1403
1403
|
} | {
|
|
1404
|
-
id: string;
|
|
1405
1404
|
type: "observation";
|
|
1406
|
-
|
|
1407
|
-
tool_name: string;
|
|
1405
|
+
id: string;
|
|
1408
1406
|
timestamp: number;
|
|
1407
|
+
tool_name: string;
|
|
1408
|
+
tool_call_id: string & z.BRAND<"ToolCallId">;
|
|
1409
1409
|
success: boolean;
|
|
1410
1410
|
observation: string;
|
|
1411
|
-
data?: unknown;
|
|
1412
|
-
error?: string | undefined;
|
|
1413
1411
|
attachments?: {
|
|
1414
1412
|
id: string;
|
|
1415
1413
|
kind: "image";
|
|
@@ -1422,14 +1420,16 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1422
1420
|
fileName?: string | undefined;
|
|
1423
1421
|
label?: string | undefined;
|
|
1424
1422
|
}[] | undefined;
|
|
1423
|
+
error?: string | undefined;
|
|
1424
|
+
data?: unknown;
|
|
1425
1425
|
error_code?: string | undefined;
|
|
1426
1426
|
duration_ms?: number | undefined;
|
|
1427
1427
|
} | {
|
|
1428
|
-
id: string;
|
|
1429
1428
|
type: "final_answer";
|
|
1430
|
-
|
|
1429
|
+
id: string;
|
|
1431
1430
|
timestamp: number;
|
|
1432
1431
|
answer_id: string;
|
|
1432
|
+
completion_reason: "tool_call" | "terminal" | "interrupted";
|
|
1433
1433
|
answer: string;
|
|
1434
1434
|
provider_continuations?: {
|
|
1435
1435
|
kind: string;
|
|
@@ -1491,30 +1491,30 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1491
1491
|
})[] | undefined;
|
|
1492
1492
|
meta?: Record<string, unknown> | undefined;
|
|
1493
1493
|
} | {
|
|
1494
|
-
id: string;
|
|
1495
1494
|
type: "error";
|
|
1496
|
-
|
|
1495
|
+
id: string;
|
|
1497
1496
|
timestamp: number;
|
|
1497
|
+
error: string;
|
|
1498
1498
|
error_code?: string | undefined;
|
|
1499
1499
|
details?: Record<string, unknown> | undefined;
|
|
1500
1500
|
retryable?: boolean | undefined;
|
|
1501
1501
|
} | {
|
|
1502
|
-
id: string;
|
|
1503
1502
|
type: "stream_chunk";
|
|
1504
|
-
|
|
1503
|
+
id: string;
|
|
1505
1504
|
timestamp: number;
|
|
1505
|
+
content: string;
|
|
1506
1506
|
answer_id: string;
|
|
1507
1507
|
seq: number;
|
|
1508
1508
|
is_last?: boolean | undefined;
|
|
1509
1509
|
} | {
|
|
1510
|
-
id: string;
|
|
1511
1510
|
type: "stream_reset";
|
|
1511
|
+
id: string;
|
|
1512
1512
|
timestamp: number;
|
|
1513
1513
|
answer_id?: string | undefined;
|
|
1514
1514
|
thought_message_ids?: string[] | undefined;
|
|
1515
1515
|
} | {
|
|
1516
|
-
id: string;
|
|
1517
1516
|
type: "provider_continuation";
|
|
1517
|
+
id: string;
|
|
1518
1518
|
timestamp: number;
|
|
1519
1519
|
continuations: {
|
|
1520
1520
|
kind: string;
|
|
@@ -1529,25 +1529,26 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1529
1529
|
payload: SerializableJsonValue;
|
|
1530
1530
|
}[];
|
|
1531
1531
|
}, {
|
|
1532
|
-
id: string;
|
|
1533
1532
|
type: "thought";
|
|
1534
|
-
|
|
1533
|
+
id: string;
|
|
1535
1534
|
timestamp: number;
|
|
1535
|
+
content: string;
|
|
1536
1536
|
is_complete: boolean;
|
|
1537
1537
|
thought_message_id?: string | undefined;
|
|
1538
1538
|
delta?: string | undefined;
|
|
1539
1539
|
meta?: Record<string, unknown> | undefined;
|
|
1540
1540
|
} | {
|
|
1541
|
+
type: "tool_call_decision";
|
|
1541
1542
|
id: string;
|
|
1543
|
+
timestamp: number;
|
|
1542
1544
|
status: "error" | "loading" | "success";
|
|
1543
|
-
type: "tool_call_decision";
|
|
1544
|
-
tool_call_id: string;
|
|
1545
1545
|
tool_name: string;
|
|
1546
|
-
|
|
1547
|
-
phase: "
|
|
1546
|
+
tool_call_id: string;
|
|
1547
|
+
phase: "start" | "update" | "complete" | "error";
|
|
1548
1548
|
tool_args: Record<string, unknown>;
|
|
1549
1549
|
tool_calls?: unknown[] | undefined;
|
|
1550
1550
|
payload?: {
|
|
1551
|
+
args?: Record<string, unknown> | undefined;
|
|
1551
1552
|
tool_calls?: unknown[] | undefined;
|
|
1552
1553
|
provider_continuations?: {
|
|
1553
1554
|
kind: string;
|
|
@@ -1607,31 +1608,28 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1607
1608
|
payload: SerializableJsonValue;
|
|
1608
1609
|
}[] | undefined;
|
|
1609
1610
|
})[] | undefined;
|
|
1610
|
-
args?: Record<string, unknown> | undefined;
|
|
1611
1611
|
} | undefined;
|
|
1612
1612
|
meta?: Record<string, unknown> | undefined;
|
|
1613
1613
|
} | {
|
|
1614
|
+
type: "tool_process";
|
|
1614
1615
|
id: string;
|
|
1616
|
+
timestamp: number;
|
|
1615
1617
|
status: "error" | "loading" | "success";
|
|
1616
|
-
type: "tool_process";
|
|
1617
|
-
tool_call_id: string;
|
|
1618
1618
|
tool_name: string;
|
|
1619
|
-
|
|
1620
|
-
phase: "
|
|
1619
|
+
tool_call_id: string;
|
|
1620
|
+
phase: "start" | "update" | "complete" | "error";
|
|
1621
1621
|
tool_args: Record<string, unknown>;
|
|
1622
1622
|
tool_calls?: unknown[] | undefined;
|
|
1623
1623
|
payload?: Record<string, unknown> | undefined;
|
|
1624
1624
|
meta?: Record<string, unknown> | undefined;
|
|
1625
1625
|
} | {
|
|
1626
|
-
id: string;
|
|
1627
1626
|
type: "observation";
|
|
1628
|
-
|
|
1629
|
-
tool_name: string;
|
|
1627
|
+
id: string;
|
|
1630
1628
|
timestamp: number;
|
|
1629
|
+
tool_name: string;
|
|
1630
|
+
tool_call_id: string;
|
|
1631
1631
|
success: boolean;
|
|
1632
1632
|
observation: string;
|
|
1633
|
-
data?: unknown;
|
|
1634
|
-
error?: string | undefined;
|
|
1635
1633
|
attachments?: {
|
|
1636
1634
|
id: string;
|
|
1637
1635
|
kind: "image";
|
|
@@ -1644,14 +1642,16 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1644
1642
|
fileName?: string | undefined;
|
|
1645
1643
|
label?: string | undefined;
|
|
1646
1644
|
}[] | undefined;
|
|
1645
|
+
error?: string | undefined;
|
|
1646
|
+
data?: unknown;
|
|
1647
1647
|
error_code?: string | undefined;
|
|
1648
1648
|
duration_ms?: number | undefined;
|
|
1649
1649
|
} | {
|
|
1650
|
-
id: string;
|
|
1651
1650
|
type: "final_answer";
|
|
1652
|
-
|
|
1651
|
+
id: string;
|
|
1653
1652
|
timestamp: number;
|
|
1654
1653
|
answer_id: string;
|
|
1654
|
+
completion_reason: "tool_call" | "terminal" | "interrupted";
|
|
1655
1655
|
answer: string;
|
|
1656
1656
|
provider_continuations?: {
|
|
1657
1657
|
kind: string;
|
|
@@ -1713,30 +1713,30 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
|
|
|
1713
1713
|
})[] | undefined;
|
|
1714
1714
|
meta?: Record<string, unknown> | undefined;
|
|
1715
1715
|
} | {
|
|
1716
|
-
id: string;
|
|
1717
1716
|
type: "error";
|
|
1718
|
-
|
|
1717
|
+
id: string;
|
|
1719
1718
|
timestamp: number;
|
|
1719
|
+
error: string;
|
|
1720
1720
|
error_code?: string | undefined;
|
|
1721
1721
|
details?: Record<string, unknown> | undefined;
|
|
1722
1722
|
retryable?: boolean | undefined;
|
|
1723
1723
|
} | {
|
|
1724
|
-
id: string;
|
|
1725
1724
|
type: "stream_chunk";
|
|
1726
|
-
|
|
1725
|
+
id: string;
|
|
1727
1726
|
timestamp: number;
|
|
1727
|
+
content: string;
|
|
1728
1728
|
answer_id: string;
|
|
1729
1729
|
seq: number;
|
|
1730
1730
|
is_last?: boolean | undefined;
|
|
1731
1731
|
} | {
|
|
1732
|
-
id: string;
|
|
1733
1732
|
type: "stream_reset";
|
|
1733
|
+
id: string;
|
|
1734
1734
|
timestamp: number;
|
|
1735
1735
|
answer_id?: string | undefined;
|
|
1736
1736
|
thought_message_ids?: string[] | undefined;
|
|
1737
1737
|
} | {
|
|
1738
|
-
id: string;
|
|
1739
1738
|
type: "provider_continuation";
|
|
1739
|
+
id: string;
|
|
1740
1740
|
timestamp: number;
|
|
1741
1741
|
continuations: {
|
|
1742
1742
|
kind: string;
|