@jianxx/dsh-cc-output-styles 0.1.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/LICENSE +201 -0
- package/README.i18n.yaml +6 -0
- package/README.md +79 -0
- package/README.zh.md +79 -0
- package/lib/index.d.ts +59 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +126 -0
- package/lib/index.js.map +1 -0
- package/lib/invariant.d.ts +16 -0
- package/lib/invariant.d.ts.map +1 -0
- package/lib/invariant.js +25 -0
- package/lib/invariant.js.map +1 -0
- package/lib/styles.d.ts +74 -0
- package/lib/styles.d.ts.map +1 -0
- package/lib/styles.js +179 -0
- package/lib/styles.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/compat/cc-output-styles/README.md
|
|
5
|
+
README.md: a30408a4f8da9a7ccbf93ae8ea6656052915feec
|
|
6
|
+
README.zh.md: 459375f2d65561894a1c7ad530fe1187b1cabe63
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @jianxx/dsh-cc-output-styles
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
Claude Code-compatible output style selection for the DeepSeek Harness. The selected style contributes a system-prompt section through the [`systemPrompt`](../../core/system-prompt/README.md) registry — empty for the `default` style — so the model's communication contract mirrors the familiar Claude Code `Explanatory` / `Learning` styles plus project- and user-authored custom styles.
|
|
6
|
+
|
|
7
|
+
## Output styles
|
|
8
|
+
|
|
9
|
+
Three built-in styles ship with the package:
|
|
10
|
+
|
|
11
|
+
| Style | Effect |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `default` | Contributes no section. |
|
|
14
|
+
| `Explanatory` | Directs the model to explain its implementation choices and codebase patterns as it works. |
|
|
15
|
+
| `Learning` | Directs the model to teach collaboratively, requesting short hands-on practice contributions gated by a single `TODO(human)` marker. |
|
|
16
|
+
|
|
17
|
+
Custom styles are loaded from `<project>/.claude/output-styles/*.md` (project) and the harness home `~/.dsh/output-styles/*.md`, with the later project directory overriding a same-named earlier style. Each file name becomes the style name; frontmatter supplies a `description` (required) and an optional `keep-coding-instructions` boolean (default `true`):
|
|
18
|
+
|
|
19
|
+
```md
|
|
20
|
+
---
|
|
21
|
+
description: Keep answers concise and skip the usual preamble.
|
|
22
|
+
keep-coding-instructions: false
|
|
23
|
+
---
|
|
24
|
+
Your concise coding and communication instructions here.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
When `keep-coding-instructions` is `false`, the contributed section states that it replaces the default coding-instruction section; when `true` (the default), the default coding instructions are retained alongside the style's prose. Malformed or missing frontmatter fails the plugin load loud.
|
|
28
|
+
|
|
29
|
+
## Selection
|
|
30
|
+
|
|
31
|
+
The active style is the settings key `outputStyle` in the `cc-output-styles` namespace, layered over the plugin composition `outputStyle` config. Without a settings provider the composition value stands; then `/output-style` still switches in-session.
|
|
32
|
+
|
|
33
|
+
A switch re-emits `system-prompt/change`, so the next assembled prompt picks up the new style's section.
|
|
34
|
+
|
|
35
|
+
## `/output-style` command
|
|
36
|
+
|
|
37
|
+
Registered through [`ctx.commands`](../../interaction/commands/README.md); every composed command adapter discovers it without a model turn.
|
|
38
|
+
|
|
39
|
+
| Input | Result |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `/output-style` | Show the current style and the selectable styles. |
|
|
42
|
+
| `/output-style <name>` | Set the active style; unknown names return an error listing the selectable styles. |
|
|
43
|
+
|
|
44
|
+
## Composition
|
|
45
|
+
|
|
46
|
+
The plugin injects `systemPrompt` and `commands`. Custom apps mount their owners plus this row:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
- id: system-prompt
|
|
50
|
+
name: '@deepseek-ai/dsh-system-prompt'
|
|
51
|
+
- id: commands
|
|
52
|
+
name: '@deepseek-ai/dsh-commands'
|
|
53
|
+
- id: cc-output-styles
|
|
54
|
+
name: '@jianxx/dsh-cc-output-styles'
|
|
55
|
+
config:
|
|
56
|
+
outputStyle: Explanatory
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Model Experience
|
|
60
|
+
|
|
61
|
+
### Output style section
|
|
62
|
+
|
|
63
|
+
#### What the model sees
|
|
64
|
+
|
|
65
|
+
While a non-default style is active, its prose appears as the `cc:output-style` prompt section, rendered before the deployment persona. The `default` style contributes nothing.
|
|
66
|
+
|
|
67
|
+
#### Token effect
|
|
68
|
+
|
|
69
|
+
The `default` style adds no tokens. Non-default styles add their section prose to each assembled prompt.
|
|
70
|
+
|
|
71
|
+
#### KV Cache effect
|
|
72
|
+
|
|
73
|
+
The contribution is a fixed prompt-section provider; a style switch changes the section text and so the assembled prompt for the following turn, like any system-prompt section change.
|
|
74
|
+
|
|
75
|
+
## Known Limitations and Deferred Work
|
|
76
|
+
|
|
77
|
+
- **Prompt-section replacement only** — `keep-coding-instructions: false` is expressed in the contributed section's lead-in rather than by unregistering the harness's own coding-instruction provider, which owns that slot.
|
|
78
|
+
- **Composition fallback is static** — without a settings provider the selection reverts to the composition `outputStyle` after a reload; `/output-style` persistence needs the `settings` service.
|
|
79
|
+
- **No plugin-forced styles** — Claude Code's plugin-authored `force-for-plugin` output styles are out of scope for this row.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @jianxx/dsh-cc-output-styles
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
面向 DeepSeek Harness、兼容 Claude Code 的输出风格选择。选中的风格通过 [`systemPrompt`](../../core/system-prompt/README.md) 注册表贡献一个系统提示词 section——`default` 风格下为空——使模型的沟通契约镜像熟悉的 Claude Code `Explanatory`/`Learning` 风格,加上项目与用户自定义风格。
|
|
6
|
+
|
|
7
|
+
## 输出风格
|
|
8
|
+
|
|
9
|
+
随包提供三种内建风格:
|
|
10
|
+
|
|
11
|
+
| 风格 | 效果 |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `default` | 不贡献任何 section。 |
|
|
14
|
+
| `Explanatory` | 指示模型在工作中解释其实现选择与代码库模式。 |
|
|
15
|
+
| `Learning` | 指示模型协作式教学,请求以单个 `TODO(human)` 标记为门槛的简短动手实践贡献。 |
|
|
16
|
+
|
|
17
|
+
自定义风格从 `<project>/.claude/output-styles/*.md`(项目)与 harness home `~/.dsh/output-styles/*.md` 加载,靠后的项目目录会覆盖同名较早风格。每个文件名即风格名;frontmatter 提供 `description`(必需)与可选的 `keep-coding-instructions` 布尔值(默认 `true`):
|
|
18
|
+
|
|
19
|
+
```md
|
|
20
|
+
---
|
|
21
|
+
description: Keep answers concise and skip the usual preamble.
|
|
22
|
+
keep-coding-instructions: false
|
|
23
|
+
---
|
|
24
|
+
Your concise coding and communication instructions here.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
当 `keep-coding-instructions` 为 `false` 时,所贡献的 section 会声明其取代默认编码指示 section;为 `true`(默认)时,默认编码指示会与该风格正文一起保留。格式错误或缺失的 frontmatter 会导致插件加载期明显失败。
|
|
28
|
+
|
|
29
|
+
## 选择
|
|
30
|
+
|
|
31
|
+
当前风格是 `cc-output-styles` 命名空间中的 settings 键 `outputStyle`,叠加在插件组合 `outputStyle` 配置之上。没有 settings 提供器时以组合值为主;随后 `/output-style` 仍会在会话内切换。
|
|
32
|
+
|
|
33
|
+
切换会重新发出 `system-prompt/change`,使下一个组装的提示词采用新风格的 section。
|
|
34
|
+
|
|
35
|
+
## `/output-style` 命令
|
|
36
|
+
|
|
37
|
+
通过 [`ctx.commands`](../../interaction/commands/README.md) 注册;每个已组合的命令适配器都能发现并执行它,无需模型轮次。
|
|
38
|
+
|
|
39
|
+
| 输入 | 结果 |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `/output-style` | 显示当前风格与可选择的风格。 |
|
|
42
|
+
| `/output-style <name>` | 设置当前风格;未知名称返回列出可选择风格的错误。 |
|
|
43
|
+
|
|
44
|
+
## 组合
|
|
45
|
+
|
|
46
|
+
插件注入 `systemPrompt` 与 `commands`。自定义应用会挂载其所有者与这一行:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
- id: system-prompt
|
|
50
|
+
name: '@deepseek-ai/dsh-system-prompt'
|
|
51
|
+
- id: commands
|
|
52
|
+
name: '@deepseek-ai/dsh-commands'
|
|
53
|
+
- id: cc-output-styles
|
|
54
|
+
name: '@jianxx/dsh-cc-output-styles'
|
|
55
|
+
config:
|
|
56
|
+
outputStyle: Explanatory
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 模型体验
|
|
60
|
+
|
|
61
|
+
### 输出风格 section
|
|
62
|
+
|
|
63
|
+
#### 模型看到的内容
|
|
64
|
+
|
|
65
|
+
非 `default` 风格激活时,其正文以 `cc:output-style` 提示词 section 出现,并渲染在部署 persona 之前。`default` 风格不贡献任何内容。
|
|
66
|
+
|
|
67
|
+
#### Token 影响
|
|
68
|
+
|
|
69
|
+
`default` 风格不增加 token。非 default 风格会把各自的 section 正文加入每次组装的提示词。
|
|
70
|
+
|
|
71
|
+
#### KV Cache 影响
|
|
72
|
+
|
|
73
|
+
该贡献是固定的提示词 section 提供器;风格切换会改变 section 文本,从而改变下一轮次组装的提示词,与任何系统提示词 section 变更一致。
|
|
74
|
+
|
|
75
|
+
## 已知限制与暂缓事项
|
|
76
|
+
|
|
77
|
+
- **仅替换提示词 section**——`keep-coding-instructions: false` 表达在所贡献 section 的引导语中,而非注销 harness 自身拥有该槽位的编码指示提供器。
|
|
78
|
+
- **组合回退是静态的**——没有 settings 提供器时,重载后选择会回退到组合 `outputStyle`;`/output-style` 的持久化需要 `settings` 服务。
|
|
79
|
+
- **无插件强制风格**——Claude Code 插件自带的 `force-for-plugin` 输出风格不在本行范围内。
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code-compatible output style selection for the DeepSeek Harness.
|
|
3
|
+
*
|
|
4
|
+
* A selected output style contributes a system-prompt section (empty for the
|
|
5
|
+
* `default` style), switching through a settings key or the `/output-style`
|
|
6
|
+
* command, and re-emits `system-prompt/change` so the next turn reassembles the
|
|
7
|
+
* prompt.
|
|
8
|
+
*
|
|
9
|
+
* @module @jianxx/dsh-cc-output-styles
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
+
import z from '@deepseek-ai/schemastery';
|
|
13
|
+
export type { OutputStyle } from './styles.ts';
|
|
14
|
+
export { BUILTIN_STYLES, DEFAULT_OUTPUT_STYLE, REPLACES_CODING_INSTRUCTIONS, buildStyleLibrary, loadCustomStyles, parseCustomStyle, styleSectionText, } from './styles.ts';
|
|
15
|
+
/** Cordis plugin name. */
|
|
16
|
+
export declare const name = "cc-output-styles";
|
|
17
|
+
/** The prompt registry and human command registry this plugin contributes to. */
|
|
18
|
+
export declare const inject: string[];
|
|
19
|
+
/** Name of the system-prompt section this plugin owns. */
|
|
20
|
+
export declare const OUTPUT_STYLE_SECTION = "cc:output-style";
|
|
21
|
+
/**
|
|
22
|
+
* Prompt order of the output-style section. Rendered before the deployment
|
|
23
|
+
* persona (`0`) so the communication contract is among the first text a model
|
|
24
|
+
* reads; harness identity (`-100`) still precedes it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OUTPUT_STYLE_ORDER = -50;
|
|
27
|
+
/** Settings namespace carrying the selected output style. */
|
|
28
|
+
export declare const OUTPUT_STYLE_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
|
|
29
|
+
/** Plugin config: composition-level style selection and custom style sources. */
|
|
30
|
+
export interface Config {
|
|
31
|
+
/** Output style name; defaults to {@link DEFAULT_OUTPUT_STYLE}. */
|
|
32
|
+
outputStyle?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Project root whose `.claude/output-styles/` directory contributes custom
|
|
35
|
+
* styles. Defaults to the current working directory.
|
|
36
|
+
*/
|
|
37
|
+
projectRoot?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Harness home whose `output-styles/` directory contributes custom styles.
|
|
40
|
+
* Defaults to the deepseek harness home (`~/.dsh`).
|
|
41
|
+
*/
|
|
42
|
+
harnessHome?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Explicit custom-style directories, replacing the computed project and
|
|
45
|
+
* harness directories. Later directories override same-named earlier styles.
|
|
46
|
+
*/
|
|
47
|
+
dirs?: string[];
|
|
48
|
+
}
|
|
49
|
+
/** Runtime schema for the output-style plugin config. */
|
|
50
|
+
export declare const Config: z<Config>;
|
|
51
|
+
/**
|
|
52
|
+
* Register the output-style plugin: load custom styles, wire the settings
|
|
53
|
+
* section covering the selection, register the system-prompt section, and
|
|
54
|
+
* register the `/output-style` command.
|
|
55
|
+
* @param ctx - Cordis context with `systemPrompt` and `commands` mounted.
|
|
56
|
+
* @param config - plugin config carrying the composition selection and dirs.
|
|
57
|
+
*/
|
|
58
|
+
export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAcxC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAA;AAEpB,0BAA0B;AAC1B,eAAO,MAAM,IAAI,qBAAqB,CAAA;AAEtC,iFAAiF;AACjF,eAAO,MAAM,MAAM,UAA+B,CAAA;AAElD,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,oBAAoB,CAAA;AAErD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,6DAA6D;AAC7D,eAAO,MAAM,+BAA+B,uDAAwC,CAAA;AAKpF,iFAAiF;AACjF,MAAM,WAAW,MAAM;IACrB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,yDAAyD;AACzD,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAK3B,CAAA;AAqBF;;;;;;GAMG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwDvE"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code-compatible output style selection for the DeepSeek Harness.
|
|
3
|
+
*
|
|
4
|
+
* A selected output style contributes a system-prompt section (empty for the
|
|
5
|
+
* `default` style), switching through a settings key or the `/output-style`
|
|
6
|
+
* command, and re-emits `system-prompt/change` so the next turn reassembles the
|
|
7
|
+
* prompt.
|
|
8
|
+
*
|
|
9
|
+
* @module @jianxx/dsh-cc-output-styles
|
|
10
|
+
*/
|
|
11
|
+
import z from '@deepseek-ai/schemastery';
|
|
12
|
+
import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { defaultDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
15
|
+
import { DEFAULT_OUTPUT_STYLE, buildStyleLibrary, loadCustomStyles, styleSectionText, } from "./styles.js";
|
|
16
|
+
export { BUILTIN_STYLES, DEFAULT_OUTPUT_STYLE, REPLACES_CODING_INSTRUCTIONS, buildStyleLibrary, loadCustomStyles, parseCustomStyle, styleSectionText, } from "./styles.js";
|
|
17
|
+
/** Cordis plugin name. */
|
|
18
|
+
export const name = 'cc-output-styles';
|
|
19
|
+
/** The prompt registry and human command registry this plugin contributes to. */
|
|
20
|
+
export const inject = ['systemPrompt', 'commands'];
|
|
21
|
+
/** Name of the system-prompt section this plugin owns. */
|
|
22
|
+
export const OUTPUT_STYLE_SECTION = 'cc:output-style';
|
|
23
|
+
/**
|
|
24
|
+
* Prompt order of the output-style section. Rendered before the deployment
|
|
25
|
+
* persona (`0`) so the communication contract is among the first text a model
|
|
26
|
+
* reads; harness identity (`-100`) still precedes it.
|
|
27
|
+
*/
|
|
28
|
+
export const OUTPUT_STYLE_ORDER = -50;
|
|
29
|
+
/** Settings namespace carrying the selected output style. */
|
|
30
|
+
export const OUTPUT_STYLE_SETTINGS_NAMESPACE = settingsNamespace('cc-output-styles');
|
|
31
|
+
/** Schema of one resolved settings section for the output style. */
|
|
32
|
+
const OUTPUT_STYLE_ENTRY_SCHEMA = z.object({ outputStyle: z.string() });
|
|
33
|
+
/** Runtime schema for the output-style plugin config. */
|
|
34
|
+
export const Config = z.object({
|
|
35
|
+
outputStyle: z.string().default(DEFAULT_OUTPUT_STYLE),
|
|
36
|
+
projectRoot: z.string(),
|
|
37
|
+
harnessHome: z.string(),
|
|
38
|
+
dirs: z.array(z.string()),
|
|
39
|
+
});
|
|
40
|
+
/** The custom-style directories contributing to the plugin load. */
|
|
41
|
+
function styleDirectories(config) {
|
|
42
|
+
if (config.dirs !== undefined)
|
|
43
|
+
return config.dirs;
|
|
44
|
+
return [
|
|
45
|
+
join(config.projectRoot ?? process.cwd(), '.claude', 'output-styles'),
|
|
46
|
+
join(config.harnessHome ?? defaultDshHome(), 'output-styles'),
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
/** Render the selectable style list with the current selection marked. */
|
|
50
|
+
function renderStyleList(library, current) {
|
|
51
|
+
const lines = ['Available output styles:'];
|
|
52
|
+
for (const style of library.values()) {
|
|
53
|
+
const marker = style.name === current ? '*' : ' ';
|
|
54
|
+
lines.push(`${marker} ${style.name} — ${style.description}`);
|
|
55
|
+
}
|
|
56
|
+
return lines.join('\n');
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Register the output-style plugin: load custom styles, wire the settings
|
|
60
|
+
* section covering the selection, register the system-prompt section, and
|
|
61
|
+
* register the `/output-style` command.
|
|
62
|
+
* @param ctx - Cordis context with `systemPrompt` and `commands` mounted.
|
|
63
|
+
* @param config - plugin config carrying the composition selection and dirs.
|
|
64
|
+
*/
|
|
65
|
+
export async function apply(ctx, config) {
|
|
66
|
+
const library = buildStyleLibrary(await loadCustomStyles(styleDirectories(config)));
|
|
67
|
+
// Composition default, replaced by the user layer while a settings provider
|
|
68
|
+
// is mounted, and written by /output-style when none is.
|
|
69
|
+
let fallback = config.outputStyle ?? DEFAULT_OUTPUT_STYLE;
|
|
70
|
+
let source = () => fallback;
|
|
71
|
+
installSettingsSection(ctx, OUTPUT_STYLE_SETTINGS_NAMESPACE, OUTPUT_STYLE_ENTRY_SCHEMA, { outputStyle: fallback }, {
|
|
72
|
+
setSource: (current) => {
|
|
73
|
+
source = () => current().outputStyle;
|
|
74
|
+
},
|
|
75
|
+
onChange: () => {
|
|
76
|
+
// A committed style change must reach the next assembled prompt.
|
|
77
|
+
ctx.emit('system-prompt/change');
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
// The section provider reads the live selection at each assembly, so a
|
|
81
|
+
// switch takes effect on the next turn without re-registering.
|
|
82
|
+
ctx.effect(() => ctx.systemPrompt.section({
|
|
83
|
+
name: OUTPUT_STYLE_SECTION,
|
|
84
|
+
order: OUTPUT_STYLE_ORDER,
|
|
85
|
+
text: () => styleSectionText(library.get(source()) ?? BUILTIN_DEFAULT_STYLE),
|
|
86
|
+
}), 'cc-output-styles.section()');
|
|
87
|
+
/** Persist or, without a settings provider, apply the selection in-session. */
|
|
88
|
+
const applySelection = async (selected) => {
|
|
89
|
+
const settings = ctx.get('settings');
|
|
90
|
+
if (settings !== undefined) {
|
|
91
|
+
await settings.update(OUTPUT_STYLE_SETTINGS_NAMESPACE, { outputStyle: selected });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
fallback = selected;
|
|
95
|
+
ctx.emit('system-prompt/change');
|
|
96
|
+
};
|
|
97
|
+
ctx.commands.register({
|
|
98
|
+
name: 'output-style',
|
|
99
|
+
description: 'view or set the active output style',
|
|
100
|
+
input: { hint: '[<name>]' },
|
|
101
|
+
handler: async (invocation) => {
|
|
102
|
+
const current = source();
|
|
103
|
+
const input = invocation.rawInput.trim();
|
|
104
|
+
if (input.length === 0) {
|
|
105
|
+
return { kind: 'success', text: `Current output style: ${current}\n\n${renderStyleList(library, current)}` };
|
|
106
|
+
}
|
|
107
|
+
if (!library.has(input)) {
|
|
108
|
+
return {
|
|
109
|
+
kind: 'error',
|
|
110
|
+
text: `Unknown output style "${input}".\n${renderStyleList(library, current)}`,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
await applySelection(input);
|
|
114
|
+
return { kind: 'success', text: `Output style set to ${input}.` };
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** The always-present default style used when a stored selection names nothing known. */
|
|
119
|
+
const BUILTIN_DEFAULT_STYLE = {
|
|
120
|
+
name: DEFAULT_OUTPUT_STYLE,
|
|
121
|
+
description: 'Default output style',
|
|
122
|
+
prompt: '',
|
|
123
|
+
builtin: true,
|
|
124
|
+
keepCodingInstructions: true,
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAG5D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GAEjB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,4BAA4B,EAC5B,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAA;AAEpB,0BAA0B;AAC1B,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AAEtC,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;AAElD,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAA;AAErD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,CAAA;AAErC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,+BAA+B,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;AAEpF,oEAAoE;AACpE,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE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.
|
|
3
|
+
* @module @jianxx/dsh-cc-output-styles/invariant
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export declare const name = "cc-output-styles-invariant";
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register this package's invariant companion.
|
|
12
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
+
//# sourceMappingURL=invariant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,+BAA+B,CAAA;AAChD,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAWpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@jianxx/dsh-cc-output-styles`.
|
|
3
|
+
* @module @jianxx/dsh-cc-output-styles/invariant
|
|
4
|
+
*/
|
|
5
|
+
const PACKAGE_NAME = '@jianxx/dsh-cc-output-styles';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export const name = 'cc-output-styles-invariant';
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export const inject = ['invariants'];
|
|
10
|
+
/**
|
|
11
|
+
* No runtime invariant: the output-style section text is a pure function of
|
|
12
|
+
* the selected style (`styleSectionText`), and the switch contract — a settings
|
|
13
|
+
* write re-emitting `system-prompt/change`, and `/output-style` rejecting
|
|
14
|
+
* unknown names — is asserted by the package behavioral suite rather than a
|
|
15
|
+
* stateful projection or event pairing this companion owns.
|
|
16
|
+
*/
|
|
17
|
+
const install = () => { };
|
|
18
|
+
/**
|
|
19
|
+
* Register this package's invariant companion.
|
|
20
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
21
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
22
|
+
*/
|
|
23
|
+
export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
24
|
+
/* jscpd:ignore-end */
|
|
25
|
+
//# sourceMappingURL=invariant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,YAAY,GAAG,8BAA8B,CAAA;AAEnD,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,4BAA4B,CAAA;AAChD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAuB,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,sBAAsB"}
|
package/lib/styles.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output-style model, frontmatter parsing, and file loading for
|
|
3
|
+
* `@jianxx/dsh-cc-output-styles`.
|
|
4
|
+
*
|
|
5
|
+
* A style is a named, human-selected communication contract contributed to the
|
|
6
|
+
* system prompt. `default` contributes nothing; built-in styles supply prose;
|
|
7
|
+
* user- and project-authored styles are loaded from `output-styles/*.md`
|
|
8
|
+
* directories whose file names become the style names.
|
|
9
|
+
*
|
|
10
|
+
* @module @jianxx/dsh-cc-output-styles/styles
|
|
11
|
+
*/
|
|
12
|
+
/** Name of the no-op style: no extra section is contributed. */
|
|
13
|
+
export declare const DEFAULT_OUTPUT_STYLE = "default";
|
|
14
|
+
/** One selectable output style. */
|
|
15
|
+
export interface OutputStyle {
|
|
16
|
+
/** Style name; also the contracted cross-session key. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** Human-readable summary shown in discovery and command output. */
|
|
19
|
+
readonly description: string;
|
|
20
|
+
/** The system-prompt prose contributed while this style is active. */
|
|
21
|
+
readonly prompt: string;
|
|
22
|
+
/** Whether this is a harness-shipped (not user- or project-authored) style. */
|
|
23
|
+
readonly builtin: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the harness's default coding-instruction section is retained
|
|
26
|
+
* alongside this style's prose. When false, the contributed section states
|
|
27
|
+
* that it replaces the default coding instructions.
|
|
28
|
+
*/
|
|
29
|
+
readonly keepCodingInstructions: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Built-in styles in canonical registration order. */
|
|
32
|
+
export declare const BUILTIN_STYLES: readonly OutputStyle[];
|
|
33
|
+
/**
|
|
34
|
+
* The lead line contributed when an active custom style replaces the default
|
|
35
|
+
* coding-instruction section (`keep-coding-instructions: false`). Kept as a
|
|
36
|
+
* constant so package tests pin the model-visible contract verbatim.
|
|
37
|
+
*/
|
|
38
|
+
export declare const REPLACES_CODING_INSTRUCTIONS = "This output style defines the coding instructions for this session and replaces the default coding-instruction section.";
|
|
39
|
+
/**
|
|
40
|
+
* Parse a custom style's frontmatter. The file name (without `.md`) is the
|
|
41
|
+
* style name; frontmatter must provide a non-empty `description`; the optional
|
|
42
|
+
* `keep-coding-instructions` boolean (or `'true'`/`'false'` string) defaults
|
|
43
|
+
* to true. Any other shape fails loud.
|
|
44
|
+
* @param fileName - the style's markdown file name (with `.md`), giving the style name.
|
|
45
|
+
* @param raw - the file's full text.
|
|
46
|
+
* @returns the parsed custom style.
|
|
47
|
+
* @throws when the file has no frontmatter, the frontmatter is not a plain
|
|
48
|
+
* object, or `description` is missing or empty.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseCustomStyle(fileName: string, raw: string): OutputStyle;
|
|
51
|
+
/**
|
|
52
|
+
* Read every markdown output-style file across the given directories, in
|
|
53
|
+
* order, deduplicating by style name so a later directory overrides an earlier
|
|
54
|
+
* same-named style. Missing directories contribute nothing.
|
|
55
|
+
* @param dirs - directories to scan; later entries override earlier ones.
|
|
56
|
+
* @returns the loaded custom styles in directory order.
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadCustomStyles(dirs: readonly string[]): Promise<OutputStyle[]>;
|
|
59
|
+
/**
|
|
60
|
+
* Assemble the selectable library: built-in styles first, then custom styles
|
|
61
|
+
* overlaid by name so a project- or user-authored style shadows a built-in.
|
|
62
|
+
* @param custom - the loaded custom styles.
|
|
63
|
+
* @returns a name-keyed, insertion-ordered library.
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildStyleLibrary(custom: readonly OutputStyle[]): Map<string, OutputStyle>;
|
|
66
|
+
/**
|
|
67
|
+
* Render one style's contributed system-prompt section. The default style and
|
|
68
|
+
* any style with no prompt contribute nothing; a custom style that replaces
|
|
69
|
+
* the default coding instructions carries an explicit lead-in.
|
|
70
|
+
* @param style - the active style.
|
|
71
|
+
* @returns the model-visible section text, or `''` when nothing is contributed.
|
|
72
|
+
*/
|
|
73
|
+
export declare function styleSectionText(style: OutputStyle): string;
|
|
74
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAE7C,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAA;CACzC;AA0BD,uDAAuD;AACvD,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAIhD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,4HACkF,CAAA;AAiB3H;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAsC3E;AAOD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAkBtF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAI1F;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAM3D"}
|
package/lib/styles.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output-style model, frontmatter parsing, and file loading for
|
|
3
|
+
* `@jianxx/dsh-cc-output-styles`.
|
|
4
|
+
*
|
|
5
|
+
* A style is a named, human-selected communication contract contributed to the
|
|
6
|
+
* system prompt. `default` contributes nothing; built-in styles supply prose;
|
|
7
|
+
* user- and project-authored styles are loaded from `output-styles/*.md`
|
|
8
|
+
* directories whose file names become the style names.
|
|
9
|
+
*
|
|
10
|
+
* @module @jianxx/dsh-cc-output-styles/styles
|
|
11
|
+
*/
|
|
12
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { parse as parseYaml } from 'yaml';
|
|
15
|
+
/** Name of the no-op style: no extra section is contributed. */
|
|
16
|
+
export const DEFAULT_OUTPUT_STYLE = 'default';
|
|
17
|
+
/** Explanatory: narrate implementation choices and codebase patterns. */
|
|
18
|
+
const EXPLANATORY_STYLE = {
|
|
19
|
+
name: 'Explanatory',
|
|
20
|
+
description: 'Explain implementation choices and codebase patterns',
|
|
21
|
+
builtin: true,
|
|
22
|
+
keepCodingInstructions: true,
|
|
23
|
+
prompt: [
|
|
24
|
+
'Explain the implementation choices and codebase patterns you rely on as you work, so the user follows your reasoning.',
|
|
25
|
+
'Cover why an approach was chosen, the design decisions behind changed code, and how the change fits existing conventions. Keep explanations concise and tied to the task; do not pad them with general commentary.',
|
|
26
|
+
].join('\n'),
|
|
27
|
+
};
|
|
28
|
+
/** Learning: collaborate hands-on, requesting practice contributions. */
|
|
29
|
+
const LEARNING_STYLE = {
|
|
30
|
+
name: 'Learning',
|
|
31
|
+
description: 'Collaborative teaching that learns through hands-on practice',
|
|
32
|
+
builtin: true,
|
|
33
|
+
keepCodingInstructions: true,
|
|
34
|
+
prompt: [
|
|
35
|
+
'Work as a collaborative tutor. Break the task into steps and invite the user to write small pieces of code themselves for hands-on practice, especially where the solution has multiple valid approaches or meaningful design decisions.',
|
|
36
|
+
'Before requesting a contribution, place a single TODO(human) marker in the code that names the exact function or section to implement. Request only one practice contribution at a time, then stop and wait for the user\'s implementation before continuing.',
|
|
37
|
+
].join('\n'),
|
|
38
|
+
};
|
|
39
|
+
/** Built-in styles in canonical registration order. */
|
|
40
|
+
export const BUILTIN_STYLES = [
|
|
41
|
+
{ name: DEFAULT_OUTPUT_STYLE, description: 'Default output style', prompt: '', builtin: true, keepCodingInstructions: true },
|
|
42
|
+
EXPLANATORY_STYLE,
|
|
43
|
+
LEARNING_STYLE,
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* The lead line contributed when an active custom style replaces the default
|
|
47
|
+
* coding-instruction section (`keep-coding-instructions: false`). Kept as a
|
|
48
|
+
* constant so package tests pin the model-visible contract verbatim.
|
|
49
|
+
*/
|
|
50
|
+
export const REPLACES_CODING_INSTRUCTIONS = 'This output style defines the coding instructions for this session and replaces the default coding-instruction section.';
|
|
51
|
+
/** Locate the closing `---` of a markdown frontmatter block. */
|
|
52
|
+
function findClosingFrontmatter(raw, start) {
|
|
53
|
+
let lineStart = start;
|
|
54
|
+
while (lineStart <= raw.length) {
|
|
55
|
+
const nextNewline = raw.indexOf('\n', lineStart);
|
|
56
|
+
const lineEnd = nextNewline < 0 ? raw.length : nextNewline;
|
|
57
|
+
const line = raw.slice(lineStart, lineEnd).replace(/\r$/, '');
|
|
58
|
+
if (line === '---') {
|
|
59
|
+
return { start: lineStart, bodyStart: nextNewline < 0 ? raw.length : nextNewline + 1 };
|
|
60
|
+
}
|
|
61
|
+
if (nextNewline < 0)
|
|
62
|
+
return undefined;
|
|
63
|
+
lineStart = nextNewline + 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parse a custom style's frontmatter. The file name (without `.md`) is the
|
|
68
|
+
* style name; frontmatter must provide a non-empty `description`; the optional
|
|
69
|
+
* `keep-coding-instructions` boolean (or `'true'`/`'false'` string) defaults
|
|
70
|
+
* to true. Any other shape fails loud.
|
|
71
|
+
* @param fileName - the style's markdown file name (with `.md`), giving the style name.
|
|
72
|
+
* @param raw - the file's full text.
|
|
73
|
+
* @returns the parsed custom style.
|
|
74
|
+
* @throws when the file has no frontmatter, the frontmatter is not a plain
|
|
75
|
+
* object, or `description` is missing or empty.
|
|
76
|
+
*/
|
|
77
|
+
export function parseCustomStyle(fileName, raw) {
|
|
78
|
+
const firstLineEnd = raw.indexOf('\n');
|
|
79
|
+
if (firstLineEnd < 0)
|
|
80
|
+
throw new Error('output-style file has no YAML frontmatter');
|
|
81
|
+
const firstLine = raw.slice(0, firstLineEnd).replace(/\r$/, '');
|
|
82
|
+
if (firstLine !== '---')
|
|
83
|
+
throw new Error('output-style file has no YAML frontmatter');
|
|
84
|
+
const start = firstLineEnd + 1;
|
|
85
|
+
const closing = findClosingFrontmatter(raw, start);
|
|
86
|
+
if (closing === undefined)
|
|
87
|
+
throw new Error('output-style file has no YAML frontmatter');
|
|
88
|
+
let data;
|
|
89
|
+
try {
|
|
90
|
+
data = parseYaml(raw.slice(start, closing.start));
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
throw new Error(`output-style frontmatter is not valid YAML: ${String(error)}`, { cause: error });
|
|
94
|
+
}
|
|
95
|
+
if (typeof data !== 'object' || data === null || Array.isArray(data)) {
|
|
96
|
+
throw new Error('output-style frontmatter must be a map of keys');
|
|
97
|
+
}
|
|
98
|
+
const fields = data;
|
|
99
|
+
const description = typeof fields['description'] === 'string' && fields['description'].trim().length > 0
|
|
100
|
+
? fields['description'].trim()
|
|
101
|
+
: undefined;
|
|
102
|
+
if (description === undefined) {
|
|
103
|
+
throw new Error('output-style frontmatter requires a non-empty description');
|
|
104
|
+
}
|
|
105
|
+
const rawKeep = fields['keep-coding-instructions'];
|
|
106
|
+
const keepCodingInstructions = rawKeep === true || rawKeep === 'true'
|
|
107
|
+
? true
|
|
108
|
+
: rawKeep === false || rawKeep === 'false'
|
|
109
|
+
? false
|
|
110
|
+
: true;
|
|
111
|
+
const name = fileName.replace(/\.md$/i, '');
|
|
112
|
+
return {
|
|
113
|
+
name,
|
|
114
|
+
description,
|
|
115
|
+
prompt: raw.slice(closing.bodyStart).trim(),
|
|
116
|
+
builtin: false,
|
|
117
|
+
keepCodingInstructions,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Whether a directory entry is a markdown output-style file. */
|
|
121
|
+
function isMarkdown(entry) {
|
|
122
|
+
return entry.endsWith('.md');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Read every markdown output-style file across the given directories, in
|
|
126
|
+
* order, deduplicating by style name so a later directory overrides an earlier
|
|
127
|
+
* same-named style. Missing directories contribute nothing.
|
|
128
|
+
* @param dirs - directories to scan; later entries override earlier ones.
|
|
129
|
+
* @returns the loaded custom styles in directory order.
|
|
130
|
+
*/
|
|
131
|
+
export async function loadCustomStyles(dirs) {
|
|
132
|
+
const byName = new Map();
|
|
133
|
+
for (const dir of dirs) {
|
|
134
|
+
let entries;
|
|
135
|
+
try {
|
|
136
|
+
entries = await readdir(dir);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// A missing or transiently unreadable directory is an ordinary empty
|
|
140
|
+
// source, not a load failure.
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
for (const entry of entries.sort()) {
|
|
144
|
+
if (!isMarkdown(entry))
|
|
145
|
+
continue;
|
|
146
|
+
const style = parseCustomStyle(entry, await readFile(join(dir, entry), 'utf8'));
|
|
147
|
+
byName.set(style.name, style);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return [...byName.values()];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Assemble the selectable library: built-in styles first, then custom styles
|
|
154
|
+
* overlaid by name so a project- or user-authored style shadows a built-in.
|
|
155
|
+
* @param custom - the loaded custom styles.
|
|
156
|
+
* @returns a name-keyed, insertion-ordered library.
|
|
157
|
+
*/
|
|
158
|
+
export function buildStyleLibrary(custom) {
|
|
159
|
+
const library = new Map(BUILTIN_STYLES.map(style => [style.name, style]));
|
|
160
|
+
for (const style of custom)
|
|
161
|
+
library.set(style.name, style);
|
|
162
|
+
return library;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Render one style's contributed system-prompt section. The default style and
|
|
166
|
+
* any style with no prompt contribute nothing; a custom style that replaces
|
|
167
|
+
* the default coding instructions carries an explicit lead-in.
|
|
168
|
+
* @param style - the active style.
|
|
169
|
+
* @returns the model-visible section text, or `''` when nothing is contributed.
|
|
170
|
+
*/
|
|
171
|
+
export function styleSectionText(style) {
|
|
172
|
+
if (style.name === DEFAULT_OUTPUT_STYLE || style.prompt.length === 0)
|
|
173
|
+
return '';
|
|
174
|
+
if (style.keepCodingInstructions === false) {
|
|
175
|
+
return `${REPLACES_CODING_INSTRUCTIONS}\n\n${style.prompt}`;
|
|
176
|
+
}
|
|
177
|
+
return style.prompt;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAA;AAEzC,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA;AAoB7C,yEAAyE;AACzE,MAAM,iBAAiB,GAAgB;IACrC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,sDAAsD;IACnE,OAAO,EAAE,IAAI;IACb,sBAAsB,EAAE,IAAI;IAC5B,MAAM,EAAE;QACN,uHAAuH;QACvH,oNAAoN;KACrN,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAA;AAED,yEAAyE;AACzE,MAAM,cAAc,GAAgB;IAClC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,8DAA8D;IAC3E,OAAO,EAAE,IAAI;IACb,sBAAsB,EAAE,IAAI;IAC5B,MAAM,EAAE;QACN,0OAA0O;QAC1O,+PAA+P;KAChQ,CAAC,IAAI,CAAC,IAAI,CAAC;CACb,CAAA;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,EAAE,IAAI,EAAE,oBAAo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,EAAE,MAAM,CAAC,CAAC,CAAA;YAC/E,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAC9D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAA;IACzE,KAAK,MAAM,KAAK,IAAI,MAAM;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC1D,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAC/E,IAAI,KAAK,CAAC,sBAAsB,KAAK,KAAK,EAAE,CAAC;QAC3C,OAAO,GAAG,4BAA4B,OAAO,KAAK,CAAC,MAAM,EAAE,CAAA;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAA;AACrB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jianxx/dsh-cc-output-styles",
|
|
3
|
+
"description": "Claude Code-compatible output style selection for the DeepSeek Harness",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/jianxx/dsh-cc-plugins.git",
|
|
8
|
+
"directory": "packages/compat/cc-output-styles"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./invariant": {
|
|
17
|
+
"types": "./lib/invariant.d.ts",
|
|
18
|
+
"default": "./lib/invariant.js"
|
|
19
|
+
},
|
|
20
|
+
"./src/*": "./src/*",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"lib"
|
|
25
|
+
],
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@deepseek-ai/dsh-commands": ">=0.1.1-rc.2",
|
|
29
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2",
|
|
30
|
+
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2",
|
|
31
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.1.1-rc.2",
|
|
32
|
+
"@deepseek-ai/cordis": ">=0.1.1-rc.2",
|
|
33
|
+
"@deepseek-ai/dsh-home-paths": ">=0.1.1-rc.2",
|
|
34
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"yaml": "^2.4.2"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",
|
|
41
|
+
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
42
|
+
"@deepseek-ai/dsh-commands": "link:../../../../deepseek-harness/packages/interaction/commands",
|
|
43
|
+
"@deepseek-ai/dsh-invariants": "link:../../../../deepseek-harness/packages/runtime-diagnostics/invariants",
|
|
44
|
+
"@deepseek-ai/dsh-scope": "link:../../../../deepseek-harness/packages/core/scope",
|
|
45
|
+
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
46
|
+
"@deepseek-ai/dsh-settings": "link:../../../../deepseek-harness/packages/settings/settings",
|
|
47
|
+
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
48
|
+
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
49
|
+
"@deepseek-ai/dsh-home-paths": "link:../../../../deepseek-harness/packages/util/home-paths",
|
|
50
|
+
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
}
|
|
55
|
+
}
|