dsh-plugin-thinking-guard 0.0.0-stage → 0.4.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 +88 -0
- package/LICENSE +21 -0
- package/README.en.md +231 -0
- package/README.md +213 -2
- package/cordis.patch.yml +43 -0
- package/icon.svg +19 -0
- package/index.js +48 -0
- package/lib/guard.js +645 -0
- package/lib/lead-wrapper.js +209 -0
- package/lib/tool-markup.js +885 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +61 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本文件记录 `dsh-plugin-thinking-guard` 的版本变更。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
4
|
+
版本号遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
|
|
5
|
+
|
|
6
|
+
## [0.4.0] — 2026-12-06
|
|
7
|
+
|
|
8
|
+
第四类泄漏:中转把对话压成带标签的文字记录后,模型顺着记录替用户往下编,一直写到输出上限。
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- 新的伪调用写法 `<function_call>bash</function_call><function_parameter name="…">…</function_parameter></function_call>`
|
|
13
|
+
(也认 `<function_call>{json}</function_call>` 和 `<function_call name="…">`),按第二类规则删掉并补发。
|
|
14
|
+
参数还没写完就断掉的调用只删不执行。
|
|
15
|
+
- 配置 `fakeTurns`(默认 `true`):回答在模型开始编下一轮的位置截断——`</assistant_message>` 后紧跟另一个轮次标签、
|
|
16
|
+
成对闭合的 `<user_message>…</user_message>` / `<function_results>` / `<tool_response>` 等,或以文字出现的
|
|
17
|
+
`<|User|>` / `<|Assistant|>`。截断点之后的正文和后续所有块都丢掉。回答开头的 `<assistant_message>`、
|
|
18
|
+
结尾多出的一个 `</assistant_message>` 只去标签。`toolMarkup: off` 时这道过滤照样生效。
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- 被截断的响应如果原本以 `max-tokens` 结束,`finish` 改成 `tool-calls`(有调用时)或 `stop`,
|
|
23
|
+
这样截断点之前的调用会执行、turn 接着跑;回放元数据里的 `stopReason` 同步改成 `toolUse` / `stop`。
|
|
24
|
+
这是插件唯一会改 `finish` 的情况。
|
|
25
|
+
|
|
26
|
+
### Verified
|
|
27
|
+
|
|
28
|
+
- 截图里的形态写成单测,按 1 / 3 / 7 字符切流结果一致;两个旧会话回放结果与 0.3.0 逐条相同。
|
|
29
|
+
|
|
30
|
+
## [0.3.0] — 2026-12-05
|
|
31
|
+
|
|
32
|
+
第三类泄漏:模型用一个随手起名的标签,把开工前的独白整块包起来。
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- `lib/lead-wrapper.js`(`LeadWrapperGuard`):正文块**一开头**就是一个标签、且这个标签把**整块**包住时,
|
|
37
|
+
按「后面跟什么」决定归属——后面还有工具调用或别的块,它是前言(reasoning);响应到此为止,它就是答案,
|
|
38
|
+
只去掉标签、内容照常显示;闭合标签后还有正文,只去标签。HTML 元素名、大写开头的 JSX 组件、带属性的标签
|
|
39
|
+
不算自造包装;一直不闭合或包裹超过 8000 字时原样放行。
|
|
40
|
+
- 配置 `leadWrappers`(默认 `true`),可单独关掉这道过滤。
|
|
41
|
+
- `tags` 现在也接受中文标签名(例如 `思考`)。
|
|
42
|
+
|
|
43
|
+
### Verified
|
|
44
|
+
|
|
45
|
+
- 回放了另一个真实会话:`<概述>` 那条变成思考块、后面的建任务调用不受影响;在早先那个会话上,
|
|
46
|
+
这条规则只影响 3 条消息,且都是 `<bash>…</bash>` 草稿。
|
|
47
|
+
|
|
48
|
+
## [0.2.0] — 2026-12-05
|
|
49
|
+
|
|
50
|
+
第二类泄漏:中转没解析出来、以文本形式漏进正文的工具调用。
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
- `lib/tool-markup.js`(`ToolMarkupGuard`):从正文里删除漏出的调用标记(DSML、`<invoke name="…">`、
|
|
55
|
+
`<usage tool="…">`、`<tool_call>{json}</tool_call>` 等),并把 DSML 被弄坏的 `<||DSML||>` 残渣一并清掉。
|
|
56
|
+
- `toolMarkup: salvage`(默认):本次响应没有任何真正的工具调用时,把格式完整的标记在 `finish` 之前补发成
|
|
57
|
+
真正的 tool-call 块,参数按 `string="false"` / 工具 schema 转类型;同一调用重复写多遍只执行一次。
|
|
58
|
+
已经有真调用时只删除、不执行。`strip` 只删不执行,`off` 关闭这道过滤。
|
|
59
|
+
- 工具名必须命中本次请求 `tools` 里的真实工具,编造的名字与 `<bash>ls</bash>` 这类简写不动。
|
|
60
|
+
- `lib/lead-wrapper.js`(`LeadWrapperGuard`):整块被自己编的标签包住时按「形状 + 后面跟什么」判断——
|
|
61
|
+
后面还有别的块就当前言(reasoning),响应到此为止就去掉标签保留正文。
|
|
62
|
+
- `ReplayAligner`:改写后同步对齐 adapter 的 replay 元数据(块数 / 块类型),消息仍按原生格式回放,
|
|
63
|
+
不再退化成丢掉思考的「外来消息」。
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- 块开头出现孤立 `</thinking>`(思考通道已结束、标签却漏进正文)时,0.1.0 会把它当正文留着;
|
|
68
|
+
0.2.0 删掉它,并且 4000 字以内再出现一个 `</thinking>` 时把中间内容按思考处理。
|
|
69
|
+
|
|
70
|
+
### Verified
|
|
71
|
+
|
|
72
|
+
- 用某个真实的卡住会话的 669 条 assistant 消息回放:每条按 1 字符、7 字符、随机长度切成流喂给
|
|
73
|
+
`guardStream`。14 个提前收工的 turn 全部补发出工具调用,638 条正常消息字节不变,
|
|
74
|
+
几种切分方式结果完全一致,改写后正文里没有残留标记。
|
|
75
|
+
|
|
76
|
+
## [0.1.0] — 2026-11-22
|
|
77
|
+
|
|
78
|
+
首个版本:把漏进正文的 chain-of-thought 拆回 reasoning 块。
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- `lib/guard.js`(`ThinkingGuard`):挂在 `llm/stream` waterfall 上,在 agent loop 组装消息之前把
|
|
83
|
+
`<thinking>…</thinking>` / `<analysis>…</analysis>` / `<thought>…</thought>` 拆成独立的 reasoning 块,
|
|
84
|
+
一次改写同时修好实时显示、落盘消息与后续回放。
|
|
85
|
+
- `mode: split`(默认,思考保留为可折叠的 reasoning)与 `mode: strip`(整段丢弃)。
|
|
86
|
+
- 流式安全的标签识别:跨 delta 切断的标签也能认出,标签尾部前缀先扣住不当作正文发出。
|
|
87
|
+
- `midStream: false`(默认):只认整块开头的泄漏标签;正文里引用的字面 `<thinking>` 原样保留。
|
|
88
|
+
- 纯正文回答走快路径、字节级不变;`finish` / `usage` / 工具调用顺序不变。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yuna
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# dsh-plugin-thinking-guard
|
|
2
|
+
|
|
3
|
+
Turn leaked chain-of-thought back into a reasoning block, leaked tool-call markup back into real tool calls,
|
|
4
|
+
and cut a reply off where the model starts writing the user's next turn itself.
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/dsh-plugin-thinking-guard) [](LICENSE)
|
|
7
|
+
|
|
8
|
+
[中文](README.md)
|
|
9
|
+
|
|
10
|
+
## The problem it solves
|
|
11
|
+
|
|
12
|
+
Some OpenAI-compatible relays (for example one that forwards `deepseek-v4.1-flash` to another upstream)
|
|
13
|
+
do not put the model's reasoning in `reasoning_content` on every request. They write it into `content`:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
<thinking>The user wants an outline. Let me plan the structure…</thinking>
|
|
17
|
+
|
|
18
|
+
Three threads first: …
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
DSH's LLM layer only reads thinking from `reasoning_content` / `reasoning` / `reasoning_text`; everything
|
|
22
|
+
else is assistant text. So the model's inner monologue shows up in the answer, gets stored as assistant
|
|
23
|
+
text, and is replayed on the next request — blowing up the context and teaching the model the same habit.
|
|
24
|
+
|
|
25
|
+
This plugin hooks the `llm/stream` waterfall and rewrites chunks **before** the agent loop assembles the
|
|
26
|
+
message: a leading `<thinking>…</thinking>` (also `<analysis>`, `<thought>`) becomes its own reasoning
|
|
27
|
+
block, and what follows stays text. One rewrite therefore fixes three things at once: the live view, the
|
|
28
|
+
stored message, and later replays.
|
|
29
|
+
|
|
30
|
+
## Second leak: tool calls that arrive as text (0.2.0+)
|
|
31
|
+
|
|
32
|
+
The same relays also drop DeepSeek's **native tool calls**. The model emits DSML:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
<|DSML|invoke name="bash">
|
|
36
|
+
<|DSML|parameter name="command" string="true">ls</|DSML|parameter>
|
|
37
|
+
</|DSML|invoke>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The relay is supposed to parse that into OpenAI `tool_calls`, but some responses skip it and push the raw
|
|
41
|
+
markup into `content` — often with the special tokens mangled into `<||DSML||>` fragments, or reduced to a
|
|
42
|
+
bare `<invoke name="bash">`. Models also borrow other formats: `<usage tool="bash">`,
|
|
43
|
+
`<edit><parameter …>`, `<tool_call>{json}</tool_call>`, `<function_call>bash</function_call><function_parameter …>` (0.4.0+).
|
|
44
|
+
|
|
45
|
+
The consequence: the agent loop only executes real tool-call blocks, so it sees plain text, decides the
|
|
46
|
+
answer is finished, and **ends the turn early**. You type "continue"; the markup is replayed back to the
|
|
47
|
+
model as assistant text and the habit spreads. In one real session, 14 of 40 turns ended this way.
|
|
48
|
+
|
|
49
|
+
The second stage (`lib/tool-markup.js`) runs in the same `llm/stream` waterfall and handles text blocks:
|
|
50
|
+
|
|
51
|
+
- Recognized call markup is removed from the text; a tool name must exist in the current request's `tools`.
|
|
52
|
+
- If the response carries **no** real tool call, well-formed calls are appended as real tool-call blocks
|
|
53
|
+
before `finish` (`toolMarkup: salvage`), so the loop keeps going — approvals, sandbox and argument
|
|
54
|
+
validation all still apply. The same call written several times runs once (comparisons ignore
|
|
55
|
+
`description`). Argument types follow DSML's `string="false"` or the tool schema (e.g. `timeoutMs` → number).
|
|
56
|
+
- When the response already has a real tool call, pseudo-calls in the text are deleted, not executed.
|
|
57
|
+
- `<||DSML||>…</||DSML||>` residue tokens are removed, and the self-talk they wrapped ("emit", "go")
|
|
58
|
+
becomes a collapsed reasoning block (dropped entirely in `strip` mode).
|
|
59
|
+
- Markup inside code fences and inline code is never touched; unknown tool names, shorthands like
|
|
60
|
+
`<bash>ls</bash>` and ordinary angle brackets are left alone.
|
|
61
|
+
- Responses that ended with `max-tokens` / an error / an abort get no salvaged calls.
|
|
62
|
+
|
|
63
|
+
After rewriting, the plugin also rewrites the adapter's replay metadata so block counts and types line up:
|
|
64
|
+
messages still replay in native form (thinking still goes back as `reasoning_content`) instead of degrading
|
|
65
|
+
into a "foreign" message that loses its thinking.
|
|
66
|
+
|
|
67
|
+
## Third leak: the model wraps a whole preamble in a tag it invented (0.3.0+)
|
|
68
|
+
|
|
69
|
+
The model also likes to wrap its pre-work monologue in a hand-made tag — any language, any name:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
<概述>
|
|
73
|
+
The user wants a new issue in the project… I already checked for duplicates. Creating it now.
|
|
74
|
+
</概述>
|
|
75
|
+
[tool call]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The tag name can never be trusted (next time it is `<小结>`, `<plan>`), so the third stage
|
|
79
|
+
(`lib/lead-wrapper.js`) judges shape and context instead:
|
|
80
|
+
|
|
81
|
+
- The text block **opens** with a tag and that tag wraps the **whole** block. HTML element names,
|
|
82
|
+
capitalized JSX components and tags with attributes do not qualify.
|
|
83
|
+
- A tool call (including ones the second stage just salvaged) or any other block follows → it was a
|
|
84
|
+
preamble: it becomes a reasoning block (dropped in `strip` mode).
|
|
85
|
+
- The response ends there → it is the answer: only the tags are removed, the content stays visible.
|
|
86
|
+
- Text follows the closing tag → only the tags are removed.
|
|
87
|
+
- Never closed (e.g. `<filename> is a placeholder`) or wrapping more than 8000 characters → passed through.
|
|
88
|
+
|
|
89
|
+
`tags` now also accepts CJK names (e.g. `思考`); a configured tag is handled by the first rule, i.e. a leading
|
|
90
|
+
tag counts as thinking.
|
|
91
|
+
|
|
92
|
+
## Fourth leak: the model writes the rest of the conversation itself (0.4.0+)
|
|
93
|
+
|
|
94
|
+
When a relay flattens the whole chat into a tagged transcript, the model may simply continue that transcript:
|
|
95
|
+
it writes a call as text, then writes "please continue" on the user's behalf, then invents "the tool still
|
|
96
|
+
returned nothing", and keeps going until it hits the output limit:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
<function_call>bash</function_call> <function_parameter name="command">grep -rn …</function_parameter> </function_call>
|
|
100
|
+
</assistant_message> <user_message> please continue </user_message> <assistant_message> <thinking>Still no tool output…</thinking> …
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
On screen that is a wall of tags ending in "output token limit reached". The call never ran, yet the model
|
|
104
|
+
believes it did.
|
|
105
|
+
|
|
106
|
+
The fourth stage (`fakeTurns`, inside `lib/tool-markup.js`):
|
|
107
|
+
|
|
108
|
+
- Cuts the reply **where the model starts writing the next turn**: a `</assistant_message>` followed by
|
|
109
|
+
another turn tag, a complete `<user_message>…</user_message>` (or `<function_results>`, `<tool_response>`,
|
|
110
|
+
…), or DeepSeek's role tokens `<|User|>` / `<|Assistant|>` rendered as text. Everything after the cut,
|
|
111
|
+
including later blocks, is dropped.
|
|
112
|
+
- `<function_call>` calls before the cut are salvaged as real calls, like any other leaked call.
|
|
113
|
+
- Since the output limit was only reached because of the invented turns, the finish reason becomes
|
|
114
|
+
"tool calls" (when there is a call) or a normal stop, so the turn continues instead of showing "output token
|
|
115
|
+
limit reached". The replay metadata's `stopReason` is updated to match.
|
|
116
|
+
- A leading `<assistant_message>` and a single trailing `</assistant_message>` only lose the tag.
|
|
117
|
+
- Tags inside code are never touched, nor is a lone `<user_message>` mentioned in prose without a matching close.
|
|
118
|
+
|
|
119
|
+
## Install
|
|
120
|
+
|
|
121
|
+
In DSH open **Settings → Plugins → Add plugin** and search for the npm package name
|
|
122
|
+
**`dsh-plugin-thinking-guard`**, then refresh the page. Marketplace indexing runs on a nightly build, so a
|
|
123
|
+
fresh release may not be searchable until the next day.
|
|
124
|
+
|
|
125
|
+
From a terminal:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
dsh plugin --profile <profile> add dsh-plugin-thinking-guard
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Or install from a tarball when the package is not on the registry yet:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
dsh plugin --profile <profile> add ./dsh-plugin-thinking-guard-0.4.0.tgz
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## Configuration (`config` in `cordis.patch.yml`)
|
|
139
|
+
|
|
140
|
+
| Key | Default | Meaning |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `enabled` | `true` | `false` disables the plugin entirely. |
|
|
143
|
+
| `mode` | `split` | `split`: leaked thinking becomes a reasoning block (collapsible, nothing lost). `strip`: dropped. |
|
|
144
|
+
| `tags` | `["thinking","analysis","thought"]` | Tag names treated as thinking wrappers, case-insensitive. |
|
|
145
|
+
| `midStream` | `false` | Only a tag that opens the whole block counts as a leak. With `true`, a tag in the middle of the text is split too — at the cost of misreading answers that quote the tag. |
|
|
146
|
+
| `leadWrappers` | `true` | Third stage: unwrap a preamble that the model wrapped in a made-up tag. `false` disables it. |
|
|
147
|
+
| `toolMarkup` | `salvage` | `salvage`: delete pseudo-calls, and re-emit them as real calls when nothing else was called. `strip`: delete only. `off`: disable the stage. |
|
|
148
|
+
| `fakeTurns` | `true` | Fourth stage: cut the reply where the model starts writing the conversation's next turns itself. `false` disables it. |
|
|
149
|
+
| `debug` | `false` | Log one `console.warn` per rewrite. |
|
|
150
|
+
|
|
151
|
+
Configuration is overridden by the profile's patch layer, so upgrades never lose it.
|
|
152
|
+
|
|
153
|
+
## Boundaries
|
|
154
|
+
|
|
155
|
+
- Only tag-shaped leaks. If a relay dumps reasoning into the text **bare**, the plugin neither guesses nor deletes.
|
|
156
|
+
- A stray `</thinking>` at the start of a block is removed; if another `</thinking>` appears within 4000
|
|
157
|
+
characters, the text between them is treated as thinking.
|
|
158
|
+
- 0.1.0 split thinking into a new block without fixing replay metadata, so pi-ai downgraded the message and
|
|
159
|
+
lost the thinking. From 0.2.0 the plugin realigns metadata at `finish`: existing blocks keep their entries,
|
|
160
|
+
new blocks get ordinary ones, and split thinking reuses the message's `thinkingSignature`. Envelopes it
|
|
161
|
+
cannot map are passed through untouched.
|
|
162
|
+
- Salvaged calls come from markup the model wrote in its own text and may be a draft (a path written as
|
|
163
|
+
`.../a.tsx`, say). Such a call is rejected by the tool itself and the error goes back to the model, which
|
|
164
|
+
beats a stalled turn; set `toolMarkup: strip` if you would rather not take that risk.
|
|
165
|
+
- An unclosed `<invoke name="<a real tool>">` written in prose without backticks loses its opening tag.
|
|
166
|
+
Discuss such syntax inside inline code or a fenced block.
|
|
167
|
+
- Tags the model invented for other purposes are only handled when they open the block and wrap all of it;
|
|
168
|
+
one that appears in the middle of the text (`<original_code>…</original_code>`, a lone `<continue>`) is
|
|
169
|
+
left alone — no reliable rule separates it from ordinary XML.
|
|
170
|
+
- An answer that starts with a custom element (`<my-widget>…</my-widget>`) wrapping the entire response
|
|
171
|
+
loses its tags. Put such code in a fenced block.
|
|
172
|
+
- `finish` changes in one case only: the fourth stage cut the reply and it had ended at the output limit.
|
|
173
|
+
Otherwise `finish`, `usage`, tool calls and block order are unchanged; a plain answer takes a fast path and
|
|
174
|
+
stays byte-identical.
|
|
175
|
+
- The invented turns are discarded, not kept. A matched `<user_message>…</user_message>` pair written in prose
|
|
176
|
+
without backticks (to explain a template, say) also cuts the reply there; put such syntax in inline code or
|
|
177
|
+
a fenced block.
|
|
178
|
+
- It does not switch your upstream or change model parameters. The real fix still belongs on the relay side.
|
|
179
|
+
|
|
180
|
+
## Does it actually work?
|
|
181
|
+
|
|
182
|
+
1. **Plugins** shows a `Thinking guard` row that is enabled.
|
|
183
|
+
2. Start a new session and have the model print this leak-shaped text, then look at the history:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
<thinking>test marker</thinking>
|
|
187
|
+
VISIBLE-ANSWER
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Expected: two blocks — a collapsible thinking row containing `test marker`, and the text
|
|
191
|
+
`VISIBLE-ANSWER`, with no angle-bracket tags left in the body.
|
|
192
|
+
|
|
193
|
+
3. Reverse check: have the model say a sentence mentioning the tag, e.g.
|
|
194
|
+
"People still see the literal `</thinking>` tag." That sentence must stay exactly as written — this is
|
|
195
|
+
`midStream: false` doing its job.
|
|
196
|
+
|
|
197
|
+
4. Tool calls: ask the model to "not call a tool, but print this text verbatim":
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
<invoke name="bash">
|
|
201
|
+
<parameter name="command">echo GUARD-OK</parameter>
|
|
202
|
+
<parameter name="description">guard check</parameter>
|
|
203
|
+
</invoke>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Expected: the markup is gone from the text, one real bash call runs, it prints `GUARD-OK`, and the turn
|
|
207
|
+
continues.
|
|
208
|
+
|
|
209
|
+
The plugin is meant to be link-installed during development: after editing a file under `lib/`, toggle the
|
|
210
|
+
row in **Plugins** off and on again so the host loads the new module version.
|
|
211
|
+
|
|
212
|
+
## Development
|
|
213
|
+
|
|
214
|
+
```sh
|
|
215
|
+
npm test # node --test test/*.test.mjs
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`lib/guard.js` is a pure rewriter (`ThinkingGuard.push(chunk) -> chunk[]`), `lib/tool-markup.js` is the
|
|
219
|
+
second and fourth stage (`ToolMarkupGuard`), `lib/lead-wrapper.js` the third (`LeadWrapperGuard`), and `guardStream` chains them with a `ReplayAligner` that realigns replay
|
|
220
|
+
metadata. None of it touches the network; the tests assert final blocks with a miniature assembler
|
|
221
|
+
equivalent to `@deepseek-ai/dsh-llm`'s `BlockAssembler`.
|
|
222
|
+
|
|
223
|
+
0.2.0 was replayed against 669 real assistant messages from one stalled session, each stream cut at 1
|
|
224
|
+
character, 7 characters and random lengths: all 14 stuck turns got their tool calls back, 638 normal
|
|
225
|
+
messages stayed byte-identical, every slicing strategy agreed, and no markup was left behind. 0.4.0 turned the
|
|
226
|
+
"continues the conversation itself" shape into unit tests (streams cut at 1, 3 and 7 characters); replaying
|
|
227
|
+
both earlier sessions gives message-for-message the same output as 0.3.0.
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,3 +1,214 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-plugin-thinking-guard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
把「泄漏进正文的思考」改回 reasoning 块;把「漏成正文的工具调用」改回真正的工具调用;
|
|
4
|
+
模型替用户往下编的对话,在编的地方截掉。
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/dsh-plugin-thinking-guard)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](#安装)
|
|
9
|
+
|
|
10
|
+
[English](README.en.md)
|
|
11
|
+
|
|
12
|
+
## 它解决什么问题
|
|
13
|
+
|
|
14
|
+
有些 OpenAI 兼容中转(例如把 `deepseek-v4.1-flash` 转发到另一条上游的 relay)在部分请求里
|
|
15
|
+
不把思考放进 `reasoning_content`,而是直接写进 `content`:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
<thinking>用户要一份大纲。先想结构……</thinking>
|
|
19
|
+
|
|
20
|
+
先看三条主线:……
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
DSH 的 LLM 适配层只会从 `reasoning_content` / `reasoning` / `reasoning_text` 三个字段取思考,
|
|
24
|
+
其余一律当正文。于是模型的内心独白就出现在回答里,还会被当成 assistant 正文存进历史、
|
|
25
|
+
在下一次请求里回放一遍(上下文膨胀 + 模型模仿这种格式,越滚越多)。
|
|
26
|
+
|
|
27
|
+
本插件挂在 `llm/stream` 这个 waterfall 上,在 agent loop 组装消息**之前**改写 chunk:
|
|
28
|
+
开头的 `<thinking>…</thinking>`(以及 `<analysis>…</analysis>`)被拆成独立的 reasoning 块,
|
|
29
|
+
后面的内容才是 text 块。因此一次改写同时修好三处:实时显示、落盘消息、后续回放。
|
|
30
|
+
|
|
31
|
+
## 第二类泄漏:工具调用漏成了正文(0.2.0 起)
|
|
32
|
+
|
|
33
|
+
同一类中转还会漏掉 DeepSeek 的**原生工具调用**。模型本来输出的是 DSML:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
<|DSML|invoke name="bash">
|
|
37
|
+
<|DSML|parameter name="command" string="true">ls</|DSML|parameter>
|
|
38
|
+
</|DSML|invoke>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
中转应该把它解析成 OpenAI 的 `tool_calls`,但有一部分响应没解析,原样塞进了 `content`,
|
|
42
|
+
特殊 token 还常被弄坏成 `<||DSML||>` 残渣,或者干脆只剩 `<invoke name="bash">`。
|
|
43
|
+
模型有时也会写成别家的格式:`<usage tool="bash">`、`<edit><parameter …>`、
|
|
44
|
+
`<tool_call>{json}</tool_call>`、`<function_call>bash</function_call><function_parameter …>`(0.4.0 起)。
|
|
45
|
+
|
|
46
|
+
后果:agent loop 只执行真正的 tool-call 块,看到的只有文字,就判定回答结束,
|
|
47
|
+
**turn 提前收工**,用户只好打「请继续」;这段标记还会作为正文回放给模型,越学越多。
|
|
48
|
+
某个真实会话的 40 个 turn 里有 14 个就是这样停下的。
|
|
49
|
+
|
|
50
|
+
本插件的第二道过滤(`lib/tool-markup.js`)在同一个 `llm/stream` waterfall 里处理 text 块:
|
|
51
|
+
|
|
52
|
+
- 认出的调用标记从正文里删掉;工具名必须是本次请求 `tools` 里真实存在的工具。
|
|
53
|
+
- 如果这次响应**没有**任何真正的工具调用,就把格式完整的调用在 `finish` 之前补发成真正的
|
|
54
|
+
tool-call 块(`toolMarkup: salvage`),loop 照常执行,审批、沙箱、参数校验一样生效。
|
|
55
|
+
同一调用重复写了几遍只执行一次(比较时忽略 `description`)。参数类型按 DSML 的
|
|
56
|
+
`string="false"` 或工具 schema 转换(例如 `timeoutMs` 变成数字)。
|
|
57
|
+
- 响应里已经有真正的工具调用时,正文里的伪调用只删除、不再执行(避免重复执行)。
|
|
58
|
+
- `<||DSML||>…</||DSML||>` 这类残渣 token 被删掉,它们包着的自言自语(「emit」「go」)
|
|
59
|
+
变成可折叠的思考块(`strip` 模式下直接丢弃)。
|
|
60
|
+
- 代码块和行内代码里的标记一律不动;未知工具名、`<bash>ls</bash>` 这种简写、普通的尖括号也不动。
|
|
61
|
+
- `max-tokens` / 出错 / 中断的响应不补发调用。
|
|
62
|
+
|
|
63
|
+
改写之后,插件会同步改写 adapter 的 replay 元数据,让块数和块类型对得上。这样消息仍按原生格式
|
|
64
|
+
回放(思考继续作为 `reasoning_content` 发回),不会退化成丢思考的「外来消息」。
|
|
65
|
+
|
|
66
|
+
## 第三类泄漏:模型自己编的标签包着整块独白(0.3.0 起)
|
|
67
|
+
|
|
68
|
+
模型还会用一个随手起名的标签把开工前的独白整块包起来,语言、名字都不固定:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
<概述>
|
|
72
|
+
用户想在某个项目里新建一个代码托管任务……我已经检查了重复项。现在开始创建。
|
|
73
|
+
</概述>
|
|
74
|
+
[工具调用]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
标签名靠不住(下次可能是 `<小结>`、`<plan>`),所以第三道过滤(`lib/lead-wrapper.js`)看形状和上下文:
|
|
78
|
+
|
|
79
|
+
- 正文块**一开头**就是一个标签,且这个标签把**整块**包住;HTML 元素名、大写开头的 JSX 组件、
|
|
80
|
+
带属性的标签不算。
|
|
81
|
+
- 后面紧跟工具调用(包括第二道过滤补发的)或别的块 → 这是开工前的独白,变成思考块
|
|
82
|
+
(`strip` 模式下丢弃)。
|
|
83
|
+
- 整个回答就这一块 → 这就是答案,只去掉标签,内容照常显示,不藏起来。
|
|
84
|
+
- 闭合标签后面还有正文 → 只去掉标签。
|
|
85
|
+
- 一直不闭合(例如 `<文件名> 是占位符`)或包裹超过 8000 字 → 原样放行。
|
|
86
|
+
|
|
87
|
+
`tags` 配置现在也接受中文标签名(例如 `思考`),写进去的标签按第一类规则处理(开头即视为思考)。
|
|
88
|
+
|
|
89
|
+
## 第四类泄漏:模型自己往下编对话(0.4.0 起)
|
|
90
|
+
|
|
91
|
+
中转把整段对话压成一份带标签的文字记录喂给模型时,模型会顺着这份记录往下写:先用文字写一个
|
|
92
|
+
调用,然后替用户写一句「请继续」,再替自己编「工具一直没返回结果」,一路写到输出上限:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
<function_call>bash</function_call> <function_parameter name="command">grep -rn …</function_parameter> </function_call>
|
|
96
|
+
</assistant_message> <user_message> 请继续 </user_message> <assistant_message> <thinking>Still no tool output…</thinking> …
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
界面上就是一屏标签,最后报「已达到输出 token 上限」。那个调用其实从来没执行,模型却以为它执行过了。
|
|
100
|
+
|
|
101
|
+
第四道过滤(`fakeTurns`,在 `lib/tool-markup.js` 里)这样处理:
|
|
102
|
+
|
|
103
|
+
- 回答在**模型开始编下一轮**的位置截断:`</assistant_message>` 后面紧跟另一个轮次标签、一段完整的
|
|
104
|
+
`<user_message>…</user_message>`(或 `<function_results>`、`<tool_response>` 等)、
|
|
105
|
+
或者以文字出现的 DeepSeek 角色 token `<|User|>` / `<|Assistant|>`。截断点之后的正文和后面所有的块都丢掉。
|
|
106
|
+
- 截断点之前的 `<function_call>` 调用按第二类规则补发成真调用。
|
|
107
|
+
- 这次响应是因为编下去才撞上输出上限的,所以截断后把结束原因改成「工具调用」(有调用时)或「正常结束」,
|
|
108
|
+
turn 接着跑,不再显示「已达到输出 token 上限」。回放元数据的 `stopReason` 一起改。
|
|
109
|
+
- 回答开头的 `<assistant_message>` 只去掉标签;回答最后多出来的一个 `</assistant_message>` 也只去掉标签。
|
|
110
|
+
- 代码块、行内代码里的标签不动;正文里单独提到 `<user_message>`、没有成对闭合的,不动。
|
|
111
|
+
|
|
112
|
+
## 安装
|
|
113
|
+
|
|
114
|
+
DSH 里打开 **设置 → 插件 → Add plugin**,搜 npm 包名 **`dsh-plugin-thinking-guard`**,装好后刷新页面。
|
|
115
|
+
市场收录由夜间构建更新,刚发布时可能当天还搜不到。
|
|
116
|
+
|
|
117
|
+
命令行也可以:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
dsh plugin --profile <profile> add dsh-plugin-thinking-guard
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
包还没上 npm 时,直接装 tarball:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
dsh plugin --profile <profile> add ./dsh-plugin-thinking-guard-0.4.0.tgz
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## 配置(`cordis.patch.yml` 的 `config`)
|
|
130
|
+
|
|
131
|
+
| 键 | 默认 | 说明 |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `enabled` | `true` | 关掉后完全不介入流。 |
|
|
134
|
+
| `mode` | `split` | `split`:思考变成 reasoning 块(可折叠,信息不丢)。`strip`:整段丢弃,只留正文。 |
|
|
135
|
+
| `tags` | `["thinking","analysis","thought"]` | 当成思考包裹的标签名,大小写不敏感。 |
|
|
136
|
+
| `midStream` | `false` | 只认整块开头的泄漏标签(本次事故形态)。设 `true` 后正文中间的标签也切开,代价是回答里讨论这个写法时会被误判。 |
|
|
137
|
+
| `leadWrappers` | `true` | 第三道过滤:整块被自造标签包住的独白。`false` 关掉。 |
|
|
138
|
+
| `toolMarkup` | `salvage` | `salvage`:删掉正文里的伪调用,没有真调用时补发成真调用。`strip`:只删不执行。`off`:关掉第二道过滤。 |
|
|
139
|
+
| `fakeTurns` | `true` | 第四道过滤:模型替用户往下编对话时,在编的地方截断回答。`false` 关掉。 |
|
|
140
|
+
| `debug` | `false` | 每次改写打一行 `console.warn`,排查用。 |
|
|
141
|
+
|
|
142
|
+
改配置后由 profile 的 patch 层覆盖,升级插件不会丢。
|
|
143
|
+
|
|
144
|
+
## 行为边界
|
|
145
|
+
|
|
146
|
+
- 只认标签形态的泄漏。如果中转把思考**裸着**塞进正文(没有标签),本插件不猜、不删。
|
|
147
|
+
- 块开头出现孤立的 `</thinking>`(思考通道结束了、标签却漏进正文)时,它会被删掉;如果 4000 字以内
|
|
148
|
+
又出现一个 `</thinking>`,两者之间的内容按思考处理。
|
|
149
|
+
- 0.1.0 拆出 reasoning 块后 replay 元数据会对不上,pi-ai 会把整条消息降级、丢掉思考。0.2.0 起
|
|
150
|
+
插件在 `finish` 上重新对齐元数据:原有块保留原条目,新块用普通条目,拆出的思考沿用本条消息
|
|
151
|
+
已有的 `thinkingSignature`。对不上的 envelope(例如块数本来就不一致)原样放行。
|
|
152
|
+
- 补发的调用来自模型写在正文里的标记,可能是它的草稿(例如路径写成了 `.../a.tsx`)。这类调用会被
|
|
153
|
+
工具本身拒绝,并把错误交回模型,比 turn 停下来强;不放心可以把 `toolMarkup` 设成 `strip`。
|
|
154
|
+
- 正文里**不加反引号**直接写 `<invoke name="真实工具名">` 又不闭合时,这个开标签会被删掉。
|
|
155
|
+
讨论这种写法请放进行内代码或代码块。
|
|
156
|
+
- 自造标签只在「块开头 + 包住整块」时处理;出现在正文中间的(例如 `<original_code>…</original_code>`、
|
|
157
|
+
单独一个 `<continue>`)不处理,没有可靠规则区分它们和正常 XML。
|
|
158
|
+
- 回答开头不加代码块、直接写一个自定义元素(例如 `<my-widget>…</my-widget>`)并包住整个回答时,
|
|
159
|
+
标签会被去掉。展示代码请放进代码块。
|
|
160
|
+
- 只有一种情况会改 `finish`:回答被第四道过滤截断、且原本是撞上输出上限结束的。其余情况不改 `finish`、`usage`、
|
|
161
|
+
工具调用与 block 顺序;纯正文的普通回答走快路径,字节级不变。
|
|
162
|
+
- 截断时丢掉的是模型编的后续轮次,不会保留。正文里不加反引号、成对写出 `<user_message>…</user_message>`
|
|
163
|
+
来讲模板格式时,也会在那里截断;讨论这种写法请放进行内代码或代码块。
|
|
164
|
+
- 不替你换上游,也不改模型参数。根治仍然在中转侧(让后端把思考放进 `reasoning_content`)。
|
|
165
|
+
|
|
166
|
+
## 怎么确认它真的生效
|
|
167
|
+
|
|
168
|
+
1. 在 **Plugins** 里看到 `思考护栏` 这一行、状态是启用。
|
|
169
|
+
2. 起一个新会话,让模型输出下面这段(它模拟泄漏形态),发完看历史:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
<thinking>测试标记</thinking>
|
|
173
|
+
VISIBLE-ANSWER
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
期望:消息里出现两行内容——一行可折叠的「思考」(内容为「测试标记」),一行正文
|
|
177
|
+
`VISIBLE-ANSWER`;正文里**不再**出现尖括号标签。
|
|
178
|
+
|
|
179
|
+
3. 反向检查:让模型输出一句提到标签的普通句子,例如
|
|
180
|
+
「人们会看到 `</thinking>` 这样的字面标签。」——这句必须原样保留,不被拆开。
|
|
181
|
+
这是 `midStream: false` 的严格模式在起作用。
|
|
182
|
+
|
|
183
|
+
4. 工具调用:让模型「不调用工具,而是原样输出下面这段文字」:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
<invoke name="bash">
|
|
187
|
+
<parameter name="command">echo GUARD-OK</parameter>
|
|
188
|
+
<parameter name="description">guard check</parameter>
|
|
189
|
+
</invoke>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
期望:正文里不出现这段标记,而是出现一次真正的 bash 调用,结果是 `GUARD-OK`,turn 继续往下走。
|
|
193
|
+
|
|
194
|
+
本次交付已按上面两步在真实的 pi-ai 流上跑通(`<thought>` 块被识别为 reasoning、
|
|
195
|
+
带内联代码标签的正文原样通过)。注意:插件是链接安装的,改完 `lib/guard.js` 需要在
|
|
196
|
+
**Plugins** 里把本行关一次再开一次,Host 才会加载新的模块版本。
|
|
197
|
+
|
|
198
|
+
## 开发
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
npm test # node --test test/*.test.mjs
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
`lib/guard.js` 是纯函数式改写器(`ThinkingGuard.push(chunk) -> chunk[]`),`lib/tool-markup.js`
|
|
205
|
+
是第二道过滤(`ToolMarkupGuard`),`lib/lead-wrapper.js` 是第三道(`LeadWrapperGuard`),
|
|
206
|
+
`guardStream` 按这个顺序串起来并用 `ReplayAligner` 对齐 replay 元数据。都不依赖网络,测试里用一个和 `@deepseek-ai/dsh-llm` `BlockAssembler` 等价的迷你装配器
|
|
207
|
+
断言最终 block。
|
|
208
|
+
|
|
209
|
+
0.2.0 用某个卡住会话的 669 条真实 assistant 消息做过回放:每条消息按 1 字符、7 字符、
|
|
210
|
+
随机长度切成流,喂给 `guardStream`。结果:14 个卡住的 turn 全部补发出了工具调用,638 条正常消息
|
|
211
|
+
字节不变,几种切分方式结果完全一致,改写后正文里没有残留标记。0.3.0 又回放了另一个会话:
|
|
212
|
+
`<概述>` 那条变成思考块、后面的建任务调用不变;在第一个会话上,这条规则只影响了 3 条消息,
|
|
213
|
+
都是 `<bash>…</bash>` 草稿。0.4.0 把截图里的「自己往下编对话」形态写成了单测(含 1/3/7 字符切流),
|
|
214
|
+
两个旧会话的回放结果与 0.3.0 逐条一致。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# dsh-plugin-thinking-guard bundle patch
|
|
2
|
+
#
|
|
3
|
+
# 只有一行 Host 插件。所有可调项都在 config 里,改完由 profile 的 patch 层覆盖,
|
|
4
|
+
# 升级插件不会丢你的配置。
|
|
5
|
+
#
|
|
6
|
+
# mode:
|
|
7
|
+
# split —— 泄漏的思考被拆成独立的 reasoning 块(界面里显示为可折叠的「思考」),
|
|
8
|
+
# 回答正文保持干净。默认,信息不丢。
|
|
9
|
+
# strip —— 直接丢弃泄漏的思考,只保留回答正文。
|
|
10
|
+
# tags:
|
|
11
|
+
# 被当作思考包裹的标签名,默认 thinking / analysis / thought(大小写不敏感)。
|
|
12
|
+
# midStream:
|
|
13
|
+
# 默认 false。只认「整块开头」的泄漏标签,也就是本次事故的形态。设成 true 后,
|
|
14
|
+
# 正文中间出现的 <thinking> 也会被切开——代价是回答里讨论这个写法时会被误判。
|
|
15
|
+
# toolMarkup:
|
|
16
|
+
# salvage —— 中转没解析出来、漏进正文的工具调用(DSML / <invoke> / <usage> 等)从正文删掉;
|
|
17
|
+
# 这次响应没有真正的工具调用时,把它们补发成真正的工具调用,turn 不再提前结束。默认。
|
|
18
|
+
# strip —— 只删不执行。
|
|
19
|
+
# off —— 关掉这道过滤。
|
|
20
|
+
# fakeTurns:
|
|
21
|
+
# 默认 true。模型顺着对话记录替用户往下编(</assistant_message> <user_message>请继续</user_message> …)时,
|
|
22
|
+
# 在编的地方截断回答,前面写成文字的调用补发成真调用;因此撞上输出上限的响应改成正常结束,turn 接着跑。false 关掉。
|
|
23
|
+
# leadWrappers:
|
|
24
|
+
# 默认 true。正文块一开头就被一个模型自造的标签(如 <概述>)整块包住时:后面紧跟工具调用
|
|
25
|
+
# 或别的块 → 当作开工前的独白,变成思考块;整个回答就这一块 → 只去掉标签。false 关掉。
|
|
26
|
+
# debug:
|
|
27
|
+
# 每次改写时在 Host 日志里打一行 console.warn,排查用。
|
|
28
|
+
|
|
29
|
+
- insert:
|
|
30
|
+
- id: dsh-thinking-guard
|
|
31
|
+
name: dsh-plugin-thinking-guard
|
|
32
|
+
config:
|
|
33
|
+
enabled: true
|
|
34
|
+
mode: split
|
|
35
|
+
tags:
|
|
36
|
+
- thinking
|
|
37
|
+
- analysis
|
|
38
|
+
- thought
|
|
39
|
+
midStream: false
|
|
40
|
+
toolMarkup: salvage
|
|
41
|
+
fakeTurns: true
|
|
42
|
+
leadWrappers: true
|
|
43
|
+
debug: false
|
package/icon.svg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="Thinking guard">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="shield" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#4f7cff"/>
|
|
5
|
+
<stop offset="1" stop-color="#2b4bd1"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<path d="M32 3.5 55 12v19.5c0 14.2-9.6 24.6-23 29-13.4-4.4-23-14.8-23-29V12z"
|
|
9
|
+
fill="url(#shield)" stroke="#1b2f8a" stroke-width="1.6" stroke-linejoin="round"/>
|
|
10
|
+
<path d="M20 24h24a4 4 0 0 1 4 4v11a4 4 0 0 1-4 4H31l-8.4 6.2a1 1 0 0 1-1.6-.8V43H20a4 4 0 0 1-4-4V28a4 4 0 0 1 4-4z"
|
|
11
|
+
fill="#ffffff" opacity="0.94"/>
|
|
12
|
+
<g fill="#3b5bdb">
|
|
13
|
+
<circle cx="24.5" cy="33.5" r="2.6"/>
|
|
14
|
+
<circle cx="32" cy="33.5" r="2.6"/>
|
|
15
|
+
<circle cx="39.5" cy="33.5" r="2.6"/>
|
|
16
|
+
</g>
|
|
17
|
+
<path d="M20 24h24a4 4 0 0 1 4 4v11a4 4 0 0 1-4 4H31l-8.4 6.2a1 1 0 0 1-1.6-.8V43H20a4 4 0 0 1-4-4V28a4 4 0 0 1 4-4z"
|
|
18
|
+
fill="none" stroke="#1b2f8a" stroke-width="1.4" stroke-linejoin="round" opacity="0.55"/>
|
|
19
|
+
</svg>
|