Repository navigation
Conversation
- 角色可打包为 zip(persona.md + 头像 + 专属技能 + 专属 MCP 含解密秘密 + 知识库目录),在另一台机器 / 另一 DEVA_HOME 导入 / bundle a persona with its avatar, exclusive skills and MCP servers (secrets decrypted), and knowledge directory for import on another machine or DEVA_HOME - 导入按来源簿记判定:同包再导入就地更新;原 id 空闲则沿用,冲突铸新 id,内置角色永不落位 / import decides by provenance: same bundle re-import updates in place, free ids are kept, conflicts mint new ids, builtin ids are never targeted - 侧入口:Rail 角色右键导出(内置灰显)、花名册 + 菜单导入;成功后 toast 并刷新扩展清单 / Rail context menu exports (builtins disabled), roster add-menu imports, with toast feedback and extension refresh - personas.ts 导出目录助手(路径唯一出口)、atomic-write 支持二进制原子写 / personas.ts now exports its directory helpers as the single path source; writeFileAtomic gains a binary overload
…y in the delete cascade - 知识库目录(档 0 约定、角色包导入会创建)此前删除角色时不清理,会留孤儿目录;与头像同等待遇一并删 / the knowledge directory (doc-0 convention, created by bundle imports) survived persona deletion as an orphan; it is now removed alongside the avatar
…fully and skip symlinks - 导入不再经 frontmatter 重组写盘:包内 persona.md 原样落盘,手改键与未来字段(knowledge/workspace)不在往返中丢失;启用态语义不变(新建默认关、更新不动)/ imports now write the bundled persona.md bytes verbatim instead of recomposing frontmatter, so hand-edited keys and future fields (knowledge/workspace) survive round-trips; enable semantics unchanged - 目录收集改用 lstat 并跳过符号链接:防链接环无限递归与越界拉取(对齐检查点模块的同类取法)/ directory collection uses lstat and skips symlinks, preventing loop recursion and out-of-tree pulls (same approach as checkpoints) - 真实数据 dry-run(办公室运维助手 persona-3585c7d1)验证:回环与更新路径字节级一致,额外键保留 / verified against the real 办公室运维助手 persona: round-trip and update are byte-identical, extra keys preserved
…rt and import - 引导 docs/plantree(README、baseline 模块键、ideas);P001 记录全角落清单、六项决策、v2 设计与验证证据 / bootstrap docs/plantree (README, baseline module keys, ideas); P001 records the persona-surface inventory, six decisions, v2 design and verification evidence
…nded commits and llmdoc sync
…-cascade and missing-secret cases
…evidence and second gap fix for P001
…-persona dry-run evidence for P001
…acement, partial-import toast semantics, missing-knowledge warning - Rail 的 BUILTIN_PERSONA_IDS 从 import 块中间移到 import 之后 / move the BUILTIN_PERSONA_IDS const out of the import block in Rail - 导入 toast:随包技能/MCP 改名(良性 →)不再误报「部分带入」,仅真失败(write-failed/secret-unavailable 等)才提示 / import toast no longer reports benign id renames as partial installs; only real failures do - manifest 声称带知识库但包内无对应文件时记 knowledge:missing 警告,不再静默跳过 / warn knowledge:missing when the manifest claims a knowledge base the bundle does not contain
Contributor
Author
|
撤回重做:不应包含方案树文档,且需合并为单个提交。稍后以干净的单提交分支重新提交。 |
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.
动机
角色目前锁在单机:换机、备份、分享都没有路径。而且一个「角色」往往不只是
<id>.md一段提示词——它常带从属内容:专属技能(整目录含参考文档/脚本)、专属 MCP 服务(配置 + 加密存储的密钥)、知识库目录(personas/knowledge/<id>/,#65 的档 0 约定)、自定义头像。只导出 md 正文,另一半资产就断在现场。功能
persona.md磁盘原文 + 头像 + 专属技能整目录 + 专属 MCP 配置与密钥 + 知识库整目录 +manifest.json)。内置角色(Deva / 小码酱)不可导出。personas.imports簿记在案(同源包再导入)→ 就地更新,不产生重复角色makeId铸新 id,绝不覆盖(主进程本无防覆盖闸,此闸由本功能显式实现)WebPersona推送自动看到导入的角色,无新增远端面。设计依据
完整决策与证据在
docs/plantree/plans/001-persona-export-import/(随本 PR 提交):六项决策(id 策略 / 内置不导出 / 再导入=更新 / 打包范围 / UI 入口 / 来源只进 manifest)、全角落清单、v2 设计、验证记录。安全考虑
secrets.json,加密不可用的字段跳过并警告,绝不静默存明文。请在 PR 里知悉这一点再合并。lstat跳过符号链接(防链接环递归与越界拉取)。persona.md原样字节落盘(writePersonaMdRaw),不经 frontmatter 重组——手改键与未来字段(【功能建议】角色 frontmatter 增加 knowledge 字段:给每个角色挂一个随角色走的知识库目录 #65knowledge、feat(personas): 角色默认工作区——新对话开场即挂载 / persona default workspace #49workspace)在往返中不丢失。personas:export/import,对话框在主进程),零授权弹窗立场不变。验证
pnpm typecheck双侧 +pnpm build通过。originalId=general硬闸 + 坏 manifest 拒绝 / 删除级联(簿记+头像+知识库随删)/ 缺秘密导出警告。~/.deva纯读,zip 落 /tmp):两个真实角色回环与更新均字节级一致;带知识库角色(6 md / 83KB)导入后 sha256 逐一匹配。已知边界
DEVA_HOME时失效(档 0 约定固有局限,静默按无知识库处理;【功能建议】角色 frontmatter 增加 knowledge 字段:给每个角色挂一个随角色走的知识库目录 #65 字段化是正解)。.zip后缀的包文件。两处均为 P3 备注。兼容性
纯新增功能,无迁移。
config.json新增personas.imports[id]簿记键(删除角色时级联清理);其余键不动。