dsh-output-styles 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/LICENSE +201 -0
- package/README.es.md +197 -0
- package/README.ja.md +197 -0
- package/README.ko.md +197 -0
- package/README.md +197 -0
- package/README.zh.md +197 -0
- package/cordis.patch.yml +40 -0
- package/docs/VERIFICATION.zh.md +93 -0
- package/lib/client.js +83 -0
- package/lib/index.js +415 -0
- package/lib/invariant-LV6hQX5s.js +442 -0
- package/lib/invariant.js +2 -0
- package/lib/types/client/index.d.ts +30 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +13 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/config.d.ts +73 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/index.d.ts +31 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/invariant.d.ts +59 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/runtime.d.ts +144 -0
- package/lib/types/runtime.d.ts.map +1 -0
- package/lib/types/style-command.d.ts +68 -0
- package/lib/types/style-command.d.ts.map +1 -0
- package/lib/types/style-library.d.ts +78 -0
- package/lib/types/style-library.d.ts.map +1 -0
- package/lib/types/types.d.ts +78 -0
- package/lib/types/types.d.ts.map +1 -0
- package/package.json +138 -0
- package/src/client/index.ts +104 -0
- package/src/client/locales.ts +14 -0
- package/src/config.ts +110 -0
- package/src/index.ts +51 -0
- package/src/invariant.ts +144 -0
- package/src/runtime.ts +439 -0
- package/src/style-command.ts +89 -0
- package/src/style-library.ts +348 -0
- package/src/types.ts +86 -0
- package/styles/concise.md +17 -0
- package/styles/explanatory.md +14 -0
- package/styles/formal.md +14 -0
- package/styles/step-by-step.md +16 -0
package/README.ko.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🎨 dsh-output-styles
|
|
4
|
+
|
|
5
|
+
**DeepSeek Harness를 위한 Claude Code `outputStyles`** —— 런타임에, 세션별로, 영구적으로 모델의 출력 스타일을 전환합니다.
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
|
|
9
|
+
[](#)
|
|
10
|
+
[](#)
|
|
11
|
+
[](#)
|
|
12
|
+
|
|
13
|
+
🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
`/style concise` —— 이제부터 모든 답변이 간결해집니다. `/style step-by-step` —— 모델이 번호 매긴 단계로 설명합니다. `/style off` —— 프로젝트 기본값으로 복귀합니다. 세션당 명령 하나, 재시작에도 유지되며 agent loop 변경은 전혀 없습니다.
|
|
20
|
+
|
|
21
|
+
## ✨ 기능
|
|
22
|
+
|
|
23
|
+
| | |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 🗂️ **스타일 라이브러리** | 스타일당 Markdown 파일 하나(`styles/*.md`). frontmatter에 메타데이터를, 본문은 모델 지시문입니다. `name`은 기본값이 파일명이며 공백을 포함할 수 있습니다(`Diagrams first`). |
|
|
26
|
+
| ⌨️ **`/style` 명령** | 인자 없이 실행하면 스타일 목록(설명 포함) + 현재 선택을 표시합니다. `/style <name>`으로 전환하고 `/style off`로 프로젝트 기본값을 복원합니다. `/style` 뒤의 나머지 전체가 스타일 이름입니다. |
|
|
27
|
+
| 💾 **세션 범위 영속화** | 선택은 `output_style` 저장소 도메인에 sessionId를 키로 저장되어, 두 세션이 서로 간섭하지 않고 선택은 재시작 후에도 유지됩니다. |
|
|
28
|
+
| 🧩 **시스템 프롬프트 주입** | `systemPrompt.section()` 기여(order 90)가 매 조립마다 현재 세션의 스타일 본문을 주입합니다. 본문은 설정 가능한 예산으로 잘립니다. |
|
|
29
|
+
| 🎭 **Claude Code `keep-coding-instructions`** | `keep-coding-instructions: false`(Claude Code와 같은 기본값)인 스타일은 시스템 프롬프트 전체를 교체합니다 —— 소프트웨어 엔지니어링에서 벗어나는 스타일용입니다. |
|
|
30
|
+
| 📌 **강제 스타일** | `force: true`는 세션 선택을 무시하고 무조건 스타일을 적용합니다. 강제 스타일이 둘이면 로드가 실패합니다. |
|
|
31
|
+
| 🔁 **Claude Code 호환성** | `outputStyles` JSON 컬렉션(`{ name, description, prompt }`)을 로드하며, 단일 항목 또는 `settings.json` 스타일 배열을 지원합니다. 해석 불가 항목은 경고와 함께 건너뜁니다. |
|
|
32
|
+
| 📚 **계층화된 디렉터리** | `stylesDir`은 목록이며 뒤쪽 디렉터리가 앞쪽을 재정의합니다(내장 `styles/`가 최하위 계층, `includeBuiltins: false`로 비활성화). |
|
|
33
|
+
| 🔄 **핫 리로드** | 스타일 파일 변경이 재시작 없이 반영됩니다(`watchStyles: false`로 해제). |
|
|
34
|
+
| ⚙️ **설정과 프로젝트 기본값** | 한 번도 선택하지 않은 세션은 DSH 설정의 `output-style.style`, 그다음 `defaultStyle`로 폴백합니다. |
|
|
35
|
+
| 🖱️ **웹 피커** | `dsh.client` 항목(`dsh-output-styles/client`)이 호스트의 `/style` 명령을 프로젝션 기반 팝업 피커로 꾸밉니다. |
|
|
36
|
+
| 📊 **세션 프로젝션** | Web UI용 `style` 프로젝션(`{ options, currentValue }`)으로, 세션 로그에서 확정된 명령으로부터 폴딩됩니다. |
|
|
37
|
+
| 🧯 **명확한 실패, 깔끔한 건너뜀** | 잘못된 설정은 로드 시 예외를 던집니다. 잘못된 스타일 파일은 경고와 함께 건너뛰며 프로필을 깨뜨리지 않습니다. |
|
|
38
|
+
| 🌐 **5개 언어 문서** | EN · 中文 · 日本語 · 한국어 · Español. |
|
|
39
|
+
|
|
40
|
+
## 🚀 빠른 시작
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# 1. 설치 — 이 패키지는 번들 레이어이므로 한 명령으로
|
|
44
|
+
# storage + storage-json + storage-domain + 플러그인 행이 구성됩니다:
|
|
45
|
+
dsh plugin --profile <name> add dsh-output-styles
|
|
46
|
+
|
|
47
|
+
# 2. 부팅하고 전환
|
|
48
|
+
dsh --profile <name>
|
|
49
|
+
/style # → output style off, 그다음 스타일별 한 줄
|
|
50
|
+
/style concise # → switched to concise
|
|
51
|
+
/style Diagrams first # → 공백 포함 이름도 동작
|
|
52
|
+
/style off # → 프로젝트 기본값으로 복귀
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
이 레이어는 웹 프로필에 대해 멱등적입니다(id 기준 삽입이 동일 id 행을 대체). 웹 프로필은 `storage`를 기본으로 포함합니다. 웹 피커를 사용하려면 프로필에 클라이언트 행을 추가하세요:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
- id: output-styles-client
|
|
59
|
+
name: 'dsh-output-styles/client'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 🎬 데모
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
You > /style
|
|
66
|
+
output style off
|
|
67
|
+
concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
|
|
68
|
+
explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
|
|
69
|
+
formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
|
|
70
|
+
step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
|
|
71
|
+
|
|
72
|
+
You > /style concise
|
|
73
|
+
switched to concise
|
|
74
|
+
|
|
75
|
+
You > 한 문장으로만 자기소개해 주세요.
|
|
76
|
+
AI > 저는 DeepSeek Harness 플러그인 플랫폼에서 실행되고 deepseek-v4-pro 모델을 기반으로 하는 AI 코딩 에이전트입니다.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🧠 동작 방식
|
|
80
|
+
|
|
81
|
+
```mermaid
|
|
82
|
+
flowchart LR
|
|
83
|
+
U[/style concise 입력] --> C[명령 레지스트리]
|
|
84
|
+
C -->|command/run 기록| L[(세션 로그)]
|
|
85
|
+
C -->|put {style, source}| D[(output_style 도메인)]
|
|
86
|
+
D --> R[OutputStyleRuntime]
|
|
87
|
+
R -->|매 조립마다 본문 주입| S[systemPrompt 섹션 order 90]
|
|
88
|
+
S --> M[모델 요청]
|
|
89
|
+
M -->|전체 시스템 프롬프트| H[request/header 기록]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
모델이 보는 모든 것은 세션 로그에서 재구성할 수 있습니다 —— 새로운 세션 이벤트 타입도, agent-loop 변경도 없습니다. 스타일 이름은 `command/run`에서, 주입된 정확한 텍스트는 `request/header`에서 나오며, 출처 마커 `{ kind: 'plugin', plugin: 'dsh-output-styles' }`는 도메인 레코드에 남습니다. 스타일은 메인 대화에만 적용되며, 하위 에이전트 세션은 자체 프롬프트를 유지합니다(Claude Code와 일치).
|
|
93
|
+
|
|
94
|
+
## ⚙️ 설정
|
|
95
|
+
|
|
96
|
+
모든 조정 값은 검증된 Schemastery `Config` 필드입니다(잘못된 값은 로드 실패):
|
|
97
|
+
|
|
98
|
+
| 필드 | 기본값 | 의미 |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `stylesDir` | `[]` | 스타일 라이브러리 디렉터리. cwd 기준으로 해석되며 뒤쪽 항목이 앞쪽을 재정의합니다. `[]` = 내장 `styles/`만. 단순 문자열은 단일 디렉터리 목록입니다. |
|
|
101
|
+
| `maxStyleChars` | `4000` | 스타일 본문 예산(코드 포인트, ≥ 1). 더 긴 본문은 마커와 함께 잘립니다. |
|
|
102
|
+
| `defaultStyle` | `''` | 한 번도 선택하지 않은 세션(설정 기본값도 없음)에 적용할 스타일. `''` = 스타일 없음. |
|
|
103
|
+
| `compatJson` | `true` | Claude Code `outputStyles` JSON 항목(단일 객체 또는 배열)을 로드합니다. |
|
|
104
|
+
| `sectionOrder` | `90` | 주입 섹션의 순서(0 = persona, 100–199 = 도구 지침). |
|
|
105
|
+
| `truncationMarker` | `"\n\n[style truncated]"` | 잘린 지점에 추가되는 마커. |
|
|
106
|
+
| `includeBuiltins` | `true` | 패키지 내장 `styles/`를 최저 우선순위 계층으로 포함합니다. |
|
|
107
|
+
| `watchStyles` | `true` | 디스크에서 스타일 파일이 변경되면 라이브러리를 다시 로드합니다. |
|
|
108
|
+
|
|
109
|
+
## 📚 스타일 라이브러리
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary><code>styles/concise.md</code></summary>
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
---
|
|
116
|
+
name: concise
|
|
117
|
+
description: Terse, direct answers — minimal prose, no preamble.
|
|
118
|
+
whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
|
|
119
|
+
keep-coding-instructions: true
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
You are in the concise output style for this conversation.
|
|
123
|
+
- Lead with the direct answer; skip preamble, restatements, and filler.
|
|
124
|
+
- 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
</details>
|
|
128
|
+
|
|
129
|
+
frontmatter 필드:
|
|
130
|
+
|
|
131
|
+
| 필드 | 기본값 | 의미 |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `name` | 파일명 | 전환 대상. 문자, 숫자, 공백, 하이픈(선행/후행 공백 없음. `off`는 예약됨). |
|
|
134
|
+
| `description` | —(필수) | 목록과 피커에 표시되는 한 문장. |
|
|
135
|
+
| `whenToUse` | — | 목록에 덧붙이는 선택적 안내. |
|
|
136
|
+
| `keep-coding-instructions` | `false` | `true`면 하네스 프롬프트(정체성, persona, 도구 지침)를 유지하고, `false`면 완전히 교체합니다(Claude Code 의미론). |
|
|
137
|
+
| `force` | `false` | 세션 선택을 무시하고 무조건 적용합니다. 최대 한 스타일만 설정할 수 있습니다. |
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary>Claude Code <code>outputStyles</code> JSON(<code>compatJson: true</code>)</summary>
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{ "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
레거시 `settings.json` 배열(`[{ … }, { … }]`)은 그대로 로드되고, 잘못된 항목은 경고와 함께 건너뜁니다.
|
|
147
|
+
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
## ⌨️ 명령 레퍼런스
|
|
151
|
+
|
|
152
|
+
| 입력 | 결과 |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `/style` | 현재 선택 + 스타일별 한 줄(name — description) 나열 |
|
|
155
|
+
| `/style concise` | 전환(영구 기록), `switched to concise` |
|
|
156
|
+
| `/style Diagrams first` | 여러 단어 이름은 나머지 전체 |
|
|
157
|
+
| `/style off` | 프로젝트 기본값 복원(설정 기본값, 그다음 `defaultStyle`) |
|
|
158
|
+
| `/style nope` | `error: unknown output style "nope" (available: …)` |
|
|
159
|
+
|
|
160
|
+
## 🖱️ 웹 피커
|
|
161
|
+
|
|
162
|
+
`dsh.client` 항목은 호스트 `/style` 명령의 인자 없는 호출을 팝업 피커로 꾸밉니다: 「off」 행 + 라이브러리 스타일별 한 행(`description · whenToUse`), 활성 행이 표시됩니다. 선택하면 명령 Remote를 통해 `/style <name>`을 제출하므로, 모든 전환이 호스트의 영구적인 명령 수명 주기를 유지하고 `style` 프로젝션이 유일하게 표시되는 사실로 남습니다.
|
|
163
|
+
|
|
164
|
+
## 🔍 충돌 검사
|
|
165
|
+
|
|
166
|
+
개발 전 DSH 생태계를 조사했습니다(2026-08 스냅샷): [topic:dsh-plugin](https://github.com/topics/dsh-plugin) 아래 `style`/`output-style` 저장소 없음, 4대 [awesome 목록](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)에 output-style 카테고리 없음, [dsh-hub 카탈로그](https://github.com/omdsh-dev/dsh-hub-workshop)에도 항목 없음. 가장 가까운 이웃인 [dsh-soul-md](https://github.com/Scorp1o117/dsh-soul-md)(persona)와 [dsh-claude-marketplace](https://github.com/ben7am1n/dsh-claude-marketplace)(출력 스타일을 명시적으로 v0.2+로 연기)은 인접하지만 충돌하지 않습니다.
|
|
167
|
+
|
|
168
|
+
## 🆚 Claude Code와의 차이
|
|
169
|
+
|
|
170
|
+
| | Claude Code | dsh-output-styles |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| 스타일 파일 | 사용자/프로젝트/관리 계층의 `.claude/output-styles` | `stylesDir` 디렉터리 + 내장 `styles/`, 뒤쪽 디렉터리가 우선 |
|
|
173
|
+
| 사용자 정의 스타일 | Markdown, frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | 동일 필드(`force` = `force-for-plugin`) + `whenToUse` |
|
|
174
|
+
| 레거시 JSON | `settings.json`의 `outputStyles` 배열 | 그대로 로드(`compatJson: true`) |
|
|
175
|
+
| 적용 시점 | `/clear` 후 또는 새 세션 | 즉시 — 시스템 프롬프트가 요청마다 재조립 |
|
|
176
|
+
| 하위 에이전트 | 스타일 미적용 | 동일 — 하위 에이전트 세션은 자체 프롬프트 유지 |
|
|
177
|
+
| 전환 | `/config` 메뉴 또는 `outputStyle` 설정(`/output-style` 명령은 v2.1.91에서 제거) | `/style` 명령 + 웹 피커 + 설정 `output-style.style` |
|
|
178
|
+
|
|
179
|
+
## 🧪 개발
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
pnpm install
|
|
183
|
+
pnpm run typecheck # 두 tsc 프로젝트
|
|
184
|
+
pnpm test # vitest — 87 테스트
|
|
185
|
+
pnpm run build # lib/ 산출물(호스트 + 클라이언트 번들)
|
|
186
|
+
pnpm pack # dsh plugin add용 tarball
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
구조는 [omdsh-dev/plugin-template](https://github.com/omdsh-dev/plugin-template)를 따릅니다: `src/index.ts`(플러그인 메타데이터), `src/config.ts`(스키마), `src/runtime.ts`(런타임 서비스 + 활성화), `src/invariant.ts`(불변식), `src/client/`(웹 피커), `styles/`(내장 스타일).
|
|
190
|
+
|
|
191
|
+
## 📄 라이선스
|
|
192
|
+
|
|
193
|
+
[Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
<sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🎨 dsh-output-styles
|
|
4
|
+
|
|
5
|
+
**Claude Code `outputStyles` for DeepSeek Harness** — switch the model's output style at runtime, per session, durably.
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
|
|
9
|
+
[](#)
|
|
10
|
+
[](#)
|
|
11
|
+
[](#)
|
|
12
|
+
|
|
13
|
+
🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
`/style concise` — and every reply from now on is terse. `/style step-by-step` — and the model narrates numbered steps. `/style off` — back to the project default. One command per session, persisted across restarts, zero changes to the agent loop.
|
|
20
|
+
|
|
21
|
+
## ✨ Features
|
|
22
|
+
|
|
23
|
+
| | |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 🗂️ **Style library** | One Markdown file per style (`styles/*.md`); frontmatter for metadata, body = the model directive. `name` defaults to the file name and may contain spaces (`Diagrams first`). |
|
|
26
|
+
| ⌨️ **`/style` command** | No argument lists styles (with descriptions) + current selection; `/style <name>` switches; `/style off` restores the project default. The whole remainder after `/style` is the style name. |
|
|
27
|
+
| 💾 **Session-scoped persistence** | The choice lives in the `output_style` storage domain, keyed by sessionId — two sessions never interfere, and the choice survives restarts. |
|
|
28
|
+
| 🧩 **System-prompt injection** | A `systemPrompt.section()` contribution (order 90) injects the current session's style body at every assembly; bodies are truncated at a configurable budget. |
|
|
29
|
+
| 🎭 **Claude Code `keep-coding-instructions`** | Styles with `keep-coding-instructions: false` (the default, like Claude Code) replace the whole system prompt — for styles that leave software engineering behind. |
|
|
30
|
+
| 📌 **Forced styles** | `force: true` applies a style unconditionally, overriding any session selection; two forced styles fail the load. |
|
|
31
|
+
| 🔁 **Claude Code compatibility** | Loads `outputStyles` JSON collections (`{ name, description, prompt }`), single entries or `settings.json`-style arrays; unparseable entries are skipped with a warning. |
|
|
32
|
+
| 📚 **Layered directories** | `stylesDir` is a list; later directories override earlier ones (bundled `styles/` is the lowest layer, disable with `includeBuiltins: false`). |
|
|
33
|
+
| 🔄 **Hot reload** | Style-file changes are picked up without restarting (`watchStyles: false` to opt out). |
|
|
34
|
+
| ⚙️ **Project default over settings** | Sessions that never selected one fall back to `output-style.style` from the DSH settings seam, then to `defaultStyle`. |
|
|
35
|
+
| 🖱️ **Web picker** | A `dsh.client` entry (`dsh-output-styles/client`) decorates the host `/style` command with a projection-backed popup picker. |
|
|
36
|
+
| 📊 **Session projection** | A `style` projection (`{ options, currentValue }`) for the Web UI, folded from settled commands in the session log. |
|
|
37
|
+
| 🧯 **Fail loud, skip cleanly** | Misconfiguration throws at load; a bad style file is skipped with a warning and never breaks the profile. |
|
|
38
|
+
| 🌐 **Five-language docs** | EN · 中文 · 日本語 · 한국어 · Español. |
|
|
39
|
+
|
|
40
|
+
## 🚀 Quick start
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# 1. Install — the package is a bundle layer, so one command composes
|
|
44
|
+
# storage + storage-json + storage-domain + the plugin row:
|
|
45
|
+
dsh plugin --profile <name> add dsh-output-styles
|
|
46
|
+
|
|
47
|
+
# 2. Boot and switch
|
|
48
|
+
dsh --profile <name>
|
|
49
|
+
/style # → output style off, then one line per style
|
|
50
|
+
/style concise # → switched to concise
|
|
51
|
+
/style Diagrams first # → names with spaces work too
|
|
52
|
+
/style off # → back to the project default
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The layer is idempotent over web profiles (insert-by-id replaces same-id rows), which compose `storage` in box. For the Web picker, add the client row to the profile:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
- id: output-styles-client
|
|
59
|
+
name: 'dsh-output-styles/client'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 🎬 Demo
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
You > /style
|
|
66
|
+
output style off
|
|
67
|
+
concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
|
|
68
|
+
explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
|
|
69
|
+
formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
|
|
70
|
+
step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
|
|
71
|
+
|
|
72
|
+
You > /style concise
|
|
73
|
+
switched to concise
|
|
74
|
+
|
|
75
|
+
You > 请只用一句话介绍你自己。
|
|
76
|
+
AI > 我是运行在 DeepSeek Harness 插件化平台上、基于 deepseek-v4-pro 模型的 AI 编码代理。
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🧠 How it works
|
|
80
|
+
|
|
81
|
+
```mermaid
|
|
82
|
+
flowchart LR
|
|
83
|
+
U[You type /style concise] --> C[command registry]
|
|
84
|
+
C -->|command/run logged| L[(session log)]
|
|
85
|
+
C -->|put {style, source}| D[(output_style domain)]
|
|
86
|
+
D --> R[OutputStyleRuntime]
|
|
87
|
+
R -->|body at every assembly| S[systemPrompt section order 90]
|
|
88
|
+
S --> M[Model request]
|
|
89
|
+
M -->|full system prompt| H[request/header logged]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Everything the model sees is reconstructable from the session log — no new session event type, no agent-loop changes. The style name comes from `command/run`, the exact injected text from `request/header`, and the provenance marker `{ kind: 'plugin', plugin: 'dsh-output-styles' }` rides in the domain record. Styles apply to the main conversation only; subagent sessions keep their own prompts (matching Claude Code).
|
|
93
|
+
|
|
94
|
+
## ⚙️ Configuration
|
|
95
|
+
|
|
96
|
+
Every tunable is a validated Schemastery `Config` field (invalid values fail the load):
|
|
97
|
+
|
|
98
|
+
| Field | Default | Meaning |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `stylesDir` | `[]` | Style-library directories, resolved against cwd; later entries override earlier ones. `[]` = the bundled `styles/` only. A bare string is a single-directory list. |
|
|
101
|
+
| `maxStyleChars` | `4000` | Style-body budget (code points, ≥ 1); longer bodies are truncated with a marker. |
|
|
102
|
+
| `defaultStyle` | `''` | Style for sessions that never selected one (and no settings default exists); `''` = no style. |
|
|
103
|
+
| `compatJson` | `true` | Load Claude Code `outputStyles` JSON entries (single objects or arrays). |
|
|
104
|
+
| `sectionOrder` | `90` | Order of the injected section (0 = persona, 100–199 = tool guidance). |
|
|
105
|
+
| `truncationMarker` | `"\n\n[style truncated]"` | Marker appended at the truncation point. |
|
|
106
|
+
| `includeBuiltins` | `true` | Include the package's bundled `styles/` as the lowest-priority layer. |
|
|
107
|
+
| `watchStyles` | `true` | Reload the library when a style file changes on disk. |
|
|
108
|
+
|
|
109
|
+
## 📚 Style library
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary><code>styles/concise.md</code></summary>
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
---
|
|
116
|
+
name: concise
|
|
117
|
+
description: Terse, direct answers — minimal prose, no preamble.
|
|
118
|
+
whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
|
|
119
|
+
keep-coding-instructions: true
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
You are in the concise output style for this conversation.
|
|
123
|
+
- Lead with the direct answer; skip preamble, restatements, and filler.
|
|
124
|
+
- 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
</details>
|
|
128
|
+
|
|
129
|
+
Frontmatter fields:
|
|
130
|
+
|
|
131
|
+
| Field | Default | Meaning |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `name` | file name | Switch target; letters, digits, spaces, and hyphens (no leading/trailing space; `off` is reserved). |
|
|
134
|
+
| `description` | — (required) | One sentence shown in listings and the picker. |
|
|
135
|
+
| `whenToUse` | — | Optional guidance appended to listings. |
|
|
136
|
+
| `keep-coding-instructions` | `false` | Keep the harness prompt (identity, persona, tool guidance) when `true`; replace it entirely when `false` (Claude Code semantics). |
|
|
137
|
+
| `force` | `false` | Apply unconditionally, overriding any session selection; at most one style may set it. |
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary>Claude Code <code>outputStyles</code> JSON (<code>compatJson: true</code>)</summary>
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{ "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Legacy `settings.json` arrays (`[{ … }, { … }]`) load as-is; bad entries are skipped with a warning.
|
|
147
|
+
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
## ⌨️ Command reference
|
|
151
|
+
|
|
152
|
+
| Input | Outcome |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `/style` | List current selection + one line per style (name — description) |
|
|
155
|
+
| `/style concise` | Switch (durable write), `switched to concise` |
|
|
156
|
+
| `/style Diagrams first` | Multi-word names are the whole remainder |
|
|
157
|
+
| `/style off` | Restore the project default (settings default, then `defaultStyle`) |
|
|
158
|
+
| `/style nope` | `error: unknown output style "nope" (available: …)` |
|
|
159
|
+
|
|
160
|
+
## 🖱️ Web picker
|
|
161
|
+
|
|
162
|
+
The `dsh.client` entry decorates the host `/style` command's bare invocation with a popup picker: an "off" row plus one row per library style (`description · whenToUse`), the active row marked. Picking submits `/style <name>` through the command Remote, so every switch keeps the host's durable command lifecycle and the `style` projection stays the single displayed fact.
|
|
163
|
+
|
|
164
|
+
## 🔍 Conflict check
|
|
165
|
+
|
|
166
|
+
Screened against the DSH ecosystem before development (2026-08 snapshot): no `style`/`output-style` repository under [topic:dsh-plugin](https://github.com/topics/dsh-plugin), no output-style category in the four major [awesome lists](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin), and no entry in the [dsh-hub catalog](https://github.com/omdsh-dev/dsh-hub-workshop). The closest neighbors — [dsh-soul-md](https://github.com/Scorp1o117/dsh-soul-md) (persona) and [dsh-claude-marketplace](https://github.com/ben7am1n/dsh-claude-marketplace) (output styles explicitly deferred to v0.2+) — are adjacent, not conflicting.
|
|
167
|
+
|
|
168
|
+
## 🆚 Differences from Claude Code
|
|
169
|
+
|
|
170
|
+
| | Claude Code | dsh-output-styles |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| Style files | `.claude/output-styles` at user/project/managed levels | `stylesDir` directories + bundled `styles/`, later directory wins |
|
|
173
|
+
| Custom styles | Markdown, frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | Same fields (`force` = `force-for-plugin`) + `whenToUse` |
|
|
174
|
+
| Legacy JSON | `outputStyles` array in `settings.json` | Loaded verbatim (`compatJson: true`) |
|
|
175
|
+
| Taking effect | After `/clear` or a new session | Immediately — the system prompt re-assembles per request |
|
|
176
|
+
| Subagents | Styles do not apply | Same — subagent sessions keep their own prompts |
|
|
177
|
+
| Switching | `/config` menu or `outputStyle` setting (the `/output-style` command was removed in v2.1.91) | `/style` command + Web picker + settings `output-style.style` |
|
|
178
|
+
|
|
179
|
+
## 🧪 Development
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
pnpm install
|
|
183
|
+
pnpm run typecheck # both tsc projects
|
|
184
|
+
pnpm test # vitest — 87 tests
|
|
185
|
+
pnpm run build # lib/ artifacts (host + client bundles)
|
|
186
|
+
pnpm pack # tarball for dsh plugin add
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Structure follows the [omdsh-dev/plugin-template](https://github.com/omdsh-dev/plugin-template): `src/index.ts` (plugin metadata), `src/config.ts` (schema), `src/runtime.ts` (runtime service + activation), `src/invariant.ts` (invariants), `src/client/` (Web picker), `styles/` (built-ins).
|
|
190
|
+
|
|
191
|
+
## 📄 License
|
|
192
|
+
|
|
193
|
+
[Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
<sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🎨 dsh-output-styles
|
|
4
|
+
|
|
5
|
+
**DeepSeek Harness 版的 Claude Code `outputStyles`** —— 在运行时、按会话、持久地切换模型输出风格。
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
|
|
9
|
+
[](#)
|
|
10
|
+
[](#)
|
|
11
|
+
[](#)
|
|
12
|
+
|
|
13
|
+
🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
`/style concise` —— 从此之后每条回复都简洁。`/style step-by-step` —— 模型按编号步骤叙述推理。`/style off` —— 回到项目默认。每会话一条命令、重启后依然生效、零 agent-loop 改动。
|
|
20
|
+
|
|
21
|
+
## ✨ 特性
|
|
22
|
+
|
|
23
|
+
| | |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 🗂️ **风格库** | 每个风格一个 Markdown 文件(`styles/*.md`);frontmatter 存元数据,正文即模型指令。`name` 缺省继承文件名,且可含空格(如 `Diagrams first`)。 |
|
|
26
|
+
| ⌨️ **`/style` 命令** | 无参列出全部风格(含描述)与当前选择;`/style <name>` 切换;`/style off` 恢复项目默认。`/style` 之后的整段文本即风格名。 |
|
|
27
|
+
| 💾 **会话级持久化** | 选择保存在 `output_style` 存储域,按 sessionId 隔离——会话互不干扰,重启后保留。 |
|
|
28
|
+
| 🧩 **系统提示注入** | `systemPrompt.section()` 贡献(order 90)在每次组装时注入当前会话的风格正文;正文按可配置预算截断。 |
|
|
29
|
+
| 🎭 **Claude Code `keep-coding-instructions`** | `keep-coding-instructions: false`(缺省,与 Claude Code 一致)的风格**替换整个系统提示**——适合彻底离开软件工程的风格。 |
|
|
30
|
+
| 📌 **强制风格** | `force: true` 无条件生效,覆盖任何会话选择;两个强制风格会在加载期报错。 |
|
|
31
|
+
| 🔁 **Claude Code 兼容** | 加载 `outputStyles` JSON 集合(`{ name, description, prompt }`),支持单对象与 `settings.json` 式数组;坏条目逐个跳过并警告。 |
|
|
32
|
+
| 📚 **目录分层** | `stylesDir` 是目录列表,后者覆盖前者(内置 `styles/` 是最低层,`includeBuiltins: false` 可排除)。 |
|
|
33
|
+
| 🔄 **热加载** | 风格文件改动即时生效,无需重启(`watchStyles: false` 可关闭)。 |
|
|
34
|
+
| ⚙️ **settings 项目默认** | 从未选择过的会话依次回落到 settings 的 `output-style.style`、再回落 `defaultStyle`。 |
|
|
35
|
+
| 🖱️ **Web 选择器** | `dsh.client` 入口(`dsh-output-styles/client`)把宿主 `/style` 命令装饰成投影驱动的弹窗选择器。 |
|
|
36
|
+
| 📊 **会话投影** | `style` 投影(`{ options, currentValue }`)供 Web UI 使用,按会话日志中**已成功落定**的命令折叠。 |
|
|
37
|
+
| 🧯 **失效即响、坏件干净跳过** | 配置错误加载期抛错;坏风格文件跳过并警告,绝不拖垮 profile。 |
|
|
38
|
+
| 🌐 **五语文档** | EN · 中文 · 日本語 · 한국어 · Español。 |
|
|
39
|
+
|
|
40
|
+
## 🚀 快速开始
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
# 1. 安装——本包是 bundle 补丁层,一条命令即组合好
|
|
44
|
+
# storage + storage-json + storage-domain + 插件行:
|
|
45
|
+
dsh plugin --profile <name> add dsh-output-styles
|
|
46
|
+
|
|
47
|
+
# 2. 启动并切换
|
|
48
|
+
dsh --profile <name>
|
|
49
|
+
/style # → 当前状态 + 每风格一行
|
|
50
|
+
/style concise # → switched to concise
|
|
51
|
+
/style Diagrams first # → 含空格的名字同样可用
|
|
52
|
+
/style off # → 回到项目默认
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
该补丁层对 web profile 幂等(按 id 插入会替换同 id 行),web profile 本就内建 storage 三行。使用 Web 选择器时,向 profile 添加客户端行:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
- id: output-styles-client
|
|
59
|
+
name: 'dsh-output-styles/client'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 🎬 演示
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
You > /style
|
|
66
|
+
output style off
|
|
67
|
+
concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
|
|
68
|
+
explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
|
|
69
|
+
formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
|
|
70
|
+
step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
|
|
71
|
+
|
|
72
|
+
You > /style concise
|
|
73
|
+
switched to concise
|
|
74
|
+
|
|
75
|
+
You > 请只用一句话介绍你自己。
|
|
76
|
+
AI > 我是运行在 DeepSeek Harness 插件化平台上、基于 deepseek-v4-pro 模型的 AI 编码代理。
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🧠 工作原理
|
|
80
|
+
|
|
81
|
+
```mermaid
|
|
82
|
+
flowchart LR
|
|
83
|
+
U[输入 /style concise] --> C[命令注册表]
|
|
84
|
+
C -->|记录 command/run| L[(会话日志)]
|
|
85
|
+
C -->|写入 {style, source}| D[(output_style 域)]
|
|
86
|
+
D --> R[OutputStyleRuntime]
|
|
87
|
+
R -->|每次组装注入正文| S[systemPrompt 节 order 90]
|
|
88
|
+
S --> M[模型请求]
|
|
89
|
+
M -->|完整系统提示| H[记录 request/header]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
模型所见的一切都能从会话日志重建——无需新增会话事件类型、不改 agent-loop。风格名来自 `command/run`,注入的确切文本来自 `request/header`,来源标记 `{ kind: 'plugin', plugin: 'dsh-output-styles' }` 随域记录存储。风格只作用于主会话;子代理会话保持各自的提示(与 Claude Code 一致)。
|
|
93
|
+
|
|
94
|
+
## ⚙️ 配置
|
|
95
|
+
|
|
96
|
+
所有可调项都是带校验的 Schemastery `Config` 字段(非法值加载即失败):
|
|
97
|
+
|
|
98
|
+
| 字段 | 默认 | 含义 |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `stylesDir` | `[]` | 风格库目录列表,相对 cwd 解析;后者覆盖前者。`[]` = 仅内置 `styles/`。裸字符串视为单目录列表。 |
|
|
101
|
+
| `maxStyleChars` | `4000` | 风格正文预算(码点,≥ 1);超长正文截断并加标记。 |
|
|
102
|
+
| `defaultStyle` | `''` | 从未选择过的会话(且无 settings 默认)使用的风格;`''` = 不注入。 |
|
|
103
|
+
| `compatJson` | `true` | 加载 Claude Code `outputStyles` JSON 条目(单对象或数组)。 |
|
|
104
|
+
| `sectionOrder` | `90` | 注入节顺序(0 = persona,100–199 = 工具指引)。 |
|
|
105
|
+
| `truncationMarker` | `"\n\n[style truncated]"` | 截断点追加的标记。 |
|
|
106
|
+
| `includeBuiltins` | `true` | 将包内置 `styles/` 作为最低优先级层纳入。 |
|
|
107
|
+
| `watchStyles` | `true` | 风格文件在磁盘上变化时重载风格库。 |
|
|
108
|
+
|
|
109
|
+
## 📚 风格库
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary><code>styles/concise.md</code></summary>
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
---
|
|
116
|
+
name: concise
|
|
117
|
+
description: Terse, direct answers — minimal prose, no preamble.
|
|
118
|
+
whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
|
|
119
|
+
keep-coding-instructions: true
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
You are in the concise output style for this conversation.
|
|
123
|
+
- Lead with the direct answer; skip preamble, restatements, and filler.
|
|
124
|
+
- 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
</details>
|
|
128
|
+
|
|
129
|
+
frontmatter 字段:
|
|
130
|
+
|
|
131
|
+
| 字段 | 默认 | 含义 |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `name` | 文件名 | 切换目标;字母、数字、空格、连字符(首尾无空白;`off` 为保留字)。 |
|
|
134
|
+
| `description` | ——(必填) | 列表与选择器里展示的一句话。 |
|
|
135
|
+
| `whenToUse` | —— | 可选适用场景说明,追加到列表。 |
|
|
136
|
+
| `keep-coding-instructions` | `false` | `true` 保留宿主提示(身份、persona、工具指引);`false` 整体替换(Claude Code 语义)。 |
|
|
137
|
+
| `force` | `false` | 无条件生效,覆盖会话选择;最多一个风格可设置。 |
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary>Claude Code <code>outputStyles</code> JSON(<code>compatJson: true</code>)</summary>
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{ "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
旧版 `settings.json` 的数组形式(`[{ … }, { … }]`)原样加载;坏条目逐个跳过并警告。
|
|
147
|
+
|
|
148
|
+
</details>
|
|
149
|
+
|
|
150
|
+
## ⌨️ 命令参考
|
|
151
|
+
|
|
152
|
+
| 输入 | 结果 |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `/style` | 列出当前选择 + 每风格一行(名称 — 描述) |
|
|
155
|
+
| `/style concise` | 切换(持久写入),`switched to concise` |
|
|
156
|
+
| `/style Diagrams first` | 含空格的风格名 = `/style` 后的整段文本 |
|
|
157
|
+
| `/style off` | 恢复项目默认(先 settings 默认,后 `defaultStyle`) |
|
|
158
|
+
| `/style nope` | `error: unknown output style "nope" (available: …)` |
|
|
159
|
+
|
|
160
|
+
## 🖱️ Web 选择器
|
|
161
|
+
|
|
162
|
+
`dsh.client` 入口把宿主 `/style` 命令的裸调用装饰成弹窗选择器:「off」行 + 每风格一行(`描述 · 适用场景`),当前行高亮。选中即通过命令 Remote 提交 `/style <name>`,因此每次切换都保留宿主的持久命令生命周期,`style` 投影始终是唯一展示事实。
|
|
163
|
+
|
|
164
|
+
## 🔍 生态冲突检查
|
|
165
|
+
|
|
166
|
+
开发前对 DSH 生态做了筛查(2026-08 快照):[topic:dsh-plugin](https://github.com/topics/dsh-plugin) 下没有 `style`/`output-style` 仓库,四大 [awesome 列表](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 没有 output-style 分类,[dsh-hub 目录](https://github.com/omdsh-dev/dsh-hub-workshop) 亦无条目。最接近的邻居——[dsh-soul-md](https://github.com/Scorp1o117/dsh-soul-md)(persona)与 [dsh-claude-marketplace](https://github.com/ben7am1n/dsh-claude-marketplace)(明确将输出风格推迟到 v0.2+)——相邻而不冲突。
|
|
167
|
+
|
|
168
|
+
## 🆚 与 Claude Code 的差异
|
|
169
|
+
|
|
170
|
+
| | Claude Code | dsh-output-styles |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| 风格文件 | 用户/项目/托管层级的 `.claude/output-styles` | `stylesDir` 目录 + 内置 `styles/`,后目录胜出 |
|
|
173
|
+
| 自定义风格 | Markdown,frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | 同字段(`force` 对应 `force-for-plugin`)+ `whenToUse` |
|
|
174
|
+
| 旧版 JSON | `settings.json` 里的 `outputStyles` 数组 | 原样加载(`compatJson: true`) |
|
|
175
|
+
| 生效时机 | `/clear` 或新会话后 | 立即生效——系统提示每次请求重组 |
|
|
176
|
+
| 子代理 | 风格不适用 | 一致——子代理会话保持各自提示 |
|
|
177
|
+
| 切换方式 | `/config` 菜单或 `outputStyle` 设置(`/output-style` 命令已在 v2.1.91 移除) | `/style` 命令 + Web 选择器 + settings `output-style.style` |
|
|
178
|
+
|
|
179
|
+
## 🧪 开发
|
|
180
|
+
|
|
181
|
+
```sh
|
|
182
|
+
pnpm install
|
|
183
|
+
pnpm run typecheck # 两个 tsc 工程
|
|
184
|
+
pnpm test # vitest —— 87 个测试
|
|
185
|
+
pnpm run build # lib/ 产物(宿主 + 客户端两个 bundle)
|
|
186
|
+
pnpm pack # 供 dsh plugin add 使用的 tarball
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
结构遵循 [omdsh-dev/plugin-template](https://github.com/omdsh-dev/plugin-template):`src/index.ts`(插件元数据)、`src/config.ts`(schema)、`src/runtime.ts`(运行时服务与激活)、`src/invariant.ts`(不变量)、`src/client/`(Web 选择器)、`styles/`(内置风格)。
|
|
190
|
+
|
|
191
|
+
## 📄 License
|
|
192
|
+
|
|
193
|
+
[Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
<sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Patch layer for `dsh-output-styles`, declared by the package's
|
|
2
|
+
# `dsh.bundle.patch` manifest and also usable by hand with `--patch`.
|
|
3
|
+
#
|
|
4
|
+
# Inserting rows by id replaces any same-id row already in the profile, so
|
|
5
|
+
# the layer is safe on top of a web profile (which composes storage in box)
|
|
6
|
+
# and completes a bare headless profile.
|
|
7
|
+
#
|
|
8
|
+
# The plugin injects `storageDomain`; a headless profile has none of the
|
|
9
|
+
# storage rows, so the layer brings the routed kv backend along.
|
|
10
|
+
- insert:
|
|
11
|
+
- id: storage
|
|
12
|
+
name: '@deepseek-ai/dsh-storage'
|
|
13
|
+
- id: storage-json
|
|
14
|
+
name: '@deepseek-ai/dsh-storage-json'
|
|
15
|
+
- id: storage-domain
|
|
16
|
+
name: '@deepseek-ai/dsh-storage-domain'
|
|
17
|
+
- id: output-styles
|
|
18
|
+
name: 'dsh-output-styles'
|
|
19
|
+
# config: # schema defaults shown for reference
|
|
20
|
+
# stylesDir: [] # [] = bundled styles/ only (lowest priority)
|
|
21
|
+
# maxStyleChars: 4000
|
|
22
|
+
# defaultStyle: '' # '' = new sessions get no style
|
|
23
|
+
# compatJson: true
|
|
24
|
+
# sectionOrder: 90
|
|
25
|
+
# truncationMarker: "\n\n[style truncated]"
|
|
26
|
+
# includeBuiltins: true
|
|
27
|
+
# watchStyles: true
|
|
28
|
+
|
|
29
|
+
# Optional invariant companion (envelope-level checks). Only for profiles
|
|
30
|
+
# that DISABLE the main row above: the main plugin already registers
|
|
31
|
+
# library-aware checks when an `invariants` service is composed, and the
|
|
32
|
+
# host registry accepts one registrant per package name.
|
|
33
|
+
# - id: output-styles-invariant
|
|
34
|
+
# name: 'dsh-output-styles/invariant'
|
|
35
|
+
|
|
36
|
+
# Optional Web picker (browser half). Only for web profiles whose client
|
|
37
|
+
# bundle composes the client runtime services; headless profiles must not
|
|
38
|
+
# enable this row.
|
|
39
|
+
# - id: output-styles-client
|
|
40
|
+
# name: 'dsh-output-styles/client'
|