export type AgentScope = "user" | "project" | "both"; export type AgentMode = "primary" | "subagent"; export interface AgentConfig { name: string; description: string; mode: AgentMode; model?: string; systemPrompt: string; source: "user" | "project" | "cloud" | "system"; filePath: string; } export interface AgentDiscoveryResult { agents: AgentConfig[]; projectAgentsDir: string | null; } export declare const SYSTEM_AGENTS: AgentConfig[]; export declare function setCloudAgents(agents: AgentConfig[], teamId?: string): void; /** * Outcome of a cloud-agent refresh. Lets callers react to auth rejection * (e.g. trigger a forced machine re-registration) instead of silently * treating an auth failure as "no agents". */ export type CloudAgentRefreshResult = { /** Auth rejected by the backend (HTTP 401/403 or GraphQL auth error). */ authRejected: true; /** Human-readable reason for diagnostics. */ reason: string; } | { authRejected: false; /** Number of cloud agents loaded into the cache (may be 0 legitimately). */ count: number; }; export declare function refreshCloudAgents(opts: { backendUrl: string; machineJwt: string; teamId?: string; }): Promise; export declare function discoverAgents(cwd: string, scope: AgentScope, agentDir?: string, teamId?: string): AgentDiscoveryResult; export declare function discoverPrimaryAgent(cwd: string, scope?: AgentScope, agentDir?: string, teamId?: string): AgentConfig | null; /** * Resolve the primary agent for a session. * * Legacy / unset values (`undefined`, `null`, `"__auto__"`, `"__inherit__"`) are * treated as "no agent" — sessions are fully explicit; the settings-level * auto-detect no longer applies per-session. An unknown agent name also * resolves to `null` (no fallback to auto-detect), so a stale selection never * silently injects an arbitrary primary agent. */ export declare function resolveSelectedPrimaryAgent(selectedName: string | null | undefined, cwd: string, agentDir?: string, teamId?: string): AgentConfig | null; /** * Prepend the primary agent's system prompt above the base system prompt. * * - Returns the base unchanged when no primary agent is provided. * - Idempotent: if the base already starts with the primary agent header, * the base is returned unchanged (guards against double-injection). */ export declare function injectPrimaryAgentPrompt(base: string | undefined, primaryAgent: Pick | null): string | undefined; /** * Render a small, soft metadata block about an agent (model, source) * that is appended below the agent.s own system prompt. This is purely * informational . it tells the model what the agent declares and where it * lives (e.g. the cloud backend), so it does not go hunting for agent * files in local folders. */ export declare function agentMetadataBlock(agent: Pick | null): string; //# sourceMappingURL=agents.d.ts.map