@dsh-plus/subagent-model 0.1.0 → 0.1.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 CHANGED
@@ -32,6 +32,18 @@ react = __toESM(react);
32
32
  let react_jsx_runtime = require("react/jsx-runtime");
33
33
  react_jsx_runtime = __toESM(react_jsx_runtime);
34
34
 
35
+ //#region src/ns.ts
36
+ /**
37
+ * settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
38
+ * 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
39
+ * settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
40
+ * 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
41
+ * 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
42
+ * @module subagent-model/ns
43
+ */
44
+ const SETTINGS_NS = "dsh-plus-subagent-model";
45
+
46
+ //#endregion
35
47
  //#region src/client/api.ts
36
48
  const ROUTE_CONFIG = "/dsh-plus/subagent-model/config";
37
49
  const ROUTE_CATALOG = "/dsh-plus/subagent-model/catalog";
@@ -610,7 +622,7 @@ function apply(ctx) {
610
622
  }), "subagent-model: locale");
611
623
  c.slots.inject("settings.plugin.item", () => c.slots.register({
612
624
  name: "settings.plugin.item",
613
- id: "subagent-model",
625
+ key: SETTINGS_NS,
614
626
  order: 100,
615
627
  locale: NS,
616
628
  inject: () => ({ t: c.locale.bind(NS) })
package/lib/index.js CHANGED
@@ -2,9 +2,21 @@ import z from "@deepseek-ai/schemastery";
2
2
  import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
3
3
  import { Context, Service } from "@deepseek-ai/cordis";
4
4
 
5
+ //#region src/ns.ts
6
+ /**
7
+ * settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
8
+ * 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
9
+ * settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
10
+ * 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
11
+ * 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
12
+ * @module subagent-model/ns
13
+ */
14
+ const SETTINGS_NS$1 = "dsh-plus-subagent-model";
15
+
16
+ //#endregion
5
17
  //#region src/config.ts
6
- /** settings 命名空间;webui 配置卡片与插件运行期读取同一份。 */
7
- const SETTINGS_NS = settingsNamespace("dsh-plus-subagent-model");
18
+ /** settings 命名空间;webui 配置卡片与插件运行期读取同一份(字面量见 ./ns.ts)。 */
19
+ const SETTINGS_NS = settingsNamespace(SETTINGS_NS$1);
8
20
  /** 思考程度哨兵值:继承主代理(不注入 effort 字段)。 */
9
21
  const EFFORT_INHERIT = "inherit";
10
22
  /** 思考程度哨兵值:跟随模型默认(显式剥离任何继承/推导出的 effort)。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/subagent-model",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "dsh-plus service+ui plugin: 为 subagent/subagent_fork 等子代理按提供商配置模型与思考程度(或继承主代理)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,17 +31,17 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@deepseek-ai/cordis": "4.0.1",
34
- "@deepseek-ai/dsh-settings": "0.1.0-rc.6",
34
+ "@deepseek-ai/dsh-settings": "0.1.0-rc.7",
35
35
  "@deepseek-ai/schemastery": "3.18.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@deepseek-ai/cordis": "4.0.1",
39
39
  "@deepseek-ai/cosmokit": "1.8.2",
40
- "@deepseek-ai/dsh-agent": "0.1.0-rc.6",
41
- "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.6",
42
- "@deepseek-ai/dsh-llm": "0.1.0-rc.6",
43
- "@deepseek-ai/dsh-session": "0.1.0-rc.6",
44
- "@deepseek-ai/dsh-subagent": "0.1.0-rc.6",
40
+ "@deepseek-ai/dsh-agent": "0.1.0-rc.7",
41
+ "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.7",
42
+ "@deepseek-ai/dsh-llm": "0.1.0-rc.7",
43
+ "@deepseek-ai/dsh-session": "0.1.0-rc.7",
44
+ "@deepseek-ai/dsh-subagent": "0.1.0-rc.7",
45
45
  "@types/react": "~18.3.1",
46
46
  "react": "^18.2.0"
47
47
  },
@@ -51,7 +51,7 @@
51
51
  "license": "MIT",
52
52
  "repository": {
53
53
  "type": "git",
54
- "url": "git+https://github.com/A-G-guy/dsh-plugins.git",
54
+ "url": "git+https://github.com/A-G-guy/dsh-plus.git",
55
55
  "directory": "packages/subagent-model"
56
56
  },
57
57
  "scripts": {
@@ -6,10 +6,14 @@
6
6
  * 类型说明:浏览器半只用到 slots/locale 的很窄一面,此处以最小本地接口声明,
7
7
  * 避免为构建期类型引入整条官方 client 依赖树;运行时契约以官方
8
8
  * dsh-client-ui-settings-plugins 的 settings.plugin.item 插槽为准。
9
+ * rc7 起该插槽为 keyed 槽位:key 必须是卡片编辑的 settings 命名空间
10
+ * (即服务端 settingsNamespace() 注册的同一字面量,见 ../ns.ts),
11
+ * 官方配置页按此 key 与 Host 已注册命名空间配对分发。
9
12
  * @module @dsh-plus/subagent-model/client
10
13
  */
11
14
  import type { Context } from '@deepseek-ai/cordis'
12
15
 
16
+ import { SETTINGS_NS } from '../ns.ts'
13
17
  import { SubagentModelCard } from './card.tsx'
14
18
  import { en, NS, zh } from './i18n.ts'
15
19
  import { injectStyle } from './styles.ts'
@@ -52,7 +56,7 @@ export function apply(ctx: Context): void {
52
56
  c.slots.register(
53
57
  {
54
58
  name: 'settings.plugin.item',
55
- id: 'subagent-model',
59
+ key: SETTINGS_NS,
56
60
  order: 100,
57
61
  locale: NS,
58
62
  inject: () => ({ t: c.locale.bind(NS) }),
package/src/config.ts CHANGED
@@ -17,8 +17,10 @@
17
17
  import z from '@deepseek-ai/schemastery'
18
18
  import { settingsNamespace } from '@deepseek-ai/dsh-settings'
19
19
 
20
- /** settings 命名空间;webui 配置卡片与插件运行期读取同一份。 */
21
- export const SETTINGS_NS = settingsNamespace('dsh-plus-subagent-model')
20
+ import { SETTINGS_NS as NS_LITERAL } from './ns.ts'
21
+
22
+ /** settings 命名空间;webui 配置卡片与插件运行期读取同一份(字面量见 ./ns.ts)。 */
23
+ export const SETTINGS_NS = settingsNamespace(NS_LITERAL)
22
24
 
23
25
  /** 思考程度哨兵值:继承主代理(不注入 effort 字段)。 */
24
26
  export const EFFORT_INHERIT = 'inherit'
package/src/ns.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * settings 命名空间字面量(纯常量,零依赖,浏览器半可安全引入)。
3
+ * 服务端经 settingsNamespace() 品牌化后使用(config.ts),浏览器半将其作为
4
+ * settings.plugin.item keyed 槽位的 key —— 同一字面量两处共用,防止漂移。
5
+ * 契约:dsh rc7 起该槽位按「卡片编辑的 settings 命名空间」作 key 分发,
6
+ * 官方配置页只渲染 key 命中 Host 已注册命名空间的卡片。
7
+ * @module subagent-model/ns
8
+ */
9
+ export const SETTINGS_NS = 'dsh-plus-subagent-model'