import { R as ResolveConfigOptions, I as InstallResult, A as AgenticMailAccount, C as CodexIntegrationConfig } from './config-FrDqSkD0.js'; /** * Install AgenticMail into Codex CLI. * * Pure-function-ish: takes config, writes files, returns a result object. * The terminal narration lives in cli.ts; this module knows nothing about * the terminal. * * What we write: * 1. ~/.codex/config.toml * → [mcp_servers.] block that runs the AgenticMail MCP server * → features.multi_agent_v2.enabled = true (so spawn_agent is exposed) * 2. ~/.codex/hooks.json * → SessionStart / UserPromptSubmit / Stop hooks pointing at our * mail-hook binary * 3. ~/.codex/agents/.toml * → one Codex subagent per AgenticMail agent, with persona body * stuffed into developer_instructions * * What we provision in AgenticMail: * - A single "codex" agent whose API key the MCP server uses as its identity * when a tool call doesn't pass `_account`. Mirrors the "claudecode" * bridge in @agenticmail/claudecode. * * What we do NOT do: * - We do NOT touch Codex's OAuth state, sessions/ rollouts, or skills/ * cache. Those are user state. * - We do NOT modify the user's model/sandbox/approval settings in * config.toml — only the two keys named above. */ /** * Decide which AgenticMail agents to surface as Codex subagents. * * Strict ownership: an account is exposed ONLY if `metadata.host` equals * this host's bridge name. The host's roster is its own — never inherited. * * Filters out: * - the bridge agent itself (Codex's own identity — would cause a * duplicate-name collision in the agent_type namespace) * - any account with role="bridge" (reserved for hosts like this one) * - any account flagged `metadata.bridge === true` (legacy marker from * pre-0.9.3 installs where the 'bridge' role didn't exist yet) * - any account owned by a DIFFERENT host (`metadata.host` set and not * matching this host's bridge name) * - any UNCLAIMED account (no `metadata.host` value at all). Pre-0.9.20 * accounts that predate auto-tagging are unclaimed by default; the * user must run `agenticmail- claim ` (or `claim --all`) * to transfer them. This keeps a fresh `agenticmail-codex install` * from inheriting an already-running Claude Code roster. */ declare function selectExposableAgents(accounts: AgenticMailAccount[], cfg: CodexIntegrationConfig): AgenticMailAccount[]; /** * Top-level install. Throws if the AgenticMail master API is unreachable — * we refuse to write a half-broken config that Codex would silently load * but never connect. */ declare function install(opts?: ResolveConfigOptions): Promise; export { install, selectExposableAgents };