type Confidence = 'EXTRACTED' | 'INFERRED' | 'AMBIGUOUS'; export interface CognitionOptions { /** Canon-store-relative source path of the session (e.g. `canon/claude-code/…jsonl`) — stamped as each node/edge's `source_file`, matching the sess/touched convention. */ sessionSourceFile: string; /** * SHARING RISK OPT-IN. When true, each thought node ALSO carries a `text` * field with the fuller (still-scrubbed) thinking text — richer, but a * larger surface of derived thinking content in a pushable artifact. Default * false: labels only (structural + a scrubbed ~80-char snippet). */ includeThoughtText?: boolean; /** The secret-scrub every content-derived string is routed through. Default identity — callers that emit into a shareable graph MUST pass `scrubSecrets` from canonSync. */ scrub?: (s: string) => string; /** Label snippet length (default 80). */ labelChars?: number; /** Full opt-in `text` length cap (default 2000, mirrors windowDocs truncation discipline). */ textChars?: number; /** * Injected path→file-node resolver (project-ownership lives in canonGraph). * Returns the graph node id for an absolute path THIS project owns (creating * a `file:` node if needed), or undefined for a path owned by no/other * project. When provided, `thought → source_file` edges are built here; the * `fileLinks` are always returned for inspection regardless. */ resolveFile?: (absPath: string) => string | undefined; } export interface CognitionNode { id: string; label: string; file_type: string; source_file: string; source_location: string; node_type: 'thought' | 'tool_call'; [k: string]: unknown; } export interface CognitionEdge { source: string; target: string; relation: string; confidence: Confidence; confidence_score: number; source_file: string; source_location: string; weight: number; } export interface CognitionResult { nodes: CognitionNode[]; links: CognitionEdge[]; /** Every (thought, tool, absolute path) linkage the turn's tool calls imply — reported even when no resolver folded them into edges. */ fileLinks: { thought: string; tool: string; absPath: string; }[]; thoughts: number; toolEdges: number; fileEdges: number; continuityEdges: number; } /** * Pure extraction: canonical records → cognition nodes/edges. Groups assistant * records by (session_id, turn); emits ONE thought node per reasoning-bearing * turn plus its EXTRACTED thought→tool_call edges, INFERRED thought→source_file * edges (via `resolveFile`), and INFERRED thought→thought continuity edges * between consecutive reasoning turns of a session. No fs/git. */ export declare function extractCognition(records: any[], opts: CognitionOptions): CognitionResult; /** * fs helper (kept OUT of the pure core): stream a session's canon JSONL parts * and return the assistant records that bear reasoning or tool calls — the * bounded input `extractCognition` needs. Pre-filters cheaply on the raw line * so 170MB sessions don't fully parse. Not unit-tested itself (trivial IO); * the extraction it feeds is. */ export declare function readSessionCognitionRecords(parts: string[]): Promise; export {}; //# sourceMappingURL=canonCognition.d.ts.map