Compare commits

...
60 Commits
Author SHA1 Message Date
mesalogo fb5a9c6f43 test: allow bounded knowledge snapshot writes
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
The complete-snapshot boundary test performs 501 synchronous SQLite source and document writes. It passed functionally but could exceed its 10-second case timeout on the serial Linux CI runner, so give this I/O-heavy case a bounded 30-second allowance without changing product behavior or global test limits.
2026-09-03 06:00:16 +08:00
mesalogo 26b87d7ed5 test: use the installed OpenCode entrypoint
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The Linux routing test still referenced the obsolete bin/opencode name. With intentional path-only Runtime selection, that stale fixture was no longer masked by automatic discovery; use the locked opencode-ai 1.18.9 bin/opencode.exe entrypoint on every platform.

Keep the approved 0.12.0 notes and bilingual feature matrices explicit that local OpenCode paths are not prevalidated and fail only at actual launch.
2026-09-03 05:37:52 +08:00
mesalogo 93721d69b6 test: serialize full-suite validation
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The Linux release validator still exhausted process and socket timing with two Vitest workers, causing unrelated OpenCode and private-endpoint tests to fail. Run test files with one worker so process-backed integration tests remain deterministic within the existing CI job budget.
2026-09-02 23:19:48 +08:00
mesalogo 8ecd87381f test: stabilize 0.12.0 candidate validation
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Full-suite resource contention could make asynchronous renderer assertions and short runtime timing tests fail even though focused runs passed. Limit Vitest to two workers and give the affected UI operations the existing three-second async window.

Also include the approved Linux ARM OpenCode startup note in both feature matrices and release-note languages, and record the successful isolated Linux x64 Host validation of the current-source Runtime activation path.
2026-09-02 22:57:31 +08:00
mesalogo dc36e7a967 fix: skip repeated OpenCode binary validation
OpenCode startup on Linux ARM could run a --version probe before launching the configured Runtime and recheck registered remote binary metadata. Execution now trusts the selected path and registered manifest identity after setup-time verification, so switching and cold launch avoid duplicate binary work.

Release note: 优化 Linux ARM 上切换 OpenCode 的启动速度;已安装或已登记的 Runtime 在执行时不再重复启动或检查二进制。
2026-09-02 22:41:50 +08:00
mesalogo cdecb584d5 test: wait for settings before appearance assertions
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The Linux CI run could query the Appearance tab before the lazy Settings route finished loading. Appearance tests now wait for the Settings heading before interacting with its tabs, matching the stable navigation pattern used elsewhere.
2026-09-02 21:47:18 +08:00
mesalogo c4231c8f9c chore: prepare GoodBuddy 0.12.0 release
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Update the desktop version, approved bilingual release notes, and synchronized English and Chinese feature matrices for the 0.12.0 candidate.

Release preparation now runs local tests, type checks, and lint without a local production build, then requires the main-branch CI build before tagging. The package matrix uses a native Windows arm64 runner and validates managed Python on every target without adding extra license files to the desktop package.
2026-09-02 21:36:27 +08:00
mesalogo 8a14cf356a fix: hide unverified capability placeholders
The tool environment page always displayed an unverified capability-dependency state even though it had no Skill or MCP evidence behind it. The page now shows only actual interpreter and companion-tool diagnostics; capability dependency status remains reserved for capability details with real validation results.

Release note: 工具执行环境页不再显示没有实际验证依据的能力依赖占位状态。
2026-09-02 17:00:42 +08:00
mesalogo 19a3bafb63 docs: prevent dead-end selection flows
Document that options requiring an in-place prerequisite must remain operable, defer persistence until validation succeeds, avoid implicit first-candidate selection, preserve the previous value on cancellation, and show errors beside the action.
2026-09-02 16:47:24 +08:00
mesalogo 5fac1d3c41 fix: align DeepSeek Harness model selection
DeepSeek Harness previously required a separate Runtime model selection when no administrator-provided connection was available, even if the user had already selected a compatible GoodBuddy model. It now prefers the administrator connection, then follows the compatible default model or first compatible connection across conversations, projects, and messaging channels.

Release note: 修复 DeepSeek Harness 未自动使用已选兼容模型的问题;没有管理员预置连接时,现在会跟随当前默认或首个兼容模型,无需再到 Harness 页面重复指定。
2026-09-02 16:45:42 +08:00
mesalogo 42cbfa43f1 feat: add copy action to AI responses
Completed AI responses now expose a bottom copy action that copies their Markdown source without reasoning, tool logs, or citation metadata. Clipboard writes use a validated Preload/Main bridge so sandboxed Electron sessions no longer fail with a renderer clipboard permission error; full-conversation copy uses the same path.

Release note: AI 回复底部现在可以直接复制 Markdown 原文,并修复了沙箱环境下回复和完整会话可能无法写入剪贴板的问题。
2026-09-02 16:35:51 +08:00
mesalogo 4d9ab72778 fix: keep custom tool environments selectable
The custom Node.js and Python choices could appear unavailable until a candidate was already discovered, and selecting the source implicitly adopted the first candidate. The chooser now stays operable, waits for an explicit validated path, keeps cancellation quiet, and shows validation errors beside the affected runtime.

Candidate discovery now prioritizes active virtual environments and Conda before bounded user/system PATH and common Node/Python locations, while preserving canonical validation and deduplication.

Release note: 修复自定义 Node.js/Python 环境入口不可用的问题,并增加对 PATH、venv、Conda 和常见安装位置的解释器检测。
2026-09-02 16:29:55 +08:00
mesalogo be39665ca9 feat: add managed local tool environments
GoodBuddy can now provide managed Node.js and on-demand Python to local Skills and stdio MCP servers, or validate an explicitly selected custom interpreter. The Capabilities and tools settings page exposes source selection, diagnostics, installation progress, cancellation, and removal while new processes receive immutable PATH snapshots.

Application settings migrate to v10. Local terminal and remote Host environments remain unchanged. Windows x64 native-source Node and Python paths are validated; OSS mirror publication, redistributed license resources, and the remaining native platform probes are recorded as release blockers.

Release note: 新增工具执行环境,可为本机 Skills 和 stdio MCP 使用 GoodBuddy 托管的 Node.js、按需安装的 Python,或经过验证的自定义解释器。
2026-09-02 10:36:56 +08:00
mesalogo 1530fa116c fix: make product copy direct and factual
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
The website, README, and Smart Heartbeat interface used promotional superlatives, generic benefit labels, and personified growth language that obscured the actual product behavior. The English README is now the repository entry point with a separate Chinese version, and both website and in-app copy describe concrete capabilities, reports, suggestions, and execution boundaries.

Release note: 优化官网、README 与智能心跳界面的中英文文案,去除空泛宣传和拟人化表达,改为直接说明产品能力、运行记录与建议内容。
2026-09-02 01:14:16 +08:00
mesalogo b36d688900 feat: add direct model programming agents
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Direct model conversations can now execute bounded platform-native processes and delegate one level of programming work without duplicating tools in Agent Runtimes. Process and Subagent activity follows existing workspace, mode, approval, cancellation, and lifecycle boundaries, with chat attribution and complete feature documentation.

Remove the static Renderer bundle baseline gate and its build-only manifests; production builds continue to compile all processes and verify the control-plane installer. Also include the pending documentation link normalization.

Release note: 直连模型现在可在 Execute 模式运行本机命令,并可委派编程 Subagent 完成修改、测试和复核;构建流程不再因静态 Renderer 包体基线阻塞。
2026-09-02 00:50:54 +08:00
mesalogo d36889d9f6 fix: quiet resolved dependency reference logs
electron-builder listed shared, successfully resolved production dependencies as duplicate references during every package build. All desktop packaging entry points now lower only that non-actionable summary to debug while unresolved reference failures remain visible.

Move Renderer-bundled AntV G6 to development dependencies so its transitive graph is not copied into desktop packages.

Release note: 桌面打包不再显示无需处理的重复依赖引用摘要,也不再把已由 Renderer 打包的 AntV G6 依赖树重复复制到安装包中。
2026-09-02 00:45:15 +08:00
mesalogo 06c1123caa fix: focus built-in skill defaults
The Skills catalog exposed nine product-marketing recipes as independent
capabilities and enabled every marketing package for every Runtime by default.
It now keeps five top-level Skills, loads the nine recipes on demand through
the product-marketing package, and leaves the three marketing Skills disabled
until users enable them. Existing saved Skill settings remain authoritative.

Release note: 内置 Skills 已从 14 个顶层入口精简为 5 个;去 AI 味和长文工具默认启用,产品营销类默认停用,已保存的用户设置保持不变。
2026-09-02 00:44:44 +08:00
mesalogo 4f3e0bdcfd fix: unify capability settings navigation
Skills and MCP previously occupied separate top-level settings categories. They now share one Capabilities and tools category with accessible horizontal tabs, while the unimplemented tool environment remains hidden until its settings are usable.

Prevent nested PageTabs wrappers from collapsing to zero height in scrollable Flex layouts, add a CSS regression guard, and document the shared rule plus the planned local Node.js and Python environment.

Release note: 设置中心将 Skills 和 MCP 合并到“能力与工具”,并修复水平页签可能被压缩而不可见的问题;尚未实现的工具执行环境暂不显示。
2026-09-02 00:28:47 +08:00
mesalogo 2fca39ddb2 feat: expand deai writing checks
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The bundled deai-writing skill now detects additional template patterns,
unsupported attribution, role-slot prose, engineering metaphors, and absolute
claims. Its JSON report also summarizes findings by level and category while
preserving GoodBuddy's cross-platform Python guidance.

Release note: 中文“去 AI 味”审校新增分析套话、模糊归因、角色槽位、工程黑话和绝对化承诺等检查,并提供按分类汇总的扫描结果。
2026-09-01 20:48:58 +08:00
mesalogo 2f1881a414 docs: organize product design by feature
Define repository and feature-scoped documentation rules for PRDs, User Stories, logic, UI, technical design, and progress evidence.

Move feature-owned documents under docs/features, add one entry point per feature, remove the redundant docs index, and update all affected cross-references. Expand the local tool environment design with explicit product, story, logic, UI, technical, and progress documents.
2026-09-01 14:52:22 +08:00
mesalogo dba3380a06 fix: accept bare browser addresses
The Browser workbar required users to enter a complete HTTP(S) URL, so submitting a bare domain or host with a port failed URL validation. Enter and Go now prepend http:// before using the existing browser navigation path.

Explicit protocols remain unchanged so the Main browser URL policy continues to reject unsupported schemes with the correct error.

Release note: 浏览器地址栏现在支持直接输入域名或主机端口,回车或点击“前往”时会自动补全 http://。
2026-09-01 08:54:18 +08:00
mesalogo 77ce13aba3 fix: align the primary sidebar divider
The primary sidebar resize hit target still reserved four pixels in the flex row, leaving a visible gap between the divider and the content frame. Its opposing negative margins now keep the nine-pixel pointer target layout-neutral while preserving the aligned one-pixel divider.

Release note: 修复主侧栏拖拽分隔线与内容边缘未对齐的问题。
2026-09-01 08:37:05 +08:00
mesalogo 5127f7d045 feat: add browser workbar navigation controls
The Browser workbar previously showed the Agent-controlled page but did not let users navigate it directly. It now provides Back, Refresh or Stop Loading, an address field, and Go alongside the existing interaction and close actions.

User and Agent operations share the same per-conversation browser session and serialization path. Loading, committed URL, and history state keep the toolbar accurate, while Stop Loading interrupts page navigation without closing the session or releasing Runtime context.

Direct navigation continues to use the existing built-in-browser capability and URL policy. Closing the browser remains a distinct lifecycle action.

Release note: 浏览器工作栏新增返回、刷新/停止加载、地址栏和前往操作;用户与 Agent 共用同一浏览器会话,停止加载不会关闭会话。
2026-09-01 08:26:57 +08:00
mesalogo 27055693bf feat: add multi-terminal workbar and resizable sidebars
The assistant workbar now uses persistent application tabs with a permanent catalog entry point and supports multiple local or managed SSH terminals bound to the current project. Terminal sessions flow through the Main, preload, and renderer boundaries with bounded output, resize, lifecycle, and cleanup behavior.

The main sidebar and Magic Notes list now support pointer and keyboard resizing. Magic Notes can also hide and restore its list, remembers the chosen layout, and stacks its panes when the available width is narrow.

Closing a terminal tab ends its Shell session. Restored terminal tabs do not restart prior Shell processes and require an explicit reconnect.

Release note: 助手工作栏现可通过“+”打开多个本机或当前远程项目终端;主侧栏和魔法笔记列表支持拖拽调宽,魔法笔记列表可隐藏并记住布局。
2026-09-01 00:49:49 +08:00
mesalogo 73cc55bf75 fix: clarify local tools on remote hosts
The remote host settings page did not explain that locally configured Skills and MCP servers stay on the desktop. It now states that boundary in Chinese and English, with a focused UI regression test.

Document the planned local Node.js and Python environment for local Skills and stdio MCP servers, including managed and custom sources, compatibility migration, lifecycle, remote boundaries, and acceptance criteria.

Release note: 远程主机设置现在明确说明本机 Skills 和 MCP 不会作用于远程主机。
2026-08-31 23:28:41 +08:00
mesalogo 00a231da07 chore: prepare GoodBuddy 0.11.14 releases
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Set the Desktop package metadata and approved bilingual notes to 0.11.14,
aligned with the coordinated Agent 0.11.14 lock and release-status docs. This
candidate uses the standard x64/arm64 release matrices and does not include an
experimental LoongArch preview.

Release note: 准备 GoodBuddy Desktop 与 Agent 0.11.14 正式发布,包含托管 SSH 任务恢复、有界诊断和桌面反馈改进。
2026-08-31 16:02:53 +08:00
mesalogo 2833a27f83 feat: add bounded diagnostics and improve UX feedback
Ask and Execute guidance, Runtime state, live announcements, loading states,
retry paths, settings focus, and update failures now provide consistent and
accessible feedback across the desktop experience.

Add bounded redacted Desktop and Agent diagnostic logs, a read-only Agent
diagnostics command, and an explicit opt-in for attaching a small Desktop
diagnostic summary to in-app feedback. Diagnostics stay local by default and
the existing feedback v1 service contract remains compatible.

Release note: 新增可选桌面诊断反馈与 Agent 诊断导出,并统一 Ask/Execute 状态、错误恢复和无障碍反馈;诊断默认保留在本地,仅在用户明确勾选时附加桌面摘要。
2026-08-31 15:35:13 +08:00
mesalogo b1729125e1 fix: allow slower OpenCode startup on Linux ARM
OpenCode health polling restored a ten-second startup limit, causing Linux ARM systems and QEMU environments that became healthy just after that boundary to be reported unavailable. Managed local OpenCode now retains health-based readiness detection while allowing up to thirty seconds for startup.

Release note: 修复部分 Linux ARM 设备切换 OpenCode 时因启动超过 10 秒而误报超时的问题;健康检查现在最多等待 30 秒。
2026-08-31 13:25:49 +08:00
mesalogo 561de29f00 feat: keep managed SSH prompts running on Hosts
Managed SSH prompts previously depended on Desktop-owned provider and transcript state, so accepted work could stop or become uncertain when the Desktop, network, or power disappeared. The Agent now owns accepted OpenCode prompt execution, model and tool rounds, cancellation, and the durable semantic transcript, while Desktop remains authoritative for permanent projects, conversations, tasks, and messages.

Recovered work attaches to the original conversation without replay. The project switcher also groups managed SSH projects by saved Host and shows live Agent connectivity beside each group without opening a connection merely to read status. Remote project subtitles now show only the path, and the Agent lock advances to 0.11.14 with Runtime ACP v4.

Release note: 托管 SSH 任务在桌面端、网络或电源中断后可继续在主机上运行,并能回到原会话精确恢复;项目菜单现按主机分组并显示实时连接状态。
2026-08-31 11:04:41 +08:00
mesalogo f6f8d5e053 fix: release runtime status probes after checks
Chat startup and Runtime switching previously cached status-only Runtime instances, leaving managed OpenCode servers running without active conversations. Status checks now resolve the selected or configured default Runtime through a disposable probe and release it immediately.

Project execution Runtimes remain cached by model selection and execution space, preserving parallel work across different projects.

Release note: 修复启动或切换 Runtime 后空闲 OpenCode 服务持续驻留的问题;状态检查完成后会立即回收,多个项目仍可并行执行。
2026-08-31 01:35:04 +08:00
mesalogo 8c580a9174 fix: preserve remote environment checks across settings pages
The Hosts settings page discarded the last successful Agent and Runtime version check whenever users switched categories or restarted GoodBuddy, forcing them to refresh the same Host again. Validated results now persist locally and remain visible until users refresh, edit or delete the Host, or start a remote environment update.

Release note: 远程主机的 Agent 和 Runtime 版本检查结果现在会在设置页面切换和应用重启后保留,无需重复点击刷新版本。
2026-08-31 01:07:52 +08:00
mesalogo efd304fa1d feat: support native subagents and long-running prompts
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
OpenCode Task calls now appear as first-class subagents in local and managed SSH conversations, with stable status, persistence, terminal handling, and true event ordering instead of duplicate generic tool entries.

GoodBuddy no longer applies a fixed outer wall-clock total to OpenCode, Continue, DeepSeek Harness, or managed SSH Prompts. Runtime-owned limits, user cancellation, bounded control operations, output limits, and released Agent protocol compatibility remain intact. Desktop and Agent release metadata are synchronized at 0.11.13 with approved bilingual notes.

Release note: OpenCode 原生 Task 现在以独立子 Agent 展示;长任务不再被 GoodBuddy 固定总时限中止,并修复 OpenCode 启动识别、可配置 HTTP 服务地址与发布说明读取问题。
2026-08-30 17:18:33 +08:00
mesalogo 7c6f15d3c0 fix: allow HTTP for configurable service endpoints
DeepSeek Harness and Weixin binding configuration rejected non-loopback HTTP endpoints even when users explicitly selected those internal services. Configurable endpoints now accept valid HTTP and HTTPS URLs without host-location restrictions, while retaining the required protocol and API-key checks.

Release note: 模型连接、DeepSeek Harness 与微信绑定现在可直接使用局域网或公网 HTTP/HTTPS 服务地址,不再强制公网 HTTPS 或本机回环地址。
2026-08-30 16:49:47 +08:00
mesalogo 6dc219f3a3 fix: detect OpenCode readiness by health
GoodBuddy previously treated one exact OpenCode stdout line as the startup signal, so harmless log formatting differences could report a timeout even when the server was already listening. It now polls the authenticated health endpoint on the loopback port that GoodBuddy selected, with bounded attempts and the original ten-second startup limit.

Release note: 修复 OpenCode 已启动但因监听日志格式未被识别而误报超时的问题;启动检测现在直接使用本机健康接口。
2026-08-30 15:30:43 +08:00
mesalogo acc5a8e2d8 fix: allow slower OpenCode server startup
The bundled OpenCode server could be reported unavailable when slower Linux ARM systems needed more than ten seconds to initialize. GoodBuddy now allows thirty seconds for startup before terminating the server and reports the updated timeout.

Release note: 修复部分 Linux ARM 设备上 OpenCode 冷启动较慢时被误报为启动超时的问题。
2026-08-30 14:42:18 +08:00
mesalogo 9f0f231e3b chore: prepare GoodBuddy 0.11.12 release
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
2026-08-30 11:08:55 +08:00
mesalogo 967796539f fix: recover remote conversations after uncertain prompts
An interrupted managed SSH prompt could leave its ACP binding as the permanent owner of the conversation, so every later user message failed with the same uncertain-recovery error. A later explicit prompt now retires that binding and starts a fresh ACP session without replaying the uncertain operation.

Ask-mode Runtime startup also waited on the wrong bubblewrap executable identity. The Agent now supervises the bounded transition to the signed Runtime or model-bridge executable, and the Agent version advances to 0.11.10.

Release note: 修复远程 ACP 请求中断后同一会话无法继续输入,以及 Ask 模式可能在模型调用前启动失败的问题。
2026-08-30 11:02:20 +08:00
mesalogo 8e08ab0bac feat: show Magic Notes update times
The Magic Notes list previously showed only each title, content preview, and
entry count, making similarly named or recently changed notes harder to scan.
Each note now shows its localized update time beside the entry count, with a
semantic timestamp and bounded single-line layout for the narrow list pane.

Release note: 魔法笔记左侧列表现在显示每篇笔记的本地化更新时间,便于快速找到最近修改的内容。
2026-08-30 10:09:39 +08:00
mesalogo edba31e873 chore: prepare GoodBuddy 0.11.11 release
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Bump the desktop package metadata to 0.11.11 and package the approved Simplified Chinese and English release notes for complete remote conversation saves and discoverable Magic Notes list shortcuts.

Release note: GoodBuddy 0.11.11 修复远程项目长工具结果的会话持久化,并补充魔法笔记列表快捷输入提示。
2026-08-30 09:33:58 +08:00
mesalogo 0804f5ccd2 fix: preserve complete remote tool details
Managed SSH Runtime events could complete successfully and then fail local conversation persistence when tool details exceeded a second, smaller renderer-to-Main schema limit. Conversation persistence now stores the complete tool details already accepted from the Runtime, so long remote results no longer leave the final assistant message stuck in a streaming state.

Release note: 修复远程项目工具结果较长时会话持久化失败的问题;Runtime 已返回的工具详情现在会完整保存到本地会话。
2026-08-30 09:29:28 +08:00
mesalogo 29639ff516 fix: surface Magic Notes list shortcuts
Magic Notes already accepted Quill's native bullet, numbered, and checklist
autofill, but the editor did not make those shortcuts discoverable or protect
them with behavior coverage. The composer now explains the supported markers
in both languages, and tests verify they continue producing Delta list formats.

Release note: 魔法笔记编辑区现在提示项目符号、编号和待办清单快捷输入;输入标记后按空格即可创建对应列表。
2026-08-30 09:20:27 +08:00
mesalogo 22c80b2d94 fix: align Linux Agent verifier regression
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The Linux source validator still expected the full verifier's old payload mode
message after entrypoint metadata checks moved ahead of the payload loop. The
test now asserts the actual bounded entrypoint error returned by the optimized
verifier.

The unpublished desktop 0.11.9 notes move to 0.11.10. The Agent lock remains
on the successfully published Agent 0.11.9, and the recovery release still has
no LoongArch preview.

Release note: GoodBuddy 0.11.10 延续已批准的 Host 更新修复;未发布的桌面 0.11.9 由新版本替代。
2026-08-29 23:01:46 +08:00
mesalogo 85e14ca626 fix: make Host updates simple and fast
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Host repair could fail while adopting the published OpenCode Runtime, then
repeat package and payload verification and carry durable metadata snapshots
for recovery. Host preparation now verifies each acquired compound archive
once, adopts signed Agent and Runtime metadata without rereading payload trees,
and retries failed work by cleaning staging and preparing fresh.

The desktop and Agent versions are advanced to 0.11.9 with the approved
bilingual release notes. Remote Projects remain a disabled-by-default technical
preview, Agent packages remain separate Linux x64/arm64 releases, and this
release has no LoongArch preview.

Release note: 修复 Host 更新采用失败,移除重复远端包体校验,并将中断恢复简化为清理暂存后重新准备。
2026-08-29 22:31:39 +08:00
mesalogo a99b90cc02 fix: make Host environment updates fast and recoverable
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
Published Host updates could fail while the desktop reverified Runtime against
its bundled lock and repeatedly traversed remote payloads. Host preparation now
verifies and extracts once, adopts Agent and Runtime on one pinned connection,
and uses registered metadata for normal health, capability, and prompt paths.
Interrupted commits and adoption retain bounded recovery and rollback state.

Desktop and Agent versions are 0.11.8. Remote Projects remain a technical
preview; the Agent targets Linux x64 and arm64, with no LoongArch preview.

Release note: 修复正式环境 Host 更新失败并移除重复远端包体扫描;中断恢复与清理失败不再破坏已健康环境。
2026-08-29 17:20:25 +08:00
mesalogo ff4fde282f chore: prepare GoodBuddy 0.11.7 release notes
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agent Release / Authorize Agent release (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux arm64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Build Linux x64 compound package (push) Canceled after 0s
GoodBuddy Agent Release / Sign cumulative Agent catalog (push) Canceled after 0s
GoodBuddy Agent Release / Publish Agent to GitHub and OSS (push) Canceled after 0s
Add the approved matching Chinese and English notes for the desktop 0.11.7
release and its separately published Agent 0.11.7 requirement. Remote Projects
remain a technical preview, and no LoongArch preview is included.
2026-08-29 14:03:52 +08:00
mesalogo f327341b00 fix: prevent duplicate queue replay and use cached Agents
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
An interrupted dispatch could leave the same user input both in conversation
history and in the pending queue, causing it to be sent again after restart.
Persisted user messages now retain their queue identity, startup recovery drops
only matching materialized inputs, and conversation branches discard that
ownership marker.

Explicit GoodBuddy transfer now leases a verified local Agent package when the
catalog is unavailable or the local version is at least as new, while a known
newer online package still wins. Prepare both the desktop and Agent locks for
0.11.7; the experimental LoongArch preview remains excluded.

Release note: 修复对话中断后同一条排队输入可能重复发送的问题;GoodBuddy 传输现在可复用已验证的本地 Agent 包,同时不会阻止已知的线上新版。
2026-08-29 13:31:56 +08:00
mesalogo 459cc21e3d fix: make managed SSH sessions fast and resilient
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Managed SSH project selection repeatedly activated the remote Host and could
leave idle ACP bindings rejected as stale-controller after a controller
generation change. Host environment updates also coupled project state to
component installation evidence and presented a crowded control surface.

Project selection is now local-only, one Host connection serves compatible
project and conversation callers, idle bindings are safely replaced only
after proven controller takeover, and active prompts keep exact resume/replay.
Remote environment setup now uses explicit signed compound package
preparation with bounded transfer, rollback, recovery, and clearer settings.

Managed Hosts must be updated to separately distributed Agent 0.11.6 before
the daemon-side controller recovery fix takes effect. Desktop packages do not
embed the Agent or remote Runtime, and existing project data is preserved.

Release note: 托管 SSH 项目切换不再重复连接,同一 Host 可顺畅承载多个项目和对话;同时修复重连后的 stale-controller,并优化远程环境安装、更新与状态布局。
2026-08-29 10:58:19 +08:00
lofyerandGitHub eb947213c8 Merge pull request #1 from mesalogo/jojocoding-patch-1
Update README.md
2026-08-27 21:43:15 +08:00
jojokeeandGitHub c2095037ee Update README.md
更新社群二维码
2026-08-27 21:33:33 +08:00
mesalogo 93bf3b908a fix: keep Chinese downloads on OSS loading state
Cross-platform packages / Validate source (push) Canceled after 0s
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The Chinese download cards briefly exposed the GitHub fallback before OSS index validation completed. They now stay disabled while loading and only show GitHub if the OSS request or validation fails; English downloads remain unchanged.

Release note: 中文官网下载入口加载 OSS 索引期间不再短暂跳转 GitHub,仅在索引失败时回退。
2026-08-27 21:30:38 +08:00
mesalogo 38f6a23306 chore: prepare GoodBuddy 0.11.6 release notes
Cross-platform packages / Validate source (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
Add the approved Simplified Chinese and English release notes for sidebar brand customization, independent Anthropic output limits, and restored composer and brand guidance.
2026-08-27 12:56:51 +08:00
mesalogo 12463ad593 feat: add sidebar brand customization
The primary sidebar brand was fixed to the built-in name, subtitle, and logo. Appearance settings now let users preview and save a custom brand name, localized Chinese and English subtitles, and a validated local PNG, JPEG, or WebP logo, with default-logo and full-reset actions.

Customization remains device-local and limited to the top-left brand area; installer, update, Agent, and protocol identities remain GoodBuddy. The desktop package version is now 0.11.6.

Release note: 新增“外观 → 品牌定制”,可修改左上角品牌名称、中英文副标题和本地 Logo,并支持实时预览、恢复默认及本机持久化。
2026-08-27 12:42:26 +08:00
mesalogo 618e505b8b fix: restore the workspace brand subtitle
The primary sidebar showed only the GoodBuddy name after its supporting brand line was removed. It now displays the localized “智能工作台” / “Intelligent Workspace” subtitle beneath the product name again.

Release note: 恢复左上角 GoodBuddy 标题下方的“智能工作台”副标题,使品牌区域的信息层级更加完整。
2026-08-27 10:30:15 +08:00
mesalogo 0a3bf6094a fix: restore composer guidance in input hint
The composer placeholder had been reduced to only the message prompt, hiding send, newline, and paste guidance unless users hovered the field. The full localized keyboard guidance now appears directly in the empty text area again for both chat and image generation.

Release note: 恢复聊天输入框中的发送、换行和粘贴快捷键提示,空输入框会再次直接显示完整操作说明。
2026-08-27 10:14:39 +08:00
mesalogo 957e2ecde7 fix: align homepage feature checklist
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
Wrapped feature rows were centered independently, which shifted the lower-right item away from the column above it. The Chinese homepage now uses a shared two-column grid and collapses to one aligned column on narrow screens.

Release note: 官网首页特性列表现在按列对齐,桌面与移动端布局更整齐。
2026-08-27 08:04:36 +08:00
mesalogo 9316fed3e3 fix: streamline homepage introduction
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
The homepage hero paragraph and page description now focus on GoodBuddy's desktop assistant and Agent Runtime capabilities. Download options and architecture support remain unchanged.

Release note: 官网首页产品介绍现更聚焦桌面助手与 Agent Runtime 能力。
2026-08-27 07:54:04 +08:00
mesalogo d6fea0c6c2 fix: simplify LoongArch download copy
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
The Linux download card now presents only the preview version, DEB format, size, and checksum. Preview index validation and fail-closed download behavior are unchanged.

Release note: 官网龙芯下载信息现仅展示版本、包格式、大小与校验值。
2026-08-27 07:45:03 +08:00
mesalogo d9a554b4b1 feat: add LoongArch preview download to the website
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Deploy website to GitHub Pages / Deploy static website (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build Linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build Linux x64 Agent (push) Canceled after 0s
The Chinese Linux download card now includes a LoongArch processor option and fixes its package type to DEB. It reads a separate strictly validated OSS preview index, while the formal six-target release index and English GitHub downloads remain unchanged.

The page keeps three symmetric platform cards, disables only the LoongArch selection when its index is unavailable, and labels the package as unverified on real LoongArch hardware.

Release note: 官网 Linux 下载新增龙芯 LoongArch 处理器选项,选择后提供独立 DEB 预览包;正式下载与更新索引保持不变。
2026-08-26 23:23:27 +08:00
mesalogo b20c10f820 fix: separate Anthropic output and context limits
Direct Anthropic connections reused the configured context window as max_tokens, which could impose an unintended output value or send a provider-invalid request. Anthropic connections now expose an independent per-response maximum output setting, defaulting to 32K for the protocol-required field, while OpenAI direct requests remain without an added output token cap and direct tool rounds remain unmetered.

Release note: Anthropic 直连模型现在可单独配置单次最大输出,不再复用上下文窗口;OpenAI 直连请求和工具调用轮次不增加额外配额。
2026-08-26 22:53:49 +08:00
mesalogo 49700bc7cf fix: make LoongArch preview checksum portable
Generate SHA256SUMS from inside the timestamped artifact directory so it records only the DEB filename and remains verifiable after copying the preview output elsewhere.
2026-08-26 17:12:20 +08:00
431 changed files with 71873 additions and 18276 deletions
+9 -1
View File
@@ -130,7 +130,7 @@ jobs:
runner: windows-2025
- platform: windows
arch: arm64
runner: windows-2025
runner: windows-11-vs2026-arm
- platform: macos
arch: x64
runner: macos-15-intel
@@ -174,6 +174,14 @@ jobs:
name: goodbuddy-production-bundle
path: out
- name: Verify native runner architecture
run: node -e "if(process.arch !== '${{ matrix.arch }}'){throw new Error('Expected ${{ matrix.arch }} runner, received '+process.arch)}"
- name: Install and validate managed Python
run: npm exec vitest run tests/local-tool-environment-live.test.ts
env:
GOODBUDDY_RUN_LIVE_TOOL_ENVIRONMENT: '1'
- name: Install RPM packaging tools
if: matrix.platform == 'linux'
shell: bash
+154 -294
View File
@@ -4,26 +4,60 @@
These instructions apply to the entire repository.
GoodBuddy is a secure, cross-platform Electron desktop assistant. It uses
Electron, React, TypeScript, Vite, Vitest, and SQLite. User-facing copy is
primarily Simplified Chinese.
GoodBuddy is a cross-platform Electron desktop assistant for internal
organizational networks. It uses Electron, React, TypeScript, Vite, Vitest, and
SQLite. User-facing copy is primarily Simplified Chinese.
## Product Priorities
GoodBuddy is primarily an internal-network product. Unless the user states
otherwise, assume a trusted organizational environment, not a hostile public,
multi-tenant, or zero-trust deployment.
Use this order when requirements or implementation choices compete:
1. Working product functionality.
2. Performance and responsiveness.
1. Complete, working product functionality.
2. Measured performance and responsiveness.
3. Clear, low-friction user experience.
4. Simple, conventional, maintainable implementation.
5. Security controls proportional to a concrete, realistic risk.
5. Security controls only for a concrete risk in the actual deployment model.
Follow KISS and YAGNI. Do not add trust tiers, consent ceremonies, durable
state machines, protocol phases, cryptographic identities, quotas, recovery
machinery, or compatibility layers unless they are needed for an actual user
workflow or a demonstrated failure mode. Prefer the normal platform mechanism
and the smallest design that works. Test Hosts are test environments; do not
turn their workflows into production compliance exercises.
Functionality and performance are the primary acceptance criteria. Do not
disable, delay, restrict, or complicate a working product path for speculative
security hardening. Preserve the existing Electron, credential, user-data, and
release-signing boundaries, but do not expand them without a concrete current
risk or an explicit user requirement.
## Design Simplicity
Follow KISS and YAGNI. Use the smallest conventional design that completes the
real user workflow.
- A demonstrated failure authorizes only the smallest proportional fix, not a
general recovery, compatibility, or security framework.
- Prefer deleting bounded staging and retrying, idempotent operations, and
reconciliation from one authoritative source of truth. Do not persist copies
of state that can be derived or safely retried.
- Do not add durable snapshots, journals, versioned internal receipts, rollback
engines, compatibility readers, multi-phase state machines, protocol phases,
cryptographic identities, trust tiers, consent ceremonies, or quotas when
cleanup, retry, or reconciliation is safe.
- Before introducing any of that machinery, stop before coding. Explain the
reproducible current failure, why the simple alternative is insufficient,
and obtain the user's explicit approval for the added complexity. A reviewer
suggestion, test-only scenario, hypothetical crash, or possible future need
is not sufficient evidence.
- Performance outranks simplicity only for a measured bottleneck. Security
complexity requires a concrete threat at an actual trust boundary.
- Ignore hypothetical threats that require a hostile public network,
untrusted tenants, or zero-trust deployment unless that environment is an
explicit product requirement. Do not turn such findings into implementation
work.
- A complete workflow means the normal production path plus demonstrated
failure cases. It does not require exhaustive recovery from every
hypothetical interruption point.
- Test Hosts are test environments. Do not turn their workflows into production
compliance exercises.
When the user asks to implement a feature, deliver the complete usable user
workflow unless the user explicitly requests a prototype, scaffold, staged
@@ -48,7 +82,8 @@ work as the implemented feature.
- `build`: packaging scripts and icons.
- `out` and `dist`: generated output. Change source files instead.
Keep Electron security boundaries intact:
Keep these existing Electron security boundaries intact. They do not authorize
additional hardening beyond the actual internal-network threat model:
- Preserve context isolation and sandboxing.
- Never enable renderer Node integration.
@@ -77,7 +112,11 @@ Keep Electron security boundaries intact:
## Data and Compatibility
- Preserve existing user data and migrations.
- Preserve released user-owned data, migrations required by released data, and
supported external contracts.
- Compatibility does not apply to unshipped, branch-local, or safely disposable
internal operation records. Replace or discard those records instead of
adding migrations, legacy readers, versioned receipts, or recovery machinery.
- Do not weaken SQLite transaction, lifecycle, deduplication, or cleanup logic.
- Treat user workspaces and untracked files as user-owned.
- Keep Windows, macOS, Linux x64, and Linux arm64 behavior in mind.
@@ -88,6 +127,10 @@ Keep Electron security boundaries intact:
- Follow surrounding TypeScript and React patterns.
- Reuse installed libraries and shared contracts before adding dependencies.
- Keep changes focused. Do not add unrelated refactors or documentation.
- Reviewer findings do not expand task scope. Implement a finding only when it
identifies a reachable current failure, a released compatibility contract,
or reproducible user-visible harm. Record speculative concerns without
building machinery around them.
- Validate the real end-to-end path, not only schemas, mocks, injected test
doubles, or isolated infrastructure. A feature is not complete until its
normal UI action reaches the production implementation and produces the
@@ -108,6 +151,22 @@ Keep Electron security boundaries intact:
- Keep UI accessible with labels, keyboard behavior, semantic roles, and visible
focus states.
## Product Design Documentation
- Organize feature documentation by product feature under
`docs/features/<feature-name>/`, not by document type.
- Treat each feature directory's `README.md` as its documentation entry point.
- Follow `docs/features/AGENTS.md` for required document responsibilities,
naming, traceability, progress evidence, and migration rules.
- Keep cross-feature architecture, quality protocols, development procedures,
and product-wide roadmaps outside feature directories only when they cannot
be owned by one feature.
- Maintain one authoritative definition for each requirement, state rule, UI
behavior, technical contract, and implementation fact. Link to it instead of
duplicating it across documents.
- Update the affected feature documents after functional changes. The
implemented and validated production behavior is the final source of truth.
## UI Consistency
- Treat `UI-DESIGN.md` as the canonical UI design system. Read and follow it
@@ -133,11 +192,6 @@ Keep Electron security boundaries intact:
blocking page state, or an error with an immediate local recovery action.
- Do not show the same event both inline and as an application notification.
Preserve user input and actionable error context when an operation fails.
- Treat renderer bundle budgets as regression guardrails, not UX targets. Do
not lazy-load one lightweight peer tab solely to satisfy a byte ceiling.
When a genuinely heavy view needs deferred loading, preserve peer
interaction semantics, render a non-empty layout-stable local fallback,
and test its first interaction rather than only its eventual appearance.
## Commit Messages and Release Notes
@@ -180,276 +234,43 @@ mode.
Release note: 修复左上角项目设置与消息通道项目设置不一致的问题;现在从任一入口修改后,另一处会同步显示相同配置。
```
## Release Packaging
## Releases
- `.github/workflows/packages.yml` is the canonical cross-platform packaging
workflow. It validates and builds `out` once, then packages on six native
runners: Windows, macOS, and Linux, each for x64 and arm64.
- The experimental Linux LoongArch (`loong64`) preview is built separately
through `build/loongarch-cross` by following
`docs/development/loongarch-preview-build.md`. It is not part of
`.github/workflows/packages.yml`, the six-runner GitHub Actions matrix,
standard release manifests, GitHub Release asset expectations, or the
production update index. Do not add it to those paths unless the user
explicitly requests a future production-support migration.
- Run the unified packager with
`npm run release:package -- --platform <platform> --arch <arch>`. It only
packages for the native host and writes to
`dist/release/<platform>-<arch>`.
- Default deliverables are NSIS and portable ZIP for Windows, DMG and ZIP for
macOS, and AppImage, DEB, and RPM for Linux. Every target includes
`release-manifest.json` with SHA-256 hashes.
- `build/build-release.cjs` verifies the unpacked application, `app.asar`,
bundled Continue and OpenCode runtimes, executable architecture, and package
signatures before atomically replacing a release directory.
- All desktop build paths, including local `portable`, package the Agent and
remote Runtime version locks plus the public signing-key registry without
embedding installable Linux Agent or remote Runtime payloads. Managed SSH is
optional: users explicitly download a compatible compound `.gbagent` package
from Settings or import one offline before GoodBuddy can install or update a
Host.
- Each independently published Linux x64 or arm64 `.gbagent` contains the
Agent daemon, pinned Node, and the desktop-maintained compatible OpenCode
Runtime. Build both architectures on native GitHub Actions runners from one
immutable `agent-v<agentVersion>` tag.
- Keep the GoodBuddy Agent source, shared protocol/contracts, runtime lock,
bundle tooling, and tests in this repository so a desktop commit identifies
the exact Agent source it expects. Do not create a separate Agent repository
or long-lived Agent release branch unless the Agent becomes an independently
released product serving multiple clients.
- `.github/workflows/agents.yml` is the branch and pull-request build
verification workflow for GoodBuddy Agent. It must build Linux x64 and
arm64 on native runners from the checked-out commit, acquire the locked
official Node archive and locked OpenCode npm archive, verify every locked
digest, use only an ephemeral in-memory test signing identity, and verify the
resulting compound package and deterministic archive. It must not read
production signing secrets, publish installable release artifacts, or modify
the checked-in public key registry.
- `.github/workflows/agent-release.yml` is the only production compound Agent
publication path. It requires an annotated immutable Agent tag, the protected
`agent-signing` Environment, native x64/arm64 builds, one production
GoodBuddy signing identity for every layer of the compound package and
catalog, a non-Latest GitHub Agent Release, and synchronized immutable
Beijing OSS objects plus the final signed latest-catalog pointer.
- `.github/workflows/packages.yml` and `release:package` build only desktop
products. Missing Agent packages, remote Runtime inputs, or GoodBuddy signing
credentials must never block an ordinary desktop package or release.
- Keep electron-builder invocations on `--publish never`. Main-branch builds
run validation and build the production bundle without running the native
package matrix. Manual builds upload 30-day GitHub Actions artifacts.
Version-tag builds verify and aggregate packages before publishing GitHub
Release assets. The macOS jobs sign, notarize, and verify packages when all
five Apple credentials are configured. With no Apple credentials they must
use the explicit `--unsigned` path, warn that Gatekeeper may block the
packages, and still complete; a partial credential set must fail rather than
silently downgrade.
- Keep `ELECTRON_CACHE` and `ELECTRON_BUILDER_CACHE` under
`${{ runner.temp }}` in step-level workflow contexts. A cache beneath the
repository inherits the root `"type": "module"` and breaks electron-builder's
CommonJS macOS icon tool.
- Tag builds must use `v${package.version}`. The workflow also supports manual
dispatch and main-branch changes to release tooling.
Detailed release operations are governed by
[`docs/development/release-runbook.md`](./docs/development/release-runbook.md).
Read that runbook only when preparing, publishing, recovering, or verifying a
desktop or GoodBuddy Agent release. It is an operator and CI procedure, not an
authorization to add product persistence or recovery machinery.
### Agent Release Process
Repository-wide release invariants:
- Agent releases use annotated `agent-v${agent-runtime-lock.agentVersion}` tags
and are separate from desktop `v${package.version}` releases. Confirm the
exact Agent release commit and tag with the user before creating or pushing
either.
- The tagged commit must be reachable from protected `main`. The two native
jobs build the compound x64/arm64 packages from the same source and locks;
the catalog job rejects missing architectures, changed bytes for an existing
version/architecture identity, invalid prior signatures, and incompatible
matrix metadata.
- Agent GitHub Releases are ordinary non-draft, non-prerelease releases but
must use `--latest=false`; they must never replace the desktop release marked
Latest. Publish immutable packages and the versioned catalog to
`agent-releases/v<agentVersion>/` in Beijing OSS, publish the GitHub Agent
Release, then atomically update the single `agent-releases/latest.json`
pointer to that version's immutable catalog and signature.
- Do not report an Agent release complete until both public package
architectures match the signed catalog by size and SHA-256, the GitHub and
OSS catalog bytes/signatures are identical, the application can read the
selected source, and GitHub's repository Latest tag remains the desktop tag.
### Tagged Release Process
Every version-tag release must follow this sequence. A branch-only push does
not require release notes.
1. Confirm that the user wants a release tag and identify the exact release
commit and the new `package.json` version. Separately ask whether this
release should also receive an experimental LoongArch preview build; never
infer that choice from an earlier release.
2. Find the latest stable version tag reachable before the release commit and
inspect the complete commit and file diff from that tag to the release
commit. For the first tagged release, inspect the relevant repository
history instead.
3. Draft concise, user-facing release notes in both Simplified Chinese and
English based only on verified changes in that range. Use the titles
`GoodBuddy <version> 更新内容` and
`What's New in GoodBuddy <version>`, with corresponding `功能更新` /
`Features` and `问题修复` / `Bug Fixes` sections when applicable. The two
language versions must describe the same changes. Do not expose
internal-only details, credentials, private content, or unverified claims.
4. Show the exact bilingual release-note draft to the user and wait for
explicit approval. If the release commit or either language version changes
after approval, inspect the updated tag range and request approval again.
5. Write the approved notes to the single entry for the release version in
`resources/release-notes.json`. A failed unpublished candidate whose content
is carried forward must not retain a duplicate packaged entry.
6. Verify that `package.json`, the root `package-lock.json` version, and
`package-lock.json.packages[""].version` all equal the release version. Run
`npm run release:notes:verify`, the required source validators, the
production build, and any native candidate launch probe available on the
current host. The six native CI jobs remain the cross-platform authority.
If the user requested a LoongArch preview in step 1, build it separately
from this exact candidate by following the LoongArch build document, record
its size and SHA-256, and keep it outside the standard GitHub/OSS release
asset set unless the user separately authorizes publishing it.
7. Fetch both remotes immediately before tagging. Inspect any remote branch
movement instead of overwriting or silently merging it. Confirm the working
tree is clean, the candidate tag is unused locally and remotely, and the
exact approved commit has not changed.
8. Only after all previous steps pass, create an annotated
`v${package.version}` tag at the exact approved commit. Push `main` to
`origin` and `github`, verify both branch SHAs, then push the tag to both
remotes and verify each peeled tag SHA (`refs/tags/<tag>^{}`) equals the
release commit.
9. Keep both approved language versions as the single source for the GitHub
Release body and the packaged first-open release-notes modal. The modal
displays the release notes matching the current interface language and
contains no button linking to a full release page.
10. Observe the tag workflow through publication and complete the public
verification checklist below. A successful push is not a completed
release.
### OSS Publication Contract
The tagged release job publishes through the GitHub Environment selected by
`.github/workflows/packages.yml` (`aliyun-oss-release`) and reads the following
effective GitHub Actions variables. Before a release or same-tag rerun can
publish, verify that repository-, organization-, or environment-level
resolution exposes:
- `ALIYUN_OSS_BUCKET=goodbuddy`
- `ALIYUN_OSS_ENDPOINT=https://oss-cn-beijing.aliyuncs.com`
- a non-empty `ALIYUN_OIDC_PROVIDER_ARN` matching
`acs:ram::*:oidc-provider/*`
- a non-empty `ALIYUN_ROLE_ARN` matching `acs:ram::*:role/*`
For environment-scoped values, use the exact Environment name from the
workflow; do not assume a similarly named UI environment such as `Production`
contains the active variables.
The Bucket and Endpoint are a deployment contract, not interchangeable
examples. They must stay aligned with the trusted URL checks in
`src/main/version-checker.ts`, `sites/app.js`, website validation, and related
tests. A host, Bucket, Region, or CDN migration must update and validate every
surface together before a new release.
- Use GitHub OIDC and the RAM Role to obtain short-lived STS credentials.
Never add long-lived AccessKeys to repository or environment secrets.
- Keep `ossutil` pinned. Its V4 signing requires the Region; derive it from the
canonical Endpoint, verify that the production value resolves to
`cn-beijing`, and pass `--region` to every `ossutil cp`, including the final
`latest.json` update.
- Grant the RAM Role only the actions and prefixes required by the workflow.
It must be able to write immutable version objects and the final latest
pointer without granting unrelated administration privileges.
- Upload release assets and `site-release.json` under the immutable
`releases/<tag>/` prefix first. Verify all 14 installer URLs publicly before
creating or publishing the GitHub Release. Update
`releases/latest.json` only after the GitHub Release is public and all prior
checks succeeded.
- The expected GitHub Release contains 22 assets: 14 installers (two formats
for each Windows/macOS target and three formats for each Linux target), six
renamed target manifests, one aggregate `release-manifest.json`, and one `SHA256SUMS`.
`site-release.json` is an OSS publication artifact, not a GitHub Release
asset.
### Failed Tag Recovery
Classify a failed tag by the external side effects that completed before
choosing a recovery:
- If no source or release metadata must change, correct only the external
configuration and use **Re-run failed jobs** for the same immutable tag. Do
not change, move, delete, or recreate the tag.
- If immutable OSS objects were partially uploaded but their source bytes are
unchanged, a same-tag rerun may idempotently re-upload or verify them. Never
point `latest.json` at a partially verified prefix.
- If the GitHub Release is already public but the final latest-pointer step
failed, it is a published version. Keep its packaged notes and rerun the
failed release job for the same tag; do not classify it as an unpublished
candidate.
- If code or release metadata must change, keep the failed tag immutable,
increment the patch version, obtain approval for the revised exact release
commit and notes, and create a new tag. Do not reuse the failed version.
When recovering from a version tag whose workflow never published a public
GitHub Release:
- If a code or metadata change requires a higher version and a new tag, carry
the failed candidate's approved user-facing notes forward into the recovery
version, then remove the superseded failed version's entry from
`resources/release-notes.json`.
- The packaged first-open modal must show that carried-forward content only
once under the recovery version. Never retain both the failed version and
its cumulative recovery copy, because users upgrading across them would see
duplicate content.
- Never remove the packaged history for a version that successfully published
a GitHub Release. Verify the failed release state before treating an entry as
superseded.
### Post-Publication Verification
Do not report a release complete until all of the following are verified:
1. The tag workflow and all six native package jobs succeeded. Verify the
recorded macOS signing mode: signed builds must pass `codesign`, `spctl`,
and `stapler`; unsigned builds must record the Gatekeeper caveat in the
Actions log and job summary. In the final release job, explicitly verify
the OSS configuration, OIDC authentication, release-index generation,
immutable upload, public asset check, GitHub Release publication, and
latest-pointer steps.
2. The public GitHub Release is non-draft, non-prerelease, marked Latest, and
uses the expected tag and title. Its body must exactly match the Markdown
generated from the approved packaged bilingual notes.
3. The GitHub asset set has exactly the expected 22 names and every asset is
uploaded. Compare installer sizes and SHA-256 digests with the aggregate
manifest and `SHA256SUMS`.
4. The Beijing `releases/latest.json` returns HTTP 200, has the expected stable
version, exact six targets and 14 installer entries, the trusted Beijing
URLs, and the GitHub fallback URL. It must match the immutable
`releases/<tag>/site-release.json`.
5. All 14 public installer URLs accept `HEAD` without redirects and report the
declared size. For small JSON/checksum metadata, prefer a `GET` byte and
digest comparison; OSS may gzip JSON responses and omit an uncompressed
`Content-Length` on `HEAD`.
6. The live website successfully fetches the index and produces the 14 correct
platform/architecture/format links. Exercise the application's actual
mirror checker against the public index for all six targets.
7. Both remote `main` refs and both peeled tag refs still equal the approved
release commit, and the local working tree is clean.
Never create or push a release tag, and never push a previously created
release tag, before the release-note draft has received explicit approval.
- Before a push that updates the `github` remote, ask whether the user wants a
release tag unless they already specified that choice. A branch-only push
does not require a version bump or tag. When the user requests a release,
verify that `package.json` and `package-lock.json` contain the same release
version, create `v${package.version}` at the exact commit being pushed, and
push that tag so the native package matrix and GitHub Release run.
- Never move or reuse an existing release tag. If `v${package.version}` already
exists locally or on a remote at another commit, increment the package
version and create a new matching tag before the release push.
- Verified release baseline on 2026-08-18: commit
`60119a4317118fa3f077db0382664f15266a6682`, annotated tag `v0.10.4`, and
GitHub Actions run `32038633609` attempt 2 succeeded through all six native
packages, GitHub Release publication, Beijing OSS publication, and the final
`latest.json` switch.
- Write each release-note feature item as two or three clear sentences that
identify the user situation, the available action, and the resulting
behavior or important boundary. Do not impose an arbitrary per-item
character limit; use the detail needed to make the user scenario clear.
- Before approving the exact release commit and bilingual release notes,
inspect the English `FEATURES.md` and Simplified Chinese
`FEATURES.zh-CN.md` against the verified changes since the previous stable
release. Keep both versions aligned, and update their provided capabilities,
roadmap status, current versions, limitations, and remaining release
acceptance work as needed. Include any required update in the release
candidate; if no change is needed, explicitly confirm that both feature lists
were reviewed and remain accurate.
- Never create or push a release tag before the user approves the exact release
commit and bilingual release notes.
- Never move, delete, recreate, or reuse a release tag.
- Keep desktop and Agent release paths, tags, artifacts, and Latest status
separate.
- GitHub Actions is the release build and cross-platform packaging authority.
During release preparation, run local tests, type checks, and lint, but do
not run `npm run build`, `npm run build:bundle`, local packaging, or
packaged-app probes. Push the approved candidate commit first and require its
main-branch CI validation and production build to pass before tagging it,
unless the user explicitly requests an additional local build.
- LoongArch is a separate experimental preview. Build or publish it only when
the user explicitly requests it for that release.
- Never commit or publish credentials. Production publication uses the existing
protected environments and short-lived credentials described in the runbook.
## Validation
@@ -461,19 +282,58 @@ npm run typecheck
npm run lint
```
Run `npm run build` for production build changes. Use `npm run portable` only
when a current Windows portable package is requested. The user has granted
standing authorization in this repository for bounded real text-model calls
needed to validate changed product paths; do not ask again for each such call.
Keep each validation call minimal, disable tools and attachments where
possible, and report the exact call count. This standing authorization does
not cover bulk, high-cost, destructive, publishing, messaging, purchasing, or
other consequential external actions.
Run `npm run build` for production build changes during development, but not
solely as a release-preparation step; release candidates use the main-branch CI
production build before tagging. Use `npm run portable` only when a current
Windows portable package is requested. The user has granted standing
authorization in this repository for bounded real text-model calls needed to
validate changed product paths; do not ask again for each such call. Keep each
validation call minimal, disable tools and attachments where possible, and
report the exact call count. This standing authorization does not cover bulk,
high-cost, destructive, publishing, messaging, purchasing, or other
consequential external actions.
### GoodBuddy Agent development validation
Every source change that can alter the deployed GoodBuddy Agent or the
desktop-to-Agent production path must be validated on the shared Linux x64 test
Host while the change is being developed. This includes Agent daemon and
protocol changes, packaging and installation, attach/update behavior, Runtime
launch and process ownership, workspaces, model bridges, and lifecycle or
recovery behavior. Unit tests, mocks, fixtures, CI, and waiting for release
validation are not substitutes for this development-time check.
- Reach the shared Host at `192.168.0.23` on the LAN when available, otherwise
use `10.7.0.23` over VPN. These are two routes to the same physical machine,
not two independent test targets or architecture results.
- Exercise the current source or package under development, not only the
previously published Agent. Run the affected production path as soon as it is
runnable and repeat the relevant scenario after the final change.
- Select the real-Host scenario from the changed surface: attach/bootstrap or
update for installation changes; Ask/Execute and a bounded real model request
for Runtime or model-bridge changes; and the applicable disconnect, restart,
cancellation, or reconnection sequence for lifecycle and recovery changes.
- Use the existing pinned Host identity and GoodBuddy credential storage. Never
add credentials to source, documentation, commands, logs, or test output, and
never hard-code these test addresses into product behavior or defaults.
- Keep all artifacts in GoodBuddy-owned test directories. Before stopping or
changing a remote process, verify that it belongs to the test run; never
modify unrelated Host files or processes.
- If neither route is reachable, report the real-Host validation as blocked and
do not present the Agent work as complete or defer its first real validation
to release time.
The detailed scenario rules are documented in
[`docs/features/remote-host/technical-design.md`](./docs/features/remote-host/technical-design.md).
Before committing or pushing, inspect `git status`, `git diff`, and
`git diff --cached`. Do not commit secrets, local databases, logs, generated
credentials, or private user artifacts.
Before a push that updates the `github` remote, ask whether the user wants a
release tag unless they already specified that choice. A branch-only push does
not require a version bump or tag.
This repository has two synchronized remotes, `origin` and `github`. Unless the
user explicitly names a remote, every requested push must update the current
branch on both remotes. When the user requests a release tag, push the new tag
+72 -46
View File
@@ -132,6 +132,12 @@ npm run dist:linux:arm64
打包产物位于 `dist`。
所有桌面打包入口通过同一个 `electron-builder` 启动脚本运行。正常日志会隐藏
`duplicate dependency references` 信息摘要,因为它只表示同一已解析依赖被多条
生产依赖路径共享,并不要求构建操作者处理;调试日志仍会保留该摘要。Renderer 中
已由 Vite 打包的 `@antv/g6` 归类为构建期依赖,不会再作为独立 Node 模块复制进桌面
安装包。
以上 `dist*` 与 `portable` 命令用于普通本地桌面打包。它们会携带
`agent-runtime-lock.json`、`remote-runtime-lock.json` 与公开的
`agent-release-keys.json`,但所有桌面构建路径(包括本地 `portable`)都不会嵌入
@@ -151,11 +157,54 @@ Main 在写入缓存前校验签名目录、目录签名、大小、SHA-256、
production/test 环境和撤销列表,不来自 JSON 空白或换行。读取桌面资源、复合包和 Host
已有 registry 时接受等价 UTF-8 JSON 格式;向 Host 写入前统一重新序列化为确定性 LF
JSON。签名目录、包描述符、manifest、签名和 payload 的原始字节校验保持不变,包下载
继续流式计算 SHA-256,不使用 MD5。
继续流式计算 SHA-256。
“SSH 主机 > 远程运行环境”的“更新版本”只使用已验证的本地复合包。对应 Host 架构
尚未下载时会提示先到设置下载或导入,不会联网,也不会影响本地项目、普通桌面功能或
其他架构的 Agent 包。
“SSH 主机 > 远程运行环境”只有一个按版本事实显示“安装远程环境”“更新远程环境”或
“重新安装”的主按钮。次级 SegmentedControl 选择默认且不持久化的“自动”、“Host 下载”
或“GoodBuddy 传输”:
- “Host 下载”使用签名目录中的固定 GitHub/北京镜像 URL、大小、SHA-256、
有界重定向链和固定 SSH prepare channel。GoodBuddy 桌面控制面通过该通道发送有界
one-shot installer;Host 校验目录绑定的归档大小和 SHA-256 后,由包内固定 Node 解码
并运行 installer。
- 显式“GoodBuddy 传输”在在线目录不可用,或本地已验证包版本不低于在线候选时优先使用
本地包,包括版本更高的离线导入;线上存在更新且可用时仍取得线上新包。需要下载时,
同一次用户操作会校验 SHA-256 与签名、缓存并取得 lease,再以有界流式 SFTP 上传一个
compound archive 和归档内已验证的 bootstrap Node;约 294 MiB 的整包不会一次读入
Main `Buffer`,Host 仍再次校验。
- “自动”只在 operation/prepare 前执行 Host capability probe;直连明确可用才选择
Host 下载,否则选择 GoodBuddy 传输。显式选择保持有效,prepare、commit 或 adoption
失败后不跨 acquisition 自动 fallback。
两种 acquisition 都把同一签名 compound `.gbagent` 交付到固定 operation staging,随后
共用 control-plane `prepare → commit → Agent activate/health → Runtime activate →
finalize → cleanup`。Main 只持久化清理 operation staging 所需的 operation ID,不保存
Agent/Runtime metadata 副本。操作中断或 adoption 失败后,下一次更新尽力清理旧暂存并
重新 prepare,不恢复或续写旧操作。确认 adoption 后显式 cleanup。Host 在 prepare
解包时完成一次完整 payload 校验;commit 只复核签名 metadata
并原子发布,Agent/Runtime 注册后的 health、capabilities 和 prompt 启动不再遍历或哈希
完整 payload。cleanup 失败不回滚已健康环境,也不阻塞下一次 fresh prepare。
进入“主机与远程执行”设置页只读取本地 Host 列表,不逐台连接。用户点击某台 Host 的
“刷新版本”后才执行远端版本和直连准备能力探测。项目切换只更新本地选择,不建立 SSH
连接;首次实际使用远程 Workspace 或 Runtime 时才建立连接。当前进程会复用该 Host 已确认
的 Agent/Runtime identity 和 Agent 连接,Host 编辑或环境更新会定向清空它们。
直连安装本身只依赖 SSH,不依赖已有 Agent。显式选择 Host 下载时由实际安装流程重新探测
并报告工具、权限、空间或来源不可达等原因;本次操作不会自动改用 GoodBuddy 传输。
新建远程项目弹窗也只读本地 Host 验证记录;目录浏览或保存才连接所选 Host。Host 卡片
在版本相同时仍允许显式重装;损坏的 GoodBuddy-owned 同 digest 目录会先隔离、替换并在
失败时恢复。直连 bootstrap 使用固定短命令 `exec sh -s`,脚本和有界输入经 stdin 发送,
避免 SSH command 长度限制。
新增 Host 只保存并探测,不提供自动安装开关;只有用户明确点击主按钮后才传输完整包。现有
package format v1 归档已经包含固定 Agent 和 Node,可直接用于 Host 直连;归档无需携带
`agent/lib/package-installer.cjs`,签名目录不提供也不检查额外的 bootstrap 能力元数据。
首次 bootstrap 不依赖已安装 Agent daemon。目标契约见
[SSH Host 远程环境准备与直连下载设计](./docs/features/remote-host/environment-provisioning-technical-design.md)。
删除 Host 或远程项目属于纯本地管理操作。Host 确认框列出全部关联项目记录并级联清理
本地数据库,但不连接 Host、不检查远端目录,也不删除远端文件;Host 设置文件和项目事务
的普通失败会回滚已写入的一侧。
## Runtime 资源
@@ -169,11 +218,19 @@ JSON。签名目录、包描述符、manifest、签名和 payload 的原始字
跨架构打包前,确认目标架构的 OpenCode 资源已经准备完成。不要用其他架构的二进制替代目标资源。
GoodBuddy 管理的本机 OpenCode 启动后会轮询已认证的 loopback health 接口,最多等待
30 秒。该窗口用于兼容 Linux ARM 等较慢环境;不要改回依赖 stdout 文案或 10 秒固定上限。
## GoodBuddy Agent 工件
面向用户发布的是按远端 Host 架构区分的复合 `.gbagent`,每个包同时包含签名
Agent、固定 Node 和当前桌面源码维护并适配的签名 OpenCode Runtime。Runtime 不建立
独立的用户版本流。生产构建命令为:
独立的用户版本流。远程直连所需的有界 one-shot installer 由桌面控制面打包并通过固定
SSH prepare channel 发送,不是 `.gbagent` 的必需条目。Host 按签名目录校验完整归档
大小和 SHA-256 后,包内固定 Node 解码并运行 installer。两种 acquisition 都在固定
operation staging 中执行同一 prepare/commit;本地 pending record 只保存清理暂存所需的
operation ID。失败或中断后的下一次更新尽力清理旧暂存并重新 prepare,不保存或恢复
Agent/Runtime metadata 副本。生产构建命令为:
```bash
node build/agent-package.cjs build \
@@ -271,15 +328,17 @@ broker 必须按 socket 当前已缓冲字节增量读取长度帧,不能等
唯一标识对应版本的精确工件。变更后必须重新构建、签名并导入 Linux x64/arm64 两套工件;
旧版本或旧 digest 会按设计校验失败。不要手工把本机 `.runtime-resources` 当作远程 bundle。
桌面应用更新后不会在项目激活时自动下载 Agent。用户先在设置中显式下载“最新兼容”
版本或导入离线包;随后打开托管 SSH 项目时,Main 才使用该 Host 架构的本地验证包执行
完整激活。所需版本健康且项目事务提交成功后才刷新项目绑定;失败不会覆盖旧安装或把
未提交的新 identity 暴露给 Workspace/Runtime。
桌面应用更新后不会在项目切换时下载或安装 Agent。用户先在 SSH Host 的远程运行环境
卡片显式选择直连下载或 GoodBuddy 传输。托管 SSH 项目只保存 Host ID、远端路径、
Runtime 选择和默认模式;创建或保存时验证 Host 当前环境,普通项目切换只读取这些本地
配置。首次实际使用 Workspace 或 Runtime 时解析 Host current identity;同一进程内后续
项目复用已确认的 Agent/Runtime identity 和 Agent 连接。该流程不取得安装包、不重读完整
payload,也不发布组件。
用户也可在 SSH Host 的远程运行环境卡片显式选择“更新版本”。该路径按 Agent、
OpenCode Runtime 顺序使用对应架构的本地复合包,支持阶段进度和取消;成功后使引用该 Host
的项目重新验证。验收应覆盖激活与此手动入口,并确认失败或取消不会删除
Host 配置、凭据、项目设置、Workspace 文件或仍可用的旧安装。
两条手动准备路径都支持阶段进度和取消;成功后定向失效该 Host 的连接与 Runtime 缓存,
引用项目下一次打开自然使用新的 current 环境。验收应覆盖两种准备方式与项目当前环境
验证入口,并确认失败或取消不会删除 Host 配置、凭据、项目设置、Workspace 文件、全局
可信元数据或仍可用的旧安装。
## 跨平台 CI 与 GitHub Release
@@ -455,36 +514,3 @@ npm test -- src/main/agent/deepseek-harness-acp-e2e.test.ts -t "rejects a real n
如需覆盖发布包内置 npm 路径,再设置 `GOODBUDDY_DSH_NPM_CLI` 与
`GOODBUDDY_DSH_NODE_EXECUTABLE` 指向已解包应用中的 npm CLI 和应用主程序。
## Renderer bundle 性能门禁
`electron-vite` 会在 `out/renderer/.vite` 生成 Vite manifest 和仅含构建模块
归属的 module manifest。`npm run build:bundle` 在 bundle 完成后自动运行
`build/check-renderer-bundle.cjs`,去重统计首屏同步闭包及 Knowledge、知识图谱、
Activity、Magic Notes、Settings 动态入口同步加载的 JS 与 CSS 合计 raw / gzip
大小并执行预算校验。
门禁同时验证以下结构约束:
- Knowledge、Activity 与 G6 不得进入首屏同步闭包。
- `KnowledgeGraphChart` 与 G6 不得进入 Knowledge shell 的同步闭包。
- G6 必须由知识图谱动态入口同步拥有。
路径遍历使用 manifest 中的相对文件名并通过 Node `path.resolve` 读取,因此兼容
Windows 与 POSIX 构建输出。构建专用 module manifest 只记录项目相对路径、
`node_modules/` 相对路径或稳定的虚拟模块名,不记录 Runner 的盘符、主目录或
绝对路径;检查成功后会删除该诊断文件,检查失败时保留以便排查。标准 Vite
manifest 会保留在输出中。预算以干净生产构建为基线并保留有限余量;若业务确需
提高预算,必须先检查 manifest 闭包和产物差异,不能只为通过 CI 调大数值。
Bundle 大小是发现意外依赖和持续膨胀的粗粒度工程护栏,不是用户体验指标,也不能替代
Electron 中的实际交互验证。Settings 的硬上限以 2026-08-23 验证构建
`648.78 kB raw / 97.79 kB gzip` 为基线,增加约 15% 评审余量后取整为
`750 kB raw / 115 kB gzip`。该上限用于拦截显著增长,不要求实现长期贴线运行。
调整 Renderer 拆包时遵守以下优先级:
1. 同级页签的交互一致性、首个绘制帧内反馈和输入保留优先于包体数字。
2. 不得仅为通过预算,把一个原本轻量的同级页签单独改成首次点击才加载。
3. 确需动态加载重型功能时,必须提供非空、无布局跳变的局部状态,并增加首次交互测试。
4. 修改预算必须记录干净生产构建基线、增量闭包差异和 Electron 实测结果。
+491 -83
View File
@@ -1,103 +1,511 @@
# GoodBuddy 功能矩阵与路线图
# GoodBuddy Feature Matrix and Roadmap
本文记录 GoodBuddy 的已提供能力和路线图。未完成项目不代表已包含在当前版本中。
**English** | [简体中文](./FEATURES.zh-CN.md)
## 状态说明
This document records the capabilities available in GoodBuddy and its roadmap.
Unchecked items are not included in the current release unless the item says
otherwise.
- [x] 已提供
- [ ] 开发中或规划中,具体以条目标注为准
## Status
## 功能总表
- [x] Available
- [ ] In development or planned, as described by the item
### 桌面基础、工作空间与上下文
## Feature Matrix
- [x] **跨平台桌面应用**:支持 Windows、macOS、Linux,以及 `x64`、`arm64` 发布目标。
- [x] **可配置全局快捷唤起**:在“平台功能 / 通用设置”中启停或录制 Electron accelerator;默认保留 `CommandOrControl+Shift+Space`,冲突或保存失败时继续使用上一组已注册快捷键,并显示可处理的状态。
- [x] **Projects、独立对话与会话分支**:按项目隔离上下文,管理会话、附件和 Git 工作区变更;本地会话可在稳定状态下复制当前聊天内容到独立分支,分支持续显示来源徽标且不复制 Task、队列或成果归属;项目选择器区分本地、托管 SSH 与远程消息通道项目,并显示对应目录或来源。
- [x] **文件、截图、窗口、剪贴板上下文**:用户明确选择后才加入模型上下文。
- [x] **富文本回答**:支持 GitHub Flavored Markdown、LaTeX 数学公式和受控 Mermaid 图表;大图可缩放、拖动或查看源码,失败时保留原始图表代码。
- [ ] **项目 Agent Space**(规划中):在 Project 中统一角色、知识、Skills/MCP、模型、审批策略、预算和超时,并支持模板复用。
- [ ] **通用助手工作栏与执行空间**(规划中):保留 Task Center 作为 Task 的单例索引,并把监督、Runtime、终端、进程、工作区、浏览器和成果作为始终可访问的应用级能力;除 Task Center 外的可绑定能力由用户选择跟随或固定目标,并逐步支持静态安全 HTML 预览、本机/SSH 执行空间和远程 Agent Runtime。附件与知识库继续由会话输入区管理,未来的记忆与历史执行上下文归入关联 Task。详见 [Feature PRD](./docs/prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md)。
### Desktop foundation, workspaces, and context
### Agent Runtime 与模型连接
- [x] **Cross-platform desktop application**: Supports Windows, macOS, and
Linux release targets on `x64` and `arm64`.
- [x] **Configurable global shortcut**: Enable, disable, or record an Electron
accelerator under Platform Features / General. The default remains
`CommandOrControl+Shift+Space`; if registration conflicts or saving fails,
GoodBuddy keeps the previously registered shortcuts and shows an actionable
status.
- [x] **Projects, independent conversations, and conversation branches**:
Isolates context by project and manages conversations, attachments, and Git
workspace changes. A stable local conversation can be copied into an
independent branch; the branch retains a source badge but does not copy
Tasks, queues, or artifact ownership. The project selector distinguishes
local, managed SSH, and remote messaging-channel projects. Managed SSH
projects are grouped by Host, with the real Agent connection state on the
Host heading and only the remote path on each project row.
- [x] **File, screenshot, window, and clipboard context**: Added to model
context only after explicit user selection.
- [x] **Rich responses**: Supports GitHub Flavored Markdown, LaTeX math, and
constrained Mermaid diagrams. Large diagrams can be zoomed, panned, or
viewed as source, and failed renders preserve the original diagram code.
- [x] **AI response and full-conversation copy**: Completed AI responses expose
a bottom action that copies Markdown source without reasoning, tool logs, or
citation metadata. Full-conversation copy uses the same validated
Preload/Main clipboard path.
- [x] **Assistant workbar, multiple terminals, and resizable layouts**: The
right workbar uses a persistent “+” capability catalog and application tabs.
Users can open multiple independent terminals for the current local or
managed SSH project with bounded output, resizing, termination, and explicit
reconnection. Closing a terminal tab ends its Shell; restarting the app
restores only an ended tab description and never restarts the Shell. The
main sidebar and Magic Notes list support pointer and keyboard resizing;
the notes list can be hidden, remembers its layout, and stacks at narrow
widths.
- [ ] **Project Agent Space** (planned): Unifies roles, knowledge, Skills/MCP,
models, approval policy, budgets, and timeouts in a Project, with reusable
templates.
- [ ] **Additional assistant workbar and execution-space capabilities**
(planned): Builds on the current workbar and multiple terminals with
supervision, unified Runtime monitoring, managed processes, safe static HTML
preview, target-pinnable workspace/browser/artifact instances, bottom
docking, and separate windows. Task Center remains the singleton Task index;
attachments and knowledge remain in the conversation composer, while future
memory and historical execution context belong to the associated Task. See
the [Feature PRD](./docs/features/assistant-workbar/prd.md).
- [x] **直连模型 Runtime**:支持问答、知识总结、受控工具执行和图像生成。
- [x] **OpenCode 与 Continue**:使用隔离子进程、环境变量白名单、统一配置、取消、总执行时限、有界流式输出和活动记录;共享进程回收逻辑保留 Windows 完整进程树终止,并对采用独立进程组的 POSIX 子进程执行组回收。交互提问只由前台对话回答,定时任务、远程通道和委派等后台执行遇到提问时会立即失败并提示改为前台运行,避免无限等待。
- [x] **托管 SSH OpenCode 闭环(技术预览)**:该能力由“设置 > 平台功能”中的独立“远程项目(技术预览)”页签控制并默认关闭;关闭时不影响任何本地项目、普通桌面功能或桌面发布。启用后可管理固定 Host Key 的 SSH Host、浏览有界远端目录并创建 Ask/Execute 项目;Ask 在 Runtime 边界通过 bubblewrap 保持 Workspace 只读,Execute 使用所选 SSH 账号的完整权限。Main 通过签名 Agent、私有 Unix socket、ACP v3、持久恢复 cursor 和 Main-only 模型桥维持长任务、重连与会话恢复,模型凭据不进入远端。远端组件不嵌入桌面包,也不会在项目激活时自动下载;设置页只读取小型签名目录并按 Linux x64/arm64 显示本地版本、在线最新兼容版本和“有更新/已是最新”,用户点击后才下载签名 `.gbagent`,也可导入/导出离线包。每个复合包包含 Agent、固定 Node 与由桌面源码统一维护适配的 OpenCode Runtime;在线来源跟随“关于与更新”的 GitHub/北京 OSS 选择,签名累计目录绑定最低桌面版本、Agent 协议、架构、大小、SHA-256 和固定 URL。公钥 registry 接受等价 JSON 空白和换行,但仍严格校验 schema、Ed25519 key、环境与撤销;目录、包、manifest、payload 签名和流式 SHA-256 不变。缺少某架构包只使该架构托管 SSH 不可用。持久化验证继续精确绑定 Agent installation 与签名 Runtime digest;托管 SSH 会话只显示支持的 OpenCode 选择。Windows 到 Linux x64 的安装、provider-free 模型桥、断线重放、Session 续接和零残留清理已完成真实 Host 验证;签名 Agent 0.11.2-e2e.12 与 OpenCode Runtime 1.18.9 已完成一次只提交一遍、只调用一个 Ask 原生 read、无标题轮次且精确返回证据内容的有界真实模型验收,当前源码 lock 已转为正式 Agent 0.11.5。
- [x] **SSH Host 运行环境手动更新**:远程运行环境卡片只读取 Host 已安装 Agent/Runtime 与当前本地复合包所需版本,不会联网。用户显式触发后,Main 按 Agent、Runtime 顺序使用对应 Host 架构的已验证本地 `.gbagent` 强制重新校验并安装,显示阶段进度并允许在最终收尾前取消;尚未下载时提示先到平台功能设置下载或导入。更新期间保留旧版本卡片,失败或取消后刷新实际状态并允许重试;成功后定向清理该 Host 缓存并使引用项目重新验证,不删除 Host 配置、凭据、项目设置或 Workspace 文件。
- [x] **DeepSeek Harness(预览)**:使用 GoodBuddy 固定 Host 和 OpenAI 兼容模型连接;Ask 只允许调用 Host 中真实注册的 `read`、`skill` 以及 Main 管理的 Web Search/Fetch 代理,拒绝插件同名冒充,Execute 放行全部已启用内置及插件工具,并以当前用户权限运行。图像输入跟随所选模型连接的能力声明,文本模型在 Host 或模型调用前拒绝图片,图片模型通过有界内联内容和临时 Attachment Store 接收 JPEG/PNG。
- [x] **DSH npm 插件市场**:市场默认关闭,由用户显式开启后搜索公共 npm 的 `dsh-plugin` 包,使用捆绑 npm 执行精确版本安装和普通 lifecycle scripts,并支持启停、JSON 配置、移除、失败启动自动停用和离线管理已安装插件;关闭市场只隐藏目录与管理界面,不改变已有插件的启停状态,第三方代码不受 Ask 初始化隔离。
- [x] **Ask 与 Execute 工作模式**:Ask 保持只读;Execute 是用户对当前本机或 SSH 账号可用工具、进程、网络和可写路径的完整授权。
- [x] **专家与 Subagent**:支持显式专家、团队分析和最多三个只读专家并行分析;聊天先展示可逐项展开的专家完整输出,再在其下展示总 Agent 的综合结果,并随会话保存。
- [x] **角色绑定模型连接**:每个角色可继承默认模型或选择独立文本模型连接,失效连接安全回退默认模型,综合角色始终继承默认模型。
- [x] **多协议模型配置**:支持 Anthropic Messages、OpenAI Responses、OpenAI Chat Completions、OpenAI Images 和无认证本机模型;新用户默认连接为本机 Ollama 兼容地址,不预置第三方云模型服务。升级时只替换从未配置凭据且仍完全等于旧内置值的历史默认连接,用户显式保存或加密凭据的连接保持不变;已有部署仅使用兼容环境变量提供凭据时继续沿用对应的历史连接参数,通用模型环境变量仍优先。“保存并测试模型”会发送有界的真实文本或图片生成请求并校验生成结果,而不是只检查 HTTP 连通性,因此可能产生少量服务商用量费用。
- [x] **上下文用量与自动压缩**:直连模型按每次成功调用更新供应商用量,图片与工具轮次使用同一口径,供应商缺失 usage 时才回退估算;界面明确区分“本次模型调用”和“压缩后对话估算”,压缩线始终根据当前设置与所选模型窗口即时计算,不在每个对话中保存旧配置;压缩标识的前后值使用同一估算口径,运行记录仍保留各次模型调用的供应商 usage。对话与多轮工具 Agent 可在已完成调用越过阈值后自动重复压缩,规划时先为固定提示、工具定义和摘要预留预算;同一回复会分别保留 Agent 工具上下文与对话历史的压缩标识,并在应用重启或较早消息滚出本地历史窗口后继续复用摘要。
- [x] **Main-only 凭据保护**:API Key 使用系统安全存储加密,不暴露给 Renderer。密钥随对应模型连接保存,修改服务地址或临时切换为无需认证不会要求重新输入;只有用户显式清除凭据或删除连接时才移除。
- [x] **OpenCode Runtime 定制**:GoodBuddy 管理的内置 OpenCode 可发现原生 Agents、Tools、Commands、LSP、Formatters、MCP、Skills、Prompts 与 Resources;Tools 单独显示读取、文件修改、命令、网络、Agent 编排等类型、来源及 Ask/Execute 可用性,并隐藏 OpenCode 内部 `invalid` 与 GoodBuddy 临时 MCP 工具。支持保存默认 Agent、每次请求覆盖 Agent、通过原生 SDK 执行 Command、显示上下文用量并调用有总时限的原生 Compact;并发外部 Server 对话的提问使用请求级公开 ID 映射,回答不会串到其他会话。外部 OpenCode Server 只报告连接状态,不宣称原生清单可读。任意插件安装、Session Share、自动 Worktree 和 OpenCode 原生会话持久化仍不开放。
- [x] **Continue Runtime 定制**:提供静态配置中的原生 Rules、Prompt 模板与 MCP 清单,以及可编辑的 GoodBuddy Rules/Prompt 配置预设;聊天可按请求选择预设和填入可继续编辑的 Prompt。当前 Continue Host 没有可信的静态原生 Tool 发现接口,且使用隔离的 `CONTINUE_GLOBAL_DIR`,因此界面明确标记 Tools 不支持静态发现,也不把 Host 实际不会加载的工作区或用户 Skills 冒充原生能力;GoodBuddy 分配的 Skills 仍按请求暂存执行。Continue 临时 Host 不复用原生会话压缩,手动压缩由 GoodBuddy 摘要模型完成并验证持久化摘要覆盖范围;Agent 交互提问转换为统一问答卡片。Resources、Hooks、后台 Job 和 Continue 原生会话管理继续暂缓。
- [x] **Runtime 原生清单语义**:原生能力以 Agents、Tools、Commands、Skills、MCP、Rules、Prompts、Resources、LSP、Formatters 和上下文 11 个页签展示;清单状态独立于 Runtime 连通性,区分完整、部分、不可用、仅连接和不支持。DeepSeek Harness 通过 Host Registry 枚举有界的内置/插件 Tools 与 Skills,显示真实 Ask/Execute 边界,并排除 GoodBuddy 按请求分配的 Skills、Web/MCP 代理。
- [ ] **Runtime 监督栏目**(规划中):在应用级助手工作栏的固定 Runtime 栏目统一承载 OpenCode、Continue 和 DeepSeek Harness 的 Task 级委派、后台执行、Workflow/Hook、长任务与原生会话监督;用户只选择 Conversation 或 Task,Job/Run 保持内部,不形成树或独立操作对象。
- [ ] **可执行 Subagent**(规划中):提供显式 Execute 委派,限制嵌套、并行、Token、时间和工具权限,在助手工作栏固定的 Runtime 栏目按 Task 聚合状态、取消入口和审计归属。
### Agent Runtimes and model connections
### Skills、MCP 与知识库
- [x] **Direct model Runtime**: Supports question answering, knowledge
synthesis, controlled tool execution, and image generation.
- [x] **Direct model programming agent**: Local direct text models can run the
platform Shell in Execute mode and delegate one level of programming
Subagent work while inheriting the parent request's mode, model, workspace,
and capability scope. OpenCode, Continue, DeepSeek Harness, and managed SSH
do not receive duplicate copies of these tools. The Windows local command
path and a real-model edit, test, fix, and review loop have passed; native
macOS and Linux command validation remains.
- [x] **OpenCode and Continue**: Use isolated child processes, an environment
variable allowlist, unified configuration, cancellation, total execution
limits, bounded streaming output, and activity records. Shared process
cleanup preserves complete Windows process-tree termination and terminates
POSIX process groups when a child uses an independent process group. Chat
status checks use a one-shot Runtime probe that is immediately cleaned up
rather than entering the model-and-project execution cache. Execution
Runtimes remain reusable per project, so different projects can run in
parallel. Interactive questions are answered only by foreground
conversations; scheduled tasks, remote channels, delegated work, and other
background runs fail immediately with guidance to rerun in the foreground
instead of waiting indefinitely. Local OpenCode startup uses the selected
absolute path directly without checking the file or running `--version`
first; invalid paths fail at actual launch. On managed Linux ARM Hosts,
Runtime activation reuses the registry and manifest verified during setup
instead of rehashing or rechecking the complete OpenCode binary.
- [x] **Managed SSH OpenCode loop (technical preview)**: Controlled by the
separate Remote Projects (Technical Preview) tab under Settings / Platform
Features and disabled by default. Disabling it does not affect local
projects, ordinary desktop capabilities, or desktop releases. When enabled,
users can manage SSH Hosts with pinned Host Keys, browse bounded remote
directories, and create Ask or Execute projects. Ask keeps the Workspace
read-only at the Runtime boundary through bubblewrap; Execute has all
permissions of the selected SSH account. The Agent owns accepted Prompts,
provider/tool rounds, Runtime processes, a stable model ledger, and a bounded
semantic transcript over a private Unix socket and ACP v4. Work continues on
the Host after Desktop exit, network loss, or local-process termination.
Reconnection attaches only to the original controller, binding, and
operation, then atomically merges provenance into the original conversation
without resending the Prompt. Model profiles and API keys enter Agent memory
only for the accepted operation and are not written to the Renderer, SSH
arguments, remote environment, or disk. Remote components are not embedded
in the desktop package; switching projects updates only local selection and
does not connect or download. Settings reads a small signed catalog and
reports the local version, latest compatible online version, and update
state for Linux x64/arm64. Downloads occur only after a user action, and
packages can also be imported or exported offline. Each compound `.gbagent`
package contains the Agent, fixed Node, and the compatible OpenCode Runtime
maintained by the desktop source. Online sources follow the GitHub/Beijing
OSS choice in About and Updates. The cumulative signed catalog binds minimum
Desktop version, Agent protocol, architecture, size, SHA-256, and fixed URL.
The public-key registry accepts equivalent JSON whitespace and line endings
while still strictly validating schema, Ed25519 keys, environment, and
revocation; catalog, package, manifest, payload signatures, and streaming
SHA-256 remain unchanged. A missing architecture package disables managed
SSH only for that architecture. Projects store only Host, remote path,
Runtime selection, and mode. Current Host identity is read when a
Workspace/Runtime is first used, then reused by other projects in the same
process. Managed SSH conversations expose only supported OpenCode choices.
Multiple projects and conversations can run concurrently on one Host;
recovery separately reports network, Agent, Runtime, committed-event cursor,
completion, or failure/retry and blocks only the affected project. A real
Linux x64 Host has covered short and long detach, forced local harness exit,
concurrency, SSH relay loss, cancellation, definite and uncertain provider
failure, Agent `SIGKILL`/restart, and recovery from a reopened Desktop SQLite
database. Successful tool START/END events appear exactly once, with no
Prompt, provider, or tool replay observed. The current source lock and
Agent source lock is `0.11.14`, while the current Desktop release candidate
is `0.12.0`; formal publication status follows the separate Agent and Desktop
release channels.
- [x] **Manual SSH Host environment provisioning source path**: After Host Key,
authentication, and system probes succeed, GoodBuddy saves the Host and
read-only probes the shared Agent/Runtime. Saving a Host or opening a project
never installs automatically. A Host card has one primary action based on
version facts, Install Remote Environment, Update Remote Environment, or
Reinstall, plus a secondary SegmentedControl for Auto, Host Download, or
GoodBuddy Transfer. The selection defaults to Auto and is not persisted; a
Version Matched badge does not mean the environment is healthy. Auto probes
only before operation preparation and chooses one acquisition route.
Explicit choices remain in effect, and prepare, commit, or adoption failures
do not silently fall back across acquisition routes. Both routes deliver the
same signed compound `.gbagent` into fixed staging and share control-plane
prepare, commit, Agent activation/health, Runtime activation, finalize, and
explicit cleanup. The GoodBuddy route can download and validate a missing
candidate during the same operation, cache it with a lease, and stream one
archive plus its verified bootstrap Node over bounded SFTP without loading
the roughly 294 MiB package into a Main-process `Buffer`; the Host performs
one complete payload verification while extracting. An unfinished operation
stores only the operation ID needed to clean staging. A later update makes a
best-effort cleanup and starts prepare again, without persisting a remote
metadata copy or allowing cleanup failure to block a new update or roll back
a healthy environment. Existing projects resolve current Host identity on
demand and run a fixed `attach-or-bootstrap`; registered health,
capabilities, and prompt startup do not scan the full payload. See the
[design](./docs/features/remote-host/environment-provisioning-technical-design.md).
- [ ] **Real-Host acceptance for SSH Host environment provisioning**: The
source can use the current format-v1 package. GitHub, Beijing mirror, Linux
x64/arm64, cancellation, and offline GoodBuddy transfer validation remains.
This status does not mean the path is published or has completed real-Host
testing.
- [x] **DeepSeek Harness (preview)**: Uses the fixed GoodBuddy Host and an
OpenAI-compatible model connection. It prefers an administrator-provided
connection, otherwise follows the compatible default model or first
compatible connection without requiring a duplicate selection. Ask permits
only real Host-registered `read` and `skill` tools plus Main-managed Web
Search/Fetch proxies, and rejects plugin impersonation of those names.
Execute allows all enabled built-in and plugin tools with the current user's
permissions. Image input follows the selected model connection's declared
capability: text models reject images before Host or model invocation, while
image-capable models receive bounded inline JPEG/PNG content through a
temporary Attachment Store.
- [x] **DSH npm plugin marketplace**: Disabled by default and searches public
npm `dsh-plugin` packages only after explicit user enablement. It uses the
bundled npm to install exact versions with ordinary lifecycle scripts and
supports enable/disable, JSON configuration, removal, automatic disablement
after startup failure, and offline management of installed plugins.
Disabling the marketplace hides only the catalog and management interface;
it does not change the enabled state of installed plugins, and third-party
code is not subject to Ask initialization isolation.
- [x] **Ask and Execute work modes**: Ask remains read-only. Execute is the
user's authorization for all tools, processes, network access, and writable
paths available to the current local or SSH account.
- [x] **Experts and Subagents**: Supports explicit experts, team analysis, and
up to three read-only experts running in parallel. Chat shows each
expandable full expert response first and the main Agent's synthesis below,
and persists both with the conversation.
- [x] **Role-bound model connections**: Each role can inherit the default model
or select an independent text-model connection. Invalid connections safely
fall back to the default; the synthesis role always inherits the default.
- [x] **Multiple model protocols**: Supports Anthropic Messages, OpenAI
Responses, OpenAI Chat Completions, OpenAI Images, and unauthenticated local
models. New users receive a local Ollama-compatible default and no
preconfigured third-party cloud provider. During upgrades, GoodBuddy
replaces a historical default only when it has never received credentials
and still exactly matches the old built-in value; explicitly saved
connections and encrypted credentials remain unchanged. Existing
deployments that supply credentials only through compatible environment
variables retain their historical connection parameters, while generic
model environment variables still take precedence. Save and Test Model sends
a bounded real text or image-generation request and validates the generated
result instead of testing HTTP reachability alone, so it may incur a small
provider usage charge.
- [x] **Context usage and automatic compaction**: Direct models update usage
from each successful provider call. Images and tool rounds use the same
accounting, with estimation only when the provider omits usage. The UI
distinguishes This Model Call from Post-Compaction Conversation Estimate,
and the compaction line is recalculated from current settings and the
selected model window rather than storing old configuration per
conversation. Before/after compaction markers use one estimation method,
while activity history retains provider usage for each call. Conversations
and multi-round tool Agents can compact repeatedly after a completed call
crosses the threshold, reserving budget first for fixed prompts, tool
definitions, and summaries. One response separately preserves compaction
markers for Agent tool context and conversation history, and summaries remain
reusable after app restart or when older messages leave the local history
window.
- [x] **Persistent credential protection**: Main encrypts API keys with secure
system storage and never exposes them to the Renderer. A managed SSH accepted
Prompt places the current profile and key in Agent memory only, never in SSH
arguments, the remote environment, or disk; other paths keep credentials
inside Main. Credentials remain attached to their model connection when the
service URL changes or authentication is temporarily disabled, and are
removed only when the user explicitly clears them or deletes the connection.
- [x] **Bounded failure diagnostics**: Desktop stores a fixed allowlist of
startup, Runtime, and remote-connection failure stages in the user-data
directory, rotating at four 256 KiB files. Each GoodBuddy Agent rotates
daemon, connection, recovery, and Runtime lifecycle diagnostics at three
64 KiB files in its private installation state and exposes them through the
fixed `diagnostics --installation-id` command. Both sides store only
allowlisted stages, stable error codes/types, and fixed short messages, never
Prompts, credentials, file contents, paths, environments, SSH arguments, or
raw provider responses. Diagnostic-write failure does not alter normal
operation.
- [x] **OpenCode Runtime customization**: GoodBuddy-managed OpenCode can
discover native Agents, Tools, Commands, LSPs, Formatters, MCP, Skills,
Prompts, and Resources. Tools show read, file-edit, command, network, Agent
orchestration, and other types, source, and Ask/Execute availability while
hiding OpenCode's internal `invalid` tool and temporary GoodBuddy MCP tools.
Users can save a default Agent, override it per request, run Commands through
the native SDK, view context usage, and invoke native Compact with a total
timeout. Questions from concurrent external Server conversations are mapped
by public request ID so answers cannot cross conversations. External
OpenCode Servers report connection state only and do not claim native
catalog access. Arbitrary plugin installation, Session Share, automatic
Worktree, and OpenCode native-session persistence remain unavailable.
- [x] **Continue Runtime customization**: Exposes native Rules, prompt
templates, and MCP from static configuration plus editable GoodBuddy Rules
and Prompt presets. Chat can select a preset per request and insert an
editable Prompt. The current Continue Host has no trustworthy static native
Tool discovery API and runs with an isolated `CONTINUE_GLOBAL_DIR`, so the UI
explicitly marks static Tool discovery unsupported and does not present
workspace or user Skills that the Host will not load as native capabilities.
GoodBuddy-assigned Skills still execute through per-request staging. The
temporary Continue Host does not reuse native session compaction; manual
compaction uses the GoodBuddy summary model and verifies persisted summary
coverage. Agent questions become unified question cards. Resources, Hooks,
background Jobs, and Continue native-session management remain deferred.
- [x] **Native Runtime catalog semantics**: Native capabilities are displayed
across 11 tabs: Agents, Tools, Commands, Skills, MCP, Rules, Prompts,
Resources, LSP, Formatters, and Context. Catalog state is independent from
Runtime connectivity and distinguishes complete, partial, unavailable,
connection-only, and unsupported. DeepSeek Harness enumerates bounded
built-in/plugin Tools and Skills through the Host Registry, reports real
Ask/Execute boundaries, and excludes per-request GoodBuddy Skills and
Web/MCP proxies.
- [ ] **Runtime supervision section** (planned): A fixed section in the
application-level assistant workbar for Task-level delegation, background
execution, Workflows/Hooks, long-running work, and native-session
supervision across OpenCode, Continue, and DeepSeek Harness. Users select
only Conversation or Task; Job/Run remains internal rather than becoming a
tree or independent object.
- [ ] **Executable Subagents** (planned): Explicit Execute delegation with
bounded nesting, parallelism, tokens, time, and tool permissions, aggregated
by Task in the workbar's fixed Runtime section with cancellation and audit
ownership.
- [x] **Skills 按需接入**:可分配给直连模型、OpenCode、Continue 和 DeepSeek Harness,并使用有界资源和受控 Runtime 边界。
- [x] **内置 MCP 按需接入**:知识库、魔法笔记与 GoodBuddy 配置 MCP 可分别启停,并可分配给直连模型、GoodBuddy 管理的 OpenCode 和 Continue;DeepSeek Harness 在设置中明确显示为暂不支持。内置 MCP 仅通过当前请求的短期本机权限提供,Ask / Execute 读写边界不受用户配置放宽。
- [x] **MCP Tools**:显式启用的自定义 MCP 可按 Runtime 分配给直连模型、GoodBuddy 管理的 OpenCode、Continue Agent Execute 和 DeepSeek Harness,并仅在 Execute 加载;Agent 子进程只获得按请求签发的本机回环权限,MCP 地址、命令和凭据保留在 Main,动态工具仍会重新发现并经过现有执行记录与权限边界。
- [x] **MCP Prompts 与 Resources 元数据**:MCP 测试仅在 Server 声明对应能力时发现有界的 Prompt、参数与 Resource 元数据,不读取 Resource 内容;Runtime 支持的 Prompt 可填入聊天草稿后继续编辑。OpenCode 可报告实验性 Resource 清单,Continue 当前版本明确不支持 Resources。
- [x] **本地知识库**:支持文件、目录和网页导入、SQLite FTS5 检索及来源追溯。
- [x] **知识图谱**:支持规则、模型和混合抽取,以及实体、关系、别名和证据维护。
- [x] **向量模型配置与检索**:可配置兼容 Embeddings 接口并用于语义检索。
- [x] **向量诊断与索引任务**:提供真实向量生成诊断、按文档重建进度、取消、失败状态与重启后结果恢复;每篇成功文档立即可用于检索。
- [x] **混合检索测试台**:支持全文、中文词组、向量和图谱通道诊断,可调 Top K、阈值、权重、本地或学习型重排及上下文预算。
- [x] **分块、维护与评估**:支持固定、结构化和父子分块,分块维护、可取消重建及双语检索评估。
- [x] **受控知识本体**:每个知识库可定义实体、关系、别名和端点约束,保留证据偏移、置信度和抽取来源,并显式提示图谱重建。
- [x] **强制检索与引用上下文**:对话可按需或每次先检索,显示零结果、降级、失败与取消状态,并可查看引用上下文或安全打开来源。
- [x] **魔法笔记 / Magic Notes**:提供本地优先的笔记与待办工作台、范围管理、编辑、筛选和受控 AI 评论;左侧入口可按设置显示未完成待办数量,创建、保存和评论结果使用统一应用通知。
- [ ] **MCP Server Control Plane**(规划中):统一 MCP 生命周期、健康检查、重连、Schema 缓存、隔离、审批和审计。
- [ ] **可追溯笔记摘录与 AI 编辑**(规划中):从对话、知识和网页收集带来源的摘录,并提供需确认的总结、改写和整理操作。
### Skills, MCP, and knowledge
### 工作管理、长期协作与工作流
- [x] **On-demand Skills**: Assignable to direct models, OpenCode, Continue,
and DeepSeek Harness with bounded resources and controlled Runtime boundaries.
- [x] **Local tool-execution environment source path**: Under Capabilities and
Tools / Tool Environment, users can select GoodBuddy-managed Node.js,
on-demand managed Python, or a genuinely validated custom interpreter for
local Skills and stdio MCP. The page provides an independent Native/OSS
source choice, diagnostics, installation progress, cancellation, and
removal. New local Runtimes and stdio MCP processes receive immutable PATH
snapshots without changing ordinary terminals, the system environment, or
remote Hosts. Managed Node and native-source Python have passed real
installation validation on Windows x64.
- [ ] **Local tool-execution environment release acceptance**: All six
platform/architecture OSS mirror objects have passed public byte, size, and
SHA-256 verification. Managed Python remains an on-demand download and does
not add license files to the Desktop package. Each standard package job uses
a native target-architecture Runner and performs a real managed-Python
install, SSL, pip, and venv probe before packaging; the `0.12.0` candidate
must pass that matrix. Real Skill/MCP execution, custom interpreter
execution, and coordination with affected running processes remain
acceptance work. Six-platform release acceptance must not be claimed before
the applicable checks pass.
- [x] **On-demand built-in MCP**: Knowledge, Magic Notes, and GoodBuddy
configuration MCP can be enabled independently and assigned to direct
models, GoodBuddy-managed OpenCode, and Continue. Settings explicitly marks
DeepSeek Harness unsupported. Built-in MCP uses short-lived local authority
for the current request, and user configuration cannot loosen Ask/Execute
read/write boundaries.
- [x] **MCP Tools**: Explicitly enabled custom MCP can be assigned to direct
models, GoodBuddy-managed OpenCode, Continue Agent Execute, and DeepSeek
Harness, and loads only in Execute. Agent child processes receive only
per-request local-loopback authority; MCP addresses, commands, and
credentials remain in Main. Dynamic tools are still rediscovered and pass
through existing activity and permission boundaries.
- [x] **MCP Prompts and Resource metadata**: MCP testing discovers bounded
Prompt, parameter, and Resource metadata only when the Server declares the
corresponding capability and does not read Resource content. Supported
Prompts can be inserted into the chat draft for further editing. OpenCode can
report an experimental Resource catalog; the current Continue version
explicitly does not support Resources.
- [x] **Local knowledge bases**: Supports file, directory, and web imports,
SQLite FTS5 retrieval, and source tracing.
- [x] **Knowledge graph**: Supports rule-based, model-based, and hybrid
extraction plus entity, relationship, alias, and evidence maintenance.
- [x] **Embedding configuration and retrieval**: Configures compatible
Embeddings endpoints and uses them for semantic retrieval.
- [x] **Embedding diagnostics and indexing jobs**: Provides real embedding
diagnostics, per-document rebuild progress, cancellation, failure state, and
result recovery after restart. Each successful document becomes immediately
searchable.
- [x] **Hybrid retrieval workbench**: Diagnoses full-text, Chinese phrase,
vector, and graph channels with configurable Top K, thresholds, weights,
local or learned reranking, and context budgets.
- [x] **Chunking, maintenance, and evaluation**: Supports fixed, structured,
and parent-child chunking, chunk maintenance, cancellable rebuilds, and
bilingual retrieval evaluation.
- [x] **Controlled knowledge ontology**: Each knowledge base can define
entities, relationships, aliases, and endpoint constraints while retaining
evidence offsets, confidence, and extraction source, with explicit guidance
to rebuild the graph.
- [x] **Required retrieval and cited context**: Conversations can retrieve on
demand or before every response, show zero-result, degraded, failed, and
cancelled states, and expose cited context or safely open its source.
- [x] **Magic Notes**: A local-first notes and todo workbench with scope
management, editing, filtering, and controlled AI comments. The left
navigation can show the incomplete-todo count, and create, save, and comment
results use application-wide notifications.
- [ ] **MCP Server Control Plane** (planned): Unified MCP lifecycle, health
checks, reconnection, schema cache, isolation, approval, and audit.
- [ ] **Traceable note excerpts and AI editing** (planned): Collects sourced
excerpts from conversations, knowledge, and the web and provides
confirmation-based summarization, rewriting, and organization.
- [x] **任务、活动与成果**:集中管理任务状态、审计活动和独立成果文件;普通聊天回复只保留在会话中,不再自动复制到成果栏,已有重复聊天 Markdown 从成果列表隐藏但不物理删除。Token 用量按 Runtime 与模型归类,并针对 OpenAI 兼容与 Anthropic Messages 的不同上报口径归一化展示缓存命中率;活动按会话分组并默认收起,避免长历史占满页面。
- [x] **Task 与定制任务体验**:每个产品级 Task 只关联一条 Conversation,一条 Conversation 可承载多个 Task;左侧会话列表通过行首展开按钮显示带共享状态点的 Task 子项,父会话行不重复任务标签,UI 只展示到 Task,不暴露 Job/Run 层级。新建定制任务可关联当前或新 Conversation,默认 Execute 并沿用 Runtime、工具和审批边界;重复触发复用同一 Task,文本结果回写 Conversation,独立文件和图片保留为成果。普通消息与到期 Scheduled Task 共用 Conversation 级持久发送队列,同一会话一次只执行一项;当前回复期间仍可继续发送,队列按顺序续跑,并允许删除或“立即中断并插入”。Task Center 继续作为完整索引,不建设独立 Automation Center。当前计划触发支持单次、每日和每周;高级时区、Cron、事件触发与重试治理仍按 PRD 逐步实现。详见 [Task Center PRD](./docs/prd/task-and-job/task-center-prd.md) 和 [Scheduled Task PRD](./docs/prd/task-and-job/scheduled-task-prd.md)。
- [x] **记忆与智能心跳**:当前提供周期回顾、建议记忆、洞察、后续任务和可审计运行轨迹。
- [x] **智能心跳入口与范围改善**:将“智能心跳 > 心跳计划”作为完整配置的唯一权威入口,支持创建和编辑 Global 或指定一个、多个 Project 的计划;旧单项目配置无损迁移,项目级记忆与行动输出必须显式指定范围内的 Project。Task Center 和设置不再复制心跳表单。“未来分区记忆”仍只是尚待独立设计的长期方向。详见 [智能心跳 PRD](./docs/prd/smart-heartbeat/smart-heartbeat-prd.md)。
- [ ] **通用监督**(规划中):通过固定监督栏目观察用户选择的会话、任务、自动化或实验对象,提供带证据的评论与人工介入请求,但不自动发言、批准工具或切换 Execute。详见 [会话监督 PRD](./docs/prd/supervision/conversation-supervision-prd.md)。
- [ ] **批量运行与对比实验室**(规划中):对模型、Prompt、角色和工作流配置执行批量对比,汇总质量、耗时、Token、费用、失败率和成果差异。
- [ ] **时态记忆与事实冲突检测**(规划中):为记忆和知识图谱增加有效期、当前事实、过期与矛盾检测、事实核验及证据回溯。
- [ ] **可视化受控工作流**(规划中):提供版本化 DAG、条件分支、审批、取消和恢复,执行节点继续经过 Main Runtime 边界。
- [ ] **统一 Run Graph 与回放**(规划中):关联任务、Subagent、模型、知识、工具审批、用量和成果,支持失败定位、重试和脱敏导出。
### Work management, long-term collaboration, and workflows
### 浏览器、通信、语音与应用维护
- [x] **Tasks, activity, and artifacts**: Centrally manages task state, audit
activity, and independent artifact files. Ordinary chat responses remain
only in the conversation and are no longer copied into Artifacts; existing
duplicate chat Markdown is hidden from the artifact list but not physically
deleted. Token usage is grouped by Runtime and model and normalizes the
different OpenAI-compatible and Anthropic Messages cache-reporting semantics
when showing cache hit rate. Activity is grouped by conversation and
collapsed by default so long histories do not fill the page.
- [x] **Task and custom-task experience**: Each product-level Task belongs to
one Conversation, while one Conversation can contain multiple Tasks. The
left conversation list exposes Task children through a leading expand
button; children share status dots, the parent does not repeat task badges,
and the UI stops at Task rather than exposing Job/Run levels. A new custom
Task can use the current or a new Conversation, defaults to Execute, and
preserves Runtime, tool, and approval boundaries. Repeated triggers reuse the
same Task; text returns to the Conversation, while independent files and
images remain artifacts. Ordinary messages and due Scheduled Tasks share a
persistent Conversation queue that runs one item at a time. Users can keep
sending while a response is active; queued items continue in order and can
be removed or inserted immediately by interrupting the current item. Task
Center remains the complete index rather than creating a separate Automation
Center. Current schedules support one-time, daily, and weekly triggers;
advanced time zones, Cron, event triggers, and retry governance remain
incremental PRD work. See the
[Task Center PRD](./docs/features/task-and-job/task-center-prd.md) and
[Scheduled Task PRD](./docs/features/task-and-job/scheduled-task-prd.md).
- [x] **Memory and Smart Heartbeat**: Provides periodic review, suggested
memories, insights, follow-up tasks, and auditable run history.
- [x] **Improved Smart Heartbeat entry and scope**: Smart Heartbeat / Heartbeat
Plans is the sole authoritative full-configuration entry. Plans can be
created and edited for Global or one or more selected Projects. Legacy
single-project settings migrate without loss, and project-level memory and
action output must explicitly target a Project in scope. Task Center and
Settings no longer duplicate the form. Future partitioned memory remains an
independently designed long-term direction. See the
[Smart Heartbeat PRD](./docs/features/smart-heartbeat/prd.md).
- [ ] **General supervision** (planned): Uses a fixed supervision section to
observe user-selected conversations, Tasks, automations, or experiments and
provide evidence-backed comments and requests for human intervention,
without automatically speaking, approving tools, or switching to Execute.
See the
[Conversation Supervision PRD](./docs/features/conversation-supervision/prd.md).
- [ ] **Batch runs and comparison lab** (planned): Compares model, Prompt,
role, and workflow configurations in batches and summarizes quality,
duration, tokens, cost, failure rate, and artifact differences.
- [ ] **Temporal memory and fact-conflict detection** (planned): Adds validity
periods, current/expired/conflicting fact detection, fact checking, and
evidence tracing to memory and the knowledge graph.
- [ ] **Visual controlled workflows** (planned): Versioned DAGs, conditional
branches, approvals, cancellation, and recovery, with execution still
passing through Main Runtime boundaries.
- [ ] **Unified Run Graph and replay** (planned): Connects Tasks, Subagents,
models, knowledge, tool approvals, usage, and artifacts for failure
diagnosis, retry, and redacted export.
- [x] **直连模型内置浏览器**:使用 GoodBuddy 内置的隔离 Chromium,不控制客户端已安装的浏览器;用户通过独立总开关决定是否提供给 Execute,开启后不逐次询问。
- [x] **客户端电脑控制工具**:与内置浏览器分开管理,并保留范围、取消、超时、输出边界和执行记录。
- [x] **远程消息通道项目**:微信 ClawBot、企业微信和钉钉分别拥有系统管理的项目、独立远程会话、工作目录、处理后端、默认 Ask/Execute 模式及任务活动归属;完整回复交由各通道按平台能力控制长度与分段,不再由公共服务统一截断。
- [x] **微信 ClawBot 扫码与媒体**:通过独立 Sidecar 完成本机扫码、验证码、加密凭据和文字收发;支持个人微信私聊图片与文件,单条消息最多 4 个附件、解密后合计不超过 12MB。
- [x] **微信安全回传**:支持返回当前任务生成的图片,或在用户明确要求时将本次最终文本生成为 Markdown 附件;不自动读取或发送已有工作区文件。
- [x] **企业微信与钉钉连接**:支持 Main-only 加密设置、环境变量只读覆盖、连接测试、动态启停、发送者范围和状态诊断。
- [x] **受管本地模型下载源**:在“平台功能 / 通用设置”中为后续语音输入与 OCR 模型下载全局选择 ModelScope(默认)或 Hugging Face;所选来源缺少完整已验证文件时明确不可用,不静默换源或混合文件。
- [x] **可选本地语音模型管理**:应用不内置模型权重;提供校验下载、进度与取消、来源链接、ZIP 或本地目录导入、切换和删除。
- [x] **本地录音与离线转写**:采集麦克风音频并使用已选择的本地模型离线转写,支持停止、取消、状态反馈和资源释放。
- [x] **版本检查与镜像节点**:在“关于与更新”中选择 GitHub(默认)或镜像节点;手动检查、启动时检查和下载页使用同一选择,并只读取固定可信的发布索引,不自动下载或安装。
- [x] **应用内反馈**:在“关于与更新”中直接提交问题、建议或体验反馈,支持可选邮箱和单张截图;失败后保留草稿并按同一请求编号重试,不自动附加对话、日志、文件、配置或凭据。
- [x] **内网兼容模式**:默认开启;允许应用内 HTTP 与无效、自签名或过期的 HTTPS 证书,关闭后恢复严格地址和证书校验。
### Browser, communication, voice, and application maintenance
### 开源、构建与发布
- [x] **Built-in browser for direct models**: Uses GoodBuddy's isolated
Chromium and never controls a browser installed by the user. A separate
master switch decides whether Execute receives the capability, with no
per-use prompt after enablement. The Browser workbar and Agent share the same
Conversation-owned session and serialized operation path, with Back,
Refresh/Stop Loading, address entry, Go, Interaction, and Close actions.
Stop Loading does not close the session, and user navigation changes the
page the Agent sees next.
- [x] **Client-computer control tools**: Managed separately from the built-in
browser with scope, cancellation, timeout, output, and activity boundaries.
- [x] **Remote messaging-channel projects**: WeChat ClawBot, WeCom, and
DingTalk each have a system-managed project, independent remote
conversations, working directory, processing backend, default Ask/Execute
mode, and task/activity ownership. Each channel controls complete-response
length and segmentation according to platform capabilities rather than
relying on a shared service truncation.
- [x] **WeChat ClawBot QR login and media**: A separate Sidecar handles local
QR scanning, verification codes, encrypted credentials, and text messaging.
Personal WeChat chats support images and files, with at most four
attachments and 12 MB total after decryption per message.
- [x] **Safe WeChat responses**: Can return images generated by the current
task, or generate a Markdown attachment from the current final text after an
explicit user request. It never automatically reads or sends existing
workspace files.
- [x] **WeCom and DingTalk connections**: Main-only encrypted settings,
read-only environment-variable overrides, connection tests, dynamic
enable/disable, sender scope, and status diagnostics.
- [x] **Managed local-model download source**: Platform Features / General
selects ModelScope (default) or Hugging Face globally for future speech-input
and OCR model downloads. A source without a complete verified file is
explicitly unavailable and never silently falls back or combines files.
- [x] **Optional local speech-model management**: Model weights are not bundled.
Provides verified downloads, progress and cancellation, source links, ZIP or
local-directory import, switching, and removal.
- [x] **Local recording and offline transcription**: Captures microphone audio
and transcribes with the selected local model, with stop, cancel, state
feedback, and resource cleanup.
- [x] **Version checks and mirror source**: About and Updates selects GitHub
(default) or the mirror. Manual checks, startup checks, and the download page
use the same choice and read only fixed trusted release indexes; GoodBuddy
does not automatically download or install updates.
- [x] **In-app feedback**: About and Updates can submit problems, suggestions,
or experience feedback with an optional email and one screenshot.
Diagnostics are not uploaded by default; users can explicitly attach a
bounded recent Desktop diagnostic summary. Failed submission preserves the
draft, diagnostic choice, and request ID. Conversations, Prompts,
credentials, file contents, paths, raw provider responses, and remote Agent
logs are never attached.
- [x] **Private-network compatibility mode**: Enabled by default and permits
in-app HTTP plus invalid, self-signed, or expired HTTPS certificates.
Disabling it restores strict address and certificate validation.
- [x] **0BSD 开源许可**:原创代码可自由使用、复制、修改、分发和商用;第三方组件和资源仍遵循各自许可证。
- [x] **可复现依赖安装与源码构建**:使用锁定依赖、Node.js 24 和统一的测试、类型检查、Lint、生产构建命令。
- [x] **六平台原生发布矩阵**:Windows、macOS、Linux 的 `x64`、`arm64` 目标由原生 Runner 构建,并提供发布清单和 SHA-256 哈希;Linux 同时生成 AppImage、DEB 和 RPM。
### Open source, builds, and releases
### 开放接口、团队协作与远程执行
- [x] **0BSD open-source license**: Original code can be freely used, copied,
modified, distributed, and commercialized. Third-party components and
resources retain their own licenses.
- [x] **Reproducible dependency installation and source builds**: Uses locked
dependencies, Node.js 24, and unified test, type-check, lint, and production
build commands.
- [x] **Six-target native release matrix**: Native runners build Windows,
macOS, and Linux `x64` and `arm64` targets with release manifests and SHA-256
hashes. Linux also produces AppImage, DEB, and RPM.
- [x] **远程任务委派**:仅在用户显式配置端点和令牌后启用,按全局内网兼容模式使用 HTTP(S),结果进入持久化发件箱。
- [ ] **Headless Runtime API**(规划中):提供本机优先的任务、事件、状态和成果 API,以及有范围、有效期、限流和撤销能力的令牌。
- [ ] **GoodBuddy Team Hub**(规划中):以可选服务提供组织、RBAC、项目共享、远程 Agent、策略下发和租户审计。
- [ ] **SSH 主机与远程执行空间发布验收**:主机 CRUD、Host Key、加密凭据、Project UI、Workspace、OpenCode ACP、Main-only 模型桥、Ask 只读、Execute 完整账号权限、取消、detached Agent 重连和 release-only 双架构资源校验已经接线。Windows 到 Linux x64 的真实 Host provider-free 安装、metadata-only Portable 复用与项目保存、桥接、断线恢复、输出重放、同 Session 续接与清理已经通过;Agent 0.11.2-e2e.12 与 OpenCode Runtime 1.18.9 的真实模型 Ask 验收也已通过,单次用户操作只执行一个原生 read,两个 build 模型轮次均完成交付,没有 title 轮次或请求重放。公开 signing key registry 已供应。剩余门槛是生成并导入 Linux x64/arm64 当前发布版本的正式签名工件完整矩阵。门槛未满足时不提供未验证 SSH fallback。
- [ ] **多云远程沙盒 Agent**(规划中):通过云厂商 API 和 SSH Agent 管理专用 Linux 沙盒;凭据留在 Main 进程,高风险控制面操作单独确认。
### Open interfaces, team collaboration, and remote execution
## 规划原则
- [x] **Remote task delegation**: Enabled only after the user explicitly
configures an endpoint and token, uses HTTP(S) according to the global
private-network compatibility setting, and writes results to a persistent
outbox.
- [ ] **Headless Runtime API** (planned): A local-first Task, event, state, and
artifact API with scoped, expiring, rate-limited, and revocable tokens.
- [ ] **GoodBuddy Team Hub** (planned): An optional service for organizations,
RBAC, project sharing, remote Agents, policy distribution, and tenant audit.
- [ ] **SSH Host and remote execution-space release acceptance**: Host CRUD,
Host Key, encrypted credentials, Project UI, Workspace, OpenCode ACP v4,
Agent-owned Prompt/gateway/transcript, read-only Ask, full-account Execute,
cancellation, exact detached-Agent reconnection, and release-only
dual-architecture resource verification are wired. Current Linux x64 source
has passed a real-model and tool matrix covering detach, process exit, relay
loss, concurrency, cancellation, provider failures, Agent restart, and
Desktop SQLite recovery. The final `0.11.14` test-signed package again
verified two delivered model rounds, one tool, one terminal state,
`latest=ACK`, and no owner/journal residue. The public signing-key registry is
provisioned. Direct control-plane source does not wait for a new
installer-bearing package, but the current formally signed Linux x64/arm64
artifact matrix still requires public verification, along with
GitHub/Beijing mirror, dual-architecture, and offline GoodBuddy transfer
release acceptance. Until these gates pass, this path must not be described
as published or as having passed formal release acceptance.
- [ ] **Multi-cloud remote sandbox Agents** (planned): Manages dedicated Linux
sandboxes through cloud-provider APIs and SSH Agents. Credentials remain in
Main, and high-risk control-plane operations receive separate confirmation.
规划中的工作流、Subagent、MCP、远程 API 和沙盒能力不得绕过现有 Main Runtime、Ask/Execute、权限、取消、超时和审计边界。
## Roadmap Principles
Planned workflows, Subagents, MCP, remote APIs, and sandbox capabilities must
not bypass existing Main Runtime, Ask/Execute, permission, cancellation,
timeout, or audit boundaries.
+112
View File
@@ -0,0 +1,112 @@
# GoodBuddy 功能矩阵与路线图
[English](./FEATURES.md) | **简体中文**
本文记录 GoodBuddy 的已提供能力和路线图。未完成项目不代表已包含在当前版本中。
## 状态说明
- [x] 已提供
- [ ] 开发中或规划中,具体以条目标注为准
## 功能总表
### 桌面基础、工作空间与上下文
- [x] **跨平台桌面应用**:支持 Windows、macOS、Linux,以及 `x64`、`arm64` 发布目标。
- [x] **可配置全局快捷唤起**:在“平台功能 / 通用设置”中启停或录制 Electron accelerator;默认保留 `CommandOrControl+Shift+Space`,冲突或保存失败时继续使用上一组已注册快捷键,并显示可处理的状态。
- [x] **Projects、独立对话与会话分支**:按项目隔离上下文,管理会话、附件和 Git 工作区变更;本地会话可在稳定状态下复制当前聊天内容到独立分支,分支持续显示来源徽标且不复制 Task、队列或成果归属;项目选择器区分本地、托管 SSH 与远程消息通道项目,托管 SSH 项目按 Host 分组并在 Host 标题显示真实 Agent 连接状态,项目行只保留远端路径。
- [x] **文件、截图、窗口、剪贴板上下文**:用户明确选择后才加入模型上下文。
- [x] **富文本回答**:支持 GitHub Flavored Markdown、LaTeX 数学公式和受控 Mermaid 图表;大图可缩放、拖动或查看源码,失败时保留原始图表代码。
- [x] **AI 回复与完整会话复制**:已完成的 AI 回复可从消息底部复制不含推理、工具日志和引用元数据的 Markdown 原文;完整会话复制复用同一条经过 Preload/Main 校验的剪贴板路径。
- [x] **助手工作栏、多终端与可调布局**:右侧工作栏使用持久“+”能力目录和应用 Tab;用户可为当前本机或托管 SSH 项目打开多个独立终端,获得有界输出、调整尺寸、结束与显式重连。关闭终端 Tab 会结束 Shell,应用重启只恢复已结束的 Tab 描述,不自动重启 Shell。主侧栏和魔法笔记列表支持鼠标与键盘调宽,魔法笔记列表可隐藏并记住布局,窄宽度下自动堆叠。
- [ ] **项目 Agent Space**(规划中):在 Project 中统一角色、知识、Skills/MCP、模型、审批策略、预算和超时,并支持模板复用。
- [ ] **通用助手工作栏与执行空间后续能力**(规划中):在现有工作栏和多终端基础上继续加入监督、统一 Runtime、受管进程、静态安全 HTML 预览、可固定目标的工作区/浏览器/成果实例、底部停靠与独立窗口。Task Center 保持 Task 的单例索引,附件与知识库继续由会话输入区管理,未来的记忆与历史执行上下文归入关联 Task。详见 [Feature PRD](./docs/features/assistant-workbar/prd.md)。
### Agent Runtime 与模型连接
- [x] **直连模型 Runtime**:支持问答、知识总结、受控工具执行和图像生成。
- [x] **直连模型编程 Agent**:本机直连文本模型可在 Execute 模式运行平台 Shell,并可按父请求模式、模型、工作区和能力范围委派一层编程 Subagent;OpenCode、Continue、DeepSeek Harness 和托管 SSH 不重复注入这两个工具。Windows 本机命令与真实模型“修改、测试、修复、复核”闭环已通过,macOS 与 Linux 真机命令仍待对应平台验收。
- [x] **OpenCode 与 Continue**:使用隔离子进程、环境变量白名单、统一配置、取消、总执行时限、有界流式输出和活动记录;共享进程回收逻辑保留 Windows 完整进程树终止,并对采用独立进程组的 POSIX 子进程执行组回收。聊天状态检查使用一次性探测 Runtime 并在返回后立即回收,不进入按模型与项目隔离的执行 Runtime 缓存;执行 Runtime 仍按项目复用,因此不同项目可并行。交互提问只由前台对话回答,定时任务、远程通道和委派等后台执行遇到提问时会立即失败并提示改为前台运行,避免无限等待。本机 OpenCode 启动时直接使用已选择的绝对路径,不预先检查文件或运行 `--version`,路径失效时由实际启动返回错误;托管 Linux ARM Host 激活 Runtime 时复用准备阶段已验证的 registry 和 manifest,不重新哈希或检查完整 OpenCode 二进制。
- [x] **托管 SSH OpenCode 闭环(技术预览)**:该能力由“设置 > 平台功能”中的独立“远程项目(技术预览)”页签控制并默认关闭;关闭时不影响任何本地项目、普通桌面功能或桌面发布。启用后可管理固定 Host Key 的 SSH Host、浏览有界远端目录并创建 Ask/Execute 项目;Ask 在 Runtime 边界通过 bubblewrap 保持 Workspace 只读,Execute 使用所选 SSH 账号的完整权限。Agent 通过私有 Unix socket 和 ACP v4 持有 accepted Prompt、Provider/工具轮次、Runtime 进程、稳定模型 ledger 与有界语义 transcript;Desktop 退出、网络中断或本机进程结束后 Host 继续执行,重启后只 attach 原 controller/binding/operation 并把 provenance 原子归并回原对话,不重发 Prompt。模型 profile 与 API Key 只在当前 accepted operation 生命周期内进入 Agent 内存,不写入 Renderer、SSH 参数、远端环境或磁盘。远端组件不嵌入桌面包,项目切换只更新本地选择且不会连接或下载;设置页只读取小型签名目录并按 Linux x64/arm64 显示本地版本、在线最新兼容版本和“有更新/已是最新”,用户点击后才下载签名 `.gbagent`,也可导入/导出离线包。每个复合包包含 Agent、固定 Node 与由桌面源码统一维护适配的 OpenCode Runtime;在线来源跟随“关于与更新”的 GitHub/北京 OSS 选择,签名累计目录绑定最低桌面版本、Agent 协议、架构、大小、SHA-256 和固定 URL。公钥 registry 接受等价 JSON 空白和换行,但仍严格校验 schema、Ed25519 key、环境与撤销;目录、包、manifest、payload 签名和流式 SHA-256 不变。缺少某架构包只使该架构托管 SSH 不可用。项目只保存 Host、远端路径、Runtime 选择和模式;首次实际使用 Workspace/Runtime 时读取 Host current identity,同一进程内其他项目复用已确认 identity 和 Agent 连接。托管 SSH 会话只显示支持的 OpenCode 选择。同一 Host 可并行运行多个项目和对话;恢复进度分别显示网络、Agent、Runtime、已提交事件 cursor、完成或失败/重试,只阻塞受影响项目。Linux x64 真实 Host 已覆盖短/长 detach、本机 harness 强制结束、并发、SSH relay 丢失、取消、确定/不确定 Provider 失败、Agent `SIGKILL`/重启和 reopened Desktop SQLite 恢复;成功工具 START/END 各一次,未发现 Prompt、Provider 或工具重放。当前 Agent 源码 lock 为 `0.11.14`,Desktop 发布候选为 `0.12.0`;正式发布状态以 Agent 与 Desktop 的独立发布渠道为准。
- [x] **SSH Host 手动环境准备源码链路**:Host Key、认证和系统探针成功后先保存 Host,并只读探测共享 Agent/Runtime;保存 Host、打开项目都不自动安装。Host 卡片只有一个按版本事实显示“安装远程环境”“更新远程环境”或“重新安装”的主按钮,次级 SegmentedControl 选择默认且不持久化的“自动”、Host 下载或 GoodBuddy 传输;“版本匹配”badge 不等同环境健康。自动模式只在 operation/prepare 前探测并择一,显式选择保持有效,任何 prepare、commit 或 adoption 失败都不跨 acquisition 自动 fallback。两种方式把同一签名 compound `.gbagent` 交付到固定 staging 后,共用 control-plane prepare、commit、Agent activate/health、Runtime activate、finalize 与显式 cleanup。GoodBuddy 路径可在同一次操作下载并验证缺失候选、缓存并取得 lease,再有界流式 SFTP 上传一个归档和其中已验证的 bootstrap Node,不把约 294 MiB 整包读入 Main `Buffer`;Host 在解包时完成一次完整 payload 校验。未完成操作只记录暂存 cleanup 所需的 operation ID;下次更新尽力清理旧暂存后重新 prepare,不保存远端 metadata 副本,也不让 cleanup 失败阻塞新更新或回滚健康环境。已有项目在实际使用 Workspace/Runtime 时按需解析 Host current identity 并执行固定 `attach-or-bootstrap`,注册后的 health、capabilities 和 prompt 启动不扫描完整 payload。详见 [设计说明](./docs/features/remote-host/environment-provisioning-technical-design.md)。
- [ ] **SSH Host 环境准备真实 Host 验收**:源码已可使用当前 format v1 包;仍需完成 GitHub、北京镜像、Linux x64/arm64、取消和离线 GoodBuddy 传输的真实 Host 验收。当前状态不表示已发布或已完成真实 Host 测试。
- [x] **DeepSeek Harness(预览)**:使用 GoodBuddy 固定 Host 和 OpenAI 兼容模型连接;优先使用管理员提供的连接,否则跟随兼容的默认模型或首个兼容连接,无需单独重复选择。Ask 只允许调用 Host 中真实注册的 `read`、`skill` 以及 Main 管理的 Web Search/Fetch 代理,拒绝插件同名冒充,Execute 放行全部已启用内置及插件工具,并以当前用户权限运行。图像输入跟随所选模型连接的能力声明,文本模型在 Host 或模型调用前拒绝图片,图片模型通过有界内联内容和临时 Attachment Store 接收 JPEG/PNG。
- [x] **DSH npm 插件市场**:市场默认关闭,由用户显式开启后搜索公共 npm 的 `dsh-plugin` 包,使用捆绑 npm 执行精确版本安装和普通 lifecycle scripts,并支持启停、JSON 配置、移除、失败启动自动停用和离线管理已安装插件;关闭市场只隐藏目录与管理界面,不改变已有插件的启停状态,第三方代码不受 Ask 初始化隔离。
- [x] **Ask 与 Execute 工作模式**:Ask 保持只读;Execute 是用户对当前本机或 SSH 账号可用工具、进程、网络和可写路径的完整授权。
- [x] **专家与 Subagent**:支持显式专家、团队分析和最多三个只读专家并行分析;聊天先展示可逐项展开的专家完整输出,再在其下展示总 Agent 的综合结果,并随会话保存。
- [x] **角色绑定模型连接**:每个角色可继承默认模型或选择独立文本模型连接,失效连接安全回退默认模型,综合角色始终继承默认模型。
- [x] **多协议模型配置**:支持 Anthropic Messages、OpenAI Responses、OpenAI Chat Completions、OpenAI Images 和无认证本机模型;新用户默认连接为本机 Ollama 兼容地址,不预置第三方云模型服务。升级时只替换从未配置凭据且仍完全等于旧内置值的历史默认连接,用户显式保存或加密凭据的连接保持不变;已有部署仅使用兼容环境变量提供凭据时继续沿用对应的历史连接参数,通用模型环境变量仍优先。“保存并测试模型”会发送有界的真实文本或图片生成请求并校验生成结果,而不是只检查 HTTP 连通性,因此可能产生少量服务商用量费用。
- [x] **上下文用量与自动压缩**:直连模型按每次成功调用更新供应商用量,图片与工具轮次使用同一口径,供应商缺失 usage 时才回退估算;界面明确区分“本次模型调用”和“压缩后对话估算”,压缩线始终根据当前设置与所选模型窗口即时计算,不在每个对话中保存旧配置;压缩标识的前后值使用同一估算口径,运行记录仍保留各次模型调用的供应商 usage。对话与多轮工具 Agent 可在已完成调用越过阈值后自动重复压缩,规划时先为固定提示、工具定义和摘要预留预算;同一回复会分别保留 Agent 工具上下文与对话历史的压缩标识,并在应用重启或较早消息滚出本地历史窗口后继续复用摘要。
- [x] **持久凭据保护**:API Key 由 Main 使用系统安全存储加密且不暴露给 Renderer。托管 SSH accepted Prompt 只把当前 profile 与密钥放入 Agent 内存,不写入 SSH 参数、远端环境或磁盘;其他路径仍在 Main 内使用。密钥随对应模型连接保存,修改服务地址或临时切换为无需认证不会要求重新输入;只有用户显式清除凭据或删除连接时才移除。
- [x] **有界故障诊断**:Desktop 在用户数据目录中轮转保存启动、Runtime 和远程连接的固定阶段失败,最多 4 个 256 KiB 文件;GoodBuddy Agent 在各 installation 的私有 state 目录中轮转保存 daemon、连接、恢复和 Runtime 生命周期,最多 3 个 64 KiB 文件,并可通过固定 `diagnostics --installation-id` 命令读取。两端都只记录白名单阶段、稳定错误码/类型和固定短消息,不保存 Prompt、凭据、文件内容、路径、环境、SSH 参数或 Provider 原始响应;诊断写入失败不改变正常运行。
- [x] **OpenCode Runtime 定制**:GoodBuddy 管理的内置 OpenCode 可发现原生 Agents、Tools、Commands、LSP、Formatters、MCP、Skills、Prompts 与 Resources;Tools 单独显示读取、文件修改、命令、网络、Agent 编排等类型、来源及 Ask/Execute 可用性,并隐藏 OpenCode 内部 `invalid` 与 GoodBuddy 临时 MCP 工具。支持保存默认 Agent、每次请求覆盖 Agent、通过原生 SDK 执行 Command、显示上下文用量并调用有总时限的原生 Compact;并发外部 Server 对话的提问使用请求级公开 ID 映射,回答不会串到其他会话。外部 OpenCode Server 只报告连接状态,不宣称原生清单可读。任意插件安装、Session Share、自动 Worktree 和 OpenCode 原生会话持久化仍不开放。
- [x] **Continue Runtime 定制**:提供静态配置中的原生 Rules、Prompt 模板与 MCP 清单,以及可编辑的 GoodBuddy Rules/Prompt 配置预设;聊天可按请求选择预设和填入可继续编辑的 Prompt。当前 Continue Host 没有可信的静态原生 Tool 发现接口,且使用隔离的 `CONTINUE_GLOBAL_DIR`,因此界面明确标记 Tools 不支持静态发现,也不把 Host 实际不会加载的工作区或用户 Skills 冒充原生能力;GoodBuddy 分配的 Skills 仍按请求暂存执行。Continue 临时 Host 不复用原生会话压缩,手动压缩由 GoodBuddy 摘要模型完成并验证持久化摘要覆盖范围;Agent 交互提问转换为统一问答卡片。Resources、Hooks、后台 Job 和 Continue 原生会话管理继续暂缓。
- [x] **Runtime 原生清单语义**:原生能力以 Agents、Tools、Commands、Skills、MCP、Rules、Prompts、Resources、LSP、Formatters 和上下文 11 个页签展示;清单状态独立于 Runtime 连通性,区分完整、部分、不可用、仅连接和不支持。DeepSeek Harness 通过 Host Registry 枚举有界的内置/插件 Tools 与 Skills,显示真实 Ask/Execute 边界,并排除 GoodBuddy 按请求分配的 Skills、Web/MCP 代理。
- [ ] **Runtime 监督栏目**(规划中):在应用级助手工作栏的固定 Runtime 栏目统一承载 OpenCode、Continue 和 DeepSeek Harness 的 Task 级委派、后台执行、Workflow/Hook、长任务与原生会话监督;用户只选择 Conversation 或 Task,Job/Run 保持内部,不形成树或独立操作对象。
- [ ] **可执行 Subagent**(规划中):提供显式 Execute 委派,限制嵌套、并行、Token、时间和工具权限,在助手工作栏固定的 Runtime 栏目按 Task 聚合状态、取消入口和审计归属。
### Skills、MCP 与知识库
- [x] **Skills 按需接入**:可分配给直连模型、OpenCode、Continue 和 DeepSeek Harness,并使用有界资源和受控 Runtime 边界。
- [x] **本机工具执行环境源码链路**:在“能力与工具 > 工具执行环境”中为本机 Skills 与 stdio MCP 选择 GoodBuddy 托管 Node.js、按需安装的托管 Python,或经过真实验证的自定义解释器;提供独立的原生地址/OSS 镜像选择、诊断、安装进度、取消和删除。新的本机 Runtime 与 stdio MCP 获得不可变 PATH 快照,不修改普通终端、系统环境或远程 Host。Windows x64 托管 Node 与原生地址 Python 已通过真实安装验证。
- [ ] **本机工具执行环境发布验收**:六个平台/架构的 OSS 镜像对象已完成字节、大小和 SHA-256 公开回读验证。托管 Python 保持按需下载,不向 Desktop 发行包额外带入许可证文件。每个标准打包任务使用目标架构原生 Runner,并在打包前真实安装托管 Python,验证 SSL、pip 与 venv;`0.12.0` 候选仍须通过该矩阵。真实 Skill/MCP、自定义解释器和运行中进程协调仍是待完成验收;完成适用检查前不宣称六平台发布验收通过。
- [x] **内置 MCP 按需接入**:知识库、魔法笔记与 GoodBuddy 配置 MCP 可分别启停,并可分配给直连模型、GoodBuddy 管理的 OpenCode 和 Continue;DeepSeek Harness 在设置中明确显示为暂不支持。内置 MCP 仅通过当前请求的短期本机权限提供,Ask / Execute 读写边界不受用户配置放宽。
- [x] **MCP Tools**:显式启用的自定义 MCP 可按 Runtime 分配给直连模型、GoodBuddy 管理的 OpenCode、Continue Agent Execute 和 DeepSeek Harness,并仅在 Execute 加载;Agent 子进程只获得按请求签发的本机回环权限,MCP 地址、命令和凭据保留在 Main,动态工具仍会重新发现并经过现有执行记录与权限边界。
- [x] **MCP Prompts 与 Resources 元数据**:MCP 测试仅在 Server 声明对应能力时发现有界的 Prompt、参数与 Resource 元数据,不读取 Resource 内容;Runtime 支持的 Prompt 可填入聊天草稿后继续编辑。OpenCode 可报告实验性 Resource 清单,Continue 当前版本明确不支持 Resources。
- [x] **本地知识库**:支持文件、目录和网页导入、SQLite FTS5 检索及来源追溯。
- [x] **知识图谱**:支持规则、模型和混合抽取,以及实体、关系、别名和证据维护。
- [x] **向量模型配置与检索**:可配置兼容 Embeddings 接口并用于语义检索。
- [x] **向量诊断与索引任务**:提供真实向量生成诊断、按文档重建进度、取消、失败状态与重启后结果恢复;每篇成功文档立即可用于检索。
- [x] **混合检索测试台**:支持全文、中文词组、向量和图谱通道诊断,可调 Top K、阈值、权重、本地或学习型重排及上下文预算。
- [x] **分块、维护与评估**:支持固定、结构化和父子分块,分块维护、可取消重建及双语检索评估。
- [x] **受控知识本体**:每个知识库可定义实体、关系、别名和端点约束,保留证据偏移、置信度和抽取来源,并显式提示图谱重建。
- [x] **强制检索与引用上下文**:对话可按需或每次先检索,显示零结果、降级、失败与取消状态,并可查看引用上下文或安全打开来源。
- [x] **魔法笔记 / Magic Notes**:提供本地优先的笔记与待办工作台、范围管理、编辑、筛选和受控 AI 评论;左侧入口可按设置显示未完成待办数量,创建、保存和评论结果使用统一应用通知。
- [ ] **MCP Server Control Plane**(规划中):统一 MCP 生命周期、健康检查、重连、Schema 缓存、隔离、审批和审计。
- [ ] **可追溯笔记摘录与 AI 编辑**(规划中):从对话、知识和网页收集带来源的摘录,并提供需确认的总结、改写和整理操作。
### 工作管理、长期协作与工作流
- [x] **任务、活动与成果**:集中管理任务状态、审计活动和独立成果文件;普通聊天回复只保留在会话中,不再自动复制到成果栏,已有重复聊天 Markdown 从成果列表隐藏但不物理删除。Token 用量按 Runtime 与模型归类,并针对 OpenAI 兼容与 Anthropic Messages 的不同上报口径归一化展示缓存命中率;活动按会话分组并默认收起,避免长历史占满页面。
- [x] **Task 与定制任务体验**:每个产品级 Task 只关联一条 Conversation,一条 Conversation 可承载多个 Task;左侧会话列表通过行首展开按钮显示带共享状态点的 Task 子项,父会话行不重复任务标签,UI 只展示到 Task,不暴露 Job/Run 层级。新建定制任务可关联当前或新 Conversation,默认 Execute 并沿用 Runtime、工具和审批边界;重复触发复用同一 Task,文本结果回写 Conversation,独立文件和图片保留为成果。普通消息与到期 Scheduled Task 共用 Conversation 级持久发送队列,同一会话一次只执行一项;当前回复期间仍可继续发送,队列按顺序续跑,并允许删除或“立即中断并插入”。Task Center 继续作为完整索引,不建设独立 Automation Center。当前计划触发支持单次、每日和每周;高级时区、Cron、事件触发与重试治理仍按 PRD 逐步实现。详见 [Task Center PRD](./docs/features/task-and-job/task-center-prd.md) 和 [Scheduled Task PRD](./docs/features/task-and-job/scheduled-task-prd.md)。
- [x] **记忆与智能心跳**:当前提供周期回顾、建议记忆、洞察、后续任务和可审计运行轨迹。
- [x] **智能心跳入口与范围改善**:将“智能心跳 > 心跳计划”作为完整配置的唯一权威入口,支持创建和编辑 Global 或指定一个、多个 Project 的计划;旧单项目配置无损迁移,项目级记忆与行动输出必须显式指定范围内的 Project。Task Center 和设置不再复制心跳表单。“未来分区记忆”仍只是尚待独立设计的长期方向。详见 [智能心跳 PRD](./docs/features/smart-heartbeat/prd.md)。
- [ ] **通用监督**(规划中):通过固定监督栏目观察用户选择的会话、任务、自动化或实验对象,提供带证据的评论与人工介入请求,但不自动发言、批准工具或切换 Execute。详见 [会话监督 PRD](./docs/features/conversation-supervision/prd.md)。
- [ ] **批量运行与对比实验室**(规划中):对模型、Prompt、角色和工作流配置执行批量对比,汇总质量、耗时、Token、费用、失败率和成果差异。
- [ ] **时态记忆与事实冲突检测**(规划中):为记忆和知识图谱增加有效期、当前事实、过期与矛盾检测、事实核验及证据回溯。
- [ ] **可视化受控工作流**(规划中):提供版本化 DAG、条件分支、审批、取消和恢复,执行节点继续经过 Main Runtime 边界。
- [ ] **统一 Run Graph 与回放**(规划中):关联任务、Subagent、模型、知识、工具审批、用量和成果,支持失败定位、重试和脱敏导出。
### 浏览器、通信、语音与应用维护
- [x] **直连模型内置浏览器**:使用 GoodBuddy 内置的隔离 Chromium,不控制客户端已安装的浏览器;用户通过独立总开关决定是否提供给 Execute,开启后不逐次询问。浏览器工作栏与 Agent 共用同一条按 Conversation 归属的会话和串行操作路径,支持返回、刷新/停止加载、地址输入、前往、交互和关闭;停止加载不会关闭会话,用户导航会改变 Agent 下一步看到的页面。
- [x] **客户端电脑控制工具**:与内置浏览器分开管理,并保留范围、取消、超时、输出边界和执行记录。
- [x] **远程消息通道项目**:微信 ClawBot、企业微信和钉钉分别拥有系统管理的项目、独立远程会话、工作目录、处理后端、默认 Ask/Execute 模式及任务活动归属;完整回复交由各通道按平台能力控制长度与分段,不再由公共服务统一截断。
- [x] **微信 ClawBot 扫码与媒体**:通过独立 Sidecar 完成本机扫码、验证码、加密凭据和文字收发;支持个人微信私聊图片与文件,单条消息最多 4 个附件、解密后合计不超过 12MB。
- [x] **微信安全回传**:支持返回当前任务生成的图片,或在用户明确要求时将本次最终文本生成为 Markdown 附件;不自动读取或发送已有工作区文件。
- [x] **企业微信与钉钉连接**:支持 Main-only 加密设置、环境变量只读覆盖、连接测试、动态启停、发送者范围和状态诊断。
- [x] **受管本地模型下载源**:在“平台功能 / 通用设置”中为后续语音输入与 OCR 模型下载全局选择 ModelScope(默认)或 Hugging Face;所选来源缺少完整已验证文件时明确不可用,不静默换源或混合文件。
- [x] **可选本地语音模型管理**:应用不内置模型权重;提供校验下载、进度与取消、来源链接、ZIP 或本地目录导入、切换和删除。
- [x] **本地录音与离线转写**:采集麦克风音频并使用已选择的本地模型离线转写,支持停止、取消、状态反馈和资源释放。
- [x] **版本检查与镜像节点**:在“关于与更新”中选择 GitHub(默认)或镜像节点;手动检查、启动时检查和下载页使用同一选择,并只读取固定可信的发布索引,不自动下载或安装。
- [x] **应用内反馈**:在“关于与更新”中直接提交问题、建议或体验反馈,支持可选邮箱和单张截图;默认不上传诊断,用户可主动附加有界的最近桌面诊断摘要。失败后保留草稿、诊断选择和同一请求编号;不会附加对话、Prompt、凭据、文件内容、路径、Provider 原始响应或远端 Agent 日志。
- [x] **内网兼容模式**:默认开启;允许应用内 HTTP 与无效、自签名或过期的 HTTPS 证书,关闭后恢复严格地址和证书校验。
### 开源、构建与发布
- [x] **0BSD 开源许可**:原创代码可自由使用、复制、修改、分发和商用;第三方组件和资源仍遵循各自许可证。
- [x] **可复现依赖安装与源码构建**:使用锁定依赖、Node.js 24 和统一的测试、类型检查、Lint、生产构建命令。
- [x] **六平台原生发布矩阵**:Windows、macOS、Linux 的 `x64`、`arm64` 目标由原生 Runner 构建,并提供发布清单和 SHA-256 哈希;Linux 同时生成 AppImage、DEB 和 RPM。
### 开放接口、团队协作与远程执行
- [x] **远程任务委派**:仅在用户显式配置端点和令牌后启用,按全局内网兼容模式使用 HTTP(S),结果进入持久化发件箱。
- [ ] **Headless Runtime API**(规划中):提供本机优先的任务、事件、状态和成果 API,以及有范围、有效期、限流和撤销能力的令牌。
- [ ] **GoodBuddy Team Hub**(规划中):以可选服务提供组织、RBAC、项目共享、远程 Agent、策略下发和租户审计。
- [ ] **SSH 主机与远程执行空间发布验收**:主机 CRUD、Host Key、加密凭据、Project UI、Workspace、OpenCode ACP v4、Agent-owned Prompt/gateway/transcript、Ask 只读、Execute 完整账号权限、取消、detached Agent 精确重连和 release-only 双架构资源校验已经接线。Linux x64 当前源码已用真实模型与工具通过 detach、进程结束、relay 丢失、并发、取消、Provider 异常、Agent 重启和 Desktop SQLite 恢复矩阵;最终 `0.11.14` 测试签名包再次验证两个已交付模型轮次、一个工具、一个终态、`latest=ACK` 与零 owner/journal 残留。公开 signing key registry 已供应。控制面直连源码不等待新 installer-bearing 包,但仍需公开核对当前 Linux x64/arm64 正式签名工件矩阵,并完成 GitHub/北京镜像、双架构和离线 GoodBuddy 传输的发布验收;门槛未满足时不宣称该路径已发布或通过正式发布验收。
- [ ] **多云远程沙盒 Agent**(规划中):通过云厂商 API 和 SSH Agent 管理专用 Linux 沙盒;凭据留在 Main 进程,高风险控制面操作单独确认。
## 规划原则
规划中的工作流、Subagent、MCP、远程 API 和沙盒能力不得绕过现有 Main Runtime、Ask/Execute、权限、取消、超时和审计边界。
-85
View File
@@ -1,85 +0,0 @@
# GoodBuddy
English | [简体中文](README.md)
A secure, cross-platform, local-first desktop AI assistant and Agent workspace.
![GoodBuddy workspace](docs/screenshots/workspace-overview.png)
## Highlights
- **Controlled execution**: `Ask` stays read-only; `Execute` runs only enabled tools within defined boundaries and records their activity.
- **Local-first data**: Conversations, tasks, artifacts, memory, knowledge bases, and graphs are stored in local SQLite. API keys are encrypted by the operating system.
- **Multiple runtimes**: Connect directly to models or use OpenCode, Continue, and the preview DeepSeek Harness, with cancellation, timeouts, output limits, and process cleanup.
- **Open integrations**: Supports OpenAI Responses, OpenAI-compatible Chat Completions, Anthropic Messages, OpenAI Images, Embeddings, cross-runtime Skills and custom MCP, plus a default-off DeepSeek Harness npm plugin marketplace that users enable explicitly.
- **Knowledge workspace**: Import files, folders, and web pages, then search them with full-text, phrase, vector, and graph retrieval.
- **Work management**: Organize projects, conversations, tasks, activity, artifacts, memory, Magic Notes, and Smart Heartbeat.
- **Remote channels**: Connect WeChat ClawBot, WeCom, and DingTalk with separate remote sessions for each sender.
- **Managed SSH projects (technical preview)**: Remote support is off by default and does not affect ordinary desktop use. After enabling it, manually download the independently signed package for the Linux Host architecture under Settings > Platform Features > Remote Projects, or import/export an offline `.gbagent`. Each package contains the Agent, pinned Node, and the GoodBuddy-adapted remote OpenCode Runtime; online downloads follow the GitHub or mirror source selected under About & Updates.
- **Desktop context**: Add selected files, screenshots, application windows, clipboard content, and voice.
- **Offline speech**: Use local SenseVoice, Paraformer, and Whisper models.
- **Rich responses**: Render Markdown, LaTeX, and controlled Mermaid diagrams.
![GoodBuddy knowledge workspace](docs/screenshots/knowledge-workspace.png)
![GoodBuddy knowledge graph](docs/screenshots/knowledge-graph.png)
![GoodBuddy Magic Notes](docs/screenshots/GoodBuddy_MFSGeK0NoT.gif)
![GoodBuddy Smart Heartbeat](docs/screenshots/smart-heartbeat.png)
See [FEATURES.md](FEATURES.md) for the detailed feature matrix and roadmap, and
the [documentation index](docs/README.md) for product, architecture, design,
and quality documents.
## Install
Download a build from [GitHub Releases](https://github.com/mesalogo/goodbuddy/releases):
| Platform | Architectures | Formats |
| --- | --- | --- |
| Windows | `x64`, `arm64` | NSIS, portable ZIP |
| macOS | `x64`, `arm64` | DMG, ZIP |
| Linux | `x64`, `arm64` | AppImage, DEB, RPM |
Desktop installers do not contain remote Agent payloads. No Agent package is
needed for local projects; managed SSH users install one explicitly in
Settings.
Code signing and macOS notarization are not configured yet, so your operating system may display a security warning.
## Run from source
Requires Node.js 24 and npm:
```bash
git clone https://github.com/mesalogo/goodbuddy.git
cd goodbuddy
npm ci
npm run dev
```
See [BUILD.md](BUILD.md) for build and packaging instructions.
## Privacy and security
- Model requests are sent only to services selected by the user.
- Local data stays in the operating system's application data directory by default.
- The Renderer has no access to raw Electron APIs or model credentials.
- The DeepSeek Harness plugin marketplace is off by default. After it is enabled and a third-party plugin is installed, its install scripts, initialization, and Execute tools run with the current user's permissions. Turning off the marketplace only hides its catalog and management interface; it does not disable or uninstall existing plugins. Installation requires explicit confirmation, and Ask limits only model tool calls.
- Remote delegation is disabled until the user configures an endpoint and token.
- Private-network compatibility permits in-app HTTP and non-standard HTTPS certificates. WeChat credential and media endpoints remain strictly validated.
## Contributing
Issues and pull requests are welcome. Read [AGENTS.md](AGENTS.md) first, then run:
```bash
npm test
npm run typecheck
npm run lint
```
## License
Original GoodBuddy code is released under the [0BSD License](LICENSE). You may use, modify, distribute, and commercialize it freely. Third-party components and resources retain their respective licenses.
+93 -63
View File
@@ -1,63 +1,88 @@
<div align="center">
<img src="./sites/assets/goodbuddy-light.png" width="96" alt="GoodBuddy" />
# GoodBuddy
[English](README.en.md) | 简体中文
**Desktop access to model chat, coding agents, knowledge, and scheduled work**
GoodBuddy是一个开箱即用的 AI 生产平台,安全、跨平台、本地优先的桌面 AI 助手与 Agent 工作空间。
**English** | [简体中文](./README.zh-CN.md)
产品官网:https://mesalogo.github.io/goodbuddy/
[Website](https://mesalogo.github.io/goodbuddy/en.html) ·
[Download](https://github.com/mesalogo/goodbuddy/releases) ·
[Feature Matrix](./FEATURES.md) ·
[Build Guide](./BUILD.md)
五大特点:
1. 支持国产信创系统和硬件
2. 免注册,不收集个人信息
3. 完全开源和免费,友好的OBSD协议
4. 不需要联网,纯私有网络也可以用
5. 开放生态,内置主流好用的Agent Runtime,目前支持OpenCode、Continue和DeepSeek Harness,让小白用户也可以快速用起来最前沿的Agent工具
[![Release](https://img.shields.io/github/v/release/mesalogo/goodbuddy?label=release)](https://github.com/mesalogo/goodbuddy/releases)
[![License: 0BSD](https://img.shields.io/badge/license-0BSD-blue.svg)](./LICENSE)
[![Windows](https://img.shields.io/badge/Windows-x64%20%7C%20arm64-0078D4)](https://github.com/mesalogo/goodbuddy/releases)
[![macOS](https://img.shields.io/badge/macOS-x64%20%7C%20arm64-000000)](https://github.com/mesalogo/goodbuddy/releases)
[![Linux](https://img.shields.io/badge/Linux-x64%20%7C%20arm64-FCC624)](https://github.com/mesalogo/goodbuddy/releases)
</div>
![GoodBuddy 工作空间](docs/screenshots/workspace-overview.png)
![GoodBuddy workspace](./docs/screenshots/workspace-overview.png)
## 核心能力
GoodBuddy is a desktop application for model chat, coding agents, knowledge
retrieval, notes, and scheduled tasks. No GoodBuddy account is required.
Workspace data is stored locally by default. Model endpoints can run on the
same device, on a private network, or at a provider selected by the user.
- **安全执行**:`Ask` 保持只读;`Execute` 仅运行已启用且受边界约束的工具,并保留活动记录。
- **本地优先**:会话、任务、成果、记忆、知识库和图谱保存在本地 SQLite;API Key 由系统安全存储加密。
- **多 Runtime**:支持直连模型、OpenCode、Continue 和预览版 DeepSeek Harness,统一处理取消、超时、输出限制和进程退出;原生能力清单将 Tools 与 Commands、LSP、Formatters 分开,并显示来源及 Ask/Execute 可用性。内置 OpenCode 提供 Agent、Tool、Command 与原生 Compact,Continue 提供 Rules、Prompt 预设、结构化提问与 GoodBuddy 手动摘要压缩,并明确标记当前版本无法静态发现原生 Tools。
- **开放连接**:支持 OpenAI Responses、OpenAI 兼容 Chat Completions、Anthropic Messages、OpenAI Images、Embeddings、跨 Runtime Skills 与自定义 MCP,以及默认关闭、由用户显式开启的 DeepSeek Harness npm 插件市场。MCP 测试可读取有界 Prompt/Resource 元数据,但不会读取 Resource 内容。
- **知识工作区**:支持文件、目录和网页导入,以及全文、词组、向量和图谱混合检索。
- **工作管理**:集中管理 Projects、对话、任务、活动、成果、记忆、魔法笔记和智能心跳;可从稳定的本地会话复制当前聊天内容并创建互不影响的会话分支。
- **远程通道**:支持微信 ClawBot、企业微信和钉钉,每个发送者使用独立远程会话。
- **托管 SSH 项目(技术预览)**:远程能力默认关闭且不影响普通桌面使用。启用后,在“设置 > 平台功能 > 远程项目”按 Linux Host 架构手动下载独立签名的 Agent 包,或导入/导出 `.gbagent` 离线包;每个包包含 Agent、固定 Node 和 GoodBuddy 适配的远端 OpenCode Runtime,在线来源跟随“关于与更新”的 GitHub/镜像选择。
- **桌面上下文**:可选择文件、截图、应用窗口、剪贴板和语音作为上下文。
- **离线语音**:支持 SenseVoice、Paraformer 和 Whisper 本地模型。
- **富文本回答**:支持 Markdown、LaTeX 公式和受控 Mermaid 图表。
## Capabilities
![GoodBuddy 知识工作区](docs/screenshots/knowledge-workspace.png)
| Area | Available in GoodBuddy |
| --- | --- |
| Agent Runtimes | Direct model connections, OpenCode, Continue, and the preview DeepSeek Harness |
| Data and execution | Local SQLite storage, read-only `Ask`, full-account `Execute`, and recorded tool activity |
| Knowledge | File, folder, and web imports with full-text, Chinese phrase, vector, and knowledge graph retrieval |
| Desktop releases | Windows, macOS, and Linux builds for `x64` and `arm64` |
| Integrations | Local or hosted model endpoints, custom MCP servers, WeChat ClawBot, WeCom, and DingTalk |
![GoodBuddy 知识图谱](docs/screenshots/knowledge-graph.png)
## Product tour
![GoodBuddy 魔法笔记](docs/screenshots/GoodBuddy_MFSGeK0NoT.gif)
### Knowledge bases and graphs
![GoodBuddy 智能心跳](docs/screenshots/smart-heartbeat.png)
![GoodBuddy knowledge workspace](./docs/screenshots/knowledge-workspace.png)
完整功能和路线图见 [FEATURES.md](FEATURES.md),产品、架构、设计与质量文档见
[文档导航](docs/README.md)。
![GoodBuddy knowledge graph](./docs/screenshots/knowledge-graph.png)
## 安装
### Magic Notes and Smart Heartbeat
从 [GitHub Releases](https://github.com/mesalogo/goodbuddy/releases) 下载:
![GoodBuddy Magic Notes](./docs/screenshots/GoodBuddy_MFSGeK0NoT.gif)
| 系统 | 架构 | 格式 |
![GoodBuddy Smart Heartbeat](./docs/screenshots/smart-heartbeat.png)
## Agent Runtimes
| Runtime | Functions | Configuration |
| --- | --- | --- |
| Windows | `x64`、`arm64` | NSIS、便携 ZIP |
| macOS | `x64`、`arm64` | DMG、ZIP |
| Linux | `x64`、`arm64` | AppImage、DEB、RPM |
| Direct models | Chat, retrieval, image generation, and built-in tools | GoodBuddy model connections |
| OpenCode | Coding agents, native commands, tools, and skills | GoodBuddy-managed or native OpenCode configuration |
| Continue | Rules, prompt presets, and coding tasks | GoodBuddy-managed or native Continue configuration |
| DeepSeek Harness (preview) | A fixed host with optional plugin capabilities | GoodBuddy-managed OpenAI-compatible connection |
桌面安装包不包含远端 Agent payload。仅使用本地项目时无需下载任何
Agent 包;托管 SSH 用户可在设置中按需管理。
Each run reports cancellation, timeouts, token usage, tool calls, and history.
Runtime-specific capabilities and configuration remain separate.
当前尚未配置代码签名和 macOS notarization,系统可能显示安全提示。
## Download
## 从源码运行
Download a build from
[GitHub Releases](https://github.com/mesalogo/goodbuddy/releases):
需要 Node.js 24 和 npm:
| Platform | Architectures | Formats |
| --- | --- | --- |
| Windows | `x64`, `arm64` | NSIS, portable ZIP |
| macOS | `x64`, `arm64` | DMG, ZIP |
| Linux | `x64`, `arm64` | AppImage, DEB, RPM |
Desktop installers do not contain remote Agent payloads. Local projects do not
need an Agent package; managed SSH users download or import one explicitly in
Settings.
Code signing and macOS notarization are not configured yet, so the operating
system may display a security warning.
## Run from source
Requires Node.js 24 and npm:
```bash
git clone https://github.com/mesalogo/goodbuddy.git
@@ -66,20 +91,35 @@ npm ci
npm run dev
```
构建与打包说明见 [BUILD.md](BUILD.md)。
See [BUILD.md](./BUILD.md) for build and packaging instructions.
## 隐私与安全
## Documentation
- 模型请求只发送到用户选择的服务。
- 本地数据默认保存在系统应用数据目录。
- Renderer 不接触原始 Electron API 或模型凭据。
- DeepSeek Harness 插件市场默认关闭;开启并安装第三方插件后,其安装脚本、初始化和 Execute 工具以当前用户权限运行。关闭市场只隐藏目录和管理界面,不会停用或卸载已有插件;安装前会明确确认。Ask 只允许 Host 原生 `read`/`skill` 与 Main 管理的 Web Search/Fetch,不允许调用第三方插件工具,也不能限制插件初始化代码。
- 远程委派仅在用户配置端点和令牌后启用。
- 内网兼容模式允许应用内 HTTP 和非标准 HTTPS 证书;微信凭据和媒体端点仍执行严格校验。
- [Feature matrix and roadmap](./FEATURES.md)
- [Product feature documentation](./docs/features/)
- [UI design system](./UI-DESIGN.md)
- [Build and packaging](./BUILD.md)
- [Release runbook](./docs/development/release-runbook.md)
## 参与贡献
## Privacy and execution boundaries
欢迎提交 Issue 和 Pull Request。请先阅读 [AGENTS.md](AGENTS.md),提交前运行:
- Model requests are sent only to services selected by the user.
- Local data stays in the operating system's application data directory by
default. API keys are encrypted by secure system storage.
- The Renderer has no access to raw Electron APIs or model credentials.
- The DeepSeek Harness plugin marketplace is off by default. Third-party
install scripts, initialization code, and Execute tools run with the current
user's permissions.
- Remote delegation is enabled only after the user configures an endpoint and
token.
- Private-network compatibility permits in-app HTTP and non-standard HTTPS
certificates. WeChat credential and media endpoints remain strictly
validated.
## Contributing
Issues and pull requests are welcome. Read [AGENTS.md](./AGENTS.md) first, then
run:
```bash
npm test
@@ -87,18 +127,8 @@ npm run typecheck
npm run lint
```
## 为什么选择GoodBuddy
## License
<img width="1024" height="1536" alt="6dd45371542dea9fb2d99474387708f5" src="https://github.com/user-attachments/assets/ca608646-ea48-4039-9177-d862be8396ac" />
## 社区交流
目前采用微信群的方式供大家高效交流,大家可以微信扫码进入社区群:
<img width="993" height="1335" alt="image" src="https://github.com/user-attachments/assets/4893715a-edaf-4db6-8a6d-d529b972db8e" />
## 开源许可
GoodBuddy 的原创代码采用 [0BSD License](LICENSE),可自由使用、修改、分发和商用。第三方组件和资源遵循各自许可证。
Original GoodBuddy code is released under the [0BSD License](./LICENSE). You may
use, modify, distribute, and commercialize it freely. Third-party components
and resources retain their respective licenses.
+125
View File
@@ -0,0 +1,125 @@
<div align="center">
<img src="./sites/assets/goodbuddy-light.png" width="96" alt="GoodBuddy" />
# GoodBuddy
**模型对话、编程 Agent、本地知识库和定时任务的桌面入口**
[English](./README.md) | **简体中文**
[产品官网](https://mesalogo.github.io/goodbuddy/) ·
[下载](https://github.com/mesalogo/goodbuddy/releases) ·
[功能矩阵](./FEATURES.zh-CN.md) ·
[构建说明](./BUILD.md)
[![Release](https://img.shields.io/github/v/release/mesalogo/goodbuddy?label=release)](https://github.com/mesalogo/goodbuddy/releases)
[![License: 0BSD](https://img.shields.io/badge/license-0BSD-blue.svg)](./LICENSE)
[![Windows](https://img.shields.io/badge/Windows-x64%20%7C%20arm64-0078D4)](https://github.com/mesalogo/goodbuddy/releases)
[![macOS](https://img.shields.io/badge/macOS-x64%20%7C%20arm64-000000)](https://github.com/mesalogo/goodbuddy/releases)
[![Linux](https://img.shields.io/badge/Linux-x64%20%7C%20arm64-FCC624)](https://github.com/mesalogo/goodbuddy/releases)
</div>
![GoodBuddy 工作空间](./docs/screenshots/workspace-overview.png)
GoodBuddy 是用于模型对话、编程 Agent、知识检索、笔记和定时任务的桌面应用。使用 GoodBuddy 无需注册账号,工作数据默认保存在本机。模型服务可以运行在本机、组织内网或用户选择的云端服务。
## 主要能力
| 范围 | GoodBuddy 提供的能力 |
| --- | --- |
| Agent Runtime | 直连模型、OpenCode、Continue 和预览版 DeepSeek Harness |
| 数据与执行 | 本地 SQLite、只读 `Ask`、使用当前账号完整权限的 `Execute`、工具调用记录 |
| 知识库 | 导入文件、目录和网页,通过全文、中文词组、向量和知识图谱检索 |
| 桌面版本 | Windows、macOS、Linux 的 `x64` 与 `arm64` 正式版本,以及龙芯 LoongArch 实验预览版 |
| 外部连接 | 本机或内网模型服务、自定义 MCP、微信 ClawBot、企业微信和钉钉 |
## 产品界面
### 知识库与知识图谱
![GoodBuddy 知识工作区](./docs/screenshots/knowledge-workspace.png)
![GoodBuddy 知识图谱](./docs/screenshots/knowledge-graph.png)
### 魔法笔记与智能心跳
![GoodBuddy 魔法笔记](./docs/screenshots/GoodBuddy_MFSGeK0NoT.gif)
![GoodBuddy 智能心跳](./docs/screenshots/smart-heartbeat.png)
## Agent Runtime
| Runtime | 适用场景 | 配置来源 |
| --- | --- | --- |
| 直连模型 | 对话、知识检索、图片生成和内置工具 | GoodBuddy 模型连接 |
| OpenCode | 编程 Agent、原生 Commands、Tools 和 Skills | GoodBuddy 管理或 OpenCode 自有配置 |
| Continue | Rules、Prompt 预设和编程任务 | GoodBuddy 管理或 Continue 自有配置 |
| DeepSeek Harness(预览) | 固定 Host 与可选插件能力 | GoodBuddy 管理的 OpenAI 兼容连接 |
每次运行都会记录取消、超时、Token 用量、工具调用和执行历史。各 Runtime 的原生能力与配置仍分别管理。
## 下载
从 [GitHub Releases](https://github.com/mesalogo/goodbuddy/releases) 下载:
| 系统 | 架构 | 格式 |
| --- | --- | --- |
| Windows | `x64`、`arm64` | NSIS、便携 ZIP |
| macOS | `x64`、`arm64` | DMG、ZIP |
| Linux | `x64`、`arm64` | AppImage、DEB、RPM |
龙芯 LoongArch 使用独立的 `loong64` 实验预览通道,可在[产品官网](https://mesalogo.github.io/goodbuddy/#download)选择下载。
桌面安装包不包含远端 Agent payload。本地项目无需 Agent 包;托管 SSH 用户可在设置中单独下载或导入。
当前未配置代码签名和 macOS notarization,操作系统可能显示安全提示。
## 从源码运行
需要 Node.js 24 和 npm:
```bash
git clone https://github.com/mesalogo/goodbuddy.git
cd goodbuddy
npm ci
npm run dev
```
构建与打包说明见 [BUILD.md](./BUILD.md)。
## 文档
- [功能矩阵与路线图](./FEATURES.zh-CN.md)
- [产品功能文档](./docs/features/)
- [UI 设计系统](./UI-DESIGN.md)
- [构建与打包](./BUILD.md)
- [发布流程](./docs/development/release-runbook.md)
## 隐私与执行边界
- 模型请求只发送到用户选择的服务。
- 本地数据默认保存在系统应用数据目录,API Key 由系统安全存储加密。
- Renderer 不接触原始 Electron API 或模型凭据。
- DeepSeek Harness 插件市场默认关闭。第三方插件安装脚本、初始化代码和 Execute 工具以当前用户权限运行。
- 远程委派只在用户配置端点和令牌后启用。
- 内网兼容模式允许应用内 HTTP 和非标准 HTTPS 证书;微信凭据和媒体端点仍执行严格校验。
## 参与贡献
欢迎提交 Issue 和 Pull Request。请先阅读 [AGENTS.md](./AGENTS.md),提交前运行:
```bash
npm test
npm run typecheck
npm run lint
```
## 社区交流
扫描二维码加入 GoodBuddy 微信群:
<img width="360" alt="GoodBuddy 微信社区群二维码" src="https://github.com/user-attachments/assets/10bb7ac2-0bc1-41a9-978d-c2862923fcd6" />
## 开源许可
GoodBuddy 原创代码采用 [0BSD License](./LICENSE),可自由使用、修改、分发和商用。第三方组件和资源遵循各自许可证。
+56 -10
View File
@@ -193,7 +193,7 @@
### 6.1 PageTabs
用于同一一级页面内的同级内容面板,例如智能心跳的“成长概览”和“心跳计划”。
用于同一一级页面内的同级内容面板,例如智能心跳的“运行概览”和“心跳计划”。
- 使用 `tablist`、`tab` 和 `tabpanel` 语义,当前项使用 `aria-selected="true"`。
- 一级页面之间的导航由应用主导航承担,不复用 `PageTabs`。
@@ -201,6 +201,7 @@
- 项目过多时优先重组信息架构,不把一级页签做成多行。
- `PageTabs` 可使用默认视觉或共享的 `segmented` 视觉变体。紧凑主从工作台中的 2 至 4 个同级面板可使用与模型设置一致的分段外观,但不得因此改用按钮组语义。
- 视觉变体不改变组件含义:分段外观的 `PageTabs` 仍使用页签语义、单一激活面板、游标焦点和方向键切换,不复制页面专属样式。
- 在独立滚动的 Flex 页面中,`PageTabs` 及其直接包装层必须保持 `flex: 0 0 auto`,不得被剩余内容压缩到零高度。新增页签容器时必须提供对应的 CSS 回归测试。
### 6.2 SegmentedControl
@@ -282,6 +283,9 @@
- 一级导航与最近会话之间、最近会话与底部账户区之间必须有可见结构分隔线。浅色主题使用 `--border-default`,深色主题可在可辨前提下使用 `--border-subtle`。
- 当前导航项和当前会话必须同时使用至少三种信号中的两种:强调背景、可见边框、图标或文字强调。浅色主题的当前项优先使用更完整的蓝色选中表面和较高字重。
- 未选中项保持平整,不为每一行添加卡片边框或阴影。悬停反馈不得强于选中状态。
- 桌面停靠状态下,主侧栏宽度允许在 `220px` 至 `420px` 范围内通过指针或键盘调整,
并记住用户选择;分隔条使用 `separator` 语义,支持方向键、Home 和 End。小于
`900px` 时继续使用固定宽度抽屉,不显示拖拽分隔条。
- 关联 Task 的 Conversation 在行最左侧显示独立展开按钮,父会话行不重复任务标签或数量;
展开后的每个 Task 子项左侧显示名称,模式、计划和共享状态标记收在右侧,与父会话的
更新时间位置一致;展开层级只到 Task,不展示 Job、Subjob 或 Run。
@@ -298,26 +302,56 @@
失败或中断使用危险色,等待审批使用警告色,暂停或取消使用禁用色;非完成态旁边同时
显示本地化状态文字,已完成文案保留给辅助技术而不在紧凑元数据中重复显示,不能只靠
颜色或动效表达状态。
- 左上角品牌区允许用户在“外观”设置中定制品牌名称、中英文副标题和单个 Logo。定制只
影响该品牌区,不替换安装包名称、更新协议、Agent 标识或应用正文中的 GoodBuddy 产品
身份。副标题按当前界面语言显示,留空时隐藏且不保留空行。
- 品牌设置必须提供同布局预览、显式保存、默认 Logo 和整组恢复默认操作。自定义 Logo 仅
接受用户本机选择的 PNG、JPEG 或 WebP 内联数据,宽高不超过 `4096 × 4096`、总像素不
超过 1600 万且大小不超过 `512 KB`;不得读取远程 Logo URL。名称或副标题溢出品牌区时
单行截断,不能撑宽或挤压侧栏。
- 账户与设置入口固定在侧栏底部。已有稳定设置入口时,不在顶栏重复提供同一入口。
### 6.9 助手工作栏
助手工作栏是应用级右侧工具容器,不归属于聊天页面,也不根据当前页面、项目或 Runtime
自动增删入口。产品契约见
[通用助手工作栏与执行空间 PRD](./docs/prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md)。
[通用助手工作栏与执行空间 PRD](./docs/features/assistant-workbar/prd.md),
动态 Tab、“+”和终端细节见
[助手工作栏多终端页签 PRD](./docs/features/assistant-workbar/terminal-tabs-prd.md)。
- 默认固定提供任务中心、工作区、浏览器和成果四个标准栏目,不根据当前页面或
Runtime 能力自动增删入口。
- 升级后默认打开任务中心、工作区、浏览器和成果四个单实例应用,不根据当前页面或 Runtime
能力自动增删稳定应用目录入口。
- Tab 行只显示已打开实例,行末始终提供“+”普通按钮;点击后在内容区打开应用选择页。
“+”不使用 `tab` 语义,也不能因为终端或其他应用已经打开而消失。
- 应用注册表声明单实例或多实例。单实例重复选择时聚焦已有 Tab;终端从首期开始支持
多实例,每次选择创建独立 Tab 和 Shell Session。
- Task Center 是 Task 的单例应用级索引,不使用“跟随 / 固定目标”多实例模式。每个 Task
只关联一条 Conversation,一条 Conversation 可以关联多个 Task;列表不得复制会话内容,
也不得把 Job/Run 提升为可导航 UI 对象。
- 各栏目读取当前会话或项目的对应内容;当前内容不可用时仍保留栏目入口并说明原因。
- 能力、连接和内容可以动态变化,栏目入口不能随之自动隐藏。不可用状态必须说明原因、影响和可执行入口。
- 用户可以主动排序或隐藏栏目,并可恢复默认布局;应用不能用用户偏好机制实现自动能力裁剪。
- 四个栏目使用稳定标签并保留 `tablist`、`tab`、`tabpanel`、方向键、Home、End 和焦点恢复语义。
- 已打开实例保留 `tablist`、`tab`、`tabpanel`、方向键、Home、End 和焦点恢复语义。
实例过多时 Tab 区单行横向滚动,“+”保持可见,不换行或改成下拉框。
- 当前工作栏 Tab 必须同时使用连续内容表面、可见边框、顶部指示、图标或较高字重中的至少
两种信号;悬停反馈不得强于当前选中态。Tab 关闭按钮保留固定布局空间,默认仅在对应 Tab 悬停或
`focus-within` 时显示;无悬停或粗指针设备始终显示,键盘与辅助技术始终可访问。
- 选择“终端”后直接绑定当前项目,由项目执行空间自动决定本机或托管 SSH;不再显示第二层
目标选择器。终端面板内部不重复提供关闭会话按钮,关闭统一由 Tab 入口完成。
- 下一次请求使用的附件和知识库由会话输入区展示与管理,不在工作栏重复提供“上下文”栏目;
记忆功能实现前不展示占位内容,未来的记忆与历史执行上下文归入关联 Task 的任务中心详情。
- 徽标可以提示未解决意见、等待审批、失败或连接状态,但不能成为唯一状态信号,也不能无条件抢占当前栏目。
- 浏览器 Tab 的内容顶部固定使用一条紧凑工具栏,按“返回、刷新/停止加载、地址输入、
前往、交互、关闭浏览器”排列。“刷新”在当前页面加载时原位切换为“停止加载”;
“关闭浏览器”必须使用明确文字和与页面导航控件清楚区分的危险操作视觉,不能继续标为
含义模糊的“停止浏览器”。地址输入显示浏览器权威提交 URL,但用户编辑期间保留本地草稿,
不被画面或状态刷新覆盖;提交裸域名时自动添加 `http://`,提交、失焦后的同步规则不得让
尚未提交的文字改变 Agent 看到的页面。
- 浏览器工具栏操作的是当前 Conversation 中 Agent 使用的同一隔离浏览器会话,用户导航会
有意改变 Agent 下一步看到的页面。创建中、Agent 操作中或已进入完整交互窗口时禁用其余
工具栏控件;仅当前导航仍在加载时保留“停止加载”,且该操作只中止页面加载,不关闭浏览器、
不释放 Runtime 上下文。没有会话的活动 Conversation 可以直接在地址栏输入 URL 并“前往”
创建会话,但必须复用 Agent 浏览器相同的 URL 策略与能力路径。
- 所有窗口宽度下均停靠在主工作区右侧并参与水平布局回流;展开时压缩主工作区,不能覆盖、
遮罩或隔离其内容。分栏计算排除最左侧主导航,主工作区与工作栏采用相同的 `300px`
最小宽度;拖动保存两者在可用分栏宽度中的比例,任一侧到达最小值后都不得继续侵占。
@@ -369,8 +403,11 @@
- 支持上、下方向键、Home、End、Enter 或 Space、Escape;打开后焦点进入当前项,关闭后返回触发按钮。
- 点击或聚焦菜单外部时关闭;同一输入区内的模型、专家和模式菜单互斥展开。
- 不可用选项保持可读并说明原因,键盘导航不得停留在不可选择项上。
- 项目选择器属于富信息单选菜单。收起时保持当前项目名称紧凑可见;展开后每项至少显示项目名称和项目类型,并按数据可用性补充本地目录、远程来源、平台、连接状态或其他能帮助辨认项目的信息。
- 项目菜单区分“本地项目 / 远程项目 / 远程通道”,不把消息通道命名为远程项目。“远程项目(技术预览)”关闭时完整移除远程项目分组,而不是显示不可操作的残留选项;本地项目和远程通道继续可用。分组、项目类型和连接状态均须显示文字,不只依赖图标或颜色;新增项目来源时不得退回仅列名称的原生 `select`。
- 当某个选项需要用户在其展开区域内完成路径选择、授权或其他前置操作时,不得因为前置条件
尚未完成而禁用该入口。选择入口只展开流程,验证成功前不提交实际值;不得自动采用第一个
候选。取消保持原值,验证错误在对应操作附近显示。
- 项目选择器属于富信息单选菜单。收起时保持当前项目名称紧凑可见;展开后每项至少显示项目名称,并按数据可用性补充目录、远程来源或其他能帮助辨认项目的信息。托管 SSH 项目在“远程项目”内按已保存 SSH Host 做一层轻量分组,Host 标题旁显示真实 Agent 连接状态;项目副标题只显示远端路径,不重复“托管 SSH”类型。
- 项目菜单区分“本地项目 / 远程项目 / 远程通道”,不把消息通道命名为远程项目。“远程项目(技术预览)”关闭时完整移除远程项目分组,而不是显示不可操作的残留选项;本地项目和远程通道继续可用。Agent 连接状态使用“未连接 / 连接中 / 就绪 / 异常”等文字标签,读取状态不得发起连接,且不能只依赖图标或颜色;新增项目来源时不得退回仅列名称的原生 `select`。
### 6.12 应用通知与就地反馈
@@ -536,6 +573,9 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
- 使用 `reading` 壳层,消息流与输入区共享宽度。
- 对话标题和当前项目范围位于 `PageHeader` 或对话上下文区,不在消息流中重复。
- 已结束且包含正文的助手回复在底部提供带可访问名称和工具提示的复制图标;复制 Markdown
原文,不包含推理过程、工具日志或引用元数据,结果通过应用通知反馈。流式回复完成前不显示
复制入口。
- 本地会话的更多操作提供“在新会话中继续”。创建前必须先持久化当前稳定消息;有活动运行
或待发送内容时不可创建。新会话复制聊天内容与当前 Runtime/知识检索选择,重置压缩状态,
使用新的会话和消息 ID,且不复制 Task、队列、运行、记忆或成果归属。
@@ -546,6 +586,7 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
- OpenCode、Continue 和 DeepSeek Harness 后续的 Task 级委派与取消、后台执行进度/结果、Workflow/Hook 运行、长任务暂停/恢复/终止及原生会话监督统一进入应用级助手工作栏固定的“Runtime”栏目,不加入 Composer。栏目入口始终存在;只选择 Conversation 或 Task,并按 Task 聚合执行状态,不显示 Job/Run 树或独立操作菜单。内部可选区域按用户所选目标和 Runtime 的真实能力显示,不为未支持能力渲染空卡片或成排禁用按钮。切换跟随目标时必须清理上一归属的监督状态,固定目标则保持不变。
- 设置中心只管理持久 Runtime 配置、默认值和能力清单;右侧 Runtime 栏目管理用户当前跟随或固定目标的生命周期。两处不得复制同一实时操作,栏目中的高风险操作仍须就地确认并保留取消、权限、用量和活动审计。
- Runtime Prompt 快捷操作只把模板填入输入草稿,用户可以继续编辑;OpenCode Command 由 Runtime 原生 API 执行,输入框只承载可选参数,不以普通斜杠文本冒充执行。
- OpenCode 原生 Task 调用在本地项目和托管 SSH 项目中统一解析为子 Agent 状态卡,不显示为普通工具卡。状态卡持续显示 Agent 类型、任务说明、运行状态、完成输出或失败原因;身份徽标、Agent 名称和状态位于首层,任务说明作为主信息,Runtime 来源作为次级元数据,输出与错误在同一卡片内按需展开。父 Agent 的推理不冒充子 Agent 过程,必须与状态卡保持明确间距。状态不能只靠颜色表达。推理、子 Agent、工具和正文统一按事件首次出现顺序进入消息块;增量更新只更新原位置,Task 临时工具块重分类后必须原位替换,不能把子 Agent 卡统一提升到消息顶部。同一调用的增量事件按稳定调用 ID 更新,不能因 ACP 首帧尚无参数而永久保留重复工具卡或活动记录。一次请求内已观察到的子 Agent 均保留在消息与活动记录中;父请求取消、失败或意外中断时仍处于活动状态的卡片必须结算为对应终态,父请求成功结束但子 Agent 未报告终态时必须显示为失败而不是推断为完成。
- Agent 回复进行中锁定模型、专家角色、工作模式和 Runtime 定制选择器,并关闭已打开的上下文菜单;回复结束或停止后再恢复选择,避免界面状态与本次运行实际使用的上下文不一致。
- Agent 回复进行中不能禁用普通消息发送。新消息与到期 Scheduled Task 共用 Conversation 级待发送队列。队列位于 Composer 容器之外、与输入框等宽并保持独立间距;有待发送项时直接显示无标题栏的极简列表,空队列不保留占位。每项固定为一行,按进入顺序显示轻量来源图标和截断摘要;普通消息使用消息图标,Scheduled Task 统一使用淡出时钟图标。
- 待发送项默认在当前回复结束后顺序执行。每项提供明确的“立即中断并插入”(空闲时为“立即运行”)和删除操作;前者先取消当前 Conversation 的活动执行,再将所选项提升为下一项,不允许同一 Conversation 并发写入时间线。
@@ -586,7 +627,7 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
- 范围明确区分 Global 与指定的一个或多个 Project;Global 与指定项目互斥,多项目选择使用
Checkbox,不能依靠进入页面时的当前项目推断。
- 状态卡片使用统一状态令牌,不只依赖颜色。
- 保留“成长概览 / 待处理建议 / 心跳轨迹 / 心跳计划”四个同级页面。
- 保留“运行概览 / 待处理建议 / 报告与记录 / 心跳计划”四个同级页面。
- 智能心跳菜单入口是完整配置的权威位置;任务中心和设置中心不得复制同一 CRUD 表单。
- “未来分区记忆”仅为长期方向,数据、状态和页面尚未设计,不得显示占位入口。
@@ -618,6 +659,11 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
- “笔记 / 待办”属于同一工作台内的同级内容面板,使用 `PageTabs` 的 `segmented` 视觉变体,与模型设置的分段控件保持同一外观。
- 页签切换保留 `tablist`、`tab` 和 `tabpanel` 语义;待办状态仍使用独立的 `SegmentedControl`,不得与内容页签合并。
- 笔记编辑器保留 Quill 原生列表快捷输入:输入 `-`、`*`、`1.`、`[ ]` 或 `[x]` 后按空格,分别转换为项目符号、编号或待办清单。快捷输入只生成现有 Delta 富文本,不引入 Markdown 源码模式、第二套持久化格式或第三方 Markdown 插件;编辑区附近持续提供简短提示。
- 左侧笔记与待办列表在双栏布局中允许在 `180px` 至 `360px` 范围内通过指针或键盘调整,
也可从页面标题区隐藏和恢复;宽度与显示状态均记住用户选择。分隔条保留 `separator`
语义及方向键、Home、End 操作,窄窗口堆叠布局不显示拖拽分隔条。
- 左侧笔记列表依次显示标题、最多两行内容预览,以及同一行的记录数和本地化更新时间。记录数靠左、更新时间靠右,窄宽度下均保持单行省略,不挤压标题或扩大列表栏。
- 左侧“魔法笔记”入口可显示未完成待办数量。数量为 0 时隐藏徽标,超过 99 时显示 `99+`,可访问名称仍说明精确数量;勾选、取消勾选以及 Agent / MCP 对笔记清单的写入都必须刷新数量。
- 未完成待办徽标的高度不得超过主导航图标;数量从 0 变为可见或再次隐藏时,主导航项行高和相邻菜单位置必须保持不变。
- 在待办面板勾选或取消勾选后,当前缓存中的源笔记正文必须立即同步对应清单状态,不得依赖离开工作区后重新加载。
@@ -641,8 +687,8 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
- “保存并测试模型”必须在保存后发送一次有界的真实模型请求。文本连接校验本次随机测试文本,图像连接校验实际返回的内联图片;仅收到成功 HTTP 状态、模型列表或健康检查响应不算测试成功。界面持续说明该操作可能产生少量服务商用量费用,成功反馈明确写为“真实生成测试通过”。
- 所有显式保存的设置草稿都参与离开保护:关闭、切换分类、主侧栏或工作区导航及托盘导航不得静默丢弃,统一通过设置中心的就地确认提供继续编辑与明确放弃入口,保存失败后保留输入。“平台功能 / 通用设置”承载全局快捷唤起的共享 Switch、可访问 accelerator 录制输入、恢复默认、保存及注册、停用或冲突状态,不新增分类或页签;注册或持久化失败时保留上一组可用快捷键和当前草稿,保存或停用成功后同步更新输入区的快捷键提示。
- “平台功能”使用共享 `PageTabs` 区分“通用设置”“远程项目(技术预览)”和“魔法笔记”,默认进入通用设置。“远程项目”页将持久 Switch 与用户数据目录中的 Linux x64/arm64 Agent 包清单分成独立卡片;清单延迟到首次打开该页签时由 Main 完整校验,并读取所选更新源的小型签名目录,显示本地版本、在线最新兼容版本以及“有更新”“已是最新”“未下载”“校验失败”。打开页签或刷新不得自动下载 `.gbagent`;只有用户点击带目标版本的下载/更新按钮后才传输包。签名目录不可用时继续显示并允许导出已验证本地包,提供就地重试错误;清单不混入 Host 已安装状态、缓存路径或敏感签名细节。下载和导入期间保留上下文进度,成功进入全局通知视口。“魔法笔记”页提供默认开启的“显示未完成待办数量”持久 Switch,关闭后只隐藏左侧数量徽标,不改变待办数据或魔法笔记入口。全局模型下载源使用 `fieldset`、持久 `legend` 与整行可点击的原生 Radio 卡片;选中状态同时依靠 Radio、边框和背景表达,读取失败时不得用默认值伪装为已保存选择。
- “关于与更新”的更新源位于“启动时检查新版本”开关下方,常规宽度下将标签、原生单选下拉框和用途说明放在同一行,并复用设置表单的统一控件样式;关闭启动检查后,下拉框置灰且不可操作。选项显示“GitHub(默认)”和中性的“镜像节点”。该选择同时控制手动检查、启动时检查、下载页和 Agent 包在线下载,不显示底层服务商名称。
- “关于与更新”在版本信息之后提供应用内反馈卡片。反馈对话框使用原生字段、明确隐私说明和一张可选截图,失败时保留草稿并提供就地重试,成功时在对话框内保留可复制编号而不重复发送全局通知;对话框遵循统一 Modal 的背景隔离、初始焦点、Tab 循环、Escape、焦点恢复和窄窗口布局。
- “关于与更新”的更新源位于“启动时检查新版本”开关下方,常规宽度下将标签、原生单选下拉框和用途说明放在同一行,并复用设置表单的统一控件样式;关闭启动检查后仍可选择更新源,手动检查继续使用当前选择。选项显示“GitHub(默认)”和中性的“镜像节点”。该选择同时控制手动检查、启动时检查、下载页和 Agent 包在线下载,不显示底层服务商名称。
- “关于与更新”在版本信息之后提供应用内反馈卡片。反馈对话框使用原生字段、明确隐私说明和一张可选截图;另提供默认关闭的原生 Checkbox,让用户主动附加最近桌面诊断摘要。Checkbox 附近必须持续说明摘要只含时间、组件、阶段、稳定错误码、错误类型和固定短消息,不含对话、Prompt、凭据、文件内容、路径、Provider 原始响应或远端 Agent 日志。勾选时为诊断摘要预留描述字符预算,超长草稿必须保留并显示字段错误,不得静默截断。失败时保留草稿、勾选状态和请求编号并提供就地重试,成功时在对话框内保留可复制编号而不重复发送全局通知;对话框遵循统一 Modal 的背景隔离、初始焦点、Tab 循环、Escape、焦点恢复和窄窗口布局。
- Agent Runtime 分类页头的“保存设置”同时保存 Runtime 基础配置与 Runtime 原生定制,不在原生定制卡片内提供第二个保存入口。原生定制存在未保存更改时持续显示状态和撤销入口;切换设置分类或 Runtime 不丢弃草稿,关闭设置中心前必须先保存或撤销。
- Agent Runtime 页面在低层程序与配置覆盖之外提供“能力与默认配置”区域。能力清单使用共享 `PageTabs`,按 Agents、Tools、Commands、Skills、MCP、Rules、Prompts、Resources、LSP、Formatters 和上下文 11 类单行滚动展示,一次只呈现当前分类的 `tabpanel`;清单只显示 Runtime 自有能力,不混入 GoodBuddy 分配的 Skills、临时 MCP 或 Continue 预设。Tools 必须独立于 Commands、LSP 和 Formatters,显示工具类型、来源及 Ask/Execute 可用性;清单状态必须区分完整、部分、不可用、仅连接和不支持,不能用进程连通性冒充清单可读。
- “能力与默认配置”只显示一个模块标题,刷新入口位于该标题右侧,能力状态压缩为一行并排在默认 Agent 或 Continue 预设编辑器之前;不得再复制“Runtime 原生能力”等同义标题、说明或状态结论。刷新只更新能力快照,不覆盖未保存的原生定制草稿。
+1 -1
View File
@@ -1,6 +1,6 @@
{
"formatVersion": 1,
"agentVersion": "0.11.5",
"agentVersion": "0.11.14",
"protocol": {
"major": 2,
"minor": 0
+39
View File
@@ -328,6 +328,20 @@ function createManifest(bundleDirectory, metadata) {
spdx: 'MIT',
path: 'licenses/zod-MIT.txt'
},
...(files.some(
(file) =>
file.path ===
'licenses/agent-client-protocol-Apache-2.0.txt'
)
? [
{
package: '@agentclientprotocol/sdk',
version: metadata.acpSdkVersion,
spdx: 'Apache-2.0',
path: 'licenses/agent-client-protocol-Apache-2.0.txt'
}
]
: []),
{
package: koffiPackageName,
version: metadata.koffiVersion,
@@ -923,6 +937,20 @@ function buildAgentBundle(options) {
join(projectRoot, 'node_modules', 'zod', 'LICENSE'),
join(staging, 'licenses', 'zod-MIT.txt')
)
copyLicense(
join(
projectRoot,
'node_modules',
'@agentclientprotocol',
'sdk',
'LICENSE'
),
join(
staging,
'licenses',
'agent-client-protocol-Apache-2.0.txt'
)
)
copyLicense(
join(projectRoot, 'node_modules', 'koffi', 'LICENSE.txt'),
join(staging, 'licenses', 'koffi-MIT.txt')
@@ -935,10 +963,21 @@ function buildAgentBundle(options) {
join(projectRoot, 'node_modules', 'zod', 'package.json'),
'zod package metadata'
)
const acpSdkPackage = readJson(
join(
projectRoot,
'node_modules',
'@agentclientprotocol',
'sdk',
'package.json'
),
'ACP SDK package metadata'
)
const manifest = createManifest(staging, {
agentVersion: lock.agentVersion,
nodeVersion: lock.node.version,
zodVersion: zodPackage.version,
acpSdkVersion: acpSdkPackage.version,
koffiVersion: koffi.version,
koffiNativePackage: koffi.nativePackage,
arch,
+1 -1
View File
@@ -336,7 +336,7 @@ function main() {
const result = spawnSync(
process.execPath,
[
join(root, 'node_modules', 'electron-builder', 'cli.js'),
join(root, 'build', 'run-electron-builder.cjs'),
'--dir',
'--x64',
`--config.directories.output=${stagingRoot}`,
+25 -1
View File
@@ -88,9 +88,11 @@ const portableRequiredFiles = [
'resources/release-notes.json',
'resources/icon.ico',
'resources/tray-icon.png',
'resources/tool-environment/managed-python-artifacts.json',
'resources/runtimes/opencode/opencode.exe',
'resources/runtimes/continue/package.json',
'resources/runtimes/npm/bin/npm-cli.js',
'resources/runtimes/npm/bin/npx-cli.js',
'resources/runtimes/npm/package.json',
'resources/runtimes/npm/node_modules/graceful-fs/package.json'
]
@@ -346,7 +348,7 @@ function buildElectronBuilderArguments(options, outputDirectory) {
)
)]
const builderArguments = [
join(root, 'node_modules', 'electron-builder', 'cli.js'),
join(root, 'build', 'run-electron-builder.cjs'),
'--config',
releaseBuilderConfig,
definition.builderFlag,
@@ -894,6 +896,10 @@ function verifyHarnessPackage(
join(npmRoot, 'bin', 'npm-cli.js'),
'DSH 插件安装 npm CLI'
)
assertFile(
join(npmRoot, 'bin', 'npx-cli.js'),
'DSH 插件安装 npx CLI'
)
if (
!Array.isArray(npmManifest.bundleDependencies) ||
npmManifest.bundleDependencies.length === 0
@@ -1053,6 +1059,14 @@ function verifyUnpackedOutput(directory, options) {
assertFile(applicationExecutable, '应用主程序')
assertFile(join(resources, 'app.asar'), '应用 ASAR')
assertFile(join(resources, 'release-notes.json'), '版本更新说明')
assertFile(
join(
resources,
'tool-environment',
'managed-python-artifacts.json'
),
'托管 Python 产物目录'
)
assertFile(
join(resources, 'agent-release-keys.json'),
'Agent 受信任签名密钥'
@@ -1080,6 +1094,16 @@ function verifyUnpackedOutput(directory, options) {
),
'DSH 插件安装 npm Runtime'
)
assertFile(
join(
resources,
'runtimes',
'npm',
'bin',
'npx-cli.js'
),
'DSH 插件安装 npx Runtime'
)
verifyHarnessPackage(resources, options)
for (const [filePath, label] of [
[applicationExecutable, '应用主程序'],
@@ -0,0 +1,74 @@
const { createHash } = require('node:crypto')
const { readFileSync } = require('node:fs')
const { resolve } = require('node:path')
const { spawnSync } = require('node:child_process')
const maximumInstallerBytes = 256 * 1024
function verifyControlPlanePackageInstaller(
filePath = resolve(
'out',
'main',
'remote-package-installer.mjs'
)
) {
const bytes = readFileSync(filePath)
if (
bytes.byteLength === 0 ||
bytes.byteLength > maximumInstallerBytes
) {
throw new Error(
'Control-plane package installer exceeds its transfer limit'
)
}
const source = new TextDecoder('utf-8', {
fatal: true,
ignoreBOM: true
}).decode(bytes)
if (
/(?:^|\n)\s*(?:import|export)\b[^\r\n]*\bfrom\s*['"]\.{1,2}\//u.test(
source
) ||
/(?:^|\n)\s*import\s*['"]\.{1,2}\//u.test(source) ||
/\bimport\s*\(\s*['"]\.{1,2}\//u.test(source)
) {
throw new Error(
'Control-plane package installer is not a standalone bundle'
)
}
const syntax = spawnSync(
process.execPath,
['--check', filePath],
{
encoding: 'utf8',
windowsHide: true
}
)
if (syntax.status !== 0) {
throw new Error(
`Control-plane package installer is not executable: ${
syntax.stderr.trim() || syntax.stdout.trim()
}`
)
}
return {
size: bytes.byteLength,
sha256: createHash('sha256').update(bytes).digest('hex')
}
}
if (require.main === module) {
const result = verifyControlPlanePackageInstaller(
process.argv[2]
? resolve(process.argv[2])
: undefined
)
process.stdout.write(
`Control-plane package installer: ${result.size} bytes, sha256 ${result.sha256}\n`
)
}
module.exports = {
maximumInstallerBytes,
verifyControlPlanePackageInstaller
}
-401
View File
@@ -1,401 +0,0 @@
const { existsSync, readFileSync, rmSync } = require('node:fs')
const { gzipSync } = require('node:zlib')
const { resolve } = require('node:path')
// These are hard regression ceilings, not user-experience targets. In
// particular, do not lazy-load one peer tab solely to stay below a ceiling.
// The Settings ceiling is the validated 2026-08-23 production baseline
// (648.78 kB raw / 97.79 kB gzip), rounded up with about 15% review headroom.
const rendererBundleBudgets = Object.freeze({
initial: Object.freeze({ raw: 3_500_000, gzip: 720_000 }),
knowledge: Object.freeze({ raw: 330_000, gzip: 50_000 }),
graph: Object.freeze({ raw: 3_500_000, gzip: 720_000 }),
activity: Object.freeze({ raw: 55_000, gzip: 9_000 }),
magicNotes: Object.freeze({ raw: 630_000, gzip: 130_000 }),
settings: Object.freeze({ raw: 750_000, gzip: 115_000 })
})
function normalizePath(value) {
return value.replaceAll('\\', '/')
}
function findEntryKey(manifest) {
const entries = Object.entries(manifest).filter(
([, item]) => item && item.isEntry
)
if (entries.length !== 1) {
throw new Error(
`Expected one renderer entry in the manifest, found ${entries.length}`
)
}
return entries[0][0]
}
function findSourceKey(manifest, sourceSuffix) {
const normalizedSuffix = normalizePath(sourceSuffix)
let matches = Object.entries(manifest).filter(([key, item]) => {
const source = normalizePath(item.src || key)
return source.endsWith(normalizedSuffix)
})
if (matches.length === 0) {
const sourceName = normalizedSuffix
.split('/')
.at(-1)
?.replace(/\.[^.]+$/u, '')
matches = Object.entries(manifest).filter(
([, item]) =>
item?.isDynamicEntry &&
item.name === sourceName
)
}
if (matches.length !== 1) {
throw new Error(
`Expected one manifest entry for ${sourceSuffix}, found ${matches.length}`
)
}
return matches[0][0]
}
function findModuleOwnerKeys(manifest, moduleManifest, pattern) {
const keysByFile = new Map(
Object.entries(manifest).map(([key, item]) => [item.file, key])
)
const keys = new Set()
for (const [file, modules] of Object.entries(moduleManifest)) {
if (modules.some((id) => pattern.test(normalizePath(id)))) {
const key = keysByFile.get(normalizePath(file))
if (!key) {
throw new Error(`Module manifest chunk is missing: ${file}`)
}
keys.add(key)
}
}
if (keys.size === 0) {
throw new Error(`No renderer chunk owns modules matching ${pattern}`)
}
return keys
}
function assertSafeModuleManifest(moduleManifest) {
for (const modules of Object.values(moduleManifest)) {
for (const id of modules) {
const normalized = normalizePath(id)
if (
normalized !== id ||
normalized.startsWith('/') ||
normalized.startsWith('../') ||
/[A-Za-z]:\//u.test(normalized) ||
normalized.includes('/Users/') ||
normalized.includes('/home/')
) {
throw new Error(`Unsafe renderer module manifest path: ${id}`)
}
}
}
}
function collectSynchronousClosure(manifest, rootKey) {
if (!manifest[rootKey]) {
throw new Error(`Manifest entry is missing: ${rootKey}`)
}
const visited = new Set()
const pending = [rootKey]
while (pending.length > 0) {
const key = pending.pop()
if (visited.has(key)) {
continue
}
const item = manifest[key]
if (!item) {
throw new Error(`Manifest import is missing: ${key}`)
}
visited.add(key)
for (const imported of item.imports || []) {
pending.push(imported)
}
}
return visited
}
function collectAssetFiles(manifest, keys) {
const files = new Set()
for (const key of keys) {
const item = manifest[key]
if (!item) {
throw new Error(`Manifest entry is missing: ${key}`)
}
files.add(normalizePath(item.file))
for (const cssFile of item.css || []) {
files.add(normalizePath(cssFile))
}
}
return files
}
function measureFiles(files, readAsset, metricCache = new Map()) {
let raw = 0
let gzip = 0
const measuredFiles = [...files].sort()
for (const file of measuredFiles) {
let metrics = metricCache.get(file)
if (!metrics) {
const bytes = Buffer.from(readAsset(file))
metrics = {
raw: bytes.byteLength,
gzip: gzipSync(bytes).byteLength
}
metricCache.set(file, metrics)
}
raw += metrics.raw
gzip += metrics.gzip
}
return { raw, gzip, files: measuredFiles }
}
function withoutItems(keys, excluded) {
return new Set([...keys].filter((key) => !excluded.has(key)))
}
function describeEntry(
manifest,
key,
initialKeys,
initialFiles,
readAsset,
metricCache
) {
const closureKeys = collectSynchronousClosure(manifest, key)
const closureFiles = collectAssetFiles(manifest, closureKeys)
const incrementalKeys = withoutItems(closureKeys, initialKeys)
const incrementalFiles = withoutItems(closureFiles, initialFiles)
const root = measureFiles(
collectAssetFiles(manifest, new Set([key])),
readAsset,
metricCache
)
return {
key,
file: manifest[key].file,
rootRaw: root.raw,
rootGzip: root.gzip,
closureKeys,
incrementalKeys,
...measureFiles(incrementalFiles, readAsset, metricCache)
}
}
function assertDisjoint(description, keys, forbiddenKeys) {
const matches = [...forbiddenKeys].filter((key) => keys.has(key))
if (matches.length > 0) {
throw new Error(
`${description} synchronously includes ${matches.join(', ')}`
)
}
}
/**
* @typedef {object} RendererAnalysisKeys
* @property {string} initial
* @property {string} knowledge
* @property {string} graph
* @property {string} activity
* @property {string} magicNotes
* @property {string} settings
* @property {string[]} g6
*/
/**
* Analyzes one renderer manifest.
*
* `keys` is the authoritative set of discovered roots and module owners;
* notably, `keys.g6` is always an array because G6 may span several chunks.
*
* @returns {{ keys: RendererAnalysisKeys, sections: Record<string, object> }}
*/
function analyzeRendererManifest(manifest, readAsset, moduleManifest) {
assertSafeModuleManifest(moduleManifest)
const metricCache = new Map()
const keys = {
initial: findEntryKey(manifest),
knowledge: findSourceKey(manifest, 'KnowledgeWorkspace.tsx'),
graph: findSourceKey(manifest, 'KnowledgeGraphChart.tsx'),
activity: findSourceKey(manifest, 'ActivityPanel.tsx'),
magicNotes: findSourceKey(manifest, 'MagicNotesWorkspace.tsx'),
settings: findSourceKey(manifest, 'SettingsPanel.tsx')
}
const g6Keys = findModuleOwnerKeys(
manifest,
moduleManifest,
/(?:^|\/)node_modules\/@antv\/g6\//u
)
const initialKeys = collectSynchronousClosure(manifest, keys.initial)
const initialFiles = collectAssetFiles(manifest, initialKeys)
const initialRoot = measureFiles(
collectAssetFiles(manifest, new Set([keys.initial])),
readAsset,
metricCache
)
const initial = {
key: keys.initial,
file: manifest[keys.initial].file,
rootRaw: initialRoot.raw,
rootGzip: initialRoot.gzip,
closureKeys: initialKeys,
incrementalKeys: initialKeys,
...measureFiles(initialFiles, readAsset, metricCache)
}
const sections = {
initial,
knowledge: describeEntry(
manifest,
keys.knowledge,
initialKeys,
initialFiles,
readAsset,
metricCache
),
graph: describeEntry(
manifest,
keys.graph,
initialKeys,
initialFiles,
readAsset,
metricCache
),
activity: describeEntry(
manifest,
keys.activity,
initialKeys,
initialFiles,
readAsset,
metricCache
),
magicNotes: describeEntry(
manifest,
keys.magicNotes,
initialKeys,
initialFiles,
readAsset,
metricCache
),
settings: describeEntry(
manifest,
keys.settings,
initialKeys,
initialFiles,
readAsset,
metricCache
)
}
assertDisjoint(
'The renderer entry',
initialKeys,
new Set([keys.knowledge, keys.graph, keys.activity, ...g6Keys])
)
assertDisjoint(
'The Knowledge shell',
sections.knowledge.closureKeys,
new Set([keys.graph, ...g6Keys])
)
for (const g6Key of g6Keys) {
if (!sections.graph.closureKeys.has(g6Key)) {
throw new Error('The graph chunk no longer synchronously owns G6')
}
}
return { keys: { ...keys, g6: [...g6Keys] }, sections }
}
function checkBudgets(analysis, budgets = rendererBundleBudgets) {
const failures = []
for (const [name, budget] of Object.entries(budgets)) {
const section = analysis.sections[name]
if (!section) {
failures.push(`Unknown budget section: ${name}`)
continue
}
for (const metric of ['raw', 'gzip']) {
if (section[metric] > budget[metric]) {
failures.push(
`${name} ${metric} ${section[metric]} exceeds ${budget[metric]}`
)
}
}
}
if (failures.length > 0) {
throw new Error(`Renderer bundle budget failed:\n- ${failures.join('\n- ')}`)
}
}
function formatBytes(bytes) {
return `${(bytes / 1000).toFixed(2)} kB`
}
function formatReport(analysis) {
return [
'Renderer bundle budget:',
...Object.entries(analysis.sections).map(
([name, section]) =>
`- ${name}: root ${formatBytes(section.rootRaw)} raw / ` +
`${formatBytes(section.rootGzip)} gzip, ` +
`incremental closure ${formatBytes(section.raw)} raw / ` +
`${formatBytes(section.gzip)} gzip`
)
].join('\n')
}
function checkRendererBundle(root = process.cwd()) {
const rendererRoot = resolve(root, 'out', 'renderer')
const manifestPath = resolve(rendererRoot, '.vite', 'manifest.json')
const moduleManifestPath = resolve(
rendererRoot,
'.vite',
'module-manifest.json'
)
if (!existsSync(manifestPath)) {
throw new Error(`Renderer manifest not found: ${manifestPath}`)
}
if (!existsSync(moduleManifestPath)) {
throw new Error(
`Renderer module manifest not found: ${moduleManifestPath}`
)
}
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
const moduleManifest = JSON.parse(
readFileSync(moduleManifestPath, 'utf8')
)
const analysis = analyzeRendererManifest(
manifest,
(file) => readFileSync(resolve(rendererRoot, file)),
moduleManifest
)
checkBudgets(analysis)
rmSync(moduleManifestPath)
return analysis
}
module.exports = {
analyzeRendererManifest,
checkBudgets,
checkRendererBundle,
collectAssetFiles,
collectSynchronousClosure,
findEntryKey,
findModuleOwnerKeys,
findSourceKey,
formatReport,
assertSafeModuleManifest,
measureFiles,
rendererBundleBudgets
}
if (require.main === module) {
try {
const analysis = checkRendererBundle()
console.log(formatReport(analysis))
} catch (error) {
console.error(error instanceof Error ? error.message : String(error))
process.exitCode = 1
}
}
+4 -1
View File
@@ -300,7 +300,10 @@ assert_loongarch_elf \
assert_loongarch_elf \
"${verify_root}/opt/${application_directory}/resources/app/${koffi_binding#${app_root}/}"
sha256sum "${artifact}" > "${artifact_root}/SHA256SUMS"
(
cd "${artifact_root}"
sha256sum "${artifact_name}" > SHA256SUMS
)
cat > "${artifact_root}/preview-manifest.json" <<EOF
{
"formatVersion": 1,
+2 -2
View File
@@ -32,8 +32,8 @@ function validateItems(value, label) {
fail(`${label} contains a non-string item`)
}
const normalized = item.trim()
if (!normalized || normalized.length > 500) {
fail(`${label} contains an empty or oversized item`)
if (!normalized) {
fail(`${label} contains an empty item`)
}
return normalized
})
+32
View File
@@ -0,0 +1,32 @@
'use strict'
function configureElectronBuilderLogLevels(
moduleManager = require(
'app-builder-lib/out/node-module-collector/moduleManager'
)
) {
const duplicateReferenceMessage =
moduleManager.LogMessageByKey.PKG_DUPLICATE_REF
if (
!duplicateReferenceMessage ||
!moduleManager.logMessageLevelByKey[
duplicateReferenceMessage
]
) {
throw new Error(
'当前 electron-builder 不支持依赖引用日志级别配置'
)
}
moduleManager.logMessageLevelByKey[
duplicateReferenceMessage
] = 'debug'
}
if (require.main === module) {
configureElectronBuilderLogLevels()
require('electron-builder/cli')
}
module.exports = {
configureElectronBuilderLogLevels
}
@@ -147,7 +147,7 @@ async function main() {
)
const packageArguments = [
resolve('node_modules/electron-builder/cli.js'),
resolve('build/run-electron-builder.cjs'),
'--projectDir',
project,
'--win',
-54
View File
@@ -1,54 +0,0 @@
# GoodBuddy 文档导航
GoodBuddy 文档按“文档类型 → 功能域”组织。新增文档应先选择类型,再放入对应功能目录,
避免继续把所有设计平铺到单一 `features` 目录。
## 产品需求
| 功能域 | 入口 |
| --- | --- |
| Task 与 Job | [Task 与 Job 总览](./prd/task-and-job/README.md) |
| Smart Heartbeat | [智能心跳 PRD](./prd/smart-heartbeat/smart-heartbeat-prd.md) |
| 助手工作栏 | [通用助手工作栏与执行空间 PRD](./prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md) |
| 会话监督 | [会话监督 PRD](./prd/supervision/conversation-supervision-prd.md) |
| 记忆 | [分区记忆 PRD](./prd/memory/partitioned-memory-prd.md) |
| 并行实验 | [并行实验工作台 PRD](./prd/experiments/parallel-experiments-prd.md) |
| 持续学习 | [持续学习与评估门 PRD](./prd/learning/continuous-learning-prd.md) |
| 知识库 | [知识库检索与分块增强 PRD](./prd/knowledge/knowledge-rag-enhancement-prd.md) |
| 文档处理 | [文档解析与本地 OCR](./prd/document-processing/document-extraction-and-local-ocr.md) |
| 消息通道 | [微信 ClawBot 通道 PRD](./prd/channels/wechat-clawbot-channel-project-prd.md) |
## Task 与 Job 文档
- [统一领域模型](./prd/task-and-job/task-and-job-model.md)
- [Task Center](./prd/task-and-job/task-center-prd.md)
- [Scheduled Task](./prd/task-and-job/scheduled-task-prd.md)
- [Goal Task](./prd/task-and-job/goal-task-prd.md)
- [Job 与 Subjob](./prd/task-and-job/job-and-subjob-prd.md)
## 跨功能文档
- [自动化平台架构](./architecture/automation-platform-architecture.md)
- [平台功能页签与模型下载源设计](./architecture/model-download-source-design.md)
- [本地文本向量模型与连接设计](./architecture/local-text-embedding-model-design.md)
- [全双工实时语音交互设计](./architecture/full-duplex-voice-design.md)
- [DeepSeek Harness Runtime 设计](./architecture/deepseek-harness-runtime-design.md)
- [应用内反馈系统设计与对接](./architecture/in-app-feedback-integration-design.md)
- [SSH 远程主机与 GoodBuddy Agent 稳定终态设计](./architecture/remote-host-and-goodbuddy-agent-design.md)
- [跨平台助手产品设计](./design/cross-platform-assistant-product-design.md)
- [长期助手路线图](./roadmap/long-term-assistant-roadmap.md)
- [电脑控制实施状态](./status/computer-control-implementation-status.md)
- [知识检索评估](./quality/knowledge-retrieval-evaluation.md)
- [GoodBuddy 龙芯(LoongArch)预览版构建与功能列表](./development/loongarch-preview-build.md)
- [统一界面设计系统](../UI-DESIGN.md)
## 目录规则
1. PRD 放在 `docs/prd/<功能域>/`。
2. 跨功能技术总纲放在 `docs/architecture/`。
3. 产品级设计放在 `docs/design/`,路线图和实施状态分别放在 `roadmap`、`status`。
4. 测试方法、评估协议和质量报告放在 `docs/quality/`。
5. 开发环境、实验性构建和移植说明放在 `docs/development/`。
6. 一个概念只能有一份权威定义;其他文档链接到它,不复制另一套术语。
7. Task、Job、Run、Subagent 和 Conversation 的含义以
[Task 与 Job 统一领域模型](./prd/task-and-job/task-and-job-model.md) 为准。
@@ -9,7 +9,7 @@
| 日期 | 2026-08-19 |
| 适用产品 | GoodBuddy 桌面端 |
| 文档角色 | Task/Job、调度、目标、并行实验、会话监督、分区记忆与持续学习的总纲 |
| 领域模型 | [Task 与 Job 统一领域模型](../prd/task-and-job/task-and-job-model.md) |
| 领域模型 | [Task 与 Job 统一领域模型](../features/task-and-job/task-and-job-model.md) |
## 1. 背景
@@ -435,9 +435,9 @@ Renderer 只通过显式 IPC 列出、加入、删除、提升、释放和接收
└─ 独立成果
智能心跳
├─ 成长概览
├─ 运行概览
├─ 待处理建议
├─ 心跳轨迹
├─ 报告与记录
└─ 心跳计划
└─ Global / 指定 Project
```
@@ -445,7 +445,7 @@ Renderer 只通过显式 IPC 列出、加入、删除、提升、释放和接收
监督统一进入应用级助手工作栏中固定且始终可访问的“监督”栏目,不再保留“独立可折叠右栏”
和“动态新增页签”两种实现。栏目默认跟随当前上下文,用户可以固定到其他 Conversation、
Task 或实验对象;详细范围与交互契约见
[通用助手工作栏与执行空间 PRD](../prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md)。
[通用助手工作栏与执行空间 PRD](../features/assistant-workbar/prd.md)。
## 13. 安全与隐私
@@ -555,15 +555,15 @@ Conversation 关联,旧 child-task 字段可兼容映射到 Job/Subjob;心
## 17. 相关文档
- [Task 与 Job 统一领域模型](../prd/task-and-job/task-and-job-model.md)
- [Task Center PRD](../prd/task-and-job/task-center-prd.md)
- [Scheduled Task PRD](../prd/task-and-job/scheduled-task-prd.md)
- [Job 与 Subjob PRD](../prd/task-and-job/job-and-subjob-prd.md)
- [智能心跳 PRD](../prd/smart-heartbeat/smart-heartbeat-prd.md)
- [并行实验工作台 PRD](../prd/experiments/parallel-experiments-prd.md)
- [会话监督 PRD](../prd/supervision/conversation-supervision-prd.md)
- [分区记忆 PRD](../prd/memory/partitioned-memory-prd.md)
- [持续学习与评估门 PRD](../prd/learning/continuous-learning-prd.md)
- [Task 与 Job 统一领域模型](../features/task-and-job/task-and-job-model.md)
- [Task Center PRD](../features/task-and-job/task-center-prd.md)
- [Scheduled Task PRD](../features/task-and-job/scheduled-task-prd.md)
- [Job 与 Subjob PRD](../features/task-and-job/job-and-subjob-prd.md)
- [智能心跳 PRD](../features/smart-heartbeat/prd.md)
- [并行实验工作台 PRD](../features/parallel-experiments/prd.md)
- [会话监督 PRD](../features/conversation-supervision/prd.md)
- [分区记忆 PRD](../features/memory/prd.md)
- [持续学习与评估门 PRD](../features/continuous-learning/prd.md)
- [GoodBuddy 长期助手功能规划](../roadmap/long-term-assistant-roadmap.md)
- [GoodBuddy 统一界面设计系统](../../UI-DESIGN.md)
@@ -10,7 +10,7 @@
| 日期 | 2026-08-19 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 相关基线 | [统一界面设计系统](../../UI-DESIGN.md)、[文档解析与本地 OCR](../prd/document-processing/document-extraction-and-local-ocr.md)、[本地文本向量模型与连接设计](./local-text-embedding-model-design.md)、[全双工实时语音交互设计](./full-duplex-voice-design.md) |
| 相关基线 | [统一界面设计系统](../../UI-DESIGN.md)、[文档解析与本地 OCR](../features/document-processing/prd.md)、[本地文本向量模型与连接设计](../features/knowledge-base/local-embedding-technical-design.md)、[全双工实时语音交互设计](../features/full-duplex-voice/technical-design.md) |
本文定义“设置 → 平台功能”的二级页签结构,以及所有 GoodBuddy 托管本地模型共同使用的
“模型下载源”设置。首期下载源为 ModelScope 和 Hugging Face,默认使用 ModelScope。
@@ -1,247 +0,0 @@
# SSH 远程主机与 GoodBuddy Agent 实现说明
## 状态
本文记录当前代码实现,不定义额外的信任框架。Windows 到 Linux x64 的安装、Main-only 模型桥、断线恢复、输出重放、同一 OpenCode Session 续接与终态清理已经在真实 Host 上完成 provider-free 验证。上一轮 Linux x64 验收使用 Agent `0.11.2-e2e.12` 与 OpenCode Runtime `1.18.9` 完成了一次有界真实模型工具调用;加入每 helper 随机 loopback 路径 capability 后,当前源码 lock 已转为正式 Agent `0.11.5`。失败的 `agent-v0.11.3` 保持不可变且未发布。远程 OpenCode 功能仍处于发布前验证阶段;公开签名 key registry 已供应,当前发布门槛是通过独立 Agent workflow 正式发布并公开验证 Linux x64/arm64 复合包和签名累计目录。
## 产品语义
远程 Host 与项目能力是默认关闭的技术预览。用户在“设置 > 平台功能”的独立
“远程项目(技术预览)”页签启用开关后,Renderer 才显示 SSH Host 管理、托管 SSH 项目创建和已保存
远程项目;Main 在 IPC 边界执行同一开关校验,避免隐藏界面被绕过。关闭开关不删除 Host、
项目或凭据;进行中的激活允许取消,当前远程项目切回第一个普通本地项目。应用启动仍固定
选择普通本地项目,不会因为保存了远程项目而自动连接 Host。
远程项目只有两种工作模式:
- **Ask**:Runtime 在操作系统边界以只读方式访问项目 Workspace。
- **Execute**:用户已授权使用所选 SSH 账号的完整权限。Runtime 可以使用该账号可访问的文件、进程、网络和工具,不再要求额外 trust tier、consent checklist、逐工具审批或“受控执行”授权。
Execute 不获得 root 或 SSH 账号本身没有的权限。模型 API Key 与 Provider 认证仍保留在 Electron Main,不传给远端 Runtime。
## 组件
```text
Renderer
-> 窄 Preload / Main IPC
Main
-> SSH Host 与 Host Key 管理
-> SSH connection pool
-> 签名 Agent / Runtime 安装
-> 远程项目验证与 SQLite 事务
-> Main-owned model bridge
SSH attach
-> 远端私有 Unix socket
Detached GoodBuddy Agent
-> Workspace / Git 协议
-> OpenCode ACP channel
-> 直接拥有的 Runtime 进程
```
不提供把远端路径交给本机 Runtime 的伪本地模式,也不提供 SSH stdio Runtime fallback。
## SSH Host
- Renderer 只管理脱敏 Host 快照,不接触密码、密文、SSH Client 或任意命令接口。
- Main 在认证前取得 Host Key,展示算法与 SHA-256 指纹,并保存完整 key blob。
- 首次连接需要用户确认。Host Key 变化展示旧/新值并要求显式替换。
- 密码使用 Electron `safeStorage`;系统 SSH Agent 认证不启用 Agent forwarding。
- Host 地址、用户或 Host Key generation 变化时关闭旧连接,并定向退役依赖旧 Host identity 的 Workspace 和 Runtime 会话。保存开始后,所有引用该 Host 的项目保持“需要重新激活”状态;当前项目立即执行完整激活并原子刷新 Host revision 等验证结果,其他项目在下次选择时刷新。激活失败或取消不会恢复发送能力,Composer 和来自 Main 持久队列的用户消息都要等待后续成功激活;排队消息会退回原队列,并在成功后通过既有 queue-ready 流程继续。用户重新选择当前 SSH 项目也会显式触发相同验证,而不是复用旧项目快照。
## Agent 安装与生命周期
- Agent bundle 通过 manifest、Ed25519 签名、payload digest、平台和架构校验。
- 安装使用当前 SSH 用户目录中的 GoodBuddy-owned 路径和 side-by-side digest 目录。
- Agent 代码与固定 Node Runtime 是独立 payload。升级时如果当前 Host Agent 的签名
manifest、registry identity、owner/mode/size 和 Node digest 都可验证,且候选
manifest 声明完全相同的 Node,安装器直接在新的 side-by-side 目录中复用该 Node;
否则正常上传候选 Node。Agent 不匹配不会阻止升级,也不会覆盖旧安装。
- 桌面包只携带版本 lock 与 production 公钥,不携带远端 payload。用户必须先在设置中显式下载最新兼容的目标架构复合包,或导入离线 `.gbagent`;项目激活不会联网下载。每个复合包绑定 Agent、固定 Node 与桌面维护的 OpenCode Runtime 精确工件。应用重启固定进入第一个普通本地项目,不自动连接上次远程项目;用户主动切换托管 SSH 项目时,Main 从本地验证缓存选择 Host 架构工件,Host 尚未安装该 identity 时上传并启动。相同 Renderer 对同一项目的并发激活共享一个 Main 操作。
- Agent、Workspace 和 Runtime 全部验证成功后,Main 才在同一 SQLite 事务中刷新项目保存的 Agent/Runtime evidence,然后把项目设为当前项目。上传、启动、验证或事务失败时,项目继续绑定旧 identity,不能用未提交的新 identity 绕过持久化绑定校验。
- SSH 连接先尝试 attach;Agent 不存在或未运行时执行幂等 bootstrap,然后重新 attach。
- Agent 是按需启动的 detached process,不注册开机服务,不依赖 systemd、D-Bus 或 Linger。
- 每个模型桥 helper 都为 loopback HTTP 入口生成一次性随机路径 capability;只有写入当前 OpenCode 子进程配置的 URL 可以访问该入口,其他本机用户即使发现临时端口也不能提交模型请求。
- Agent 监听当前用户拥有的私有 Unix socket。SSH 中断只关闭 relay,不拥有 Agent 和活动 Runtime 的生命周期。
- SSH Host 设置通过固定探针和有界 SFTP 显示 Host 已登记的 Agent/OpenCode 版本,并与当前 GoodBuddy 所需版本比较;打开设置或“刷新版本”只读取状态,不安装或切换远端组件。
- “平台功能 > 远程项目”中的本地 Agent 包清单与 Host 状态分离。Main 对用户数据目录中
Linux x64/arm64 `.gbagent` 分别执行外层可信签名、桌面/协议兼容性、内部 Agent/Runtime
签名、架构与完整 payload 校验;首次打开和手动刷新还会读取“关于与更新”所选来源的
小型签名目录。Renderer 只得到本地/在线版本、是否有更新、架构、远端 Runtime 版本、
协议和本地状态,不得到缓存路径、key ID 或 digest。目录检查不下载 `.gbagent`,在线
包下载只由用户点击带目标版本的操作触发;离线导入/导出通过 Main 管理的文件对话框完成。
- 当任一组件缺失或不是当前版本时,用户可显式选择“更新版本”。Main 使用同一个取消信号依次强制执行 Agent、Runtime 安装器,并把 Agent、Runtime、Finalizing 阶段只发送给发起更新的 Renderer。更新启动仍受技术预览开关和可信 Sender 校验约束;取消不受开关约束,确保操作开始后即使关闭功能也能停止。
- 更新成功后才定向清理该 Host 的 Agent 连接和 Runtime 选择缓存,并让当前引用项目重新激活;失败或取消保留 Host 配置、凭据、项目、Workspace 和可继续验证的旧组件,Renderer 刷新实际版本并允许重试。同一 Renderer 同时只更新一个 Host,窗口销毁或 Main 退出会取消活动更新并执行有界收尾。
- 显式 stop、升级、身份冲突或进程退出时清理 GoodBuddy 自己的 socket、状态和子进程;不得删除或覆盖无关 Host 文件。
## Workspace
Main 传入已规范化的绝对 POSIX root。Agent 返回 Workspace identity、访问模式、Git 状态和有界能力。
- 创建项目时,用户可以直接输入远端工作目录,或通过输入框右侧的文件夹按钮浏览并选择目录。
- 项目保存前的目录浏览使用 Main 管理的只读、有界 SFTP,只返回目录;每次请求重新解析并校验当前 Host revision 与 Host Key generation,不安装 Agent、不暴露任意 shell/SFTP 接口。
- 浏览从 SSH 账号 Home 或当前有效绝对路径开始,限制扫描次数、返回条目和总时限;取消、Host 变化、超时或连接失败时关闭 SFTP 并保留用户原先输入。
- 选择目录只更新项目草稿,仍需通过正常的 Agent、Workspace、Runtime 验证和项目保存事务才会持久化。
- Ask Workspace handle 不暴露写入方法。
- Execute Workspace handle 可读写,但这不是 Execute 的唯一权限面;Execute Runtime 本身使用 SSH 账号的正常权限。
- 文件预览、搜索、Git diff、目录项和显式文件传输保持字节、条目数和路径长度上限。
## Runtime
首个远程 Runtime 固定为签名 OpenCode ACP bundle。
托管 SSH 项目的 Composer Runtime 菜单只显示当前配置的 OpenCode 和管理入口,不显示
直连模型、Continue 或 DeepSeek Harness。激活旧远程会话时,若其保存了其他 Runtime
selection,Renderer 会恢复为当前 OpenCode 配置;Main 的远程请求校验仍是最终边界。
### Ask
Ask 使用系统 `bwrap`:
- Workspace 和 Runtime bundle 只读 bind;
- 独立可写 scratch HOME、TMPDIR 和 XDG 目录;
- 固定环境名和固定 Runtime argv;
- 通过只读边界阻止 Workspace 修改。
- ACP 权限请求只有在工具种类为原生 `read` 且 Runtime 提供 `allow_once` 选项时才允许;
search、edit、execute、未知工具以及只提供持久授权的请求全部拒绝。
`allow_once` 只解决 OpenCode 发起原生读取前的 ACP 协商,真正的文件系统边界仍是只读
`bwrap` bind。Host 缺少 `bwrap` 时 Ask 不可用。
### Execute
Execute 不经过 Ask 的 bubblewrap profile:
- 直接启动已签名 Runtime entrypoint;
- 使用 Main-only 模型桥时,签名 Agent launcher 会 `exec` 候选 manifest 锁定的
Node Runtime;完全相同且已验证的 Node 可在 Agent 版本间复用。进程 owner 校验
最终 Node executable,而不是已经被替换的 shell launcher 路径;
- `cwd` 为项目 Workspace;
- 继承 SSH 账号的正常环境、文件系统、进程和网络能力;
- 不进行 T2/T3、confinement attestation、approval bridge 或逐工具批准。
两种模式都保留请求 deadline、输入/输出字节上限、取消和进程组清理。
## ACP 与断线
- 管控面只负责有界 JSON-RPC:连接、查询、启动、取消、关闭和重连。数据面只负责
ACP/blob 数据与 Agent 本机 journal。二者共享同一个经过 Host Key 校验和认证的
SSH attach 字节流,但不共享生命周期:管控连接关闭不会隐式取消 Agent 已接受的
Runtime 动作。
- 帧只保留连接 identity、channel identity、单调 sequence、类型和长度。Main 与
Agent 都按调用顺序 FIFO 写入,输入队列达到固定字节或条目上限时暂停 SSH stream。
顺序、可靠传输、分包和网络背压全部交给 SSH;协议不实现 credit/window、优先级
调度、跨 channel 超车、批发送或第二套拥塞控制。
- Agent 在把 Main 输入交给 Runtime 前、以及把 Runtime 输出交给 Main 前,先把 ACP frame 写入本机 journal。ACK 只推进 cursor 并裁剪已确认 frame,不表示 channel 已终止。
- Main 持久化 binding identity 和单调 cursor;保留中的 connection lease 即使处于 offline/reconnecting,也可以先把新 cursor 落盘。重连提交不能覆盖 resume 过程中并发落盘的更新。
- 同一 detached Agent 存活时,短暂 SSH 断线依次执行 `controller/resume`、`runtime/resumeAcpChannel` 和 `runtime/replayAcpChannel`,从 Main 已确认的 cursor 后只重放 Agent 到 Main 的已记录输出。重复 frame 会被确认但不会再次交给上层。
- Main 到 Runtime 的 ACP 输入、模型请求、工具请求和 blob 不自动重放。
- 无法确认外部 Provider 是否已处理的模型调用保持结果未知,避免重复计费或重复副作用。
- 只有远端返回 identity 匹配且 `closed: true` 时,Main 才删除持久化 binding;传输失败或未确认 close 会保留 recovery identity。
- 终态 close 由 Agent 在一个事务中为两个方向记录 sequence high-water tombstone,删除剩余 frame 和 active channel,并归零对应 journal quota。tombstone 用于拒绝迟到的旧 epoch frame,因此当前不会按时间自动裁剪。
- 断线不主动终止正在运行的 Runtime。用户取消、deadline、显式关闭或 Agent shutdown 才触发停止。
- Agent 失联期间继续把 Runtime 输出写入本机 journal;重新连接只校验 controller
identity、恢复 binding,并从 Main 最后确认的 cursor 后同步缺失数据。已接受的
指令和结果不确定的 Provider 请求都不自动重放。
## 模型桥
- Provider URL、API Key 和认证头只存在于 Main。
- 远端 OpenCode 通过 GoodBuddy Agent helper 和每次 Prompt 的私有 Unix socket 使用模型桥。
- Main 校验固定模型 profile、协议、请求路径和有界传输格式,并记录 Provider
返回的实际 usage;不限制 Prompt 内的模型调用轮数、工具调用次数、累计 Token
或单次模型输出 Token。取消、Runtime deadline、请求/响应字节上限和结果不确定时
禁止自动重放仍然保留。
- helper 可以接收同一 Prompt 内并发到达的模型桥请求;它在单一稳定模型桥上按到达
顺序等待并交付,不返回本地 `bridge-busy`,每个响应只有在 HTTP 完整 flush 后才
发送 delivery ACK。
- GoodBuddy 自己管理会话标题,因此传给 OpenCode 的配置禁用 title Agent;一次用户
Prompt 不会额外触发标题模型请求。
- 一条模型桥消息编码为一个 canonical JSON blob frame;blob frame 最大 2 MiB,
Provider 请求与响应 body 仍各自限制为 768 KiB。每条模型消息只调用一次 SSH
write,不再二次分片、等待逐帧 credit 或合并多个协议帧。凭据不进入 Renderer、
SSH 命令参数或远端环境。
- Unix socket 接收端按 `readableLength` 中已经缓冲的字节增量排空一个声明长度的帧,
不会在部分大响应到达时反复请求尚未缓冲的完整剩余长度;短读、连接结束、错误和取消
都会使当前交换失败。原生 Linux 回归覆盖至少 256 KiB 的 broker 响应。
- Renderer 把相邻 text/reasoning delta 合并为消息 block 时始终替换最后一个 block,
不修改既有 React state 对象。这样开发环境 StrictMode 重复调用 state updater 时,
block metadata 与 canonical 消息正文保持一致。
## 已完成的 E2E 验收记录
- 2026-08 的本地 fixture 完整验证 Linux x64 Agent `0.11.2-e2e.12`、Node `24.19.0`
和 Agent protocol `2.0`;当时没有 arm64 fixture,因此该记录不能作为当前独立发布
的双架构验收。当前源码 lock 是正式版本 `0.11.5`,需要由新的复合包发布流程另行验证。
- 正常 Host 更新路径把 Linux x64 Host 的 Agent 更新为 `0.11.2-e2e.12`,并确认
OpenCode Runtime 已安装版本与所需版本均为 `1.18.9`。
- 一条新的 Ask 用户操作只提交一次。OpenCode 先在 build 模型轮次请求一个原生
`read`,读取专用测试 Workspace 中的证据文件,再在第二个 build 模型轮次生成最终
回答;没有 title 模型轮次,也没有第二个工具调用。
- 两个模型轮次都记录已交付,远端 helper 保持休眠且 Unix socket 没有未读响应积压。
持久化的 canonical 助手正文精确为 `GOODBUDDY_REMOTE_TOOL_4C6B9D8A`。验收操作没有
重放任何结果未知或已经完成的 Provider 请求。
## 项目保存
远程项目持久化稳定配置和当前验证结果:
- Host ID、Host revision 与 Host Key generation;
- 远端工作目录和 Workspace identity;
- Agent installation identity;
- Runtime selection、bundle digest、adapter digest;
- `ask | execute`。
打开托管 SSH 项目会从这些已保存字段重建验证输入,不接受 Renderer 回传的旧项目草稿。桌面更新后,用户先显式准备兼容复合包,第一次打开才可安装对应 Agent/Runtime 并原子刷新以上字段,同时保留项目名称、说明、Host、远端工作目录、Runtime selection 和默认工作模式。
请求前置校验只要求 Workspace 验证与 Runtime 验证来自同一个当前 Agent
installation。它不比较激活时保存的模型 profile 或默认工作模式与当前会话选择,
因为这些不是签名远端 Runtime 的身份;切换当前模型配置或 Ask/Execute 不需要重新激活
项目。实时 Runtime 创建仍只接受 OpenCode,使用当前解析后的模型 profile 建立 Main-only
模型桥,并再次精确核对 Agent identity、Runtime bundle/adapter digest、架构、capability
和连接身份。Ask/Execute 权限继续由每次 Prompt 的 ACP Runtime 边界执行。
Renderer 在用户主动打开托管 SSH 项目时订阅同一次 Main 保存操作的进度,依次显示
Host、Agent、Workspace、Runtime 和 Saving。操作完成、失败或取消后会清除阻塞进度;
进行中可显式取消,并禁用会产生冲突的项目切换、创建和设置入口。远端 RPC 拒绝只向
Renderer 暴露固定方法名、数字 RPC code 和有界 service code,不转发 Host 私有错误详情。
`runtime/preparePrompt` 在远端明确拒绝且尚未接受 Prompt 时会关闭对应 Main binding,
不会把确定性失败错误保留为 `outcome-unknown`。
不持久化 T2/T3、consent、approval bridge 或 confinement 证明。数据库迁移可以保留旧列以安全读取历史数据库,但新 domain object 不再暴露这些字段。
## 资源与发布
- 所有桌面构建(包括 `portable` 与 `release:package`)只携带
`agent-runtime-lock.json`、`remote-runtime-lock.json` 与公开的
`agent-release-keys.json`,不嵌入 `.agent-resources`、
`.remote-runtime-resources` 或任何可安装 Linux 远端 payload。
- `build/agent-package.cjs` 在对应原生 Linux 架构组装确定性 `.gbagent`,外层签名覆盖
描述符和每个内部文件身份;内部 Agent 与 Runtime 仍分别使用既有签名 manifest 和 lock
校验,但所有 production 层统一使用一组 GoodBuddy 通用发布身份并通过签名域区分用途,
不要求内部 Runtime 单独配置密钥。`build/agent-catalog.cjs` 为双架构包生成签名累计目录,
拒绝同一版本/架构改变字节。
- `.github/workflows/agents.yml` 只使用进程内临时测试 key 做分支/PR 原生验证,不发布。
`.github/workflows/agent-release.yml` 才可在 annotated `agent-v<version>` 标签和受保护
`agent-signing` Environment 中构建 production 包。Agent GitHub Release 必须
`--latest=false`;北京 OSS 先写 `agent-releases/v<version>/`,GitHub 公开后才切换
单一 `agent-releases/latest.json` 指针,使客户端始终从同一不可变版本目录读取目录与签名。
- Main 的本地缓存只发布完整验证成功的内容。在线目录和包都绑定固定 GitHub/OSS URL、
大小和 SHA-256;选取规则是桌面最低版本满足、Agent protocol major 相同且 minor 不高于
当前支持值的最高 SemVer。缺少某架构仅使该架构 Host 的托管 SSH 无法激活。
- `agent-release-keys.json` 读取时按 UTF-8 JSON 解析并严格验证 schema、唯一 key ID、
规范 Base64、有效 Ed25519 key、环境和撤销列表,不把 CRLF/LF 或普通 JSON 空白作为
信任条件。上传到 Host 前重新序列化为确定性 LF JSON。签名目录、描述符、manifest 和
payload 仍按原始签名字节及 SHA-256 验证。
## 发布前验证
1. `npm test`
2. `npm run typecheck`
3. `npm run lint`
4. `npm run build`
5. 用测试签名复合包验证在线下载源选择和离线导入/导出;正式 Agent 候选还需公开校验
双架构 production 包与签名目录。
6. 在已固定 Host Key 的 Linux x64 测试 Host 上验证 attach-or-bootstrap。
7. 在 GoodBuddy 专用测试目录验证 Ask 无法修改文件。
8. 验证 Execute 可以写文件、启动进程和访问网络,同时不触碰无关 Host 文件。
9. 运行一次有界的真实模型调用,确认凭据只由 Main 使用。
10. 中断并恢复 SSH,确认活动 Runtime 不被网络抖动终止。
+294
View File
@@ -0,0 +1,294 @@
# GoodBuddy Release Runbook
Read this runbook only when preparing, publishing, recovering, or verifying a
desktop or GoodBuddy Agent release.
This is an operator and CI procedure. It does not authorize adding application
persistence, snapshots, journals, rollback engines, recovery protocols, or
compatibility layers to automate release operations. Determine release recovery
from the authoritative GitHub, OSS, workflow, and Git state, then use the
smallest existing idempotent rerun or a new immutable version as specified
below.
## Release Packaging
- Unless the user explicitly requests it, never run a local production build,
desktop package, or launch probe as part of release preparation. In
particular, do not run `npm run build`, `npm run build:bundle`,
`npm run portable`, `npm run release:package`, direct `electron-builder`
packaging, or launch a locally packaged app before publishing a release.
Local tests, type checks, and lint plus the main-branch and native tag GitHub
Actions jobs are the release authorities.
- After a release is published, confirm only that the expected Windows assets
exist in the public release metadata. Do not locally rebuild or launch the
Windows package, download or hash published installers, attach browser
automation to a packaged app, or perform exhaustive per-asset network probes
unless the user explicitly asks for that additional validation.
- `.github/workflows/packages.yml` is the canonical cross-platform packaging
workflow. It validates and builds `out` once, then packages on six native
runners: Windows, macOS, and Linux, each for x64 and arm64.
- The experimental Linux LoongArch (`loong64`) preview is built separately
through `build/loongarch-cross` by following
`docs/development/loongarch-preview-build.md`. It is not part of
`.github/workflows/packages.yml`, the six-runner GitHub Actions matrix,
standard release manifests, GitHub Release asset expectations, or the
production update index. Do not add it to those paths unless the user
explicitly requests a future production-support migration.
- Run the unified packager with
`npm run release:package -- --platform <platform> --arch <arch>`. It only
packages for the native host and writes to
`dist/release/<platform>-<arch>`.
- Default deliverables are NSIS and portable ZIP for Windows, DMG and ZIP for
macOS, and AppImage, DEB, and RPM for Linux. Every target includes
`release-manifest.json` with SHA-256 hashes.
- `build/build-release.cjs` verifies the unpacked application, `app.asar`,
bundled Continue and OpenCode runtimes, executable architecture, and package
signatures before atomically replacing a release directory.
- All desktop build paths, including local `portable`, package the Agent and
remote Runtime version locks plus the public signing-key registry without
embedding installable Linux Agent or remote Runtime payloads. Managed SSH is
optional: users explicitly download a compatible compound `.gbagent` package
from Settings or import one offline before GoodBuddy can install or update a
Host.
- Each independently published Linux x64 or arm64 `.gbagent` contains the
Agent daemon, pinned Node, and the desktop-maintained compatible OpenCode
Runtime. Build both architectures on native GitHub Actions runners from one
immutable `agent-v<agentVersion>` tag.
- Keep the GoodBuddy Agent source, shared protocol/contracts, runtime lock,
bundle tooling, and tests in this repository so a desktop commit identifies
the exact Agent source it expects. Do not create a separate Agent repository
or long-lived Agent release branch unless the Agent becomes an independently
released product serving multiple clients.
- `.github/workflows/agents.yml` is the branch and pull-request build
verification workflow for GoodBuddy Agent. It must build Linux x64 and
arm64 on native runners from the checked-out commit, acquire the locked
official Node archive and locked OpenCode npm archive, verify every locked
digest, use only an ephemeral in-memory test signing identity, and verify the
resulting compound package and deterministic archive. It must not read
production signing secrets, publish installable release artifacts, or modify
the checked-in public key registry.
- `.github/workflows/agent-release.yml` is the only production compound Agent
publication path. It requires an annotated immutable Agent tag, the protected
`agent-signing` Environment, native x64/arm64 builds, one production
GoodBuddy signing identity for every layer of the compound package and
catalog, a non-Latest GitHub Agent Release, and synchronized immutable
Beijing OSS objects plus the final signed latest-catalog pointer.
- `.github/workflows/packages.yml` and `release:package` build only desktop
products. Missing Agent packages, remote Runtime inputs, or GoodBuddy signing
credentials must never block an ordinary desktop package or release.
- Keep electron-builder invocations on `--publish never`. Main-branch builds
run validation and build the production bundle without running the native
package matrix. Manual builds upload 30-day GitHub Actions artifacts.
Version-tag builds verify and aggregate packages before publishing GitHub
Release assets. The macOS jobs sign, notarize, and verify packages when all
five Apple credentials are configured. With no Apple credentials they must
use the explicit `--unsigned` path, warn that Gatekeeper may block the
packages, and still complete; a partial credential set must fail rather than
silently downgrade.
- Keep `ELECTRON_CACHE` and `ELECTRON_BUILDER_CACHE` under
`${{ runner.temp }}` in step-level workflow contexts. A cache beneath the
repository inherits the root `"type": "module"` and breaks electron-builder's
CommonJS macOS icon tool.
- Tag builds must use `v${package.version}`. The workflow also supports manual
dispatch and main-branch changes to release tooling.
### Agent Release Process
- Agent releases use annotated `agent-v${agent-runtime-lock.agentVersion}` tags
and are separate from desktop `v${package.version}` releases. Confirm the
exact Agent release commit and tag with the user before creating or pushing
either.
- The tagged commit must be reachable from protected `main`. The two native
jobs build the compound x64/arm64 packages from the same source and locks;
the catalog job rejects missing architectures, changed bytes for an existing
version/architecture identity, invalid prior signatures, and incompatible
matrix metadata.
- Agent GitHub Releases are ordinary non-draft, non-prerelease releases but
must use `--latest=false`; they must never replace the desktop release marked
Latest. Publish immutable packages and the versioned catalog to
`agent-releases/v<agentVersion>/` in Beijing OSS, publish the GitHub Agent
Release, then atomically update the single `agent-releases/latest.json`
pointer to that version's immutable catalog and signature.
- Do not report an Agent release complete until both public package
architectures match the signed catalog by size and SHA-256, the GitHub and
OSS catalog bytes/signatures are identical, the application can read the
selected source, and GitHub's repository Latest tag remains the desktop tag.
### Tagged Release Process
Every version-tag release must follow this sequence. A branch-only push does
not require release notes.
1. Confirm that the user wants a release tag and identify the exact release
commit and the new `package.json` version. Separately ask whether this
release should also receive an experimental LoongArch preview build; never
infer that choice from an earlier release.
2. Find the latest stable version tag reachable before the release commit and
inspect the complete commit and file diff from that tag to the release
commit. For the first tagged release, inspect the relevant repository
history instead.
3. Draft concise, user-facing release notes in both Simplified Chinese and
English based only on verified changes in that range. Use the titles
`GoodBuddy <version> 更新内容` and
`What's New in GoodBuddy <version>`, with corresponding `功能更新` /
`Features` and `问题修复` / `Bug Fixes` sections when applicable. The two
language versions must describe the same changes. Do not expose
internal-only details, credentials, private content, or unverified claims.
4. Show the exact bilingual release-note draft to the user and wait for
explicit approval. If the release commit or either language version changes
after approval, inspect the updated tag range and request approval again.
5. Write the approved notes to the single entry for the release version in
`resources/release-notes.json`. A failed unpublished candidate whose content
is carried forward must not retain a duplicate packaged entry.
6. Verify that `package.json`, the root `package-lock.json` version, and
`package-lock.json.packages[""].version` all equal the release version. Run
`npm run release:notes:verify`, `npm test`, `npm run typecheck`, and
`npm run lint`. Do not run a local production build, packaging command, or
packaged-app launch probe unless the user explicitly requests one.
If the user requested a LoongArch preview in step 1, build it separately
from this exact candidate by following the LoongArch build document, record
its size and SHA-256, and keep it outside the standard GitHub/OSS release
asset set unless the user separately authorizes publishing it.
7. Commit the approved candidate and confirm the exact release commit with the
user. Fetch both remotes, inspect branch movement instead of overwriting or
silently merging it, then push that commit to `main` on `origin` and
`github`. Require the candidate commit's main-branch GitHub Actions source
validation and production build to succeed before tagging.
8. Fetch both remotes again immediately before tagging. Confirm the working
tree is clean, both remote `main` refs still equal the approved commit, the
candidate tag is unused locally and remotely, and the exact approved commit
has not changed. Only then create the annotated `v${package.version}` tag at
that commit, push the tag to both remotes, and verify each peeled tag SHA
(`refs/tags/<tag>^{}`) equals the release commit.
9. Keep both approved language versions as the single source for the GitHub
Release body and the packaged first-open release-notes modal. The modal
displays the release notes matching the current interface language and
contains no button linking to a full release page.
10. Observe the tag workflow through publication and complete the public
verification checklist below. A successful push is not a completed
release.
### OSS Publication Contract
The tagged release job publishes through the GitHub Environment selected by
`.github/workflows/packages.yml` (`aliyun-oss-release`) and reads the following
effective GitHub Actions variables. Before a release or same-tag rerun can
publish, verify that repository-, organization-, or environment-level
resolution exposes:
- `ALIYUN_OSS_BUCKET=goodbuddy`
- `ALIYUN_OSS_ENDPOINT=https://oss-cn-beijing.aliyuncs.com`
- a non-empty `ALIYUN_OIDC_PROVIDER_ARN` matching
`acs:ram::*:oidc-provider/*`
- a non-empty `ALIYUN_ROLE_ARN` matching `acs:ram::*:role/*`
For environment-scoped values, use the exact Environment name from the
workflow; do not assume a similarly named UI environment such as `Production`
contains the active variables.
The Bucket and Endpoint are a deployment contract, not interchangeable
examples. They must stay aligned with the trusted URL checks in
`src/main/version-checker.ts`, `sites/app.js`, website validation, and related
tests. A host, Bucket, Region, or CDN migration must update and validate every
surface together before a new release.
- Use GitHub OIDC and the RAM Role to obtain short-lived STS credentials.
Never add long-lived AccessKeys to repository or environment secrets.
- Keep `ossutil` pinned. Its V4 signing requires the Region; derive it from the
canonical Endpoint, verify that the production value resolves to
`cn-beijing`, and pass `--region` to every `ossutil cp`, including the final
`latest.json` update.
- Grant the RAM Role only the actions and prefixes required by the workflow.
It must be able to write immutable version objects and the final latest
pointer without granting unrelated administration privileges.
- Upload release assets and `site-release.json` under the immutable
`releases/<tag>/` prefix first. Verify all 14 installer URLs publicly before
creating or publishing the GitHub Release. Update
`releases/latest.json` only after the GitHub Release is public and all prior
checks succeeded.
- The expected GitHub Release contains 22 assets: 14 installers (two formats
for each Windows/macOS target and three formats for each Linux target), six
renamed target manifests, one aggregate `release-manifest.json`, and one `SHA256SUMS`.
`site-release.json` is an OSS publication artifact, not a GitHub Release
asset.
### Failed Tag Recovery
Classify a failed tag by the external side effects that completed before
choosing a recovery:
- If no source or release metadata must change, correct only the external
configuration and use **Re-run failed jobs** for the same immutable tag. Do
not change, move, delete, or recreate the tag.
- If immutable OSS objects were partially uploaded but their source bytes are
unchanged, a same-tag rerun may idempotently re-upload or verify them. Never
point `latest.json` at a partially verified prefix.
- If the GitHub Release is already public but the final latest-pointer step
failed, it is a published version. Keep its packaged notes and rerun the
failed release job for the same tag; do not classify it as an unpublished
candidate.
- If code or release metadata must change, keep the failed tag immutable,
increment the patch version, obtain approval for the revised exact release
commit and notes, and create a new tag. Do not reuse the failed version.
When recovering from a version tag whose workflow never published a public
GitHub Release:
- If a code or metadata change requires a higher version and a new tag, carry
the failed candidate's approved user-facing notes forward into the recovery
version, then remove the superseded failed version's entry from
`resources/release-notes.json`.
- The packaged first-open modal must show that carried-forward content only
once under the recovery version. Never retain both the failed version and
its cumulative recovery copy, because users upgrading across them would see
duplicate content.
- Never remove the packaged history for a version that successfully published
a GitHub Release. Verify the failed release state before treating an entry as
superseded.
### Post-Publication Verification
Do not report a release complete until all of the following are verified:
1. The tag workflow and all six native package jobs succeeded. Verify the
recorded macOS signing mode: signed builds must pass `codesign`, `spctl`,
and `stapler`; unsigned builds must record the Gatekeeper caveat in the
Actions log and job summary. In the final release job, explicitly verify
the OSS configuration, OIDC authentication, release-index generation,
immutable upload, public asset check, GitHub Release publication, and
latest-pointer steps.
2. The public GitHub Release is non-draft, non-prerelease, marked Latest, and
uses the expected tag and title. Its body must exactly match the Markdown
generated from the approved packaged bilingual notes.
3. GitHub release metadata contains exactly the expected 22 uploaded asset
names, including the expected Windows x64 and arm64 assets. Do not download,
hash, launch, or send individual network probes to published installers
unless the user explicitly requests that additional validation.
4. The Beijing `releases/latest.json` returns HTTP 200, has the expected stable
version, exact six targets and 14 installer entries, the trusted Beijing
URLs, and the GitHub fallback URL. It must match the immutable
`releases/<tag>/site-release.json`. Fetching and comparing these small JSON
metadata files is sufficient; rely on the successful publication job for
its per-asset public checks.
5. The live website successfully fetches the index and produces the 14 correct
platform/architecture/format links from that metadata.
6. Both remote `main` refs and both peeled tag refs still equal the approved
release commit, and the local working tree is clean.
Never create or push a release tag, and never push a previously created
release tag, before the release-note draft has received explicit approval.
- Before a push that updates the `github` remote, ask whether the user wants a
release tag unless they already specified that choice. A branch-only push
does not require a version bump or tag. When the user requests a release,
verify that `package.json` and `package-lock.json` contain the same release
version, create `v${package.version}` at the exact commit being pushed, and
push that tag so the native package matrix and GitHub Release run.
- Never move or reuse an existing release tag. If `v${package.version}` already
exists locally or on a remote at another commit, increment the package
version and create a new matching tag before the release push.
- Verified release baseline on 2026-08-18: commit
`60119a4317118fa3f077db0382664f15266a6682`, annotated tag `v0.10.4`, and
GitHub Actions run `32038633609` attempt 2 succeeded through all six native
packages, GitHub Release publication, Beijing OSS publication, and the final
`latest.json` switch.
+135
View File
@@ -0,0 +1,135 @@
# GoodBuddy Feature Documentation Guide
## Scope
These instructions apply to all files under `docs/features/`.
Each direct child directory represents one user-visible product feature or one coherent feature family. Organize documentation by feature ownership first, then by document responsibility.
## Standard Structure
Use the smallest applicable subset:
```text
docs/features/<feature-name>/
README.md
prd.md
user-stories.md
logic-design.md
ui-design.md
technical-design.md
progress.md
```
Additional documents are allowed when one standard file would mix independent responsibilities. List every additional document and its unique responsibility in the feature `README.md`.
Do not create empty placeholders. If a standard document is not needed yet, omit it and state the missing responsibility in `README.md` only when that absence matters to current work.
## Document Responsibilities
### `README.md`
- The sole entry point for the feature.
- Summarizes feature purpose and boundary.
- Lists all feature documents and their authoritative responsibilities.
- Defines feature-specific terminology.
- Points to cross-feature dependencies without copying them.
### `prd.md`
- Defines the user problem, goals, scope, non-goals, functional requirements, and product acceptance.
- Describes what the product must do, not module layout or implementation mechanics.
- Records explicit limitations when a workflow is intentionally unsupported.
### `user-stories.md`
- Defines user roles, scenarios, and Given/When/Then-style acceptance.
- Covers first use, normal use, failure recovery, compatibility, permissions, and boundary cases relevant to real users.
- Keeps implementation details out unless the detail is itself an observable contract.
### `logic-design.md`
- Defines invariants, state dimensions, state transitions, decision tables, priority rules, failure outcomes, and cross-story consistency.
- Resolves overlap between PRD requirements and User Stories before technical implementation.
- Includes a logic completeness assessment and identifies unresolved product decisions separately from technical selection work.
### `ui-design.md`
- Defines feature information architecture, shared component usage, states, copy, feedback, keyboard behavior, accessibility, and responsive behavior.
- Must follow the repository root `UI-DESIGN.md`.
- Does not create feature-local visual systems when shared tokens and primitives already exist.
### `technical-design.md`
- Defines process and module boundaries, shared contracts, persistence, IPC, lifecycle, packaging, compatibility, validation, and implementation order.
- Implements the PRD and logic design rather than redefining their behavior.
- Follows KISS and YAGNI. Do not add recovery or compatibility machinery without a demonstrated requirement.
### `progress.md`
- Records only verified implementation facts, remaining work, blockers, validation commands, and dated evidence.
- Never marks an item complete based only on a design, mock, schema, or injected fake when the production path remains incomplete.
- Does not duplicate future design. Link back to the authoritative document.
## Traceability
For non-trivial features:
1. PRD requirements use stable IDs such as `FR-1`.
2. User Stories use stable IDs such as `US-A1`.
3. Logic design maps rules and state transitions to PRD and User Story IDs.
4. UI and technical design link to the PRD and logic design.
5. Progress items map to implementation stages and record actual validation.
Do not renumber stable IDs merely for presentation after implementation begins.
## Source of Truth
- PRD owns product scope and requirements.
- User Stories own user scenarios and scenario acceptance.
- Logic design owns behavioral decisions and state rules.
- Root `UI-DESIGN.md` owns global UI consistency; feature UI design owns feature-specific application.
- Technical design owns implementation architecture.
- Progress owns current implementation and validation status.
- Final code and validated runtime behavior override stale documentation. Correct all affected documents when they diverge.
## Feature Boundaries
- Keep a document in a feature directory when one feature can own its behavior and acceptance.
- Keep a document in `docs/architecture`, `docs/quality`, `docs/development`, or `docs/roadmap` only when it truly governs multiple features and has no single feature owner.
- Reference cross-feature documents rather than copying their definitions.
- When two features share a global domain model, keep that model in the feature family that owns the domain or in cross-feature architecture if ownership is genuinely global.
## Managed External Artifacts
When a feature downloads external artifacts managed by GoodBuddy:
- Define the exact setting that selects the source and the setting scope.
- Use immutable artifact targets with expected byte size and SHA-256.
- Freeze the selected source when an operation starts.
- Fail explicitly when the selected source is unavailable or invalid. Never silently request another source.
- Keep download URLs and redirect allowlists out of Renderer-controlled input.
- State whether the setting affects models, application updates, Agent packages, managed tool runtimes, package-manager registries, or user-configured URLs. Do not imply a broader scope than implemented.
- When two targets are presented as an upstream/original address and its OSS mirror, require byte-identical content with one shared size and SHA-256. A mirror must not rebuild, recompress, or modify the upstream artifact.
## Migration Rules
When moving existing documentation:
1. Preserve content and Git history where practical.
2. Update every repository link to the new path.
3. Add or update the destination feature `README.md`.
4. Delete the old authoritative path; do not leave a duplicate compatibility copy.
5. Do not rewrite unrelated document content merely because the file moved.
6. Preserve uncommitted user edits while moving files.
7. Verify all relative Markdown links after migration.
## Review Checklist
- The feature has one clear entry point.
- Every document has one declared responsibility.
- Product requirements, stories, logic, UI, technical design, and progress do not contradict each other.
- Normal, failure, cancellation, compatibility, permission, and scope behavior are covered where applicable.
- UI behavior follows `UI-DESIGN.md`.
- Progress claims are backed by dated evidence.
- All relative links resolve.
+13
View File
@@ -0,0 +1,13 @@
# 助手工作栏
助手工作栏统一承载本机与远程执行空间、Task、成果、文件、浏览器和终端等持续工作界面。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [通用助手工作栏与执行空间 PRD](./prd.md) | 工作栏整体产品范围、执行空间和各工作面板归属 |
| [多终端页签 PRD](./terminal-tabs-prd.md) | 多终端 Tab、目标选择、关闭确认和终端生命周期 |
当前尚未拆出独立 User Stories、功能逻辑、UI 设计、技术设计和进度文档;相关内容仍保留在
两份现有 PRD 中,后续实际维护该功能时按职责拆分。
@@ -5,11 +5,11 @@
| 项目 | 内容 |
| --- | --- |
| 状态 | 设计中 |
| 版本 | 0.5 |
| 日期 | 2026-08-21 |
| 版本 | 0.6 |
| 日期 | 2026-08-31 |
| 适用产品 | GoodBuddy 桌面端 |
| 相关设计 | [统一界面设计系统](../../../UI-DESIGN.md)、[SSH 远程主机与 GoodBuddy Agent 稳定终态设计](../../architecture/remote-host-and-goodbuddy-agent-design.md) |
| 相关能力 | [会话监督](../supervision/conversation-supervision-prd.md)、[自动化平台](../../architecture/automation-platform-architecture.md)、[长期助手路线图](../../roadmap/long-term-assistant-roadmap.md) |
| 相关设计 | [统一界面设计系统](../../../UI-DESIGN.md)、[SSH 远程主机与 GoodBuddy Agent 实现说明](../remote-host/technical-design.md) |
| 相关能力 | [会话监督](../conversation-supervision/prd.md)、[自动化平台](../../architecture/automation-platform-architecture.md)、[长期助手路线图](../../roadmap/long-term-assistant-roadmap.md) |
## 1. 背景
@@ -104,7 +104,8 @@ Runtime
- 监督默认选择当前会话,用户可以改选其他 Conversation、Task 或实验对象。
- Runtime 默认跟随当前会话或 Task;执行事件可以查看,但 Job/Run 不作为独立选择对象。
- 终端默认使用当前项目执行空间,用户可以新建本机或远程终端。
- 终端创建时固定到当前项目执行空间,由项目配置自动决定本机或托管 SSH;没有当前项目时
使用本机 Home。
- 工作区默认显示当前项目目录,用户可以打开其他本机目录或远程目录。
- 成果默认使用当前范围,用户可以切换到项目、全局或其他允许范围。
- 下一次请求的附件和知识库由当前 Composer 展示与管理,不作为工作栏能力。历史执行上下文
@@ -134,8 +135,8 @@ Runtime
- 当前 Runtime 不支持后台 Job 时,Runtime 能力仍可发现;打开后说明当前可监督的内容。
- 当前执行空间没有 Git 仓库时,工作区文件功能仍可使用,Git 区域显示不可用原因。
- 没有活动进程时,进程面板提供创建终端或启动 Runtime 的入口。
- 没有项目时,终端和工作区允许用户选择本机目录或远程主机,但必须先取得有界临时
Execution Space Grant,不能把可选路径直接传给文件、Git、Process 或 Runtime。
- 没有项目时,终端使用当前用户本机 Home;工作区等允许选择路径的能力仍必须先取得有界
临时 Execution Space Grant,不能把可选路径直接传给文件、Git、Process 或 Runtime。
- 监督未启用时,监督面板提供目标、模式和“开始监督”,而不是隐藏能力。
不得渲染成排没有解释的禁用按钮,也不得把“进程连通”描述为已经支持完整原生监督。
@@ -201,22 +202,26 @@ Runtime
### 6.2 能力目录与面板实例
能力目录不等于同时打开八个面板。推荐使用工作栏内的纵向能力导航,并在旁边或停靠区域管理
用户已经打开的面板实例:
能力目录不等于同时打开八个面板。当前产品采用“已打开实例 Tab + 持久新增按钮”的工作栏
模型:Tab 行只显示已打开实例,行末“+”始终可见;点击后在工作栏内容区打开稳定能力目录,
用户再创建或激活应用实例。详细交互以
[助手工作栏多终端页签 PRD](./terminal-tabs-prd.md) 为准。
- 每项始终显示稳定图标,并提供可见标签或可持续查看的工具提示。
- 目录使用与其交互模型匹配的列表、工具栏或菜单语义;单实例切换使用 `tablist`、`tab`、
`tabpanel`,多实例停靠区使用有名称的区域和明确面板标题。
- 已打开实例使用 `tablist`、`tab`、`tabpanel`;“+”是位于 `tablist` 外的普通命令按钮。
- 应用注册表声明 `single` 或 `multiple`。重复选择单实例应用时聚焦已有实例;选择多实例
应用时每次创建新实例。
- 支持方向键、Home、End、Enter、Space、关闭面板和正确焦点恢复。
- 徽标显示未解决数量、等待审批或失败状态,并同时提供文字或可访问名称。
- 用户调整目录顺序、打开实例、停靠位置和尺寸后持久化;关闭实例后能力仍可从目录重新打开。
- 默认布局只恢复经过产品确认的少量常用面板,不自动打开全部标准能力。
- 每个实例显示稳定实例 ID、能力名称、跟随或固定状态与当前目标;同能力多实例不能只靠位置区分。
当前聊天右栏过渡实现保留 Task Center、工作区、浏览器和成果四个横向页签时,必须
单行横向滚动,不能自动隐藏或缩写到不可辨认。Task Center 继续作为 Task 的现有入口;
审批定位到所属 Task 或 Runtime。智能心跳不作为工作栏页签,其报告、建议、历史和完整配置统一归属
“智能心跳”菜单入口。当前阶段不新增独立自动化中心。
从当前聊天右栏迁移时,Task Center、工作区、浏览器和成果作为默认打开的单实例应用保留;
终端不默认打开,由用户通过“+”创建,并从首期开始支持多实例。Tab 必须单行横向滚动,
不能自动隐藏或缩写到不可辨认,“+”不能随滚动消失。Task Center 继续作为 Task 的现有
入口;审批定位到所属 Task 或 Runtime。智能心跳不作为工作栏页签,其报告、建议、历史和
完整配置统一归属“智能心跳”菜单入口。当前阶段不新增独立自动化中心。
### 6.3 工作栏尺寸
@@ -265,7 +270,7 @@ Conversation,默认 Execute,并持续显示 Runtime、Project、工作目录
### 7.2 监督
监督是通用观察与评论入口,详细行为以
[会话监督 PRD](../supervision/conversation-supervision-prd.md) 为准。
[会话监督 PRD](../conversation-supervision/prd.md) 为准。
监督能力在目录中稳定可发现;用户打开面板实例后可以选择:
@@ -311,10 +316,12 @@ Runtime 能力统一监督直连模型、OpenCode、Continue、DeepSeek Harness
### 7.4 终端
终端面板允许用户主动创建和管理本机或 SSH 终端:
终端面板允许用户通过工作栏“+”主动创建和管理多个本机或 SSH 终端。详细产品行为、首期
直接 SSH PTY 技术选择、生命周期和验收以
[助手工作栏多终端页签 PRD](./terminal-tabs-prd.md) 为准。
- 新建、重命名、切换、关闭和重新连接终端。
- 选择执行空间、工作目录和 Shell。
- 创建时自动绑定当前项目执行空间、权威工作目录和平台默认 Shell,不显示重复目标选择。
- 显示本机或远程主机、目录、Shell 和连接状态。
- 支持复制、粘贴、搜索、清屏、滚动和调整终端尺寸。
- 支持将终端切换到右侧、底部或独立窗口。
@@ -369,10 +376,45 @@ Renderer 不接收任意系统 PID 控制能力。控制动作引用 Main 签发
- 创建新的 GoodBuddy 隔离浏览器会话。
- 选择当前会话或其他受控浏览器会话。
- 查看状态、当前 URL、有界画面和错误。
- 进入明确的交互模式或停止会话。
- 通过顶部浏览器工具栏返回、刷新或停止加载、编辑地址并前往。
- 进入明确的交互模式或关闭浏览器。
没有浏览器会话时显示“新建浏览器会话”,而不是隐藏能力。模型或后台浏览器活动可以更新
徽标,但不得无条件打开面板或切换用户当前面板。
顶部工具栏按“返回、刷新/停止加载、地址输入、前往、交互、关闭浏览器”组织。“刷新”在
页面加载期间原位切换为“停止加载”;“关闭浏览器”是清楚独立于导航的会话生命周期操作,
必须与“停止加载”在文案和视觉上明确区分。现有“停止浏览器”语义统一改名为“关闭浏览器”。
浏览器面板和 Agent 操作同一条按 Conversation 归属的浏览器会话,不创建用户预览专用的
第二个页面。用户执行前往、返回或刷新会有意改变 Agent 下一步读取和操作的页面。所有
前往、返回和刷新请求都进入 `BrowserService`,并与 Agent 发起的浏览器操作串行执行;不在
Renderer 建立第二套导航队列、抢占规则或恢复状态机。
浏览器工具栏读取的权威状态至少包含:
```ts
type BrowserToolbarState = {
committedUrl: string
loading: boolean
canGoBack: boolean
sessionActivity: 'inactive' | 'creating' | 'ready' | 'agent_action' | 'full_interaction'
}
```
`committedUrl` 是浏览器已经提交的权威 URL。地址输入在未编辑时与它同步;获得编辑意图后,
输入文字保持为 Renderer 本地草稿,画面、加载状态和 URL 更新不得覆盖草稿,直到用户“前往”
或放弃编辑。用户提交未带 `http://` 或 `https://` 的裸域名时,Renderer 自动补上
`http://`,再通过既有浏览器 URL 策略提交。地址草稿不属于浏览器会话持久状态,也不需要
恢复或版本化机制。
创建会话、Agent 操作和完整交互窗口期间,返回、刷新、地址提交、前往、交互和关闭浏览器
控件禁用,避免与同一会话并发操作。例外是活动导航处于加载中时,“停止加载”保持可用,
可中断当前页面加载;
它只取消页面加载,不销毁浏览器会话、不执行“关闭浏览器”,也不释放当前 Runtime 上下文。
“关闭浏览器”沿用现有停止会话的生命周期语义。
没有浏览器会话时仍显示工具栏。活动 Conversation 可以直接在地址栏输入非空 URL 并“前往”,
由 `BrowserService` 通过 Agent 浏览器相同的能力检查和 URL 策略创建会话并导航;不得为这一
空状态增加旁路 WebView 或宽松 URL 入口。没有活动 Conversation 时说明需要先选择或创建会话。
模型或后台浏览器活动可以更新徽标,但不得无条件打开面板或切换用户当前面板。
浏览器面板只管理 GoodBuddy 受控浏览器,不表示可以控制用户已安装的浏览器。
@@ -470,15 +512,15 @@ type WorkbarPanelInstance = {
本节定义产品入口和用户行为。Host Key、凭据、远程 Agent 协议、模型请求代理、签名更新、
断线和 Runtime 适配的技术边界以
[SSH 远程主机与 GoodBuddy Agent 稳定终态设计](../../architecture/remote-host-and-goodbuddy-agent-design.md)
[SSH 远程主机与 GoodBuddy Agent 稳定终态设计](../remote-host/technical-design.md)
为准。
### 9.1 设置入口
设置中心“平台功能”提供独立“远程项目(技术预览)”页签及开关,默认关闭。关闭时不显示
“主机与远程执行”分类、托管 SSH 项目创建选项和已保存远程项目,Main IPC 同时拒绝新的
SSH/远程项目操作;已有 Host、项目和凭据保持不变。若关闭时正在激活远程项目,应用发出
取消并保持或切回普通本地项目;若当前项目已经是远程项目,则切回项目列表中的第一个普通
SSH/远程项目操作;已有 Host、项目和凭据保持不变。若当前项目已经是远程项目,则切回
项目列表中的第一个普通
本地项目。重新启用后恢复完整入口和既有数据。
启用后,设置中心显示“主机与远程执行”分类,管理:
@@ -491,6 +533,9 @@ SSH/远程项目操作;已有 Host、项目和凭据保持不变。若关闭
- 删除、重新验证或更新 Host Key。
主机配置是全局资源。项目或工作栏只引用主机 ID,不能复制凭据。
删除 Host 前列出所有引用它的本地项目记录,包括归档项目;确认后仅删除本机 Host、凭据、
项目和关联数据,不建立 SSH 连接,也不删除远端目录或内容。若当前项目被删除,界面切回
普通本地项目。
当前实施状态:设置中心已经实现主机 CRUD 和模态验证向导。新增或目标/认证编辑依次完成
连接信息、认证前 Host Key 核对、密码/系统 SSH Agent 认证和平台/架构/Shell/Home 有界
@@ -501,22 +546,51 @@ SSH/远程项目操作;已有 Host、项目和凭据保持不变。若关闭
和文本模型 profile 验证后原子提交。私钥导入仍未开放。旧流程已保存但
没有成功探针记录的主机继续读取,但在完成新向导前显示为“需要重新验证”。
应用重启后固定进入项目列表中的第一个普通本地项目,不自动激活上次远程项目。用户主动
打开已有托管 SSH 项目时,Main 会用数据库中的项目字段重新执行同一套
Host/Agent/Workspace/Runtime 验证。桌面版本携带的 Agent 或 Runtime identity 已变化时,
先 side-by-side 安装新候选,全部成功后再原子刷新项目 evidence 并切换当前项目;失败保留
此前项目和安装绑定,不由 Renderer 用旧草稿重建更新请求。同一 Renderer 对同一项目的
重复激活共享一个操作,不会并行启动第二次保存。
主动打开期间,项目切换器在原位置展示 Host、Agent、Workspace、Runtime、Saving
五个阶段及原生 `progressbar` 语义;用户可以取消,项目切换、创建和设置入口在操作结束前
保持禁用。成功后才提交项目选择,失败或取消继续保留此前项目。
当前源码已把 Agent/Runtime 生命周期归入 Host 管理。新增或重新验证 Host
在身份、认证和系统探针成功后先保存 Host,再只读探测实际组件状态和瞬时下载能力,然后
结束新增向导。产品不提供自动安装开关,也不在保存后传输包。Host 卡片只有一个按版本
事实显示“安装远程环境”“更新远程环境”或“重新安装”的主按钮;次级 SegmentedControl
选择“自动”“Host 下载”或“GoodBuddy 传输”,默认“自动”且不持久化。版本匹配 badge
不代表环境健康。环境准备失败或取消保留 Host 并显示可重试状态;重新安装失败时显示
本次操作未完成,并以随后重新检查的版本卡片表达当前事实,不对不确定提交宣称旧版本
未被替换。详细技术契约见
[SSH Host 远程环境准备与直连下载设计](../remote-host/environment-provisioning-technical-design.md)。
进入或切回“主机与远程执行”页面只读取本地 Host 列表,不逐台建立 SSH 连接。版本和瞬时
下载能力仅在用户点击某台 Host 的“刷新版本”时探测,成功结果在当前 Renderer 进程内按
Host 持久化缓存,切换页面或重启应用后返回直接显示;Host 编辑、删除或开始更新远程环境后
不复用旧结果。该动作不是项目连接前置条件;用户
切换已有远程项目只更新 Renderer 的本地项目选择,不建立 Host/Agent 连接。
新建远程项目弹窗同样只读取本地 Host 验证记录,不扫描所有 Host;浏览目录或保存时才连接
所选 Host。版本号相同时仍允许用户显式重新安装,以修复 registry、签名或 identity 异常,
且不删除 Host、凭据或项目。由远程主机安装只使用 SSH 和远端系统工具,不依赖已有 Agent;
“自动”仅在操作开始时探测:直连明确可用才选 Host 下载,否则选 GoodBuddy 传输;用户
显式选择不被改写,prepare、commit 或 adoption 失败后不在同次操作中切换 acquisition。
项目选择器中每个项目的管理按钮默认隐藏,在悬停、键盘焦点或触屏环境显示。该入口直接
打开目标项目设置而不先切换项目,因此 Host 不可达或远端目录已不存在时仍可删除本地项目
记录;删除操作从不删除远端项目内容。
应用重启后固定进入项目列表中的第一个普通本地项目。用户主动打开已有托管 SSH 项目时只
切换本地项目配置;首次实际使用 Workspace 或 Runtime 时,Main 才通过 Agent/Runtime
安装管理器解析 Host current identity,执行固定 `attach-or-bootstrap`,并使用同一 Agent
连接。
项目数据库不保存 Agent installation、Host revision、Workspace identity 或 Runtime
digest。当前 registry、连接或 capability 无效时项目保持未切换,并提示到 Host 管理显式
修复。当前进程缓存每个 Host 已确认的 Agent/Runtime identity,并复用 Agent 连接;Host
编辑或环境更新会定向清空。Agent 的 attach/按需启动只读取 Host 管理已提交的 registry 与
匹配 manifest 元数据,不重新验签或哈希完整 Agent payload。项目切换器立即提交本地选择,
不展示远程激活进度;完整进度和取消只属于新建或显式保存项目。
项目只持久化 Host ID、规范远端路径、Runtime 选择和默认工作模式。新建和保存验证当前
Workspace/Runtime,但不写入组件 identity;普通切换不做远程验证。未就绪或版本过旧时,
实际 Workspace/Runtime 操作显示错误。桌面更新造成组件版本变化时,用户先在 Host 管理中
准备环境;项目切换本身不连接、不下载、不扫描、不安装,也不改写项目。
已保存 Host 的地址、用户或固定 Host Key 变化后,Main 关闭旧连接并定向退役该 Host 的
Runtime 缓存。当前项目引用该 Host 时,设置保存成功会立即运行上述完整激活流程并刷新
项目验证;其他项目在下次选择时刷新。用户再次选择当前 SSH 项目也会执行完整激活,
不能因为项目已经选中而跳过验证。从 Host 保存到项目成功激活之间,项目持续保持需要
重新连接状态;失败或取消不会重新开放 Composer。已由 Main 派发的用户排队消息退回原
持久队列,不生成失败消息、不丢失附件,并在成功激活后的 queue-ready 通知中继续派发。
Runtime 缓存。引用项目下次选择时使用 Host 管理的当前 revision、Host Key 和用户执行固定
attach 并读取 current registry,不存在项目中的旧 Host revision 或组件 identity;
当前环境无效时才要求显式修复。
新建托管 SSH 项目时,远端工作目录既可手工输入,也可通过文件夹按钮打开 Main 管理的
只读、有界 SFTP 目录选择器。选择器从 SSH 账号 Home 或当前有效绝对路径开始,只返回目录,
@@ -545,11 +619,25 @@ Runtime 缓存。当前项目引用该 Host 时,设置保存成功会立即运
- 安装到远程当前用户的 GoodBuddy-owned 目录,不要求 root。首次连接先 attach,Agent
不存在或未运行时幂等 bootstrap 为 detached process,再重新 attach;不注册开机服务,
不依赖 systemd、D-Bus 或 `Linger=yes`。
- SSH 负责 Host Key、认证、SFTP 安装和固定 `goodbuddy-agent attach` 中继;attach 只连接
用户私有 Unix socket。SSH relay 断开不终止 Agent 或活动 Runtime。
- 上传内容使用应用内置公钥验证的签名 manifest,并校验组件版本、协议、平台、架构、大小
和 SHA-256。Agent 与 Runtime 各自维护版本,签名摘要标识精确工件;使用 side-by-side
安装、自检和健康切换,失败时不改变当前项目绑定。
- SSH 负责 Host Key、认证、固定 bootstrap、可选 SFTP 安装和 `goodbuddy-agent attach`
中继;attach 只连接用户私有 Unix socket。SSH relay 断开不终止 Agent 或活动 Runtime。
- Host 环境准备可让远端按签名目录固定的 GitHub/北京镜像 URL、大小和 SHA-256 下载完整
`.gbagent`,也可由 GoodBuddy 下载、完整验证后通过有界流式 SFTP 传输一个 compound
archive 和归档中已验证的 bootstrap Node;完整包不一次读入 Main `Buffer`,Host 仍再次
校验。两种 acquisition 交付到固定 operation staging 后共用
`prepare → commit → Agent activate/health → Runtime activate → finalize → cleanup`。
- 直连首次 bootstrap 不依赖已安装 Agent daemon。GoodBuddy 桌面控制面通过固定 SSH
prepare channel 发送有界 one-shot installer;Host 先验证目录绑定的归档大小和 SHA-256,
再由 format v1 归档内固定 Node 解码并运行 installer。归档无需包含
`agent/lib/package-installer.cjs`,目录不提供或检查额外的 bootstrap 能力元数据。
- Agent 与 Runtime 各自维护版本,签名摘要标识精确工件。Host 在解包到准备目录的同一遍
处理中完成完整 payload 校验,commit 只复核签名 metadata 并原子替换 side-by-side
目录,不重新读取归档、扫描旧目录或使用跨安装硬链接。
- Main 只保存清理 operation staging 所需的 operation ID。控制通道中断或 adoption 失败
后,下次更新尽力清理旧暂存并重新 prepare,不保存或恢复 Agent/Runtime metadata 副本。
新 Agent/Runtime 各自最多完整验证一次;注册后的
health、capabilities 和 prompt 启动只检查 registry、签名 manifest 与入口 metadata。
确认 adoption 后显式 cleanup,cleanup 失败不回滚健康环境,也不阻塞下一次 fresh prepare。
- 握手报告 installation、Daemon boot identity、协议、系统、架构、用户监督器和能力。
- 在远程执行路径规范化、Git、文件、PTY、进程组和 Runtime 管理。
- 持久化有界 Agent 到 Main 输出;SSH 断开后 Agent 继续运行,同一 Agent 重连时只恢复
@@ -762,13 +850,15 @@ Electron、ChildProcess、PTY、SSH Client、Socket 或文件句柄。
- 通用 Artifact Event。
- HTML 工作区和成果的静态即时预览。
- Runtime Inspector Snapshot 与事件。
- OpenCode 会话、子会话、Todo、工具、用量和取消。
- 直连模型及现有 GoodBuddy Subagent 的统一展示。
- OpenCode 会话、子会话、Todo、工具、用量和取消;本地与托管 SSH 的原生 Task 调用在
Conversation 中统一显示为可追踪的 Subagent 状态,而不是普通工具参数卡。
- 直连模型、OpenCode 原生 Subagent 及现有 GoodBuddy Subagent 的统一展示。
### 阶段 2:监督、终端与受管进程
- 普通会话手动监督和右栏评论流。
- 本机 PTY 终端。
- 工作栏持久“+”、应用注册表和单/多实例 Tab。
- 本机 PTY 与直接 SSH PTY 多终端。
- 受管进程注册、日志和终止。
- 自动回复后监督、节流和独立预算。
- 用户选择终端停靠位置。
@@ -791,8 +881,18 @@ Electron、ChildProcess、PTY、SSH Client、Socket 或文件句柄。
- 先完成签名 OpenCode bundle、Ask bubblewrap、Execute 直接进程、官方 ACP channel、
Main 模型网关、取消、超时和活动记录。
- OpenCode 闭环稳定后,Continue 与 DeepSeek Harness 复用相同面板和通道契约逐个接入。
- 一次远程项目保存请求完成 Host/Agent/Workspace/Runtime 全量验证和 SQLite 原子提交。
- 桌面更新后,用户主动首次打开远程项目时自动安装当前签名 Agent/Runtime,并在成功后原子刷新项目绑定;应用启动本身不连接远程项目。
- 新增或重新验证 Host 时只保存并探测 Agent/Runtime,不自动安装。用户在 Host 卡片用
单一主按钮启动,并用次级控件选择自动、Host 下载或 GoodBuddy 传输;Host 保存与环境
准备是两个可独立重试的事务。
- 控制面直连源码直接使用既有 package format v1 包;不等待发布携带 installer 的新
Agent 包,也不通过额外目录元数据判断 bootstrap 能力。GitHub/北京镜像、
Linux x64/arm64、取消和离线 GoodBuddy 传输仍须真实 Host 验收,不能据此声称已发布或已完成
真实 Host 测试。
- 一次远程项目保存请求完成 Host/Agent/Workspace/Runtime 当前环境验证和 SQLite 原子
提交,但只持久化 Host、路径、Runtime 选择和模式,也不获取或安装组件。
- 桌面更新后,用户先在 Host 管理中更新当前签名 Agent/Runtime;远程项目下一次实际使用
Workspace/Runtime 时直接使用新的 current 环境,无需刷新项目绑定。应用启动和项目切换
本身都不连接 Host,也不下载或安装组件。
- SSH、Main、Daemon、Runtime 和远端重启后的核对、恢复与 `outcome_unknown`。
- 支持平台的安装、Ask、Execute、取消和重连冒烟测试通过后开放对应 OpenCode 能力。
@@ -843,6 +943,11 @@ Electron、ChildProcess、PTY、SSH Client、Socket 或文件句柄。
- [ ] 重连先恢复 event cursor 并查询 operation;有副作用操作不会自动重放,无法确认的
结果显示为 `outcome_unknown`。
- [ ] Agent side-by-side 更新支持所需签名版本的健康切换,失败时保留旧项目绑定。
- [x] 新增 Host 只探测远端下载能力,不提供自动安装开关,也不传输完整包;Host 卡片用
一个按版本事实命名的主按钮与不持久化的 acquisition SegmentedControl 启动准备。
- [x] 创建、保存、打开和切换托管 SSH 项目都从 Host current registry 与当前 Agent
连接验证环境;项目只保存稳定配置,且这些流程不下载 `.gbagent`、上传 payload 或发布
安装。
- [ ] 切换跟随目标后不显示上一对象的过期状态。
- [ ] 固定目标的订阅在页面切换后保持,关闭时正确释放。
- [ ] 日志、终端、文件、成果和远程传输均有明确上限和背压。
@@ -855,18 +960,27 @@ Electron、ChildProcess、PTY、SSH Client、Socket 或文件句柄。
- [ ] 仅使用键盘可以选择能力、面板实例、目标、执行空间和控制动作。
- [ ] 状态不只依赖颜色,徽标具有文字或可访问名称。
- [ ] 终端、HTML、监督证据和高频日志具有可访问替代或降噪行为。
- [ ] 浏览器 Tab 顶部工具栏始终清楚区分“停止加载”和“关闭浏览器”;地址编辑草稿不会被
权威状态刷新覆盖,用户与 Agent 的导航通过同一 `BrowserService` 会话串行执行。
- [ ] 创建中、Agent 操作中和完整交互期间禁用浏览器其余工具栏控件;活动加载仍可单独停止,
且停止加载不会关闭会话或释放 Runtime 上下文。
- [ ] 活动 Conversation 没有浏览器会话时,可从同一地址栏按 Agent 相同 URL 策略启动会话。
## 18. 相关文档的职责
- 本文是助手工作栏稳定能力目录、用户面板实例、范围控制和执行空间的产品总契约。
- [助手工作栏多终端页签 PRD](./terminal-tabs-prd.md) 定义持久“+”、应用实例策略、
动态 Tab 以及本机与直接 SSH 多终端。
- [Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) 定义 Task、Conversation、
Job、Subjob、Run 与 Subagent。
- [Task Center PRD](../task-and-job/task-center-prd.md) 定义应用级 Task 索引。
- [智能心跳 PRD](../smart-heartbeat/smart-heartbeat-prd.md) 定义心跳入口、范围和长期边界。
- [会话监督 PRD](../supervision/conversation-supervision-prd.md) 定义监督判断、证据、预算和介入边界。
- [智能心跳 PRD](../smart-heartbeat/prd.md) 定义心跳入口、范围和长期边界。
- [会话监督 PRD](../conversation-supervision/prd.md) 定义监督判断、证据、预算和介入边界。
- [自动化平台总体设计](../../architecture/automation-platform-architecture.md) 定义 Plan、Job、Run、监督、预算和记忆。
- [长期助手路线图](../../roadmap/long-term-assistant-roadmap.md) 记录整体长期能力与实施背景。
- [DeepSeek Harness Runtime 设计](../../architecture/deepseek-harness-runtime-design.md) 定义该 Runtime 的具体适配边界。
- [DeepSeek Harness Runtime 设计](../deepseek-harness/technical-design.md) 定义该 Runtime 的具体适配边界。
- [SSH Host 远程环境准备与直连下载设计](../remote-host/environment-provisioning-technical-design.md)
定义 Host 级组件获取、首次准备、更新、回退和项目只验证边界。
- [统一界面设计系统](../../../UI-DESIGN.md) 定义视觉、语义、响应式和无障碍规则。
若其他文档把工作栏描述为八个同时固定显示的栏目、根据项目或 Runtime 自动裁剪的动态入口,
@@ -0,0 +1,582 @@
# 助手工作栏多终端页签 PRD
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,跨平台验证中 |
| 版本 | 1.1 |
| 日期 | 2026-08-31 |
| 适用产品 | GoodBuddy 桌面端 |
| 界面归属 | [通用助手工作栏与执行空间](./prd.md) |
| 相关设计 | [统一界面设计系统](../../../UI-DESIGN.md) |
| 远程架构 | [SSH 远程主机与 GoodBuddy Agent 实现说明](../remote-host/technical-design.md)、[SSH Host 远程环境准备与控制面直连设计](../remote-host/environment-provisioning-technical-design.md) |
## 1. 文档职责
本文细化助手工作栏中的以下行为:
- 已打开应用以同级 Tab 呈现。
- Tab 行始终提供“+”入口,用户按需打开应用。
- 应用通过统一注册表声明单实例或多实例策略。
- “终端”作为首个多实例应用,自动使用当前项目的本机或托管 SSH 执行空间。
- 本机与远程交互式终端的生命周期、状态、性能和验收要求。
[通用助手工作栏与执行空间 PRD](./prd.md)
继续负责工作栏的应用级位置、稳定能力目录、执行空间、范围绑定和总体产品边界。本文不重新
定义 Host Key、凭据、Agent 安装、Ask/Execute Runtime 或项目持久化契约。
## 2. 背景与当前问题
当前工作栏在聊天页面右侧固定显示“任务中心、工作区、浏览器、成果”四个 Tab。用户不能:
- 通过统一入口按需打开新的工作栏应用。
- 关闭并重新打开一个工作栏应用。
- 为支持多实例的应用创建第二个独立实例。
- 在 GoodBuddy 内使用本机或远程 Host 的交互式 Shell。
当前代码已经具备工作栏右侧回流、宽度调整、Tab 键盘导航、SSH Host Key 固定、加密凭据和
SSH 连接池,但尚不存在工作栏应用实例模型、终端 IPC、终端 Session Manager 或终端模拟器。
`node-pty` 当前只作为其他 Runtime 的间接依赖被打包,不能视为已经存在用户终端能力。
## 3. 产品定义
### 3.1 工作栏应用
工作栏应用是可以在助手工作栏中打开的一个能力,例如任务中心、工作区、浏览器、成果或
终端。每项应用通过统一注册表声明:
- 稳定应用 ID。
- 用户可见名称、图标和说明。
- `single` 或 `multiple` 实例策略。
- 创建实例时可用的默认上下文。
- 当前不可用时的原因和修复入口。
目录中的应用可发现性与实例是否已经打开相互独立。应用不可用时保留入口并说明原因,不以
隐藏代替状态。
### 3.2 工作栏 Tab 实例
工作栏 Tab 是应用的一次打开实例。每个实例具有独立 ID、标题、应用类型和状态。Tab 行只
显示已经打开的实例,不把全部能力同时渲染为 Tab。
### 3.3 终端实例
每个终端 Tab 对应一个独立交互式 Shell Session:
- 本机终端由桌面 Main 进程管理本机 PTY。
- 远程终端通过现有、已验证的 SSH Host 打开直接 SSH PTY。
- 不同终端拥有独立 Shell、工作目录、输入、输出、尺寸和结束状态。
- 创建后固定到当时选择的执行位置,切换项目不会迁移已经运行的终端。
直接 SSH PTY 是用户操作的远程终端,不是连接期临时 GoodBuddy Agent,也不作为 Runtime
stdio fallback。首期远程终端随 SSH Channel 结束,不提供跨 SSH 或桌面重启的进程恢复。
## 4. 已确认的产品决策
1. 工作栏 Tab 行末尾始终显示“+”按钮。
2. “+”是普通命令按钮,不是一个 `tab`。
3. 点击“+”在工作栏内容区显示“新建工作栏应用”选择页;取消后返回原活动 Tab。
4. 选择应用后创建或激活实例,并关闭临时选择页。
5. 单实例应用已经打开时,再次选择只聚焦已有实例,不创建重复 Tab。
6. 多实例应用每次选择都创建新实例。
7. 终端从首期开始就是多实例应用。
8. 任务中心、工作区、浏览器和成果首期保持单实例;后续只需修改应用注册表策略即可开放
多实例,不重写 Tab 壳层。
9. 现有四个应用在升级后仍按当前默认布局打开,避免用户入口突然消失。
10. 用户关闭、切换或重排应用 Tab 后,“+”仍保持可见。
11. 选择“终端”后不再显示第二层目标选择器。存在当前项目时直接绑定该项目,由 Main
根据项目执行空间自动打开本机或托管 SSH Shell;没有当前项目时打开本机 Home Shell。
12. 远程首期使用直接 SSH PTY。SSH 断线后终端进入“已中断”,重新连接会创建一个新的
Shell,不伪装为恢复旧进程。
13. 工作栏收起、切换主页面或切换 Tab 不终止终端;显式关闭终端 Tab 才终止对应 Shell。
14. 应用重启不自动启动 Shell。恢复的终端 Tab 显示“会话已结束”,由用户显式重新连接。
15. 终端是用户交互表面。Ask/Execute 继续约束 Agent Runtime,不把用户键盘操作误判为
Agent 工具调用;Agent、自动化和模型不得未经明确用户操作向终端注入输入。
16. 工作栏继续按上位 PRD 提升为应用级容器;切换聊天、知识、魔法笔记或活动记录等主页面
不销毁 Tab 实例或终端 Session。
## 5. 目标
### 5.1 用户目标
- 在工作栏中随时通过“+”发现并打开应用。
- 同时打开多个本机或远程终端,并通过 Tab 快速切换。
- 清楚知道每个终端运行在本机还是哪个远程 Host、当前目录和连接状态。
- 在终端断线、退出或目标失效后获得准确状态和明确恢复操作。
- 使用键盘完成打开应用、切换 Tab、操作终端和关闭实例。
### 5.2 产品目标
- 用一个可扩展的应用注册表统一单实例与多实例行为。
- 把现有固定四 Tab 迁移为用户实例,而不回归现有任务中心、工作区、浏览器和成果能力。
- 建立真实的 Main/Preload/Renderer 终端生产链路,而不是用普通文本框模拟终端。
- 复用现有 SSH Host Key、凭据和连接池,不建立第二套 Host 管理。
- 保持终端输入输出有序、响应流畅、内存有界,并可靠清理本机和远程资源。
## 6. 非目标
- 不把 GoodBuddy 改造成完整 IDE。
- 不唤起 Windows Terminal、Terminal.app 等外部终端窗口代替内嵌终端。
- 不扫描或导入用户全部 SSH config、目录、Shell profile 或命令历史。
- 不支持任意 `ProxyCommand`、端口转发或 SSH Agent Forwarding。
- 不在打开远程终端时安装、更新或修复 GoodBuddy Agent。
- 不把 Agent 工具调用、Runtime 日志或自动化输出伪装成用户终端。
- 不允许 Renderer 直接访问 PTY、ChildProcess、SSH Client、凭据或 Node API。
- 首期不提供终端协作、录制、云同步、Shell Session 复用、tmux 管理或跨设备恢复。
- 首期不实现底部停靠和独立窗口;本文保留兼容模型,后续按工作栏总 PRD 扩展。
- 首期不通过 GoodBuddy Agent 恢复远程终端,也不为终端复制 Runtime transcript、
`outcome_unknown` 或模型调用恢复协议。
## 7. 信息架构与“+”交互
### 7.1 Tab 行
```text
┌──────────────────────────────────────────────┐
│ 任务中心 │ 工作区 │ 终端 1 │ 终端 2 │ + │
├──────────────────────────────────────────────┤
│ 当前活动实例内容 │
└──────────────────────────────────────────────┘
```
- 已打开实例位于一个语义化 `tablist` 中。
- 每个实例使用独立 `tab` 和 `tabpanel`。
- “+”固定在 Tab 行末尾,但位于 `tablist` 之外。
- Tab 过多时实例区域单行横向滚动,“+”保持可见;不换行、不自动隐藏实例。
- 终端 Tab 默认使用递增标题,例如“终端 1”“终端 2”;状态栏持续显示项目、Host、
工作目录和 Shell。用户可以重命名终端。
- 当前 Tab 同时使用连续内容表面、选中边框、顶部强调线、图标和较高字重,不能只靠文字颜色。
- Tab 关闭按钮默认不争夺视觉注意力,仅在鼠标悬停或键盘焦点进入对应 Tab 时出现;
粗指针或无悬停设备始终显示,出现与隐藏不得引发布局位移。
### 7.2 新建应用选择页
点击“+”后:
1. 保留当前实例及其运行状态。
2. 在工作栏内容区显示“新建工作栏应用”。
3. 列出稳定应用目录,每项显示名称、说明、单/多实例提示和当前可用状态。
4. 初始焦点进入第一个可用应用;Escape 或“取消”返回原活动实例和“+”按钮。
5. 选择单实例应用时,若实例已存在,直接聚焦该 Tab。
6. 选择终端时直接解析当前项目执行空间,创建新 Tab 并聚焦终端输入,不再要求用户
重复选择本机或远程目标。
选择页是“+”触发的临时界面,不进入实例顺序,不持久化,也不占用一个普通 Tab。
### 7.3 首期应用注册表
| 应用 | 实例策略 | 升级后默认状态 | 再次从“+”选择 |
| --- | --- | --- | --- |
| 任务中心 | `single` | 打开 | 聚焦已有 Tab |
| 工作区 | `single` | 打开 | 聚焦已有 Tab |
| 浏览器 | `single` | 打开 | 聚焦已有 Tab |
| 成果 | `single` | 打开 | 聚焦已有 Tab |
| 终端 | `multiple` | 不打开 | 每次创建新 Tab |
实例策略是应用注册数据,不能分散硬编码在多个点击处理器中。
### 7.4 Tab 操作
- 点击或使用方向键切换实例不会暂停或终止后台实例。
- 支持左右方向键、Home、End 和 roving `tabindex`。
- 关闭非活动 Tab 后焦点保持在当前活动 Tab。
- 关闭活动 Tab 后激活右侧相邻实例;没有右侧实例时激活左侧实例。
- 关闭最后一个实例后显示明确空状态和“打开应用”,Tab 行仍保留“+”。
- 关闭正在运行的终端需要确认“关闭终端将结束 Shell 及其子进程”;取消是初始焦点。
- 已退出或已中断的终端可以直接关闭,不重复确认。
## 8. 终端创建流程
### 8.1 自动目标解析
- 当前项目是本地项目时,创建目标为公开 Project ID,Main 从权威项目记录解析本机根目录。
- 当前项目是托管 SSH 项目时,创建目标仍为公开 Project ID,Main 再解析项目 Host、
固定 Host Key、凭据和远端根目录。
- 没有当前项目时使用本机目标和当前用户 Home。
- Host 未验证、凭据不可用或不支持交互式 Shell 时,终端 Tab 就地显示失败原因和恢复入口,
不静默切换到本机或其他 Host。
### 8.2 本机终端
- 当前项目是本地项目时,默认工作目录为项目根目录。
- 没有本地项目目标时,默认工作目录为当前用户 Home。
- Windows 优先使用可用的 PowerShell 7,其次 Windows PowerShell,最后使用系统
`COMSPEC`。
- macOS 和 Linux 优先使用当前用户有效的 `$SHELL`,不可用时使用平台常规 Shell fallback。
- 首期自动选择默认 Shell,不提供任意可执行文件路径输入。
- Main 只向 Shell 传递正常交互所需的筛选环境,不注入模型 API Key、GoodBuddy 内部
Token 或其他产品凭据。
### 8.3 远程终端
- 当前项目是托管 SSH 项目时,自动使用项目 Host 和远端项目根目录。
- Main 复用现有 Host store、完整 Host Key 固定、认证方式和 SSH connection pool。
- 远端通过 SSH PTY 打开账号的登录 Shell,并支持输入、ANSI 输出和窗口尺寸同步。
- 活动终端持有专用 Channel lease,不得被连接池空闲回收。
- 不把密码、私钥、认证头或 GoodBuddy 模型凭据发送给 Renderer 或写入终端环境。
- Host 地址、用户、凭据或 Host Key generation 变化时,旧 Session 进入“已中断”,新建
Session 必须使用 Host store 中的当前身份。
### 8.4 创建结果
创建成功后:
- 新 Tab 插入当前活动 Tab 右侧并立即激活。
- 焦点进入终端输入区域。
- 状态栏显示“本机”或 Host 名称、工作目录、Shell 和连接状态。
- 终端尺寸使用内容区计算出的首个有效 `cols/rows`,不是固定默认值覆盖实际布局。
创建失败时在终端 Tab 保留错误上下文并提供重试;不得留下不可回收 Session 或显示为已经连接。
## 9. 终端交互与状态
### 9.1 基础交互
首期支持:
- 真实 TTY 输入与 ANSI 输出。
- 中文输入法、组合字符和常规键盘快捷键。
- 复制、粘贴、全选、搜索、清屏和滚动。
- 工作栏宽度或窗口尺寸变化后的 PTY resize。
- 终端重命名。
- 显式关闭、退出后重新打开和远程中断后重新连接。
浏览器原生页面快捷键与终端按键冲突时,终端聚焦期间优先交给终端;应用级保留快捷键必须
有明确规则和可访问说明。
### 9.2 状态模型
```ts
type TerminalSessionState =
| 'starting'
| 'running'
| 'exited'
| 'interrupted'
| 'closing'
| 'failed'
```
- `starting`:正在创建本机 PTY 或 SSH Channel。
- `running`:允许输入和 resize。
- `exited`:Shell 正常或带退出码结束,显示退出码或信号。
- `interrupted`:远程连接、Host identity 或桌面生命周期导致会话失效。
- `closing`:已拒绝新输入,正在回收进程或 Channel。
- `failed`:Session 未成功开始或发生不可恢复错误。
高频输出不逐行进入 live region。只播报连接成功、连接失败、已中断和 Shell 已退出等重要
状态变化。
### 9.3 重新连接
- 本机或远程 Session 结束后,“重新打开”在同一 Tab 中创建全新的 Shell Session。
- 远程断线后的按钮文案为“重新连接并新建 Shell”,不能暗示恢复旧进程。
- 新 Session 使用 Host store 和项目中的当前有效配置,不复用旧 Host identity。
- 重新连接前清空旧终端画面,并保留可见说明“这是新的 Shell 会话”。
## 10. 实例、Session 与持久化
工作栏实例与运行 Session 分离:
```ts
type WorkbarAppDefinition = {
id: 'tasks' | 'workspace' | 'browser' | 'results' | 'terminal'
instancePolicy: 'single' | 'multiple'
}
type WorkbarTabInstance = {
id: string
appId: WorkbarAppDefinition['id']
title: string
targetRef?: {
type: 'project' | 'local'
id?: string
}
}
```
- 持久化工作栏打开状态、Tab 顺序、活动实例、应用 ID、自定义标题、公开目标引用和宽度比例。
- 不持久化终端正文、未执行输入、凭据、环境变量、PTY PID、SSH Channel 或派生 Host
identity。
- Main 创建终端后返回新的不透明 Session ID;Renderer 不能选择 PID 或 Channel。
- 应用重启恢复终端 Tab 描述,但状态为“会话已结束”,不自动建立 SSH 连接或启动本机
Shell。
- 运行期间切换项目不会改变已经创建的终端目标。用户需要新目标时通过“+”创建新终端。
## 11. 生命周期与关闭语义
| 用户或系统动作 | Tab | Shell Session |
| --- | --- | --- |
| 切换 Tab | 保留 | 继续运行 |
| 收起工作栏 | 保留 | 继续运行,停止非必要高频 UI 工作 |
| 切换主页面 | 保留 | 继续运行 |
| 切换项目 | 保留并显示原目标 | 继续在原目标运行 |
| 关闭运行中的终端 Tab 并确认 | 删除 | 结束 Shell 和子进程 |
| Shell 自行退出 | 保留 | 标记 `exited` |
| SSH 断线 | 保留 | 标记 `interrupted` |
| 删除或修改目标 Host | 保留 | 关闭旧 Channel 并标记 `interrupted` |
| Renderer 销毁或应用退出 | 下次恢复描述 | 在总关闭截止时间内回收 |
关闭操作必须安全处理竞态。Main 停止接受新输入,关闭 stdin/Channel,先正常结束,再在既有
应用关闭截止时间内升级清理;一个卡死终端不能无限阻塞应用退出。关闭后的迟到 ACK 视为已
完成,input、resize 或重复 close 返回 Session 不存在,不操作其他 Session。
## 12. 技术生产路径
### 12.1 Shared
新增独立终端契约,至少覆盖:
- `create`:目标引用、初始 `cols/rows`。
- `write`:Session ID 和有界输入。
- `resize`:Session ID、`cols/rows`。
- `close`:Session ID。
- `snapshot`:目标、状态、Shell、目录和终态。
- `event`:带 Session ID 和单调序号的输出、状态、退出与错误事件。
所有 Schema 使用 Zod 严格校验,并限制 ID、标题、输入、尺寸、事件块、会话数和缓冲字节。
### 12.2 Main
新增统一 `TerminalSessionManager`:
- Session 按所属 `webContents` 和不透明 ID 隔离。
- 将现有间接 `node-pty` 提升为 GoodBuddy 直接生产依赖,并用于启动平台 Shell。
- 远程使用现有 `SshConnectionPool` 打开交互式 PTY Channel。
- 统一处理 write、resize、close、exit、连接中断和应用退出。
- 终端输出只发送给所属窗口。
- 复用现有子进程树终止思路,但针对 PTY 验证 Windows 与 POSIX 的实际回收行为。
### 12.3 Preload 与 IPC
- `DesktopApi` 只暴露显式 `terminal.create/write/resize/close/getSnapshot/onEvent`。
- Main Handler 对每个调用执行可信 sender 检查和共享 Schema parse。
- Preload 管理事件订阅释放,不暴露 `ipcRenderer`、PTY、SSH Client 或 Node API。
### 12.4 Renderer
- 使用 `@xterm/xterm` 6 和官方 fit/search addon 处理 ANSI、光标、选择、IME、搜索、
滚动和可访问输入,不自行实现终端转义状态机。
- 终端首次打开时按需加载;支持 WebGL2 时使用官方 WebGL renderer,初始化失败或 Context
丢失时释放 WebGL addon 并回退到 xterm 默认 renderer。
- xterm 使用解析后的跨平台系统等宽字体栈,不能把未解析的 CSS `var(...)` 交给 Canvas。
- Tab 壳层只管理实例与焦点,不持有 PTY 或 SSH 对象。
- `ResizeObserver` 只在有效非零布局后发送去重后的 `cols/rows`。
- 组件卸载时退订画面事件;只有显式关闭终端才调用 Session close。
- 终端样式复用全局语义颜色、边框、焦点和字体令牌,不创建另一套工作台设计系统。
### 12.5 输出顺序与背压
- 输出按 Session 分区并携带单调序号。
- Main 合并小块输出,限制单事件大小、待发送条目和总字节。
- Renderer 确认已经消费的序号;慢消费者达到上限时暂停 PTY/SSH stream,消费后恢复。
- 不通过丢弃中间输出维持界面响应,因为丢失字节会破坏终端状态。
- Renderer 只保留有界滚动历史;清屏不改变 Main Session 生命周期。
## 13. 权限与边界
- 用户终端以当前本机账号或所选 SSH 账号的正常权限运行,不增加额外虚构的 trust tier。
- Ask/Execute 是 Agent Runtime 模式,不自动改变用户直接操作终端的 OS 权限。
- UI 必须持续将其标注为“用户终端”,避免被理解为 Ask Runtime 的只读输出。
- Agent、模型、监督器和自动化不能调用终端 write,也不能把指令注入已有 Session。
- 终端输出不会自动进入对话上下文、模型 Prompt、成果或活动记录。
- Renderer 只能引用项目和 Session 的公开 ID;Main 从权威 store 解析目录、Host、凭据和
当前 Host identity。
- 不接受 Renderer 提交任意 Shell 可执行路径、SSH 命令、PID、环境变量集合或原始凭据。
- 保持 Electron `contextIsolation`、sandbox 和禁用 Renderer Node integration。
## 14. 错误与反馈
- 创建失败、断线、Shell 退出和目标失效保留在终端面板,提供就地重试。
- 不与全局通知重复显示同一终端错误。
- 非局部错误,例如无法保存工作栏布局,可以进入应用通知。
- 错误文案说明发生了什么、当前 Shell 是否仍在运行、用户可以做什么。
- Host Key 变化沿用现有 Host 管理流程;终端只显示“主机身份已变化,请重新验证”,不在
终端内复制凭据或 Host Key 修改流程。
- 目标不可用时保留 Tab 名称和目标,不静默切换到本机或其他 Host。
## 15. 性能与资源要求
- 工作栏切换和终端输入在正常负载下保持即时反馈,持续输出不能阻塞主界面导航。
- 同一窗口的活动终端数量必须有明确上限;达到上限时阻止新建并说明先关闭不用的终端。
- 每个 Session 的输出队列、Renderer 滚动历史和 IPC 单事件均有硬上限。
- 工作栏不可见时可以降低渲染刷新频率,但不能丢失终端协议字节或暂停 Shell 本身。
- 应用退出复用现有总清理截止时间,不因终端新增无界等待。
- 生产构建必须实际加载本机 PTY 原生模块;不能只验证文件存在。
- 远程终端不能使 SSH connection pool 的空闲项、Channel 或监听器泄漏。
具体数值在共享契约和性能测试中确定,以现有 IPC、窗口和关闭预算为上限,不在多个进程中
维护不同常量。
## 16. 无障碍与响应式
- Tab 使用 `tablist/tab/tabpanel`;“+”使用带可访问名称“打开工作栏应用”的普通按钮。
- 应用选择页使用可键盘操作的列表或菜单语义,不使用 `SegmentedControl`;终端没有重复的
目标选择页。
- 每个终端 Tab 的可访问名称包含自定义名称或位置,多个终端不能都只读作“终端”。
- Tab 关闭后焦点移动到确定的相邻 Tab;取消创建后焦点返回“+”。
- 工作栏收起后焦点返回唯一工作栏开关,不增加焦点陷阱或遮罩。
- 终端高频输出不逐行播报;只播报连接、退出、失败和中断。
- 200% 文字缩放时,目标、Shell、目录、状态和关闭操作仍可访问。
- Tab 单行横向滚动,终端内容随工作栏尺寸变化并同步 PTY,不把 Tab 换成下拉框。
- 深色和浅色主题都使用设计系统语义令牌,并保持终端文本、选择和光标可辨。
## 17. 实施顺序与多代理工作包
功能必须以完整的本机和远程用户流程交付。以下是可并行的开发工作包,不表示可以发布只有
Schema、假数据终端或不可用入口的中间产品。
### 17.1 依赖顺序
```text
契约冻结
├─ 工作栏实例壳层
├─ 本机 PTY 后端
├─ SSH PTY 后端
└─ 终端 Renderer
↓
单一集成负责人完成 Main/Preload/App 接线
↓
完整验证、真实 Host 验收与文档同步
```
### 17.2 文件所有权
| 工作包 | 主要职责 | 建议文件所有权 | 不应修改 |
| --- | --- | --- | --- |
| 契约与注册表 | Workbar/Terminal Schema、状态、测试 | 新建 `src/shared/workbar-contracts.ts`、`terminal-contracts.ts` 及测试 | `App.tsx`、`ipc.ts`、Preload |
| 工作栏壳层 | 动态实例 Tab、“+”、选择页、单/多实例和焦点 | 新建工作栏组件及其测试 | PTY、SSH、Main IPC |
| 本机终端后端 | 本机 PTY、输入、resize、退出和进程树清理 | 新建 `src/main/terminal/` 本机文件及测试 | Renderer、远程 Agent |
| SSH 终端后端 | SSH PTY、lease、resize、断线和 Channel 清理 | 新建 `src/main/terminal/` 远程文件及聚焦测试 | 工作栏 UI、Agent 协议 |
| 终端 Renderer | 模拟器、IME、搜索、复制粘贴、状态栏和 resize | 新建终端组件、样式和测试 | Main、SSH、中心 IPC |
| 集成 | 依赖、IPC channel、DesktopApi、Preload、Main 注册、`App` 接线与关闭顺序 | `package.json`、lock、`ipc-channels.ts`、`contracts.ts`、`preload/index.ts`、`main/ipc.ts`、`App.tsx` | 不重写各包已验收内部逻辑 |
| 验收与文档 | E2E、跨平台构建检查、真实 Host、最终文档 | 测试与相关文档 | 不用假实现替换生产路径 |
中心文件只能由集成负责人修改,避免多个代理同时编辑 `App.tsx`、`main/ipc.ts`、
`shared/contracts.ts`、`preload/index.ts`、`package.json` 和 lockfile。
### 17.3 并行开发门槛
契约负责人先冻结:
- 应用注册和实例策略。
- Terminal request、snapshot、event 和 error code。
- Session 所有权和关闭语义。
- 输出序号、ACK 与容量常量。
其他代理基于冻结契约工作。接口偏差由集成负责人统一修正,不由多个代理分别修改共享中心
文件。
## 18. 验收标准
### 18.1 工作栏应用与实例
- [ ] Tab 行末始终显示“+”,包括没有任何打开实例时。
- [ ] 点击“+”显示稳定应用目录,取消后返回原实例并恢复焦点。
- [ ] 选择已打开单实例应用只聚焦已有 Tab。
- [x] 连续选择终端会创建多个互相独立的终端 Tab。
- [ ] 关闭、切换和重排实例后,“+”仍保持可用。
- [ ] Tab 溢出时单行横向滚动,不隐藏“+”或把 Tab 换成下拉框。
- [x] 关闭活动 Tab 后激活正确的相邻 Tab 并恢复焦点。
- [x] 当前 Tab 的背景、边框、顶部指示和字重清晰可辨;关闭按钮仅在悬停、焦点或无悬停
设备上出现,且不引发布局位移。
- [ ] 升级后现有任务中心、工作区、浏览器和成果仍按默认布局打开且行为不回归。
- [ ] 在所有主要页面都能打开工作栏;切换主要页面不会销毁 Tab 实例或终端 Session。
### 18.2 本机终端
- [x] 从“+ → 终端”直接打开当前本机项目的真实交互式 Shell,工作目录为项目根。
- [ ] 没有项目时从用户 Home 打开本机 Shell。
- [ ] `pwd` / `Get-Location`、交互输入、ANSI 颜色、中文 IME、复制和粘贴工作正常。
- [ ] 调整工作栏和窗口尺寸会更新 PTY `cols/rows`,全屏 TTY 程序正确重绘。
- [ ] 多个本机终端的输入、输出、目录和退出状态互不串线。
- [ ] Shell 有活动子进程时关闭 Tab,确认后回收完整进程树;取消后 Session 继续运行。
- [ ] 退出后的 Tab 显示退出码,并可在同一 Tab 显式创建新 Shell。
### 18.3 远程终端
- [ ] 从“+ → 终端”直接为当前托管 SSH 项目打开真实 SSH PTY。
- [ ] 终端持续显示 Host、远端目录、Shell 和连接状态。
- [ ] 使用现有固定 Host Key 和已存凭据,Renderer、日志和命令参数不出现凭据。
- [ ] 输入、ANSI、中文、复制粘贴和 resize 在真实 Host 上工作正常。
- [ ] 活动远程终端不会被 SSH connection pool 空闲回收。
- [ ] SSH 断线立即标记“已中断”并拒绝继续输入,不显示为仍在运行。
- [ ] “重新连接并新建 Shell”明确创建新 Session,不宣称恢复旧远端进程。
- [ ] Host 删除、地址/用户/凭据或 Host Key generation 变化会中断旧 Session;新 Session
使用当前 Host identity。
### 18.4 生命周期、性能和边界
- [ ] 收起工作栏、切换主页面、切换 Tab 或切换项目不会终止已有终端。
- [ ] 终端不会随项目切换静默迁移执行位置。
- [ ] 应用重启只恢复终端 Tab 描述,不自动连接或启动 Shell。
- [ ] 输出顺序在持续大输出下保持正确,Main 和 Renderer 内存保持有界,主界面仍可操作。
- [ ] 慢 Renderer 触发暂停和恢复,不丢弃中间终端字节。
- [ ] Renderer 不获得 raw PTY、ChildProcess、SSH Client、PID、环境变量或凭据。
- [ ] Agent、模型和自动化不能向已有用户终端注入输入。
- [ ] 窗口销毁和应用退出在既有关闭截止时间内回收本机进程、SSH Channel 和监听器。
- [ ] 重复 close、迟到 input/resize 和退出竞态不会操作其他 Session 或导致进程泄漏。
### 18.5 设计、无障碍和跨平台
- [ ] 仅使用键盘可以打开应用、创建终端、切换和关闭 Tab、复制、粘贴及重新连接。
- [ ] Tab、“+”、选择页和关闭确认使用正确语义并有可见焦点。
- [ ] 终端输出不逐行进入 live region,关键状态变化可被辅助技术感知。
- [ ] 浅色、深色、200% 文字缩放和窄窗口下可以完成核心流程。
- [ ] Windows、macOS、Linux x64 和 Linux arm64 的正式构建实际启动本机 PTY。
- [ ] 远程链路在共享 Linux x64 真实 Host 上完成创建、输入、resize、断线、重连、关闭和
应用退出验证;若 Host 不可达,远程终端不得标记为完成。
## 19. 验证计划
### 19.1 自动验证
- 共享 Zod Schema 和边界值测试。
- 单/多实例注册策略、Tab 顺序、关闭焦点和“+”选择页组件测试。
- 本机 PTY Session Manager 的输入、resize、退出、幂等关闭和进程树测试。
- SSH PTY 的 Host identity、lease、断线、resize 和关闭测试。
- Main trusted sender、Session 所有权、IPC 输入边界和事件路由测试。
- Terminal Renderer 的 IME、键盘、ResizeObserver、订阅释放和状态测试。
- `npm test`
- `npm run typecheck`
- `npm run lint`
- `npm run build`
### 19.2 真实路径验证
- 在当前开发平台通过产品 UI 完成本机终端全流程。
- 在共享 Linux x64 Host 通过现有 Host 配置完成远程终端全流程。
- 真实运行需要 TTY 的程序,验证 ANSI、光标和 resize,不只运行非交互命令。
- 持续输出并主动减慢 Renderer 消费,验证背压和内存上限。
- 分别在本机和远程启动带子进程的命令,关闭 Tab 和应用后核对无 GoodBuddy 所属遗留资源。
- 生产构建在各受支持平台实际加载 PTY 原生模块,不以单元测试或包内文件存在代替。
### 19.3 当前开发验证记录
2026-09-01 已通过生产 `SshConnectionPool` 和 `createSshTerminalSession` 在共享 Linux x64
Host 完成直接 SSH PTY 验证:使用已有固定 Host Key 和测试凭据,以远端项目目录启动登录
Shell,验证交互输入、ANSI、UTF-8 中文、`80×24` 到 `101×37` resize、连接销毁后进入
`interrupted`、重新连接创建新 Shell,以及 Session close 和 connection pool dispose
回收远端 Shell。验证只创建一个
`$HOME/.goodbuddy/terminal-smoke-<UUID>` 临时目录,结束后已删除并确认无遗留 Shell 进程。
同日使用最新生产构建完成工作栏视觉检查:活动 Tab 使用连续内容表面、顶部强调线和应用
图标;关闭按钮默认不可见,悬停后以 overlay 显示且 Tab 宽度不变;横向滚动继续可用但不
显示滚动条,“+”保持独立可见。
本记录不替代尚未勾选的完整产品 UI、剪贴板、macOS、Linux arm64 和各平台本机 PTY 验收。
本 PRD 不改变 Agent 协议,因此首期远程终端无需 Agent package 更新。若实现期间改为
Agent-owned PTY,必须先修订本文的远程生命周期和恢复语义,并按 Agent 开发规则在共享
Linux x64 Host 验证当前源码或候选包。
## 20. 相关文档职责
- [通用助手工作栏与执行空间 PRD](./prd.md):
工作栏应用级位置、稳定能力目录、执行空间和总体范围。
- 本文:持久“+”、应用实例策略、工作栏动态 Tab、自动项目目标、本机与直接 SSH 多终端。
- [统一界面设计系统](../../../UI-DESIGN.md):Tab、菜单、布局、主题、焦点和无障碍规则。
- [SSH 远程主机与 GoodBuddy Agent 实现说明](../remote-host/technical-design.md):
Host Key、凭据、连接池、Agent 和远程项目现状。
- [SSH Host 远程环境准备与控制面直连设计](../remote-host/environment-provisioning-technical-design.md):
Host 保存、环境准备和项目使用之间的职责。
+11
View File
@@ -0,0 +1,11 @@
# 电脑控制
电脑控制包含 GoodBuddy 对浏览器和客户端桌面能力的产品实现与平台适配状态。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [功能进度](./progress.md) | 当前已实现能力、缺陷修复、平台限制和验证状态 |
当前只有进度文档;产品需求、功能逻辑、UI 和技术设计尚未从历史实现记录中独立整理。
@@ -28,8 +28,8 @@ Linux x64 和 Linux arm64。
导航及重定向仍经过 DNS 解析和目标地址固定。
- 已实现回环过滤代理、下载和文件选择器阻止、权限拒绝、会话取消、
空闲回收和应用退出清理。
- 直连模型工具循环已提高到适合浏览器任务的有界上限,并包含重复调用和
无进展保护。
- 直连模型工具循环不设置工具次数或模型轮次配额;取消、请求超时、工具结果大小和
累计输出边界继续防止失控执行。
### MCP
@@ -93,11 +93,27 @@ Linux x64 和 Linux arm64。
新增“浏览器”页签;活动对话启动浏览器时会自动打开该页签,并显示创建中、
加载中、操作中、用户交互中、就绪、失败和已停止状态。用户可点击“交互”打开
同一会话的子窗口辅助 Agent;交互时主窗口暂时禁用,关闭时先刷新最终画面再将
浏览器窗口最小化,页面和会话继续保留。用户也可立即停止当前对话的浏览器会话。
浏览器窗口最小化,页面和会话继续保留。用户也可明确关闭当前对话的浏览器会话。
当前实现按导航、快照、点击、输入、选择、返回和截图操作刷新画面,而不是创建
第二个预览浏览器,因此显示内容与模型受控页面一致。
### 已实现:浏览器工具栏
浏览器 Tab 顶部已增加“返回、刷新/停止加载、地址输入、前往、交互、关闭浏览器”工具栏。
它继续操作 Agent 在当前 Conversation 中使用的同一浏览器会话;用户导航会有意改变 Agent
下一步看到的页面。前往、返回和刷新通过 `BrowserService` 与 Agent 浏览器操作串行执行,
不会创建第二套 Renderer 导航路径。
工具栏状态以浏览器提交后的权威 URL、是否加载中、能否返回和会话活动状态为准;地址输入
在用户编辑期间保留本地草稿,不被状态刷新覆盖;提交未带 HTTP(S) 协议的裸域名时会自动添加
`http://`。创建中、Agent 操作中和完整交互窗口期间禁用其余工具栏控件,但活动导航仍可用
“停止加载”中断。停止加载只取消页面加载,不关闭浏览器,也不释放 Runtime 上下文;原“停止
浏览器”会话生命周期操作已统一标为“关闭浏览器”,并在视觉和文案上与停止加载清楚区分。
活动 Conversation 尚无浏览器会话时,可直接从地址栏输入 URL 并“前往”,通过现有浏览器
能力检查和同一 URL 策略创建会话。实现复用现有每 Conversation 串行队列和有界状态,不引入
恢复、版本化或第二套会话框架。
### P0:百度输入时元素引用失效,已修复
截图中的“浏览器元素引用已失效,请重新获取快照”来自过宽的导航监听:广告或
@@ -0,0 +1,11 @@
# 持续学习
持续学习定义 GoodBuddy 如何从运行结果、评估证据和人工反馈中形成可验证的改进闭环。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [持续学习与评估门 PRD](./prd.md) | 产品目标、学习边界、评估门和验收要求 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
@@ -7,7 +7,7 @@
| 状态 | 设计中,远期能力 |
| 版本 | 0.3 |
| 日期 | 2026-08-19 |
| 依赖 | [自动化平台总体设计](../../architecture/automation-platform-architecture.md)、[并行实验 PRD](../experiments/parallel-experiments-prd.md)、[分区记忆 PRD](../memory/partitioned-memory-prd.md) |
| 依赖 | [自动化平台总体设计](../../architecture/automation-platform-architecture.md)、[并行实验 PRD](../parallel-experiments/prd.md)、[分区记忆 PRD](../memory/prd.md) |
## 1. 背景
@@ -0,0 +1,11 @@
# 会话监督
会话监督定义对长会话、工具执行和异常状态的观察、判断与介入边界。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [会话监督 PRD](./prd.md) | 监督目标、证据、介入方式和产品验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
@@ -8,7 +8,7 @@
| 版本 | 0.2 |
| 日期 | 2026-08-18 |
| 依赖 | [自动化平台总体设计](../../architecture/automation-platform-architecture.md) |
| 界面归属 | [通用助手工作栏与执行空间](../assistant-experience/assistant-workbar-and-execution-spaces-prd.md) |
| 界面归属 | [通用助手工作栏与执行空间](../assistant-workbar/prd.md) |
| 体验参考 | GoodBuddy 魔法笔记 AI 评论流 |
## 1. 背景
+12
View File
@@ -0,0 +1,12 @@
# DeepSeek Harness Runtime
本功能定义 DeepSeek Harness 作为 GoodBuddy 本机 Agent Runtime 的产品接入、控制面、
插件市场、权限和打包边界。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [技术设计](./technical-design.md) | Runtime 产品与技术方案、协议、插件、打包、测试和验收 |
现有文档同时包含部分 PRD、功能逻辑和进度内容,后续修改该 Runtime 时再按标准职责拆分。
@@ -163,7 +163,7 @@ Electron utilityProcess
├─ 本地 Shell / Filesystem Provider
├─ 最小工具集与 Main 代理 MCP
└─ Main 明确启用的第三方 Cordis 插件
│ HTTPS
│ HTTP/HTTPS
▼
用户选择的 OpenAI 兼容模型连接
```
@@ -325,12 +325,13 @@ GoodBuddy conversationId -> Harness sessionId + process generation
- 历史以明确的“不可信会话数据”结构传入,不能拼接成系统指令。
- 用户分配的 Skill 只通过 Main 校验的包路径进入 Host,并在 Agent scope 注册;不得把 Skill 内容伪装成用户 Prompt。
### 9.3 取消与超时
### 9.3 取消与有界控制操作
- 用户取消时立即发送 `session/cancel`。
- 取消等待有界,超时后关闭连接并终止整个 Harness 进程。
- 初始化、握手、Session 创建、Prompt、权限回传和关闭分别使用独立超时。
- Prompt 超时与用户取消使用不同错误类型,不能被宽泛 catch 抹平。
- 初始化、握手、请求准备、权限回传和关闭分别使用独立控制超时。
- 生产 Prompt 不设置固定墙钟总时限,由 Harness 自身协议终态或用户取消结束。测试可以
显式注入短 Prompt 时限验证取消传播,超时错误与用户取消仍不能被宽泛 catch 抹平。
- 取消后仍可接收并丢弃该请求的最终协议结算帧,但不得写入下一请求。
### 9.4 释放与退出
@@ -426,13 +427,13 @@ DeepSeek Harness 首版只使用符合下列边界的 GoodBuddy 模型连接:
- 协议必须是 `openai-chat-completions`。
- 认证必须是 API Key。
- 公网服务地址必须使用 HTTPS;`localhost`、`127.0.0.1` 和 `::1` 回环地址可以使用 HTTP。
- 服务地址可以使用自定义主机、端口和部署路径,但不得包含用户名、密码、查询参数或片段。
- 服务地址支持 HTTP 和 HTTPS,不根据主机位置、端口、凭据、查询参数或片段增加额外限制。
- 模型名称不限制为 DeepSeek 品牌,由所选 OpenAI 兼容服务决定。
- 模型名称和服务地址由 Main 传入受控 Host。
- 图片能力只读取所选 GoodBuddy 模型连接的 `supportsImageInput`;Main、Utility 启动配置、ACP 能力和 Pi-AI 模型输入模态必须使用同一个布尔值。
- API Key 继续保存在 GoodBuddy 加密设置中。
- 启动环境提供的部署连接只由 Main 自动解析,不在 Renderer 中显示为可选来源。
- 未显式指定 Harness 模型且没有可用的管理员预置连接时,Main 优先使用当前默认的兼容 GoodBuddy 模型连接;默认连接不兼容时使用首个兼容连接。只有不存在任何兼容连接时才提示用户前往模型或 Runtime 设置。
不允许选择 Harness 自有的用户配置文件或自定义 Host。Runtime 始终使用随当前 GoodBuddy 版本发布的内置 Host,并通过完整内部能力握手。
@@ -469,7 +470,7 @@ DeepSeek Harness 首版只使用符合下列边界的 GoodBuddy 模型连接:
| stderr 累计 | 64 KiB |
| Host 启动 | 10 秒基础预算 + 每插件 5 秒激活与最多 1 秒失败清理,插件序列最多 91 秒;Main 另预留 2 秒持久化失败状态 |
| ACP 初始化与内部握手 | 每阶段 10 秒 |
| 单次 Prompt | 10 分钟 |
| 单次 Prompt | 无固定墙钟总时限,由 Harness 终态或用户取消结束 |
| 有序关闭宽限期 | 2 秒 |
超过限制时应取消当前请求。协议帧、队列或 stderr 持续异常时,应终止 Runtime 进程,避免继续信任已失控的通道。
@@ -535,7 +536,7 @@ Runtime 栏目入口始终存在,并采用统一监督模型;内部再按用
显示 OpenCode、Continue 或 DSH 的具体区域。未支持能力不渲染空卡片或一排禁用按钮,而是
在用户需要理解缺口时显示原因和可执行入口。跟随模式切换 Runtime、Conversation 或 Task
时必须清理上一归属的聚合执行状态,固定目标则保持不变。完整工作栏契约见
[通用助手工作栏与执行空间 PRD](../prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md)。
[通用助手工作栏与执行空间 PRD](../assistant-workbar/prd.md)。
所有未来的 Subagent、Job、Workflow、Hook 和会话操作仍须经过 Main 的 Runtime 边界,保留取消、超时、权限、Task/Job/Subjob 层级、用量和活动审计。高风险动作在侧栏就地确认,运行结果进入活动与成果记录,不以 Composer 按钮代替监督面板。DeepSeek Harness 首版仍不加载这些服务,本节只确定未来跨 Runtime 的产品位置和协议归属。
@@ -0,0 +1,48 @@
# 直连模型 Agent 能力
本目录是 GoodBuddy“直连模型 Agent 能力”的唯一文档入口。本功能为直连文本模型补齐
跨平台进程执行和编程 Subagent,使其能够在 Execute 模式完成读取、修改、运行和验证组成的
编程闭环,同时避免向已经拥有原生 Shell 或 Agent 能力的 Runtime 重复注入工具。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [PRD](./prd.md) | 用户问题、产品范围、功能需求、非目标和产品验收 |
| [User Stories](./user-stories.md) | 本机开发、失败恢复、委派和 Runtime 边界场景 |
| [功能逻辑](./logic-design.md) | 能力矩阵、不变量、状态转换、继承规则和失败结果 |
| [UI 设计](./ui-design.md) | 设置能力目录、聊天活动、Subagent 状态和无障碍行为 |
| [技术设计](./technical-design.md) | Main 服务、工具契约、平台适配、Subagent、生命周期和测试 |
| [功能进度](./progress.md) | 当前实现事实、待实施阶段、阻塞项和验证证据 |
## 术语
| 术语 | 定义 |
| --- | --- |
| 直连模型 | Runtime provider 为 `model`、由 GoodBuddy 直接调用模型协议的文本模型 |
| 进程执行 | GoodBuddy 在当前执行空间启动一个前台 Shell 命令并返回有界结果 |
| 平台 Shell | Windows 上的 PowerShell,macOS/Linux 上的 Bash 或 POSIX Sh |
| 编程 Subagent | 由直连模型临时委派、使用直连模型 Runtime 执行一个有界子任务的执行者 |
| 父请求 | 发起进程调用或 Subagent 委派的当前直连模型请求 |
| 子任务 | 父请求内部的一项委派工作,对应 Job/Subjob 语义,不是新的顶层 Task |
Task、Job、Subjob、Run 和 Subagent 的对象关系以
[Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) 为准。本功能不重新定义
这些对象。
## 功能边界
- `process_execute` 和 `subagent_delegate` 是 GoodBuddy 直连模型内置工具,不是外部 MCP。
- OpenCode、Continue 和 DeepSeek Harness 继续使用各自原生执行与委派能力。
- Ask 不允许进程执行;Subagent 若在 Ask 中使用,只能继承 Ask 的只读能力。
- Execute 表示用户授权当前执行空间账号的完整能力,不增加第二套工具审批或权限档位。
- 首版跨平台指桌面本机 Windows、macOS 和 Linux。托管 SSH 项目当前继续使用远端
OpenCode;未来若向远端直连模型开放本工具,命令必须由 Host Agent 执行,绝不能回退到
桌面本机。
## 相关功能
- [本机工具环境](../local-tool-environment/README.md):为新进程提供 Node、Python 和 PATH。
- [助手工作栏与执行空间](../assistant-workbar/prd.md):定义本机/SSH 执行位置和活动归属。
- [远程主机与远程执行](../remote-host/README.md):定义当前托管 SSH Runtime 边界。
- [DeepSeek Harness Runtime](../deepseek-harness/README.md):已经拥有平台 Shell 的独立 Runtime。
@@ -0,0 +1,173 @@
# 直连模型 Agent 能力功能逻辑设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施 |
| 版本 | 0.2 |
| 日期 | 2026-09-01 |
| 关联 PRD | [PRD](./prd.md) |
| 关联故事 | [User Stories](./user-stories.md) |
## 1. 权威不变量
1. `process_execute` 和 `subagent_delegate` 只属于直连文本模型。
2. Ask 永远不能启动命令、写入工作区或创建 Execute Subagent。
3. 子级的项目、执行空间、工作模式、模型连接和能力范围只能继承或缩小。
4. 子级工具清单不包含 `subagent_delegate`,最大深度固定为 1。
5. 命令必须在父请求绑定的执行空间运行,禁止跨设备静默回退。
6. 一个 `process_execute` 调用只拥有自己创建的前台进程树,不能管理无关进程。
7. 非零退出码是命令结果;启动失败、输入无效和后端不可用才是工具失败。
8. 子任务是父请求内部 Job/Subjob,不创建顶层 Task 或独立 Conversation。
9. 父请求取消、Runtime 释放或应用退出会传播到全部活动子级和进程。
10. OpenCode、Continue 和 DeepSeek Harness 的原生能力不被本功能替换或包装。
## 2. 状态维度
| 维度 | 值 |
| --- | --- |
| Runtime | `model`、`opencode`、`continue`、`deepseek-harness` |
| 工作模式 | `ask`、`execute` |
| 执行空间 | `local`、`ssh` |
| 本机 Shell | `available`、`unavailable` |
| Subagent 深度 | `0`、`1` |
| 父请求 | `active`、`cancelling`、`terminal` |
## 3. 工具可见性决策表
| Runtime | 模式 | 执行空间 | `process_execute` | `subagent_delegate` |
| --- | --- | --- | --- | --- |
| `model` | Ask | 本机 | 隐藏 | 提供,只读继承 |
| `model` | Execute | 本机且 Shell 可用 | 提供 | 提供,Execute 继承 |
| `model` | Execute | 本机但 Shell 不可用 | 隐藏并报告诊断 | 提供,但子级同样没有进程工具 |
| `model` | Ask/Execute | SSH,远端后端未实现 | 隐藏 | 当前远端直连模型产品入口不开放 |
| 其他 Runtime | 任意 | 任意 | 隐藏 | 隐藏 |
工具清单隐藏不是最终授权边界。`callTool` 仍须重新验证 Runtime、工作模式、执行空间和父请求
是否活动,以拒绝旧快照或伪造调用。
## 4. 进程状态机
```text
validating
├─ invalid → failed
└─ valid → starting
├─ spawn_failed → failed
└─ running
├─ exit 0 → completed
├─ exit nonzero → completed_nonzero
├─ timeout → terminating → timed_out
├─ parent cancel → terminating → cancelled
└─ output/lifecycle failure → terminating → failed
```
规则:
- `completed_nonzero` 仍产生正常工具结果。
- 超时和取消结果包含已经取得的有界输出。
- 进入 `terminating` 后不再接受新输入,也不启动替代命令。
- 终止只针对本次调用记录的进程树。
- 迟到的 `close` 只用于清理,不得覆盖已提交的取消或超时原因。
## 5. 工作目录决策
| 输入 | 结果 |
| --- | --- |
| 未提供 | 当前工作区根目录 |
| `.` 或合法相对子目录 | 解析到工作区内目录 |
| 绝对路径 | 拒绝 |
| `..` 越界、符号链接越界 | 拒绝 |
| 不存在或不是目录 | 拒绝 |
| 当前工作区身份在验证期间变化 | 拒绝本次调用 |
首版进程工具比 Execute 的 OS 权限范围更窄地固定工作目录输入,只是为了保持请求与项目
一致;命令本身仍以当前用户权限运行,可以显式访问该账号有权访问的其他绝对路径。该规则
不是 Runtime OS 沙箱,也不能宣称文件系统 containment。
## 6. Shell 选择
| 平台 | 顺序 | 不可用结果 |
| --- | --- | --- |
| Windows | `pwsh` → `powershell.exe` | 进程工具不注册,设置诊断显示 PowerShell 不可用 |
| macOS | `/bin/bash` → `/bin/sh` | 两者都不可用时不注册 |
| Linux | `/bin/bash` → `/bin/sh` | 两者都不可用时不注册 |
一次父请求冻结实际 Shell 描述。PATH 或工具环境设置变化只影响新创建的 Runtime/执行服务,
不在运行中的命令或 Subagent 中途切换。
## 7. Subagent 状态机
```text
validating
├─ invalid/depth_exceeded → failed
└─ queued
├─ parent_cancelled → cancelled
└─ running
├─ model done → completed
├─ child failure → failed_with_partial_output
├─ timeout → cancelled
└─ parent cancel → cancelled
```
父模型收到结构化终态:
```ts
type SubagentDelegateResult = {
status: 'completed' | 'failed' | 'cancelled'
output: string
error?: string
modelUsage?: {
inputTokens?: number
outputTokens?: number
}
}
```
失败和取消是父模型可以解释的子任务结果。只有契约损坏、未知子任务身份或服务已经释放等
内部不变量失败才终止父工具循环。
## 8. 权限与能力继承
| 父请求 | 子级模式 | 子级能力 |
| --- | --- | --- |
| Ask | Ask | 父级只读工具的子集,不含进程、写入和再次委派 |
| Execute | Execute | 父级已启用工具的子集,包含本机进程能力,不含再次委派 |
- 子级不能请求更高模式。
- 子级使用父请求开始时的工具与能力快照;运行中设置变化不重写快照。
- 子级调用 MCP、浏览器或知识能力时继续经过这些能力已有的作用域和生命周期边界。
- Execute 子级不弹出额外的“Subagent 执行授权”,也不获得父级没有的 MCP 分配。
## 9. 并发和顺序
- 全局编程 Subagent 最大并发为 3,额外请求进入有界队列。
- 单个父模型的工具调用仍按直连模型现有顺序结算,不为本功能改写全部工具并发语义。
- 不同父请求的 Subagent 可以并发;共享工作区的并发写入属于用户已授权的 Execute 行为,
活动记录必须保留实际顺序和结果。
- 首版不自动创建工作树、锁文件或回滚层。出现真实冲突时由父模型读取当前工作区事实并处理。
## 10. 结果优先级
当多个终止原因竞争时,使用以下优先级:
```text
用户/父请求取消 > 工具超时 > 输出或协议边界 > 进程退出 > 普通工具错误
```
已经提交的正常终态不被稍后到达的取消覆盖。父请求进入终态后,迟到的子级文本和工具事件
只用于资源清理,不再写入会话。
## 11. 逻辑完整性评估
| 领域 | 结论 |
| --- | --- |
| Runtime 隔离 | 完整,工具只注入 `model` |
| Ask/Execute | 完整,清单过滤和调用边界双重检查 |
| 本机三平台 | 完整,统一契约和平台 Shell 决策已定义 |
| Subagent 递归 | 完整,深度固定为 1 |
| 取消与失败 | 完整,父子和进程传播及优先级已定义 |
| 产品对象 | 完整,遵循 Task/Job 权威模型 |
| SSH 远端执行 | 明确不在首版;未来必须增加 Agent 后端后才能开放 |
当前没有需要在实施前由用户补充的产品决策。
+185
View File
@@ -0,0 +1,185 @@
# 直连模型 Agent 能力 PRD
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,跨平台 CI 待验证 |
| 版本 | 0.2 |
| 日期 | 2026-09-01 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 关联领域 | [Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) |
## 1. 背景
GoodBuddy 直连模型已经可以读取、列出和写入工作区文本,使用浏览器、联网搜索、知识库及
分配的 MCP,但没有内置命令执行工具。模型可以生成代码,却不能运行构建、测试、格式化、
Git 或项目脚本,因此无法独立验证结果。
GoodBuddy 也已经有面向用户专家协作的只读 Subagent,但直连模型不能在自己的工具循环中
主动委派一个聚焦的编程子任务。OpenCode、Continue 和 DeepSeek Harness 一般已经提供
Shell、Agent 或 Task 能力,再向它们注入 GoodBuddy 同名工具只会造成重复入口和语义冲突。
本功能只补齐直连模型缺少的基础 Agent 能力:
1. 一个按平台适配的进程执行接口。
2. 一个单层、继承父请求范围的编程 Subagent 接口。
## 2. 产品目标
1. 让直连模型在 Execute 模式完成“读取代码 → 修改 → 运行 → 根据结果修正”的闭环。
2. 在 Windows、macOS 和 Linux 使用同一个模型工具契约,不要求模型调用平台专属工具名。
3. 让直连模型可以把独立工作委派给临时 Subagent,并取得有界、可核验的结果。
4. 保持 Ask 只读、Execute 完整授权、执行空间、取消、有界输出和进程回收语义不变。
5. 不向已有原生执行能力的 Agent Runtime 重复注入 GoodBuddy 进程或 Subagent 工具。
## 3. 核心产品决策
### 3.1 统一工具名,平台适配留在 Main
模型只看到 `process_execute`。GoodBuddy 根据当前平台选择 PowerShell、Bash 或 Sh,并在
工具描述和结果中明确实际 Shell。模型不需要在 Windows 调用 `powershell_execute`、在
macOS/Linux 改用 `bash_execute`。
### 3.2 它是内置能力,不依赖 MCP
进程生命周期、工作目录、取消和执行空间由 GoodBuddy 管理。用户仍可以配置提供其他命令
能力的 MCP,但直连模型的基本编程能力不依赖第三方 MCP 是否安装或在线。
### 3.3 Runtime 能力不重复注入
| Runtime | GoodBuddy `process_execute` | GoodBuddy `subagent_delegate` |
| --- | --- | --- |
| 直连模型 `model` | Execute 提供 | Ask/Execute 提供 |
| OpenCode | 不提供 | 不提供 |
| Continue | 不提供 | 不提供 |
| DeepSeek Harness | 不提供 | 不提供 |
“不提供”只表示不注入本功能工具,不限制 Runtime 自己的 Bash、PowerShell、Task、
Agent 或插件能力。
### 3.4 Subagent 继承,不扩权
Subagent 使用父请求的项目、执行空间、工作模式、直连模型连接和已启用能力快照:
- Ask 父请求只能创建 Ask Subagent。
- Execute 父请求创建 Execute Subagent。
- 子级不能切换项目、目录、Runtime、模型连接或工作模式。
- 子级不再看到 `subagent_delegate`,首版最大委派深度固定为 1。
- 子任务不是新的顶层 Task 或 Conversation,结果先返回父模型。
### 3.5 不新增权限档位
Ask 禁止命令和写入。Execute 是用户对当前执行空间账号的完整授权。进程和 Subagent 不增加
“受控执行”“仅测试”“可信命令”或逐命令风险等级,也不重复弹出第二套确认。
## 4. 功能范围
### 4.1 包含
- 本机 Windows、macOS、Linux 的前台 Shell 命令执行。
- 当前工作区默认工作目录及合法子目录选择。
- Exit Code、标准输出、标准错误、Shell、目录、耗时和截断状态。
- 命令超时、用户取消、进程树停止和应用退出清理。
- 新进程使用当前本机工具环境提供的 Node、Python 和 PATH。
- 直连模型单层 Subagent 委派、排队、运行、部分结果、失败和取消。
- 父子请求的工具、模型用量、活动和成果归属。
- 桌面聊天和选择直连模型的消息通道项目使用相同 Runtime 能力矩阵。
### 4.2 不包含
- 交互式 PTY、终端复用、持续 stdin、密码提示或 TUI 自动化。
- 后台守护进程、任意 PID 枚举、接管或停止用户已有进程。
- Shell Session 持久化,环境变更不会跨 `process_execute` 调用保留。
- 首版远程 SSH 直连模型进程执行。
- 向 OpenCode、Continue 或 DeepSeek Harness 注入本功能工具。
- 递归 Subagent、长期运行的自治 Agent、Workflow、Hook 或恢复未完成子任务。
- 新的权限矩阵、逐命令批准、沙箱档位或命令白名单。
- 自动安装项目依赖;模型可以在 Execute 中显式运行项目已有的安装命令。
## 5. 功能需求
### FR-1 直连模型专属可用性
- 两个工具只由 Runtime provider `model` 注册。
- Agent Runtime 切换为 OpenCode、Continue 或 DeepSeek Harness 后不再显示这两个工具。
- 图像生成连接不获得文本 Agent 工具。
- 能力不可用时返回准确原因,不以其他 Runtime 或本机 Shell 静默代替。
### FR-2 跨平台进程执行
- 使用统一的 `process_execute` 工具契约。
- Windows 选择 PowerShell;macOS/Linux 选择 Bash,Bash 不可用时可使用 POSIX Sh。
- 每次调用启动一个前台进程树,完成后返回结构化结果。
- 非零退出码是可观察的命令结果,不自动转成模型请求失败。
- Shell 启动失败、非法参数或执行后端不可用才属于工具失败。
### FR-3 工作目录和执行位置
- 默认目录是父请求当前工作区。
- 可选工作目录必须解析为当前工作区本身或其子目录。
- 本机执行只能发生在当前桌面执行空间。
- 当前请求绑定 SSH 执行空间且没有远端进程后端时不注册工具,绝不在桌面目录回退执行。
### FR-4 Ask/Execute
- Ask 工具清单不包含 `process_execute`。
- Runtime 边界必须再次拒绝 Ask 发起的伪造命令调用。
- Execute 命令使用 GoodBuddy 客户端当前用户权限,不声称 Runtime OS 沙箱。
- 消息通道的直连模型 Execute 继续服从该通道既有工具策略。
### FR-5 Subagent 委派
- `subagent_delegate` 接受一个清晰的任务说明,不要求用户预先创建专家。
- 子级默认使用父请求选择的直连模型连接。
- 子级继承父请求的工作模式和能力上限,但不获得再次委派能力。
- 子级最终输出、部分输出、错误、用量和状态返回父请求。
- 父模型负责综合结果并向用户作最终回答。
### FR-6 Subagent 领域归属
- 子任务使用 Job/Subjob 语义,不创建 Task Center 条目或独立 Conversation。
- UI 对象层级继续止于用户 Task;活动可以显示 Subagent 状态卡,但不显示 Job/Run 树。
- 子任务产生的工具、成果和用量可追溯到父请求及子任务标识。
### FR-7 生命周期和资源边界
- 父请求取消必须传播到活动 Subagent 和其当前进程。
- Runtime 替换、会话释放和应用退出必须停止 GoodBuddy 创建的活动子进程。
- 命令、标准输出、标准错误、Subagent 提示、结果、队列和并发全部有界。
- 截断必须明确标记,不能把不完整输出伪装为完整结果。
### FR-8 环境和凭据
- 新进程使用筛选后的当前用户环境和本机工具环境 PATH。
- 模型 Provider 凭据、GoodBuddy 加密设置和无关桌面会话变量不进入命令环境。
- 首版不接受模型提交任意环境变量映射;需要的普通变量由 Shell 命令在单次调用中设置。
### FR-9 状态与活动
- 进程活动显示等待、运行、成功、非零退出、超时、取消和失败。
- Subagent 显示排队、运行、完成、失败和取消。
- 命令和子任务失败保留可操作错误及已有部分输出。
- 同一事件不同时显示页内错误和应用通知。
### FR-10 兼容
- 现有模型连接、MCP 分配、专家设置和 Runtime 选择无需迁移。
- 不改变现有 Agent Runtime 的工具清单或权限语义。
- 不修改系统 PATH、Shell Profile 或用户终端会话。
## 6. 产品验收
- [ ] Windows 直连模型 Execute 使用 PowerShell 创建文件、运行测试并读取退出码。
- [ ] macOS/Linux 直连模型 Execute 使用 Bash/Sh 完成同一工作流。
- [ ] Ask 中模型看不到进程工具,伪造调用也在 Main 边界失败。
- [ ] 直连模型可以委派编程子任务,子级运行命令并把结果返回父模型。
- [ ] Ask Subagent 保持只读;Execute Subagent 不增加第二套批准。
- [ ] Subagent 不能递归委派,不能切换父请求工作区、模式或模型。
- [ ] 切换到 OpenCode、Continue 或 DeepSeek Harness 后不出现本功能工具。
- [ ] 非零退出、超时、取消和输出截断均准确展示。
- [ ] 取消父请求和退出应用后没有残留 GoodBuddy 命令进程。
- [ ] 本机工具环境选择对新命令生效,Main 持有的模型凭据不进入子进程。
- [ ] 子任务不进入 Task Center,不创建独立可导航 Conversation。
- [ ] 全量测试、类型检查、Lint 和生产构建通过。
@@ -0,0 +1,120 @@
# 直连模型 Agent 能力功能进度
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 文档类型 | 功能进度 |
| 状态 | 已实施,本机验收完成 |
| 版本 | 0.2 |
| 日期 | 2026-09-02 |
| 关联入口 | [直连模型 Agent 能力](./README.md) |
## 当前结论
本机生产路径已经完成源码接线:直连模型 Execute 可运行平台 Shell,Ask/Execute 均可按
父模式委派单层编程 Subagent;OpenCode、Continue、DeepSeek Harness 和托管 SSH 路径不注入
这两个工具。Windows 本机、真实模型和全量项目验证已通过;macOS 与 Linux 真机验证仍需
由对应平台完成。
## 已确认的当前基线
- [x] 直连模型当前内置工作区读、目录列表和文本写入,但没有进程工具。
- [x] 内置 MCP 当前没有 Shell;自定义 MCP 不能替代开箱即用的进程能力。
- [x] `ModelAgentRuntime` 已有多轮工具循环、取消、上下文压缩和有界结果。
- [x] DeepSeek Harness 已按 Windows PowerShell、macOS/Linux Bash 注册原生 Shell。
- [x] OpenCode 和 Continue 使用各自原生执行工具。
- [x] 当前专家 Subagent 是只读协作流程,不是直连模型可调用的编程工具。
- [x] Task/Job 领域文档已经明确 Subagent 不是新的顶层 Task 或 Conversation。
- [x] 当前跨平台进程树清理已经覆盖 Windows `taskkill /T /F` 和 POSIX 进程组。
## 已完成设计
- [x] 工具只注入直连模型,不注入 Agent Runtime。
- [x] 统一 `process_execute` 契约和三平台 Shell 决策。
- [x] Ask/Execute、执行空间、工作目录和非零退出规则。
- [x] 输出、超时、取消、环境和进程树边界。
- [x] 单层 `subagent_delegate`、继承规则、并发和结果模型。
- [x] 不创建 Child Task/独立 Conversation 的领域归属。
- [x] 设置能力目录、聊天活动、错误和无障碍行为。
- [x] 本机、真实模型和项目验证方案。
## 实施状态
### 阶段 1:进程服务
- [x] Shared 工具和 schema。
- [x] 本机 Shell 探测与能力状态。
- [x] 工作目录解析。
- [x] 跨平台前台进程、输出边界、超时和取消。
- [x] 当前筛选 PATH 和凭据环境过滤。
### 阶段 2:直连模型接入
- [x] `ModelToolProvider` 注册与调用。
- [x] Ask/Execute、Runtime target 和本机执行空间双重检查。
- [x] DeepSeek Harness、OpenCode 和 Continue 隔离。
- [x] 通用工具活动和“设置 > MCP > 直连模型”编程能力目录。
### 阶段 3:编程 Subagent
- [x] 编程 Subagent 服务和同 Provider 深度过滤。
- [x] 父子模式、模型、执行空间和能力继承。
- [x] 深度、全局并发、队列、超时和取消。
- [x] 新 Subagent actor 契约和旧专家事件兼容读取。
- [x] 用量、部分输出、实时活动和终态归并。
### 阶段 4:端到端验收
- [x] Windows PowerShell 真实命令。
- [ ] macOS Bash/Sh 真实命令。
- [ ] Linux x64/arm64 Bash/Sh 真实命令。
- [x] 直连模型“修改 → 测试 → 修复”真实闭环。
- [x] 假模型端到端 Subagent 编程委派、真实本机命令和父模型综合。
- [x] 真实模型 Subagent 编程委派和父模型综合。
- [x] Runtime 隔离、取消、会话释放和进程树回收聚焦测试。
- [x] 全量测试、类型检查、Lint 和生产构建。
## 当前阻塞项
- 当前没有实现阻塞项。
- 本机工具环境仍处于计划阶段;在其实施前,进程工具可以使用当前筛选 PATH,但不能宣称
GoodBuddy 托管 Node/Python 已可用。
- 远端直连模型进程执行不在首版,后续需要独立增加 Agent 进程协议和真机验证。
## 2026-09-01 至 2026-09-02 实施与验证证据
- 新增 `direct-model-process-service.ts`:PowerShell/Bash/Sh 探测、工作区目录校验、96 KiB
首尾输出、超时、取消、进程树回收和环境过滤。
- 新增 `direct-model-subagent-service.ts`:单层委派、共享并发 3、队列 20、10 分钟上限、
192 KiB 输出、父请求取消和临时会话释放。
- `ModelToolProvider` 只在直连模型上下文注册工具;Ask 隐藏进程工具,深度 1 隐藏委派工具,
远端工作区拒绝本机进程。
- `ModelAgentRuntime` 复用同一已解析模型和 Tool Provider 运行子级,并把子级工具、用量和
Subagent 活动实时归并到父请求。
- 新 actor 联合类型兼容既有专家/OpenCode 记录;编程 Subagent 不创建 Assistant Task。
- 聚焦验证:
- 进程、Provider、Runtime、共享契约与聊天 UI:`290 passed, 1 skipped`。
- 设置与 Runtime 隔离:`216 passed`。
- Main/Shared 聚焦持久化与 Subagent:`188 passed, 1 skipped`。
- Node 与 Web TypeScript no-emit 检查通过。
- 假模型端到端场景实际启动 Windows PowerShell,子级运行命令后返回父模型;该场景的
Runtime 模型调用数为 4 次。
- 真实 DeepSeek 兼容连接端到端通过:模型创建失败程序、观察非零退出、修复并观察退出码
0、委派编程 Subagent 再次运行最终程序并综合结果;最终源码成功验收运行包含 8 次真实
模型调用。
- BigToken 连接的首次验收在 TLS 建立前被 `ECONNRESET` 中断,未进入模型工具路径;切换
到仓库已有的 DeepSeek 连接后完成验证。
- 全量 `npm test`:`3410 passed, 50 skipped`。
- `npm run typecheck`:通过。
- `npm run lint`:通过。
- `npm run build`:Main、Preload、Renderer 和控制面安装器均成功构建。2026-09-02 按产品
决策移除未对应实际性能问题的 Renderer bundle 基线门禁后复验通过。
## 进度维护要求
- 只有真实生产路径完成并验证后才能勾选实施项。
- 平台模拟单元测试不能替代对应平台真实命令测试。
- 真实模型验证必须记录准确调用次数且不得记录凭据。
- 需求变化回写 PRD、User Stories 和功能逻辑;实现事实只写本文件。
@@ -0,0 +1,398 @@
# 直连模型 Agent 能力技术设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施 |
| 版本 | 0.2 |
| 日期 | 2026-09-01 |
| 关联 PRD | [PRD](./prd.md) |
| 功能逻辑 | [功能逻辑设计](./logic-design.md) |
| 相关架构 | [助手工作栏与执行空间](../assistant-workbar/prd.md)、[本机工具环境](../local-tool-environment/technical-design.md) |
## 1. 实现基线
当前源码已经实现:
- `ModelAgentRuntime` 的多轮工具调用、上下文压缩、取消、用量和有界结果处理。
- `ModelToolProvider` 的直连模型内置工具、浏览器、Web、知识和自定义 MCP 聚合。
- `WorkspaceAccess` 的本机和远端工作区抽象。
- 跨平台子进程树终止辅助函数。
- 面向用户专家协作的 `SubagentScheduler`、状态事件和只读模型调用。
- OpenCode、Continue 和 DeepSeek Harness 各自的 Shell/Agent 能力。
- 直连模型 `process_execute` 和 `subagent_delegate`。
- 不创建顶层 Task/Conversation 的编程 Subagent actor 与活动归并。
## 2. 总体架构
```text
ModelAgentRuntime
└─ ModelToolProvider
├─ WorkspaceAccess
├─ DirectModelProcessService
│ └─ LocalDirectModelProcessService
├─ DirectModelSubagentService
│ ├─ SubagentScheduler
│ └─ 同一 ModelAgentRuntime 的临时子会话
│ └─ 同一 ModelToolProvider(delegationDepth=1 时移除委派)
├─ Browser / Web / Knowledge
└─ assigned MCP
```
OpenCode、Continue 和 DeepSeek Harness 的创建路径不接收
`DirectModelProcessService` 或 `DirectModelSubagentService`。DeepSeek Harness 即使继续使用
`ModelToolProvider` 代理 Web/MCP,也必须通过明确的工具视图排除直连模型专属工具。
## 3. 共享工具目录
`BuiltinModelToolSummary` 增加 `programming` 分组和 Runtime 可见性:
```ts
type BuiltinModelToolSummary = {
name: string
displayName: string
description: string
access: 'read' | 'write'
group: 'filesystem' | 'browser' | 'web' | 'programming'
}
```
`process_execute` 标记为 `write`,只在 Execute 清单中出现。
`subagent_delegate` 的实际访问级别由父模式决定:
- Ask 清单中提供只读委派定义。
- Execute 清单中提供继承 Execute 的定义。
- `callTool` 不依赖静态 `access` 单独授权,必须检查父请求上下文。
工具总数和 schema 总字节继续计入直连模型现有 100 个工具与 512 KiB 上限。
## 4. 进程工具契约
### 4.1 输入
```ts
const processExecuteInputSchema = z.object({
command: z.string().trim().min(1).max(100_000),
cwd: z
.string()
.trim()
.min(1)
.max(4_096)
.optional(),
timeoutMs: z
.number()
.int()
.min(1_000)
.max(10 * 60_000)
.default(120_000)
}).strict()
```
- `cwd` 只接受相对工作区路径。
- 首版不接受 `env`、`stdin`、`background`、`pty`、`shell` 或任意 executable 参数。
- Shell 选择由执行后端决定,防止模型绕过平台契约启动另一套受管接口。
- 命令字符串仍可以调用当前账号本来有权运行的程序;Execute 不增加命令白名单。
### 4.2 结果
```ts
type ProcessExecuteResult = {
shell: {
kind: 'powershell' | 'bash' | 'sh'
label: string
}
cwd: string
exitCode: number | null
signal?: string
terminationReason?: 'timeout' | 'cancelled'
durationMs: number
stdout: string
stderr: string
stdoutTruncated: boolean
stderrTruncated: boolean
}
```
`cwd` 返回工作区相对显示值,不把不必要的绝对用户路径送入模型上下文。Shell 在模型结果
中只返回稳定标签;绝对可执行路径只进入 Main 诊断状态。
### 4.3 输出边界
- stdout 和 stderr 各最多 96 KiB。
- 超限时分别保留前 48 KiB 与最后 48 KiB,中间插入固定截断标记。
- JSON 结果加上元数据后必须低于 `ModelToolProvider` 现有 256 KiB 工具结果上限。
- 流式读取在收到数据时执行边界,不先积累无界 Buffer。
- 输出按 UTF-8 解码,无效序列使用替换字符并保留字节计数。
## 5. 平台执行
### 5.1 Shell 探测
启动直连模型执行服务时解析一次 Shell:
```text
Windows: PATH 中 pwsh → Windows PowerShell powershell.exe
macOS: /bin/bash → /bin/sh
Linux: /bin/bash → /bin/sh
```
Shell 不可用时保留直连模型对话能力,但不注册 `process_execute`。设置目录继续展示静态能力
说明,实际 Shell 通过每次请求的工具定义和结果可见;当前不增加独立 Shell 诊断 IPC。
不下载或捆绑新的 Bash/PowerShell。
### 5.2 启动参数
```text
PowerShell:
<shell> -NoLogo -NoProfile -NonInteractive -Command <command>
Bash:
/bin/bash -c <command>
Sh:
/bin/sh -c <command>
```
使用 `spawn(executable, args, { shell: false })`,避免 Node 再增加一层平台 Shell。POSIX 子进程
作为独立进程组启动;Windows 记录根 PID。停止时复用现有
`terminateProcessTreeAndWait`:Windows 使用 `taskkill /T /F`,POSIX 终止本次进程组并等待
有界退出。
### 5.3 环境
进程环境由 Main 构造:
- 继承运行普通项目命令所需的当前用户基础变量。
- 当前使用筛选后的用户 PATH;[本机工具环境](../local-tool-environment/technical-design.md)
实施后可通过现有 `toolBinDirectory` 注入口把受管 bin 放在 PATH 前面。
- 排除模型 Provider Key、GoodBuddy 加密设置、调试变量和无关应用凭据。
- 不修改 `process.env`,不写系统 PATH 或 Shell Profile。
- 每次调用得到独立环境快照;命令内设置的变量不会进入下一次调用。
## 6. 执行空间绑定
定义一个小型进程后端接口,不把任意进程能力塞进 `WorkspaceAccess`:
```ts
interface ExecutionSpaceProcessExecutor {
getCapability(): Promise<
| { available: true; shell: ProcessShellSummary }
| { available: false; reason: string }
>
execute(
input: ProcessExecuteInput,
context: {
workspace: WorkspaceAccess
signal: AbortSignal
}
): Promise<ProcessExecuteResult>
dispose(): Promise<void>
}
```
首版只有 `LocalProcessExecutor`。`ExecutionSpaceDescriptor.kind === 'ssh'` 时使用不可用实现,
工具清单不注册进程能力。未来远端实现必须新增 Agent 协议、由 Agent 直接拥有命令进程,并
按远端身份、取消和断线语义验证;不得把 SSH 路径传给本机 executor。
工作目录通过 `WorkspaceAccess.getIdentity()` 和本机真实路径解析共同确认。路径检查与 spawn
之间若目录被外部替换,spawn 失败并返回准确错误;不为此增加持久路径凭据或恢复协议。
## 7. Subagent 工具契约
### 7.1 输入
```ts
const subagentDelegateInputSchema = z.object({
task: z.string().trim().min(1).max(100_000)
}).strict()
```
首版一次调用只创建一个子任务。不同父请求可以通过全局调度器并发,不增加批量委派 schema。
### 7.2 子请求
`DirectModelSubagentService` 创建临时子请求:
```ts
type DirectModelSubagentContext = {
parentRequestId: string
childRunId: string
projectId?: string
conversationId: string
workMode: 'ask' | 'execute'
}
```
- 子 `conversationId` 只用于 Runtime 内存和工具会话隔离,完成后立即
`releaseConversation`,不保存为用户 Conversation。
- 子 Prompt 使用明确任务和 Main 可信的编程 Subagent 指令,不复制父会话历史。
- 子级使用父请求模型连接,首版不增加单独模型选择设置。
- 子级复用父请求已授权能力快照和知识范围。
- 子级复用父 Provider;Main 写入的 `delegationDepth=1` 同时在清单和调用边界过滤
`subagent_delegate`。
- Ask 子级使用 Ask 清单;Execute 子级使用 Execute 清单。
### 7.3 调度和结果
- 复用 `SubagentScheduler` 的取消、并发和队列模式。
- 全局最大并发 3,队列最大 20。
- 单个子任务最长 10 分钟;父请求更早取消时立即停止。
- 文本结果最多 192 KiB,错误最多 2 KiB,连同结构化字段保持在 256 KiB 工具结果上限内。
- 模型用量逐事件归属父请求和 `childRunId`,不能只算入父模型最后一轮。
- 子级失败和取消返回结构化终态及部分输出,让父模型决定下一步。
### 7.4 领域持久化
当前 `SubagentService` 为历史专家流程创建隐藏 Child Task。新编程 Subagent 不复制该行为:
- 运行身份使用内部 `childRunId`。
- 父消息通过现有 `subagent` 活动块保存终态和结果摘要。
- 若通用 Job/Subjob 表已经实现,则记录为所属父 Task/请求的 Subjob/Run。
- 若通用 Job/Subjob 表尚未实现,首版只保存现有消息活动和模型用量,不先创建另一套持久
子任务表、恢复日志或兼容读取器。
可以提取现有 Scheduler、事件归并和用量转发逻辑,但不能把旧数据库字段当成新的产品模型。
## 8. ModelToolProvider 接入
`ModelToolCallContext` 增加不可伪造的运行上下文:
```ts
type ModelToolCallContext = {
conversationId: string
requestId: string
runtimeTarget: 'model'
workMode: 'ask' | 'execute'
executionSpaceIdentity: string
delegationDepth: 0 | 1
knowledgeCapabilityToken?: string
}
```
要求:
- `listTools` 根据模式、执行空间能力和深度生成快照。
- `getApproval` 不为两个工具创建第二套逐次确认;沿用父 Execute 授权和现有通道工具策略。
- `callTool` 再次检查 `runtimeTarget`、模式、执行空间 identity、深度和请求是否活动。
- `releaseConversation` 取消并释放该会话拥有的浏览器、Subagent 和进程。
- `dispose` 等待有界清理,不因模型或子进程不响应而阻塞应用退出。
DeepSeek Harness 的 Main 工具代理必须使用仅包含分配 MCP 和 Web 的 Provider 视图,不能因为
共享 `ModelToolProvider` 类而自动看到直连模型编程工具。
## 9. 事件与活动
### 9.1 进程事件
继续使用现有 Runtime `tool` 事件:
- `pending`:参数已接收。
- `running`:Shell 已成功启动。
- `completed`:返回 exit 0 或非零退出结果。
- `failed`:启动或契约失败。
- `cancelled`:父请求取消。
结果摘要包含 Shell、相对目录、退出码、耗时和截断标记。完整有界 stdout/stderr 进入工具
输出字段,不写应用诊断日志。
### 9.2 Subagent 事件
复用现有 `subagent` 公开事件和消息块,增加 `routingMode: 'native'` 表示模型主动委派。
`expertId` 不再作为编程 Subagent 必填身份;共享 schema 应改为执行者 discriminated union,
而不是伪造一个专家记录:
```ts
type SubagentActor =
| { kind: 'expert'; expertId: string; expertName: string }
| { kind: 'direct-model'; label: '编程 Subagent' }
```
迁移只需让读取器接受旧专家事件和新联合类型,不重写既有消息。
## 10. 错误处理
| 情况 | 结果 |
| --- | --- |
| 命令非零退出 | 正常 `ProcessExecuteResult` |
| 命令不存在 | Shell 非零退出及 stderr |
| Shell 无法启动 | 工具失败 |
| cwd 无效或越界 | 工具调用前失败 |
| 超时/取消 | 终止进程树,返回已有输出和原因 |
| 子级模型失败 | 返回 `failed`、部分输出和错误 |
| 子级工具失败 | 由子模型处理;最终无法完成时返回子级失败 |
| 父请求已终止 | 拒绝新调用,丢弃迟到内容并清理 |
不要用宽泛 catch 抹掉取消、超时、Provider HTTP 状态或进程退出上下文。
## 11. 性能
- Shell 探测按执行服务实例缓存,不在每轮模型调用重复探测。
- stdout/stderr 边读边界定,避免大日志进入内存后再截断。
- 子级共享父请求已解析的模型配置和工具服务,不复制 MCP 配置或持久状态。
- 不增加持久 Shell、后台 daemon、工作区快照或恢复状态机。
- 命令执行不使用 PTY,避免普通构建和测试承担终端渲染成本。
## 12. 测试策略
### 12.1 单元测试
- 工具可见性矩阵和 Runtime target 过滤。
- Ask 伪造进程调用拒绝。
- Windows PowerShell、POSIX Bash/Sh 选择和参数。
- cwd 默认、合法子目录、越界、符号链接越界和不存在。
- exit 0、非零退出、spawn 失败、超时、取消和输出截断。
- 环境筛选、本机工具 PATH 优先且模型凭据不进入进程。
- 子级模式、模型、项目、执行空间和能力继承。
- 深度 1 过滤、并发 3、队列 20、取消传播和部分输出。
- 编程 Subagent 不创建 Task/Conversation。
- DeepSeek Harness/OpenCode/Continue 不获得本功能工具。
### 12.2 本机集成测试
- Windows PowerShell 创建临时文件、运行 Node/Python、非零退出和进程树取消。
- macOS/Linux Bash/Sh 执行相同场景。
- 直连模型工具循环执行“修改 → 测试失败 → 修复 → 测试通过”。
- 父模型委派子级修改或验证专用临时项目,并正确综合结果。
- Runtime 切换后工具清单刷新且没有重复 Shell。
- 应用退出后无残留 GoodBuddy 命令进程。
所有测试只在专用临时工作区创建文件,不删除或覆盖用户工作。
### 12.3 真实模型验证
使用一个最小真实直连文本模型请求:
1. Execute 创建一段有缺陷的小程序。
2. 调用进程工具运行聚焦测试并观察失败。
3. 修改程序并再次运行到通过。
4. 委派一个 Subagent 检查实现或补充测试。
5. 父模型读取子级结果并给出最终结论。
每个平台一次完整场景即可,不进行批量或高成本调用。记录准确模型调用次数,不记录 API Key。
### 12.4 项目验证
源码完成后运行:
```text
npm test
npm run typecheck
npm run lint
npm run build
```
跨平台进程实现必须由 Windows、macOS、Linux x64 和 Linux arm64 CI 验证。首版不改变
GoodBuddy Agent 或桌面到 Agent 生产路径,因此不要求远端 Host 验证;未来增加远端 executor
时必须按远程主机技术设计执行共享 Linux Host 真机验证。
## 13. 实施顺序
1. Shared 工具摘要、schema 和 Runtime target 过滤。
2. 本机 Shell 探测、进程执行、输出边界和进程树取消。
3. `ModelToolProvider` Execute 接入及 UI 活动。
4. 编程 Subagent 服务、过滤 Provider、事件和用量。
5. 设置能力目录与状态诊断。
6. 三平台真实命令、真实模型和完整项目验证。
每一步都必须保持直连模型正常问答可用;Shell 不可用不能阻止普通对话。
@@ -0,0 +1,134 @@
# 直连模型 Agent 能力 UI 设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施 |
| 版本 | 0.2 |
| 日期 | 2026-09-01 |
| 设计系统 | [GoodBuddy 统一界面设计系统](../../../UI-DESIGN.md) |
| 关联 PRD | [PRD](./prd.md) |
| 关联逻辑 | [功能逻辑设计](./logic-design.md) |
## 1. 信息架构
本功能不增加一级页面、Composer 按钮或 Runtime 专属工具栏。用户主要通过三处理解能力:
1. **设置 > MCP > 直连模型**:查看内置编程能力说明。
2. **聊天消息活动块**:查看命令和 Subagent 的实时状态与结果。
3. **运行记录**:按当前 Conversation 或 Task 查看聚合执行活动。
Job、Subjob 和 Run 继续是内部对象,不创建树形 UI、独立路由或操作菜单。
## 2. 设置中的能力目录
在现有直连模型工具目录增加“编程能力”分组:
```text
编程能力
进程执行
使用当前工作区和当前用户权限运行 PowerShell/Bash 命令。
编程 Subagent
将聚焦任务委派给同一模型连接;继承当前工作模式和工作区。
```
要求:
- 两项默认属于直连模型,不提供持久 Switch。
- 设置目录只定义稳定工具能力,不增加 Shell 状态或重试控件;实际 Shell 标签在模型工具
定义和进程结果中返回。
- Runtime 是 OpenCode、Continue 或 DeepSeek Harness 时,不在其原生能力清单中伪造这两项;
用户需要理解差异时,在直连模型分组说明“Agent Runtime 使用自身工具”。
- 不把模型配置检查成功描述为命令或 Subagent 已经通过真实执行验证。
## 3. 进程活动块
复用现有对话工具活动视觉和语义,不创建页面专属卡片系统。
### 3.1 标题与摘要
```text
进程执行
PowerShell · packages/app · npm test
```
- 命令只显示单行有界摘要,完整参数进入可展开详情。
- 目录显示工作区相对路径;工作区根显示 `.`。
- 不在摘要中显示完整环境或凭据。
### 3.2 状态
| 状态 | 文案 |
| --- | --- |
| pending | 等待运行 |
| running | 正在运行 |
| completed,exit 0 | 已完成 |
| completed,exit 非零 | 工具已完成,详情显示退出码 N |
| timeout | 工具已完成,详情显示 timeout |
| cancelled | 父请求活动显示已取消 |
| failed | 启动失败 |
状态必须同时有文字和状态图标,不能只依靠颜色。非零退出属于正常结构化工具结果,不显示为
GoodBuddy 服务崩溃。
### 3.3 结果详情
详情按以下顺序展示:
1. Shell、工作目录、耗时和退出码。
2. stdout。
3. stderr。
4. 截断提示。
日志使用共享等宽字体和可选择文本。长输出在活动块内折叠,展开后仍保持工作栏和聊天布局
可用;不把完整日志复制为应用通知。
## 4. Subagent 活动块
复用现有 `subagent` 消息块,并将系统执行者显示为“编程 Subagent”,不要求用户预先创建
专家。
```text
编程 Subagent
检查认证模块的测试失败并提出修复
正在运行 · 直连模型 · Execute
```
终态:
- 完成:显示有界结果摘要,可展开查看完整返回。
- 失败:保留部分输出和错误。
- 取消:显示“父请求已取消”或准确取消原因。
- 排队:显示当前处于并发队列,不显示虚假百分比。
活动块不提供单独的“批准”“提高权限”或“继续递归”按钮。用户取消父请求即可取消子级。
## 5. Ask/Execute 表达
- Ask 中不显示不可用的进程按钮,因为模型工具没有手动调用入口。
- Ask Subagent 活动明确显示“只读”。
- Execute 活动显示“当前用户权限”,不声称 OS 沙箱或工作区隔离。
- 如果用户从 Ask 切到 Execute,只有下一条请求使用新模式;运行中的 Subagent 不切换。
## 6. 错误与通知
- 参数错误、命令退出、Subagent 失败和部分输出属于当前活动上下文,保留在对应活动块。
- Runtime 初始化、Shell 探测或全局服务失败可通过应用通知提示,并在设置状态卡提供重试。
- 同一错误不同时显示活动块副本和通知副本。
- 失败后保留用户 Prompt、命令摘要、工作目录和已有输出。
## 7. 键盘与无障碍
- 活动块展开按钮使用原生 `button`,提供 `aria-expanded` 和关联详情 ID。
- 状态变化通过现有活动区域的礼貌级 live region 发布,不逐个朗读流式日志。
- stdout/stderr 区域具有可见标签,不能只靠顺序区分。
- 焦点不会因后台状态更新自动移动。
- 取消父请求后的焦点保持在原取消按钮或恢复到 Composer。
- 浅色、深色和减少动态效果模式遵守统一设计系统。
## 8. 响应式
- 窄聊天区只保留工具名、状态和一行摘要,元数据换行到下一行。
- 日志区域横向滚动,不撑宽页面。
- 运行记录使用紧凑摘要,不复制完整 stdout/stderr;用户回到聊天活动块展开查看详情。
@@ -0,0 +1,168 @@
# 直连模型 Agent 能力 User Stories
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,跨平台 CI 待验证 |
| 版本 | 0.2 |
| 日期 | 2026-09-01 |
| 关联 PRD | [直连模型 Agent 能力 PRD](./prd.md) |
| 关联逻辑 | [功能逻辑设计](./logic-design.md) |
## 1. 角色
### 1.1 普通项目用户
希望模型直接完成脚本、文档生成或数据处理,不关心不同平台的 Shell 名称。
### 1.2 开发者
希望直连模型能够修改代码、运行测试、检查 Git 状态并根据失败结果继续修正。
### 1.3 Runtime 用户
已经使用 OpenCode、Continue 或 DeepSeek Harness,希望继续使用 Runtime 原生能力,不看到
重复的 GoodBuddy Shell 或 Subagent。
## 2. Epic A:跨平台执行
### US-A1 在 Windows 运行项目命令
关联:FR-2、FR-3、FR-4。
Given 当前项目位于 Windows 本机且选择直连模型 Execute,When 模型调用
`process_execute`,Then GoodBuddy 使用可用 PowerShell 在项目目录运行命令,并返回
Shell、目录、退出码、输出和耗时。
### US-A2 在 macOS/Linux 运行项目命令
关联:FR-2、FR-3。
Given 当前项目位于 macOS 或 Linux 本机,When 模型运行同一工具,Then GoodBuddy 使用
Bash,Bash 不可用时使用 Sh,工具契约保持不变且实际 Shell 明确可见。
### US-A3 使用工作区子目录
关联:FR-3。
Given 项目包含多个包,When 模型传入工作区内相对目录,Then 命令在该目录执行;When
路径越出工作区、不是目录或不存在,Then 命令不启动并返回准确错误。
### US-A4 根据非零退出继续修正
关联:FR-2、FR-9。
Given 测试命令退出码非零,When 进程结束,Then 工具正常返回退出码和 stderr,而不是终止
整个模型请求,And 模型可以读取失败原因、修改代码并再次运行。
### US-A5 取消长命令
关联:FR-7。
Given 命令仍在运行,When 用户取消父请求,Then 当前 Shell 及其由本次命令创建的子进程树
停止,And 活动状态显示“已取消”,And 其他用户进程不受影响。
### US-A6 看懂截断结果
关联:FR-7、FR-9。
Given 命令输出超过上限,When 工具返回结果,Then 保留有用的开头和结尾并明确
`truncated: true`,And 模型与用户都不会把结果理解为完整日志。
## 3. Epic B:编程闭环
### US-B1 修改后运行验证
关联:FR-2、FR-4。
Given 用户选择 Execute 并要求修复代码,When 直连模型修改文件,Then 它可以运行聚焦测试
或检查命令,并根据真实结果继续修改,直到给出完成或阻塞结论。
### US-B2 使用本机工具环境
关联:FR-8、FR-10。
Given 用户选择了 GoodBuddy 托管或自定义 Node/Python,When 新命令调用 `node`、`npm`、
`npx`、`python` 或 `pip`,Then 它们解析到当前工具环境,And 不修改系统 PATH 或已有终端。
### US-B3 依赖或命令不存在
关联:FR-2、FR-9。
Given 项目缺少所需命令或依赖,When Shell 返回错误,Then 工具保留退出码和错误文本,
And 模型说明缺失项或在 Execute 中采取用户要求的安装步骤,不把环境缺失报告为模型故障。
## 4. Epic C:Subagent 委派
### US-C1 委派聚焦编程任务
关联:FR-5、FR-6。
Given 父直连模型正在处理复杂请求,When 它调用 `subagent_delegate` 并给出独立任务,
Then 子级使用同一项目、模型连接和 Execute 能力完成工作,And 最终结果返回父模型综合。
### US-C2 Ask 中只读委派
关联:FR-4、FR-5。
Given 父请求为 Ask,When 模型委派分析任务,Then 子级保持 Ask,不能写文件或运行命令,
And 不因 Subagent 存在而扩大权限。
### US-C3 禁止递归委派
关联:FR-5、FR-7。
Given 子级正在执行,When 它读取自己的工具清单,Then 清单中没有
`subagent_delegate`,And 子级不能创建孙级任务。
### US-C4 子级失败后父级继续
关联:FR-5、FR-9。
Given 子级运行期间失败或超时,When 子任务结算,Then 父模型收到失败状态、部分输出和
有界错误,And 可以自行继续、改变方案或向用户说明阻塞。
### US-C5 取消传播
关联:FR-7。
Given 一个 Subagent 正在运行模型或命令,When 用户取消父请求,Then 排队和运行中的子级
全部取消,当前命令进程树停止,And 不再向父请求追加迟到结果。
### US-C6 保持产品对象简单
关联:FR-6。
Given 直连模型完成一次委派,When 用户查看会话、Task Center 和活动,Then 会话内可看到
Subagent 状态与结果摘要,And Task Center 不出现新的子 Task,And UI 不展示 Job/Run 树。
## 5. Epic D:Runtime 与执行空间边界
### US-D1 Agent Runtime 不重复获得工具
关联:FR-1、FR-10。
Given 用户选择 OpenCode、Continue 或 DeepSeek Harness,When Runtime 启动,Then
GoodBuddy 不注入 `process_execute` 或 `subagent_delegate`,And Runtime 原生能力保持不变。
### US-D2 切换 Runtime 后工具清单更新
关联:FR-1。
Given 会话从直连模型切换为 Agent Runtime,When 下一次请求开始,Then 新请求只使用目标
Runtime 的能力;切回直连模型时重新获得符合工作模式的直连工具。
### US-D3 不在错误设备执行
关联:FR-3。
Given 当前执行空间是 SSH 且远端进程后端尚不可用,When 解析工具清单,Then 不注册
`process_execute`;即使调用参数有效,也不能回退到桌面本机执行。
### US-D4 消息通道使用相同规则
关联:FR-1、FR-4。
Given 消息通道项目选择直连模型,When 合法消息触发 Ask 或 Execute,Then 使用与桌面会话
相同的工具矩阵和通道既有工具策略,不维护第二套 Shell 能力配置。
@@ -0,0 +1,11 @@
# 文档处理
文档处理负责聊天附件和知识库导入中的文本提取、格式转换与本地 OCR。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [文档解析与本地 OCR PRD](./prd.md) | 产品范围、解析策略、OCR 模型管理和验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
+11
View File
@@ -0,0 +1,11 @@
# 全双工语音
全双工语音定义持续听说、打断、语音活动检测、本地与远端推理以及多平台音频边界。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [技术设计](./technical-design.md) | 产品目标、交互流程、音频架构、模型、打包和实施状态 |
现有文档是综合设计,尚未按 PRD、User Stories、功能逻辑、UI 和进度职责拆分。
@@ -10,7 +10,7 @@
| 日期 | 2026-08-19 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 相关基线 | [跨平台助手产品设计](../design/cross-platform-assistant-product-design.md)、[长期助手路线图](../roadmap/long-term-assistant-roadmap.md)、[统一界面设计系统](../../UI-DESIGN.md) |
| 相关基线 | [长期助手路线图](../../roadmap/long-term-assistant-roadmap.md)、[统一界面设计系统](../../../UI-DESIGN.md) |
本文定义 GoodBuddy 中类似自然通话的全双工实时语音能力,包括本地与云端语音引擎、
音频平面、会话状态、打断语义、工具审批、数据留存、失败恢复、跨平台交付和验收指标。
@@ -831,7 +831,7 @@ Endpoint 不能因为 URL 相似就被标记为实时语音。
- 本地模块化引擎作为 Windows、macOS、Linux x64/arm64 的统一功能基线。
- 在线 ASR、VAD 和轻量 TTS 权重不内置,继续使用按需下载和 ZIP 离线迁移。
- GoodBuddy 托管模型的下载遵守
[平台功能页签与模型下载源设计](./model-download-source-design.md),使用用户显式选择的
[平台功能页签与模型下载源设计](../../architecture/model-download-source-design.md),使用用户显式选择的
ModelScope 或 Hugging Face,失败时不切换来源。
- 云端 Adapter 在六个平台复用同一契约,并分别验证 Electron WebRTC/WebSocket 行为。
- 本地原生引擎按 Adapter 声明平台与硬件,不伪装成全平台能力。
+11
View File
@@ -0,0 +1,11 @@
# 应用内反馈
应用内反馈负责用户在 GoodBuddy 中提交反馈、附带受控诊断并获得提交状态。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [技术设计](./technical-design.md) | 产品流程、数据边界、接口、UI 接入和验收 |
现有文档是综合设计,尚未按标准职责拆分。
@@ -10,7 +10,7 @@
| 日期 | 2026-08-25 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 相关基线 | [统一界面设计系统](../../UI-DESIGN.md)、[GoodBuddy 文档导航](../README.md) |
| 相关基线 | [统一界面设计系统](../../../UI-DESIGN.md) |
本文定义 GoodBuddy 桌面端的应用内反馈入口、数据边界、Renderer / Preload /
Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平台服务端、管理后台、
@@ -45,8 +45,9 @@ Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平
以此保证幂等;创建另一条反馈时才生成新 ID。
10. GoodBuddy 使用单独的随机安装 UUID 做服务端限流。该 UUID 不得复用 Agent
installation ID、硬件 ID、机器名、用户名、项目 ID 或任何设备指纹。
11. 默认不发送对话、提示词、模型回复、日志、文件、项目或工作区路径、知识库、模型配置、
Runtime 配置、API Key、Token、Cookie、SSH 信息、剪贴板或屏幕内容。
11. 默认不发送对话、提示词、模型回复、诊断、日志、文件、项目或工作区路径、知识库、模型
配置、Runtime 配置、API Key、Token、Cookie、SSH 信息、剪贴板或屏幕内容。用户可通过
默认关闭的 Checkbox 主动附加有界的最近桌面诊断摘要。
12. 反馈提交失败时保留全部表单内容和截图,成功后显示可复制的服务端反馈编号。
13. 首版不提供反馈历史、状态查询、编辑、撤回、自动日志收集或服务端管理入口。
14. 生产接口固定为 `https://imp.mesalogo.com/api/v1/feedback`。域名健康检查、
@@ -79,7 +80,8 @@ Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平
- GitHub Issue 创建、GitHub Token 或 GitHub 网页附件上传。
- GoodBuddy 内的管理员后台、处理状态修改或内部备注。
- 用户账户、登录、反馈列表、远程状态查询或推送通知。
- 自动附加当前对话、日志、错误堆栈、项目、文件、模型或 Runtime 信息。
- 自动附加当前对话、桌面诊断、日志、错误堆栈、项目、文件、模型或 Runtime 信息。
- 远端 Agent 日志或通用日志、诊断包和附件框架。
- 自动截取全屏、当前窗口、浏览器、远程桌面或其他应用窗口。
- 多截图、视频、录屏、任意文件附件或压缩包。
- 离线队列、后台自动重试、指数退避、跨重启草稿或发送历史。
@@ -113,16 +115,23 @@ Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平
- 使用体验:`experience`
- 其他:`other`
2. **标题**,必填,1 至 120 字符。
3. **详细描述**,必填,去除首尾空白后 10 至 5,000 字符。
4. **联系邮箱**,可选,最多 254 字符。
5. **截图**,可选,最多一张,支持选择 PNG/JPEG/WebP 或在对话框中粘贴图片。
6. **将发送的信息**,只读显示应用版本、系统、架构和界面语言。
7. **隐私说明**,紧邻提交操作。
3. **详细描述**,必填,去除首尾空白后 10 至 5,000 字符;选择桌面诊断时为摘要预留空间,
用户描述上限为 3,398 字符。
4. **附加最近桌面诊断记录**,可选的原生 Checkbox,默认关闭。
5. **联系邮箱**,可选,最多 254 字符。
6. **截图**,可选,最多一张,支持选择 PNG/JPEG/WebP 或在对话框中粘贴图片。
7. **将发送的信息**,只读显示应用版本、系统、架构和界面语言。
8. **隐私说明**,紧邻提交操作。
隐私说明使用明确文案:
> 将发送反馈类型、标题、描述、可选邮箱、GoodBuddy 版本、操作系统、架构、界面语言,
> 以及你主动添加的截图。不会自动发送对话、日志、文件、项目路径、模型配置或凭据。
> 以及你主动添加的截图。默认不上传桌面诊断;只有勾选后才会把有界诊断摘要追加到描述。
> 不会发送对话、Prompt、凭据、文件内容、路径、Provider 原始响应或远端 Agent 日志。
Checkbox 下方持续说明:诊断摘要只含时间、组件、阶段、稳定错误码、错误类型和固定短消息。
Renderer 不预览、不读取也不接收诊断内容或路径。勾选后详细描述上限为 3,398 字符,为附加
摘要预留 1,600 字符以及分隔换行;超长草稿保留在表单中并显示字段错误,不静默截断。
截图区域必须包含:
@@ -167,7 +176,7 @@ Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平
| `productKey` | Main 常量 `goodbuddy` | 服务端产品路由 |
| `category` | 用户选择 | 分流反馈 |
| `title` | 用户输入 | 摘要 |
| `description` | 用户输入 | 问题和建议详情 |
| `description` | 用户输入;勾选时由 Main 追加桌面诊断摘要 | 问题、建议和主动提供的有界诊断详情 |
| `contactEmail` | 用户可选输入 | 必要时联系用户 |
| `environment.appVersion` | `app.getVersion()` | 判断受影响版本 |
| `environment.platform` | `process.platform` 映射 | 判断受影响平台 |
@@ -197,8 +206,9 @@ Main 进程职责、公共 API 对接、失败处理和验收方法。反馈平
- 剪贴板、屏幕、摄像头、麦克风或其他应用内容。
- Remote Agent installation ID、Runtime ID、Conversation ID、Task ID 或 Project ID。
未来若增加日志、诊断包或其他附件,必须单独设计字段、预览、大小限制、用户选择和服务端
保留策略,不能复用截图字段静默上传。
除上述用户主动选择、追加到描述且有界的桌面诊断摘要外,未来若增加日志、诊断包或其他
附件,必须单独设计字段、预览、大小限制、用户选择和服务端保留策略,不能复用截图字段
静默上传。
### 4.3 本地数据生命周期
@@ -289,6 +299,7 @@ HTTP 201 表示首次创建,HTTP 200 表示相同 `clientRequestId` 的幂等
| 500–599 | 提示服务暂时异常,保留草稿 |
| 超时 / DNS / TLS / 离线 | 提示无法连接反馈服务,保留草稿 |
| 响应格式错误 | 提示服务返回无效结果,不能猜测成功 |
| 本地诊断读取失败 | 不发送反馈,保留草稿、勾选状态和请求 ID,提示重试或取消勾选 |
首版不自动重试。自动重试容易让用户无法判断是否已经发送,也会在服务持续异常时制造额外
流量。用户点击“重试”时复用同一个 `clientRequestId`。
@@ -330,6 +341,7 @@ type FeedbackSubmitInput = {
category: 'bug' | 'feature' | 'experience' | 'other'
title: string
description: string
includeDiagnostics: boolean
contactEmail?: string
locale: 'zh-CN' | 'en-US'
clientRequestId: string
@@ -341,7 +353,7 @@ type FeedbackSubmitInput = {
```
Renderer 不能传入 `productKey`、`appVersion`、`platform`、`architecture` 或
`installationId`。这些字段由 Main 从受信运行环境生成。
`installationId`,也不能传入诊断内容或路径。这些字段由 Main 从受信运行环境生成。
### 6.3 IPC 与 Preload
@@ -402,6 +414,12 @@ Main-only `FeedbackService` 负责:
- 映射应用版本、平台和架构。
- 验证并标准化可选截图。
- 组装严格的公共 payload。
- 仅在 `includeDiagnostics: true` 时通过注入的 DesktopDiagnostics provider 读取最多 20 条
最近记录;默认提交完全不调用诊断 provider。
- 将诊断格式化为带
`[GOODBUDDY_DESKTOP_DIAGNOSTICS_V1_BEGIN]` /
`[GOODBUDDY_DESKTOP_DIAGNOSTICS_V1_END]` 明确分隔、最多 1,600 字符且只保留完整 JSON
行的摘要。无记录时写入固定 `{"status":"no-recent-diagnostics"}` 事实。
- 调用 HTTP Client。
- 维持单次提交的 AbortController,并在 dispose / 清除本地数据时取消。
@@ -416,6 +434,11 @@ Main-only `FeedbackService` 负责:
架构只保留 `x64` 和 `arm64`,其他值映射为 `unknown`。
公共 API 继续使用 `schemaVersion: 1` 和原有固定字段。`includeDiagnostics` 只属于客户端
IPC 输入,不进入公共 payload,也不新增 multipart 字段;Main 把摘要追加到
`payload.description`。默认未勾选时,公共 payload 与既有实现逐字段一致。诊断读取失败时
不得发送部分摘要或声称已附加,必须返回可本地化的 `diagnostics-unavailable` 错误。
### 6.6 严格 HTTPS Client
反馈客户端使用 `undici` 的独立 `Agent`:
@@ -618,7 +641,8 @@ Endpoint 的健康检查和无副作用 schema 探针也必须在发布前通过
- 普通文本粘贴不被图片处理拦截。
- 截图选择、预览、替换、移除和 Object URL 清理。
- 并发截图读取按最新选择生效,关闭对话框后不会留下待处理 Object URL。
- 失败保留字段,重试使用原 `clientRequestId`。
- 失败保留字段、诊断勾选状态,重试使用原 `clientRequestId`。
- 默认提交不读取诊断且公共 payload 不变;主动附加、描述预算、无记录和读取失败均有覆盖。
- 成功显示真实编号并清空后续新草稿。
- Dialog role、初始焦点、Tab 循环、Escape 和焦点恢复。
- 浅色、深色、窄窗口和 reduced motion。
@@ -666,8 +690,9 @@ npm run build
- Endpoint 域名变化属于客户端发布变更,不能依赖 301/302 迁移。
- 入口发布与 `goodbuddy` 产品启用状态、生产 TLS 和 v1 契约保持同一发布门槛。
- 此功能不迁移现有用户数据;只新增可重置的随机反馈安装身份。
- 发布说明应明确:用户现在可以在“关于与更新”内直接提交反馈,邮箱和截图可选,应用不会
自动附加对话、日志、文件或凭据。
- 发布说明应明确:用户现在可以在“关于与更新”内直接提交反馈,邮箱和截图可选;桌面诊断
默认不上传,只有用户勾选后才附加有界摘要,并且不会发送对话、Prompt、凭据、文件内容、
路径、Provider 原始响应或远端 Agent 日志。
---
+14
View File
@@ -0,0 +1,14 @@
# 知识库
知识库负责资料导入、解析、分块、索引、检索、图谱和带来源的知识问答。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [知识库检索与分块增强 PRD](./prd.md) | 检索、分块、诊断和产品验收 |
| [User Stories](./user-stories.md) | 知识使用者、维护者和调试者场景 |
| [本地文本向量技术设计](./local-embedding-technical-design.md) | 本地与兼容向量连接、模型包、索引和进程边界 |
| [知识检索评估](./retrieval-evaluation.md) | 检索质量评估方法、数据集、指标和门槛 |
当前尚未拆出统一功能逻辑、UI 设计和功能进度文档。
@@ -10,7 +10,7 @@
| 日期 | 2026-08-22 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 相关基线 | [知识库检索与分块增强 PRD](../prd/knowledge/knowledge-rag-enhancement-prd.md)、[模型下载源设计](./model-download-source-design.md)、[知识检索评估](../quality/knowledge-retrieval-evaluation.md)、[统一界面设计系统](../../UI-DESIGN.md) |
| 相关基线 | [知识库检索与分块增强 PRD](./prd.md)、[模型下载源设计](../../architecture/model-download-source-design.md)、[知识检索评估](./retrieval-evaluation.md)、[统一界面设计系统](../../../UI-DESIGN.md) |
本文定义 GoodBuddy 的文本向量模型产品形态,包括 GoodBuddy 提供的内置本地连接、
用户添加的 OpenAI 兼容连接、模型管理界面、进程边界、编码契约、索引兼容性、失败状态
@@ -912,7 +912,7 @@ Endpoint、编码配置或服务端稳定模型摘要变化。
- 目录只包含元数据,不包含模型权重。
- 每个来源的文件固定不可变 Revision、URL、字节数和 SHA-256。
- 实际下载使用“平台功能 → 通用设置”中显式选择的 ModelScope 或 Hugging Face,完整
来源契约以[平台功能页签与模型下载源设计](./model-download-source-design.md)为准。
来源契约以[平台功能页签与模型下载源设计](../../architecture/model-download-source-design.md)为准。
- 下载写入随机暂存目录和 `.partial` 文件。
- 禁止未声明重定向到其他主机。
- 每个文件边下载边计算摘要。
@@ -1084,7 +1084,7 @@ GoodBuddy 只持续显示规范化 Endpoint 主机、实际维度和诊断结果
4. **质量评测**:中文、中英文混合、跨语言和代码标识固定样例。
5. **平台评测**:六个平台的安装、加载、取消、退出和资源。
现有[知识检索评估](../quality/knowledge-retrieval-evaluation.md)中的确定性内存 Provider
现有[知识检索评估](./retrieval-evaluation.md)中的确定性内存 Provider
用于验证生产检索管道,不代表真实模型质量。内置模型需要单独的可选本地评测命令,
该命令不读取用户数据库、不联网、不进入默认 CI。
@@ -9,7 +9,7 @@
| 日期 | 2026-08-22 |
| 适用产品 | GoodBuddy 桌面端 |
| 实施范围 | 第一阶段:可用、可见、可诊断;第二阶段:可调、可优化、可维护 |
| 相关设计 | [本地文本向量模型与连接设计](../../architecture/local-text-embedding-model-design.md) |
| 相关设计 | [本地文本向量模型与连接设计](./local-embedding-technical-design.md) |
## 1. 背景
@@ -49,7 +49,7 @@ OpenAI 兼容向量模型、RRF 混合检索、知识图谱、任务状态和来
跨平台向量扩展前,接受本地 CPU 线性扫描,并持续显示性能诊断。
9. 向量索引兼容性同时校验 Provider、Model、维度和 Provider Fingerprint。
同名模型切换端点后,旧向量不能继续参与召回。Fingerprint 的完整模型、编码与
数据路径定义以[本地文本向量模型与连接设计](../../architecture/local-text-embedding-model-design.md)
数据路径定义以[本地文本向量模型与连接设计](./local-embedding-technical-design.md)
为准。
10. 失败或取消的重建不能停用上一版已就绪索引。新索引只有完整校验成功后才
原子替换当前服务版本。
@@ -171,7 +171,7 @@ OpenAI 兼容向量模型、RRF 混合检索、知识图谱、任务状态和来
全局向量模型仍在“设置 → 模型连接 → 向量模型”中配置。GoodBuddy 内置连接和用户添加的
OpenAI 兼容连接使用同一连接列表;其界面、数据路径及切换语义以
[本地文本向量模型与连接设计](../../architecture/local-text-embedding-model-design.md)
[本地文本向量模型与连接设计](./local-embedding-technical-design.md)
为准,知识库页面只显示当前模型、索引兼容性、覆盖率和重建操作。“模型连接”是设置入口
名称,不表示向量连接可以分配给 Agent Runtime;项目 Runtime 和 Agent Runtime 的模型
选择中不显示向量连接。
@@ -7,7 +7,7 @@
| 状态 | 实施中 |
| 版本 | 0.1 |
| 日期 | 2026-08-11 |
| 关联 PRD | [知识库检索与分块增强 PRD](./knowledge-rag-enhancement-prd.md) |
| 关联 PRD | [知识库检索与分块增强 PRD](./prd.md) |
## 1. 角色
@@ -0,0 +1,43 @@
# 工具执行环境
本目录是 GoodBuddy“工具执行环境”功能的唯一文档入口。该功能为本机 SKILL 和本机
stdio MCP 提供明确、可诊断的 Node.js 与 Python 环境,同时允许专业用户选择自己维护的
解释器。
本功能不作用于 SSH Host 上的 GoodBuddy Agent、固定 Node、签名 Runtime、SKILL 或 MCP。
用户从设置中心的“能力与工具”进入,并在 `Skills`、`MCP`、`工具执行环境` 三个水平
Tab 之间切换。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [PRD](./prd.md) | 用户问题、产品目标、范围、需求和产品验收 |
| [User Stories](./user-stories.md) | 用户角色、使用场景和逐故事验收 |
| [功能逻辑](./logic-design.md) | 不变量、状态机、决策表、失败恢复和跨场景一致性 |
| [UI 设计](./ui-design.md) | 页面结构、组件、状态、文案和无障碍一致性 |
| [技术设计](./technical-design.md) | Main、Runtime、MCP、打包、生命周期和测试架构 |
| [功能进度](./progress.md) | 已完成、进行中、待实施、阻塞项和验证证据 |
## 术语
| 术语 | 定义 |
| --- | --- |
| 能力与工具 | 设置中心中统一承载 Skills、MCP 和工具执行环境的一级分类 |
| 工具执行环境 | GoodBuddy 在桌面所在设备上向本机 Runtime 和 stdio MCP 提供的工具命令环境 |
| GoodBuddy 托管 | 由 GoodBuddy 提供、验证并解析的 Node.js 或 Python |
| 自定义环境 | 用户从检测结果中选择或直接指定的外部解释器 |
| 工具下载源 | GoodBuddy 固定目录受管工具工件使用的原生地址或 OSS 镜像 |
| 工具就绪 | 解释器及配套命令通过真实诊断 |
| 能力依赖就绪 | 某个 SKILL 或 MCP 所需的第三方包和入口通过实际验证 |
## 文档维护规则
1. 产品范围只在 PRD 定义,其他文档链接引用。
2. 界面视觉和交互只在 UI 设计定义,并服从仓库根目录的
[统一界面设计系统](../../../UI-DESIGN.md)。
3. 状态转换、优先级和冲突决策只在功能逻辑中定义。
4. 进度文档只记录已验证事实,不复制未来设计。
5. 技术实现变化先更新技术设计;用户行为变化同时更新 PRD、User Stories、功能逻辑和
UI 设计。
6. 每次完成功能阶段后立即更新进度、验证命令和剩余阻塞项。
@@ -0,0 +1,460 @@
# 工具执行环境功能逻辑设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,验收中 |
| 版本 | 0.2 |
| 日期 | 2026-09-02 |
| 关联 PRD | [工具执行环境 PRD](./prd.md) |
| 关联场景 | [工具执行环境 User Stories](./user-stories.md) |
本文是本功能业务规则、状态转换、决策表和跨场景一致性的权威来源。它不定义组件视觉,也
不规定代码模块如何实现。
## 1. 逻辑目标
1. 同一用户操作在不同本机 Runtime 和 stdio MCP 中得到一致的解释器选择。
2. 系统不通过隐式回退掩盖配置错误。
3. 工具可执行、配套命令可执行和具体能力依赖可用是三个可区分事实。
4. 已运行进程使用稳定环境,不被设置变化中途改写。
5. 安装、更新、取消、失败和删除都有唯一、可恢复的结果。
6. 本机环境和远程 Host 环境没有隐式传播。
## 2. 核心不变量
### INV-1 单一明确来源
Node.js 和 Python 各自恰好保存一个来源:`managed` 或 `custom`。不存在 `auto`、候选优先级
列表或运行时动态选择。
### INV-2 禁止静默回退
当前来源不可用时,该工具明确不可用。即使发现另一套系统解释器,也不会自动切换。
### INV-3 配套命令同源
- `node`、`npm`、`npx` 必须属于同一 Node 来源。
- `python`、`python3`、`pip` 必须属于同一 Python 来源。
- `pip` 等价于当前 Python 的 `-m pip`,不能解析到其他解释器。
### INV-4 三层状态独立
1. **解释器状态**:Node 或 Python 本身能否执行。
2. **工具组合状态**:npm/npx 或 pip/venv/SSL 是否完整。
3. **能力依赖状态**:具体 SKILL/MCP 的入口和第三方依赖是否通过验证。
任一上层成功都不能推导下一层成功。
### INV-5 进程环境不可变
每个 Runtime/MCP 进程在启动时取得一份环境快照。设置变化只影响之后启动的进程,不改写
已运行进程的 PATH 或解释器。
### INV-6 绝对命令优先
stdio MCP 配置的绝对 command 表达用户对该 MCP 的明确覆盖,原样执行,不经过全局工具
命令替换。
### INV-7 本机与远程隔离
本机工具选择、shim、Python 包、SKILL 包和 stdio MCP 配置不上传到远程 Host。
### INV-8 不推断能力依赖已就绪
能力没有专属实际诊断时,状态只能是“未验证”,不能根据解释器版本或文件存在推断“已就绪”。
### INV-9 受管工具工件来源明确且冻结
每个受管工具外部工件同时声明固定原生地址和 OSS Target。用户选择一个下载源后,任务
启动时冻结该来源;失败不回退。OSS 必须是原生工件的字节级副本。
### INV-10 设置导航不改变业务状态
“能力与工具”的三个水平 Tab 只组织界面,不改变 Skill、MCP 或工具环境设置。切换 Tab
不得提交、丢弃或重置当前设置面板会话中的编辑状态;关闭后不持久化外层 Tab。
分阶段交付期间,未实现的“工具执行环境”不进入 Tab 状态集合。第一阶段状态集合只有
`skills | mcp`,后续实现完成后才扩展为 `skills | mcp | tool-environment`。
### INV-11 内置 Skill 默认值不覆盖用户状态
只有状态存储中没有对应 Skill 记录时才使用产品默认值。通用文档工具
`deai-writing`、`longdoc-docx` 默认启用;产品营销类 `product-evidence`、
`product-marketing`、`product-presentation` 默认停用。用户显式保存的启停状态和
Runtime 分配优先,升级不得重置。
九种产品营销文档配方属于 `product-marketing` 包内工作流,不是独立能力状态维度,
不进入顶层 Skill 目录,也不单独注入 Runtime。
## 3. 状态维度
### 3.1 来源选择
```text
managed
custom(executablePath)
```
这是唯一持久状态。
候选选择还具有不持久化的界面状态:
```text
closed
choosing
validating
failed
```
- 从 `closed` 进入 `choosing` 不改变当前持久来源。
- `choosing` 中不得自动采用首个候选;只有用户明确选择候选或文件后才进入 `validating`。
- 验证成功后一次性保存 `custom(executablePath)`;验证失败回到 `choosing` 并就地显示错误。
- 文件选择取消回到 `choosing`,不显示错误且不改变当前来源。
- 没有候选不是禁用“自定义环境”的理由,用户仍可刷新或选择其他可执行文件。
### 3.2 托管 Python 安装状态
```text
not-installed
downloading
verifying
installing
testing
ready
update-available
error
```
`error` 同时携带“是否仍有旧版可用”。若旧版可用,实际工具状态仍基于旧版诊断。
托管 Node 随 GoodBuddy 存在,不使用下载安装状态,但仍可能因打包损坏进入诊断失败。
### 3.3 工具诊断状态
```text
unknown
testing
ready
partial
unavailable
```
- `ready`:解释器和本功能承诺的配套命令全部通过。
- `partial`:解释器通过,至少一个配套命令失败。
- `unavailable`:解释器本身不能使用。
### 3.4 能力依赖状态
```text
unknown
checking
ready
missing
incompatible
error
```
- `unknown` 在 UI 中显示“依赖未验证”。
- `missing` 表示明确缺少包或入口。
- `incompatible` 表示解释器版本、架构或 ABI 不满足已声明要求。
- `error` 表示诊断本身没有得出有效结论。
### 3.5 工具下载源
```text
native
oss
```
这是独立于 Node/Python 环境来源的持久设置。全新用户默认 `native`。
## 4. 来源解析决策表
| 保存来源 | 当前事实 | 解析结果 | 是否回退 |
| --- | --- | --- | --- |
| 托管 Node | 完整诊断通过 | 使用 Electron Node 与锁定 npm/npx | 否 |
| 托管 Node | Node 通过,npm/npx 失败 | Node 部分可用,显示失败项 | 否 |
| 托管 Node | Node 失败 | Node 不可用,提示修复/重装 GoodBuddy | 否 |
| 托管 Python | 未安装 | Python 不可用,提供安装 | 否 |
| 托管 Python | 已安装且诊断通过 | 使用托管 Python | 否 |
| 托管 Python | 更新失败但旧版健康 | 继续使用旧版并显示更新失败 | 否 |
| 托管 Python | 安装损坏 | Python 不可用,提供重新安装/删除 | 否 |
| 自定义 | 路径及诊断通过 | 使用该绝对路径 | 否 |
| 自定义 | 路径失效 | 保持选择并显示路径不可用 | 否 |
| 自定义 | 解释器通过、配套命令失败 | 部分可用并显示失败项 | 否 |
| 任意 | 发现其他有效解释器 | 只作为候选展示 | 不自动使用 |
## 5. 命令解析决策表
| 调用形式 | 结果 |
| --- | --- |
| `node ...` | 当前 Node |
| `npm ...` | 当前 Node 配套 npm |
| `npx ...` | 当前 Node 配套 npx |
| `python ...` | 当前 Python |
| `python3 ...` | 当前 Python |
| `pip ...` | 当前 Python `-m pip` |
| `#!/usr/bin/env node` | 从进程工具 PATH 解析当前 Node |
| `#!/usr/bin/env python3` | 从进程工具 PATH 解析当前 Python |
| stdio MCP 绝对 command | 原样执行 |
| 未托管裸命令,例如 `uvx` | 按原筛选 PATH 处理;找不到则明确失败 |
| HTTP/SSE MCP | 不参与本机命令解析 |
绝对 command 的子进程若自行调用裸 `node` 或 `python`,仍会看到该 MCP 进程启动时的工具
PATH。这不改变绝对 command 本身。
## 6. 首次使用和迁移
### 6.1 全新安装
| 工具 | 默认选择 | 首次状态 |
| --- | --- | --- |
| Node.js | GoodBuddy 托管 | 立即真实诊断 |
| Python | GoodBuddy 托管 | 未安装,展示安装入口 |
系统候选可以展示,但不会改变默认选择。
### 6.2 旧版本升级
1. 设置中没有工具环境字段时执行一次迁移。
2. 分别按旧版本实际 PATH 解析 Node 和 Python 3。
3. 有效解释器固化为 `custom + 绝对真实路径`。
4. 无有效解释器时选择 `managed`。
5. 持久化后不再因 PATH 变化迁移。
迁移中 Node 和 Python 独立决策,不要求二者使用同一种来源。
## 7. 托管 Python 生命周期
### 7.1 首次安装
```text
not-installed
→ downloading
→ verifying
→ installing
→ testing
→ ready
```
任一步失败:
```text
→ 删除本次暂存
→ error(没有活动版本)
→ 用户可重试
```
### 7.2 取消
| 取消阶段 | 结果 |
| --- | --- |
| 下载 | 终止下载、删除暂存、回到安装前状态 |
| 校验 | 终止校验、删除暂存、回到安装前状态 |
| 解压/安装 | 完成本次有界清理、回到安装前状态 |
| 测试 | 停止诊断、删除未发布候选、回到安装前状态 |
取消不发布候选版本,不把取消显示为安装失败。
### 7.3 更新
1. 下载和验证候选时,旧版继续服务现有进程。
2. 应用候选前,页面说明需要停止依赖托管 Python 的本机 Runtime/MCP。
3. 用户确认后通过现有生命周期取消/停止相关进程。
4. 无法确认停止时不替换当前版本。
5. 候选完整诊断通过后才发布。
6. 失败继续使用旧版,并显示更新失败。
首期不让两个托管 Python 版本长期并存。候选暂存只服务本次更新。
### 7.4 删除
| 条件 | 行为 |
| --- | --- |
| 没有使用中进程 | 确认后删除托管目录 |
| 有使用中进程 | 说明影响,用户确认后停止相关进程再删除 |
| 进程停止失败 | 不删除,保留当前环境 |
| 当前选择为自定义 | 删除托管包不改变自定义来源 |
| 当前选择为托管 | 删除后保持托管选择,状态变为未安装 |
## 8. 设置保存与进程生效
### 8.1 保存时
- 验证待保存来源。
- 自定义路径必须在保存前通过解释器诊断;配套命令可以形成 `partial`。
- 保存成功后标记本机 Runtime 环境配置已变化。
- 不直接修改任何运行中进程。
### 8.2 后续进程
- 没有活动请求的缓存 Runtime 在下次使用前按现有重建入口重建。
- 有活动请求的 Runtime 完成或被用户停止前保持原环境。
- 已启动 stdio MCP 保持原环境,正常关闭、重连或显式测试后使用新环境。
- 新启动的 Runtime/MCP 立即使用新环境。
每个工具调用的活动记录应归属于实际承载它的进程,不根据最新设置追改历史来源。
### 8.3 设置导航
| 入口或操作 | 打开的外层 Tab | 数据行为 |
| --- | --- | --- |
| 普通“能力与工具”入口 | Skills | 不修改业务数据 |
| 用户点击 Skills | Skills | 不修改业务数据 |
| 用户点击 MCP | MCP | 不修改业务数据 |
| 未来的定向入口 | 指定 Tab | 不修改业务数据 |
| 同一设置面板会话中切换 Tab | 用户选择的 Tab | 保留三个面板的会话内状态 |
| 关闭后重新打开普通入口 | Skills | 不恢复上次外层 Tab |
MCP 内层页签状态属于 MCP 面板,不与外层 Tab 合并。外层 Tab 的默认值或定向入口不能改写
MCP 的连接、凭据、启用或 Runtime 分配状态。
## 9. 能力依赖逻辑
### 9.1 诊断输入
能力可以声明:
- 需要 Node 或 Python。
- 最低/最高解释器版本。
- 可选依赖文件位置。
- 可选的无副作用诊断入口。
首期声明只用于显示、版本比较和显式诊断,不触发自动安装。
### 9.2 状态推导
| 工具状态 | 能力诊断 | 能力状态 |
| --- | --- | --- |
| unavailable | 不执行 | missing 或 incompatible,附工具原因 |
| partial | 能力不依赖失败配套项且实际诊断成功 | ready |
| partial | 能力依赖失败配套项 | missing |
| ready | 没有能力诊断 | unknown |
| ready | 实际诊断成功 | ready |
| ready | 明确缺包 | missing |
| ready | 版本/ABI 不满足 | incompatible |
| 任意 | 诊断自身异常 | error |
“依赖未验证”不是错误,也不能显示为“已就绪”。
## 10. Ask、Execute 与 MCP
| 场景 | 解释器是否可见 | 是否允许执行 |
| --- | --- | --- |
| 本机 Execute Runtime | 是 | 按现有 Execute 权限 |
| 本机 Ask Runtime | 可以存在于进程环境 | 仍由 Runtime Ask 边界决定,不能因此获得命令权限 |
| Main 启动的已启用 stdio MCP | 是 | 按当前 MCP 分配和模式规则 |
| HTTP/SSE MCP | 不适用 | 按当前网络 MCP 规则 |
| 远程 Runtime | 否 | 使用远程 Host 自身环境 |
工具环境不创建新的工具,不扩大 Runtime 当前允许的工具集合。
## 11. 网络受限与离线
### 11.1 托管 Node
随 GoodBuddy 提供,安装后可离线使用。
### 11.2 托管 Python
- Windows 原生 Target 固定到官方 NuGet 包;macOS/Linux 原生 Target 固定到 Astral
`python-build-standalone`。
- OSS Target 是对应原生工件的字节级副本。
- 下载源不可达时保持未安装或旧版可用状态,并显示准确原因。
- 首期不提供 Python 离线包导入,避免引入未经选型的包格式和导入流程。
- 完全离线用户可以选择已经离线安装的自定义 Python。
未来若加入离线导入,必须在 PRD、User Stories、逻辑状态和技术包校验中同时定义,不能只
增加一个文件按钮。
### 11.3 工具下载源决策
| 保存选择 | 目录事实 | 行为 |
| --- | --- | --- |
| 原生地址 | 原生 Target 完整 | 请求固定上游 URL |
| 原生地址 | 原生 Target 缺失 | 工件不可下载,不请求 OSS |
| OSS 镜像 | OSS Target 完整 | 只请求固定 OSS URL |
| OSS 镜像 | OSS Target 缺失 | 工件不可下载,不请求原生地址 |
| 任意 | 下载后字节数/SHA-256 不符 | 删除暂存并失败 |
| 任意 | 设置在任务期间变化 | 当前任务不变,后续任务使用新选择 |
该选择只覆盖受管工具目录中的外部工件,不影响模型、应用更新、Agent、pip/npm 注册表或
用户 URL。
## 12. 冲突与一致性检查
| 可能冲突 | 唯一规则 |
| --- | --- |
| 全局工具选择 vs MCP 绝对 command | 绝对 command 优先 |
| 新设置 vs 运行中进程 | 运行中进程保留启动快照 |
| 新托管版本 vs 健康旧版本 | 候选完整通过后才发布 |
| 系统发现新版本 vs 已保存自定义路径 | 不自动切换 |
| 解释器成功 vs 缺少第三方包 | 工具 ready,能力 missing/unknown |
| Ask 环境包含解释器 vs Ask 只读 | Ask 权限边界优先 |
| 本机设置 vs 远程项目 | 远程隔离优先 |
| 镜像不可达 vs 其他来源可用 | 不在同一次操作中静默切换来源 |
| 工具下载源 vs 模型/更新下载源 | 各自独立,工具执行环境设置不覆盖其他功能 |
| OSS 对象 vs 原生工件 | 必须字节、大小和 SHA-256 相同 |
| 合并设置入口 vs 原有 Skills/MCP 数据 | 只重组导航,不迁移或重写业务数据 |
| 外层 Tab vs MCP 内层 Tab | 保持两个独立 tablist、标识和键盘焦点范围 |
## 13. 逻辑评估结论
### 13.1 完整性评估
| 评估维度 | 结论 | 依据 |
| --- | --- | --- |
| 首次使用 | 通过 | 托管 Node 立即诊断,托管 Python 明确未安装 |
| 正常执行 | 通过 | SKILL 与 stdio MCP 共用同一命令解析 |
| 自定义环境 | 通过 | 明确路径、真实诊断、禁止静默回退 |
| 部分失败 | 通过 | 解释器、工具组合、能力依赖三层状态独立 |
| 安装生命周期 | 通过 | 安装、取消、失败、重试有唯一结果 |
| 更新生命周期 | 通过 | 候选通过后发布,失败保留健康旧版 |
| 删除生命周期 | 通过 | 使用中进程先停止,失败不删除 |
| 设置生效 | 通过 | 进程启动快照不可变,新进程使用新设置 |
| 升级兼容 | 通过 | 旧系统解释器一次性固化为自定义路径 |
| Ask/Execute | 通过 | 工具环境不扩大工具集合或权限 |
| 远程边界 | 通过 | 本机配置不进入 Host |
| 受限网络 | 通过 | 来源失败可见,不在同次操作静默切换 |
| 完全离线 | 有明确限制 | Node 可用;Python 首期要求已有自定义环境 |
| 受管工具工件来源 | 通过 | 原生/OSS 独立选择、任务冻结、禁止回退 |
| 设置导航 | 通过 | 单一一级入口、分阶段水平 Tab、业务数据不变 |
### 13.2 一致性评估
- “两种来源”与自定义候选探测不冲突:候选只是自定义来源的选值,不是第三种来源。
- “禁止回退”与升级迁移不冲突:迁移只发生一次,完成后按普通保存选择处理。
- “进程环境不可变”与 Runtime 重建不冲突:只有空闲或后续启动的进程使用新环境。
- “工具环境就绪”与“能力依赖就绪”不冲突:两者属于独立状态维度。
- “绝对 MCP command 优先”与 PATH 注入不冲突:command 不替换,但其子进程继承启动快照。
- “更新保留旧版”不要求长期多版本管理:旧版只在候选发布前保持当前,候选失败即删除。
### 13.3 当前未决项
没有未决的产品逻辑分支。以下属于实施前必须解决的技术选型,不改变业务规则:
1. 六平台 CPython 独立发行包、固定版本、许可证和摘要。
2. SKILL/MCP 运行要求声明的最小 schema 和无副作用诊断入口。
3. 各 Runtime 当前缓存进程的精确空闲判定与既有重建入口接线。
若技术选型无法满足当前逻辑,例如目标 Python 工件不包含可用 pip/venv,必须回到 PRD 和
逻辑设计调整承诺,不能在实现中静默降级。
## 14. 需求追踪
| 逻辑范围 | PRD | User Stories |
| --- | --- | --- |
| 首次使用默认状态 | FR-1、FR-2、FR-6 | US-A0 |
| 明确来源与禁止回退 | FR-3、FR-8 | US-C1、US-C2、US-D3 |
| 托管 Node | FR-1 | US-A1、US-B2 |
| 托管 Python 生命周期 | FR-2、FR-9 | US-A2、US-D2、US-D4、US-D5 |
| 三层状态 | FR-6 | US-A3、US-A4 |
| SKILL 命令解析 | FR-4 | US-A1、US-A3 |
| MCP 命令解析 | FR-5 | US-B1、US-B2、US-B3 |
| 生效时机 | FR-7 | US-C3、US-C4 |
| Ask/Execute | FR-10 | US-D6 |
| 远程隔离 | FR-7、FR-9 | US-D1 |
| 受限网络与离线 | FR-2、FR-11 | US-E1、US-E2、US-E3 |
| 统一设置入口 | FR-12 | US-F1、US-F2 |
+213
View File
@@ -0,0 +1,213 @@
# 工具执行环境 PRD
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已批准并实施,验收中 |
| 版本 | 0.2 |
| 日期 | 2026-09-02 |
| 适用产品 | GoodBuddy 桌面端 |
| 目标平台 | Windows、macOS、Linux,x64 与 arm64 |
| 关联文档 | [功能入口](./README.md)、[User Stories](./user-stories.md)、[功能逻辑](./logic-design.md)、[UI 设计](./ui-design.md)、[技术设计](./technical-design.md)、[功能进度](./progress.md) |
## 1. 背景
GoodBuddy 的部分 SKILL 通过 Node.js 或 Python 脚本生成成果,部分本机 stdio MCP 也以
`node`、`npm`、`npx`、`python` 或 `python -m` 启动。当前安装包没有向这些能力提供统一
解释器,用户是否成功取决于系统 PATH 和预装软件。
普通用户不应为了使用一个 SKILL 或 MCP 手工安装开发环境。专业用户已有项目 Node、
Python、虚拟环境或 Conda 环境时,也不能被 GoodBuddy 静默替换。
## 2. 产品目标
1. 全新设备无需预装 Node.js 即可运行普通 JavaScript SKILL 和 Node.js stdio MCP。
2. 用户可在 GoodBuddy 内按需安装 Python,并运行 Python SKILL 和 stdio MCP。
3. 专业用户可以选择检测到的解释器或指定其他可执行文件。
4. 设置始终展示实际来源、版本、路径、工具状态和能力依赖状态。
5. 工具执行环境不修改系统环境,也不传播到远程主机。
6. 保持 Ask/Execute、Runtime、MCP、取消和进程清理的现有边界。
7. 用户可以在“工具执行环境”Tab 中明确选择受管工具工件使用原生地址还是 OSS 镜像。
8. Skills、MCP 和工具执行环境通过一个“能力与工具”设置入口形成清晰的能力配置链路。
## 3. 核心决策
### 3.1 每种工具只有两个来源
- **GoodBuddy 托管(推荐)**
- **自定义环境**
不提供“自动选择”。“系统安装”和“指定路径”合并为“自定义环境”,因为两者最终都是
用户明确选择的外部可执行文件,区别只在发现方式。
### 3.2 配套命令跟随解释器
- Node.js 保证 `node`、`npm`、`npx` 来自同一来源。
- Python 保证 `python`、`python3`、`pip` 来自同一来源;`pip` 实际绑定当前 Python。
- 首期不托管 `uv`、`uvx`、Conda、Poetry、pyenv 或 nvm。
### 3.3 工具就绪不等于能力依赖就绪
解释器通过诊断后标记“工具环境已就绪”。只有 SKILL 或 MCP 的实际入口及所需第三方包
通过验证后,才能标记“能力依赖已就绪”。GoodBuddy 首期不自动扫描和安装任意能力依赖。
### 3.4 分阶段交付统一设置入口
第一阶段先把现有 Skills 和 MCP 合并到“能力与工具”,只显示两个真实可用的水平 Tab。
“工具执行环境”实现完成后再加入第三个 Tab;未实现期间不展示禁用项、空白页或开发中占位。
## 4. 功能范围
### 4.1 包含
- 本机 OpenCode、Continue、DeepSeek Harness 加载的 SKILL。
- Main 或本机 Runtime 启动的 stdio MCP。
- 托管 Node.js、npm、npx。
- 按需下载安装的托管 Python 3、pip、venv。
- 系统解释器探测、自定义文件选择和真实诊断。
- 工具来源、版本、路径、安装、删除、更新和错误状态。
- 受管工具工件的原生地址/OSS 镜像选择。
- “能力与工具”一级分类及 `Skills`、`MCP`、`工具执行环境` 三个水平 Tab。
- 新启动本机 Runtime 和 MCP 的 PATH 注入。
### 4.2 不包含
- SSH Host 的 PATH、Agent、固定 Node、Runtime、SKILL 或 MCP。
- HTTP/SSE MCP 服务端环境。
- 普通助手工作栏终端的 Shell 环境。
- 通用语言版本管理器。
- 每项目或每 SKILL 的解释器覆盖。
- 自动合并或求解多个 `requirements.txt`、`package.json`。
- 自动执行任意第三方安装脚本。
- 修改系统 PATH、注册表或 Shell Profile。
- 无条件把完整 Python 打入桌面安装包。
- 首期导入托管 Python 离线包;完全离线用户可选择已有的自定义 Python。
- 修改模型下载源、应用更新源、Agent 下载源、pip/npm 注册表或用户配置的网络地址。
## 5. 功能需求
### FR-1 Node.js 托管环境
- 安装 GoodBuddy 后托管 Node.js 即可用,不需要额外下载。
- 实际版本通过运行命令诊断,不仅根据 Electron 版本推断。
- `node`、`npm`、`npx` 必须来自同一托管组合。
- Electron Node 原生扩展兼容限制必须可见。
### FR-2 Python 托管环境
- Python 未安装时展示安装入口,不把完整 Python 放入所有桌面安装包。
- Windows x64 使用固定官方 `python` NuGet 工件,Windows ARM64 使用固定官方
`pythonarm64` NuGet 工件;macOS/Linux 使用固定 Astral `python-build-standalone`
工件,最终版本以真实诊断和共同支持矩阵为准。
- 原生地址直接指向精确上游工件;OSS 镜像保存该工件的字节完全相同副本。
- 展示下载、校验、安装、取消、可更新、删除和失败状态。
- 下载失败保留已验证旧安装。
### FR-3 自定义环境
- 探测 PATH 和常见安装位置中的有效候选。
- 探测当前虚拟环境、Conda 环境以及用户/系统常见解释器位置。
- 候选同时展示版本和规范化绝对路径。
- 用户可以选择未被探测到的可执行文件。
- “自定义环境”入口在没有候选时仍可操作,不自动选择首个候选。
- 保存前执行真实诊断。
- 已保存路径失效时保持用户选择并报错,不静默回退。
### FR-4 SKILL 接入
- SKILL 可以稳定调用 `node`、`npm`、`npx`、`python`、`python3` 和 `pip`。
- SKILL 不需要知道解释器真实安装目录。
- 缺失解释器或第三方依赖时返回准确错误。
- 工具环境不自动安装 SKILL 声明的依赖。
### FR-5 stdio MCP 接入
- 裸命令通过当前工具环境解析。
- `env node`、`env python3` 形式的脚本使用当前工具环境。
- MCP 中配置的绝对命令路径保持原样,不被替换。
- Python 和 Node.js MCP 均使用与 SKILL 相同的来源。
### FR-6 状态与诊断
- 工具执行环境页只显示有真实诊断结果的解释器和配套工具状态,不显示固定的能力依赖占位
状态。
- 具体 SKILL/MCP 只有在其实际入口及第三方依赖通过验证后,才在对应能力详情中显示能力
依赖状态。
- Node 诊断覆盖 Node、npm、npx、标准库和子进程。
- Python 诊断覆盖 Python 3、架构、标准库、SSL、pip 和 venv。
- 诊断使用临时目录并在结束后清理。
### FR-7 生效范围
- 设置只对新启动的本机 Runtime 和 stdio MCP 生效。
- 已运行进程不被中途替换环境。
- 不影响普通终端、系统环境和远程主机。
### FR-8 升级兼容
- 全新用户默认选择 GoodBuddy 托管。
- 已发布版本升级时,将当前有效系统解释器一次性固化为自定义绝对路径。
- 没有有效系统解释器时迁移到托管来源。
- 后续系统 PATH 变化不自动改变选择。
### FR-9 生命周期
- 安装、诊断、Runtime 和 MCP 子进程支持取消和应用退出清理。
- 删除只作用于 GoodBuddy-owned 目录。
- 不删除系统解释器、自定义环境、用户工作区或远程文件。
### FR-10 权限模式
- Ask 不因解释器可用而获得额外命令或写入权限。
- Execute 继续使用当前本机账号的完整授权。
- 不为工具环境增加第二套批准流程。
### FR-11 工具下载源
- “工具执行环境”Tab 提供两个互斥选项:`原生地址` 和 `OSS 镜像`。
- 全新用户默认使用原生地址;该选择独立于“关于与更新”和模型下载源。
- 选择原生地址时,每个受管工件使用目录中固定的上游 URL。
- 选择 OSS 镜像时,使用 GoodBuddy OSS 中固定的对应对象。
- 两个 Target 必须声明同一逻辑工件、相同字节数和 SHA-256;OSS 不得重打包或修改内容。
- 下载开始时冻结来源;运行期间切换设置只影响后续下载。
- 当前来源失败、缺少工件或校验失败时明确失败,不自动请求另一个来源。
- 该设置适用于当前 Python Runtime 和未来纳入受管工具目录的 Runtime/工具链。
- 该设置不影响用户执行的 pip/npm 依赖安装、模型下载、应用更新、Agent 下载、HTTP/SSE
MCP 或用户配置 URL。
### FR-12 统一设置入口
- 设置中心只提供一个“能力与工具”一级分类,不再并列显示独立的 Skills、MCP 或工具执行
环境分类。
- 第一阶段提供 `Skills`、`MCP` 两个水平 Tab;工具执行环境完成后依次提供
`Skills`、`MCP`、`工具执行环境` 三个水平 Tab。始终默认打开 `Skills`。
- 三个 Tab 使用共享 `PageTabs`,保留 `tablist`、`tab`、`tabpanel`、方向键和可见焦点。
- `Skills` 继续承载现有 Skill 启停、导入、状态和 Runtime 分配。
- 内置 Skill 顶层目录只展示五个独立能力:`deai-writing`、`longdoc-docx`、
`product-evidence`、`product-marketing`、`product-presentation`。产品营销的功能目录、
一页纸、技术方案、白皮书、招标、演示套件、客户案例和竞品定位作为
`product-marketing` 内部工作流,不重复显示为独立 Skill。
- `deai-writing` 和 `longdoc-docx` 默认启用;`product-evidence`、
`product-marketing`、`product-presentation` 默认停用。已保存的用户启停和 Runtime
分配始终优先于默认值;导入 Skill 的默认行为保持不变。
- `MCP` 继续承载现有 MCP 配置、凭据、状态和 Runtime 分配;其现有内部分组页签保持不变。
- `工具执行环境` 承载工具下载源、Node.js、Python、诊断和生效范围。
- 合并导航不改写 Skills/MCP 业务数据;未来新增定向入口时必须进入对应水平 Tab。
- 切换水平 Tab 不丢弃当前编辑状态;不把当前水平 Tab 持久化为产品设置。
- 未实现的工具执行环境不得以禁用 Tab 或占位内容提前显示。
## 6. 产品验收
- 无系统 Node.js 时,托管 Node 可以真实执行 JavaScript SKILL 和 stdio MCP。
- 无系统 Python 时,用户可安装托管 Python 并真实执行现有 Python SKILL 和 MCP。
- Node、npm、npx 来源一致;Python、python3、pip 来源一致。
- 用户可明确选择并锁定自定义解释器。
- 自定义路径失效不触发静默切换。
- 工具就绪与能力依赖就绪不会混为同一状态。
- 本机 Skills、MCP 和工具执行环境不会应用于远程主机。
- 工具下载使用用户明确选择的原生地址或 OSS,且不会静默回退。
- 第一阶段通过“能力与工具”统一入口展示 Skills/MCP 两个水平 Tab;工具执行环境完成后
追加第三个 Tab。
- 中英文界面、键盘操作、焦点和状态反馈符合统一设计系统。
- 全量测试、类型检查、Lint 和生产构建通过。
@@ -0,0 +1,120 @@
# 工具执行环境功能进度
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 文档类型 | 功能进度 |
| 状态 | 已实施,发布候选 CI 验收中 |
| 版本 | 0.4 |
| 日期 | 2026-09-02 |
| 关联入口 | [工具执行环境](./README.md) |
## 当前结论
本机工具执行环境的生产链路已经进入源码。“能力与工具”现在显示 `Skills`、`MCP`、
`工具执行环境` 三个真实 Tab;Main 统一解析托管或自定义 Node/Python,并把不可变 PATH
快照应用到新启动的本机 Runtime 与 stdio MCP。Windows x64 已完成真实托管 Node 和原生
地址托管 Python 安装验证。
六个 OSS 镜像对象已发布并公开回读验证。托管 Python 继续按需下载,Desktop 发行包不额外
带入许可证文件。标准六平台打包任务已改用目标架构原生 Runner,并在打包前执行托管 Python
的真实安装、SSL、pip 和 venv 探针;`0.12.0` 候选仍需通过这组 CI 才能完成对应跨平台验收。
## 已完成
### 设置、迁移和界面
- [x] Shared 严格设置、候选、诊断、进度、IPC 和 Preload 契约。
- [x] Application Settings v10;全新用户默认托管环境和原生地址。
- [x] v1-v9 分别执行真实 Node/Python 3 探测的一次性迁移;无有效候选时选择托管环境。
- [x] 用户/系统 PATH、活动 venv/Conda、`CONDA_ENVS_PATH`、Conda/pyenv/nvm 和常见安装
位置,以及已保存自定义路径候选的规范化、去重、版本及架构诊断。
- [x] 自定义解释器保存前真实验证;无效新选择不持久化,已保存失效路径不回退。
- [x] “自定义环境”始终可进入;不隐式采用首个候选,取消文件选择不改设置,验证错误在
对应工具卡内显示。
- [x] “能力与工具”统一入口及三个水平 Tab,MCP 原内层页签保持不变。
- [x] 工具下载源、Node.js、Python、候选、诊断、安装进度、取消和删除界面。
- [x] 工具卡只展示真实工具诊断;未接入具体能力证据前不显示固定的能力依赖占位状态。
- [x] 使用 `PageTabs`、应用通知、就地操作错误、删除确认和具名进度条。
### 托管 Node 与进程注入
- [x] 使用 Electron-as-Node 提供 `node`,使用同一 Node 和打包 CLI 提供 `npm`、`npx`。
- [x] 自定义 Node 只使用同安装位置且验证成功的 npm/npx,不与托管 CLI 混用。
- [x] 每次配置生成不可变 shim 目录;已有进程继续持有原 PATH,新进程读取新快照。
- [x] OpenCode、Continue、DeepSeek Harness 和本机通用/精选 stdio MCP 接收工具 PATH。
- [x] 工具 PATH 不修改 `process.env`,不进入普通终端或远程 Host。
- [x] 解释器探针使用过滤后的环境,不接收模型凭据、GoodBuddy 或 Factory 内部变量。
### 托管 Python
- [x] 锁定 CPython 3.13.15 的 Windows/macOS/Linux x64/ARM64 六平台目录、大小和 SHA-256。
- [x] 用户选择的原生地址或 OSS 镜像在任务开始时冻结,同一次任务不回退。
- [x] HTTPS、重定向 Host、大小、SHA-256、取消和部分文件清理。
- [x] NuGet ZIP 与 Astral TAR 的 payload 限定、路径穿越防护、展开上限和安全链接处理。
- [x] GoodBuddy-owned 暂存安装、发布、失败清理、更新保留和删除。
- [x] `python`、`python3`、`pip` 同源,`pip` 固定使用所选 Python 的 `-m pip`。
- [x] 发布前真实验证 Python 3.13.15、架构、标准库、SSL、pip,并创建和执行临时 venv。
- [x] 取消恢复原状态且不显示为安装失败;退出时取消并等待安装清理。
## 待完成验收
- [x] 发布六个平台/架构的字节完全相同 OSS 镜像对象并公开回读校验。
- [x] 确认托管 Python 保持按需下载,Desktop 发行包不额外带入许可证文件。
- [ ] Windows ARM64、macOS x64/ARM64、Linux x64/ARM64 原生 CI 安装、SSL、pip、venv 探针;工作流已接线,等待 `0.12.0` 候选运行结果。
- [ ] 最低 Windows/macOS/glibc 支持矩阵和 Windows NuGet 签名核验。
- [ ] 真实 JavaScript/Python SKILL 成果及 Node/Python stdio MCP 调用。
- [ ] 自定义 Node/Python 在产品 UI 中的真实选择和任务执行。
- [ ] 更新或删除托管 Python 时,使用现有本机 Runtime/MCP 生命周期协调受影响进程。
## 当前阻塞项
- 当前机器只能原生验证 Windows x64。其余五个平台必须由对应原生 CI 执行,不能用本机
mock 代替。
## 已验证证据
### 2026-09-02 完整实现
- 发布准备确认不把按需下载的托管 Python 许可证文件加入 Desktop `extraResources`、解包
校验或 Portable ZIP 必需文件,避免该额外资源改变现有编译和打包路径。
- 六平台打包矩阵在 `npm ci` 后先断言 Runner 架构,再执行
`GOODBUDDY_RUN_LIVE_TOOL_ENVIRONMENT=1` 的托管 Python 安装探针;Windows arm64 改用
`windows-11-vs2026-arm` 原生 Runner。发行资源与目录聚焦测试 `47/47` 通过。
- `npm run typecheck` 通过。
- `npm run lint` 通过。
- `npm run build` 通过,Main、Preload 和 Renderer 生产 bundle 成功。
- 工具环境聚焦测试通过:契约、设置迁移、解析/shim、服务、下载、解压、安装、IPC、
Preload、Runtime/MCP 注入、Renderer 和发行资源校验。
- Windows x64 真实托管 Node:Electron Node `24.18.0`、npm `11.19.0`、npx `11.19.0`。
- `GOODBUDDY_RUN_LIVE_TOOL_ENVIRONMENT=1` 真实下载官方 NuGet、校验摘要、解压、安装并
验证 CPython `3.13.15`、SSL、pip 和 venv,`1/1` 通过;临时安装已清理。
- 隔离 Electron 生产 bundle 自动化确认三个 Tab 均可见;“诊断全部”显示托管 Node
`24.18.0`、npm/npx `11.19.0`。隔离进程和用户数据已清理。
- 第一次全量测试发现 3 个确定性夹具/兼容失败,修复后聚焦复跑 `25/25` 通过。第二次暴露
2 个 `App.test.tsx` 设置导航时序问题,修正为按可访问名称点击并等待设置中心。
- 最终 `npm test` 通过:`3465` 通过、`51` 跳过;完整 `App.test.tsx` 为 `157/157` 通过。
- 使用本机受控 Aliyun 凭据将六个已验证上游工件原样上传到
`goodbuddy/tool-artifacts/python/3.13.15/<sha256>/<filename>`,总计 `142,251,693`
字节。随后从目录中的六个公开 OSS URL 全量下载,逐个验证字节数和 SHA-256,全部一致。
- 修复无候选时禁用“自定义环境”的死路交互,并扩展 venv/Conda/常见安装位置探测;
聚焦 Main/Renderer/Settings 测试 `95/95` 通过,最终 `npm test` 为 `3477` 通过、
`51` 跳过,类型检查、功能文件定向 Lint 和生产构建通过。仓库全量 Lint 当前被并行
`App.tsx` 的两个 React Compiler memoization 错误阻塞,与工具执行环境文件无关。
- 隔离 Electron 实机确认“自定义环境”始终可进入,展开和刷新不会保存来源;在 64 项以上
PATH 的机器上优先发现活动 `<user>\miniconda3\python.exe`,真实诊断为
Python `3.13.13 · amd64`,刷新后持久设置仍为 `managed`。
### 2026-09-02 菜单阶段
- 完成“能力与工具”一级菜单及 Skills/MCP Tab,并修复可滚动 Flex 布局将页签压缩为零
高度的问题;加入 `flex: 0 0 auto` 回归约束。
## 进度维护要求
- 只有真实源码和生产路径完成后才能勾选对应实施项。
- 测试失败时保留未完成状态并记录失败原因。
- 每次更新记录日期、实际命令、结果和外部阻塞。
- 不在本文件复制未来设计,需求变化回写 PRD/UI/技术设计。
@@ -0,0 +1,370 @@
# 工具执行环境技术设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,跨平台验收中 |
| 版本 | 0.2 |
| 日期 | 2026-09-02 |
| 关联 PRD | [工具执行环境 PRD](./prd.md) |
| 功能逻辑 | [工具执行环境功能逻辑设计](./logic-design.md) |
| 相关架构 | [DeepSeek Harness Runtime 设计](../deepseek-harness/technical-design.md)、[SSH 远程主机与 GoodBuddy Agent 实现说明](../remote-host/technical-design.md) |
## 1. 当前基线
GoodBuddy 已具备:
- Electron 内置 Node Runtime。
- 安装包中的锁定 npm CLI。
- DSH 插件安装器使用的 `process.execPath + ELECTRON_RUN_AS_NODE=1` shim。
- OpenCode、Continue、DeepSeek Harness 的独立本机进程环境入口。
- SKILL 按 Runtime 目标分配和暂存。
- Main 和 Runtime 的 stdio MCP 启动链路。
- Runtime 可执行文件探测、版本读取和自定义路径模式。
- 下载、摘要校验、进度、取消和暂存清理模式。
当前缺少统一工具来源设置、通用 PATH 注入和托管 Python。
## 2. 设置契约
```ts
type LocalToolEnvironmentSelection =
| { source: 'managed' }
| { source: 'custom'; executablePath: string }
type LocalToolEnvironmentSettings = {
node: LocalToolEnvironmentSelection
python: LocalToolEnvironmentSelection
artifactDownloadSource: 'native' | 'oss'
}
```
只持久化用户意图。不持久化候选列表、版本、PATH、shim 路径、诊断结果或可重新读取的托管
包元数据。
### 2.1 兼容迁移
- 全新用户默认 `managed`。
- 旧设置没有该字段时,Main 按升级前 PATH 分别解析有效 Node 和 Python 3。
- 有效候选写成 `custom + 规范化绝对路径`。
- 没有有效候选时写成 `managed`。
- 新增的 `artifactDownloadSource` 默认迁移为 `native`。
- 迁移只执行一次,后续 PATH 变化不改变选择。
## 3. Main 服务
新增一个 `LocalToolEnvironmentService`,负责:
- 设置读取和保存。
- Node/Python 候选探测。
- 自定义解释器诊断。
- 当前工具组合解析。
- 受管工具 bin 创建。
- 托管 Python 安装、更新、删除。
- 有界状态和进度发布。
- 应用退出时取消安装并清理本次暂存。
不为每项职责增加持久 Manager、注册表或恢复状态机。失败安装删除暂存,下次重新执行。
## 4. 解析结果
```ts
type ResolvedLocalToolEnvironment = {
binDirectory: string
node?: {
executablePath: string
npmCliPath?: string
npxCliPath?: string
}
python?: {
executablePath: string
}
}
```
工具 bin:
| 平台 | 命令 |
| --- | --- |
| Windows | `node.cmd`、`npm.cmd`、`npx.cmd`、`python.cmd`、`python3.cmd`、`pip.cmd` |
| macOS/Linux | `node`、`npm`、`npx`、`python`、`python3`、`pip` |
shim 使用绝对路径。`pip` 固定调用 `<python> -m pip`,避免解释器错配。
## 5. Node.js 托管环境
托管 Node shim:
```text
ELECTRON_RUN_AS_NODE=1 <process.execPath> <arguments...>
```
约束:
- 复用 DSH 已有的平台转义实现。
- `ELECTRON_RUN_AS_NODE` 不写入 Main 全局环境。
- npm/npx 使用安装包中同一锁定 npm 发行版的 CLI。
- npm 子进程范围设置 `npm_execpath` 和 `npm_node_execpath`。
- 自定义 Node 只使用与其配套且验证成功的 npm/npx,不混入 GoodBuddy npm。
- 普通 JavaScript 和 Node 内置模块属于支持路径。
- 普通 Node 原生扩展可能受 Electron ABI 影响,不承诺兼容。
## 6. Python 托管环境
### 6.1 包
- 使用包含 pip、venv、SSL 和标准库的固定 CPython 独立发行包。
- 每个平台/架构锁定一个版本。
- Windows x64 原生工件来自官方 `python` NuGet 包,Windows ARM64 来自官方
`pythonarm64` NuGet 包。
- macOS/Linux 原生工件来自 Astral `python-build-standalone`。
- 目录包含版本、平台、架构、字节数、SHA-256、原生 Target 和 OSS Target。
- OSS 对象直接复制原生工件字节,不重新压缩或转换。
- 安装包不无条件携带完整 Python。
具体发行包和版本必须在实现前完成六平台工件、维护状态和 pip/venv 可用性核验。
目录示例:
```ts
type ManagedToolArtifact = {
id: string
version: string
platform: NodeJS.Platform
architecture: string
size: number
sha256: string
downloads: {
native: {
url: string
redirectHosts: string[]
}
oss: {
url: string
}
}
}
```
URL 只存在于 Main/构建目录,不进入 Renderer。两个 Target 共用顶层 `size` 和 `sha256`,
从 schema 上禁止声明不同字节。
### 6.2 安装
```text
读取固定目录
→ 下载到 GoodBuddy-owned 暂存
→ 校验大小和 SHA-256
→ 解压到新版本目录
→ 运行完整环境诊断
→ 发布为当前托管 Python
→ 删除暂存
```
失败保留已验证旧安装。删除只作用于 GoodBuddy-owned Python 目录。
### 6.3 包依赖
首期提供解释器和 pip,不自动扫描或安装任意 `requirements.txt`。第三方包由 SKILL/MCP
安装流程或用户明确命令准备。出现可复现的包冲突后,再评估能力级虚拟环境。
## 7. 自定义环境探测
### 7.1 Node
候选来源:
- GoodBuddy 启动时继承的合并 PATH,其中包含操作系统提供的用户 PATH 和系统 PATH。
- 当前 `VIRTUAL_ENV`、`CONDA_PREFIX`、`NVM_HOME`/`NVM_BIN` 和 `VOLTA_HOME`。
- Windows 用户目录和 ProgramData 下的 Conda/Miniconda/Anaconda base 与 `envs`,
LocalAppData Python,以及 Program Files/系统盘常见 Node/Python 目录。
- macOS/Linux 的 `/usr/local/bin`、`/usr/bin`、Homebrew、本地用户 bin、Python
Framework、Conda、pyenv 和 nvm 常见目录。
- `CONDA_ENVS_PATH` 中的有界环境目录。
- 已保存路径。
目录枚举有总量和单目录上限,不递归扫描整块磁盘。每个候选使用分离参数启动检查,确认
普通文件、成功退出、可解析版本和架构,并按真实路径去重。
### 7.2 Python
- Windows 探测 `python.exe`。
- macOS/Linux 优先 `python3`,其次为明确的 Python 3 `python`。
- Conda/venv 候选使用各环境自己的解释器,不依赖环境激活脚本。
- 拒绝未安装的 Windows Store App Execution Alias。
- 诊断 Python 3、版本、架构和解释器绝对路径。
单候选和总探测具有超时、输出上限、取消和进程树清理。
## 8. 完整诊断
### 8.1 Node
- `node --version`
- 加载标准库
- 启动最小子进程
- `npm --version`
- `npx --version`
- npm/npx 实际 Node 来源一致
### 8.2 Python
- Python 3、版本和架构
- 标准库导入
- SSL/证书模块
- `python -m pip --version`
- 在临时目录创建最小 venv
诊断不联网,使用 GoodBuddy-owned 临时目录并清理。
## 9. 环境注入
新启动的以下本机进程将工具 bin 放到现有筛选 PATH 前面:
- OpenCode Server。
- Continue Utility Process。
- DeepSeek Harness Utility Process。
- Main 启动的 stdio MCP。
- Runtime 启动的 stdio MCP。
不注入 Main 全局环境、Renderer、普通终端、SSH 请求、Agent 或远程 Runtime。
设置变化后,有活动请求的 Runtime 保持启动时快照;空闲 Runtime 在下次使用前使用既有
重建入口。已运行 MCP 在正常关闭、重连或显式测试后使用新环境,不增加热切换协议。
## 10. SKILL 与 MCP
SKILL 稳定调用命令名,不接收真实安装路径。
- `resources/skills` 顶层只保留五个带 `SKILL.md` 的独立包:
`deai-writing`、`longdoc-docx`、`product-evidence`、`product-marketing`、
`product-presentation`。
- 九种纯 Markdown 产品营销配方位于 `product-marketing/workflows/<route-id>/`,
使用 `WORKFLOW.md` 与同目录 `templates/`,不参与顶层 Skill 发现。
- `CapabilityService` 仅在状态中没有该 ID 时应用默认值。三个产品营销 Skill 默认
`enabled: false`;两个通用文档工具和导入 Skill 维持默认启用。显式保存状态不迁移、
不覆盖。
- 默认停用的 Skill 不进入 Runtime 指令和原生 Skill 包列表;用户启用后沿用现有四个
Runtime 分配。
stdio MCP:
- 裸 `node`、`npm`、`npx`、`python`、`python3`、`pip` 使用工具 bin。
- `env node`/`env python3` 脚本通过 PATH 使用同一来源。
- 绝对 command 保持原样。
- HTTP/SSE 不受影响。
- 工具环境不自动安装 MCP 第三方依赖。
## 11. Renderer 状态与 IPC
### 11.1 统一设置分类
- `settingsCategoryList` 用一个 `capabilities` 分类替换现有 `skills`、`mcp` 分类,不增加
`sdk` 分类。
- 新增 `CapabilitiesAndToolsSettingsSection`,在统一分类标题下使用共享 `PageTabs` 渲染
第一阶段的 `skills | mcp`。
- `SkillsSettingsSection` 和 `McpSettingsSection` 继续拥有各自业务状态;嵌入时不重复渲染
一级分类标题。MCP 原有内层 `PageTabs` 保持独立。
- `ToolEnvironmentSettingsSection` 只承载工具下载源、Node.js、Python 和诊断。
- 当前源码没有 Settings 外部 Skills/MCP 定向入口,第一阶段不增加未使用的
`initialCapabilityTab`。未来出现真实定向入口时再增加会话级初始 Tab 参数。
- 普通进入 `capabilities` 时默认 `skills`。外层选中值只存在于当前 Renderer 会话,不写入
Shared 设置。
- 为避免切换时丢失编辑状态,外层面板首次访问时挂载,之后在本次设置面板会话中保留并用
`hidden` 控制可见性;关闭设置面板后按现有生命周期释放。
- 工具执行环境生产路径完成时,把 `tool-environment` 追加到同一个组件;完成前不注册
Tab、不渲染占位面板。
- 页签直接包装层使用 `flex: 0 0 auto`,并由 CSS 回归测试保证在滚动设置布局中不可收缩。
### 11.2 工具环境状态与 IPC
Renderer 接收:
- 当前选择。
- 当前实际来源、版本、路径。
- 有界候选列表。
- 托管安装状态、版本、占用空间。
- 工具诊断分项结果。
- 安装进度和脱敏错误。
- 受管工具工件下载源选择,以及活动任务实际冻结的来源。
Renderer 不能提交 PATH、环境变量、下载 URL、摘要、安装目录、shim 内容或任意命令参数。
所有 IPC 输入使用共享 Zod schema,Main 重新验证路径和解释器。
## 12. 受管工具工件下载
- 设置值为 `native | oss`,默认 `native`。
- 下载操作开始时读取并冻结设置。
- 解析目录中对应 Target;缺失即返回“当前下载源不可用”。
- 原生 Target 按每个上游声明严格 Host/重定向 allowlist。
- OSS Target 只允许 GoodBuddy 固定 OSS Host 和不可变对象前缀。
- 两种来源共用大小和 SHA-256 校验、暂存、取消、发布和清理逻辑。
- 失败不重试另一来源。
- 构建/发布流程先下载原生工件、校验,再把原字节同步到 OSS,并复核公开对象。
- 该设置不传给 pip/npm,不改写其 registry;也不参与模型、应用更新和 Agent 目录选择。
## 13. 权限与远程边界
- Ask/Execute 语义不变。
- 不新增解释器批准流程。
- 不上传 shim、Python、pip 包或自定义路径。
- 不修改 Host PATH。
- 不把本机 SKILL 或 stdio MCP 传给远程 ACP Session。
- 远程 Agent 固定 Node 继续只服务 Agent、模型桥和签名 Runtime。
## 14. 实施顺序
### 阶段 1:契约、迁移、探测和 UI
- Shared schema、设置迁移、IPC。
- 用“能力与工具”分类合并现有 Skills/MCP 入口,增加三个外层水平 Tab。
- 增加“工具执行环境”面板及原生/OSS 下载源设置。
- Node/Python 候选探测和完整诊断。
- 设置卡片和状态。
### 阶段 2:托管 Node 与执行链路
- 提取 DSH shim。
- 增加 node/npm/npx。
- 注入本机 Runtime 和 stdio MCP。
### 阶段 3:托管 Python
- 锁定六平台工件。
- 下载、校验、安装、更新、取消、删除。
- 增加 python/python3/pip。
### 阶段 4:真实端到端验收
- Node SKILL 与 MCP。
- Python SKILL 与 MCP。
- 自定义解释器。
- Ask/Execute、重建、取消和退出。
- 六平台打包。
这些阶段是开发顺序,不是可长期发布的残缺功能。合并能力前完成普通用户和专业用户的完整
生产路径。
## 15. 验证
单元测试覆盖设置迁移、探测、版本解析、shim 转义、PATH 顺序、失效路径、下载摘要和暂存
清理,以及原生/OSS 选择冻结、Target 缺失和禁止回退。
Renderer 测试覆盖统一一级分类、三个外层 Tab、默认 Skills、Skills/MCP 定向入口、会话内
状态保留、MCP 内外层 tablist 隔离、键盘切换和窄屏单行滚动。
集成测试覆盖安装包 Electron Node、npm/npx、托管 Python、三个本机 Runtime 和两类 stdio
MCP 的实际进程路径。
项目验证:
```text
npm test
npm run typecheck
npm run lint
npm run build
```
生产资源通过六平台原生 CI 打包验证。若后续改动触及 Agent、远程协议或远程 Runtime,
再按远程架构文档执行共享 Linux x64 Host 验证。
@@ -0,0 +1,305 @@
# 工具执行环境 UI 设计
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施 |
| 版本 | 0.2 |
| 日期 | 2026-09-02 |
| 关联 PRD | [工具执行环境 PRD](./prd.md) |
| 功能逻辑 | [工具执行环境功能逻辑设计](./logic-design.md) |
| 全局规范 | [GoodBuddy 统一界面设计系统](../../../UI-DESIGN.md) |
本文只定义本功能的界面结构和交互。颜色、字体、间距、通知、Switch、焦点和响应式行为以
全局设计系统为最终权威,不在本文件建立页面专属视觉体系。
## 1. 信息架构
设置中心把现有 `Skills`、`MCP` 一级分类和新增的工具执行环境合并为一个“能力与工具”
一级分类。内容区使用三个水平 Tab:
```text
[ Skills ] [ MCP ] [ 工具执行环境 ]
```
一级分类副标题固定为:
> 管理 Skills、MCP 和本机工具执行环境
“工具执行环境”不放入任一 Runtime 专属卡片。该 Tab 顶部持续显示:
> 用于新启动的本机 Runtime 和 stdio MCP;不修改系统环境,也不应用于普通终端或远程主机。
### 1.1 分阶段显示
第一阶段只实现统一菜单和现有能力页签:
```text
[ Skills ] [ MCP ]
```
此阶段不显示“工具执行环境”禁用 Tab、空页面或“开发中”占位。Node.js、Python 和工具下载源
真实可用后,再按本设计追加第三个水平 Tab。
“能力与工具”的页签条位于独立滚动的 Flex 设置内容区,直接包装层必须保持
`flex: 0 0 auto`,避免被下方长列表压缩到零高度。该规则同时服从根
[`UI-DESIGN.md`](../../../UI-DESIGN.md) 的 `PageTabs` 规范。
## 2. 页面结构
```text
能力与工具
管理 Skills、MCP 和本机工具执行环境
[ Skills ] [ MCP ] [ 工具执行环境 ]
Skills 面板
现有 Skill 启停、导入、状态和 Runtime 分配
五个内置 Skill;产品营销三个默认停用,通用文档工具两个默认启用
MCP 面板
现有 MCP 配置、凭据、状态和 Runtime 分配
[内置 MCP] [直连模型] [自定义 MCP] [电脑控制]
工具执行环境面板
范围说明
工具下载源
原生地址 / OSS 镜像
Node.js 卡片
来源
当前状态
自定义候选或路径操作
测试环境
Python 卡片
来源
当前状态
安装/更新/删除或自定义路径操作
测试环境
```
产品营销的九种文档配方不单独占用 Skill 卡片。用户启用 `product-marketing` 后,
由该 Skill 根据任务按需读取内部工作流。界面只展示能够独立启停和分配 Runtime 的
五个顶层内置 Skill;已保存状态覆盖产品默认值。
工具执行环境面板内的区块顺序固定为工具下载源、Node.js、Python,不再增加页签。
## 3. 三个水平 Tab
外层页签使用共享 `PageTabs` 的 `segmented` 视觉变体,不使用页面自定义 Tab 或普通
`SegmentedControl`:
```tsx
<PageTabs
ariaLabel="能力与工具设置"
idPrefix="capabilities-and-tools"
tabs={[
{ id: 'skills', label: 'Skills' },
{ id: 'mcp', label: 'MCP' },
{ id: 'tool-environment', label: '工具执行环境' }
]}
/>
```
交互规则:
- 普通入口默认打开 `Skills`。
- 现有 Skills/MCP 应用内入口分别定位到对应水平 Tab。
- 切换外层 Tab 不保存为产品设置,不修改任何 Skill、MCP 或工具环境值。
- 三个面板在同一次设置面板会话中保留编辑状态;切换后返回不得重置草稿。
- MCP 原有四个内层页签继续保留,外层和内层使用不同的 `aria-label` 与 `idPrefix`。
- 窄屏时外层页签保持单行并允许水平滚动,不折成多行,不替换为下拉框。
## 4. 工具下载源
使用原生 Radio Group:
```text
工具下载源
选择 GoodBuddy 受管 Runtime 和工具链的下载通道。
● 原生地址(默认)
从各工件的固定上游地址下载。
○ OSS 镜像
从 GoodBuddy OSS 下载相同工件。
```
邻近说明:
> 下载开始后会固定本次来源;失败时不会自动切换。该设置不影响模型、应用更新、Agent、
> pip/npm 依赖或用户配置的网络地址。
切换设置即时保存,不触发下载,不取消活动任务。成功通过应用通知反馈;保存失败恢复最后
确认值并在 Radio Group 附近显示错误。
## 5. 工具环境来源选择
每张卡片使用原生单选语义,只提供:
1. **GoodBuddy 托管(推荐)**
2. **自定义环境**
不显示“自动选择”“系统安装”“指定路径”三个交叉选项。自定义环境选中后,在同一区域展示
检测候选下拉框和“选择其他可执行文件”次操作。
“自定义环境”单选项始终可操作。尚无候选或已保存路径时,点击只展开选择区域并保持当前
实际来源,不把入口禁用,也不自动选择第一个候选。选择区域显示“刷新候选”和“选择其他
可执行文件”;只有用户明确选择且 Main 验证成功后才保存并切换来源。
文件选择取消不显示错误、不发送成功通知且保持选择区域展开。验证失败在对应 Node/Python
卡片的路径操作附近显示,保留原来源和原路径;不得只在页面顶部显示错误。刷新后出现候选
时通过正常列表更新呈现,不改变当前来源,焦点保持在触发操作或用户随后选择的候选上。
候选项格式:
```text
Node.js v22.14.0 · C:\Program Files\nodejs\node.exe
Python 3.13.2 · C:\Python313\python.exe
```
版本和绝对路径不能只放在 Tooltip 中。
## 6. Node.js 卡片
```text
Node.js
● GoodBuddy 托管(推荐)
Node.js vXX · 已就绪
npm 11.x · npx 11.x
○ 自定义环境
[Node.js v22.x · C:\Program Files\nodejs\node.exe ▼]
[选择其他可执行文件]
[测试环境]
```
托管 Node 随应用提供,不显示安装和删除操作。测试结果分别显示 Node、npm、npx,不能用
Node 成功代替整套组合成功。找不到配套 npm/npx 时,自定义 Node 可以保存,但状态显示
“Node.js 已就绪,npm/npx 不可用”。
## 7. Python 卡片
托管 Python 未安装:
```text
Python
● GoodBuddy 托管(推荐)
尚未安装
[安装]
○ 自定义环境
[Python 3.13.x · C:\Python313\python.exe ▼]
[选择其他可执行文件]
```
安装中使用卡片内进度:
```text
正在下载 Python 3.x
[================------] 68%
[取消]
```
安装后显示:
- Python 版本和架构。
- pip、venv 和 SSL 诊断状态。
- 安装占用空间。
- 有更新时的“更新”操作。
- “删除托管 Python”危险次操作。
删除确认说明受影响范围,不要求输入确认文字:
> 删除后,依赖托管 Python 的本机 SKILL 和 stdio MCP 将不可用。系统 Python、自定义环境
> 和项目文件不会被删除。
## 8. 两层状态
每张工具卡展示工具环境状态:
- 已就绪
- 尚未安装
- 正在安装
- 路径不可用
- 部分可用,例如 npm/npx 或 pip/venv 缺失
- 测试失败
- 可更新
SKILL/MCP 的能力详情展示能力依赖状态:
- 依赖已验证
- 依赖未验证
- 缺少第三方包
- 入口不可用
工具执行环境页不掌握具体 SKILL/MCP 的验证证据,因此不显示固定的“依赖未验证”占位
区块。只有对应能力产生真实验证结果后,才在该能力详情中展示上述状态。
不得把工具卡的“已就绪”复用为某个 SKILL 或 MCP 的“完全可用”。
## 9. 生效与刷新
保存后在卡片中持续显示:
> 对新启动的本机 Runtime 和 stdio MCP 生效。已运行进程不会中途切换环境。
设置保存成功、安装成功、删除成功和重新检测成功使用应用通知。版本、路径、安装进度和
阻塞错误留在卡片内,不同时显示重复通知。
## 10. 错误与恢复
- 自定义路径失效:保留路径和来源选择,显示“重新检测”和“选择其他文件”。
- 下载失败:保留已验证旧安装和安装按钮。
- 诊断部分失败:逐项显示失败项,保留成功项。
- 取消安装:恢复“尚未安装”或原已安装版本。
- 字段错误:就地关联到选择控件。
- Runtime/MCP 已运行:不显示为错误,只说明新进程生效。
- 工具下载源失败:保留当前选择,显示实际来源和重试,不提示自动回退。
## 11. 无障碍与键盘
- 外层使用 `tablist`/`tab`/`tabpanel`,支持左右方向键、Home、End 和 roving focus。
- 每个外层 `tab` 通过共享组件准确关联自己的 `tabpanel`。
- 来源使用 `radiogroup`/`radio` 语义。
- 安装、测试、更新、删除和文件选择使用语义按钮。
- 下载进度使用可命名的 `progressbar`。
- 状态不只依赖颜色,必须包含文字。
- 尚无自定义候选时不得禁用“自定义环境”入口;真正因活动操作禁用的控件仍提供可理解的
邻近说明。
- 切换到自定义环境后,焦点按正常 Tab 顺序进入候选选择框。
- 对话框关闭后焦点回到触发操作。
- 窄屏时卡片操作换行,不压缩版本和路径到不可读宽度。
## 12. 文案词汇
固定使用:
- 能力与工具
- Skills
- MCP
- 工具执行环境
- GoodBuddy 托管
- 自定义环境
- 工具环境已就绪
- 能力依赖已验证
- 新启动的本机 Runtime 和 stdio MCP
- 不应用于远程主机
- 工具下载源
- 原生地址
- OSS 镜像
不使用:
- 自动环境
- 系统模式
- 内置开发机
- 全局 Python
- 远程托管环境
- 开发环境
@@ -0,0 +1,330 @@
# 工具执行环境 User Stories
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 状态 | 已实施,验收中 |
| 版本 | 0.3 |
| 日期 | 2026-09-02 |
| 关联 PRD | [工具执行环境 PRD](./prd.md) |
| 关联逻辑 | [工具执行环境功能逻辑设计](./logic-design.md) |
## 1. 角色
### 1.1 普通用户
希望直接使用文档、演示文稿或数据处理 SKILL,不理解 Node.js、Python、pip 或 PATH。
### 1.2 MCP 使用者
希望配置一个本机工具服务,并由 GoodBuddy 解决其基础解释器启动问题。
### 1.3 专业开发者
已有明确的 Node、Python、虚拟环境或 Conda 环境,希望控制实际版本和绝对路径。
### 1.4 内网与离线用户
无法稳定访问公网,需要使用选定镜像或离线准备环境,同时不向远程 Host 传播本机配置。
## 2. Epic A:普通用户无需预装环境
### US-A0 首次看到准确默认状态
作为普通用户,我希望第一次打开设置时看到 GoodBuddy 已提供什么、还需要安装什么,以免
误以为所有工具都已就绪。
验收:
- 全新安装默认选择 GoodBuddy 托管 Node 和 Python
- 托管 Node 立即执行真实诊断并显示版本
- 未安装的托管 Python 显示“尚未安装”和安装入口
- 检测到的系统解释器只作为自定义候选,不改变默认来源
- “工具执行环境”Tab 持续说明只对新启动的本机 Runtime 和 stdio MCP 生效
### US-A1 直接使用托管 Node
作为普通用户,我希望安装 GoodBuddy 后即可使用 Node.js SKILL,以免单独安装 Node.js。
验收:
- Given 系统 PATH 没有 Node.js
- When 本机 Execute 请求运行普通 JavaScript SKILL
- Then `node` 使用 GoodBuddy 托管来源
- And `npm`、`npx` 与该 Node 来源一致
- And 设置显示实际 Node 版本
### US-A2 按需安装 Python
作为普通用户,我希望在设置中安装 Python,以便运行 Python SKILL 而不离开 GoodBuddy。
验收:
- Given 系统没有 Python 且托管 Python 未安装
- When 用户点击安装
- Then 页面显示下载、校验和安装进度
- And 成功后真实 Python、pip、venv 诊断通过
- And 失败不会留下半安装目录
### US-A3 看懂缺失依赖
作为普通用户,我希望区分“没有 Python”和“缺少 python-pptx”,以便采取正确修复操作。
验收:
- 工具解释器不可用时显示工具环境错误
- 解释器可用但能力包缺失时显示能力依赖错误
- 页面不把 `python --version` 成功描述为 SKILL 已完全可用
- 错误保留原任务和可执行的下一步
### US-A4 看懂部分就绪
作为用户,我希望知道解释器可用但配套命令损坏,以免把所有失败都理解为没有安装环境。
验收:
- Node 可用而 npm/npx 失败时显示“部分可用”和具体失败项
- Python 可用而 pip、venv 或 SSL 失败时显示“部分可用”和具体失败项
- 不依赖失败项的能力仍可通过实际诊断标记就绪
- 没有能力专属诊断时显示“依赖未验证”,不推断为就绪
## 3. Epic B:本机 MCP 使用一致环境
### US-B1 启动 Python MCP
作为 MCP 使用者,我希望 `python -m my_mcp_server` 使用设置中的 Python,以免配置第二套
解释器。
验收:
- 裸 `python`、`python3` 和 `pip` 解析到当前选择
- Main 直连工具链和本机 Runtime 使用相同来源
- 绝对命令路径不被替换
- MCP 自身包缺失时准确报告依赖错误
### US-B2 启动 Node.js MCP
作为 MCP 使用者,我希望 `node server.js` 或 `npx package` 使用同一 Node 组合。
验收:
- `node`、`npm`、`npx` 来源一致
- npm lifecycle 子进程使用当前 Node
- 取消或关闭应用后没有遗留 MCP 进程
### US-B3 保持网络 MCP 不变
作为 MCP 使用者,我希望 HTTP/SSE MCP 不受本机解释器设置影响。
验收:
- HTTP/SSE 配置不显示本机解释器要求
- GoodBuddy 不管理远端 MCP 服务端依赖
- 切换工具执行环境不重建 HTTP/SSE 服务
## 4. Epic C:专业用户明确控制环境
### US-C1 使用检测到的系统解释器
作为专业开发者,我希望从版本和绝对路径列表中选择解释器,以便使用已有工具链。
验收:
- “自定义环境”入口始终可操作,不因尚无候选而禁用
- 点击“自定义环境”只展开选择流程,不自动采用第一个候选
- 候选覆盖启动时继承的用户/系统 PATH、当前虚拟环境、Conda 环境和常见安装位置
- 候选经过真实版本和架构诊断
- 相同真实路径不重复显示
- 用户必须明确选择一个候选后才保存并切换来源
- 保存后状态显示实际生效来源
- PATH 后续变化不会自动替换选择
### US-C2 指定项目虚拟环境
作为专业开发者,我希望选择未被自动发现的 Python,以便使用自己的 venv 或 Conda 环境。
验收:
- 文件选择由 Main 管理
- 没有候选时仍可从“自定义环境”流程直接打开文件选择器
- 取消文件选择不报错、不保存,也不改变当前来源
- 保存前验证 Python 3、版本和架构
- 验证失败在 Python 卡片的路径操作附近显示,并保留原设置
- GoodBuddy 不安装、升级或删除该环境
- 路径失效时不静默回退
### US-C3 返回托管环境
作为专业开发者,我希望随时切回 GoodBuddy 托管环境,以便恢复标准组合。
验收:
- 切换前显示新启动进程才生效
- 新 Runtime 和 stdio MCP 使用托管来源
- 已运行进程不中途换环境
### US-C4 明确设置何时生效
作为专业开发者,我希望知道环境切换何时影响进程,以免一个运行中的任务突然换解释器。
验收:
- 保存前后都说明只对新启动进程生效
- 有活动请求的 Runtime 保持启动时环境
- 空闲 Runtime 在下一次使用前按现有入口重建
- 已启动 stdio MCP 在关闭、重连或显式测试后使用新环境
- 活动记录不根据最新设置改写历史解释器来源
## 5. Epic D:范围和生命周期可理解
### US-D1 不影响远程主机
作为远程项目用户,我希望清楚知道本机环境不会上传到 Host,以免错误预期远程脚本可用。
验收:
- “工具执行环境”Tab 显示范围说明
- 远程主机设置页显示本机 Skills 和 MCP 不适用
- Host PATH、Agent 包和 Runtime 包不包含本机选择
### US-D2 删除托管 Python
作为用户,我希望删除不再使用的托管 Python,以便释放磁盘空间。
验收:
- 删除前说明受影响的本机 SKILL 和 MCP
- 只删除 GoodBuddy-owned Python 目录
- 不删除系统、自定义或工作区文件
- 使用中的进程先按现有生命周期停止
### US-D3 升级后保持既有解释器
作为现有用户,我希望升级 GoodBuddy 后已有脚本仍使用原来的系统解释器。
验收:
- 首次迁移把有效系统解释器保存为自定义绝对路径
- 无有效解释器时才选择托管来源
- 迁移结果只写一次
### US-D4 取消 Python 安装
作为用户,我希望可以取消耗时的 Python 安装,并在之后重试。
验收:
- 下载、校验、安装和候选诊断阶段都响应取消
- 取消后清理本次暂存
- 取消不发布未验证候选
- 页面回到操作前的未安装状态或健康旧版本
- 取消不显示为安装失败
### US-D5 安全更新托管 Python
作为用户,我希望更新托管 Python 失败时仍能使用旧版本,以免现有能力全部中断。
验收:
- 下载和验证候选期间旧版继续服务已有进程
- 应用更新前说明需要停止哪些本机 Runtime/MCP
- 用户确认后才通过现有生命周期停止相关进程
- 无法停止时不替换当前版本
- 候选完整诊断成功后才发布
- 更新失败继续使用健康旧版本
### US-D6 安装解释器不扩大 Ask 权限
作为 Ask 用户,我希望安装 Node/Python 后仍保持原有只读边界,以免环境准备改变授权范围。
验收:
- 工具环境不新增 Runtime 工具
- Ask 是否允许命令仍由当前 Runtime 边界决定
- Ask 中禁止的写入和执行不会因解释器存在而放行
- Execute 继续使用用户已授权的本机账号权限
## 6. Epic E:受限网络与离线行为明确
### US-E1 通过所选官方来源安装 Python
作为内网用户,我希望在“工具执行环境”Tab 中选择原生地址或 OSS 镜像,以便符合当前
网络条件。
验收:
- 默认使用 Python 工件的固定原生地址
- 选择 OSS 后,Python 只请求固定 OSS 对象
- 页面显示本次下载冻结的来源和准确失败原因
- 同一次安装不在原生地址和 OSS 之间静默切换
- 失败保留健康旧版本或未安装状态
### US-E2 完全离线时使用已有环境
作为完全离线用户,我希望清楚知道首期可用路径,以免等待一个无法完成的下载。
验收:
- 托管 Node 安装后可离线使用
- 托管 Python 未缓存且来源不可达时明确说明无法下载
- 首期不展示未实现的 Python 离线导入入口
- 用户可以选择设备上已经离线安装的自定义 Python
### US-E3 所有受管工具工件遵循同一下载通道
作为用户,我希望未来新增的受管 Runtime 和工具链遵循同一个下载源选择,以免每种工具
产生不同规则。
验收:
- 受管工具目录中的每个外部工件同时声明原生地址和 OSS Target
- 两个 Target 对应相同字节数和 SHA-256
- 下载任务开始后冻结来源
- 所选来源缺少该工件时明确显示不可用
- pip/npm 依赖、模型、应用更新、Agent 和用户 URL 不受该设置影响
## 7. Epic F:统一管理能力与执行环境
### US-F1 从一个入口管理相关能力
作为用户,我希望从一个设置入口访问 Skills、MCP 和工具执行环境,以便理解能力配置及其
本机依赖之间的关系。
验收:
- 设置中心只显示一个“能力与工具”一级分类
- 第一阶段依次显示 `Skills`、`MCP` 两个水平 Tab
- 工具执行环境完成后在同一组中追加第三个 `工具执行环境` Tab
- 未完成前不显示禁用或占位的 `工具执行环境`
- 首次进入默认打开 `Skills`
- 每个 Tab 使用独立、可命名的 `tabpanel`
- 水平 Tab 支持方向键、Home、End 和可见焦点
- 窄屏时页签保持单行横向滚动,不换成多行或下拉框
### US-F2 保持业务数据和编辑状态
作为现有用户,我希望合并设置导航后原有 Skills 和 MCP 配置保持不变,并且切换水平 Tab
不丢失正在编辑的信息。
验收:
- 原独立 Skills/MCP 左侧分类由一个“能力与工具”分类替代,不保留重复入口
- 合并导航不修改 Skill 启停、导入、分配或 MCP 配置、凭据和分配数据
- MCP 原有内部分组页签继续位于 MCP 面板内
- 切换三个外层 Tab 后返回时保留本次设置面板会话中的编辑状态
- 关闭并重新打开设置时,普通入口仍默认显示 Skills,不持久化上次外层 Tab
- 未来新增 Skills/MCP 定向入口时打开对应水平 Tab
### US-F3 聚焦默认内置能力
作为普通用户,我希望默认只加载通用文档工具,不让低频产品营销说明占用每次会话的上下文。
验收:
- Skills 列表只把五个具备独立入口或执行器的内置能力显示为顶层 Skill
- 产品营销的九种文档配方从 `product-marketing` 内部按需读取
- `deai-writing` 和 `longdoc-docx` 在没有保存状态时默认启用
- 三个产品营销 Skill 在没有保存状态时默认停用
- 用户显式保存的启停状态和 Runtime 分配不因版本升级而重置
- 用户导入的 Skill 继续使用现有默认启用和 Runtime 分配规则
+11
View File
@@ -0,0 +1,11 @@
# 记忆
记忆定义 GoodBuddy 的用户、项目和会话记忆分区、写入边界、召回和治理。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [分区记忆 PRD](./prd.md) | 记忆范围、分区、生命周期和产品验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
@@ -7,7 +7,7 @@
| 状态 | 设计中 |
| 版本 | 0.3 |
| 日期 | 2026-08-19 |
| 依赖 | [自动化平台总体设计](../../architecture/automation-platform-architecture.md)、[智能心跳 PRD](../smart-heartbeat/smart-heartbeat-prd.md)、[Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) |
| 依赖 | [自动化平台总体设计](../../architecture/automation-platform-architecture.md)、[智能心跳 PRD](../smart-heartbeat/prd.md)、[Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) |
## 1. 背景
@@ -0,0 +1,11 @@
# 并行实验
并行实验定义多个候选方案、模型或执行分支的受控比较、评估与结果选择。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [并行实验工作台 PRD](./prd.md) | 实验对象、工作台流程、评估和验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
+13
View File
@@ -0,0 +1,13 @@
# 远程主机与远程执行
本功能负责 SSH Host 管理、Host Key、远程环境安装、GoodBuddy Agent、签名 Runtime、
远程 Workspace 和 Ask/Execute 生产路径。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [远程主机与 Agent 技术设计](./technical-design.md) | 当前产品语义、Agent、Runtime、Workspace、协议、生命周期和验证事实 |
| [远程环境准备技术设计](./environment-provisioning-technical-design.md) | Host 下载、GoodBuddy 传输、安装事务、更新和恢复边界 |
现有文档包含产品、功能逻辑和进度事实,后续修改远程功能时再按标准职责拆分。
@@ -0,0 +1,329 @@
# SSH Host 远程环境准备与直连下载设计
## 状态
本文记录 2026-08-28 确认的目标设计及当前实施状态。源码已经实现 Host 手动准备、
GoodBuddy 传输、Host 直连下载、control-plane one-shot installer、发布后健康 adoption,
以及项目路径只验证已安装环境。Host 负责 Agent/Runtime 的安装与更新生命周期,项目流程
只消费已经准备好的 Host 环境。
当前源码可以直接使用既有 package format v1 `.gbagent`:归档已经包含固定 Agent 和
Node,installer 由 GoodBuddy 桌面控制面打包并通过固定 SSH prepare channel 单次发送,
不要求归档包含 `agent/lib/package-installer.cjs`,签名目录也不提供或检查额外的
bootstrap 能力元数据。公开直连能力仍须完成本文末尾 GitHub/北京镜像、Linux x64/arm64、
取消和离线 GoodBuddy 传输的真实 Host 验收;本文
不表示这些验收或新的 Agent 发布已经发生。当前实现细节同时以
[SSH 远程主机与 GoodBuddy Agent 实现说明](./technical-design.md)
和源码为准。
## 设计结论
将安装和更新从项目切换移到 Host 管理是合理的,原因如下:
- Agent、固定 Node 和 OpenCode Runtime 安装在 SSH 账号 Home 下,由同一 Host/账号上的
多个项目共享,不属于某一个 Workspace。
- 大文件传输发生在项目切换时会阻塞导航,也把 Host 级故障误显示成项目故障。
- Host Key、认证、平台和架构本来就在新增 Host 时验证,此时继续只读探测并在 Host 卡片
提供手动准备入口最容易理解。
- 项目只保存 Host ID、远端路径、Runtime 选择和默认工作模式。Agent installation、
Runtime digest、Workspace identity 和 Host revision 都从当次连接取得,不写入项目;
“移出安装”不等于“跳过当前环境检查”。
目标职责是:
| 流程 | 职责 |
| --- | --- |
| 新增或重新验证 Host | 验证身份和认证,保存 Host 并探测环境,不传输安装包 |
| Host 管理 | 用户明确刷新目标 Host,并可选择安装、同版本重修、取消和重试 |
| 创建远程项目 | 只读本地 Host 验证记录,保存时连接所选 Host 并验证当前 Agent、Workspace、Runtime 和模型配置,只持久化稳定配置 |
| 切换远程项目 | 只切换本地项目配置,不连接 Host;实际使用 Workspace 或 Runtime 时按需复用 Host 当前环境 |
## 不变量
- Host 配置与远程环境准备是两个事务。SSH 验证成功后先原子保存 Host、凭据和完整 Host
Key,再开始可能耗时的下载和安装。
- 环境准备失败或取消时保留已保存 Host,显示“未就绪”并允许重试,不创建半完成项目。
- 不把“环境健康”保存为长期可信布尔值。设置页从 Host 的签名 registry 和当前 Host
identity 派生版本状态;准备完成和实际使用时再执行 bootstrap/health。合法但暂未运行的
detached Agent 仍可显示为已安装,打开设置不能为了刷新卡片隐式启动或更新它。
- 所有安装继续使用 GoodBuddy-owned staging 和 side-by-side digest 目录。失败不得覆盖
可用旧安装,也不得删除 Host 上无关文件。
- Renderer 不接收下载 URL、缓存路径、签名 key、digest、SSH 命令或凭据。Main 负责来源
选择、可信目录解析、操作编排和 IPC 输入校验。
- 产品不提供“自动安装远程环境”开关。保存、重新验证或打开 Host 都不能自动传输
`.gbagent`;只有用户点击 Host 卡片的主按钮后,Main 才开始准备。
- Host 卡片只有一个主按钮,按版本事实显示“安装远程环境”“更新远程环境”或“重新安装”。
次级 SegmentedControl 选择“自动”“Host 下载”或“GoodBuddy 传输”;默认“自动”,只影响
下一次操作,不持久化为 Host 配置。
- “自动”只在 operation/prepare 前执行一次 Host capability probe:直连明确可用时选择
Host 下载,否则选择 GoodBuddy 传输。用户显式选择的方式保持有效;一旦 acquisition
已选定,prepare、commit 或 adoption 的任何失败都停止本次操作,不跨 acquisition
自动回退。
- 直连安装只要求已验证 SSH 连接和远端系统工具,不要求现有 Agent daemon。轻量能力探测
返回确定性缺少工具、空间、权限或来源不可达时说明原因;探测本身异常时仍允许用户点击
直连安装,由实际安装流程重新解析签名候选并通过 SSH 重试。
- 项目路径不得为了“方便”回退到隐式安装。Host 未就绪时应引导到 Host 设置,不在项目
切换器中启动大文件传输。
## 新增 Host 流程
新增向导保持现有 Host Key 和认证顺序,并在系统探针之后显示一次只读环境结果:
1. 输入名称、地址、端口、用户名和认证方式。
2. 在发送认证材料前读取并确认 Host Key。
3. 完成 SSH 认证以及平台、架构、Shell、Home 有界探针。
4. 原子保存 Host、加密凭据和完整 Host Key。
5. 读取 Host 已安装的 Agent/Runtime registry,并执行一次轻量下载能力探测。
6. 如果已安装 identity 满足当前 GoodBuddy 要求,显示“版本匹配”并结束;该 badge 不代表
Agent 正在运行或环境健康。
7. 如果组件缺失或需要更新,显示目标 Agent、Node、Runtime、架构、来源和完整包大小,
告知用户保存后前往 Host 卡片安装,然后结束新增向导。
新增流程到此结束,不显示自动安装开关,也不自动开始环境安装。保存后的 Host 卡片提供
一个手动准备主按钮,并以次级 SegmentedControl 选择“自动”“Host 下载”或
“GoodBuddy 传输”。主按钮按版本事实显示“安装远程环境”“更新远程环境”或“重新安装”。
本地尚无精确包不要求用户先离开当前页面;选择 GoodBuddy 传输时,同一次操作会取得并
验证候选后继续上传。
探测不得自动下载完整 `.gbagent`。只有用户明确启动安装后才允许传输大包。
## Host 编辑
- 仅修改显示名称不要求重装远端环境。
- 地址、端口、用户名或 Host Key 变化时,旧 Host identity 立即失效,关闭旧连接和对应
Runtime 缓存。项目记录不含旧组件 identity;下一次打开直接解析新 Host 的当前环境。
保存新身份后只重新执行环境探测,所需安装由用户在 Host 卡片手动启动。
- 只替换同一目标的认证材料时仍重新认证并读取实际环境;如果签名 identity 和健康状态
未变化,不重复安装。
- 当前项目引用的 Host 被编辑时,Main 立即失效该 Host 的 identity 和连接缓存;下一次
Workspace/Runtime 操作按需使用新目标。环境未准备好时该操作失败,不回退旧连接。
## 下载能力探测
探测在 Host Key 已固定且 SSH 认证成功后执行,只检查当前选择的“关于与更新”来源:
- Host 是受支持的 Linux `x64` 或 `arm64`。
- SSH 账号 Home 可写,GoodBuddy-owned staging 可创建。
- 可用空间满足签名目录声明的包大小、解包上限和安全余量。
- Host 可以通过 HTTPS 访问所选 GitHub 或北京镜像 URL。
- 首次安装所需的下载、SHA-256 和运行归档内固定 Node 的能力可用。
- 已安装 Agent 是否报告未来的直连更新能力。
探测使用小型签名目录或有界请求,不以一次成功 `HEAD` 代替真实安装验证。结果只用于当次
展示,不持久化为永久能力;开始安装前重新检查,因为网络、代理和磁盘状态可能变化。
探测失败不能阻止保存 Host,也不能禁用显式 GoodBuddy 传输或离线导入路径。显式选择
Host 下载时由实际操作报告不可用原因;“自动”只把“直连明确可用”作为选择 Host 下载的
条件,其他结果选择 GoodBuddy 传输。
## 工件选择与来源
Main 继续读取并验证 `agent-catalog.json`、`agent-catalog.sig` 和 production 公钥
registry,按以下条件选择唯一候选:
- Host 平台和架构匹配;
- 最低桌面版本满足;
- Agent protocol major 相同,minor 不高于桌面支持值;
- 使用满足条件的最高 SemVer;
- URL、文件名、大小和 SHA-256 来自签名目录;
- 下载来源跟随“关于与更新”的 GitHub/镜像选择。
远程下载只优化大包的网络路径。Main 仍需先取得并验证小型目录,再通过经过 Host Key
验证的 SSH 控制面传递固定候选元数据。产品不接受 Renderer、项目、Host 文件或用户输入的
任意下载 URL。
## 获取与统一安装事务
首次安装不能假设 Host 已有 GoodBuddy Agent、installer 或系统 Node,也不由既有 Agent
daemon 参与。两种 acquisition 的差别只在于如何把同一个签名 compound `.gbagent` 交付到
固定 operation staging:
- **Host 下载**:控制面通过固定 SSH prepare channel 发送签名目录绑定的 URL、大小和
SHA-256;Host 有界下载并校验完整归档。
- **GoodBuddy 传输**:显式选择时,在线目录不可用或本地已验证包版本不低于在线候选,
则优先使用本地包,包括版本更高的离线导入;线上存在更新且可用时仍取得线上新包。
需要下载时,同一次用户操作会验证 SHA-256 和签名、写入缓存并取得 lease。随后以有界
流式 SFTP 上传一个 compound archive,以及从该归档中已验证的 bootstrap Node。约
294 MiB 的完整包不会一次读入 Main `Buffer`,Host 收到后仍再次校验完整包。
交付后两种 acquisition 完全共用一个 control-plane 事务:
1. Main 创建带 operation ID、总时限、输出上限和取消信号的准备操作,并通过固定
`prepare` channel 发送有界 one-shot installer 与结构化输入。
2. Host 在解包写入准备目录的同一遍处理中校验归档大小、SHA-256、外层及内层签名、
平台、架构、协议和每个 payload digest;不再先完整扫描 payload、再重复解包和哈希。
3. `commit` 只复核有界的签名 manifest、准备回执和入口 metadata,再以目录 rename 发布
已准备内容及包内认证的公钥 registry/Runtime lock;不会重读归档或遍历 payload。
4. commit 后在同一条已固定身份的 SSH lease 上执行 Agent bootstrap/readiness 和 Runtime
activate。新 Agent 最多完整验证一次,新 Runtime 最多完整验证一次;注册成功后的
health、capabilities 和 prompt 启动只读取 registry、签名 manifest 与入口 metadata。
5. Main 确认 adoption 后显式执行 cleanup。cleanup 失败不回滚已经健康的 Agent/Runtime,
也不阻塞下一次更新。
这不是两个并行安装管理器,也不存在把 Agent 与 Runtime payload 逐文件走 SFTP 安装的
第二条路径。两种 acquisition 共享相同的 prepare、commit、adoption、finalize 与 cleanup。
Host 缺少可靠的下载、SHA-256 或 ZIP 能力时,不自动安装系统软件,也不要求 root。显式
Host 下载返回明确失败;本次操作不自动切换 acquisition,用户可改选 GoodBuddy 传输后
重新点击主按钮。后续更新和同版本重装复用同一事务,不要求用户先通过项目切换完成
“过渡升级”。
## 本机传输与离线路径
现有 `.gbagent` 本地缓存、在线下载、离线导入和导出继续保留:
- GoodBuddy 路径在本地缺少精确候选时,于同一次操作完成下载、整包大小与 SHA-256、
全部签名和 payload 验证、缓存发布及 lease 获取。
- SFTP 有界流式上传单个 compound archive 与其中已验证的 bootstrap Node 到操作自己的
staging;Main 不把完整归档读入内存,Host 再次校验后进入统一 control-plane 事务。
- Host 无公网、代理/TLS 异常或缺少 bootstrap 工具时,用户可显式使用此路径;离线导入
后也走同一缓存 lease、上传和 Host 校验流程。
- 本地项目和普通桌面打包不依赖任何远端 Agent 工件。
## 完整包与发布
第一阶段继续发布和下载完整复合 `.gbagent`,不同时引入组件化增量发布:
- 远程直连和 GoodBuddy 本机下载都会传输完整包,其中包含 Agent、固定 Node 和 OpenCode
Runtime。
- 每次显式安装或重装都从本次已经校验并解包的准备目录原子替换对应 Agent 与 Runtime
digest 目录,不为节省本机磁盘写入而重新遍历旧目录,也不使用跨安装硬链接。
- 操作中断后不续写旧 operation。下一次更新尽力清理其 staging,并从签名候选重新
prepare;正常 cleanup 随后删除本次准备目录。
只有真实包体和发布频率证明网络成本仍不可接受时,才另行设计 Agent、Node 和 Runtime
独立签名组件目录;本功能不提前引入第二套发布协议。
## Host 准备状态
设置中的 Host 卡片分开表达版本事实和操作结果:
- **未验证**:Host Key、认证或系统探针尚未完成。
- **尚未安装**:Host 可连接,但 Agent 或 Runtime 缺失。
- **需要更新**:已安装 identity 与当前兼容候选不一致。
- **正在准备**:正在探测、下载、验签、安装或健康检查。
- **版本匹配**:版本 badge 只表示 Agent/Runtime identity 与当前兼容候选匹配,不等同于
进程正在运行或环境健康;设置页普通刷新不会启动已停止的 Agent。
- **准备失败**:保留 Host 和可用旧组件,展示有界错误与重试入口。
主按钮按版本事实显示“安装远程环境”“更新远程环境”或“重新安装”。重新安装失败后,
界面显示本次操作未完成,并以随后重新检查的版本卡片表达当前事实,不在提交结果不确定时
断言旧版本未被替换,也不得把“版本匹配”改称“环境健康”。统一进度以 `探测`、
`下载/传输`、`校验`、`应用环境`、`Agent 激活与健康检查`、`Runtime 激活` 和
`完成设置` 表达用户可理解的阶段。
同一 Host identity 同时只允许一个由用户启动、Main-owned 的准备操作。重复观察者加入
已有操作,不启动第二次发布;窗口关闭、显式取消、Host identity 改变或 Main 退出时执行
有界取消。Main 只为该 Host 持久化一个不含凭据的 version-1 pending operation ID,用于
下一次操作开始时尽力清理旧 staging。无论旧 cleanup 成功、目标已变化还是旧记录损坏,
都删除这条可丢弃记录并开始 fresh prepare;不保存远端 metadata 副本,不续写旧 commit,
也不跨重启恢复 adoption。当前操作中可确定的失败会立即尽力 cleanup。环境已健康后的
cleanup 失败不回滚环境,也不阻塞下一次更新。
## 项目创建与切换
- 新建托管 SSH 项目弹窗只读取本地 Host Key/连接验证记录,不逐台连接或刷新版本。只有
已完成本地验证的 Host 可选;浏览目录或保存时才连接所选 Host,并由保存流程完整检查
Agent、Workspace 和 Runtime,但不隐式安装。
- 项目保存验证 Host 当前 revision 与 Host Key generation、当前 Agent、Workspace、
Runtime、模型 profile 和 Ask/Execute 配置;SQLite 事务只写入 Host ID、规范远端路径、
Runtime 选择和默认工作模式。
- 打开或切换已有项目只提交本地项目选择,不执行 SSH、registry、Workspace 或 Runtime
检查。首次实际使用远程 Workspace 或 Runtime 时才解析 Host 管理的当前 Agent/Runtime,
并建立或复用当前 Agent 连接。已安装 Agent 暂未运行时,
固定 `attach-or-bootstrap` 命令幂等启动 registry 中的 current identity;这里的
bootstrap 只启动进程,不安装组件,也不重新读取、哈希或验签完整 payload。
Agent 进程读取 Host 管理已提交的 registry 和匹配 manifest 元数据,不重新验签或扫描
完整安装 payload。
- Workspace 和 Runtime 使用当前 Agent 连接产生的 live handle/lease。项目不保存或核对
历史 Workspace/Runtime identity;当前 registry、连接状态或 capability 无效时停止并
引导到 Host 管理,不在项目流程中下载或安装。
- 桌面更新导致 Host 组件过旧时,项目保持未切换并提示前往 Host 设置。应用启动仍进入
第一个普通本地项目,不自动连接或更新远端 Host。
- Host 环境更新成功后,Main 定向失效该 Host 的 Agent/Runtime identity、连接和 Runtime
会话缓存。所有项目在下一次实际操作时自然使用新的 current 环境;无需改写项目记录。
- 环境准备失败时不改变已有项目绑定。Host identity 编辑失败时则继续保持 fail-closed,
因为旧身份不能替代用户刚保存的新身份。
- 项目管理入口与项目选择分离。项目选择器中的浮动管理按钮直接打开目标项目设置;删除
不访问 Workspace、Agent 或 Host,因此远端目录已删除或 Host 不可达都不能阻止本地
项目记录清理。删除当前项目或 Host 级联删除当前项目时只回退到普通本地项目。
- 项目选择器把托管 SSH 项目按已保存 Host 分组,并只读取 Main 当前持有的 Agent 连接
状态显示“未连接 / 连接中 / 就绪 / 异常”;打开菜单或读取状态不得隐式连接 Host。
Host 已承担类型与连接语义,项目副标题只显示远端工作目录。
- Host 删除确认使用本地数据库列出全部引用项目,包括归档项目;确认后级联删除本地项目
及其会话、任务、成果、记忆、计划和心跳关联,再删除本地 Host 与凭据。整个流程不发起
SSH,也不删除远端内容;跨 Host 设置文件与 SQLite 的普通失败会恢复已写入的一侧。
项目切换不展示远程激活进度,也不阻塞项目导航。`Host`、`Agent`、`Workspace`、`Runtime`
和 `Saving` 进度只属于新建或显式保存项目;实际 Workspace/Runtime 操作使用正常的局部
加载和错误反馈。
## 实现结构
当前实现复用现有机制,没有新增平行的安装管理器:
- 扩展当前 Host 系统探针和远程环境 inspector,返回瞬时下载准备能力。
- 让当前 `RemoteEnvironmentUpdateService` 演进为 Host 环境准备编排器,统一用户手动
启动的首次安装和后续更新、自动 acquisition 选择、进度、取消和最终失效。
- Host 环境准备编排器直接完成一次 package prepare/commit 及 Agent/Runtime adoption。
Workspace 和执行路径只读取 current registry 并调用 Host 侧轻量 identity/health 检查,
在当前进程内复用已确认 identity 和 Agent 连接;Host 编辑或环境更新定向清空这些缓存。
这些路径不会取得安装包、发布组件或通过 SFTP 扫描 payload。
- Host 卡片即使显示相同版本也保留显式重装操作,用于修复 registry、签名或 payload
identity 异常;若同一 digest 的 GoodBuddy-owned 目录校验失败,重装会先隔离旧目录,
并在原子 commit 失败时恢复旧目录。commit 成功后的 adoption 失败保留新发布内容,
下次重装清理旧暂存并重新 prepare/adopt。重装不要求删除 Host、凭据或项目,也不会
处理所有者异常、符号链接或非 GoodBuddy 管理路径。
- 由桌面控制面打包有界 one-shot installer,并通过固定短命令 `exec sh -s` 和 stdin
发送脚本及结构化输入,避免 SSH command 长度限制;既有 package format v1 归档内固定
Node 负责解码和运行它。
- Preload 只暴露明确的 Host 探测、准备、取消和进度方法,不暴露 URL 或任意 SSH 命令。
- 现有 Agent/Runtime side-by-side、固定 SSH lease、Host 端一次完整验证、注册后轻量检查、
连接失效和项目稳定配置事务继续作为唯一实现。
## 迁移
- 已保存 Host 打开设置时只显示本地记录,不自动连接或检查版本;用户点击对应 Host 的
“刷新版本”后才执行只读状态探测。项目切换不依赖该按钮,也不建立连接。
- 数据库升级保留远程项目、Host ID、远端路径、Runtime 选择及关联会话/任务,并删除旧的
Agent/Runtime/Workspace/Host 验证列和 Runtime 验证表。下一次实际远程操作从 Host
current 环境重新取得所有 live identity。
- 如果 Host 未就绪或版本不兼容,项目仍可在本地选择,但实际远程操作失败;不再走旧的
隐式安装。
- 已下载或导入的本地 `.gbagent` 保持可用,不能因加入远程直连而迁移或删除。
- pending operation 保持 version 1,只记录 Host、目标 identity 与 operation ID,用于
尽力清理旧 staging;它不是远端环境状态或恢复日志。
- 远程直连继续使用现有 package format version 1,不要求归档携带 installer,也不要求
目录声明额外的 bootstrap 能力元数据。
## 验收标准
1. 新 Host 保存和探测完成后不会自动下载、上传或安装任何包,也不存在自动安装开关;
再次进入 Host 设置不会逐台连接,只有显式“刷新版本”才探测目标 Host。
2. Host 卡片只有一个按版本事实命名的主按钮;次级 SegmentedControl 提供默认且不持久化的
“自动”及显式“Host 下载”“GoodBuddy 传输”。没有预装 Agent、Node 或 Runtime 的 Host
可以完成准备;远程下载不可用时可手动改用 GoodBuddy 传输。
3. 探测不下载完整包,失败不阻止保存 Host;非确定性探测失败不禁用直连重试,安装失败
或取消后 Host 仍可重试。
4. 直接下载严格匹配签名目录中的 URL、大小和 SHA-256;GoodBuddy 传输可在同一次操作中
下载并验证缺失候选,以有界流式 SFTP 上传完整归档和已验证 bootstrap Node。Host 对
两者完成相同的外层与内层签名、路径、架构、协议和 payload 校验。
5. Host 对本次候选只完成一次完整 payload 校验;commit、adoption、health、capabilities
和 prompt 启动不得再次遍历或哈希完整 Agent/Runtime,显式重装仍能用本次准备内容修复
同 digest 的损坏目录。
6. 创建、打开和切换项目不会产生 `.gbagent` 下载、Agent payload SFTP 上传或安装目录发布。
7. 未就绪 Host 不能创建远程项目;已有项目仍可本地选择,但远程操作失败并引导到 Host 设置。
8. Host 编辑或更新后,引用项目使用 Host 管理的当前连接和 current registry,不读取项目
中的旧 Host/Agent/Runtime/Workspace identity;当前环境无效时才停止并要求在 Host 管理
中修复。
9. Host 地址、用户或 Host Key 在准备期间变化时停止候选发布,旧身份不会被重新启用。
10. GitHub、北京镜像、无公网 Host、取消、应用退出、磁盘不足、损坏下载和不支持架构均有
明确结果,且不触碰 GoodBuddy-owned 目录之外的文件。
11. Linux x64 和 arm64 均通过 GitHub/北京镜像、取消、离线 GoodBuddy 传输,以及项目使用
Host current 环境执行 Workspace/Runtime 操作的真实 Host 测试;这些真实 Host 验收当前
仍待完成。
12. Host 不可达或远端目录不存在时,用户仍可从项目浮动管理入口删除本地项目;删除 Host
会列出并本地清理全部关联项目,但不会连接 Host 或删除任何远端目录和内容。
13. 中断或 adoption 失败后的下一次更新只尽力清理旧 staging,然后 fresh prepare;
pending record 不包含远端 metadata 副本。已健康环境的 cleanup 失败不触发回滚,
也不阻塞下一次更新。
@@ -0,0 +1,510 @@
# SSH 远程主机与 GoodBuddy Agent 实现说明
## 状态
本文记录截至 2026-08-31 的当前代码实现,不定义额外的信任框架。“新增 Host 只探测、Host 卡片手动准备
Agent/Runtime、Host 直接从 GitHub/北京镜像下载、项目始终使用 Host current 环境”已经完成源码接线,
详细事务与验收边界见
[SSH Host 远程环境准备与直连下载设计](./environment-provisioning-technical-design.md);
控制面直连源码可直接使用既有 package format v1 包,不等待携带 installer 的新 Agent
包,也不通过额外目录元数据判断 bootstrap 能力;公开能力仍等待 GitHub/北京镜像、
Linux x64/arm64、取消和离线 GoodBuddy 传输的真实 Host 验收。
Windows 到 Linux x64 的安装、Agent-owned Prompt、Agent 本地模型 gateway、断线恢复、
同一 OpenCode Session 续接、取消和终态清理已经使用真实模型与工具验证。Agent
`0.11.10` 已通过独立 workflow 发布 Linux x64/arm64 复合包和签名累计目录;当前未发布
Agent 源码 lock 为 `0.11.14`,桌面版本仍保持已发布的 `0.11.13`,等待发布审批后再选择
新版本。现有源码显示本地与远端 OpenCode 原生 Task,并取消 GoodBuddy 对生产 Prompt 的
固定墙钟总时限。失败的 `agent-v0.11.3` 保持不可变且未发布。
## 产品语义
远程 Host 与项目能力是默认关闭的技术预览。用户在“设置 > 平台功能”的独立
“远程项目(技术预览)”页签启用开关后,Renderer 才显示 SSH Host 管理、托管 SSH 项目创建和已保存
远程项目;Main 在 IPC 边界执行同一开关校验,避免隐藏界面被绕过。关闭开关不删除 Host、
项目或凭据;当前远程项目切回第一个普通本地项目。应用启动仍固定
选择普通本地项目,不会因为保存了远程项目而自动连接 Host。
远程项目只有两种工作模式:
- **Ask**:Runtime 在操作系统边界以只读方式访问项目 Workspace。
- **Execute**:用户已授权使用所选 SSH 账号的完整权限。Runtime 可以使用该账号可访问的文件、进程、网络和工具,不再要求额外 trust tier、consent checklist、逐工具审批或“受控执行”授权。
Execute 不获得 root 或 SSH 账号本身没有的权限。托管 SSH Prompt 会把当前选中的文本模型
profile 和凭据作为有界、逐 Prompt 的控制消息交给 Agent;该凭据不进入命令参数、环境变量、
语义日志或模型调用账本,并在 Prompt 终态清除。此行为只适用于用户已明确启用的可信组织
网络和已认证 SSH Host。
## 组件
```text
Renderer
-> 窄 Preload / Main IPC
Main
-> SSH Host 与 Host Key 管理
-> SSH connection pool
-> 签名 Agent / Runtime 安装
-> 远程项目当前环境准备与稳定配置 SQLite 事务
-> 永久项目、对话、Task 与已同步事件 SQLite
SSH attach
-> 远端私有 Unix socket
Detached GoodBuddy Agent
-> Workspace / Git 协议
-> Agent-owned OpenCode ACP Prompt Promise
-> Prompt-scoped Provider gateway / model-call ledger
-> 有界语义 transcript / page / ACK
-> 有界私有诊断记录
-> 直接拥有的 Runtime 进程
```
不提供把远端路径交给本机 Runtime 的伪本地模式,也不提供 SSH stdio Runtime fallback。
## SSH Host
- Renderer 只管理脱敏 Host 快照,不接触密码、密文、SSH Client 或任意命令接口。
- Main 在认证前取得 Host Key,展示算法与 SHA-256 指纹,并保存完整 key blob。
- 首次连接需要用户确认。Host Key 变化展示旧/新值并要求显式替换。
- 密码使用 Electron `safeStorage`;系统 SSH Agent 认证不启用 Agent forwarding。
- Host 地址、用户或 Host Key generation 变化时关闭旧连接,并定向退役依赖旧 Host identity 的 Workspace 和 Runtime 会话。下一次选择使用 Host 管理的当前连接记录解析 current Agent/Runtime,不读取项目中的旧 revision 或组件 identity;当前 registry、连接或 capability 无效时才要求显式修复。
## Agent 安装与生命周期
- Agent bundle 通过 manifest、Ed25519 签名、payload digest、平台和架构校验。
- 安装使用当前 SSH 用户目录中的 GoodBuddy-owned 路径和 side-by-side digest 目录。
- Agent 代码与固定 Node Runtime 一起位于签名 compound payload。显式安装或重装从本次
已完整校验的准备目录原子发布整个 Agent,不扫描旧安装、不创建跨版本 Node 硬链接;
Agent 不匹配不会阻止升级,也不会覆盖 GoodBuddy-owned 路径以外的内容。
- 桌面包只携带版本 lock 与 production 公钥,不携带远端 payload。Host 卡片只有一个按
版本事实显示“安装远程环境”“更新远程环境”或“重新安装”的主按钮;次级
SegmentedControl 选择“自动”“Host 下载”或“GoodBuddy 传输”,默认“自动”且不持久化。
每个复合包绑定 Agent、固定 Node 与桌面维护的 OpenCode Runtime 精确工件。添加或重新
验证 Host 只保存并探测,不自动传输完整包。
- Host 管理独占 Agent/Runtime 的包准备、更新和完整 payload 验证。已有项目的打开和切换
只更新本地项目选择。Workspace 和执行路径按需读取 Host current registry,
执行固定 `attach-or-bootstrap` 并复用当前 Agent 连接;同一进程内复用已确认 identity。
它们不取得安装包、不发布组件,也不通过 SFTP 重读或哈希 payload;已登记 Runtime
的能力读取和 Prompt 启动只核对 registry 与 manifest 元数据,不再次执行、读取或检查
OpenCode 二进制。
- Agent 的固定 attach/按需启动命令只读取 Host 管理已提交的 installation registry 和
与其 digest 匹配的有界 manifest 元数据,不在每次项目切换时重新验签或哈希完整 payload。
完整验签、payload 扫描和 registry 写入仍只发生在显式 Host 准备/更新流程。
- 项目切换不执行远程核对,立即选择本地项目配置。Workspace 或 Runtime 首次实际使用时
才通过当前 Agent 连接核对所需能力;失败只影响该操作。新建或显式保存项目仍执行完整
准备,并只事务写入 Host、路径、Runtime 选择和工作模式。
- SSH 连接先尝试 attach;Agent 不存在或未运行时执行幂等 bootstrap,然后重新 attach。
- Agent 是按需启动的 detached process,不注册开机服务,不依赖 systemd、D-Bus 或 Linger。
- 每个模型桥 helper 都为 loopback HTTP 入口生成一次性随机路径 capability;只有写入当前 OpenCode 子进程配置的 URL 可以访问该入口,其他本机用户即使发现临时端口也不能提交模型请求。
- Agent 监听当前用户拥有的私有 Unix socket。SSH 中断只关闭 relay,不拥有 Agent 和活动 Runtime 的生命周期。
- SSH Host 设置通过固定探针和有界 SFTP 显示 Host 已登记的 Agent/OpenCode 版本,并与当前
GoodBuddy 所需版本比较。进入或切回该设置页只读取本地 Host 列表,不连接任何 Host;
用户点击“刷新版本”后才探测对应 Host,探测不安装或切换远端组件。项目切换与此按钮
解耦且不建立连接;实际远程操作才建立或复用 SSH/Agent 连接。
- “平台功能 > 远程项目”中的本地 Agent 包清单与 Host 状态分离。Main 对用户数据目录中
Linux x64/arm64 `.gbagent` 分别执行外层可信签名、桌面/协议兼容性、内部 Agent/Runtime
签名、架构与完整 payload 校验;首次打开和手动刷新还会读取“关于与更新”所选来源的
小型签名目录。Renderer 只得到本地/在线版本、是否有更新、架构、远端 Runtime 版本、
协议和本地状态,不得到缓存路径、key ID 或 digest。目录检查不下载 `.gbagent`,在线
包下载只由用户点击带目标版本的操作触发;离线导入/导出通过 Main 管理的文件对话框完成。
- “自动”只在 operation/prepare 前用 Host capability probe 选择 acquisition:直连明确
可用才选 Host 下载,否则选 GoodBuddy 传输;显式选择不被改写。prepare、commit 或
adoption 失败后都不跨 acquisition 自动 fallback。
- Host 下载由桌面控制面通过固定 SSH prepare channel 和结构化 stdin 发送候选信息,
Host 取得 compound `.gbagent` 并核对大小与 SHA-256。显式 GoodBuddy 传输在在线目录
不可用,或本地已验证包版本不低于在线候选时优先租用本地包,包括更高版本离线导入;
线上存在更新且可用时仍取得线上新包。需要下载时,同一次操作会验 SHA-256 与签名、
缓存并取得 lease,再以有界流式 SFTP 上传一个 compound archive 和归档中已验证的
bootstrap Node;约 294 MiB 完整包不会一次读入 Main `Buffer`,Host 仍再次校验完整包。
- 两种 acquisition 交付到固定 operation staging 后,完全共用 control-plane
`prepare → commit → Agent activate/health → Runtime activate → finalize → cleanup`。
Main 只保存清理 operation staging 所需的 operation ID。中断或 adoption 失败后,下次
更新尽力清理旧暂存并重新 prepare,不保存或恢复 Agent/Runtime metadata 副本。确认
adoption 后才显式 cleanup;cleanup 失败不回滚健康环境,也不阻塞下一次 fresh prepare。
Host 在 prepare 解包时
完成一次完整 payload 校验,commit 和后续注册检查不再遍历包体。首次 bootstrap 不依赖
既有 Agent daemon,也不要求 format v1 归档携带 `agent/lib/package-installer.cjs`。
- 即使版本号均为当前版本,Host 卡片仍提供同版本“重新安装”,用于修复 registry、签名
或安装 identity 异常。GoodBuddy-owned 同 digest 目录损坏时先隔离后替换,并在发布或
原子 commit 失败时恢复;commit 成功后的激活失败保留新发布内容,下次点击重新安装时
清理旧暂存并重新 prepare/adopt。不要求删除 Host、凭据或引用项目。
- Host 卡片的“版本匹配”badge 只表达版本事实,不代表 Agent 正在运行或环境健康。重新安装
失败时明确显示本次操作未完成,并以随后重新检查的版本卡片表达当前事实;提交结果
不确定时不声称旧版本未被替换。
- 更新成功后才定向清理该 Host 的 Agent 连接和 Runtime 选择缓存。引用项目再次打开时
解析新的 current registry 并建立当前连接,无需刷新项目记录;当前环境无效时要求用户
显式修复,但不在项目切换中下载或安装。失败或取消保留 Host 配置、凭据、项目、
Workspace 和旧组件。
- 显式 stop、升级、身份冲突或进程退出时清理 GoodBuddy 自己的 socket、状态和子进程;不得删除或覆盖无关 Host 文件。
### Host 级环境生命周期
- Agent、Node 和 Runtime 是 Host/SSH 账号级共享环境。新增或重新验证 Host 后先保存 Host
并只读探测,不自动安装;用户随后在 Host 卡片明确选择安装或更新方式,失败保留 Host
并允许重试。
- Host 可以按签名目录固定的 URL、大小和 SHA-256 直接从当前 GitHub/北京镜像来源下载
完整 `.gbagent`,也可使用 GoodBuddy 本机下载、流式 SFTP 传输和离线导入。自动模式只在
操作开始时择一;执行失败不会在同一次操作中切换 acquisition。
- 项目只保存 Host ID、远端路径、Runtime 选择和默认模式。创建或保存时验证 Host current
环境;打开或切换只读取本地配置。Workspace/Runtime 实际使用时从 Host current registry
和当前 Agent 连接取得 live identity,不再扫描、下载、上传或发布 Agent/Runtime。完整
事务、兼容边界和验收要求以
[Host 环境准备设计](./environment-provisioning-technical-design.md) 为准。
- 打开新建/项目设置弹窗只读取本地 Host 验证记录,不并发检查所有 Host;目录浏览或保存
才连接所选 Host。
- 项目选择器中的管理操作默认浮动隐藏,在悬停、键盘焦点或触屏环境显示。管理任意已保存
项目不先激活项目,因此 Host 不可达或远端目录已不存在时仍可删除其本地记录。
- “远程项目”在选择器中按已保存 SSH Host 轻量分组。Host 标题显示 Main 已持有的真实
Agent 连接状态(未连接、连接中、就绪或异常),读取和展示状态本身不连接 Host;
项目副标题只显示远端路径,不重复“托管 SSH”类型。
- 删除 Host 时确认框列出所有引用它的本地项目记录,包括归档项目。确认后只删除本机
Host、凭据、项目及其关联记录,不连接 Host、不删除远端目录或内容;Host 设置写入或
项目事务失败时恢复另一侧,避免只删掉其中一类本地记录。
## Workspace
Main 传入已规范化的绝对 POSIX root。Agent 返回 Workspace identity、访问模式、Git 状态和有界能力。
- 创建项目时,用户可以直接输入远端工作目录,或通过输入框右侧的文件夹按钮浏览并选择目录。
- 项目保存前的目录浏览使用 Main 管理的只读、有界 SFTP,只返回目录;每次请求重新解析并校验当前 Host revision 与 Host Key generation,不安装 Agent、不暴露任意 shell/SFTP 接口。
- 浏览从 SSH 账号 Home 或当前有效绝对路径开始,限制扫描次数、返回条目和总时限;取消、Host 变化、超时或连接失败时关闭 SFTP 并保留用户原先输入。
- 选择目录只更新项目草稿,仍需通过正常的 Agent、Workspace、Runtime 验证和项目保存事务才会持久化。
- Ask Workspace handle 不暴露写入方法。
- Execute Workspace handle 可读写,但这不是 Execute 的唯一权限面;Execute Runtime 本身使用 SSH 账号的正常权限。
- 文件预览、搜索、Git diff、目录项和显式文件传输保持字节、条目数和路径长度上限。
## Runtime
首个远程 Runtime 固定为签名 OpenCode ACP bundle。
托管 SSH 项目的 Composer Runtime 菜单只显示当前配置的 OpenCode 和管理入口,不显示
直连模型、Continue 或 DeepSeek Harness。激活旧远程会话时,若其保存了其他 Runtime
selection,Renderer 会恢复为当前 OpenCode 配置;Main 的远程请求校验仍是最终边界。
本机配置的 SKILL 包和 stdio MCP Server 不上传或分配给远程 Runtime;远程 ACP Session
继续使用空 MCP Server 列表。Node.js、Python 等工具执行环境同样不修改或同步到 Host,
完整边界见[工具执行环境](../local-tool-environment/README.md)。
### Ask
Ask 使用系统 `bwrap`:
- Workspace 和 Runtime bundle 只读 bind;
- 独立可写 scratch HOME、TMPDIR 和 XDG 目录;
- 固定环境名和固定 Runtime argv;
- 通过只读边界阻止 Workspace 修改。
- ACP 权限请求只有在工具种类为原生 `read` 且 Runtime 提供 `allow_once` 选项时才允许;
search、edit、execute、未知工具以及只提供持久授权的请求全部拒绝。
`allow_once` 只解决 OpenCode 发起原生读取前的 ACP 协商,真正的文件系统边界仍是只读
`bwrap` bind。Host 缺少 `bwrap` 时 Ask 不可用。
### Execute
Execute 不经过 Ask 的 bubblewrap profile:
- 直接启动已签名 Runtime entrypoint;
- 使用 Agent 本地模型 gateway 时,签名 Agent launcher 会 `exec` 候选 manifest 锁定的
Node Runtime;进程 owner 校验最终 Node executable,而不是已经被替换的 shell
launcher 路径;
- `cwd` 为项目 Workspace;
- 继承 SSH 账号的正常环境、文件系统、进程和网络能力;
- 不进行 T2/T3、confinement attestation、approval bridge 或逐工具批准。
两种模式都保留输入/输出字节上限、用户取消和进程组清理。生产 Prompt 不设置固定墙钟
总时限;只要 Runtime 尚未按自身协议结束,Main 和 Agent 就允许其持续运行。启动、握手、
单个控制 RPC、重连尝试和关闭清理仍使用独立的有界超时,测试可以显式注入短 Prompt
时限验证取消升级,但该覆盖值不是生产默认。无界 Prompt 继续复用已发布的必填
`deadlineAt` 字段,以 year-9999 哨兵表达;Main 与 Agent 必须同时理解该哨兵,Agent
`0.11.10` 及更早版本仍会按其 manifest 上限夹紧,因此桌面启用这一语义前必须配套更新
到 Agent `0.11.13` 或更高版本。
## ACP 与断线
- 管控面只负责有界 JSON-RPC:连接、查询、启动、取消、关闭和重连。数据面只负责
ACP/blob 数据与 Agent 本机 journal。二者共享同一个经过 Host Key 校验和认证的
SSH attach 字节流,但不共享生命周期:管控连接关闭不会隐式取消 Agent 已接受的
Runtime 动作。
- 帧只保留连接 identity、channel identity、单调 sequence、类型和长度。Main 与
Agent 都按调用顺序 FIFO 写入,输入队列达到固定字节或条目上限时暂停 SSH stream。
顺序、可靠传输、分包和网络背压全部交给 SSH;协议不实现 credit/window、优先级
调度、跨 channel 超车、批发送或第二套拥塞控制。
- Agent 在把 Main 输入交给 Runtime 前、以及把 Runtime 输出交给 Main 前,先把 ACP frame 写入本机 journal。ACK 只推进 cursor 并裁剪已确认 frame,不表示 channel 已终止。
- Main 持久化 binding identity 和单调 cursor;保留中的 connection lease 即使处于 offline/reconnecting,也可以先把新 cursor 落盘。重连提交不能覆盖 resume 过程中并发落盘的更新。
- Runtime 事件先经过单事件、单请求输出和每次 Prompt 最多 100 个不同工具调用的边界;
通过边界后,Renderer 和 Main 将已接受的工具详情保存到本地 SQLite,不再额外缩短其
输入、输出、错误或摘要。
- OpenCode 原生 Task 工具按 `subagent_type`、`description`、`prompt` 和稳定 tool call ID
解析为子 Agent 事件。本地 OpenCode SDK 与远端 ACP 增量工具事件复用同一转换;ACP
首帧缺少参数时可以先显示普通工具活动,后续参数确认其为 Task 后必须替换为子 Agent
状态卡,并持久化任务说明、终态与输出。
- 同一 detached Agent 存活时,短暂 SSH 断线依次执行 `controller/resume`、`runtime/resumeAcpChannel` 和 `runtime/replayAcpChannel`,从 Main 已确认的 cursor 后只重放 Agent 到 Main 的已记录输出。重复 frame 会被确认但不会再次交给上层。若上一代连接只留下没有活动请求的 detached binding,完成精确 controller takeover 后会先有界停止并核对遗留 Runtime process,再用新 channel epoch 重新打开同一 binding 并恢复已有 ACP session;其他 controller、未证明 takeover 或仍有活动请求的 binding 仍被拒绝。
- Main 到 Runtime 的 ACP 输入、模型请求、工具请求和 blob 不自动重放。
- 无法确认外部 Provider 是否已处理的模型调用保持结果未知,避免重复计费或重复副作用。
- 只有远端返回 identity 匹配且 `closed: true` 时,Main 才删除持久化 binding;传输失败或未确认 close 会保留 recovery identity。
- 终态 close 由 Agent 在一个事务中为两个方向记录 sequence high-water tombstone,删除剩余 frame 和 active channel,并归零对应 journal quota。tombstone 用于拒绝迟到的旧 epoch frame,因此当前不会按时间自动裁剪。
- 断线不主动终止正在运行的 Runtime。用户取消、显式关闭、输出边界或 Agent shutdown
才触发停止;连接恢复只受当前用户取消信号和单次重连控制超时约束,不把 Prompt 已运行
时长当作停止条件。
- Agent 失联期间继续把 Runtime 输出写入本机 journal;重新连接只校验 controller
identity、恢复 binding,并从 Main 最后确认的 cursor 后同步缺失数据。已接受的
指令和结果不确定的 Provider 请求都不自动重放。
### Agent-owned Prompt 与 Desktop 恢复
- 托管 SSH 的生产 Prompt 从一开始就由 Agent 持有 ACP `ClientSideConnection`、原始
Prompt Promise、Provider 轮次和 Runtime 进程。SSH relay 或 Desktop 进程不属于该
Promise 的生命周期,因此正常退出、强制结束 Desktop 或本机网络中断后,Host 仍能继续
后续模型/工具轮次。该路径要求 `runtime/acp` capability v4,即 Agent `0.11.14` 或更高。
- Agent 把 ACP session update、permission decision 和唯一 Prompt 终态写入有界语义
transcript。Main 不恢复旧 JSON-RPC Promise,也不重发 `session/prompt`;Fresh Desktop
只对同一 controller/binding/operation 执行 takeover、attach 和 ACK-exclusive page。
- 每个 Agent 语义 sequence 在 Main 映射为零到多个公开事件,最后追加内部 checkpoint。
Desktop 在同一 SQLite 事务中去重 provenance、归并原 assistant message,并在 checkpoint
时提交 Task 终态;事务成功后生成器才继续并向 Agent ACK。断电发生在同一 sequence
中间时会重读该 sequence,已写事件按 `(binding, operation, sequence, eventIndex)` 去重,
未写事件继续归并,不会重复 Provider 或工具执行。
- ACK 后 Agent 删除已确认事件,只保留小型操作终态与游标用于幂等核对;未 ACK 输出继续
保留。Main 按 transcript page 的最高连续 sequence ACK,终态仍立即 ACK。单事件、单页、
单 Prompt 总字节和事件数都有上限;Agent 始终为唯一终态预留一个事件和最大事件字节,
避免配额耗尽后无法记录终态或无法重启。已 ACK 终态操作和已交付模型 ledger 在 daemon
运行期间也按固定上限裁剪,不依赖重启。Agent 重启不能重建内存中的 Runtime/Prompt
Promise,因此启动时把遗留 nonterminal 记录变为 `outcome-unknown`,Desktop 只同步该
终态而不自动重放。
- prepare 已接受但 start RPC 未到达时,Agent 使用两分钟 prepare-to-start watchdog 清除
进程和 Prompt 凭据并记录 `outcome-unknown`,避免无界 Prompt 哨兵造成永久悬挂。
- Desktop SQLite 仍是永久可见项目/对话数据的权威;Agent transcript 只是尚未同步事件的
权威。启动后 Renderer 先订阅恢复进度,再触发每项目恢复。项目选择器依次显示网络、
Agent、Runtime、cursor、完成或失败/重试;只阻塞受影响项目的发送和队列,已有历史与
其他项目保持可用。
- 正常应用退出对已接受托管 SSH 请求执行 detach,不等待远端完成;本地请求和尚未接受的
请求仍按原行为取消。用户显式“停止”始终发送稳定 operation cancellation,并等待 Agent
语义终态。已进入 Agent-owned `run` 但 start/attach 响应仍不确定的请求继续保留为
`interrupted + remote_recoverable`,并自动走 exact attach;不会因为尚未收到第一个公开
事件而丢失恢复身份。
## Agent 本地模型 gateway
- Main 在 `runtime/preparePrompt` 中发送当前解析后的有界 profile;Agent 只在该 operation
的内存状态中持有 Provider URL、API Key 和认证信息。OpenCode 仍通过 Prompt 私有 Unix
socket 发出模型请求,但 HTTP Provider dispatch、响应交付和稳定 call ledger 全部位于
Agent,因此 Desktop 断电后可以继续下一轮。
- Agent 校验固定 model、协议和 API path,拒绝 background/store、provider web search、
provider MCP、持久 conversation、非文本 modality 和其他可独立计费能力;请求/响应 body
各限制 768 KiB,响应同时核对声明长度与短读。每个
`(binding, operation, roundIndex)` 只 dispatch 一次;已 dispatch 但未证明完整交付的调用
变为 `outcome-unknown`,不会自动重试。
- Prompt 最多 100 个模型调用,并受单次与累计输出 Token 上限保护;这些是资源边界,不是
Prompt 墙钟总时限。Provider 单次请求仍有独立超时。实际 usage 在语义 transcript 中同步
回 Desktop 的 usage/task 数据。Agent 在所有进程终止路径统一清除 Prompt token 计数。
- helper 可以接收同一 Prompt 内并发到达的模型桥请求;它在单一稳定模型桥上按到达
顺序等待并交付,不返回本地 `bridge-busy`,每个响应只有在 HTTP 完整 flush 后才
发送 delivery ACK。
- GoodBuddy 自己管理会话标题,因此传给 OpenCode 的配置禁用 title Agent;一次用户
Prompt 不会额外触发标题模型请求。
- Agent gateway 不再把 Provider 请求往返 Desktop;legacy blob bridge 只保留给旧的
非 Agent-owned 测试/兼容路径。凭据不进入 Renderer、SSH 命令参数或远端环境。
- Unix socket 接收端按 `readableLength` 中已经缓冲的字节增量排空一个声明长度的帧,
不会在部分大响应到达时反复请求尚未缓冲的完整剩余长度;短读、连接结束、错误和取消
都会使当前交换失败。原生 Linux 回归覆盖至少 256 KiB 的 broker 响应。
- Renderer 把相邻 text/reasoning delta 合并为消息 block 时始终替换最后一个 block,
不修改既有 React state 对象。这样开发环境 StrictMode 重复调用 state updater 时,
block metadata 与 canonical 消息正文保持一致。
## Agent 开发期间的真实 Host 验证
任何会改变已部署 GoodBuddy Agent 或桌面到 Agent 生产链路的源码改动,都必须在开发期间
使用共享 Linux x64 真实测试 Host 验证。适用范围包括 Agent daemon、Agent protocol
及共享 contract、Agent 组包与安装、attach/update、Runtime 启动与进程归属、Workspace、
model bridge,以及生命周期和恢复逻辑。单元测试、mock、fixture、CI 或正式发布前回归
都不能替代这一步;不得等到准备发布时才首次运行受影响的真实链路。
测试 Host 有两个网络入口:
- `192.168.0.23`:局域网入口,在本地网络可达时优先使用;
- `10.7.0.23`:VPN 入口,局域网入口不可达时使用。
两者指向同一台物理 Host,只代表两条访问路由,不能计为两个独立 Host、两种架构或两份
覆盖结果。测试只使用已固定的 Host identity 和 GoodBuddy 已有凭据存储;地址不得写入
产品行为或默认配置,用户名、密码、私钥等凭据不得写入源码、文档、命令、日志或测试输出。
开发时应在改动链路达到可运行状态后尽早执行真实 Host 验证,并在最终相关改动后重复受
影响的场景。必须使用当前源码构建或当前候选包,不能只验证 Host 上已经发布的旧 Agent。
按改动范围至少选择以下场景:
1. Agent 组包、安装或升级:验证当前候选的 attach-or-bootstrap、安装/更新、版本切换及
随后的连接。
2. Runtime profile、进程启动/归属或 Ask/Execute 边界:通过桌面生产入口启动真实 Runtime,
验证受影响模式;Ask 权限改动必须验证只读边界,Execute 权限改动必须验证所需写入、
进程和网络能力。
3. Agent protocol、RPC、stream、model bridge 或模型消息链路:执行最小有界真实模型调用,
禁用非必要工具和附件,并记录实际调用次数;大消息或工具链路改动还应覆盖对应的真实
payload/工具场景。
4. 会话、owner、取消、超时、断线或恢复逻辑:执行与改动直接相关的中断、取消、Agent/
Runtime 重启、SSH 断开或重连序列,并确认不会错误重放结果未知的操作。
5. Workspace 或 Host 文件路径:只在 GoodBuddy 专用测试目录操作,验证真实路径和权限,
不得读取、覆盖或删除无关 Host 文件。
停止或修改远端进程前必须先核对其启动身份、PID/进程组和 GoodBuddy 归属。若两个入口均
不可达,应立即把真实 Host 验证报告为开发阻塞,保持该验证未完成,不能把 Agent 改动表述
为已完成,也不能把首次真实验证推迟到发布阶段。
## 已完成的 E2E 验收记录
- 2026-08 的本地 fixture 完整验证 Linux x64 Agent `0.11.2-e2e.12`、Node `24.19.0`
和 Agent protocol `2.0`;当时没有 arm64 fixture,因此该记录不能作为当前独立发布
的双架构验收。Agent `0.11.10` 后续已由原生 workflow 发布并公开验证双架构工件;
当前源码 lock 固定为 `0.11.14`;正式发布状态以独立 Agent Release 与签名 catalog 为准。
- 2026-08-30 在共享 Linux x64 Host 的隔离测试 HOME 中验证当前 `0.11.13` 源码候选:
签名 Runtime 清单的测试墙钟上限为 1 秒,模型桥首轮故意延迟 2.515 秒后 Prompt 仍在
5.770 秒正常完成;随后 OpenCode 原生 Task 依次产生 `running`、`completed` 子 Agent
事件并完成父请求。测试结束后隔离 Agent、Runtime、socket 和 Workspace 已全部清理,
Host current Agent 仍为 `0.11.10`。
- 2026-08-31 使用隔离 Linux x64 Agent `0.11.14` 候选完成 remote-authoritative 矩阵:
15 秒短 smoke、2 分钟正常 detach、5 分钟本机 harness 强制结束、并发对话、SSH relay
丢失、显式取消、确定性 Provider 错误、2 秒 Provider 结果未知、Agent `SIGKILL`/重启,
以及 reopened Desktop SQLite 恢复。成功工具的 START/END sentinel 都各出现一次;
Provider 结果未知与 Agent 重启只提交 `outcome-unknown`,未重放 Prompt、模型调用或工具。
- 同一矩阵中的 Desktop schema v32 实际恢复保持原 project/conversation/request/
assistant-message 身份,在同一事务中提交语义 provenance、消息与 cursor;重新打开
`assistant.sqlite` 后消息和 Task 都完整,重复 provenance 返回 false,recoverable Task
归零。
- 最终源码复核后重新构建测试签名 package:
SHA-256 `39307fd1dccd638dcb723027591bcd83deab7057d550c99eff6f037e339829f4`,
installation `agent-2cad05acfebe853394807e3a11f7befcd9f47215c2cf3a33a03d5f644b45716e`,
Runtime `1.18.9` / bundle
`sha256:6c7fc975415ef2547d3729bc4772d3e78362c2e76c05d1fc24968a0468fcb7ba`。
最终 15 秒 detach/recovery 使用两个模型轮次、一个工具和一个终态,ledger 两轮均
`completed + delivered`,语义 `latest=ACK=41`,保留事件、Runtime owner、ACP channel/
frame 都为 0,START/END 各一次。最终取消另使用一个模型轮次、一个工具和一个 cancelled
终态,语义 `latest=ACK=29`,清理计数同样为 0。最终补充验证共 3 次真实文本模型调用。
采证后已按 PID/starttime/executable 停止精确隔离 daemon 并删除隔离 Host 测试根目录;
`/root/.goodbuddy` 下的共享 Agent 安装和进程未被修改。
- 2026-08-31 使用当前工作树短期测试签名 Linux x64 候选,在全新隔离 HOME 和 installation
中验证有界诊断:bootstrap、detached daemon、attach、relay 断开与同 controller 重连、
`controller/resume`、Runtime candidate 激活和 OpenCode ACP 进程启动均通过;新
`diagnostics --installation-id` 命令在 daemon 重启后读取到 23 条完整 JSONL。诊断目录
为 `0700`、文件为 `0600`,单文件 3719 bytes,未超过 64 KiB。六类测试哨兵覆盖 Prompt、
密钥、环境、SSH 参数、用户文件内容和原始错误消息,CLI 输出与磁盘均未出现哨兵。把隔离
diagnostics 目录临时设为不可写后,Attach 和 `agent/status` 仍正常;随后已恢复权限。
- 2026-09-02 使用当前源码 Agent bundle 在共享 Linux x64 Host 的唯一
`/tmp/goodbuddy-e2e-no-reverify-*` 隔离 HOME 验证已登记 Runtime 的快速激活路径。测试
复制 Host current Runtime registry 与 bundle,在副本 OpenCode 二进制追加哨兵字节后,
`runtime activate` 仍依据匹配的 registry 与 canonical manifest 成功返回
`activated=true`,确认普通激活不重新哈希 payload 或执行 OpenCode 版本探测。本次没有
模型调用;harness 成功后已删除整个隔离目录,未修改共享 Agent/Runtime 安装或进程。
本次未注入模型凭据或执行 Prompt,真实文本模型调用 0 次;三文件轮转继续由聚焦测试覆盖。
测试结束前按 PID、UID、starttime、executable 和唯一 installation 核对并停止所有本次
daemon,本地及 Host 临时目录均已清理,共享 current Agent 和 `/root/.goodbuddy` 未修改。
- 正常 Host 更新路径把 Linux x64 Host 的 Agent 更新为 `0.11.2-e2e.12`,并确认
OpenCode Runtime 已安装版本与所需版本均为 `1.18.9`。
- 一条新的 Ask 用户操作只提交一次。OpenCode 先在 build 模型轮次请求一个原生
`read`,读取专用测试 Workspace 中的证据文件,再在第二个 build 模型轮次生成最终
回答;没有 title 模型轮次,也没有第二个工具调用。
- 两个模型轮次都记录已交付,远端 helper 保持休眠且 Unix socket 没有未读响应积压。
持久化的 canonical 助手正文精确为 `GOODBUDDY_REMOTE_TOOL_4C6B9D8A`。验收操作没有
重放任何结果未知或已经完成的 Provider 请求。
## 项目保存
远程项目只持久化稳定配置:
- Host ID;
- 规范远端工作目录;
- Runtime selection;
- `ask | execute` 默认模式。
Agent installation、Host revision/Host Key generation、Workspace identity、Runtime
bundle/adapter digest 和 capability generation 都属于 live connection/lease,不进入项目
domain object 或 SQLite。打开托管 SSH 项目不接受 Renderer 回传的旧项目草稿,而是从 Host
store 解析当前连接目标,通过 Agent/Runtime 安装管理器的 current/activate 读取路径取得
registry identity,再用同一个 Agent 连接验证 Workspace 路径和 Runtime capability。该流程
不会扫描完整 payload、取得安装包或发布组件。
实时 Runtime 创建只接受 OpenCode,使用当前解析后的模型 profile 准备 Agent 本地 gateway,
从当前 Agent 连接和 Runtime registry 取得会话 identity,并在该连接上打开 Workspace 和
ACP channel。Host 编辑或环境更新会定向失效 Agent 连接与 Runtime 缓存,下一次请求自然
重新取得 current 环境;无需修改项目。Ask/Execute 权限继续由每次 Prompt 的 ACP Runtime
边界执行。
Renderer 在用户主动打开已有托管 SSH 项目时立即切换,不显示远程激活状态。Host、Agent、
Workspace、Runtime 和 Saving 进度仅用于新建或显式保存项目;进行中可显式取消并禁用会
产生冲突的项目创建和设置入口。远端 RPC 拒绝只向
Renderer 暴露固定方法名、数字 RPC code 和有界 service code,不转发 Host 私有错误详情。
`runtime/preparePrompt` 在远端明确拒绝且尚未接受 Prompt 时会关闭对应 Main binding,
不会把确定性失败错误保留为 `outcome-unknown`。未确认终态的 Prompt 仍不会自动重放;
同一当前 Agent identity 上的 `prompt-running` binding 会阻止不同的新 operation,直到
原 operation 恢复或取消,避免遗留 Host 工作与新 Prompt 并行。只有 Host/Agent/Runtime
identity 已变化且旧 authority 无法恢复,或原 binding 已有 `outcome-unknown` 终态时,显式
新 Prompt 才替换旧 binding。新 ACP session 的首次 Prompt 会把 Desktop 已持久化的有界
会话历史作为不可信数据一并发送;成功加载或恢复原 ACP session 时不会重复注入历史。
Ask 模式的 Linux Runtime 进程由 `bwrap` 启动后 `exec` 到已签名 Runtime 或 Agent
model bridge helper;监督器只接受同一 PID/进程组从固定 `bwrap` 路径到预期最终可执行文件
的有界转换,再登记为运行中进程。
不持久化 T2/T3、consent、approval bridge、confinement 或组件验证结果。数据库 schema
v32 保留项目及关联用户数据,并加入 remote-recoverable Task/message/provenance/cursor;
执行空间表保持 `project_id/kind/root_path/ssh_host_id`
四列,并删除旧 Runtime 验证表。
## Agent 有界诊断
Detached Agent 不依赖 stdio 留存故障证据。每个 installation 在固定私有目录
`~/.goodbuddy/state/<installationId>/diagnostics/` 中维护
`agent-diagnostics.jsonl`、`.1` 和 `.2`,每个文件不超过 64 KiB,目录权限为 `0700`,
文件权限为 `0600`。记录覆盖 daemon 启停、detached 启动、连接、恢复和 Runtime
启动/退出;每条只包含固定事件、时间、PID、可选工作模式、固定原因和白名单错误码。
诊断写入使用最多 64 条的有界异步队列。连接、恢复和 Runtime 回调只把已经归一化的固定
记录入队,不等待磁盘;原始 `Error` 不进入队列。队列满、目录不可写或轮转失败只丢弃诊断,
不得改变 Attach、协议、Runtime 或退出结果。daemon 停止和 bootstrap 生命周期结束时执行
有界 flush。多个 Agent 进程通过 GoodBuddy 私有短期锁协调 append 和轮转,不把长期锁作为
运行前提。
已安装 Agent 提供只读固定命令:
```text
goodbuddy-agent diagnostics --installation-id <installationId>
```
该命令只能从 installation 对应的固定 state 目录读取上述有界文件,并逐行输出已验证 JSONL;
不接受任意路径,也不扩展 Agent protocol。诊断不得包含 accepted Prompt、模型输入输出、
模型密钥、完整配置、环境变量、SSH 参数、用户文件内容、路径或原始错误消息。应用内反馈的
“附加最近桌面诊断记录”只读取 Desktop 诊断,不会自动取得或上传这些远端 Agent 记录。
## 资源与发布
- 所有桌面构建(包括 `portable` 与 `release:package`)只携带
`agent-runtime-lock.json`、`remote-runtime-lock.json` 与公开的
`agent-release-keys.json`,不嵌入 `.agent-resources`、
`.remote-runtime-resources` 或任何可安装 Linux 远端 payload。
- `build/agent-package.cjs` 在对应原生 Linux 架构组装确定性 `.gbagent`,外层签名覆盖
描述符和每个内部文件身份;内部 Agent 与 Runtime 仍分别使用既有签名 manifest 和 lock
校验,但所有 production 层统一使用一组 GoodBuddy 通用发布身份并通过签名域区分用途,
不要求内部 Runtime 单独配置密钥。`build/agent-catalog.cjs` 为双架构包生成签名累计目录,
拒绝同一版本/架构改变字节。
- `.github/workflows/agents.yml` 只使用进程内临时测试 key 做分支/PR 原生验证,不发布。
`.github/workflows/agent-release.yml` 才可在 annotated `agent-v<version>` 标签和受保护
`agent-signing` Environment 中构建 production 包。Agent GitHub Release 必须
`--latest=false`;北京 OSS 先写 `agent-releases/v<version>/`,GitHub 公开后才切换
单一 `agent-releases/latest.json` 指针,使客户端始终从同一不可变版本目录读取目录与签名。
- Main 的本地缓存只发布完整验证成功的内容。在线目录和包都绑定固定 GitHub/OSS URL、
大小和 SHA-256;选取规则是桌面最低版本满足、Agent protocol major 相同且 minor 不高于
当前支持值的最高 SemVer。缺少某架构仅使该架构 Host 的托管 SSH 无法激活。
- `agent-release-keys.json` 读取时按 UTF-8 JSON 解析并严格验证 schema、唯一 key ID、
规范 Base64、有效 Ed25519 key、环境和撤销列表,不把 CRLF/LF 或普通 JSON 空白作为
信任条件。上传到 Host 前重新序列化为确定性 LF JSON。签名目录、描述符、manifest 和
payload 仍按原始签名字节及 SHA-256 验证。
## 发布前完整回归(不能替代开发验证)
以下清单只用于复核开发期间已经在真实 Host 上通过的链路,不得作为 Agent 改动的首次
真实 Host 验证:
1. `npm test`
2. `npm run typecheck`
3. `npm run lint`
4. `npm run build`
5. 用测试签名复合包验证在线下载源选择和离线导入/导出;正式 Agent 候选还需公开校验
双架构 production 包与签名目录。
6. 在已固定 Host Key 的 Linux x64 测试 Host 上验证 attach-or-bootstrap。
7. 在 GoodBuddy 专用测试目录验证 Ask 无法修改文件。
8. 验证 Execute 可以写文件、启动进程和访问网络,同时不触碰无关 Host 文件。
9. 运行一次有界的真实模型调用,确认凭据不进入 Renderer、SSH 参数、远端环境或磁盘,
只在当前 accepted operation 生命周期内进入 Agent 内存。
10. 中断并恢复 SSH,确认活动 Runtime 不被网络抖动终止。
+11
View File
@@ -0,0 +1,11 @@
# Smart Heartbeat
Smart Heartbeat 负责按计划或条件主动检查范围内信息,并生成可监督的建议或任务。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [智能心跳 PRD](./prd.md) | 用户目标、范围、计划、运行和产品验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
@@ -11,7 +11,7 @@
| 文档角色 | 智能心跳当前能力、权威入口、范围和长期边界 |
| 相关设计 | [统一界面设计系统](../../../UI-DESIGN.md) |
| 相关架构 | [自动化、监督与记忆平台总体设计](../../architecture/automation-platform-architecture.md) |
| 相关界面 | [通用助手工作栏与执行空间 PRD](../assistant-experience/assistant-workbar-and-execution-spaces-prd.md) |
| 相关界面 | [通用助手工作栏与执行空间 PRD](../assistant-workbar/prd.md) |
| Task 模型 | [Task 与 Job 统一领域模型](../task-and-job/task-and-job-model.md) |
> 本文区分近期实施与长期方向。未完成设计的“未来分区记忆”不得转写为数据结构、状态机、
@@ -120,7 +120,7 @@
| 选择 Global / Project 范围 | 智能心跳 > 心跳计划 | 不依赖当前项目推断 |
| 暂停、恢复、立即心跳或删除 | 智能心跳 > 心跳计划 | 不复制操作 |
| 查看报告与待处理建议 | 智能心跳 | 主导航徽标和通知可触达 |
| 查看运行历史和失败 | 智能心跳 > 心跳轨迹 | 活动记录仅作审计补充 |
| 查看运行历史和失败 | 智能心跳 > 报告与记录 | 活动记录仅作审计补充 |
| 管理平台级默认值 | 设置中心 | 不显示单条计划 CRUD |
移除重复入口的顺序:
@@ -135,9 +135,9 @@
保留现有四个页面:
- **成长概览**:状态、成功率、记忆、洞察和行动统计。
- **运行概览**:状态、成功率、记忆、洞察和行动统计。
- **待处理建议**:记忆建议和行动建议。
- **心跳轨迹**:报告与 Run 审计。
- **报告与记录**:心跳报告与 Run 审计。
- **心跳计划**:唯一完整配置入口。
### 5.1 心跳计划
@@ -14,3 +14,8 @@
先阅读统一领域模型。其他功能文档不得重新定义 Task、Conversation、Job、Run 或 Subagent。
若实现与文档出现冲突,应先修正统一模型,再同步功能 PRD。
## 相关功能
- [直连模型 Agent 能力](../direct-model-agent/README.md) 使用本目录定义的 Subagent 与
Job/Subjob 语义,为直连模型提供单层编程委派,但不重新定义产品对象层级。
@@ -363,7 +363,8 @@ Task Center 显示 Scheduled Task 的范围、关联 Conversation、状态、模
- [x] 手动运行不改变下次计划时间。
- [x] Scheduled Task 与普通消息共用 Conversation 级队列,不并发写入同一时间线。
- [x] 当前回复期间可以继续发送普通消息,并在 Composer 上沿查看、删除或提升待发送项。
- [x] 应用重启恢复尚未执行的队列项和有界附件上下文。
- [x] 应用重启恢复尚未执行的队列项和有界附件上下文;已写入 Conversation 的用户输入
通过队列项身份完成恢复对账,不会再次进入待发送队列。
- [x] 文本结果只写入 Conversation,独立交付物才进入成果。
- [ ] Task Center 和桌面通知可以打开正确 Conversation 并定位 Task。
- [ ] 应用重启不自动重放结果未知的副作用。
@@ -8,7 +8,7 @@
| 版本 | 0.3 |
| 日期 | 2026-08-19 |
| 依赖 | [Task 与 Job 统一领域模型](./task-and-job-model.md) |
| 界面归属 | [通用助手工作栏与执行空间](../assistant-experience/assistant-workbar-and-execution-spaces-prd.md) |
| 界面归属 | [通用助手工作栏与执行空间](../assistant-workbar/prd.md) |
## 1. 产品定义
+11
View File
@@ -0,0 +1,11 @@
# 微信消息通道
微信消息通道负责将微信连接、项目、工作目录、Runtime 和工作模式接入 GoodBuddy。
## 文档导航
| 文档 | 权威职责 |
| --- | --- |
| [微信 ClawBot 通道 PRD](./prd.md) | 通道连接、项目绑定、消息处理和验收 |
当前尚无独立 User Stories、功能逻辑、UI、技术设计和进度文档。
+4 -4
View File
@@ -9,7 +9,7 @@
| 版本 | 0.4 |
| 日期 | 2026-08-22 |
| 适用产品 | GoodBuddy 桌面端 |
| 相关设计 | [通用助手工作栏与执行空间 PRD](../prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md)、[Task 与 Job 统一领域模型](../prd/task-and-job/task-and-job-model.md)、[智能心跳 PRD](../prd/smart-heartbeat/smart-heartbeat-prd.md)、[全双工实时语音交互设计](../architecture/full-duplex-voice-design.md) |
| 相关设计 | [通用助手工作栏与执行空间 PRD](../features/assistant-workbar/prd.md)、[Task 与 Job 统一领域模型](../features/task-and-job/task-and-job-model.md)、[智能心跳 PRD](../features/smart-heartbeat/prd.md)、[全双工实时语音交互设计](../features/full-duplex-voice/technical-design.md) |
## 1. 文档目标
@@ -58,7 +58,7 @@ GoodBuddy 应能够:
### 3.2 右侧工作栏
本节的范围、选择、执行空间与安全契约以
[通用助手工作栏与执行空间 PRD](../prd/assistant-experience/assistant-workbar-and-execution-spaces-prd.md) 为准。
[通用助手工作栏与执行空间 PRD](../features/assistant-workbar/prd.md) 为准。
#### 任务中心
@@ -208,7 +208,7 @@ GoodBuddy 应能够:
- 当前已提供点击开始、再次点击停止或到达 20 秒上限后停止的本地一次性语音听写。
- 转写结果先进入可编辑输入框,不自动发送。
- 后续按[全双工实时语音交互设计](../architecture/full-duplex-voice-design.md)增加持续听说、
- 后续按[全双工实时语音交互设计](../features/full-duplex-voice/technical-design.md)增加持续听说、
Barge-in、流式文本转语音、本地与云端显式语音引擎。
- 活动会话冻结引擎、Provider、模型、地域、数据位置和能力;引擎失败时明确停止或重试
当前选择,不在本地/云端、原生/模块化、语音/文本之间静默降级。
@@ -266,7 +266,7 @@ GoodBuddy 应能够:
1. 所有新 IPC 继续执行 Zod 校验和可信主窗口校验。
2. 项目根目录、成果路径和上下文路径必须 canonicalize 并验证目录包含关系。
3. Child Runtime 环境变量改用最小 allowlist,避免继承无关密钥。
4. 远程委派仅允许 HTTPS,开发环境只放行 loopback。
4. 远程委派支持用户配置的 HTTP 和 HTTPS 地址,不按主机位置增加额外限制。
5. 语音、窗口捕获和浏览器上下文分别授权。
6. 自动化不得绕过工具审批和项目权限。
7. 记忆必须保留来源和作用域。
@@ -0,0 +1,563 @@
# GoodBuddy 产品、性能与体验综合改进计划
## 文档信息
| 项目 | 内容 |
| --- | --- |
| 文档类型 | 跨功能实施路线图 |
| 状态 | 规划中 |
| 版本 | 1.0 |
| 日期 | 2026-08-31 |
| 适用范围 | GoodBuddy Desktop、GoodBuddy Agent、发布与质量流程 |
| 评审基线 | Desktop `0.11.13`、Agent lock `0.11.14` |
## 1. 目的
本文把 2026-08-31 对当前仓库进行的功能、性能、体验和交付评审结果整理为一份可分批实施、
持续更新的权威清单。后续每一批工作都从本文选择明确范围,完成后更新状态、验证结果和相关
产品文档,不再维护平行的临时待办。
本计划优先完成已经存在但尚未形成真实用户闭环的能力,其次处理经过测量确认的性能问题,
再安排依赖外部平台或产品选择的增强能力。实施继续遵循以下原则:
1. 先保证完整、可用的生产路径,再扩展能力范围。
2. 性能优化必须有基线、目标和优化后的对比数据。
3. 复用现有合同、IPC、Worker、通知、错误边界和界面组件,不引入不必要的框架。
4. Ask 保持只读;Execute 继续代表当前本机或 SSH 账号的完整授权。
5. 每批只处理列明的范围,不借机进行无关重构。
## 2. 明确排除的工作
本计划**不包含初始 Renderer Bundle 优化**,包括但不限于:
- 不为了缩小入口包继续拆分轻量同级页面。
- 不单独延迟 KaTeX、全局样式或其他入口依赖。
- 不调整现有 Bundle 预算来制造通过或失败。
- 不以 Bundle 大小为理由改变当前页面交互语义。
现有构建预算和按路由拆包继续作为回归保护保留。只有后续获得首屏解析或执行耗时证据,并由
用户单独确认范围后,才重新讨论该项。
## 3. 状态与优先级
### 3.1 状态
| 状态 | 含义 |
| --- | --- |
| 待开始 | 范围已确认,尚未实施 |
| 进行中 | 已进入当前实施批次 |
| 阻塞 | 存在明确外部依赖,已记录解除条件 |
| 已完成 | 代码、真实路径、测试和文档均完成 |
| 不做 | 经重新评审后明确移出范围,并记录原因 |
### 3.2 优先级
| 优先级 | 含义 |
| --- | --- |
| P0 | 影响正式交付、安装或已声明生产路径,发布前处理 |
| P1 | 阻断核心工作流或造成明显错误、卡顿、误导 |
| P2 | 重要增强或规模化问题,可在核心闭环后实施 |
## 4. 分批实施总览
批次表示建议顺序,不表示必须一次完成整批。每次可以从当前批次选择一组边界清晰、能够独立
验收的事项。
| 批次 | 主题 | 事项 | 开始条件 | 完成门槛 |
| --- | --- | --- | --- | --- |
| 0 | 正式交付闭环 | `REL-01` 至 `REL-03`、`QA-03` | 发布资源和目标平台明确 | 正式产物可安装、可启动,版本与验证声明准确 |
| 1 | 核心工作流与恢复体验 | `FUN-01`、`FUN-04`、`UX-01` 至 `UX-12`、`OPS-01` 至 `OPS-03` | 无 | 用户可理解状态、从常见失败中直接恢复,并能导出有界诊断 |
| 2 | 通道、更新和真实 Runtime | `FUN-02`、`FUN-03`、`FUN-05`、`QA-01`、`QA-02` | 对应平台测试配置可用 | 文件办公闭环、更新下载闭环和真实 Runtime E2E 均通过 |
| 3A | 性能基线 | `PERF-01`、`PERF-03`、`PERF-05`、`PERF-07`、`PERF-09` | 固定测试数据和设备 | 形成可重复基线、目标阈值和原始结果 |
| 3B | 已测量性能优化 | `PERF-02`、`PERF-04`、`PERF-06`、`PERF-08`、`PERF-10` | 对应 3A 指标确认存在瓶颈 | 指标改善且功能、取消、恢复语义不回退 |
| 4 | 增强能力 | `FUN-06` 至 `FUN-09` | 核心闭环稳定;首个电脑控制平台已选定 | 每项形成独立、完整、可真实使用的工作流 |
## 5. 发布与交付
### REL-01 Desktop 与 Agent 版本闭环
- **优先级 / 状态:** P0 / 待开始
- **目标:** 当前 Desktop 源码依赖的 Agent 能从正式渠道取得并完成真实 Host 验证。
- **范围:**
- 发布并验证 Agent `0.11.14`,或在 Desktop 发布前恢复到已发布 Agent 契约。
- 验证 Linux x64、Linux arm64 正式候选包。
- 覆盖安装、Attach、Execute、取消和断线恢复。
- 覆盖 GitHub、镜像和离线 GoodBuddy 传输路径。
- **验收:**
- 干净用户目录能获取预期版本。
- Desktop 到 Agent 的正常路径和恢复路径均使用当前候选产物通过。
- 发布说明准确标注已验证架构和仍未验证范围。
- **外部依赖:** Agent 发布审批、双架构正式产物、真实 Linux arm64 环境。
- **起始证据:** `package.json`、`agent-runtime-lock.json`、
`docs/features/remote-host/technical-design.md`。
### REL-02 正式 Latest 签名门槛
- **优先级 / 状态:** P0 / 待开始
- **目标:** 官网正式推荐下载不指向可能被系统默认安全策略阻止的测试产物。
- **范围:**
- macOS 缺少签名或公证凭据时,不更新正式 Latest。
- Windows 未签名构建不作为默认推荐安装包。
- 未签名构建继续作为明确标注的测试 artifact。
- **验收:**
- 发布工作流在签名条件不满足时不会切换正式 Latest。
- 正式下载在全新 macOS、Windows 默认安全策略下完成首次启动。
- **外部依赖:** Apple 和 Windows 代码签名凭据。
- **起始证据:** `.github/workflows/packages.yml`、`BUILD.md`、`README.md`。
### REL-03 发布包启动冒烟
- **优先级 / 状态:** P0 / 待开始
- **目标:** 发布成功代表打包应用能够启动,而不只是文件结构完整。
- **范围:**
- 在对应 CI Runner 启动解包应用。
- 等待 Main、Preload、Renderer ready 健康标识后退出。
- Windows x64 接入现有 packaged DeepSeek Harness smoke。
- 为启动设置总超时,并保留无用户内容的失败诊断。
- **验收:**
- 缺 DLL、ASAR unpack、Preload 或 Main 启动错误会使发布任务失败。
- 探针无凭据、无外网也能执行。
- **起始证据:** `.github/workflows/packages.yml`、`build/build-release.cjs`、
`build/run-packaged-deepseek-harness-smoke.cjs`。
## 6. 核心与增强功能
### FUN-01 定时任务编辑
- **优先级 / 状态:** P1 / 待开始
- **目标:** 用户无需删除并重建计划任务即可纠正配置。
- **范围:**
- 新增共享 Update schema、Preload 方法和可信 IPC handler。
- 复用定制任务创建对话框作为编辑模式。
- 支持修改名称、Prompt、Ask/Execute、Runtime、首次运行时间和周期。
- 保留原 Task、Conversation、Schedule 和历史运行关联。
- **验收:**
- 从任务界面进入编辑,保存后列表和下一次运行时间立即更新。
- 编辑不产生重复 Task 或 Schedule。
- 正在运行的实例继续使用启动时快照,后续触发使用新配置。
- **起始证据:** `CustomTaskDialog.tsx`、`TaskScheduleActions.tsx`、`src/main/ipc.ts`。
### FUN-02 企业微信附件收发
- **优先级 / 状态:** P1 / 待开始
- **目标:** 企业微信完成“接收文件或图片、处理、回传成果”的办公闭环。
- **范围:**
- 接收官方接口支持的图片和普通文件。
- 将附件接入现有远程消息上下文。
- 支持回传当前任务生成的图片或文件。
- 复用 `ChannelMediaAttachment`、现有大小限制和 outbox 清理。
- **验收:**
- 收到支持的附件不会再返回 `attachment_not_supported`。
- 任务生成的有界成果能发送到原会话。
- 超限、下载失败和发送失败提供明确错误且临时文件得到清理。
- **起始证据:** `src/main/channels/wecom-driver.ts`、
`src/main/channels/wechat-sidecar.ts`。
### FUN-03 钉钉附件收发
- **优先级 / 状态:** P1 / 待开始
- **目标:** 钉钉非文本消息不再静默丢失,并完成文件办公闭环。
- **范围:**
- 支持官方接口允许的图片和普通文件接收。
- 支持任务成果附件回传。
- 对暂不支持的消息类型返回明确说明。
- **验收:**
- 支持的非文本消息进入对应远程 Conversation。
- 不支持的消息有可见反馈,不被静默忽略。
- 收发限制和清理行为与其他通道一致。
- **起始证据:** `src/main/channels/dingtalk-driver.ts`、
`src/main/channels/dingtalk-channel-driver.ts`。
### FUN-04 浏览器错误分类
- **优先级 / 状态:** P1 / 待开始
- **目标:** 浏览器任务失败后,用户知道失败阶段和下一步操作。
- **范围:**
- 保留代理、DNS、会话创建、CDP、导航和截图等失败阶段。
- 增加少量稳定错误码及一句修复建议。
- 在任务记录和界面中呈现,不建立通用错误协议框架。
- **验收:**
- 典型失败不再全部显示为“工具执行失败”。
- 原始敏感内容不进入 Renderer 或诊断日志。
- 取消继续被识别为取消,而不是错误。
- **起始证据:** `src/main/agent/model-runtime.ts`、
`docs/status/computer-control-implementation-status.md`。
### FUN-05 更新下载闭环
- **优先级 / 状态:** P1 / 待开始
- **目标:** 用户能在应用中取得当前平台安装文件并确认文件完整。
- **范围:**
- 从当前更新源读取当前平台产物。
- 下载到用户选择目录。
- 使用现有发布清单校验大小和 SHA-256。
- 校验成功后允许打开文件或所在目录。
- 安装继续由用户手动触发。
- **验收:**
- 下载源、版本、架构和当前系统匹配。
- 损坏或哈希不匹配的文件不会被呈现为可安装。
- 失败保留目标和错误上下文,可重新下载。
- **起始证据:** `UpdateSettingsSection.tsx`、`src/main/version-checker.ts`、
`src/main/ipc.ts`。
### FUN-06 定时任务常用周期
- **优先级 / 状态:** P2 / 待开始
- **目标:** 覆盖常见办公日历,而不要求用户编写 Cron。
- **范围:** 增加工作日和每月周期,并持续显示下一次实际执行时间。
- **验收:** 创建、编辑、重启恢复和到期触发均按本地日历执行且不重复。
- **依赖:** `FUN-01`、`FUN-07`。
- **起始证据:** `src/shared/assistant-contracts.ts`、
`docs/features/task-and-job/scheduled-task-prd.md`。
### FUN-07 时区和错过执行策略
- **优先级 / 状态:** P2 / 待开始
- **目标:** 用户明确控制任务在哪个时区运行,以及错过后是否补跑。
- **范围:**
- 默认本机 IANA 时区。
- 支持 `skip` 和 `run_once`。
- 显示 DST 影响后的下一次实际运行时间。
- **验收:**
- 重启或系统恢复后不会形成补跑风暴。
- 时区和策略可创建、编辑、持久化并在界面复现。
- **起始证据:** `src/main/assistant/assistant-database.ts`、
`docs/features/task-and-job/scheduled-task-prd.md`。
### FUN-08 旧版 Office 文件
- **优先级 / 状态:** P2 / 待开始
- **目标:** DOC、XLS、PPT 能进入聊天附件和知识库解析路径。
- **范围:**
- 检测本机 LibreOffice。
- 使用 headless 转换到 OOXML 或 PDF 后复用现有解析器。
- 未安装时提供明确安装或手工转换建议。
- **验收:**
- 三种旧格式各用真实文件完成聊天解析和知识库导入。
- 转换取消、超时和失败后清理 GoodBuddy 临时目录。
- 不内置第二套文档解析引擎。
- **起始证据:** `src/main/knowledge/document-parser.ts`、
`DocumentParsingSettingsSection.tsx`。
### FUN-09 首个原生电脑控制适配器
- **优先级 / 状态:** P2 / 待开始
- **目标:** 在一个明确的主要部署平台上真实控制桌面应用。
- **范围:**
- 首先从 Windows UIA、macOS AX 或 Linux 原生方案中选择一个平台。
- 完成窗口快照、点击、输入、取消和退出清理。
- 接入现有 computer-control broker。
- **验收:**
- 在真实桌面应用完成一次可重复的查看、点击和输入任务。
- Ask 仍不可执行桌面变更,Execute 路径记录活动。
- 取消和关闭后不遗留 GoodBuddy 控制会话。
- **外部依赖:** 首个平台产品决策及对应真实设备。
- **起始证据:** `src/main/capabilities/capability-service.ts`、
`docs/status/computer-control-implementation-status.md`。
## 7. 性能
### PERF-01 启动性能测量
- **优先级 / 状态:** P1 / 待开始
- **目标:** 得到冷启动各阶段的可重复耗时,而不是依据代码顺序猜测。
- **指标:** `app.whenReady`、窗口创建、数据库、知识库、Provider/Gateway、Runtime hydration、
IPC 注册、`loadMainWindow`、`ready-to-show` 和 Renderer 首帧。
- **验收:** 固定设备至少运行五次冷启动,报告中位数和 p95;诊断不包含用户内容。
### PERF-02 启动路径优化
- **优先级 / 状态:** P1 / 待开始
- **目标:** 尽早显示可理解的应用壳,并延后经测量确认的非首屏工作。
- **实施条件:** `PERF-01` 证明具体阶段构成主要延迟。
- **验收:** 首帧和可交互时间达到批次开始时确定的目标,初始化失败仍有明确状态和恢复入口。
### PERF-03 长流式回答基准
- **优先级 / 状态:** P1 / 待开始
- **场景:** 100KB、500KB、1MB Markdown 回答,包含推理、代码块和常见富文本。
- **指标:** React commit 数和 p95、Long Tasks、Markdown 渲染时间、输入延迟、滚动帧率、
Renderer 堆内存。
- **验收:** 测试数据、运行步骤和原始结果可重复执行。
### PERF-04 流式更新合并
- **优先级 / 状态:** P1 / 待开始
- **目标:** 降低长回答期间的状态复制和完整 Markdown 重解析。
- **实施条件:** `PERF-03` 确认 commit 或 Markdown 渲染是瓶颈。
- **范围:**
- 同一请求的 text/reasoning delta 按 `requestAnimationFrame` 合并。
- 每帧最多提交一次相关 React 状态。
- 流结束后再执行完整富文本渲染。
- **验收:** 目标指标改善;事件顺序、停止、重试、引用、工具和 Subagent 块不回退。
### PERF-05 向量检索规模基准
- **优先级 / 状态:** P1 / 待开始
- **场景:** 1k、10k、50k chunks 的全文、向量和混合检索。
- **指标:** 总耗时、`vectorScannedCount`、Main event-loop lag、取消响应和峰值内存。
- **验收:** 固定语料和查询集产生可比较结果,并保留检索质量指标。
### PERF-06 向量计算移出 Main
- **优先级 / 状态:** P1 / 待开始
- **目标:** 大知识库向量扫描不阻塞 Electron Main。
- **实施条件:** `PERF-05` 确认 Main event-loop lag 或取消响应不达标。
- **范围:** 优先复用已有 Worker,减少重复扫描和复制;本项不自动引入 ANN。
- **验收:** 检索排序和质量不回退,Main 延迟与取消指标达到目标。
### PERF-07 知识库 Snapshot 测量
- **优先级 / 状态:** P2 / 待开始
- **指标:** SQL 时间、对象数量、structured-clone 估算字节、IPC 往返、Renderer commit 和
峰值堆内存。
- **场景:** 小型、典型和大型文档与图谱数据集。
- **验收:** 明确首屏实际需要的字段和超过目标阈值的数据规模。
### PERF-08 知识库按需加载
- **优先级 / 状态:** P2 / 待开始
- **实施条件:** `PERF-07` 证明完整 Snapshot 是可见瓶颈。
- **范围:**
- 首屏只返回列表字段、状态和计数。
- 文档详情按选择加载。
- 图实体、关系和证据仅在图谱视图加载。
- 复用已有列表和 chunk 接口。
- **验收:** 首开与切换指标改善,选择、刷新、取消和局部错误状态不回退。
### PERF-09 Keep-alive 压力测试
- **优先级 / 状态:** P2 / 待开始
- **场景:** 连续打开 12 个会话,每个会话包含 80 条富 Markdown、图片和工具记录。
- **指标:** DOM 节点、Renderer heap、GC pause 和流式 commit。
- **验收:** 明确隐藏会话缓存是否构成实际内存或渲染问题。
### PERF-10 Keep-alive 轻量优化
- **优先级 / 状态:** P2 / 待开始
- **实施条件:** `PERF-09` 确认当前缓存不达标。
- **范围:**
- 优先 memoize 隐藏 `ChatHistoryPane` 并稳定 props。
- 仍不达标时才调整缓存数量或一小时有效期。
- 暂不引入完整虚拟化框架。
- **验收:** 内存和 commit 指标改善,同时保留会话切换位置和快速恢复体验。
## 8. 体验与可访问性
### UX-01 统一 Ask/Execute 文案
- **优先级 / 状态:** P1 / 已完成
- **范围:**
- 删除“Execute 高风险操作仍需审批”的冲突说明。
- 统一表达为使用当前账号完整权限执行,调用记录到活动。
- 同步定时任务、Composer、Runtime、帮助文案及中英文资源。
- **验收:** 所有入口对 Ask/Execute 的描述与真实 Runtime 契约一致。
### UX-02 Runtime 显式状态
- **优先级 / 状态:** P1 / 已完成
- **范围:** 顶栏显示就绪、连接中、不可用等文字,并通过 `aria-describedby` 暴露原因。
- **验收:** 不依赖颜色或 `title` 即可理解 Runtime 状态和发送不可用原因。
### UX-03 等待审批实时通知
- **优先级 / 状态:** P1 / 已完成
- **范围:** 审批卡首次出现时用 polite live region 播报等待状态和工具名;不抢焦点。
- **验收:** 屏幕阅读器能发现新审批,右侧栏数量变化也有可访问状态。
### UX-04 长任务阶段播报
- **优先级 / 状态:** P1 / 已完成
- **范围:** 低频阶段使用 `role="status"`,失败终态使用 `role="alert"`,不逐字播报正文。
- **验收:** 准备、等待、完成和失败可被辅助技术理解,流式输出不会形成播报风暴。
### UX-05 Composer 错误关联
- **优先级 / 状态:** P1 / 已完成
- **范围:** 附件和上下文错误使用稳定 ID、`role="alert"`、`aria-describedby` 和适当的
`aria-invalid`。
- **验收:** 键盘和屏幕阅读器用户能知道发送失败原因及对应操作区域。
### UX-06 设置离开确认焦点
- **优先级 / 状态:** P1 / 已完成
- **范围:** 确认出现时滚动到可见区域并聚焦“继续编辑”,或改用共享确认对话框。
- **验收:** 在长设置页底部切换分类、关闭设置和应用导航时均不会出现不可见确认。
### UX-07 SSH Host 读取失败状态
- **优先级 / 状态:** P1 / 已完成
- **范围:** 读取失败与真实空列表分开,失败状态提供重新读取。
- **验收:** 暂时读取失败不会诱导用户重复添加 Host,重试成功后恢复原列表。
### UX-08 工作区预览重试
- **优先级 / 状态:** P2 / 已完成
- **范围:** 加载使用 `role="status"` 和 `aria-busy`;失败保留路径并提供重新读取。
- **验收:** 网络抖动后无需返回目录重新查找文件即可恢复预览。
### UX-09 最近对话空状态
- **优先级 / 状态:** P2 / 已完成
- **范围:** 区分首次为空、搜索无结果和加载失败,分别提供新建、清除搜索和重试。
- **验收:** 三种状态文案和操作互不混用。
### UX-10 共享加载状态语义
- **优先级 / 状态:** P2 / 已完成
- **范围:** 为共享 `EmptyState` 增加 loading 变体,并迁移知识库、智能心跳和 SSH Host。
- **验收:** 加载状态统一输出 `role="status"`、`aria-live="polite"` 和 `aria-busy="true"`。
### UX-11 更新检查错误反馈
- **优先级 / 状态:** P1 / 已完成
- **范围:**
- 启动检查失败进入去重后的全局错误通知。
- 保留来源、网络和有界 HTTP 错误上下文。
- 打开下载页失败也显示通知。
- **验收:** 不再以空 `catch` 静默丢失用户可处理的更新错误。
### UX-12 更新源与自动检查解耦
- **优先级 / 状态:** P2 / 已完成
- **范围:**
- 关闭启动检查后仍可选择 GitHub 或镜像。
- 手动检查和下载继续使用所选来源。
- 同步修订 `UI-DESIGN.md` 当前相反的规则。
- **验收:** “关闭自动检查、切换镜像、手动检查”流程通过测试。
## 9. 诊断与质量
### OPS-01 桌面端有界诊断日志
- **优先级 / 状态:** P1 / 已完成
- **范围:** 轮转记录最近启动和 Runtime 失败的时间、组件、阶段和稳定错误码。
- **限制:** 不记录 Prompt、凭据、文档正文或 Provider 原始响应。
- **验收:** 重启后仍可定位最近一次人为制造的数据库或 Runtime 启动失败。
### OPS-02 远端 Agent 有界诊断日志
- **优先级 / 状态:** P1 / 已完成
- **范围:** Detached Agent 保存有界轮转诊断,覆盖 Runtime 启动、退出、连接和恢复阶段。
- **验收:** 人为制造远端失败后可导出根因阶段;关闭和轮转不会遗留无界文件。
- **限制:** 不记录 accepted Prompt、模型密钥或完整模型配置。
### OPS-03 反馈可选附加诊断
- **优先级 / 状态:** P1 / 已完成
- **范围:** 用户主动勾选后才附加诊断,提交前说明类别,保留现有截图和草稿重试。
- **验收:** 默认反馈不附加诊断;勾选后只包含允许的有界记录。
- **依赖:** `OPS-01`;本批明确不自动读取或附加 `OPS-02` 的远端 Agent 记录,
远端记录通过 Agent 固定 CLI 独立导出。
### QA-01 真实 Runtime E2E
- **优先级 / 状态:** P1 / 待开始
- **范围:**
- 直连模型一次有界真实请求。
- Bundled OpenCode 启动并执行文件任务。
- Continue 启动并完成一次任务。
- MCP 工具写入生产路径。
- **验收:** 受保护发布候选任务运行通过,并记录精确模型调用次数和费用边界。
### QA-02 本地兼容 Provider E2E
- **优先级 / 状态:** P1 / 待开始
- **目标:** 常规 CI 无需公网或真实模型凭据也能覆盖打包 Runtime 启动和工具路径。
- **范围:** 提供最小本地 OpenAI 兼容测试 Provider,覆盖流式响应和工具调用。
- **验收:** SDK、Runtime 二进制、Provider 适配或工具写入回归会使常规 CI 失败。
### QA-03 Windows ARM64 覆盖纠正
- **优先级 / 状态:** P1 / 待开始
- **范围:**
- 文档明确 Windows ARM64 当前为交叉打包。
- 在真实设备验证 Electron、node-pty、Koffi、Canvas、OCR 和 Runtime 加载。
- 有可用 ARM64 Runner 后再声明原生 CI。
- **验收:** 文档和发布声明不再把文件架构验证描述为原生运行验证。
- **外部依赖:** 真实 Windows ARM64 设备或 Runner。
## 10. 每批完成标准
一个事项只有同时满足以下条件才可标记为“已完成”:
1. 正常 UI 操作到达生产实现并产生预期结果,不以 mock、注入 fake 或禁用入口代替。
2. 已覆盖本事项声明的可达失败场景,用户输入和可恢复上下文不会被静默丢弃。
3. 新增或更新聚焦测试;功能变化后运行:
```text
npm test
npm run typecheck
npm run lint
```
4. 生产构建或发布脚本变化后运行 `npm run build`。
5. 改动涉及 GoodBuddy Agent 或 Desktop-to-Agent 生产路径时,按 `AGENTS.md` 在共享 Linux x64
Test Host 验证当前源码或候选包;Host 不可达时明确记录阻塞,不能标记完成。
6. 检查并更新受影响的 PRD、架构、设计、功能矩阵、构建和运维文档。
7. 在批次记录中填写实际验证命令、结果、剩余限制和对应提交。
## 11. 批次记录模板
开始一个批次时,在本节末尾复制以下模板:
```markdown
### 批次 N:标题
- 状态:进行中
- 范围:ITEM-01、ITEM-02
- 明确不包含:
- 开始日期:
- 完成日期:
- 外部依赖:
#### 验收结果
- [ ] 正常生产路径
- [ ] 声明的失败与恢复路径
- [ ] 聚焦测试
- [ ] npm test
- [ ] npm run typecheck
- [ ] npm run lint
- [ ] npm run build(如适用)
- [ ] 真实 Host 或目标平台验证(如适用)
- [ ] 相关文档更新
#### 结果与剩余限制
- 提交:
- 验证:
- 剩余限制:
```
### 批次 1A:体验一致性与 P1 诊断
- 状态:已完成
- 范围:`UX-01` 至 `UX-12`、`OPS-01` 至 `OPS-03`
- 明确不包含:`REL-*`、`FUN-*`、`PERF-*`、`QA-*`,以及初始 Renderer Bundle 优化
- 开始日期:2026-08-31
- 完成日期:2026-08-31
- 外部依赖:无
#### 验收结果
- [x] 正常生产路径
- [x] 声明的失败与恢复路径
- [x] 聚焦测试
- [x] `npm test`
- [x] `npm run typecheck`
- [x] `npm run lint`
- [x] `npm run build`
- [x] 共享 Linux x64 Host 的当前源码 Agent 候选验证
- [x] 相关文档更新
#### 结果与剩余限制
- 提交:尚未提交
- 验证:306 个测试文件、3322 项测试通过,49 项按既有条件跳过;Node/Web TypeScript、
完整 ESLint、生产构建和 Renderer Bundle 预算均通过。共享 Linux x64 Host 使用隔离
installation 完成 bootstrap、attach、断开重连、controller resume、Runtime 进程启动、
CLI 诊断导出、重启读取、权限和诊断写失败隔离;真实文本模型调用 0 次。
- 剩余限制:真实 Host 本次没有通过 Agent-owned model bridge 执行 Prompt,因此未在该
Host 上覆盖 Prompt 期间的 `runtime.starting/runtime.started` 诊断;三文件真实轮转仍由
聚焦测试覆盖。正式发布、功能增强、性能基线和 QA 路线均不属于本批。
+7 -79
View File
@@ -58,84 +58,12 @@ function deepSeekHarnessBundleManifestPlugin(): Plugin {
}
}
export function sanitizeRendererModuleId(
id: string,
projectRoot = resolve('.')
): string {
const normalized = id.replaceAll('\\', '/')
const normalizedRoot = resolve(projectRoot).replaceAll('\\', '/')
if (normalized.startsWith('\0')) {
const virtualId = normalized.slice(1)
if (virtualId.startsWith(`${normalizedRoot}/`)) {
return `virtual:${virtualId.slice(normalizedRoot.length + 1)}`
}
const virtualNodeModulesIndex =
virtualId.lastIndexOf('/node_modules/')
if (virtualNodeModulesIndex >= 0) {
return `virtual:node_modules/${virtualId.slice(
virtualNodeModulesIndex + '/node_modules/'.length
)}`
}
if (
virtualId.startsWith('/') ||
/[A-Za-z]:\//u.test(virtualId) ||
/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(virtualId) ||
virtualId.includes('/Users/') ||
virtualId.includes('/home/')
) {
throw new Error(`Renderer virtual module leaks a path: ${id}`)
}
return `virtual:${virtualId}`
}
if (
normalized === normalizedRoot ||
normalized.startsWith(`${normalizedRoot}/`)
) {
return normalized.slice(normalizedRoot.length + 1)
}
const nodeModulesMarker = '/node_modules/'
const nodeModulesIndex = normalized.lastIndexOf(nodeModulesMarker)
if (nodeModulesIndex >= 0) {
return `node_modules/${normalized.slice(
nodeModulesIndex + nodeModulesMarker.length
)}`
}
if (
!normalized.startsWith('/') &&
!/^[A-Za-z]:\//u.test(normalized) &&
!/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(normalized) &&
!normalized.startsWith('../')
) {
return normalized
}
throw new Error(`Renderer module is outside the project: ${id}`)
}
function rendererBundleModuleManifestPlugin(): Plugin {
const projectRoot = resolve('.')
return {
name: 'renderer-bundle-module-manifest',
generateBundle(_options, bundle) {
const chunks = Object.values(bundle)
.filter((item) => item.type === 'chunk')
.map((chunk) => [
chunk.fileName,
Object.keys(chunk.modules).map((id) =>
sanitizeRendererModuleId(id, projectRoot)
)
])
this.emitFile({
type: 'asset',
fileName: '.vite/module-manifest.json',
source: `${JSON.stringify(Object.fromEntries(chunks), null, 2)}\n`
})
}
}
}
export function stableMainEntryFileName(chunk: {
readonly name: string
}): string {
if (chunk.name === 'remote-package-installer') {
return 'remote-package-installer.mjs'
}
return [
'deepseek-harness-host-bootstrap',
'embedding-inference-bootstrap'
@@ -191,6 +119,9 @@ export default defineConfig({
),
'embedding-inference-bootstrap': resolve(
'src/main/embedding-inference-bootstrap.ts'
),
'remote-package-installer': resolve(
'src/main/remote-agent/control-plane-package-installer-cli.ts'
)
},
external: [
@@ -248,9 +179,6 @@ export default defineConfig({
worker: {
format: 'es'
},
build: {
manifest: true
},
plugins: [react(), rendererBundleModuleManifestPlugin()]
plugins: [react()]
}
})
+79 -3
View File
@@ -1,16 +1,15 @@
{
"name": "goodbuddy",
"version": "0.11.5",
"version": "0.12.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "goodbuddy",
"version": "0.11.5",
"version": "0.12.0",
"license": "0BSD",
"dependencies": {
"@agentclientprotocol/sdk": "0.25.1",
"@antv/g6": "^5.1.1",
"@deepseek-ai/cordis": "4.0.1",
"@deepseek-ai/dsh-agent": "0.1.0-rc.8",
"@deepseek-ai/dsh-agent-loop": "0.1.0-rc.8",
@@ -39,6 +38,10 @@
"@napi-rs/canvas": "1.0.3",
"@opencode-ai/sdk": "^1.18.9",
"@wecom/aibot-node-sdk": "^1.0.6",
"@xterm/addon-fit": "0.11.0",
"@xterm/addon-search": "0.16.0",
"@xterm/addon-webgl": "0.19.0",
"@xterm/xterm": "6.0.0",
"cross-spawn": "^7.0.6",
"dingtalk-stream": "^2.1.6-beta.1",
"dompurify": "^3.4.13",
@@ -50,6 +53,7 @@
"koffi": "3.1.4",
"lucide-react": "^1.27.0",
"mermaid": "^11.16.1",
"node-pty": "^1.2.0-beta.15",
"npm": "11.19.0",
"onnxruntime-web": "^1.23.2",
"pdfjs-dist": "^6.2.108",
@@ -70,6 +74,7 @@
"zod": "^4.4.3"
},
"devDependencies": {
"@antv/g6": "^5.1.1",
"@continuedev/cli": "1.5.47",
"@eslint/js": "^10.0.1",
"@fontsource-variable/inter": "^5.3.0",
@@ -163,6 +168,7 @@
"version": "0.1.26",
"resolved": "https://registry.npmjs.org/@antv/algorithm/-/algorithm-0.1.26.tgz",
"integrity": "sha512-DVhcFSQ8YQnMNW34Mk8BSsfc61iC1sAnmcfYoXTAshYHuU50p/6b7x3QYaGctDNKWGvi1ub7mPcSY0bK+aN0qg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/util": "^2.0.13",
@@ -173,6 +179,7 @@
"version": "2.0.17",
"resolved": "https://registry.npmjs.org/@antv/util/-/util-2.0.17.tgz",
"integrity": "sha512-o6I9hi5CIUvLGDhth0RxNSFDRwXeywmt6ExR4+RmVAzIi48ps6HUy+svxOCayvrPBN37uE6TAc2KDofRo0nK9Q==",
"dev": true,
"license": "ISC",
"dependencies": {
"csstype": "^3.0.8",
@@ -183,6 +190,7 @@
"version": "2.1.11",
"resolved": "https://registry.npmjs.org/@antv/component/-/component-2.1.11.tgz",
"integrity": "sha512-dTdz8VAd3rpjOaGEZTluz82mtzrP4XCtNlNQyrxY7VNRNcjtvpTLDn57bUL2lRu1T+iklKvgbE2llMriWkq9vQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/g": "^6.1.11",
@@ -195,18 +203,21 @@
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@antv/event-emitter/-/event-emitter-0.1.3.tgz",
"integrity": "sha512-4ddpsiHN9Pd4UIlWuKVK1C4IiZIdbwQvy9i7DUSI3xNJ89FPUFt8lxDYj8GzzfdllV0NkJTRxnG+FvLk0llidg==",
"dev": true,
"license": "MIT"
},
"node_modules/@antv/expr": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@antv/expr/-/expr-1.0.2.tgz",
"integrity": "sha512-vrfdmPHkTuiS5voVutKl2l06w1ihBh9A8SFdQPEE+2KMVpkymzGOF1eWpfkbGZ7tiFE15GodVdhhHomD/hdIwg==",
"dev": true,
"license": "MIT"
},
"node_modules/@antv/g": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/@antv/g/-/g-6.3.1.tgz",
"integrity": "sha512-WYEKqy86LHB2PzTmrZXrIsIe+3Epeds2f68zceQ+BJtRoGki7Sy4IhlC8LrUMztgfT1t3d/0L745NWZwITroKA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/g-lite": "2.7.0",
@@ -220,6 +231,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@antv/g-canvas/-/g-canvas-2.2.0.tgz",
"integrity": "sha512-h7zVBBo2aO64DuGKvq9sG+yTU3sCUb9DALCVm7nz8qGPs8hhLuFOkKPEzUDNfNYZGJUGzY8UDtJ3QRGRFcvEQg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/g-lite": "2.7.0",
@@ -234,6 +246,7 @@
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/@antv/g-lite/-/g-lite-2.7.0.tgz",
"integrity": "sha512-uSzgHYa5bwR5L2Au7/5tsOhFmXKZKLPBH90+Q9bP9teVs5VT4kOAi0isPSpDI8uhdDC2/VrfTWu5K9HhWI6FWw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/g-math": "3.1.0",
@@ -249,6 +262,7 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@antv/g-math/-/g-math-3.1.0.tgz",
"integrity": "sha512-DtN1Gj/yI0UiK18nSBsZX8RK0LszGwqfb+cBYWgE+ddyTm8dZnW4tPUhV7QXePsS6/A5hHC+JFpAAK7OEGo5ZQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/util": "^3.3.5",
@@ -261,6 +275,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@antv/g-plugin-dragndrop/-/g-plugin-dragndrop-2.1.1.tgz",
"integrity": "sha512-+aesDUJVQDs6UJ2bOBbDlaGAPCfHmU0MbrMTlQlfpwNplWueqtgVAZ3L57oZ2ZGHRWUHiRwZGPjXMBM3O2LELw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/g-lite": "2.7.0",
@@ -273,6 +288,7 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@antv/g6/-/g6-5.1.1.tgz",
"integrity": "sha512-50bXxMUf4mChyOv4ePVeWZLwotih9VunKfp0a++Wofv/wCyY8fb9+CV2wouIBCOZnd5ydBRA4NNaX9yLJzqa2w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/algorithm": "^0.1.26",
@@ -292,6 +308,7 @@
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@antv/graphlib/-/graphlib-2.0.4.tgz",
"integrity": "sha512-zc/5oQlsdk42Z0ib1mGklwzhJ5vczLFiPa1v7DgJkTbgJ2YxRh9xdarf86zI49sKVJmgbweRpJs7Nu5bIiwv4w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/event-emitter": "^0.1.3"
@@ -301,12 +318,14 @@
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/@antv/hierarchy/-/hierarchy-0.7.1.tgz",
"integrity": "sha512-7r22r+HxfcRZp79ZjGmsn97zgC1Iajrv0Mm9DIgx3lPfk+Kme2MG/+EKdZj1iEBsN0rJRzjWVPGL5YrBdVHchw==",
"dev": true,
"license": "MIT"
},
"node_modules/@antv/layout": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@antv/layout/-/layout-2.0.0.tgz",
"integrity": "sha512-aCZ3UdNc40SfT7meFV7QTADY2HCnc0DShVw56CJNTI6oExUIVU736grPuL5Dhb8/JrVaU4Y83QPN/P7KafBzlw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/event-emitter": "^0.1.3",
@@ -327,6 +346,7 @@
"version": "0.4.16",
"resolved": "https://registry.npmjs.org/@antv/scale/-/scale-0.4.16.tgz",
"integrity": "sha512-5wg/zB5kXHxpTV5OYwJD3ja6R8yTiqIOkjOhmpEJiowkzRlbEC/BOyMvNUq5fqFIHnMCE9woO7+c3zxEQCKPjw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@antv/util": "^3.3.7",
@@ -338,6 +358,7 @@
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/@antv/util/-/util-3.3.11.tgz",
"integrity": "sha512-FII08DFM4ABh2q5rPYdr0hMtKXRgeZazvXaFYCs7J7uTcWDHUhczab2qOCJLNDugoj8jFag1djb7wS9ehaRYBg==",
"dev": true,
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
@@ -349,6 +370,7 @@
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@antv/vendor/-/vendor-1.0.11.tgz",
"integrity": "sha512-LmhPEQ+aapk3barntaiIxJ5VHno/Tyab2JnfdcPzp5xONh/8VSfed4bo/9xKo5HcUAEydko38vYLfj6lJliLiw==",
"dev": true,
"license": "MIT AND ISC",
"dependencies": {
"@types/d3-array": "^3.2.1",
@@ -5873,6 +5895,33 @@
"node": ">=10.0.0"
}
},
"node_modules/@xterm/addon-fit": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz",
"integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==",
"license": "MIT"
},
"node_modules/@xterm/addon-search": {
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0.tgz",
"integrity": "sha512-9OeuBFu0/uZJPu+9AHKY6g/w0Czyb/Ut0A5t79I4ULoU4IfU5BEpPFVGQxP4zTTMdfZEYkVIRYbHBX1xWwjeSA==",
"license": "MIT"
},
"node_modules/@xterm/addon-webgl": {
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0.tgz",
"integrity": "sha512-b3fMOsyLVuCeNJWxolACEUED0vm7qC0cy4wRvf3oURSzDTYVQiGPhTnhWZwIHdvC48Y+oLhvYXnY4XDXPoJo6A==",
"license": "MIT"
},
"node_modules/@xterm/xterm": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz",
"integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==",
"license": "MIT",
"workspaces": [
"addons/*"
]
},
"node_modules/abbrev": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz",
@@ -6351,6 +6400,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.6.0"
@@ -6527,6 +6577,7 @@
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/bubblesets-js/-/bubblesets-js-2.3.4.tgz",
"integrity": "sha512-DyMjHmpkS2+xcFNtyN00apJYL3ESdp9fTrkDr5+9Qg/GPqFmcWgGsK1akZnttE1XFxJ/VMy4DNNGMGYtmFp1Sg==",
"dev": true,
"license": "MIT"
},
"node_modules/buffer-equal-constant-time": {
@@ -6868,6 +6919,7 @@
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
"integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "^1.0.0",
@@ -6890,6 +6942,7 @@
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.2.tgz",
"integrity": "sha512-OxGdvBmJuNKSCMO4NTl1L47VRp6xn2wG4F/2hYzB6tiCb709otOxtEYCSvK80PtjODfXXZu8ds+Nw5kVCjqd2g==",
"dev": true,
"license": "Apache-2.0"
},
"node_modules/comma-separated-tokens": {
@@ -7050,6 +7103,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"dev": true,
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
@@ -7196,6 +7250,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/d3-binarytree/-/d3-binarytree-1.0.2.tgz",
"integrity": "sha512-cElUNH+sHu95L04m92pG73t2MEJXKu+GeKUN1TJkFsu93E5W8E9Sc3kHEGJKgenGvj19m6upSn2EunvMgMD2Yw==",
"dev": true,
"license": "MIT"
},
"node_modules/d3-brush": {
@@ -7366,6 +7421,7 @@
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/d3-force-3d/-/d3-force-3d-3.0.6.tgz",
"integrity": "sha512-4tsKHUPLOVkyfEffZo1v6sFHvGFwAIIjt/W8IThbp08DYAsXZck+2pSHEG5W1+gQgEvFLdZkYvmJAbRM2EzMnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"d3-binarytree": "1",
@@ -7403,6 +7459,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-4.0.0.tgz",
"integrity": "sha512-p0bK60CEzph1iqmnxut7d/1kyTmm3UWtPlwdkM31AU+LW+BXazd5zJdoCn7VFxNCHXRngPHRnsNn5uGjLRGndg==",
"dev": true,
"license": "ISC",
"dependencies": {
"commander": "7",
@@ -7424,6 +7481,7 @@
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 10"
@@ -7454,6 +7512,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/d3-octree/-/d3-octree-1.1.0.tgz",
"integrity": "sha512-F8gPlqpP+HwRPMO/8uOu5wjH110+6q4cgJvgJT6vlpy3BEaDIKlTZrgHKZSp/i1InRpVfh4puY/kvL6MxK930A==",
"dev": true,
"license": "MIT"
},
"node_modules/d3-path": {
@@ -7496,6 +7555,7 @@
"version": "1.3.10",
"resolved": "https://registry.npmjs.org/d3-regression/-/d3-regression-1.3.10.tgz",
"integrity": "sha512-PF8GWEL70cHHWpx2jUQXc68r1pyPHIA+St16muk/XRokETzlegj5LriNKg7o4LR0TySug4nHYPJNNRz/W+/Niw==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/d3-sankey": {
@@ -7660,6 +7720,7 @@
"version": "0.8.5",
"resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz",
"integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==",
"dev": true,
"license": "MIT",
"dependencies": {
"graphlib": "^2.1.8",
@@ -8984,6 +9045,7 @@
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
"integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==",
"dev": true,
"license": "MIT"
},
"node_modules/fetch-blob": {
@@ -9356,6 +9418,7 @@
"version": "3.4.4",
"resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz",
"integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==",
"dev": true,
"license": "MIT"
},
"node_modules/glob": {
@@ -9563,6 +9626,7 @@
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz",
"integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"lodash": "^4.17.15"
@@ -9949,6 +10013,7 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"dev": true,
"license": "MIT",
"dependencies": {
"css-line-break": "^2.1.0",
@@ -10222,12 +10287,14 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-any-array/-/is-any-array-3.0.0.tgz",
"integrity": "sha512-o4h+tylWykC4BD1vaejp6gDxoM13bwW8FGuNs4yIKpj8xbBJcRxJx8vZpq0dCr7ZDEfeKjmsi/euolKhX6f/ww==",
"dev": true,
"license": "MIT"
},
"node_modules/is-arrayish": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz",
"integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==",
"dev": true,
"license": "MIT"
},
"node_modules/is-decimal": {
@@ -10699,6 +10766,7 @@
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"dev": true,
"license": "MIT"
},
"node_modules/lodash-es": {
@@ -11896,6 +11964,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ml-array-max/-/ml-array-max-2.0.0.tgz",
"integrity": "sha512-QQZ4kENwpWmyNb98UXRDFXrmtIXuXtt1+bSbda/2KA85+F+rrJP8hZk6QOkCQXM2Th9mUDYdq/PNByPdT9ID4A==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-any-array": "^3.0.0"
@@ -11905,6 +11974,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ml-array-min/-/ml-array-min-2.0.0.tgz",
"integrity": "sha512-GRj6Ky6sW9vGL6yIjgsHmXZ9YgrdmcQ8nCxPqEGeKc6dkfYg1XDYxGFxADUjNuZyoCd5PUscWAS4N+cFaX6hFg==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-any-array": "^3.0.0"
@@ -11914,6 +11984,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ml-array-rescale/-/ml-array-rescale-2.0.0.tgz",
"integrity": "sha512-2GGtKfSno94/kIloWGvpp/U5Q5vLvLrza+SAaGsLeo6Xj4mEbA6Gqx+oTfZFkxnd1grT2X007HfJNs3T5BsiVg==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-any-array": "^3.0.0",
@@ -11925,6 +11996,7 @@
"version": "6.15.0",
"resolved": "https://registry.npmjs.org/ml-matrix/-/ml-matrix-6.15.0.tgz",
"integrity": "sha512-wFa1v6KP8bKp+fj0nYmRs1Pb5K4zRkXGKsOvLinvILENFIADncm4XlOI+S1M7yuACMGfI6cfk0IifDgd4j5xmw==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-any-array": "^3.0.0",
@@ -15933,6 +16005,7 @@
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz",
"integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==",
"dev": true,
"license": "MIT",
"dependencies": {
"is-arrayish": "^0.3.1"
@@ -16180,6 +16253,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/svg-path-parser/-/svg-path-parser-1.1.0.tgz",
"integrity": "sha512-jGCUqcQyXpfe38R7RFfhrMyfXcBmpMNJI/B+4CE9/Unkh98UporAc461GTthv+TVDuZXsBx7/WiwJb1Oh4tt4A==",
"dev": true,
"license": "MIT"
},
"node_modules/symbol-tree": {
@@ -16246,6 +16320,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"dev": true,
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
@@ -16845,6 +16920,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"dev": true,
"license": "MIT",
"dependencies": {
"base64-arraybuffer": "^1.0.2"
+17 -8
View File
@@ -1,6 +1,6 @@
{
"name": "goodbuddy",
"version": "0.11.5",
"version": "0.12.0",
"private": true,
"description": "Secure desktop AI workspace with controlled Agent Runtimes",
"desktopName": "GoodBuddy",
@@ -27,7 +27,7 @@
"test:watch": "vitest",
"eval:retrieval": "vitest run --config tests/support/knowledge-retrieval-evaluation.ts tests/knowledge-retrieval-metrics.test.ts tests/knowledge-retrieval-evaluation.test.ts",
"build": "npm run typecheck && npm run build:bundle",
"build:bundle": "electron-vite build && node build/check-renderer-bundle.cjs",
"build:bundle": "electron-vite build && node build/check-control-plane-package-installer.cjs",
"smoke:deepseek-harness": "npm run build:bundle && node build/run-deepseek-harness-utility-smoke.cjs",
"smoke:deepseek-harness:packaged": "node build/run-packaged-deepseek-harness-smoke.cjs",
"agent:build": "node build/agent-bundle.cjs build",
@@ -37,12 +37,12 @@
"remote-runtime:verify": "node build/remote-runtime-bundle.cjs verify",
"remote-runtime:import": "node build/remote-runtime-bundle.cjs import",
"release:notes:verify": "node build/release-notes.cjs",
"dist": "npm run build && electron-builder",
"dist:win": "npm run build && electron-builder --win nsis --x64 --arm64",
"dist:mac": "npm run build && electron-builder --mac dmg --x64 --arm64",
"dist": "npm run build && node build/run-electron-builder.cjs",
"dist:win": "npm run build && node build/run-electron-builder.cjs --win nsis --x64 --arm64",
"dist:mac": "npm run build && node build/run-electron-builder.cjs --mac dmg --x64 --arm64",
"dist:linux": "npm run dist:linux:x64 && npm run dist:linux:arm64",
"dist:linux:x64": "npm run build && electron-builder --linux AppImage deb rpm --x64",
"dist:linux:arm64": "npm run build && electron-builder --linux AppImage deb rpm --arm64",
"dist:linux:x64": "npm run build && node build/run-electron-builder.cjs --linux AppImage deb rpm --x64",
"dist:linux:arm64": "npm run build && node build/run-electron-builder.cjs --linux AppImage deb rpm --arm64",
"icons": "node build/generate-icons.mjs",
"release:package": "node build/build-release.cjs",
"portable": "node build/build-portable.cjs"
@@ -91,6 +91,10 @@
"from": "resources/release-notes.json",
"to": "release-notes.json"
},
{
"from": "resources/tool-environment/managed-python-artifacts.json",
"to": "tool-environment/managed-python-artifacts.json"
},
{
"from": "agent-runtime-lock.json",
"to": "agent-runtime-lock.json"
@@ -259,7 +263,6 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "0.25.1",
"@antv/g6": "^5.1.1",
"@deepseek-ai/cordis": "4.0.1",
"@deepseek-ai/dsh-agent": "0.1.0-rc.8",
"@deepseek-ai/dsh-agent-loop": "0.1.0-rc.8",
@@ -288,6 +291,10 @@
"@napi-rs/canvas": "1.0.3",
"@opencode-ai/sdk": "^1.18.9",
"@wecom/aibot-node-sdk": "^1.0.6",
"@xterm/addon-fit": "0.11.0",
"@xterm/addon-search": "0.16.0",
"@xterm/addon-webgl": "0.19.0",
"@xterm/xterm": "6.0.0",
"cross-spawn": "^7.0.6",
"dingtalk-stream": "^2.1.6-beta.1",
"dompurify": "^3.4.13",
@@ -299,6 +306,7 @@
"koffi": "3.1.4",
"lucide-react": "^1.27.0",
"mermaid": "^11.16.1",
"node-pty": "^1.2.0-beta.15",
"npm": "11.19.0",
"onnxruntime-web": "^1.23.2",
"pdfjs-dist": "^6.2.108",
@@ -319,6 +327,7 @@
"zod": "^4.4.3"
},
"devDependencies": {
"@antv/g6": "^5.1.1",
"@continuedev/cli": "1.5.47",
"@eslint/js": "^10.0.1",
"@fontsource-variable/inter": "^5.3.0",
+316
View File
@@ -1,6 +1,322 @@
{
"formatVersion": 1,
"releases": [
{
"version": "0.12.0",
"releasedAt": "2026-09-02",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.12.0 新增多终端助手工作栏、直连模型编程 Agent 和本机工具执行环境,并完善浏览器导航、回复复制、Skills 组织与 DeepSeek Harness 模型选择。"
],
"features": [
"**助手工作栏与多终端。** 在本机或托管 SSH 项目中开发时,可以从右侧工作栏的“+”同时打开多个终端,分别运行开发服务、测试或其他 Shell 任务。每个终端拥有独立目录、输出和生命周期;关闭页签会结束对应 Shell,应用重启后由用户明确选择是否重连。主侧栏与魔法笔记列表也支持拖拽和键盘调宽,魔法笔记列表可隐藏并记住布局。",
"**直连模型编程 Agent。** 使用直连模型处理代码时,现在可以直接要求它在 Execute 模式修改文件、运行平台 Shell 并根据测试结果继续修复。模型还可以把一个聚焦的编程步骤委派给单层 Subagent,再将结果汇总回当前回复。整个过程继续使用当前模型、项目和工作模式,并保留取消与活动记录。",
"**本机工具执行环境。** 在新设备缺少 Node.js 或 Python,或者 Skills、stdio MCP 需要固定解释器时,可以在“能力与工具”中选择 GoodBuddy 托管环境或经过验证的自定义解释器。托管 Node.js 随应用提供,托管 Python 在首次需要时按所选原生地址或 OSS 镜像下载,并显示诊断、安装进度、取消和删除操作。该设置只影响新启动的本机 Runtime 与 stdio MCP,不修改系统环境、普通终端或远程 Host。",
"**浏览器工作栏导航。** 当 Agent 正在使用内置浏览器调研或操作网页时,可以在工作栏中直接返回、刷新、停止加载或输入新地址,不必结束任务后重新开始。地址栏支持完整 URL、裸域名和带端口的主机地址。用户与 Agent 始终操作同一个按会话隔离的浏览器页面,因此用户导航后的页面会成为 Agent 下一步看到的页面。",
"**复制 AI 回复。** 需要把回答放入文档、Issue 或其他工具时,可以从已完成回复底部一键复制干净的 Markdown 原文。复制内容不包含推理过程、工具日志或引用元数据,避免手动清理。复制完整会话时也使用同一条经过 Main 校验的剪贴板路径,修复沙箱环境下可能无法写入的问题。",
"**中文“去 AI 味”审校扩展。** 审阅中文报告、方案或产品文案时,内置审校现在可以发现更多分析套话、模糊归因、角色槽位、工程黑话和绝对化承诺。扫描报告按严重级别和问题分类汇总,便于先处理高影响问题,再逐项修改原文。现有跨平台 Python 使用方式保持不变。"
],
"fixes": [
"**工具环境选择与诊断更准确。** 自定义 Node.js/Python 入口始终可操作,不再隐式采用首个候选;增加 PATH、venv、Conda 和常见安装位置探测,并移除没有实际证据的依赖占位状态。",
"**DeepSeek Harness 自动沿用兼容模型。** 没有管理员预置连接时,现在跟随默认或首个兼容模型,无需重复配置。",
"**Skills 与 MCP 入口更清晰。** 两者统一到“能力与工具”;内置 Skills 从 14 个顶层入口精简为 5 个,产品营销类默认停用,已保存的用户设置保持不变。",
"**界面和产品文案修正。** 修复主侧栏分隔线未对齐,并将官网、README 与智能心跳中的空泛宣传改为直接说明实际能力和运行边界。",
"**桌面打包更干净。** 不再显示无需处理的重复依赖引用摘要,也不再把已由 Renderer 打包的 AntV G6 依赖树重复复制到安装包。",
"**OpenCode 启动路径不再重复验证。** 启动本机 OpenCode 时,GoodBuddy 现在直接使用已选择的绝对路径,不再预先检查文件或运行 `--version`;若路径失效,实际启动会返回错误。托管 Linux ARM Host 激活已登记 Runtime 时也继续依据安装或更新阶段验证的 registry 与 manifest,不重新哈希或检查完整二进制。"
],
"notices": [
"工具执行环境只作用于本机 Skills 和 stdio MCP,不修改系统环境、普通终端或远程 Host。托管 Python 在首次使用时按需下载。",
"远程项目仍为默认关闭的技术预览,继续使用单独发布的 Agent `0.11.14`;Desktop `0.12.0` 不内置 Agent 或远程 Runtime。",
"本次使用标准 Windows、macOS、Linux `x64`/`arm64` 发布矩阵,不构建 LoongArch 实验预览。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.12.0 adds a multi-terminal assistant workbar, direct-model programming agents, and local tool environments, together with improved browser navigation, response copy, Skills organization, and DeepSeek Harness model selection."
],
"features": [
"**Assistant workbar and multiple terminals.** While developing in a local or managed SSH project, use the “+” in the right workbar to open separate terminals for a development server, tests, or other Shell tasks. Each terminal has its own directory, output, and lifecycle; closing its tab ends that Shell, and an app restart lets the user explicitly choose whether to reconnect. The main sidebar and Magic Notes list also support pointer and keyboard resizing, while the notes list can be hidden and remembers its layout.",
"**Direct-model programming agents.** When using a direct model for coding, you can now ask it to edit files, run the platform Shell in Execute mode, and continue fixing the result based on test output. The model can also delegate one focused programming step to a single-level Subagent and synthesize the result into the current response. The process retains the current model, project, and work mode, together with cancellation and activity records.",
"**Local tool environments.** On a new device without Node.js or Python, or when a Skill or stdio MCP needs a specific interpreter, choose a GoodBuddy-managed environment or a validated custom interpreter under Capabilities and Tools. Managed Node.js ships with the app; managed Python downloads on first use from the selected native or OSS source and shows diagnostics, installation progress, cancellation, and removal. The setting affects only newly started local Runtimes and stdio MCP processes, not the system environment, ordinary terminals, or remote Hosts.",
"**Browser workbar navigation.** While the Agent researches or operates a page in the built-in browser, you can go back, refresh, stop loading, or enter another address in the workbar without ending and restarting the task. The address field accepts full URLs, bare domains, and hosts with ports. The user and Agent always operate the same conversation-isolated page, so the page reached by user navigation is the page the Agent sees next.",
"**Copy AI responses.** When moving an answer into documentation, an Issue, or another tool, use the bottom action on a completed response to copy clean Markdown source in one step. The copied text excludes reasoning, tool logs, and citation metadata, avoiding manual cleanup. Full-conversation copy uses the same Main-validated clipboard path and fixes writes that could fail in sandboxed sessions.",
"**Expanded Chinese de-AI writing review.** When reviewing a Chinese report, proposal, or product copy, the bundled checker now detects more template analysis phrases, unsupported attribution, role-slot prose, engineering jargon, and absolute promises. Its report groups findings by severity and category so users can address high-impact issues first and then revise each location. Existing cross-platform Python usage remains unchanged."
],
"fixes": [
"**More accurate tool-environment selection and diagnostics.** Custom Node.js/Python choices remain operable and no longer adopt the first candidate implicitly. Discovery now covers PATH, venv, Conda, and common locations, and unsupported dependency placeholders are hidden.",
"**DeepSeek Harness follows a compatible model automatically.** Without an administrator-provided connection, it now uses the default or first compatible model instead of requiring duplicate configuration.",
"**Clearer Skills and MCP navigation.** Both now live under Capabilities and Tools. Built-in Skills are reduced from 14 top-level entries to five; product-marketing Skills default to off, while saved user settings remain authoritative.",
"**Interface and product-copy corrections.** Fixed the misaligned main-sidebar divider and replaced vague promotional wording on the website, in the README, and in Smart Heartbeat with direct descriptions of actual behavior and boundaries.",
"**Cleaner desktop packaging.** Packaging no longer prints non-actionable duplicate dependency summaries or copies the Renderer-bundled AntV G6 dependency graph into desktop packages.",
"**OpenCode startup paths are no longer revalidated.** Local OpenCode now uses the selected absolute path directly without checking the file or running `--version` first; an invalid path fails at the actual launch. Registered Runtime activation on managed Linux ARM Hosts also continues to rely on the registry and manifest verified during installation or update without rehashing or rechecking the complete binary."
],
"notices": [
"Tool environments apply only to local Skills and stdio MCP. They do not modify the system environment, ordinary terminals, or remote Hosts. Managed Python is downloaded on demand when first used.",
"Remote Projects remain an off-by-default technical preview and continue to use the separately published Agent `0.11.14`; Desktop `0.12.0` does not embed the Agent or Remote Runtime.",
"This release uses the standard Windows, macOS, and Linux `x64`/`arm64` matrix and does not build an experimental LoongArch preview."
]
}
}
},
{
"version": "0.11.14",
"releasedAt": "2026-08-31",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.11.14 让托管 SSH 任务在桌面退出或网络中断后继续在 Host 上运行并恢复到原会话,同时新增默认保存在本地的有界诊断,以及更清晰、可恢复的桌面反馈。"
],
"features": [
"**托管 SSH 任务在 Host 上继续运行。** Agent 接受 OpenCode 任务后,不再依赖桌面或 SSH relay 持续在线。重新连接会把结果同步到原会话,不会重发 Prompt、模型调用或工具。项目选择器现按 Host 分组,并显示实时 Agent 连接状态和逐项目恢复进度。",
"**有界诊断与可选反馈附件。** Desktop 与 Agent 分别轮转保存固定阶段和错误码;Agent 诊断可通过只读 `goodbuddy-agent diagnostics --installation-id <id>` 导出为 JSONL。应用内反馈仅在用户勾选时附加小型桌面诊断摘要,且不会附加远端 Agent 日志。"
],
"fixes": [
"**Runtime 状态检查不再残留服务。** 应用启动和切换 Runtime 后会立即回收仅用于状态检查的 OpenCode 探测实例;实际执行 Runtime 仍按项目复用。",
"**Host 版本状态无需重复刷新。** 成功读取的 Agent 与 Runtime 版本会在切换设置分类和重启应用后保留,直到用户刷新、编辑或删除 Host,或开始更新远程环境。",
"**较慢设备上的 OpenCode 启动更可靠。** Linux ARM 与 QEMU 环境的本地 OpenCode 健康检查现在最多等待 30 秒,减少服务已就绪却误报超时。",
"**更新控制相互独立。** 关闭自动检查不再禁用更新源切换或手动检查;启动检查和打开下载页失败时会明确提示。",
"**状态、错误与无障碍反馈更清晰。** 聊天顶部区分 Runtime 连接中、就绪与不可用;Ask/Execute 说明与真实权限一致;最近会话、Host、工作区预览、智能心跳和知识库的加载失败提供明确状态与重试,审批和长任务阶段也会通过辅助技术播报。"
],
"notices": [
"**远程项目技术预览。** 该能力仍默认关闭。Host 必须安装单独发布的 Agent `0.11.14`(Linux x64/arm64)才能使用新的 Agent-owned 恢复;桌面包不内置 Agent 或远程 Runtime。",
"**离线执行与恢复边界。** Agent 接受任务后,桌面离线期间仍可能继续模型和工具轮次并产生服务商用量,直到任务完成、恢复连接后被取消,或 Host 侧 Runtime 停止。若 Host、Agent 或 Runtime 重启,内存中的进行中任务无法继续,将报告结果未知且不会自动重放。",
"**诊断默认仅保存在本地。** 诊断不记录对话、Prompt、凭据、文件内容、路径、环境变量、SSH 参数或 Provider 原始响应;只有用户明确勾选时才将有界桌面摘要附加到反馈,Agent 日志不会自动上传。",
"**发布平台。** Desktop 使用标准 Windows、macOS、Linux 的 x64/arm64 发布矩阵;本次不构建实验性 LoongArch 预览。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.11.14 keeps managed SSH tasks running on the Host when the Desktop exits or the network disconnects, restores them into the original conversation, and adds bounded local-by-default diagnostics plus clearer, recoverable desktop feedback."
],
"features": [
"**Managed SSH tasks continue on the Host.** After the Agent accepts an OpenCode task, it no longer depends on the Desktop or SSH relay staying online. Reconnection synchronizes results into the original conversation without replaying the prompt, model calls, or tools. The project selector now groups projects by Host and shows live Agent connectivity and per-project recovery progress.",
"**Bounded diagnostics and optional feedback attachment.** Desktop and Agent keep separate rotating local records of fixed stages and error codes. Agent diagnostics are available as read-only JSONL through `goodbuddy-agent diagnostics --installation-id <id>`. In-app feedback attaches a small Desktop diagnostic summary only when selected, and never includes remote Agent logs."
],
"fixes": [
"**Runtime status checks no longer leave services running.** GoodBuddy now releases OpenCode probes used only for status checks after startup and Runtime switching. Execution Runtimes remain reusable per project.",
"**Host version status no longer needs repeated refreshes.** Successful Agent and Runtime version results persist across settings-category changes and app restarts until the user refreshes, edits or removes the Host, or starts a remote-environment update.",
"**More reliable OpenCode startup on slower systems.** Local OpenCode health checks now wait up to 30 seconds on Linux ARM and QEMU environments, reducing false timeout reports after the service becomes ready.",
"**Independent update controls.** Turning off automatic checks no longer disables update-source selection or manual checks. Startup-check and download-page failures are now shown explicitly.",
"**Clearer status, recovery, and accessibility feedback.** The chat header distinguishes Runtime Connecting, Ready, and Unavailable states; Ask/Execute guidance matches actual permissions; load failures for recent conversations, Hosts, workspace previews, Smart Heartbeat, and Knowledge provide explicit states and retries; approval and long-task stages are also announced to assistive technologies."
],
"notices": [
"**Remote Projects technical preview.** This capability remains off by default. Hosts require the separately published Agent `0.11.14` for Linux x64 or arm64 to use the new Agent-owned recovery. Desktop packages do not embed the Agent or Remote Runtime.",
"**Offline execution and recovery boundary.** After the Agent accepts a task, model and tool rounds may continue while the Desktop is offline and may continue provider usage until the task completes, is cancelled after reconnection, or the Host-side Runtime stops. If the Host, Agent, or Runtime restarts, in-memory work cannot continue; it reports an unknown outcome and is not replayed automatically.",
"**Diagnostics remain local by default.** Diagnostics do not record conversations, prompts, credentials, file contents, paths, environment variables, SSH arguments, or raw provider responses. A bounded Desktop summary is attached to feedback only when explicitly selected, and Agent logs are never uploaded automatically.",
"**Release platforms.** Desktop uses the standard Windows, macOS, and Linux x64/arm64 matrix. This release does not build an experimental LoongArch preview."
]
}
}
},
{
"version": "0.11.13",
"releasedAt": "2026-08-30",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.11.13 将本地与托管 SSH 项目中的 OpenCode 原生 Task 显示为独立子 Agent,并移除 GoodBuddy 固定的 Prompt 总时限,让 Runtime 决定长任务生命周期。"
],
"features": [
"**OpenCode 原生子 Agent。** OpenCode Task 调用现在以独立子 Agent 卡片显示,持续呈现任务、运行状态、输出和错误,不再同时重复为普通工具。"
],
"fixes": [
"**长任务不再被固定时限中止。** 移除本地 OpenCode、Continue、DeepSeek Harness 和托管 SSH Prompt 的 2/10 分钟外层总时限。任务可持续数小时或更久,直到正常完成或用户取消;Runtime 自身超时仍然生效。",
"**OpenCode 启动更可靠。** 改用本机健康接口检测启动完成,不再依赖固定日志格式,并为较慢设备保留更充足的冷启动时间,减少已启动却误报超时。",
"**HTTP 服务地址配置更灵活。** 模型连接、DeepSeek Harness 与微信绑定可使用用户明确配置的合法 HTTP 或 HTTPS 地址,包括局域网与公网服务;仍保留协议和 API Key 校验。"
],
"notices": [
"用户仍可随时停止任务;启动、控制请求、断线恢复、取消收敛、清理和输出大小仍有独立边界。",
"托管 SSH Host 需要单独发布的 Agent `0.11.13`。提供 Linux x64 和 arm64;桌面包不内置 Agent 或远程 Runtime。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.11.13 presents native OpenCode Tasks as dedicated subagents in local and managed SSH projects, and removes GoodBuddy's fixed Prompt deadline so the Runtime owns long-task lifetime."
],
"features": [
"**Native OpenCode subagents.** OpenCode Task calls now appear as dedicated subagent cards with the task, running state, output, and errors, without a duplicate generic-tool entry."
],
"fixes": [
"**Long tasks are no longer stopped by a fixed limit.** Removed the outer 2/10-minute total deadline from local OpenCode, Continue, DeepSeek Harness, and managed SSH Prompts. Tasks can run for hours or longer until completion or user cancellation; Runtime-owned timeouts still apply.",
"**More reliable OpenCode startup.** GoodBuddy now detects readiness through the local health endpoint instead of a fixed log format and allows more cold-start time on slower devices, avoiding false startup timeouts.",
"**More flexible HTTP service endpoints.** Model connections, DeepSeek Harness, and Weixin binding can use explicitly configured valid HTTP or HTTPS endpoints, including LAN and public services, while retaining protocol and API-key validation."
],
"notices": [
"Users can still stop tasks at any time. Startup, control requests, reconnection recovery, cancellation settlement, cleanup, and output sizes retain independent bounds.",
"Managed SSH Hosts require the separately published Agent `0.11.13`. Linux x64 and arm64 are provided; desktop packages do not embed the Agent or Remote Runtime."
]
}
}
},
{
"version": "0.11.12",
"releasedAt": "2026-08-30",
"notes": {
"zh-CN": {
"highlights": [],
"features": [
"**魔法笔记更新时间。** 魔法笔记列表现在显示每篇笔记的最后更新时间,便于快速判断最近修改过的内容。"
],
"fixes": [
"**远程会话中断后可以继续输入。** 修复托管 SSH 请求结果不确定后,同一会话的每条后续输入都会重复显示“恢复状态不确定”的问题。未确认的旧请求仍不会自动重放;用户再次明确发送时,GoodBuddy 会建立新的 ACP session 并继续当前会话。",
"**Ask 模式远程 Runtime 可以稳定启动。** 修复 Linux Host 上 `bwrap` 启动身份检查存在竞态,导致 Ask 模式可能在模型调用前被拒绝的问题。Agent 现在会验证从固定沙箱启动器到预期签名可执行文件的受限转换。"
],
"notices": [
"**远程项目技术预览与 Agent 要求。** 远程项目仍默认关闭且为技术预览。Host 需要更新到单独发布的 Agent `0.11.10` 才能获得 Ask 模式启动修复;提供 Linux x64 和 arm64,桌面包不内置 Agent 或远程 Runtime。本次不构建 LoongArch 预览。"
]
},
"en-US": {
"highlights": [],
"features": [
"**Magic Notes update times.** The Magic Notes list now shows when each note was last updated, making recently edited content easier to identify."
],
"fixes": [
"**Remote conversations continue after interruptions.** Fixed every later message in a managed SSH conversation repeatedly failing with an uncertain-recovery error after a prompt outcome could not be confirmed. The uncertain prompt is still never replayed automatically; when the user explicitly sends again, GoodBuddy starts a new ACP session and continues the current conversation.",
"**Reliable Ask-mode Remote Runtime startup.** Fixed a race in Linux Host `bwrap` launch identity verification that could reject Ask-mode requests before the model was called. The Agent now verifies the bounded transition from the fixed sandbox launcher to the expected signed executable."
],
"notices": [
"**Remote Projects technical preview and Agent requirement.** Remote Projects remain disabled by default and in technical preview. Hosts must update to the separately published Agent `0.11.10` to receive the Ask-mode startup fix. Linux x64 and arm64 are provided; desktop packages do not embed the Agent or Remote Runtime. This release does not include a LoongArch preview."
]
}
}
},
{
"version": "0.11.11",
"releasedAt": "2026-08-30",
"notes": {
"zh-CN": {
"highlights": [],
"features": [],
"fixes": [
"**远程会话完整保存。** 修复托管 SSH 远程项目的工具结果较长时,会话持久化失败并可能让已完成回复仍显示为生成中的问题。Runtime 已返回的工具输入、输出、错误和摘要现在会完整保存到本地会话,不再受额外的会话字段长度限制。",
"**魔法笔记列表快捷输入更易发现。** 编辑区现在提示输入 `-`、`1.`、`[ ]` 或 `[x]` 后按空格即可创建项目符号、编号或待办清单,并增加行为覆盖以防快捷输入回退。"
],
"notices": []
},
"en-US": {
"highlights": [],
"features": [],
"fixes": [
"**Complete remote conversation saves.** Fixed conversation persistence failing for managed SSH Remote Projects when tool results were long, which could leave a completed reply displayed as still generating. Tool input, output, errors, and summaries already returned by the Runtime are now saved completely without additional conversation-field length limits.",
"**Discoverable Magic Notes list shortcuts.** The editor now explains that typing `-`, `1.`, `[ ]`, or `[x]` followed by Space creates a bullet, numbered, or checklist item, with behavior coverage to prevent regressions."
],
"notices": []
}
}
},
{
"version": "0.11.10",
"releasedAt": "2026-08-29",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.11.10 修复正式环境中的 Host 更新失败,并显著缩短 Agent 与 OpenCode Runtime 的安装、恢复和日常启动校验。"
],
"features": [],
"fixes": [
"**Host 更新恢复可用。** 修复已发布 OpenCode Runtime 在采用阶段被桌面内置锁重复校验而失败的问题。Host 现在使用签名复合包中的版本锁和身份,并在同一条固定 SSH 连接上完成 Agent 启动、健康检查与 Runtime 激活。",
"**不再重复扫描远端包体。** 每种获取路径只对复合包执行一次完整 SHA-256;Host installer 在解包时验证全部签名与 payload digest,commit 只检查签名元数据。Main 不再通过 SFTP 逐文件读取 Agent/Runtime,后续健康检查、能力发现和每次提问只使用已登记 identity、manifest 与入口元数据。仍保留 SHA-256,提速来自消除重复读取。",
"**失败后直接重试。** 未完成操作只保留一个小型 staging 清理记录;下次更新先尽力清理旧暂存,再重新 prepare,不保存或回滚 Agent/Runtime 元数据副本。已健康环境不会因暂存清理失败而回滚,安装错误仍会显示具体的有界原因。"
],
"notices": [
"**技术预览与版本要求。** 远程项目仍默认关闭且为技术预览。Host 需要安装单独发布的 Agent `0.11.9`,提供 Linux x64 和 arm64;桌面包不内置 Agent 或远程 Runtime,本次不构建 LoongArch 预览。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.11.10 fixes Host updates in production and substantially reduces Agent and OpenCode Runtime verification during installation, recovery, and normal startup."
],
"features": [],
"fixes": [
"**Host updates work again.** Fixed published OpenCode Runtime adoption failing because it was redundantly checked against the desktop-bundled lock. The Host now uses the signed compound package's lock and identity, then starts and health-checks the Agent and activates Runtime on one pinned SSH connection.",
"**No repeated remote payload scans.** Each acquisition path performs one full SHA-256 pass over the compound package. The Host installer verifies every signature and payload digest while extracting, and commit checks only signed metadata. Main no longer reads Agent or Runtime file trees over SFTP. Later health, capability, and prompt paths use registered identities, manifests, and entrypoint metadata. SHA-256 remains; the speedup comes from eliminating rereads.",
"**Simple retry after failures.** An unfinished operation keeps only a small staging-cleanup receipt. The next update makes one best-effort cleanup attempt and performs a fresh prepare without saving or restoring copies of Agent or Runtime metadata. A healthy environment is not rolled back for staging cleanup failures, and bounded installer errors retain their concrete cause."
],
"notices": [
"**Technical preview and version requirement.** Remote Projects remain disabled by default and in technical preview. Hosts require the separately published Agent `0.11.9` for Linux x64 or arm64. Desktop packages do not embed the Agent or remote Runtime, and this release does not build a LoongArch preview."
]
}
}
},
{
"version": "0.11.7",
"releasedAt": "2026-08-29",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.11.7 让托管 SSH 项目切换与多会话使用更顺畅,重做 Host 远程环境准备,并修复中断后排队消息重复发送。"
],
"features": [
"**更清楚的 Host 远程环境准备。** “设置 → 平台功能 → 远程项目”的 Host 卡片现在通过一个主按钮完成安装、更新或重装,并可选择“自动”“Host 下载”或“GoodBuddy 传输”。“自动”会在 Host 可直连时由 Host 下载,否则通过 GoodBuddy 传输;已验证的本地或离线导入 Agent 包可以复用,已检查到更高的线上兼容版本时仍使用新版。只有点击主按钮才会开始准备。",
"**Host 与项目管理。** 可从项目选择器直接打开远程项目设置;即使 Host 不可达或远端目录已不存在,也能删除本地项目记录。删除 Host 会先列出关联项目,并在确认后清理这些项目及其本机会话、任务、成果、记忆、计划和心跳关联;不会连接 Host 或删除远端文件。"
],
"fixes": [
"**更快、更可靠的托管 SSH 会话。** 切换已有远程项目现在只更新本地选择,同一 Host 上兼容的项目与对话会共用连接。重连后空闲会话不再因 `stale-controller` 无法继续,正在执行的提问仍按原位置恢复或重放。",
"**排队输入不再重复发送。** 如果应用在消息已写入对话、但队列尚未完成时中断,重启恢复会识别已显示的用户消息并清除对应队列项,不会再次发送同一内容;会话分支也不会继承该队列身份。",
"**中文下载入口。** 中文官网下载卡片在北京 OSS 索引加载期间保持不可点击,不再短暂暴露 GitHub 回退;仅在索引请求或校验失败后切换到 GitHub。英文下载行为不变。"
],
"notices": [
"**技术预览与版本要求。** 远程项目仍默认关闭且为技术预览。守护进程端的重连恢复需要 Host 安装单独发布的 Agent `0.11.7`,提供 Linux x64 和 arm64;桌面包不内置 Agent 或远程 Runtime,本次不提供 LoongArch 预览。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.11.7 makes managed SSH project switching and multi-conversation use smoother, overhauls Host remote-environment setup, and prevents queued input from being sent twice after an interruption."
],
"features": [
"**Clearer Host remote-environment setup.** Under Settings → Platform Features → Remote Projects, each Host card uses one action for install, update, or reinstall, plus Automatic, Host download, and GoodBuddy transfer methods. Automatic downloads on the Host when direct access works; otherwise GoodBuddy transfers it. Verified local or imported Agent packages can be reused, but a known newer compatible online version still wins. Preparation starts only when you select the action.",
"**Host and project management.** Open a remote project's settings directly from the project switcher, and remove its local record even when the Host is unreachable or the remote folder is gone. Deleting a Host now lists linked projects first and, after confirmation, removes their local conversations, Tasks, results, memories, schedules, and Heartbeat links without connecting to the Host or deleting remote files."
],
"fixes": [
"**Faster, more resilient managed SSH sessions.** Switching an existing remote project is now local-only, and compatible projects and conversations share one Host connection. Reconnection no longer leaves idle sessions blocked by `stale-controller`, while active prompts preserve exact resume or replay behavior.",
"**Queued input is no longer sent twice.** If the app is interrupted after a message reaches conversation history but before its queue item completes, startup recovery recognizes the displayed user message and removes the matching queue item instead of sending it again. Conversation branches also discard that queue identity.",
"**Chinese download entry.** Download cards on the Chinese website now remain disabled while the Beijing OSS index is loading instead of briefly exposing the GitHub fallback. They switch to GitHub only if the OSS request or validation fails; English downloads are unchanged."
],
"notices": [
"**Technical preview and version requirement.** Remote Projects remain disabled by default and in technical preview. Daemon-side reconnection recovery requires the separately published Agent `0.11.7` for Linux x64 or arm64. Desktop packages do not embed the Agent or remote Runtime, and this release has no LoongArch preview."
]
}
}
},
{
"version": "0.11.6",
"releasedAt": "2026-08-27",
"notes": {
"zh-CN": {
"highlights": [
"GoodBuddy 0.11.6 新增侧栏品牌定制,并修复 Anthropic 输出上限与关键界面提示。"
],
"features": [
"**侧栏品牌定制。** “设置 → 外观 → 品牌定制”现在可修改左上角品牌名称、中英文副标题和本地 Logo,并提供实时预览、默认 Logo、恢复默认及本机持久化。"
],
"fixes": [
"**Anthropic 输出上限。** Anthropic 直连模型现在可单独配置单次最大输出,不再错误复用上下文窗口;OpenAI 直连请求和工具调用轮次不增加额外配额。",
"**输入框与品牌提示。** 恢复聊天和生图输入框中的发送、换行与粘贴快捷键说明,并恢复左上角品牌副标题。"
],
"notices": [
"品牌定制仅保存在当前设备并只影响左上角品牌区;安装包、更新、Agent 和协议身份仍为 GoodBuddy。",
"Anthropic 单次最大输出未填写时默认使用 32K Token;实际可用上限仍取决于所选模型和服务商。"
]
},
"en-US": {
"highlights": [
"GoodBuddy 0.11.6 adds sidebar brand customization while fixing Anthropic output limits and essential interface guidance."
],
"features": [
"**Sidebar brand customization.** Settings → Appearance → Brand customization now lets you change the top-left brand name, Chinese and English subtitles, and a local logo, with live preview, default-logo, full-reset, and on-device persistence."
],
"fixes": [
"**Anthropic output limits.** Direct Anthropic connections now have an independent per-response maximum output setting instead of incorrectly reusing the context window. OpenAI direct requests and tool rounds receive no additional quota.",
"**Composer and brand guidance.** Restored send, newline, and paste shortcuts in chat and image-generation input hints, along with the subtitle beneath the top-left brand name."
],
"notices": [
"Brand customization is stored only on the current device and affects only the top-left brand area. Installer, update, Agent, and protocol identities remain GoodBuddy.",
"Anthropic per-response maximum output defaults to 32K tokens when left unset. The selected model and provider may enforce a lower limit."
]
}
}
},
{
"version": "0.11.5",
"releasedAt": "2026-08-26",
+110 -12
View File
@@ -1,10 +1,10 @@
---
name: deai-writing
version: 1.1.0
version: 1.3.0
description: |
中文正式文档「去 AI 味」审校。用于任何需要产出不露 AI 痕迹的正式中文文本:
中文正式文档「去 AI 味」审校。用于降低模板化、空泛和过度工整的机器生成痕迹:
投标方案、技术方案、公司官网文案、研究文章、汇报材料、说明文档、商务邮件。
在生成或润色中文正式文档之后调用,也可在评审阶段单独调用做质量门禁。
在生成或润色中文正式文档之后调用,也可在评审阶段单独调用做质量检查。
提供可执行的病症词典扫描脚本,把「凭感觉找 AI 味」变成「按清单定位并改写」。
触发词:去 AI 味、AI 腔、AI 味、文案审校、润色中文文档、官网文案评审。
allowed-tools:
@@ -17,13 +17,14 @@ compatibility: Python 3.9+,不依赖第三方 Python 包
# 中文正式文档「去 AI 味」审校
AI 味不是玄学,而是一批可枚举、可正则命中、可批量修改的固定套路。所以这件事
能做成脚本 + 清单反复调用,不用每次靠人肉感觉。
所谓 AI 味,通常是模板化连接词、空心形容词、强迫式排比、元话语和低信息密度
等可观察特征。扫描器负责找候选,Agent 结合语境改写,人工负责事实与语气验收。
检测结果不是作者身份鉴定,也不能证明一段文字由 AI 生成。
## 什么时候用
- 刚用大模型生成或润色完一份中文正式文档,交付前。
- 长文方案编制流程里,接在关键词核验之后、人工通读之前,作为固定质量门禁
- 长文方案编制流程里,接在关键词核验之后、人工通读之前,作为固定检查步骤
(见 `longdoc-docx` 技能)。
- 官网/产品文案评审,被人挑出「像 AI 写的」但说不清哪里像。
@@ -46,7 +47,8 @@ AI 味不是玄学,而是一批可枚举、可正则命中、可批量修改
输出分两级:
- **阻断项**:命中即应改写,目标压到接近 0。
- **阻断项**:高置信度套路表达,应逐条核对并改写,目标压到接近 0;法律原文、
客户原话、引用内容和固定术语可以保留,但要记录理由。
- **复核项**:只是候选,结合页面类型、事实边界和专业语境逐条判断,**不追求
机械清零**。研究文章里的「闭环」如果确有定义就该留着。
@@ -56,7 +58,9 @@ AI 味不是玄学,而是一批可枚举、可正则命中、可批量修改
2. 扫描源文件,将 JSON 命中清单与原文一起交给 Agent 定向改写。
3. 逐条核对改写没有编造数字、删除限制条件或改变责任主体。
4. 复扫,直到阻断项收敛;逐条处理复核项,不机械清零。
5. 通读全文,检查关键词扫描无法发现的前后矛盾和主体错位。
5. 做一次结构复核:检查段落是否等长、标题是否同构、列表是否总凑三点、句子
是否反复使用同一种节奏。
6. 通读全文,检查关键词扫描无法发现的前后矛盾、主体错位和语气漂移。
扫描器只负责定位,不提供自动替换。语义改写必须由 Agent 结合上下文完成,
避免把专业术语、法定提示和事实边界误删。
@@ -140,8 +144,9 @@ AI 味不是玄学,而是一批可枚举、可正则命中、可批量修改
按事实保留。**
### 11. 对照句式、问答式标题与人为凑数
句式:`不是 A,而是 B`、`并非 A,而是 B`、`A,而不是 B`、`不先谈 A,先看 B`。
英文的 `not A but B`、`rather than`、`instead of` 同属一类。
句式:`不是 A,而是 B`、`并非 A,而是 B`、`不只是 A,还要 B`、
`A,而不是 B`、`不先谈 A,先看 B`。英文的 `not A but B`、`rather than`、
`instead of` 同属一类。
标题:`结果回答了三个具体问题`、`以下四点值得关注`、`三个发现`、
`我们需要回答什么`。这类标题只描述文章结构,没有说明本节内容。
@@ -190,9 +195,89 @@ CTA 应指向项目咨询、合作沟通或联系团队,避免 `按清单准
等内部审查语言,改写为客户可理解的适用范围、接入条件和分阶段交付边界;规划
能力仍须用将来时或设计阶段表述。
### 14. 万能分析框架与标签化收束
`从本质上看`、`从某种意义上说`、`从多个维度`、`核心在于`、`关键在于`、
`归根结底`、`可以看出`、`由此可见`、`具体而言`、`从……角度来看`。
这些表达不一定错误,但连续出现时常在替代真实推理。删掉框架词后检查句子:
如果仍没有对象、动作、条件或证据,就补充具体信息;如果信息已经完整,直接
陈述即可。
### 15. 假引用、假共识与来源模糊
`业内普遍认为`、`研究表明`、`数据显示`、`专家指出`、`实践证明`、
`有观点认为`,但没有来源、样本、日期或适用范围。
改法:能追溯就补来源和口径;不能追溯就改成本文可承担的判断,或删除。不要用
模糊权威给观点加重量,也不要为了显得具体而编造论文、机构、链接和数字。
### 16. 句式和段落节奏过度整齐
命中信号:连续段落以同一短语开头;每段都是「结论 + 三个分点 + 小结」;
多个标题使用同一种问句或冒号结构;句长和段长近乎一致。
改法:按信息关系组织,不按模板配平。合并重复段,拆开超载句;事实、解释、
限制和动作可以使用不同长度,不必每节都做总结。扫描器只能发现少量局部信号,
这项必须人工复核。
### 17. 角色槽位式三段法
`系统做什么、学生做什么、教师看到什么`、`用户需要什么、平台提供什么、
最终获得什么`、`输入是什么、处理什么、输出什么`。这类句子先盘点角色或槽位,
再把内容填进去,形式完整但没有描述真实流程。
角色主语本身没有问题,问题在于反复使用 `谁做什么`、`谁看到什么` 等元问题,
或把每个角色机械配成长度相近的一段。改写时按事件顺序写清触发条件、系统动作
和可见结果,不必给每个角色单独设栏。
- 「系统做什么、学生做什么、教师看到什么」
→ 「学生提交答案时,系统保存答题步骤和引用依据;教师可在评分页展开查看」
- 「教师看到的不只是最终分数」
→ 「评分页同时展示最终得分、答题步骤和引用依据」
需求矩阵、职责表和泳道图本来就按角色组织,可以保留;叙事正文和宣传标题应
优先描述具体流程或结果。
### 18. 闸门、门禁、硬约束等工程黑话
`闸门`、`门禁`、`硬约束`、`卡点`、`护栏` 在工程语境中可能是准确术语,也可能
只是给普通规则套上的比喻。单独出现只作复核,不机械删除。
检查它是否说明了四件事:对象、条件、执行动作和结果。例如:
- 「设置质量门禁」→「测试失败时禁止合并」
- 「形成发布闸门」→「延迟超过 200 ms 时停止发布」
- 「建立安全门禁」→「未通过权限校验的请求直接拒绝」
- 「施加硬约束」→「显存占用不得超过 80 GB」
`CI 门禁`、优化问题中的 `硬约束` 等团队已有明确定义的术语可以保留。若删掉
黑话后仍看不出谁在什么条件下阻止什么,就应改成可执行规则。
### 19. 拟人化数量词与连续工程隐喻
`每一次思考都有证据`、`一颗权重`、`数十亿颗权重`、`数据喂不够快`、
`存储到计算的路越来越繁忙`。拟人化或比喻偶尔能辅助解释,但多个比喻连续出现,
会让技术说明像自动生成的科普文案,并掩盖可验证的技术关系。
改写时回到实际对象、单位和瓶颈:
- 「每一次思考都有证据」→「系统保存答题步骤及其引用依据」
- 「数十亿颗权重都要被反复读取」→「每生成一个 Token,都需要访问模型各层的
大量权重」
- 「从算得不够快变成数据喂不够快」→「Decode 阶段通常受显存带宽而非计算吞吐
限制」
- 「这条路越繁忙」→「权重读取总量上升,显存带宽压力随之增加」
不要为了去掉比喻而引入未经测量的结论。`通常受显存带宽限制` 仍需结合模型、
批量大小、硬件和推理实现确认。
### 20. 绝对化承诺与全称判断
`每一次……都……`、`所有……均……`、`任何情况下`、`始终确保`、`完全避免`。
这类表达容易把局部能力写成无条件保证,也常与口号、拟人化表达组合出现。
先核对产品机制和证据范围。能够保证时写清条件,例如「开启过程记录后,评分页
保存每次提交的步骤与引用」;不能保证时改成实际覆盖范围。法规、数学命题和测试
验收标准中的全称表达按原意保留。
## 改写纪律
去 AI 味不是把文本改得干瘪,而是去套路、留信息。四条底线:
去 AI 味不是把文本改得干瘪,更不是伪装作者身份,而是去套路、留信息。六条
底线:
1. **只删套路,不删事实。** 形容词换成数字/动作是「换」不是「删信息」;
连接词、铺垫、升华才是直接删。
@@ -203,21 +288,32 @@ CTA 应指向项目咨询、合作沟通或联系团队,避免 `按清单准
规划能力写成已经实现。
4. **改完复读一遍出声。** AI 味的本质是结构过于工整、信息密度偏低,出声读
最容易发现。
5. **不编造“人味”。** 不故意加入错别字、口头禅、虚构经历、情绪或未经证实的
个人判断。自然表达来自具体信息和真实语境,不来自人为瑕疵。
6. **尊重引用与固定文本。** 法规、合同条款、客户原话、品牌标语和准确引文不
因命中词典而改写;必要时从扫描范围排除,或在评审记录中说明保留原因。
## 一分钟自查清单(不跑脚本时)
- 开头有没有「随着/在……的今天」?删。
- 有没有「不仅……而且/综上所述/值得注意的是」?删。
- 有没有「不是 A,而是 B」或「回答三个问题」式标题?直接写 B 或具体结果。
- 有没有「不只是 A,还要 B」?删掉对照架子,直接并列实际信息。
- 公司首页是否写成了实施步骤?改成服务领域、产品能力和公司定位。
- CTA 是否像需求填报表?改成项目咨询或合作沟通。
- 官网是否出现「当前基线」「已知缺口」等内部审校语言?改成适用范围和交付条件。
- 标题是否以 `把/让/先/再` 或 `Bring/Start/Let/First` 发出操作口令?改名词性。
- 产品首屏是否塞入接口字段、回退链、调试过程?下沉到技术说明。
- 有没有「研究表明/数据显示/业内普遍认为」却不给来源?补证据或删除归因。
- 是否反复用「从本质上看/核心在于/具体而言」代替实际分析?直接写对象和结论。
- 是否在盘点「系统/用户/教师做什么」?按真实事件顺序描述触发、动作和结果。
- `闸门/门禁/硬约束/护栏` 是否说明了执行条件和后果?否则改成具体规则。
- 是否使用「一颗权重/数据喂不够快/道路繁忙」等连续比喻?改回技术对象和指标。
- `每一次/所有/始终/完全` 是否超出了证据范围?补条件或缩小范围。
- 限制是否在同一页面重复出现?合并为一处正向范围说明,同时保留必要的研究、
安全和人工复核边界。
- 形容词能不能换成数字或具体动作?能就换。
- 是不是每段都凑三点、每句都加粗?打破它。
- 是不是每段都凑三点、每句都加粗、相邻段落等长同构?按信息关系重组。
- 有没有破折号、Emoji、客服式结尾?清掉。
- 出声读一遍:像人说话,还是像念 PPT?
@@ -267,6 +363,8 @@ deai-writing/
## 已知边界
- 结构性问题(排比、三段式、每段凑三点)正则只能给候选,最终要人读。
- 角色槽位、工程黑话、拟人化比喻和绝对化表达都有合理语境,只能作为复核线索。
- 「不仅……而且」等词单独出现误报率高,词典里已收敛成句式匹配;仍会有误报,
阻断项要逐条看过再改,不能盲目全局替换。
- 扫描器不判断事实正确性。改写时新引入的数字必须有证据支撑。
- 扫描结果只描述文本特征,不判断作者身份,也不应用于学术诚信或人员考核结论。
@@ -25,6 +25,8 @@ AI_SMELL = {
],
"对照模板": [
r"不是.{0,40}而是", r"并非.{0,40}而是", "而不是",
r"不只是.{0,40}(而是|还|也|更)", r"不止是.{0,40}(而是|还|也|更)",
r"不只是[^,。;!?\n]{1,30}(?:[。;!?\n]|$)",
r"不先.{0,30}先", r"下一步是.{0,40}而不是",
],
"问答式标题": [
@@ -67,6 +69,13 @@ AI_SMELL = {
"过度对冲": [
"在某种程度上", "总体而言", "一般来说",
],
"万能收束": [
"从本质上看", "从某种意义上说", "归根结底", "可以看出",
"由此可见",
],
"来源模糊": [
"业内普遍认为", "专家指出", "有观点认为",
],
"格式痕迹": [
"——", "✅", "❌", "🚀", "💡", "🎯", "✨", "🔥", "📌", "⚡",
],
@@ -93,6 +102,38 @@ REVIEW_ONLY = {
"否定句堆叠": [
"不代表", "不包含", "尚未", "不能",
],
"分析框架": [
"从多个维度", "核心在于", "关键在于", "具体而言",
r"从.{0,20}角度来看",
],
"无来源归因": [
"研究表明", "数据显示", "实践证明",
],
"角色槽位": [
r"(系统|平台).{0,20}(做什么|负责什么).{0,40}"
r"(学生|教师|用户|客户).{0,20}(做什么|看到什么|获得什么)",
r"(学生|教师|用户|客户).{0,20}(做什么|负责什么).{0,40}"
r"(系统|平台|教师|用户|客户).{0,20}(做什么|看到什么|获得什么)",
r"输入是什么.{0,30}(处理什么|怎么处理).{0,30}输出什么",
r"用户需要什么.{0,30}平台提供什么.{0,30}(最终)?获得什么",
],
"工程黑话": [
"闸门", "门禁", "硬约束", "卡点", "护栏",
],
"拟人化技术表达": [
r"[一两二三四五六七八九十百千万亿0-9]+颗(权重|参数)",
"数据喂不够快", r"(存储|内存|显存).{0,20}(道路|路).{0,20}(繁忙|拥堵)",
r"(模型|系统).{0,10}(思考|理解|读懂|看懂)",
],
"绝对化承诺": [
r"每一(次|个|项|条).{0,30}(都|均)", r"所有.{0,30}均",
"任何情况下", "始终确保", "完全避免",
],
"标签化三联": [
r"(看得见|可见).{0,20}(查得到|可查).{0,20}(可追溯|能追溯)",
r"事前.{0,20}事中.{0,20}事后",
r"业务侧.{0,20}技术侧.{0,20}管理侧",
],
}
# ---------------------------------------------------------------------------
@@ -219,6 +219,19 @@ def collect_files(targets, exts):
return list(dict.fromkeys(out))
def summarize_findings(findings):
"""Count findings by level and category for CI and agent consumers."""
counts = {LEVEL_BLOCK: {}, LEVEL_REVIEW: {}}
for finding in findings:
level_counts = counts[finding["level"]]
category = finding["category"]
level_counts[category] = level_counts.get(category, 0) + 1
return {
level: dict(sorted(category_counts.items()))
for level, category_counts in counts.items()
}
def main():
ap = argparse.ArgumentParser(description="中文正式文档 AI 味扫描")
ap.add_argument("targets", nargs="+", help="待扫描的文件或目录")
@@ -271,6 +284,7 @@ def main():
n_block = sum(1 for f in all_findings if f["level"] == LEVEL_BLOCK)
n_review = len(all_findings) - n_block
by_category = summarize_findings(all_findings)
if args.json:
print(json.dumps({
@@ -278,6 +292,7 @@ def main():
"requested_files": len(files),
"block": n_block,
"review": n_review,
"by_category": by_category,
"errors": errors,
"findings": all_findings,
}, ensure_ascii=False, indent=2))
@@ -31,6 +31,55 @@ class DeaiScanTests(unittest.TestCase):
levels = {finding["level"] for finding in findings}
self.assertEqual(levels, {deai_scan.LEVEL_BLOCK, deai_scan.LEVEL_REVIEW})
def test_reports_new_reasoning_and_attribution_patterns(self):
findings = self.scan(
"从本质上看,业内普遍认为该方案有效。\n"
"研究表明,核心在于形成闭环。"
)
categories = {finding["category"] for finding in findings}
self.assertTrue({"万能收束", "来源模糊"}.issubset(categories))
self.assertTrue({"无来源归因", "分析框架"}.issubset(categories))
def test_summarizes_findings_by_level_and_category(self):
findings = self.scan("综上所述,归根结底,需要复核当前基线。")
summary = deai_scan.summarize_findings(findings)
self.assertEqual(summary[deai_scan.LEVEL_BLOCK]["套路连接词"], 1)
self.assertEqual(summary[deai_scan.LEVEL_BLOCK]["万能收束"], 1)
self.assertEqual(summary[deai_scan.LEVEL_REVIEW]["内部审校话语"], 1)
def test_reports_user_identified_templates_and_metaphors(self):
findings = self.scan(
"每一次思考都有证据,教师看到的不只是最终分数。\n"
"系统做什么、学生做什么、教师看到什么。\n"
"设置质量门禁和硬约束,让数据不再喂不够快。\n"
"Decode 时需要读取数十亿颗权重。"
)
categories = {finding["category"] for finding in findings}
self.assertIn("对照模板", categories)
self.assertTrue(
{
"角色槽位",
"工程黑话",
"拟人化技术表达",
"绝对化承诺",
}.issubset(categories)
)
def test_keeps_concrete_engineering_rules_clean(self):
findings = self.scan(
"测试失败时禁止合并。延迟超过 200 ms 时停止发布。"
"显存占用不得超过 80 GB。"
)
watched = {
"角色槽位",
"工程黑话",
"拟人化技术表达",
"绝对化承诺",
}
self.assertFalse(
any(finding["category"] in watched for finding in findings)
)
def test_masks_markdown_code(self):
findings = self.scan("正文没有问题。\n```text\n综上所述,打造闭环。\n```\n")
self.assertEqual(findings, [])
@@ -80,6 +129,8 @@ class DeaiScanTests(unittest.TestCase):
result = subprocess.run(command, check=True, capture_output=True, text=True)
report = json.loads(result.stdout)
self.assertGreater(report["block"], 0)
self.assertIn("阻断", report["by_category"])
self.assertIn("复核", report["by_category"])
failed = subprocess.run(
command + ["--fail-on-block"],
@@ -10,7 +10,7 @@
|---|---|
| 示例 | 表格会按内容长度分配列宽 |
![示例架构图](assets/example.png)
![示例架构图](./assets/example.png)
*图 1 示例架构图*
+25 -24
View File
@@ -1,40 +1,40 @@
---
name: product-marketing
version: 1.0.0
version: 1.1.0
description: |
编排产品事实、功能列表、招标参数、产品 PPT、技术方案、一页纸、白皮书、招标响应、
演示套件、客户案例和竞品定位等多个独立技能。用于一次请求需要选择或组合多种
产品市场产物,并确保它们共享同一事实版本、术语和承诺边界。
演示套件、客户案例和竞品定位。用于一次请求需要选择或组合多种产品市场产物,
并确保它们共享同一事实版本、术语和承诺边界。
allowed-tools:
- Read
- Grep
- Glob
- Execute
compatibility: 可独立规划;执行节点需要对应子技能可用
compatibility: 内置九种文档工作流;事实校验和 PPT 构建需要对应独立 Skill
---
# 产品市场总编排
本技能只负责需求澄清、路由、依赖、门禁和跨产物一致性。各产物的方法和模板由
对应独立技能负责,不能在总技能中重新实现一份简化版本。
本技能负责需求澄清、路由、依赖、门禁和跨产物一致性。九种文档产物的方法与模板
内置在 `workflows/`;需要哪种产物才读取对应 `WORKFLOW.md`,不要一次加载全部。
## 子技能
## 内置工作流
| 技能 | 唯一职责 |
|---|---|
| `product-evidence` | 冻结产品事实、状态、证据和限制 |
| `product-feature-catalog` | 功能目录和版本矩阵 |
| `tender-technical-spec` | 可采购、可验收的招标技术规格 |
| `product-presentation` | 产品介绍 PPT 与讲稿 |
| `technical-proposal` | 客户或投标技术方案 |
| `product-one-pager` | 一页纸产品概览和彩页文案 |
| `solution-whitepaper` | 原理、架构、证据和边界白皮书 |
| `tender-response-matrix` | 招标要求逐条响应、缺口和偏离 |
| `sales-demo-kit` | 可执行演示套件、回退和演练材料 |
| `customer-case-study` | 经授权且可复核的客户案例 |
| `competitive-positioning` | 有来源的竞品矩阵和定位 |
| 路由标识 | 工作流文件 | 唯一职责 |
|---|---|---|
| `product-feature-catalog` | `workflows/product-feature-catalog/WORKFLOW.md` | 功能目录和版本矩阵 |
| `tender-technical-spec` | `workflows/tender-technical-spec/WORKFLOW.md` | 可采购、可验收的招标技术规格 |
| `technical-proposal` | `workflows/technical-proposal/WORKFLOW.md` | 客户或投标技术方案 |
| `product-one-pager` | `workflows/product-one-pager/WORKFLOW.md` | 一页纸产品概览和彩页文案 |
| `solution-whitepaper` | `workflows/solution-whitepaper/WORKFLOW.md` | 原理、架构、证据和边界白皮书 |
| `tender-response-matrix` | `workflows/tender-response-matrix/WORKFLOW.md` | 招标要求逐条响应、缺口和偏离 |
| `sales-demo-kit` | `workflows/sales-demo-kit/WORKFLOW.md` | 可执行演示套件、回退和演练材料 |
| `customer-case-study` | `workflows/customer-case-study/WORKFLOW.md` | 经授权且可复核的客户案例 |
| `competitive-positioning` | `workflows/competitive-positioning/WORKFLOW.md` | 有来源的竞品矩阵和定位 |
`deai-writing` 和 `longdoc-docx` 是可选质量与导出技能,不承担产品事实判断。
`product-evidence` 负责冻结产品事实、状态、证据和限制;`product-presentation`
负责产品 PPT 与讲稿构建。两者保留为独立 Skill,使用前必须确认已启用。
`deai-writing` 和 `longdoc-docx` 也是独立的质量与导出 Skill,不承担产品事实判断。
## 第一步:形成任务简报
@@ -60,8 +60,9 @@ compatibility: 可独立规划;执行节点需要对应子技能可用
<python> "<skill-dir>/scripts/validate_route_plan.py" ./route-plan.json
```
所有产物必须直接或间接依赖唯一的 `product-evidence` 节点。节点缺少对应技能时
明确报告缺失,不允许由总技能静默生成低质量替代物。
所有产物必须直接或间接依赖唯一的 `product-evidence` 节点。路由计划 v1 继续用
`skill` 字段记录工作流或独立 Skill 标识,避免破坏已有计划。缺少或未启用
`product-evidence`、`product-presentation` 时明确报告,不允许静默生成替代物。
`depends_on` 表示硬依赖:被依赖节点未 `completed` 时,本节点不能进入 `running`
或 `completed`。可选输入(例如尚无授权的客户案例)不要写进 `depends_on`,而是
@@ -179,7 +180,7 @@ deliverables/
internal/ # 仅内部
```
各子技能的 `output` 一律指向 `deliverables/<密级>/`,核验产物一律写入
各工作流的 `output` 一律指向 `deliverables/<密级>/`,核验产物一律写入
`build/check/`。交付目录内只允许出现 DOCX 与 PPTX。
单文件产物直接放 `build/<产物名>.md`。技术方案、白皮书等需要分章节的长文,改用
@@ -1,18 +1,8 @@
---
name: competitive-positioning
version: 1.0.0
description: |
基于公开、可定位且有日期的来源生成竞品矩阵、差异化定位和销售边界。用于市场
分析、产品定位和受控销售准备;不允许推断竞品“不支持”或生成无证据攻击性话术。
allowed-tools:
- Read
- Grep
- Glob
compatibility: Markdown/JSON;需要提供或获准获取竞品公开来源
---
# 竞品与定位分析
基于公开、可定位且有日期的来源生成竞品矩阵、差异化定位和销售边界。用于市场
分析、产品定位和受控销售准备;不允许推断竞品“不支持”或生成无证据攻击性话术。
## 必要输入
- 本产品事实与证据。
@@ -1,18 +1,8 @@
---
name: customer-case-study
version: 1.0.0
description: |
基于客户授权、实施记录和可复核指标生成客户案例、成功故事和案例摘要。用于公开
宣传、销售材料或受控投标引用;没有披露授权或历史结果时不得生成可发布案例。
allowed-tools:
- Read
- Grep
- Glob
compatibility: Markdown;建议配合 product-evidence
---
# 客户案例
基于客户授权、实施记录和可复核指标生成客户案例、成功故事和案例摘要。用于公开
宣传、销售材料或受控投标引用;没有披露授权或历史结果时不得生成可发布案例。
## 发布前硬门禁
必须具备:
@@ -1,19 +1,9 @@
---
name: product-feature-catalog
version: 1.0.0
description: |
基于产品事实与证据生成结构化功能列表、模块树和版本能力矩阵。用于产品规划、
售前交流、招标附件或交付范围梳理;重点回答产品有什么功能、谁使用、产生什么
结果,不负责撰写技术参数或长篇方案。
allowed-tools:
- Read
- Grep
- Glob
compatibility: Markdown;建议配合 product-evidence
---
# 产品功能列表
基于产品事实与证据生成结构化功能列表、模块树和版本能力矩阵。用于产品规划、
售前交流、招标附件或交付范围梳理;重点回答产品有什么功能、谁使用、产生什么
结果,不负责撰写技术参数或长篇方案。
## 必要输入
- `product-evidence.json`,至少包含 `product`、`features`、`limitations`。
@@ -1,18 +1,8 @@
---
name: product-one-pager
version: 1.0.0
description: |
将已核验产品信息压缩为一页纸产品概览、宣传彩页或官网下载页文案。用于首次触达、
展会资料和销售跟进;不替代完整功能清单、技术规格或技术方案。
allowed-tools:
- Read
- Grep
- Glob
compatibility: Markdown/HTML;建议配合 product-evidence
---
# 产品一页纸
将已核验产品信息压缩为一页纸产品概览、宣传彩页或官网下载页文案。用于首次触达、
展会资料和销售跟进;不替代完整功能清单、技术规格或技术方案。
## 必要输入
- 产品定位、目标受众和本次一页纸唯一目标。
@@ -1,19 +1,8 @@
---
name: sales-demo-kit
version: 1.0.0
description: |
生成可执行的产品演示故事线、环境清单、操作脚本、讲解词、失败回退和演练检查表。
用于售前 Demo、POC 汇报或验收演示;不负责制作通用产品介绍 PPT。
allowed-tools:
- Read
- Grep
- Glob
- Execute
compatibility: Markdown/JSON;演示自动化需另行使用可用的控制工具
---
# 售前演示套件
生成可执行的产品演示故事线、环境清单、操作脚本、讲解词、失败回退和演练检查表。
用于售前 Demo、POC 汇报或验收演示;不负责制作通用产品介绍 PPT。
## 必要输入
- 演示目标、受众、时长和希望获得的下一步。

Some files were not shown because too many files have changed in this diff Show More