@tangle-network/agent-provider-tangle 0.14.1 → 0.14.3

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,5 +1,5 @@
1
1
  import type { BackendRegistryEntry, BackendRegistryResponse, BackendType, CreateSandboxOptions, ExecResult as SandboxExecResult, PromptOptions, PromptResult, SandboxEvent } from "@tangle-network/sandbox";
2
- import type { AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, AgentExecutionPreparationReceipt, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentProfile, ConfidentialAttestation, ConfidentialExecutionEnvironment, InputPart, InteractionRequest, InteractionResponseCommand } from "@tangle-network/agent-interface";
2
+ import type { AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, AgentInteractiveSessionControlClaim, AgentInteractiveSessionControlClaimAcknowledgement, AgentInteractiveSessionControlClaimRequest, AgentInteractiveSessionAttach, AgentInteractiveSessionPromptAcknowledgement, AgentInteractiveSessionPromptCommand, AgentInteractiveSessionRef, AgentInteractiveSessionStart, AgentInteractiveSessionStatus, AgentInteractiveSessionStopAcknowledgement, AgentInteractiveSessionStopCommand, AgentInteractiveTerminalSession, ConfidentialAttestation, ConfidentialExecutionEnvironment, InputPart, InteractionRequest, InteractionResponseCommand } from "@tangle-network/agent-interface";
3
3
  import type { AgentEnvironmentCapabilities, AgentEnvironmentProvider, CreateAgentEnvironmentInput } from "@tangle-network/agent-interface/environment-provider";
4
4
  /**
5
5
  * The platform verdict for the create call that returned a sandbox.
@@ -335,57 +335,45 @@ export interface SandboxTerminalsLike {
335
335
  handlers?: SandboxTerminalHandlersLike;
336
336
  }): Promise<SandboxTerminalStreamLike>;
337
337
  }
338
- /** Identity returned by the Sandbox exact interactive-session route. */
339
- export interface SandboxInteractiveSessionIdentityLike {
340
- sessionId: string;
341
- harness: BackendType;
342
- startedAt: string;
343
- /** Provider-issued process incarnation. Replays return this exact value. */
344
- incarnationId: string;
345
- /** Canonical provider admission receipt for the effective route. */
346
- preparationReceipt: AgentExecutionPreparationReceipt;
347
- }
348
- /** Start acknowledgement from the canonical Sandbox interactive API. */
349
- export interface SandboxInteractiveSessionInfoLike extends SandboxInteractiveSessionIdentityLike {
350
- streamUrl: string;
351
- }
352
- /** Lifecycle returned by the Sandbox exact interactive-session route. */
353
- export type SandboxInteractiveSessionStatusLike = (SandboxInteractiveSessionInfoLike & {
338
+ /** Start result returned by the Sandbox exact interactive-session route. */
339
+ export type SandboxInteractiveSessionStartResultLike = {
354
340
  state: "running";
355
- }) | (SandboxInteractiveSessionIdentityLike & {
341
+ ref: AgentInteractiveSessionRef;
342
+ control: AgentInteractiveSessionControlClaim;
343
+ streamUrl: string;
344
+ } | {
356
345
  state: "exited";
346
+ ref: AgentInteractiveSessionRef;
347
+ control: AgentInteractiveSessionControlClaim;
357
348
  endedAt: string;
358
349
  exitCode?: number;
359
350
  exitSignal?: string;
360
351
  reason: "exited" | "stopped" | "lost";
361
- });
352
+ };
362
353
  /** Existing Sandbox SDK handle for one coding harness's native TUI. */
363
354
  export interface SandboxInteractiveSessionLike {
364
- start(options: {
365
- harness: BackendType;
366
- model?: string;
367
- cwd?: string;
368
- cols?: number;
369
- rows?: number;
370
- profile: AgentProfile;
371
- initialPrompt?: string;
372
- /** Derived from the exact run; owned by the Sandbox creation ledger. */
373
- idempotencyKey: string;
374
- /** Exact request digest paired with the idempotency key. */
375
- requestDigest: `sha256:${string}`;
376
- }): Promise<SandboxInteractiveSessionInfoLike>;
377
- claimControl(request: AgentInteractiveSessionControlClaimRequest): Promise<AgentInteractiveSessionControlClaimAcknowledgement>;
378
- status(): Promise<SandboxInteractiveSessionStatusLike | null>;
379
- attach(options: {
380
- control: AgentInteractiveSessionControlClaim;
381
- cols?: number;
382
- rows?: number;
383
- handlers?: SandboxTerminalHandlersLike;
384
- }): Promise<SandboxTerminalStreamLike>;
385
- /** Validate the current generation before each PTY mutation. */
386
- validateControl(control: AgentInteractiveSessionControlClaim): Promise<void>;
387
- sendPrompt(command: AgentInteractiveSessionPromptCommand): Promise<AgentInteractiveSessionPromptAcknowledgement>;
388
- stop(command: AgentInteractiveSessionStopCommand): Promise<AgentInteractiveSessionStopAcknowledgement>;
355
+ start(request: AgentInteractiveSessionStart, options?: {
356
+ signal?: AbortSignal;
357
+ }): Promise<SandboxInteractiveSessionStartResultLike>;
358
+ claimControl(request: AgentInteractiveSessionControlClaimRequest, options?: {
359
+ signal?: AbortSignal;
360
+ }): Promise<AgentInteractiveSessionControlClaimAcknowledgement>;
361
+ status(options?: {
362
+ signal?: AbortSignal;
363
+ }): Promise<AgentInteractiveSessionStatus | null>;
364
+ attachAgentTerminal(request: AgentInteractiveSessionAttach, options?: {
365
+ signal?: AbortSignal;
366
+ }): Promise<AgentInteractiveTerminalSession>;
367
+ /** Confirm that this claim is still the current writable generation. */
368
+ validateControl(control: AgentInteractiveSessionControlClaim, options?: {
369
+ signal?: AbortSignal;
370
+ }): Promise<void>;
371
+ sendPrompt(command: AgentInteractiveSessionPromptCommand, options?: {
372
+ signal?: AbortSignal;
373
+ }): Promise<AgentInteractiveSessionPromptAcknowledgement>;
374
+ stop(command: AgentInteractiveSessionStopCommand, options?: {
375
+ signal?: AbortSignal;
376
+ }): Promise<AgentInteractiveSessionStopAcknowledgement>;
389
377
  }
390
378
  export interface SandboxInstanceLike {
391
379
  id: string;
@@ -502,7 +490,10 @@ export interface SandboxInstanceLike {
502
490
  export interface SandboxSessionLike {
503
491
  readonly id: string;
504
492
  /** Exact native coding-agent TUI bound to this session id. */
505
- interactive?(): unknown;
493
+ interactive?(options?: {
494
+ ref?: AgentInteractiveSessionRef;
495
+ control?: AgentInteractiveSessionControlClaim;
496
+ }): unknown;
506
497
  status(options?: {
507
498
  signal?: AbortSignal;
508
499
  }): Promise<unknown | null>;