Skip to content

AI-native design editor. Open-source Figma alternative.

Fix ACP shell scope config and surface connection errors

Danila Poyarkov2109bd660589
diff --git a/desktop/Cargo.lock b/desktop/Cargo.lock
index 22472a812..7abe90543 100644
--- a/desktop/Cargo.lock
+++ b/desktop/Cargo.lock
@@ -882,6 +882,15 @@ version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
+[[package]]
+name = "encoding_rs"
+version = "0.8.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
+dependencies = [
+ "cfg-if",
+]
+
[[package]]
name = "endi"
version = "1.1.1"
@@ -2576,6 +2585,7 @@ dependencies = [
"tauri-plugin-dialog",
"tauri-plugin-fs",
"tauri-plugin-opener",
+ "tauri-plugin-shell",
"zip",
"zstd",
]
@@ -2596,6 +2606,16 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "os_pipe"
+version = "1.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "pango"
version = "0.18.3"
@@ -3521,12 +3541,44 @@ dependencies = [
"digest",
]
+[[package]]
+name = "shared_child"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7"
+dependencies = [
+ "libc",
+ "sigchld",
+ "windows-sys 0.60.2",
+]
+
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
+[[package]]
+name = "sigchld"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1"
+dependencies = [
+ "libc",
+ "os_pipe",
+ "signal-hook",
+]
+
+[[package]]
+name = "signal-hook"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
+dependencies = [
+ "libc",
+ "signal-hook-registry",
+]
+
[[package]]
name = "signal-hook-registry"
version = "1.4.8"
@@ -3980,6 +4032,27 @@ dependencies = [
"zbus",
]
+[[package]]
+name = "tauri-plugin-shell"
+version = "2.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8457dbf9e2bab1edd8df22bb2c20857a59a9868e79cb3eac5ed639eec4d0c73b"
+dependencies = [
+ "encoding_rs",
+ "log",
+ "open",
+ "os_pipe",
+ "regex",
+ "schemars 0.8.22",
+ "serde",
+ "serde_json",
+ "shared_child",
+ "tauri",
+ "tauri-plugin",
+ "thiserror 2.0.18",
+ "tokio",
+]
+
[[package]]
name = "tauri-runtime"
version = "2.10.0"
diff --git a/desktop/capabilities/default.json b/desktop/capabilities/default.json
index 949e62c61..996d19f91 100644
--- a/desktop/capabilities/default.json
+++ b/desktop/capabilities/default.json
@@ -19,7 +19,14 @@
},
"fs:allow-watch",
"fs:allow-unwatch",
- "shell:allow-spawn",
+ {
+ "identifier": "shell:allow-spawn",
+ "allow": [
+ { "name": "claude-code-acp", "cmd": "claude-code-acp", "args": true },
+ { "name": "codex-acp", "cmd": "codex-acp", "args": true },
+ { "name": "gemini", "cmd": "gemini", "args": true }
+ ]
+ },
"shell:allow-stdin-write",
"shell:allow-kill"
]
diff --git a/src/components/ChatPanel.vue b/src/components/ChatPanel.vue
index 057f88d00..05da74aea 100644
--- a/src/components/ChatPanel.vue
+++ b/src/components/ChatPanel.vue
@@ -23,6 +23,7 @@ ensureChat().then((c) => {
})
const messagesEnd = ref<HTMLDivElement>()
const debugCopied = ref(false)
+const initError = ref<string | null>(null)
const messages = computed(() => chat.value?.messages ?? [])
const status = computed(() => chat.value?.status ?? 'ready')
@@ -58,10 +59,17 @@ watch(messages, scrollToBottom, { deep: true })
async function handleSubmit(text: string) {
if (status.value === 'streaming' || status.value === 'submitted') return
- const c = await ensureChat()
- if (c) chat.value = markRaw(c)
- chat.value?.sendMessage({ text }).catch(() => {
- /* user-facing error handled by UI */
+ try {
+ initError.value = null
+ const c = await ensureChat()
+ if (c) chat.value = markRaw(c)
+ } catch (e) {
+ console.error('Failed to initialize chat:', e)
+ initError.value = e instanceof Error ? e.message : String(e)
+ return
+ }
+ chat.value?.sendMessage({ text }).catch((e: unknown) => {
+ console.error('Chat error:', e)
})
}
@@ -169,6 +177,18 @@ function handleClearChat() {
</button>
</div>
+ <!-- Connection error banner -->
+ <div
+ v-if="initError"
+ class="flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-3 py-2 text-[11px] text-red-400"
+ >
+ <icon-lucide-circle-alert class="size-3.5 shrink-0" />
+ <span class="min-w-0 flex-1">{{ initError }}</span>
+ <button class="shrink-0 text-red-300 hover:text-red-200" @click="initError = null">
+ <icon-lucide-x class="size-3" />
+ </button>
+ </div>
+
<ChatInput :status="status" @submit="handleSubmit" @stop="handleStop" />
</template>
</div>