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

@@ -0,0 +1,16 @@
import { describe, expect, test } from 'bun:test'
import plan from './index.js'
describe('plan bridge invocation safety', () => {
test('allows headless plan mode operations over Remote Control', () => {
expect(plan.getBridgeInvocationError?.('')).toBeUndefined()
expect(plan.getBridgeInvocationError?.('write a migration plan')).toBeUndefined()
})
test('blocks /plan open over Remote Control', () => {
expect(plan.getBridgeInvocationError?.('open')).toBe(
"Opening the local editor via /plan open isn't available over Remote Control.",
)
})
})

View File

@@ -1,6 +1,14 @@
import type { Command } from '../../commands.js'
const plan = {
bridgeSafe: true,
getBridgeInvocationError(args: string) {
const subcommand = args.trim().split(/\s+/)[0]
if (subcommand === 'open') {
return "Opening the local editor via /plan open isn't available over Remote Control."
}
return undefined
},
type: 'local-jsx',
name: 'plan',
description: 'Enable plan mode or view the current session plan',