@sema-agent/core
Version:
Stateless, task-oriented AI agent core
21 lines (20 loc) • 1.4 kB
TypeScript
import type { SessionMetadata, SessionTreeEntry, SessionWriteOptions } from "../harness/types.js";
import type { HolderJudge, SessionStorageResidence } from "../../core/checkpoint-generation.js";
import { BaseSessionStorage } from "./storage-base.js";
/** Volatile session storage used by tests and in-process harness callers. */
export declare class InMemorySessionStorage<TMetadata extends SessionMetadata = SessionMetadata> extends BaseSessionStorage<TMetadata> {
constructor(options?: {
entries?: SessionTreeEntry[];
metadata?: TMetadata;
/** Branch floor for a bounded-window load (F3); the entries must start at this id. */
floorEntryId?: string | null;
/** The deployment's grant judge: every append and leaf move carrying `opts.holder` is judged by it first ({@link HolderJudge}). */
holderIsCurrent?: HolderJudge;
});
setLeafId(leafId: string | null, opts?: SessionWriteOptions): Promise<void>;
appendEntry(entry: SessionTreeEntry, opts?: SessionWriteOptions): Promise<void>;
/** It lives in this process, and judges the holder of its writes exactly when it was built with a judge. */
getResidence(): SessionStorageResidence;
/** The in-memory repo's owner write: the row's metadata with its owner recorded, adopted by this storage in the repo's judging step. */
recordOwnerCell(metadata: TMetadata): void;
}