an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat(providers): add OpenCode, Crush, pi.dev presets + model lists
Chaitanya Giri57e3c808df82
diff --git a/src/renderer/src/store/config.ts b/src/renderer/src/store/config.tsindex 354d84c5..9807cad6 100644--- a/src/renderer/src/store/config.ts+++ b/src/renderer/src/store/config.ts@@ -167,6 +167,48 @@ export const QWEN_MODELS: ModelOption[] = [{ id: 'qwen-max', label: 'Qwen Max' }];+/** Models offered when an agent runs on OpenCode (`opencode`). OpenCode's `--model`+ * takes a `provider/model` slug; these are curated BYOK suggestions (the command+ * field stays editable; `opencode models` / models.dev is the source of truth).+ * // TODO-verify exact live slugs (humanQA — they drift). */+export const OPENCODE_MODELS: ModelOption[] = [+ { id: undefined, label: 'default' },+ { id: 'anthropic/claude-sonnet-4-5', label: 'Claude Sonnet 4.5 (Anthropic)' },+ { id: 'anthropic/claude-haiku-4-5', label: 'Claude Haiku 4.5 (Anthropic)' },+ { id: 'openai/gpt-5', label: 'GPT-5 (OpenAI)' },+ { id: 'openai/gpt-5-mini', label: 'GPT-5 mini (OpenAI)' },+ { id: 'openrouter/anthropic/claude-sonnet-4.5', label: 'Claude Sonnet 4.5 (OpenRouter)' },+ { id: 'google/gemini-2.5-pro', label: 'Gemini 2.5 Pro (Google)' },+ { id: 'local/llama3', label: 'Local · OpenAI-compatible (set base-URL)' }+];++/** Models offered when an agent runs on Crush (`crush`). Crush's `--model` takes a+ * `provider/model-id` slug; free-text editable (Crush accepts arbitrary slugs).+ * // TODO-verify exact live ids (humanQA). */+export const CRUSH_MODELS: ModelOption[] = [+ { id: undefined, label: 'Crush default (config)' },+ { id: 'anthropic/claude-sonnet-4-5', label: 'Claude Sonnet 4.5 (Anthropic)' },+ { id: 'anthropic/claude-opus-4-1', label: 'Claude Opus (Anthropic)' },+ { id: 'openai/gpt-4o', label: 'GPT-4o (OpenAI)' },+ { id: 'openai/o3', label: 'o3 (OpenAI)' },+ { id: 'gemini/gemini-2.5-pro', label: 'Gemini 2.5 Pro' },+ { id: 'openrouter/auto', label: 'OpenRouter (auto)' },+ { id: 'ollama/llama3.1', label: 'Local · Ollama (llama3.1)' }+];++/** Models offered when an agent runs on Pi (`pi`). Pi's `--model` takes a+ * `provider/model` slug (thinking via a `:high` suffix). Curated BYOK suggestions;+ * free-text editable. // TODO-verify exact live slugs (humanQA). */+export const PI_MODELS: ModelOption[] = [+ { id: undefined, label: 'default' },+ { id: 'anthropic/claude-sonnet-4-5', label: 'Claude Sonnet 4.5 (Anthropic)' },+ { id: 'anthropic/claude-opus-4-1', label: 'Claude Opus (Anthropic)' },+ { id: 'openai/gpt-5', label: 'GPT-5 (OpenAI)' },+ { id: 'google/gemini-2.5-pro', label: 'Gemini 2.5 Pro (Google)' },+ { id: 'groq/llama-3.3-70b', label: 'Llama 3.3 70B (Groq)' },+ { id: 'local/llama3', label: 'Local · OpenAI-compatible (set base-URL)' }+];+/** Split a command string into argv, respecting double/single quotes so a model* value with spaces (agy's `--model "Gemini 3.1 Pro (High)"`) stays one token.* Quotes are stripped from the result. */@@ -183,6 +225,9 @@ export function modelsForProvider(provider: AgentProvider): ModelOption[] {if (provider === 'codex') return CODEX_MODELS;if (provider === 'antigravity') return ANTIGRAVITY_MODELS;if (provider === 'qwen') return QWEN_MODELS;+ if (provider === 'opencode') return OPENCODE_MODELS;+ if (provider === 'crush') return CRUSH_MODELS;+ if (provider === 'pi') return PI_MODELS;return AGENT_MODELS;}diff --git a/src/shared/agentProvider.ts b/src/shared/agentProvider.tsindex 546372ef..30436e43 100644--- a/src/shared/agentProvider.ts+++ b/src/shared/agentProvider.ts@@ -19,7 +19,15 @@ import { CODEX_COMMAND_GROUPS } from './codexCommands';// an unmaintained "museum exhibit" repo, not a production CLI. Re-add a supported// fork here (plus its preset/models/logo) after review. The proxy-bridge tier it// shared with qwen stays in place for qwen.-export type AgentProvider = 'claude' | 'codex' | 'antigravity' | 'qwen' | 'custom';+export type AgentProvider =+ | 'claude'+ | 'codex'+ | 'antigravity'+ | 'qwen'+ | 'opencode'+ | 'crush'+ | 'pi'+ | 'custom';/** Structured descriptor for how a NON-hiveAware provider gets hive lifecycle* events (live status + Stop→inbox-drain + cost), introduced alongside the legacy@@ -36,7 +44,7 @@ export type AgentProvider = 'claude' | 'codex' | 'antigravity' | 'qwen' | 'custo* and `inboxDelivery` is how mail reaches it ('terminal' work-order* handoff today; 'serve' reserved for a future HTTP push path). */export type BridgeDescriptor =- | { kind: 'hooks'; shim: 'agy' | 'codex' }+ | { kind: 'hooks'; shim: 'agy' | 'codex' | 'pi' | 'opencode' }| {kind: 'proxy';api: 'openai' | 'anthropic';@@ -227,6 +235,120 @@ export const AGENT_PROVIDER_PRESETS: AgentProviderPreset[] = [recommendedOrchestratorModel: 'qwen3-coder-plus',resumeFlag: undefined},+ {+ // OpenCode — the TypeScript AI coding agent (opencode.ai / anomalyco/opencode,+ // ex sst/opencode). NOT the archived Go opencode-ai/opencode (→ Crush). Run as+ // its interactive TUI in a PTY (like codex), oriented by --prompt.+ id: 'opencode',+ label: 'OpenCode',+ defaultCommand: 'opencode',+ commandGroups: [],+ // OpenCode's TUI exposes no skip-permissions FLAG; headless auto-approve is a+ // config concern (permission:allow). To keep auto-mode gated behind the floor+ // `config.autoMode` toggle (Pam guardrail #2), the permission JSON is NOT a+ // static nonInteractiveEnv — spawnAgentCore builds OPENCODE_CONFIG_CONTENT+ // dynamically (permission:allow only when autoMode is on; + a local provider+ // block when a base-URL is set). So no auto flag is spliced onto the command.+ autoModeFlag: '',+ autoFlag: '',+ supportsModel: true,+ modelFlag: '--model', // value form: provider/model, e.g. anthropic/claude-sonnet-4-5+ hiveAware: false, // no --append-system-prompt/--settings; protocol rides in via --prompt+ // NATIVE PLUGIN bridge (god Decision 1): OpenCode has no Claude-shaped Stop hook,+ // but its plugin API DOES expose a real lifecycle event (session.idle). A bundled+ // per-agent plugin drains the inbox on idle and posts HIVE_SOCK payloads — the+ // same Stop→drain semantics as codex's hooks, provider-agnostic, no traffic+ // interception. Modeled as a `hooks` bridge with a new `opencode` shim so it+ // reuses the existing hooks dispatch arm (installOpenCodePlugin, sibling of+ // installCodexHooks). The config-injection proxy is the documented fallback only.+ bridge: { kind: 'hooks', shim: 'opencode' },+ // god-eligible. NOTE: the plugin bridge is architecturally verified (event surface+ // + payload contract) but its live runtime (auto-load + session.idle firing ++ // injection) is UNVERIFIED pending BYOK keys / a local LLM. The renderer idle+ // inbox-wake nudge (useHive.ts) is the guaranteed fallback so a god still drains.+ canReceiveInbox: true,+ initialPromptFlag: '--prompt', // opencode --prompt "<orchestrator/worker brief>"+ recommendedOrchestratorModel: 'anthropic/claude-sonnet-4-5', // OpenCode's own default; user may pick opus+ // Capturing the TUI session id for resume is unverified; spawn fresh on respawn+ // (protocol re-injected as the initial prompt), matching codex.+ resumeFlag: undefined,+ installCommand: 'npm install -g opencode-ai@latest', // trusted, hardcoded+ docsUrl: 'https://opencode.ai/docs'+ },+ {+ // Crush — Charmbracelet's Go TUI coding agent (charmbracelet/crush), successor to+ // the archived Go opencode-ai/opencode. Non-hiveAware. Its hook surface is+ // Claude-shaped but exposes ONLY PreToolUse today (NO Stop/SessionEnd) — so a+ // hooks bridge can't drain on turn-end. Hence a PROXY bridge (qwen tier): a+ // loopback sidecar observes its LLM traffic and SYNTHESIZES the Stop→drain.+ id: 'crush',+ label: 'Crush · Charm',+ defaultCommand: 'crush',+ commandGroups: [],+ // No CODEX_NON_INTERACTIVE analogue. First-run onboarding is suppressed by the+ // harness-written per-agent CRUSH_GLOBAL_CONFIG (provider+model+key pre-seeded),+ // set in env at spawn by installCrushConfig — NOT via this field.+ nonInteractiveEnv: undefined,+ autoModeFlag: '--yolo', // -y: accept all permissions (dangerous; unsandboxed). Gated by config.autoMode.+ autoFlag: '--yolo',+ supportsModel: true,+ modelFlag: '--model', // value format: provider/model-id, e.g. anthropic/claude-..., openai/gpt-4o+ hiveAware: false,+ // PROXY bridge. baseUrlEnv is an INTENTIONALLY INERT sentinel: Crush has NO+ // base-URL env override, so the generic proxy env-rewrite does nothing for it.+ // Real routing is via a per-agent CRUSH_GLOBAL_CONFIG whose provider base_url+ // points at the loopback (installCrushConfig, special-cased in the proxy arm).+ // Do NOT "fix" this to a real env var — it would have no effect.+ bridge: { kind: 'proxy', api: 'openai', baseUrlEnv: 'CRUSH_PROXY_BASE_URL', inboxDelivery: 'terminal' },+ recommendedOrchestratorModel: 'anthropic/claude-sonnet-4-5', // advisory/editable; exact long-context id UNKNOWN — humanQA+ // god-eligible via the proxy bridge (terminal inbox delivery on synthesized idle).+ // Live runtime (proxy parse of Crush traffic + synthesized Stop) is UNVERIFIED+ // pending keys; the renderer idle nudge is the guaranteed drain fallback.+ canReceiveInbox: true,+ // Protocol rides as the session's initial prompt, POSITIONAL like codex. UNKNOWN+ // whether the bare TUI accepts a positional seed — if not, the harness types the+ // protocol as the TUI's first message (renderer nudge). humanQA.+ initialPromptFlag: undefined,+ resumeFlag: '--session', // Crush supports resume by id (also --continue for most-recent)+ installCommand: 'npm install -g @charmland/crush', // trusted, hardcoded (brew/go/winget also valid)+ docsUrl: 'https://github.com/charmbracelet/crush'+ },+ {+ // Pi (Pi Coding Agent, earendil-works; npm @earendil-works/pi-coding-agent).+ // Terminal-first, headless-driveable, 15-provider BYOK. Non-hiveAware, but has a+ // rich pi.on(event) lifecycle (tool_call→PreToolUse, agent_end→Stop, …). Bridged+ // via a bundled per-agent extension (installPiHooks) that posts HIVE_SOCK payloads+ // and auto-approves tools — a `hooks` bridge with a new `pi` shim.+ id: 'pi',+ label: 'Pi',+ defaultCommand: 'pi',+ commandGroups: [],+ // pi has NO yolo flag. `--approve` is per-run PROJECT trust (accept the cwd so pi+ // doesn't prompt to trust the folder); the actual tool auto-allow lives INSIDE the+ // bridge extension's tool_call handler, which respects the floor auto-state via+ // HIVE_AUTO_APPROVE env (Pam guardrail #5). Gated by config.autoMode like the rest.+ autoModeFlag: '--approve',+ autoFlag: '--approve',+ // Suppress first-run version-check / telemetry chatter in the PTY. // humanQA exact names+ nonInteractiveEnv: { PI_SKIP_VERSION_CHECK: '1', PI_TELEMETRY: '0' },+ supportsModel: true,+ modelFlag: '--model', // value form: provider/model, e.g. anthropic/claude-sonnet-4-5 (thinking via :high)+ hiveAware: false,+ // HOOKS bridge via the new `pi` shim (installPiHooks). NOTE: only the structured+ // `bridge` is set (NOT the legacy hookBridge) — bridgeOf returns preset.bridge+ // first, so a hookBridge:'pi' would be dead weight + force a second union widening.+ bridge: { kind: 'hooks', shim: 'pi' },+ recommendedOrchestratorModel: 'anthropic/claude-sonnet-4-5',+ // god-eligible. Live runtime (whether the extension auto-continues from agent_end,+ // or we lean on the renderer idle nudge) is UNVERIFIED pending keys. Renderer nudge+ // is the guaranteed drain fallback either way.+ canReceiveInbox: true,+ initialPromptFlag: undefined, // positional, like codex: pi "<prompt>"+ resumeFlag: '--session',+ // --ignore-scripts: don't run the package's postinstall on the user's machine.+ installCommand: 'npm install -g --ignore-scripts @earendil-works/pi-coding-agent',+ docsUrl: 'https://pi.dev/docs/latest'+ },{id: 'custom',label: 'Custom',@@ -246,6 +368,9 @@ export function isAgentProvider(value: unknown): value is AgentProvider {value === 'codex' ||value === 'antigravity' ||value === 'qwen' ||+ value === 'opencode' ||+ value === 'crush' ||+ value === 'pi' ||value === 'custom');}@@ -291,6 +416,9 @@ export function inferAgentProvider(command: string | undefined, explicit?: unknoif (bin === 'codex') return 'codex';if (bin === 'agy' || bin === 'antigravity') return 'antigravity';if (bin === 'qwen') return 'qwen';+ if (bin === 'opencode') return 'opencode';+ if (bin === 'crush') return 'crush';+ if (bin === 'pi') return 'pi';if (bin === 'claude' || !bin) return 'claude';return 'custom';}