程序员阿江(Relakkes) 0a82efdcd9 fix: keep desktop permission prompts visible
Desktop notification permission can appear granted while macOS still suppresses a foreground banner, so blocking permission prompts now also request OS-level window attention. The notification sender keeps the native notification path, but prompt callers can ask the window manager for attention when silence would block user progress.

The desktop package also declares the existing qrcode runtime dependency used by AdapterSettings so production desktop builds can resolve that import.

Constraint: Tauri window attention requires an explicit capability grant in packaged builds.
Constraint: macOS may suppress foreground notification banners even when notification APIs report success.
Rejected: Replace native notifications with a custom in-app sound or overlay | the notification feature should stay OS-owned and already has an in-app permission card.
Confidence: high
Scope-risk: narrow
Directive: Keep requestAttention limited to blocking prompts unless another flow truly needs persistent OS attention.
Tested: bun run test -- src/lib/desktopNotifications.test.ts src/stores/chatStore.test.ts
Tested: bun run check:desktop
Tested: bun run check:native
Tested: git diff --check
Not-tested: bun run quality:pr | blocked by existing branch-wide CLI core policy requiring allow-cli-core-change approval
2026-05-04 19:05:04 +08:00

109 lines
2.8 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/nicegui/nicegui/main/nicegui/static/tauri-capabilities-schema-v2.json",
"identifier": "default",
"description": "Default capabilities for Claude Code Desktop",
"windows": ["main"],
"permissions": [
"core:default",
"core:window:allow-close",
"core:window:allow-minimize",
"core:window:allow-request-user-attention",
"core:window:allow-start-dragging",
"core:window:allow-toggle-maximize",
"shell:allow-open",
{
"identifier": "shell:allow-execute",
"allow": [
{
"args": [
"server",
{ "validator": "regex", "value": "^(--port|--host|--config)=.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"adapters",
{ "validator": "regex", "value": "^(feishu|telegram|wechat|dingtalk|lark|slack)(:.+)?$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"cli",
{ "validator": "regex", "value": "^.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
}
]
},
{
"identifier": "shell:allow-spawn",
"allow": [
{
"args": [
"server",
{ "validator": "regex", "value": "^(--port|--host|--config)=.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"adapters",
{ "validator": "regex", "value": "^(feishu|telegram|wechat|dingtalk|lark|slack)(:.+)?$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"cli",
{ "validator": "regex", "value": "^.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
}
]
},
{
"identifier": "shell:allow-kill",
"allow": [
{
"args": [
"server",
{ "validator": "regex", "value": "^(--port|--host|--config)=.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"adapters",
{ "validator": "regex", "value": "^(feishu|telegram|wechat|dingtalk|lark|slack)(:.+)?$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
},
{
"args": [
"cli",
{ "validator": "regex", "value": "^.+$" }
],
"name": "binaries/claude-sidecar",
"sidecar": true
}
]
},
"dialog:allow-open",
"dialog:allow-save",
"notification:default",
"process:allow-exit",
"process:allow-restart",
"updater:default"
]
}