/** * Session management operations. * @task T4463 * @epic T4454 * @task T1450 — Contracts-driven refactor */ import type { Session, SessionScope } from '@cleocode/contracts'; import { type SessionEndParams, type SessionGcParams, type SessionListParams, type SessionResumeParams, type SessionStartParams, type SessionStatusParams } from '@cleocode/contracts'; import type { DataAccessor } from '../store/data-accessor.js'; import '../hooks/handlers/index.js'; /** * Parse a scope string into a SessionScope. * @task T4463 * * @example * ```ts * // Global scope * const global = parseScope('global'); * console.assert(global.type === 'global', 'global scope type'); * * // Epic scope with task ID * const epic = parseScope('epic:T123'); * console.assert(epic.type === 'epic', 'epic scope type'); * console.assert(epic.epicId === 'T123', 'epic scope ID'); * * // Invalid scope throws * let threw = false; * try { parseScope('invalid'); } catch { threw = true; } * console.assert(threw, 'invalid scope throws CleoError'); * ``` */ export declare function parseScope(scopeStr: string): SessionScope; /** * Read sessions from accessor or JSON file. * Internal helper — not exposed via dispatch contracts. * @task T4463 */ export declare function readSessions(cwd?: string, accessor?: DataAccessor): Promise; /** * Save sessions via accessor or JSON file. * Internal helper — not exposed via dispatch contracts. * @task T4463 */ export declare function saveSessions(sessions: Session[], cwd?: string, accessor?: DataAccessor): Promise; /** * Start a new session. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function startSession(projectRoot: string, params: SessionStartParams): Promise; /** * End a session. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function endSession(projectRoot: string, params: SessionEndParams): Promise; /** * Get current session status. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function sessionStatus(projectRoot: string, _params: SessionStatusParams): Promise; /** * Resume an existing session. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function resumeSession(projectRoot: string, params: SessionResumeParams): Promise; /** * List sessions with optional filtering. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function listSessions(projectRoot: string, params: SessionListParams): Promise; /** * Garbage collect old sessions. * Marks orphaned sessions that have been active too long. * Normalized Core signature: (projectRoot, params) → Result. * @task T1450 */ export declare function gcSessions(projectRoot: string, params: SessionGcParams): Promise<{ orphaned: string[]; removed: string[]; }>; export type { AgentSessionAdapterOptions, AgentSessionHandle, WrappedResult, } from './agent-session-adapter.js'; export { closeAgentSession, getReceiptsAuditPath, openAgentSession, wrapWithAgentSession, } from './agent-session-adapter.js'; export { recordAssumption } from './assumptions.js'; export type { BriefingBlockedTask, BriefingBug, BriefingEpic, BriefingOptions, BriefingTask, CurrentTaskInfo, LastSessionInfo, PipelineStageInfo, SessionBriefing, } from './briefing.js'; export { computeBriefing } from './briefing.js'; export type { ConnectionHandleContext } from './connection-session-handle.js'; export { bindConnectionSession, connectionRegistrySize, getConnectionSessionId, getCurrentConnectionSessionId, resetConnectionSessionRegistry, runWithConnectionHandle, unbindConnectionSession, } from './connection-session-handle.js'; export { getDecisionLog, recordDecision } from './decisions.js'; export type { DetectSessionDriftOptions, DriftAuditEntry, DriftReport, } from './drift-watchdog.js'; export { DEFAULT_PIVOT_THRESHOLD, DRIFT_WATCHDOG_INTERVAL_DEFAULT_SEC, DRIFT_WATCHDOG_INTERVAL_ENV, detectSessionDrift, GLOBAL_AUDIT_RELPATH, getDriftWatchdogIntervalSec, LOCAL_AUDIT_RELPATH, resolveDriftAuditPath, } from './drift-watchdog.js'; export type { FindSessionsParams, MinimalSessionRecord } from './find.js'; export { findSessions } from './find.js'; export type { FocusStateMetaAccessor } from './focus-state-store.js'; export { focusStateKey, LEGACY_FOCUS_STATE_KEY, readFocusState, writeFocusState, } from './focus-state-store.js'; export type { ComputeDebriefOptions, ComputeHandoffOptions, DebriefData, DebriefDecision, GitState, HandoffData, } from './handoff.js'; export { computeDebrief, computeHandoff, getHandoff, getLastHandoff, persistHandoff, sessionHandoffShow, } from './handoff.js'; export type { HandoffMarkdownContext } from './handoff-markdown.js'; export { emitHandoffMarkdown, renderHandoffMarkdown } from './handoff-markdown.js'; export { archiveSessions } from './session-archive.js'; export { cleanupSessions } from './session-cleanup.js'; export type { ContextDriftResult } from './session-drift.js'; export { getContextDrift } from './session-drift.js'; export type { SessionHistoryEntry, SessionHistoryParams } from './session-history.js'; export { getSessionHistory } from './session-history.js'; export { CANONICAL_SESSION_ENV_KEY, PARENT_SESSION_ENV_KEY, resolveAgentIdFromEnv, resolveParentSessionIdFromEnv, resolveSessionIdFromEnv, SESSION_ENV_KEY_PRECEDENCE, } from './session-id.js'; export { ensureGlobalSignaldockDb, mirrorSessionToManifest, readSessionManifestRow, reconcileSessionManifestOnStart, resolveGlobalManifestDbPath, } from './session-manifest-mirror.js'; export type { SessionBridgeData, SessionBridgeResult } from './session-memory-bridge.js'; export { bridgeSessionToMemory } from './session-memory-bridge.js'; export { showSession } from './session-show.js'; export type { SessionStatsResult } from './session-stats.js'; export { getSessionStats } from './session-stats.js'; export { suspendSession } from './session-suspend.js'; export { switchSession } from './session-switch.js'; export { SessionView } from './session-view.js'; export type { AssumptionRecord, DecisionRecord, TaskWorkStateExt, } from './types.js'; //# sourceMappingURL=index.d.ts.map