import type { CommitSummary } from "./types"; export type CommitBrief = Pick; export function toBrief(commit: CommitSummary): CommitBrief { return { sha: commit.sha, shortSha: commit.shortSha, subject: commit.subject, authorName: commit.authorName, committedAt: commit.committedAt, }; } /** A run of consecutive final-version lines (0-based `start`) attributed to one commit. */ export type BlameRange = { start: number; count: number; sha: string }; export type BlameResult = { lines: string[]; ranges: BlameRange[]; commits: Record; truncated: boolean; }; export type CodeSearchHit = { owner: string; repo: string; ref: string; path: string; snippet: string; }; export const SNIPPET_OPEN = "\u0001"; export const SNIPPET_CLOSE = "\u0002"; export type NotebookOutput = { id: number } & ( | { kind: "text"; text: string; stderr: boolean } | { kind: "image"; mime: string; data: string } | { kind: "error"; text: string } ); export type NotebookCell = { id: number } & ( | { kind: "markdown"; html: string } | { kind: "code"; source: string; executionCount: number | null; outputs: NotebookOutput[] } | { kind: "raw"; text: string } ); export type Notebook = { language: string; cells: NotebookCell[]; truncated: boolean };