/** * #38 runtime fallback — is the configured `default_agent` role actually on disk? * * The plugin cannot see config-directory roles through `ctx.agent`: a zero-token * probe measured `ctx.agent.list({})` returning only the 7 built-ins and * `ctx.agent.get({agentID:"team"})` → `Agent not found: team`. So the only way * to warn about a `default_agent` that points at a role file which does not exist * is to read the global config from disk ourselves. * * Why this matters: the host falls back to `build` SILENTLY when `default_agent` * names a missing agent, so the user's sessions quietly stop being Team and * nothing says so. This check turns that silence into one warning line. * * Boundaries, all deliberate: * · never throws — a missing/unreadable/unparseable config is a counted state, * not a startup failure; * · never prints config CONTENT — only the role name and the file path it looked * for (the two facts the user needs to fix it); * · reads only the global config dir the host itself reads. */ export interface DefaultAgentCheck { /** ok = the role file exists; missing-role = default_agent names a role with no * file; no-default = the key is absent; no-config = no config file found; * unreadable = the file exists but could not be read or parsed. */ state: "ok" | "missing-role" | "no-default" | "no-config" | "unreadable"; defaultAgent?: string; roleFile?: string; } /** The global config dir the host reads: `OPENCODE_CONFIG_DIR` when set, else * `~/.config/opencode` (on Windows `os.homedir()` reads `USERPROFILE`). */ export declare function globalConfigDir(env?: NodeJS.ProcessEnv): string; export declare function checkDefaultAgentRole(opts: { configDir: string; readFile?: (p: string) => string; exists?: (p: string) => boolean; }): DefaultAgentCheck; //# sourceMappingURL=v2-default-agent.d.ts.map