/**
 * Session highlight extractors.
 *
 * Pure derivations over a session's `SessionEvent[]` that power the "what did
 * this session use and produce" sections of both renders of a session — the
 * picker quick preview (`sessions-picker.ts`) and the full summary
 * (`render.ts`). One module, two consumers, so the panes never drift.
 *
 * Skills/hooks/links are no-I/O. `extractRepos` touches the filesystem (a
 * bounded `.git` walk over a handful of candidate dirs) and is the only
 * non-pure function here.
 */
import type { SessionAgentId, SessionEvent } from './types.js';
import { type FileChange } from './digest.js';
export interface SkillUse {
    name: string;
    count: number;
}
/**
 * True for a tool_use event that is that harness's skill-invocation call (see
 * {@link SKILL_TOOL_NAME_BY_AGENT}). Exported so an INCREMENTAL parser
 * (discover.ts's ClaudeParseState/foldDerivedToolState) can select matching
 * events into a small held array as it streams, then run {@link extractSkills}
 * over just that subset at finalize — without re-parsing the whole transcript.
 */
export declare function isSkillInvocation(e: SessionEvent): boolean;
/**
 * Skills invoked during the session, from that harness's skill-invocation
 * tool calls (see {@link SKILL_TOOL_NAME_BY_AGENT}). Carries the skill id in
 * `args.skill` (or `args.name`). Sorted by count desc, then name.
 */
export declare function extractSkills(events: SessionEvent[]): SkillUse[];
export interface SlashCommandUse {
    /** WITH the leading slash, e.g. `/recap`, `/code:commit` — matches SessionEvent.slashCommand's shape. */
    name: string;
    count: number;
}
/**
 * Slash commands invoked during the session — either the user typing one
 * (Claude's `<command-name>` wrapper) or the model invoking one via the
 * `SlashCommand` tool (`SessionEvent.slashCommand`, populated by
 * `parseClaudeContent` for both sources — see session/prompt.ts). Sorted by
 * count desc, then name.
 */
export declare function extractSlashCommands(events: SessionEvent[]): SlashCommandUse[];
export interface HookUse {
    /** Hook name as configured, e.g. `SessionStart:startup`. */
    name: string;
    /** Lifecycle event, e.g. `SessionStart`. */
    event?: string;
    /** How many times it fired. */
    count: number;
    /** How many firings failed (non-`hook_success` records). */
    failed: number;
}
/**
 * Hooks that fired during the session, folded from `hook` events (parsed from
 * Claude's `hook_success`/`hook_error`/… attachment records; other harnesses
 * don't record firings in their transcripts, so they yield an empty list).
 * Sorted by count desc, then name.
 */
export declare function extractHooks(events: SessionEvent[]): HookUse[];
export type LinkKind = 'linear' | 'jira' | 'github' | 'gitlab' | 'other';
export interface SessionLink {
    kind: LinkKind;
    url: string;
    /** Short display label: `RUSH-2076`, `PR#1755`, `owner/repo#123`, host. */
    label: string;
}
/**
 * Links mentioned in user/assistant messages, classified (Linear/Jira/GitHub/
 * GitLab), deduped by URL AND by label (a session that quotes the same PR in
 * five messages shows it once), first-seen order. Capped so a link-heavy
 * session can't flood the pane.
 */
export declare function extractLinks(events: SessionEvent[]): SessionLink[];
export type ArtifactBucket = 'artifacts' | 'plans' | 'reports' | 'docs';
export interface ProducedArtifact {
    /** Absolute (or session-relative) path of the created file. */
    path: string;
    basename: string;
    bucket: ArtifactBucket;
}
/**
 * Documents/files the session CREATED, from the already-classified changes
 * (callers classify once — this never re-derives). Keeps the ones a human
 * browses later: anything under `.agents/artifacts|plans|reports/`, plus other
 * `*.md`/`*.html` creations. Source/config churn (the bulk of `+N`) stays in
 * the Changes line.
 */
export declare function extractArtifacts(changes: FileChange[]): ProducedArtifact[];
/**
 * Repos the session worked in, from the directories its file paths live under
 * (a bounded `.git` walk-up; a `.git` FILE counts too — that's the worktree
 * layout). Names are repo dir basenames, first-seen order, capped.
 *
 * Relative paths resolve against the SESSION's cwd only — when it is unknown
 * (e.g. kimi rows carry no cwd today) they are skipped: resolving them against
 * the viewer's process cwd attributes the session to whatever repo the CLI
 * happens to run in, which is a wrong answer, not a degraded one.
 */
export declare function extractRepos(events: SessionEvent[], cwd?: string): string[];
/**
 * True when this harness records backgrounded shells at all. Callers MUST gate
 * on this before rendering a count: for a harness that cannot report it, "0" is
 * a lie ("none running") where the truth is "unknown", so the segment is omitted
 * entirely — the same way the Hooks line renders for Claude only.
 */
export declare function harnessTracksBackgroundShells(agent: SessionAgentId): boolean;
/**
 * True for a tool_use event that starts a background shell. Exported for the
 * same reason {@link isSkillInvocation} is: the incremental parser can select
 * matching events while streaming instead of re-reading the transcript.
 */
export declare function isBackgroundShellStart(e: SessionEvent): boolean;
export interface BackgroundShell {
    /** The command line as invoked, trimmed for display. */
    command: string;
    timestamp: string;
}
/**
 * Shells the session started in the background, oldest first.
 *
 * This is "started", NOT "still running". A transcript records the start and
 * never the death, and inferring liveness from its absence is the same trap
 * `agents devices ps` documents — a killed process leaves no marker, so a naive
 * reader reports "running" forever. Live status belongs to `sessions --active`,
 * which resolves real pids.
 */
export declare function extractBackgroundShells(events: SessionEvent[]): BackgroundShell[];
/**
 * True for a tool call that spawns another agent. Deliberately counts BOTH
 * shapes, because both are fan-out the operator needs to see:
 *
 *   in-process   an `Agent` / `Task` tool call inside this transcript
 *   shelled-out  a Bash command that invokes `agents run`, `agents cloud run`,
 *                or `agents teams add|start`
 *
 * Moved here from `commands/sessions-picker.ts` so BOTH preview body paths (the
 * digest body and `formatMetaOnlyBody`) share one definition instead of
 * drifting apart. Semantics are unchanged: session f045b577 counts 23
 * in-process + 30 shelled-out = 53.
 *
 * The full summary's `Subagents (N)` section (`render.ts`) deliberately does NOT
 * use this. It builds a described ROSTER, so it needs `args.description` /
 * `args.prompt` and is necessarily limited to in-process `Agent`/`Task` calls —
 * a shelled-out `agents run` carries no such description. Different question,
 * different answer; do not "unify" them.
 */
export declare function isSubAgentTool(tool: string, command: string): boolean;
