type HookEvent = Record; type SessionFields = Record; type AdapterOutput = { readonly sessionFields: SessionFields; readonly priorAssistant: string | null; readonly usesTranscript: boolean; }; /** * Normalise a raw hook event into session fields, priorAssistant context, and * transcript usage flag — varying by agent type. * * - "codex": reads model/permission_mode/source + last_assistant_message * directly from the event (no transcript file). * - "pi": same event-carried shape as codex — the events are authored by * glen's own pi extension (packages/pi-plugin/extensions/glen.ts); pi's * session file is a pi-specific JSONL tree glen doesn't parse. * - "claude-code" and generic/unknown: uses parseTranscript for priorAssistant * and the user-message index (nextUserMessageIndex) that callers need for * idempotency key derivation. */ declare const adaptAgentEvent: (agent: string | undefined, event: HookEvent, transcriptLines: readonly string[]) => AdapterOutput; export { adaptAgentEvent };