agents
Version:
A home for your AI agents
86 lines (84 loc) • 2.52 kB
TypeScript
import { s as LifecycleCapability } from "../capability-runner-BiVUtjqC.js";
import {
a as RecentHistoryResult,
c as SessionChangeListener,
d as SessionRowStat,
f as SessionsOptions,
i as HistoryReadOptions,
l as SessionMessage,
m as WriteOptions,
n as AppendResult,
o as SearchResult,
p as StoredCompaction,
r as HistoryBatchReadOptions,
s as SessionChangeEvent,
t as AppendOptions,
u as SessionMessagePart
} from "../types-B7LojTe4.js";
import {
a as CompactOptions,
c as isCompactionMessage,
i as COMPACTION_PREFIX,
n as Session,
o as CompactResult,
r as SessionMirrorOptions,
s as createCompactFunction,
t as CompactionFunction
} from "../handle-zAzh0UW2.js";
//#region src/sessions/sessions.d.ts
/**
* Durable conversation history for a Lifecycle Object.
*
* `session()` returns a per-session handle for reads (streamed, byte
* budgeted), writes (sanitized, media offloaded), branch navigation, and
* compaction overlays. `subscribe()` is the change feed a cache-owning host
* mirrors.
*
* @experimental The API surface may change before stabilizing.
*/
declare class Sessions extends LifecycleCapability {
#private;
constructor(options?: SessionsOptions);
/** Migrate session storage during Lifecycle startup. */
onStart(): Promise<void>;
/**
* The handle for one session. The default (empty) id is the primary path:
* in the one-object-per-conversation model a Durable Object holds exactly
* one session. Handles are cached, so per-session configuration (the
* compaction trigger) survives repeated calls.
*/
session(sessionId?: string): Session;
/**
* Subscribe to the change feed: ordered dispatch after every durable
* write, with the stored message. The host cache mirror lives here;
* telemetry additionally flows through capability events.
*/
subscribe(listener: SessionChangeListener): () => void;
}
//#endregion
export {
type AppendOptions,
type AppendResult,
COMPACTION_PREFIX,
type CompactOptions,
type CompactResult,
type CompactionFunction,
type HistoryBatchReadOptions,
type HistoryReadOptions,
type RecentHistoryResult,
type SearchResult,
Session,
type SessionChangeEvent,
type SessionChangeListener,
type SessionMessage,
type SessionMessagePart,
type SessionMirrorOptions,
type SessionRowStat,
Sessions,
type SessionsOptions,
type StoredCompaction,
type WriteOptions,
createCompactFunction,
isCompactionMessage
};
//# sourceMappingURL=index.d.ts.map