feat(web): workspaces, connect and status pages plus the full chat experience

- workspaces list + new-workspace flow (add -> ensure -> navigate), server context bar
- connect: manual/pair-code redeem, QR scan with paste fallback, paired summary, disconnect
- status: info/health/resources/models/devices/connection cards with 3s visible-only polling
- chat: 3/2/1-column layout, session tree, virtualized stream, tool/thinking/todo/batch blocks,
  composer with queue chips and abort, subagents/todo/tasks panel, attention + diff review modals,
  history pagination merged with live entries
- canonical reducer reused via @protocol alias (no duplicated types)
- 63 vitest tests, typecheck + build green, zh/en parity at 411 keys
This commit is contained in:
yuez committed 2026-10-21 13:32:34 +08:00
1 parent 2e5d6d5006
commit 721661177c
61 files changed
+10931 -355

No files matched your search

+50
View File
@@ -14,7 +14,9 @@
"chat.attachNote": "Attachments are sent with the next message to pi2 (prototype demo only).",
"chat.attachTitle": "Add attachment",
"chat.attachmentAdded": "Added attachment {name}",
"chat.attachmentFailed": "Could not read attachment: {name}",
"chat.attentionQuestion": "Subagent requests confirmation: allow running ",
"chat.attentionResolvedOther": "Resolved by another client",
"chat.attentionTimedOut": "Request timed out and was auto-denied",
"chat.attentionTimeout": "Auto-deny on timeout · ",
"chat.attentionTitle": "Needs your attention · Extension request",
@@ -32,10 +34,14 @@
"chat.collapse": "Collapse",
"chat.collapseTree": "Collapse / expand session tree",
"chat.command": "Command",
"chat.commandFailed": "Action failed: {error}",
"chat.composerAria": "Message input",
"chat.composerPlaceholder": "Message pi2…",
"chat.currentSubagents": "Subagents in this session · {n}",
"chat.denied": "Request denied",
"chat.deny": "Deny",
"chat.details": "Arguments",
"chat.diffReview": "Review changes",
"chat.dispatch": "Dispatch",
"chat.dispatchTitle": "Dispatch subagent",
"chat.dispatched": "Dispatched subagent {name}",
@@ -45,7 +51,12 @@
"chat.emptyText": "Start a conversation below",
"chat.emptyTitle": "No messages yet",
"chat.error": "Error",
"chat.fold": "Collapse",
"chat.historyError": "Failed to load history",
"chat.latest": "↓ Latest",
"chat.loadOlder": "Load older messages",
"chat.loading": "Loading…",
"chat.loadingOlder": "Loading older messages…",
"chat.mockReply": "Got it, I'll take care of it.",
"chat.model": "Model",
"chat.modelLabel": "Model",
@@ -55,15 +66,22 @@
"chat.nameLabel": "Name",
"chat.nameRequired": "Name is required",
"chat.newSession": "New session",
"chat.newSessionCreated": "New session created",
"chat.newSessionDemo": "New session demo: created session 01a16a2f",
"chat.newSessionFailed": "Could not create a session: {error}",
"chat.noChanges": "No changes",
"chat.noMatch": "No matching sessions",
"chat.noOutput": "(no output)",
"chat.noSessions": "No sessions yet",
"chat.noSessionsText": "Create a session in this workspace to start chatting.",
"chat.noSubagents": "No subagents yet",
"chat.noSubagentsText": "Use \"+ Dispatch\" to hand a task to a subagent",
"chat.noTasks": "No background tasks",
"chat.noTasksText": "Background commands run by the agent appear here",
"chat.noTodo": "No todos yet · maintained by the agent",
"chat.noTodoText": "The agent will maintain the task breakdown here",
"chat.offlineHint": "Connection lost, reconnecting…",
"chat.output": "Output",
"chat.panel": "Panel",
"chat.parentSession": "Parent session",
"chat.pending": "{n} pending",
@@ -79,7 +97,9 @@
"chat.progress": "Progress {done}/{total}",
"chat.queueRemoved": "Queued message removed",
"chat.reject": "Reject",
"chat.rejectAll": "Reject all",
"chat.rejected": "Rejected changes: {path}",
"chat.removeAttachment": "Remove attachment",
"chat.removeQueued": "Remove queued message",
"chat.rename": "Rename",
"chat.renameSession": "Rename session",
@@ -87,11 +107,15 @@
"chat.renameSubagentAria": "Rename subagent",
"chat.renameSubagentHint": "Local display only; the subagent process is unchanged.",
"chat.renamed": "Renamed: {name}",
"chat.resizePanel": "Resize side panel",
"chat.resizeTree": "Resize session tree",
"chat.returnedParent": "Returned to parent session: {name}",
"chat.search": "Search sessions…",
"chat.searchAria": "Search sessions",
"chat.send": "Send",
"chat.sendFailed": "Send failed: {error}",
"chat.sendTitle": "Send (Enter)",
"chat.sending": "Sending…",
"chat.sessions": "Sessions",
"chat.source": "Source: {name}",
"chat.status": "Status",
@@ -129,8 +153,11 @@
"chat.top": "↑ Top",
"chat.treeAria": "Session tree",
"chat.tryOther": "Try another keyword",
"chat.unfold": "Expand",
"chat.unpairedHint": "Not paired. Connect to your server first.",
"chat.viewSubagent": "View subagent {name}",
"chat.waitLabel": "Wait for the subagent to finish (wait)",
"chat.workspace": "Workspace",
"chat.workspaceCrumb": "Workspace",
"chat.you": "You",
"common.add": "Add",
@@ -141,6 +168,7 @@
"common.copy": "Copy {label}",
"common.copyFailed": "Copy failed. Select the text manually.",
"common.delete": "Delete",
"common.loading": "Loading…",
"common.manage": "Manage",
"common.open": "Open",
"common.optional": "Optional",
@@ -161,6 +189,7 @@
"connect.connect": "Connect",
"connect.connected": "Connected: {name}",
"connect.connecting": "Connecting…",
"connect.defaultDeviceName": "Web console",
"connect.demoScan": "Demo: simulate scan",
"connect.device": "Device",
"connect.deviceName": "Device name",
@@ -184,6 +213,7 @@
"connect.name": "Name",
"connect.noAutoDetect": "Camera is on. This browser cannot decode QR codes automatically; paste the pairing link.",
"connect.notPairQr": "Not a pi2 pairing QR code. Try another.",
"connect.pairFailed": "Pairing failed. Check the pairing code or link.",
"connect.pairHint": "Scan the pairing QR code shown by the pi2 server; you will confirm before connecting.",
"connect.pairingLink": "Pairing link",
"connect.pastePlaceholder": "Paste a pi2://pair?… pairing link",
@@ -283,9 +313,12 @@
"status.fail": "Fail",
"status.health": "Health checks",
"status.healthy": "Healthy",
"status.instances": "Instances",
"status.kernel": "Kernel",
"status.lastActive": "Last active",
"status.lastConnected": "Last connected",
"status.lastHeartbeat": "Last heartbeat",
"status.liveSessions": "Live sessions",
"status.local": "Local",
"status.localAddress": "Local address",
"status.mdns": "mDNS name",
@@ -301,6 +334,8 @@
"status.noHealthTitle": "No health data yet",
"status.noModelsText": "Try another keyword or clear the search.",
"status.noModelsTitle": "No matching models",
"status.noResourcesText": "Waiting for the server to report resource usage.",
"status.noResourcesTitle": "No resource data yet",
"status.noTasksText": "Long-running commands from chats appear here.",
"status.noTasksTitle": "No background tasks",
"status.notConnectedText": "Pair your pi2 server on the connect page first.",
@@ -310,12 +345,16 @@
"status.pass": "Pass",
"status.piVersion": "PI version",
"status.pluginVersion": "Plugin version",
"status.port": "Port",
"status.qrAria": "Pairing QR code",
"status.reasoning": "reasoning",
"status.resourceWarn": "Memory is close to the soft limit; new instances may start slowly.",
"status.resources": "Resources",
"status.revoke": "Revoke",
"status.revokeText": "Revoke access for \"{name}\"? The phone's next request will fail.",
"status.revokeTitle": "Revoke device",
"status.revoked": "Revoked \"{name}\"",
"status.scoped": "scoped",
"status.securityExpiry": "Pairing code expires in {n} minutes",
"status.securityLocal": "Listens on 127.0.0.1 by default; bind a network address for cross-device access.",
"status.securityToken": "Every request requires a token; revoking a device invalidates it immediately.",
@@ -334,10 +373,12 @@
"time.justNow": "just now",
"time.minutesAgo": "{n}m ago",
"workspaces.activeRecently": "Active in the last hour",
"workspaces.addFailed": "Could not open the workspace. Check that the path is accessible.",
"workspaces.contextAria": "Current server",
"workspaces.count": "{n} workspaces",
"workspaces.count.one": "{n} workspace",
"workspaces.count.other": "{n} workspaces",
"workspaces.creating": "Opening…",
"workspaces.crumb": "Console",
"workspaces.cwdAria": "Working directory path",
"workspaces.defaultNamePlaceholder": "Defaults to the last path segment",
@@ -346,6 +387,15 @@
"workspaces.emptyTitle": "No workspaces yet",
"workspaces.enter": "Enter →",
"workspaces.idle": "Idle",
"workspaces.instanceDegraded": "Instance degraded",
"workspaces.instanceMissing": "Working directory is missing",
"workspaces.instanceReady": "Instance ready",
"workspaces.instanceStarting": "Instance starting",
"workspaces.instanceStopped": "Instance stopped",
"workspaces.instanceStopping": "Instance stopping",
"workspaces.instanceUnmanaged": "Instance unmanaged",
"workspaces.loadErrorText": "Could not load workspaces. Check the server connection and retry.",
"workspaces.loadErrorTitle": "Could not load workspaces",
"workspaces.nameHint": "Optional; defaults to the last path segment",
"workspaces.new": "Open new workspace",
"workspaces.newTitle": "Open new workspace",
+50
View File
@@ -14,7 +14,9 @@
"chat.attachNote": "附件会随下一条消息发送给 pi2(原型仅为交互演示)。",
"chat.attachTitle": "添加附件",
"chat.attachmentAdded": "已添加附件 {name}",
"chat.attachmentFailed": "附件读取失败:{name}",
"chat.attentionQuestion": "子代理请求确认:允许执行 ",
"chat.attentionResolvedOther": "该请求已由其他客户端处理",
"chat.attentionTimedOut": "请求超时,已自动拒绝",
"chat.attentionTimeout": "超时后自动拒绝 · 剩余 ",
"chat.attentionTitle": "需要你的注意 · 扩展请求",
@@ -32,10 +34,14 @@
"chat.collapse": "收起",
"chat.collapseTree": "收起 / 展开 session 树",
"chat.command": "命令",
"chat.commandFailed": "操作失败:{error}",
"chat.composerAria": "输入消息",
"chat.composerPlaceholder": "给 pi2 发消息…",
"chat.currentSubagents": "当前 session 的子代理 · {n}",
"chat.denied": "已拒绝该请求",
"chat.deny": "拒绝",
"chat.details": "参数详情",
"chat.diffReview": "变更审查",
"chat.dispatch": "派发",
"chat.dispatchTitle": "派发子代理",
"chat.dispatched": "已派发子代理 {name}",
@@ -45,7 +51,12 @@
"chat.emptyText": "在输入框里开始对话吧",
"chat.emptyTitle": "还没有消息",
"chat.error": "错误",
"chat.fold": "折叠",
"chat.historyError": "历史记录加载失败",
"chat.latest": "↓ 回到最新",
"chat.loadOlder": "加载更早的消息",
"chat.loading": "加载中…",
"chat.loadingOlder": "正在加载更早的消息…",
"chat.mockReply": "收到,我来处理。",
"chat.model": "模型",
"chat.modelLabel": "模型 model",
@@ -55,15 +66,22 @@
"chat.nameLabel": "名称 name",
"chat.nameRequired": "名称不能为空",
"chat.newSession": "新 session",
"chat.newSessionCreated": "已创建新 session",
"chat.newSessionDemo": "新建 session 演示:已创建 session 01a16a2f",
"chat.newSessionFailed": "新建 session 失败:{error}",
"chat.noChanges": "没有变更",
"chat.noMatch": "没有匹配的 session",
"chat.noOutput": "(无输出)",
"chat.noSessions": "还没有 session",
"chat.noSessionsText": "在当前工作空间创建一个 session 开始对话。",
"chat.noSubagents": "暂无子代理",
"chat.noSubagentsText": "点击「+ 派发」把任务交给子代理",
"chat.noTasks": "暂无后台任务",
"chat.noTasksText": "agent 执行的后台命令会出现在这里",
"chat.noTodo": "暂无 todo · 由 agent 维护",
"chat.noTodoText": "agent 会在这里维护当前任务的拆解",
"chat.offlineHint": "连接已断开,正在重连…",
"chat.output": "输出",
"chat.panel": "面板",
"chat.parentSession": "父会话",
"chat.pending": "{n} 待处理",
@@ -79,7 +97,9 @@
"chat.progress": "进度 {done}/{total}",
"chat.queueRemoved": "已删除排队消息",
"chat.reject": "拒绝",
"chat.rejectAll": "全部拒绝",
"chat.rejected": "已拒绝变更:{path}",
"chat.removeAttachment": "移除附件",
"chat.removeQueued": "删除排队消息",
"chat.rename": "重命名",
"chat.renameSession": "重命名 session",
@@ -87,11 +107,15 @@
"chat.renameSubagentAria": "重命名子代理",
"chat.renameSubagentHint": "仅影响本地显示,不会改变子代理进程。",
"chat.renamed": "已重命名:{name}",
"chat.resizePanel": "调整右面板宽度",
"chat.resizeTree": "调整 session 树宽度",
"chat.returnedParent": "已返回父会话:{name}",
"chat.search": "搜索 session…",
"chat.searchAria": "搜索 session",
"chat.send": "发送",
"chat.sendFailed": "发送失败:{error}",
"chat.sendTitle": "发送(Enter)",
"chat.sending": "发送中…",
"chat.sessions": "会话",
"chat.source": "来源:{name}",
"chat.status": "状态",
@@ -129,8 +153,11 @@
"chat.top": "↑ 顶部",
"chat.treeAria": "session 树",
"chat.tryOther": "试试其他关键字",
"chat.unfold": "展开",
"chat.unpairedHint": "未连接服务器,请先配对。",
"chat.viewSubagent": "查看子代理 {name}",
"chat.waitLabel": "等待子代理完成(wait)",
"chat.workspace": "工作空间",
"chat.workspaceCrumb": "工作空间",
"chat.you": "你",
"common.add": "添加",
@@ -141,6 +168,7 @@
"common.copy": "复制{label}",
"common.copyFailed": "复制失败,请手动选择文本",
"common.delete": "删除",
"common.loading": "加载中…",
"common.manage": "管理",
"common.open": "打开",
"common.optional": "可选",
@@ -161,6 +189,7 @@
"connect.connect": "连接",
"connect.connected": "已连接:{name}",
"connect.connecting": "正在连接…",
"connect.defaultDeviceName": "Web 控制台",
"connect.demoScan": "演示:模拟扫码",
"connect.device": "设备",
"connect.deviceName": "设备名",
@@ -184,6 +213,7 @@
"connect.name": "名称",
"connect.noAutoDetect": "摄像头已开启。当前浏览器不支持自动识别,请粘贴配对链接。",
"connect.notPairQr": "这不是 pi2 配对二维码,请换一个",
"connect.pairFailed": "配对失败,请检查配对码或链接",
"connect.pairHint": "扫描 pi2 服务器显示的配对二维码,识别后需二次确认。",
"connect.pairingLink": "配对链接",
"connect.pastePlaceholder": "粘贴 pi2://pair?… 配对链接",
@@ -283,9 +313,12 @@
"status.fail": "失败",
"status.health": "健康检查",
"status.healthy": "健康",
"status.instances": "实例数",
"status.kernel": "内核",
"status.lastActive": "最后活跃",
"status.lastConnected": "最后连接",
"status.lastHeartbeat": "最后心跳",
"status.liveSessions": "在线会话",
"status.local": "Local",
"status.localAddress": "Local 地址",
"status.mdns": "mDNS 名",
@@ -301,6 +334,8 @@
"status.noHealthTitle": "暂无健康数据",
"status.noModelsText": "换一个关键词,或清空搜索。",
"status.noModelsTitle": "没有匹配的模型",
"status.noResourcesText": "等待服务器上报资源数据。",
"status.noResourcesTitle": "暂无资源数据",
"status.noTasksText": "在对话中运行的长命令会出现在这里。",
"status.noTasksTitle": "没有后台任务",
"status.notConnectedText": "请先在连接页配对 pi2 服务器。",
@@ -310,12 +345,16 @@
"status.pass": "通过",
"status.piVersion": "PI 版本",
"status.pluginVersion": "插件版本",
"status.port": "端口",
"status.qrAria": "配对二维码",
"status.reasoning": "推理",
"status.resourceWarn": "内存占用接近软上限,新的实例可能被延迟启动。",
"status.resources": "资源占用",
"status.revoke": "撤销",
"status.revokeText": "将撤销「{name}」的访问权限,手机端下次请求将失效。",
"status.revokeTitle": "撤销设备",
"status.revoked": "已撤销「{name}」",
"status.scoped": "受限",
"status.securityExpiry": "配对码 {n} 分钟后过期",
"status.securityLocal": "默认仅监听 127.0.0.1,跨设备访问需显式绑定网络地址",
"status.securityToken": "所有请求均需 Token 鉴权,撤销设备后立即失效",
@@ -334,10 +373,12 @@
"time.justNow": "刚刚",
"time.minutesAgo": "{n} 分钟前",
"workspaces.activeRecently": "最近 1 小时有活动",
"workspaces.addFailed": "打开工作空间失败,请检查路径是否可访问",
"workspaces.contextAria": "当前服务器",
"workspaces.count": "{n} 个工作空间",
"workspaces.count.one": "{n} 个工作空间",
"workspaces.count.other": "{n} 个工作空间",
"workspaces.creating": "正在打开…",
"workspaces.crumb": "控制台",
"workspaces.cwdAria": "工作目录路径",
"workspaces.defaultNamePlaceholder": "默认取路径末段",
@@ -346,6 +387,15 @@
"workspaces.emptyTitle": "还没有工作空间",
"workspaces.enter": "进入 →",
"workspaces.idle": "空闲",
"workspaces.instanceDegraded": "实例降级",
"workspaces.instanceMissing": "工作目录不存在",
"workspaces.instanceReady": "实例已就绪",
"workspaces.instanceStarting": "实例正在启动",
"workspaces.instanceStopped": "实例已停止",
"workspaces.instanceStopping": "实例正在停止",
"workspaces.instanceUnmanaged": "实例未托管",
"workspaces.loadErrorText": "无法加载工作空间列表,请检查服务器连接后重试。",
"workspaces.loadErrorTitle": "加载工作空间失败",
"workspaces.nameHint": "可选,留空则取路径末段",
"workspaces.new": "打开新工作空间",
"workspaces.newTitle": "打开新工作空间",