feat(storage): add centralized workspace storage plugin - #215
Closed
Grivn wants to merge 4 commits into
Closed
Conversation
28 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要 / Summary
新增
dsh-mnemon-storage-workspaces独立布局插件,通过storageScope: workspaces把四类数据存放在<集中根>/workspaces/<规范路径 SHA-256>/,同时隔离不同项目。设置中的“记忆范围”提供“集中存储 · 按工作区隔离”及可选集中根目录,保存后实时生效。Add a standalone storage layout plugin that keeps Runtime, Documents, Memory Spaces and state under one central directory with an isolated subtree per workspace. Its mode and optional root are configured together in Memory scope and apply live after Save.
MemoryStoragePluginSDK 契约;Starter 消费无状态解析器,现有 Sources 继续持有数据。 / Public SDK layout contract, consumed by the Starter without another Cordis Entry or Source.关联 Issue 或背景 / Related Issue or Context
Closes #189
涉及区域 / Affected Areas
PR 类型 / PR Type
最新代码确认 / Latest Codebase Confirmation
main分支开发,或在提交前已 rebase 或合并最新main。 / I developed from the latestmain, or rebased or merged the latestmainbefore submitting.同步命令 / Sync command:
git fetch origin main && git rebase origin/main— isolated worktree, basea1c500a.AI 编码披露 / AI Coding Disclosure
使用的 AI 模型 / AI model used:
GPT-6
使用的编码 Agent 工具 / Coding Agent tool used:
Codex
仓库规范检查 / Repository Rules
@deepseek-ai/*NPM 契约。 / I did not modify DSH source or point tsconfig at a DSH source checkout, and used only published@deepseek-ai/*NPM contracts.src/host/protocol.ts为准,没有在两侧重复定义 wire DTO。 / The Client and Host boundary still uses browser-safesrc/host/protocol.tsas the source for wire DTOs.lib/文件。 / I did not commit tokens, credentials, private memory, unredacted logs, or generatedlib/files.兼容性与数据安全 / Compatibility and Data Safety
现有
global、workspace、custom布局及 legacydataDir行为保持兼容。集中根优先取dataDir,否则取MNEMON_DATA_DIR或~/.mnemon;全局 USER.md 始终使用原全局根。已有符号链接别名通过realpath归一化;ID 为固定 64 位十六进制,拒绝非法路径,RPC 只接受 Host 登记或会话授权的工作区。只读清单不创建目录。Existing modes and legacy configuration remain compatible. Central roots use the configured directory or the global default; global USER.md remains at the global root. Canonical absolute workspace paths produce bounded hash IDs; malformed paths and unauthorized workspace targets are rejected. Inventory remains read-only.
切换模式不移动、合并或删除旧数据。移动或重命名工作区会选择新 ID,需要显式恢复旧数据。ZIP Pack 仍只覆盖所选工作区;完整备份应包含整个集中根。远程 Provider 保留自身命名空间。回滚到不支持
workspaces的旧版前,应先选择旧版支持的范围;新目录保留。Switches preserve old roots. A workspace move or rename selects a new ID and requires explicit restoration. Packs cover the selected workspace; back up the whole central root for all workspaces. Remote Provider namespaces retain their own scope. Select a legacy-supported scope before rolling back to an older version.
本地验证 / Local Validation
执行的命令 / Commands run:
结果摘要 / Result summary:
全部通过:最终 Node 22 全量验证包含根包 823 项、插件 320 项,共 1143 项;仅 Windows 专用测试因 macOS 环境跳过。类型检查、确定性构建、Headless、公开入口、包检查通过。17 个独立插件仓库和 18 个制品的独立安装、构建及测试通过;changeset 覆盖校验通过。
PASS: 1143 tests (823 root + 320 plugin), including the real Native CLI. Only the Windows-specific smoke test is skipped on macOS. Types, deterministic builds, Headless and package checks pass, as do 17 independent plugin repositories, 18 packed artifacts and release-intent coverage.
用户可见变更证据 / Local Feature Evidence
真实 DSH WebUI 验证了中英文及深浅主题、设置保存与路径校验、A/B 记忆和档案隔离、全局 USER、Provider 映射、Sidebar/Builtin、目录切换保留旧数据、重启恢复和 390px 运行时页面。 / Real DSH WebUI covered configuration, workspace isolation, global USER, Provider mapping, Sidebar/Builtin, root switching, restarts and narrow Runtime layout.
完整双语记录和 9 张截图 / Full bilingual record and nine screenshots · 脱敏磁盘断言 / Sanitized disk assertions
已记录的宿主限制:390px 设置弹窗内容过窄,Builtin 的会话宽度拖动条可能截获 Runtime Tab 中心点击,键盘可正常激活。未修改 DSH 源码。 / Recorded Host limits: cramped settings at 390px and a Builtin resize handle intercepting the Runtime tab center; keyboard activation works. No DSH source changes.