AI-native design editor. Open-source Figma alternative.
feat(ai): add Grok Build as a desktop coding agent (#1717)
Danila Poyarkova5037cf9a9bb
diff --git a/README.md b/README.mdindex 912b5b448..f6763ead9 100644--- a/README.md+++ b/README.md@@ -31,7 +31,7 @@ Official builds send one anonymous ping a day and share usage stats only if you- **Opens `.fig` and `.pen` files** — read and write native Figma files, open supported Pencil documents from the app or OS file browser, copy & paste nodes between apps- **AI builds designs** — describe what you want in chat, 100+ tools create and modify nodes. Bring your own key for the major providers or any compatible endpoint-- **Fully programmable** — headless CLI, XPath queries, Figma Plugin API plus an `openpencil` API via `eval`, MCP server for AI agents, and desktop agent integrations for Claude Code, Codex, Gemini CLI, Cursor, and Pi+- **Fully programmable** — headless CLI, XPath queries, Figma Plugin API plus an `openpencil` API via `eval`, MCP server for AI agents, and desktop agent integrations for Claude Code, Codex, Gemini CLI, Cursor, Grok Build, and Pi- **Lint, convert, and extract tokens** — inspect documents, lint naming/layout/accessibility, convert between supported formats, analyze colors/typography/spacing/clusters, and extract design tokens- **Components and variants** — create reusable components, group variants into component sets, insert local assets as instances, and switch variants from the inspector- **Working controls** — give a component a Reka UI behaviour (switch, slider, tabs, text field, …) and preview it live over the canvas, with real inputs, focus, and keyboarddiff --git a/changes/1717/added.md b/changes/1717/added.mdnew file mode 100644index 000000000..1a939ce8c--- /dev/null+++ b/changes/1717/added.md@@ -0,0 +1 @@+- The desktop app can use Grok Build as the design agent, signed in with `grok login`.diff --git a/desktop/capabilities/default.json b/desktop/capabilities/default.jsonindex 1925fad22..c32c3c714 100644--- a/desktop/capabilities/default.json+++ b/desktop/capabilities/default.json@@ -141,6 +141,7 @@{ "name": "codex-acp", "cmd": "codex-acp", "args": false },{ "name": "gemini", "cmd": "gemini", "args": ["--acp"] },{ "name": "cursor-agent", "cmd": "cursor-agent", "args": ["acp"] },+ { "name": "grok", "cmd": "grok", "args": ["agent", "stdio"] },{"name": "npm","cmd": "npm",@@ -176,6 +177,7 @@{ "name": "cmd-codex-acp", "cmd": "cmd", "args": ["/c", "codex-acp"] },{ "name": "cmd-gemini", "cmd": "cmd", "args": ["/c", "gemini", "--acp"] },{ "name": "cmd-cursor-agent", "cmd": "cmd", "args": ["/c", "cursor-agent", "acp"] },+ { "name": "cmd-grok", "cmd": "cmd", "args": ["/c", "grok", "agent", "stdio"] },{"name": "cmd-npm","cmd": "cmd",diff --git a/desktop/src/agents/lookup.rs b/desktop/src/agents/lookup.rsindex 44bb62290..626809818 100644--- a/desktop/src/agents/lookup.rs+++ b/desktop/src/agents/lookup.rs@@ -13,6 +13,7 @@ const EXECUTABLES: &[&str] = &["codex-acp","gemini","cursor-agent",+ "grok","openpencil-mcp-http","openpencil-harness","npm",diff --git a/packages/core/src/ai/providers.ts b/packages/core/src/ai/providers.tsindex ac0fcf902..6331a5cbf 100644--- a/packages/core/src/ai/providers.ts+++ b/packages/core/src/ai/providers.ts@@ -1,6 +1,6 @@/** ACP agents, direct AI providers, and the models each provider recommends. */-export type ACPAgentID = 'claude-code' | 'codex' | 'gemini-cli' | 'cursor'+export type ACPAgentID = 'claude-code' | 'codex' | 'gemini-cli' | 'cursor' | 'grok-build'export interface ACPAgentDef {id: ACPAgentID@@ -65,6 +65,13 @@ export const ACP_AGENTS: ACPAgentDef[] = [command: 'cursor-agent',args: ['acp'],setupURL: 'https://cursor.com/docs/cli/installation'+ },+ {+ id: 'grok-build',+ name: 'Grok Build',+ command: 'grok',+ args: ['agent', 'stdio'],+ setupURL: 'https://docs.x.ai/build/overview'}]diff --git a/packages/docs/de/programmable/ai-chat.md b/packages/docs/de/programmable/ai-chat.mdindex 3401ed6f9..ead5298d7 100644--- a/packages/docs/de/programmable/ai-chat.md+++ b/packages/docs/de/programmable/ai-chat.md@@ -9,7 +9,7 @@ description: Integrierter AI-Assistent mit mehr als 90 Werkzeugen zum Erstellen## Einrichtung-Beim ersten Start fragt die geführte Einrichtung, wobei die KI helfen soll und was bereits vorhanden ist: ein Coding-Agent wie Claude Code, Codex, Gemini CLI oder Cursor in der Desktop-App, ein API-Konto oder ein lokaler bzw. Firmenserver. Sie verbindet diesen Zugang und weist ihn den Rollen **Design agent** und **Vision** zu; manuell Eingerichtetes bleibt erhalten. Bei OpenRouter genügt eine Anmeldung statt eines eingefügten API-Schlüssels. Sie lässt sich überspringen und jederzeit über **Einstellungen → KI und Agenten → Geführte Einrichtung starten** erneut ausführen. Modelle manuell einrichten:+Beim ersten Start fragt die geführte Einrichtung, wobei die KI helfen soll und was bereits vorhanden ist: ein Coding-Agent wie Claude Code, Codex, Gemini CLI, Cursor oder Grok Build in der Desktop-App, ein API-Konto oder ein lokaler bzw. Firmenserver. Sie verbindet diesen Zugang und weist ihn den Rollen **Design agent** und **Vision** zu; manuell Eingerichtetes bleibt erhalten. Bei OpenRouter genügt eine Anmeldung statt eines eingefügten API-Schlüssels. Sie lässt sich überspringen und jederzeit über **Einstellungen → KI und Agenten → Geführte Einrichtung starten** erneut ausführen. Modelle manuell einrichten:1. AI-Chat öffnen.2. Einstellungssymbol wählen.diff --git a/packages/docs/es/programmable/ai-chat.md b/packages/docs/es/programmable/ai-chat.mdindex 28cc592f5..d7b7c99b7 100644--- a/packages/docs/es/programmable/ai-chat.md+++ b/packages/docs/es/programmable/ai-chat.md@@ -9,7 +9,7 @@ Pulsa <kbd>⌘</kbd><kbd>J</kbd> o <kbd>Ctrl</kbd><kbd>J</kbd>. El asistente pue## Configurar modelos-La primera vez que abres OpenPencil, la configuración guiada pregunta en qué debe ayudarte la IA y qué usas ya: un agente de programación como Claude Code, Codex, Gemini CLI o Cursor en la aplicación de escritorio, una cuenta de API o un servidor local o de la empresa. Conecta ese acceso y lo asigna a los roles **Design agent** y **Vision**, sin tocar lo que configuraste a mano. Con OpenRouter puedes iniciar sesión en lugar de pegar una clave de API. Puedes omitirla y volver a ejecutarla desde **Ajustes → IA y agentes → Iniciar la configuración guiada**. Para configurar los modelos a mano:+La primera vez que abres OpenPencil, la configuración guiada pregunta en qué debe ayudarte la IA y qué usas ya: un agente de programación como Claude Code, Codex, Gemini CLI, Cursor o Grok Build en la aplicación de escritorio, una cuenta de API o un servidor local o de la empresa. Conecta ese acceso y lo asigna a los roles **Design agent** y **Vision**, sin tocar lo que configuraste a mano. Con OpenRouter puedes iniciar sesión en lugar de pegar una clave de API. Puedes omitirla y volver a ejecutarla desde **Ajustes → IA y agentes → Iniciar la configuración guiada**. Para configurar los modelos a mano:1. Abre el chat.2. Selecciona el icono de ajustes.diff --git a/packages/docs/fr/programmable/ai-chat.md b/packages/docs/fr/programmable/ai-chat.mdindex ee70abb2a..6d4bd1b98 100644--- a/packages/docs/fr/programmable/ai-chat.md+++ b/packages/docs/fr/programmable/ai-chat.md@@ -9,7 +9,7 @@ Appuyez sur <kbd>⌘</kbd><kbd>J</kbd> ou <kbd>Ctrl</kbd><kbd>J</kbd>. L’assis## Configurer les modèles-Au premier lancement, la configuration guidée demande pour quoi l’IA doit vous aider et ce que vous utilisez déjà : un agent de code comme Claude Code, Codex, Gemini CLI ou Cursor dans l’application de bureau, un compte API, ou un serveur local ou d’entreprise. Elle connecte cet accès et l’attribue aux rôles **Design agent** et **Vision**, sans toucher à ce que vous avez configuré à la main. Avec OpenRouter, il suffit de se connecter au lieu de coller une clé API. Vous pouvez la passer et la relancer depuis **Réglages → IA et agents → Lancer la configuration guidée**. Pour configurer les modèles à la main :+Au premier lancement, la configuration guidée demande pour quoi l’IA doit vous aider et ce que vous utilisez déjà : un agent de code comme Claude Code, Codex, Gemini CLI, Cursor ou Grok Build dans l’application de bureau, un compte API, ou un serveur local ou d’entreprise. Elle connecte cet accès et l’attribue aux rôles **Design agent** et **Vision**, sans toucher à ce que vous avez configuré à la main. Avec OpenRouter, il suffit de se connecter au lieu de coller une clé API. Vous pouvez la passer et la relancer depuis **Réglages → IA et agents → Lancer la configuration guidée**. Pour configurer les modèles à la main :1. Ouvrez le chat.2. Sélectionnez l’icône des réglages.diff --git a/packages/docs/it/programmable/ai-chat.md b/packages/docs/it/programmable/ai-chat.mdindex 00683c0d4..e913d9e98 100644--- a/packages/docs/it/programmable/ai-chat.md+++ b/packages/docs/it/programmable/ai-chat.md@@ -9,7 +9,7 @@ Premi <kbd>⌘</kbd><kbd>J</kbd> o <kbd>Ctrl</kbd><kbd>J</kbd>. L’assistente p## Configurare i modelli-Al primo avvio, la configurazione guidata chiede in cosa deve aiutarti l’IA e cosa usi già: un agente di programmazione come Claude Code, Codex, Gemini CLI o Cursor nell’app desktop, un account API o un server locale o aziendale. Collega quell’accesso e lo assegna ai ruoli **Design agent** e **Vision**, lasciando invariato ciò che hai configurato a mano. Con OpenRouter puoi accedere invece di incollare una chiave API. Puoi saltarla e riavviarla da **Impostazioni → IA e agenti → Avvia la configurazione guidata**. Per configurare i modelli a mano:+Al primo avvio, la configurazione guidata chiede in cosa deve aiutarti l’IA e cosa usi già: un agente di programmazione come Claude Code, Codex, Gemini CLI, Cursor o Grok Build nell’app desktop, un account API o un server locale o aziendale. Collega quell’accesso e lo assegna ai ruoli **Design agent** e **Vision**, lasciando invariato ciò che hai configurato a mano. Con OpenRouter puoi accedere invece di incollare una chiave API. Puoi saltarla e riavviarla da **Impostazioni → IA e agenti → Avvia la configurazione guidata**. Per configurare i modelli a mano:1. Apri la chat.2. Seleziona l’icona delle impostazioni.diff --git a/packages/docs/pl/programmable/ai-chat.md b/packages/docs/pl/programmable/ai-chat.mdindex 11d6b4632..8d4febd4a 100644--- a/packages/docs/pl/programmable/ai-chat.md+++ b/packages/docs/pl/programmable/ai-chat.md@@ -9,7 +9,7 @@ Naciśnij <kbd>⌘</kbd><kbd>J</kbd> albo <kbd>Ctrl</kbd> + <kbd>J</kbd>. Asyste## Konfiguracja-Przy pierwszym uruchomieniu konfiguracja z przewodnikiem pyta, w czym ma pomagać AI i z czego już korzystasz: z agenta programistycznego, takiego jak Claude Code, Codex, Gemini CLI lub Cursor w aplikacji na komputer, z konta API albo z serwera lokalnego lub firmowego. Łączy ten dostęp i przypisuje go do ról **Design agent** i **Vision**, nie zmieniając ręcznej konfiguracji. W przypadku OpenRouter wystarczy się zalogować zamiast wklejać klucz API. Możesz ją pominąć i uruchomić ponownie w **Ustawienia → AI i agenci → Uruchom konfigurację z przewodnikiem**. Aby skonfigurować modele ręcznie:+Przy pierwszym uruchomieniu konfiguracja z przewodnikiem pyta, w czym ma pomagać AI i z czego już korzystasz: z agenta programistycznego, takiego jak Claude Code, Codex, Gemini CLI, Cursor lub Grok Build w aplikacji na komputer, z konta API albo z serwera lokalnego lub firmowego. Łączy ten dostęp i przypisuje go do ról **Design agent** i **Vision**, nie zmieniając ręcznej konfiguracji. W przypadku OpenRouter wystarczy się zalogować zamiast wklejać klucz API. Możesz ją pominąć i uruchomić ponownie w **Ustawienia → AI i agenci → Uruchom konfigurację z przewodnikiem**. Aby skonfigurować modele ręcznie:1. Otwórz panel czatu AI.2. Kliknij ikonę ustawień.diff --git a/packages/docs/programmable/ai-chat.md b/packages/docs/programmable/ai-chat.mdindex 6cef7113f..634541e19 100644--- a/packages/docs/programmable/ai-chat.md+++ b/packages/docs/programmable/ai-chat.md@@ -9,7 +9,7 @@ Press <kbd>⌘</kbd><kbd>J</kbd> (<kbd>Ctrl</kbd> + <kbd>J</kbd>) to open the AI## Setup-The first time you open OpenPencil, guided setup asks what AI should help with and what you already use: a [coding agent](./coding-agents) such as Claude Code, Codex, Gemini CLI, Cursor, or Pi in the desktop app, an API account, or a local or company server. It connects that access and assigns it to the **Design agent** and **Vision** roles, keeping anything you configured by hand. With OpenRouter you can sign in instead of pasting an API key. Skip it to start designing, and run it again from **Settings → Models → Run guided setup**. To configure models by hand:+The first time you open OpenPencil, guided setup asks what AI should help with and what you already use: a [coding agent](./coding-agents) such as Claude Code, Codex, Gemini CLI, Cursor, Grok Build, or Pi in the desktop app, an API account, or a local or company server. It connects that access and assigns it to the **Design agent** and **Vision** roles, keeping anything you configured by hand. With OpenRouter you can sign in instead of pasting an API key. Skip it to start designing, and run it again from **Settings → Models → Run guided setup**. To configure models by hand:1. Open the AI chat panel (<kbd>⌘</kbd><kbd>J</kbd>)2. Open the model picker under the message field and choose **Manage models and roles…**diff --git a/packages/docs/programmable/coding-agents.md b/packages/docs/programmable/coding-agents.mdindex dc7c29c57..5671bbc39 100644--- a/packages/docs/programmable/coding-agents.md+++ b/packages/docs/programmable/coding-agents.md@@ -1,6 +1,6 @@# Coding agents-The OpenPencil desktop app can use a coding agent you already have — Claude Code, Codex, Gemini CLI, [Cursor](#cursor), or [Pi](#pi) — as its design agent. The agent runs on your computer with your own subscription and chooses its own model; OpenPencil starts it when you send a message, through the [Agent Client Protocol](https://agentclientprotocol.com/) or, for Pi, its Harness companion, and gives it the canvas tools through OpenPencil's local [MCP server](./mcp-server).+The OpenPencil desktop app can use a coding agent you already have — Claude Code, Codex, Gemini CLI, [Cursor](#cursor), [Grok Build](#grok-build), or [Pi](#pi) — as its design agent. The agent runs on your computer with your own subscription and chooses its own model; OpenPencil starts it when you send a message, through the [Agent Client Protocol](https://agentclientprotocol.com/) or, for Pi, its Harness companion, and gives it the canvas tools through OpenPencil's local [MCP server](./mcp-server).Coding agents need the desktop app; the browser cannot start programs on your computer. They take only the **Design agent** role. Visual review, plan reviews, and fast background work need an API model, which guided setup can add for you.@@ -60,6 +60,16 @@ On Windows, use the PowerShell command on that page. The installer adds two commRun `cursor-agent login` once to sign in.+## Grok Build++Grok Build speaks ACP itself, so there is no separate program. Install it from the [Grok Build guide](https://docs.x.ai/build/overview):++```sh+curl -fsSL https://x.ai/cli/install.sh | bash+```++On Windows, use the PowerShell command on that page. OpenPencil starts it as `grok agent stdio`. Run `grok login` once to sign in.+## PiPi runs through OpenPencil's Harness companion instead of ACP. It needs Node.js 22.15 or later, or Bun. Guided setup installs the companion with one click; to install it yourself, use the version that matches your app:diff --git a/packages/docs/ru/programmable/ai-chat.md b/packages/docs/ru/programmable/ai-chat.mdindex 4eb0c45c3..e8661f2c2 100644--- a/packages/docs/ru/programmable/ai-chat.md+++ b/packages/docs/ru/programmable/ai-chat.md@@ -9,7 +9,7 @@ description: Встроенный помощник с более чем 90 ин## Настройка-При первом запуске пошаговая настройка спрашивает, с чем должен помогать ИИ и чем вы уже пользуетесь: агентом для программирования вроде Claude Code, Codex, Gemini CLI или Cursor в настольном приложении, аккаунтом API или локальным либо корпоративным сервером. Она подключает этот доступ и назначает его ролям **Design agent** и **Vision**, не меняя то, что вы настроили вручную. Для OpenRouter достаточно войти в аккаунт вместо вставки ключа API. Её можно пропустить и запустить снова в **Настройки → ИИ и агенты → Пройти пошаговую настройку**. Чтобы настроить модели вручную:+При первом запуске пошаговая настройка спрашивает, с чем должен помогать ИИ и чем вы уже пользуетесь: агентом для программирования вроде Claude Code, Codex, Gemini CLI, Cursor или Grok Build в настольном приложении, аккаунтом API или локальным либо корпоративным сервером. Она подключает этот доступ и назначает его ролям **Design agent** и **Vision**, не меняя то, что вы настроили вручную. Для OpenRouter достаточно войти в аккаунт вместо вставки ключа API. Её можно пропустить и запустить снова в **Настройки → ИИ и агенты → Пройти пошаговую настройку**. Чтобы настроить модели вручную:1. Откройте панель чата.2. Нажмите значок настроек.diff --git a/packages/feedback/src/contract/schema.ts b/packages/feedback/src/contract/schema.tsindex 57537cb07..8d7f7673a 100644--- a/packages/feedback/src/contract/schema.ts+++ b/packages/feedback/src/contract/schema.ts@@ -40,7 +40,8 @@ export const AI_PROVIDERS = ['acp:claude-code','acp:codex','acp:gemini-cli',- 'acp:cursor'+ 'acp:cursor',+ 'acp:grok-build'] as constexport type Platform = (typeof PLATFORMS)[number]diff --git a/src/app/ai/agents/acp/events.ts b/src/app/ai/agents/acp/events.tsindex 771654e6b..f0f960570 100644--- a/src/app/ai/agents/acp/events.ts+++ b/src/app/ai/agents/acp/events.ts@@ -25,6 +25,7 @@ interface ToolIdentity {}const OWN_PREFIX = `mcp__${OPEN_PENCIL_MCP_SERVER}__`+const GROK_OWN_PREFIX = `${OPEN_PENCIL_MCP_SERVER}__`const codexMCPInputSchema = v.object({server: v.string(),@@ -49,6 +50,14 @@ const cursorMCPInputSchema = v.object({toolName: v.string(),args: v.optional(v.unknown())})+const grokMetaSchema = v.object({ 'x.ai/tool': v.object({ name: v.literal('use_tool') }) })+const grokMCPInputSchema = v.object({ tool_name: v.string(), tool_input: v.optional(v.unknown()) })+/** Grok Build's MCP result: the tool's text, under `OkayOutput` or, for a failure, `Error`. */+const grokMCPOutputSchema = v.object({+ type: v.literal('MCP'),+ output: v.union([v.object({ OkayOutput: v.string() }), v.object({ Error: v.string() })]),+ is_error: v.optional(v.boolean())+})const mcpResultSchema = v.object({content: v.array(v.unknown()),isError: v.optional(v.boolean())@@ -95,11 +104,23 @@ function cursorIdentity(update: ToolCallReport): ToolIdentity | null {: { name: `mcp__${server}__${tool}`, kind: 'mcp', input: args ?? {} }}+/** Grok Build calls every MCP tool through its `use_tool`, naming it `server__tool`. */+function grokIdentity(update: ToolCallReport): ToolIdentity | null {+ if (!v.is(grokMetaSchema, update._meta)) return null+ const input = v.safeParse(grokMCPInputSchema, update.rawInput)+ if (!input.success) return null+ const { tool_name: name, tool_input: args } = input.output+ return name.startsWith(GROK_OWN_PREFIX)+ ? { name: name.slice(GROK_OWN_PREFIX.length), kind: 'own', input: args ?? {} }+ : { name: `mcp__${name}`, kind: 'mcp', input: args ?? {} }+}+function identify(update: ToolCallReport): ToolIdentity {return (codexIdentity(update) ??claudeIdentity(update) ??- cursorIdentity(update) ?? { name: update.title || 'unknown', kind: 'agent' }+ cursorIdentity(update) ??+ grokIdentity(update) ?? { name: update.title || 'unknown', kind: 'agent' })}@@ -174,8 +195,18 @@ type ToolResult = { ok: true; output: unknown } | { ok: false; errorText: stringconst FAILED = 'Tool call failed'-/** An MCP call's result, unwrapped from Codex's `{ result, error }`, or the error it reports. */+/**+ * An MCP call's result, unwrapped from Codex's `{ result, error }` or Grok Build's text, or the+ * error it reports.+ */function mcpOutcome(update: ToolCallReport): ToolResult {+ const grok = v.safeParse(grokMCPOutputSchema, update.rawOutput)+ if (grok.success) {+ const { output } = grok.output+ const text = 'OkayOutput' in output ? output.OkayOutput : output.Error+ const isError = grok.output.is_error === true || 'Error' in output+ return { ok: true, output: { content: [{ type: 'text', text }], isError } }+ }const codex = v.safeParse(codexMCPOutputSchema, update.rawOutput)if (!codex.success) return { ok: true, output: update.rawOutput }const { error, result } = codex.outputdiff --git a/src/app/ai/agents/setup/prompt.ts b/src/app/ai/agents/setup/prompt.tsindex cc5969a1f..03ca51f40 100644--- a/src/app/ai/agents/setup/prompt.ts+++ b/src/app/ai/agents/setup/prompt.ts@@ -10,7 +10,8 @@ const SIGN_IN: Record<ACPAgentID, string> = {'Make sure I am signed in to Claude Code: run `claude` and use `/login` if it asks me to sign in.',codex: 'Make sure I am signed in to Codex: run `codex login` if I am not.','gemini-cli': 'Make sure I am signed in to Gemini CLI: run `gemini` and choose a sign-in method.',- cursor: 'Make sure I am signed in to Cursor: run `cursor-agent login` if I am not.'+ cursor: 'Make sure I am signed in to Cursor: run `cursor-agent login` if I am not.',+ 'grok-build': 'Make sure I am signed in to Grok Build: run `grok login` if I am not.'}export function codingAgentGuideURL(agentID: ACPAgentID): string {diff --git a/src/app/ai/models/settings/onboarding/plan.ts b/src/app/ai/models/settings/onboarding/plan.tsindex b1f113759..fef522910 100644--- a/src/app/ai/models/settings/onboarding/plan.ts+++ b/src/app/ai/models/settings/onboarding/plan.ts@@ -15,6 +15,7 @@ export const ONBOARDING_AGENTS = ['acp:codex','acp:gemini-cli','acp:cursor',+ 'acp:grok-build','harness:pi'] as const/** Subscriptions OpenPencil's own agent signs in to; the sign-in needs the desktop app. */diff --git a/src/components/settings/provider/ProviderLogo.vue b/src/components/settings/provider/ProviderLogo.vueindex e30264ff4..f29adedb6 100644--- a/src/components/settings/provider/ProviderLogo.vue+++ b/src/components/settings/provider/ProviderLogo.vue@@ -8,6 +8,7 @@ import IconCursor from '~icons/ai/cursor'import IconDeepSeek from '~icons/ai/deepseek'import IconGemini from '~icons/ai/gemini'import IconGeminiCLI from '~icons/ai/geminicli'+import IconGrok from '~icons/ai/grok'import IconLMStudio from '~icons/ai/lmstudio'import IconMiniMax from '~icons/ai/minimax'import IconOllama from '~icons/ai/ollama'@@ -35,6 +36,7 @@ const LOGOS: Record<string, Component> = {'acp:codex': IconCodex,'acp:cursor': IconCursor,'acp:gemini-cli': IconGeminiCLI,+ 'acp:grok-build': IconGrok,'harness:pi': IconBot}diff --git a/tests/app/ai/agents/setup/discovery.test.ts b/tests/app/ai/agents/setup/discovery.test.tsindex 0ddb52b7d..fa446f626 100644--- a/tests/app/ai/agents/setup/discovery.test.ts+++ b/tests/app/ai/agents/setup/discovery.test.ts@@ -153,7 +153,8 @@ describe('local agent discovery', () => {['claude-code', 'needs-adapter'],['codex', 'available'],['gemini-cli', 'not-installed'],- ['cursor', 'not-installed']+ ['cursor', 'not-installed'],+ ['grok-build', 'not-installed']])})@@ -163,7 +164,8 @@ describe('local agent discovery', () => {['claude-code', 'needs-adapter'],['codex', 'needs-adapter'],['gemini-cli', 'not-installed'],- ['cursor', 'not-installed']+ ['cursor', 'not-installed'],+ ['grok-build', 'not-installed']])})diff --git a/tests/engine/acp/permission.test.ts b/tests/engine/acp/permission.test.tsindex 16792c580..28b5cac16 100644--- a/tests/engine/acp/permission.test.ts+++ b/tests/engine/acp/permission.test.ts@@ -183,6 +183,20 @@ describe('permission for OpenPencil’s own tools', () => {})})+ test('Grok Build’s calls to OpenPencil’s server are allowed once without asking', () => {+ const approval = createOwnToolApproval()+ approval.noteUpdate({+ sessionUpdate: 'tool_call',+ toolCallId: 'tc-1',+ title: 'use_tool',+ rawInput: { tool_name: 'open-pencil__get_node', tool_input: { id: '1:2' } },+ _meta: { 'x.ai/tool': { name: 'use_tool' } }+ })+ expect(approval.answer(makeRequest())).toEqual({+ outcome: { outcome: 'selected', optionId: 'allow' }+ })+ })+test('another server’s calls and the agent’s own tools are left to the person', () => {const approval = createOwnToolApproval()approval.noteUpdate({diff --git a/tests/engine/acp/transport.test.ts b/tests/engine/acp/transport.test.tsindex d6631ea0d..5280a53fd 100644--- a/tests/engine/acp/transport.test.ts+++ b/tests/engine/acp/transport.test.ts@@ -87,6 +87,29 @@ function cursorUpdate(fields: Omit<ToolCallUpdate, 'toolCallId'>): SessionUpdatereturn { sessionUpdate: 'tool_call_update', toolCallId: 'cur-1', ...fields }}+const GROK_USE_TOOL = { 'x.ai/tool': { name: 'use_tool', namespace: 'grok_build' } }++/** Grok Build calls every MCP tool through its `use_tool`, naming it `server__tool`. */+function grokCall(id: string, tool: string, args: unknown): SessionUpdate {+ return {+ sessionUpdate: 'tool_call',+ toolCallId: id,+ title: 'use_tool',+ rawInput: { tool_name: tool, tool_input: args },+ _meta: GROK_USE_TOOL+ }+}++function grokDone(id: string, output: { OkayOutput: string } | { Error: string }): SessionUpdate {+ const failed = 'Error' in output+ return {+ sessionUpdate: 'tool_call_update',+ toolCallId: id,+ status: failed ? 'failed' : 'completed',+ rawOutput: { type: 'MCP', output, ...(failed ? { is_error: true } : {}) }+ }+}+function mcpText(value: unknown, isError?: boolean) {return {content: [{ type: 'text', text: JSON.stringify(value) }],@@ -232,6 +255,38 @@ describe('an ACP turn in the chat', () => {})})+ test('Grok Build’s calls to OpenPencil’s tools show the same way, with their result or error', async () => {+ const [done, failed] = await transcript([+ grokCall('grok-1', 'open-pencil__get_node', { id: '1:2' }),+ grokDone('grok-1', { OkayOutput: JSON.stringify({ id: '1:2', name: 'Card' }) }),+ grokCall('grok-2', 'open-pencil__describe', { id: '9:9' }),+ grokDone('grok-2', { Error: JSON.stringify({ error: 'Node 9:9 not found' }) })+ ])+ expect(shown(expectDefined(done, 'tool part'))).toMatchObject({+ type: 'tool-get_node',+ input: { id: '1:2' },+ state: 'done',+ output: { id: '1:2', name: 'Card' }+ })+ expect(shown(expectDefined(failed, 'tool part'))).toMatchObject({+ type: 'tool-describe',+ state: 'error',+ errorText: 'Node 9:9 not found'+ })+ })++ test('Grok Build’s calls to another server keep the MCP name', async () => {+ const [call] = await transcript([+ grokCall('grok-1', 'github__create_issue', { title: 'Bug' }),+ grokDone('grok-1', { OkayOutput: 'created' })+ ])+ expect(shown(expectDefined(call, 'tool part'))).toMatchObject({+ type: 'tool-mcp__github__create_issue',+ input: { title: 'Bug' },+ state: 'done'+ })+ })+test('an agent’s own tools keep its title and output', async () => {const [call] = await transcript([{