@jayyuen66/dsh-dir-prep-organize 0.1.1 → 0.1.2-rc

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
@@ -25,7 +25,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
25
25
  ```
26
26
 
27
27
  - Host range `>= 0.2.0-rc.2`, written to both `peerDependencies` and `engines.dsh`. Only `peerDependencies` is actually enforced: since `0.1.7-rc.1` the host evaluates it when loading plugins and disables an entry that fails (`compatibility-preflight.ts` → `deny()`), whereas `engines.dsh` has no reader at this host version.
28
- - The `@deepseek-ai/dsh-*` dependencies stay pinned at `0.2.1-alpha.1`, the version this package is built and tested against. The range is a claim about which *hosts* it runs on; the pin is a fact about which host version *it* was compiled against — mixing the two is why the publish gate now checks them separately.
28
+ - The `@deepseek-ai/dsh-*` dependencies stay pinned at `0.2.1-alpha.2`, the version this package is built and tested against. The range is a claim about which *hosts* it runs on; the pin is a fact about which host version *it* was compiled against — mixing the two is why the publish gate now checks them separately.
29
29
  - The client half is `dsh.client.platform = web` with `immediately`.
30
30
  - The publishing form is one repository per package, `repository.url` is git+https://github.com/JayYuen666/dsh-dir-prep-organize.git ; issues go to that repository's issue tracker (`bugs`).
31
31
  - Requires Node.js `>= 22.12`. This is an ESM-only package: use `import { apply } from "@jayyuen66/dsh-dir-prep-organize"` or `require("@jayyuen66/dsh-dir-prep-organize")`. There is **no default export** — `import pkg from …` fails with `does not provide an export named 'default'`; take the named exports instead. That Node floor is what makes `require()` of this ESM entry work at all, which is why `engines.node` is declared.
@@ -33,9 +33,11 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
33
33
  - The published artifact ships only `host.js`, `client.js`, `templates.data.mjs`, `types/`, `cordis.patch.yml`, `agents/` and `THIRD_PARTY_NOTICES.md` (package.json `files`). `LICENSE`, `README.md` and `package.json` are attached unconditionally by the registry client.
34
34
  - The built-in template table lives in its own artifact and is loaded **on first use**, not at plugin load. It used to be bundled into `host.js`, so every user paid for 85 templates in memory even without opening the dropdown - `host.js` is now roughly a tenth of its former size, and the browser already fetched this data lazily anyway.
35
35
  - `agents/` is not authored here: it comes from the upstream project [`agency-agents-zh`](https://github.com/jnMetaCode/agency-agents-zh) (MIT). Its copyright and licence notice ship in `THIRD_PARTY_NOTICES.md`, because MIT requires it in every distributed copy.
36
- - Runtime dependencies are four, all under `dependencies`: `@jayyuen66/dsh-plugin-shared`, `@deepseek-ai/schemastery` (the host's fork — only it resolves 0.1.7 `.volatile()` fields into live references), `@deepseek-ai/dsh-brand` (`0.2.1-alpha.1`) and `@deepseek-ai/cosmokit` (`1.8.6-alpha.1`).
37
- - The fourth one is no typo either: schemastery takes its `Dict` type from cosmokit, so every emitted declaration that mentions a schema carries a reference to it. Leaving cosmokit a transitive dependency makes that reference unresolvable for consumers under pnpm's strict layout — the declaration entry simply would not typecheck on their side. It is pinned to the exact version schemastery already resolves, so it adds nothing to the install.
38
- - The third one is no typo: `brandString` in `host.ts` is a **value import**, and per ruling A it must sit in `dependencies` — the externalization list in `build-host.mjs` only reads `dependencies` ∪ `peerDependencies`, so a `devDependencies` entry lets rolldown inline the official function body into `host.js` (`test/build-host.test.ts` pins both "specifier present" and "function body absent").
36
+ - No `@deepseek-ai/*` goes in `dependencies`, and that is not a style preference. Consumers of this package are dsh plugins installed into a profile (`nodeLinker: hoisted`, `autoInstallPeers: false`), so any host package listed under `dependencies` is written into that profile as a **real directory**, coexisting with the copy the host process already loaded. `@deepseek-ai/dsh-tools` keys its `TOOL_RUNTIME_SCHEDULER` with a plain `Symbol` (not `Symbol.for`), so symbol identity is per module instance: the host's `dsh-agent-loop` reads a `ToolRuntime` mounted from the duplicate using its own copy's symbol, gets `undefined`, and **every native tool call throws** `Cannot read properties of undefined (reading 'prepare')` — the whole profile loses its tools. This package's build, typecheck and tests all stay green right up to that point, so `test/publish-manifest.test.ts` pins the invariant in the manifest instead.
37
+ - The two host packages the shipped `host.js` imports as **values** are required (non-optional) `peerDependencies`: `@deepseek-ai/schemastery` (the host's fork — only it resolves 0.1.7 `.volatile()` fields into live references) and `@deepseek-ai/dsh-brand` (`0.2.1-alpha.2`). The host provides them at runtime and a profile installs no peers, so no duplicate appears. `build-host.mjs` externalizes `dependencies` *and* `peerDependencies`, so the bare specifiers in `host.js` stay exactly as they were — that is the ruling behind `brandString`: the peer keeps the specifier external and the official function body out of the artifact, while a `devDependencies`-only entry lets rolldown inline it (`test/build-host.test.ts` pins both "specifier present" and "function body absent").
38
+ - Every host package the emitted **declarations** name is declared under `peerDependencies`, and each one reached only there is *optional*: `@deepseek-ai/cordis` (`4.0.5-alpha.1`), `@deepseek-ai/cosmokit` (`1.8.6-alpha.1`, reached only through schemastery's `Dict`) and `@deepseek-ai/dsh-agent-default-model`, `-client-locale`, `-client-ui-conversation`, `-client-ui-renderer`, `-client-ui-settings`, `-client-ui-slots`, `-fs`, `-llm`, `-session` (all `0.2.1-alpha.2`). Declaring them is not ceremony: under pnpm's strict layout a bare specifier in `types/host.d.ts` that no manifest table names is unresolvable, so the declaration entry simply would not typecheck on the consumer's side while this repository's own typecheck stays green — here both tables carry it. `test/publish-manifest.test.ts` reads that roster off `types/**/*.d.ts` rather than off this paragraph, so the two cannot drift apart. `@deepseek-ai/dsh` is the one peer nothing imports: it names the host, which is what `engines.dsh` says in words.
39
+ - Every peer is repeated in `devDependencies` at the same exact pin; that is what lets this repository's own typecheck, build and tests resolve them. The remaining `@deepseek-ai/*` entries here are type-only in source and leave no specifier in the declarations either, so they stay in `devDependencies` alone.
40
+ - What is left in `dependencies` is this package's own runtime code: `@jayyuen66/dsh-plugin-shared`.
39
41
 
40
42
  ## Enabling it in dsh
41
43
 
@@ -82,7 +84,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
82
84
  | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83
85
  | Routing and token | All four are exact-match webServer routes (`kind: "exact"`); the **first statement** of every handler body is `guardTrust(req, res, { servingNonLoopback })` from shared/lib/trust, which writes a single 403 and returns without reading the body; `csrf` is a per-apply random token, issued by the two GETs and verified on organize |
84
86
  | Order of the trust checks | Host authority → the `sec-fetch-site` allowlist (only same-origin/none/absent) → a verbatim `origin` vs Host comparison; the `isCrossOrigin` branch inside this package's handlers became unreachable once the gate landed and is deleted (the identical check inside the shared `guardBody` now sits behind the gate too), so the gate is what rejects cross-site traffic and supplies the sentence |
85
- | Host authority is not a trusted local address | 403 with `{ok:false,error:"untrusted host authority"}`; `servingNonLoopback` comes from `webServer.host === "0.0.0.0"`, and a service without that field keeps the conservative loopback-only setting |
87
+ | Host authority is not a trusted local address | 403 with `{ok:false,error:"untrusted host authority"}`; `servingNonLoopback` comes from `isNonLoopbackBindHost(webServer.host)` (shared/lib/trust) - the host takes any local interface address as `Config.host` and rejects the wildcard address at load, so comparing against `"0.0.0.0"` would be permanently false; a service that reports no bind address keeps the conservative loopback-only setting |
86
88
  | `sec-fetch-site` outside the allowlist, or origin mismatch | 403 with `{ok:false,error:"cross-origin request rejected"}` (opaque `origin: null` sandbox pages, and a local request that carries `origin` but no Host, land here too) |
87
89
  | Wrong method | 405 with `Allow` and a JSON body: `{ok:false,error:"GET only"}` (organize/import answer `"POST only"`) |
88
90
  | Missing or wrong CSRF | 403 with `{ok:false,error:"invalid csrf token"}` (the `guardBody` check, still behind the gate) |
package/README.zh-CN.md CHANGED
@@ -23,7 +23,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
23
23
  ```
24
24
 
25
25
  - 宿主区间 `>= 0.2.0-rc.2`,同时写进 `peerDependencies` 与 `engines.dsh`。真正生效的只有 `peerDependencies`:自 `0.1.7-rc.1` 起宿主载入插件时会校验它并把不兼容的条目**停用**(`compatibility-preflight.ts` 的 `deny()`);`engines.dsh` 在该宿主版本上没有任何读者。
26
- - `@deepseek-ai/dsh-*` 依赖仍精确钉在 `0.2.1-alpha.1`——那是本包构建并测过的宿主版本。区间是对**它能跑在哪些宿主上**的声明,钉版是对**它在哪个宿主版本上编译过**的事实;把两者混成一条断言,正是发布门禁现在把它们拆开分别验的原因。
26
+ - `@deepseek-ai/dsh-*` 依赖仍精确钉在 `0.2.1-alpha.2`——那是本包构建并测过的宿主版本。区间是对**它能跑在哪些宿主上**的声明,钉版是对**它在哪个宿主版本上编译过**的事实;把两者混成一条断言,正是发布门禁现在把它们拆开分别验的原因。
27
27
  - client 半 `dsh.client.platform = web`、`immediately`。
28
28
  - 发布形态为按包单仓,`repository.url` 为 git+https://github.com/JayYuen666/dsh-dir-prep-organize.git ;问题反馈走同一仓库的 issue(`bugs`)。
29
29
  - 要求 Node.js `>= 22.12`。本包是纯 ESM:用 `import { apply } from "@jayyuen66/dsh-dir-prep-organize"` 或 `require("@jayyuen66/dsh-dir-prep-organize")`。**没有默认导出**——`import pkg from …` 会报 `does not provide an export named 'default'`,请取具名导出。正是这个 Node 下限让 `require()` 能吃下这个 ESM 入口,所以 `engines.node` 要写明。
@@ -31,9 +31,11 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
31
31
  - 发布产物只有 `host.js`、`client.js`、`templates.data.mjs`、`types/`、`cordis.patch.yml`、`agents/` 与 `THIRD_PARTY_NOTICES.md`(package.json 的 `files`);`LICENSE`、`README.md`、`package.json` 由 registry 客户端无条件附带。
32
32
  - 内置精选模板表单独成一个产物,**首次用到时才载入**,不再随插件载入就进内存。它原先被打进 `host.js`,于是即便用户从不开「模板」下拉,也要替 85 条模板付内存——现在 `host.js` 只有原先的约十分之一,而浏览器那一侧本来就是按需拉的。
33
33
  - `agents/` 并非本仓原创:它来自上游项目 [`agency-agents-zh`](https://github.com/jnMetaCode/agency-agents-zh)(MIT)。MIT 要求声明随每一份分发副本一起给出,故其版权与许可声明收录在 `THIRD_PARTY_NOTICES.md`。
34
- - 运行期依赖四枚,全在 `dependencies`:`@jayyuen66/dsh-plugin-shared`、`@deepseek-ai/schemastery`(宿主 fork,0.1.7 的 `.volatile()` 活引用只有它解析得出来)、`@deepseek-ai/dsh-brand`(`0.2.1-alpha.1`)与 `@deepseek-ai/cosmokit`(`1.8.6-alpha.1`)。
35
- - 第四枚同样不是笔误:schemastery 的 `Dict` 取自 cosmokit,于是凡是提到 schema 的声明产物都会带上对它的引用。若把 cosmokit 留作传递依赖,消费方在 pnpm 严格布局下解析不到这个引用——声明入口在那边根本过不了类型检查。这里钉的正是 schemastery 本就会解析到的那个版本,不增加任何安装体积。
36
- - 第三枚不是笔误:`host.ts` 的 `brandString` 是**值导入**,必须落 `dependencies`——`build-host.mjs` 的外部化名单只读 `dependencies`∪`peerDependencies`,放 `devDependencies` 就会被 rolldown 把官方函数体内联进 `host.js`(`test/build-host.test.ts` 同时钉「说明符在」与「函数体不在」)。
34
+ - `dependencies` 里不放任何 `@deepseek-ai/*`,这不是风格偏好。本包的消费方是 dsh 插件,被装进 profile(`nodeLinker: hoisted`、`autoInstallPeers: false`),宿主包只要出现在 `dependencies`,pnpm 就会在那棵 profile 依赖树里把它落成**真实目录**,与宿主进程已经加载的那份并存。而 `@deepseek-ai/dsh-tools` 的 `TOOL_RUNTIME_SCHEDULER` 是普通 `Symbol`(不是 `Symbol.for`),符号身份按模块实例计算——宿主 `dsh-agent-loop` 拿自己那份的 Symbol 去读由副本挂载出来的 `ToolRuntime`,得到 `undefined`,于是**每一次原生工具调用都抛** `Cannot read properties of undefined (reading 'prepare')`,整个 profile 的工具一起失效。本包的构建、类型检查与测试在这之前全部照绿,所以判据由 `test/publish-manifest.test.ts` 落在 manifest 面。
35
+ - 产物 `host.js` 里以**值**导入的两枚宿主包是非 optional 的 `peerDependencies`:`@deepseek-ai/schemastery`(宿主 fork,0.1.7 的 `.volatile()` 活引用只有它解析得出来)与 `@deepseek-ai/dsh-brand`(`0.2.1-alpha.2`)。运行期由宿主在场提供,而 profile 不装 peer,所以不产生副本。`build-host.mjs` 的外部化名单读 `dependencies` ∪ `peerDependencies`,两张表都读,所以 `host.js` 里的裸说明符一字未变——这正是 `brandString` 那处裁定的落点:落 peer 保住「说明符在」,只写 `devDependencies` 就会被 rolldown 把官方函数体内联进来(`test/build-host.test.ts` 同时钉「说明符在」与「函数体不在」)。
36
+ - 凡被**声明产物**点名的宿主包都写进 `peerDependencies`,其中只在那里现身的都判为 optional:`@deepseek-ai/cordis`(`4.0.5-alpha.1`)、`@deepseek-ai/cosmokit`(`1.8.6-alpha.1`,只经 schemastery 的 `Dict` 现身)以及 `@deepseek-ai/dsh-agent-default-model`、`-client-locale`、`-client-ui-conversation`、`-client-ui-renderer`、`-client-ui-settings`、`-client-ui-slots`、`-fs`、`-llm`、`-session`(全为 `0.2.1-alpha.2`)。声明它们不是礼节:pnpm 严格布局下,`types/host.d.ts` 里一枚没有任何 manifest 表认领的裸说明符就是解析不到——消费方那侧的声明入口根本过不了类型检查,而本仓自己的 typecheck 照绿,因为我们两张表都有它。`test/publish-manifest.test.ts` 因此按 `types/**/*.d.ts` 现扫这份名单,而不是照这段话抄,两边就此漂不开。`@deepseek-ai/dsh` 是唯一谁也没 import 的 peer:它指宿主本身,也就是 `engines.dsh` 用文字说的那件事。
37
+ - 每枚 peer 都在 `devDependencies` 里以同一枚精确版本再写一份,本仓自己的 typecheck、build 与测试靠它解析。其余 `@deepseek-ai/*` 在源码里是 type-only,在声明产物里也不留说明符,所以只留在 `devDependencies`。
38
+ - `dependencies` 剩下的确实是本包自己的运行期代码:`@jayyuen66/dsh-plugin-shared`。
37
39
 
38
40
  ## 在 dsh 里启用
39
41
 
@@ -80,7 +82,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
80
82
  | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
83
  | 路由与令牌 | 四条都是 webServer 精确路由(注册时 `kind: "exact"`);每条 handler 体的**第一条语句**是 `guardTrust(req, res, { servingNonLoopback })`(shared/lib/trust),非 trusted 即写一次 403 并 return,不再读 body;`csrf` 为 per-apply 随机令牌,两个 GET 下发、organize 回填 |
82
84
  | 信任判据的次序 | Host 权威 → `sec-fetch-site` 白名单(只放 same-origin/none/缺失)→ `origin` 与 Host 逐字比对;本包 handler 里自家那枚 `isCrossOrigin` 分支在闸门落地后不可达、已删(共享层 `guardBody` 的同形检查也被闸门挡在前面),拒跨域的是闸门,错误文本由它给 |
83
- | Host 权威不是本机可信地址 | 403 + `{ok:false,error:"untrusted host authority"}`;`servingNonLoopback` 取自 `webServer.host === "0.0.0.0"`,取不到即按只绑回环的保守档 |
85
+ | Host 权威不是本机可信地址 | 403 + `{ok:false,error:"untrusted host authority"}`;`servingNonLoopback` 取自 `isNonLoopbackBindHost(webServer.host)`(shared/lib/trust)——宿主的 `Config.host` 收任意本机接口地址、通配地址在载入即拒,所以跟 `"0.0.0.0"` 比字面量恒为 false;服务不报绑定地址时按只绑回环的保守档 |
84
86
  | `sec-fetch-site` 不在白名单、或 origin 对不上 | 403 + `{ok:false,error:"cross-origin request rejected"}`(`origin` 为 `null` 的沙箱页,以及缺 Host 却又带了 `origin` 的本地面,同落这一句) |
85
87
  | 方法不符 | 405 带 `Allow`,体是 JSON:`{ok:false,error:"GET only"}`(organize/import 为 `"POST only"`) |
86
88
  | CSRF 缺失或错 | 403 + `{ok:false,error:"invalid csrf token"}`(`guardBody` 那一条,仍在闸门之后) |
package/client.js CHANGED
@@ -6,7 +6,7 @@ window.__ModuleLoader__.load({
6
6
  var exports = module.exports;
7
7
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
8
  let react = require("react");
9
- //#region node_modules/.pnpm/@jayyuen66+dsh-plugin-shared@0.1.2_e1d13a9111f1b3b932c939974ed50e75/node_modules/@jayyuen66/dsh-plugin-shared/dist/record.js
9
+ //#region node_modules/.pnpm/@jayyuen66+dsh-plugin-shared@0.1.4_@deepseek-ai+cordis@4.0.5-alpha.1_@deepseek-ai+dsh-c_f2b4318270c2e2b24d6fbe85a854f709/node_modules/@jayyuen66/dsh-plugin-shared/dist/record.js
10
10
  function e$1(e) {
11
11
  return typeof e == `object` && !!e && !Array.isArray(e);
12
12
  }
@@ -278,7 +278,7 @@ const UI_MESSAGES = {
278
278
  }
279
279
  };
280
280
  //#endregion
281
- //#region node_modules/.pnpm/@jayyuen66+dsh-plugin-shared@0.1.2_e1d13a9111f1b3b932c939974ed50e75/node_modules/@jayyuen66/dsh-plugin-shared/dist/errors.js
281
+ //#region node_modules/.pnpm/@jayyuen66+dsh-plugin-shared@0.1.4_@deepseek-ai+cordis@4.0.5-alpha.1_@deepseek-ai+dsh-c_f2b4318270c2e2b24d6fbe85a854f709/node_modules/@jayyuen66/dsh-plugin-shared/dist/errors.js
282
282
  function e(e) {
283
283
  let t = Object.getOwnPropertyDescriptor(e, `message`);
284
284
  return t !== void 0 && `value` in t && typeof t.value == `string` ? t.value : void 0;
package/host.js CHANGED
@@ -4,7 +4,7 @@ import path from "node:path";
4
4
  import Schema from "@deepseek-ai/schemastery";
5
5
  import { brandString } from "@deepseek-ai/dsh-brand";
6
6
  import { guardBody, queryParam, sendJson } from "@jayyuen66/dsh-plugin-shared/lib/http";
7
- import { guardTrust } from "@jayyuen66/dsh-plugin-shared/lib/trust";
7
+ import { guardTrust, isNonLoopbackBindHost } from "@jayyuen66/dsh-plugin-shared/lib/trust";
8
8
  import { LOCALE_SETTINGS_NAMESPACE, messagesFor, resolveLocalePreference } from "@jayyuen66/dsh-plugin-shared/lib/locale";
9
9
  import { isRecord } from "@jayyuen66/dsh-plugin-shared/lib/record";
10
10
  import { errorText } from "@jayyuen66/dsh-plugin-shared/lib/errors";
@@ -261,10 +261,10 @@ function condenseRoleBody(body) {
261
261
  /** 本包送进 `llm.stream({ messages })` 的整理请求帧是 **request-only 输入**:它从不落
262
262
  * 任何持久消息位(`runOrganize` 只回 `{ content }`,路由也不把帧身份回投给卡片),所以
263
263
  * 按 0.1.7 它既不需要 `id` 也不带 `source`——证据三条:
264
- * 1. installed `@deepseek-ai/dsh-llm/lib/types/types.d.ts:457-462` 的 `RequestUserInput`
264
+ * 1. installed `@deepseek-ai/dsh-llm/lib/types/types.d.ts:468-473` 的 `RequestUserInput`
265
265
  * 把两面都标成 `?: never`(`readonly id?: never` / `readonly source?: never`),
266
266
  * `GenerateOptions.messages` 收的是 `RequestMessage[] = Message | RequestUserInput`
267
- * (同文件 :464,字段注记 "a hand-built one-shot may include identity-free user
267
+ * (同文件 :475,字段注记 "a hand-built one-shot may include identity-free user
268
268
  * inputs");
269
269
  * 2. 持久那半边 `Message` 要的 `source.kind` 必须是**已声明**进 `MessageSourceMap` 的
270
270
  * kind(installed `dsh-llm/lib/types/message.d.ts:101-133`),本包的
@@ -1514,7 +1514,7 @@ function apply(ctx, config) {
1514
1514
  const webServer = isWebServerService(rawWebServer) ? rawWebServer : void 0;
1515
1515
  if (webServer === void 0) return noopDisposer;
1516
1516
  const csrf = randomUUID();
1517
- const servingNonLoopback = isRecord(rawWebServer) && rawWebServer["host"] === "0.0.0.0";
1517
+ const servingNonLoopback = isNonLoopbackBindHost(webServer.host);
1518
1518
  const handlers = createRouteHandlers({
1519
1519
  sessions: () => {
1520
1520
  const service = getService("sessions");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayyuen66/dsh-dir-prep-organize",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-rc",
4
4
  "description": "dsh 插件:对话输入框「整理」按钮(主键直接整理/▾ 以角色视角整理,结合当前目录 + session 模型整理优化草稿)+「模板」下拉(内置精选角色集生成自插件 agents/ 角色库,可按部门分组;设置卡可增删改/一键导入内置全部/导入本地角色 .md)",
5
5
  "homepage": "https://github.com/JayYuen666/dsh-dir-prep-organize#readme",
6
6
  "bugs": {
@@ -45,68 +45,106 @@
45
45
  "registry": "https://registry.npmjs.org"
46
46
  },
47
47
  "dependencies": {
48
- "@deepseek-ai/cosmokit": "1.8.6-alpha.1",
49
- "@deepseek-ai/dsh-brand": "0.2.1-alpha.1",
50
- "@deepseek-ai/schemastery": "3.18.5-alpha.1",
51
- "@jayyuen66/dsh-plugin-shared": "^0.1.2"
48
+ "@jayyuen66/dsh-plugin-shared": "^0.1.4"
52
49
  },
53
50
  "devDependencies": {
54
51
  "@deepseek-ai/cordis": "4.0.5-alpha.1",
55
- "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
56
- "@deepseek-ai/dsh-agent-default-model": "0.2.1-alpha.1",
57
- "@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.1",
58
- "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-alpha.1",
59
- "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.1",
60
- "@deepseek-ai/dsh-client-store": "0.2.1-alpha.1",
61
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.1",
62
- "@deepseek-ai/dsh-client-ui-layout": "0.2.1-alpha.1",
63
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-alpha.1",
64
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.1",
65
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.1",
66
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.1",
67
- "@deepseek-ai/dsh-fs": "0.2.1-alpha.1",
68
- "@deepseek-ai/dsh-host-directory-picker": "0.2.1-alpha.1",
69
- "@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.1",
70
- "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
71
- "@deepseek-ai/dsh-llm-retry": "0.2.1-alpha.1",
72
- "@deepseek-ai/dsh-package-manifest": "0.2.1-alpha.1",
73
- "@deepseek-ai/dsh-sandbox": "0.2.1-alpha.1",
74
- "@deepseek-ai/dsh-scope": "0.2.1-alpha.1",
75
- "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
76
- "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.1",
77
- "@deepseek-ai/dsh-settings": "0.2.1-alpha.1",
78
- "@types/node": "26.6.3",
52
+ "@deepseek-ai/cosmokit": "1.8.6-alpha.1",
53
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
54
+ "@deepseek-ai/dsh-agent-default-model": "0.2.1-alpha.2",
55
+ "@deepseek-ai/dsh-api-remotes": "0.2.1-alpha.2",
56
+ "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-alpha.2",
57
+ "@deepseek-ai/dsh-brand": "0.2.1-alpha.2",
58
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
59
+ "@deepseek-ai/dsh-client-store": "0.2.1-alpha.2",
60
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.2",
61
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.1-alpha.2",
62
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.1-alpha.2",
63
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
64
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.2",
65
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2",
66
+ "@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
67
+ "@deepseek-ai/dsh-host-directory-picker": "0.2.1-alpha.2",
68
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.2",
69
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
70
+ "@deepseek-ai/dsh-llm-retry": "0.2.1-alpha.2",
71
+ "@deepseek-ai/dsh-package-manifest": "0.2.1-alpha.2",
72
+ "@deepseek-ai/dsh-sandbox": "0.2.1-alpha.2",
73
+ "@deepseek-ai/dsh-scope": "0.2.1-alpha.2",
74
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
75
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2",
76
+ "@deepseek-ai/dsh-settings": "0.2.1-alpha.2",
77
+ "@deepseek-ai/schemastery": "3.18.5-alpha.1",
78
+ "@types/node": "26.6.5",
79
79
  "@types/react": "19.3.0",
80
80
  "@types/react-dom": "19.3.0",
81
- "@vitest/coverage-v8": "5.0.2",
81
+ "@vitest/coverage-v8": "5.0.3",
82
82
  "eslint-plugin-sonarjs": "4.2.2",
83
- "happy-dom": "20.14.5",
84
- "oxfmt": "0.71.0",
85
- "oxlint": "1.86.0",
86
- "oxlint-tsgolint": "7.0.2003",
83
+ "happy-dom": "20.14.6",
84
+ "oxfmt": "0.72.0",
85
+ "oxlint": "1.87.0",
86
+ "oxlint-tsgolint": "7.0.2004",
87
87
  "react": "^19.3.0",
88
88
  "react-dom": "^19.3.0",
89
- "rolldown": "1.2.11",
89
+ "rolldown": "1.2.13",
90
90
  "typescript": "7.0.2",
91
- "vite": "8.3.1",
92
- "vitest": "5.0.2"
91
+ "vite": "8.3.4",
92
+ "vitest": "5.0.3"
93
93
  },
94
94
  "peerDependencies": {
95
+ "@deepseek-ai/cordis": "4.0.5-alpha.1",
96
+ "@deepseek-ai/cosmokit": "1.8.6-alpha.1",
95
97
  "@deepseek-ai/dsh": ">=0.2.0-rc.2",
96
- "@deepseek-ai/dsh-agent-default-model": "0.2.1-alpha.1",
97
- "@deepseek-ai/dsh-fs": "0.2.1-alpha.1",
98
+ "@deepseek-ai/dsh-agent-default-model": "0.2.1-alpha.2",
99
+ "@deepseek-ai/dsh-brand": "0.2.1-alpha.2",
100
+ "@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
101
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-alpha.2",
102
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
103
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.1-alpha.2",
104
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2",
105
+ "@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
106
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
107
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.2",
108
+ "@deepseek-ai/schemastery": "3.18.5-alpha.1",
98
109
  "react": "^19.3.0"
99
110
  },
100
111
  "peerDependenciesMeta": {
112
+ "@deepseek-ai/cordis": {
113
+ "optional": true
114
+ },
115
+ "@deepseek-ai/cosmokit": {
116
+ "optional": true
117
+ },
101
118
  "@deepseek-ai/dsh": {
102
119
  "optional": true
103
120
  },
104
121
  "@deepseek-ai/dsh-agent-default-model": {
105
122
  "optional": true
106
123
  },
124
+ "@deepseek-ai/dsh-client-locale": {
125
+ "optional": true
126
+ },
127
+ "@deepseek-ai/dsh-client-ui-conversation": {
128
+ "optional": true
129
+ },
130
+ "@deepseek-ai/dsh-client-ui-renderer": {
131
+ "optional": true
132
+ },
133
+ "@deepseek-ai/dsh-client-ui-settings": {
134
+ "optional": true
135
+ },
136
+ "@deepseek-ai/dsh-client-ui-slots": {
137
+ "optional": true
138
+ },
107
139
  "@deepseek-ai/dsh-fs": {
108
140
  "optional": true
109
141
  },
142
+ "@deepseek-ai/dsh-llm": {
143
+ "optional": true
144
+ },
145
+ "@deepseek-ai/dsh-session": {
146
+ "optional": true
147
+ },
110
148
  "react": {
111
149
  "optional": true
112
150
  }
package/types/host.d.ts CHANGED
@@ -82,10 +82,10 @@ export interface DerivedMessageView {
82
82
  }
83
83
  /**
84
84
  * 本包读到的会话面 = 官方 `Session` 两位成员的**边界投影**(installed
85
- * @deepseek-ai/dsh-session/lib/types/index.d.ts:`readonly header: SessionHeader` :118、
86
- * `deriveMessages(): Message[]` :292)。
85
+ * @deepseek-ai/dsh-session/lib/types/index.d.ts:`readonly header: SessionHeader` :150、
86
+ * `deriveMessages(): Message[]` :347)。
87
87
  * 键名一律借自官方(`header` 借 `Session`、`cwd` 借 `SessionHeader`,installed
88
- * @deepseek-ai/dsh-llm 域内 types.d.ts:69 `readonly cwd?: string`),值域收成"本包真的读的那位
88
+ * @deepseek-ai/dsh-session 域内 types.d.ts:69 `readonly cwd?: string`),值域收成"本包真的读的那位
89
89
  * + 可缺失":官方把 header/deriveMessages 记成必选成员,但那句承诺说的是宿主自己 `new`
90
90
  * 出来的 Session;跨进程递来的会话是否具备某位只能运行时判(见 `extractSessionConversation`
91
91
  * 的 `typeof session.deriveMessages !== "function"` 与 `cwdOfSession` 的 `typeof === "string"`
@@ -97,10 +97,10 @@ export interface SessionLike {
97
97
  }
98
98
  /**
99
99
  * `Context.sessions`(官方 `SessionStore`,installed @deepseek-ai/dsh-session/lib/types/
100
- * index.d.ts:26-28)的 `get` 一位(:436 `get(id: SessionId): Session | undefined`)在本包的
100
+ * index.d.ts:26-28)的 `get` 一位(:491 `get(id: SessionId): Session | undefined`)在本包的
101
101
  * 读法:入参就此是官方品牌的 `SessionId`(边界上递来的是裸 string,构造口只有文件头那枚
102
102
  * `brandString<SessionId>`),返回值域换成上面的 `SessionLike` 投影——直接取官方返回的整枚
103
- * `Session` 类会把名义类一路渗进本包(`private log`/`surfaceManager`,:105-107),那三道运行时
103
+ * `Session` 类会把名义类一路渗进本包(`private log`/`surfaceManager`,:137-139),那三道运行时
104
104
  * 守卫当场在编译器眼里变成死代码,而它们挡的是真实输入。返回 `undefined` 与官方一致。
105
105
  * 口径同 danger-guard/host.ts 的 `GuardExecution`(借键名、值域换投影)。
106
106
  */
@@ -113,7 +113,7 @@ export interface SessionsService {
113
113
  * 「转换点为 0」并不成立。取官方类型后模型选择与 stream 入参两侧共用同一真值。 */
114
114
  export type { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
115
115
  /** 默认模型选择直接取官方成员的返回形状(`AgentDefaultModelConfig.currentSelection()`
116
- * 的返回类型,installed @deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts:41)。
116
+ * 的返回类型,installed @deepseek-ai/dsh-agent-default-model/lib/types/index.d.ts:42)。
117
117
  * 旧镜像自己抄了 `{ provider, model, reasoningEffort? }` 三位——其中 `reasoningEffort` 是
118
118
  * `ReasoningEffortId` 品牌(本文件上面已按官方 re-export),抄本一旦与官方漂开,
119
119
  * 品牌值塞不进 stream 入参就是静默丢字段。取 ReturnType 之后本包不再裁定它的形状。 */
@@ -130,7 +130,7 @@ export type { RequestUserInput, TextBlock } from "@deepseek-ai/dsh-llm";
130
130
  export type { FinishReason, StreamChunk } from "@deepseek-ai/dsh-llm";
131
131
  /** stream 入参:官方 `GenerateOptions` 的本包用到的子集。此前这里在 `Pick` 之外**另加**
132
132
  * 了一枚 `signal?: AbortSignal`,注释写着"本包附加的取消位"——官方其实**就有**这一位
133
- * (installed @deepseek-ai/dsh-llm/lib/types/types.d.ts:494),另写一次等于凭空多出一个
133
+ * (installed @deepseek-ai/dsh-llm/lib/types/types.d.ts:519),另写一次等于凭空多出一个
134
134
  * 与官方并行的形状声明;现在连同 `signal` 一起 `Pick`,一处来源。 */
135
135
  export type LlmStreamOptions = Pick<GenerateOptions, "provider" | "model" | "reasoningEffort" | "messages" | "system" | "signal">;
136
136
  /** 官方 `LlmRuntime`(`Context.llm` 的类型,installed @deepseek-ai/dsh-llm/lib/types/
@@ -367,8 +367,8 @@ export interface RouteDeps {
367
367
  loadDefaultTemplates?: () => Promise<readonly TemplateEntry[]>;
368
368
  }
369
369
  /** 路由 handler 形状(本包自己的路由表投影)。官方 `WebRoute["handler"]` 的返回是
370
- * `void | Promise<void>`(installed `@deepseek-ai/dsh-host-webserver/lib/types/index.d.ts:38`),
371
- * dispatcher 侧写成 `await route.handler(req, res)`(installed lib/index.js:235)——
370
+ * `void | Promise<void>`(installed `@deepseek-ai/dsh-host-webserver/lib/types/index.d.ts:40`),
371
+ * dispatcher 侧写成 `await route.handler(req, res)`(installed lib/index.js:356)——
372
372
  * await 对同步返回同样成立,而外层 `handle` 本身是 async,故同步抛与 reject 在调用方
373
373
  * 观察上等价:**没有调用方依赖 handler 返回 promise**。于是投影按实现拆成两枚,
374
374
  * 让 createRouteHandlers 的返回值继续自证——确有 await 的三枚是 AsyncRouteHandler,
@@ -167,7 +167,7 @@ export interface UiMessages {
167
167
  }
168
168
  /**
169
169
  * 本包的文案命名空间 merge 进官方的 `LocaleNamespaceMap`(installed
170
- * `dsh-client-ui-slots/lib/types/index.d.ts:33`「Dictionary owners extend via declaration
170
+ * `dsh-client-ui-slots/lib/types/index.d.ts:23`「Dictionary owners extend via declaration
171
171
  * merging (exactly like SlotMap)」)。这不是美化:不 merge 时 `ctx.locale.bind(NS)` 只能
172
172
  * 落到官方那条**未类型化**重载(返回 `Translate<string>`),卡片要的窄键集 `t` 就无官方
173
173
  * 来源,本地只好手写一份同构签名(就是被这一段替换掉的旧版本)。