dsh-output-styles 0.4.0 → 0.4.2

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.
@@ -12,7 +12,7 @@
12
12
  * @module dsh-output-styles/export
13
13
  */
14
14
  import type { SessionEvent } from '@deepseek-ai/dsh-session';
15
- import type { RendererRegistry, RenderedText } from './renderers.ts';
15
+ import type { RendererRegistry, RenderedText } from './renderers.js';
16
16
  /** One exported conversation line. */
17
17
  export interface ExportLine {
18
18
  /** Speaker role: 'user', 'assistant', or 'tool'. */
@@ -72,5 +72,5 @@ export declare function toHtml(lines: readonly ExportLine[]): string;
72
72
  * @param now - exportedAt timestamp (injected for deterministic tests).
73
73
  * @returns the complete export document.
74
74
  */
75
- export declare function renderExport(registry: RendererRegistry, lines: readonly ExportLine[], format: 'markdown' | 'html', rules: readonly import('./renderers.ts').StyleRule[], now?: Date): ExportDocument;
75
+ export declare function renderExport(registry: RendererRegistry, lines: readonly ExportLine[], format: 'markdown' | 'html', rules: readonly import('./renderers.js').StyleRule[], now?: Date): ExportDocument;
76
76
  //# sourceMappingURL=export.d.ts.map
@@ -16,16 +16,16 @@ export declare const name = "dsh-output-styles";
16
16
  * semantics), instead of racing a parallel mount.
17
17
  */
18
18
  export declare const inject: string[];
19
- export { Config, resolveConfig } from './config.ts';
20
- export type { ResolvedConfig } from './config.ts';
21
- export { apply, DEFAULT_STYLES_DIR, OutputStyleRuntime, STYLE_SECTION_NAME } from './runtime.ts';
22
- export { applyStyleEvent, EMPTY_STYLE_STATE, parseStyleInput, STYLE_COMMAND, } from './style-command.ts';
23
- export type { StyleFoldState, StyleInput } from './style-command.ts';
24
- export { isValidStyleName, loadStyleLibrary, STYLE_NAME_RE, truncateStyle, } from './style-library.ts';
25
- export type { OutputStyle } from './style-library.ts';
26
- export { OFF, OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleSelectionSchema, styleSelectionViewSchema, } from './types.ts';
27
- export type { StyleOption, StyleSelection, StyleSelectionView } from './types.ts';
28
- export { installInvariant, PACKAGE_NAME } from './invariant.ts';
29
- export type { InvariantFacts, InvariantInstaller, InvariantRegistry } from './invariant.ts';
30
- export type * from './types.ts';
19
+ export { Config, resolveConfig } from './config.js';
20
+ export type { ResolvedConfig } from './config.js';
21
+ export { apply, DEFAULT_STYLES_DIR, OutputStyleRuntime, STYLE_SECTION_NAME } from './runtime.js';
22
+ export { applyStyleEvent, EMPTY_STYLE_STATE, parseStyleInput, STYLE_COMMAND, } from './style-command.js';
23
+ export type { StyleFoldState, StyleInput } from './style-command.js';
24
+ export { isValidStyleName, loadStyleLibrary, STYLE_NAME_RE, truncateStyle, } from './style-library.js';
25
+ export type { OutputStyle } from './style-library.js';
26
+ export { OFF, OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleSelectionSchema, styleSelectionViewSchema, } from './types.js';
27
+ export type { StyleOption, StyleSelection, StyleSelectionView } from './types.js';
28
+ export { installInvariant, PACKAGE_NAME } from './invariant.js';
29
+ export type { InvariantFacts, InvariantInstaller, InvariantRegistry } from './invariant.js';
30
+ export type * from './types.js';
31
31
  //# sourceMappingURL=index.d.ts.map
@@ -10,9 +10,9 @@
10
10
  import type { Context } from '@deepseek-ai/cordis';
11
11
  import type { Session, SessionId } from '@deepseek-ai/dsh-session';
12
12
  import type { Domain } from '@deepseek-ai/dsh-storage-domain';
13
- import { type Config } from './config.ts';
14
- import { type OutputStyle } from './style-library.ts';
15
- import { OUTPUT_STYLE_DOMAIN, type StyleSelection } from './types.ts';
13
+ import { type Config } from './config.js';
14
+ import { type OutputStyle } from './style-library.js';
15
+ import { OUTPUT_STYLE_DOMAIN, type StyleSelection } from './types.js';
16
16
  /** Bundled style-library directory (package `styles/`), the lowest-priority `stylesDir` entry. */
17
17
  export declare const DEFAULT_STYLES_DIR: string;
18
18
  /** Prompt-section name; a fixed registry key a scoped composition could shadow. */
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.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AAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAmBD;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+QvE;AAED,mCAAmC;AACnC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAA;AAErG,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,CAkB/D"}
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { SessionId } from '@deepseek-ai/dsh-session';
11
11
  import { z as zod } from 'zod';
12
- import type { OutputRenderer, RenderContext, RenderedText } from './renderers.ts';
12
+ import type { OutputRenderer, RenderContext, RenderedText } from './renderers.js';
13
13
  /** The reserved switch target that removes a session's selection. */
14
14
  export declare const OFF = "off";
15
15
  /**
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "dsh-output-styles",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Claude Code outputStyles-equivalent runtime output-style switching for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
- "packageManager": "pnpm@11.7.0",
8
7
  "license": "Apache-2.0",
9
8
  "author": "PerryLink",
10
9
  "repository": {
@@ -21,15 +20,6 @@
21
20
  "engines": {
22
21
  "node": "^22.19.0 || >=24.0.0"
23
22
  },
24
- "scripts": {
25
- "build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.json --noEmitOnError --pretty false && tsdown && tsdown -c tsdown.client.config.ts",
26
- "test": "vitest run",
27
- "typecheck": "tsc -p tsconfig.json --noEmitOnError --pretty false && tsc -p tsconfig.vitest.json --pretty false",
28
- "verify": "pnpm run typecheck && pnpm test && pnpm run verify:self-contained",
29
- "verify:self-contained": "node scripts/verify-self-contained.mjs",
30
- "prepublishOnly": "pnpm run verify",
31
- "prepare": "node scripts/prepare.mjs"
32
- },
33
23
  "main": "lib/index.js",
34
24
  "types": "lib/types/index.d.ts",
35
25
  "exports": {
@@ -63,9 +53,9 @@
63
53
  "LICENSE",
64
54
  "README.md",
65
55
  "README.zh.md",
66
- "README.ja.md",
67
- "README.ko.md",
68
56
  "README.es.md",
57
+ "README.pt.md",
58
+ "README.hi.md",
69
59
  "docs"
70
60
  ],
71
61
  "keywords": [
@@ -116,7 +106,7 @@
116
106
  ],
117
107
  "compatibility": {
118
108
  "dshVersions": [
119
- "0.1.0-rc.6"
109
+ "0.1.0-rc.8"
120
110
  ]
121
111
  },
122
112
  "capability": {
@@ -133,19 +123,19 @@
133
123
  }
134
124
  },
135
125
  "dependencies": {
136
- "@deepseek-ai/dsh-storage": "0.1.0-rc.6",
137
- "@deepseek-ai/dsh-storage-domain": "0.1.0-rc.6",
138
- "@deepseek-ai/dsh-storage-json": "0.1.0-rc.6",
126
+ "@deepseek-ai/dsh-storage": "0.1.0-rc.8",
127
+ "@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8",
128
+ "@deepseek-ai/dsh-storage-json": "0.1.0-rc.8",
139
129
  "yaml": "^2.8.0",
140
130
  "zod": "^4.4.3"
141
131
  },
142
132
  "peerDependencies": {
143
133
  "@deepseek-ai/cordis": "^4.0.1",
144
- "@deepseek-ai/schemastery": "^3.18.1",
145
- "@deepseek-ai/dsh-session": ">=0.1.0-rc.6 <0.2.0",
146
- "@deepseek-ai/dsh-session-projection": ">=0.1.0-rc.6 <0.2.0",
147
- "@deepseek-ai/dsh-storage-domain": ">=0.1.0-rc.6 <0.2.0",
148
- "@deepseek-ai/dsh-settings": ">=0.1.0-rc.6 <0.2.0"
134
+ "@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
135
+ "@deepseek-ai/dsh-session-projection": ">=0.1.0-rc.8 <0.2.0",
136
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.8 <0.2.0",
137
+ "@deepseek-ai/dsh-storage-domain": ">=0.1.0-rc.8 <0.2.0",
138
+ "@deepseek-ai/schemastery": "^3.18.1"
149
139
  },
150
140
  "peerDependenciesMeta": {
151
141
  "@deepseek-ai/dsh-settings": {
@@ -169,33 +159,48 @@
169
159
  },
170
160
  "devDependencies": {
171
161
  "@deepseek-ai/cordis": "4.0.1",
172
- "@deepseek-ai/dsh-agent": "0.1.0-rc.6",
173
- "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.6",
174
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.6",
175
- "@deepseek-ai/dsh-brand": "0.1.0-rc.6",
176
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.6",
177
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.6",
178
- "@deepseek-ai/dsh-client-ui-commands": "0.1.0-rc.6",
179
- "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.0-rc.6",
180
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.6",
181
- "@deepseek-ai/dsh-commands": "0.1.0-rc.6",
182
- "@deepseek-ai/dsh-llm": "0.1.0-rc.6",
183
- "@deepseek-ai/dsh-scope": "0.1.0-rc.6",
184
- "@deepseek-ai/dsh-session": "0.1.0-rc.6",
185
- "@deepseek-ai/dsh-session-persistence": "0.1.0-rc.6",
186
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.0-rc.6",
187
- "@deepseek-ai/dsh-session-projection": "0.1.0-rc.6",
188
- "@deepseek-ai/dsh-settings": "0.1.0-rc.6",
189
- "@deepseek-ai/dsh-storage": "0.1.0-rc.6",
190
- "@deepseek-ai/dsh-storage-domain": "0.1.0-rc.6",
191
- "@deepseek-ai/dsh-storage-json": "0.1.0-rc.6",
192
- "@deepseek-ai/dsh-system-prompt": "0.1.0-rc.6",
193
- "@deepseek-ai/dsh-timeout": "0.1.0-rc.6",
194
- "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.6",
162
+ "@deepseek-ai/cordis-plugin-include": "1.0.6",
163
+ "@deepseek-ai/cordis-plugin-loader": "1.0.2",
164
+ "@deepseek-ai/dsh-agent": "0.1.0-rc.8",
165
+ "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.8",
166
+ "@deepseek-ai/dsh-attachment": "0.1.0-rc.8",
167
+ "@deepseek-ai/dsh-brand": "0.1.0-rc.8",
168
+ "@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
169
+ "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.8",
170
+ "@deepseek-ai/dsh-client-ui-commands": "0.1.0-rc.8",
171
+ "@deepseek-ai/dsh-client-ui-input-trigger": "0.1.0-rc.8",
172
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
173
+ "@deepseek-ai/dsh-commands": "0.1.0-rc.8",
174
+ "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
175
+ "@deepseek-ai/dsh-scope": "0.1.0-rc.8",
176
+ "@deepseek-ai/dsh-session": "0.1.0-rc.8",
177
+ "@deepseek-ai/dsh-session-persistence": "0.1.0-rc.8",
178
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.0-rc.8",
179
+ "@deepseek-ai/dsh-session-projection": "0.1.0-rc.8",
180
+ "@deepseek-ai/dsh-settings": "0.1.0-rc.8",
181
+ "@deepseek-ai/dsh-storage": "0.1.0-rc.8",
182
+ "@deepseek-ai/dsh-storage-domain": "0.1.0-rc.8",
183
+ "@deepseek-ai/dsh-storage-json": "0.1.0-rc.8",
184
+ "@deepseek-ai/dsh-system-prompt": "0.1.0-rc.8",
185
+ "@deepseek-ai/dsh-timeout": "0.1.0-rc.8",
186
+ "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8",
195
187
  "@deepseek-ai/schemastery": "3.18.1",
196
188
  "@types/node": "^22.20.0",
189
+ "@vitest/coverage-v8": "4.1.10",
190
+ "oxlint": "0.18.1",
197
191
  "tsdown": "^0.22.2",
198
192
  "typescript": "^6.0.3",
199
193
  "vitest": "^4.1.8"
194
+ },
195
+ "scripts": {
196
+ "build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.json --noEmitOnError --pretty false && tsdown && tsdown -c tsdown.client.config.ts && node scripts/fix-dts.mjs",
197
+ "test": "vitest run",
198
+ "test:coverage": "vitest run --coverage",
199
+ "lint": "oxlint",
200
+ "check:readmes": "node scripts/check-readme-sync.mjs",
201
+ "typecheck": "tsc -p tsconfig.json --noEmitOnError --pretty false && tsc -p tsconfig.vitest.json --pretty false",
202
+ "verify": "pnpm run typecheck && pnpm test && pnpm run verify:self-contained",
203
+ "verify:self-contained": "node scripts/verify-self-contained.mjs",
204
+ "verify:artifacts": "node scripts/verify-artifacts.mjs"
200
205
  }
201
- }
206
+ }
@@ -88,7 +88,7 @@ export function apply(ctx: ClientContext): void {
88
88
  },
89
89
  onSelect: async (option, session) => {
90
90
  const line = option.id === OFF_ID ? '/style off' : `/style ${option.id}`
91
- const result = await remote.commands.execute(session.sessionId, line)
91
+ const result = await remote.commands.execute(session.sessionId, line, [])
92
92
  if (!result.ok) {
93
93
  throw new Error(`command.execute failed: ${result.error.code}: ${result.error.message}`)
94
94
  }
package/src/runtime.ts CHANGED
@@ -428,7 +428,10 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
428
428
 
429
429
  // The invariant companion, registered from the main plugin so its checks
430
430
  // see the live library and domain. Activates only when an invariant
431
- // registry is composed.
431
+ // registry is composed. The registry binds its internal effect to the
432
+ // service context and throws on a duplicate package name, so the returned
433
+ // disposer is the only unregistration path: hold it on this inject scope's
434
+ // fiber.
432
435
  ctx.inject(['invariants'], (invariantCtx) => {
433
436
  const registry = invariantCtx.get('invariants') as InvariantRegistry | undefined
434
437
  if (registry === undefined) return
@@ -436,7 +439,7 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
436
439
  knownStyles: () => new Set(runtime.names),
437
440
  selectionFor: sessionId => runtime.selectionFor(sessionId),
438
441
  }
439
- registry.register(PACKAGE_NAME, installInvariant(facts))
442
+ invariantCtx.effect(() => registry.register(PACKAGE_NAME, installInvariant(facts)), 'dsh-output-styles: invariant companion')
440
443
  })
441
444
 
442
445
  // ── output.render.* protocol: the renderer registry service ───────────────
package/README.ja.md DELETED
@@ -1,217 +0,0 @@
1
- <div align="center">
2
-
3
- # 🎨 dsh-output-styles
4
-
5
- **DeepSeek Harness 向け Claude Code `outputStyles`** —— モデルの出力スタイルを実行時に、セッション単位で、永続的に切り替えます。
6
-
7
- [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
8
- [![CI](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml/badge.svg)](https://github.com/PerryLink/dsh-output-styles/actions/workflows/ci.yml)
9
- [![npm version](https://img.shields.io/npm/v/dsh-output-styles)](https://www.npmjs.com/package/dsh-output-styles)
10
- [![npm downloads](https://img.shields.io/npm/dm/dsh-output-styles)](https://www.npmjs.com/package/dsh-output-styles)
11
- [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-brightgreen.svg)](#)
12
- [![DSH](https://img.shields.io/badge/deepseek--harness-0.1.0--rc.6-4d6bfe.svg)](#)
13
- [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6.svg)](#)
14
-
15
- 🌐 [English](README.md) · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md)
16
-
17
- </div>
18
-
19
- ---
20
-
21
- `/style concise` —— これ以降の返信はすべて簡潔になります。`/style step-by-step` —— モデルが番号付きの手順で説明します。`/style off` —— プロジェクトのデフォルトに戻ります。セッションごとに 1 コマンド、再起動をまたいで保持され、agent loop には一切変更を加えません。
22
-
23
- ## ✨ 機能
24
-
25
- | | |
26
- |---|---|
27
- | 🗂️ **スタイルライブラリ** | スタイルごとに 1 つの Markdown ファイル(`styles/*.md`)。frontmatter にメタデータ、本文がモデルへの指示です。`name` は既定でファイル名になり、空白を含めます(`Diagrams first`)。同梱の組み込みスタイルは 6 種で、Claude Code と同等の `proactive` と `learning` を含みます。 |
28
- | ⌨️ **`/style` コマンド** | 引数なしでスタイル一覧(説明付き)と現在の選択を表示。`/style <name>` で切り替え、`/style off` でプロジェクトのデフォルトを復元します。`/style` より後の残り全体がスタイル名です。 |
29
- | 💾 **セッション単位の永続化** | 選択は `output_style` ストレージドメインに sessionId をキーとして保持され、2 つのセッションが干渉することはなく、選択は再起動後も残ります。 |
30
- | 🧩 **システムプロンプト注入** | `systemPrompt.section()` の貢献(order 90)が、毎回の組み立てで現在のセッションのスタイル本文を注入します。本文は設定可能なバジェットで切り詰められます。 |
31
- | 🎭 **Claude Code `keep-coding-instructions`** | `keep-coding-instructions: false`(Claude Code と同じ既定)のスタイルはシステムプロンプト全体を置き換えます——ソフトウェアエンジニアリングから離れるスタイル向けです。 |
32
- | 📌 **強制スタイル** | Claude Code の `force-for-plugin`(エイリアス `force`)はセッションの選択を無視して無条件にスタイルを適用します。強制スタイルが 2 つあると読み込みに失敗します。 |
33
- | 🔁 **Claude Code 互換性** | `outputStyles` JSON コレクション(`{ name, description, prompt }`)を読み込みます。単一エントリまたは `settings.json` 形式の配列に対応し、解析不能なエントリは警告付きでスキップします。 |
34
- | 📚 **ディレクトリの階層化** | `stylesDir` はリストで、後方のディレクトリが前方のものを上書きします(同梱の `styles/` が最下層で、`includeBuiltins: false` で無効化)。 |
35
- | 🔄 **ホットリロード** | スタイルファイルの変更は再起動なしで反映されます(`watchStyles: false` で無効化)。 |
36
- | ⚙️ **settings とプロジェクトデフォルト** | 一度も選択していないセッションは、DSH settings の `output-style.style`、次いで `defaultStyle` にフォールバックします。 |
37
- | 🖱️ **Web ピッカー** | `dsh.client` エントリ(`dsh-output-styles/client`)が、ホストの `/style` コマンドを投影ベースのポップアップピッカーで装飾します。 |
38
- | 📊 **セッション投影** | Web UI 向けの `style` 投影(`{ options, currentValue }`)。セッションログ内で確定したコマンドから折りたたまれます。 |
39
- | 🧯 **失敗は明示、スキップはクリーンに** | 設定ミスは読み込み時に例外を投げます。不正なスタイルファイルは警告付きでスキップされ、プロファイルを壊すことはありません。 |
40
- | 🌐 **5 言語のドキュメント** | EN · 中文 · 日本語 · 한국어 · Español。 |
41
-
42
- ## 🚀 クイックスタート
43
-
44
- ```sh
45
- # 1. インストール——このパッケージは bundle レイヤーなので、1 コマンドで
46
- # storage + storage-json + storage-domain + プラグイン行が構成されます:
47
- dsh plugin --profile <name> add dsh-output-styles
48
-
49
- # 2. 起動して切り替え
50
- dsh --profile <name>
51
- /style # → output style off、その後にスタイルごとに 1 行
52
- /style concise # → switched to concise
53
- /style Diagrams first # → 空白を含む名前も使えます
54
- /style off # → プロジェクトのデフォルトに戻る
55
- ```
56
-
57
- このレイヤーは web プロファイルに対して冪等です(id 単位の挿入が同 id の行を置き換えます)。web プロファイルには `storage` があらかじめ含まれています。Web ピッカーを使うには、プロファイルにクライアント行を追加します:
58
-
59
- ```yaml
60
- - id: output-styles-client
61
- name: 'dsh-output-styles/client'
62
- ```
63
-
64
- ## 🎬 デモ
65
-
66
- ```
67
- You > /style
68
- output style off
69
- concise — Terse, direct answers — minimal prose, no preamble. (Daily coding work, tool-heavy sessions, or when prompt length matters.)
70
- explanatory — Educational answers with short "Insights" that teach as you work. (Learning a codebase, onboarding, …)
71
- formal — Formal, precise prose with complete sentences and defined terms. (Reports, documentation, release notes, …)
72
- learning — Collaborative learn-by-doing mode with short "Insights" and small hands-on steps for the user. (Pairing, onboarding, …)
73
- proactive — Execute immediately, assume reasonable defaults, and prefer action over planning. (Routine multi-step work, …)
74
- step-by-step — Numbered reasoning steps with explicit intermediate results. (Debugging, design decisions, …)
75
-
76
- You > /style concise
77
- switched to concise
78
-
79
- You > 一文だけで自己紹介してください。
80
- AI > 私は DeepSeek Harness プラグインプラットフォーム上で動作する、deepseek-v4-pro モデルベースの AI コーディングエージェントです。
81
- ```
82
-
83
- ## 🧠 仕組み
84
-
85
- ```mermaid
86
- flowchart LR
87
- U[/style concise と入力] --> C[コマンドレジストリ]
88
- C -->|command/run を記録| L[(セッションログ)]
89
- C -->|put {style, source}| D[(output_style ドメイン)]
90
- D --> R[OutputStyleRuntime]
91
- R -->|毎回の組み立てで本文を注入| S[systemPrompt セクション order 90]
92
- S --> M[モデルリクエスト]
93
- M -->|完全なシステムプロンプト| H[request/header を記録]
94
- ```
95
-
96
- モデルが見るものはすべてセッションログから再構築できます——新しいセッションイベント型も agent-loop の変更も不要です。スタイル名は `command/run` から、注入された正確なテキストは `request/header` から得られ、出所マーカー `{ kind: 'plugin', plugin: 'dsh-output-styles' }` はドメインレコードに残ります。スタイルはメイン会話のみに適用され、サブエージェントのセッションは独自のプロンプトを保持します(Claude Code と一致)。
97
-
98
- ## ⚙️ 設定
99
-
100
- すべての調整項目は検証付きの Schemastery `Config` フィールドです(不正な値は読み込みに失敗します):
101
-
102
- | フィールド | 既定 | 意味 |
103
- |---|---|---|
104
- | `stylesDir` | `[]` | スタイルライブラリのディレクトリ。cwd を基準に解決され、後方のエントリが前方のものを上書きします。`[]` = 同梱の `styles/` のみ。裸の文字列は単一ディレクトリのリストとみなされます。 |
105
- | `maxStyleChars` | `4000` | スタイル本文のバジェット(コードポイント、≥ 1)。長い本文はマーカー付きで切り詰められます。 |
106
- | `defaultStyle` | `''` | 一度も選択していないセッション(かつ settings の既定もない)向けのスタイル。`''` = スタイルなし。 |
107
- | `compatJson` | `true` | Claude Code `outputStyles` の JSON エントリ(単一オブジェクトまたは配列)を読み込みます。 |
108
- | `sectionOrder` | `90` | 注入セクションの順序(0 = persona、100–199 = ツールガイダンス)。 |
109
- | `truncationMarker` | `"\n\n[style truncated]"` | 切り詰め位置に付加されるマーカー。 |
110
- | `includeBuiltins` | `true` | パッケージ同梱の `styles/` を最優先度の低いレイヤーとして含めます。 |
111
- | `watchStyles` | `true` | スタイルファイルがディスク上で変更されたときにライブラリを再読み込みします。 |
112
- | `rules` | `[]` | セッション/ツール別の描画ルール:`[{ match: { tool?, contentType?, session? }, style, priority? }]`——`style` はレンダラー id(ビルトインはスタイル名と同名)。 |
113
- | `enableExport` | `true` | `/export` コマンドを登録(Markdown/HTML セッション書き出し、レンダラー対応)。 |
114
-
115
- ## 🎨 レンダラープロトコル
116
-
117
- `output.render.*` プロトコルはプレゼンテーション層を拡張点にします。レンダラーは**純粋な presenter**——`presenter(text, context)` が引数を表示データに写し、DOM には触れません——ツール名とコンテンツタイプでマッチし、優先度で並びます。サードパーティは `ctx.outputRenderers.register({ id, match, priority, presenter })` で登録(register は disposer を返し、呼び出し側の ctx.effect が所有)。各レンダーはまず `output.render/before` waterfall(リスナーは必ず `next()`)を通り、次にルール表(セッション/ツール別:`rules: [{ match: { tool: 'bash' }, style: 'concise' }]`、設定画面 `output-style-rules` で編集可)。ビルトインは `concise`(空白圧縮 + 予算切り詰め)と `step-by-step`(手順の連番化)。監査可能:各結果は `{ original, rendered, rendererId, changed }` を持ち、原文はセッションログそのもので決定論的に再構築できます。`/export [markdown|html] [--renderer=<id>]` は同じパイプラインで現在のセッションを書き出します。完全な仕様:docs/renderer-protocol.md(英語)/ docs/renderer-protocol.zh.md。
118
- ## 📚 スタイルライブラリ
119
-
120
- <details>
121
- <summary><code>styles/concise.md</code></summary>
122
-
123
- ```markdown
124
- ---
125
- name: concise
126
- description: Terse, direct answers — minimal prose, no preamble.
127
- whenToUse: Daily coding work, tool-heavy sessions, or when prompt length matters.
128
- keep-coding-instructions: true
129
- ---
130
-
131
- You are in the concise output style for this conversation.
132
- - Lead with the direct answer; skip preamble, restatements, and filler.
133
- - 回答语言跟随用户语言:中文提问用中文回答,英文提问用英文回答。
134
- ```
135
-
136
- </details>
137
-
138
- frontmatter フィールド:
139
-
140
- | フィールド | 既定 | 意味 |
141
- |---|---|---|
142
- | `name` | ファイル名 | 切り替え対象。英字、数字、空白、ハイフン(先頭・末尾の空白は不可。`off` は予約済み)。 |
143
- | `description` | —(必須) | 一覧とピッカーに表示される 1 文。 |
144
- | `whenToUse` | — | 一覧に追記される任意の利用ガイダンス。 |
145
- | `keep-coding-instructions` | `false` | `true` のときハーネスのプロンプト(アイデンティティ、persona、ツールガイダンス)を保持し、`false` のとき完全に置き換えます(Claude Code のセマンティクス)。 |
146
- | `force-for-plugin` | `false` | Claude Code 公式フィールド:セッションの選択を無視して無条件に適用します。`force` はエイリアスで、設定できるのは最大 1 つのスタイルです。 |
147
-
148
- <details>
149
- <summary>Claude Code <code>outputStyles</code> JSON(<code>compatJson: true</code>)</summary>
150
-
151
- ```json
152
- { "name": "explain", "description": "Explain like a teacher.", "prompt": "Teach in small steps." }
153
- ```
154
-
155
- エントリは Claude Code が書き込むとおりに `keep-coding-instructions` と `force-for-plugin` を受け付けます。レガシーの `settings.json` 配列(`[{ … }, { … }]`)はそのまま読み込まれ、不正なエントリは警告付きでスキップされます。
156
-
157
- </details>
158
-
159
- ## ⌨️ コマンドリファレンス
160
-
161
- | 入力 | 結果 |
162
- |---|---|
163
- | `/style` | 現在の選択 + スタイルごとに 1 行(name — description)を一覧表示 |
164
- | `/style concise` | 切り替え(永続書き込み)、`switched to concise` |
165
- | `/style Diagrams first` | 複数語の名前は残り全体が対象 |
166
- | `/style off` | プロジェクトのデフォルトを復元(settings の既定、次いで `defaultStyle`) |
167
- | `/style nope` | `error: unknown output style "nope" (available: …)` |
168
-
169
- ## 🖱️ Web ピッカー
170
-
171
- `dsh.client` エントリは、ホストの `/style` コマンドの引数なし呼び出しをポップアップピッカーで装飾します:「off」行 + ライブラリのスタイルごとに 1 行(`description · whenToUse`)で、アクティブな行がマークされます。選択するとコマンド Remote を通じて `/style <name>` が送信されるため、どの切り替えもホストの永続的なコマンドライフサイクルを経由し、`style` 投影が唯一の表示事実であり続けます。ピッカーの文言は Web UI が同梱する `zh`/`en` の言語ペアに従います。
172
-
173
- ## 🔍 競合チェック
174
-
175
- 開発前に 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+ へ先送り)——は隣接していて、競合はしません。
176
-
177
- ## 🆚 Claude Code との違い
178
-
179
- | | Claude Code | dsh-output-styles |
180
- |---|---|---|
181
- | スタイルファイル | ユーザー/プロジェクト/マネージド階層の `.claude/output-styles` | `stylesDir` ディレクトリ + 同梱の `styles/`。後方のディレクトリが優先 |
182
- | カスタムスタイル | Markdown、frontmatter `name`/`description`/`keep-coding-instructions`/`force-for-plugin` | 同じフィールド(`force-for-plugin` をそのまま受け付け、`force` はエイリアス)+ `whenToUse` |
183
- | レガシー JSON | `settings.json` 内の `outputStyles` 配列 | そのまま読み込み(`compatJson: true`) |
184
- | 反映タイミング | `/clear` 後または新しいセッション | 即時——システムプロンプトはリクエストごとに再構築 |
185
- | サブエージェント | スタイルは適用されない | 同じ——サブエージェントのセッションは独自のプロンプトを保持 |
186
- | 切り替え | `/config` メニューまたは `outputStyle` 設定(`/output-style` コマンドは v2.1.91 で削除) | `/style` コマンド + Web ピッカー + settings `output-style.style` |
187
-
188
- ## 🧪 開発
189
-
190
- ```sh
191
- pnpm install
192
- pnpm run typecheck # 両方の tsc プロジェクト
193
- pnpm test # vitest — 93 テスト
194
- pnpm run verify # typecheck + テスト + 自己完結チェック(prepublishOnly ゲート)
195
- pnpm run build # lib/ 成果物(ホスト + クライアント bundle)
196
- pnpm pack # dsh plugin add 用の tarball
197
- ```
198
-
199
- リリース:`package.json` のバージョンと一致する接尾辞を持つ `v*` タグを push すると Publish ワークフローが起動します——完全検証の後に npm へ公開(provenance 付き)。あらゆる `npm publish` も `prepublishOnly` 経由で `verify` ゲートを通過します。
200
-
201
- 構成は [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/`(Web ピッカー)、`styles/`(組み込みスタイル)。
202
-
203
- ## 👥 コントリビューター
204
-
205
- 本プロジェクトに貢献してくださったすべての方に感謝します:
206
-
207
- - [@PerryLink](https://github.com/PerryLink) — 作者兼メンテナー:プラグインアーキテクチャ、スタイルライブラリ、bundle インストール、Web ピッカー、5 言語ドキュメント、CI/リリースツール。
208
-
209
- バグやアイデアがあれば [issue](https://github.com/PerryLink/dsh-output-styles/issues) や [pull request](https://github.com/PerryLink/dsh-output-styles/pulls) をどうぞ。どの言語での貢献も歓迎します。
210
-
211
- ## 📄 ライセンス
212
-
213
- [Apache-2.0](LICENSE) © 2026 dsh-output-styles contributors
214
-
215
- ---
216
-
217
- <sub>Topics: `dsh` · `dsh-plugin` · `deepseek-harness` · `output-styles` · `claude-code`</sub>