dsh-kaomoji 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.3] - 2026-09-13
11
+
12
+ ### Fixed
13
+
14
+ - `maxPerTurn` 之前对输出没有实际约束力:提示词写死「一个」,调到 2/3 也不会变。
15
+ 现在 `frequent` 会按该上限在回复里分散放置多个颜文字,`auto` 在存在多个
16
+ 情绪点时也会用到上限;回复很短时自动少放。
17
+
18
+ ## [0.1.2] - 2026-09-10
19
+
20
+ ### Changed
21
+
22
+ - `auto` 模式的适用范围明确包含日常推荐、购物建议和实用 how-to 回答:这类
23
+ 对话式回答同样会带一个颜文字,只有纯代码、正式技术交付和高风险内容跳过。
24
+
10
25
  ## [0.1.1] - 2026-09-10
11
26
 
12
27
  ### Added
package/README.en.md CHANGED
@@ -26,7 +26,7 @@ largest Japanese kaomoji sites.
26
26
  instead of inventing malformed faces.
27
27
  - **12 mood buckets** — happy, love, sad, cry, angry, surprised, confused,
28
28
  shy, playful, encourage, thanks, sorry.
29
- - **Three frequency modes** — `auto` (default; friendly/casual/empathetic replies get one), `frequent`, `off`.
29
+ - **Three frequency modes** — `auto` (default; greetings, casual chat, recommendations and empathetic replies get one), `frequent`, `off`.
30
30
  - **Placement control** — `inline` after the mood-matching sentence (default)
31
31
  or `end` of the reply.
32
32
  - **Visual settings card** under Settings → General, saved live without a restart.
@@ -102,9 +102,9 @@ Example `cordis.patch.yml`:
102
102
 
103
103
  | Key | Type | Default | Description |
104
104
  | --- | --- | --- | --- |
105
- | `mode` | `'off' \| 'auto' \| 'frequent'` | `'auto'` | `off` disables; `auto` adds one to friendly/casual/empathetic replies; `frequent` adds one to every conversational reply (code-only/formal replies excluded) |
105
+ | `mode` | `'off' \| 'auto' \| 'frequent'` | `'auto'` | `off` disables; `auto` adds one to greetings, casual chat, recommendations and empathetic replies; `frequent` adds one to every conversational reply (code-only/formal replies excluded) |
106
106
  | `placement` | `'inline' \| 'end'` | `'inline'` | Put the kaomoji after the best-matching sentence, or at the reply end |
107
- | `maxPerTurn` | `number` (1–5) | `1` | Max kaomoji per reply |
107
+ | `maxPerTurn` | `number` (1–5) | `1` | Max kaomoji per reply; `frequent` distributes that many across different sentences (fewer in very short replies) |
108
108
  | `customPrompt` | `string` | `''` | Extra style/scene guidance; cannot change mode, whitelist or limits |
109
109
  | `settingsFile` | `string` | `~/.dsh/dsh-kaomoji.json` | (advanced) user-settings file path |
110
110
  | `settingsAuthority` | `'trusted-host' \| 'loopback'` | `'trusted-host'` | Settings RPC trust scope: by default the local Host plus declared trusted hosts (Tailscale/LAN) may write; set `loopback` to restrict to the local machine |
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  - **纯提示词方案**:不截断、不改写模型流,也不额外调用模型,稳定且对 KV 缓存友好。
18
18
  - **白名单防乱码**:模型只会从词库中逐字符复制颜文字,不会凭印象拼出坏字符。
19
19
  - **情绪分桶**:内置 12 个情绪分类(开心 / 心动 / 难过 / 大哭 / 生气 / 惊讶 / 困惑 / 害羞 / 俏皮 / 鼓励 / 感谢 / 道歉),并随规则给出可用样例。
20
- - **三种频率模式**:`auto`(智能:友好的寒暄/闲聊/共情回复都会带一个,默认)/ `frequent`(每条对话回复都带)/ `off`(关闭)。
20
+ - **三种频率模式**:`auto`(智能:寒暄/闲聊/推荐建议/共情回复都会带一个,默认)/ `frequent`(每条对话回复都带)/ `off`(关闭)。
21
21
  - **放置位置可选**:贴在情绪最贴切的句子后(`inline`,默认)或固定在回复末尾(`end`)。
22
22
  - **可视化配置卡片**:卡片位于「设置 → 通用设置」,保存即生效、无需重启。
23
23
  - **零第三方运行时依赖**:只用 dsh 自带的 `systemPrompt` 服务与 Node 标准库。
@@ -118,9 +118,9 @@ pnpm add file:C:\path\to\dsh-kaomoji
118
118
 
119
119
  | 配置项 | 类型 | 默认值 | 说明 |
120
120
  | --- | --- | --- | --- |
121
- | `mode` | `'off' \| 'auto' \| 'frequent'` | `'auto'` | `off` 关闭;`auto` 友好的寒暄/闲聊/共情回复都会带一个;`frequent` 每条对话回复都带一个(两者都跳过纯代码 / 正式技术交付) |
121
+ | `mode` | `'off' \| 'auto' \| 'frequent'` | `'auto'` | `off` 关闭;`auto` 寒暄/闲聊/推荐建议/共情回复都会带一个;`frequent` 每条对话回复都带一个(两者都跳过纯代码 / 正式技术交付) |
122
122
  | `placement` | `'inline' \| 'end'` | `'inline'` | 放在情绪最贴切的句子/短段后,或固定在回复末尾 |
123
- | `maxPerTurn` | `number`(1–5) | `1` | 每条回复最多允许的颜文字数量 |
123
+ | `maxPerTurn` | `number`(1–5) | `1` | 每条回复的颜文字数量上限;`frequent` 会按这个数量分散放在不同句子后,回复太短时自动减少 |
124
124
  | `customPrompt` | `string` | `''` | 附加风格/场景说明;不能改变模式、白名单或数量上限 |
125
125
  | `settingsFile` | `string` | `~/.dsh/dsh-kaomoji.json` | (进阶)用户设置持久化文件路径 |
126
126
  | `settingsAuthority` | `'trusted-host' \| 'loopback'` | `'trusted-host'` | 设置 RPC 信任范围:默认允许本机与 Host 声明的受信主机(Tailscale/局域网)保存设置;改成 `loopback` 则仅本机可改 |
package/lib/client.js CHANGED
@@ -56,7 +56,7 @@ window.__ModuleLoader__.load({
56
56
  "mode.off": "关闭",
57
57
  "mode.off.desc": "不使用颜文字",
58
58
  "mode.auto": "智能",
59
- "mode.auto.desc": "友好的寒暄、闲聊、共情回复都会带一个",
59
+ "mode.auto.desc": "寒暄、闲聊、推荐建议、共情回复都会带一个",
60
60
  "mode.frequent": "高频",
61
61
  "mode.frequent.desc": "每条对话回复都带一个(纯代码/正式交付除外)",
62
62
  "field.placement": "放置位置",
@@ -81,7 +81,7 @@ window.__ModuleLoader__.load({
81
81
  "mode.off": "Off",
82
82
  "mode.off.desc": "No kaomoji",
83
83
  "mode.auto": "Smart",
84
- "mode.auto.desc": "Friendly greetings, casual chat and empathetic replies get one",
84
+ "mode.auto.desc": "Greetings, casual chat, recommendations and empathetic replies get one",
85
85
  "mode.frequent": "Frequent",
86
86
  "mode.frequent.desc": "One kaomoji in every conversational reply (code-only/formal excluded)",
87
87
  "field.placement": "Placement",
package/lib/index.js CHANGED
@@ -144,20 +144,32 @@ export function buildGuidance(config) {
144
144
  const settings = normalizeConfig(config);
145
145
  if (settings.mode === "off") return "";
146
146
 
147
+ const cap = settings.maxPerTurn;
147
148
  const modeLines = {
148
149
  auto: [
149
- "Most friendly, casual, empathetic, or playful replies should include one fitting kaomoji.",
150
+ "Most conversational replies should include a fitting kaomoji — greetings, casual chat, empathy, everyday recommendations or shopping advice, and practical how-to answers.",
151
+ cap === 1
152
+ ? "Use one kaomoji in those replies."
153
+ : `Use one kaomoji when the mood fits, and up to ${String(cap)} when the reply has several distinct emotional beats.`,
150
154
  "Skip it only when the reply is purely code, a formal/technical deliverable, or serious/high-stakes content.",
151
- "One per reply is usually enough; never replace real content with it.",
152
155
  ],
153
156
  frequent: [
154
- "In every conversational reply — except code-only output, formal/technical deliverables, or tool calls — include one fitting kaomoji.",
157
+ "In every conversational reply — except code-only output, formal/technical deliverables, or tool calls — include fitting kaomoji.",
158
+ cap === 1
159
+ ? "Use exactly one kaomoji."
160
+ : `Use ${String(cap)} kaomoji, one after each of ${String(cap)} different emotion-carrying sentences; use fewer only when the reply is very short.`,
155
161
  ],
156
162
  };
157
- const placementLine =
158
- settings.placement === "end"
163
+ const placementLine = settings.placement === "end"
164
+ ? cap === 1
159
165
  ? "Put the kaomoji at the very end of the reply (same line after a space, or on its own line)."
160
- : "Put it right after the sentence or short paragraph whose mood it matches best.";
166
+ : "Put each kaomoji at the end of a different paragraph (after the sentence it matches), not all on the final line."
167
+ : cap === 1
168
+ ? "Put it right after the sentence or short paragraph whose mood it matches best."
169
+ : "Put each kaomoji right after a different sentence or short paragraph whose mood it matches best.";
170
+ const spreadLine = cap > 1
171
+ ? "Distribute the kaomoji across the reply; never put two in the same sentence, and do not stack them all at the very end."
172
+ : "Never replace real content with a kaomoji.";
161
173
 
162
174
  const poolLines = CATALOG.map(
163
175
  (group) => `${group.label}: ${group.examples.join(" | ")}`,
@@ -168,7 +180,8 @@ export function buildGuidance(config) {
168
180
  "[dsh-kaomoji] Kaomoji guidance for this reply:",
169
181
  ...modeLines[settings.mode],
170
182
  placementLine,
171
- `Use at most ${String(settings.maxPerTurn)} kaomoji per reply.`,
183
+ spreadLine,
184
+ `Never exceed ${String(cap)} kaomoji in one reply.`,
172
185
  "Never place a kaomoji inside code blocks, inline code, links, tables, or tool output.",
173
186
  "Use only the literal kaomoji listed below, copied character-for-character; do not invent, mutate, or re-combine them.",
174
187
  ...poolLines,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-kaomoji",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Add mood-aware Japanese kaomoji to DeepSeek Harness (dsh) replies; prompt-injection plugin with a curated library from kaomojiya.org.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",