@squidcloud/backend
    Preparing search index...

    Class WorkspaceClient

    Experimental, backend-only API for a scratch directory ("workspace") that survives across ask() calls and pod replicas. The directory lives on this pod's local disk for fast reads/writes; create and push are the only points that talk to the shared workspace server (rsync-over-ssh), so a workspace can move between pods without every file access paying network latency.

    Isolation is enforced server-side by a short-lived, per-workspace certificate: core signs it with the systemwide workspace CA and embeds an rrsync forced command scoped to this one workspace directory, so this client never expresses or needs to know any other path, and no long-lived key is ever held.

    This API may change or be removed without notice.

    Index
    • Ensures the workspace directory exists on this pod and reflects the latest push, generating a new workspace id when none is given. Safe to call repeatedly: pulls from the workspace server only when there is something to pull, and is a no-op for a brand-new, never-pushed workspace.

      Parameters

      Returns Promise<WorkspaceMetadata>

    • Deletes the workspace everywhere it canonically exists: its directory on the workspace server and its GC tracking record (both via core), plus every copy on this pod — the live directory, its marker, and any tree an interrupted eviction left in quarantine. Copies left on other pod replicas by an earlier create are reclaimed by their own pod's cache eviction, not by this call.

      Parameters

      • id: string

      Returns Promise<void>

    • Removes only this client's pod-local copy without changing the shared workspace.

      Parameters

      • id: string

      Returns Promise<void>

    • Syncs the current state of the workspace directory to the workspace server as the new authoritative state.

      Parameters

      • id: string

      Returns Promise<WorkspaceMetadata>