@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
38 lines • 1.98 kB
TypeScript
import type { ObserverStore } from '../../observe/store.ts';
import { type S3Config } from '../../vfs/s3/config.ts';
import { type NamespaceStore } from '../mount/namespace/store.ts';
import type { JobStore } from '../../shell/job_table/store.ts';
import { WorkspaceStateStore, type WorkspaceFields, type WorkspaceStateStoreOverrides } from './base.ts';
/**
* WorkspaceStateStore hosting the sessions + metadata group on S3.
*
* Object layout under one bucket and prefix:
*
* - `{prefix}workspaces/{ws}.json` — metadata record
* - `{prefix}{ws}/sessions/{session_id}.json` — session table
*
* Every record write is CAS-gated by a conditional PUT anchored on the
* compare-read's ETag, giving S3 the same generation contract as the
* Redis Lua script; bucket versioning (when enabled) doubles as an
* audit trail for free. This store hosts only the sessions+meta
* group: namespace nodes and observer events are chatty per-op planes
* that belong on RAM or Redis, so use this store as the `workspace`
* group override of a RAM or Redis default store. Mirrors the Python
* S3WorkspaceStateStore.
*/
export declare class S3WorkspaceStateStore extends WorkspaceStateStore {
private readonly config;
private readonly prefix;
private readonly meta;
private readonly sessionTables;
constructor(config: S3Config, overrides?: WorkspaceStateStoreOverrides);
protected makeNamespace(_workspaceId: string): NamespaceStore;
protected makeObserver(_workspaceId: string): ObserverStore;
protected makeJobs(_workspaceId: string): JobStore;
protected makeSessions(workspaceId: string): NamespaceStore;
protected readMeta(workspaceId: string): Promise<WorkspaceFields | null>;
protected casWriteMeta(workspaceId: string, fields: WorkspaceFields, expectedGeneration: number): Promise<boolean>;
protected forgetSelf(workspaceId: string): Promise<void>;
protected closeSelf(): Promise<void>;
}
//# sourceMappingURL=s3.d.ts.map