import { i as MsgContext } from "./templating-CVr5jMpU.js"; import { n as GroupKeyResolution, o as SessionEntry, s as SessionScope } from "./types-Bp0yxyUk.js"; import { h as ResolvedSessionMaintenanceConfig } from "./session-key-C9d-16to.js"; //#region src/sessions/transcript-events.d.ts /** Normalized transcript update emitted after a session transcript changes. */ type SessionTranscriptUpdate = { sessionFile: string; sessionKey?: string; agentId?: string; message?: unknown; messageId?: string; messageSeq?: number; }; type SessionTranscriptListener = (update: SessionTranscriptUpdate) => void; /** Registers a listener for normalized session transcript updates. */ declare function onSessionTranscriptUpdate(listener: SessionTranscriptListener): () => void; /** Emits a normalized transcript update to all registered listeners. */ declare function emitSessionTranscriptUpdate(update: string | SessionTranscriptUpdate): void; //#endregion //#region src/config/sessions/group.d.ts /** * Resolves channel/group chat context into the persisted group session key. * * Provider-prefixed ids use channel-owned normalization, while legacy plugin resolvers remain a * fallback for older channel surfaces that cannot yet express the generic route shape. */ declare function resolveGroupSessionKey(ctx: MsgContext): GroupKeyResolution | null; //#endregion //#region src/config/sessions/artifacts.d.ts /** Returns true for archived session artifacts and legacy store backup names. */ declare function isSessionArchiveArtifactName(fileName: string): boolean; /** Returns true for transcript files counted in usage, including reset/deleted archives. */ declare function isUsageCountedSessionTranscriptFileName(fileName: string): boolean; /** Extracts the session id from a usage-counted transcript filename. */ declare function parseUsageCountedSessionIdFromFileName(fileName: string): string | null; //#endregion //#region src/config/sessions/main-session.d.ts /** Canonicalizes main-session aliases to the current scoped session key. */ declare function canonicalizeMainSessionAlias(params: { cfg?: { session?: { scope?: SessionScope; mainKey?: string; }; }; agentId: string; sessionKey: string; }): string; //#endregion //#region src/config/sessions/transcript.d.ts type AssistantTranscriptText = { id?: string; text: string; timestamp?: number; }; type LatestAssistantTranscriptText = AssistantTranscriptText; declare function readLatestAssistantTextFromSessionTranscript(sessionFile: string | undefined): Promise; //#endregion //#region src/config/sessions/session-file.d.ts /** Resolves a transcript file path and persists it into the session store when needed. */ declare function resolveAndPersistSessionFile(params: { sessionId: string; sessionKey: string; sessionStore: Record; storePath: string; sessionEntry?: SessionEntry; agentId?: string; sessionsDir?: string; fallbackSessionFile?: string; activeSessionKey?: string; maintenanceConfig?: ResolvedSessionMaintenanceConfig; }): Promise<{ sessionFile: string; sessionEntry: SessionEntry; }>; //#endregion export { isUsageCountedSessionTranscriptFileName as a, emitSessionTranscriptUpdate as c, isSessionArchiveArtifactName as i, onSessionTranscriptUpdate as l, readLatestAssistantTextFromSessionTranscript as n, parseUsageCountedSessionIdFromFileName as o, canonicalizeMainSessionAlias as r, resolveGroupSessionKey as s, resolveAndPersistSessionFile as t };