feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288)

Co-authored-by: chengzifeng <chengzifeng@meituan.com>
This commit is contained in:
Cheng Zi Feng
2026-04-17 16:21:27 +08:00
committed by GitHub
parent b5c299f5d2
commit 72a2093cd6
64 changed files with 4138 additions and 312 deletions

View File

@@ -687,6 +687,7 @@ export const REMOTE_SAFE_COMMANDS: Set<Command> = new Set([
btw, // Quick note
feedback, // Send feedback
plan, // Plan mode toggle
proactive, // Toggle proactive mode
keybindings, // Keybinding management
statusline, // Status line toggle
stickers, // Stickers
@@ -727,9 +728,18 @@ export const BRIDGE_SAFE_COMMANDS: Set<Command> = new Set(
* BRIDGE_SAFE_COMMANDS; 'local-jsx' commands render Ink UI and stay blocked.
*/
export function isBridgeSafeCommand(cmd: Command): boolean {
if (cmd.type === 'local-jsx') return false
if (cmd.type === 'local-jsx') return cmd.bridgeSafe === true
if (cmd.type === 'prompt') return true
return BRIDGE_SAFE_COMMANDS.has(cmd)
return cmd.bridgeSafe === true || BRIDGE_SAFE_COMMANDS.has(cmd)
}
export function getBridgeCommandSafety(
cmd: Command,
args: string,
): { ok: true } | { ok: false; reason?: string } {
if (!isBridgeSafeCommand(cmd)) return { ok: false }
const reason = cmd.getBridgeInvocationError?.(args)
return reason ? { ok: false, reason } : { ok: true }
}
/**