@tangle-network/agent-interface 1.8.0 → 2.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.
Files changed (48) hide show
  1. package/README.md +14 -0
  2. package/dist/agent-candidate-code-schema.d.ts +17 -17
  3. package/dist/agent-candidate-execution-plan-schema.d.ts +179 -179
  4. package/dist/agent-candidate-lineage-schema.d.ts +2 -2
  5. package/dist/agent-candidate-outcome-schema.d.ts +56 -56
  6. package/dist/agent-candidate-profile-schema.d.ts +17 -17
  7. package/dist/agent-candidate-promotion-schema.d.ts +1085 -1085
  8. package/dist/agent-candidate-receipt-schema.d.ts +195 -195
  9. package/dist/agent-candidate-schema-common.d.ts +6 -0
  10. package/dist/agent-candidate-schema-common.js +25 -10
  11. package/dist/agent-candidate-schema.d.ts +30 -30
  12. package/dist/agent-candidate-task-schema.d.ts +16 -16
  13. package/dist/agent-execution-limits.d.ts +1 -1
  14. package/dist/agent-execution-preparation-receipt.d.ts +71 -71
  15. package/dist/agent-improvement-measurement-schema.d.ts +26 -26
  16. package/dist/agent-instance.d.ts +2 -2
  17. package/dist/agent-profile-improvement-schema.d.ts +75 -75
  18. package/dist/agent-workspace-lease.d.ts +4 -4
  19. package/dist/certified-context.d.ts +2 -2
  20. package/dist/environment-command-turn.js +4 -1
  21. package/dist/environment-interactive-control.d.ts +422 -422
  22. package/dist/environment-interactive-start.d.ts +17 -17
  23. package/dist/environment-observation.d.ts +39 -39
  24. package/dist/environment-provider.d.ts +1 -0
  25. package/dist/environment-provider.js +1 -0
  26. package/dist/environment-requests.d.ts +22 -2
  27. package/dist/environment-requests.js +29 -1
  28. package/dist/environment-runtime.d.ts +53 -20
  29. package/dist/environment-runtime.js +23 -0
  30. package/dist/harness.d.ts +11 -11
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/interaction-envelope.d.ts +26 -26
  34. package/dist/interaction-fields.d.ts +22 -22
  35. package/dist/interaction-permissions.d.ts +2 -2
  36. package/dist/portable-context-base.d.ts +1 -1
  37. package/dist/portable-context-continuation.d.ts +4 -4
  38. package/dist/portable-context-plan-request.d.ts +1 -1
  39. package/dist/portable-context-plan.d.ts +5 -5
  40. package/dist/portable-context-shared.d.ts +1 -1
  41. package/dist/portable-context-transfer.d.ts +6 -6
  42. package/dist/profile-schema.d.ts +37 -37
  43. package/dist/runtime-control.d.ts +10 -10
  44. package/dist/workspace-cleanup.d.ts +3 -3
  45. package/dist/workspace-cwd.d.ts +28 -0
  46. package/dist/workspace-cwd.js +77 -0
  47. package/dist/workspace-fork.d.ts +4 -4
  48. package/package.json +6 -6
@@ -39,13 +39,13 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
39
39
  small: z.ZodOptional<z.ZodString>;
40
40
  provider: z.ZodOptional<z.ZodString>;
41
41
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
42
- none: "none";
43
- minimal: "minimal";
42
+ high: "high";
44
43
  low: "low";
45
44
  medium: "medium";
46
- high: "high";
47
- xhigh: "xhigh";
45
+ minimal: "minimal";
46
+ none: "none";
48
47
  ultracode: "ultracode";
48
+ xhigh: "xhigh";
49
49
  }>>;
50
50
  maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
51
51
  maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
@@ -53,22 +53,22 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
53
53
  metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
54
54
  }, z.core.$strict>>;
55
55
  harness: z.ZodOptional<z.ZodEnum<{
56
+ acp: "acp";
57
+ amp: "amp";
56
58
  "claude-code": "claude-code";
57
- nanoclaw: "nanoclaw";
59
+ "cli-base": "cli-base";
58
60
  codex: "codex";
59
- opencode: "opencode";
60
- "kimi-code": "kimi-code";
61
- pi: "pi";
62
- prime: "prime";
61
+ cursor: "cursor";
62
+ "factory-droids": "factory-droids";
63
+ forge: "forge";
63
64
  gemini: "gemini";
64
65
  hermes: "hermes";
66
+ "kimi-code": "kimi-code";
67
+ nanoclaw: "nanoclaw";
65
68
  openclaw: "openclaw";
66
- amp: "amp";
67
- "factory-droids": "factory-droids";
68
- forge: "forge";
69
- cursor: "cursor";
70
- acp: "acp";
71
- "cli-base": "cli-base";
69
+ opencode: "opencode";
70
+ pi: "pi";
71
+ prime: "prime";
72
72
  }>>;
73
73
  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>>>;
74
74
  tools: z.ZodOptional<z.ZodType<Record<string, boolean>, unknown, z.core.$ZodTypeInternals<Record<string, boolean>, unknown>>>;
@@ -179,7 +179,7 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
179
179
  } | {
180
180
  kind: "secret-ref";
181
181
  key: string;
182
- format?: "raw" | "bearer" | undefined;
182
+ format?: "bearer" | "raw" | undefined;
183
183
  }> | undefined;
184
184
  }[]>, unknown, z.core.$ZodTypeInternals<Record<string, {
185
185
  command: string;
@@ -192,7 +192,7 @@ export declare const AgentInteractiveSessionStartSchema: z.ZodObject<{
192
192
  } | {
193
193
  kind: "secret-ref";
194
194
  key: string;
195
- format?: "raw" | "bearer" | undefined;
195
+ format?: "bearer" | "raw" | undefined;
196
196
  }> | undefined;
197
197
  }[]>, unknown>>>;
198
198
  modes: z.ZodOptional<z.ZodType<Record<string, {
@@ -7,11 +7,11 @@ import { z } from "zod";
7
7
  */
8
8
  export type ObservationState = "known" | "stale" | "unavailable" | "redacted" | "unknown";
9
9
  export declare const ObservationStateSchema: z.ZodEnum<{
10
- unknown: "unknown";
11
- unavailable: "unavailable";
12
10
  known: "known";
13
- stale: "stale";
14
11
  redacted: "redacted";
12
+ stale: "stale";
13
+ unavailable: "unavailable";
14
+ unknown: "unknown";
15
15
  }>;
16
16
  /** How a known or stale value was obtained, and when. */
17
17
  export interface ObservationProvenance {
@@ -102,31 +102,31 @@ export declare const ProviderIdentitySchema: z.ZodObject<{
102
102
  backend: z.ZodOptional<z.ZodString>;
103
103
  }, z.core.$strict>;
104
104
  export declare const AgentEnvironmentStatusSchema: z.ZodEnum<{
105
- unknown: "unknown";
106
- failed: "failed";
107
105
  expired: "expired";
108
- stopped: "stopped";
106
+ failed: "failed";
109
107
  pending: "pending";
110
- running: "running";
111
108
  provisioning: "provisioning";
109
+ running: "running";
110
+ stopped: "stopped";
111
+ unknown: "unknown";
112
112
  }>;
113
113
  /** Lifecycle, cleanup, continuity, and persistence of one environment. */
114
114
  export declare const EnvironmentLifecycleSchema: z.ZodObject<{
115
115
  status: z.ZodEnum<{
116
- unknown: "unknown";
117
- failed: "failed";
118
116
  expired: "expired";
119
- stopped: "stopped";
117
+ failed: "failed";
120
118
  pending: "pending";
121
- running: "running";
122
119
  provisioning: "provisioning";
120
+ running: "running";
121
+ stopped: "stopped";
122
+ unknown: "unknown";
123
123
  }>;
124
124
  cleanup: z.ZodOptional<z.ZodObject<{
125
125
  policy: z.ZodOptional<z.ZodEnum<{
126
- manual: "manual";
127
126
  idle: "idle";
128
- scheduled: "scheduled";
127
+ manual: "manual";
129
128
  "on-exit": "on-exit";
129
+ scheduled: "scheduled";
130
130
  }>>;
131
131
  scheduledAt: z.ZodOptional<z.ZodISODateTime>;
132
132
  confirmed: z.ZodOptional<z.ZodBoolean>;
@@ -134,17 +134,17 @@ export declare const EnvironmentLifecycleSchema: z.ZodObject<{
134
134
  continuity: z.ZodOptional<z.ZodObject<{
135
135
  resumable: z.ZodBoolean;
136
136
  mode: z.ZodOptional<z.ZodEnum<{
137
+ native: "native";
137
138
  none: "none";
138
139
  replayed: "replayed";
139
- native: "native";
140
140
  }>>;
141
141
  }, z.core.$strict>>;
142
142
  persistence: z.ZodOptional<z.ZodObject<{
143
143
  durable: z.ZodBoolean;
144
144
  scope: z.ZodOptional<z.ZodEnum<{
145
- session: "session";
146
145
  durable: "durable";
147
146
  ephemeral: "ephemeral";
147
+ session: "session";
148
148
  }>>;
149
149
  }, z.core.$strict>>;
150
150
  }, z.core.$strict>;
@@ -183,10 +183,10 @@ export type ResourceUseSample = z.infer<typeof ResourceUseSampleSchema>;
183
183
  /** Where an environment was requested or verified to run. */
184
184
  export declare const PlacementDescriptorSchema: z.ZodObject<{
185
185
  kind: z.ZodEnum<{
186
- provider: "provider";
186
+ fleet: "fleet";
187
187
  local: "local";
188
+ provider: "provider";
188
189
  sandbox: "sandbox";
189
- fleet: "fleet";
190
190
  }>;
191
191
  sandboxId: z.ZodOptional<z.ZodString>;
192
192
  fleetId: z.ZodOptional<z.ZodString>;
@@ -438,20 +438,20 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
438
438
  state: z.ZodLiteral<"known">;
439
439
  value: z.ZodObject<{
440
440
  status: z.ZodEnum<{
441
- unknown: "unknown";
442
- failed: "failed";
443
441
  expired: "expired";
444
- stopped: "stopped";
442
+ failed: "failed";
445
443
  pending: "pending";
446
- running: "running";
447
444
  provisioning: "provisioning";
445
+ running: "running";
446
+ stopped: "stopped";
447
+ unknown: "unknown";
448
448
  }>;
449
449
  cleanup: z.ZodOptional<z.ZodObject<{
450
450
  policy: z.ZodOptional<z.ZodEnum<{
451
- manual: "manual";
452
451
  idle: "idle";
453
- scheduled: "scheduled";
452
+ manual: "manual";
454
453
  "on-exit": "on-exit";
454
+ scheduled: "scheduled";
455
455
  }>>;
456
456
  scheduledAt: z.ZodOptional<z.ZodISODateTime>;
457
457
  confirmed: z.ZodOptional<z.ZodBoolean>;
@@ -459,17 +459,17 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
459
459
  continuity: z.ZodOptional<z.ZodObject<{
460
460
  resumable: z.ZodBoolean;
461
461
  mode: z.ZodOptional<z.ZodEnum<{
462
+ native: "native";
462
463
  none: "none";
463
464
  replayed: "replayed";
464
- native: "native";
465
465
  }>>;
466
466
  }, z.core.$strict>>;
467
467
  persistence: z.ZodOptional<z.ZodObject<{
468
468
  durable: z.ZodBoolean;
469
469
  scope: z.ZodOptional<z.ZodEnum<{
470
- session: "session";
471
470
  durable: "durable";
472
471
  ephemeral: "ephemeral";
472
+ session: "session";
473
473
  }>>;
474
474
  }, z.core.$strict>>;
475
475
  }, z.core.$strict>;
@@ -486,20 +486,20 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
486
486
  state: z.ZodLiteral<"stale">;
487
487
  value: z.ZodObject<{
488
488
  status: z.ZodEnum<{
489
- unknown: "unknown";
490
- failed: "failed";
491
489
  expired: "expired";
492
- stopped: "stopped";
490
+ failed: "failed";
493
491
  pending: "pending";
494
- running: "running";
495
492
  provisioning: "provisioning";
493
+ running: "running";
494
+ stopped: "stopped";
495
+ unknown: "unknown";
496
496
  }>;
497
497
  cleanup: z.ZodOptional<z.ZodObject<{
498
498
  policy: z.ZodOptional<z.ZodEnum<{
499
- manual: "manual";
500
499
  idle: "idle";
501
- scheduled: "scheduled";
500
+ manual: "manual";
502
501
  "on-exit": "on-exit";
502
+ scheduled: "scheduled";
503
503
  }>>;
504
504
  scheduledAt: z.ZodOptional<z.ZodISODateTime>;
505
505
  confirmed: z.ZodOptional<z.ZodBoolean>;
@@ -507,17 +507,17 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
507
507
  continuity: z.ZodOptional<z.ZodObject<{
508
508
  resumable: z.ZodBoolean;
509
509
  mode: z.ZodOptional<z.ZodEnum<{
510
+ native: "native";
510
511
  none: "none";
511
512
  replayed: "replayed";
512
- native: "native";
513
513
  }>>;
514
514
  }, z.core.$strict>>;
515
515
  persistence: z.ZodOptional<z.ZodObject<{
516
516
  durable: z.ZodBoolean;
517
517
  scope: z.ZodOptional<z.ZodEnum<{
518
- session: "session";
519
518
  durable: "durable";
520
519
  ephemeral: "ephemeral";
520
+ session: "session";
521
521
  }>>;
522
522
  }, z.core.$strict>>;
523
523
  }, z.core.$strict>;
@@ -587,10 +587,10 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
587
587
  placement: z.ZodOptional<z.ZodObject<{
588
588
  requested: z.ZodOptional<z.ZodObject<{
589
589
  kind: z.ZodEnum<{
590
- provider: "provider";
590
+ fleet: "fleet";
591
591
  local: "local";
592
+ provider: "provider";
592
593
  sandbox: "sandbox";
593
- fleet: "fleet";
594
594
  }>;
595
595
  sandboxId: z.ZodOptional<z.ZodString>;
596
596
  fleetId: z.ZodOptional<z.ZodString>;
@@ -601,10 +601,10 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
601
601
  state: z.ZodLiteral<"known">;
602
602
  value: z.ZodObject<{
603
603
  kind: z.ZodEnum<{
604
- provider: "provider";
604
+ fleet: "fleet";
605
605
  local: "local";
606
+ provider: "provider";
606
607
  sandbox: "sandbox";
607
- fleet: "fleet";
608
608
  }>;
609
609
  sandboxId: z.ZodOptional<z.ZodString>;
610
610
  fleetId: z.ZodOptional<z.ZodString>;
@@ -624,10 +624,10 @@ export declare const AgentEnvironmentObservationSchema: z.ZodObject<{
624
624
  state: z.ZodLiteral<"stale">;
625
625
  value: z.ZodObject<{
626
626
  kind: z.ZodEnum<{
627
- provider: "provider";
627
+ fleet: "fleet";
628
628
  local: "local";
629
+ provider: "provider";
629
630
  sandbox: "sandbox";
630
- fleet: "fleet";
631
631
  }>;
632
632
  sandboxId: z.ZodOptional<z.ZodString>;
633
633
  fleetId: z.ZodOptional<z.ZodString>;
@@ -5,3 +5,4 @@ export * from "./environment-observation.js";
5
5
  export * from "./environment-terminal.js";
6
6
  export * from "./environment-runtime.js";
7
7
  export * from "./environment-command-turn.js";
8
+ export * from "./workspace-cwd.js";
@@ -5,3 +5,4 @@ export * from "./environment-observation.js";
5
5
  export * from "./environment-terminal.js";
6
6
  export * from "./environment-runtime.js";
7
7
  export * from "./environment-command-turn.js";
8
+ export * from "./workspace-cwd.js";
@@ -1,3 +1,5 @@
1
+ import { z } from "zod";
2
+ import type { WorkspaceCwd } from "./workspace-cwd.js";
1
3
  import type { AgentProfile } from "./agent-profile.js";
2
4
  /** Portable profile reference: inline profile or provider catalog id. */
3
5
  export type AgentProfileRef = AgentProfile | string;
@@ -12,11 +14,29 @@ export interface WorkspaceRequest {
12
14
  repoUrl?: string;
13
15
  /** Git ref for {@link repoUrl}. */
14
16
  gitRef?: string;
15
- /** Initial working directory inside the environment. */
16
- cwd?: string;
17
+ /**
18
+ * Explicitly based working directory inside the environment or on the host.
19
+ * Repository paths use `base: "repository"`; host paths use `base: "host"`.
20
+ */
21
+ cwd?: WorkspaceCwd;
17
22
  /** Opaque provider-native workspace fields. */
18
23
  providerOptions?: Record<string, unknown>;
19
24
  }
25
+ /** Runtime contract for the portable workspace request carried by providers. */
26
+ export declare const WorkspaceRequestSchema: z.ZodObject<{
27
+ environment: z.ZodOptional<z.ZodString>;
28
+ image: z.ZodOptional<z.ZodString>;
29
+ repoUrl: z.ZodOptional<z.ZodString>;
30
+ gitRef: z.ZodOptional<z.ZodString>;
31
+ cwd: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
32
+ base: z.ZodLiteral<"repository">;
33
+ path: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ base: z.ZodLiteral<"host">;
36
+ path: z.ZodString;
37
+ }, z.core.$strict>], "base">>;
38
+ providerOptions: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
39
+ }, z.core.$strict>;
20
40
  export interface ResourceRequest {
21
41
  cpu?: number;
22
42
  memoryMb?: number;
@@ -1 +1,29 @@
1
- export {};
1
+ import { z } from "zod";
2
+ import { boundedIdentifierSchema, boundedJsonRecordSchema, boundedStringSchema, } from "./contract-limits.js";
3
+ import { workspaceCwdSchema } from "./workspace-cwd.js";
4
+ /** Runtime contract for the portable workspace request carried by providers. */
5
+ export const WorkspaceRequestSchema = z
6
+ .strictObject({
7
+ environment: boundedIdentifierSchema.optional(),
8
+ image: boundedStringSchema.min(1).optional(),
9
+ repoUrl: boundedStringSchema.min(1).optional(),
10
+ gitRef: boundedIdentifierSchema.optional(),
11
+ cwd: workspaceCwdSchema.optional(),
12
+ providerOptions: boundedJsonRecordSchema.optional(),
13
+ })
14
+ .superRefine((workspace, refinement) => {
15
+ if (workspace.environment !== undefined && workspace.image !== undefined) {
16
+ refinement.addIssue({
17
+ code: "custom",
18
+ path: ["image"],
19
+ message: "workspace cannot specify both environment and image",
20
+ });
21
+ }
22
+ if (workspace.gitRef !== undefined && workspace.repoUrl === undefined) {
23
+ refinement.addIssue({
24
+ code: "custom",
25
+ path: ["gitRef"],
26
+ message: "workspace gitRef requires repoUrl",
27
+ });
28
+ }
29
+ });
@@ -5,7 +5,7 @@ import type { InputPart } from "./parts.js";
5
5
  import type { StreamEvent } from "./stream-events.js";
6
6
  import type { TokenUsage } from "./execution-types.js";
7
7
  import { type InteractionAcknowledgement, type InteractionCapabilities, type InteractionResponseCommand, type RequestedInteractions } from "./interaction.js";
8
- import { type ContextTransferReceipt, type ContextTransferRequest, type NativeContextBoundaryProof, type NativeContextContinuationRequest, type NativeContextContinuationTurn } from "./portable-context.js";
8
+ import { type ContextTransferReceipt, type ContextTransferRequest, type ContextTransferResult, type NativeContextBoundaryProof, type NativeContextContinuationRequest, type NativeContextContinuationTurn } from "./portable-context.js";
9
9
  import { type AgentExactRunControlRef, type AgentRunCancellationAcknowledgement, type AgentRunCancellationRequest, type AgentRunControlRef } from "./runtime-control.js";
10
10
  import type { AgentWorkspaceBranching, AgentWorkspaceBranchingProvider } from "./workspace-branching.js";
11
11
  import type { AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentSessionStatus, CheckpointRef, CheckpointRequest, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from "./environment-requests.js";
@@ -92,9 +92,9 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
92
92
  messages: z.ZodArray<z.ZodObject<{
93
93
  id: z.ZodString;
94
94
  role: z.ZodEnum<{
95
- user: "user";
96
95
  assistant: "assistant";
97
96
  system: "system";
97
+ user: "user";
98
98
  }>;
99
99
  parts: z.ZodArray<z.ZodCustom<unknown, unknown>>;
100
100
  timestamp: z.ZodISODateTime;
@@ -128,9 +128,9 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
128
128
  parts: z.ZodArray<z.ZodObject<{
129
129
  partIndex: z.ZodNumber;
130
130
  action: z.ZodEnum<{
131
- transform: "transform";
132
131
  include: "include";
133
132
  omit: "omit";
133
+ transform: "transform";
134
134
  }>;
135
135
  output: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
136
136
  type: z.ZodLiteral<"text">;
@@ -171,9 +171,9 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
171
171
  messages: z.ZodArray<z.ZodObject<{
172
172
  id: z.ZodString;
173
173
  role: z.ZodEnum<{
174
- user: "user";
175
174
  assistant: "assistant";
176
175
  system: "system";
176
+ user: "user";
177
177
  }>;
178
178
  parts: z.ZodArray<z.ZodCustom<unknown, unknown>>;
179
179
  timestamp: z.ZodISODateTime;
@@ -197,8 +197,8 @@ export declare const AgentTurnInputSchema: z.ZodObject<{
197
197
  acceptedAt: z.ZodISODateTime;
198
198
  acceptedBy: z.ZodEnum<{
199
199
  policy: "policy";
200
- user: "user";
201
200
  system: "system";
201
+ user: "user";
202
202
  }>;
203
203
  }, z.core.$strict>;
204
204
  }, z.core.$strict>>;
@@ -365,13 +365,13 @@ export declare const AgentNativeContextContinuationResultSchema: z.ZodUnion<read
365
365
  operationId: z.ZodString;
366
366
  requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
367
367
  status: z.ZodEnum<{
368
- conflict: "conflict";
369
368
  accepted: "accepted";
370
- transport_failure: "transport_failure";
371
- replayed: "replayed";
372
369
  boundary_mismatch: "boundary_mismatch";
373
- unverified: "unverified";
370
+ conflict: "conflict";
371
+ replayed: "replayed";
372
+ transport_failure: "transport_failure";
374
373
  unknown_session: "unknown_session";
374
+ unverified: "unverified";
375
375
  }>;
376
376
  historyMessagesSent: z.ZodNumber;
377
377
  existingRequestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
@@ -524,13 +524,13 @@ export declare const AgentNativeContextContinuationResultSchema: z.ZodUnion<read
524
524
  operationId: z.ZodString;
525
525
  requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
526
526
  status: z.ZodEnum<{
527
- conflict: "conflict";
528
527
  accepted: "accepted";
529
- transport_failure: "transport_failure";
530
- replayed: "replayed";
531
528
  boundary_mismatch: "boundary_mismatch";
532
- unverified: "unverified";
529
+ conflict: "conflict";
530
+ replayed: "replayed";
531
+ transport_failure: "transport_failure";
533
532
  unknown_session: "unknown_session";
533
+ unverified: "unverified";
534
534
  }>;
535
535
  historyMessagesSent: z.ZodNumber;
536
536
  existingRequestDigest: z.ZodOptional<z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>>;
@@ -561,11 +561,11 @@ export declare const AgentNativeContextContinuationResultSchema: z.ZodUnion<read
561
561
  retryable: z.ZodOptional<z.ZodBoolean>;
562
562
  }, z.core.$strict>, z.ZodObject<{
563
563
  status: z.ZodEnum<{
564
+ boundary_mismatch: "boundary_mismatch";
564
565
  conflict: "conflict";
565
566
  transport_failure: "transport_failure";
566
- boundary_mismatch: "boundary_mismatch";
567
- unverified: "unverified";
568
567
  unknown_session: "unknown_session";
568
+ unverified: "unverified";
569
569
  }>;
570
570
  }, z.core.$strip>>;
571
571
  }, z.core.$strict>]>;
@@ -687,8 +687,8 @@ export interface AgentSession {
687
687
  */
688
688
  export type AgentEnvironmentCreation = "created" | "replayed";
689
689
  export declare const AgentEnvironmentCreationSchema: z.ZodEnum<{
690
- replayed: "replayed";
691
690
  created: "created";
691
+ replayed: "replayed";
692
692
  }>;
693
693
  export interface AgentEnvironment {
694
694
  readonly id: string;
@@ -803,6 +803,12 @@ export interface AgentEnvironmentCapabilities {
803
803
  /** The provider exposes the exact continued run before terminal output. */
804
804
  admissionControl?: boolean;
805
805
  };
806
+ /** Present only when fresh-session portable context transfer is durable. */
807
+ contextTransfer?: {
808
+ freshSession: boolean;
809
+ requestIdempotency: boolean;
810
+ lookup: boolean;
811
+ };
806
812
  /** Absent when the provider cannot originate or answer interactions. */
807
813
  interactions?: InteractionCapabilities;
808
814
  workspace: {
@@ -812,6 +818,11 @@ export interface AgentEnvironmentCapabilities {
812
818
  git: boolean;
813
819
  upload: boolean;
814
820
  download: boolean;
821
+ /** Path bases accepted by the provider's workspace create contract. */
822
+ cwdBases?: {
823
+ repository: boolean;
824
+ host: boolean;
825
+ };
815
826
  };
816
827
  branching: {
817
828
  checkpoint: boolean;
@@ -912,19 +923,24 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
912
923
  requestIdempotency: z.ZodBoolean;
913
924
  admissionControl: z.ZodOptional<z.ZodBoolean>;
914
925
  }, z.core.$strict>>;
926
+ contextTransfer: z.ZodOptional<z.ZodObject<{
927
+ freshSession: z.ZodBoolean;
928
+ requestIdempotency: z.ZodBoolean;
929
+ lookup: z.ZodBoolean;
930
+ }, z.core.$strict>>;
915
931
  interactions: z.ZodOptional<z.ZodObject<{
916
932
  kinds: z.ZodArray<z.ZodString>;
917
933
  answerFieldTypes: z.ZodArray<z.ZodEnum<{
918
- number: "number";
919
934
  boolean: "boolean";
920
- text: "text";
921
- select: "select";
935
+ number: "number";
922
936
  secret: "secret";
937
+ select: "select";
938
+ text: "text";
923
939
  }>>;
924
940
  responseScopes: z.ZodArray<z.ZodEnum<{
925
941
  interaction: "interaction";
926
- session: "session";
927
942
  persistent: "persistent";
943
+ session: "session";
928
944
  }>>;
929
945
  secretAnswers: z.ZodBoolean;
930
946
  concurrentRequests: z.ZodBoolean;
@@ -938,6 +954,10 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
938
954
  git: z.ZodBoolean;
939
955
  upload: z.ZodBoolean;
940
956
  download: z.ZodBoolean;
957
+ cwdBases: z.ZodOptional<z.ZodObject<{
958
+ repository: z.ZodBoolean;
959
+ host: z.ZodBoolean;
960
+ }, z.core.$strict>>;
941
961
  }, z.core.$strict>;
942
962
  branching: z.ZodObject<{
943
963
  checkpoint: z.ZodBoolean;
@@ -986,6 +1006,8 @@ export declare const AgentEnvironmentCapabilitiesSchema: z.ZodObject<{
986
1006
  }, z.core.$strict>;
987
1007
  export interface CreateAgentEnvironmentInput {
988
1008
  profile: AgentProfileRef;
1009
+ /** Exact caller-owned id required by an accepted destination contract. */
1010
+ requestedId?: string;
989
1011
  /** Agent backend inside the provider, for example "opencode" or "codex". */
990
1012
  backend?: string;
991
1013
  workspace?: WorkspaceRequest;
@@ -1049,6 +1071,8 @@ export declare function createAgentEnvironmentWithIdempotency<T extends object>(
1049
1071
  export interface AgentEnvironmentProvider {
1050
1072
  readonly name: string;
1051
1073
  readonly exactProcess?: AgentExactProcessProvider;
1074
+ /** Durable fresh-session portable context admission, when supported. */
1075
+ readonly contextTransfer?: AgentContextTransferProvider;
1052
1076
  /**
1053
1077
  * Reconstruct a source-scoped branching handle after a coordinator restart.
1054
1078
  *
@@ -1075,3 +1099,12 @@ export interface AgentEnvironmentProvider {
1075
1099
  signal?: AbortSignal;
1076
1100
  }): Promise<AgentEnvironmentSummary[]>;
1077
1101
  }
1102
+ /** Provider-owned portable context admission with retry-safe lookup. */
1103
+ export interface AgentContextTransferProvider {
1104
+ transfer(request: ContextTransferRequest, options?: {
1105
+ signal?: AbortSignal;
1106
+ }): Promise<ContextTransferResult>;
1107
+ lookup(request: ContextTransferRequest, options?: {
1108
+ signal?: AbortSignal;
1109
+ }): Promise<ContextTransferResult | undefined>;
1110
+ }
@@ -190,6 +190,13 @@ export const AgentEnvironmentCapabilitiesSchema = z
190
190
  admissionControl: z.boolean().optional(),
191
191
  })
192
192
  .optional(),
193
+ contextTransfer: z
194
+ .strictObject({
195
+ freshSession: z.boolean(),
196
+ requestIdempotency: z.boolean(),
197
+ lookup: z.boolean(),
198
+ })
199
+ .optional(),
193
200
  interactions: InteractionCapabilitiesSchema.optional(),
194
201
  workspace: z.strictObject({
195
202
  read: z.boolean(),
@@ -198,6 +205,12 @@ export const AgentEnvironmentCapabilitiesSchema = z
198
205
  git: z.boolean(),
199
206
  upload: z.boolean(),
200
207
  download: z.boolean(),
208
+ cwdBases: z
209
+ .strictObject({
210
+ repository: z.boolean(),
211
+ host: z.boolean(),
212
+ })
213
+ .optional(),
201
214
  }),
202
215
  branching: z.strictObject({
203
216
  checkpoint: z.boolean(),
@@ -286,6 +299,16 @@ export const AgentEnvironmentCapabilitiesSchema = z
286
299
  message: "native continuation requires retained control for early admission",
287
300
  });
288
301
  }
302
+ if (capabilities.contextTransfer !== undefined &&
303
+ (!capabilities.contextTransfer.freshSession ||
304
+ !capabilities.contextTransfer.requestIdempotency ||
305
+ !capabilities.contextTransfer.lookup)) {
306
+ refinement.addIssue({
307
+ code: "custom",
308
+ path: ["contextTransfer"],
309
+ message: "context transfer requires fresh-session admission, request idempotency, and lookup together",
310
+ });
311
+ }
289
312
  const durableBranching = [
290
313
  capabilities.branching.retrySafe ?? false,
291
314
  capabilities.branching.lookup ?? false,
package/dist/harness.d.ts CHANGED
@@ -23,20 +23,20 @@ import { z } from "zod";
23
23
  export type HarnessType = "claude-code" | "nanoclaw" | "codex" | "opencode" | "kimi-code" | "pi" | "prime" | "gemini" | "hermes" | "openclaw" | "amp" | "factory-droids" | "forge" | "cursor" | "acp" | "cli-base";
24
24
  /** Runtime validator for {@link HarnessType}. Kept in lockstep with the type by the drift guard below. */
25
25
  export declare const harnessTypeSchema: z.ZodEnum<{
26
+ acp: "acp";
27
+ amp: "amp";
26
28
  "claude-code": "claude-code";
27
- nanoclaw: "nanoclaw";
29
+ "cli-base": "cli-base";
28
30
  codex: "codex";
29
- opencode: "opencode";
30
- "kimi-code": "kimi-code";
31
- pi: "pi";
32
- prime: "prime";
31
+ cursor: "cursor";
32
+ "factory-droids": "factory-droids";
33
+ forge: "forge";
33
34
  gemini: "gemini";
34
35
  hermes: "hermes";
36
+ "kimi-code": "kimi-code";
37
+ nanoclaw: "nanoclaw";
35
38
  openclaw: "openclaw";
36
- amp: "amp";
37
- "factory-droids": "factory-droids";
38
- forge: "forge";
39
- cursor: "cursor";
40
- acp: "acp";
41
- "cli-base": "cli-base";
39
+ opencode: "opencode";
40
+ pi: "pi";
41
+ prime: "prime";
42
42
  }>;