-
Notifications
You must be signed in to change notification settings - Fork 1
增加 Pixelle CLI 权限状态与危险操作确认展示 #30
Copy link
Copy link
Open
Labels
cliCLI experience and terminal interfaceCLI experience and terminal interfacefeatureNew feature or capabilityNew feature or capabilitysecuritySecurity and permission boundariesSecurity and permission boundariesuxUser experience improvementsUser experience improvements
Description
Metadata
Metadata
Assignees
Labels
cliCLI experience and terminal interfaceCLI experience and terminal interfacefeatureNew feature or capabilityNew feature or capabilitysecuritySecurity and permission boundariesSecurity and permission boundariesuxUser experience improvementsUser experience improvements
背景
Agent CLI 的信任感很大程度来自权限边界。当前本地 CLI 的 ask 模式默认
writeFile/shell/network=false,/edit会用文字询问是否允许文件修改,但这个确认只是普通 assistant notice。用户无法从界面上持续看到当前请求具备哪些权限,也无法区分文件修改、shell、网络请求等能力的风险级别。如果后续 CLI 增加更多工具能力,缺少统一权限展示会让用户难以判断 agent 是否正在做高风险操作。
目标
让用户在执行危险操作前看到明确、统一的权限提示,并能理解当前请求允许哪些能力、不允许哪些能力。先聚焦
/edit文件修改授权和权限状态展示,不把 shell/network approval 做成大系统。当前问题
src/cli/local/run-local-cli.ts中/edit通过文本提示 “Type y to continue”,没有专门 approval prompt/card。WelcomeScreen和StatusBar不展示当前权限。CommandHelp只说明/edit <request>allow file changes,没有强调 shell/network 默认关闭。工具卡片也没有风险 badge。参考体验
参考现代 Agent CLI 的 approval flow:危险能力有明确确认 UI,权限范围被突出展示,用户知道这次授权是一次性的还是持久的,取消后也能看到明确反馈。
改动方向
新增权限状态组件和 approval card。
/editpending 状态应进入 CLI state,由 timeline 渲染结构化确认卡片,而不是只存在pendingEdit变量和普通文本消息中。可能涉及模块
src/cli/local/run-local-cli.tssrc/cli/components/chrome/WelcomeScreen.tsxsrc/cli/components/chrome/CommandHelp.tsxsrc/cli/components/timeline/ToolStatus.tsxsrc/cli/state/cli-state.tssrc/cli/types.tssrc/cli/utils/theme.ts大致实现方案
PermissionSummary展示 read/write/shell/network 状态ApprovalPromptCard替代/edit的纯文本 notice/help文案说明 ask/edit 模式权限差异任务清单
/edit确认提示改成结构化 approval card/help文案说明权限模型验收标准
/edit后看到专门确认卡片建议标签
cli、ux、feature、security