@user-mrz/dsh-system-prompt-studio 0.1.9 → 0.2.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/CHANGELOG.md CHANGED
@@ -12,6 +12,37 @@ integration still targets the same DSH shapes, a major bump means it may not.
12
12
 
13
13
  Nothing yet.
14
14
 
15
+ ## [0.2.0] — 2026-11-10
16
+
17
+ ### Added
18
+
19
+ - **"Replace everything" now lists what it will drop.** The panel already held the real assembled
20
+ section list, so "you are about to lose the first-party prompt" was a warning about something it could
21
+ actually enumerate. It now shows every section that will be discarded, with its character count, folds
22
+ the list after 24 entries, and calls out separately how many of those sections belong to **other
23
+ plugins**. That last number is the one that matters: a plugin's tool schema survives a `complete`
24
+ override, but the prose telling the model when and how to call it does not, so the tool stays installed
25
+ and unused with no error anywhere. It reads as "the model got dumber", never as "I turned a mode on".
26
+ - When the conversation has not assembled a prompt yet, the panel says it cannot list the sections
27
+ rather than inventing a count.
28
+ - Nine structural checks cover the new computation, including that it excludes the plugin's own
29
+ sections, that it folds past 24 entries, and that a disabled `allowComplete` suppresses the list
30
+ entirely.
31
+
32
+ ### Changed
33
+
34
+ - The README's "Replace everything" warning now leads with the cross-plugin damage rather than only the
35
+ first-party guidance, documents the new per-section listing, and recommends `allowComplete: false` for
36
+ any profile running plugins that contribute prompt sections. Both languages updated, and the config
37
+ table marks that recommendation.
38
+
39
+ ### Note
40
+
41
+ `allowComplete` still defaults to `true` in the plugin's own patch. This release adds information and
42
+ documentation, not a behaviour change: existing users keep the mode unless they turn it off. The
43
+ recommendation is in the README because whether to keep a whole-prompt override is the profile owner's
44
+ call, and silently removing a documented mode from under them would be worse than the risk it avoids.
45
+
15
46
  ## [0.1.9] — 2026-11-10
16
47
 
17
48
  ### Changed
@@ -166,7 +197,8 @@ scoped name unambiguous for anyone who arrives from GitHub.
166
197
  - Read-only assembly observer listing the real section names, order and size.
167
198
  - Loopback-only HTTP route for the panel; forged `Host` headers are refused.
168
199
 
169
- [Unreleased]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.1.9...HEAD
200
+ [Unreleased]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.2.0...HEAD
201
+ [0.2.0]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.1.9...v0.2.0
170
202
  [0.1.9]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.1.8...v0.1.9
171
203
  [0.1.8]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.1.7...v0.1.8
172
204
  [0.1.7]: https://github.com/user-Mrz/dsh-system-prompt-studio/compare/v0.1.6...v0.1.7
package/README.md CHANGED
@@ -31,7 +31,7 @@ session, effective immediately.
31
31
  |---|---|
32
32
  | **Append** (default) | Keeps every first-party section, adds yours at the end. Safest. |
33
33
  | **Replace a section** | Shadows one named first-party section, e.g. `deployment:persona-suffix`. |
34
- | **Replace everything** | Your text becomes the entire system prompt. Highest risk — see below. |
34
+ | **Replace everything** | Your text becomes the entire system prompt. Highest risk: drops first-party guidance **and every other plugin's sections** — see below. |
35
35
 
36
36
  - **Applies on the next model request.** No restart, no reload.
37
37
  - **Persists per session**, and a **global default** applies to new conversations automatically.
@@ -46,8 +46,26 @@ That mode removes **all** first-party guidance — tool instructions, structured
46
46
  policy. Tool-calling quality can drop noticeably. Runtime context (working directory, sandbox policy,
47
47
  approval policy) is still sent as a user-side snapshot and is **not** replaced by your text.
48
48
 
49
+ **It also removes every section other plugins registered.** This is the part that bites quietly. A
50
+ plugin's tool schema still ships, but the prose that tells the model *when and how* to call it is gone,
51
+ so the tool stays installed and unused — and nothing errors. The failure looks like "the model got
52
+ dumber", not like "I turned something off". If you run a plugin that registers prompt sections
53
+ (`plugin:ssh`, `plugin:task-board`, `team:policy`, and so on), Replace everything disables all of them
54
+ at once for that conversation.
55
+
56
+ The panel lists exactly what will be dropped before you save: every section name with its character
57
+ count, plus a separate line naming how many of them belong to other plugins. If the conversation has
58
+ not assembled a prompt yet, it says it cannot list them rather than guessing.
59
+
60
+ **Consider turning the mode off entirely.** Set `allowComplete: false` in the plugin row's config and
61
+ the mode becomes unavailable — the panel greys it out, and saving one is rejected with
62
+ `COMPLETE_BLOCKED`. Any `complete` override already in the state file stops applying and the prompt
63
+ falls back to the first-party default (the data is kept, not deleted). This is the recommended setting
64
+ for any profile running third-party plugins that contribute prompt sections.
65
+
49
66
  Also: assembly allows only one active `complete` section. If another plugin registers one in the same
50
- session, assembly fails with `multiple complete prompt sections`. Switch back to Append or Replace to
67
+ session, assembly fails with `multiple complete prompt sections` — and then **every** model request in
68
+ that conversation fails, while the user only sees "request failed". Switch back to Append or Replace to
51
69
  recover.
52
70
 
53
71
  ---
@@ -71,7 +89,7 @@ dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio
71
89
  From GitHub, which tracks the default branch and therefore needs a ref if you want a fixed version:
72
90
 
73
91
  ```bash
74
- dsh plugin --profile <profile> add github:user-Mrz/dsh-system-prompt-studio#v0.1.9
92
+ dsh plugin --profile <profile> add github:user-Mrz/dsh-system-prompt-studio#v0.2.0
75
93
  ```
76
94
 
77
95
  Replace `<profile>` with your profile name — for the Web build that is usually `web`.
@@ -80,7 +98,7 @@ Replace `<profile>` with your profile name — for the Web build that is usually
80
98
  changes what you install next time:
81
99
 
82
100
  ```bash
83
- dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio@0.1.9
101
+ dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio@0.2.0
84
102
  ```
85
103
 
86
104
  <details>
@@ -215,7 +233,7 @@ Edit the row in `cordis.patch.yml` or override it in your profile patch. The mos
215
233
  |---|---|---|
216
234
  | `enabled` | `true` | Master switch; when off, no section is registered and the API reports why |
217
235
  | `defaultMode` | `append` | Mode used by the global default |
218
- | `allowComplete` | `true` | Set `false` to disable "replace everything" entirely |
236
+ | `allowComplete` | `true` | Set `false` to disable "replace everything" entirely. **Recommended when other plugins register prompt sections** — see the warning above. |
219
237
  | `appendOrder` | `10500` | Sort order of the appended section, clamped to `[10201, 20000]` |
220
238
  | `maxChars` | `200000` | Max body length; oversize is **rejected**, never truncated |
221
239
  | `globalDefaultScope` | `roots` | Whether the global default also applies to subagents (`all` to include) |
@@ -324,8 +342,24 @@ DSH 本身只提供配置文件级的人设前后缀:改一次要重启,且
324
342
 
325
343
  **⚠️ 关于「完全替换」**:它会移除第一方的全部指引(工具使用说明、结构化输出规则、计划模式策略),
326
344
  工具调用质量可能明显下降。运行时上下文(工作目录 / 沙箱 / 审批策略)仍会作为用户侧快照发送,
327
- 不会被你的文本替换。另外装配只允许一个生效的 `complete` 段,若同会话内有别的插件也注册了一个,
328
- 装配会报 `multiple complete prompt sections` —— 改回「追加」或「替换」即可恢复。
345
+ 不会被你的文本替换。
346
+
347
+ **它同时会移除其它插件注册的全部段落,这一点最容易在不知不觉中出问题。** 插件的工具 schema 还在,
348
+ 但告诉模型「何时调用、怎么调用」的那段说明没了,于是工具装着却用不上,而且不报任何错——看起来像
349
+ 「模型变笨了」,而不是「我关掉了什么」。如果你装了会注册提示词段的插件(`plugin:ssh`、
350
+ `plugin:task-board`、`team:policy` 之类),「完全替换」会把它们在该对话里一次性全部停用。
351
+
352
+ 面板在保存前会逐条列出到底会丢掉什么:每个段名与字符数,并单独点明其中有多少个属于其它插件。
353
+ 若该对话还没装配过提示词,面板会如实说无法列举,而不是猜一个数字。
354
+
355
+ **建议直接把这个模式关掉。** 在插件那一行的配置里设 `allowComplete: false`,该模式即不可用——
356
+ 面板会把选项置灰,强行保存会被 `COMPLETE_BLOCKED` 拒绝。状态文件里已有的 `complete` 覆盖会停止
357
+ 生效,提示词回到第一方默认(数据保留,不删除)。**只要 profile 里装了会贡献提示词段的第三方插件,
358
+ 就推荐这么设。**
359
+
360
+ 另外装配只允许一个生效的 `complete` 段,若同会话内有别的插件也注册了一个,装配会报
361
+ `multiple complete prompt sections` —— 那时该对话的**每一次**模型请求都会失败,而用户只会看到
362
+ 「请求失败」。改回「追加」或「替换」即可恢复。
329
363
 
330
364
  **安装**
331
365
 
@@ -343,13 +377,13 @@ dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio
343
377
  或从 GitHub(跟随默认分支,建议锁 tag):
344
378
 
345
379
  ```bash
346
- dsh plugin --profile <profile> add github:user-Mrz/dsh-system-prompt-studio#v0.1.9
380
+ dsh plugin --profile <profile> add github:user-Mrz/dsh-system-prompt-studio#v0.2.0
347
381
  ```
348
382
 
349
383
  锁定版本,保证装到的是一份确定的代码:
350
384
 
351
385
  ```bash
352
- dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio@0.1.9
386
+ dsh plugin --profile <profile> add @user-mrz/dsh-system-prompt-studio@0.2.0
353
387
  ```
354
388
 
355
389
  `prepare` 脚本只校验入口文件存在,不做编译。若被 pnpm 拦下,把 `pnpm-workspace.yaml` 里
package/lib/client.js CHANGED
@@ -56,6 +56,11 @@ window.__ModuleLoader__.load({
56
56
  modeCompleteHint: '只发你写的内容。第一方的工具使用说明、结构化输出指引等提示词全部消失,可能明显影响工具调用质量。',
57
57
  modeCompleteRisk: '运行时上下文(工作目录 / 沙箱 / 审批策略)仍会随请求发送,不会被这段替换。',
58
58
  modeCompleteAck: '我已了解:这会丢掉第一方全部提示词',
59
+ completeDrops: '本次会丢弃以下段(共 {n} 个,{chars} 字符):',
60
+ completeDropsMore: '…以及另外 {n} 个段',
61
+ completeDropsUnknown: '该对话还没有装配过提示词,所以现在无法列出会被丢弃的段。发一条消息后再打开这里,就能看到真实清单。',
62
+ completeDropsPlugins: '注意:其中包含其它插件注册的段({n} 个)。丢掉它们之后,那些插件的工具会「装着但模型不知道该怎么用」。',
63
+ completeDropAll: '全部丢弃',
59
64
  target: '目标段',
60
65
  targetHint: '该对话跑过请求后,下拉框就是真实段名;手动填不存在的段名会变成新增段。',
61
66
  body: '正文',
@@ -118,6 +123,11 @@ window.__ModuleLoader__.load({
118
123
  modeCompleteHint: 'Only your text is sent. First-party guidance such as tool instructions and structured-output rules disappears, which can degrade tool use.',
119
124
  modeCompleteRisk: 'Runtime context (working directory, sandbox, approval policy) is still sent as a user-side snapshot.',
120
125
  modeCompleteAck: 'I understand this drops every first-party prompt.',
126
+ completeDrops: 'This will drop these sections ({n} of them, {chars} characters):',
127
+ completeDropsMore: '…and {n} more section(s)',
128
+ completeDropsUnknown: 'This conversation has not assembled a prompt yet, so the sections that would be dropped cannot be listed. Send a message, then reopen this panel to see the real list.',
129
+ completeDropsPlugins: 'Note: {n} of them are registered by other plugins. Dropping those leaves their tools installed but unexplained, so the model will not know how to call them.',
130
+ completeDropAll: 'Drop all',
121
131
  target: 'Target section',
122
132
  targetHint: 'After this conversation has run a request, the list holds real section names.',
123
133
  body: 'Body',
@@ -580,6 +590,35 @@ window.__ModuleLoader__.load({
580
590
  const disabled = blocked.off || blocked.noService || blocked.noAgents || busy
581
591
  const completeOk = !blocked.complete && (mode !== 'complete' || ack)
582
592
 
593
+ /**
594
+ * 「完全替换」会丢掉的段:清单里除了 studio 自己那条以外的全部。
595
+ *
596
+ * 之所以算得出来而不只是警告:面板本来就持有真实装配清单(sections),
597
+ * 所以「你会丢掉什么」不是修辞,是这一屏就能列出来的事实。之前只有一个
598
+ * 通用勾选框,用户点下去并不知道自己损失的是 3 段还是 20 段,更不知道
599
+ * 里面有没有别的插件注册的段 —— 那些插件会「装着但模型不知道怎么用」。
600
+ *
601
+ * sections 为 null 表示这个对话还没装配过(冷会话),此时如实说明无法列举,
602
+ * 而不是编一个数字出来。
603
+ */
604
+ const droppedSections = (() => {
605
+ if (mode !== 'complete' || !Array.isArray(sections)) return null
606
+ // 自己注册的段不算「丢掉的第一方内容」,它正是用户要保留的那一段。
607
+ const own = new Set(['studio:complete', 'studio:append'])
608
+ const kept = sections.filter((row) => own.has(row.name))
609
+ const dropped = sections.filter((row) => !own.has(row.name))
610
+ const chars = dropped.reduce((sum, row) => sum + (typeof row.chars === 'number' ? row.chars : 0), 0)
611
+ /**
612
+ * 第三方插件注册的段。第一方段的命名是 `harness:` / `tool:` / `deployment:` /
613
+ * `app:` / `context:` / `plan:` / `ui:` / `mcp-` 这些前缀;插件习惯用
614
+ * `plugin:` 前缀,或 `<包名>:<段名>` 的形状。按前缀判定是启发式,但足够
615
+ * 把「你自己的插件会哑掉」这件事点到名,判错也不会误导成相反的方向。
616
+ */
617
+ const FIRST_PARTY = /^(harness:|tool:|deployment:|app:|context:|plan:|ui:|mcp-)/
618
+ const plugins = dropped.filter((row) => !FIRST_PARTY.test(String(row.name ?? '')))
619
+ return { dropped, chars, plugins, kept }
620
+ })()
621
+
583
622
  const onSave = async () => {
584
623
  if (text.trim() === '' && enabled) {
585
624
  setNotice({ kind: 'error', text: t('emptyText') })
@@ -818,6 +857,54 @@ window.__ModuleLoader__.load({
818
857
  'div',
819
858
  { key: 'risk', style: { display: 'flex', flexDirection: 'column', gap: 8 } },
820
859
  h('div', { 'data-sps': 'warn' }, t('modeCompleteRisk')),
860
+
861
+ // 会丢掉哪些段:清单可读时逐条列出,读不到时如实说无法列举。
862
+ blocked.complete
863
+ ? null
864
+ : h(
865
+ 'div',
866
+ { 'data-sps': 'drops', style: { display: 'flex', flexDirection: 'column', gap: 4 } },
867
+ droppedSections === null
868
+ ? h('div', { 'data-sps': 'muted' }, t('completeDropsUnknown'))
869
+ : h(
870
+ 'div',
871
+ null,
872
+ h(
873
+ 'div',
874
+ { 'data-sps': 'warn' },
875
+ t('completeDrops')
876
+ .replace('{n}', String(droppedSections.dropped.length))
877
+ .replace('{chars}', String(droppedSections.chars)),
878
+ ),
879
+ h(
880
+ 'ul',
881
+ { 'data-sps': 'droplist', style: { margin: '4px 0 0', paddingLeft: 18, maxHeight: 140, overflowY: 'auto' } },
882
+ droppedSections.dropped.slice(0, 24).map((row) =>
883
+ h(
884
+ 'li',
885
+ { key: row.name, 'data-sps': 'dropitem' },
886
+ `${row.name} · ${row.chars}`,
887
+ ),
888
+ ),
889
+ droppedSections.dropped.length > 24
890
+ ? h(
891
+ 'li',
892
+ { key: '__more', 'data-sps': 'dropmore' },
893
+ t('completeDropsMore').replace('{n}', String(droppedSections.dropped.length - 24)),
894
+ )
895
+ : null,
896
+ ),
897
+ // 第三方插件的段被丢掉,是「装了却用不上」的来源,单独点名。
898
+ droppedSections.plugins.length > 0
899
+ ? h(
900
+ 'div',
901
+ { 'data-sps': 'error', style: { marginTop: 4 } },
902
+ t('completeDropsPlugins').replace('{n}', String(droppedSections.plugins.length)),
903
+ )
904
+ : null,
905
+ ),
906
+ ),
907
+
821
908
  blocked.complete
822
909
  ? h('div', { 'data-sps': 'error' }, t('completeBlocked'))
823
910
  : h(
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@user-mrz/dsh-system-prompt-studio",
3
3
  "displayName": "System prompt studio",
4
4
  "description": "Per-conversation system prompt control for DeepSeek Harness: append a section, shadow-replace one named section, or replace the whole prompt. Applies on the next model request, persists per session, and inherits along fork lineage.",
5
- "version": "0.1.9",
5
+ "version": "0.2.0",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
8
8
  "exports": {