@tangle-network/agent-interface 1.6.0 → 1.7.1

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.
@@ -1,6 +1,8 @@
1
1
  import { z } from "zod";
2
2
  /** Limits applied before a value is hashed, copied, or sent to a provider. */
3
3
  export declare const CONTRACT_MAX_STRING_LENGTH = 16384;
4
+ /** Maximum length of one canonical confidential-attestation quote. */
5
+ export declare const CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH = 32768;
4
6
  export declare const CONTRACT_MAX_IDENTIFIER_LENGTH = 512;
5
7
  export declare const CONTRACT_MAX_ARRAY_LENGTH = 1024;
6
8
  export declare const CONTRACT_MAX_MAP_ENTRIES = 256;
@@ -8,6 +10,7 @@ export declare const CONTRACT_MAX_JSON_DEPTH = 16;
8
10
  export declare const CONTRACT_MAX_JSON_BYTES = 1048576;
9
11
  export declare const CONTRACT_MAX_JSON_NODES = 8192;
10
12
  export declare const boundedStringSchema: z.ZodString;
13
+ export declare const confidentialAttestationQuoteSchema: z.ZodString;
11
14
  export declare const boundedIdentifierSchema: z.ZodString;
12
15
  /**
13
16
  * Validate JSON without asking Zod to recursively copy an attacker-sized
@@ -1,6 +1,8 @@
1
1
  import { z } from "zod";
2
2
  /** Limits applied before a value is hashed, copied, or sent to a provider. */
3
3
  export const CONTRACT_MAX_STRING_LENGTH = 16_384;
4
+ /** Maximum length of one canonical confidential-attestation quote. */
5
+ export const CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH = 32_768;
4
6
  export const CONTRACT_MAX_IDENTIFIER_LENGTH = 512;
5
7
  export const CONTRACT_MAX_ARRAY_LENGTH = 1_024;
6
8
  export const CONTRACT_MAX_MAP_ENTRIES = 256;
@@ -8,6 +10,9 @@ export const CONTRACT_MAX_JSON_DEPTH = 16;
8
10
  export const CONTRACT_MAX_JSON_BYTES = 1_048_576;
9
11
  export const CONTRACT_MAX_JSON_NODES = 8_192;
10
12
  export const boundedStringSchema = z.string().max(CONTRACT_MAX_STRING_LENGTH);
13
+ export const confidentialAttestationQuoteSchema = z
14
+ .string()
15
+ .max(CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH);
11
16
  export const boundedIdentifierSchema = boundedStringSchema
12
17
  .min(1)
13
18
  .max(CONTRACT_MAX_IDENTIFIER_LENGTH)
@@ -7,7 +7,7 @@ import type { TokenUsage } from "./execution-types.js";
7
7
  import { type InteractionAcknowledgement, type InteractionCapabilities, type InteractionResponseCommand, type RequestedInteractions } from "./interaction.js";
8
8
  import { type ContextTransferReceipt, type ContextTransferRequest, type NativeContextBoundaryProof, type NativeContextContinuationRequest, type NativeContextContinuationTurn } from "./portable-context.js";
9
9
  import { type AgentRunCancellationAcknowledgement, type AgentRunCancellationRequest, type AgentRunControlRef } from "./runtime-control.js";
10
- import type { AgentWorkspaceBranching } from "./workspace-branching.js";
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";
12
12
  import type { AgentExactProcessEgressMode, AgentExactProcessProvider } from "./environment-exact-process.js";
13
13
  import type { AgentEnvironmentObservation } from "./environment-observation.js";
@@ -997,6 +997,15 @@ export declare function createAgentEnvironmentWithIdempotency<T extends object>(
997
997
  export interface AgentEnvironmentProvider {
998
998
  readonly name: string;
999
999
  readonly exactProcess?: AgentExactProcessProvider;
1000
+ /**
1001
+ * Reconstruct a source-scoped branching handle after a coordinator restart.
1002
+ *
1003
+ * This surface is intentionally separate from an environment-owned handle:
1004
+ * lookup and cleanup requests identify operations, not their source. The
1005
+ * provider owns source resolution and the underlying platform calls. A
1006
+ * returned handle is bound to that source and must reject other scopes.
1007
+ */
1008
+ readonly workspaceBranching?: AgentWorkspaceBranchingProvider;
1000
1009
  capabilities(): AgentEnvironmentCapabilities | Promise<AgentEnvironmentCapabilities>;
1001
1010
  validateProfile?(profile: AgentProfileRef): AgentProfileValidationResult | Promise<AgentProfileValidationResult>;
1002
1011
  /**
package/dist/index.d.ts CHANGED
@@ -40,3 +40,4 @@ export * from "./harness-capabilities.js";
40
40
  export * from "./profile-schema.js";
41
41
  export * from "./profile-security.js";
42
42
  export * from "./sandbox-size.js";
43
+ export { CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, } from "./contract-limits.js";
package/dist/index.js CHANGED
@@ -38,3 +38,4 @@ export * from "./harness-capabilities.js";
38
38
  export * from "./profile-schema.js";
39
39
  export * from "./profile-security.js";
40
40
  export * from "./sandbox-size.js";
41
+ export { CONTRACT_MAX_CONFIDENTIAL_ATTESTATION_QUOTE_LENGTH, } from "./contract-limits.js";
@@ -81,5 +81,20 @@ export interface AgentWorkspaceBranching {
81
81
  signal?: AbortSignal;
82
82
  }): Promise<WorkspaceCleanupAcknowledgement>;
83
83
  }
84
+ /**
85
+ * Provider-level entry point for reconstructing branch operations by source.
86
+ *
87
+ * Environment handles are process-local views. A coordinator that restarts
88
+ * must obtain a fresh source-scoped handle before it looks up or cleans a
89
+ * checkpoint or fork. The returned handle must reject a resource that does
90
+ * not belong to its source scope. Providers return null when the source is
91
+ * absent, the resolved environment id does not match, or the deployment
92
+ * cannot prove the complete branching surface.
93
+ */
94
+ export interface AgentWorkspaceBranchingProvider {
95
+ forEnvironment(sourceEnvironmentId: string, options?: {
96
+ signal?: AbortSignal;
97
+ }): Promise<AgentWorkspaceBranching | null>;
98
+ }
84
99
  /** Bind cleanup confirmation to the exact provider resource and operation. */
85
100
  export declare function workspaceCleanupAcknowledgementMatches(request: WorkspaceCleanupRequest, acknowledgement: WorkspaceCleanupAcknowledgement): boolean;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { boundedStringSchema } from "./contract-limits.js";
2
+ import { boundedStringSchema, confidentialAttestationQuoteSchema, } from "./contract-limits.js";
3
3
  import { AgentExactRunControlRefSchema, } from "./runtime-control.js";
4
4
  import { idSchema, sha256DigestSchema, wireDigest } from "./workspace-branching-shared.js";
5
5
  /**
@@ -18,7 +18,7 @@ export const ConfidentialAttestationSchema = z
18
18
  requestDigest: sha256DigestSchema,
19
19
  profileDigest: sha256DigestSchema,
20
20
  policy: idSchema,
21
- quote: boundedStringSchema.min(1),
21
+ quote: confidentialAttestationQuoteSchema.min(1),
22
22
  providerKeyId: idSchema,
23
23
  providerSignature: boundedStringSchema.min(1),
24
24
  verifiedAt: z.iso.datetime().max(64),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-interface",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",