feat(permission): 实现 WebSocket 权限确认机制
重构权限系统,将终端 UI 代码从 core 模块移除,实现基于 WebSocket 的权限确认流程: Core 模块清理: - 删除 permission/prompt.ts 和 file-prompt.ts(终端交互) - 删除 diff.ts 中的 chalk 渲染函数 - 删除 config.ts 中的 inquirer 交互 - 移除 chalk 依赖 Server 权限处理: - 新增 permission/handler.ts,实现 WebSocket 权限请求/响应 - 更新 agent/adapter.ts 设置权限回调 - 更新 ws.ts 处理 permission_response 消息 Web 权限组件: - 新增 PermissionDialog 组件,显示权限请求详情和 Diff - 更新 useChat hook 管理权限状态 - 更新 Chat 页面集成权限弹窗
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export { Agent } from './core/agent.js';
|
||||
export { toolRegistry, todoManager, initTaskContext, updateTaskDescription, updateSkillDescription } from './tools/index.js';
|
||||
export { loadConfig, initConfig } from './utils/config.js';
|
||||
export { loadConfig, saveConfig, getConfig, loadVisionConfig } from './utils/config.js';
|
||||
export type { VisionConfig } from './utils/config.js';
|
||||
export { SessionStorage } from './session/storage.js';
|
||||
export { SessionManager } from './session/index.js';
|
||||
export type { SessionData, SessionSummary } from './session/types.js';
|
||||
@@ -9,7 +10,15 @@ export type { SessionData, SessionSummary } from './session/types.js';
|
||||
export type { UserInput } from './types/index.js';
|
||||
|
||||
// Permission
|
||||
export { getPermissionManager, promptPermission } from './permission/index.js';
|
||||
export { getPermissionManager } from './permission/index.js';
|
||||
export type {
|
||||
PermissionContext,
|
||||
PermissionDecision,
|
||||
PermissionCheckResult,
|
||||
FilePermissionContext,
|
||||
GitPermissionContext,
|
||||
WebPermissionContext,
|
||||
} from './permission/index.js';
|
||||
|
||||
// LSP
|
||||
export { initLSP, shutdownLSP } from './lsp/index.js';
|
||||
|
||||
Reference in New Issue
Block a user