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(realtime): mic permission gate + macOS TCC for voice session (rt-8, Realtime Michael P1)
Chaitanya Giri8c9e30376c3a
diff --git a/build/entitlements.mac.plist b/build/entitlements.mac.plistindex 4ee86b05..f4d3ebb0 100644--- a/build/entitlements.mac.plist+++ b/build/entitlements.mac.plist@@ -21,9 +21,10 @@<!-- Persist user-granted file access (the "Documents folder" grant). --><key>com.apple.security.files.user-selected.read-write</key><true/>- <!-- Free Flow voice dictation records the mic via getUserMedia. Under the- hardened runtime this resource-access entitlement is required for mic- capture; it is inert unless the user enables Free Flow and records. -->+ <!-- The mic is captured via getUserMedia by two opt-in voice features: Free+ Flow dictation and Realtime Michael (live voice chat). Under the hardened+ runtime this resource-access entitlement is required for mic capture; it+ is inert unless the user turns one of those features on. --><key>com.apple.security.device.audio-input</key><true/><!-- Child processes inherit the parent's sandbox/TCC context (no-op outsidediff --git a/electron-builder.yml b/electron-builder.ymlindex 51371f85..1baf75fc 100644--- a/electron-builder.yml+++ b/electron-builder.yml@@ -66,8 +66,10 @@ mac:NSDownloadsFolderUsageDescription: "Munder Difflin's agents may work on projects located in your Downloads."NSRemovableVolumesUsageDescription: "Munder Difflin's agents may work on projects located on external volumes."NSNetworkVolumesUsageDescription: "Munder Difflin's agents may work on projects located on network volumes."- # Free Flow voice dictation records the microphone (opt-in; off by default).- NSMicrophoneUsageDescription: "Munder Difflin records your voice only when you use Free Flow dictation, then sends it to Groq to transcribe into the message queue."+ # The microphone is used by two opt-in, off-by-default voice features: Free+ # Flow dictation (Groq transcription) and Realtime Michael (live voice chat+ # with the orchestrator via OpenAI). Mic access only happens while one is on.+ NSMicrophoneUsageDescription: "Munder Difflin uses your microphone only for its opt-in voice features: Free Flow dictation (transcribed by Groq into the message queue) and talking to Michael in real time (streamed to OpenAI). The mic is off unless you turn one of these on."# Hardened runtime + entitlements so the spawned `claude` agents inherit this# app's TCC responsibility (one grant covers them all) and node-pty can load.hardenedRuntime: truediff --git a/src/main/config.ts b/src/main/config.tsindex b270c32c..445222df 100644--- a/src/main/config.ts+++ b/src/main/config.ts@@ -256,6 +256,15 @@ export interface HarnessConfig {/** Groq Whisper model id. Default 'whisper-large-v3-turbo' (fast, multilingual). */freeflowModel?: string;+ // ─── Realtime Michael (premium speech-to-speech voice orchestrator) ─────────+ /** True ONLY while a Realtime Michael voice session is live: the renderer+ * session flips this on at start() (before getUserMedia) and off at stop().+ * The main-process mic permission gate reads it so the Electron media+ * permission is open EXACTLY while the voice loop holds the mic — never just+ * because an OpenAI key exists (that key is shared with the CLI engines).+ * Default off; absence ⇒ mic denied, mirroring `freeflowEnabled`. */+ realtimeVoiceEnabled?: boolean;+// ─── Generic inbound webhook + status API ──────────────────────────────────/** Master toggle for the generic webhook HTTP API (POST → work, GET → status). */webhookEnabled?: boolean;@@ -314,6 +323,7 @@ const DEFAULTS: HarnessConfig = {freeflowEnabled: true,groqApiKey: undefined,freeflowModel: 'whisper-large-v3-turbo',+ realtimeVoiceEnabled: false,webhookEnabled: false,webhookSecret: undefined,webhookPort: undefined,diff --git a/src/main/index.ts b/src/main/index.tsindex 98421643..84ae95cf 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -1513,22 +1513,31 @@ function createWindow(opts: { floor?: boolean } = {}): BrowserWindow {if (!isFloor) mainWindow = win;// Permission gate for the renderer (our own trusted, local content). The only- // permission we constrain is microphone capture (Free Flow): it's allowed ONLY- // while Free Flow is enabled, so a disabled flag means zero mic access even at- // the Electron layer. Every other permission keeps the app's prior permissive- // behavior (e.g. clipboard for xterm/editor copy must keep working).+ // permission we constrain is microphone capture: it's allowed ONLY while a mic+ // feature is actually live — Free Flow dictation (`freeflowEnabled`) OR a+ // Realtime Michael voice session (`realtimeVoiceEnabled`, flipped on by the+ // session at start() before getUserMedia, off at stop()). With both flags off,+ // there's zero mic access even at the Electron layer. We deliberately do NOT+ // gate on OpenAI-key presence: that key (`apikey:openai`) is shared with the CLI+ // engines, so a CLI-only user must not have the mic gate opened. Every other+ // permission keeps the app's prior permissive behavior (e.g. clipboard for+ // xterm/editor copy must keep working).+ const micFeatureLive = (): boolean => {+ const cfg = readConfig();+ return cfg.freeflowEnabled === true || cfg.realtimeVoiceEnabled === true;+ };const ses = win.webContents.session;ses.setPermissionRequestHandler((_wc, permission, callback, details) => {if (permission === 'media') {const mediaTypes = details && 'mediaTypes' in details ? details.mediaTypes : undefined;const wantsAudio = !mediaTypes || mediaTypes.includes('audio');- callback(readConfig().freeflowEnabled === true && wantsAudio);+ callback(micFeatureLive() && wantsAudio);return;}callback(true);});ses.setPermissionCheckHandler((_wc, permission) => {- if (permission === 'media') return readConfig().freeflowEnabled === true;+ if (permission === 'media') return micFeatureLive();return true;});diff --git a/src/preload/index.ts b/src/preload/index.tsindex 9031be8e..a014a813 100644--- a/src/preload/index.ts+++ b/src/preload/index.ts@@ -202,6 +202,10 @@ export interface HarnessConfig {freeflowEnabled?: boolean;groqApiKey?: string;freeflowModel?: string;+ /** Realtime Michael voice loop — true ONLY while a session holds the mic+ * (renderer session sets it at start()/stop()); the main mic permission gate+ * reads it. Default off. */+ realtimeVoiceEnabled?: boolean;costCapUsd?: number;costCapTokens?: number;agentTokenCaps?: Record<string, number>;