Files
oh-my-opencode/dist/hooks/claude-code-hooks/transcript.d.ts
T
2026-03-14 04:56:50 +00:00

30 lines
1.2 KiB
TypeScript

import type { TranscriptEntry } from "./types";
export declare function getTranscriptPath(sessionId: string): string;
export declare function appendTranscriptEntry(sessionId: string, entry: TranscriptEntry): void;
/**
* Clear transcript cache for a specific session or all sessions.
* Call on session.deleted to prevent memory accumulation.
*/
export declare function clearTranscriptCache(sessionId?: string): void;
/**
* Build Claude Code compatible transcript from session messages.
* Uses per-session cache to avoid redundant session.messages() API calls.
* First call fetches and caches; subsequent calls reuse cached base entries.
*/
export declare function buildTranscriptFromSession(client: {
session: {
messages: (opts: {
path: {
id: string;
};
query?: {
directory: string;
};
}) => Promise<unknown>;
};
}, sessionId: string, directory: string, currentToolName: string, currentToolInput: Record<string, unknown>): Promise<string | null>;
/**
* Delete temp transcript file (call in finally block)
*/
export declare function deleteTempTranscript(path: string | null): void;