/** * Card-form session titles: ` : ` (`🧪 FLAKY: Fix flaky park * tests`), the form Tern heads parked panes with. The card is part of the title * string itself, so everything that shows a session title (terminal title, the * `/resume` picker, listings) shows it; {@link splitCardTitle} takes one apart * where a piece is needed. A regenerated title keeps the session's card * ({@link keepTitleCard}); a title named without one can get a card of its own * from a card reply ({@link parseCardReply}). */ import type { TitleIcons } from "./title-settings.js"; /** The card that heads a card-form title. */ export interface TitleCard { /** An emoji or a Nerd Fonts glyph. */ icon: string; /** 1-6 ASCII capitals or digits naming the subject (`FLAKY`, `Z3`). */ code: string; } /** The pieces of a card-form title. */ export interface CardTitleParts extends TitleCard { /** The title without its card. */ title: string; } /** `title` headed by `card`: `🧪 FLAKY: Fix flaky park tests`. */ export declare function formatCardTitle(card: TitleCard, title: string): string; /** * The session title a reply in the card form names: * `<title nf="nf-md-flask" emoji="🧪" code="FLAKY">Fix flaky park tests` * becomes `🧪 FLAKY: Fix flaky park tests`. `icons` picks the icon: the Nerd Fonts * glyph under `nf+emoji` when the catalog knows the `nf` name, else the emoji; * `boring` keeps the plain title. * * Returns `null` when the reply names no title: `` (the model declined), * no tag at all, or a title {@link normalizeGeneratedTitle} rejects. Card pieces * degrade one by one: an `nf` name matching no catalog glyph leaves the emoji, * and a missing or invalid code or icon leaves a plain title. A plain `<title>` * holding the line form (`🧪 FLAKY: Fix flaky park tests`) keeps its card as well, * as does a tag whose icons are attributes but whose code heads the text * (`<title emoji="⏳">WAIT Observe agent waits`). * * @param sourceText The user's message, to reconcile the title's casing against. */ export declare function parseCardTitleReply(reply: string, icons: TitleIcons, sourceText?: string): string | null; /** * The card a card reply names: `[nf] [emoji] CODE`, the text of a title model's * `` when asked to card an existing title (`nf-md-flask 🧪 FLAKY`, or * `🧪 FLAKY` without Nerd Fonts). Text after the code, such as the title echoed * back, is ignored. `icons` picks the icon as {@link parseCardTitleReply} does. * * Returns `undefined` under `boring`, and when the reply lacks a valid code or an * icon the style shows. */ export declare function parseCardReply(reply: string, icons: TitleIcons): TitleCard | undefined; /** * The pieces of a session title in the card form `<icon> <CODE>: <title>`, or * `undefined` for a plain title (`Fix: the parser` has no icon, so it stays whole). */ export declare function splitCardTitle(title: string): CardTitleParts | undefined; /** * `title` headed by the card of the session's `current` title, if it has one. * The title model names no card when it regenerates a session's title (replan * refresh, argument-less `/rename`), and a card terminal indexes the session by * its card, so the card carries over. A card the new title brings anyway (a * custom `TITLE_SYSTEM.md`, a model ignoring the prompt) yields to the current * one rather than nesting under it. */ export declare function keepTitleCard(current: string | undefined, title: string): string;