dsh-thinking-levels 0.1.1 → 0.2.1

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/client.js ADDED
@@ -0,0 +1,226 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-thinking-levels",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ let react = require("react");
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ //#region src/client/locales.ts
10
+ /** `thinking-levels` client dictionaries. */
11
+ /** Dictionary namespace owned by this plugin. */
12
+ const NS = "thinking-levels";
13
+ /** Simplified Chinese dictionary (the key-set source of truth). */
14
+ const zh = {
15
+ "card.title": "思考档位",
16
+ "card.description": "按轮次控制 reasoning_effort:auto 按工具调用历史自动在 low / high / max 间调度,或手动固定档位。",
17
+ "card.level": "档位",
18
+ "card.level.off": "off — 关闭思考(仅手动,永不自动选择)",
19
+ "card.level.low": "low — 低(简单任务,廉价轮保持廉价)",
20
+ "card.level.high": "high — 高(官方默认)",
21
+ "card.level.max": "max — 最大(重任务)",
22
+ "card.level.auto": "auto — 按工具历史自动调度",
23
+ "card.enabled": "启用",
24
+ "card.allowDowngrade": "允许降档(auto 可降至 low)",
25
+ "card.allowUpgrade": "允许升档(auto 可升至 max)",
26
+ "card.unavailable": "设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。",
27
+ "card.readonly": "只读"
28
+ };
29
+ /** English dictionary (keys mirror zh). */
30
+ const en = {
31
+ "card.title": "Thinking Levels",
32
+ "card.description": "Per-round reasoning_effort control: auto schedules between low / high / max from the recent tool-call history, or fix a level manually.",
33
+ "card.level": "Level",
34
+ "card.level.off": "off — disable thinking (manual only, never auto-picked)",
35
+ "card.level.low": "low — cheap rounds stay cheap",
36
+ "card.level.high": "high — the official default",
37
+ "card.level.max": "max — heavy work",
38
+ "card.level.auto": "auto — schedule from tool history",
39
+ "card.enabled": "Enabled",
40
+ "card.allowDowngrade": "Allow downgrade (auto may drop to low)",
41
+ "card.allowUpgrade": "Allow upgrade (auto may lift to max)",
42
+ "card.unavailable": "Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.",
43
+ "card.readonly": "Read-only"
44
+ };
45
+ //#endregion
46
+ //#region src/client/card.tsx
47
+ /**
48
+ * Thinking-levels settings card — the `settings.plugin.item` face of the
49
+ * dsh-thinking-levels plugin.
50
+ *
51
+ * The card binds the `thinking-levels` settings namespace through the
52
+ * `settingsScope` cordis service and renders its four fields: the level picker
53
+ * (off / low / high / max / auto) plus the three scheduler toggles. Every
54
+ * change commits immediately through the scope (no staged form): the decision
55
+ * is read per model request, so a committed change applies to the next request
56
+ * without a restart.
57
+ *
58
+ * Kept dependency-free beyond react: the scope is subscribed with
59
+ * `useSyncExternalStore`, and the controls are plain HTML so the client bundle
60
+ * needs no CSS modules and no primitives value import.
61
+ */
62
+ /** The five user-facing levels, in picker order. */
63
+ const EFFORT_OPTIONS = [
64
+ "off",
65
+ "low",
66
+ "high",
67
+ "max",
68
+ "auto"
69
+ ];
70
+ /** Minimal shared row styling (inline; keeps the client bundle CSS-free). */
71
+ const rowStyle = {
72
+ display: "flex",
73
+ alignItems: "center",
74
+ justifyContent: "space-between",
75
+ gap: "12px",
76
+ padding: "6px 0",
77
+ fontSize: "13px",
78
+ lineHeight: "20px"
79
+ };
80
+ const labelStyle = {
81
+ margin: 0,
82
+ color: "var(--dsw-alias-label-primary)"
83
+ };
84
+ const controlStyle = {
85
+ background: "var(--dsw-alias-bg-surface, #fff)",
86
+ color: "var(--dsw-alias-label-primary)",
87
+ border: "1px solid var(--dsw-alias-border-l2)",
88
+ borderRadius: "4px",
89
+ padding: "3px 8px",
90
+ fontSize: "13px"
91
+ };
92
+ /** One boolean field row (checkbox) bound to the scope. */
93
+ function ToggleRow(props) {
94
+ const { id, label, checked, disabled, onChange } = props;
95
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
96
+ style: rowStyle,
97
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
98
+ htmlFor: id,
99
+ style: labelStyle,
100
+ children: label
101
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
102
+ id,
103
+ type: "checkbox",
104
+ checked,
105
+ disabled,
106
+ onChange: (event) => onChange(event.currentTarget.checked)
107
+ })]
108
+ });
109
+ }
110
+ /**
111
+ * The card body.
112
+ * @param props - locale copy and the injected settings scope.
113
+ */
114
+ function ThinkingLevelsCard({ t, scope }) {
115
+ const snapshot = (0, react.useSyncExternalStore)((listener) => scope.subscribe(listener), () => scope.getSnapshot());
116
+ const unavailable = snapshot.status === "unavailable";
117
+ const readonly = unavailable || !snapshot.writable;
118
+ const value = snapshot.value ?? {};
119
+ const level = EFFORT_OPTIONS.includes(value.level) ? value.level : "auto";
120
+ if (unavailable) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
121
+ style: {
122
+ padding: "12px 16px",
123
+ fontSize: "13px",
124
+ color: "var(--dsw-alias-label-tertiary)"
125
+ },
126
+ children: t("card.unavailable")
127
+ });
128
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
129
+ style: { padding: "12px 16px" },
130
+ children: [
131
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
132
+ style: rowStyle,
133
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
134
+ htmlFor: "plugin-config-thinking-levels-level",
135
+ style: labelStyle,
136
+ children: t("card.level")
137
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
138
+ id: "plugin-config-thinking-levels-level",
139
+ value: level,
140
+ disabled: readonly,
141
+ style: controlStyle,
142
+ onChange: (event) => {
143
+ scope.set("level", event.currentTarget.value);
144
+ },
145
+ children: EFFORT_OPTIONS.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
146
+ value: option,
147
+ children: t(`card.level.${option}`)
148
+ }, option))
149
+ })]
150
+ }),
151
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleRow, {
152
+ id: "plugin-config-thinking-levels-enabled",
153
+ label: t("card.enabled"),
154
+ checked: value.enabled ?? true,
155
+ disabled: readonly,
156
+ onChange: (next) => {
157
+ scope.set("enabled", next);
158
+ }
159
+ }),
160
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleRow, {
161
+ id: "plugin-config-thinking-levels-downgrade",
162
+ label: t("card.allowDowngrade"),
163
+ checked: value.allowDowngrade ?? true,
164
+ disabled: readonly || value.level !== "auto",
165
+ onChange: (next) => {
166
+ scope.set("allowDowngrade", next);
167
+ }
168
+ }),
169
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleRow, {
170
+ id: "plugin-config-thinking-levels-upgrade",
171
+ label: t("card.allowUpgrade"),
172
+ checked: value.allowUpgrade ?? false,
173
+ disabled: readonly || value.level !== "auto",
174
+ onChange: (next) => {
175
+ scope.set("allowUpgrade", next);
176
+ }
177
+ }),
178
+ !snapshot.writable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
179
+ style: {
180
+ margin: "8px 0 0",
181
+ fontSize: "12px",
182
+ color: "var(--dsw-alias-label-tertiary)"
183
+ },
184
+ children: t("card.readonly")
185
+ })
186
+ ]
187
+ });
188
+ }
189
+ //#endregion
190
+ //#region src/client/index.ts
191
+ /** The settings namespace the host half registers (kept in lockstep with src/index.ts). */
192
+ const THINKING_LEVELS_NS = "thinking-levels";
193
+ /** Services required by the browser half. */
194
+ const inject = [
195
+ "slots",
196
+ "locale",
197
+ "settingsScope"
198
+ ];
199
+ /**
200
+ * Client plugin body: dictionaries plus the settings card registration.
201
+ * @param ctx - client root context.
202
+ */
203
+ function apply(ctx) {
204
+ ctx.effect(() => ctx.locale.register(NS, {
205
+ zh,
206
+ en
207
+ }), "dsh-thinking-levels: dictionaries");
208
+ ctx.slots.inject("settings.plugin.item", function* () {
209
+ yield ctx.slots.register({
210
+ name: "settings.plugin.item",
211
+ key: THINKING_LEVELS_NS,
212
+ locale: NS,
213
+ inject: () => {
214
+ return { scope: ctx.settingsScope.bind({ namespace: THINKING_LEVELS_NS }) };
215
+ }
216
+ }, ThinkingLevelsCard);
217
+ });
218
+ }
219
+ //#endregion
220
+ exports.apply = apply;
221
+ exports.inject = inject;
222
+ return module.exports;
223
+ }
224
+ });
225
+
226
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","names":["useSyncExternalStore"],"sources":["../src/client/locales.ts","../src/client/card.tsx","../src/client/index.ts"],"sourcesContent":["/** `thinking-levels` client dictionaries. */\r\n\r\n/** Dictionary namespace owned by this plugin. */\r\nexport const NS = 'thinking-levels'\r\n\r\n/** Simplified Chinese dictionary (the key-set source of truth). */\r\nexport const zh = {\r\n 'card.title': '思考档位',\r\n 'card.description': '按轮次控制 reasoning_effort:auto 按工具调用历史自动在 low / high / max 间调度,或手动固定档位。',\r\n 'card.level': '档位',\r\n 'card.level.off': 'off — 关闭思考(仅手动,永不自动选择)',\r\n 'card.level.low': 'low — 低(简单任务,廉价轮保持廉价)',\r\n 'card.level.high': 'high — 高(官方默认)',\r\n 'card.level.max': 'max — 最大(重任务)',\r\n 'card.level.auto': 'auto — 按工具历史自动调度',\r\n 'card.enabled': '启用',\r\n 'card.allowDowngrade': '允许降档(auto 可降至 low)',\r\n 'card.allowUpgrade': '允许升档(auto 可升至 max)',\r\n 'card.unavailable': '设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。',\r\n 'card.readonly': '只读',\r\n} satisfies Record<string, string>\r\n\r\n/** English dictionary (keys mirror zh). */\r\nexport const en: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Thinking Levels',\r\n 'card.description': 'Per-round reasoning_effort control: auto schedules between low / high / max from the recent tool-call history, or fix a level manually.',\r\n 'card.level': 'Level',\r\n 'card.level.off': 'off — disable thinking (manual only, never auto-picked)',\r\n 'card.level.low': 'low — cheap rounds stay cheap',\r\n 'card.level.high': 'high — the official default',\r\n 'card.level.max': 'max — heavy work',\r\n 'card.level.auto': 'auto — schedule from tool history',\r\n 'card.enabled': 'Enabled',\r\n 'card.allowDowngrade': 'Allow downgrade (auto may drop to low)',\r\n 'card.allowUpgrade': 'Allow upgrade (auto may lift to max)',\r\n 'card.unavailable': 'Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.',\r\n 'card.readonly': 'Read-only',\r\n}\r\n","/**\r\n * Thinking-levels settings card — the `settings.plugin.item` face of the\r\n * dsh-thinking-levels plugin.\r\n *\r\n * The card binds the `thinking-levels` settings namespace through the\r\n * `settingsScope` cordis service and renders its four fields: the level picker\r\n * (off / low / high / max / auto) plus the three scheduler toggles. Every\r\n * change commits immediately through the scope (no staged form): the decision\r\n * is read per model request, so a committed change applies to the next request\r\n * without a restart.\r\n *\r\n * Kept dependency-free beyond react: the scope is subscribed with\r\n * `useSyncExternalStore`, and the controls are plain HTML so the client bundle\r\n * needs no CSS modules and no primitives value import.\r\n */\r\nimport { useSyncExternalStore } from 'react'\r\nimport type { CSSProperties, JSX } from 'react'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client'\r\nimport type { EffortId } from '../thinking-level.ts'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\n\r\n/** One injected face: the bound settings scope for the `thinking-levels` namespace. */\r\nexport interface ThinkingLevelsCardInjected {\r\n scope: SettingsScope<ThinkingLevelsConfig>\r\n}\r\n\r\n/** Full props: locale seat + the injected scope. */\r\nexport type ThinkingLevelsCardProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected\r\n\r\n/** The five user-facing levels, in picker order. */\r\nconst EFFORT_OPTIONS: readonly EffortId[] = ['off', 'low', 'high', 'max', 'auto']\r\n\r\n/** Minimal shared row styling (inline; keeps the client bundle CSS-free). */\r\nconst rowStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '12px',\r\n padding: '6px 0',\r\n fontSize: '13px',\r\n lineHeight: '20px',\r\n}\r\n\r\nconst labelStyle: CSSProperties = { margin: 0, color: 'var(--dsw-alias-label-primary)' }\r\n\r\nconst controlStyle: CSSProperties = {\r\n background: 'var(--dsw-alias-bg-surface, #fff)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '3px 8px',\r\n fontSize: '13px',\r\n}\r\n\r\n/** One boolean field row (checkbox) bound to the scope. */\r\nfunction ToggleRow(props: {\r\n id: string\r\n label: string\r\n checked: boolean\r\n disabled: boolean\r\n onChange: (next: boolean) => void\r\n}): JSX.Element {\r\n const { id, label, checked, disabled, onChange } = props\r\n return (\r\n <div style={rowStyle}>\r\n <label htmlFor={id} style={labelStyle}>{label}</label>\r\n <input\r\n id={id}\r\n type=\"checkbox\"\r\n checked={checked}\r\n disabled={disabled}\r\n onChange={(event) => onChange(event.currentTarget.checked)}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\n/**\r\n * The card body.\r\n * @param props - locale copy and the injected settings scope.\r\n */\r\nexport function ThinkingLevelsCard({ t, scope }: ThinkingLevelsCardProps): JSX.Element {\r\n const snapshot = useSyncExternalStore(\r\n (listener) => scope.subscribe(listener),\r\n () => scope.getSnapshot(),\r\n )\r\n const unavailable = snapshot.status === 'unavailable'\r\n const readonly = unavailable || !snapshot.writable\r\n const value = (snapshot.value ?? {}) as Partial<ThinkingLevelsConfig>\r\n const level = EFFORT_OPTIONS.includes(value.level as EffortId) ? value.level as EffortId : 'auto'\r\n\r\n if (unavailable) {\r\n return (\r\n <div style={{ padding: '12px 16px', fontSize: '13px', color: 'var(--dsw-alias-label-tertiary)' }}>\r\n {t('card.unavailable')}\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div style={{ padding: '12px 16px' }}>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-level\" style={labelStyle}>{t('card.level')}</label>\r\n <select\r\n id=\"plugin-config-thinking-levels-level\"\r\n value={level}\r\n disabled={readonly}\r\n style={controlStyle}\r\n onChange={(event) => { void scope.set('level', event.currentTarget.value as EffortId) }}\r\n >\r\n {EFFORT_OPTIONS.map((option) => (\r\n <option key={option} value={option}>{t(`card.level.${option}`)}</option>\r\n ))}\r\n </select>\r\n </div>\r\n <ToggleRow\r\n id=\"plugin-config-thinking-levels-enabled\"\r\n label={t('card.enabled')}\r\n checked={value.enabled ?? true}\r\n disabled={readonly}\r\n onChange={(next) => { void scope.set('enabled', next) }}\r\n />\r\n <ToggleRow\r\n id=\"plugin-config-thinking-levels-downgrade\"\r\n label={t('card.allowDowngrade')}\r\n checked={value.allowDowngrade ?? true}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(next) => { void scope.set('allowDowngrade', next) }}\r\n />\r\n <ToggleRow\r\n id=\"plugin-config-thinking-levels-upgrade\"\r\n label={t('card.allowUpgrade')}\r\n checked={value.allowUpgrade ?? false}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(next) => { void scope.set('allowUpgrade', next) }}\r\n />\r\n {!snapshot.writable && <p style={{ margin: '8px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary)' }}>{t('card.readonly')}</p>}\r\n </div>\r\n )\r\n}\r\n","/**\r\n * dsh-thinking-levels — browser half.\r\n *\r\n * Registers the `thinking-levels` dictionaries and one `settings.plugin.item`\r\n * card keyed by the plugin's settings namespace, so the shared Plugins\r\n * settings tab renders an editable card: the level picker (off / low / high /\r\n * max / auto) plus the scheduler toggles.\r\n *\r\n * All @deepseek-ai/* imports are type-only: collaboration happens through\r\n * cordis services (`settingsScope`) and slot registration only (client bundle\r\n * purity).\r\n */\r\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\r\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\r\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\nimport { NS, en, zh } from './locales.ts'\r\nimport { ThinkingLevelsCard, type ThinkingLevelsCardInjected } from './card.tsx'\r\n\r\n/** The settings namespace the host half registers (kept in lockstep with src/index.ts). */\r\nconst THINKING_LEVELS_NS = 'thinking-levels'\r\n\r\n/** Services required by the browser half. */\r\nexport const inject = ['slots', 'locale', 'settingsScope']\r\n\r\n/**\r\n * Client plugin body: dictionaries plus the settings card registration.\r\n * @param ctx - client root context.\r\n */\r\nexport function apply(ctx: ClientContext): void {\r\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-thinking-levels: dictionaries')\r\n\r\n ctx.slots.inject('settings.plugin.item', function* () {\r\n yield ctx.slots.register({\r\n name: 'settings.plugin.item',\r\n key: THINKING_LEVELS_NS,\r\n locale: NS,\r\n inject: (): ThinkingLevelsCardInjected => {\r\n const scope = ctx.settingsScope.bind<ThinkingLevelsConfig>({ namespace: THINKING_LEVELS_NS })\r\n return { scope }\r\n },\r\n }, ThinkingLevelsCard)\r\n })\r\n}\r\n"],"mappings":";;;;;;;;;;;EAGA,MAAa,KAAK;;EAGlB,MAAa,KAAK;GAChB,cAAc;GACd,oBAAoB;GACpB,cAAc;GACd,kBAAkB;GAClB,kBAAkB;GAClB,mBAAmB;GACnB,kBAAkB;GAClB,mBAAmB;GACnB,gBAAgB;GAChB,uBAAuB;GACvB,qBAAqB;GACrB,oBAAoB;GACpB,iBAAiB;EACnB;;EAGA,MAAa,KAAsC;GACjD,cAAc;GACd,oBAAoB;GACpB,cAAc;GACd,kBAAkB;GAClB,kBAAkB;GAClB,mBAAmB;GACnB,kBAAkB;GAClB,mBAAmB;GACnB,gBAAgB;GAChB,uBAAuB;GACvB,qBAAqB;GACrB,oBAAoB;GACpB,iBAAiB;EACnB;;;;;;;;;;;;;;;;;;;ECNA,MAAM,iBAAsC;GAAC;GAAO;GAAO;GAAQ;GAAO;EAAM;;EAGhF,MAAM,WAA0B;GAC9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S;GAAU;EAAe;;;;;EAMzD,SAAgB,MAAM,KAA0B;GAC9C,IAAI,aAAa,IAAI,OAAO,SAAS,IAAI;IAAE;IAAI;GAAG,CAAC,GAAG,mCAAmC;GAEzF,IAAI,MAAM,OAAO,wBAAwB,aAAa;IACpD,MAAM,IAAI,MAAM,SAAS;KACvB,MAAM;KACN,KAAK;KACL,QAAQ;KACR,cAA0C;MAExC,OAAO,EAAE,OADK,IAAI,cAAc,KAA2B,EAAE,WAAW,mBAAmB,CAC9E,EAAE;KACjB;IACF,GAAG,kBAAkB;GACvB,CAAC;EACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-thinking-levels",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "DSH host plugin: thinking-level (reasoning_effort) control for dsh — auto-adjust per tool round, with optional manual lock and per-tool timing telemetry.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,6 +24,9 @@
24
24
  "types": "./lib/thinking-level.d.ts",
25
25
  "default": "./lib/thinking-level.js"
26
26
  },
27
+ "./client": {
28
+ "default": "./lib/client.js"
29
+ },
27
30
  "./package.json": "./package.json"
28
31
  },
29
32
  "engines": {
@@ -41,15 +44,22 @@
41
44
  "@deepseek-ai/cordis": "^4.0.1",
42
45
  "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
43
46
  "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
47
+ "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.7",
48
+ "@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
49
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
50
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
44
51
  "@eslint/js": "^10.0.1",
45
52
  "@types/node": "^24.0.0",
53
+ "@types/react": "~18.3.1",
46
54
  "eslint": "^10.8.1",
55
+ "react": "^18.2.0",
56
+ "tsdown": "^0.22.2",
47
57
  "typescript": "^5.6.0",
48
58
  "typescript-eslint": "^8.67.0",
49
59
  "vitest": "^3.0.0"
50
60
  },
51
61
  "scripts": {
52
- "build": "tsc -p tsconfig.build.json",
62
+ "build": "tsc -p tsconfig.build.json && tsdown",
53
63
  "prepublishOnly": "npm run build",
54
64
  "typecheck": "tsc --noEmit",
55
65
  "lint": "eslint src tests",
@@ -59,6 +69,15 @@
59
69
  "dsh": {
60
70
  "bundle": {
61
71
  "patch": "./cordis.patch.yml"
72
+ },
73
+ "client": {
74
+ "inject": [
75
+ "@deepseek-ai/dsh-client-runtime",
76
+ "@deepseek-ai/dsh-client-locale",
77
+ "@deepseek-ai/dsh-client-ui-slots",
78
+ "@deepseek-ai/dsh-client-ui-settings"
79
+ ],
80
+ "platform": "web"
62
81
  }
63
82
  }
64
83
  }