Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/sessions / facade / SessionManager
Interface: SessionManager
Defined in: packages/sessions/src/facade.ts:291
Surface returned by createSessionManager.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
agents | readonly | AgentRegistry | The underlying agent registry. | packages/sessions/src/facade.ts:293 |
commentary | readonly | CommentarySanitizer | Default sanitizer instance (test seam). | packages/sessions/src/facade.ts:295 |
Methods
create()
create(args): Promise<Session>;Defined in: packages/sessions/src/facade.ts:303
Create a fresh session. The optional commentaryPolicy overrides the manager-level default just for this session - useful for deployments that pin a stricter posture per-conversation (e.g. 'strip' for compliance-sensitive sessions while everything else uses the 'wrap' default).
Parameters
| Parameter | Type |
|---|---|
args | { agentId: string; commentaryPolicy?: CommentaryPolicy; sessionId?: string; tags?: readonly string[]; title?: string; userId: string; } |
args.agentId | string |
args.commentaryPolicy? | CommentaryPolicy |
args.sessionId? | string |
args.tags? | readonly string[] |
args.title? | string |
args.userId | string |
Returns
Promise<Session>
deleteSession()
deleteSession(sessionId): Promise<void>;Defined in: packages/sessions/src/facade.ts:331
Hard-delete a session (RP-6). The cascade removes the session's bookkeeping (handoffs, workflow-run attachments, audit rows), the checkpoints of suspended runs linked to it (W-005), AND its content: messages and episodes with their FTS/vector index rows plus the full registry of session-scoped surfaces (facts, insights, rules, working blocks, spans, consolidator state - see SESSION_SCOPED_PURGES in @graphorin/store-sqlite). No separate purge step is required. Delegates to SessionStoreExt.deleteSession; authors of custom SessionStore implementations must honour that contract in full, or "deleted" conversations remain searchable.
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
Promise<void>
find()
find(sessionId): Promise<
| Session
| null>;Defined in: packages/sessions/src/facade.ts:314
Best-effort lookup. Returns null when the id is unknown.
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
Promise< | Session | null>
get()
get(sessionId): Promise<Session>;Defined in: packages/sessions/src/facade.ts:312
Hydrate an existing session by id.
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
Promise<Session>
importFromString()
importFromString(body, opts?): Promise<{
read: SessionExportReadResult;
session: | Session
| null;
}>;Defined in: packages/sessions/src/facade.ts:341
Import a JSONL stream into a fresh session.
Parameters
| Parameter | Type |
|---|---|
body | string |
opts? | SessionExportReadOptions |
Returns
Promise<{ read: SessionExportReadResult; session: | Session | null; }>
listSessions()
listSessions(scope): Promise<readonly SessionMetadata[]>;Defined in: packages/sessions/src/facade.ts:316
List sessions for a scope (newest-first by createdAt).
Parameters
| Parameter | Type |
|---|---|
scope | Pick<SessionScope, "userId" | "agentId"> |
Returns
Promise<readonly SessionMetadata[]>
pruneAudit()
pruneAudit(beforeEpochMs): Promise<number>;Defined in: packages/sessions/src/facade.ts:348
Prune audit rows older than the supplied epoch ms.
Parameters
| Parameter | Type |
|---|---|
beforeEpochMs | number |
Returns
Promise<number>
pruneSessions()
pruneSessions(opts): Promise<number>;Defined in: packages/sessions/src/facade.ts:336
Retention sweep (RP-6): delete every session matching the policy. Returns the count deleted. See SessionStoreExt.pruneSessions.
Parameters
| Parameter | Type |
|---|---|
opts | { beforeEpochMs?: number; closedOnly?: boolean; } |
opts.beforeEpochMs? | number |
opts.closedOnly? | boolean |
Returns
Promise<number>
replayer()
replayer(): SessionReplayer;Defined in: packages/sessions/src/facade.ts:346
Build the underlying replay engine for advanced consumers.