/** * The pure text side of the git tools: the prompts sent to the model and cleaning what comes back. * No I/O, so it is tested directly. */ export declare const MAX_DIFF_CHARS = 30000; /** Cut a diff to `max` characters at a line boundary and say so, so the model knows it is partial. */ export declare function truncateDiff(diff: string, max?: number): string; export interface CommitPromptInput { branch?: string; stat: string; diff: string; recent: string[]; } export declare function commitPrompt(i: CommitPromptInput): { system: string; user: string; }; export interface PrPromptInput { base: string; branch: string; commits: string[]; stat: string; diff: string; } export declare function prPrompt(i: PrPromptInput): { system: string; user: string; }; /** Strip what models add around a message: fences, a "Commit message:" label, wrapping quotes. */ export declare function cleanMessage(raw: string): string; /** A PR draft as one editable text: the title, a blank line, the body. */ export declare function splitPr(text: string): { title: string; body: string; }; /** The first line of a message. */ export declare const subject: (message: string) => string; /** Arguments of /pr: an optional base branch and a --draft flag, in any order. */ export declare function parsePrArgs(args: string): { base?: string; draft: boolean; }; /** * Command output made safe to show in a notification: escape sequences (colours, cursor moves, * window titles) and other control characters are dropped, a tab becomes spaces, and a line that * was redrawn with carriage returns (a progress bar) keeps only its last version. Newlines stay. */ export declare function plainText(raw: string): string; /** True when command output reads like a missing sign-in, key passphrase or gpg unlock. */ export declare const looksLikeAuthFailure: (text: string) => boolean; export declare const AUTH_HINT = "Hint: sign in with your credential helper, or unlock your key in ssh-agent or gpg-agent, from another terminal first, then try again.";