@agentium/harness. Types such as ChatMessage, RunContext, and ExecutionServices come from @agentium/core. A ? marks an optional field.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Agentium 4.0.0 · Upgrade from 3.x.
Identity-scoped session leases, snapshots, stores, and resource ownership.
@agentium/harness. Types such as ChatMessage, RunContext, and ExecutionServices come from @agentium/core. A ? marks an optional field.
export interface HarnessIdentity {
userId: string;
tenantId: string;
}
export interface HarnessSessionLease {
read(): HarnessSessionSnapshot;
commit(snapshot: Omit<HarnessSessionSnapshot, "revision">): void;
release(): void;
}
export interface HarnessSessionSnapshot {
conversations?: Record<string, ChatMessage[]>;
history: ChatMessage[];
state: Record<string, unknown>;
revision: number;
replayable: boolean;
}
export interface HarnessSessionStore {
readonly guarantees: {
durable: boolean;
compareAndSwap: boolean;
singleWriter: "process" | "distributed";
};
acquire(identity: HarnessIdentity, sessionId: string): Promise<HarnessSessionLease>;
}
export interface ScopedResource<T = unknown> {
value: T;
ownership: "host" | "runtime";
dispose?: () => Promise<void>;
}
export interface SessionResourceLease<T> {
value: T;
release: () => Promise<void>;
}
/** Session resources live until explicit closeSession; run resources use their returned lease. */
export declare class HarnessResourcePool {
acquire<T>(identity: HarnessIdentity, sessionId: string, id: string, scope: "host" | "session" | "run", initialize: () => Promise<ScopedResource<T>>): Promise<SessionResourceLease<T>>;
closeSession(identity: HarnessIdentity, sessionId: string): Promise<readonly string[]>;
}
export declare class HarnessSessionConflict extends Error {
readonly code = "session_conflict";
constructor();
}
/** One writer per scoped session; deliberately rejects rather than silently interleaving. */
export declare class InMemoryHarnessSessionStore implements HarnessSessionStore {
readonly guarantees: {
durable: boolean;
compareAndSwap: boolean;
singleWriter: "process";
};
acquire(identity: HarnessIdentity, sessionId: string): Promise<HarnessSessionLease>;
/** Imported display-only transcripts are readable but never represented as complete replay state. */
importLegacy(identity: HarnessIdentity, sessionId: string, history: ChatMessage[]): void;
}