/** * M30: agent profiles, level 0 of any-agent (docs/plans/any-agent.md). A profile runs a * terminal agent roost knows nothing else about: its argv, how it takes a task, and what * on its screen says it is working or waiting. Profiles come from the user's roost.json * only: a cloned project cannot make roost run a command of its choosing. */ export interface AgentProfile { /** argv, never a shell line; `{model}`, `{thinking}`, `{task}` replace whole elements. */ command: string[]; /** How the first task reaches it: appended to argv, typed once it first goes quiet, or not at all. */ task: "argv" | "type" | "none"; /** argv added when a model is chosen (`{model}` in it); absent: the agent takes no model. */ model?: string[]; /** argv added when a thinking level is chosen (`{thinking}` in it). */ thinking?: string[]; /** argv that reopens its last session; null or absent: its command again, without the first task. */ resume?: string[] | null; /** Regex over the whole screen: it is waiting for you. */ waiting?: string; /** Regex over the whole screen: it is working (wins over quiet). */ working?: string; /** Typed after a reply; default "\r". */ submit?: string; /** Quiet this long (ms) with no other signal means it is idle; default 3000. */ settleMs?: number; /** Extra environment; names on the deny list are dropped like any job's. */ env?: Record; /** * M31: it speaks the roost agent protocol (docs/protocol.md): it gets the job's identity, * its reports set the row, and replies reach it as protocol replies, not typed in. */ protocol?: boolean; } export declare const PROFILE_NAME: RegExp; export declare const profileName: (name: string) => boolean; /** A regex source that compiles (case-insensitive, multiline), or undefined. */ export declare function profileRegex(src: string | undefined): RegExp | undefined; /** A profile from JSON, or undefined when it is not one (a bad regex makes it not one). */ export declare function profileFrom(v: unknown): AgentProfile | undefined; export declare function profilesFrom(v: unknown): Record | undefined; export interface ProfileValues { task?: string; model?: string; thinking?: string; } /** * The argv a profile starts with: its command, then its model and thinking arguments * when chosen, then the task when it takes one in argv. A command that places `{model}` * (or `{task}`) itself gets it there instead. */ export declare function profileCommand(p: AgentProfile, v: ProfileValues): string[]; /** The argv that reopens it, or undefined when it cannot be reopened. */ export declare function profileResume(p: AgentProfile, v: ProfileValues): string[] | undefined; /** What the daemon keeps with the job: how to read its screen and how to type into it. */ export interface ProfileTerm { submit: string; settleMs: number; waiting?: string; working?: string; /** Typed once it first goes quiet (task "type", or a reply to an ended one). */ typeTask?: string; } export declare function profileTerm(p: AgentProfile, task?: string): ProfileTerm; /** The term settings from a stored job record, checked again (the file is the daemon's, but old or edited). */ export declare function termFrom(v: unknown): ProfileTerm | undefined;