{"_id":"@bananiceee/dsh-zhushou","_rev":"2-7a338ca3ac7cb2ac97b2497a4c1f694b","name":"@bananiceee/dsh-zhushou","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@bananiceee/dsh-zhushou","version":"0.0.1","keywords":["deepseek","deepseek-harness","dsh","assistant","assistant-panel","persona","world-book","memory"],"license":"MIT","_id":"@bananiceee/dsh-zhushou@0.0.1","maintainers":[{"name":"bananiceee","email":"xujiangtao644@gmail.com"}],"homepage":"https://github.com/Starlight-bananice/dsh-zhushou#readme","bugs":{"url":"https://github.com/Starlight-bananice/dsh-zhushou/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-slots"],"platform":"web"}},"dist":{"shasum":"41338e3404d02fd56de344d858ee19d25ed43251","tarball":"https://registry.npmjs.org/@bananiceee/dsh-zhushou/-/dsh-zhushou-0.0.1.tgz","fileCount":90,"integrity":"sha512-XeLoHC7SmeoOa9BAD3Tw5SJ6ts/pNMoZVXERN32KwzHaSQHB2a5Enp1S+fPFqB/aOaOslRLdQbEUtW6im2igjA==","signatures":[{"sig":"MEUCIQCYyrVogSW128FXm5m+Tdih24FlG+U7ho3lZ6NoC8LR3gIgbuyjTWmp+zaF/KpBhZ1aIV5OyK9W/hxnjuHfu6PchIc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":772281},"main":"./lib/index.js","type":"module","types":"./lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./client":{"types":"./lib/types/client/client/index.d.ts","default":"./lib/client.js"},"./package.json":"./package.json"},"gitHead":"b2d89c14b1a9374021771d22d5690ada62b99670","scripts":{"build":"bash scripts/build.sh","verify":"bash scripts/verify.sh","typecheck":"tsc -p tsconfig.json --noEmit","build:client":"tsdown"},"_npmUser":{"name":"bananiceee","email":"xujiangtao644@gmail.com"},"repository":{"url":"git+https://github.com/Starlight-bananice/dsh-zhushou.git","type":"git"},"_npmVersion":"11.19.0","description":"DSH 侧边栏助手插件（dsh-zhushou）：在侧边栏管理/选择助手，选中后在 DSH 主会话内直接以助手人设/模型/参数对话；不选则保持原生会话。A DSH sidebar assistant plugin: manage and pick assistant personas in the sidebar, then chat with them inside the main DSH session; leave it unselected for the native experience.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","typescript":"^5.9.0","@types/node":"^24.13.3"},"peerDependencies":{"cordis":">=4.0.0-rc <5","schemastery":"^3.18.0","@deepseek-ai/dsh-llm":">=0.0.1-rc <2","@deepseek-ai/dsh-tools":">=0.0.1-rc <2","@deepseek-ai/dsh-client-ui-slots":">=0.0.1-rc <2"},"_npmOperationalInternal":{"tmp":"tmp/dsh-zhushou_0.0.1_1787642090665_0.6308072230104047","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bananiceee/dsh-zhushou","version":"0.0.2","repository":{"type":"git","url":"git+https://github.com/Starlight-bananice/dsh-zhushou.git"},"homepage":"https://github.com/Starlight-bananice/dsh-zhushou#readme","bugs":{"url":"https://github.com/Starlight-bananice/dsh-zhushou/issues"},"description":"DSH 侧边栏助手插件（dsh-zhushou）：在侧边栏管理/选择助手，选中后在 DSH 主会话内直接以助手人设/模型/参数对话；不选则保持原生会话。A DSH sidebar assistant plugin: manage and pick assistant personas in the sidebar, then chat with them inside the main DSH session; leave it unselected for the native experience.","keywords":["deepseek","deepseek-harness","dsh","assistant","assistant-panel","persona","world-book","memory"],"type":"module","main":"./lib/index.js","types":"./lib/types/index.d.ts","license":"MIT","publishConfig":{"access":"public"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-slots"],"platform":"web"}},"peerDependencies":{"@deepseek-ai/dsh-llm":">=0.0.1-rc <2","@deepseek-ai/dsh-tools":">=0.0.1-rc <2","cordis":">=4.0.0-rc <5","schemastery":"^3.18.0","@deepseek-ai/dsh-client-ui-slots":">=0.0.1-rc <2"},"devDependencies":{"@types/node":"^24.13.3","typescript":"^5.9.0","tsdown":"^0.22.14"},"scripts":{"build":"bash scripts/build.sh","typecheck":"tsc -p tsconfig.json --noEmit","build:client":"tsdown","verify":"bash scripts/verify.sh"},"exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./client":{"types":"./lib/types/client/client/index.d.ts","default":"./lib/client.js"},"./package.json":"./package.json"},"gitHead":"d60c2c43ceb18c8e15f4a422dcbfde4d1f57e66f","_id":"@bananiceee/dsh-zhushou@0.0.2","_nodeVersion":"24.14.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-GDh3/ZRN8ZLrlQVzi/X8pqWl6Q4GCSKVk+feYY3RUtPV8BVyA1izOn6SUqOCMPnOYBRA/nlL89hIKxrok8kxiw==","shasum":"b7478e051dcedd1f6157d98db131737ec161d513","tarball":"https://registry.npmjs.org/@bananiceee/dsh-zhushou/-/dsh-zhushou-0.0.2.tgz","fileCount":90,"unpackedSize":776897,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDxINyR4uRyzf8lRnCBe0OLI6l8knErGtRxEypx+scO5wIhAM23GR/x+g6JADVjX+wMczgLEiVXCNK+8RXG4nNNJmGH"}]},"_npmUser":{"name":"bananiceee","email":"xujiangtao644@gmail.com"},"directories":{},"maintainers":[{"name":"bananiceee","email":"xujiangtao644@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-zhushou_0.0.2_1787664451353_0.3012464453251775"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-25T07:14:50.509Z","modified":"2026-08-25T13:27:31.635Z","0.0.1":"2026-08-25T07:14:50.831Z","0.0.2":"2026-08-25T13:27:31.504Z"},"bugs":{"url":"https://github.com/Starlight-bananice/dsh-zhushou/issues"},"license":"MIT","homepage":"https://github.com/Starlight-bananice/dsh-zhushou#readme","keywords":["deepseek","deepseek-harness","dsh","assistant","assistant-panel","persona","world-book","memory"],"repository":{"type":"git","url":"git+https://github.com/Starlight-bananice/dsh-zhushou.git"},"description":"DSH 侧边栏助手插件（dsh-zhushou）：在侧边栏管理/选择助手，选中后在 DSH 主会话内直接以助手人设/模型/参数对话；不选则保持原生会话。A DSH sidebar assistant plugin: manage and pick assistant personas in the sidebar, then chat with them inside the main DSH session; leave it unselected for the native experience.","maintainers":[{"name":"bananiceee","email":"xujiangtao644@gmail.com"}],"readme":"# dsh-zhushou · 助手人设，直接在你的 DSH 会话里\n\n> DeepSeek Harness（DSH）侧边栏助手插件：侧边栏『助手』选项 → 管理/选择助手 → 选中后在 DSH **主会话**内直接以助手人设/模型/参数对话（世界书、记忆、时间感知一并生效）；不选则保持原生会话。\n\n[![DSH](https://img.shields.io/badge/DSH-0.1.1--rc.2-blue)](https://github.com/deepseek-ai/deepseek-harness) [![version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.github.com%2Frepos%2FStarlight-bananice%2Fdsh-zhushou%2Ftags&query=%24%5B0%5D.name&label=version&color=green)](https://github.com/Starlight-bananice/dsh-zhushou/releases) [![npm](https://img.shields.io/npm/v/@bananiceee/dsh-zhushou)](https://www.npmjs.com/package/@bananiceee/dsh-zhushou) [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE) [![topic](https://img.shields.io/badge/topic-dsh--plugin-orange)](https://github.com/topics/dsh-plugin)\n\n[English](README.md) · [中文](README.zh.md)\n\n---\n\n## 概述\n\n**解决什么问题：** 想在多个助手人设（编程导师、翻译、写作助手……）之间切换，却不想开多个应用、多个聊天窗，或每会话手改系统提示词。\n\n**dsh-zhushou 做什么：** 侧边栏『助手』入口打开管理面板，创建/编辑助手——名称、头像、标签、绑定工作区、模型参数、系统提示词+变量、快捷回复、注入模式、世界书、skill 开关与记忆。选中助手即激活**会话级激活管线**：该 DSH 会话内每次 LLM 请求都会被重建（人设/模型参数/注入块/世界书/记忆/时间感知行）。取消选择（或删除助手）即恢复原生。\n\n**功能亮点：**\n\n- **会话级激活** — 选择状态按 DSH 会话存于 `selection.json`；激活管线拦截 `llm/stream`（`sessionId` 精确匹配 + `purpose === undefined` 过滤，排除压缩/标题/子代理调用）并短路重建请求\n- **助手档案** — 名称 / 头像（dataURL 或 URL）/ 标签 / 绑定工作区\n- **模型参数** — 模型（空=跟随主模型）/ 温度 / Top-P（预留）/ 思考强度 / 最大 Token / 上下文条数 / 流式开关\n- **系统提示词引擎** — 模板 + 双语法变量（`{{var}}` 与 `{var}`）+ 每助手变量覆盖\n- **快捷回复** — 一键发送的预写消息模板（绑定助手）\n- **注入模式** — role（system/user/assistant）+ position（before/after/replace）+ trigger（always/keywords）\n- **世界书** — 关键词命中 → 按 priority 降序 → token 预算（1024）截断 → 注入\n- **Skill** — 从 `ctx.skills.list()` 枚举并按助手启用/禁用\n- **记忆与时间感知** — 全局/私有记忆池、参考聊天记录开关、时间感知开关（把当前时间/上次对话时间/间隔注入为自然上下文行，无命令式「时间提醒」消息）\n- **侧边栏 UI** — `sidebar.footer.action` 文字选项（含选中态）+ `shell.overlay` 管理面板（选择/取消/编辑/复制/删除）+ `settings.section` 设置页\n- **干净交接** — 不选 = 完全原生会话；取消选择立即恢复原生\n\n## 兼容性\n\n| 项目 | 值 |\n|---|---|\n| DSH 版本 | `0.1.1-rc.2`（主线 `master`） |\n| 运行时 | Node ≥ 22（host）+ 现代浏览器（client）；无外部服务 |\n| 数据 | `${DSH_HOME \\|\\| ~/.dsh}/dsh-assistant-panel/`（助手/选择/记忆；可在设置页覆盖） |\n\n## 安装 / 卸载\n\n### 安装\n\n```sh\n# 从 npm 安装（推荐）\ndsh plugin --profile web add @bananiceee/dsh-zhushou\n\n# 或固定精确版本\ndsh plugin --profile web add @bananiceee/dsh-zhushou@0.0.1\n\n# 或从 GitHub 仓库安装\ndsh plugin --profile web add github:Starlight-bananice/dsh-zhushou\n\n# 或从本地 checkout 装配进 profile\ndsh plugin --profile web add ../dsh-assistant-panel\n\n# 或固定 release tarball——不可变且带版本（每次 GitHub Release 均附带）\ndsh plugin --profile web add https://github.com/Starlight-bananice/dsh-zhushou/releases/download/v0.0.1/bananiceee-dsh-zhushou-0.0.1.tgz\n```\n\n> **注意：** pnpm 11 对刚发布的包强制 24h `minimumReleaseAge`——如果当天发布的版本被拒绝，给 `dsh plugin add` 追加 `--config.minimumReleaseAge=0`。\n\n> **注意：** 仓库已提交预构建的 `lib/` 产物——git 安装开箱即用，**无需构建**。加入插件、重启 DSH Web 即可。\n\n```sh\n# 或运行时注入、免重启（开发者流程）\n#   dev_inject_plugin / dsh-super-injector → 指向本仓库目录\n```\n\n随后启动/重启 DSH Web。无需任何配置——侧边栏底部出现『助手』入口。\n\n### 升级\n\n```sh\n# npm 安装：直接更新到 registry 最新版\ndsh plugin --profile web update @bananiceee/dsh-zhushou\n\n# github: 安装按安装时的 commit 固定——重新 add 更新的 ref 升级：\ndsh plugin --profile web remove @bananiceee/dsh-zhushou\ndsh plugin --profile web add github:Starlight-bananice/dsh-zhushou#v0.0.1\n```\n\n### 停用\n\n- **只停激活、保留数据** — 在管理面板取消选择助手：所有会话恢复原生；助手与记忆原地保留。\n- **彻底停用插件** — 从 profile 的 `bundles` 列表移除；重新加入即恢复。\n\n### 卸载\n\n```sh\ndsh plugin --profile web remove @bananiceee/dsh-zhushou\n```\n\n**遗留数据：** `${DSH_HOME || ~/.dsh}/dsh-assistant-panel/`（设置/选择/助手/记忆）不会被删除——如需清空请手动移除。\n\n## 快速上手\n\n1. 安装（见上），重启 DSH Web。\n2. 点击侧边栏底部的『助手』→ 打开管理面板。\n3. 创建助手（名称、头像、模型参数、系统提示词、世界书、skill、记忆……）并保存。\n4. 为当前会话选中它——面板显示当前选择状态；此后本会话的每次回复都使用该助手的人设与参数。\n5. 取消选择即回到原生会话。\n\n## 功能清单\n\n| 功能 | 说明 |\n|---|---|\n| 助手档案 | 名称 / 头像（dataURL 或 URL）/ 标签 / 绑定工作区 |\n| 模型参数 | 模型（空=跟随主模型）/ 温度 / Top-P（预留）/ 思考强度 / 最大 Token / 上下文条数 / 流式开关 |\n| 系统提示词 | 模板 + 变量双语法（`{{var}}` 与 `{var}`）+ 自定义变量覆盖 |\n| 快捷回复 | 一键发送的预写消息模板（绑定助手） |\n| 注入模式 | role(system/user/assistant) + position(before/after/replace) + trigger(always/keywords) |\n| 世界书 | 关键词命中 → 按 priority 降序 → token 预算（1024）截断 → 注入 |\n| Skill | 从 `ctx.skills.list()` 枚举并按助手启用/禁用 |\n| 记忆 | 全局/私有池开关、参考聊天记录、时间感知开关（注入当前时间/上次对话时间/间隔为自然上下文） |\n| 会话级选择 | `selection.json` 按 DSH 会话记录选中助手；选中即在主会话注入（人设/模型参数/世界书/记忆），取消即恢复原生 |\n| 侧边栏 UI | `sidebar.footer.action` 文字选项（含选中态）+ `shell.overlay` 管理面板（选择/取消/编辑）+ `settings.section` 设置页 |\n\n## HTTP API\n\n根路径：`/assistant-panel/api`（prefix 路由，同源本机服务，无鉴权）。统一信封：`{ ok: true, data }` / `{ ok: false, error: { code, message, details? } }`。\n\n| 方法/路径 | 用途 |\n|---|---|\n| GET /health | 健康检查（版本 / dataDir / uptime） |\n| GET /assistants · POST /assistants | 助手列表摘要 / 创建 |\n| GET /assistants/:id · PUT /assistants/:id · DELETE /assistants/:id | 读取 / 部分更新 / 删除（连带私有记忆） |\n| ~~POST /chat~~ | ~~SSE 聊天~~（已退役：主会话对话，激活见 docs/ARCHITECTURE-ACTIVATION.md） |\n| ~~GET /chats…~~ | ~~会话列表 / 历史 / 删除~~（已退役，历史由 DSH 会话承载） |\n| GET /selection?sessionId= · POST /selection | 会话级助手激活/取消（`{sessionId, assistantId\\|null}`；`null`=恢复原生） |\n| GET /memory?global=&assistantId= · POST /memory · PUT /memory/:id · DELETE /memory/:id | 记忆条目 CRUD |\n| GET /skills?cwd= | skill 枚举（`ctx.skills.list`） |\n| GET /models | 提供商/模型枚举（含 default 主模型标记、思考强度档位、上下文窗口） |\n| GET /workspaces | 工作区枚举（`ctx.workspaceRegistry.list`） |\n| GET /profile · PUT /profile | 插件身份/本地化（userName/locale/timezone/dataDir） |\n\n## 数据布局\n\n数据根（可经 `PUT /profile` 的 `dataDir` 覆盖）：`${DSH_HOME || ~/.dsh}/dsh-assistant-panel/`\n\n```\nsettings.json            # 插件级设置（userName/locale/timezone/dataDir）\nselection.json           # 会话级选择状态（sessionId → {assistantId, lastChatTs}）\nassistants/<id>.json     # 助手档案（原子写：tmp + rename）\nglobal-memory.jsonl      # 全局记忆池\nmemory/<assistantId>.jsonl  # 助手私有记忆池\n# chats/ 已退役：聊天历史由 DSH 会话（~/.dsh/sessions）承载\n```\n\n## 已知限制\n\n1. **Top-P 暂不生效**：DSH `GenerateOptions` / `LlmCallConfig` 当前没有 `topP` 字段（DESIGN 调研核实）。本插件将其作为设置保留、参与校验与持久化，但不传给 `ctx.llm.stream`；官方支持后接线。\n2. **会话模型 UI 显示不随激活变化**：选中助手后，人设/模型/参数覆盖仅作用于 `llm/stream` **请求层**（激活管线，见 docs/ARCHITECTURE-ACTIVATION.md）；会话头部与 DSH UI 显示的 provider/model 仍是原值。后续如需展示可走 request-inspection 投影（本期不做）。\n3. **官方 system 可被助手人设替换**：激活时 `rebuilt.system` 以助手组装段为主体（人设优先）；助手 system 为空时保留官方 system。\n4. **注入不进会话日志**：激活注入只作用于请求面，`session/event` 记录的仍是原始消息（一致性优先）。\n5. **reasoningEffort 就近映射**：DSH 仅 off/low/high/max 四档；medium 由 host 映射为 low；auto 不传（服务端默认）。\n6. **记忆抽取未闭环**：记忆注入（关键词+时间衰减取 top 5）与 CRUD 已实现；「fast model 自动抽取事实 → 写入记忆池」的异步抽取仍未接线（记忆条目由用户在设置页手动维护）。\n7. **skill 面板受 host 运行时影响**：`ctx.skills.list()` 返回当前运行时注册的技能（如 vision-skills），非编译期全量目录。\n8. **多模态未支持**：仅文本消息；图片等后续版本扩展。\n\n## 开发\n\n```sh\n# 重建 host + client（需要 DeepSeek Harness checkout；自动探测 DSH_CHECKOUT 或常见路径）\nDSH_CHECKOUT=~/deepseek-harness bash scripts/build.sh\nnpm run build:client          # tsdown → lib/client.js\n\n# 校验已提交的 lib/ 与 src/ 同步（完整重建 + 字节级 diff）\nnpm run verify\n\n# 启用 pre-push 守护（src/ 或构建配置变更时自动跑 verify.sh）\ngit config core.hooksPath .githooks\n\n# 运行时注入、免重启（dsh-super-injector 流程）\ndev_build_plugin { \"dir\": \"/path/to/dsh-assistant-panel\" }\ndev_inject_plugin { \"dir\": \"/path/to/dsh-assistant-panel\" }\ndev_plugin_status\ndev_uninject_plugin { \"match\": \"dsh-zhushou\" }\n```\n\n## 文档\n\n- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) — 整体架构\n- [docs/ARCHITECTURE-ACTIVATION.md](docs/ARCHITECTURE-ACTIVATION.md) — 激活管线（llm/stream 短路重建）\n- [docs/DESIGN-ACTIVATION.md](docs/DESIGN-ACTIVATION.md) — 激活设计的源码级 API 调研\n- [docs/DESIGN.md](docs/DESIGN.md) — 原始产品调研\n\n## 许可证\n\n[MIT](LICENSE) © 2026 Starlight-bananice\n","readmeFilename":"README.zh.md"}