agent-sessions / Exports / SessionStore
Class: SessionStore
Persistent session store backed by individual JSON files.
Construct with a custom baseDir to redirect storage (useful in tests).
Table of contents
Constructors
Methods
Constructors
constructor
• new SessionStore(baseDir?): SessionStore
Parameters
| Name | Type |
|---|---|
baseDir? | string |
Returns
Defined in
agent-sessions/src/session-store.ts:43
Methods
save
▸ save(session): void
Persist a session record to disk. Creates the storage directory if needed.
Parameters
| Name | Type |
|---|---|
session | ISessionRecord |
Returns
void
Defined in
agent-sessions/src/session-store.ts:63
load
▸ load(id): undefined | ISessionRecord
Load a session by its ID. Returns undefined when the session file does not exist.
Parameters
| Name | Type |
|---|---|
id | string |
Returns
undefined | ISessionRecord
Defined in
agent-sessions/src/session-store.ts:72
list
▸ list(): ISessionRecord[]
List all persisted sessions, sorted by updatedAt descending (most recent first).
Returns
Defined in
agent-sessions/src/session-store.ts:84
delete
▸ delete(id): void
Delete a session by its ID. No-ops silently if the session does not exist.
Parameters
| Name | Type |
|---|---|
id | string |
Returns
void