Skip to content

@codesoul-co/hypha-adapters-local / local-workspace-snapshot-artifacts

Using this module

Use the Local workspace snapshot artifacts module for declaring and enforcing workspace scope boundaries. It exports 1 class, 2 interfaces.

Import from the package entrypoint

ts
import {
  LocalWorkspaceSnapshotArtifactService,
} from '@codesoul-co/hypha-adapters-local';

import type {
  LocalWorkspaceSnapshotArtifactContext,
  LocalWorkspaceSnapshotArtifactServiceOptions,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
LocalWorkspaceSnapshotArtifactServiceclassnew LocalWorkspaceSnapshotArtifactService(options: LocalWorkspaceSnapshotArtifactServiceOptions): LocalWorkspaceSnapshotArtifactServicePersists a full Workspace tree through ArtifactManager. Host paths never enter Artifact metadata; file bytes are collected through its governed Workspace reader port.
LocalWorkspaceSnapshotArtifactContextinterfaceinterface LocalWorkspaceSnapshotArtifactContextLocal Workspace Snapshot Artifact Context interface with 7 public fields or methods.
LocalWorkspaceSnapshotArtifactServiceOptionsinterfaceinterface LocalWorkspaceSnapshotArtifactServiceOptionsLocal Workspace Snapshot Artifact Service Options interface with 11 public fields or methods.

LocalWorkspaceSnapshotArtifactService

Persists a full Workspace tree through ArtifactManager. Host paths never enter Artifact metadata; file bytes are collected through its governed Workspace reader port.

Declaration

text
export declare class LocalWorkspaceSnapshotArtifactService {
    constructor(options: LocalWorkspaceSnapshotArtifactServiceOptions);
    createFullSnapshot(input: WorkspaceSnapshotRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>;
    restoreFullSnapshot(input: WorkspaceRestoreRequest, options?: ArtifactOperationOptions): Promise<void>;
    recoverInterruptedRestore(): Promise<LocalWorkspaceRestoreRecoveryResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: LocalWorkspaceSnapshotArtifactServiceOptions): LocalWorkspaceSnapshotArtifactServiceCreates an instance of this class.
createFullSnapshotmethodcreateFullSnapshot(input: WorkspaceSnapshotRequest, options?: ArtifactOperationOptions): Promise<ArtifactRecord>Public method; parameters and return type are shown in the signature.
recoverInterruptedRestoremethodrecoverInterruptedRestore(): Promise<LocalWorkspaceRestoreRecoveryResult>Public method; parameters and return type are shown in the signature.
restoreFullSnapshotmethodrestoreFullSnapshot(input: WorkspaceRestoreRequest, options?: ArtifactOperationOptions): Promise<void>Public method; parameters and return type are shown in the signature.

LocalWorkspaceSnapshotArtifactContext

Local Workspace Snapshot Artifact Context interface with 7 public fields or methods.

Declaration

text
export interface LocalWorkspaceSnapshotArtifactContext {
    profileRef: SpecRef;
    userId: string;
    tenantId?: string;
    workspaceId: string;
    sessionId?: string;
    runId?: string;
    agentId?: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: SpecRefPublic 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.

LocalWorkspaceSnapshotArtifactServiceOptions

Local Workspace Snapshot Artifact Service Options interface with 11 public fields or methods.

  • Kind: interface
  • Import: import type { LocalWorkspaceSnapshotArtifactServiceOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: local-workspace-snapshot-artifacts

Declaration

text
export interface LocalWorkspaceSnapshotArtifactServiceOptions {
    workspace: Pick<LocalWorkspaceAdapter, 'capture' | 'workspaceRoot'>;
    artifacts: Pick<ArtifactManager, 'create' | 'createFromWorkspace' | 'finalize' | 'read'>;
    context: LocalWorkspaceSnapshotArtifactContext;
    now?: () => string;
    nowMs?: () => number;
    maxManifestBytes?: number;
    maxSnapshotPersistenceDurationMs?: number;
    maxRestoreBytes?: number;
    maxRestoreEntries?: number;
    maxRestoreLockWaitDurationMs?: number;
    maxRestoreStagingDurationMs?: number;
}

Contract members

MemberKindSignatureDescription
artifactspropertyartifacts: Pick<ArtifactManager, "read" | "create" | "createFromWorkspace" | "finalize">Public property; its type, readonly modifier and optionality are shown in the signature.
contextpropertycontext: LocalWorkspaceSnapshotArtifactContextPublic property; its type, readonly modifier and optionality are shown in the signature.
maxManifestBytespropertymaxManifestBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxRestoreBytespropertymaxRestoreBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxRestoreEntriespropertymaxRestoreEntries?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxRestoreLockWaitDurationMspropertymaxRestoreLockWaitDurationMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxRestoreStagingDurationMspropertymaxRestoreStagingDurationMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxSnapshotPersistenceDurationMspropertymaxSnapshotPersistenceDurationMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
nowMsmethodnowMs?(): numberPublic method; parameters and return type are shown in the signature.
workspacepropertyworkspace: Pick<LocalWorkspaceAdapter, "workspaceRoot" | "capture">Public property; its type, readonly modifier and optionality are shown in the signature.