@jayyuen66/dsh-dir-prep-organize 0.1.8 → 0.1.9
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/CHANGELOG.md +26 -1
- package/README.md +9 -9
- package/README.zh-CN.md +9 -9
- package/client.js +44 -163
- package/cordis.patch.yml +3 -0
- package/host.js +8 -2
- package/package.json +54 -51
- package/types/src/templates.d.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循
|
|
4
|
-
[语义化版本](https://semver.org/lang/zh-CN/)
|
|
4
|
+
[语义化版本](https://semver.org/lang/zh-CN/)。最新版本在最上。这里的偏离是刻意的:版本标题
|
|
5
|
+
不写发布日期,各版发布时间以 npm registry 为准(`npm view <包名> time` 取得到)。
|
|
6
|
+
|
|
7
|
+
## 0.1.9
|
|
8
|
+
|
|
9
|
+
宿主开发基线抬到 `0.2.2-rc.1`,支持窗口从单条 `^0.2.1-rc.3` 改成两条宿主线的并集,`engines.node` 地板抬到 `>=24.9.0`;卡片组件改由 shared 的 `./client` 供。导入面补上两条收口:越界回执的列举有界、允许根的形状归一。默认配置不变,需要留意的是 `engines.node` 抬高后 node 22 装不上本包,以及 cordis / cosmokit 的 peer 由确切版本改成范围后宿主装载门的差别。
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **shared 抬到 0.2.4**:catalog、生成物与 lockfile 随之同步;shared 新增的普通依赖 `@deepseek-ai/dsh-fs-patch` 由 shared 自己安装,本包不重复声明。
|
|
14
|
+
- **宿主开发基线**:`devDependencies` 的 `@deepseek-ai/dsh-*` 全族抬到 `0.2.2-rc.1`,`@deepseek-ai/cordis` 抬到 `4.1.0`,`@deepseek-ai/cosmokit` 抬到 `1.9.0`,`@deepseek-ai/schemastery` 抬到 `3.19.0`,cordis 插件组两枚抬到 `1.1.0`;根 catalog 与 overrides 的投影同步,`pnpm-lock.yaml` 随之重解。
|
|
15
|
+
- **支持窗口写成并集**:`engines.dsh` 与 `@deepseek-ai/dsh*` peer 由 `^0.2.1-rc.3` 改为 `^0.2.1-rc.5 || ^0.2.2-alpha.3`;`engines.node` 由 `>=22.12.0` 抬到 `>=24.9.0`(`0.2.2` 线宿主自己的地板,写低了等于承诺一个宿主不会启动的运行环境)。
|
|
16
|
+
- **cordis 与 cosmokit 的 peer 由确切版本改成范围**:`@deepseek-ai/cordis` 原为 `~4.0.5 || 4.0.6-alpha.1`、`@deepseek-ai/cosmokit` 原为裸 `1.8.7-alpha.1`,现分别写成 `^4.0.5 || ^4.0.6-alpha.2` 与 `^1.8.6 || ^1.8.7-alpha.2`。宿主对写成字面版本的 peer 做**确切版本**强校验并在不匹配时 `skipping profile bundle`——装得上、永远不生效,而 `--dump-config` 仍退 0,是这类失败最难查的形态;`@deepseek-ai/schemastery` 的 peer 同步放宽为 `^3.18.5 || ^3.18.6-alpha.1`,与两条宿主线各自的实装版本对齐。
|
|
17
|
+
- **卡片组件改由 shared 的 `./client` 供**:`src/client-entry.ts` 与 `src/remote.ts` 的运行期值导入迁到 `./client`,`package.json` 新增 `dsh.bundle.client.external`,`build-client.mjs` 的外置清单同步;`cordis.patch.yml` 因此插入一条**不写 id** 的 `@jayyuen66/dsh-plugin-shared` 组件行(写 id 会在插件页多出一个可关闭的组件,关掉后设置卡失去组件供应)。
|
|
18
|
+
- **CI 的 node 矩阵收敛**:`ci.yml` 的 `node: [22, 24]` 加 macOS 排除改为单格 `node: [24.9]`,`ci.yml` 与 `publish.yml` 的 `node-version` 由 `24` 改为 `24.9`,与 `engines.node` 同值。
|
|
19
|
+
- **发布预检按 catalog 的范围口径改判**:`publish.yml` 的依赖库可见性预检原先要求 catalog 里 shared 那条是**精确版本**,而伞根真源按设计写的是范围(`^0.2.4`)——不符就拒发,等于让发布链与八仓的声明方式各说一套。现改为取**范围下限**那一版去查 registry:下限永远落在自己声明的范围里,与根侧 `sync --check` 比「该条范围的最低版本」的产物导出面是同一口径。认不出的写法照旧拒发,`catalog:foo` 这类命名 catalog 仍然点名拒绝。
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **越界回执有界**(`host.ts`):403 文本里的允许根最多列五处,其余折成 `…<条数>`。这条文本进会话日志与模型上下文,而允许根清单来自设置存储——手改过的 settings 或脏数据能把几百项拼进一条拒绝。省略数只用标点与数字表达,不引入未经 locale 的新词;`test/integration/filesystem.test.ts` 钉住截断形状。
|
|
24
|
+
- **允许根的形状归一**(`src/templates.ts`):登记项先剥末尾分隔符再去重,`/a` 与 `/a/` 认作同一棵树、不再在卡上摆两行;剥完为空(POSIX 根 `/`)或只剩盘符(`C:`)时保留原值,因为后者在 win32 是「该盘当前目录」的相对形式而不是根。`~` 归入「非绝对路径」一档被丢弃——它靠 shell 展开,而 host 的 `path.resolve` 不展开它,留着等于登记一条指向不明的允许根。
|
|
25
|
+
|
|
26
|
+
### Docs
|
|
27
|
+
|
|
28
|
+
- **补齐 0.1.8 落下的一处文档**:frontmatter 行数上限当时已从 20 抬到 200(`src/templates.ts` 的 `FRONTMATTER_MAX_LINES`),两份 README 的 `unnamed` 计数说明仍写「前 20 行」,四处一并改到 200。
|
|
29
|
+
- **`importAllowRoots` 一行的语义**:补上「相对路径与 `~` 丢弃」与「末尾分隔符归一后去重」,与上面 Fixed 第二条的实现同值;dsh 徽章由 `^0.2.1-rc.3` 抬到 `^0.2.1-rc.5`,与 `engines.dsh` 首条同值。
|
|
5
30
|
|
|
6
31
|
## 0.1.8
|
|
7
32
|
|
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<a href="https://www.npmjs.com/package/@jayyuen66/dsh-dir-prep-organize"><img src="https://img.shields.io/npm/d18m/@jayyuen66/dsh-dir-prep-organize?style=flat-square" alt="npm downloads (18 months)" /></a>
|
|
12
12
|
<a href="https://github.com/JayYuen666/dsh-dir-prep-organize/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-dir-prep-organize/ci.yml?branch=main&style=flat-square&label=ci" alt="ci" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/license-MIT-4c1?style=flat-square" alt="MIT" />
|
|
14
|
-
<img src="https://img.shields.io/badge/node-%3E%
|
|
15
|
-
<img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.
|
|
14
|
+
<img src="https://img.shields.io/badge/node-%3E%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
|
|
15
|
+
<img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.5-658EFF?style=flat-square" alt="dsh" />
|
|
16
16
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by_dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" /></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
@@ -69,9 +69,9 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
|
|
|
69
69
|
|
|
70
70
|
Remove with `dsh plugin --profile web remove @jayyuen66/dsh-dir-prep-organize`. The package is on the public npm registry, so installation needs no credentials and no scoped-registry line.
|
|
71
71
|
|
|
72
|
-
- **Requires Node.js `>=
|
|
73
|
-
- **Requires host `dsh`
|
|
74
|
-
- **The `@deepseek-ai/dsh-*` development pins are at `0.2.2-
|
|
72
|
+
- **Requires Node.js `>= 24.9`.** This is an ESM-only package. Use the **named** exports (`import { apply } from "@jayyuen66/dsh-dir-prep-organize"`); there is **no default export**, so `import pkg from …` fails with `does not provide an export named 'default'`. That Node floor is what makes `require()` of an ESM entry work at all, which is why `engines.node` is declared.
|
|
73
|
+
- **Requires host `dsh` on either the `0.2.1-rc.5` or the `0.2.2-alpha.3` host line.** The requirement the host actually reads is `engines.dsh` (`^0.2.1-rc.5 || ^0.2.2-alpha.3`), and it **decides alone**: `evaluatePluginCompatibility` returns on the `engines.dsh` branch before it ever looks at `peerDependencies`. Measured against the real host code: `0.2.0-rc.2` and `0.2.1-rc.3` are **refused**, `0.2.1-rc.5` and `0.2.2` pass, `0.3.0` is refused. A refused host needs the explicit risk grant `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`. The support window rolls: this package is verified against every released host version inside the window at publish time and re-verified once the window moves, so the version number in this bullet is not a standing promise.
|
|
74
|
+
- **The `@deepseek-ai/dsh-*` development pins are at `0.2.2-rc.1`** - the host line this package is built and tested against. `engines.dsh` and the optional peer ranges carry the separately checked support window (`^0.2.1-rc.5 || ^0.2.2-alpha.3`); the pin is a fact about which host version it was *compiled* against, not a restatement of that window. Mixing the two is why the publish gate checks them separately.
|
|
75
75
|
- **No `@deepseek-ai/*` under `dependencies`, by contract** (`test/publish-manifest.test.ts` enforces it). Consumer profiles install with `nodeLinker: hoisted` and `autoInstallPeers: false`, so a host package under `dependencies` is materialized as a **real directory** next to the copy the running host 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 reads the scheduler off the profile copy, gets `undefined`, and **every native tool call throws** - while this package's build, typecheck and coverage gates stay green right up to that moment.
|
|
76
76
|
- **The two host packages `host.js` imports as values are required peers**: `@deepseek-ai/schemastery` (the host's fork - only it resolves the `.volatile()` fields) and `@deepseek-ai/dsh-brand`. `build-host.mjs` externalizes `dependencies` **and** `peerDependencies`, so the bare specifiers stay in the artifact; a devDependencies-only entry would let the bundler inline the official function body. `test/build-host.test.ts` pins both "specifier present" and "function body absent".
|
|
77
77
|
- **Every host package the emitted declarations name is declared under `peerDependencies`**, and each one reached only there is *optional* (`@deepseek-ai/cordis`, `cosmokit`, and the `dsh-agent-default-model` / client-ui / `fs` / `llm` / `session` family). 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 on the consumer's side, while this repository's own typecheck stays green. The test reads that roster off `types/**/*.d.ts` rather than off this paragraph, so the two cannot drift apart.
|
|
@@ -145,7 +145,7 @@ Namespace `dir-prep-organize` equals the settings entry id. Fields projected int
|
|
|
145
145
|
| Field | Type | Default | Card control | Notes |
|
|
146
146
|
|---|---|---|---|---|
|
|
147
147
|
| `templates` | `{id,name,description,text,group,emoji}[]` | unset | **yes** | The user's own templates. Unset falls back to the 85 built-in entries |
|
|
148
|
-
| `importAllowRoots` | `string[]` | `[]` | **yes** | Extra allowed roots for the import endpoint. Non-strings and whitespace-only items are dropped
|
|
148
|
+
| `importAllowRoots` | `string[]` | `[]` | **yes** | Extra allowed roots for the import endpoint. Non-strings and whitespace-only items are dropped, **relative paths and `~` are dropped too** (the host resolves those against its own process cwd, which would register a root whose target nobody can read off the card), and items are deduplicated after trailing separators are normalized — `/a` and `/a/` are one tree, not two rows. With nothing registered, only the session cwd and the built-in role library are allowed |
|
|
149
149
|
| `organizeTimeoutMs` | natural, volatile | `120000` | **no** | The LLM abort deadline in ms. Values are truncated and clamped to `[1, 2147483647]`; non-finite values fall back to `120000`. `0` passes the schema and clamps to 1 ms, so it really does mean an immediate timeout. Past 2^31-1 Node's `setTimeout` prints a `TimeoutOverflowWarning` and silently uses **1 ms**, which turns "raise the timeout" into "fail instantly". The card has no control, so changing it means `settings.yaml` or the row's `config:` |
|
|
150
150
|
| `maxSnippetBytes` | natural, non-volatile | `262144` | **no** | Per-file cap for key-file snippets; a larger file, or one whose size is unknown, is skipped whole and counted in `skipped.tooLarge`. Import candidates use the same cap. Non-volatile means no form projection, hence no card row - deployment value only |
|
|
151
151
|
| `readConcurrency` | natural, non-volatile | `8` | **no** | Bounded read concurrency for snippets and directory imports. Clamped to `[1, 64]`: `0` or a negative value made the bounded map recurse forever until the host was killed by the OOM killer, and a huge value defeats the fd ceiling this field exists to hold |
|
|
@@ -186,9 +186,9 @@ Official Typert Remote namespace **`dirPrepOrganize`**, registered through an in
|
|
|
186
186
|
Registered honestly, one entry per class.
|
|
187
187
|
|
|
188
188
|
- **Nothing is truncated for you.** Directory listings, conversation text and role bodies go in whole. Snippets are omitted whole rather than shortened: one over the per-file cap or past the 2 MiB total budget is counted and left out. A context overflow is the model's error to report and yours to slim - this plugin will not silently drop half your draft.
|
|
189
|
-
- **The import card has no session context.** Its POST sends `sessionId` as an empty string, so an import must live inside the built-in `agents/` or a registered root, and must contain no `.` / `..` / hidden segments. The rejection names the allowed zones and echoes the resolved path.
|
|
189
|
+
- **The import card has no session context.** Its POST sends `sessionId` as an empty string, so an import must live inside the built-in `agents/` or a registered root, and must contain no `.` / `..` / hidden segments. The rejection names the allowed zones — at most five of them, the remainder folded into a `…<count>` so a large roster cannot turn one refusal into a page of paths — and echoes the resolved path.
|
|
190
190
|
- **Directory import reaches two levels.** The top level plus one sub-directory level; a third level is only **counted** as `deeper`, never imported.
|
|
191
|
-
- **A file whose name cannot be parsed from the first
|
|
191
|
+
- **A file whose name cannot be parsed from the first 200 frontmatter lines counts as `unnamed`** and is skipped rather than guessed.
|
|
192
192
|
- **Machine translation does not exist here.** The `agents/` role library and template bodies are user data; they are never translated, whichever interface language is active.
|
|
193
193
|
- **The polish path is best-effort about the model's answer.** A non-`stop` finish reason fails the whole call; a model that returns prose instead of a rewrite replaces your draft with that prose, unless the draft or input phase changed meanwhile and the write-back is refused.
|
|
194
194
|
|
|
@@ -199,7 +199,7 @@ Registered honestly, one entry per class.
|
|
|
199
199
|
| Nothing changed after pressing "Polish" | Failures never touch the draft; the button shows an error state for a few seconds with the reason in its tooltip. Usual causes: no session cwd (`sessionId` missing or session unknown), no model selection, a finish reason other than `stop`, the `organizeTimeoutMs` deadline, or the draft/selection changing while the request was in flight (the result is discarded) |
|
|
200
200
|
| The model reports a context overflow | Working as designed: input is deliberately not truncated, so the model error is the feedback. A payload above the endpoint body cap gets 413 instead |
|
|
201
201
|
| Importing local roles was refused | Absolute paths are refused by default and the card has no session context. The path must live inside the built-in `agents/` or a registered directory and contain no `.` / `..` / hidden segments |
|
|
202
|
-
| Fewer entries imported than expected | Read the four `skipped` counters: `deeper` (third level, counted only), `tooLarge` (over `maxSnippetBytes`), `unnamed` (no name in the first
|
|
202
|
+
| Fewer entries imported than expected | Read the four `skipped` counters: `deeper` (third level, counted only), `tooLarge` (over `maxSnippetBytes`), `unnamed` (no name in the first 200 frontmatter lines), `unreadable` (read failure) |
|
|
203
203
|
| Template edits not applied / wrong language | Edits stage locally and take effect for newly opened dropdowns after **Save**. Labels and copy follow the official locale preference; role and template **bodies** are user data and are never machine translated |
|
|
204
204
|
|
|
205
205
|
## <img src="https://api.iconify.design/lucide/wrench.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Development
|
package/README.zh-CN.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<a href="https://www.npmjs.com/package/@jayyuen66/dsh-dir-prep-organize"><img src="https://img.shields.io/npm/d18m/@jayyuen66/dsh-dir-prep-organize?style=flat-square" alt="npm downloads (18 months)" /></a>
|
|
12
12
|
<a href="https://github.com/JayYuen666/dsh-dir-prep-organize/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-dir-prep-organize/ci.yml?branch=main&style=flat-square&label=ci" alt="ci" /></a>
|
|
13
13
|
<img src="https://img.shields.io/badge/license-MIT-4c1?style=flat-square" alt="MIT" />
|
|
14
|
-
<img src="https://img.shields.io/badge/node-%3E%
|
|
15
|
-
<img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.
|
|
14
|
+
<img src="https://img.shields.io/badge/node-%3E%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
|
|
15
|
+
<img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.5-658EFF?style=flat-square" alt="dsh" />
|
|
16
16
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/powered_by_dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white" alt="powered by dsh" /></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
@@ -69,9 +69,9 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
|
|
|
69
69
|
|
|
70
70
|
卸载:`dsh plugin --profile web remove @jayyuen66/dsh-dir-prep-organize`。包在公共 npm 上,安装不需要凭据,也不需要配作用域源。
|
|
71
71
|
|
|
72
|
-
- **要求 Node.js `>=
|
|
73
|
-
- **要求宿主 `dsh` 在 `0.2.1-rc.
|
|
74
|
-
- **`@deepseek-ai/dsh-*` 的开发依赖钉在 `0.2.2-
|
|
72
|
+
- **要求 Node.js `>= 24.9`。** 本包是纯 ESM。用**具名**导出(`import { apply } from "@jayyuen66/dsh-dir-prep-organize"`);**没有 default 导出**,所以 `import pkg from …` 会报 `does not provide an export named 'default'`。正是这个 Node 下限让 ESM 入口的 `require()` 形式可用,所以声明了 `engines.node`。
|
|
73
|
+
- **要求宿主 `dsh` 在 `0.2.1-rc.5` 或 `0.2.2-alpha.3` 这条宿主线上。** 宿主真正读的是 `engines.dsh`(`^0.2.1-rc.5 || ^0.2.2-alpha.3`),而且它**单独决定**:`evaluatePluginCompatibility` 在 `engines.dsh` 那一支就返回了,根本走不到读 `peerDependencies` 的那段。对宿主真实代码实测:`0.2.0-rc.2` 与 `0.2.1-rc.3` **被拒**,`0.2.1-rc.5` 与 `0.2.2` 通过,`0.3.0` 被拒。被拒的宿主需要走显式担责的授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证,窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
|
|
74
|
+
- **`@deepseek-ai/dsh-*` 的开发依赖钉在 `0.2.2-rc.1`**——本包编译与测试所对着的那条宿主线。`engines.dsh` 与 optional peer 范围承载单独判读的支持窗口(`^0.2.1-rc.5 || ^0.2.2-alpha.3`);钉版是关于「它是对着哪个宿主版本**编译**的」的事实,不是那个窗口的复述。把两者混为一谈,正是发布门禁分开检查它们的原因。
|
|
75
75
|
- **`dependencies` 里不放任何 `@deepseek-ai/*`,这是契约**(`test/publish-manifest.test.ts` 钉着)。消费方 profile 用 `nodeLinker: hoisted` 且 `autoInstallPeers: false` 安装,于是写在 `dependencies` 里的宿主包会被落成**真实目录**,与运行中的宿主已加载的那份并存。`@deepseek-ai/dsh-tools` 的工具运行期调度键是普通 `Symbol`(不是 `Symbol.for`),符号身份按模块实例算:宿主从 profile 副本上读那个键拿到 `undefined`,于是**每一次原生工具调用都抛**——而本包的构建、类型检查、覆盖率门禁在此之前全部照绿。
|
|
76
76
|
- **`host.js` 按值导入的那两枚宿主包是必需 peer**:`@deepseek-ai/schemastery`(宿主 fork——只有它能把 `.volatile()` 字段解析成活引用)与 `@deepseek-ai/dsh-brand`。`build-host.mjs` 外部化 `dependencies` **与** `peerDependencies`,所以裸说明符留在产物里;只写 `devDependencies` 会让打包器把官方函数体内联进去。`test/build-host.test.ts` 同时钉「说明符在」与「函数体不在」。
|
|
77
77
|
- **声明里点到的每一枚宿主包都落在 `peerDependencies`**,凡是只能从那里到达的都是 *optional*(`@deepseek-ai/cordis`、`cosmokit`,以及 `dsh-agent-default-model` / client-ui / `fs` / `llm` / `session` 那一族)。声明它们不是仪式:pnpm 严格布局下,`types/host.d.ts` 里一枚没有被任何 manifest 表点名的裸说明符在消费方侧解析不到,而本仓自己的类型检查照样绿。那条清单由测试从 `types/**/*.d.ts` 现量读,不从这段文字读,所以两边不会漂移。
|
|
@@ -145,7 +145,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
|
|
|
145
145
|
| 字段 | 类型 | 默认值 | 卡上有控件 | 说明 |
|
|
146
146
|
|---|---|---|---|---|
|
|
147
147
|
| `templates` | `{id,name,description,text,group,emoji}[]` | 未设置 | **有** | 用户自己的模板。未设置时回落到 85 条内置 |
|
|
148
|
-
| `importAllowRoots` | `string[]` | `[]` | **有** |
|
|
148
|
+
| `importAllowRoots` | `string[]` | `[]` | **有** | 导入端点的额外允许根,逐个目录登记;非字符串与纯空白项丢弃,**相对路径与 `~` 同样丢弃**(host 按它自己的进程 cwd 解析它们,等于登记一条界面上看不出指向哪里的根),末尾分隔符归一后再去重——`/a` 与 `/a/` 是同一棵树,不该在卡上摆两行。一个都没登记时只允许会话 cwd 与内置角色库 |
|
|
149
149
|
| `organizeTimeoutMs` | natural,volatile | `120000` | **无** | LLM 中止时限(毫秒)。取值先取整再夹到 `[1, 2147483647]`;非有限数回落到 `120000`。`0` 能过 schema,夹完是 1 ms,所以它确实表示"立刻超时"。超过 2^31-1 时 Node 的 `setTimeout` 会打 `TimeoutOverflowWarning` 并静默用 **1 ms**,于是"调大超时"变成"立刻失败"。卡上没有控件,改它只能经 `settings.yaml` 或该行的 `config:` |
|
|
150
150
|
| `maxSnippetBytes` | natural,非 volatile | `262144` | **无** | 关键文件摘要的单文件上限;超过、或大小未知的文件整份跳过并计入 `skipped.tooLarge`。导入候选用同一个上限。非 volatile 意味着不进表单快照,所以也没有卡上的行——纯部署值 |
|
|
151
151
|
| `readConcurrency` | natural,非 volatile | `8` | **无** | 摘要与目录导入的有界读并发。夹在 `[1, 64]`:`0` 或负数会让那套有界 map 自我递归直到宿主被 OOM killer 杀掉,而过大的值直接废掉这个字段存在的意义(fd 上限) |
|
|
@@ -186,9 +186,9 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
|
|
|
186
186
|
按类登记,每类一条。
|
|
187
187
|
|
|
188
188
|
- **没有任何东西替你截断。** 目录列表、对话文本与角色正文都是整份进去的。摘要则是整份略去而不是缩短:超过单文件上限、或超出 2 MiB 总量预算的,会记进计数并整条不放。上下文溢出是模型的报错,也是你收窄输入的依据——本插件不会静默丢掉你半份草稿。
|
|
189
|
-
- **导入卡没有会话上下文。** 它的 POST 把 `sessionId` 发成空串,所以导入目标必须在内置 `agents/` 或某个已登记的根之内,且不含 `.` / `..` /
|
|
189
|
+
- **导入卡没有会话上下文。** 它的 POST 把 `sessionId` 发成空串,所以导入目标必须在内置 `agents/` 或某个已登记的根之内,且不含 `.` / `..` / 隐藏段。拒绝时会点名允许区——最多列五处,其余折成 `…<条数>`,以免登记项一多就把一次拒绝写成满屏路径——并回显解析后的路径。
|
|
190
190
|
- **目录导入只到两层。** 顶层加一层子目录;第三层只被**计数**为 `deeper`,永不导入。
|
|
191
|
-
- **前
|
|
191
|
+
- **前 200 行 frontmatter 里解析不出名字的文件计为 `unnamed`**,跳过而不是猜。
|
|
192
192
|
- **这里没有机器翻译。** `agents/` 角色库与模板正文是用户数据,无论界面语言如何,永不被翻译。
|
|
193
193
|
- **润色对模型回答只能尽力而为。** finish reason 不是 `stop` 就整趟失败;而模型若返回散文而不是重写结果,草稿就被那段散文替换掉——除非草稿或输入阶段在途中变了,这次写回会被拒绝。
|
|
194
194
|
|
|
@@ -199,7 +199,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
|
|
|
199
199
|
| 按了「润色」什么都没变 | 失败从不碰草稿;按钮进入错误态若干秒,原因在 tooltip 里。常见成因:没有会话 cwd(`sessionId` 缺失或会话未知)、没有模型选择、finish reason 不是 `stop`、撞上 `organizeTimeoutMs` 时限,或请求途中草稿/模型选择变了(结果被丢弃) |
|
|
200
200
|
| 模型报上下文溢出 | 这是设计如此:输入刻意不截断,模型报错就是反馈。载荷超过端点 body 上限则得到 413 |
|
|
201
201
|
| 导入本地角色被拒 | 绝对路径默认拒绝,而卡片没有会话上下文。路径必须在内置 `agents/` 或某个已登记目录之内,且不含 `.` / `..` / 隐藏段 |
|
|
202
|
-
| 导入的条目比预期少 | 看四个 `skipped` 计数器:`deeper`(第三层,只计数)、`tooLarge`(超过 `maxSnippetBytes`)、`unnamed`(前
|
|
202
|
+
| 导入的条目比预期少 | 看四个 `skipped` 计数器:`deeper`(第三层,只计数)、`tooLarge`(超过 `maxSnippetBytes`)、`unnamed`(前 200 行 frontmatter 里没有名字)、`unreadable`(读失败) |
|
|
203
203
|
| 模板改动没生效 / 语言不对 | 改动先在本地暂存,点**保存**后对新生效的下拉可见。标签与文案遵循官方 locale 偏好;而角色与模板**正文**是用户数据,永不做机器翻译 |
|
|
204
204
|
|
|
205
205
|
## <img src="https://api.iconify.design/lucide/wrench.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 开发
|
package/client.js
CHANGED
|
@@ -7,9 +7,10 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let exports = module.exports;
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
9
|
let react = require("react");
|
|
10
|
+
let _jayyuen66_dsh_plugin_shared_client = require("@jayyuen66/dsh-plugin-shared/client");
|
|
10
11
|
let zod = require("zod");
|
|
11
12
|
// node_modules/@jayyuen66/dsh-plugin-shared/dist/record.js
|
|
12
|
-
function e
|
|
13
|
+
function e(e) {
|
|
13
14
|
return typeof e == `object` && !!e && !Array.isArray(e);
|
|
14
15
|
}
|
|
15
16
|
// src/templates.ts
|
|
@@ -65,7 +66,7 @@ function trimField(value) {
|
|
|
65
66
|
* 返回 undefined 表示该条应被剔除。 */
|
|
66
67
|
function normalizeEntry(item, index, seen) {
|
|
67
68
|
let result;
|
|
68
|
-
if (e
|
|
69
|
+
if (e(item)) {
|
|
69
70
|
const { id, name, description, text, group, emoji } = item;
|
|
70
71
|
const nextName = trimField(name);
|
|
71
72
|
const nextText = trimField(text);
|
|
@@ -101,6 +102,22 @@ function sanitizeTemplateList(raw) {
|
|
|
101
102
|
}
|
|
102
103
|
return out;
|
|
103
104
|
}
|
|
105
|
+
const BACKSLASH = String.fromCodePoint(92);
|
|
106
|
+
const WIN_DRIVE_LETTER = /^[A-Za-z]:$/u;
|
|
107
|
+
const TRAILING_SEPARATORS = /[/\\]+$/u;
|
|
108
|
+
/** 绝对路径形状(与 host 侧 path.isAbsolute 同口径的宽松版:POSIX 根、win32 盘符、UNC)。
|
|
109
|
+
* client 半跑在浏览器里,没有 node:path 可用,故按形状判。 */
|
|
110
|
+
function isAbsolutePath(value) {
|
|
111
|
+
const winDrive = WIN_DRIVE_LETTER.test(value.slice(0, 2)) && (value[2] === "/" || value[2] === BACKSLASH);
|
|
112
|
+
return value.startsWith("/") || winDrive || value.startsWith(BACKSLASH + BACKSLASH);
|
|
113
|
+
}
|
|
114
|
+
/** 剥末尾分隔符;剥完为空(POSIX 根 `/`)或只剩盘符(`C:`)时留原值——后者在 win32
|
|
115
|
+
* 是「该盘当前目录」的相对形式,不是根。 */
|
|
116
|
+
function normalizeRootShape(value) {
|
|
117
|
+
const stripped = value.replace(TRAILING_SEPARATORS, "");
|
|
118
|
+
if (stripped.length === 0 || WIN_DRIVE_LETTER.test(stripped)) return value;
|
|
119
|
+
return stripped;
|
|
120
|
+
}
|
|
104
121
|
/** 任意来源(settings 快照 / 设置卡草稿)→ 合法的「导入允许目录」列表(纯函数)。
|
|
105
122
|
* host 的导入策略是「会话 cwd + 内置角色库 + importAllowRoots」,绝对路径默认拒绝,
|
|
106
123
|
* 这里登记的每一项都是**放一个读盘口子**,故:
|
|
@@ -108,21 +125,17 @@ function sanitizeTemplateList(raw) {
|
|
|
108
125
|
* - 非字符串 / trim 后为空 → 丢弃(空串在 host 侧 path.resolve 会落到进程 cwd,
|
|
109
126
|
* 绝不能让它变成一个隐式允许根);
|
|
110
127
|
* - **非绝对路径 → 丢弃**:契约是「额外允许的绝对目录」,相对项会被 host 按它自己的
|
|
111
|
-
* 进程 cwd
|
|
112
|
-
*
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
|
|
116
|
-
const WIN_DRIVE_LETTER = /^[A-Za-z]:$/u;
|
|
117
|
-
function isAbsolutePath(value) {
|
|
118
|
-
const winDrive = WIN_DRIVE_LETTER.test(value.slice(0, 2)) && (value[2] === "/" || value[2] === BACKSLASH);
|
|
119
|
-
return value.startsWith("/") || winDrive || value.startsWith(BACKSLASH + BACKSLASH);
|
|
120
|
-
}
|
|
128
|
+
* 进程 cwd 解析,等于登记了一条用户没写过、界面上也看不出指向哪里的允许根;`~`
|
|
129
|
+
* 靠 shell 展开,host 的 path.resolve 不展开它,同归这一档;
|
|
130
|
+
* - 末尾分隔符归一后去重(`/a` 与 `/a/` 是同一棵树,不该在界面上摆两行);
|
|
131
|
+
* - 条数与单条长度都不设上限:静默丢一条就是「看着成功、内容没进去」;条目多撑长的
|
|
132
|
+
* 越界回执由 host 侧的列举上限收口。 */
|
|
121
133
|
function sanitizeAllowRoots(raw) {
|
|
122
134
|
const out = [];
|
|
123
135
|
if (Array.isArray(raw)) for (const item of raw) {
|
|
124
136
|
const root = typeof item === "string" ? item.trim() : "";
|
|
125
|
-
|
|
137
|
+
const shaped = normalizeRootShape(root);
|
|
138
|
+
if (root.length > 0 && isAbsolutePath(shaped) && !out.includes(shaped)) out.push(shaped);
|
|
126
139
|
}
|
|
127
140
|
return out;
|
|
128
141
|
}
|
|
@@ -397,138 +410,6 @@ const UI_MESSAGES = {
|
|
|
397
410
|
builtinRetry: "Retry"
|
|
398
411
|
}
|
|
399
412
|
};
|
|
400
|
-
// node_modules/@jayyuen66/dsh-plugin-shared/dist/errors.js
|
|
401
|
-
function t$1(e) {
|
|
402
|
-
let t = Object.getOwnPropertyDescriptor(e, `message`);
|
|
403
|
-
return t !== void 0 && `value` in t && typeof t.value == `string` ? t.value : void 0;
|
|
404
|
-
}
|
|
405
|
-
function n$1(e, r) {
|
|
406
|
-
if (r.has(e)) return `<circular cause>`;
|
|
407
|
-
r.add(e);
|
|
408
|
-
try {
|
|
409
|
-
if (!(e instanceof Error)) {
|
|
410
|
-
if (typeof e == `object` && e) {
|
|
411
|
-
let n = t$1(e);
|
|
412
|
-
if (n !== void 0 && n !== ``) return n;
|
|
413
|
-
}
|
|
414
|
-
return String(e);
|
|
415
|
-
}
|
|
416
|
-
let i = e.message === `` ? e.name : e.message, a = typeof globalThis.AggregateError == `function` && e instanceof AggregateError && e.errors.length > 0 ? ` [${e.errors.map((e) => n$1(e, r)).join(`; `)}]` : ``, o = e.cause === void 0 || e.cause === null ? `` : n$1(e.cause, r);
|
|
417
|
-
return `${i}${a}${o === `` || o === i ? `` : `: ${o}`}`;
|
|
418
|
-
} catch {
|
|
419
|
-
return `<unrenderable value>`;
|
|
420
|
-
} finally {
|
|
421
|
-
r.delete(e);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function r$1(e) {
|
|
425
|
-
return n$1(e, /* @__PURE__ */ new Set());
|
|
426
|
-
}
|
|
427
|
-
// node_modules/@jayyuen66/dsh-plugin-shared/dist/card-ui.js
|
|
428
|
-
const c = `
|
|
429
|
-
.dsu-form{display:flex;flex-direction:column}
|
|
430
|
-
.dsu-section{margin-top:24px;padding-top:24px;border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
431
|
-
.dsu-form>.dsu-section:first-child{margin-top:0;padding-top:0;border-top:0}
|
|
432
|
-
.dsu-sectionTitle{margin:0;font-size:15px;font-weight:600;line-height:1.4;color:var(--dsw-alias-label-primary)}
|
|
433
|
-
.dsu-sectionHint{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
|
|
434
|
-
.dsu-statusbar{display:flex;flex-wrap:wrap;gap:4px 8px;margin-top:8px;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
|
|
435
|
-
.dsu-field{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,360px);column-gap:32px;align-items:center;padding:12px 0;border-top:.5px solid var(--dsw-alias-border-l2)}
|
|
436
|
-
.dsu-fieldMeta{display:flex;flex-direction:column;gap:4px;min-width:0}
|
|
437
|
-
.dsu-labelRow{display:flex;align-items:center;gap:6px;min-width:0}
|
|
438
|
-
.dsu-label{font-size:13px;font-weight:500;line-height:1.5;color:var(--dsw-alias-label-primary)}
|
|
439
|
-
.dsu-labelMono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
|
|
440
|
-
.dsu-hint{margin:0;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
|
|
441
|
-
.dsu-control{min-width:0;display:flex;align-items:center;gap:8px}
|
|
442
|
-
.dsu-fieldWide{grid-template-columns:minmax(0,1fr);align-items:start}
|
|
443
|
-
.dsu-fieldWide .dsu-control{width:100%;max-width:720px;margin-top:2px}
|
|
444
|
-
.dsu-help{display:inline-flex;align-items:center;gap:6px;min-width:0}
|
|
445
|
-
.dsu-helpBtn{appearance:none;border:0;background:transparent;padding:0;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary);cursor:help;border-radius:50%;flex:none}
|
|
446
|
-
.dsu-help:hover .dsu-helpBtn,.dsu-helpBtn:focus-visible{color:var(--dsw-alias-label-primary)}
|
|
447
|
-
.dsu-helpBtn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}
|
|
448
|
-
.dsu-tip{position:fixed;z-index:60;box-sizing:border-box;max-width:min(340px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;overflow-wrap:anywhere;padding:10px 12px;border-radius:10px;background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l3);box-shadow:0 12px 32px rgb(0 0 0 / 45%);font-size:12px;line-height:1.6;font-weight:400;color:var(--dsw-alias-label-secondary)}
|
|
449
|
-
.dsu-input{width:100%;height:34px;padding:0 12px;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}
|
|
450
|
-
.dsu-input:focus-visible{outline:none;border-color:var(--dsw-alias-state-business-primary)}
|
|
451
|
-
.dsu-input[aria-invalid="true"]{border-color:var(--dsw-alias-state-error-primary)}
|
|
452
|
-
.dsu-input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}
|
|
453
|
-
.dsu-input::placeholder{color:var(--dsw-alias-label-tertiary)}
|
|
454
|
-
.dsu-textarea{height:auto;min-height:96px;padding:8px 12px;line-height:1.6;resize:vertical}
|
|
455
|
-
.dsu-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
|
456
|
-
.dsu-numberWrap{display:flex;flex-direction:column;gap:4px;width:100%;min-width:0}
|
|
457
|
-
.dsu-number{display:flex;align-items:center;gap:8px;min-width:0}
|
|
458
|
-
.dsu-number .dsu-input{min-width:0}
|
|
459
|
-
.dsu-unit{flex:none;font-size:12px;color:var(--dsw-alias-label-tertiary)}
|
|
460
|
-
.dsu-error{margin:0;font-size:12px;line-height:1.5;color:var(--dsw-alias-state-error-primary)}
|
|
461
|
-
.dsu-switch{appearance:none;width:36px;height:20px;border-radius:999px;border:0;padding:2px;background:var(--dsw-alias-border-l3);display:flex;align-items:center;cursor:pointer;flex:none;transition:background-color .16s}
|
|
462
|
-
.dsu-knob{width:16px;height:16px;border-radius:50%;background:var(--dsw-alias-label-primary);transition:transform .16s,background-color .16s}
|
|
463
|
-
.dsu-switch[aria-checked="true"]{background:var(--dsw-alias-label-primary)}
|
|
464
|
-
.dsu-switch[aria-checked="true"] .dsu-knob{transform:translateX(16px);background:var(--dsw-alias-label-primary-foreground)}
|
|
465
|
-
.dsu-switch:disabled{opacity:.4;cursor:not-allowed}
|
|
466
|
-
.dsu-switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
467
|
-
.dsu-selectWrap{position:relative;width:100%;min-width:0}
|
|
468
|
-
.dsu-select{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;cursor:pointer}
|
|
469
|
-
.dsu-select[aria-expanded="true"]{border-color:var(--dsw-alias-state-business-primary)}
|
|
470
|
-
.dsu-selectValue{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
471
|
-
.dsu-chevron{flex:none;color:var(--dsw-alias-label-tertiary);transition:transform .16s}
|
|
472
|
-
.dsu-select[aria-expanded="true"] .dsu-chevron{transform:rotate(180deg)}
|
|
473
|
-
.dsu-menu{position:fixed;z-index:70;padding:4px;background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l3);border-radius:12px;box-shadow:0 12px 32px rgb(0 0 0 / 50%);max-height:280px;overflow:auto}
|
|
474
|
-
.dsu-option{appearance:none;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:1.4;width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border-radius:8px;cursor:pointer;text-align:left}
|
|
475
|
-
.dsu-option:hover,.dsu-option[data-active="true"]{background:var(--dsw-alias-bg-layer-3)}
|
|
476
|
-
.dsu-option:disabled{color:var(--dsw-alias-label-tertiary);cursor:not-allowed}
|
|
477
|
-
.dsu-option:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
|
|
478
|
-
.dsu-optionGroup{padding:6px 10px 2px;font-size:11px;font-weight:600;color:var(--dsw-alias-label-tertiary)}
|
|
479
|
-
.dsu-check{opacity:0;flex:none}
|
|
480
|
-
.dsu-option[aria-selected="true"] .dsu-check{opacity:1}
|
|
481
|
-
.dsu-savebar{display:flex;align-items:center;gap:8px;padding:12px 0;margin-top:24px;border-top:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
|
|
482
|
-
.dsu-savebar[data-dirty="true"]{position:sticky;bottom:0;z-index:2;box-shadow:0 -12px 24px rgb(0 0 0 / 35%)}
|
|
483
|
-
.dsu-btn{appearance:none;border:.5px solid var(--dsw-alias-border-l2);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:1.5;border-radius:var(--dsw-radius-md);padding:5px 14px;cursor:pointer;transition:background-color .12s,border-color .12s,color .12s,filter .12s}
|
|
484
|
-
.dsu-btn:hover:not(:disabled){background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-border-l3)}
|
|
485
|
-
.dsu-btn:active:not(:disabled){background:var(--dsw-alias-bg-layer-1)}
|
|
486
|
-
.dsu-btn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}
|
|
487
|
-
.dsu-btn:disabled{opacity:.4;cursor:not-allowed}
|
|
488
|
-
.dsu-btnPrimary{background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}
|
|
489
|
-
.dsu-btnPrimary:hover:not(:disabled){background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);filter:brightness(.9)}
|
|
490
|
-
.dsu-btnPrimary:active:not(:disabled){background:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-primary);filter:brightness(.84)}
|
|
491
|
-
.dsu-btnDanger{color:var(--dsw-alias-state-error-primary)}
|
|
492
|
-
.dsu-btnDanger:hover:not(:disabled){color:var(--dsw-alias-state-error-primary);border-color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-2)}
|
|
493
|
-
.dsu-status{margin-left:auto;font-size:12px;color:var(--dsw-alias-label-tertiary)}
|
|
494
|
-
.dsu-statusError{color:var(--dsw-alias-state-error-primary)}
|
|
495
|
-
.dsu-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr));gap:0 24px}
|
|
496
|
-
.dsu-grid>.dsu-field{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:10px 0;border-top:.5px solid var(--dsw-alias-border-l1)}
|
|
497
|
-
.dsu-grid>.dsu-field .dsu-control{width:100%}
|
|
498
|
-
@media (max-width:640px){
|
|
499
|
-
.dsu-field{grid-template-columns:minmax(0,1fr);align-items:start}
|
|
500
|
-
.dsu-control{width:100%;max-width:720px}
|
|
501
|
-
.dsu-section{margin-top:20px;padding-top:20px}
|
|
502
|
-
}
|
|
503
|
-
@media (prefers-reduced-motion:reduce){
|
|
504
|
-
.dsu-switch,.dsu-knob,.dsu-chevron,.dsu-btn{transition:none}
|
|
505
|
-
}
|
|
506
|
-
`;
|
|
507
|
-
function u(t) {
|
|
508
|
-
return (0, react.createElement)(`div`, { className: `dsu-form` }, t.children);
|
|
509
|
-
}
|
|
510
|
-
function d(t) {
|
|
511
|
-
return (0, react.createElement)(`section`, { className: `dsu-section` }, (0, react.createElement)(`h2`, { className: `dsu-sectionTitle` }, t.title), t.hint === void 0 ? null : (0, react.createElement)(`p`, { className: `dsu-sectionHint` }, t.hint), t.children);
|
|
512
|
-
}
|
|
513
|
-
function S(t) {
|
|
514
|
-
let n = !t.writable || t.busy || !t.dirty, r;
|
|
515
|
-
return r = t.error === null ? t.writable ? t.dirty ? t.dirtyLabel : t.cleanLabel : t.readOnlyLabel : t.error, (0, react.createElement)(`div`, {
|
|
516
|
-
className: `dsu-savebar`,
|
|
517
|
-
"data-dirty": t.dirty
|
|
518
|
-
}, (0, react.createElement)(`button`, {
|
|
519
|
-
type: `button`,
|
|
520
|
-
className: `dsu-btn dsu-btnPrimary`,
|
|
521
|
-
"data-field": `save`,
|
|
522
|
-
disabled: n,
|
|
523
|
-
onClick: t.onSave
|
|
524
|
-
}, t.busy ? t.savingLabel : t.saveLabel), (0, react.createElement)(`button`, {
|
|
525
|
-
type: `button`,
|
|
526
|
-
className: `dsu-btn`,
|
|
527
|
-
"data-field": `discard`,
|
|
528
|
-
disabled: n,
|
|
529
|
-
onClick: t.onDiscard
|
|
530
|
-
}, t.revertLabel), (0, react.createElement)(`span`, { className: t.error === null ? `dsu-status` : `dsu-status dsu-statusError` }, r));
|
|
531
|
-
}
|
|
532
413
|
// src/input-writeback.ts
|
|
533
414
|
/**
|
|
534
415
|
* 输入框异步写回的凭据与判定。
|
|
@@ -713,13 +594,13 @@ const DIR_PREP_DESCRIPTORS = [
|
|
|
713
594
|
result: { mode: "src-json" }
|
|
714
595
|
}
|
|
715
596
|
];
|
|
716
|
-
const isMounter = (value) =>
|
|
717
|
-
const isNamespace = (value) =>
|
|
597
|
+
const isMounter = (value) => (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(value) && typeof value["$mount"] === "function";
|
|
598
|
+
const isNamespace = (value) => (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(value) && typeof value["defaults"] === "function" && typeof value["context"] === "function" && typeof value["model"] === "function" && typeof value["organize"] === "function" && typeof value["importTemplates"] === "function";
|
|
718
599
|
const unwrap = (raw) => {
|
|
719
|
-
if (!
|
|
600
|
+
if (!(0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) || typeof raw["ok"] !== "boolean") throw new TypeError("Typert Remote 应答不是 RemoteResult:缺少布尔字段 ok");
|
|
720
601
|
if (!raw["ok"]) {
|
|
721
602
|
const { error } = raw;
|
|
722
|
-
if (!
|
|
603
|
+
if (!(0, _jayyuen66_dsh_plugin_shared_client.isRecord)(error) || typeof error["code"] !== "string" || typeof error["message"] !== "string") throw new TypeError("Typert Remote 应答的 error 分支缺 code/message");
|
|
723
604
|
throw new Error(`${error["code"]}: ${error["message"]}`);
|
|
724
605
|
}
|
|
725
606
|
if (!("value" in raw)) throw new TypeError("Typert Remote 应答的 ok 分支缺 value 字段");
|
|
@@ -784,7 +665,7 @@ const CLASS_ROW_HEAD = "dpic-rowhead";
|
|
|
784
665
|
const CLASS_IMPORT_PATH = "dpic-importpath";
|
|
785
666
|
const SLOT_INPUT_RIGHT = "conversation.input.right";
|
|
786
667
|
function parseDirEntry(raw) {
|
|
787
|
-
const { name, isDir, sizeBytes, snippet } =
|
|
668
|
+
const { name, isDir, sizeBytes, snippet } = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) ? raw : {};
|
|
788
669
|
return {
|
|
789
670
|
name: typeof name === "string" ? name : "",
|
|
790
671
|
isDir: isDir === true,
|
|
@@ -815,7 +696,7 @@ function skipCountsOf(skips) {
|
|
|
815
696
|
];
|
|
816
697
|
}
|
|
817
698
|
function parseContextResponse(raw) {
|
|
818
|
-
const rec =
|
|
699
|
+
const rec = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) ? raw : {};
|
|
819
700
|
const { ok, truncated, entries } = rec;
|
|
820
701
|
const parsedEntries = Array.isArray(entries) ? entries.map((entry) => parseDirEntry(entry)) : void 0;
|
|
821
702
|
return {
|
|
@@ -827,7 +708,7 @@ function parseContextResponse(raw) {
|
|
|
827
708
|
};
|
|
828
709
|
}
|
|
829
710
|
function parseModelResponse(raw) {
|
|
830
|
-
const rec =
|
|
711
|
+
const rec = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) ? raw : {};
|
|
831
712
|
return {
|
|
832
713
|
ok: rec["ok"] === true,
|
|
833
714
|
...spreadIfDefined(optionalString(rec, "error"), "error"),
|
|
@@ -837,7 +718,7 @@ function parseModelResponse(raw) {
|
|
|
837
718
|
};
|
|
838
719
|
}
|
|
839
720
|
function parseOrganizeResponse(raw) {
|
|
840
|
-
const rec =
|
|
721
|
+
const rec = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) ? raw : {};
|
|
841
722
|
return {
|
|
842
723
|
ok: rec["ok"] === true,
|
|
843
724
|
...spreadIfDefined(optionalString(rec, "error"), "error"),
|
|
@@ -865,14 +746,14 @@ function formatImportSkips(t, skips) {
|
|
|
865
746
|
return parts.length === 0 ? "" : t("skipSummary", { list: parts.join(t("skipSeparator")) });
|
|
866
747
|
}
|
|
867
748
|
function parseImportResponse(raw) {
|
|
868
|
-
const { ok, error, count, truncated, skipped, entries } =
|
|
749
|
+
const { ok, error, count, truncated, skipped, entries } = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(raw) ? raw : {};
|
|
869
750
|
const parsedEntries = Array.isArray(entries) ? sanitizeTemplateList(entries) : void 0;
|
|
870
751
|
return {
|
|
871
752
|
ok: ok === true,
|
|
872
753
|
...typeof error === "string" ? { error } : {},
|
|
873
754
|
...typeof count === "number" ? { count } : {},
|
|
874
755
|
...truncated === true ? { truncated: true } : {},
|
|
875
|
-
...
|
|
756
|
+
...(0, _jayyuen66_dsh_plugin_shared_client.isRecord)(skipped) ? { skipped: parseImportSkips(skipped) } : {},
|
|
876
757
|
...parsedEntries === void 0 ? {} : { entries: parsedEntries }
|
|
877
758
|
};
|
|
878
759
|
}
|
|
@@ -963,7 +844,7 @@ async function loadBuiltinTemplates() {
|
|
|
963
844
|
let settled;
|
|
964
845
|
try {
|
|
965
846
|
const body = await within(requireReader().defaults(), REMOTE_TIMEOUT_MS);
|
|
966
|
-
const payload =
|
|
847
|
+
const payload = (0, _jayyuen66_dsh_plugin_shared_client.isRecord)(body) ? body : void 0;
|
|
967
848
|
const okKey = "ok";
|
|
968
849
|
const templatesKey = "templates";
|
|
969
850
|
const rawReason = payload?.["error"];
|
|
@@ -980,7 +861,7 @@ async function loadBuiltinTemplates() {
|
|
|
980
861
|
settled = {
|
|
981
862
|
phase: "error",
|
|
982
863
|
list: [],
|
|
983
|
-
error:
|
|
864
|
+
error: (0, _jayyuen66_dsh_plugin_shared_client.errorText)(error)
|
|
984
865
|
};
|
|
985
866
|
} finally {
|
|
986
867
|
if (builtinGeneration === generation) builtinInflight = null;
|
|
@@ -1263,7 +1144,7 @@ async function runOrganizeClick(args) {
|
|
|
1263
1144
|
writeDraft(content);
|
|
1264
1145
|
} catch (error) {
|
|
1265
1146
|
if (seq.current !== mySeq) return;
|
|
1266
|
-
setFailed(error instanceof LocalizedOrganizeError ? t(error.messageKey, error.params) :
|
|
1147
|
+
setFailed(error instanceof LocalizedOrganizeError ? t(error.messageKey, error.params) : (0, _jayyuen66_dsh_plugin_shared_client.errorText)(error));
|
|
1267
1148
|
if (flashTimer.current !== null) clearTimeout(flashTimer.current);
|
|
1268
1149
|
flashTimer.current = setTimeout(() => {
|
|
1269
1150
|
setFailed(void 0);
|
|
@@ -1690,7 +1571,7 @@ function ImportPanel(props) {
|
|
|
1690
1571
|
skips: skipNote
|
|
1691
1572
|
}));
|
|
1692
1573
|
} catch (error) {
|
|
1693
|
-
setImportError(
|
|
1574
|
+
setImportError((0, _jayyuen66_dsh_plugin_shared_client.errorText)(error));
|
|
1694
1575
|
} finally {
|
|
1695
1576
|
setImportBusy(false);
|
|
1696
1577
|
}
|
|
@@ -1883,7 +1764,7 @@ function createPersistActions(args) {
|
|
|
1883
1764
|
const { t, editable, dirty, rootsDirty, anythingDirty, confirmReset, templates, allowRoots, draft, rootsDraft, set, unset, readBack, setDraft, setDraftFor, setRootsDraft, setBusy, setSaveError, setConfirmReset } = args;
|
|
1884
1765
|
function reportError(err) {
|
|
1885
1766
|
console.error("[dir-prep-organize] templates settings write failed:", err);
|
|
1886
|
-
setSaveError(
|
|
1767
|
+
setSaveError((0, _jayyuen66_dsh_plugin_shared_client.errorText)(err));
|
|
1887
1768
|
}
|
|
1888
1769
|
async function onSave() {
|
|
1889
1770
|
if (!editable || !anythingDirty) return;
|
|
@@ -1949,7 +1830,7 @@ function createCardBody(view) {
|
|
|
1949
1830
|
const { onCommit, onDelete, onAdd, onImported, onRootChange, onRootDelete, onRootAdd } = view.draftActions;
|
|
1950
1831
|
const { onSave, onDiscard, onReset } = view.persistActions;
|
|
1951
1832
|
const footHint = (0, react.createElement)("p", { className: "dpic-hint" }, t("footHint"));
|
|
1952
|
-
const saveBar = (0, react.createElement)(
|
|
1833
|
+
const saveBar = (0, react.createElement)(_jayyuen66_dsh_plugin_shared_client.SaveBar, {
|
|
1953
1834
|
dirty: anythingDirty,
|
|
1954
1835
|
busy,
|
|
1955
1836
|
writable: editable,
|
|
@@ -1965,7 +1846,7 @@ function createCardBody(view) {
|
|
|
1965
1846
|
},
|
|
1966
1847
|
onDiscard
|
|
1967
1848
|
});
|
|
1968
|
-
return (0, react.createElement)(
|
|
1849
|
+
return (0, react.createElement)(_jayyuen66_dsh_plugin_shared_client.CardForm, null, statusHint === "" ? null : (0, react.createElement)("p", { className: "dpic-hint" }, statusHint), (0, react.createElement)(_jayyuen66_dsh_plugin_shared_client.Section, {
|
|
1969
1850
|
title: t("rolesSection"),
|
|
1970
1851
|
hint: t("rolesHint")
|
|
1971
1852
|
}, (0, react.createElement)(CardToolbar, {
|
|
@@ -2136,7 +2017,7 @@ function apply(ctx) {
|
|
|
2136
2017
|
ctx.effect(() => {
|
|
2137
2018
|
const tag = document.createElement("style");
|
|
2138
2019
|
tag.id = "dir-prep-organize-css";
|
|
2139
|
-
tag.textContent = `${CARD_STYLES}\n${
|
|
2020
|
+
tag.textContent = `${CARD_STYLES}\n${_jayyuen66_dsh_plugin_shared_client.CARD_UI_CSS}`;
|
|
2140
2021
|
document.head.append(tag);
|
|
2141
2022
|
return () => {
|
|
2142
2023
|
tag.remove();
|
package/cordis.patch.yml
CHANGED
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
# 内置精选集由 host 半从 templates.data.mjs 经 defaults 方法按需下发。
|
|
4
4
|
# 架构与数据流见 README 与 host.ts / src/client-entry.ts。
|
|
5
5
|
- insert:
|
|
6
|
+
# 故意不写 id:shared 是本包 patch 启用的内部组件行,不是用户可停用的独立组件;
|
|
7
|
+
# 写 id 会让插件页出现一个可关闭的组件,关闭后本包设置卡会失去组件供应。
|
|
8
|
+
- name: "@jayyuen66/dsh-plugin-shared"
|
|
6
9
|
- id: dir-prep-organize
|
|
7
10
|
name: "@jayyuen66/dsh-dir-prep-organize"
|
package/host.js
CHANGED
|
@@ -738,11 +738,17 @@ function importRootsOf(cwd, allowRoots, messages) {
|
|
|
738
738
|
for (const root of allowRoots) roots.push(toImportRoot(root, messages.rootLabelAllowed));
|
|
739
739
|
return roots;
|
|
740
740
|
}
|
|
741
|
+
/** 越界回执里最多列出几个允许根。这条文本会进会话日志与模型上下文,而允许根的清单
|
|
742
|
+
* 来自设置存储——手改过的 settings 或脏数据能把几百项拼进一条 403,所以列举面要有界。
|
|
743
|
+
* 被省略的数量以 `…<条数>` 收尾:只用标点与数字,不引入未经 locale 的新词。 */
|
|
744
|
+
const OUTSIDE_ROOTS_LISTED = 5;
|
|
741
745
|
/** 越界回执文本:点名每一类允许区并回显解析后的绝对路径——越界不做静默降级,
|
|
742
746
|
* 必须让模型/人一眼看清"规则是什么、这次解析到了哪里"。 */
|
|
743
747
|
function outsideRootsError(absolute, roots, messages) {
|
|
744
|
-
const
|
|
745
|
-
|
|
748
|
+
const listed = roots.slice(0, OUTSIDE_ROOTS_LISTED);
|
|
749
|
+
const omitted = roots.length - listed.length;
|
|
750
|
+
const zones = listed.map((root) => `${root.label} ${root.absolute}`).join(messages.zoneSeparator);
|
|
751
|
+
return fillTemplate(messages.outsideRoots, [["{zones}", omitted > 0 ? `${zones}${messages.zoneSeparator}…${String(omitted)}` : zones], ["{absolute}", absolute]]);
|
|
746
752
|
}
|
|
747
753
|
/** 真实目标是否落在**每一个**允许根之外。判据交给后端(`contains` 用它自己的世界判
|
|
748
754
|
* 包含关系),而不是再写第二条字符串规则:符号链接让「路径长得合法」与「读的是哪个
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayyuen66/dsh-dir-prep-organize",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "dsh 插件:对话输入框「润色」按钮(主键直接润色/▾ 以角色风格润色,结合当前目录 + session 模型润色草稿)+「模板」下拉(内置精选角色集生成自插件 agents/ 角色库,可按部门分组;设置卡可增删改/一键导入内置全部/导入本地角色 .md)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cordis",
|
|
@@ -61,70 +61,70 @@
|
|
|
61
61
|
"registry": "https://registry.npmjs.org"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@jayyuen66/dsh-plugin-shared": "0.2.
|
|
64
|
+
"@jayyuen66/dsh-plugin-shared": "^0.2.4",
|
|
65
65
|
"zod": "4.6.7"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@deepseek-ai/cordis": "4.0
|
|
69
|
-
"@deepseek-ai/cordis-plugin-group": "1.0
|
|
70
|
-
"@deepseek-ai/cordis-plugin-include": "1.0
|
|
71
|
-
"@deepseek-ai/cosmokit": "1.
|
|
72
|
-
"@deepseek-ai/dsh-agent-default-model": "0.2.2-
|
|
73
|
-
"@deepseek-ai/dsh-app-boot": "0.2.2-
|
|
74
|
-
"@deepseek-ai/dsh-brand": "0.2.2-
|
|
75
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-
|
|
81
|
-
"@deepseek-ai/dsh-config-editor": "0.2.2-
|
|
82
|
-
"@deepseek-ai/dsh-fs": "0.2.2-
|
|
83
|
-
"@deepseek-ai/dsh-home-paths": "0.2.2-
|
|
84
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.2-
|
|
85
|
-
"@deepseek-ai/dsh-llm": "0.2.2-
|
|
86
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-
|
|
87
|
-
"@deepseek-ai/dsh-scope": "0.2.2-
|
|
88
|
-
"@deepseek-ai/dsh-session": "0.2.2-
|
|
89
|
-
"@deepseek-ai/dsh-settings": "0.2.2-
|
|
90
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.2-
|
|
91
|
-
"@deepseek-ai/schemastery": "3.
|
|
68
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
69
|
+
"@deepseek-ai/cordis-plugin-group": "1.1.0",
|
|
70
|
+
"@deepseek-ai/cordis-plugin-include": "1.1.0",
|
|
71
|
+
"@deepseek-ai/cosmokit": "1.9.0",
|
|
72
|
+
"@deepseek-ai/dsh-agent-default-model": "0.2.2-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-app-boot": "0.2.2-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-brand": "0.2.2-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-config-editor": "0.2.2-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-fs": "0.2.2-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-home-paths": "0.2.2-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.2-rc.1",
|
|
85
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-scope": "0.2.2-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.1",
|
|
89
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.1",
|
|
90
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
|
|
91
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
92
92
|
"@e18e/eslint-plugin": "0.8.1",
|
|
93
93
|
"@types/node": "26.6.6",
|
|
94
94
|
"@types/react": "19.3.0",
|
|
95
95
|
"@types/react-dom": "19.3.0",
|
|
96
|
-
"@vitest/coverage-v8": "5.0
|
|
97
|
-
"eslint-plugin-regexp": "3.3.
|
|
96
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
97
|
+
"eslint-plugin-regexp": "3.3.3",
|
|
98
98
|
"eslint-plugin-sonarjs": "4.2.2",
|
|
99
99
|
"eslint-plugin-zod": "5.2.2",
|
|
100
100
|
"fast-check": "4.10.2",
|
|
101
101
|
"happy-dom": "21.0.4",
|
|
102
|
-
"oxfmt": "0.
|
|
103
|
-
"oxlint": "1.
|
|
102
|
+
"oxfmt": "0.76.0",
|
|
103
|
+
"oxlint": "1.91.0",
|
|
104
104
|
"oxlint-tsgolint": "7.0.2005",
|
|
105
105
|
"react": "^19.3.0",
|
|
106
106
|
"react-dom": "^19.3.0",
|
|
107
|
-
"rolldown": "1.2.
|
|
107
|
+
"rolldown": "1.2.16",
|
|
108
108
|
"typescript": "7.0.2",
|
|
109
|
-
"vite": "8.3.
|
|
110
|
-
"vitest": "5.0
|
|
109
|
+
"vite": "8.3.6",
|
|
110
|
+
"vitest": "5.1.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"@deepseek-ai/cordis": "
|
|
114
|
-
"@deepseek-ai/cosmokit": "1.8.7-alpha.
|
|
115
|
-
"@deepseek-ai/dsh": "^0.2.1-rc.3",
|
|
116
|
-
"@deepseek-ai/dsh-agent-default-model": "^0.2.1-rc.3",
|
|
117
|
-
"@deepseek-ai/dsh-brand": "^0.2.1-rc.3",
|
|
118
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.3",
|
|
119
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-rc.3",
|
|
120
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.3",
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.3",
|
|
122
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.3",
|
|
123
|
-
"@deepseek-ai/dsh-fs": "^0.2.1-rc.3",
|
|
124
|
-
"@deepseek-ai/dsh-llm": "^0.2.1-rc.3",
|
|
125
|
-
"@deepseek-ai/dsh-session": "^0.2.1-rc.3",
|
|
126
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.3",
|
|
127
|
-
"@deepseek-ai/schemastery": "^3.18.6-alpha.1"
|
|
113
|
+
"@deepseek-ai/cordis": "^4.0.5 || ^4.0.6-alpha.2",
|
|
114
|
+
"@deepseek-ai/cosmokit": "^1.8.6 || ^1.8.7-alpha.2",
|
|
115
|
+
"@deepseek-ai/dsh": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
116
|
+
"@deepseek-ai/dsh-agent-default-model": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
117
|
+
"@deepseek-ai/dsh-brand": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
118
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
119
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
120
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
121
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
122
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
123
|
+
"@deepseek-ai/dsh-fs": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
124
|
+
"@deepseek-ai/dsh-llm": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
125
|
+
"@deepseek-ai/dsh-session": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
126
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
127
|
+
"@deepseek-ai/schemastery": "^3.18.5 || ^3.18.6-alpha.1"
|
|
128
128
|
},
|
|
129
129
|
"peerDependenciesMeta": {
|
|
130
130
|
"@deepseek-ai/cordis": {
|
|
@@ -169,8 +169,8 @@
|
|
|
169
169
|
},
|
|
170
170
|
"icon": "icon.svg",
|
|
171
171
|
"engines": {
|
|
172
|
-
"dsh": "^0.2.1-rc.3",
|
|
173
|
-
"node": ">=
|
|
172
|
+
"dsh": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
|
|
173
|
+
"node": ">=24.9.0"
|
|
174
174
|
},
|
|
175
175
|
"dsh": {
|
|
176
176
|
"manifestVersion": 1,
|
|
@@ -179,7 +179,10 @@
|
|
|
179
179
|
},
|
|
180
180
|
"client": {
|
|
181
181
|
"platform": "web",
|
|
182
|
-
"immediately": true
|
|
182
|
+
"immediately": true,
|
|
183
|
+
"external": [
|
|
184
|
+
"@jayyuen66/dsh-plugin-shared/client"
|
|
185
|
+
]
|
|
183
186
|
}
|
|
184
187
|
},
|
|
185
188
|
"scripts": {
|
package/types/src/templates.d.ts
CHANGED
|
@@ -81,4 +81,16 @@ export { DEFAULT_TEMPLATES } from "./default-templates.generated.js";
|
|
|
81
81
|
* - id 缺失与已收集 id 撞名都由 uniqueEntryId 按序号补成唯一(同输入同输出,可测试);
|
|
82
82
|
* - 绝不修改输入(深比较测试锁死)。 */
|
|
83
83
|
export declare function sanitizeTemplateList(raw: unknown): TemplateEntry[];
|
|
84
|
+
/** 任意来源(settings 快照 / 设置卡草稿)→ 合法的「导入允许目录」列表(纯函数)。
|
|
85
|
+
* host 的导入策略是「会话 cwd + 内置角色库 + importAllowRoots」,绝对路径默认拒绝,
|
|
86
|
+
* 这里登记的每一项都是**放一个读盘口子**,故:
|
|
87
|
+
* - 非数组 → [](未设置 = 一条都不登记,不是"全放行");
|
|
88
|
+
* - 非字符串 / trim 后为空 → 丢弃(空串在 host 侧 path.resolve 会落到进程 cwd,
|
|
89
|
+
* 绝不能让它变成一个隐式允许根);
|
|
90
|
+
* - **非绝对路径 → 丢弃**:契约是「额外允许的绝对目录」,相对项会被 host 按它自己的
|
|
91
|
+
* 进程 cwd 解析,等于登记了一条用户没写过、界面上也看不出指向哪里的允许根;`~`
|
|
92
|
+
* 靠 shell 展开,host 的 path.resolve 不展开它,同归这一档;
|
|
93
|
+
* - 末尾分隔符归一后去重(`/a` 与 `/a/` 是同一棵树,不该在界面上摆两行);
|
|
94
|
+
* - 条数与单条长度都不设上限:静默丢一条就是「看着成功、内容没进去」;条目多撑长的
|
|
95
|
+
* 越界回执由 host 侧的列举上限收口。 */
|
|
84
96
|
export declare function sanitizeAllowRoots(raw: unknown): string[];
|