dsh-quick-toc 0.7.2 → 0.7.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/lib/index.js CHANGED
@@ -1,124 +1,124 @@
1
- /**
2
- * dsh-quick-toc host half.
3
- *
4
- * One job: register the `dsh-quick-toc` settings namespace so the panel's
5
- * preferences live in the Host settings document and the plugin gets a card in
6
- * Settings → Plugins → Plugin configuration. The browser half owns both the
7
- * card and the panel; nothing here consumes the values.
8
- *
9
- * The composition entry is the base layer, so a value the user clears falls
10
- * back to the schema defaults rather than to nothing.
11
- *
12
- * @module dsh-quick-toc
13
- */
14
- import z from "@deepseek-ai/schemastery";
15
-
16
- /** Namespace the browser half binds and the card is keyed on. */
17
- export const NAMESPACE = "dsh-quick-toc";
18
-
19
- /**
20
- * Mark one preference field as a live value where the running schemastery knows
21
- * the modifier, and hand the field back untouched where it does not; see
22
- * `apply` for why the difference exists.
23
- * @param {object} schema - the field's schema.
24
- * @returns {object} the same schema, volatile on hosts that support it.
25
- */
26
- const volatileSchema = (schema) =>
27
- typeof schema.volatile === "function" ? schema.volatile() : schema;
28
-
29
- /**
30
- * The durable settings section. Values are written by the browser half's card
31
- * (and by the panel itself), so the schema is the validation layer, not a form.
32
- */
33
- export const Config = z.object({
34
- lang: volatileSchema(z
35
- .string()
36
- .pattern(/^(auto|zh|en)$/)
37
- .default("auto")
38
- .description("Panel language: auto follows DSH, zh or en forces one")),
39
- dock: volatileSchema(z
40
- .string()
41
- .pattern(/^(left|right)$/)
42
- .default("left")
43
- .description("Which edge the panel docks to by default")),
44
- levels: volatileSchema(z
45
- .array(z.number().min(1).max(6))
46
- .default([1, 2, 3, 4, 5, 6])
47
- .description("Heading levels the outline shows")),
48
- zoom: volatileSchema(z
49
- .number()
50
- .min(0.5)
51
- .max(2)
52
- .default(1)
53
- .description("Scale factor for the panel's content (text, icons, buttons) from 50% to 200%; the panel's own size is unchanged")),
54
- sheetZoom: volatileSchema(z
55
- .number()
56
- .min(0.5)
57
- .max(2)
58
- .default(1)
59
- .description("Scale factor for the curtain's content (text, icons, buttons) from 50% to 200%; the curtain's own size is unchanged")),
60
- handle: volatileSchema(z
61
- .number()
62
- .min(0)
63
- .max(1)
64
- .default(0.5)
65
- .description("Vertical position of the collapsed-panel handle: 0 = bottom, 1 = top of the conversation area")),
66
- fuzzy: volatileSchema(z
67
- .boolean()
68
- .default(false)
69
- .description("Start with fuzzy search on")),
70
- hover: volatileSchema(z
71
- .boolean()
72
- .default(true)
73
- .description("Show the hover preview card")),
74
- remember: volatileSchema(z
75
- .boolean()
76
- .default(true)
77
- .description("Remember where you were reading in each session and return there when it is reopened")),
78
- autoLoad: volatileSchema(z
79
- .boolean()
80
- .default(true)
81
- .description("Load history automatically when the outline is scrolled into turns that are not loaded yet; off means nothing loads until a row is clicked")),
82
- debug: volatileSchema(z
83
- .boolean()
84
- .default(false)
85
- .description("Print the mount diagnostic to the browser console")),
86
- });
87
-
88
- /**
89
- * Register the settings namespace, in whichever dialect the running host speaks.
90
- *
91
- * Up to DSH 0.1.5-rc.2 the settings service registers a named section with a
92
- * schema and reads and writes it by that name (`installSection`). From
93
- * 0.1.7-alpha.1 on, the service addresses settings by PROFILE ENTRY ID, derives
94
- * the entry's form from the schema this module exports, and only projects the
95
- * fields marked `.volatile()` — an instance announces its page policy with
96
- * `settings.configure` instead. Both are pure registrations that the browser
97
- * half then reads through its own service, so the plugin does not care which
98
- * one ran.
99
- *
100
- * `volatileSchema` marks a field only where the running schemastery knows the
101
- * modifier: it arrived in schemastery 3.18.3 (the alpha), and calling it on
102
- * 3.18.2 (the rc line) would throw while the module is being imported.
103
- *
104
- * @param {object} ctx - host cordis context.
105
- * @param {object} [config] - the plugin entry's composition config (base layer).
106
- */
107
- export function apply(ctx, config) {
108
- ctx.inject(["settings"], (settingsCtx) => {
109
- const settings = settingsCtx.settings;
110
- if (settings && typeof settings.installSection === "function") {
111
- settings.installSection(ctx, NAMESPACE, Config, config ?? {}, {
112
- setSource: () => {},
113
- onChange: () => {},
114
- });
115
- return;
116
- }
117
- if (settings && typeof settings.configure === "function") {
118
- // `auto: true` keeps the host's generated page as the fallback wherever no
119
- // custom page of ours is reachable (the browser half renders one where the
120
- // host offers a configuration cell for this entry).
121
- settingsCtx.effect(() => settings.configure({ auto: true }, ctx.fiber));
122
- }
123
- });
124
- }
1
+ /**
2
+ * dsh-quick-toc host half.
3
+ *
4
+ * One job: register the `dsh-quick-toc` settings namespace so the panel's
5
+ * preferences live in the Host settings document and the plugin gets a card in
6
+ * Settings → Plugins → Plugin configuration. The browser half owns both the
7
+ * card and the panel; nothing here consumes the values.
8
+ *
9
+ * The composition entry is the base layer, so a value the user clears falls
10
+ * back to the schema defaults rather than to nothing.
11
+ *
12
+ * @module dsh-quick-toc
13
+ */
14
+ import z from "@deepseek-ai/schemastery";
15
+
16
+ /** Namespace the browser half binds and the card is keyed on. */
17
+ export const NAMESPACE = "dsh-quick-toc";
18
+
19
+ /**
20
+ * Mark one preference field as a live value where the running schemastery knows
21
+ * the modifier, and hand the field back untouched where it does not; see
22
+ * `apply` for why the difference exists.
23
+ * @param {object} schema - the field's schema.
24
+ * @returns {object} the same schema, volatile on hosts that support it.
25
+ */
26
+ const volatileSchema = (schema) =>
27
+ typeof schema.volatile === "function" ? schema.volatile() : schema;
28
+
29
+ /**
30
+ * The durable settings section. Values are written by the browser half's card
31
+ * (and by the panel itself), so the schema is the validation layer, not a form.
32
+ */
33
+ export const Config = z.object({
34
+ lang: volatileSchema(z
35
+ .string()
36
+ .pattern(/^(auto|zh|en)$/)
37
+ .default("auto")
38
+ .description("Panel language: auto follows DSH, zh or en forces one")),
39
+ dock: volatileSchema(z
40
+ .string()
41
+ .pattern(/^(left|right)$/)
42
+ .default("left")
43
+ .description("Which edge the panel docks to by default")),
44
+ levels: volatileSchema(z
45
+ .array(z.number().min(1).max(6))
46
+ .default([1, 2, 3, 4, 5, 6])
47
+ .description("Heading levels the outline shows")),
48
+ zoom: volatileSchema(z
49
+ .number()
50
+ .min(0.5)
51
+ .max(2)
52
+ .default(1)
53
+ .description("Scale factor for the panel's content (text, icons, buttons) from 50% to 200%; the panel's own size is unchanged")),
54
+ sheetZoom: volatileSchema(z
55
+ .number()
56
+ .min(0.5)
57
+ .max(2)
58
+ .default(1)
59
+ .description("Scale factor for the curtain's content (text, icons, buttons) from 50% to 200%; the curtain's own size is unchanged")),
60
+ handle: volatileSchema(z
61
+ .number()
62
+ .min(0)
63
+ .max(1)
64
+ .default(0.5)
65
+ .description("Vertical position of the collapsed-panel handle: 0 = bottom, 1 = top of the conversation area")),
66
+ fuzzy: volatileSchema(z
67
+ .boolean()
68
+ .default(false)
69
+ .description("Start with fuzzy search on")),
70
+ hover: volatileSchema(z
71
+ .boolean()
72
+ .default(true)
73
+ .description("Show the hover preview card")),
74
+ remember: volatileSchema(z
75
+ .boolean()
76
+ .default(true)
77
+ .description("Remember where you were reading in each session and return there when it is reopened")),
78
+ autoLoad: volatileSchema(z
79
+ .boolean()
80
+ .default(true)
81
+ .description("Load history automatically when the outline is scrolled into turns that are not loaded yet; off means nothing loads until a row is clicked")),
82
+ debug: volatileSchema(z
83
+ .boolean()
84
+ .default(false)
85
+ .description("Print the mount diagnostic to the browser console")),
86
+ });
87
+
88
+ /**
89
+ * Register the settings namespace, in whichever dialect the running host speaks.
90
+ *
91
+ * Up to DSH 0.1.5-rc.2 the settings service registers a named section with a
92
+ * schema and reads and writes it by that name (`installSection`). From
93
+ * 0.1.7-alpha.1 on, the service addresses settings by PROFILE ENTRY ID, derives
94
+ * the entry's form from the schema this module exports, and only projects the
95
+ * fields marked `.volatile()` — an instance announces its page policy with
96
+ * `settings.configure` instead. Both are pure registrations that the browser
97
+ * half then reads through its own service, so the plugin does not care which
98
+ * one ran.
99
+ *
100
+ * `volatileSchema` marks a field only where the running schemastery knows the
101
+ * modifier: it arrived in schemastery 3.18.3 (the alpha), and calling it on
102
+ * 3.18.2 (the rc line) would throw while the module is being imported.
103
+ *
104
+ * @param {object} ctx - host cordis context.
105
+ * @param {object} [config] - the plugin entry's composition config (base layer).
106
+ */
107
+ export function apply(ctx, config) {
108
+ ctx.inject(["settings"], (settingsCtx) => {
109
+ const settings = settingsCtx.settings;
110
+ if (settings && typeof settings.installSection === "function") {
111
+ settings.installSection(ctx, NAMESPACE, Config, config ?? {}, {
112
+ setSource: () => {},
113
+ onChange: () => {},
114
+ });
115
+ return;
116
+ }
117
+ if (settings && typeof settings.configure === "function") {
118
+ // `auto: true` keeps the host's generated page as the fallback wherever no
119
+ // custom page of ours is reachable (the browser half renders one where the
120
+ // host offers a configuration cell for this entry).
121
+ settingsCtx.effect(() => settings.configure({ auto: true }, ctx.fiber));
122
+ }
123
+ });
124
+ }
package/package.json CHANGED
@@ -1,70 +1,72 @@
1
- {
2
- "name": "dsh-quick-toc",
3
- "version": "0.7.2",
4
- "description": "Conversation TOC for DeepSeek Harness (DSH): a whole-session, turn-grouped Markdown outline with hover previews, a level filter, a full-width curtain, jump-to-end buttons, title/full-text/cross-session search and a Chinese/English interface.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "files": [
8
- "lib",
9
- "cordis.patch.yml",
10
- "README.md",
11
- "README.en.md",
12
- "CHANGELOG.md",
13
- "CHANGELOG.en.md",
14
- "LICENSE"
15
- ],
16
- "engines": {
17
- "dsh": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
18
- },
19
- "exports": {
20
- ".": "./lib/index.js",
21
- "./client": "./lib/client.js",
22
- "./package.json": "./package.json"
23
- },
24
- "dsh": {
25
- "bundle": {
26
- "patch": "./cordis.patch.yml"
27
- },
28
- "client": {
29
- "inject": [
30
- "@deepseek-ai/dsh-client-ui-chat",
31
- "@deepseek-ai/dsh-client-ui-conversation",
32
- "@deepseek-ai/dsh-client-ui-layout"
33
- ],
34
- "platform": "web"
35
- },
36
- "compatibility": {
37
- "dshReleases": {
38
- "0.1.5-rc.1": "compatible",
39
- "0.1.5-rc.2": "compatible",
40
- "0.1.7-alpha.1": "compatible"
41
- }
42
- }
43
- },
44
- "peerDependencies": {
45
- "react": "^18.2.0",
46
- "@deepseek-ai/schemastery": "^3.18.0",
47
- "@deepseek-ai/dsh-client-ui-chat": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0",
48
- "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
49
- },
50
- "peerDependenciesMeta": {
51
- "@deepseek-ai/schemastery": {
52
- "optional": true
53
- }
54
- },
55
- "license": "MIT",
56
- "keywords": [
57
- "dsh",
58
- "deepseek-harness",
59
- "plugin",
60
- "toc",
61
- "outline",
62
- "markdown",
63
- "navigation",
64
- "search"
65
- ],
66
- "repository": {
67
- "type": "git",
68
- "url": "git+https://github.com/LyaxZ/dsh-quick-toc.git"
69
- }
70
- }
1
+ {
2
+ "name": "dsh-quick-toc",
3
+ "version": "0.7.3",
4
+ "description": "Conversation TOC for DeepSeek Harness (DSH): a whole-session, turn-grouped Markdown outline with hover previews, a level filter, a full-width curtain, jump-to-end buttons, title/full-text/cross-session search and a Chinese/English interface.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "files": [
8
+ "lib",
9
+ "cordis.patch.yml",
10
+ "README.md",
11
+ "README.en.md",
12
+ "CHANGELOG.md",
13
+ "CHANGELOG.en.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "dsh": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
18
+ },
19
+ "exports": {
20
+ ".": "./lib/index.js",
21
+ "./client": "./lib/client.js",
22
+ "./package.json": "./package.json"
23
+ },
24
+ "dsh": {
25
+ "bundle": {
26
+ "patch": "./cordis.patch.yml"
27
+ },
28
+ "client": {
29
+ "inject": [
30
+ "@deepseek-ai/dsh-client-ui-chat",
31
+ "@deepseek-ai/dsh-client-ui-conversation",
32
+ "@deepseek-ai/dsh-client-ui-layout"
33
+ ],
34
+ "platform": "web"
35
+ },
36
+ "compatibility": {
37
+ "dshReleases": {
38
+ "0.1.5-rc.1": "compatible",
39
+ "0.1.5-rc.2": "compatible",
40
+ "0.1.5-rc.3": "compatible",
41
+ "0.1.7-alpha.1": "compatible",
42
+ "0.1.7-alpha.2": "compatible"
43
+ }
44
+ }
45
+ },
46
+ "peerDependencies": {
47
+ "react": "^18.2.0",
48
+ "@deepseek-ai/schemastery": "^3.18.0",
49
+ "@deepseek-ai/dsh-client-ui-chat": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0",
50
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.5-rc.1 <0.1.7-0 || >=0.1.7-alpha.1 <0.2.0-0"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@deepseek-ai/schemastery": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "license": "MIT",
58
+ "keywords": [
59
+ "dsh",
60
+ "deepseek-harness",
61
+ "plugin",
62
+ "toc",
63
+ "outline",
64
+ "markdown",
65
+ "navigation",
66
+ "search"
67
+ ],
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "git+https://github.com/LyaxZ/dsh-quick-toc.git"
71
+ }
72
+ }