dsh-output-styles 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +2 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +13 -3
- package/lib/index.js +25 -9
- package/lib/{invariant-B9LpUViP.js → invariant-ExQ574yb.js} +56 -5
- package/lib/invariant.js +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/runtime.d.ts.map +1 -1
- package/lib/types/types.d.ts +21 -0
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +44 -47
- package/src/client/index.ts +1 -1
- package/src/index.ts +1 -0
- package/src/runtime.ts +6 -3
- package/src/types.ts +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ All notable changes to this project are documented in this file. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.4.3] - 2026-08-22
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **rc2 compatibility**: every `@deepseek-ai/dsh-*` dependency moves to
|
|
12
|
+
`0.1.1-rc.2` (devDependencies and the runtime storage dependencies pinned);
|
|
13
|
+
the `@deepseek-ai/dsh-session-projection` peer range raises to
|
|
14
|
+
`>=0.1.1-rc.2 <0.2.0` because the projection unit now uses the rc2-only
|
|
15
|
+
`stateSchema` + `wire` definition. The five README compatibility rows, the
|
|
16
|
+
`dshWorkshop` compatibility claim, the compat workflow's rc pins, and the
|
|
17
|
+
workspace `minimumReleaseAgeExclude` follow.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **rc2 session-projection definition**: the `style` projection registers a
|
|
22
|
+
`stateSchema` (persisted fold-state validator) and a client `wire`
|
|
23
|
+
(`viewSchema` + `view`) instead of the rc8 top-level `schema`/`view`, and
|
|
24
|
+
declares its `SessionProjectionStateMap` merge so the `register` overload
|
|
25
|
+
resolves the client-visible unit.
|
|
26
|
+
|
|
27
|
+
## [0.4.2] - 2026-08-21
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **rc8 compatibility**: every `@deepseek-ai/dsh-*` dependency moves to
|
|
32
|
+
`0.1.0-rc.8` (devDependencies and the runtime storage dependencies pinned,
|
|
33
|
+
peer ranges `>=0.1.0-rc.8 <0.2.0`); the five README compatibility rows,
|
|
34
|
+
the `dshWorkshop` compatibility claim, and the compat workflow's rc8 pins
|
|
35
|
+
follow. Verified on a real rc8 profile: bundle install, row mount, and a
|
|
36
|
+
keyless headless run through the deterministic mock LLM (`SMOKE-OK`).
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **Web picker submits through the rc8 command Remote**: the generated
|
|
41
|
+
`commands.execute` client signature gained the image-attachment batch —
|
|
42
|
+
the `/style` picker passes an empty batch, keeping every switch on the
|
|
43
|
+
host's durable command lifecycle.
|
|
44
|
+
- **rc8 `commands.execute` arity in tests and the loader runner**: the
|
|
45
|
+
integration harness and `scripts/loader-runner.mjs` pass the image batch
|
|
46
|
+
and the abort signal explicitly, matching the rc8 registry signature.
|
|
47
|
+
|
|
7
48
|
## [0.4.1] - 2026-08-19
|
|
8
49
|
|
|
9
50
|
### Fixed
|
package/README.es.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| Surface | Status |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
28
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
29
29
|
| Platforms | Todas (host + cliente web) |
|
|
30
30
|
| Model | Cualquiera (inyección en el prompt del sistema) |
|
package/README.hi.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| Surface | Status |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
28
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
29
29
|
| Platforms | सभी (host + वेब क्लाइंट) |
|
|
30
30
|
| Model | कोई भी (सिस्टम-प्रॉम्प्ट इंजेक्शन) |
|
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🎨 dsh-output-styles
|
|
4
|
+
[](https://gitee.com/perrylink/dsh-output-styles)
|
|
4
5
|
|
|
5
6
|
**Claude Code `outputStyles` for DeepSeek Harness** — switch the model's output style at runtime, per session, durably.
|
|
6
7
|
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
|
|
25
26
|
| Surface | Status |
|
|
26
27
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
28
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
29
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
29
30
|
| Platforms | All (host + web client) |
|
|
30
31
|
| Model | Any (system-prompt injection) |
|
package/README.pt.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
| Surface | Status |
|
|
26
26
|
|---|---|
|
|
27
|
-
| Harness | DeepSeek Harness `0.1.
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.1-rc.2` |
|
|
28
28
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
29
29
|
| Platforms | Todas (host + cliente web) |
|
|
30
30
|
| Model | Qualquer (injeção no prompt do sistema) |
|
package/README.zh.md
CHANGED
package/lib/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region lib/types/client/locales.js
|
|
2
2
|
/**
|
|
3
3
|
* Simplified Chinese dictionary (the key-set source of truth).
|
|
4
4
|
*
|
|
@@ -17,7 +17,17 @@ const en = {
|
|
|
17
17
|
"option.offDetail": "Restore the project default output style"
|
|
18
18
|
};
|
|
19
19
|
//#endregion
|
|
20
|
-
//#region
|
|
20
|
+
//#region lib/types/client/index.js
|
|
21
|
+
/**
|
|
22
|
+
* Browser half of `dsh-output-styles`: a popup picker decorating the HOST
|
|
23
|
+
* `/style` command. The picker reads the `style` session projection
|
|
24
|
+
* (`{ options, currentValue }`), which the host plugin keeps fresh, and
|
|
25
|
+
* submits the completed `/style <name>` / `/style off` line back through the
|
|
26
|
+
* command Remote — so every switch keeps the host's durable command
|
|
27
|
+
* lifecycle (`command/run`/`command/done`) and the projection stays the
|
|
28
|
+
* single displayed fact.
|
|
29
|
+
* @module dsh-output-styles/client
|
|
30
|
+
*/
|
|
21
31
|
/** Client plugin name; keep stable after publishing. */
|
|
22
32
|
const name = "dsh-output-styles-client";
|
|
23
33
|
/** Required client services: the command surface, the sessions face, the command Remote, and locale. */
|
|
@@ -78,7 +88,7 @@ function apply(ctx) {
|
|
|
78
88
|
},
|
|
79
89
|
onSelect: async (option, session) => {
|
|
80
90
|
const line = option.id === OFF_ID ? "/style off" : `/style ${option.id}`;
|
|
81
|
-
const result = await remote.commands.execute(session.sessionId, line);
|
|
91
|
+
const result = await remote.commands.execute(session.sessionId, line, []);
|
|
82
92
|
if (!result.ok) throw new Error(`command.execute failed: ${result.error.code}: ${result.error.message}`);
|
|
83
93
|
if (result.value === void 0) throw new Error(`unknown or malformed command: ${line}`);
|
|
84
94
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as styleFoldStateSchema, c as loadStyleLibrary, d as STYLE_COMMAND, f as applyStyleEvent, g as STYLE_SOURCE, h as OUTPUT_STYLE_DOMAIN, i as installInvariant, l as truncateStyle, m as OFF, o as STYLE_NAME_RE, p as parseStyleInput, s as isValidStyleName, t as PACKAGE_NAME, u as EMPTY_STYLE_STATE, v as styleSelectionSchema, y as styleSelectionViewSchema } from "./invariant-ExQ574yb.js";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { watch } from "node:fs";
|
|
6
6
|
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
7
7
|
import { deriveEventMessage, foldSurface } from "@deepseek-ai/dsh-session/surface";
|
|
8
|
-
//#region
|
|
8
|
+
//#region lib/types/config.js
|
|
9
9
|
/**
|
|
10
10
|
* Serializable configuration, schema, and direct-call defaults.
|
|
11
11
|
*
|
|
@@ -79,7 +79,20 @@ function resolveConfig(config, defaultStylesDir) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region
|
|
82
|
+
//#region lib/types/renderers.js
|
|
83
|
+
/**
|
|
84
|
+
* The `output.render.*` protocol: a presenter registry that turns raw
|
|
85
|
+
* model-visible text into display text. A renderer is a pure function —
|
|
86
|
+
* `presenter(text, meta)` maps args to presentation data and never touches
|
|
87
|
+
* the DOM — matched by tool name and content type, ordered by priority.
|
|
88
|
+
* Every rendered result carries its original text alongside, so any consumer
|
|
89
|
+
* (this plugin's `/export`, third-party panels) can log both and keep the
|
|
90
|
+
* "model-visible ⟺ reconstructable" invariant.
|
|
91
|
+
*
|
|
92
|
+
* This module is dependency-free (no DOM, no node: imports, no DSH imports)
|
|
93
|
+
* so the protocol vocabulary itself is portable and unit-testable anywhere.
|
|
94
|
+
* @module dsh-output-styles/renderers
|
|
95
|
+
*/
|
|
83
96
|
/**
|
|
84
97
|
* Validates a renderer before registration: id grammar, name, description,
|
|
85
98
|
* match shape, priority, presenter function. Throws on the first violation
|
|
@@ -232,7 +245,7 @@ const BUILTIN_RENDERERS = [{
|
|
|
232
245
|
presenter: (text) => enumerate(text)
|
|
233
246
|
}];
|
|
234
247
|
//#endregion
|
|
235
|
-
//#region
|
|
248
|
+
//#region lib/types/export.js
|
|
236
249
|
/**
|
|
237
250
|
* Session export: a pure projection of the current session's message surface
|
|
238
251
|
* into Markdown or sanitized HTML, with renderer application on top. The
|
|
@@ -396,7 +409,7 @@ function renderExport(registry, lines, format, rules, now = /* @__PURE__ */ new
|
|
|
396
409
|
};
|
|
397
410
|
}
|
|
398
411
|
//#endregion
|
|
399
|
-
//#region
|
|
412
|
+
//#region lib/types/runtime.js
|
|
400
413
|
/**
|
|
401
414
|
* Runtime boundary and Cordis activation: style resolution over the durable
|
|
402
415
|
* selection domain, the model-visible system-prompt section, the `/style`
|
|
@@ -719,10 +732,13 @@ async function apply(ctx, config) {
|
|
|
719
732
|
ctx.inject(["sessionProjections"], (projectionCtx) => {
|
|
720
733
|
projectionCtx.sessionProjections.register({
|
|
721
734
|
key: "style",
|
|
722
|
-
|
|
735
|
+
stateSchema: styleFoldStateSchema,
|
|
723
736
|
init: () => EMPTY_STYLE_STATE,
|
|
724
737
|
apply: applyStyleEvent,
|
|
725
|
-
|
|
738
|
+
wire: {
|
|
739
|
+
viewSchema: styleSelectionViewSchema,
|
|
740
|
+
view: (state) => viewStyleSelection(runtime, state)
|
|
741
|
+
},
|
|
726
742
|
stateVersion: 2
|
|
727
743
|
});
|
|
728
744
|
});
|
|
@@ -824,7 +840,7 @@ function parseExportInput(rawInput) {
|
|
|
824
840
|
};
|
|
825
841
|
}
|
|
826
842
|
//#endregion
|
|
827
|
-
//#region
|
|
843
|
+
//#region lib/types/index.js
|
|
828
844
|
/**
|
|
829
845
|
* `dsh-output-styles`: Claude Code `outputStyles`-equivalent runtime output
|
|
830
846
|
* styles for DeepSeek Harness. The plugin registers a model-visible system
|
|
@@ -844,4 +860,4 @@ const name = "dsh-output-styles";
|
|
|
844
860
|
*/
|
|
845
861
|
const inject = ["systemPrompt", "storageDomain"];
|
|
846
862
|
//#endregion
|
|
847
|
-
export { Config, DEFAULT_STYLES_DIR, EMPTY_STYLE_STATE, OFF, OUTPUT_STYLE_DOMAIN, OutputStyleRuntime, PACKAGE_NAME, STYLE_COMMAND, STYLE_NAME_RE, STYLE_SECTION_NAME, STYLE_SOURCE, apply, applyStyleEvent, inject, installInvariant, isValidStyleName, loadStyleLibrary, name, parseStyleInput, resolveConfig, styleSelectionSchema, styleSelectionViewSchema, truncateStyle };
|
|
863
|
+
export { Config, DEFAULT_STYLES_DIR, EMPTY_STYLE_STATE, OFF, OUTPUT_STYLE_DOMAIN, OutputStyleRuntime, PACKAGE_NAME, STYLE_COMMAND, STYLE_NAME_RE, STYLE_SECTION_NAME, STYLE_SOURCE, apply, applyStyleEvent, inject, installInvariant, isValidStyleName, loadStyleLibrary, name, parseStyleInput, resolveConfig, styleFoldStateSchema, styleSelectionSchema, styleSelectionViewSchema, truncateStyle };
|
|
@@ -3,7 +3,16 @@ import { readFileSync, readdirSync } from "node:fs";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { defineDomain, domainTable } from "@deepseek-ai/dsh-storage-domain";
|
|
5
5
|
import { parse } from "yaml";
|
|
6
|
-
//#region
|
|
6
|
+
//#region lib/types/types.js
|
|
7
|
+
/**
|
|
8
|
+
* Durable domain vocabulary and type-table merges owned by this package.
|
|
9
|
+
*
|
|
10
|
+
* The selection domain is the single source of the per-session style choice;
|
|
11
|
+
* its record schema doubles as the durable validation boundary. The `style`
|
|
12
|
+
* projection key is declared here (its one home) and re-exported from the
|
|
13
|
+
* package root so consumers receive the `SessionProjectionMap` merge.
|
|
14
|
+
* @module dsh-output-styles/types
|
|
15
|
+
*/
|
|
7
16
|
/** The reserved switch target that removes a session's selection. */
|
|
8
17
|
const OFF = "off";
|
|
9
18
|
/**
|
|
@@ -44,8 +53,30 @@ const styleSelectionViewSchema = z.object({
|
|
|
44
53
|
})),
|
|
45
54
|
currentValue: z.string().min(1).nullable()
|
|
46
55
|
});
|
|
56
|
+
/**
|
|
57
|
+
* Validates the `style` projection's persisted fold state before it seeds a
|
|
58
|
+
* fold (the `stateSchema` of the registered unit). The state is plain JSON:
|
|
59
|
+
* the settled selection (`current`, null when off) plus the in-flight switch
|
|
60
|
+
* parked by `command/run` and resolved by its paired `command/done`.
|
|
61
|
+
*/
|
|
62
|
+
const styleFoldStateSchema = z.object({
|
|
63
|
+
current: z.string().min(1).nullable(),
|
|
64
|
+
pending: z.object({
|
|
65
|
+
commandId: z.string().min(1),
|
|
66
|
+
target: z.union([z.object({ name: z.string().min(1) }), z.object({ off: z.literal(true) })])
|
|
67
|
+
}).nullable()
|
|
68
|
+
});
|
|
47
69
|
//#endregion
|
|
48
|
-
//#region
|
|
70
|
+
//#region lib/types/style-command.js
|
|
71
|
+
/**
|
|
72
|
+
* Strict parsing of the `/style` command input and the pure projection fold
|
|
73
|
+
* over its logged lifecycle events.
|
|
74
|
+
*
|
|
75
|
+
* The handler and the session-projection unit share {@link parseStyleInput}:
|
|
76
|
+
* the projection folds exactly the inputs the handler accepts, so the
|
|
77
|
+
* displayed selection can never diverge from what the command did.
|
|
78
|
+
* @module dsh-output-styles/style-command
|
|
79
|
+
*/
|
|
49
80
|
/** Command name registered on `ctx.commands`; also the log's `command/run` name. */
|
|
50
81
|
const STYLE_COMMAND = "style";
|
|
51
82
|
/**
|
|
@@ -112,7 +143,7 @@ function applyStyleEvent(state, event) {
|
|
|
112
143
|
};
|
|
113
144
|
}
|
|
114
145
|
//#endregion
|
|
115
|
-
//#region
|
|
146
|
+
//#region lib/types/style-library.js
|
|
116
147
|
/**
|
|
117
148
|
* Style-library loading: one style per `*.md` file (frontmatter + body),
|
|
118
149
|
* with optional Claude Code `outputStyles` JSON compatibility (single entry
|
|
@@ -386,7 +417,27 @@ function truncateStyle(body, maxChars, marker) {
|
|
|
386
417
|
return chars.slice(0, maxChars).join("") + marker;
|
|
387
418
|
}
|
|
388
419
|
//#endregion
|
|
389
|
-
//#region
|
|
420
|
+
//#region lib/types/invariant.js
|
|
421
|
+
/**
|
|
422
|
+
* Package-owned invariant companion for `dsh-output-styles`.
|
|
423
|
+
*
|
|
424
|
+
* Two post-commit diagnostic checks over the events this plugin's write path
|
|
425
|
+
* produces (both target events are committed before dispatch, so a violation
|
|
426
|
+
* is reported — via the host registry's `fail` — rather than vetoed):
|
|
427
|
+
*
|
|
428
|
+
* 1. Every `output_style`/`selection` durable write carries this plugin's own
|
|
429
|
+
* source marker and a legal style name; when the library is known,
|
|
430
|
+
* the name must be a library member.
|
|
431
|
+
* 2. A successful `/style <name>` command has a matching selection record on
|
|
432
|
+
* its session by the time its `command/done` settles, and `/style off`
|
|
433
|
+
* leaves no record. The standalone companion (no library/domain handle)
|
|
434
|
+
* skips this check.
|
|
435
|
+
*
|
|
436
|
+
* The main plugin registers a facts-bearing installer from its own context;
|
|
437
|
+
* the `./invariant` export is the standalone companion usable through a
|
|
438
|
+
* separate profile row.
|
|
439
|
+
* @module dsh-output-styles/invariant
|
|
440
|
+
*/
|
|
390
441
|
/** Full npm package name owning the reported failures. */
|
|
391
442
|
const PACKAGE_NAME = "dsh-output-styles";
|
|
392
443
|
/** Cordis companion plugin name. */
|
|
@@ -457,4 +508,4 @@ function getInvariantRegistry(ctx) {
|
|
|
457
508
|
*/
|
|
458
509
|
const apply = (ctx) => Promise.resolve(getInvariantRegistry(ctx).register(PACKAGE_NAME, installInvariant(COMPANION_FACTS)));
|
|
459
510
|
//#endregion
|
|
460
|
-
export {
|
|
511
|
+
export { styleFoldStateSchema as _, name as a, loadStyleLibrary as c, STYLE_COMMAND as d, applyStyleEvent as f, STYLE_SOURCE as g, OUTPUT_STYLE_DOMAIN as h, installInvariant as i, truncateStyle as l, OFF as m, apply as n, STYLE_NAME_RE as o, parseStyleInput as p, inject as r, isValidStyleName as s, PACKAGE_NAME as t, EMPTY_STYLE_STATE as u, styleSelectionSchema as v, styleSelectionViewSchema as y };
|
package/lib/invariant.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as name, i as installInvariant, n as apply, r as inject, t as PACKAGE_NAME } from "./invariant-
|
|
1
|
+
import { a as name, i as installInvariant, n as apply, r as inject, t as PACKAGE_NAME } from "./invariant-ExQ574yb.js";
|
|
2
2
|
export { PACKAGE_NAME, apply, inject, installInvariant, name };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { applyStyleEvent, EMPTY_STYLE_STATE, parseStyleInput, STYLE_COMMAND, } f
|
|
|
23
23
|
export type { StyleFoldState, StyleInput } from './style-command.js';
|
|
24
24
|
export { isValidStyleName, loadStyleLibrary, STYLE_NAME_RE, truncateStyle, } from './style-library.js';
|
|
25
25
|
export type { OutputStyle } from './style-library.js';
|
|
26
|
-
export { OFF, OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleSelectionSchema, styleSelectionViewSchema, } from './types.js';
|
|
26
|
+
export { OFF, OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleFoldStateSchema, styleSelectionSchema, styleSelectionViewSchema, } from './types.js';
|
|
27
27
|
export type { StyleOption, StyleSelection, StyleSelectionView } from './types.js';
|
|
28
28
|
export { installInvariant, PACKAGE_NAME } from './invariant.js';
|
|
29
29
|
export type { InvariantFacts, InvariantInstaller, InvariantRegistry } from './invariant.js';
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,IAAI,sBAAsB,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,UAAoC,CAAA;AAEvD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA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AChB,aAAa,EACb,aAAa,GACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,GAAG,EACH,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC/D,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAG3F,mBAAmB,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKlE,OAAO,KAAK,EAAE,MAAM,EAA2B,MAAM,iCAAiC,CAAA;AAGtF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,EAAmC,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEtF,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKlE,OAAO,KAAK,EAAE,MAAM,EAA2B,MAAM,iCAAiC,CAAA;AAGtF,OAAO,EAAiB,KAAK,MAAM,EAAE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@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { SessionId } from '@deepseek-ai/dsh-session';
|
|
11
11
|
import { z as zod } from 'zod';
|
|
12
12
|
import type { OutputRenderer, RenderContext, RenderedText } from './renderers.js';
|
|
13
|
+
import type { StyleFoldState } from './style-command.js';
|
|
13
14
|
/** The reserved switch target that removes a session's selection. */
|
|
14
15
|
export declare const OFF = "off";
|
|
15
16
|
/**
|
|
@@ -71,10 +72,30 @@ export declare const styleSelectionViewSchema: zod.ZodObject<{
|
|
|
71
72
|
}, zod.core.$strip>>;
|
|
72
73
|
currentValue: zod.ZodNullable<zod.ZodString>;
|
|
73
74
|
}, zod.core.$strip>;
|
|
75
|
+
/**
|
|
76
|
+
* Validates the `style` projection's persisted fold state before it seeds a
|
|
77
|
+
* fold (the `stateSchema` of the registered unit). The state is plain JSON:
|
|
78
|
+
* the settled selection (`current`, null when off) plus the in-flight switch
|
|
79
|
+
* parked by `command/run` and resolved by its paired `command/done`.
|
|
80
|
+
*/
|
|
81
|
+
export declare const styleFoldStateSchema: zod.ZodObject<{
|
|
82
|
+
current: zod.ZodNullable<zod.ZodString>;
|
|
83
|
+
pending: zod.ZodNullable<zod.ZodObject<{
|
|
84
|
+
commandId: zod.ZodString;
|
|
85
|
+
target: zod.ZodUnion<readonly [zod.ZodObject<{
|
|
86
|
+
name: zod.ZodString;
|
|
87
|
+
}, zod.core.$strip>, zod.ZodObject<{
|
|
88
|
+
off: zod.ZodLiteral<true>;
|
|
89
|
+
}, zod.core.$strip>]>;
|
|
90
|
+
}, zod.core.$strip>>;
|
|
91
|
+
}, zod.core.$strip>;
|
|
74
92
|
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
75
93
|
interface SessionProjectionMap {
|
|
76
94
|
style: StyleSelectionView;
|
|
77
95
|
}
|
|
96
|
+
interface SessionProjectionStateMap {
|
|
97
|
+
style: StyleFoldState;
|
|
98
|
+
}
|
|
78
99
|
}
|
|
79
100
|
/** The `ctx.outputRenderers` service: the output.render.* renderer registry. */
|
|
80
101
|
export interface OutputRenderersService {
|
package/lib/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,qEAAqE;AACrE,eAAO,MAAM,GAAG,QAAQ,CAAA;AAExB;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;CAA2D,CAAA;AAEpF,gDAAgD;AAChD,eAAO,MAAM,oBAAoB;;;;;;mBAQ/B,CAAA;AAEF,kDAAkD;AAClD,MAAM,WAAW,cAAe,SAAQ,GAAG,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC;CAAG;AAEjF;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAM9B,CAAA;AAEF,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAA;I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AC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;KACrL;CACF"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-output-styles",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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,19 +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 && node scripts/fix-dts.mjs",
|
|
26
|
-
"test": "vitest run",
|
|
27
|
-
"test:coverage": "vitest run --coverage",
|
|
28
|
-
"lint": "oxlint",
|
|
29
|
-
"check:readmes": "node scripts/check-readme-sync.mjs",
|
|
30
|
-
"typecheck": "tsc -p tsconfig.json --noEmitOnError --pretty false && tsc -p tsconfig.vitest.json --pretty false",
|
|
31
|
-
"verify": "pnpm run typecheck && pnpm test && pnpm run verify:self-contained",
|
|
32
|
-
"verify:self-contained": "node scripts/verify-self-contained.mjs",
|
|
33
|
-
"verify:artifacts": "node scripts/verify-artifacts.mjs",
|
|
34
|
-
"prepublishOnly": "pnpm run verify",
|
|
35
|
-
"prepare": "node scripts/prepare.mjs"
|
|
36
|
-
},
|
|
37
23
|
"main": "lib/index.js",
|
|
38
24
|
"types": "lib/types/index.d.ts",
|
|
39
25
|
"exports": {
|
|
@@ -120,7 +106,7 @@
|
|
|
120
106
|
],
|
|
121
107
|
"compatibility": {
|
|
122
108
|
"dshVersions": [
|
|
123
|
-
"0.1.
|
|
109
|
+
"0.1.1-rc.2"
|
|
124
110
|
]
|
|
125
111
|
},
|
|
126
112
|
"capability": {
|
|
@@ -137,18 +123,18 @@
|
|
|
137
123
|
}
|
|
138
124
|
},
|
|
139
125
|
"dependencies": {
|
|
140
|
-
"@deepseek-ai/dsh-storage": "0.1.
|
|
141
|
-
"@deepseek-ai/dsh-storage-domain": "0.1.
|
|
142
|
-
"@deepseek-ai/dsh-storage-json": "0.1.
|
|
126
|
+
"@deepseek-ai/dsh-storage": "0.1.1-rc.2",
|
|
127
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.1-rc.2",
|
|
128
|
+
"@deepseek-ai/dsh-storage-json": "0.1.1-rc.2",
|
|
143
129
|
"yaml": "^2.8.0",
|
|
144
130
|
"zod": "^4.4.3"
|
|
145
131
|
},
|
|
146
132
|
"peerDependencies": {
|
|
147
133
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
148
|
-
"@deepseek-ai/dsh-session": ">=0.1.0-rc.
|
|
149
|
-
"@deepseek-ai/dsh-session-projection": ">=0.1.
|
|
150
|
-
"@deepseek-ai/dsh-settings": ">=0.1.0-rc.
|
|
151
|
-
"@deepseek-ai/dsh-storage-domain": ">=0.1.0-rc.
|
|
134
|
+
"@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
|
|
135
|
+
"@deepseek-ai/dsh-session-projection": ">=0.1.1-rc.2 <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",
|
|
152
138
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
153
139
|
},
|
|
154
140
|
"peerDependenciesMeta": {
|
|
@@ -175,29 +161,29 @@
|
|
|
175
161
|
"@deepseek-ai/cordis": "4.0.1",
|
|
176
162
|
"@deepseek-ai/cordis-plugin-include": "1.0.6",
|
|
177
163
|
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
178
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
179
|
-
"@deepseek-ai/dsh-api-remotes": "0.1.
|
|
180
|
-
"@deepseek-ai/dsh-attachment": "0.1.
|
|
181
|
-
"@deepseek-ai/dsh-brand": "0.1.
|
|
182
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
183
|
-
"@deepseek-ai/dsh-client-runtime": "0.1.
|
|
184
|
-
"@deepseek-ai/dsh-client-ui-commands": "0.1.
|
|
185
|
-
"@deepseek-ai/dsh-client-ui-input-trigger": "0.1.
|
|
186
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1.
|
|
187
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
188
|
-
"@deepseek-ai/dsh-llm": "0.1.
|
|
189
|
-
"@deepseek-ai/dsh-scope": "0.1.
|
|
190
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
191
|
-
"@deepseek-ai/dsh-session-persistence": "0.1.
|
|
192
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.
|
|
193
|
-
"@deepseek-ai/dsh-session-projection": "0.1.
|
|
194
|
-
"@deepseek-ai/dsh-settings": "0.1.
|
|
195
|
-
"@deepseek-ai/dsh-storage": "0.1.
|
|
196
|
-
"@deepseek-ai/dsh-storage-domain": "0.1.
|
|
197
|
-
"@deepseek-ai/dsh-storage-json": "0.1.
|
|
198
|
-
"@deepseek-ai/dsh-system-prompt": "0.1.
|
|
199
|
-
"@deepseek-ai/dsh-timeout": "0.1.
|
|
200
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.
|
|
164
|
+
"@deepseek-ai/dsh-agent": "0.1.1-rc.2",
|
|
165
|
+
"@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
|
|
166
|
+
"@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
|
|
167
|
+
"@deepseek-ai/dsh-brand": "0.1.1-rc.2",
|
|
168
|
+
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
169
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
170
|
+
"@deepseek-ai/dsh-client-ui-commands": "0.1.1-rc.2",
|
|
171
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": "0.1.1-rc.2",
|
|
172
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
|
|
173
|
+
"@deepseek-ai/dsh-commands": "0.1.1-rc.2",
|
|
174
|
+
"@deepseek-ai/dsh-llm": "0.1.1-rc.2",
|
|
175
|
+
"@deepseek-ai/dsh-scope": "0.1.1-rc.2",
|
|
176
|
+
"@deepseek-ai/dsh-session": "0.1.1-rc.2",
|
|
177
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.1-rc.2",
|
|
178
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
|
|
179
|
+
"@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
|
|
180
|
+
"@deepseek-ai/dsh-settings": "0.1.1-rc.2",
|
|
181
|
+
"@deepseek-ai/dsh-storage": "0.1.1-rc.2",
|
|
182
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.1-rc.2",
|
|
183
|
+
"@deepseek-ai/dsh-storage-json": "0.1.1-rc.2",
|
|
184
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
|
|
185
|
+
"@deepseek-ai/dsh-timeout": "0.1.1-rc.2",
|
|
186
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
|
|
201
187
|
"@deepseek-ai/schemastery": "3.18.1",
|
|
202
188
|
"@types/node": "^22.20.0",
|
|
203
189
|
"@vitest/coverage-v8": "4.1.10",
|
|
@@ -205,5 +191,16 @@
|
|
|
205
191
|
"tsdown": "^0.22.2",
|
|
206
192
|
"typescript": "^6.0.3",
|
|
207
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"
|
|
208
205
|
}
|
|
209
|
-
}
|
|
206
|
+
}
|
package/src/client/index.ts
CHANGED
|
@@ -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/index.ts
CHANGED
package/src/runtime.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { resolveConfig, type Config } from './config.ts'
|
|
|
23
23
|
import { installInvariant, PACKAGE_NAME, type InvariantFacts, type InvariantRegistry } from './invariant.ts'
|
|
24
24
|
import { loadStyleLibrary, truncateStyle, type OutputStyle } from './style-library.ts'
|
|
25
25
|
import { applyStyleEvent, EMPTY_STYLE_STATE, parseStyleInput, STYLE_COMMAND, type StyleFoldState } from './style-command.ts'
|
|
26
|
-
import { OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleSelectionViewSchema, type StyleSelection, type StyleSelectionView } from './types.ts'
|
|
26
|
+
import { OUTPUT_STYLE_DOMAIN, STYLE_SOURCE, styleFoldStateSchema, styleSelectionViewSchema, type StyleSelection, type StyleSelectionView } from './types.ts'
|
|
27
27
|
import { BUILTIN_RENDERERS, RendererRegistry, type OutputRenderer, type RenderContext, type RenderedText, type StyleRule } from './renderers.ts'
|
|
28
28
|
import { conversationLines, renderExport } from './export.ts'
|
|
29
29
|
|
|
@@ -418,10 +418,13 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
|
|
|
418
418
|
ctx.inject(['sessionProjections'], (projectionCtx) => {
|
|
419
419
|
projectionCtx.sessionProjections.register<'style', StyleFoldState>({
|
|
420
420
|
key: 'style',
|
|
421
|
-
|
|
421
|
+
stateSchema: styleFoldStateSchema,
|
|
422
422
|
init: () => EMPTY_STYLE_STATE,
|
|
423
423
|
apply: applyStyleEvent,
|
|
424
|
-
|
|
424
|
+
wire: {
|
|
425
|
+
viewSchema: styleSelectionViewSchema,
|
|
426
|
+
view: state => viewStyleSelection(runtime, state),
|
|
427
|
+
},
|
|
425
428
|
stateVersion: 2,
|
|
426
429
|
})
|
|
427
430
|
})
|
package/src/types.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { SessionId } from '@deepseek-ai/dsh-session'
|
|
|
12
12
|
import { z as zod } from 'zod'
|
|
13
13
|
import { defineDomain, domainTable } from '@deepseek-ai/dsh-storage-domain'
|
|
14
14
|
import type { OutputRenderer, RenderContext, RenderedText } from './renderers.ts'
|
|
15
|
+
import type { StyleFoldState } from './style-command.ts'
|
|
15
16
|
|
|
16
17
|
/** The reserved switch target that removes a session's selection. */
|
|
17
18
|
export const OFF = 'off'
|
|
@@ -80,10 +81,30 @@ export const styleSelectionViewSchema = zod.object({
|
|
|
80
81
|
currentValue: zod.string().min(1).nullable(),
|
|
81
82
|
})
|
|
82
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Validates the `style` projection's persisted fold state before it seeds a
|
|
86
|
+
* fold (the `stateSchema` of the registered unit). The state is plain JSON:
|
|
87
|
+
* the settled selection (`current`, null when off) plus the in-flight switch
|
|
88
|
+
* parked by `command/run` and resolved by its paired `command/done`.
|
|
89
|
+
*/
|
|
90
|
+
export const styleFoldStateSchema = zod.object({
|
|
91
|
+
current: zod.string().min(1).nullable(),
|
|
92
|
+
pending: zod.object({
|
|
93
|
+
commandId: zod.string().min(1),
|
|
94
|
+
target: zod.union([
|
|
95
|
+
zod.object({ name: zod.string().min(1) }),
|
|
96
|
+
zod.object({ off: zod.literal(true) }),
|
|
97
|
+
]),
|
|
98
|
+
}).nullable(),
|
|
99
|
+
})
|
|
100
|
+
|
|
83
101
|
declare module '@deepseek-ai/dsh-session-projection/types' {
|
|
84
102
|
interface SessionProjectionMap {
|
|
85
103
|
style: StyleSelectionView
|
|
86
104
|
}
|
|
105
|
+
interface SessionProjectionStateMap {
|
|
106
|
+
style: StyleFoldState
|
|
107
|
+
}
|
|
87
108
|
}
|
|
88
109
|
|
|
89
110
|
/** The `ctx.outputRenderers` service: the output.render.* renderer registry. */
|