From 98e58f145a0d41cebdcf1c00874483766f8223c5 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Wed, 26 Aug 2026 06:19:52 +0200 Subject: [PATCH] feat(editor): File menu row to connect an external AI agent (Claude/Codex) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Declares the project.connectAgent command id and a File-menu row for it. The row is optional+pro: only the velxio-prod overlay registers a handler (it owns accounts, the MCP endpoint and the token flow), so bare OSS hides the row instead of greying it out — same seam as the account.* commands. --- frontend/src/components/editor/EditorMenuBar.tsx | 9 +++++++++ frontend/src/lib/editorCommands.ts | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/frontend/src/components/editor/EditorMenuBar.tsx b/frontend/src/components/editor/EditorMenuBar.tsx index 9f0a94ff..8cca6fee 100644 --- a/frontend/src/components/editor/EditorMenuBar.tsx +++ b/frontend/src/components/editor/EditorMenuBar.tsx @@ -142,6 +142,15 @@ export const EditorMenuBar: React.FC = () => { // pills, one button fewer in the strip. { kind: 'command', id: 'project.share', label: t('editor.toolbar.shareLabel', 'Share / Embed') }, { kind: 'command', id: 'project.githubSync', label: t('editor.toolbar.githubSyncLabel', 'Sync to GitHub'), pro: true }, + { + kind: 'command', + id: 'project.connectAgent', + label: t('editor.toolbar.connectAgentLabel', 'Connect AI agent (Claude/Codex)'), + pro: true, + // Only the pro overlay registers a handler; hide (not grey out) the + // row in builds where connecting an external agent cannot exist. + optional: true, + }, { kind: 'command', id: 'firmware.upload', label: t('editor.toolbar.uploadFirmwareLabel', 'Upload firmware') }, { kind: 'command', id: 'sim.record', label: t('editor.toolbar.recordLabel', 'Record simulation'), pro: true }, ]; diff --git a/frontend/src/lib/editorCommands.ts b/frontend/src/lib/editorCommands.ts index b04aead4..efedd482 100644 --- a/frontend/src/lib/editorCommands.ts +++ b/frontend/src/lib/editorCommands.ts @@ -37,6 +37,11 @@ export type EditorCommandId = | 'help.whatsNew' | 'project.share' | 'project.githubSync' + // Connect an external AI agent (Claude Code / Codex) to the saved + // project over MCP. Registered ONLY by the pro overlay (the OSS build + // has no accounts, tokens or MCP endpoint), so the menu row hides + // itself here — same pattern as the account.* commands. + | 'project.connectAgent' | 'firmware.upload' | 'sim.record' | 'sim.compile'