Stow
API referenceView source

TypeScript process API

Start a private native S3 server, connect to an existing endpoint, or run a scoped session. Import from @chester-hill-solutions/stow-s3.

Defaults and limits

Setting Value
Session maxBytes / maxObjects 16 MiB / 1,000 objects
maxRequestBytes / maxConcurrentRequests 8 MiB / 16 active requests
StartOptions.timeoutMs 10,000 ms, including initial bucket creation
StartOptions.mode Local unless run-through is explicitly selected; credentials alone do not select it
Credentials and port Generated credentials; use the endpoint returned by startup
forcePathStyle true; credential providers take precedence over static credentials

Behavior

  • withStow closes its session after the callback.
  • openStow requires an explicit close.
  • Sessions strip inherited cloud settings.
  • Stow.start preserves the child environment unless isolatedEnvironment is enabled.
  • A session removes only its own temporary directory; a supplied dataDir remains.
  • Closing a connection destroys its SDK client without stopping the remote server.

Errors

  • Startup can fail on cancellation, timeout, missing binaries or invalid readiness.
  • StowProtocolError exposes code; StowOwnershipError rejects unsafe directory resets.
  • SDK object requests use S3 errors.
  • Workspace helpers reject failed commands.
  • A callback failure remains observable if cleanup also fails.

Example

TypeScript6 lines
import { withStow } from "@chester-hill-solutions/stow-s3";
import { PutObjectCommand } from "@aws-sdk/client-s3";

await withStow(async ({ s3, bucket }) => {
  await s3.send(new PutObjectCommand({ Bucket: bucket, Key: "note", Body: "hello" }));
});

Symbols

AwsSdkV3ConfigOptions · checkpointWorkspace · collectWorkspaces · ConnectOptions · default · DEFAULT_SESSION_MAX_BYTES · DEFAULT_SESSION_MAX_OBJECTS · destroyWorkspace · diffWorkspaces · EMBEDDED_PROTOCOL_VERSION · EmbeddedBucket · EmbeddedCapabilities · EmbeddedHost · EmbeddedListOptions · EmbeddedObject · EmbeddedObjectPage · EmbeddedPutOptions · EmbeddedSaveObservation · EmbeddedSaveOptions · EmbeddedSaveResult · EmbeddedStow · EmbeddedStowError · EmbeddedStowOptions · EmbeddedUsage · EphemeralStowOptions · exportWorkspaceCheckpoint · handoffWorkspace · importWorkspaceCheckpoint · loadNodeWasmHost · NodeWasmHost · ObjectSnapshot · openStow · parseReadyLine · parseReadyMessage · prepareWorkspace · pruneWorkspaces · PutFixtureOptions · READY_PROTOCOL_VERSION · resetOwnedData · resolveStowBinary · restoreWorkspaceCheckpoint · resumeWorkspace · ResumeWorkspaceOptions · runWorkspaceCommand · ServedWorkspace · serveWorkspace · ServeWorkspaceOptions · StartOptions · Stow · STOW_OWNER_MARKER · stowBinaryAvailable · StowBinaryNotFoundError · StowConnection · StowInstance · StowMode · StowOwnershipError · StowProtocolError · StowReady · StowReadyCapabilities · StowSession · StowSessionCapabilities · UpstreamConfig · upstreamFromEnv · withStow · WorkspaceArchiveOptions · WorkspaceCheckpointOptions · WorkspaceJSON

AwsSdkV3ConfigOptions

TypeScript11 lines
type AwsSdkV3ConfigOptions = (AwsSdkV3ConfigBase & {
    accessKeyId: string;
    secretAccessKey: string;
    sessionToken?: string;
    provider?: AwsCredentialIdentityProvider;
}) | (AwsSdkV3ConfigBase & {
    provider: AwsCredentialIdentityProvider;
    accessKeyId?: string;
    secretAccessKey?: string;
    sessionToken?: string;
});

checkpointWorkspace

Capture an immutable checkpoint of paused writers.

TypeScript1 line
checkpointWorkspace(options: WorkspaceCheckpointOptions): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
options WorkspaceCheckpointOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

collectWorkspaces

Collect expired workspaces that are unused and eligible for deletion.

TypeScript1 line
collectWorkspaces(registryDir?: string | undefined): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
registryDir string | undefined No — Native registry directory for workspace metadata.

Returns: Promise<Readonly<Record<string, unknown>>>.

ConnectOptions

TypeScript1 line
type ConnectOptions = AwsSdkV3ConfigOptions;

default

The same Stow helper object as the named export.

TypeScript1 line
const Stow: { start(options?: StartOptions | undefined): Promise<StowInstance>; connect(options: AwsSdkV3ConfigOptions): StowConnection; awsSdkV3Config(options: StowInstance | AwsSdkV3ConfigOptions): S3ClientConfig; upstream: { fromEnv(): UpstreamConfig | null; }; };

default.start

Start a native server and create the requested buckets before returning its handle.

TypeScript1 line
start(options?: StartOptions | undefined): Promise<StowInstance>
Parameter Type Required Default Meaning
options StartOptions | undefined No — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<StowInstance>.

default.connect

Create an owned SDK client for an existing endpoint; disconnect it when finished.

TypeScript1 line
connect(options: AwsSdkV3ConfigOptions): StowConnection
Parameter Type Required Default Meaning
options AwsSdkV3ConfigOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: StowConnection.

default.awsSdkV3Config

Return AWS SDK connection settings with local credentials and path-style addressing by default.

TypeScript1 line
awsSdkV3Config(options: StowInstance | AwsSdkV3ConfigOptions): S3ClientConfig
Parameter Type Required Default Meaning
options StowInstance | AwsSdkV3ConfigOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: S3ClientConfig.

DEFAULT_SESSION_MAX_BYTES

Default session storage limit: 16 MiB.

TypeScript1 line
const DEFAULT_SESSION_MAX_BYTES: number;

DEFAULT_SESSION_MAX_OBJECTS

Default session object count: 1,000.

TypeScript1 line
const DEFAULT_SESSION_MAX_OBJECTS: 1000;

destroyWorkspace

Explicitly destroy a registered, eligible workspace.

TypeScript1 line
destroyWorkspace(id: string, registryDir?: string | undefined): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
registryDir string | undefined No — Native registry directory for workspace metadata.

Returns: Promise<Readonly<Record<string, unknown>>>.

diffWorkspaces

Compare two checkpoints and return changed paths.

TypeScript1 line
diffWorkspaces(from: string, to: string, registryDir?: string | undefined, team?: string | undefined): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
from string Yes —
to string Yes —
registryDir string | undefined No — Native registry directory for workspace metadata.
team string | undefined No — Registry team partition; it is not an authorization identity.

Returns: Promise<Readonly<Record<string, unknown>>>.

EMBEDDED_PROTOCOL_VERSION

TypeScript1 line
const EMBEDDED_PROTOCOL_VERSION: 1;

EmbeddedBucket

TypeScript4 lines
interface EmbeddedBucket {
  name: string;
  creationDate?: string | undefined;
}
Field Type Optional Description
name string No Name identifying this bucket, head, protection or error class.
creationDate string | undefined Yes

EmbeddedCapabilities

TypeScript13 lines
interface EmbeddedCapabilities {
  backend: "memory" | "indexeddb" | "host";
  maxBytes: number;
  maxObjects: number;
  persistent: boolean;
  multipart: boolean;
  upstream: boolean;
  conditionalWrites?: boolean | undefined;
  guardedSaves?: boolean | undefined;
  durableSaveRequests?: boolean | undefined;
  recoveryHolds?: boolean | undefined;
  hostMaintenance?: boolean | undefined;
}
Field Type Optional Description
backend "memory" | "indexeddb" | "host" No Storage implementation selected or reported by this handle.
maxBytes number No Maximum managed object bytes; zero means unlimited.
maxObjects number No Maximum object count; zero means unlimited.
persistent boolean No Whether this backend retains data after the handle closes.
multipart boolean No Whether this handle supports multipart operations.
upstream boolean No Whether this handle can use an upstream provider.
conditionalWrites boolean | undefined Yes Whether atomic ETag write conditions are supported.
guardedSaves boolean | undefined Yes Whether the underlying runtime can compare an observation atomically at publication.
durableSaveRequests boolean | undefined Yes Whether a save request key is retained, so a lost reply can be resolved.
recoveryHolds boolean | undefined Yes Whether an observed object's bytes can be protected from mutation until release.
hostMaintenance boolean | undefined Yes Whether namespace recovery inspection and garbage collection are supported.

EmbeddedHost

TypeScript4 lines
interface EmbeddedHost {
  call(request: string): string;
  callBinary(metadata: string, data?: Uint8Array<ArrayBufferLike> | undefined): EmbeddedBinaryResponse;
}

EmbeddedHost.call

TypeScript1 line
call(request: string): string
Parameter Type Required Default Meaning
request string Yes —

Returns: string.

EmbeddedHost.callBinary

Binary calls preserve caller ownership; returned bytes belong to the caller.

TypeScript1 line
callBinary(metadata: string, data?: Uint8Array<ArrayBufferLike> | undefined): EmbeddedBinaryResponse
Parameter Type Required Default Meaning
metadata string Yes — Serialized binary-bridge request or response metadata.
data Uint8Array<ArrayBufferLike> | undefined No — Object bytes. Input ownership and size rules depend on the method.

Returns: EmbeddedBinaryResponse.

EmbeddedListOptions

TypeScript6 lines
interface EmbeddedListOptions {
  prefix?: string | undefined;
  delimiter?: string | undefined;
  cursor?: string | undefined;
  limit?: number | undefined;
}
Field Type Optional Description
prefix string | undefined Yes Only list keys beginning with this prefix.
delimiter string | undefined Yes Groups keys that share it into commonPrefixes; empty lists every key.
cursor string | undefined Yes Opaque continuation value returned by the previous page.
limit number | undefined Yes Maximum results per page; limits and defaults depend on the listing API.

EmbeddedObject

TypeScript10 lines
interface EmbeddedObject {
  bucket: string;
  key: string;
  data?: Uint8Array<ArrayBufferLike> | undefined;
  size: number;
  etag: string;
  contentType?: string | undefined;
  metadata?: Record<string, string> | undefined;
  lastModified?: string | undefined;
}
Field Type Optional Description
bucket string No Bucket name. Create it before storing objects.
key string No Object or file key within the selected bucket or project.
data Uint8Array<ArrayBufferLike> | undefined Yes Object bytes. Input ownership and size rules depend on the method.
size number No Total object or content size in bytes; stream uploads require an exact declaration.
etag string No Content validator returned by the store or provider.
contentType string | undefined Yes MIME content type attached to the object or file.
metadata Record<string, string> | undefined Yes User metadata included in storage and sync comparisons.
lastModified string | undefined Yes

EmbeddedObjectPage

TypeScript6 lines
interface EmbeddedObjectPage {
  objects: EmbeddedObject[];
  truncated: boolean;
  nextCursor?: string | undefined;
  commonPrefixes?: string[] | undefined;
}
Field Type Optional Description
objects EmbeddedObject[] No Objects returned by the listing or persistence snapshot.
truncated boolean No Whether additional matching objects remain.
nextCursor string | undefined Yes Continuation value for the next page when truncated is true.
commonPrefixes string[] | undefined Yes The delimiter groups this page collapsed, in row order.

EmbeddedPutOptions

TypeScript6 lines
interface EmbeddedPutOptions {
  contentType?: string | undefined;
  metadata?: Record<string, string> | undefined;
  ifMatch?: string | undefined;
  ifNoneMatch?: string | undefined;
}
Field Type Optional Description
contentType string | undefined Yes MIME content type attached to the object or file.
metadata Record<string, string> | undefined Yes User metadata included in storage and sync comparisons.
ifMatch string | undefined Yes Write only when the current content ETag matches; empty means unset.
ifNoneMatch string | undefined Yes Use * to create only when absent; empty means unset.

EmbeddedSaveObservation

What a read-for-save observed: the bytes, whether the key was absent, and the token a save compares against.

TypeScript5 lines
interface EmbeddedSaveObservation {
  object: EmbeddedObject;
  absent: boolean;
  observationToken: string;
}
Field Type Optional Description
object EmbeddedObject No
absent boolean No
observationToken string No

EmbeddedSaveOptions

TypeScript7 lines
interface EmbeddedSaveOptions {
  observationToken?: string | undefined;
  replace?: boolean | undefined;
  contentType?: string | undefined;
  metadata?: Record<string, string> | undefined;
  requestKey?: string | undefined;
}
Field Type Optional Description
observationToken string | undefined Yes The token from readForSave.
replace boolean | undefined Yes Publish without comparing, deliberately replacing whatever is stored.
contentType string | undefined Yes MIME content type attached to the object or file.
metadata Record<string, string> | undefined Yes User metadata included in storage and sync comparisons.
requestKey string | undefined Yes Unique persisted request identity for capture or save recovery.

EmbeddedSaveResult

Only committed proves the write; a thrown error does not prove non-commit.

TypeScript5 lines
interface EmbeddedSaveResult {
  object: EmbeddedObject;
  outcome: "committed" | "not_committed" | "unknown";
  replayed: boolean;
}
Field Type Optional Description
object EmbeddedObject No Commit metadata; payload bytes may be absent, as in the native save result.
outcome "committed" | "not_committed" | "unknown" No
replayed boolean No True when a retained request answered instead of the write being attempted.

EmbeddedStow

TypeScript21 lines
class EmbeddedStow {
  static open(host: EmbeddedHost, options?: EmbeddedStowOptions): EmbeddedStow;
  readonly handle: number;
  capabilities(): EmbeddedCapabilities;
  usage(): EmbeddedUsage;
  createBucket(bucket: string): void;
  deleteBucket(bucket: string): void;
  listBuckets(): EmbeddedBucket[];
  putObject(bucket: string, key: string, data: Uint8Array<ArrayBufferLike>, options?: EmbeddedPutOptions): EmbeddedObject;
  getObject(bucket: string, key: string): EmbeddedObject;
  headObject(bucket: string, key: string): EmbeddedObject;
  listObjects(bucket: string, options?: EmbeddedListOptions): EmbeddedObjectPage;
  deleteObject(bucket: string, key: string): void;
  readForSave(bucket: string, key: string): EmbeddedSaveObservation;
  saveObject(bucket: string, key: string, data: Uint8Array<ArrayBufferLike>, options?: EmbeddedSaveOptions): EmbeddedSaveResult;
  resolveSave(bucket: string, key: string, requestKey: string): EmbeddedSaveResult;
  releaseObservation(observationToken: string): void;
  copyObject(sourceBucket: string, sourceKey: string, destinationBucket: string, destinationKey: string): EmbeddedObject;
  reset(): void;
  close(): void;
}
Field Type Optional Description
handle number No Open runtime handle issued by the WASM bridge.

EmbeddedStow.open

Open a handle. Retain it until operations finish, then close it.

TypeScript1 line
open(host: EmbeddedHost, options?: EmbeddedStowOptions): EmbeddedStow
Parameter Type Required Default Meaning
host EmbeddedHost Yes — Bind address; native default is 127.0.0.1.
options EmbeddedStowOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: EmbeddedStow.

EmbeddedStow.capabilities

Return the operations and limits supported by this handle.

TypeScript1 line
capabilities(): EmbeddedCapabilities

Returns: EmbeddedCapabilities.

EmbeddedStow.usage

Return current storage accounting.

TypeScript1 line
usage(): EmbeddedUsage

Returns: EmbeddedUsage.

EmbeddedStow.createBucket

Create the named bucket before storing objects.

TypeScript1 line
createBucket(bucket: string): void
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.

Returns: void.

EmbeddedStow.deleteBucket

Remove an empty bucket; a nonempty bucket is refused.

TypeScript1 line
deleteBucket(bucket: string): void
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.

Returns: void.

EmbeddedStow.listBuckets

Return the buckets visible to the handle.

TypeScript1 line
listBuckets(): EmbeddedBucket[]

Returns: EmbeddedBucket[].

EmbeddedStow.putObject

Store complete bytes and metadata, subject to write conditions and quotas.

TypeScript1 line
putObject(bucket: string, key: string, data: Uint8Array<ArrayBufferLike>, options?: EmbeddedPutOptions): EmbeddedObject
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
data Uint8Array<ArrayBufferLike> Yes — Object bytes. Input ownership and size rules depend on the method.
options EmbeddedPutOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: EmbeddedObject.

EmbeddedStow.getObject

Return complete object bytes and metadata.

TypeScript1 line
getObject(bucket: string, key: string): EmbeddedObject
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: EmbeddedObject.

EmbeddedStow.headObject

Return object metadata without reading the body into the result.

TypeScript1 line
headObject(bucket: string, key: string): EmbeddedObject
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: EmbeddedObject.

EmbeddedStow.listObjects

Return one page. Pass nextCursor to continue when truncated is true.

TypeScript1 line
listObjects(bucket: string, options?: EmbeddedListOptions): EmbeddedObjectPage
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
options EmbeddedListOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: EmbeddedObjectPage.

EmbeddedStow.deleteObject

Delete the selected object; deleting a missing object is idempotent.

TypeScript1 line
deleteObject(bucket: string, key: string): void
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: void.

EmbeddedStow.readForSave

Observe an object, or its absence, before changing it.

TypeScript1 line
readForSave(bucket: string, key: string): EmbeddedSaveObservation
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.

Returns: EmbeddedSaveObservation.

EmbeddedStow.saveObject

Publish a save that compares at publication, or replaces deliberately.

TypeScript1 line
saveObject(bucket: string, key: string, data: Uint8Array<ArrayBufferLike>, options?: EmbeddedSaveOptions): EmbeddedSaveResult
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
data Uint8Array<ArrayBufferLike> Yes — Object bytes. Input ownership and size rules depend on the method.
options EmbeddedSaveOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: EmbeddedSaveResult.

EmbeddedStow.resolveSave

Ask what a request key did, instead of writing again.

TypeScript1 line
resolveSave(bucket: string, key: string, requestKey: string): EmbeddedSaveResult
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
requestKey string Yes — Unique persisted request identity for capture or save recovery.

Returns: EmbeddedSaveResult.

EmbeddedStow.releaseObservation

Drop a token this caller will not use, rather than waiting for its expiry.

TypeScript1 line
releaseObservation(observationToken: string): void
Parameter Type Required Default Meaning
observationToken string Yes —

Returns: void.

EmbeddedStow.copyObject

Copy source bytes and metadata to the destination object.

TypeScript1 line
copyObject(sourceBucket: string, sourceKey: string, destinationBucket: string, destinationKey: string): EmbeddedObject
Parameter Type Required Default Meaning
sourceBucket string Yes — Bucket containing the source object.
sourceKey string Yes — Source object key.
destinationBucket string Yes — Bucket that receives the copy.
destinationKey string Yes — Object key that receives the copy.

Returns: EmbeddedObject.

EmbeddedStow.reset

Clear storage state where the backend supports reset.

TypeScript1 line
reset(): void

Returns: void.

EmbeddedStow.close

Release this handle. Do not submit new operations after closing it.

TypeScript1 line
close(): void

Returns: void.

EmbeddedStowError

TypeScript4 lines
class EmbeddedStowError  extends Error {
  readonly code: string;
  constructor(code: string, message: string);
}
Field Type Optional Description
code string No Structured error code; inspect the code rather than matching message text.
name string No Name identifying this bucket, head, protection or error class.
message string No Human-readable error message.
stack string | undefined Yes JavaScript stack trace, when available.
cause unknown Yes Underlying error cause, when provided.

EmbeddedStowError.constructor

function Object() { [native code] }

TypeScript1 line
constructor(code: string, message: string)
Parameter Type Required Default Meaning
code string Yes — Structured error code; inspect the code rather than matching message text.
message string Yes — Human-readable error message.

Returns: EmbeddedStowError.

EmbeddedStowOptions

TypeScript4 lines
interface EmbeddedStowOptions {
  maxBytes?: number | undefined;
  maxObjects?: number | undefined;
}
Field Type Optional Description
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxObjects number | undefined Yes Maximum object count; zero means unlimited.

EmbeddedUsage

TypeScript4 lines
interface EmbeddedUsage {
  bytes: number;
  objects: number;
}
Field Type Optional Description
bytes number No Current managed object payload bytes.
objects number No Objects returned by the listing or persistence snapshot.

EphemeralStowOptions

TypeScript10 lines
interface EphemeralStowOptions {
  readonly maxRequestBytes?: number | undefined;
  maxConcurrentRequests?: number | undefined;
  readonly maxBytes?: number | undefined;
  readonly maxObjects?: number | undefined;
  readonly bucket?: string | undefined;
  readonly timeoutMs?: number | undefined;
  readonly signal?: AbortSignal | undefined;
  readonly dataDir?: string | undefined;
}
Field Type Optional Description
maxRequestBytes number | undefined Yes Positive HTTP request-body byte limit; native default is 8 MiB.
maxConcurrentRequests number | undefined Yes Positive active HTTP handler limit; native default is 16.
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxObjects number | undefined Yes Maximum object count; zero means unlimited.
bucket string | undefined Yes Bucket name. Create it before storing objects.
timeoutMs number | undefined Yes Startup deadline in milliseconds; see the defaults table for this interface.
signal AbortSignal | undefined Yes AbortSignal for cancellation. A started write can still commit.
dataDir string | undefined Yes Native data directory. A supplied session directory is preserved on close.

exportWorkspaceCheckpoint

Write a portable checkpoint archive to the selected file.

TypeScript1 line
exportWorkspaceCheckpoint(checkpointId: string, output: string, options?: WorkspaceArchiveOptions): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
checkpointId string Yes — Immutable checkpoint identity.
output string Yes — Destination path for the transfer document or archive.
options WorkspaceArchiveOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

handoffWorkspace

Create a handoff reference, optionally with a portable archive.

TypeScript1 line
handoffWorkspace(id: string, options?: { readonly registryDir?: string | undefined; readonly team?: string | undefined; readonly checkpointId?: string | undefined; readonly archive?: string | undefined; readonly output?: string | undefined; }): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
id string Yes — Stable identity of this workspace, file stage, revision or immutable record.
options { readonly registryDir?: string | undefined; readonly team?: string | undefined; readonly checkpointId?: string | undefined; readonly archive?: string | undefined; readonly output?: string | undefined; } No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

importWorkspaceCheckpoint

Validate and import a portable checkpoint archive.

TypeScript1 line
importWorkspaceCheckpoint(archive: string, options?: WorkspaceArchiveOptions): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
archive string Yes — Path to a portable checkpoint archive.
options WorkspaceArchiveOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

loadNodeWasmHost

TypeScript1 line
loadNodeWasmHost(): Promise<NodeWasmHost>
Parameter Type Required Default Meaning

Returns: Promise<NodeWasmHost>.

NodeWasmHost

TypeScript5 lines
interface NodeWasmHost  extends EmbeddedHost {
  callBinaryAsync(metadata: string, data?: Uint8Array<ArrayBufferLike> | undefined): Promise<EmbeddedBinaryResponse>;
  openHost(metadata: string, store: HostObjectStoreBridge): Promise<EmbeddedBinaryResponse>;
  close(): Promise<void>;
}

NodeWasmHost.callBinaryAsync

TypeScript1 line
callBinaryAsync(metadata: string, data?: Uint8Array<ArrayBufferLike> | undefined): Promise<EmbeddedBinaryResponse>
Parameter Type Required Default Meaning
metadata string Yes — Serialized binary-bridge request or response metadata.
data Uint8Array<ArrayBufferLike> | undefined No — Object bytes. Input ownership and size rules depend on the method.

Returns: Promise<EmbeddedBinaryResponse>.

NodeWasmHost.openHost

TypeScript1 line
openHost(metadata: string, store: HostObjectStoreBridge): Promise<EmbeddedBinaryResponse>
Parameter Type Required Default Meaning
metadata string Yes — Serialized binary-bridge request or response metadata.
store HostObjectStoreBridge Yes — Open underlying object or content store supplied by the application.

Returns: Promise<EmbeddedBinaryResponse>.

NodeWasmHost.close

Release this handle. Do not submit new operations after closing it.

TypeScript1 line
close(): Promise<void>

Returns: Promise<void>.

ObjectSnapshot

TypeScript6 lines
interface ObjectSnapshot {
  key: string;
  size: number;
  etag?: string | undefined;
  lastModified?: Date | undefined;
}
Field Type Optional Description
key string No Object or file key within the selected bucket or project.
size number No Total object or content size in bytes; stream uploads require an exact declaration.
etag string | undefined Yes Content validator returned by the store or provider.
lastModified Date | undefined Yes

openStow

Start a private S3 session and return its owned handle. Call close when finished.

TypeScript1 line
openStow(options?: EphemeralStowOptions): Promise<StowSession>
Parameter Type Required Default Meaning
options EphemeralStowOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<StowSession>.

parseReadyLine

Parse the pre-protocol single-line readiness announcement.

TypeScript1 line
parseReadyLine(line: string): ReadyLine | null
Parameter Type Required Default Meaning
line string Yes — One JSON or legacy readiness record to decode.

Returns: ReadyLine | null.

parseReadyMessage

Parse the single readiness object.

TypeScript1 line
parseReadyMessage(line: string): StowReady
Parameter Type Required Default Meaning
line string Yes — One JSON or legacy readiness record to decode.

Returns: StowReady.

prepareWorkspace

Create a workspace from a task manifest and return its launch descriptor.

TypeScript1 line
prepareWorkspace(manifestPath: string): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
manifestPath string Yes — Path to the task manifest used to prepare a workspace.

Returns: Promise<Readonly<Record<string, unknown>>>.

pruneWorkspaces

Remove registry records for missing directories; preserve existing directories.

TypeScript1 line
pruneWorkspaces(options?: { readonly registryDir?: string | undefined; readonly team?: string | undefined; readonly includeAdopted?: boolean | undefined; }): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
options { readonly registryDir?: string | undefined; readonly team?: string | undefined; readonly includeAdopted?: boolean | undefined; } No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

PutFixtureOptions

TypeScript4 lines
interface PutFixtureOptions {
  contentType?: string | undefined;
  metadata?: Record<string, string> | undefined;
}
Field Type Optional Description
contentType string | undefined Yes MIME content type attached to the object or file.
metadata Record<string, string> | undefined Yes User metadata included in storage and sync comparisons.

READY_PROTOCOL_VERSION

TypeScript1 line
const READY_PROTOCOL_VERSION: 1;

resetOwnedData

Delete a stow data directory that stow created, and nothing else.

TypeScript1 line
resetOwnedData(dataDir: string): Promise<void>
Parameter Type Required Default Meaning
dataDir string Yes — Native data directory. A supplied session directory is preserved on close.

Returns: Promise<void>.

resolveStowBinary

TypeScript1 line
resolveStowBinary(): string
Parameter Type Required Default Meaning

Returns: string.

restoreWorkspaceCheckpoint

Restore a checkpoint into a new workspace directory.

TypeScript1 line
restoreWorkspaceCheckpoint(checkpointId: string, root: string, registryDir?: string | undefined): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
checkpointId string Yes — Immutable checkpoint identity.
root string Yes — New workspace directory; its parent must already exist.
registryDir string | undefined No — Native registry directory for workspace metadata.

Returns: Promise<Readonly<Record<string, unknown>>>.

resumeWorkspace

Open the workspace selected by ID or a same-machine handoff.

TypeScript1 line
resumeWorkspace(options: ResumeWorkspaceOptions): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
options ResumeWorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<Readonly<Record<string, unknown>>>.

ResumeWorkspaceOptions

TypeScript5 lines
interface ResumeWorkspaceOptions {
  readonly id?: string | undefined;
  readonly handoffPath?: string | undefined;
  readonly registryDir?: string | undefined;
}
Field Type Optional Description
id string | undefined Yes Stable identity of this workspace, file stage, revision or immutable record.
handoffPath string | undefined Yes Path to a same-machine or portable handoff document.
registryDir string | undefined Yes Native registry directory for workspace metadata.

runWorkspaceCommand

Run the native workspace command without a shell and decode its JSON object.

TypeScript1 line
runWorkspaceCommand(args: readonly string[]): Promise<Readonly<Record<string, unknown>>>
Parameter Type Required Default Meaning
args readonly string[] Yes —

Returns: Promise<Readonly<Record<string, unknown>>>.

ServedWorkspace

TypeScript4 lines
interface ServedWorkspace {
  readonly ready: Readonly<Record<string, unknown>>;
  close(): Promise<void>;
}
Field Type Optional Description
ready Readonly<Record<string, unknown>> No

ServedWorkspace.close

Release this handle. Do not submit new operations after closing it.

TypeScript1 line
close(): Promise<void>

Returns: Promise<void>.

serveWorkspace

Own a workspace S3 server until the returned handle closes; preserve workspace data.

TypeScript1 line
serveWorkspace(options: ServeWorkspaceOptions): Promise<ServedWorkspace>
Parameter Type Required Default Meaning
options ServeWorkspaceOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<ServedWorkspace>.

ServeWorkspaceOptions

TypeScript11 lines
interface ServeWorkspaceOptions {
  readonly maxRequestBytes?: number | undefined;
  maxConcurrentRequests?: number | undefined;
  readonly id: string;
  readonly registryDir?: string | undefined;
  readonly team?: string | undefined;
  readonly maxBytes?: number | undefined;
  readonly maxObjects?: number | undefined;
  readonly timeoutMs?: number | undefined;
  readonly signal?: AbortSignal | undefined;
}
Field Type Optional Description
maxRequestBytes number | undefined Yes Positive HTTP request-body byte limit; native default is 8 MiB.
maxConcurrentRequests number | undefined Yes Positive active HTTP handler limit; native default is 16.
id string No Stable identity of this workspace, file stage, revision or immutable record.
registryDir string | undefined Yes Native registry directory for workspace metadata.
team string | undefined Yes Registry team partition; it is not an authorization identity.
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxObjects number | undefined Yes Maximum object count; zero means unlimited.
timeoutMs number | undefined Yes Startup deadline in milliseconds; see the defaults table for this interface.
signal AbortSignal | undefined Yes AbortSignal for cancellation. A started write can still commit.

StartOptions

TypeScript31 lines
interface StartOptions {
  dataDir?: string | undefined;
  backend?: "memory" | "filesystem" | undefined;
  buckets?: string[] | undefined;
  port?: number | undefined;
  host?: string | undefined;
  allowInsecureRemote?: boolean | undefined;
  adminToken?: string | undefined;
  timeoutMs?: number | undefined;
  signal?: AbortSignal | undefined;
  region?: string | undefined;
  baseHost?: string | undefined;
  allowPublicAdmin?: boolean | undefined;
  resetOwnedData?: boolean | undefined;
  cleanSlate?: boolean | undefined;
  accessKey?: string | undefined;
  secretKey?: string | undefined;
  mode?: StowMode | "auto" | undefined;
  cacheDir?: string | undefined;
  cacheMaxBytes?: number | undefined;
  cacheMaxObjects?: number | undefined;
  cacheTtlSeconds?: number | undefined;
  allowLiveWrites?: boolean | undefined;
  allowInsecureUpstream?: boolean | undefined;
  maxRequestBytes?: number | undefined;
  maxConcurrentRequests?: number | undefined;
  maxBytes?: number | undefined;
  maxObjects?: number | undefined;
  isolatedEnvironment?: boolean | undefined;
  parentPid?: number | undefined;
}
Field Type Optional Description
dataDir string | undefined Yes Native data directory. A supplied session directory is preserved on close.
backend "memory" | "filesystem" | undefined Yes Storage implementation selected or reported by this handle.
buckets string[] | undefined Yes Buckets to create before startup resolves, or buckets returned by inspection.
port number | undefined Yes Requested native TCP port; zero selects an ephemeral port.
host string | undefined Yes Bind address; native default is 127.0.0.1.
allowInsecureRemote boolean | undefined Yes Explicit consent to bind beyond loopback; requires provisioned credentials and adminToken.
adminToken string | undefined Yes Credential for admin routes, passed only to the child environment.
timeoutMs number | undefined Yes Startup deadline in milliseconds; see the defaults table for this interface.
signal AbortSignal | undefined Yes AbortSignal for cancellation. A started write can still commit.
region string | undefined Yes Region used for S3 signing; native default is us-east-1.
baseHost string | undefined Yes Hostname used for virtual-hosted S3 requests.
allowPublicAdmin boolean | undefined Yes Deprecated and ignored; admin-token rules still apply.
resetOwnedData boolean | undefined Yes Clear only a Stow-owned data directory before startup; protected paths are refused.
cleanSlate boolean | undefined Yes Deprecated alias for resetOwnedData, with identical ownership checks.
accessKey string | undefined Yes Configured S3 access key ID.
secretKey string | undefined Yes Configured S3 signing secret.
mode StowMode | "auto" | undefined Yes Select local or run-through explicitly. Legacy auto does not select an upstream from credentials alone.
cacheDir string | undefined Yes Directory for upstream-derived cached objects, separate from dataDir.
cacheMaxBytes number | undefined Yes Maximum cache payload bytes.
cacheMaxObjects number | undefined Yes Maximum cached object count.
cacheTtlSeconds number | undefined Yes Cache entry lifetime in seconds, measured from publication.
allowLiveWrites boolean | undefined Yes Explicit consent to propagate native run-through writes upstream.
allowInsecureUpstream boolean | undefined Yes Allow HTTP upstream transport beyond literal loopback addresses.
maxRequestBytes number | undefined Yes Positive HTTP request-body byte limit; native default is 8 MiB.
maxConcurrentRequests number | undefined Yes Positive active HTTP handler limit; native default is 16.
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxObjects number | undefined Yes Maximum object count; zero means unlimited.
isolatedEnvironment boolean | undefined Yes Remove inherited STOW_*, S3_* and AWS_* variables from the child environment.
parentPid number | undefined Yes Stop the native server when this parent process dies.

Stow

Server startup, endpoint connection and AWS SDK configuration helpers.

TypeScript1 line
const Stow: { start(options?: StartOptions | undefined): Promise<StowInstance>; connect(options: AwsSdkV3ConfigOptions): StowConnection; awsSdkV3Config(options: StowInstance | AwsSdkV3ConfigOptions): S3ClientConfig; upstream: { fromEnv(): UpstreamConfig | null; }; };

Stow.start

Start a native server and create the requested buckets before returning its handle.

TypeScript1 line
start(options?: StartOptions | undefined): Promise<StowInstance>
Parameter Type Required Default Meaning
options StartOptions | undefined No — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<StowInstance>.

Stow.connect

Create an owned SDK client for an existing endpoint; disconnect it when finished.

TypeScript1 line
connect(options: AwsSdkV3ConfigOptions): StowConnection
Parameter Type Required Default Meaning
options AwsSdkV3ConfigOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: StowConnection.

Stow.awsSdkV3Config

Return AWS SDK connection settings with local credentials and path-style addressing by default.

TypeScript1 line
awsSdkV3Config(options: StowInstance | AwsSdkV3ConfigOptions): S3ClientConfig
Parameter Type Required Default Meaning
options StowInstance | AwsSdkV3ConfigOptions Yes — Configuration for this operation; the parameter type lists the accepted settings.

Returns: S3ClientConfig.

STOW_OWNER_MARKER

The file a stow server writes into a data directory it has initialized.

TypeScript1 line
const STOW_OWNER_MARKER: ".stow-owner";

stowBinaryAvailable

TypeScript1 line
stowBinaryAvailable(): boolean
Parameter Type Required Default Meaning

Returns: boolean.

StowBinaryNotFoundError

StowBinaryNotFoundError reports that no runnable server binary was found.

TypeScript4 lines
class StowBinaryNotFoundError  extends Error {
  readonly code: "binary_not_found";
  constructor(resolved: string);
}
Field Type Optional Description
code "binary_not_found" No Structured error code; inspect the code rather than matching message text.
name string No Name identifying this bucket, head, protection or error class.
message string No Human-readable error message.
stack string | undefined Yes JavaScript stack trace, when available.
cause unknown Yes Underlying error cause, when provided.

StowBinaryNotFoundError.constructor

function Object() { [native code] }

TypeScript1 line
constructor(resolved: string)
Parameter Type Required Default Meaning
resolved string Yes —

Returns: StowBinaryNotFoundError.

StowConnection

TypeScript11 lines
interface StowConnection {
  endpoint: string;
  accessKeyId?: string | undefined;
  secretAccessKey?: string | undefined;
  sessionToken?: string | undefined;
  provider?: AwsCredentialIdentityProvider | undefined;
  region: string;
  client: S3Client;
  awsSdkV3Config(): S3ClientConfig;
  disconnect(): void;
}
Field Type Optional Description
endpoint string No S3 service URL, including scheme and port.
accessKeyId string | undefined Yes Local S3 access key ID.
secretAccessKey string | undefined Yes Local S3 signing secret.
sessionToken string | undefined Yes Temporary AWS credential session token, when required.
provider AwsCredentialIdentityProvider | undefined Yes AWS credential provider; takes precedence over static credentials.
region string No Region used for S3 signing; native default is us-east-1.
client S3Client No Caller-owned or handle-owned AWS SDK client; follow the interface's close rules.

StowConnection.awsSdkV3Config

Return AWS SDK connection settings with local credentials and path-style addressing by default.

TypeScript1 line
awsSdkV3Config(): S3ClientConfig

Returns: S3ClientConfig.

StowConnection.disconnect

TypeScript1 line
disconnect(): void

Returns: void.

StowInstance

TypeScript14 lines
interface StowInstance {
  endpoint: string;
  accessKeyId: string;
  secretAccessKey: string;
  region: string;
  mode: StowMode;
  dataDir: string;
  stop(): Promise<void>;
  awsSdkV3Config(): S3ClientConfig;
  createBucket(name: string): Promise<void>;
  emptyBucket(name: string): Promise<void>;
  putFixture(bucket: string, key: string, body: any, options?: PutFixtureOptions | undefined): Promise<void>;
  snapshotObjects(bucket: string, prefix?: string | undefined): Promise<ObjectSnapshot[]>;
}
Field Type Optional Description
endpoint string No S3 service URL, including scheme and port.
accessKeyId string No Local S3 access key ID.
secretAccessKey string No Local S3 signing secret.
region string No Region used for S3 signing; native default is us-east-1.
mode StowMode No
dataDir string No Native data directory. A supplied session directory is preserved on close.

StowInstance.stop

TypeScript1 line
stop(): Promise<void>

Returns: Promise<void>.

StowInstance.awsSdkV3Config

Return AWS SDK connection settings with local credentials and path-style addressing by default.

TypeScript1 line
awsSdkV3Config(): S3ClientConfig

Returns: S3ClientConfig.

StowInstance.createBucket

Create the named bucket before storing objects.

TypeScript1 line
createBucket(name: string): Promise<void>
Parameter Type Required Default Meaning
name string Yes — Name identifying this bucket, head, protection or error class.

Returns: Promise<void>.

StowInstance.emptyBucket

TypeScript1 line
emptyBucket(name: string): Promise<void>
Parameter Type Required Default Meaning
name string Yes — Name identifying this bucket, head, protection or error class.

Returns: Promise<void>.

StowInstance.putFixture

TypeScript1 line
putFixture(bucket: string, key: string, body: any, options?: PutFixtureOptions | undefined): Promise<void>
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
key string Yes — Object or file key within the selected bucket or project.
body any Yes — Complete object payload for the selected native SDK helper.
options PutFixtureOptions | undefined No — Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<void>.

StowInstance.snapshotObjects

TypeScript1 line
snapshotObjects(bucket: string, prefix?: string | undefined): Promise<ObjectSnapshot[]>
Parameter Type Required Default Meaning
bucket string Yes — Bucket name. Create it before storing objects.
prefix string | undefined No — Only list keys beginning with this prefix.

Returns: Promise<ObjectSnapshot[]>.

StowMode

TypeScript1 line
type StowMode = "local" | "run-through";

StowOwnershipError

A directory stow did not create is never deleted on a caller's behalf.

TypeScript4 lines
class StowOwnershipError  extends Error {
  readonly code: "ownership";
  constructor(dataDir: string, reason: string);
}
Field Type Optional Description
code "ownership" No Structured error code; inspect the code rather than matching message text.
dataDir string No Native data directory. A supplied session directory is preserved on close.
name string No Name identifying this bucket, head, protection or error class.
message string No Human-readable error message.
stack string | undefined Yes JavaScript stack trace, when available.
cause unknown Yes Underlying error cause, when provided.

StowOwnershipError.constructor

function Object() { [native code] }

TypeScript1 line
constructor(dataDir: string, reason: string)
Parameter Type Required Default Meaning
dataDir string Yes — Native data directory. A supplied session directory is preserved on close.
reason string Yes —

Returns: StowOwnershipError.

StowProtocolError

TypeScript4 lines
class StowProtocolError  extends Error {
  readonly code: StowErrorCode;
  constructor(code: StowErrorCode, message: string);
}
Field Type Optional Description
code StowErrorCode No Structured error code; inspect the code rather than matching message text.
name string No Name identifying this bucket, head, protection or error class.
message string No Human-readable error message.
stack string | undefined Yes JavaScript stack trace, when available.
cause unknown Yes Underlying error cause, when provided.

StowProtocolError.constructor

function Object() { [native code] }

TypeScript1 line
constructor(code: StowErrorCode, message: string)
Parameter Type Required Default Meaning
code StowErrorCode Yes — Structured error code; inspect the code rather than matching message text.
message string Yes — Human-readable error message.

Returns: StowProtocolError.

StowReady

TypeScript11 lines
interface StowReady {
  protocolVersion: number;
  binaryVersion: string;
  endpoint: string;
  region: string;
  accessKeyId: string;
  secretAccessKey: string;
  mode: string;
  backend: string;
  capabilities: StowReadyCapabilities;
}
Field Type Optional Description
protocolVersion number No Readiness protocol version supported by this client.
binaryVersion string No Native binary version reported by readiness.
endpoint string No S3 service URL, including scheme and port.
region string No Region used for S3 signing; native default is us-east-1.
accessKeyId string No Local S3 access key ID.
secretAccessKey string No Local S3 signing secret.
mode string No
backend string No Storage implementation selected or reported by this handle.
capabilities StowReadyCapabilities No

StowReadyCapabilities

TypeScript12 lines
interface StowReadyCapabilities {
  persistent: boolean;
  multipart: boolean;
  upstream: boolean;
  conditionalWrites: boolean;
  presignedUrls: boolean;
  maxBytes: number;
  maxMultipartUploads?: number | undefined;
  maxObjects: number;
  maxRequestBytes: number;
  maxConcurrentRequests?: number | undefined;
}
Field Type Optional Description
persistent boolean No Whether this backend retains data after the handle closes.
multipart boolean No Whether this handle supports multipart operations.
upstream boolean No Whether this handle can use an upstream provider.
conditionalWrites boolean No Whether atomic ETag write conditions are supported.
presignedUrls boolean No
maxBytes number No Maximum managed object bytes; zero means unlimited.
maxMultipartUploads number | undefined Yes
maxObjects number No Maximum object count; zero means unlimited.
maxRequestBytes number No Positive HTTP request-body byte limit; native default is 8 MiB.
maxConcurrentRequests number | undefined Yes Positive active HTTP handler limit; native default is 16.

StowSession

TypeScript10 lines
interface StowSession {
  readonly bucket: string;
  readonly endpoint: string;
  readonly dataDir: string;
  readonly s3: S3Client;
  awsSdkV3Config(): S3ClientConfig;
  capabilities(): StowSessionCapabilities;
  handoff(): Record<string, string>;
  close(): Promise<void>;
}
Field Type Optional Description
bucket string No Bucket name. Create it before storing objects.
endpoint string No S3 service URL, including scheme and port.
dataDir string No Native data directory. A supplied session directory is preserved on close.
s3 S3Client No Session-owned S3 client, destroyed on close.

StowSession.awsSdkV3Config

Return AWS SDK connection settings with local credentials and path-style addressing by default.

TypeScript1 line
awsSdkV3Config(): S3ClientConfig

Returns: S3ClientConfig.

StowSession.capabilities

Return the operations and limits supported by this handle.

TypeScript1 line
capabilities(): StowSessionCapabilities

Returns: StowSessionCapabilities.

StowSession.handoff

A fresh environment mapping for a child process that needs to reach this session.

TypeScript1 line
handoff(): Record<string, string>

Returns: Record<string, string>.

StowSession.close

Release this handle. Do not submit new operations after closing it.

TypeScript1 line
close(): Promise<void>

Returns: Promise<void>.

StowSessionCapabilities

TypeScript12 lines
interface StowSessionCapabilities {
  backend: string;
  persistent: boolean;
  multipart: boolean;
  upstream: boolean;
  maxBytes: number;
  maxObjects: number;
  maxRequestBytes: number;
  maxConcurrentRequests: number;
  protocolVersion: number;
  binaryVersion: string;
}
Field Type Optional Description
backend string No Storage implementation selected or reported by this handle.
persistent boolean No Whether this backend retains data after the handle closes.
multipart boolean No Whether this handle supports multipart operations.
upstream boolean No Whether this handle can use an upstream provider.
maxBytes number No Maximum managed object bytes; zero means unlimited.
maxObjects number No Maximum object count; zero means unlimited.
maxRequestBytes number No Positive HTTP request-body byte limit; native default is 8 MiB.
maxConcurrentRequests number No Positive active HTTP handler limit; native default is 16.
protocolVersion number No Readiness protocol version supported by this client.
binaryVersion string No Native binary version reported by readiness.

UpstreamConfig

TypeScript8 lines
interface UpstreamConfig {
  endpoint: string;
  accessKey: string;
  secretKey: string;
  sessionToken?: string | undefined;
  region?: string | undefined;
  bucket?: string | undefined;
}
Field Type Optional Description
endpoint string No S3 service URL, including scheme and port.
accessKey string No Configured S3 access key ID.
secretKey string No Configured S3 signing secret.
sessionToken string | undefined Yes Temporary AWS credential session token, when required.
region string | undefined Yes Region used for S3 signing; native default is us-east-1.
bucket string | undefined Yes Bucket name. Create it before storing objects.

upstreamFromEnv

Resolve upstream credentials from environment variables.

TypeScript1 line
upstreamFromEnv(): UpstreamConfig | null
Parameter Type Required Default Meaning

Returns: UpstreamConfig | null.

withStow

Run the callback in a private session and always close it.

TypeScript1 line
withStow<T>(use: (session: StowSession) => T | Promise<T>, options?: EphemeralStowOptions): Promise<T>
Parameter Type Required Default Meaning
use (session: StowSession) => T | Promise<T> Yes — Session callback; its result is returned after cleanup.
options EphemeralStowOptions No {} Configuration for this operation; the parameter type lists the accepted settings.

Returns: Promise<T>.

WorkspaceArchiveOptions

TypeScript7 lines
interface WorkspaceArchiveOptions {
  readonly registryDir?: string | undefined;
  readonly team?: string | undefined;
  readonly maxBytes?: number | undefined;
  readonly maxFiles?: number | undefined;
  readonly includeSensitive?: boolean | undefined;
}
Field Type Optional Description
registryDir string | undefined Yes Native registry directory for workspace metadata.
team string | undefined Yes Registry team partition; it is not an authorization identity.
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxFiles number | undefined Yes Maximum files accepted by the archive operation.
includeSensitive boolean | undefined Yes Explicitly permit paths rejected by the sensitive-filename filter.

WorkspaceCheckpointOptions

TypeScript9 lines
interface WorkspaceCheckpointOptions {
  readonly id: string;
  readonly registryDir?: string | undefined;
  readonly team?: string | undefined;
  readonly parent?: string | undefined;
  readonly maxBytes?: number | undefined;
  readonly maxFiles?: number | undefined;
  readonly includeSensitive?: boolean | undefined;
}
Field Type Optional Description
id string No Stable identity of this workspace, file stage, revision or immutable record.
registryDir string | undefined Yes Native registry directory for workspace metadata.
team string | undefined Yes Registry team partition; it is not an authorization identity.
parent string | undefined Yes Optional parent checkpoint identity.
maxBytes number | undefined Yes Maximum managed object bytes; zero means unlimited.
maxFiles number | undefined Yes Maximum files accepted by the archive operation.
includeSensitive boolean | undefined Yes Explicitly permit paths rejected by the sensitive-filename filter.

WorkspaceJSON

TypeScript1 line
type WorkspaceJSON = Readonly<Record<string, unknown>>;