Skip to content

Commit b0be8ce

Browse files
refactor(rust): collapse audio boilerplate and adopt with_conn/row_to_track helpers
Add AudioState::dispatch to eliminate per-command channel boilerplate in audio command wrappers. Add send_engine_result closure to collapse Play/Pause/Seek/SetDevice match arms in audio_thread. Migrate commands/queue.rs and commands/favorites.rs to Database::with_conn. Make row_to_track pub(crate) and replace four inlined Track row mappings in db/favorites.rs and db/playlists.rs. Closes task-336.1
1 parent 4d48baf commit b0be8ce

10 files changed

Lines changed: 4473 additions & 581 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/mt-tauri/gen/schemas/acl-manifests.json

Lines changed: 4313 additions & 1 deletion
Large diffs are not rendered by default.

crates/mt-tauri/gen/schemas/desktop-schema.json

Lines changed: 1 addition & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,168 +2654,6 @@
26542654
"const": "global-shortcut:deny-unregister-all",
26552655
"markdownDescription": "Denies the unregister_all command without any pre-configured scope."
26562656
},
2657-
{
2658-
"description": "Default permissions for MCP Bridge plugin\n#### This default permission set includes:\n\n- `allow-capture-native-screenshot`\n- `allow-emit-event`\n- `allow-execute-command`\n- `allow-execute-js`\n- `allow-get-backend-state`\n- `allow-get-ipc-events`\n- `allow-get-window-info`\n- `allow-list-windows`\n- `allow-report-ipc-event`\n- `allow-request-script-injection`\n- `allow-script-result`\n- `allow-start-ipc-monitor`\n- `allow-stop-ipc-monitor`",
2659-
"type": "string",
2660-
"const": "mcp-bridge:default",
2661-
"markdownDescription": "Default permissions for MCP Bridge plugin\n#### This default permission set includes:\n\n- `allow-capture-native-screenshot`\n- `allow-emit-event`\n- `allow-execute-command`\n- `allow-execute-js`\n- `allow-get-backend-state`\n- `allow-get-ipc-events`\n- `allow-get-window-info`\n- `allow-list-windows`\n- `allow-report-ipc-event`\n- `allow-request-script-injection`\n- `allow-script-result`\n- `allow-start-ipc-monitor`\n- `allow-stop-ipc-monitor`"
2662-
},
2663-
{
2664-
"description": "Enables the capture_native_screenshot command without any pre-configured scope.",
2665-
"type": "string",
2666-
"const": "mcp-bridge:allow-capture-native-screenshot",
2667-
"markdownDescription": "Enables the capture_native_screenshot command without any pre-configured scope."
2668-
},
2669-
{
2670-
"description": "Enables the emit_event command without any pre-configured scope.",
2671-
"type": "string",
2672-
"const": "mcp-bridge:allow-emit-event",
2673-
"markdownDescription": "Enables the emit_event command without any pre-configured scope."
2674-
},
2675-
{
2676-
"description": "Enables the execute_command command without any pre-configured scope.",
2677-
"type": "string",
2678-
"const": "mcp-bridge:allow-execute-command",
2679-
"markdownDescription": "Enables the execute_command command without any pre-configured scope."
2680-
},
2681-
{
2682-
"description": "Enables the execute_js command without any pre-configured scope.",
2683-
"type": "string",
2684-
"const": "mcp-bridge:allow-execute-js",
2685-
"markdownDescription": "Enables the execute_js command without any pre-configured scope."
2686-
},
2687-
{
2688-
"description": "Enables the get_backend_state command without any pre-configured scope.",
2689-
"type": "string",
2690-
"const": "mcp-bridge:allow-get-backend-state",
2691-
"markdownDescription": "Enables the get_backend_state command without any pre-configured scope."
2692-
},
2693-
{
2694-
"description": "Enables the get_ipc_events command without any pre-configured scope.",
2695-
"type": "string",
2696-
"const": "mcp-bridge:allow-get-ipc-events",
2697-
"markdownDescription": "Enables the get_ipc_events command without any pre-configured scope."
2698-
},
2699-
{
2700-
"description": "Enables the get_window_info command without any pre-configured scope.",
2701-
"type": "string",
2702-
"const": "mcp-bridge:allow-get-window-info",
2703-
"markdownDescription": "Enables the get_window_info command without any pre-configured scope."
2704-
},
2705-
{
2706-
"description": "Enables the list_windows command without any pre-configured scope.",
2707-
"type": "string",
2708-
"const": "mcp-bridge:allow-list-windows",
2709-
"markdownDescription": "Enables the list_windows command without any pre-configured scope."
2710-
},
2711-
{
2712-
"description": "Enables the report_ipc_event command without any pre-configured scope.",
2713-
"type": "string",
2714-
"const": "mcp-bridge:allow-report-ipc-event",
2715-
"markdownDescription": "Enables the report_ipc_event command without any pre-configured scope."
2716-
},
2717-
{
2718-
"description": "Enables the request_script_injection command without any pre-configured scope.",
2719-
"type": "string",
2720-
"const": "mcp-bridge:allow-request-script-injection",
2721-
"markdownDescription": "Enables the request_script_injection command without any pre-configured scope."
2722-
},
2723-
{
2724-
"description": "Enables the script_result command without any pre-configured scope.",
2725-
"type": "string",
2726-
"const": "mcp-bridge:allow-script-result",
2727-
"markdownDescription": "Enables the script_result command without any pre-configured scope."
2728-
},
2729-
{
2730-
"description": "Enables the start_ipc_monitor command without any pre-configured scope.",
2731-
"type": "string",
2732-
"const": "mcp-bridge:allow-start-ipc-monitor",
2733-
"markdownDescription": "Enables the start_ipc_monitor command without any pre-configured scope."
2734-
},
2735-
{
2736-
"description": "Enables the stop_ipc_monitor command without any pre-configured scope.",
2737-
"type": "string",
2738-
"const": "mcp-bridge:allow-stop-ipc-monitor",
2739-
"markdownDescription": "Enables the stop_ipc_monitor command without any pre-configured scope."
2740-
},
2741-
{
2742-
"description": "Denies the capture_native_screenshot command without any pre-configured scope.",
2743-
"type": "string",
2744-
"const": "mcp-bridge:deny-capture-native-screenshot",
2745-
"markdownDescription": "Denies the capture_native_screenshot command without any pre-configured scope."
2746-
},
2747-
{
2748-
"description": "Denies the emit_event command without any pre-configured scope.",
2749-
"type": "string",
2750-
"const": "mcp-bridge:deny-emit-event",
2751-
"markdownDescription": "Denies the emit_event command without any pre-configured scope."
2752-
},
2753-
{
2754-
"description": "Denies the execute_command command without any pre-configured scope.",
2755-
"type": "string",
2756-
"const": "mcp-bridge:deny-execute-command",
2757-
"markdownDescription": "Denies the execute_command command without any pre-configured scope."
2758-
},
2759-
{
2760-
"description": "Denies the execute_js command without any pre-configured scope.",
2761-
"type": "string",
2762-
"const": "mcp-bridge:deny-execute-js",
2763-
"markdownDescription": "Denies the execute_js command without any pre-configured scope."
2764-
},
2765-
{
2766-
"description": "Denies the get_backend_state command without any pre-configured scope.",
2767-
"type": "string",
2768-
"const": "mcp-bridge:deny-get-backend-state",
2769-
"markdownDescription": "Denies the get_backend_state command without any pre-configured scope."
2770-
},
2771-
{
2772-
"description": "Denies the get_ipc_events command without any pre-configured scope.",
2773-
"type": "string",
2774-
"const": "mcp-bridge:deny-get-ipc-events",
2775-
"markdownDescription": "Denies the get_ipc_events command without any pre-configured scope."
2776-
},
2777-
{
2778-
"description": "Denies the get_window_info command without any pre-configured scope.",
2779-
"type": "string",
2780-
"const": "mcp-bridge:deny-get-window-info",
2781-
"markdownDescription": "Denies the get_window_info command without any pre-configured scope."
2782-
},
2783-
{
2784-
"description": "Denies the list_windows command without any pre-configured scope.",
2785-
"type": "string",
2786-
"const": "mcp-bridge:deny-list-windows",
2787-
"markdownDescription": "Denies the list_windows command without any pre-configured scope."
2788-
},
2789-
{
2790-
"description": "Denies the report_ipc_event command without any pre-configured scope.",
2791-
"type": "string",
2792-
"const": "mcp-bridge:deny-report-ipc-event",
2793-
"markdownDescription": "Denies the report_ipc_event command without any pre-configured scope."
2794-
},
2795-
{
2796-
"description": "Denies the request_script_injection command without any pre-configured scope.",
2797-
"type": "string",
2798-
"const": "mcp-bridge:deny-request-script-injection",
2799-
"markdownDescription": "Denies the request_script_injection command without any pre-configured scope."
2800-
},
2801-
{
2802-
"description": "Denies the script_result command without any pre-configured scope.",
2803-
"type": "string",
2804-
"const": "mcp-bridge:deny-script-result",
2805-
"markdownDescription": "Denies the script_result command without any pre-configured scope."
2806-
},
2807-
{
2808-
"description": "Denies the start_ipc_monitor command without any pre-configured scope.",
2809-
"type": "string",
2810-
"const": "mcp-bridge:deny-start-ipc-monitor",
2811-
"markdownDescription": "Denies the start_ipc_monitor command without any pre-configured scope."
2812-
},
2813-
{
2814-
"description": "Denies the stop_ipc_monitor command without any pre-configured scope.",
2815-
"type": "string",
2816-
"const": "mcp-bridge:deny-stop-ipc-monitor",
2817-
"markdownDescription": "Denies the stop_ipc_monitor command without any pre-configured scope."
2818-
},
28192657
{
28202658
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
28212659
"type": "string",
@@ -3262,4 +3100,4 @@
32623100
]
32633101
}
32643102
}
3265-
}
3103+
}

crates/mt-tauri/gen/schemas/macOS-schema.json

Lines changed: 1 addition & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,168 +2654,6 @@
26542654
"const": "global-shortcut:deny-unregister-all",
26552655
"markdownDescription": "Denies the unregister_all command without any pre-configured scope."
26562656
},
2657-
{
2658-
"description": "Default permissions for MCP Bridge plugin\n#### This default permission set includes:\n\n- `allow-capture-native-screenshot`\n- `allow-emit-event`\n- `allow-execute-command`\n- `allow-execute-js`\n- `allow-get-backend-state`\n- `allow-get-ipc-events`\n- `allow-get-window-info`\n- `allow-list-windows`\n- `allow-report-ipc-event`\n- `allow-request-script-injection`\n- `allow-script-result`\n- `allow-start-ipc-monitor`\n- `allow-stop-ipc-monitor`",
2659-
"type": "string",
2660-
"const": "mcp-bridge:default",
2661-
"markdownDescription": "Default permissions for MCP Bridge plugin\n#### This default permission set includes:\n\n- `allow-capture-native-screenshot`\n- `allow-emit-event`\n- `allow-execute-command`\n- `allow-execute-js`\n- `allow-get-backend-state`\n- `allow-get-ipc-events`\n- `allow-get-window-info`\n- `allow-list-windows`\n- `allow-report-ipc-event`\n- `allow-request-script-injection`\n- `allow-script-result`\n- `allow-start-ipc-monitor`\n- `allow-stop-ipc-monitor`"
2662-
},
2663-
{
2664-
"description": "Enables the capture_native_screenshot command without any pre-configured scope.",
2665-
"type": "string",
2666-
"const": "mcp-bridge:allow-capture-native-screenshot",
2667-
"markdownDescription": "Enables the capture_native_screenshot command without any pre-configured scope."
2668-
},
2669-
{
2670-
"description": "Enables the emit_event command without any pre-configured scope.",
2671-
"type": "string",
2672-
"const": "mcp-bridge:allow-emit-event",
2673-
"markdownDescription": "Enables the emit_event command without any pre-configured scope."
2674-
},
2675-
{
2676-
"description": "Enables the execute_command command without any pre-configured scope.",
2677-
"type": "string",
2678-
"const": "mcp-bridge:allow-execute-command",
2679-
"markdownDescription": "Enables the execute_command command without any pre-configured scope."
2680-
},
2681-
{
2682-
"description": "Enables the execute_js command without any pre-configured scope.",
2683-
"type": "string",
2684-
"const": "mcp-bridge:allow-execute-js",
2685-
"markdownDescription": "Enables the execute_js command without any pre-configured scope."
2686-
},
2687-
{
2688-
"description": "Enables the get_backend_state command without any pre-configured scope.",
2689-
"type": "string",
2690-
"const": "mcp-bridge:allow-get-backend-state",
2691-
"markdownDescription": "Enables the get_backend_state command without any pre-configured scope."
2692-
},
2693-
{
2694-
"description": "Enables the get_ipc_events command without any pre-configured scope.",
2695-
"type": "string",
2696-
"const": "mcp-bridge:allow-get-ipc-events",
2697-
"markdownDescription": "Enables the get_ipc_events command without any pre-configured scope."
2698-
},
2699-
{
2700-
"description": "Enables the get_window_info command without any pre-configured scope.",
2701-
"type": "string",
2702-
"const": "mcp-bridge:allow-get-window-info",
2703-
"markdownDescription": "Enables the get_window_info command without any pre-configured scope."
2704-
},
2705-
{
2706-
"description": "Enables the list_windows command without any pre-configured scope.",
2707-
"type": "string",
2708-
"const": "mcp-bridge:allow-list-windows",
2709-
"markdownDescription": "Enables the list_windows command without any pre-configured scope."
2710-
},
2711-
{
2712-
"description": "Enables the report_ipc_event command without any pre-configured scope.",
2713-
"type": "string",
2714-
"const": "mcp-bridge:allow-report-ipc-event",
2715-
"markdownDescription": "Enables the report_ipc_event command without any pre-configured scope."
2716-
},
2717-
{
2718-
"description": "Enables the request_script_injection command without any pre-configured scope.",
2719-
"type": "string",
2720-
"const": "mcp-bridge:allow-request-script-injection",
2721-
"markdownDescription": "Enables the request_script_injection command without any pre-configured scope."
2722-
},
2723-
{
2724-
"description": "Enables the script_result command without any pre-configured scope.",
2725-
"type": "string",
2726-
"const": "mcp-bridge:allow-script-result",
2727-
"markdownDescription": "Enables the script_result command without any pre-configured scope."
2728-
},
2729-
{
2730-
"description": "Enables the start_ipc_monitor command without any pre-configured scope.",
2731-
"type": "string",
2732-
"const": "mcp-bridge:allow-start-ipc-monitor",
2733-
"markdownDescription": "Enables the start_ipc_monitor command without any pre-configured scope."
2734-
},
2735-
{
2736-
"description": "Enables the stop_ipc_monitor command without any pre-configured scope.",
2737-
"type": "string",
2738-
"const": "mcp-bridge:allow-stop-ipc-monitor",
2739-
"markdownDescription": "Enables the stop_ipc_monitor command without any pre-configured scope."
2740-
},
2741-
{
2742-
"description": "Denies the capture_native_screenshot command without any pre-configured scope.",
2743-
"type": "string",
2744-
"const": "mcp-bridge:deny-capture-native-screenshot",
2745-
"markdownDescription": "Denies the capture_native_screenshot command without any pre-configured scope."
2746-
},
2747-
{
2748-
"description": "Denies the emit_event command without any pre-configured scope.",
2749-
"type": "string",
2750-
"const": "mcp-bridge:deny-emit-event",
2751-
"markdownDescription": "Denies the emit_event command without any pre-configured scope."
2752-
},
2753-
{
2754-
"description": "Denies the execute_command command without any pre-configured scope.",
2755-
"type": "string",
2756-
"const": "mcp-bridge:deny-execute-command",
2757-
"markdownDescription": "Denies the execute_command command without any pre-configured scope."
2758-
},
2759-
{
2760-
"description": "Denies the execute_js command without any pre-configured scope.",
2761-
"type": "string",
2762-
"const": "mcp-bridge:deny-execute-js",
2763-
"markdownDescription": "Denies the execute_js command without any pre-configured scope."
2764-
},
2765-
{
2766-
"description": "Denies the get_backend_state command without any pre-configured scope.",
2767-
"type": "string",
2768-
"const": "mcp-bridge:deny-get-backend-state",
2769-
"markdownDescription": "Denies the get_backend_state command without any pre-configured scope."
2770-
},
2771-
{
2772-
"description": "Denies the get_ipc_events command without any pre-configured scope.",
2773-
"type": "string",
2774-
"const": "mcp-bridge:deny-get-ipc-events",
2775-
"markdownDescription": "Denies the get_ipc_events command without any pre-configured scope."
2776-
},
2777-
{
2778-
"description": "Denies the get_window_info command without any pre-configured scope.",
2779-
"type": "string",
2780-
"const": "mcp-bridge:deny-get-window-info",
2781-
"markdownDescription": "Denies the get_window_info command without any pre-configured scope."
2782-
},
2783-
{
2784-
"description": "Denies the list_windows command without any pre-configured scope.",
2785-
"type": "string",
2786-
"const": "mcp-bridge:deny-list-windows",
2787-
"markdownDescription": "Denies the list_windows command without any pre-configured scope."
2788-
},
2789-
{
2790-
"description": "Denies the report_ipc_event command without any pre-configured scope.",
2791-
"type": "string",
2792-
"const": "mcp-bridge:deny-report-ipc-event",
2793-
"markdownDescription": "Denies the report_ipc_event command without any pre-configured scope."
2794-
},
2795-
{
2796-
"description": "Denies the request_script_injection command without any pre-configured scope.",
2797-
"type": "string",
2798-
"const": "mcp-bridge:deny-request-script-injection",
2799-
"markdownDescription": "Denies the request_script_injection command without any pre-configured scope."
2800-
},
2801-
{
2802-
"description": "Denies the script_result command without any pre-configured scope.",
2803-
"type": "string",
2804-
"const": "mcp-bridge:deny-script-result",
2805-
"markdownDescription": "Denies the script_result command without any pre-configured scope."
2806-
},
2807-
{
2808-
"description": "Denies the start_ipc_monitor command without any pre-configured scope.",
2809-
"type": "string",
2810-
"const": "mcp-bridge:deny-start-ipc-monitor",
2811-
"markdownDescription": "Denies the start_ipc_monitor command without any pre-configured scope."
2812-
},
2813-
{
2814-
"description": "Denies the stop_ipc_monitor command without any pre-configured scope.",
2815-
"type": "string",
2816-
"const": "mcp-bridge:deny-stop-ipc-monitor",
2817-
"markdownDescription": "Denies the stop_ipc_monitor command without any pre-configured scope."
2818-
},
28192657
{
28202658
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
28212659
"type": "string",
@@ -3262,4 +3100,4 @@
32623100
]
32633101
}
32643102
}
3265-
}
3103+
}

0 commit comments

Comments
 (0)