/** * v0.3.0 — Chief session-id store (named "PM session" pre-v1.1). * * Maps (userId, orgSlug) → Claude Code session-id. The actual conversation * transcript lives in `~/.claude/projects//.jsonl` * (managed by Claude Code itself, per PoC #1). We only persist the mapping * + light bookkeeping (last interaction, cumulative cost, active workflow). * * File layout per org: * //.solosquad/sessions/.json * * Per docs/plan/v0.3-pm-mode-orchestration.md §3.2 / §3.2.1. */ export interface SessionRecord { userId: string; orgSlug: string; sessionId: string; createdAt: string; lastInteractionAt: string; totalCostUsd: number; activeWorkflowId?: string; archived?: Array<{ sessionId: string; archivedAt: string; reason: string; }>; /** * v0.5 §7 — freq channel hysteresis. Map of SKILL name → turns remaining * before that SKILL can be auto-loaded again. Caller (router-runner) ticks * the counter each turn via `tickCooldowns()` and records new entries * returned by `resolve()`'s `start_cooldown`. */ freqCooldowns?: Record; } export declare class SessionStore { private readonly workspace; constructor(workspace: string); read(orgSlug: string, userId: string): SessionRecord | null; ensure(orgSlug: string, userId: string): { record: SessionRecord; fresh: boolean; }; write(record: SessionRecord): void; rotate(orgSlug: string, userId: string, reason: string): { previous: string | null; next: string; }; recordTurn(orgSlug: string, userId: string, costUsdDelta: number): void; setActiveWorkflow(orgSlug: string, userId: string, workflowId: string | undefined): void; /** * v0.5 §7 — apply one turn of cooldown decay + record any new freq match. * Pure update: returns nothing, persists the result. Idempotent on entries * that have already counted down to zero (they're dropped). */ updateFreqCooldowns(orgSlug: string, userId: string, opts?: { tick?: boolean; start?: { skillName: string; turns: number; } | null; }): void; listForOrg(orgSlug: string): SessionRecord[]; }