@tangle-network/agent-interface 3.1.2 → 4.0.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.
@@ -5,7 +5,8 @@ import { PortableConversationContextSchema } from "./portable-context-base.js";
5
5
  export const PortableContextDestinationSchema = z.strictObject({
6
6
  runner: idSchema,
7
7
  provider: idSchema,
8
- environmentId: idSchema,
8
+ /** Omitted when the provider allocates the environment after acceptance. */
9
+ environmentId: idSchema.optional(),
9
10
  sessionId: idSchema,
10
11
  runId: idSchema,
11
12
  executionId: idSchema,
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod";
2
+ import type { AgentProfile } from "./agent-profile.js";
3
+ import { type ResourceRequest, type WorkspaceRequest } from "./environment-requests.js";
2
4
  import type { Sha256Digest } from "./agent-candidate.js";
3
5
  import { type PortableContextPlan } from "./portable-context-plan.js";
4
6
  export declare const ContextPlanAcceptanceSchema: z.ZodObject<{
@@ -15,6 +17,9 @@ export interface ContextTransferRequestMaterial {
15
17
  operationId: string;
16
18
  plan: PortableContextPlan;
17
19
  acceptance: ContextPlanAcceptance;
20
+ profile?: AgentProfile;
21
+ workspace?: WorkspaceRequest;
22
+ resources?: ResourceRequest;
18
23
  }
19
24
  export declare function contextTransferRequestDigest(request: ContextTransferRequestMaterial): Sha256Digest;
20
25
  export declare const ContextTransferRequestSchema: z.ZodObject<{
@@ -60,7 +65,7 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
60
65
  destination: z.ZodObject<{
61
66
  runner: z.ZodString;
62
67
  provider: z.ZodString;
63
- environmentId: z.ZodString;
68
+ environmentId: z.ZodOptional<z.ZodString>;
64
69
  sessionId: z.ZodString;
65
70
  runId: z.ZodString;
66
71
  executionId: z.ZodString;
@@ -149,6 +154,268 @@ export declare const ContextTransferRequestSchema: z.ZodObject<{
149
154
  user: "user";
150
155
  }>;
151
156
  }, z.core.$strict>;
157
+ profile: z.ZodOptional<z.ZodObject<{
158
+ name: z.ZodOptional<z.ZodString>;
159
+ description: z.ZodOptional<z.ZodString>;
160
+ version: z.ZodOptional<z.ZodString>;
161
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
162
+ prompt: z.ZodOptional<z.ZodObject<{
163
+ systemPrompt: z.ZodOptional<z.ZodString>;
164
+ appendSystemPrompt: z.ZodOptional<z.ZodString>;
165
+ instructions: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ }, z.core.$strict>>;
167
+ model: z.ZodOptional<z.ZodObject<{
168
+ default: z.ZodOptional<z.ZodString>;
169
+ small: z.ZodOptional<z.ZodString>;
170
+ provider: z.ZodOptional<z.ZodString>;
171
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
172
+ high: "high";
173
+ low: "low";
174
+ medium: "medium";
175
+ minimal: "minimal";
176
+ none: "none";
177
+ ultracode: "ultracode";
178
+ xhigh: "xhigh";
179
+ }>>;
180
+ maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
181
+ maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
182
+ maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
183
+ metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
184
+ }, z.core.$strict>>;
185
+ harness: z.ZodOptional<z.ZodEnum<{
186
+ acp: "acp";
187
+ amp: "amp";
188
+ "claude-code": "claude-code";
189
+ "cli-base": "cli-base";
190
+ codex: "codex";
191
+ cursor: "cursor";
192
+ "factory-droids": "factory-droids";
193
+ forge: "forge";
194
+ gemini: "gemini";
195
+ hermes: "hermes";
196
+ "kimi-code": "kimi-code";
197
+ nanoclaw: "nanoclaw";
198
+ openclaw: "openclaw";
199
+ opencode: "opencode";
200
+ pi: "pi";
201
+ prime: "prime";
202
+ }>>;
203
+ seats: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
+ harness: z.ZodEnum<{
205
+ acp: "acp";
206
+ amp: "amp";
207
+ "claude-code": "claude-code";
208
+ "cli-base": "cli-base";
209
+ codex: "codex";
210
+ cursor: "cursor";
211
+ "factory-droids": "factory-droids";
212
+ forge: "forge";
213
+ gemini: "gemini";
214
+ hermes: "hermes";
215
+ "kimi-code": "kimi-code";
216
+ nanoclaw: "nanoclaw";
217
+ openclaw: "openclaw";
218
+ opencode: "opencode";
219
+ pi: "pi";
220
+ prime: "prime";
221
+ }>;
222
+ provider: z.ZodString;
223
+ model: z.ZodString;
224
+ selector: z.ZodUnion<readonly [z.ZodObject<{
225
+ kind: z.ZodLiteral<"all-eligible">;
226
+ }, z.core.$strict>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"seat">;
228
+ id: z.ZodString;
229
+ }, z.core.$strict>]>;
230
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
231
+ permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
232
+ }, z.core.$strict>>>;
233
+ permissions: z.ZodOptional<z.ZodType<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown, z.core.$ZodTypeInternals<Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">>, unknown>>>;
234
+ tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
235
+ mcp: z.ZodOptional<z.ZodType<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown, z.core.$ZodTypeInternals<Record<string, import("./agent-profile.js").AgentProfileMcpServer>, unknown>>>;
236
+ connections: z.ZodOptional<z.ZodArray<z.ZodObject<{
237
+ connectionId: z.ZodString;
238
+ capabilities: z.ZodArray<z.ZodString>;
239
+ alias: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strict>>>;
241
+ subagents: z.ZodOptional<z.ZodType<Record<string, {
242
+ description?: string | undefined;
243
+ prompt?: string | undefined;
244
+ model?: string | undefined;
245
+ tools?: Record<string, boolean> | undefined;
246
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
247
+ maxSteps?: number | undefined;
248
+ metadata?: Record<string, unknown> | undefined;
249
+ }>, unknown, z.core.$ZodTypeInternals<Record<string, {
250
+ description?: string | undefined;
251
+ prompt?: string | undefined;
252
+ model?: string | undefined;
253
+ tools?: Record<string, boolean> | undefined;
254
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
255
+ maxSteps?: number | undefined;
256
+ metadata?: Record<string, unknown> | undefined;
257
+ }>, unknown>>>;
258
+ resources: z.ZodOptional<z.ZodObject<{
259
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ path: z.ZodString;
261
+ resource: z.ZodUnion<readonly [z.ZodObject<{
262
+ kind: z.ZodLiteral<"inline">;
263
+ name: z.ZodString;
264
+ content: z.ZodString;
265
+ }, z.core.$strict>, z.ZodObject<{
266
+ kind: z.ZodLiteral<"github">;
267
+ repository: z.ZodOptional<z.ZodString>;
268
+ path: z.ZodString;
269
+ ref: z.ZodOptional<z.ZodString>;
270
+ name: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>]>;
272
+ executable: z.ZodOptional<z.ZodBoolean>;
273
+ }, z.core.$strict>>>;
274
+ tools: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
275
+ kind: z.ZodLiteral<"inline">;
276
+ name: z.ZodString;
277
+ content: z.ZodString;
278
+ }, z.core.$strict>, z.ZodObject<{
279
+ kind: z.ZodLiteral<"github">;
280
+ repository: z.ZodOptional<z.ZodString>;
281
+ path: z.ZodString;
282
+ ref: z.ZodOptional<z.ZodString>;
283
+ name: z.ZodOptional<z.ZodString>;
284
+ }, z.core.$strict>]>>>;
285
+ skills: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
286
+ kind: z.ZodLiteral<"inline">;
287
+ name: z.ZodString;
288
+ content: z.ZodString;
289
+ }, z.core.$strict>, z.ZodObject<{
290
+ kind: z.ZodLiteral<"github">;
291
+ repository: z.ZodOptional<z.ZodString>;
292
+ path: z.ZodString;
293
+ ref: z.ZodOptional<z.ZodString>;
294
+ name: z.ZodOptional<z.ZodString>;
295
+ }, z.core.$strict>]>>>;
296
+ agents: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
297
+ kind: z.ZodLiteral<"inline">;
298
+ name: z.ZodString;
299
+ content: z.ZodString;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ kind: z.ZodLiteral<"github">;
302
+ repository: z.ZodOptional<z.ZodString>;
303
+ path: z.ZodString;
304
+ ref: z.ZodOptional<z.ZodString>;
305
+ name: z.ZodOptional<z.ZodString>;
306
+ }, z.core.$strict>]>>>;
307
+ commands: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
308
+ kind: z.ZodLiteral<"inline">;
309
+ name: z.ZodString;
310
+ content: z.ZodString;
311
+ }, z.core.$strict>, z.ZodObject<{
312
+ kind: z.ZodLiteral<"github">;
313
+ repository: z.ZodOptional<z.ZodString>;
314
+ path: z.ZodString;
315
+ ref: z.ZodOptional<z.ZodString>;
316
+ name: z.ZodOptional<z.ZodString>;
317
+ }, z.core.$strict>]>>>;
318
+ instructions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
319
+ kind: z.ZodLiteral<"inline">;
320
+ name: z.ZodString;
321
+ content: z.ZodString;
322
+ }, z.core.$strict>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"github">;
324
+ repository: z.ZodOptional<z.ZodString>;
325
+ path: z.ZodString;
326
+ ref: z.ZodOptional<z.ZodString>;
327
+ name: z.ZodOptional<z.ZodString>;
328
+ }, z.core.$strict>]>]>>;
329
+ failOnError: z.ZodOptional<z.ZodBoolean>;
330
+ }, z.core.$strict>>;
331
+ hooks: z.ZodOptional<z.ZodType<Record<string, {
332
+ command: string;
333
+ timeoutMs?: number | undefined;
334
+ blocking?: boolean | undefined;
335
+ matcher?: string | undefined;
336
+ env?: Record<string, {
337
+ kind: "public";
338
+ value: string;
339
+ } | {
340
+ kind: "secret-ref";
341
+ key: string;
342
+ format?: "bearer" | "raw" | undefined;
343
+ }> | undefined;
344
+ }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
345
+ command: string;
346
+ timeoutMs?: number | undefined;
347
+ blocking?: boolean | undefined;
348
+ matcher?: string | undefined;
349
+ env?: Record<string, {
350
+ kind: "public";
351
+ value: string;
352
+ } | {
353
+ kind: "secret-ref";
354
+ key: string;
355
+ format?: "bearer" | "raw" | undefined;
356
+ }> | undefined;
357
+ }[]>, unknown>>>;
358
+ modes: z.ZodOptional<z.ZodType<Record<string, {
359
+ description?: string | undefined;
360
+ model?: string | undefined;
361
+ prompt?: string | undefined;
362
+ tools?: Record<string, boolean> | undefined;
363
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
364
+ metadata?: Record<string, unknown> | undefined;
365
+ }>, unknown, z.core.$ZodTypeInternals<Record<string, {
366
+ description?: string | undefined;
367
+ model?: string | undefined;
368
+ prompt?: string | undefined;
369
+ tools?: Record<string, boolean> | undefined;
370
+ permissions?: Record<string, "allow" | "ask" | "deny" | Record<string, "allow" | "ask" | "deny">> | undefined;
371
+ metadata?: Record<string, unknown> | undefined;
372
+ }>, unknown>>>;
373
+ confidential: z.ZodOptional<z.ZodObject<{
374
+ tee: z.ZodOptional<z.ZodString>;
375
+ attestationNonce: z.ZodOptional<z.ZodString>;
376
+ sealed: z.ZodOptional<z.ZodBoolean>;
377
+ attestationRefresh: z.ZodOptional<z.ZodBoolean>;
378
+ }, z.core.$strict>>;
379
+ metadata: z.ZodOptional<z.ZodType<import("./agent-profile.js").AgentProfileMetadata, unknown, z.core.$ZodTypeInternals<import("./agent-profile.js").AgentProfileMetadata, unknown>>>;
380
+ extensions: z.ZodOptional<z.ZodType<Record<string, Record<string, unknown> | undefined>, unknown, z.core.$ZodTypeInternals<Record<string, Record<string, unknown> | undefined>, unknown>>>;
381
+ }, z.core.$strict>>;
382
+ workspace: z.ZodOptional<z.ZodObject<{
383
+ environment: z.ZodOptional<z.ZodString>;
384
+ image: z.ZodOptional<z.ZodString>;
385
+ repoUrl: z.ZodOptional<z.ZodString>;
386
+ gitRef: z.ZodOptional<z.ZodString>;
387
+ cwd: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
388
+ base: z.ZodLiteral<"repository">;
389
+ path: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
390
+ }, z.core.$strict>, z.ZodObject<{
391
+ base: z.ZodLiteral<"host">;
392
+ path: z.ZodString;
393
+ }, z.core.$strict>], "base">>;
394
+ checkpoint: z.ZodOptional<z.ZodObject<{
395
+ checkpointId: z.ZodString;
396
+ provider: z.ZodString;
397
+ source: z.ZodObject<{
398
+ runId: z.ZodString;
399
+ provider: z.ZodString;
400
+ environmentId: z.ZodString;
401
+ sessionId: z.ZodString;
402
+ executionId: z.ZodString;
403
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
404
+ }, z.core.$strict>;
405
+ idempotencyKey: z.ZodString;
406
+ requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
407
+ createdAt: z.ZodISODateTime;
408
+ metadata: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
409
+ }, z.core.$strict>>;
410
+ providerOptions: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
411
+ }, z.core.$strict>>;
412
+ resources: z.ZodOptional<z.ZodObject<{
413
+ cpu: z.ZodOptional<z.ZodNumber>;
414
+ memoryMb: z.ZodOptional<z.ZodNumber>;
415
+ diskMb: z.ZodOptional<z.ZodNumber>;
416
+ gpu: z.ZodOptional<z.ZodString>;
417
+ providerOptions: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
418
+ }, z.core.$strict>>;
152
419
  }, z.core.$strict>;
153
420
  export type ContextTransferRequest = z.infer<typeof ContextTransferRequestSchema>;
154
421
  export declare const ContextTransferReceiptSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -170,7 +437,7 @@ export declare const ContextTransferReceiptSchema: z.ZodDiscriminatedUnion<[z.Zo
170
437
  destination: z.ZodObject<{
171
438
  runner: z.ZodString;
172
439
  provider: z.ZodString;
173
- environmentId: z.ZodString;
440
+ environmentId: z.ZodOptional<z.ZodString>;
174
441
  sessionId: z.ZodString;
175
442
  runId: z.ZodString;
176
443
  executionId: z.ZodString;
@@ -206,7 +473,7 @@ export declare const ContextTransferReceiptSchema: z.ZodDiscriminatedUnion<[z.Zo
206
473
  destination: z.ZodObject<{
207
474
  runner: z.ZodString;
208
475
  provider: z.ZodString;
209
- environmentId: z.ZodString;
476
+ environmentId: z.ZodOptional<z.ZodString>;
210
477
  sessionId: z.ZodString;
211
478
  runId: z.ZodString;
212
479
  executionId: z.ZodString;
@@ -246,7 +513,7 @@ export declare const ContextTransferResultSchema: z.ZodDiscriminatedUnion<[z.Zod
246
513
  destination: z.ZodObject<{
247
514
  runner: z.ZodString;
248
515
  provider: z.ZodString;
249
- environmentId: z.ZodString;
516
+ environmentId: z.ZodOptional<z.ZodString>;
250
517
  sessionId: z.ZodString;
251
518
  runId: z.ZodString;
252
519
  executionId: z.ZodString;
@@ -282,7 +549,7 @@ export declare const ContextTransferResultSchema: z.ZodDiscriminatedUnion<[z.Zod
282
549
  destination: z.ZodObject<{
283
550
  runner: z.ZodString;
284
551
  provider: z.ZodString;
285
- environmentId: z.ZodString;
552
+ environmentId: z.ZodOptional<z.ZodString>;
286
553
  sessionId: z.ZodString;
287
554
  runId: z.ZodString;
288
555
  executionId: z.ZodString;
@@ -1,4 +1,7 @@
1
1
  import { z } from "zod";
2
+ import { agentProfileSchema } from "./profile-schema.js";
3
+ import { canonicalAgentProfileDigest } from "./agent-execution-preparation.js";
4
+ import { ResourceRequestSchema, WorkspaceRequestSchema } from "./environment-requests.js";
2
5
  import { boundedStringSchema, CONTRACT_MAX_ARRAY_LENGTH, } from "./contract-limits.js";
3
6
  import { PortableContextSourceBoundarySchema, } from "./portable-context-base.js";
4
7
  import { PortableContextDestinationSchema, PortableContextPlanSchema, } from "./portable-context-plan.js";
@@ -12,6 +15,9 @@ const ContextTransferRequestMaterialSchema = z.strictObject({
12
15
  operationId: idSchema,
13
16
  plan: PortableContextPlanSchema,
14
17
  acceptance: ContextPlanAcceptanceSchema,
18
+ profile: agentProfileSchema.optional(),
19
+ workspace: WorkspaceRequestSchema.optional(),
20
+ resources: ResourceRequestSchema.optional(),
15
21
  });
16
22
  export function contextTransferRequestDigest(request) {
17
23
  const parsed = ContextTransferRequestMaterialSchema.parse(request);
@@ -19,6 +25,9 @@ export function contextTransferRequestDigest(request) {
19
25
  operationId: parsed.operationId,
20
26
  planDigest: parsed.plan.digest,
21
27
  acceptance: parsed.acceptance,
28
+ ...(parsed.profile === undefined ? {} : { profileDigest: canonicalAgentProfileDigest(parsed.profile) }),
29
+ ...(parsed.workspace === undefined ? {} : { workspace: parsed.workspace }),
30
+ ...(parsed.resources === undefined ? {} : { resources: parsed.resources }),
22
31
  });
23
32
  }
24
33
  export const ContextTransferRequestSchema = z
@@ -27,8 +36,20 @@ export const ContextTransferRequestSchema = z
27
36
  requestDigest: sha256DigestSchema,
28
37
  plan: PortableContextPlanSchema,
29
38
  acceptance: ContextPlanAcceptanceSchema,
39
+ profile: agentProfileSchema.optional(),
40
+ workspace: WorkspaceRequestSchema.optional(),
41
+ resources: ResourceRequestSchema.optional(),
30
42
  })
31
43
  .superRefine((request, refinement) => {
44
+ if (request.plan.destination.environmentId === undefined && request.profile === undefined) {
45
+ refinement.addIssue({ code: "custom", path: ["profile"], message: "an unbound destination requires its exact profile" });
46
+ }
47
+ if (request.profile !== undefined && canonicalAgentProfileDigest(request.profile) !== request.plan.destination.profileDigest) {
48
+ refinement.addIssue({ code: "custom", path: ["profile"], message: "profile digest must match the accepted destination" });
49
+ }
50
+ if (request.profile?.harness !== undefined && request.profile.harness !== request.plan.destination.runner) {
51
+ refinement.addIssue({ code: "custom", path: ["profile", "harness"], message: "profile harness must match the accepted destination runner" });
52
+ }
32
53
  if (request.acceptance.planDigest !== request.plan.digest) {
33
54
  refinement.addIssue({
34
55
  code: "custom",
@@ -41,6 +62,9 @@ export const ContextTransferRequestSchema = z
41
62
  operationId: request.operationId,
42
63
  plan: request.plan,
43
64
  acceptance: request.acceptance,
65
+ ...(request.profile === undefined ? {} : { profile: request.profile }),
66
+ ...(request.workspace === undefined ? {} : { workspace: request.workspace }),
67
+ ...(request.resources === undefined ? {} : { resources: request.resources }),
44
68
  })) {
45
69
  refinement.addIssue({
46
70
  code: "custom",
@@ -145,7 +169,7 @@ export function contextTransferReceiptMatches(request, receipt) {
145
169
  wireDigest(exactReceipt.source) === wireDigest(source.source) &&
146
170
  wireDigest(exactReceipt.destination) === wireDigest(destination) &&
147
171
  exactReceipt.provider === destination.provider &&
148
- exactReceipt.environmentId === destination.environmentId &&
172
+ (destination.environmentId === undefined || exactReceipt.environmentId === destination.environmentId) &&
149
173
  exactReceipt.sessionId === destination.sessionId &&
150
174
  exactReceipt.runId === destination.runId &&
151
175
  exactReceipt.executionId === destination.executionId &&
@@ -5,13 +5,19 @@ import type { SdkHostServices } from "./host-services.js";
5
5
  import type { BackendCapabilities, ProviderConfig } from "./provider-config.js";
6
6
  import type { BackendArtifact, BackendListOptions, McpConfig, McpStatusResponse } from "./mcp.js";
7
7
  import type { StreamEvent } from "./stream-events.js";
8
+ import type { ContextTransferRequest } from "./portable-context.js";
9
+ /** Fresh runner session creation with an accepted portable history. */
10
+ export type SdkCreateSessionOptions = {
11
+ workspaceRoot?: string;
12
+ sessionId?: string;
13
+ /** Preserve the typed history and refuse every unsupported part. */
14
+ contextTransfer?: ContextTransferRequest;
15
+ };
8
16
  export interface SdkProviderAdapter {
9
17
  readonly provider: string;
10
18
  getCapabilities(): BackendCapabilities;
11
19
  initialize(config: ProviderConfig): Promise<void>;
12
- createSession?(options?: {
13
- workspaceRoot?: string;
14
- }): Promise<string>;
20
+ createSession?(options?: SdkCreateSessionOptions): Promise<string>;
15
21
  forkSession?(options: {
16
22
  sessionId: string;
17
23
  messageId?: string;
@@ -1,3 +1,4 @@
1
+ import type { InputPart } from "./parts.js";
1
2
  export type BackendCapabilities = {
2
3
  streaming: boolean;
3
4
  toolUse: boolean;
@@ -5,6 +6,10 @@ export type BackendCapabilities = {
5
6
  multimodal: boolean;
6
7
  contextWindow: number;
7
8
  interactions?: string[];
9
+ /** Native typed history import implemented by this runner. */
10
+ contextTransfer?: {
11
+ parts: Array<InputPart["type"]>;
12
+ };
8
13
  };
9
14
  export type ProviderCapabilities = {
10
15
  supportsVision: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "3.1.2",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -61,6 +61,11 @@
61
61
  "import": "./dist/profile-kb/index.js",
62
62
  "types": "./dist/profile-kb/index.d.ts",
63
63
  "default": "./dist/profile-kb/index.js"
64
+ },
65
+ "./learning-state": {
66
+ "import": "./dist/learning-state.js",
67
+ "types": "./dist/learning-state.d.ts",
68
+ "default": "./dist/learning-state.js"
64
69
  }
65
70
  },
66
71
  "repository": {