@tangle-network/agent-interface 0.44.0 → 0.46.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.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-candidate-code-schema.d.ts +1 -0
  3. package/dist/agent-candidate-execution-plan-schema.d.ts +8 -6
  4. package/dist/agent-candidate-profile-schema.d.ts +3 -2
  5. package/dist/agent-candidate-promotion-schema.d.ts +59 -42
  6. package/dist/agent-candidate-receipt-schema.d.ts +5 -4
  7. package/dist/agent-candidate-schema-common.js +1 -1
  8. package/dist/agent-candidate-schema.d.ts +4 -2
  9. package/dist/agent-execution-preparation.d.ts +27 -26
  10. package/dist/agent-profile.d.ts +10 -3
  11. package/dist/agent-profile.js +45 -22
  12. package/dist/backend-message.d.ts +14 -0
  13. package/dist/backend-message.js +1 -0
  14. package/dist/contract-limits.d.ts +26 -0
  15. package/dist/contract-limits.js +175 -0
  16. package/dist/environment-exact-process.d.ts +161 -0
  17. package/dist/environment-exact-process.js +1 -0
  18. package/dist/environment-profile-capabilities.d.ts +26 -0
  19. package/dist/environment-profile-capabilities.js +34 -0
  20. package/dist/environment-provider.d.ts +3 -730
  21. package/dist/environment-provider.js +3 -245
  22. package/dist/environment-requests.d.ts +70 -0
  23. package/dist/environment-requests.js +1 -0
  24. package/dist/environment-runtime.d.ts +834 -0
  25. package/dist/environment-runtime.js +228 -0
  26. package/dist/execution-types.d.ts +47 -0
  27. package/dist/execution-types.js +1 -0
  28. package/dist/harness-capabilities.js +5 -0
  29. package/dist/harness.d.ts +6 -1
  30. package/dist/harness.js +1 -0
  31. package/dist/host-services.d.ts +91 -0
  32. package/dist/host-services.js +1 -0
  33. package/dist/index.d.ts +10 -617
  34. package/dist/index.js +10 -125
  35. package/dist/interaction-answer-validation.d.ts +13 -0
  36. package/dist/interaction-answer-validation.js +149 -0
  37. package/dist/interaction-data.d.ts +22 -0
  38. package/dist/interaction-data.js +46 -0
  39. package/dist/interaction-envelope.d.ts +258 -0
  40. package/dist/interaction-envelope.js +245 -0
  41. package/dist/interaction-fields.d.ts +130 -0
  42. package/dist/interaction-fields.js +227 -0
  43. package/dist/interaction-permissions.d.ts +28 -0
  44. package/dist/interaction-permissions.js +57 -0
  45. package/dist/interaction-resolution-validation.d.ts +9 -0
  46. package/dist/interaction-resolution-validation.js +50 -0
  47. package/dist/interaction-response-validation.d.ts +17 -0
  48. package/dist/interaction-response-validation.js +102 -0
  49. package/dist/interaction.d.ts +6 -397
  50. package/dist/interaction.js +6 -603
  51. package/dist/mcp.d.ts +38 -0
  52. package/dist/mcp.js +1 -0
  53. package/dist/parts.d.ts +104 -0
  54. package/dist/parts.js +55 -0
  55. package/dist/portable-context-base.d.ts +82 -0
  56. package/dist/portable-context-base.js +63 -0
  57. package/dist/portable-context-continuation.d.ts +168 -0
  58. package/dist/portable-context-continuation.js +194 -0
  59. package/dist/portable-context-plan-request.d.ts +86 -0
  60. package/dist/portable-context-plan-request.js +102 -0
  61. package/dist/portable-context-plan.d.ts +229 -0
  62. package/dist/portable-context-plan.js +241 -0
  63. package/dist/portable-context-shared.d.ts +36 -0
  64. package/dist/portable-context-shared.js +46 -0
  65. package/dist/portable-context-transfer.d.ts +319 -0
  66. package/dist/portable-context-transfer.js +206 -0
  67. package/dist/portable-context.d.ts +5 -753
  68. package/dist/portable-context.js +5 -754
  69. package/dist/profile-diff.js +56 -47
  70. package/dist/profile-schema.d.ts +1 -0
  71. package/dist/provider-adapter.d.ts +45 -0
  72. package/dist/provider-adapter.js +1 -0
  73. package/dist/provider-config.d.ts +58 -0
  74. package/dist/provider-config.js +42 -0
  75. package/dist/runtime-control.d.ts +87 -10
  76. package/dist/runtime-control.js +159 -38
  77. package/dist/stream-events.d.ts +55 -0
  78. package/dist/stream-events.js +1 -0
  79. package/dist/workspace-branching-shared.d.ts +7 -0
  80. package/dist/workspace-branching-shared.js +20 -0
  81. package/dist/workspace-branching.d.ts +4 -254
  82. package/dist/workspace-branching.js +4 -400
  83. package/dist/workspace-checkpoint.d.ts +99 -0
  84. package/dist/workspace-checkpoint.js +169 -0
  85. package/dist/workspace-cleanup.d.ts +85 -0
  86. package/dist/workspace-cleanup.js +156 -0
  87. package/dist/workspace-confidentiality.d.ts +59 -0
  88. package/dist/workspace-confidentiality.js +123 -0
  89. package/dist/workspace-fork.d.ts +182 -0
  90. package/dist/workspace-fork.js +267 -0
  91. package/package.json +1 -1
@@ -0,0 +1,228 @@
1
+ import { z } from "zod";
2
+ import { InteractionCapabilitiesSchema } from "./interaction.js";
3
+ import { ContextTransferReceiptSchema, ContextTransferRequestSchema, NativeContextContinuationAcknowledgementSchema, NativeContextContinuationRequestSchema, nativeContextContinuationAcknowledgementMatches } from "./portable-context.js";
4
+ import { AgentExactRunControlRefSchema, AgentRunControlRefSchema, CanonicalStreamEventSchema } from "./runtime-control.js";
5
+ import { AgentProfileCapabilitiesSchema } from "./environment-profile-capabilities.js";
6
+ import { boundedIdentifierSchema, boundedJsonRecordSchema, boundedJsonSchema, boundedStringSchema, CONTRACT_MAX_ARRAY_LENGTH } from "./contract-limits.js";
7
+ import { InputPartSchema } from "./portable-context-shared.js";
8
+ export const AgentTurnInputSchema = z.strictObject({
9
+ prompt: boundedStringSchema.optional(),
10
+ parts: z.array(InputPartSchema).max(CONTRACT_MAX_ARRAY_LENGTH).optional(),
11
+ sessionId: boundedIdentifierSchema.optional(),
12
+ model: boundedIdentifierSchema.optional(),
13
+ timeoutMs: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
14
+ executionId: boundedIdentifierSchema.optional(),
15
+ lastEventId: boundedIdentifierSchema.optional(),
16
+ turnId: boundedIdentifierSchema.optional(),
17
+ detach: z.boolean().optional(),
18
+ controlRef: AgentRunControlRefSchema.optional(),
19
+ contextTransfer: ContextTransferRequestSchema.optional(),
20
+ nativeContinuation: NativeContextContinuationRequestSchema.optional(),
21
+ context: boundedJsonRecordSchema.optional(),
22
+ signal: z.custom().optional(),
23
+ providerOptions: boundedJsonRecordSchema.optional(),
24
+ });
25
+ const TokenUsageSchema = z.strictObject({
26
+ inputTokens: z.number().int().nonnegative(),
27
+ outputTokens: z.number().int().nonnegative(),
28
+ totalTokens: z.number().int().nonnegative().optional(),
29
+ cacheReadInputTokens: z.number().int().nonnegative().optional(),
30
+ cacheCreationInputTokens: z.number().int().nonnegative().optional(),
31
+ reasoningTokens: z.number().int().nonnegative().optional(),
32
+ cost: z.number().finite().nonnegative().optional(),
33
+ });
34
+ const AgentEnvironmentEventSchema = z.strictObject({
35
+ type: boundedIdentifierSchema,
36
+ data: boundedJsonRecordSchema,
37
+ id: boundedIdentifierSchema.optional(),
38
+ normalized: CanonicalStreamEventSchema.optional(),
39
+ usage: TokenUsageSchema.optional(),
40
+ providerEvent: boundedJsonSchema.optional(),
41
+ });
42
+ /** Runtime validator for a provider turn returned from durable continuation. */
43
+ export const AgentTurnResultSchema = z.strictObject({
44
+ text: boundedStringSchema,
45
+ success: z.boolean(),
46
+ error: boundedStringSchema.optional(),
47
+ sessionId: boundedIdentifierSchema.optional(),
48
+ usage: TokenUsageSchema.optional(),
49
+ metadata: boundedJsonRecordSchema.optional(),
50
+ events: z.array(AgentEnvironmentEventSchema).max(CONTRACT_MAX_ARRAY_LENGTH).optional(),
51
+ contextTransferReceipt: ContextTransferReceiptSchema.optional(),
52
+ });
53
+ /** Durable provider result for one digest-bound native continuation. */
54
+ export const AgentNativeContextContinuationResultSchema = z.union([
55
+ z
56
+ .strictObject({
57
+ acknowledgement: NativeContextContinuationAcknowledgementSchema.and(z.object({ status: z.enum(["accepted", "replayed"]) })),
58
+ result: AgentTurnResultSchema,
59
+ controlRef: AgentExactRunControlRefSchema,
60
+ })
61
+ .superRefine((outcome, refinement) => {
62
+ if (outcome.result.contextTransferReceipt !== undefined) {
63
+ refinement.addIssue({
64
+ code: "custom",
65
+ path: ["result", "contextTransferReceipt"],
66
+ message: "native continuation cannot return a context transfer receipt",
67
+ });
68
+ }
69
+ }),
70
+ z
71
+ .strictObject({
72
+ acknowledgement: NativeContextContinuationAcknowledgementSchema.and(z.object({
73
+ status: z.enum([
74
+ "conflict",
75
+ "boundary_mismatch",
76
+ "unverified",
77
+ "unknown_session",
78
+ "transport_failure",
79
+ ]),
80
+ })),
81
+ })
82
+ .superRefine((outcome, refinement) => {
83
+ if (outcome.acknowledgement.status === "transport_failure" &&
84
+ outcome.acknowledgement.retryable !== true) {
85
+ refinement.addIssue({
86
+ code: "custom",
87
+ path: ["acknowledgement", "retryable"],
88
+ message: "a durable native continuation transport failure must be retryable",
89
+ });
90
+ }
91
+ }),
92
+ ]);
93
+ /** Cross-check a successful native continuation against its retained session. */
94
+ export function agentNativeContextContinuationResultMatchesRequest(request, outcome) {
95
+ const parsedRequest = NativeContextContinuationRequestSchema.safeParse(request);
96
+ const parsedOutcome = AgentNativeContextContinuationResultSchema.safeParse(outcome);
97
+ if (!parsedRequest.success || !parsedOutcome.success)
98
+ return false;
99
+ const exactOutcome = parsedOutcome.data;
100
+ if (exactOutcome.acknowledgement.status !== "accepted" &&
101
+ exactOutcome.acknowledgement.status !== "replayed")
102
+ return false;
103
+ if (!("result" in exactOutcome) || !("controlRef" in exactOutcome))
104
+ return false;
105
+ if (!nativeContextContinuationAcknowledgementMatches(parsedRequest.data, exactOutcome.acknowledgement))
106
+ return false;
107
+ const current = exactOutcome.controlRef;
108
+ return (current.provider === request.run.provider &&
109
+ current.environmentId === request.run.environmentId &&
110
+ current.sessionId === request.run.sessionId &&
111
+ (exactOutcome.result.sessionId === undefined ||
112
+ exactOutcome.result.sessionId === current.sessionId));
113
+ }
114
+ /** Strict runtime validator for provider capability negotiation. */
115
+ export const AgentEnvironmentCapabilitiesSchema = z
116
+ .strictObject({
117
+ profile: AgentProfileCapabilitiesSchema,
118
+ streaming: z.strictObject({
119
+ live: z.boolean(),
120
+ replay: z.boolean(),
121
+ detach: z.boolean(),
122
+ turnIdempotency: z.boolean(),
123
+ }),
124
+ sessions: z.strictObject({
125
+ continue: z.boolean(),
126
+ list: z.boolean(),
127
+ messages: z.boolean(),
128
+ }),
129
+ retainedControl: z
130
+ .strictObject({
131
+ exactRunIdentity: z.boolean(),
132
+ resultIdentity: z.boolean(),
133
+ eventIdentity: z.boolean(),
134
+ cancellationIdempotency: z.boolean(),
135
+ })
136
+ .optional(),
137
+ nativeContinuation: z
138
+ .strictObject({
139
+ atomicBoundary: z.boolean(),
140
+ requestIdempotency: z.boolean(),
141
+ })
142
+ .optional(),
143
+ interactions: InteractionCapabilitiesSchema.optional(),
144
+ workspace: z.strictObject({
145
+ read: z.boolean(),
146
+ write: z.boolean(),
147
+ exec: z.boolean(),
148
+ git: z.boolean(),
149
+ upload: z.boolean(),
150
+ download: z.boolean(),
151
+ }),
152
+ branching: z.strictObject({
153
+ checkpoint: z.boolean(),
154
+ fork: z.boolean(),
155
+ retrySafe: z.boolean().optional(),
156
+ lookup: z.boolean().optional(),
157
+ cleanup: z.boolean().optional(),
158
+ }),
159
+ placement: z.boolean(),
160
+ usage: z.boolean(),
161
+ confidential: z.boolean(),
162
+ exactProcess: z
163
+ .strictObject({
164
+ egress: z
165
+ .array(z.enum(["blocked", "strict"]))
166
+ .min(1)
167
+ .max(CONTRACT_MAX_ARRAY_LENGTH),
168
+ })
169
+ .optional(),
170
+ })
171
+ .superRefine((capabilities, refinement) => {
172
+ if (capabilities.retainedControl !== undefined &&
173
+ (!capabilities.retainedControl.exactRunIdentity ||
174
+ !capabilities.retainedControl.resultIdentity ||
175
+ !capabilities.retainedControl.eventIdentity ||
176
+ !capabilities.retainedControl.cancellationIdempotency ||
177
+ !capabilities.streaming.replay ||
178
+ !capabilities.streaming.detach ||
179
+ !capabilities.streaming.turnIdempotency ||
180
+ !capabilities.sessions.continue)) {
181
+ refinement.addIssue({
182
+ code: "custom",
183
+ path: ["retainedControl"],
184
+ message: "retained control requires exact run, result, event, cancellation, replay, detach, turn, and session identity together",
185
+ });
186
+ }
187
+ if (capabilities.nativeContinuation !== undefined &&
188
+ (!capabilities.nativeContinuation.atomicBoundary ||
189
+ !capabilities.nativeContinuation.requestIdempotency ||
190
+ !capabilities.sessions.continue)) {
191
+ refinement.addIssue({
192
+ code: "custom",
193
+ path: ["nativeContinuation"],
194
+ message: "native continuation requires session continuation, atomic boundary admission, and request idempotency together",
195
+ });
196
+ }
197
+ const durableBranching = [
198
+ capabilities.branching.retrySafe ?? false,
199
+ capabilities.branching.lookup ?? false,
200
+ capabilities.branching.cleanup ?? false,
201
+ ];
202
+ if (durableBranching.some(Boolean) &&
203
+ (!durableBranching.every(Boolean) ||
204
+ !capabilities.branching.checkpoint ||
205
+ !capabilities.branching.fork)) {
206
+ refinement.addIssue({
207
+ code: "custom",
208
+ path: ["branching"],
209
+ message: "retry-safe branching requires checkpoint, fork, lookup, and cleanup together",
210
+ });
211
+ }
212
+ const egress = capabilities.exactProcess?.egress;
213
+ if (egress && new Set(egress).size !== egress.length) {
214
+ refinement.addIssue({
215
+ code: "custom",
216
+ path: ["exactProcess", "egress"],
217
+ message: "exact process egress modes must be unique",
218
+ });
219
+ }
220
+ const extensions = capabilities.profile.extensions;
221
+ if (extensions && new Set(extensions).size !== extensions.length) {
222
+ refinement.addIssue({
223
+ code: "custom",
224
+ path: ["profile", "extensions"],
225
+ message: "profile extension namespaces must be unique",
226
+ });
227
+ }
228
+ });
@@ -0,0 +1,47 @@
1
+ import type { AgentExecutionOutcome, PlanContinuation } from "./plan.js";
2
+ import type { InputPart } from "./parts.js";
3
+ import type { ProviderConfig } from "./provider-config.js";
4
+ export type ToolInvocation = {
5
+ toolName: string;
6
+ input: unknown;
7
+ result?: unknown;
8
+ isError?: boolean;
9
+ };
10
+ export type TokenUsage = {
11
+ inputTokens: number;
12
+ outputTokens: number;
13
+ totalTokens?: number;
14
+ cacheReadInputTokens?: number;
15
+ cacheCreationInputTokens?: number;
16
+ reasoningTokens?: number;
17
+ cost?: number;
18
+ };
19
+ export type ExecutionTiming = {
20
+ startedAt: number;
21
+ completedAt: number;
22
+ durationMs: number;
23
+ };
24
+ export type AgentExecutionInput = {
25
+ message?: string;
26
+ parts?: InputPart[];
27
+ systemPrompt: string;
28
+ userId?: string;
29
+ traceId?: string;
30
+ sessionId?: string;
31
+ workspaceRoot?: string;
32
+ abortSignal?: AbortSignal;
33
+ headers?: Record<string, string>;
34
+ model?: ProviderConfig["model"];
35
+ turnId?: string;
36
+ planContinuation?: PlanContinuation;
37
+ };
38
+ export type AgentExecutionResult = {
39
+ outcome: AgentExecutionOutcome;
40
+ text: string;
41
+ toolInvocations: ToolInvocation[];
42
+ reasoning?: string[];
43
+ sessionId?: string;
44
+ metadata?: Record<string, unknown>;
45
+ tokenUsage?: TokenUsage;
46
+ timing?: ExecutionTiming;
47
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -125,6 +125,9 @@ export function snapHarnessToModel(harness, modelId) {
125
125
  * and silently replaced with the default rather than rejected — so the set must not overstate.
126
126
  * - pi: `--thinking` accepts `off|minimal|low|medium|high|xhigh|max`; canonical `none` maps to
127
127
  * `off` and `ultracode` to `max`.
128
+ * - prime: the prime fork of the pi line accepts the same `--thinking` set
129
+ * (`off|minimal|low|medium|high|xhigh|max`); canonical `none` maps to `off` and `ultracode` to
130
+ * `max`.
128
131
  * - openclaw: `--thinking` accepts `off|minimal|low|medium|high|xhigh|max` (and `adaptive`, which
129
132
  * defers the choice rather than naming a rung); canonical `none` maps to `off` and `ultracode`
130
133
  * to `max`.
@@ -135,6 +138,7 @@ const harnessReasoningEffortsOverride = {
135
138
  codex: ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"],
136
139
  "claude-code": ["low", "medium", "high", "xhigh", "ultracode"],
137
140
  pi: ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"],
141
+ prime: ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"],
138
142
  openclaw: [
139
143
  "none",
140
144
  "minimal",
@@ -249,6 +253,7 @@ export function harnessHonorsSelectors(harness) {
249
253
  const harnessSystemPromptControls = {
250
254
  "claude-code": { replace: true, append: true },
251
255
  pi: { replace: true, append: true },
256
+ prime: { replace: true, append: true },
252
257
  codex: { replace: true, append: false },
253
258
  gemini: { replace: true, append: false },
254
259
  opencode: { replace: false, append: true },
package/dist/harness.d.ts CHANGED
@@ -16,8 +16,12 @@ import { z } from "zod";
16
16
  *
17
17
  * `forge` (tailcallhq/forgecode) and `cursor` (cursor-agent) are multi-provider CLI harnesses with
18
18
  * no vendor lock, so they carry no entry in the capability tables and resolve as router-backed.
19
+ *
20
+ * `prime` (PrimeIntellect-ai/prime-agent) is the prime fork of the pi line — the RLM
21
+ * IPython-kernel harness. It is a distinct harness from `pi`: the fork's wire protocol has
22
+ * diverged (its daemon rejects pi-line clients), so the two are not interchangeable at run time.
19
23
  */
20
- export type HarnessType = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "forge" | "cursor" | "acp" | "cli-base";
24
+ export type HarnessType = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "prime" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "forge" | "cursor" | "acp" | "cli-base";
21
25
  /** Runtime validator for {@link HarnessType}. Kept in lockstep with the type by the drift guard below. */
22
26
  export declare const harnessTypeSchema: z.ZodEnum<{
23
27
  "claude-code": "claude-code";
@@ -26,6 +30,7 @@ export declare const harnessTypeSchema: z.ZodEnum<{
26
30
  opencode: "opencode";
27
31
  "kimi-code": "kimi-code";
28
32
  pi: "pi";
33
+ prime: "prime";
29
34
  gemini: "gemini";
30
35
  hermes: "hermes";
31
36
  openclaw: "openclaw";
package/dist/harness.js CHANGED
@@ -7,6 +7,7 @@ export const harnessTypeSchema = z.enum([
7
7
  "opencode",
8
8
  "kimi-code",
9
9
  "pi",
10
+ "prime",
10
11
  "gemini",
11
12
  "hermes",
12
13
  "openclaw",
@@ -0,0 +1,91 @@
1
+ import type { BackendMessage } from "./backend-message.js";
2
+ import type { AgentExecutionResult } from "./execution-types.js";
3
+ import type { Part } from "./parts.js";
4
+ import type { SdkPlanHost } from "./plan.js";
5
+ import type { ProviderConfig } from "./provider-config.js";
6
+ export type MemoryEntry = {
7
+ id: string;
8
+ type: "summary" | "fact" | "note";
9
+ content: string;
10
+ createdAt: string;
11
+ };
12
+ export type MemoryEntryInput = Omit<MemoryEntry, "id" | "createdAt">;
13
+ export interface SdkMemoryHost {
14
+ list(sessionId: string): Promise<MemoryEntry[]>;
15
+ remember(sessionId: string, entry: MemoryEntryInput): Promise<void>;
16
+ format(entries: MemoryEntry[]): string;
17
+ }
18
+ export type ToolExecutionContext = {
19
+ workspaceRoot?: string;
20
+ };
21
+ export type ToolDefinition = {
22
+ name: string;
23
+ description: string;
24
+ instruction?: string;
25
+ inputSchema: unknown;
26
+ inputSchemaJson: Record<string, unknown>;
27
+ outputSchema?: unknown;
28
+ outputSchemaJson?: Record<string, unknown>;
29
+ handler: (input: unknown, context: ToolExecutionContext) => Promise<unknown>;
30
+ };
31
+ export interface SdkToolHost {
32
+ buildPromptBlock(): string;
33
+ registerInstruction?(instruction: string, key?: string): void;
34
+ clear?(): void;
35
+ getRegisteredTools(): ToolDefinition[];
36
+ }
37
+ export interface SdkRecorder {
38
+ recordUserMessage(parts: BackendMessage["parts"]): Promise<void>;
39
+ appendAssistantParts(parts: BackendMessage["parts"]): Promise<void>;
40
+ setSessionId(sessionId?: string): Promise<void>;
41
+ recordAssistantPartUpdate?(part: Part, delta?: string): Promise<void>;
42
+ setTurnId?(turnId: string): void;
43
+ markTurnCompleted?(payload?: {
44
+ result?: Record<string, unknown>;
45
+ [extra: string]: unknown;
46
+ }): Promise<void>;
47
+ markTurnInterrupted?(payload?: {
48
+ reason?: string;
49
+ [extra: string]: unknown;
50
+ }): Promise<void>;
51
+ findCompletedTurn?(turnId: string): Promise<AgentExecutionResult | null>;
52
+ }
53
+ export type TraceEventInput = {
54
+ type: "message.part.updated";
55
+ part: Part;
56
+ delta?: string;
57
+ } | {
58
+ type: "message.updated";
59
+ text?: string;
60
+ finalText?: string;
61
+ tokenUsage?: Record<string, unknown>;
62
+ timing?: Record<string, unknown>;
63
+ toolInvocations?: unknown[];
64
+ metadata?: Record<string, unknown>;
65
+ } | {
66
+ type: "error";
67
+ category: "runtime" | "syntax" | "type" | "network" | "timeout" | "unknown";
68
+ message: string;
69
+ stack?: string;
70
+ code?: string;
71
+ source?: string;
72
+ } | {
73
+ type: "custom";
74
+ name: string;
75
+ data: Record<string, unknown>;
76
+ };
77
+ export interface SdkTraceContext {
78
+ addEvent(event: TraceEventInput): void;
79
+ addSignal(signal: string, metadata?: Record<string, unknown>): void;
80
+ complete(metadata?: Record<string, unknown>): void;
81
+ fail(error: string | Error, metadata?: Record<string, unknown>): void;
82
+ trackSubAgent?(childSessionId: string, agentType?: string): void;
83
+ }
84
+ export type SdkHostServices = {
85
+ memoryHost: SdkMemoryHost;
86
+ toolHost: SdkToolHost;
87
+ planHost: SdkPlanHost;
88
+ recorder: SdkRecorder;
89
+ providerConfig: ProviderConfig;
90
+ traceContext?: SdkTraceContext;
91
+ };
@@ -0,0 +1 @@
1
+ export {};