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,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAC1B,kBAAkB,GAClB,gBAAgB,GAChB,sBAAsB,GACtB,aAAa,GACb,WAAW,GACX,UAAU,GACV,aAAa,GACb,sBAAsB,GACtB,gBAAgB,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IAClC,aAAa,EAAE,CAAC,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,GAAG,KAAK,GAAG,WAAW,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACxC,aAAa,EAAE,CAAC,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B","sourcesContent":["import type { StoredPayload, UsageSummary } from \"../types.ts\";\n\nexport type SessionStartReason = \"startup\" | \"reload\" | \"new\" | \"resume\" | \"fork\";\nexport type SessionEndReason = \"quit\" | \"reload\" | \"new\" | \"resume\" | \"fork\";\nexport type VerificationKind = \"test\" | \"lint\" | \"build\" | \"typecheck\" | \"check\";\n\nexport interface RecorderEventBase {\n\tschemaVersion: 1;\n\tsessionId: string;\n\tsequence: number;\n\ttimestamp: string;\n\tbundleDigest: string | null;\n}\n\nexport interface SessionStartRecord {\n\ttype: \"session_start\";\n\treason: SessionStartReason;\n\tcwd: string;\n\tsessionFile?: string;\n\tpreviousSessionFile?: string;\n}\n\nexport interface SessionEndRecord {\n\ttype: \"session_end\";\n\treason: SessionEndReason;\n\ttargetSessionFile?: string;\n}\n\nexport interface BeforeAgentStartRecord {\n\ttype: \"before_agent_start\";\n\tprompt: StoredPayload;\n\tsystemPrompt: StoredPayload;\n\tsystemPromptOptions: StoredPayload;\n\timages?: StoredPayload;\n}\n\nexport interface MessageRecord {\n\ttype: \"message\";\n\trole: string;\n\tmessage: StoredPayload;\n\t/** Pi session entry id, used to deduplicate resume-time backfill. */\n\tsourceEntryId?: string;\n}\n\nexport interface UsageRecord {\n\ttype: \"usage\";\n\tprovider: string;\n\tmodel: string;\n\tusage: UsageSummary;\n}\n\nexport interface VerificationRecord {\n\tkind: VerificationKind;\n\tcommand: string;\n\texitCode: number | null;\n}\n\nexport interface ToolRecord {\n\ttype: \"tool\";\n\ttoolCallId: string;\n\ttoolName: string;\n\tstartedAt: string;\n\tendedAt: string;\n\tdurationMs: number;\n\tinput: StoredPayload;\n\tresult: StoredPayload;\n\tisError: boolean;\n\tverification?: VerificationRecord;\n}\n\nexport interface GitDiffRecord {\n\ttype: \"git_diff\";\n\tcwd: string;\n\tclean: boolean;\n\tdiff: StoredPayload;\n}\n\nexport interface ExplicitFeedbackRecord {\n\ttype: \"explicit_feedback\";\n\tsource: \"interactive\" | \"rpc\" | \"extension\";\n\ttext: StoredPayload;\n\tinboxFile: string;\n}\n\nexport interface CompactionRecord {\n\ttype: \"compaction\";\n\treason: \"manual\" | \"threshold\" | \"overflow\";\n\twillRetry: boolean;\n\tfromExtension: boolean;\n\tfirstKeptEntryId: string;\n\ttokensBefore: number;\n\tdurationMs: number | null;\n\tsummary: StoredPayload;\n\tdetails?: StoredPayload;\n}\n\nexport type RecorderEventData =\n\t| SessionStartRecord\n\t| SessionEndRecord\n\t| BeforeAgentStartRecord\n\t| MessageRecord\n\t| UsageRecord\n\t| ToolRecord\n\t| GitDiffRecord\n\t| ExplicitFeedbackRecord\n\t| CompactionRecord;\n\nexport type RecorderEvent = RecorderEventBase & RecorderEventData;\nexport type RecordedEvent = RecorderEvent;\n\nexport type RecorderInboxKind = \"candidate\" | \"preference\" | \"request\" | \"note\";\n\nexport interface RecorderInboxEntry {\n\tschemaVersion: 1;\n\tid: string;\n\ttimestamp: string;\n\tsessionId: string;\n\tsource: \"interactive\" | \"rpc\" | \"extension\";\n\ttext: string;\n\t/** Legacy entries omit this and are classified from their text prefix. */\n\tkind?: RecorderInboxKind;\n}\n\nexport interface RecorderSessionReference {\n\tschemaVersion: 1;\n\tsessionId: string;\n\tlogPath: string;\n\tbundleDigest: string | null;\n}\n"]}