Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Add Devin as a built-in engine over ACP
Krishna Dobhal5eb9d5f34537
diff --git a/apps/docs/content/docs/providers/index.mdx b/apps/docs/content/docs/providers/index.mdxindex 45c1d2ec5b..f20cd2f50c 100644--- a/apps/docs/content/docs/providers/index.mdx+++ b/apps/docs/content/docs/providers/index.mdx@@ -19,6 +19,7 @@ MausBot does not proxy every message through its own model account. It starts su| GitHub Copilot | `copilot login`, or `COPILOT_GITHUB_TOKEN` | ACP driver with the plan's live models, each labelled with its premium request multiplier || Command Code | `cmd login`, or `COMMAND_CODE_API_KEY` | ACP driver with the account's live models and their effort levels || Kiro | `kiro-cli login`, or `KIRO_API_KEY` | ACP driver with the account's live models and their effort levels |+| Devin | `devin auth login`, or `WINDSURF_API_KEY` | ACP driver with the account's live models || Kimi | Kimi CLI login | ACP integration || Droid | Factory Droid CLI login | ACP integration || Antigravity | Google account through the official ACP server | Managed install, isolated accounts, live models, and approval cards |@@ -36,6 +37,8 @@ Command Code runs the official Command Code CLI (`npm install -g command-code`,Kiro runs the official Kiro CLI (`curl -fsSL https://cli.kiro.dev/install | bash` on macOS and Linux) in its ACP mode with its V3 engine (`kiro-cli acp --agent-engine=v3`) and bills the Kiro account `kiro-cli login` signed in, or the Kiro Pro key in `KIRO_API_KEY`. Its picker lists every model the account offers, plus **Kiro default**, which keeps the model picked in Kiro itself. Ask turns Kiro's Autopilot off, so each write or command waits for approval in the app; Full access turns Autopilot on.+Devin runs the official Devin CLI (`curl -fsSL https://cli.devin.ai/install.sh | bash` on macOS and Linux, `irm https://static.devin.ai/cli/setup.ps1 | iex` in Windows PowerShell) in its ACP mode (`devin acp`) and bills the Devin account `devin auth login` signed in, or the key in `WINDSURF_API_KEY`. Its picker lists every model the account offers, plus **Devin default**, which keeps the model set in Devin itself. Full access runs Devin's Bypass Permissions mode. Every other level runs its Code mode, the strictest one Devin offers over ACP that can still edit: Devin applies workspace edits on its own there, including a command it reads as one, and other commands wait for approval in the app. Approving for the session is the longest grant MausBot gives: Devin's project-wide, all-projects and switch-to-bypass choices are never offered.+OMP runs the official Oh My Pi CLI (`npm install -g @oh-my-pi/pi-coding-agent`) through `omp acp`. Run `omp login` or configure providers in `~/.omp/agent/models.yml`; OMP keeps its own credentials. The picker lists OMP's advertised models and their thinking choices, plus **OMP default (configured)**, which leaves the model selected in OMP itself. Threads resume their native OMP sessions, and permission prompts use MausBot's approval cards.To use OpenRouter, Fireworks AI, DeepSeek, Cline, or your own OpenAI- or Anthropic-compatible service, see [Other model providers](./model-providers.mdx).diff --git a/apps/docs/content/docs/security/analytics.mdx b/apps/docs/content/docs/security/analytics.mdxindex cb54497764..f74de81597 100644--- a/apps/docs/content/docs/security/analytics.mdx+++ b/apps/docs/content/docs/security/analytics.mdx@@ -55,7 +55,7 @@ Properties are counts, `true` or `false`, or words from fixed lists in the app's| List | Values || --- | --- || Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |-| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro`, `omp` |+| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro`, `devin`, `omp` || App | The 24 apps Connected apps lists by default: `slack`, `github`, `gmail`, `googlecalendar`, `googlesheets`, `googledocs`, `googledrive`, `notion`, `linear`, `sentry`, `posthog`, `discord`, `twitter`, `reddit`, `zapier`, `hubspot`, `salesforce`, `jira`, `asana`, `trello`, `dropbox`, `airtable`, `figma`, `stripe`. Every other app is `other`. || Starting role | `assistant`, `inbox`, `research`, `coder`, `community`, `ops` || Cloud plan | `starter`, `personal`, `pro`, `max` |diff --git a/docs/analytics.md b/docs/analytics.mdindex e8947e8236..b20097eb03 100644--- a/docs/analytics.md+++ b/docs/analytics.md@@ -51,7 +51,7 @@ Properties are counts, `true` or `false`, or words from fixed lists in the app's| List | Values || --- | --- || Key provider | `anthropic`, `openai`, `openrouter`, `openai_compat`, `xai`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `boat`, `composio`, `opencode_go`, `custom_endpoint`, `elevenlabs`, `fish_audio`, `jev`, `openrouter_decider`, `openai_image`, `custom_image`, `openai_live`, `onepassword`, `treg`, `postiz` |-| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro`, `omp` |+| Engine | `claude`, `codex`, `gemini`, `cursor`, `opencode`, `qwen`, `hermes`, `cline`, `custom_acp`, `pi`, `openai_compat`, `grok`, `grok_api`, `kimi`, `droid`, `antigravity`, `minimax`, `mistral`, `cerebras`, `groq`, `greenference`, `modelgo`, `meta`, `muse_code`, `deepseek`, `copilot`, `command_code`, `kiro`, `devin`, `omp` || App | The 24 apps Connected apps lists by default: `slack`, `github`, `gmail`, `googlecalendar`, `googlesheets`, `googledocs`, `googledrive`, `notion`, `linear`, `sentry`, `posthog`, `discord`, `twitter`, `reddit`, `zapier`, `hubspot`, `salesforce`, `jira`, `asana`, `trello`, `dropbox`, `airtable`, `figma`, `stripe`. Every other app is `other`. || Starting role | `assistant`, `inbox`, `research`, `coder`, `community`, `ops` || Cloud plan | `starter`, `personal`, `pro`, `max` |diff --git a/scripts/verify-engines-ui.ts b/scripts/verify-engines-ui.tsindex ce69068d5b..58cad638ed 100644--- a/scripts/verify-engines-ui.ts+++ b/scripts/verify-engines-ui.ts@@ -36,6 +36,7 @@ const instances: InstanceInfo[] = [["githubCopilot", "copilotAgent", "GitHub Copilot", true, "1.0.103"],["commandCode", "commandCodeAgent", "Command Code", true, "1.88.4"],["kiro", "kiroAgent", "Kiro", true, "3.1.0"],+ ["devin", "devinAgent", "Devin", true, "3000.12.59"],].map(([id, driver, name, ready, version]) => ({instanceId: String(id), driverKind: String(driver), displayName: String(name),cliDefault: String(id),diff --git a/server/chat-notices.ts b/server/chat-notices.tsindex 4b4c300a0e..430e0bca74 100644--- a/server/chat-notices.ts+++ b/server/chat-notices.ts@@ -99,6 +99,7 @@ export const CHAT_NOTICE = {"chat.notice.copilotAccountRefused": "GitHub Copilot refused this request for the signed-in account. Check its Copilot plan and premium request allowance, then try again.","chat.notice.commandCodeAccountRefused": "Command Code refused this request for the signed-in account. Check its plan and credits on commandcode.ai, then try again.","chat.notice.kiroAccountRefused": "Kiro refused this request for the signed-in account. Check its Kiro plan and credits, then try again.",+ "chat.notice.devinAccountRefused": "Devin refused this request for the signed-in account. Check its Devin plan and credits, then try again.","chat.notice.acpQuietUsageLimit": "{name} reached a usage limit{said} and is waiting it out without replying, so this turn was stopped.","chat.notice.acpQuietStuck": "{name} sent nothing for {quiet} with no tool running, no open request to its model and no CPU use, so the turn was stopped as stuck. Send the message again to retry.","chat.notice.acpModelRequestFailed": "{name}'s model request failed: \"{message}\" {name} may retry or stop; no reply for {quiet} so far.",diff --git a/server/drivers/acp/core.ts b/server/drivers/acp/core.tsindex 09cd35da78..90f67bd980 100644--- a/server/drivers/acp/core.ts+++ b/server/drivers/acp/core.ts@@ -190,6 +190,9 @@ export interface AcpSupport {clientCapabilitiesMeta?: Record<string, unknown>;/** Made once per process: rewrites a session/update before the turn reads it, or drops it by returning null. */updateFilter?(): (update: Record<string, any>) => Record<string, any> | null;+ /** Rewrites a session/request_permission's params before the card is built and an option is picked: the options the+ * app may answer with, and the tool call it describes. */+ permissionRequest?(params: Record<string, any>): Record<string, any>;/** The agent reaches MCP servers by URL: OpenMausBot's own servers are this server's endpoints, no process each. */ownMcpOverHttp?: boolean;/** How many tools the agent lists of its own beside the MCP servers', counted against a provider's tool limit. */@@ -706,7 +709,7 @@ export function createAcpDriver(support: AcpSupport): ProviderDriver<AcpConfig>// An unanswered server request blocks the agent.return send({ jsonrpc: "2.0", id: msg.id, error: { code: -32601, message: "method not found" } });}- const params = msg.params ?? {};+ const params = support.permissionRequest ? support.permissionRequest(msg.params ?? {}) : msg.params ?? {};current.flushAssistantText();const options: Array<{ optionId?: string; kind?: string; name?: string }> = Array.isArray(params.options) ? params.options : [];const optionFor = (want: "allow" | "reject") =>diff --git a/server/drivers/acp/devin.test.ts b/server/drivers/acp/devin.test.tsnew file mode 100644index 0000000000..8d4c951827--- /dev/null+++ b/server/drivers/acp/devin.test.ts@@ -0,0 +1,164 @@+import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";+import { afterEach, beforeEach, describe, expect, it } from "vitest";++import { ensureDirs, instanceConfigs } from "../../config.ts";+import type { ProviderInstance } from "../../contracts.ts";+import { recordEvents, type EventRecorder } from "../../testing/events.ts";+import { removeTempDir } from "../../testing/cleanup.ts";+import { BUILT_IN_DRIVERS } from "../builtIn.ts";+import { classifyDevinError, DevinAgentDriver, devinConfigDir, devinPermissionRequest, devinSignedIn, resolveDevinModels } from "./devin.ts";++const FAKE_CLI = join(dirname(fileURLToPath(import.meta.url)), "../../testing/fake-acp-cli.ts");+const MODELS = "swe-1-6-fast,claude-sonnet-5-5";+const MODES = "accept-edits,smart,ask,plan,bypass";++describe("Devin sign-in", () => {+ let scratch: string;+ beforeEach(() => {+ scratch = mkdtempSync(join(tmpdir(), "omb-devin-sign-in-"));+ });+ afterEach(async () => {+ await removeTempDir(scratch);+ });++ it("looks for Devin's config in %APPDATA% on Windows and ~/.config elsewhere", () => {+ const home = join(scratch, "home");+ expect(devinConfigDir({ HOME: home }, "linux")).toBe(join(home, ".config", "devin"));+ expect(devinConfigDir({ HOME: home }, "darwin")).toBe(join(home, ".config", "devin"));+ expect(devinConfigDir({ HOME: home, XDG_CONFIG_HOME: join(scratch, "cfg") }, "linux")).toBe(join(scratch, "cfg", "devin"));+ expect(devinConfigDir({ USERPROFILE: home, APPDATA: join(scratch, "roaming") }, "win32")).toBe(join(scratch, "roaming", "devin"));+ });++ it("is signed in by the credentials `devin auth login` stored, or by WINDSURF_API_KEY", () => {+ const home = join(scratch, "home");+ expect(devinSignedIn({ HOME: home }, "linux")).toBe(false);+ expect(devinSignedIn({ HOME: home, WINDSURF_API_KEY: " " }, "linux")).toBe(false);+ expect(devinSignedIn({ HOME: home, WINDSURF_API_KEY: "fixture-key" }, "linux")).toBe(true);+ const dir = devinConfigDir({ HOME: home }, "linux");+ mkdirSync(dir, { recursive: true });+ writeFileSync(join(dir, "config.json"), "{}");+ expect(devinSignedIn({ HOME: home }, "linux")).toBe(false);+ writeFileSync(join(dir, "credentials.toml"), "token = \"fixture\"\n");+ expect(devinSignedIn({ HOME: home }, "linux")).toBe(true);+ });++ it("reads Devin's signed-out prompt refusal as a missing login, and nothing else", () => {+ expect(classifyDevinError({ code: -32000, message: "Please log in to use Devin. Use `/login` to authenticate again." })).toBe("invalid_credentials");+ expect(classifyDevinError({ code: -32000, message: "MCP server telegram: please log in" })).toBeUndefined();+ expect(classifyDevinError({ code: -32603, message: "Please log in to use Devin." })).toBeUndefined();+ });+});++describe("Devin permission requests", () => {+ const request = {+ sessionId: "s1",+ toolCall: { toolCallId: "call_1", _meta: { "cognition.ai/editableCommand": "curl -s https://example.com", "cognition.ai/permissionRule": "Exec(curl)" } },+ options: [+ { optionId: "allow_once", name: "Allow", kind: "allow_once" },+ { optionId: "allow_session", name: "Yes, allow `curl` commands (this session)", kind: "allow_always" },+ { optionId: "allow_always", name: "Yes, always allow `curl` commands in `project`", kind: "allow_always" },+ { optionId: "allow_always_global", name: "Yes, always allow `curl` commands in all projects", kind: "allow_always" },+ { optionId: "switch_bypass", name: "Yes, switch to bypass mode", kind: "allow_always" },+ { optionId: "reject_once", name: "Reject", kind: "reject_once" },+ ],+ };++ it("keeps only the grants that end with the session, whatever order Devin lists them in", () => {+ for (const options of [request.options, [...request.options].reverse()]) {+ expect(devinPermissionRequest({ ...request, options }).options.map((option: { optionId: string }) => option.optionId).sort())+ .toEqual(["allow_once", "allow_session", "reject_once"]);+ }+ });++ it("names the command Devin asks to run on the card", () => {+ expect(devinPermissionRequest(request).toolCall).toMatchObject({+ toolCallId: "call_1", kind: "execute", title: "curl -s https://example.com", rawInput: { command: "curl -s https://example.com" },+ });+ const edit = { toolCallId: "call_2", kind: "edit", title: "Edit a.ts" };+ expect(devinPermissionRequest({ ...request, toolCall: edit }).toolCall).toBe(edit);+ });+});++describe("Devin ACP driver", () => {+ let scratch: string;+ let instance: ProviderInstance | undefined;+ let recorder: EventRecorder | undefined;++ beforeEach(() => {+ ensureDirs();+ scratch = mkdtempSync(join(tmpdir(), "omb-devin-contract-"));+ });+ afterEach(async () => {+ recorder?.stop();+ await instance?.dispose();+ instance = undefined;+ recorder = undefined;+ await removeTempDir(scratch);+ });++ async function create(environment: Record<string, string> = {}) {+ instance = await DevinAgentDriver.create({+ instanceId: `devin-contract-${Math.random().toString(36).slice(2)}`, displayName: "Devin", enabled: true,+ environment: { FAKE_ACP_MODELS: MODELS, FAKE_ACP_MODES: MODES,+ FAKE_ACP_DUMP: join(scratch, "launch.json"), WINDSURF_API_KEY: "engine-fixture-key", ...environment },+ config: { cli: FAKE_CLI, fullAuto: false },+ });+ recorder = recordEvents(instance.adapter);+ return { instance, recorder };+ }++ const prompts = () => readFileSync(join(scratch, "launch.json.prompts.jsonl"), "utf8").trim().split("\n").map((line) => JSON.parse(line));+ const configCalls = () => JSON.parse(readFileSync(join(scratch, "launch.json.config.json"), "utf8")) as Array<{ method: string; params: any }>;+ const modeCalls = () => configCalls().filter((call) => call.params.configId === "mode").map((call) => call.params.value);++ it("is a built-in engine in fresh and existing fleets", () => {+ expect(BUILT_IN_DRIVERS.some((driver) => driver.driverKind === "devinAgent")).toBe(true);+ expect(instanceConfigs({}).devin?.driver).toBe("devinAgent");+ expect(instanceConfigs({ instances: { claude: { driver: "claudeAgent" } } }).devin?.driver).toBe("devinAgent");+ expect(DevinAgentDriver.metadata.displayName).toBe("Devin");+ expect(DevinAgentDriver.models).toEqual({ default: "agent-default", options: [{ id: "agent-default", label: "Devin default" }] });+ });++ it("lists the advertised models after Devin's own default", async () => {+ const catalog = await resolveDevinModels({ ...process.env, FAKE_ACP_MODELS: MODELS }, { cli: FAKE_CLI });+ expect(catalog.default).toBe("agent-default");+ expect(catalog.options.map((option) => option.id)).toEqual(["agent-default", ...MODELS.split(",")]);+ });++ it("starts nothing when the instance is created", async () => {+ await create();+ expect(existsSync(join(scratch, "launch.json"))).toBe(false);+ });++ it("runs `devin acp` on the picked model in Code mode on Ask", async () => {+ const { instance, recorder } = await create();+ const { turnId } = await instance.adapter.sendTurn({ threadId: "devin-ask", text: "hello", model: "claude-sonnet-5-5", approvalMode: "ask" });+ await recorder.until((event) => event.type === "turn.completed" && event.turnId === turnId);+ expect(recorder.events.every((event) => event.provider === "devinAgent")).toBe(true);+ const launch = JSON.parse(readFileSync(join(scratch, "launch.json"), "utf8"));+ expect(launch.argv.at(-1)).toBe("acp");+ expect(launch.env.WINDSURF_API_KEY).toBe("engine-fixture-key");+ expect(modeCalls()).toEqual(["accept-edits"]);+ expect(prompts().at(-1)).toMatchObject({ model: "claude-sonnet-5-5" });+ });++ it("leaves Devin on its own default model, and bypasses permissions only under Full access", async () => {+ const { instance, recorder } = await create();+ const { turnId } = await instance.adapter.sendTurn({ threadId: "devin-full", text: "hello", model: "agent-default", approvalMode: "full" });+ await recorder.until((event) => event.type === "turn.completed" && event.turnId === turnId);+ expect(configCalls().some((call) => call.params.configId === "model")).toBe(false);+ expect(modeCalls()).toEqual(["bypass"]);+ });++ it("fails the turn instead of prompting when Devin does not confirm the permission mode", async () => {+ const ack = join(scratch, "mode-ack.txt");+ writeFileSync(ack, "empty");+ const { instance, recorder } = await create({ FAKE_ACP_MODE_ACK_FILE: ack });+ const { turnId } = await instance.adapter.sendTurn({ threadId: "devin-unconfirmed", text: "hello", model: "agent-default", approvalMode: "full" });+ await recorder.until((event) => event.type === "turn.completed" && event.turnId === turnId);+ expect(existsSync(join(scratch, "launch.json.prompts.jsonl"))).toBe(false);+ });+});diff --git a/server/drivers/acp/devin.ts b/server/drivers/acp/devin.tsnew file mode 100644index 0000000000..a9fa797e18--- /dev/null+++ b/server/drivers/acp/devin.ts@@ -0,0 +1,119 @@+// Devin CLI over ACP (`devin acp`), billed to the Devin account `devin auth login` signed in, or to WINDSURF_API_KEY.+// Checked against devin 3000.12.57 and 3000.12.59:+// - initialize offers authMethods [devin-browser] and image input; the CLI reads WINDSURF_API_KEY, then the+// credentials `devin auth login` stored;+// - session/new advertises the account's models as the `model` config option and its permission modes as `mode`+// (accept-edits, smart, ask, plan, bypass); session/set_config_option sets both and answers with the full+// configOptions;+// - a mode the session does not list (the CLI's own `auto`) is acknowledged but leaves the mode unchanged, and+// neither `--permission-mode` nor DEVIN_PERMISSION_MODE reaches an ACP session, so accept-edits is the strictest+// mode that can still edit.+import { existsSync } from "node:fs";+import { join } from "node:path";++import type { ModelCatalog, ProviderErrorCode } from "../../contracts.ts";+import { userHome } from "../../env-path.ts";+import { createAcpDriver, type AccountErrorCode, type AcpConfig, type AcpSupport } from "./core.ts";+import { discoverAcpModels, type AcpDiscoveryOptions } from "./custom-model-catalog.ts";++/** Leaves the session on the model the person set in Devin itself. */+const AGENT_DEFAULT = { id: "agent-default", label: "Devin default" };+const MODELS: ModelCatalog = { default: AGENT_DEFAULT.id, options: [AGENT_DEFAULT] };+const SPAWN_ARGS = ["acp"];+const SIGN_IN = "devin auth login";+const API_KEY_ENV = "WINDSURF_API_KEY";+const LOGIN_NOTE = `Devin is not signed in. Run ${SIGN_IN} in a terminal, or set ${API_KEY_ENV}, then check again.`;+export const DEVIN_MODE = { ask: "accept-edits", full: "bypass" } as const;++/** Devin keeps its user config in `%APPDATA%\devin` on Windows and `~/.config/devin` elsewhere. */+export function devinConfigDir(env: Record<string, string | undefined>, platform: NodeJS.Platform = process.platform): string {+ if (platform === "win32") return join(env.APPDATA?.trim() || join(userHome(env), "AppData", "Roaming"), "devin");+ return join(env.XDG_CONFIG_HOME?.trim() || join(userHome(env), ".config"), "devin");+}++/** Signed in by WINDSURF_API_KEY, or by the `credentials.toml` that `devin auth login` writes. */+export function devinSignedIn(env: Record<string, string | undefined>, platform: NodeJS.Platform = process.platform): boolean {+ return Boolean(env[API_KEY_ENV]?.trim()) || existsSync(join(devinConfigDir(env, platform), "credentials.toml"));+}++/** No exit grace: devin 3000.12.57 exits on EOF but orphans the MCP servers it started from its own config, which then+ * hold the discovery folder for seconds where the tree kill would have stopped them. */+const DISCOVERY: AcpDiscoveryOptions = { passthrough: AGENT_DEFAULT };++export function resolveDevinModels(env: Record<string, string | undefined>, config: Pick<AcpConfig, "cli">): Promise<ModelCatalog> {+ return discoverAcpModels(env, config.cli, SPAWN_ARGS, DISCOVERY);+}++/** devin 3000.12.59 refuses a signed-out prompt with -32000 "Please log in to use Devin. Use `/login` to authenticate again." */+export function classifyDevinError(error: unknown): ProviderErrorCode | undefined {+ const { code, message } = (error ?? {}) as { code?: unknown; message?: unknown };+ return code === -32000 && typeof message === "string" && /\blog in to use devin\b/i.test(message) ? "invalid_credentials" : undefined;+}++/** devin 3000.12.57 offers, beside allow once and reject, `allow_session` and three more `allow_always` grants: always in+ * this project, always in every project, and switching the session to bypass mode. Only grants that end with the session+ * are kept. Its request names the command only in `_meta["cognition.ai/editableCommand"]`, without a title or kind. */+export function devinPermissionRequest(params: Record<string, any>): Record<string, any> {+ const options = Array.isArray(params.options) ? params.options : [];+ const kept = options.filter((option: { optionId?: unknown; kind?: unknown }) =>+ option.kind === "allow_once" || String(option.kind ?? "").startsWith("reject") || option.optionId === "allow_session");+ const toolCall = params.toolCall ?? {};+ const command = toolCall._meta?.["cognition.ai/editableCommand"];+ const described = typeof command === "string" && command && toolCall.rawInput?.command === undefined+ ? { ...toolCall, kind: toolCall.kind ?? "execute", title: toolCall.title ?? command, rawInput: { ...toolCall.rawInput, command } }+ : toolCall;+ return { ...params, options: kept, toolCall: described };+}++export function describeDevinAccountError(code: AccountErrorCode): string {+ return code === "invalid_credentials" ? LOGIN_NOTE+ : "Devin refused this request for the signed-in account. Check its Devin plan and credits, then try again.";+}++const SUPPORT: AcpSupport = {+ driverKind: "devinAgent",+ displayName: "Devin",+ models: MODELS,+ defaultCli: "devin",+ nativeSource: "devin.acp",+ images: true,+ loginNote: LOGIN_NOTE,+ install: {+ command: {+ darwin: "curl -fsSL https://cli.devin.ai/install.sh | bash",+ linux: "curl -fsSL https://cli.devin.ai/install.sh | bash",+ win32: "irm https://static.devin.ai/cli/setup.ps1 | iex",+ },+ docsUrl: "https://docs.devin.ai/cli",+ signInCommand: SIGN_IN,+ },+ spawnArgs: () => SPAWN_ARGS,+ credentialEnv: [API_KEY_ENV],+ resolveModels: (env, config) => resolveDevinModels(env, config),+ // Every fleet has this instance: the catalog comes from the startup cache and refreshes when the engine is picked.+ resolveModelsOnCreate: false,+ selectModel: { configId: "model", agentDefault: AGENT_DEFAULT.id },+ modelVariants: true,+ pickAuthMethod: () => null,+ authFailure: "continue",+ isAuthenticated: (env) => devinSignedIn(env),+ classifyError: classifyDevinError,+ describeAccountError: describeDevinAccountError,+ accountErrorText: (code) => code === "invalid_credentials" ? undefined : { key: "chat.notice.devinAccountRefused" },+ permissionRequest: devinPermissionRequest,+ sessionScopedApproval: true,+ async configureSession({ request, sessionId, config }) {+ const value = config.fullAuto ? DEVIN_MODE.full : DEVIN_MODE.ask;+ let confirmed: unknown;+ try {+ const answer = await request("session/set_config_option", { sessionId, configId: "mode", value });+ confirmed = answer?.configOptions?.find((option: { id?: unknown }) => option.id === "mode")?.currentValue;+ } catch (error) {+ throw new Error(`Devin rejected permission mode "${value}": ${(error as Error).message}`);+ }+ if (confirmed !== value) throw new Error(`Devin did not switch to permission mode "${value}".`);+ },+ buildPromptText: (turn) => (turn.system ? `${turn.system}\n\n${turn.text}` : turn.text),+};++export const DevinAgentDriver = createAcpDriver(SUPPORT);diff --git a/server/drivers/builtIn.ts b/server/drivers/builtIn.tsindex 77ee8a2ffc..b4fbb9a821 100644--- a/server/drivers/builtIn.ts+++ b/server/drivers/builtIn.ts@@ -17,6 +17,7 @@ import { ClineAgentDriver } from "./acp/cline.ts";import { CopilotAgentDriver } from "./acp/copilot.ts";import { CommandCodeAgentDriver } from "./acp/command-code.ts";import { KiroAgentDriver } from "./acp/kiro.ts";+import { DevinAgentDriver } from "./acp/devin.ts";import { OmpAgentDriver } from "./acp/omp.ts";import { OpenAICompatDriver } from "./openai-compat.ts";import { PiDriver } from "./pi.ts";@@ -43,6 +44,7 @@ export const BUILT_IN_DRIVERS: readonly AnyProviderDriver[] = [CopilotAgentDriver,CommandCodeAgentDriver,KiroAgentDriver,+ DevinAgentDriver,OmpAgentDriver,CustomAcpDriver,PiDriver,diff --git a/server/engine-memory.ts b/server/engine-memory.tsindex bd6c71d388..40bc0102ba 100644--- a/server/engine-memory.ts+++ b/server/engine-memory.ts@@ -29,7 +29,7 @@ const STALL_PERCENT = 20;const MINUTE_MS = 60_000, DAY_MINUTES = 24 * 60;/** Engines that run each thread's turns in processes of their own. */export const ENGINE_PROCESS_KINDS: ReadonlySet<string> = new Set(["claudeAgent", "codex", "opencodeGo", "grokAgent", "geminiAgent", "kimiAgent",- "droidAgent", "cursorAgent", "qwenAgent", "hermesAgent", "clineAgent", "copilotAgent", "commandCodeAgent", "kiroAgent", "customAcp", "piAgent", "ompAgent", "antigravityAgent"]);+ "droidAgent", "cursorAgent", "qwenAgent", "hermesAgent", "clineAgent", "copilotAgent", "commandCodeAgent", "kiroAgent", "devinAgent", "customAcp", "piAgent", "ompAgent", "antigravityAgent"]);/** Chat-runtime engines (openai-chat.ts) have no process of their own, but each turn starts its MCP servers, each a Node process. */export const CHAT_RUNTIME_KINDS: ReadonlySet<string> = new Set(["openai-compat", "cerebras", "greenference", "grok", "groq", "meta", "minimax", "mistral", "modelgo"]);diff --git a/server/instance-fleets.ts b/server/instance-fleets.tsindex 54c5c221a7..cf3b5ca3b1 100644--- a/server/instance-fleets.ts+++ b/server/instance-fleets.ts@@ -32,6 +32,7 @@ export const DEFAULT_FLEET: InstanceConfigMap = {githubCopilot: { driver: "copilotAgent" },commandCode: { driver: "commandCodeAgent" },kiro: { driver: "kiroAgent" },+ devin: { driver: "devinAgent" },claude: { driver: "claudeAgent" },codex: { driver: "codex" },chatgpt: { driver: "codex", displayName: "ChatGPT plan", config: { authMode: "chatgpt-plan" } },@@ -69,6 +70,7 @@ export const PRODUCT_FLEET_ADDITIONS = {githubCopilot: { driver: "copilotAgent" },commandCode: { driver: "commandCodeAgent" },kiro: { driver: "kiroAgent" },+ devin: { driver: "devinAgent" },openaiCompat: { driver: "openai-compat" },mistral: { driver: "mistral" },cerebras: { driver: "cerebras" },diff --git a/server/runtime/capabilities.test.ts b/server/runtime/capabilities.test.tsindex 10e4981395..68917960e2 100644--- a/server/runtime/capabilities.test.ts+++ b/server/runtime/capabilities.test.ts@@ -30,6 +30,7 @@ const EXPECTED: Record<string, EngineCapabilities> = {copilotAgent: bare,commandCodeAgent: bare,kiroAgent: bare,+ devinAgent: bare,customAcp: bare,"openai-compat": chat,grok: chat,diff --git a/server/runtime/capabilities.ts b/server/runtime/capabilities.tsindex 1fb8551749..8b5c92068e 100644--- a/server/runtime/capabilities.ts+++ b/server/runtime/capabilities.ts@@ -37,6 +37,7 @@ const ENGINES: Readonly<Record<string, EngineRow>> = {copilotAgent: { resume: true },commandCodeAgent: { resume: true },kiroAgent: { resume: true },+ devinAgent: { resume: true },customAcp: { resume: true },"openai-compat": CHAT_ROW,grok: CHAT_ROW,diff --git a/server/testing/fake-acp-cli.ts b/server/testing/fake-acp-cli.tsindex 6877e054ec..0fcad07db2 100755--- a/server/testing/fake-acp-cli.ts+++ b/server/testing/fake-acp-cli.ts@@ -323,6 +323,7 @@ const dumpEnv = Object.fromEntries("GITHUB_TOKEN","COMMAND_CODE_API_KEY","KIRO_API_KEY",+ "WINDSURF_API_KEY",].flatMap((key) => (process.env[key] === undefined ? [] : [[key, process.env[key]]] as const)),);const dumpState: Record<string, unknown> = { argv, env: dumpEnv, pid: process.pid };diff --git a/shared/tool-scope-support.ts b/shared/tool-scope-support.tsindex 4a6e495d75..f8fd6cc8e0 100644--- a/shared/tool-scope-support.ts+++ b/shared/tool-scope-support.ts@@ -5,7 +5,7 @@ export const TOOL_SCOPE_SUPPORT = {grok: "native-and-mcp", grokAgent: "native-and-mcp", piAgent: "native-and-mcp","openai-compat": "native-and-mcp", mistral: "native-and-mcp", minimax: "native-and-mcp", cerebras: "native-and-mcp", groq: "native-and-mcp", greenference: "native-and-mcp", modelgo: "native-and-mcp", meta: "native-and-mcp",claudeAgent: "mcp", codex: "mcp", geminiAgent: "mcp", kimiAgent: "mcp", droidAgent: "mcp",- cursorAgent: "mcp", opencodeGo: "mcp", qwenAgent: "mcp", hermesAgent: "mcp", clineAgent: "mcp", copilotAgent: "mcp", commandCodeAgent: "mcp", kiroAgent: "mcp", ompAgent: "mcp", deepseekAgent: "mcp", customAcp: "mcp", antigravityAgent: "mcp", museCode: "mcp",+ cursorAgent: "mcp", opencodeGo: "mcp", qwenAgent: "mcp", hermesAgent: "mcp", clineAgent: "mcp", copilotAgent: "mcp", commandCodeAgent: "mcp", kiroAgent: "mcp", devinAgent: "mcp", ompAgent: "mcp", deepseekAgent: "mcp", customAcp: "mcp", antigravityAgent: "mcp", museCode: "mcp",} as const;export function assertToolScopeSupported(engine: string, value: unknown): ToolScope | undefined {diff --git a/src/components/EngineLibrary.tsx b/src/components/EngineLibrary.tsxindex a74d35eaaf..896af8d0b6 100644--- a/src/components/EngineLibrary.tsx+++ b/src/components/EngineLibrary.tsx@@ -19,7 +19,7 @@ const providers: Record<string, string> = {claudeAgent: "Anthropic", codex: "OpenAI", grok: "xAI", grokAgent: "xAI",kimiAgent: "Moonshot AI", droidAgent: "Factory", cursorAgent: "Cursor",antigravityAgent: "Google", opencodeGo: "OpenCode", qwenAgent: "Qwen",- hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", piAgent: "pi.dev", mistral: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", modelgo: "ModelGo", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",+ hermesAgent: "Nous Research", clineAgent: "Cline", copilotAgent: "GitHub", commandCodeAgent: "Command Code", kiroAgent: "Amazon Web Services", devinAgent: "Cognition", piAgent: "pi.dev", mistral: "Mistral AI", cerebras: "Cerebras", groq: "Groq", greenference: "Greenference", modelgo: "ModelGo", meta: "Meta", museCode: "Meta", deepseekAgent: "DeepSeek",};export function providerName(instance: InstanceInfo): string {diff --git a/src/components/ProviderIcons.tsx b/src/components/ProviderIcons.tsxindex e000f43e34..409c47e8a0 100644--- a/src/components/ProviderIcons.tsx+++ b/src/components/ProviderIcons.tsx@@ -145,6 +145,11 @@ export function KiroMark({ size = 16, className }: IconProps) {</svg>;}+export function DevinMark({ size = 16, className }: IconProps) {+ // Devin's mark, from the Devin Desktop 3.12.59 app icon, drawn in the ink color so it reads on light and dark.+ return <svg width={size} height={size} viewBox="152 152 720 720" className={className} aria-hidden="true"><path fill="var(--color-ink)" d="M419.864 446.137v.055a75.968 75.968 0 0 1 37.923-10.178h.975l1.381.027c.92.026 1.814.053 2.736.135l.677.054c10.943.812 21.344 3.898 31.042 9.232a98.315 98.315 0 0 1 2.87 1.65c.732.461 1.463.92 2.222 1.409l.705.46c5.985 4.033 11.375 8.933 16.142 14.672.65.784 1.273 1.57 2.032 2.57l.38.49c.487.649.974 1.324 1.435 2.002l.839 1.218c.38.568.732 1.136 1.084 1.706.297.487.595.974.895 1.462l.513.866c6.663 11.505 10.185 24.661 10.185 37.98h-.027c0 13.346-3.52 26.475-10.185 37.98l-1.164 1.977c-.488.784-.976 1.543-1.463 2.3l-.38.57c-6.175 9.069-14.03 16.512-23.538 22.251a92.658 92.658 0 0 1-2.872 1.652c-.757.434-1.543.812-2.329 1.218l-.757.38c-6.501 3.166-13.436 5.386-20.777 6.632-1.003.161-2.005.298-3.007.434l-.839.107c-.813.082-1.624.163-2.465.243-.488.027-.975.082-1.463.109-.677.054-1.327.082-2.004.082-.569 0-1.137.027-1.707.054h-1.084c-13.3 0-26.409-3.52-37.947-10.18l-70.319-40.552-140.69 81.321-.054 162.29 140.69 81.186 140.744-81.212v-81.186a75.862 75.862 0 0 1 10.184-37.98l1.166-1.977c.486-.784.975-1.543 1.463-2.3l.378-.57c6.176-9.068 14.031-16.512 23.538-22.25.95-.57 1.897-1.112 2.872-1.653a94.206 94.206 0 0 1 2.33-1.218l.758-.38c6.501-3.166 13.436-5.386 20.776-6.631 1.002-.162 2.004-.298 3.006-.434l.84-.107c.812-.082 1.626-.164 2.492-.244l1.436-.109a24.665 24.665 0 0 1 2.004-.081c.57 0 1.138-.027 1.706-.055h1.084a76 76 0 0 1 37.95 10.18l70.344 40.552 140.744-81.212-.055-162.345-140.662-81.212-70.344 40.66-.055-.11c-11.566 6.66-24.65 10.098-38.03 10.18h-.894l-1.409-.027a46.006 46.006 0 0 1-2.736-.136l-.677-.053c-10.943-.813-21.344-3.9-31.042-9.232a94.602 94.602 0 0 1-2.87-1.652c-.759-.46-1.49-.948-2.222-1.407l-.704-.46c-5.986-4.033-11.376-8.933-16.143-14.672a71.73 71.73 0 0 1-2.031-2.573l-.38-.486a53.355 53.355 0 0 1-1.436-2.005l-.84-1.218a63.078 63.078 0 0 1-1.082-1.705c-.3-.486-.625-.974-.923-1.488l-.486-.84c-6.664-11.506-10.185-24.66-10.185-37.98h-.027v-81.159L350.09 162.38l-.678-.379-140.69 81.321-.054 162.29 140.69 81.187 70.371-40.607.136-.055Z" /></svg>;+}+export function GreenferenceMark({ size = 16, className }: IconProps) {// Greenference's site icon (greenference.com/assets/favicon.svg) without its tile, in a teal from its logo that reads on light and dark.return <svg width={size} height={size} viewBox="4 2 24 24" className={className} aria-hidden="true">@@ -208,6 +213,8 @@ export function ProviderMark({ driverKind, size, className }: IconProps & { drivreturn <CommandCodeMark size={size} className={className} />;case "kiroAgent":return <KiroMark size={size} className={className} />;+ case "devinAgent":+ return <DevinMark size={size} className={className} />;case "greenference":return <GreenferenceMark size={size} className={className} />;case "modelgo":diff --git a/src/components/usage/TraceWaterfall.tsx b/src/components/usage/TraceWaterfall.tsxindex e5add0bed8..60c2f2ec7c 100644--- a/src/components/usage/TraceWaterfall.tsx+++ b/src/components/usage/TraceWaterfall.tsx@@ -11,8 +11,9 @@ import { useStore, type InstanceInfo } from "@/state/store";import type { TraceDetail, TraceNode, TraceRootSummary, TraceTotals } from "../../../shared/usage-trace";import { appName, StepIcon, ToolIcon, TurnAvatar, useAppCards } from "./TraceIcon";-export function modelName(model: string, instances: readonly InstanceInfo[]): string {- for (const instance of instances) {+export function modelName(model: string, instances: readonly InstanceInfo[], driverKind?: string): string {+ const own = instances.filter((instance) => instance.driverKind === driverKind);+ for (const instance of [...own, ...instances]) {const label = instance.models?.options?.find((option) => option.id === model)?.label;if (label) return label;}@@ -105,7 +106,7 @@ function RowName({ row, models }: { row: TraceRow; models: readonly InstanceInfoconst bot = state.bots.find((entry) => entry.id === node.botId);icon = <TurnAvatar bot={bot} name={node.botName} />;name = (bot?.name ?? node.botName) || t("trace.unknownBot");- detail = modelName(node.model, models);+ detail = modelName(node.model, models, node.driverKind);break;}case "step":diff --git a/src/lib/analytics-allowlist.ts b/src/lib/analytics-allowlist.tsindex 2dae5a50d4..10f74b95ca 100644--- a/src/lib/analytics-allowlist.ts+++ b/src/lib/analytics-allowlist.ts@@ -32,7 +32,7 @@ export function credentialProvider(target: unknown): KeyProvider | "other" {export const ENGINE = ["claude", "codex", "gemini", "cursor", "opencode", "qwen", "hermes", "cline", "custom_acp", "pi", "openai_compat", "grok",- "grok_api", "kimi", "droid", "antigravity", "minimax", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "muse_code", "deepseek", "copilot", "command_code", "kiro", "omp",+ "grok_api", "kimi", "droid", "antigravity", "minimax", "mistral", "cerebras", "groq", "greenference", "modelgo", "meta", "muse_code", "deepseek", "copilot", "command_code", "kiro", "devin", "omp",] as const;export type Engine = (typeof ENGINE)[number];@@ -41,7 +41,7 @@ const ENGINE_BY_DRIVER = new Map<string, Engine>(Object.entries({qwenAgent: "qwen", hermesAgent: "hermes", clineAgent: "cline", customAcp: "custom_acp", piAgent: "pi","openai-compat": "openai_compat", grokAgent: "grok", grok: "grok_api", kimiAgent: "kimi", droidAgent: "droid",antigravityAgent: "antigravity", minimax: "minimax", mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference", modelgo: "modelgo",- meta: "meta", museCode: "muse_code", deepseekAgent: "deepseek", copilotAgent: "copilot", commandCodeAgent: "command_code", kiroAgent: "kiro", ompAgent: "omp",+ meta: "meta", museCode: "muse_code", deepseekAgent: "deepseek", copilotAgent: "copilot", commandCodeAgent: "command_code", kiroAgent: "kiro", devinAgent: "devin", ompAgent: "omp",} satisfies Record<string, Engine>));export function engineForDriver(driverKind: unknown): Engine | "other" {diff --git a/src/lib/built-in-instances.ts b/src/lib/built-in-instances.tsindex e9b7058afe..a90a672d68 100644--- a/src/lib/built-in-instances.ts+++ b/src/lib/built-in-instances.ts@@ -1,6 +1,6 @@/** The server's default instances by id, with their driver kinds, plus `gemini`, which an enterprise licence restores. */export const BUILT_IN_INSTANCE_DRIVERS: Readonly<Record<string, string>> = {- grok: "grokAgent", kimi: "kimiAgent", droid: "droidAgent", cursor: "cursorAgent", githubCopilot: "copilotAgent", commandCode: "commandCodeAgent", kiro: "kiroAgent", claude: "claudeAgent", codex: "codex",+ grok: "grokAgent", kimi: "kimiAgent", droid: "droidAgent", cursor: "cursorAgent", githubCopilot: "copilotAgent", commandCode: "commandCodeAgent", kiro: "kiroAgent", devin: "devinAgent", claude: "claudeAgent", codex: "codex",chatgpt: "codex", antigravity: "antigravityAgent", opencodeGo: "opencodeGo", openaiCompat: "openai-compat",mistral: "mistral", cerebras: "cerebras", groq: "groq", greenference: "greenference", modelgo: "modelgo", meta: "meta", museCode: "museCode", deepseek: "deepseekAgent", openai: "openai-compat",claudeApi: "claudeAgent", xaiApi: "grok", openrouter: "openai-compat", qwen: "qwenAgent", hermes: "hermesAgent",diff --git a/src/lib/usage-trace.test.ts b/src/lib/usage-trace.test.tsindex 2431f06bf9..4f23b23bbe 100644--- a/src/lib/usage-trace.test.ts+++ b/src/lib/usage-trace.test.ts@@ -10,7 +10,7 @@ vi.mock("@/state/store", async (original) => {const actual = await original<typeof import("@/state/store")>();return { ...actual, useStore: () => ({ state: actual.initialState, dispatch: vi.fn() }), api: vi.fn(() => new Promise(() => {})) };});-const { TraceWaterfall } = await import("../components/usage/TraceWaterfall");+const { TraceWaterfall, modelName } = await import("../components/usage/TraceWaterfall");const { GroupBars, usageGroupLabel } = await import("../components/UsageSection");const T0 = Date.UTC(2026, 9, 22, 9, 0, 0);@@ -44,6 +44,13 @@ const detail: TraceDetail = {describe("trace helpers", () => {afterEach(() => { vi.unstubAllGlobals(); setLocale("en"); });+ it("names a turn's model from its own engine when engines share a model id", () => {+ const engine = (driverKind: string, label: string) => ({ driverKind, models: { default: "agent-default", options: [{ id: "agent-default", label }] } }) as never;+ const instances = [engine("commandCodeAgent", "Command Code default"), engine("devinAgent", "Devin default")];+ expect(modelName("agent-default", instances, "devinAgent")).toBe("Devin default");+ expect(modelName("agent-default", instances)).toBe("Command Code default");+ expect(modelName("gone", instances, "devinAgent")).toBe("gone");+ });it("formats durations the way the waterfall labels them", () => {expect([450, 6_900, 51_000, 100_000, 3_600_000, 7_500_000].map(formatDuration)).toEqual(["450ms", "6.9s", "51s", "1m 40s", "1h", "2h 5m"]);expect([0, 20_000, 90_000, 5_400_000].map(formatTick)).toEqual(["0s", "20s", "1m 30s", "1h 30m"]);diff --git a/src/locales/en.json b/src/locales/en.jsonindex 8e7141ff4f..4c8dafb2ef 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -9838,6 +9838,7 @@"chat.notice.copilotAccountRefused": "GitHub Copilot refused this request for the signed-in account. Check its Copilot plan and premium request allowance, then try again.","chat.notice.commandCodeAccountRefused": "Command Code refused this request for the signed-in account. Check its plan and credits on commandcode.ai, then try again.","chat.notice.kiroAccountRefused": "Kiro refused this request for the signed-in account. Check its Kiro plan and credits, then try again.",+ "chat.notice.devinAccountRefused": "Devin refused this request for the signed-in account. Check its Devin plan and credits, then try again.","chat.notice.acpQuietUsageLimit": "{name} reached a usage limit{said} and is waiting it out without replying, so this turn was stopped.","chat.notice.acpQuietStuck": "{name} sent nothing for {quiet} with no tool running, no open request to its model and no CPU use, so the turn was stopped as stuck. Send the message again to retry.","chat.notice.acpModelRequestFailed": "{name}'s model request failed: \"{message}\" {name} may retry or stop; no reply for {quiet} so far.",