import { z } from 'zod'; import type { JsonObject, SkillCallSplitRecord, SplitEntry, TransformContext } from './types'; /** * Canonicalize a harness skill name: `sp-dev-run` / `$sp-dev-run` / `/skill:sp-dev-run` → * `sp:dev-run`; `rd3-*` → `rd3:*`. Only the frozen harness package set is rewritten — an * unqualified name like `code-review` is kept verbatim (exact structural match, 0736 R4). */ export declare function canonicalizeSkillName(raw: string): string; /** Identity fields a split already computed for its parent message (skill rows join it). */ export interface SkillCallIdentity { readonly sessionId: string; readonly seq: number; /** Split index of the parent message entry in the same split batch (_messageSplitIndex). */ readonly messageSplitIndex: number; } /** * Detect skill-load events in one raw source record (0736 R1/R2). Dispatches on the source in * the transform context; unknown sources return nothing. Detection signatures per source are * the verified ones from the storm report §10.3: * * - L1 native load tool is authoritative (claude/omp `Skill`, agy `view_file` skill reads, * grok `read_file` on SKILL.md, opencode native `skill`). * - Sources with no L1 trigger on their structural signal: pi's `` * wrapper, codex's `/` block, gemini's L0 harness prefix. * - L0/L2 never trigger for agents that have an L1 (false-positive suppression, 0736 R4). */ export declare function extractSkillCalls(raw: JsonObject, context: TransformContext | undefined, identity: SkillCallIdentity): readonly SkillCallSplitRecord[]; /** * Route one skill-load row to `history_skill_call` exactly like tool calls route to * `history_tool_call`: a SplitEntry whose record the importer normalizes, hashes, dedups, * and inserts through the typed-column path. */ export declare function skillCallEntry(record: SkillCallSplitRecord): SplitEntry; /** Compute args_digest: sha256 of stable-jsonified, key-sorted, redacted args. */ export declare function argsDigest(args: unknown): string; /** * Return retained raw args for a typed tool call: the shell command string for * recognized bash/shell/exec/command tools, sanitized valid JSON otherwise, and * undefined when the event carries no invocation arguments. */ export declare function maybeArgsRaw(_source: string, toolName: string, args: unknown): string | undefined; /** Map a Claude Code JSONL record into one or more ETL split entries. */ export declare function claudeSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Map a Pi JSONL record into one or more ETL split entries. */ export declare function piSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Map an OMP JSONL record into one or more ETL split entries. */ export declare function ompSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Timing signals carried by an OMP toolResult message envelope (task 0564 R1). */ export interface OmpToolResultTiming { /** The toolCall id this result answers — joins `toolCall.id` exactly. */ toolCallId: string; /** The tool's own measured wall time in ms, when present and finite. */ wallTimeMs: number | undefined; /** Message timestamp as epoch millis, when parseable. */ timestampMs: number | undefined; } /** Parse a message timestamp (epoch-millis number, numeric string, or ISO) to epoch millis. */ export declare function timestampToEpochMs(value: unknown): number | undefined; /** * Extract toolResult timing signals from a raw OMP record (task 0564 R1), or null * when the record is not a toolResult message or carries no toolCallId. Live OMP * emits `role: "toolResult"` message envelopes with `{toolCallId, toolName, * content, details, isError, timestamp}`; `details.wallTimeMs` is the tool's own * measured wall time (48% of results in the sampled session) and `toolCallId` * joins the originating `toolCall.id` exactly. */ export declare function ompToolResultTiming(raw: Record): OmpToolResultTiming | null; /** Signals carried by a Claude tool_result user line (task 0624 R2). */ export interface ClaudeToolResultTiming { /** The `toolu_…` id from the answered tool_use block — joins `tool_use.id` exactly. */ toolCallId: string; /** Message timestamp as epoch millis, when parseable. */ timestampMs: number | undefined; /** Native tool duration, when Claude Code emits one. */ durationMs: number | undefined; /** Serialized size in bytes of the tool result payload. */ resultBytes: number; } /** * Extract tool_result signals from a raw Claude Code record (task 0624 R2), or * null when the record carries no tool_result block. Claude Code emits * `type: "user"` lines whose `message.content` holds `{type: "tool_result", * tool_use_id, content}` blocks; the top-level `toolUseResult` carries the raw * envelope. `resultBytes` prefers the model-visible block content and falls * back to `toolUseResult`; both are null-safe. Some tool results carry a native * `durationMs` or `durationSeconds`; absent timing stays unmeasured. */ export declare function claudeToolResultTiming(raw: Record): ClaudeToolResultTiming | null; /** Map a Codex JSONL record into one or more ETL split entries. */ export declare function codexSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Map an Antigravity (AGY) JSONL record into one or more ETL split entries. */ export declare function agySplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Map Gemini CLI message, tool, and session-state events into the forensic contract tables. */ export declare function geminiSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** * Map one DeepSeek dsh `session.v3.jsonl` line into forensic ETL entries (task 0067 R2). * * dsh layout: line 1 is the session header `{type:"session", version:3, id, createdAt, cwd, ...}` and is * persisted as one `history_message` metadata row (role/disposition `meta`) carrying session * identity, cwd and creation time; * * any remaining lines are append-only events `{type, seq, time, data}` whose * vocabulary is plugin-extensible. Only chat events (`user/message`, * `assistant/message`) become conversational `keep` rows (content is an array of * `{text}` blocks — the existing extractContentText joined-text rule); every * unrecognized event type (compaction/*, hook/*, turn/*, session/title, …) is * tolerated and skipped, and torn crash tails never reach the mapper because * the source registers `corruptLinePolicy: 'skip'`. Session identity comes from * the `session-` dir path (stateless — message events carry no session id), * mirroring the agy/codex path-identity precedent. */ export declare function dshSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** * Pure helper extracting canonical session identity from source transcript paths (task 0638 R4). * * Normalizes POSIX/Windows separators and returns only valid UUID-shaped identifiers: * - agy: segment immediately following `/brain/` * - codex: trailing UUID before `.jsonl` in a filename beginning with `rollout-` */ export declare function sessionIdFromSourcePath(source: string, sourceFile: string): string | undefined; /** Map a Grok JSONL record into one or more ETL split entries. */ export declare function grokSplit(raw: Record, context?: TransformContext): readonly SplitEntry[]; /** Compute a stable field-shape key from a JSON object: sorted, lowercased, +-joined top-level keys. */ export declare function stableFieldShape(raw: JsonObject): string; /** Identity field map for the Claude mapper. */ export declare const CLAUDE_FIELD_MAP: Record; /** Identity field map for the Pi mapper. */ export declare const PI_FIELD_MAP: Record; /** Identity field map for the OMP mapper. */ export declare const OMP_FIELD_MAP: Record; /** Identity field map for the Codex mapper. */ export declare const CODEX_FIELD_MAP: Record; /** Identity field map for the AGY mapper. */ export declare const AGY_FIELD_MAP: Record; /** Identity field map for the Grok mapper. */ export declare const GROK_FIELD_MAP: Record; /** Identity field map for the Gemini mapper. */ export declare const GEMINI_FIELD_MAP: Record; /** Identity field map for the DeepSeek dsh mapper — message rows only, no tool-call rows. */ export declare const DSH_FIELD_MAP: Record; /** Passthrough Zod schema for the Claude mapper. */ export declare const CLAUDE_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the Pi mapper. */ export declare const PI_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the OMP mapper. */ export declare const OMP_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the Codex mapper. */ export declare const CODEX_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the AGY mapper. */ export declare const AGY_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the Grok mapper. */ export declare const GROK_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the Gemini mapper. */ export declare const GEMINI_SCHEMA: z.ZodObject<{}, z.core.$loose>; /** Passthrough Zod schema for the DeepSeek dsh mapper. */ export declare const DSH_SCHEMA: z.ZodObject<{}, z.core.$loose>; //# sourceMappingURL=mappers.d.ts.map