dsh-soul 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,18 +7,20 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
7
7
  ## 功能
8
8
 
9
9
  - Web UI 个性化设置页面
10
- - 设置页体验:中英双语文案(随界面语言切换)、dirty 检测(无改动禁用保存)、保存结果提示、「查看当前生效提示词」只读面板
10
+ - 设置页体验:中英双语文案(随界面语言切换)、dirty 检测(无改动禁用保存)、保存结果提示、提示词预览只读面板
11
11
  - 启用或禁用个性化设置
12
12
  - 「关于你」:设置用户昵称、职业和介绍,回复时结合你的背景
13
13
  - 选择回复风格和语调(合并为单一选项):`professional`(专业严谨)、`casual`(轻松自然)、`humorous`(幽默风趣)、`roast`(吐槽达人)、`efficient`(高效干练)
14
14
  - 特质微调(在风格和语调的基础上叠加):
15
15
  - 标题和列表:`default`(默认)、`more`(增强,采用清晰格式和列表结构)、`less`(减弱,使用更多段落文本)
16
16
  - 表情符号:`default`(默认)、`more`(增强,使用较多表情符号)、`less`(减弱,尽量减少使用表情符号)
17
+ - 表格:`default`(默认)、`more`(增强,呈现对比或多字段信息时优先使用表格)、`less`(减弱,避免表格、改用列表或段落)
18
+ - 回复长度偏好:`concise`(简洁,只讲要点、不展开)、`normal`(适中,不额外约束,默认)、`detailed`(详尽,充分展开背景、步骤与推理)
17
19
  - 选择输出语言(Agent 回复语言 + `/soul` 命令输出语言):中文 / English
18
20
  - 提示词随输出语言本地化:`language=en` 时 system prompt 使用英文描述
19
21
  - 输入自定义指令
20
22
  - Agent 可调用工具 `set_persona`,让模型在对话中直接调整人设
21
- - 人设预设:多套命名人设一键切换(保存 / 使用 / 列表 / 删除,Web UI 与命令双入口)
23
+ - 人设预设:6 个内置人设(苏格拉底式提问者 / 极简主义者 / 资深架构师 / 教学型讲解者 / 严格代码审阅者 / 头脑风暴伙伴,随插件提供、不可删除)+ 多套自建人设一键切换(保存 / 使用 / 列表 / 删除,Web UI 与命令双入口);每行摘要显示风格与偏离默认的维度
22
24
  - `set_persona` 确认模式(`requireToolConfirmation`):Agent 的人设修改需经 `/soul confirm` 确认后才生效
23
25
  - 输入框光轨:Agent 回复中时,输入框边框显示沿边循环流动的光轨(默认颜色 `#679EFE`)
24
26
  - 颜色:预设色板、取色器或十六进制输入(如 `#679EFE`)
@@ -30,6 +32,9 @@ DeepSeek Harness 个性化设置插件,用于配置 Agent 的昵称、回复
30
32
  - 配置输入校验:字段白名单、类型、长度上限(昵称/职业 50、介绍 500、自定义指令 2000 字符)、枚举与十六进制颜色校验,非法或超限字段整单拒绝
31
33
  - 配置更新后同步到所有活动 Agent
32
34
  - 变更检测:仅在影响 Agent 行为的配置实际变化时刷新提示词并注入会话;纯外观配置(输入框光轨)只落盘,不产生注入消息
35
+ - 插件图标:插件管理列表与侧栏入口显示专属图标(`assets/icon.svg`,36×36,随 npm 包发布)
36
+ - 设置导航图标:设置面板左侧「个性化」那一项显示与插件图标同一套几何的图标——同一条光轨与火花,颜色与线宽则跟随邻居(单色 `currentColor`);DSH 的导航图标按 section id 硬编码、插件声明不了,故由客户端做 DOM 替换
37
+ - 提示词预览(只读,设置页底部折叠区):无未保存编辑时显示**当前生效**的提示词;表单一有改动就转为预览**草稿**——展示保存后真正会注入的内容,边改边看(停止输入 400ms 后自动重新编译),并在保存 / 重置 / 应用预设后自动刷新。未通过校验的字段会单独列出且不计入预览
33
38
 
34
39
  ## 安装
35
40
 
@@ -91,10 +96,10 @@ dsh plugin --profile web update dsh-soul
91
96
  ```text
92
97
  /soul show 查看当前配置(含确认模式与预设数量)
93
98
  /soul set k=v 修改配置项(如 /soul set style=humorous language=en;光轨:trailColor=#679EFE trailSpeed=fast trailWidth=thick)
94
- /soul save <名> 保存当前配置为人设预设
95
- /soul use <名> 应用人设预设
96
- /soul list 查看人设预设(✔ 标记当前匹配项)
97
- /soul del <名> 删除人设预设(delete / rm 别名)
99
+ /soul save <名> 保存当前配置为人设预设(内置名不可占用)
100
+ /soul use <名> 应用人设预设(内置预设同样可用)
101
+ /soul list 查看人设预设(✔ 标记当前匹配项;内置项带 [内置] 标记)
102
+ /soul del <名> 删除人设预设(delete / rm 别名;内置预设不可删)
98
103
  /soul confirm 应用待确认的人设变更(确认模式)
99
104
  /soul reject 拒绝待确认的人设变更
100
105
  /soul reset 重置配置(保留人设预设库)
@@ -134,7 +139,7 @@ soul-config.json
134
139
  }
135
140
  ```
136
141
 
137
- 人设预设保存在同一文件的 `personas` 字段:名称 → 人设字段快照(昵称/职业/介绍/风格/特质/语言/自定义指令)+ `updatedAt`;预设库变更不影响活动配置,使用预设时才应用到配置并同步会话。
142
+ 自建人设预设保存在同一文件的 `personas` 字段:名称 → 人设字段快照(昵称/职业/介绍/风格/特质/回复长度/语言/自定义指令)+ `updatedAt`;预设库变更不影响活动配置,使用预设时才应用到配置并同步会话。内置人设不落盘(见 `lib/personas.mjs`),列表 / 使用 / ★ 匹配统一走「内置 + 自建」的合并视图,同名以内置为准,内置名既不可保存占用也不可删除。
138
143
 
139
144
  输入框光轨字段:`trailEnabled`(是否启用,默认 `true`)、`trailColor`(6 位十六进制颜色,统一大写存储,默认 `#679EFE`)、`trailSpeed`(`slow` / `normal` / `fast`,默认 `slow`)、`trailWidth`(`thin` / `normal` / `thick`,默认 `thin`)。这四个字段属纯外观配置,只落盘、不进入 system prompt、不触发会话注入。
140
145
 
package/README_EN.md CHANGED
@@ -7,18 +7,20 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
7
7
  ## Features
8
8
 
9
9
  - Personalization settings page in the Web UI
10
- - Localized settings UI (English/Chinese, follows the interface language), dirty tracking (save disabled when unchanged), save-result toasts, and a read-only "active prompt" viewer
10
+ - Localized settings UI (English/Chinese, follows the interface language), dirty tracking (save disabled when unchanged), save-result toasts, and a read-only prompt preview panel
11
11
  - Enable or disable personalization
12
12
  - "About you": set your nickname, occupation and bio so replies fit your background
13
13
  - Combined style & tone option: `professional`, `casual`, `humorous`, `roast`, `efficient`
14
14
  - Trait fine-tuning (layered on top of style & tone):
15
15
  - Headings & lists: `default`, `more` (clear formatting with headings and lists), `less` (more paragraph text)
16
16
  - Emoji: `default`, `more` (frequent emoji usage), `less` (minimal emoji usage)
17
+ - Tables: `default`, `more` (prefer tables for comparisons and multi-field data), `less` (avoid tables; use lists or paragraphs)
18
+ - Reply length preference: `concise` (key points only), `normal` (no extra constraint, default), `detailed` (expand background, steps and reasoning)
17
19
  - Output language (agent reply language + `/soul` command output language): Chinese or English
18
20
  - The compiled system prompt follows the output language (English descriptions when `language=en`)
19
21
  - Custom instructions
20
22
  - Agent-callable tool `set_persona` to let the model adjust persona during a conversation
21
- - Named personas: save the current config under a name and switch with one click (save / use / list / delete, in both the Web UI and slash commands)
23
+ - Named personas: 6 built-in personas (Socratic Questioner / Minimalist / Senior Architect / Teaching Explainer / Strict Code Reviewer / Brainstorm Partner — shipped with the plugin, cannot be deleted) plus your own named personas, switched with one click (save / use / list / delete, in both the Web UI and slash commands); each row summarises the style and every dimension that differs from its default
22
24
  - `set_persona` confirmation mode (`requireToolConfirmation`): agent persona changes take effect only after `/soul confirm`
23
25
  - Composer light trail: while the agent is replying, a light trail loops around the composer border (default color `#679EFE`)
24
26
  - Color: preset swatches, a color picker, or a hex input (e.g. `#679EFE`)
@@ -30,6 +32,9 @@ A personalization plugin for DeepSeek Harness (DSH). Configure your agent's nick
30
32
  - Input validation: field whitelist, types, length limits (nickname/occupation 50, bio 500, custom instructions 2000 chars), enum and hex-color checks; invalid or oversized fields reject the whole write
31
33
  - Configuration synced to all active agents after every update
32
34
  - Change detection: the prompt is refreshed and sessions injected only when a behavior-affecting field actually changed — appearance-only config (composer light trail) is persisted without injecting anything
35
+ - Plugin icon: a dedicated icon in the plugin manager list and the sidebar entry (`assets/icon.svg`, 36×36, shipped with the npm package)
36
+ - Settings nav icon: the "Personalization" entry in the settings panel draws the same geometry as the plugin icon — same trail and spark, but coloured and weighted like its neighbours (monochrome `currentColor`). DSH hardcodes nav glyphs by section id and offers no way for a plugin to declare one, so the client swaps the glyph in the DOM
37
+ - Prompt preview (read-only, collapsible section at the bottom of the settings page): shows the **currently active** prompt while the form is untouched; as soon as any edit is pending it compiles the **draft** instead — what will actually be injected once you save — refreshing live (400 ms after you stop typing) and again after save / reset / applying a persona. Fields that fail validation are listed separately and excluded from the preview
33
38
 
34
39
  ## Installation
35
40
 
@@ -91,10 +96,10 @@ Slash commands are also available:
91
96
  ```text
92
97
  /soul show Show current configuration (confirmation mode & persona count)
93
98
  /soul set k=v Change config fields (e.g. /soul set style=humorous language=en; trail: trailColor=#679EFE trailSpeed=fast trailWidth=thick)
94
- /soul save <name> Save the current config as a persona
95
- /soul use <name> Apply a persona
96
- /soul list List personas (✔ marks the active match)
97
- /soul del <name> Delete a persona (delete / rm aliases)
99
+ /soul save <name> Save the current config as a persona (built-in names are reserved)
100
+ /soul use <name> Apply a persona (built-in personas work the same way)
101
+ /soul list List personas (✔ marks the active match; built-ins carry a [built-in] tag)
102
+ /soul del <name> Delete a persona (delete / rm aliases; built-in personas cannot be deleted)
98
103
  /soul confirm Apply the pending persona proposal (confirmation mode)
99
104
  /soul reject Discard the pending persona proposal
100
105
  /soul reset Reset configuration (keeps the persona library)
@@ -134,7 +139,7 @@ Example:
134
139
  }
135
140
  ```
136
141
 
137
- Personas are stored in the same file under the `personas` field: name → persona field snapshot (nickname / occupation / bio / style / traits / language / custom instructions) + `updatedAt`. Persona library changes never touch the active config; a persona is applied to the config (and synced to sessions) only when used.
142
+ Your own personas are stored in the same file under the `personas` field: name → persona field snapshot (nickname / occupation / bio / style / traits / reply length / language / custom instructions) + `updatedAt`. Persona library changes never touch the active config; a persona is applied to the config (and synced to sessions) only when used. Built-in personas are not persisted — they live in `lib/personas.mjs` — and listing / applying / match detection all go through the merged view of built-ins plus your own; on a name collision the built-in wins, and a built-in name can neither be saved over nor deleted.
138
143
 
139
144
  Composer light trail fields: `trailEnabled` (on/off, default `true`), `trailColor` (6-digit hex, stored uppercase, default `#679EFE`), `trailSpeed` (`slow` / `normal` / `fast`, default `slow`), `trailWidth` (`thin` / `normal` / `thick`, default `thin`). These are appearance-only: they are persisted but never enter the system prompt and never trigger a session injection.
140
145
 
@@ -0,0 +1,21 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none" role="img" aria-label="dsh-soul">
2
+ <defs>
3
+ <!-- 光轨:头部明亮,尾端渐隐 -->
4
+ <linearGradient id="soulTrail" x1="18" y1="6" x2="8.6" y2="23.4" gradientUnits="userSpaceOnUse">
5
+ <stop offset="0" stop-color="#ADD3FF"/>
6
+ <stop offset="0.3" stop-color="#679EFE"/>
7
+ <stop offset="0.72" stop-color="#679EFE" stop-opacity="0.38"/>
8
+ <stop offset="1" stop-color="#679EFE" stop-opacity="0"/>
9
+ </linearGradient>
10
+ <!-- 灵魂火花:上浅下深,深浅主题下都不塌成一块 -->
11
+ <linearGradient id="soulSpark" x1="18" y1="11.6" x2="18" y2="24.4" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0" stop-color="#B6DBFF"/>
13
+ <stop offset="0.5" stop-color="#679EFE"/>
14
+ <stop offset="1" stop-color="#4560D6"/>
15
+ </linearGradient>
16
+ </defs>
17
+ <!-- 光轨:绕行约 250°,左上留口,尾端渐隐 -->
18
+ <path d="M18 6A12 12 0 1 1 6.72 22.1" stroke="url(#soulTrail)" stroke-width="2.8" stroke-linecap="round"/>
19
+ <!-- 灵魂火花 -->
20
+ <path d="M18 11.6C18.52 15.15 20.85 17.48 24.4 18C20.85 18.52 18.52 20.85 18 24.4C17.48 20.85 15.15 18.52 11.6 18C15.15 17.48 17.48 15.15 18 11.6Z" fill="url(#soulSpark)"/>
21
+ </svg>