@tangle-network/agent-interface 1.6.0 → 1.7.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.
@@ -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
  /**
@@ -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;
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.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",