Skip to content

@codesoul-co/hypha-core / contracts/remote-sandbox-provider

Using this module

Use the Remote sandbox provider module for declaring and runtime-validating contracts. It exports 10 interfaces, 1 type.

Import from the package entrypoint

ts
import type {
  RemoteArtifactChunk,
  RemoteArtifactChunkSequenceExpectation,
  RemoteArtifactDownloadRequest,
  RemoteArtifactTransferReceipt,
  RemoteArtifactUploadRequest,
  RemoteExecutionReconciliationRequest,
  RemoteExecutionReconciliationResult,
  RemoteOutputStreamRequest,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 11 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.

Public exports

SymbolKindSignatureDescription
RemoteArtifactChunkinterfaceinterface RemoteArtifactChunkRemote Artifact Chunk interface with 9 public fields or methods.
RemoteArtifactChunkSequenceExpectationinterfaceinterface RemoteArtifactChunkSequenceExpectationRemote Artifact Chunk Sequence Expectation interface with 3 public fields or methods.
RemoteArtifactDownloadRequestinterfaceinterface RemoteArtifactDownloadRequestRemote Artifact Download Request interface with 9 public fields or methods.
RemoteArtifactTransferReceiptinterfaceinterface RemoteArtifactTransferReceiptRemote Artifact Transfer Receipt interface with 12 public fields or methods.
RemoteArtifactUploadRequestinterfaceinterface RemoteArtifactUploadRequestRemote Artifact Upload Request interface with 12 public fields or methods.
RemoteExecutionReconciliationRequestinterfaceinterface RemoteExecutionReconciliationRequestRemote Execution Reconciliation Request interface with 8 public fields or methods.
RemoteExecutionReconciliationResultinterfaceinterface RemoteExecutionReconciliationResultRemote Execution Reconciliation Result interface with 8 public fields or methods.
RemoteOutputStreamRequestinterfaceinterface RemoteOutputStreamRequestRemote Output Stream Request interface with 8 public fields or methods.
RemoteSandboxProviderinterfaceinterface RemoteSandboxProvider extends SandboxProviderRemote Sandbox Provider interface with 15 public fields or methods.
RemoteSandboxProviderCapabilitiesinterfaceinterface RemoteSandboxProviderCapabilities extends SandboxProviderCapabilitiesRemote Sandbox Provider Capabilities interface with 12 public fields or methods.
RemoteExecutionReconciliationStatetypetype RemoteExecutionReconciliationState = 'not_found' | 'accepted' | 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown'Public type alias for Remote Execution Reconciliation State; the declaration contains its complete type expression.

RemoteArtifactChunk

Remote Artifact Chunk interface with 9 public fields or methods.

Declaration

text
export interface RemoteArtifactChunk {
    transferId: string;
    artifactRef: string;
    sequence: number;
    offsetBytes: number;
    encoding: 'base64';
    content: string;
    byteLength: number;
    contentHash: string;
    final: boolean;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
byteLengthpropertybyteLength: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
contentpropertycontent: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
encodingpropertyencoding: "base64"Public property; its type, readonly modifier and optionality are shown in the signature.
finalpropertyfinal: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
offsetBytespropertyoffsetBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
sequencepropertysequence: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
transferIdpropertytransferId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteArtifactChunkSequenceExpectation

Remote Artifact Chunk Sequence Expectation interface with 3 public fields or methods.

Declaration

text
export interface RemoteArtifactChunkSequenceExpectation {
    transferId: string;
    artifactRef: string;
    sizeBytes: number;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
transferIdpropertytransferId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteArtifactDownloadRequest

Remote Artifact Download Request interface with 9 public fields or methods.

Declaration

text
export interface RemoteArtifactDownloadRequest {
    operationId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    artifactRef: string;
    maxBytes: number;
    expectedContentHash?: string;
    correlationId?: string;
    causationId?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedContentHashpropertyexpectedContentHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxBytespropertymaxBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
sandboxIdpropertysandboxId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteArtifactTransferReceipt

Remote Artifact Transfer Receipt interface with 12 public fields or methods.

Declaration

text
export interface RemoteArtifactTransferReceipt {
    id: string;
    providerId: string;
    sandboxId: string;
    artifactRef: string;
    direction: 'upload' | 'download';
    status: 'accepted' | 'completed' | 'rejected' | 'unknown';
    sizeBytes: number;
    contentHash?: string;
    providerTransferRef?: string;
    issuedAt: string;
    receiptHash: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
directionpropertydirection: "upload" | "download"Public property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
issuedAtpropertyissuedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
providerIdpropertyproviderId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerTransferRefpropertyproviderTransferRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
receiptHashpropertyreceiptHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sandboxIdpropertysandboxId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "unknown" | "accepted" | "completed" | "rejected"Public property; its type, readonly modifier and optionality are shown in the signature.

RemoteArtifactUploadRequest

Remote Artifact Upload Request interface with 12 public fields or methods.

Declaration

text
export interface RemoteArtifactUploadRequest {
    operationId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    expectedSandboxRevision: number;
    artifactRef: string;
    sizeBytes: number;
    contentHash: string;
    mediaType?: string;
    idempotencyKey: string;
    correlationId?: string;
    causationId?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
expectedSandboxRevisionpropertyexpectedSandboxRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
mediaTypepropertymediaType?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
sandboxIdpropertysandboxId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteExecutionReconciliationRequest

Remote Execution Reconciliation Request interface with 8 public fields or methods.

Declaration

text
export interface RemoteExecutionReconciliationRequest {
    operationId: string;
    executionId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    providerExecutionRef?: string;
    idempotencyKey?: string;
    correlationId?: string;
    causationId?: string;
}

Contract members

MemberKindSignatureDescription
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
executionIdpropertyexecutionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
providerExecutionRefpropertyproviderExecutionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sandboxIdpropertysandboxId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteExecutionReconciliationResult

Remote Execution Reconciliation Result interface with 8 public fields or methods.

Declaration

text
export interface RemoteExecutionReconciliationResult {
    executionId: string;
    sandboxId: string;
    state: RemoteExecutionReconciliationState;
    providerExecutionRef?: string;
    observedAt: string;
    result?: CommandExecutionResult;
    receipt?: ExecutionReceipt;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
executionIdpropertyexecutionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
observedAtpropertyobservedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerExecutionRefpropertyproviderExecutionRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
receiptpropertyreceipt?: ExecutionReceiptPublic property; its type, readonly modifier and optionality are shown in the signature.
resultpropertyresult?: CommandExecutionResultPublic property; its type, readonly modifier and optionality are shown in the signature.
sandboxIdpropertysandboxId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate: RemoteExecutionReconciliationStatePublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteOutputStreamRequest

Remote Output Stream Request interface with 8 public fields or methods.

Declaration

text
export interface RemoteOutputStreamRequest {
    operationId: string;
    executionId: string;
    principal: ExecutionPrincipal;
    fromSequence?: number;
    maxChunks?: number;
    follow?: boolean;
    correlationId?: string;
    causationId?: string;
}

Contract members

MemberKindSignatureDescription
causationIdpropertycausationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
correlationIdpropertycorrelationId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
executionIdpropertyexecutionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
followpropertyfollow?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
fromSequencepropertyfromSequence?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxChunkspropertymaxChunks?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteSandboxProvider

Remote Sandbox Provider interface with 15 public fields or methods.

Declaration

text
export interface RemoteSandboxProvider extends SandboxProvider {
    capabilities(): Promise<RemoteSandboxProviderCapabilities>;
    reconcileExecution(request: RemoteExecutionReconciliationRequest): Promise<RemoteExecutionReconciliationResult>;
    streamOutput(request: RemoteOutputStreamRequest): AsyncIterable<CommandOutputChunk>;
    uploadArtifact(request: RemoteArtifactUploadRequest, chunks: AsyncIterable<RemoteArtifactChunk>): Promise<RemoteArtifactTransferReceipt>;
    downloadArtifact(request: RemoteArtifactDownloadRequest): AsyncIterable<RemoteArtifactChunk>;
}

Contract members

MemberKindSignatureDescription
cancelmethodcancel(request: ExecutionCancelRequest): Promise<void>Public method; parameters and return type are shown in the signature.
capabilitiesmethodcapabilities(): Promise<RemoteSandboxProviderCapabilities>Public method; parameters and return type are shown in the signature.
cleanupmethodcleanup(request: SandboxCleanupRequest): Promise<void>Public method; parameters and return type are shown in the signature.
closemethodclose?(): Promise<void>Public method; parameters and return type are shown in the signature.
createmethodcreate(request: SandboxCreateRequest): Promise<SandboxRecord>Public method; parameters and return type are shown in the signature.
downloadArtifactmethoddownloadArtifact(request: RemoteArtifactDownloadRequest): AsyncIterable<RemoteArtifactChunk>Public method; parameters and return type are shown in the signature.
executemethodexecute(request: CommandExecutionRequest): Promise<CommandExecutionResult>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): Promise<ProviderHealth>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reconcileExecutionmethodreconcileExecution(request: RemoteExecutionReconciliationRequest): Promise<RemoteExecutionReconciliationResult>Public method; parameters and return type are shown in the signature.
startmethodstart(request: SandboxStartRequest): Promise<SandboxRecord>Public method; parameters and return type are shown in the signature.
statusmethodstatus(request: SandboxStatusRequest): Promise<SandboxRecord | null>Public method; parameters and return type are shown in the signature.
streamOutputmethodstreamOutput(request: RemoteOutputStreamRequest): AsyncIterable<CommandOutputChunk>Public method; parameters and return type are shown in the signature.
terminatemethodterminate(request: SandboxTerminateRequest): Promise<void>Public method; parameters and return type are shown in the signature.
uploadArtifactmethoduploadArtifact(request: RemoteArtifactUploadRequest, chunks: AsyncIterable<RemoteArtifactChunk>): Promise<RemoteArtifactTransferReceipt>Public method; parameters and return type are shown in the signature.

RemoteSandboxProviderCapabilities

Remote Sandbox Provider Capabilities interface with 12 public fields or methods.

Declaration

text
export interface RemoteSandboxProviderCapabilities extends SandboxProviderCapabilities {
    remoteExecution: true;
}

Contract members

MemberKindSignatureDescription
cancellationpropertycancellation: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
cpuLimitspropertycpuLimits: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
diskLimitspropertydiskLimits: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
filesystemIsolationpropertyfilesystemIsolation: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
imageDigestPinningpropertyimageDigestPinning: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryLimitspropertymemoryLimits: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
networkIsolationpropertynetworkIsolation: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
pidsLimitpropertypidsLimit: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
processIsolationpropertyprocessIsolation: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
processTreeKillpropertyprocessTreeKill: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
remoteExecutionpropertyremoteExecution: truePublic property; its type, readonly modifier and optionality are shown in the signature.
snapshotspropertysnapshots: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

RemoteExecutionReconciliationState

Public type alias for Remote Execution Reconciliation State; the declaration contains its complete type expression.

Declaration

text
export type RemoteExecutionReconciliationState = 'not_found' | 'accepted' | 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown';