agentmux_cef\commands/
stubs.rs

1// Copyright 2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Stub command handlers for commands deferred to Phase 3+.
5// These log the call and return Ok(null) to avoid frontend errors.
6
7/// Handle a stubbed command. Logs the command name and returns null.
8pub fn handle_stub(cmd: &str, args: &serde_json::Value) -> serde_json::Value {
9    tracing::debug!("stub: {} args={}", cmd, args);
10    serde_json::Value::Null
11}
12
13/// List of commands that are stubbed (deferred to Phase 3+).
14///
15/// Cross-window drag commands:
16///   start_cross_drag, update_cross_drag, complete_cross_drag,
17///   cancel_cross_drag, set_drag_cursor, restore_drag_cursor,
18///   release_drag_capture, get_cursor_point, get_mouse_button_state,
19///   set_js_drag_active
20///
21/// Multi-window commands:
22///   open_new_window, list_windows, focus_window, open_window_at_position
23///
24/// Window effects:
25///   set_window_transparency
26///
27/// Legacy claude code stubs:
28///   open_claude_code_auth, get_claude_code_auth, disconnect_claude_code
29///
30/// Existing stubs (already unimplemented in Tauri):
31///   download_file, quicklook, update_wco, set_keyboard_chord_mode,
32///   create_workspace, switch_workspace, delete_workspace,
33///   set_active_tab, create_tab, close_tab
34///
35/// Update:
36///   install_update
37pub fn is_stub_command(cmd: &str) -> bool {
38    matches!(
39        cmd,
40        // Legacy stubs
41        "open_claude_code_auth"
42            | "get_claude_code_auth"
43            | "disconnect_claude_code"
44            // Existing stubs
45            | "download_file"
46            | "quicklook"
47            | "update_wco"
48            | "set_keyboard_chord_mode"
49            | "create_workspace"
50            | "switch_workspace"
51            | "delete_workspace"
52            | "set_active_tab"
53            | "create_tab"
54            | "close_tab"
55            // Update
56            | "install_update"
57            // Devtools (handled separately but stubbed for is_devtools_open)
58            | "is_devtools_open"
59    )
60}