dsh-subagent-library 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -78,6 +78,8 @@ Settings → 设置 里新增「子代理库」卡片:可视化增删改条目
78
78
  传输层 subagentProvider / 输出上限 maxTokens / 禁用工具 / 深度 / 后台模式 / 角色提示词),写回 `$DSH_HOME/settings.yaml`,热生效。
79
79
  新增卡只收常用字段(ID / 描述 / Provider / 模型 / 传输层 / 输出上限),其余字段(禁用工具 / 深度 / 后台模式 / 角色提示词)在条目卡内编辑。
80
80
 
81
+ > **安全提示**:子代理库的设置接口(`/subagent-library/api`)遵循 DSH Web Host 的本地可信边界,插件自身不含独立身份验证层。若将 DSH Web 绑定到局域网 / 公网 / 反向代理,请在外层配置认证与访问控制,不要把该接口暴露给不可信客户端——子代理 persona 与配置可能包含内部工作规则。
82
+
81
83
  ## 设计说明
82
84
 
83
85
  - 工具注册在 **host 平面**:不依赖任何 agent preset,切 preset 不会丢;
@@ -0,0 +1,96 @@
1
+ # Third-Party Notices
2
+
3
+ This distribution (`dsh-subagent-library`) bundles third-party code **inlined into
4
+ `lib/index.js`** by the build toolchain (tsdown / rolldown). The list below was
5
+ extracted from the shipped bundle's `//#region node_modules/...` comments exactly —
6
+ **not from the lockfile** — and each entry's license was verified against the
7
+ corresponding `LICENSE` file in the vendored package. Packages that never enter the
8
+ bundle (only `@deepseek-ai/cordis` / `@deepseek-ai/schemastery`, which are kept as
9
+ external `peerDependencies`) are deliberately not listed.
10
+
11
+ `lib/client.js` contains **no third-party package code**: the browser side loads
12
+ React / React DOM via external `require("react")` from the host runtime, and the
13
+ `rolldown:runtime` block is generic bundler-generated helper code, not a package.
14
+
15
+ ## Bundled third-party packages / 进 bundle 的第三方包
16
+
17
+ | Package | Version | License | Copyright notice(版权声明原文) |
18
+ |---|---|---|---|
19
+ | `@deepseek-ai/dsh-scope` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
20
+ | `@deepseek-ai/dsh-timeout` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
21
+ | `@deepseek-ai/dsh-llm` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
22
+ | `@deepseek-ai/dsh-session` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
23
+ | `@deepseek-ai/dsh-tools` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
24
+ | `@deepseek-ai/dsh-subagent` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
25
+ | `@deepseek-ai/dsh-settings` | 0.1.0-rc.6 | MIT | Copyright (c) 2026 DeepSeek |
26
+ | `zod` | 4.4.3 | MIT | Copyright (c) 2025 Colin McDonnell |
27
+
28
+ ## Verification / 查证说明
29
+
30
+ - All 8 packages are **MIT License**. None is Apache-2.0; no upstream package ships a
31
+ `NOTICE` file, so there are no additional NOTICE obligations beyond keeping the
32
+ copyright + permission notice.
33
+ - The per-package `LICENSE` texts are reproduced verbatim below (two copyright holders:
34
+ DeepSeek 2026 for the seven `@deepseek-ai/*` packages, Colin McDonnell 2025 for zod).
35
+ - `lib/client.js` is excluded from the list by design: React 等浏览器端依赖由宿主运行时以
36
+ 外部 `require("react")` 提供,不随本包分发。
37
+
38
+ ## License texts(许可证原文,逐字摘自各上游包 LICENSE 文件)
39
+
40
+ ### MIT License — Copyright (c) 2026 DeepSeek
41
+
42
+ (`@deepseek-ai/dsh-scope`、`@deepseek-ai/dsh-timeout`、`@deepseek-ai/dsh-llm`、
43
+ `@deepseek-ai/dsh-session`、`@deepseek-ai/dsh-tools`、`@deepseek-ai/dsh-subagent`、
44
+ `@deepseek-ai/dsh-settings` 七个包,文本完全相同)
45
+
46
+ ```text
47
+ MIT License
48
+
49
+ Copyright (c) 2026 DeepSeek
50
+
51
+ Permission is hereby granted, free of charge, to any person obtaining a copy
52
+ of this software and associated documentation files (the "Software"), to deal
53
+ in the Software without restriction, including without limitation the rights
54
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55
+ copies of the Software, and to permit persons to whom the Software is
56
+ furnished to do so, subject to the following conditions:
57
+
58
+ The above copyright notice and this permission notice shall be included in all
59
+ copies or substantial portions of the Software.
60
+
61
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67
+ SOFTWARE.
68
+ ```
69
+
70
+ ### MIT License — Copyright (c) 2025 Colin McDonnell
71
+
72
+ (`zod`)
73
+
74
+ ```text
75
+ MIT License
76
+
77
+ Copyright (c) 2025 Colin McDonnell
78
+
79
+ Permission is hereby granted, free of charge, to any person obtaining a copy
80
+ of this software and associated documentation files (the "Software"), to deal
81
+ in the Software without restriction, including without limitation the rights
82
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
83
+ copies of the Software, and to permit persons to whom the Software is
84
+ furnished to do so, subject to the following conditions:
85
+
86
+ The above copyright notice and this permission notice shall be included in all
87
+ copies or substantial portions of the Software.
88
+
89
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
90
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
91
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
92
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
94
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
95
+ SOFTWARE.
96
+ ```
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { Context, Service } from "@deepseek-ai/cordis";
4
4
 
5
- //#region node_modules/.pnpm/@deepseek-ai+dsh-scope@0.1._6f3351786c779449c277f079a737f571/node_modules/@deepseek-ai/dsh-scope/lib/index.js
5
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-scope@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-invariants_6f3351786c779449c277f079a737f571/node_modules/@deepseek-ai/dsh-scope/lib/index.js
6
6
  /**
7
7
  * Shared insertion-ordered storage and effect ownership for scope-aware registries.
8
8
  *
@@ -282,12 +282,12 @@ function scopeTarget(base, key) {
282
282
  }
283
283
 
284
284
  //#endregion
285
- //#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0._8c173ab999b05cf1db05d479dd44e888/node_modules/@deepseek-ai/dsh-timeout/lib/index.js
285
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-timeout@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-invarian_8c173ab999b05cf1db05d479dd44e888/node_modules/@deepseek-ai/dsh-timeout/lib/index.js
286
286
  /** Largest delay Node schedules without clamping it to one millisecond. */
287
287
  const MAX_TIMER_DELAY_MS = 2147483647;
288
288
 
289
289
  //#endregion
290
- //#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.1.0-_4ed4e5c71eb965b0bd6912871e829940/node_modules/@deepseek-ai/dsh-llm/lib/index.js
290
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-llm@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-attachment@0_4ed4e5c71eb965b0bd6912871e829940/node_modules/@deepseek-ai/dsh-llm/lib/index.js
291
291
  /**
292
292
  * Brand a string as a {@link CallId}.
293
293
  * @param id - the provider-issued (or synthesized) call id.
@@ -442,7 +442,7 @@ function assertNever(value, context) {
442
442
  }
443
443
 
444
444
  //#endregion
445
- //#region node_modules/.pnpm/@deepseek-ai+dsh-session@0._959f4648d9537c86268b5de534a89875/node_modules/@deepseek-ai/dsh-session/lib/index.js
445
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-session@0.1.0-rc.6_6fd26f59436a18b115f326d6060415e6/node_modules/@deepseek-ai/dsh-session/lib/index.js
446
446
  /** Lossless-JSON validation and detached snapshots for durable session data. @module @deepseek-ai/dsh-session/json */
447
447
  /** Whether a realm-owned intrinsic prototype is backed by its native constructor. */
448
448
  function hasIntrinsicConstructor$1(prototype, name$1) {
@@ -647,7 +647,7 @@ var SessionPreparation = class SessionPreparation$1 {
647
647
  };
648
648
 
649
649
  //#endregion
650
- //#region node_modules/.pnpm/@deepseek-ai+dsh-tools@0.1._d489cb013f2a8725198f1fce9da6f626/node_modules/@deepseek-ai/dsh-tools/lib/index.js
650
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-tools@0.1.0-rc.6_f8724372086ccc1457fc84e7becee2e0/node_modules/@deepseek-ai/dsh-tools/lib/index.js
651
651
  /**
652
652
  * Enforced JSON Schema subset shared by tool outputs, generated Code Mode
653
653
  * types, subagents, and workflows. The subset accepts any JSON root, an
@@ -8261,7 +8261,7 @@ const describe = describe$1;
8261
8261
  const meta = meta$1;
8262
8262
 
8263
8263
  //#endregion
8264
- //#region node_modules/.pnpm/@deepseek-ai+dsh-subagent@0_3df74c1b55f479c797399aa68ffa64be/node_modules/@deepseek-ai/dsh-subagent/lib/index.js
8264
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-subagent@0.1.0-rc.6_8b00c1f8ce51e08c328cf93c42b529f7/node_modules/@deepseek-ai/dsh-subagent/lib/index.js
8265
8265
  /**
8266
8266
  * Reject a recursion cap that cannot represent an exact delegation depth.
8267
8267
  * @param maxDepth - the optional runtime value to validate.
@@ -8451,7 +8451,7 @@ async function settleRun(run) {
8451
8451
  }
8452
8452
 
8453
8453
  //#endregion
8454
- //#region node_modules/.pnpm/@deepseek-ai+dsh-settings@0_52495af71738a1095726249ceff4fd7b/node_modules/@deepseek-ai/dsh-settings/lib/index.js
8454
+ //#region node_modules/.pnpm/@deepseek-ai+dsh-settings@0.1.0-rc.6_@deepseek-ai+cordis@4.0.1_@deepseek-ai+dsh-brand@0_52495af71738a1095726249ceff4fd7b/node_modules/@deepseek-ai/dsh-settings/lib/index.js
8455
8455
  /**
8456
8456
  * Structural secret redaction for settings values. `role('secret')` fields are
8457
8457
  * removed from a value before it crosses a wire boundary; a sidecar records
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-library",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Named subagent library for DeepSeek Harness: a settings-driven roster of role subagents (model + persona + tool filter), exposed to every session through the list_subagents and delegate tools, a /subagent command, and a Settings page.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -11,6 +11,7 @@
11
11
  ],
12
12
  "type": "module",
13
13
  "main": "lib/index.js",
14
+ "packageManager": "pnpm@11.21.0",
14
15
  "engines": {
15
16
  "node": ">=22"
16
17
  },
@@ -33,10 +34,12 @@
33
34
  "./package.json": "./package.json"
34
35
  },
35
36
  "files": [
36
- "lib",
37
+ "lib/index.js",
38
+ "lib/client.js",
37
39
  "cordis.patch.yml",
38
40
  "README.md",
39
- "LICENSE"
41
+ "LICENSE",
42
+ "THIRD_PARTY_NOTICES.md"
40
43
  ],
41
44
  "dsh": {
42
45
  "bundle": {
@@ -52,6 +55,14 @@
52
55
  "platform": "web"
53
56
  }
54
57
  },
58
+ "scripts": {
59
+ "build": "tsdown",
60
+ "typecheck": "tsc --noEmit",
61
+ "test": "tsx --test tests/api.test.ts tests/tools.test.ts",
62
+ "smoke": "node scripts/smoke-host.mjs && node scripts/smoke-client.mjs",
63
+ "check:pack": "node scripts/check-pack.mjs",
64
+ "prepack": "pnpm run build"
65
+ },
55
66
  "license": "MIT",
56
67
  "peerDependencies": {
57
68
  "@deepseek-ai/cordis": "^4.0.1",
@@ -84,12 +95,5 @@
84
95
  "tsdown": "^0.15.0",
85
96
  "tsx": "^4.19.0",
86
97
  "typescript": "^5.7.0"
87
- },
88
- "scripts": {
89
- "build": "tsdown",
90
- "typecheck": "tsc --noEmit",
91
- "test": "tsx --test tests/api.test.ts tests/tools.test.ts",
92
- "smoke": "node scripts/smoke-host.mjs && node scripts/smoke-client.mjs",
93
- "check:pack": "node scripts/check-pack.mjs"
94
98
  }
95
- }
99
+ }
package/lib/client.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","names":["readView","writeView","clean: StoredEntry","zh: Record<SubagentLibraryKey, string>","en: Record<SubagentLibraryKey, string>","ERROR_TEXT: Record<string, string>","body: unknown"],"sources":["../src/client/LibrarySettings.tsx","../src/client/locales.ts","../src/client/index.tsx"],"sourcesContent":["/**\n * Settings section: edit the subagent library document through the plugin's\n * own host routes. A `settings-conflict` (409) reloads instead of clobbering\n * a concurrent change.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { LibraryView, LibraryWrite, LibraryWriteResult, StoredEntry } from './index.tsx'\n\nexport interface LibrarySettingsInjected {\n readView: () => Promise<LibraryView>\n writeView: (write: LibraryWrite) => Promise<LibraryWriteResult>\n /** Re-run the loader on any pushed `settings/document-updated` for this\n * namespace; the push's revision lets the section skip its own echo. */\n subscribeRefresh: (fn: (revision?: number) => void) => () => void\n}\n\nexport type LibrarySettingsProps =\n PropsRuntime<'settings.section'>\n & InjectFace<LibrarySettingsInjected>\n\nexport function LibrarySettings(props: LibrarySettingsProps): React.ReactElement {\n const { readView, writeView, subscribeRefresh } = props\n\n const [view, setView] = useState<LibraryView | null>(null)\n const [entries, setEntries] = useState<Record<string, StoredEntry>>({})\n const [busy, setBusy] = useState(false)\n const [status, setStatus] = useState<{ kind: 'ok' | 'error'; text: string } | null>(null)\n const [newId, setNewId] = useState('')\n const [newEntry, setNewEntry] = useState<StoredEntry>({ description: '', provider: '', model: '', backgroundMode: 'one-shot' })\n\n const alive = useRef(true)\n /** Synchronous busy flag (see applyWrite's re-entry guard). */\n const busyRef = useRef(false)\n useEffect(() => () => { alive.current = false }, [])\n\n /** Revision of the last committed server state (successful write or load).\n * document-updated pushes at or below it are our own write's echo and are\n * skipped — applyWrite already merged the touched row, and a full reload\n * here would wipe unsaved drafts in other rows. External pushes (higher\n * revisions) still reload. */\n const lastCommitted = useRef<number | null>(null)\n /** True while a write request is in flight: the push and the HTTP response\n * travel on independent channels, so a push may arrive before the response\n * commits our state. Everything in this window is skipped and the newest\n * skipped revision is re-checked after the response. */\n const pendingSelfWrite = useRef(false)\n const skippedWhilePending = useRef<number | null>(null)\n\n const load = (): void => {\n void (async () => {\n try {\n const next = await readView()\n if (!alive.current) return\n lastCommitted.current = next.revision\n setView(next)\n setEntries(structuredClone(next.entries))\n } catch (error) {\n if (alive.current) setStatus({ kind: 'error', text: String(error) })\n }\n })()\n }\n\n useEffect(() => {\n load()\n return subscribeRefresh((revision) => {\n if (pendingSelfWrite.current) {\n if (revision !== undefined) skippedWhilePending.current = Math.max(skippedWhilePending.current ?? -1, revision)\n return\n }\n if (revision !== undefined && lastCommitted.current !== null && revision <= lastCommitted.current) return\n load()\n })\n }, [subscribeRefresh])\n\n const applyWrite = async (write: LibraryWrite, touchedId: string): Promise<boolean> => {\n // Synchronous re-entry guard: setBusy is async state, so two clicks in the\n // same frame would both fire applyWrite with one expectedRevision and the\n // second would 409 — then reload and wipe drafts in other rows.\n if (busyRef.current) return false\n busyRef.current = true\n setBusy(true)\n setStatus(null)\n pendingSelfWrite.current = true\n try {\n const result = await writeView(write)\n if (!alive.current) return false\n pendingSelfWrite.current = false\n const skipped = skippedWhilePending.current\n skippedWhilePending.current = null\n if (result.ok) {\n lastCommitted.current = result.view.revision\n setView(result.view)\n // Merge only the row this write touched (fresh server value);\n // unsaved drafts in other rows survive — they are never persisted,\n // because save bases on view.entries.\n setEntries((current) => {\n const next = { ...current }\n const fresh = result.view.entries[touchedId]\n if (fresh !== undefined) next[touchedId] = structuredClone(fresh)\n else delete next[touchedId]\n return next\n })\n setStatus({ kind: 'ok', text: '已保存' })\n // A push skipped while the write was in flight may have carried a\n // newer external change; reload to pick it up.\n if (skipped !== null && skipped > result.view.revision) load()\n return true\n }\n skippedWhilePending.current = null\n if (result.conflict) {\n setStatus({ kind: 'error', text: '配置已被其他窗口修改,已重新加载,请重试。' })\n load()\n } else {\n // A push skipped while the failed write was in flight may have\n // carried a newer external change; our write did not advance the\n // revision, so reload when that skipped change is beyond what we\n // last committed.\n if (skipped !== null && lastCommitted.current !== null && skipped > lastCommitted.current) load()\n setStatus({ kind: 'error', text: result.message ?? '保存失败' })\n }\n return false\n } finally {\n pendingSelfWrite.current = false\n busyRef.current = false\n if (alive.current) setBusy(false)\n }\n }\n\n /** Normalize one entry for persistence: empty optional fields are dropped\n * (they then fall back to their defaults instead of being stored as '' or\n * stale values), and toolFilter survives only while it still scopes\n * something — an allow list alone must NOT be deleted by an editor that\n * only shows deny. */\n const cleanEntry = (entry: StoredEntry): StoredEntry => {\n const clean: StoredEntry = { ...entry }\n if (clean.provider === '') delete clean.provider\n if (clean.model === '') delete clean.model\n if (clean.subagentProvider === '') delete clean.subagentProvider\n if (clean.persona === '') delete clean.persona\n if (clean.description === '') delete clean.description\n if (clean.maxDepth === undefined) delete clean.maxDepth\n if (clean.maxTokens === undefined) delete clean.maxTokens\n const filter = clean.toolFilter\n if (filter !== undefined\n && (filter.allow === undefined || filter.allow.length === 0)\n && (filter.deny === undefined || filter.deny.length === 0)) {\n delete clean.toolFilter\n }\n return clean\n }\n\n const updateEntry = (id: string, entry: StoredEntry): void => {\n if ((entry.description ?? '').trim() === '') {\n setStatus({ kind: 'error', text: '描述不能为空。' })\n return\n }\n if (entry.maxDepth !== undefined && (!Number.isInteger(entry.maxDepth) || entry.maxDepth < 1)) {\n setStatus({ kind: 'error', text: '深度上限需为 ≥1 的整数。' })\n return\n }\n if (entry.maxTokens !== undefined && (!Number.isInteger(entry.maxTokens) || entry.maxTokens < 1)) {\n setStatus({ kind: 'error', text: '输出上限需为 ≥1 的整数。' })\n return\n }\n // Save against the server truth, not the local snapshot: an unsaved draft\n // in another row must never be silently persisted by this row's button.\n void applyWrite({ op: 'save', entries: { ...(view?.entries ?? {}), [id]: cleanEntry(entry) }, expectedRevision: view?.revision }, id)\n }\n\n const removeEntry = (id: string): void => {\n if (!window.confirm(`确认删除子代理 \"${id}\"?该操作立即写入 settings.yaml。`)) return\n void applyWrite({ op: 'delete', id, expectedRevision: view?.revision }, id)\n }\n\n const addEntry = (): void => {\n const id = newId.trim()\n if (!/^[a-z0-9][a-z0-9-]*$/.test(id) || (newEntry.description ?? '').trim() === '') {\n setStatus({ kind: 'error', text: 'ID 需为小写字母/数字/连字符,且必须有描述。' })\n return\n }\n const serverEntries = view?.entries ?? {}\n if (serverEntries[id] !== undefined) {\n setStatus({ kind: 'error', text: `ID \"${id}\" 已存在。` })\n return\n }\n if (newEntry.maxTokens !== undefined && (!Number.isInteger(newEntry.maxTokens) || newEntry.maxTokens < 1)) {\n setStatus({ kind: 'error', text: '输出上限需为 ≥1 的整数。' })\n return\n }\n void applyWrite({ op: 'save', entries: { ...serverEntries, [id]: cleanEntry(newEntry) }, expectedRevision: view?.revision }, id).then((ok) => {\n if (alive.current && ok) {\n setNewId('')\n setNewEntry({ description: '', provider: '', model: '', backgroundMode: 'one-shot' })\n }\n })\n }\n\n const rowStyle = { display: 'flex', alignItems: 'center', gap: '8px' } as const\n /** Shrinkable multi-column row: min-width 0 lets inputs shrink below their\n * intrinsic width instead of overflowing the settings card (form controls\n * otherwise keep their default width as a flex minimum). */\n const colStyle = { ...rowStyle, flex: 1, minWidth: 0 } as const\n const labelStyle = { fontSize: '13px', opacity: 0.85, minWidth: '72px' } as const\n const inputStyle = {\n flex: 1,\n minWidth: 0,\n fontSize: '13px',\n fontFamily: 'monospace',\n padding: '4px 8px',\n border: '1px solid var(--dsh-color-border, #3a3f4b)',\n borderRadius: '4px',\n background: 'transparent',\n color: 'inherit',\n } as const\n const buttonStyle = {\n padding: '3px 12px',\n fontSize: '12px',\n cursor: 'pointer',\n opacity: busy ? 0.55 : 1,\n } as const\n const cardStyle = {\n display: 'flex',\n flexDirection: 'column',\n gap: '6px',\n padding: '10px 12px',\n border: '1px solid var(--dsh-color-border, #3a3f4b)',\n borderRadius: '6px',\n } as const\n const hintStyle = { fontSize: '11px', opacity: 0.6, marginTop: '2px' } as const\n\n if (view === null) {\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: '8px', padding: '12px 4px' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <div style={{ fontSize: '15px', fontWeight: 600 }}>子代理库</div>\n <button type=\"button\" onClick={load} style={{ ...buttonStyle, opacity: 0.7 }}>重试</button>\n </div>\n {status !== null && (\n <div style={{ fontSize: '12px', color: status.kind === 'ok' ? 'var(--dsh-color-success, #30a46c)' : 'var(--dsh-color-danger, #e5484d)', whiteSpace: 'pre-wrap' }}>\n {status.text}\n </div>\n )}\n {status === null && <div style={{ fontSize: '13px', opacity: 0.8 }}>正在加载…(若长时间无响应,请重试或检查插件是否加载)</div>}\n </div>\n )\n }\n\n const ids = Object.keys(entries)\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: '10px', padding: '12px 4px', maxWidth: '720px' }}>\n <div style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <div style={{ fontSize: '15px', fontWeight: 600 }}>子代理库</div>\n <button type=\"button\" onClick={load} style={{ ...buttonStyle, opacity: 0.7 }}>刷新</button>\n </div>\n <span style={hintStyle}>管理具名角色子代理。保存后热生效:模型可在任意会话通过 list_subagents / delegate 使用。</span>\n </div>\n\n {!view.writable && <div style={{ fontSize: '12px', opacity: 0.7 }}>(当前设置只读)</div>}\n\n {ids.length === 0 && (\n <div style={{ fontSize: '13px', opacity: 0.8 }}>库为空。添加第一个条目开始使用。</div>\n )}\n\n {ids.map((id) => {\n const entry = entries[id]\n return (\n <div key={id} style={cardStyle}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <span style={{ fontSize: '13px', fontWeight: 600, fontFamily: 'monospace' }}>{id}</span>\n <span style={{ fontSize: '11px', opacity: 0.7 }}>\n {entry.provider || '默认路由'}/{entry.model || '默认模型'}\n {entry.backgroundMode === 'continuable' ? ' · 可续聊' : ''}\n {entry.maxDepth !== undefined ? ` · 深度${entry.maxDepth}` : ''}\n {entry.maxTokens !== undefined ? ` · ${entry.maxTokens}tok` : ''}\n </span>\n <span style={{ flex: 1 }} />\n <button type=\"button\" disabled={busy || !view.writable} onClick={() => removeEntry(id)} style={buttonStyle}>删除</button>\n <button type=\"button\" disabled={busy || !view.writable} onClick={() => updateEntry(id, entry)} style={buttonStyle}>保存</button>\n </div>\n\n <div style={rowStyle}>\n <span style={labelStyle}>描述</span>\n <input\n value={entry.description ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, description: event.target.value } })}\n placeholder=\"角色描述(模型可见)\"\n style={inputStyle}\n />\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>Provider</span>\n <input\n value={entry.provider ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, provider: event.target.value } })}\n placeholder=\"deepseek-official / kimi-coding\"\n style={inputStyle}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>模型</span>\n <input\n value={entry.model ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, model: event.target.value } })}\n placeholder=\"k3-256k\"\n style={inputStyle}\n />\n </div>\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>传输层</span>\n <input\n value={entry.subagentProvider ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, subagentProvider: event.target.value } })}\n placeholder=\"spawn(默认)\"\n style={inputStyle}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>输出上限</span>\n <input\n type=\"number\"\n min={1}\n value={entry.maxTokens ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, maxTokens: event.target.value === '' ? undefined : Number(event.target.value) } })}\n placeholder=\"tokens\"\n style={{ ...inputStyle, maxWidth: '110px' }}\n />\n </div>\n </div>\n\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>深度上限</span>\n <input\n type=\"number\"\n min={1}\n value={entry.maxDepth ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, maxDepth: event.target.value === '' ? undefined : Number(event.target.value) } })}\n style={{ ...inputStyle, maxWidth: '80px' }}\n />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>后台模式</span>\n <select\n value={entry.backgroundMode ?? 'one-shot'}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, backgroundMode: event.target.value as 'one-shot' | 'continuable' } })}\n style={{ ...inputStyle, maxWidth: '140px' }}\n >\n <option value=\"one-shot\">one-shot</option>\n <option value=\"continuable\">continuable</option>\n </select>\n </div>\n <div style={{ ...colStyle, flex: 2 }}>\n <span style={labelStyle}>禁用工具</span>\n <input\n value={(entry.toolFilter?.deny ?? []).join(', ')}\n onChange={(event) => {\n const deny = event.target.value.split(',').map((item) => item.trim()).filter(Boolean)\n // The editor only shows deny; a hand-written allow list is\n // preserved so an edit to deny cannot silently drop it.\n const allow = entry.toolFilter?.allow\n setEntries({\n ...entries,\n [id]: {\n ...entry,\n toolFilter: (allow !== undefined && allow.length > 0) || deny.length > 0\n ? {\n ...(allow !== undefined && allow.length > 0 ? { allow } : {}),\n ...(deny.length > 0 ? { deny } : {}),\n }\n : undefined,\n },\n })\n }}\n placeholder=\"write, edit, todo_write, …\"\n style={inputStyle}\n />\n </div>\n </div>\n\n <div style={rowStyle}>\n <span style={labelStyle}>角色提示词</span>\n <textarea\n value={entry.persona ?? ''}\n onChange={(event) => setEntries({ ...entries, [id]: { ...entry, persona: event.target.value } })}\n placeholder=\"子代理的系统提示词(可选)\"\n rows={3}\n style={{ ...inputStyle, resize: 'vertical', fontFamily: 'inherit' }}\n />\n </div>\n </div>\n )\n })}\n\n {/* Add-card mirrors the entry-card rhythm: header row with the action\n button on the right, then one label row per field group. */}\n <div style={cardStyle}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>\n <span style={{ fontSize: '13px', fontWeight: 600 }}>新增子代理</span>\n <span style={{ flex: 1 }} />\n <button type=\"button\" disabled={busy || !view.writable} onClick={addEntry} style={buttonStyle}>添加</button>\n </div>\n <div style={rowStyle}>\n <span style={labelStyle}>ID</span>\n <input value={newId} onChange={(event) => setNewId(event.target.value)} placeholder=\"k3-reviewer\" style={{ ...inputStyle, maxWidth: '200px' }} />\n </div>\n <div style={rowStyle}>\n <span style={labelStyle}>描述</span>\n <input\n value={newEntry.description ?? ''}\n onChange={(event) => setNewEntry({ ...newEntry, description: event.target.value })}\n placeholder=\"角色描述(模型可见)\"\n style={inputStyle}\n />\n </div>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>Provider</span>\n <input value={newEntry.provider ?? ''} onChange={(event) => setNewEntry({ ...newEntry, provider: event.target.value })} placeholder=\"kimi-coding\" style={inputStyle} />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>模型</span>\n <input value={newEntry.model ?? ''} onChange={(event) => setNewEntry({ ...newEntry, model: event.target.value })} placeholder=\"k3-256k\" style={inputStyle} />\n </div>\n </div>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '8px' }}>\n <div style={colStyle}>\n <span style={labelStyle}>传输层</span>\n <input value={newEntry.subagentProvider ?? ''} onChange={(event) => setNewEntry({ ...newEntry, subagentProvider: event.target.value })} placeholder=\"spawn(默认)\" style={inputStyle} />\n </div>\n <div style={colStyle}>\n <span style={labelStyle}>输出上限</span>\n <input\n type=\"number\"\n min={1}\n value={newEntry.maxTokens ?? ''}\n onChange={(event) => setNewEntry({ ...newEntry, maxTokens: event.target.value === '' ? undefined : Number(event.target.value) })}\n placeholder=\"tokens(可选)\"\n style={{ ...inputStyle, maxWidth: '110px' }}\n />\n </div>\n </div>\n </div>\n\n {status !== null && (\n <div style={{ fontSize: '12px', color: status.kind === 'ok' ? 'var(--dsh-color-success, #30a46c)' : 'var(--dsh-color-danger, #e5484d)' }}>\n {status.text}\n </div>\n )}\n\n <div style={{ fontSize: '11px', opacity: 0.55, paddingTop: '4px' }}>配置存储于 $DSH_HOME/settings.yaml 的 subagent-library.entries。</div>\n </div>\n )\n}\n","/**\n * 子代理库设置词典(最少化:zh 主、en 兜底)。\n * The namespace merge into LocaleNamespaceMap is what makes the slot-level\n * `locale` seat and the typed `t` prop work.\n */\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'subagent-library': SubagentLibraryKey\n }\n}\n\nexport type SubagentLibraryKey =\n | 'settings.title'\n | 'settings.hint'\n | 'settings.empty'\n | 'settings.missing'\n | 'settings.add'\n | 'settings.addNew'\n | 'settings.delete'\n | 'settings.save'\n | 'settings.saved'\n | 'settings.conflict'\n | 'settings.error'\n | 'settings.id'\n | 'settings.description'\n | 'settings.model'\n | 'settings.persona'\n | 'settings.toolFilter'\n | 'settings.maxDepth'\n | 'settings.background'\n | 'settings.provider'\n | 'settings.sourceHint'\n\nexport const zh: Record<SubagentLibraryKey, string> = {\n 'settings.title': '子代理库',\n 'settings.hint': '管理具名角色子代理。保存后热生效:模型可在任意会话通过 list_subagents / delegate 使用。',\n 'settings.empty': '库为空。添加第一个条目开始使用。',\n 'settings.missing': '未找到 subagent-library 配置段(插件未加载?)。',\n 'settings.add': '添加',\n 'settings.addNew': '新增子代理',\n 'settings.delete': '删除',\n 'settings.save': '保存',\n 'settings.saved': '已保存',\n 'settings.conflict': '配置已被其他窗口修改,已重新加载,请重试。',\n 'settings.error': '保存失败:',\n 'settings.id': 'ID',\n 'settings.description': '描述',\n 'settings.model': '模型',\n 'settings.persona': '角色提示词',\n 'settings.toolFilter': '禁用工具',\n 'settings.maxDepth': '深度上限',\n 'settings.background': '后台模式',\n 'settings.provider': 'Provider',\n 'settings.sourceHint': '配置存储于 $DSH_HOME/settings.yaml 的 subagent-library.entries。',\n}\n\nexport const en: Record<SubagentLibraryKey, string> = {\n 'settings.title': 'Subagent Library',\n 'settings.hint': 'Manage named role subagents. Changes apply live: models use them via list_subagents / delegate in any session.',\n 'settings.empty': 'Library is empty. Add the first entry to get started.',\n 'settings.missing': 'No subagent-library section found (plugin not loaded?).',\n 'settings.add': 'Add',\n 'settings.addNew': 'New subagent',\n 'settings.delete': 'Delete',\n 'settings.save': 'Save',\n 'settings.saved': 'Saved',\n 'settings.conflict': 'Config changed elsewhere; reloaded — please retry.',\n 'settings.error': 'Save failed: ',\n 'settings.id': 'ID',\n 'settings.description': 'Description',\n 'settings.model': 'Model',\n 'settings.persona': 'Persona',\n 'settings.toolFilter': 'Denied tools',\n 'settings.maxDepth': 'Max depth',\n 'settings.background': 'Background',\n 'settings.provider': 'Provider',\n 'settings.sourceHint': 'Stored at $DSH_HOME/settings.yaml under subagent-library.entries.',\n}\n","/**\n * dsh-subagent-library — browser half.\n *\n * A Settings section card (\"子代理库\") that reads and edits the\n * `subagent-library` settings namespace through the plugin's own host routes\n * (`/subagent-library/api`). The standard `api.settings.*` wire face cannot\n * serve a third-party namespace in this harness build (the gateway only\n * exposes its own allowlist), so the editor talks to the host directly,\n * exactly like dsh-plugin-fish-tts does.\n */\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\nimport { LibrarySettings, type LibrarySettingsInjected } from './LibrarySettings.tsx'\nimport { en, zh } from './locales.ts'\n\nconst NS = 'subagent-library'\nconst API_PATH = '/subagent-library/api'\n\n/** Wire view of one library entry as stored in the settings document. */\nexport interface StoredEntry {\n description?: string\n provider?: string\n model?: string\n subagentProvider?: string\n maxTokens?: number\n persona?: string\n toolFilter?: { allow?: string[]; deny?: string[] }\n maxDepth?: number\n backgroundMode?: 'one-shot' | 'continuable'\n}\n\nexport interface LibraryView {\n writable: boolean\n revision: number\n entries: Record<string, StoredEntry>\n}\n\nexport type LibraryWrite =\n | { op: 'save'; entries: Record<string, StoredEntry>; expectedRevision?: number }\n | { op: 'delete'; id: string; expectedRevision?: number }\n\nexport type LibraryWriteResult =\n | { ok: true; view: LibraryView }\n | { ok: false; conflict?: boolean; message?: string }\n\n/** Host error codes that carry no `message`; map them to user-facing text. */\nconst ERROR_TEXT: Record<string, string> = {\n 'not-ready': '设置服务尚未就绪,请稍后重试。',\n 'readonly': '设置当前为只读,无法写入。',\n 'content-type-json-required': '请求被拒绝:写入只接受 JSON。',\n 'cross-origin-forbidden': '请求被拒绝:跨源写入。',\n 'body-too-large': '请求体超过 1 MiB 上限。',\n 'bad-json': '请求体不是合法 JSON。',\n 'entries-object-required': '缺少 entries 对象。',\n 'invalid-id': '条目 ID 非法。',\n 'unknown-op': '未知操作。',\n}\n\nasync function readView(): Promise<LibraryView> {\n const response = await fetch(API_PATH, { cache: 'no-store' })\n const body: unknown = await response.json()\n if (!response.ok || typeof body !== 'object' || body === null || (body as { ok?: boolean }).ok !== true) {\n const error = (body as { error?: string } | null)?.error\n // A diagnostic `message` (e.g. settings-seam registration failure) wins\n // over the generic per-code text.\n const message = (body as { message?: string } | null)?.message\n throw new Error(message ?? (error !== undefined ? ERROR_TEXT[error] : undefined) ?? '子代理库接口不可用(插件未加载?)')\n }\n const value = body as { writable: boolean; revision: number; entries: Record<string, StoredEntry> }\n return { writable: value.writable, revision: value.revision, entries: value.entries ?? {} }\n}\n\nasync function writeView(write: LibraryWrite): Promise<LibraryWriteResult> {\n try {\n const response = await fetch(API_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(write),\n cache: 'no-store',\n })\n const body: unknown = await response.json()\n if (response.status === 409) return { ok: false, conflict: true }\n if (!response.ok || typeof body !== 'object' || body === null || (body as { ok?: boolean }).ok !== true) {\n const message = (body as { message?: string } | null)?.message\n const error = (body as { error?: string } | null)?.error\n return { ok: false, message: message ?? (error !== undefined ? ERROR_TEXT[error] : undefined) ?? '保存失败' }\n }\n const value = body as { writable: boolean; revision: number; entries: Record<string, StoredEntry> }\n return { ok: true, view: { writable: value.writable, revision: value.revision, entries: value.entries ?? {} } }\n } catch (error) {\n return { ok: false, message: String(error) }\n }\n}\n\nexport const inject = ['slots', 'locale', 'remote']\n\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'subagent-library: dictionaries')\n\n // Pushed invalidation: any committed change to the subagent-library\n // namespace re-reads the document. The push carries the new revision so a\n // subscriber can tell its own write's echo (≤ last committed) from an\n // external change without racing the write response.\n const listeners = new Set<(revision?: number) => void>()\n const subscribeRefresh = (fn: (revision?: number) => void): (() => void) => {\n listeners.add(fn)\n return () => { listeners.delete(fn) }\n }\n const refresh = (revision?: number): void => {\n for (const fn of listeners) {\n try {\n fn(revision)\n } catch {\n // one stale subscriber must not break the others\n }\n }\n }\n ctx.effect(() => ctx.remote.$on('settings/document-updated', (ns: string, revision?: number) => {\n if (ns === NS) refresh(revision)\n }), 'subagent-library: settings invalidation')\n\n // ── settings section card ──────────────────────────────────────────────────\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: NS,\n order: 40,\n label: () => '子代理库',\n inject: (): LibrarySettingsInjected => ({ readView, writeView, subscribeRefresh }),\n }, LibrarySettings))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,gBAAgB,OAAiD;CAC/E,MAAM,EAAE,sBAAU,wBAAW,qBAAqB;CAElD,MAAM,CAAC,MAAM,+BAAwC,KAAK;CAC1D,MAAM,CAAC,SAAS,kCAAoD,EAAE,CAAC;CACvE,MAAM,CAAC,MAAM,+BAAoB,MAAM;CACvC,MAAM,CAAC,QAAQ,iCAAqE,KAAK;CACzF,MAAM,CAAC,OAAO,gCAAqB,GAAG;CACtC,MAAM,CAAC,UAAU,mCAAqC;EAAE,aAAa;EAAI,UAAU;EAAI,OAAO;EAAI,gBAAgB;EAAY,CAAC;CAE/H,MAAM,0BAAe,KAAK;;CAE1B,MAAM,4BAAiB,MAAM;AAC7B,kCAAsB;AAAE,QAAM,UAAU;IAAS,EAAE,CAAC;;;;;;CAOpD,MAAM,kCAAsC,KAAK;;;;;CAKjD,MAAM,qCAA0B,MAAM;CACtC,MAAM,wCAA4C,KAAK;CAEvD,MAAM,aAAmB;AACvB,GAAM,YAAY;AAChB,OAAI;IACF,MAAM,OAAO,MAAMA,YAAU;AAC7B,QAAI,CAAC,MAAM,QAAS;AACpB,kBAAc,UAAU,KAAK;AAC7B,YAAQ,KAAK;AACb,eAAW,gBAAgB,KAAK,QAAQ,CAAC;YAClC,OAAO;AACd,QAAI,MAAM,QAAS,WAAU;KAAE,MAAM;KAAS,MAAM,OAAO,MAAM;KAAE,CAAC;;MAEpE;;AAGN,4BAAgB;AACd,QAAM;AACN,SAAO,kBAAkB,aAAa;AACpC,OAAI,iBAAiB,SAAS;AAC5B,QAAI,aAAa,OAAW,qBAAoB,UAAU,KAAK,IAAI,oBAAoB,WAAW,IAAI,SAAS;AAC/G;;AAEF,OAAI,aAAa,UAAa,cAAc,YAAY,QAAQ,YAAY,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