import type { ImageContent, Message, TextContent, Usage } from "@bastani/pi-ai/compat"; import type { VerbatimCompactionDetails } from "./compaction/compaction-types.js"; import type { BashExecutionMessage, CustomMessage } from "./messages.ts"; import { type BranchSummaryEntry, type CompactionEntry, type ContextEditEntry, type CustomEntry, type CustomMessageEntry, type FileEntry, type LabelEntry, type ModelChangeEntry, type SessionEntry, type SessionHeader, type SessionInfoEntry, type SessionMessageEntry, type SessionNameState, type SessionSummaryEntry, type SessionWorkflowMetadata, type ThinkingLevelChangeEntry } from "./session-manager-types.ts"; export declare function createSessionHeader(id: string, cwd: string, timestamp?: string, parentSession?: string, internal?: boolean, workflow?: SessionWorkflowMetadata): SessionHeader; export declare function createSessionFilePath(sessionDir: string, timestamp: string, sessionId: string): string; export declare function createMessageEntry(message: Message | CustomMessage | BashExecutionMessage, byId: { has(id: string): boolean; }, parentId: string | null): SessionMessageEntry; export declare function createThinkingLevelChangeEntry(thinkingLevel: string, byId: { has(id: string): boolean; }, parentId: string | null): ThinkingLevelChangeEntry; export declare function createModelChangeEntry(provider: string, modelId: string, byId: { has(id: string): boolean; }, parentId: string | null): ModelChangeEntry; export declare function createCompactionEntry(compactedText: string, firstKeptEntryId: string | null, tokensBefore: number, details: VerbatimCompactionDetails, usage: Usage | undefined, byId: { has(id: string): boolean; }, parentId: string | null): CompactionEntry; export declare function createContextEditEntry(targetId: string, replacement: ContextEditEntry["replacement"], byId: { has(id: string): boolean; }, parentId: string | null): ContextEditEntry; export declare function createCustomEntry(customType: string, data: unknown, byId: { has(id: string): boolean; }, parentId: string | null): CustomEntry; export declare function createSessionInfoEntry(name: string, byId: { has(id: string): boolean; }, parentId: string | null): SessionInfoEntry; export declare function createSessionSummaryEntry(summary: string, summarizedThroughId: string, usage: Usage | undefined, byId: { has(id: string): boolean; }, parentId: string | null): SessionSummaryEntry; /** * Anchor for a session summary: the newest user/assistant message entry. * * Both sides of the freshness check call this so they cannot drift apart. Tool results and * non-message entries are ignored, and an assistant turn made only of tool calls still counts — * it carries no text, but it is a real conversation step. */ export declare function getLastConversationMessageId(entries: FileEntry[]): string | undefined; /** * Latest generated resume summary that has not been retired, entry and all. * * Returns the entry rather than its text: callers need `summarizedThroughId` alongside the * summary to decide whether it still describes the conversation. * * A `branch_summary` written afterwards retires it, because the branch it described was * abandoned. Both the picker and the generation guard call this, so a retired summary is hidden * from the picker *and* lets a replacement be generated; splitting the two rules leaves such a * session showing fallback text forever. */ export declare function getLatestSessionSummary(entries: FileEntry[]): SessionSummaryEntry | undefined; export declare function getLatestSessionName(entries: readonly FileEntry[]): SessionNameState; export declare function createCustomMessageEntry(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details: T | undefined, excludeFromContext: boolean | undefined, protectedReconciliation: CustomMessageEntry["protectedReconciliation"], byId: { has(id: string): boolean; }, parentId: string | null, stageAdmissionKey?: string): CustomMessageEntry; export declare function createLabelEntry(targetId: string, label: string | undefined, byId: { has(id: string): boolean; }, parentId: string | null, timestamp?: string): LabelEntry; export declare function createBranchSummaryEntry(branchFromId: string | null, fromId: string, summary: string, details: unknown, usage: Usage | undefined, fromHook: boolean | undefined, byId: { has(id: string): boolean; }): BranchSummaryEntry; export declare function getEntriesWithoutHeader(fileEntries: FileEntry[]): SessionEntry[]; //# sourceMappingURL=session-manager-entries.d.ts.map