| 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. |
| 2 | import type { SessionSource } from "./SessionSource"; |
| 3 | |
| 4 | /** |
| 5 | * Cheap metadata for the TOC sidebar — never loads the full file. |
| 6 | */ |
| 7 | export type SessionSummary = { |
| 8 | /** |
| 9 | * UUID — the JSONL filename minus the extension. |
| 10 | */ |
| 11 | id: string, |
| 12 | /** |
| 13 | * The project's encoded-dir id. |
| 14 | */ |
| 15 | projectId: string, |
| 16 | /** |
| 17 | * customTitle > slug > first real user message (truncated) > "(untitled)" |
| 18 | */ |
| 19 | title: string, |
| 20 | /** |
| 21 | * First event carrying a timestamp. |
| 22 | */ |
| 23 | startedAt: string | null, |
| 24 | /** |
| 25 | * Last event carrying a timestamp, or filesystem mtime as fallback. |
| 26 | */ |
| 27 | lastActivityAt: string | null, |
| 28 | /** |
| 29 | * First assistant message's `message.model`, if observed. |
| 30 | */ |
| 31 | model: string | null, |
| 32 | /** |
| 33 | * Count of events that render as rows in the viewer timeline. |
| 34 | * Excludes session-level metadata events (`permission-mode`, |
| 35 | * `file-history-snapshot`, etc.) and sidechain subagent |
| 36 | * events. Matches `read_session`'s `messages.len()`. |
| 37 | */ |
| 38 | messageCount: number, |
| 39 | /** |
| 40 | * Count of actual human-typed prompts. A `user` event whose |
| 41 | * `content` is a plain string, or an array that does NOT |
| 42 | * contain a `tool_result` block, counts as a prompt. |
| 43 | * Tool-result return events (which Claude Code writes as |
| 44 | * `user` events after every `tool_use`) are excluded so the |
| 45 | * sidebar reflects turns the human actually drove. |
| 46 | */ |
| 47 | promptCount: number, gitBranch: string | null, version: string | null, slug: string | null, |
| 48 | /** |
| 49 | * Verified working directory from the first event that carried a |
| 50 | * `cwd` field. Projects use this as the authoritative cwd when |
| 51 | * aggregating. |
| 52 | */ |
| 53 | cwd: string | null, |
| 54 | /** |
| 55 | * Explicit title set via a `custom-title` event inside the jsonl |
| 56 | * (Claude Code's `/title` slash command). When this is `Some`, |
| 57 | * the command layer must **not** override `title` with any |
| 58 | * external source — the user set it deliberately. |
| 59 | */ |
| 60 | customTitle: string | null, |
| 61 | /** |
| 62 | * Which client wrote this session. Common values observed on disk: |
| 63 | * `"cli"` (terminal Claude Code), `"claude-vscode"` (the VS Code |
| 64 | * extension), `"sdk-ts"` (the claude-mem observer agent or any |
| 65 | * other Agent SDK caller). |
| 66 | */ |
| 67 | entrypoint: string | null, |
| 68 | /** |
| 69 | * Disk-backed or archive-reconstructed. Determines which |
| 70 | * dispatch path [`commands::read_session`] takes. |
| 71 | */ |
| 72 | source: SessionSource, }; |