Skip to content

@codesoul-co/hypha-core / contracts/sandbox ​

Using this module ​

Use the Sandbox module for declaring and runtime-validating contracts. It exports 19 interfaces, 1 type.

Import from the package entrypoint ​

ts
import type {
  ExecutionEnvironmentSpec,
  ExecutionImageSpec,
  ExecutionLoggingPolicySpec,
  NetworkPolicySpec,
  ProcessPolicySpec,
  ResourceLimitSpec,
  SandboxCleanupRequest,
  SandboxCreateRequest,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns ​

  • Use the 20 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
ExecutionEnvironmentSpecinterfaceinterface ExecutionEnvironmentSpec extends VersionedSpec, SpecMetadataExecution Environment Spec interface with 23 public fields or methods.
ExecutionImageSpecinterfaceinterface ExecutionImageSpecExecution Image Spec interface with 8 public fields or methods.
ExecutionLoggingPolicySpecinterfaceinterface ExecutionLoggingPolicySpecExecution Logging Policy Spec interface with 7 public fields or methods.
NetworkPolicySpecinterfaceinterface NetworkPolicySpecNetwork Policy Spec interface with 16 public fields or methods.
ProcessPolicySpecinterfaceinterface ProcessPolicySpecProcess Policy Spec interface with 17 public fields or methods.
ResourceLimitSpecinterfaceinterface ResourceLimitSpecResource Limit Spec interface with 19 public fields or methods.
SandboxCleanupRequestinterfaceinterface SandboxCleanupRequestSandbox Cleanup Request interface with 6 public fields or methods.
SandboxCreateRequestinterfaceinterface SandboxCreateRequestSandbox Create Request interface with 12 public fields or methods.
SandboxFilesystemPolicySpecinterfaceinterface SandboxFilesystemPolicySpecSandbox Filesystem Policy Spec interface with 10 public fields or methods.
SandboxLifecyclePolicySpecinterfaceinterface SandboxLifecyclePolicySpecSandbox Lifecycle Policy Spec interface with 12 public fields or methods.
SandboxMountSpecinterfaceinterface SandboxMountSpecSandbox Mount Spec interface with 8 public fields or methods.
SandboxProviderCapabilitiesinterfaceinterface SandboxProviderCapabilitiesSandbox Provider Capabilities interface with 12 public fields or methods.
SandboxRecordinterfaceinterface SandboxRecordSandbox Record interface with 26 public fields or methods.
SandboxSecurityPolicySpecinterfaceinterface SandboxSecurityPolicySpecSandbox Security Policy Spec interface with 20 public fields or methods.
SandboxStartRequestinterfaceinterface SandboxStartRequestSandbox Start Request interface with 5 public fields or methods.
SandboxStatusRequestinterfaceinterface SandboxStatusRequestSandbox Status Request interface with 2 public fields or methods.
SandboxTerminateRequestinterfaceinterface SandboxTerminateRequestSandbox Terminate Request interface with 6 public fields or methods.
SandboxTmpfsSpecinterfaceinterface SandboxTmpfsSpecSandbox Tmpfs Spec interface with 6 public fields or methods.
SecretInjectionPolicySpecinterfaceinterface SecretInjectionPolicySpecSecret Injection Policy Spec interface with 8 public fields or methods.
SandboxStatustypetype SandboxStatus = 'creating' | 'created' | 'starting' | 'ready' | 'busy' | 'stopping' | 'stopped' | 'terminating' | 'terminated' | 'cleaning' | 'cleaned' | 'failed'Public type alias for Sandbox Status; the declaration contains its complete type expression.

ExecutionEnvironmentSpec ​

Execution Environment Spec interface with 23 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionEnvironmentSpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface ExecutionEnvironmentSpec extends VersionedSpec, SpecMetadata {
    revision?: string;
    provider: 'mock' | 'local_process' | 'docker' | 'remote_sandbox' | 'custom';
    providerRef?: string;
    image?: ExecutionImageSpec;
    process: ProcessPolicySpec;
    resources: ResourceLimitSpec;
    filesystem: SandboxFilesystemPolicySpec;
    network: NetworkPolicySpec;
    security: SandboxSecurityPolicySpec;
    secrets: SecretInjectionPolicySpec;
    logging: ExecutionLoggingPolicySpec;
    lifecycle: SandboxLifecyclePolicySpec;
    workingDirectoryPolicy: 'workspace_only' | 'configured_paths';
    defaultTimeoutMs: number;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
defaultTimeoutMspropertydefaultTimeoutMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
filesystempropertyfilesystem: SandboxFilesystemPolicySpecPublic 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.
imagepropertyimage?: ExecutionImageSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
lifecyclepropertylifecycle: SandboxLifecyclePolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
loggingpropertylogging: ExecutionLoggingPolicySpecPublic 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.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
networkpropertynetwork: NetworkPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
processpropertyprocess: ProcessPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: "mock" | "local_process" | "docker" | "remote_sandbox" | "custom"Public property; its type, readonly modifier and optionality are shown in the signature.
providerRefpropertyproviderRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resourcespropertyresources: ResourceLimitSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
secretspropertysecrets: SecretInjectionPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
securitypropertysecurity: SandboxSecurityPolicySpecPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workingDirectoryPolicypropertyworkingDirectoryPolicy: "workspace_only" | "configured_paths"Public property; its type, readonly modifier and optionality are shown in the signature.

ExecutionImageSpec ​

Execution Image Spec interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionImageSpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface ExecutionImageSpec {
    reference: string;
    digest?: string;
    platform?: string;
    pullPolicy?: 'never' | 'if_not_present' | 'always';
    trustedRegistryRefs?: string[];
    requireDigestPin?: boolean;
    sbomRef?: string;
    signaturePolicyRef?: string;
}

Contract members ​

MemberKindSignatureDescription
digestpropertydigest?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
platformpropertyplatform?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
pullPolicypropertypullPolicy?: "never" | "if_not_present" | "always"Public property; its type, readonly modifier and optionality are shown in the signature.
referencepropertyreference: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
requireDigestPinpropertyrequireDigestPin?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
sbomRefpropertysbomRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
signaturePolicyRefpropertysignaturePolicyRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
trustedRegistryRefspropertytrustedRegistryRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ExecutionLoggingPolicySpec ​

Execution Logging Policy Spec interface with 7 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionLoggingPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface ExecutionLoggingPolicySpec {
    captureStdout: boolean;
    captureStderr: boolean;
    streamOutput?: boolean;
    includeTimestamps?: boolean;
    maxLineBytes?: number;
    redactPatterns?: string[];
    persistOutputAsArtifact?: boolean;
}

Contract members ​

MemberKindSignatureDescription
captureStderrpropertycaptureStderr: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
captureStdoutpropertycaptureStdout: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includeTimestampspropertyincludeTimestamps?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
maxLineBytespropertymaxLineBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
persistOutputAsArtifactpropertypersistOutputAsArtifact?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
redactPatternspropertyredactPatterns?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
streamOutputpropertystreamOutput?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

NetworkPolicySpec ​

Network Policy Spec interface with 16 public fields or methods.

  • Kind: interface
  • Import: import type { NetworkPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface NetworkPolicySpec {
    mode: 'disabled' | 'restricted' | 'enabled' | 'task_authorized';
    allowedDomains?: string[];
    deniedDomains?: string[];
    allowedCidrs?: string[];
    deniedCidrs?: string[];
    allowedPorts?: number[];
    allowedProtocols?: Array<'tcp' | 'udp' | 'http' | 'https' | 'dns'>;
    dnsPolicy?: 'disabled' | 'system' | 'managed';
    proxyRef?: string;
    blockPrivateNetworks?: boolean;
    blockMetadataEndpoints?: boolean;
    resolveAndPinDns?: boolean;
    taskAuthorizationTtlSeconds?: number;
    maxConnections?: number;
    maxBytesSent?: number;
    maxBytesReceived?: number;
}

Contract members ​

MemberKindSignatureDescription
allowedCidrspropertyallowedCidrs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedDomainspropertyallowedDomains?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedPortspropertyallowedPorts?: number[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedProtocolspropertyallowedProtocols?: ("tcp" | "udp" | "http" | "https" | "dns")[]Public property; its type, readonly modifier and optionality are shown in the signature.
blockMetadataEndpointspropertyblockMetadataEndpoints?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
blockPrivateNetworkspropertyblockPrivateNetworks?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deniedCidrspropertydeniedCidrs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
deniedDomainspropertydeniedDomains?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
dnsPolicypropertydnsPolicy?: "system" | "managed" | "disabled"Public property; its type, readonly modifier and optionality are shown in the signature.
maxBytesReceivedpropertymaxBytesReceived?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxBytesSentpropertymaxBytesSent?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxConnectionspropertymaxConnections?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "disabled" | "restricted" | "enabled" | "task_authorized"Public property; its type, readonly modifier and optionality are shown in the signature.
proxyRefpropertyproxyRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resolveAndPinDnspropertyresolveAndPinDns?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
taskAuthorizationTtlSecondspropertytaskAuthorizationTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ProcessPolicySpec ​

Process Policy Spec interface with 17 public fields or methods.

  • Kind: interface
  • Import: import type { ProcessPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface ProcessPolicySpec {
    shellEnabled: boolean;
    allowedShells?: string[];
    allowedExecutables?: string[];
    deniedExecutables?: string[];
    executableResolution: 'absolute_allowlist' | 'path_allowlist' | 'container_path';
    maxProcesses?: number;
    maxThreads?: number;
    maxOpenFiles?: number;
    allowBackgroundProcesses?: boolean;
    allowDaemonization?: boolean;
    killProcessTreeOnExit: boolean;
    environmentAllowList?: string[];
    environmentDenyList?: string[];
    inheritHostEnvironment?: boolean;
    defaultUmask?: string;
    locale?: string;
    timezone?: string;
}

Contract members ​

MemberKindSignatureDescription
allowBackgroundProcessespropertyallowBackgroundProcesses?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowDaemonizationpropertyallowDaemonization?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedExecutablespropertyallowedExecutables?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowedShellspropertyallowedShells?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
defaultUmaskpropertydefaultUmask?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deniedExecutablespropertydeniedExecutables?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
environmentAllowListpropertyenvironmentAllowList?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
environmentDenyListpropertyenvironmentDenyList?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
executableResolutionpropertyexecutableResolution: "absolute_allowlist" | "path_allowlist" | "container_path"Public property; its type, readonly modifier and optionality are shown in the signature.
inheritHostEnvironmentpropertyinheritHostEnvironment?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
killProcessTreeOnExitpropertykillProcessTreeOnExit: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
localepropertylocale?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxOpenFilespropertymaxOpenFiles?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxProcessespropertymaxProcesses?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxThreadspropertymaxThreads?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
shellEnabledpropertyshellEnabled: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
timezonepropertytimezone?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ResourceLimitSpec ​

Resource Limit Spec interface with 19 public fields or methods.

  • Kind: interface
  • Import: import type { ResourceLimitSpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface ResourceLimitSpec {
    cpuCores?: number;
    cpuQuotaMicros?: number;
    cpuPeriodMicros?: number;
    cpuShares?: number;
    maxCpuSeconds?: number;
    memoryMb?: number;
    memorySwapMb?: number;
    oomKillDisable?: boolean;
    diskBytes?: number;
    tempBytes?: number;
    maxWriteBytes?: number;
    blockIoWeight?: number;
    pidsLimit?: number;
    maxOpenFiles?: number;
    maxStdoutBytes?: number;
    maxStderrBytes?: number;
    maxCombinedOutputBytes?: number;
    maxExecutionSeconds?: number;
    maxIdleSeconds?: number;
}

Contract members ​

MemberKindSignatureDescription
blockIoWeightpropertyblockIoWeight?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
cpuCorespropertycpuCores?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
cpuPeriodMicrospropertycpuPeriodMicros?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
cpuQuotaMicrospropertycpuQuotaMicros?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
cpuSharespropertycpuShares?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
diskBytespropertydiskBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxCombinedOutputBytespropertymaxCombinedOutputBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxCpuSecondspropertymaxCpuSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxExecutionSecondspropertymaxExecutionSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxIdleSecondspropertymaxIdleSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxOpenFilespropertymaxOpenFiles?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxStderrBytespropertymaxStderrBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxStdoutBytespropertymaxStdoutBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxWriteBytespropertymaxWriteBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memoryMbpropertymemoryMb?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
memorySwapMbpropertymemorySwapMb?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
oomKillDisablepropertyoomKillDisable?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
pidsLimitpropertypidsLimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
tempBytespropertytempBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxCleanupRequest ​

Sandbox Cleanup Request interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxCleanupRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxCleanupRequest {
    operationId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    expectedRevision: number;
    reason?: string;
    idempotencyKey?: string;
}

Contract members ​

MemberKindSignatureDescription
expectedRevisionpropertyexpectedRevision: 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.
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.
reasonpropertyreason?: 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.

SandboxCreateRequest ​

Sandbox Create Request interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxCreateRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxCreateRequest {
    operationId: string;
    principal: ExecutionPrincipal;
    environment: ExecutionEnvironmentSpec;
    environmentRevision: string;
    userId: string;
    tenantId?: string;
    workspaceId: string;
    sessionId?: string;
    runId: string;
    agentId?: string;
    idempotencyKey?: string;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentpropertyenvironment: ExecutionEnvironmentSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentRevisionpropertyenvironmentRevision: 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.
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.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxFilesystemPolicySpec ​

Sandbox Filesystem Policy Spec interface with 10 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxFilesystemPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxFilesystemPolicySpec {
    rootFilesystem: 'read_only' | 'writable';
    mounts: SandboxMountSpec[];
    tmpfs?: SandboxTmpfsSpec[];
    maskPaths?: string[];
    readonlyPaths?: string[];
    writablePaths?: string[];
    allowDeviceAccess?: boolean;
    allowedDevices?: string[];
    allowHostPathMounts?: boolean;
    maxMounts?: number;
}

Contract members ​

MemberKindSignatureDescription
allowDeviceAccesspropertyallowDeviceAccess?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedDevicespropertyallowedDevices?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowHostPathMountspropertyallowHostPathMounts?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
maskPathspropertymaskPaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
maxMountspropertymaxMounts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
mountspropertymounts: SandboxMountSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
readonlyPathspropertyreadonlyPaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
rootFilesystempropertyrootFilesystem: "read_only" | "writable"Public property; its type, readonly modifier and optionality are shown in the signature.
tmpfspropertytmpfs?: SandboxTmpfsSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
writablePathspropertywritablePaths?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

SandboxLifecyclePolicySpec ​

Sandbox Lifecycle Policy Spec interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxLifecyclePolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxLifecyclePolicySpec {
    reuse: 'never' | 'run' | 'session' | 'pool';
    idleTtlSeconds?: number;
    maxLifetimeSeconds?: number;
    maxExecutions?: number;
    createTimeoutMs?: number;
    startTimeoutMs?: number;
    stopTimeoutMs?: number;
    cleanupTimeoutMs?: number;
    snapshotOnFailure?: boolean;
    cleanupOnSuccess?: boolean;
    cleanupOnFailure?: boolean;
    retainForDebugSeconds?: number;
}

Contract members ​

MemberKindSignatureDescription
cleanupOnFailurepropertycleanupOnFailure?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
cleanupOnSuccesspropertycleanupOnSuccess?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
cleanupTimeoutMspropertycleanupTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
createTimeoutMspropertycreateTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
idleTtlSecondspropertyidleTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxExecutionspropertymaxExecutions?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxLifetimeSecondspropertymaxLifetimeSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
retainForDebugSecondspropertyretainForDebugSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
reusepropertyreuse: "session" | "run" | "never" | "pool"Public property; its type, readonly modifier and optionality are shown in the signature.
snapshotOnFailurepropertysnapshotOnFailure?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
startTimeoutMspropertystartTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
stopTimeoutMspropertystopTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxMountSpec ​

Sandbox Mount Spec interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxMountSpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxMountSpec {
    sourceRef: string;
    targetPath: string;
    mode: 'ro' | 'rw';
    type: 'bind' | 'volume' | 'artifact' | 'workspace' | 'tmpfs';
    propagation?: 'private' | 'rprivate';
    noExec?: boolean;
    noSuid?: boolean;
    noDev?: boolean;
}

Contract members ​

MemberKindSignatureDescription
modepropertymode: "ro" | "rw"Public property; its type, readonly modifier and optionality are shown in the signature.
noDevpropertynoDev?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
noExecpropertynoExec?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
noSuidpropertynoSuid?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
propagationpropertypropagation?: "private" | "rprivate"Public property; its type, readonly modifier and optionality are shown in the signature.
sourceRefpropertysourceRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
targetPathpropertytargetPath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "artifact" | "workspace" | "bind" | "volume" | "tmpfs"Public property; its type, readonly modifier and optionality are shown in the signature.

SandboxProviderCapabilities ​

Sandbox Provider Capabilities interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxProviderCapabilities } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxProviderCapabilities {
    processIsolation: boolean;
    filesystemIsolation: boolean;
    networkIsolation: boolean;
    cpuLimits: boolean;
    memoryLimits: boolean;
    diskLimits: boolean;
    pidsLimit: boolean;
    cancellation: boolean;
    processTreeKill: boolean;
    snapshots: boolean;
    imageDigestPinning: boolean;
    remoteExecution: boolean;
}

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: booleanPublic 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.

SandboxRecord ​

Sandbox Record interface with 26 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxRecord } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxRecord {
    id: string;
    revision: number;
    providerId: string;
    environmentRef: SpecRef;
    environmentRevision: string;
    tenantId?: string;
    userId: string;
    workspaceId: string;
    sessionId?: string;
    runId: string;
    agentId?: string;
    status: SandboxStatus;
    providerSandboxRef?: string;
    imageDigest?: string;
    activeExecutionIds: string[];
    resourceLimits: ResourceLimitSpec;
    networkPolicyHash: string;
    mountPolicyHash: string;
    createdAt: string;
    readyAt?: string;
    lastUsedAt?: string;
    expiresAt?: string;
    terminatedAt?: string;
    cleanedAt?: string;
    error?: NormalizedExecutionError;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
activeExecutionIdspropertyactiveExecutionIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
cleanedAtpropertycleanedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentRefpropertyenvironmentRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
environmentRevisionpropertyenvironmentRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedExecutionErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
expiresAtpropertyexpiresAt?: stringPublic 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.
imageDigestpropertyimageDigest?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastUsedAtpropertylastUsedAt?: 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.
mountPolicyHashpropertymountPolicyHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
networkPolicyHashpropertynetworkPolicyHash: stringPublic 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.
providerSandboxRefpropertyproviderSandboxRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
readyAtpropertyreadyAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resourceLimitspropertyresourceLimits: ResourceLimitSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: SandboxStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
terminatedAtpropertyterminatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxSecurityPolicySpec ​

Sandbox Security Policy Spec interface with 20 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxSecurityPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxSecurityPolicySpec {
    runAsUser?: string;
    runAsGroup?: string;
    nonRootRequired: boolean;
    noNewPrivileges: boolean;
    privileged: boolean;
    dropCapabilities?: string[];
    addCapabilities?: string[];
    seccompProfileRef?: string;
    appArmorProfileRef?: string;
    selinuxLabelRef?: string;
    userNamespace?: boolean;
    pidNamespace?: boolean;
    networkNamespace?: boolean;
    ipcNamespace?: boolean;
    utsNamespace?: boolean;
    readOnlyProc?: boolean;
    maskHostProc?: boolean;
    preventPtrace?: boolean;
    allowNestedContainers?: boolean;
    metadata?: Record<string, unknown>;
}

Contract members ​

MemberKindSignatureDescription
addCapabilitiespropertyaddCapabilities?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
allowNestedContainerspropertyallowNestedContainers?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
appArmorProfileRefpropertyappArmorProfileRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dropCapabilitiespropertydropCapabilities?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
ipcNamespacepropertyipcNamespace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
maskHostProcpropertymaskHostProc?: booleanPublic 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.
networkNamespacepropertynetworkNamespace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
noNewPrivilegespropertynoNewPrivileges: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
nonRootRequiredpropertynonRootRequired: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
pidNamespacepropertypidNamespace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
preventPtracepropertypreventPtrace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
privilegedpropertyprivileged: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
readOnlyProcpropertyreadOnlyProc?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
runAsGrouppropertyrunAsGroup?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runAsUserpropertyrunAsUser?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
seccompProfileRefpropertyseccompProfileRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
selinuxLabelRefpropertyselinuxLabelRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userNamespacepropertyuserNamespace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
utsNamespacepropertyutsNamespace?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxStartRequest ​

Sandbox Start Request interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxStartRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxStartRequest {
    operationId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    expectedRevision: number;
    idempotencyKey?: string;
}

Contract members ​

MemberKindSignatureDescription
expectedRevisionpropertyexpectedRevision: 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.
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.

SandboxStatusRequest ​

Sandbox Status Request interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxStatusRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxStatusRequest {
    sandboxId: string;
    principal: ExecutionPrincipal;
}

Contract members ​

MemberKindSignatureDescription
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.

SandboxTerminateRequest ​

Sandbox Terminate Request interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxTerminateRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxTerminateRequest {
    operationId: string;
    sandboxId: string;
    principal: ExecutionPrincipal;
    expectedRevision: number;
    reason?: string;
    idempotencyKey?: string;
}

Contract members ​

MemberKindSignatureDescription
expectedRevisionpropertyexpectedRevision: 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.
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.
reasonpropertyreason?: 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.

SandboxTmpfsSpec ​

Sandbox Tmpfs Spec interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { SandboxTmpfsSpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SandboxTmpfsSpec {
    targetPath: string;
    sizeBytes?: number;
    mode?: number;
    noExec?: boolean;
    noSuid?: boolean;
    noDev?: boolean;
}

Contract members ​

MemberKindSignatureDescription
modepropertymode?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
noDevpropertynoDev?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
noExecpropertynoExec?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
noSuidpropertynoSuid?: booleanPublic 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.
targetPathpropertytargetPath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

SecretInjectionPolicySpec ​

Secret Injection Policy Spec interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { SecretInjectionPolicySpec } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export interface SecretInjectionPolicySpec {
    allowedSecretRefs?: string[];
    injectionMode: 'none' | 'environment' | 'file' | 'brokered';
    exposeNamesOnly?: boolean;
    redactFromOutput: boolean;
    redactFromEvents: boolean;
    ttlSeconds?: number;
    revokeOnExecutionEnd?: boolean;
    allowChildProcessInheritance?: boolean;
}

Contract members ​

MemberKindSignatureDescription
allowChildProcessInheritancepropertyallowChildProcessInheritance?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
allowedSecretRefspropertyallowedSecretRefs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
exposeNamesOnlypropertyexposeNamesOnly?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
injectionModepropertyinjectionMode: "none" | "environment" | "file" | "brokered"Public property; its type, readonly modifier and optionality are shown in the signature.
redactFromEventspropertyredactFromEvents: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
redactFromOutputpropertyredactFromOutput: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
revokeOnExecutionEndpropertyrevokeOnExecutionEnd?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
ttlSecondspropertyttlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

SandboxStatus ​

Public type alias for Sandbox Status; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { SandboxStatus } from '@codesoul-co/hypha-core';
  • Source module: contracts/sandbox

Declaration ​

text
export type SandboxStatus = 'creating' | 'created' | 'starting' | 'ready' | 'busy' | 'stopping' | 'stopped' | 'terminating' | 'terminated' | 'cleaning' | 'cleaned' | 'failed';