/** * What this run continues, said as the three states a run can be in. A thread * round knows its history from the checkpoint: "Since your last round" is in * the task when there is one, so the prompt only names the state and the * reading order. A first thread round and a standalone run share the rule that * there is nothing to catch up on; the thread one adds that the thread starts * with this answer. */ export declare function thread(options: ThreadOptions): string; export type ThreadMode = "first" | "continuing"; export interface ThreadOptions { /** * Where this run sits in its thread. `continuing` is a later round with * history to catch up on; `first` opens a thread; undefined is a standalone * run with no thread at all. */ threadMode?: ThreadMode; } /** * How a host collapses a comment. The round is the same everywhere, so a host * adds one line of mechanism, never a round of its own. * * The host comes from the environment, never from the remote: a remote says * where the code lives, CI variables say we have a thread to answer in. */ declare const HOSTS: { github: { env: string[]; collapse: string; }; gitlab: { env: string[]; collapse: string; }; bitbucket: { env: string[]; collapse: string; }; generic: { env: never[]; collapse: string; }; }; /** * Which host this job belongs to. `generic` when it is CI and nothing claims it, * nothing at all when it is not CI — a developer's own checkout has no thread. */ export declare function threadHost(env: Environment): ThreadHost | null; /** What a comment of this thread opens with, and so what identifies it. */ export declare function threadMarker(thread: string): string; export declare function commentThread(options: CommentThreadOptions): string; export type ThreadHost = keyof typeof HOSTS; type Environment = Record; export interface CommentThreadOptions extends ThreadOptions { host: ThreadHost; /** Which conversation this run is, so parallel runs never touch each other. */ thread: string; /** * The exact marker line a comment opens with. Built by the CLI so a comment * the agent posts itself is stamped the same way as one the CLI delivers — * the next round finds both by the same prefix. */ marker: string; /** The report file, so the comment body is the report and not a remark. */ reportFile?: string; /** The heading the CLI would have opened the report with, if any. */ header?: string; /** The line the CLI would have signed the report with, if any. */ footer?: string; /** True when the command posts the answer and collapses the older ones. */ delivered?: boolean; } export {};