mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
Monaco's context-menu Paste reads navigator.clipboard.readText(), which is blocked in Orca's sandboxed renderer, so right-click Paste did nothing while Cmd/Ctrl+V and right-click Copy worked. Register a higher-priority implementation on Monaco's PasteAction that reads the clipboard through Orca's trusted IPC bridge (window.api.ui.readClipboardText) and dispatches Monaco's native paste. Falls through for read-only/unfocused/non-editor targets so Cmd/Ctrl+V is untouched, and routes oversized pastes through the existing chunked inserter to preserve the too-large guard for both paste paths. Verified with unit tests (incl. read-only fall-through, empty/too-large/focus-lost/oversized) and end-to-end in the Electron app.