@jayyuen66/dsh-dir-prep-organize 0.1.9 → 0.1.11

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 CHANGED
@@ -4,19 +4,37 @@
4
4
  [语义化版本](https://semver.org/lang/zh-CN/)。最新版本在最上。这里的偏离是刻意的:版本标题
5
5
  不写发布日期,各版发布时间以 npm registry 为准(`npm view <包名> time` 取得到)。
6
6
 
7
+ ## 0.1.11
8
+
9
+ 宿主开发基线抬到 `0.2.2-rc.2`,支持窗口收到 `^0.2.2-rc.1`;vendored 角色库与上游重新对齐。默认模板与行为不变。
10
+
11
+ ### Changed
12
+
13
+ - **vendored 角色库刷新**:12 份角色文件从上游 `agency-agents-zh` 重新拷回(修正此前本地引入的行首多余空格),`gen:defaults` 重生成精选模板默认值;`vendored:check` 恢复 298/298 逐字节相同。精选模板条数(85)与 README 计数不变。
14
+ - **宿主开发基线抬到 `0.2.2-rc.2`**:`devDependencies` 整组 `@deepseek-ai/dsh-*` 抬到 `0.2.2-rc.2`,并补上 rc.2 新增的 `@deepseek-ai/dsh-error`(`dsh-llm` 的精确 peer,`autoInstallPeers: false` 下须显式声明)。
15
+ - **支持窗口收到 `^0.2.2-rc.1`**:`engines.dsh` 与 `@deepseek-ai/dsh*` peer 由 `^0.2.1-rc.5 || ^0.2.2-alpha.3` 改为 `^0.2.2-rc.1`(单条 0.2.2 线);`@deepseek-ai/schemastery` peer 由 `^3.18.5 || ^3.18.6-alpha.1` 收到 `^3.19.0`。devDependencies 仍精确钉版。
16
+
17
+ ## 0.1.10
18
+
19
+ 修复 0.1.9 引入的 web 启动隐患:设置卡与 dock 条目的组件收回 `client.js` 内联,移除对 `@jayyuen66/dsh-plugin-shared/client` 的模块表外置与 `cordis.patch.yml` 里的 shared 供应行。对外工具与 Remote 方法名单不变,默认配置不变。
20
+
21
+ ### Fixed
22
+
23
+ - **卡片组件内联进 `client.js`,产物自足**:0.1.9 把 `@jayyuen66/dsh-plugin-shared/client` 外置给宿主模块表,靠 `cordis.patch.yml` 插入的一条**不写 id** 的 shared 组件行把 shared 装载成供应方。这份供应链在 shared 只作为传递依赖装进 profile 时(`dsh plugin add` 的正常结果)没有保证——宿主侧可以既不报错也不把 shared 的 client 产物排进启动图,页面启动时 `require("@jayyuen66/dsh-plugin-shared/client")` 落进 `missed the module table`,整窗「应用无法启动或已意外停止」(dsh-ocr-review 仓 issue #2,宿主 0.2.2-rc.1 dsh desktop 实报)。`build-client.mjs` 的外置清单收回 react / zod 两族(宿主 `PLATFORM_MODULES` 供给,内联反而会产生第二份身份),卡片组件与工具函数全部内联;`package.json` 的 `dsh.bundle.client.external` 与 patch 里的 shared 供应行随之移除,`cordis.patch.yml` 回到只声明本包一行。`test/integration/client-bundle.test.ts` 的索取面断言改为恰好 react / zod 两枚,工厂替身对未知说明符的抛出把外置回流挡在装配层。
24
+
7
25
  ## 0.1.9
8
26
 
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 由确切版本改成范围后宿主装载门的差别。
27
+ 宿主开发基线抬到 `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
28
 
11
29
  ### Changed
12
30
 
13
31
  - **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`,与两条宿主线各自的实装版本对齐。
32
+ - **宿主开发基线**:`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` 随之重解。
33
+ - **支持窗口写成并集**:`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` 线宿主自己的下限,写低了等于承诺一个宿主不会启动的运行环境)。
34
+ - **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
35
  - **卡片组件改由 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
36
  - **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 仍然点名拒绝。
37
+ - **发布预检按 catalog 的范围做法改判**:`publish.yml` 的依赖库可见性预检原先要求 catalog 里 shared 那条是**精确版本**,而伞根唯一来源按设计写的是范围(`^0.2.4`)——不符就拒发,等于让发布链与八仓的声明方式各说一套。现改为取**范围下限**那一版去查 registry:下限永远落在自己声明的范围里,与根侧 `sync --check` 比「该条范围的最低版本」的产物导出名单是同一做法。认不出的写法照旧拒发,`catalog:foo` 这类命名 catalog 仍然点名拒绝。
20
38
 
21
39
  ### Fixed
22
40
 
@@ -30,26 +48,26 @@
30
48
 
31
49
  ## 0.1.8
32
50
 
33
- 一轮跨面审查修复:模板导入判据与解析收口,客户端超时与写回时序修正,CI 与发布链同步加固。
51
+ 一轮跨模块审查修复:模板导入判据与解析统一处理,客户端超时与写回时序修正,CI 与发布链同步加固。
34
52
 
35
53
  ### Changed
36
54
 
37
- - **发布链加固**(`.github/workflows/publish.yml`):拆 build/publish 两 job,`id-token: write` 只留 publish job;预检补本包版本占用检查与全部 `catalog:` 依赖可见性遍历;tarball 打包一次经 artifact 传递,发布前校验身份一致且无 `catalog:`/`workspace:` 残留,发布后轮询 registry 至可见(上限 5 分钟)。CI 侧 actionlint 改按文件豁免,codeql/scorecard/dependabot 同步收口。
55
+ - **发布链加固**(`.github/workflows/publish.yml`):拆 build/publish 两 job,`id-token: write` 只留 publish job;预检补本包版本占用检查与全部 `catalog:` 依赖可见性遍历;tarball 打包一次经 artifact 传递,发布前校验身份一致且无 `catalog:`/`workspace:` 残留,发布后轮询 registry 至可见(上限 5 分钟)。CI 侧 actionlint 改按文件豁免,codeql/scorecard/dependabot 同步统一处理。
38
56
  - **依赖与元数据**:author 改对象形(name+url);`@deepseek-ai/schemastery` peer 放宽为 `^3.18.6-alpha.1`;devDependencies 删孤儿 `@deepseek-ai/dsh-host-webserver`、新增 fast-check 4.10.2;catalog 的 shared 抬到 0.2.2。
39
57
 
40
58
  ### Fixed
41
59
 
42
- - **模板导入**(`host.ts`):导入失败的 promise 先清出缓存再重抛,读面 Retry 不再永远重放同一 rejection;单文件正文围栏未闭合按 `truncated` 记账不再让整次导入失败;多根命中按绝对路径长度降序逐个复判,cwd 内合法登记不再被判隐藏段越权;子目录加 `fs.contains` 复判,链接进根外的目录按 escaped 记账;`.md` 后缀大小写不敏感;导入允许根拒收相对路径并按 resolve 去重。
60
+ - **模板导入**(`host.ts`):导入失败的 promise 先清出缓存再重抛,读取方法 Retry 不再永远重放同一 rejection;单文件正文围栏未闭合按 `truncated` 记录不再让整次导入失败;多根命中按绝对路径长度降序逐个复判,cwd 内合法登记不再被判隐藏段越权;子目录加 `fs.contains` 复判,链接进根外的目录按 escaped 记录;`.md` 后缀大小写不敏感;导入允许根拒收相对路径并按 resolve 去重。
43
61
  - **模板解析**(`src/templates.ts`):emoji 按 Unicode 码点截断不再劈开代理对;frontmatter 上限 20→200 行、缩进子键不再当顶层键;空 id 合并处理;`sanitizeAllowRoots` 只收绝对路径(POSIX/盘符/UNC)。
44
62
  - **客户端超时与写回**(`src/client-timeouts.ts`、`src/input-writeback.ts`、`src/client-entry.ts`):fetch 超时先压 base 再加余量,配置顶格时客户端时限不再等于宿主时限;导入回执 count 坏值回落真实条数并追加 truncated 提示;保存往返期间用户的新输入不再被清洗结果覆盖;写回 commit 现判 sessionId/phase,组件卸载作废在途票据;润色超时抛本地化错误,英文界面不再见硬编码中文。
45
63
 
46
64
  ### Added
47
65
 
48
- - **测试三层**:`test/e2e/product-load.e2e.test.ts`(rolldown 产物原生 import 装载加真宿主服务链全链)、`test/platform/paths.platform.test.ts`(跨平台路径形状)、`test/property/import-policy.property.test.ts`(fast-check 属性面)。
66
+ - **测试三层**:`test/e2e/product-load.e2e.test.ts`(rolldown 产物原生 import 装载加真宿主服务链全链)、`test/platform/paths.platform.test.ts`(跨平台路径形状)、`test/property/import-policy.property.test.ts`(fast-check 属性测试)。
49
67
 
50
68
  ## 0.1.7
51
69
 
52
- 这一版让润色跟随会话当前的模型选择,把模板写入改成宿主校验的光标插入,并把插件页展示面收进包内。
70
+ 这一版让润色跟随会话当前的模型选择,把模板写入改成宿主校验的光标插入,并把插件页展示收进包内。
53
71
 
54
72
  ### Changed
55
73
 
@@ -57,7 +75,7 @@
57
75
  两者都没有才用 `agentDefaultModel.currentSelection()`。
58
76
  - **模板改为光标插入**:`captureInsertion()` + `insertText()` 由宿主按发起的选区核验,草稿里的引用块与附件
59
77
  不再被整稿替换抹平;输入框处于提交期时两个入口禁用,宿主拒绝插入时不回落 `setDraft`。
60
- - **润色结果写回增加版本凭据**:新增 `src/input-writeback.ts`,按会话 id、草稿版本、输入动作面身份与
78
+ - **润色结果写回增加版本凭据**:新增 `src/input-writeback.ts`,按会话 id、草稿版本、输入动作对象的身份与
61
79
  `phase` 判定;请求期间继续输入、切换会话或进入提交期都会放弃写回,并提示「输入框内容已变化」。
62
80
  - **设置卡改用 shared 的卡片骨架**:正文改为「角色库」小节,保存与撤销走统一 `SaveBar`,样式使用
63
81
  `CARD_UI_CSS` 与 `dsu-*` 控件类。
@@ -71,29 +89,29 @@
71
89
  ### Fixed
72
90
 
73
91
  - **请求在途时用户继续编辑,旧润色结果会覆盖新草稿**:写回改为读最新一帧并核对版本戳,过期结果不再落地。
74
- - **模板插入会重建整份草稿**:改走输入框的插入面后只插入文本,引用块与附件保持原样。
75
- - **干净 npm 安装与宿主品牌包的 cordis 线冲突**:`@deepseek-ai/cordis` 的 optional peer 改为
92
+ - **模板插入会重建整份草稿**:改走输入框的插入接口后只插入文本,引用块与附件保持原样。
93
+ - **干净 npm 安装与宿主自带的 cordis 版本线冲突**:`@deepseek-ai/cordis` 的 optional peer 改为
76
94
  `~4.0.5 || 4.0.6-alpha.1`,既接受宿主当前要求的 `~4.0.5`,也接受编译所用的
77
95
  `4.0.6-alpha.1`;编译期精确钉版仍留在 `devDependencies`。
78
96
 
79
97
  ## 0.1.6
80
98
 
81
- 这一版收口客户端交互与错误文案,并把构建、CI 与伞工作区基线统一;模板数据与 85 条内置精选不变。
99
+ 这一版统一处理客户端交互与错误文案,并把构建、CI 与伞工作区基线统一;模板数据与 85 条内置精选不变。
82
100
 
83
101
  ### Changed
84
102
 
85
- - **宿主线抬到 `0.2.1-rc.3`**:`engines.dsh`、peer/dev 依赖、`pnpm-workspace.yaml` 的 overrides 与 README 徽标/正文同值;shared 下限随根真源投影。
103
+ - **宿主线抬到 `0.2.1-rc.3`**:`engines.dsh`、peer/dev 依赖、`pnpm-workspace.yaml` 的 overrides 与 README 徽标/正文同值;shared 下限随根唯一来源投影。
86
104
  - **构建编排统一进 shared 的 `lib/build-*`**:host/client/types 构建脚本只剩薄配置层,产物仍落 `dist/`。
87
105
  - **润色链路的错误文案跟随界面语言**:客户端自己产生的错误(目录上下文失败、读取模型失败、输入为空、回执不可解析)改走本地化消息键,宿主回执里的原文不翻译、作为 `{message}` 原样带出。
88
106
  - **超时值的非法输入回落到默认值**:`NaN`、`0`、负数与小数不再被折算成 1 ms 或负数——那会让「配错」看起来像「配了一个很小的合法值」,实际是立刻超时。
89
107
  - **编辑中的草稿与写入操作互斥**:模板行、导入面板与允许根面板在保存期间禁用;保存成功后只清本次真正写下的键。
90
- - **Remote 读面按运行期形状校验**:`ok: true` 但缺 `value` 的应答不再被当成「成功但空」;`$mount` 失败不缓存,下一次读会重试。
108
+ - **Remote 读取方法按运行期形状校验**:`ok: true` 但缺 `value` 的应答不再被当成「成功但空」;`$mount` 失败不缓存,下一次读会重试。
91
109
  - **样式补兜底与可访问性**:所有 `var()` 带回落值,错误态 hover 不被基础样式覆盖,补 `:focus-visible` 与 `prefers-reduced-motion`。
92
110
 
93
111
  ### Fixed
94
112
 
95
- - **同一轮事件里的第二次点击会再发一次 LLM 请求**:`loading` 要等一次重渲染才生效,两道读状态的闸门都拦不住;改为在 `await` 之前置同步在途标记。
96
- - **新增模板行的正文会把占位提示落盘**:占位改由 textarea 的 placeholder 承担,新行正文从空串开始。
113
+ - **同一轮事件里的第二次点击会再发一次 LLM 请求**:`loading` 要等一次重渲染才生效,两道读状态的检查都拦不住;改为在 `await` 之前置同步在途标记。
114
+ - **新增模板行的正文会把占位提示写到磁盘**:占位改由 textarea 的 placeholder 承担,新行正文从空串开始。
97
115
  - **角色文件的代码围栏没有结束标记时只导入半篇正文**:现在直接报错并点明起始行,不再静默截断。
98
116
  - **恢复默认的二次确认文案写死 4 秒**:改为按实际确认窗口插值。
99
117
 
@@ -108,15 +126,15 @@
108
126
 
109
127
  - **命名与文案统一**:「整理」改为「润色」,「提示词模板」改为「模板库」,「角色视角」改为「角色风格」;中英文案、`package.json` 描述与关键字、`cordis.patch.yml` 与两份 README 同步。
110
128
  - **prompt 信任序**:目录摘要、最近若干轮与角色正文改由 `buildOrganizeUser` 放进 user 消息的 `<data>` 围栏,system 只拿会话 cwd;数据行里的围栏标记先替换成 `[fence-open]` / `[fence-close]`,避免草稿自己关掉围栏。
111
- - **客户端竞态收口**:内置快照读面加世代号,`reset` 之后晚到的应答不再写回 store;「恢复默认」与「保存」共用 busy 门禁;▾ 菜单项与主按钮同用 `loading || !canWrite`;超时下界夹到 1 ms。
112
- - **Remote 读面**:`unwrap` 按运行期形状校验应答;`mount` 的 promise 失败后清缓存。
129
+ - **客户端竞态统一处理**:内置快照读取方法加世代号,`reset` 之后晚到的应答不再写回 store;「恢复默认」与「保存」共用 busy门禁;▾ 菜单项与主按钮同用 `loading || !canWrite`;超时下界夹到 1 ms。
130
+ - **Remote 读取方法**:`unwrap` 按运行期形状校验应答;`mount` 的 promise 失败后清缓存。
113
131
  - **跨平台构建**:`.gitattributes` 钉 `eol=lf`;生成器用 `process.execPath` 跑 oxfmt 包内入口;构建产物改临时文件 + `rename`;核对产物里的 `BUNDLE_PKG` 与包名同源;补 `dist-size` 预算与 `.prettierignore` 第二份生成物。
114
132
  - **CI 与发布**:新增三平台 × node 22/24 的 `ci.yml`、`codeql.yml`、`scorecard.yml` 与 `dependabot.yml`;`publish.yml` 改 OIDC 优先、静态 token 兜底,挂 `npm-publish` 环境、加 concurrency 与超时,action 钉 commit SHA。
115
133
 
116
134
  ### Fixed
117
135
 
118
136
  - 内置快照 `reset` 之后可能被恢复前那次请求的旧快照覆盖。
119
- - 「恢复默认」与「保存」并发时最后写入者赢,没有共同门禁。
137
+ - 「恢复默认」与「保存」并发时最后写入者赢,没有共同检查。
120
138
  - 写不回草稿时,▾ 菜单要烧完整次 LLM 往返才在写回那步报错。
121
139
  - `Math.trunc` 把 `(0,1)` 的配置值取整成 0,加完余量后可能变成 0 或负数,被当成「当场超时」。
122
140
 
@@ -133,11 +151,11 @@
133
151
 
134
152
  - **导入同 slug 碰撞时 id 改写进入死循环**(会同步阻塞宿主):改为循环内自增后缀,并加回归用例。
135
153
  - **允许根包含判据只按 `/` 拆段**:win32 上合法子路径一律判越界、`..\` 漏检;改用 `path.relative` + 双分隔符拆段。
136
- - **client 读面的模块级全局不随卸载清理**:收进 `ctx.effect` disposer,按身份比较防误清。
154
+ - **client 读取方法的模块级全局不随卸载清理**:收进 `ctx.effect` disposer,按身份比较防误清。
137
155
 
138
156
  ### Changed
139
157
 
140
- - **Typert 迁移收尾**:五条 `/_dsh/dir-prep/*` 端点改为官方 `dirPrepOrganize` Remote;HTTP handler、信任/CSRF 闸门、`guardBody` 与只为 body 上限存在的 `importBodyMaxBytes` 删除,webserver 集成测试一并删除。
158
+ - **Typert 迁移收尾**:五条 `/_dsh/dir-prep/*` 端点改为官方 `dirPrepOrganize` Remote;HTTP handler、信任与 CSRF 检查、`guardBody` 与只为 body 上限存在的 `importBodyMaxBytes` 删除,webserver 集成测试一并删除。
141
159
  - 删除 `peerDependencies.react`:宿主运行时是 18.x,devDependency 保留。
142
160
  - 清理迁移遗留的 HTTP 契约文本、`invalidJsonBody` 死键、指错行的证据引用与失真计数。
143
161
 
@@ -149,19 +167,19 @@
149
167
  - **单文件导入没有字节上限**:`cwd/roles.md` 直接调 `fs.readText`,不看 `maxSnippetBytes`;现在按官方 `stat` 判大小,未知或超限即跳过并计入 `skipped.tooLarge`。
150
168
  - **目录枚举逐个降级**:`fs.listDir` 在 `mapBounded` worker 里没有 try/catch,一个 `chmod 000` 的子目录就让整次导入归零;现在逐个降级并计入 `skipped.unreadable`。
151
169
  - **导入回填按最新草稿合并**:`onImported` 闭包用点击那一刻的草稿,等待一整次网络往返期间用户改的行会被整份旧草稿覆盖;改为函数式更新。
152
- - **fetch 超时夹到 2^31-1**:`organizeTimeoutMs + 5000` 越界时 V8 会静默夹成 1 ms,把「调大超时」反转成「立刻失败」;取值与夹位单源挪到 `src/client-timeouts.ts`。
170
+ - **fetch 超时夹到 2^31-1**:`organizeTimeoutMs + 5000` 越界时 V8 会静默夹成 1 ms,把「调大超时」反转成「立刻失败」;取值与夹位唯一来源挪到 `src/client-timeouts.ts`。
153
171
  - **「恢复默认」纳入 busy 门禁**;「整理」按钮在 `setDraft` 不可用时禁用。
154
172
 
155
173
  ### Changed
156
174
 
157
- - `@jayyuen66/dsh-plugin-shared` 从 `^0.1.4` 升到 `^0.1.5-rc`,吃进三处信任闸门修复;验证不止比版本号:`npm pack` 拉下发布产物逐条比对行为。
175
+ - `@jayyuen66/dsh-plugin-shared` 从 `^0.1.4` 升到 `^0.1.5-rc`,带上三处信任校验的修复;验证不止比版本号:`npm pack` 拉下发布产物逐条比对行为。
158
176
  - 新增集成层(真磁盘 + 真 FileSystem 抽象类):上面三条 host 缺陷都是手搓桩测不出来的。
159
177
 
160
178
  ## 0.1.2-rc
161
179
 
162
180
  ### Changed
163
181
 
164
- - **宿主包整体精确钉到 `0.2.1-alpha.2`**;`@jayyuen66/dsh-plugin-shared` 升到 `^0.1.4`,工具链随 catalog 更新。
182
+ - **宿主包整体精确对齐到 `0.2.1-alpha.2`**;`@jayyuen66/dsh-plugin-shared` 升到 `^0.1.4`,工具链随 catalog 更新。
165
183
  - **`servingNonLoopback` 改由 shared 的 `isNonLoopbackBindHost` 取**:宿主把 `Config.host` 收成任意本机接口 IP 字面量、通配地址在载入即拒,旧的 `=== "0.0.0.0"` 恒为 false,局域网请求整片吃 403 而本地门禁全绿。
166
184
  - **peerDependencies 补齐声明产物点名却未认领的宿主包**,写成 optional;值导入的 `dsh-brand` 与 `schemastery` 保持必选。
167
185
  - 升级带来的声明行号位移逐条对表修正。
@@ -183,7 +201,7 @@
183
201
  ### Fixed
184
202
 
185
203
  - `check` 补上 `build:types`:此前校验的声明产物压根没被构建过。
186
- - 发布清单门禁覆盖入口面、第三方声明、运行期产物、声明覆盖全部导出,以及不泄漏本机或包管理器内部路径。
204
+ - 发布清单检查覆盖入口、第三方声明、运行期产物、声明覆盖全部导出,以及不泄漏本机或包管理器内部路径。
187
205
 
188
206
  ## 0.1.0
189
207
 
package/README.md CHANGED
@@ -12,7 +12,7 @@
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
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" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.1-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
 
@@ -31,20 +31,22 @@
31
31
 
32
32
  ## <img src="https://api.iconify.design/lucide/file-text.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Contents
33
33
 
34
- - [What it does](#what-it-does)
35
- - [Install](#install)
36
- - [Verify it is live](#verify-it-is-live)
37
- - [What it does not provide](#what-it-does-not-provide)
38
- - [Enabling it in dsh](#enabling-it-in-dsh)
39
- - [The polish call](#the-polish-call)
40
- - [Templates](#templates)
41
- - [Settings](#settings)
42
- - [Public interface](#public-interface)
43
- - [Data and privacy](#data-and-privacy)
44
- - [Known boundaries](#known-boundaries)
45
- - [FAQ](#faq)
46
- - [Development](#development)
47
- - [License](#license)
34
+ - [ Contents](#-contents)
35
+ - [ What it does](#-what-it-does)
36
+ - [ Install](#-install)
37
+ - [ Shared version floor](#-shared-version-floor)
38
+ - [ Verify it is live](#-verify-it-is-live)
39
+ - [ What it does not provide](#-what-it-does-not-provide)
40
+ - [ Enabling it in dsh](#-enabling-it-in-dsh)
41
+ - [ The polish call](#-the-polish-call)
42
+ - [ Templates](#-templates)
43
+ - [ Settings](#-settings)
44
+ - [ Public interface](#-public-interface)
45
+ - [ Data and privacy](#-data-and-privacy)
46
+ - [ Known boundaries](#-known-boundaries)
47
+ - [ FAQ](#-faq)
48
+ - [ Development](#-development)
49
+ - [ License](#-license)
48
50
 
49
51
  ## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> What it does
50
52
 
@@ -70,8 +72,8 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
70
72
  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
73
 
72
74
  - **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
+ - **Requires host `dsh` on the `0.2.2-rc.1` host line or later.** The requirement the host actually reads is `engines.dsh` (`^0.2.2-rc.1`), 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`, `0.2.1-rc.5` and `0.2.2-alpha.3` are **refused**, `0.2.2-rc.1`, `0.2.2-rc.2` 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.
76
+ - **The `@deepseek-ai/dsh-*` development pins are at `0.2.2-rc.2`** - 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.2-rc.1`); 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
77
  - **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
78
  - **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
79
  - **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.
package/README.zh-CN.md CHANGED
@@ -12,7 +12,7 @@
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
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" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.1-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
 
@@ -31,20 +31,22 @@
31
31
 
32
32
  ## <img src="https://api.iconify.design/lucide/file-text.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 目录
33
33
 
34
- - [它做什么](#它做什么)
35
- - [安装](#安装)
36
- - [确认它真的在工作](#确认它真的在工作)
37
- - [它不提供什么](#它不提供什么)
38
- - [在 dsh 里启用](#在-dsh-里启用)
39
- - [润色调用](#润色调用)
40
- - [模板](#模板)
41
- - [设置项](#设置项)
42
- - [对外接口](#对外接口)
43
- - [数据与隐私](#数据与隐私)
44
- - [已知边界](#已知边界)
45
- - [常见问题](#常见问题)
46
- - [开发](#开发)
47
- - [许可](#许可)
34
+ - [ 目录](#-目录)
35
+ - [ 它做什么](#-它做什么)
36
+ - [ 安装](#-安装)
37
+ - [ shared 的版本下限](#-shared-的版本下限)
38
+ - [ 确认它真的在工作](#-确认它真的在工作)
39
+ - [ 它不提供什么](#-它不提供什么)
40
+ - [ 在 dsh 里启用](#-在-dsh-里启用)
41
+ - [ 润色调用](#-润色调用)
42
+ - [ 模板](#-模板)
43
+ - [ 设置项](#-设置项)
44
+ - [ 对外接口](#-对外接口)
45
+ - [ 数据与隐私](#-数据与隐私)
46
+ - [ 已知边界](#-已知边界)
47
+ - [ 常见问题](#-常见问题)
48
+ - [ 开发](#-开发)
49
+ - [ 许可](#-许可)
48
50
 
49
51
  ## <img src="https://api.iconify.design/lucide/shield.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 它做什么
50
52
 
@@ -53,7 +55,7 @@
53
55
  - 下拉按条目的 `group` 字段分组,`group` 为空的条目落在「通用」里。
54
56
  - **润色**会把草稿、会话 cwd 的顶层(文件名、大小、关键文本文件的全文)以及会话里**真实的** user/assistant 轮次交给当前会话选定的模型(取不到时回落宿主默认模型),然后用重写结果替换草稿。只有会话、草稿版本与输入阶段都没变时才写回。
55
57
  - 失败时草稿**绝不**被改动:按钮进入错误态若干秒,原因写在其 tooltip 里。
56
- - **模板**经输入框的插入面写到光标处:引用块与附件保持原样;插入凭据过期时宿主拒绝插入,而不是重建整份草稿。输入框处于提交期时两个控件禁用。
58
+ - **模板**经输入框的插入接口写到光标处:引用块与附件保持原样;插入凭据过期时宿主拒绝插入,而不是重建整份草稿。输入框处于提交期时两个控件禁用。
57
59
  - 内置集是 **85 条精选角色模板**,由 `scripts/gen-defaults.mjs` 从本包的 `agents/` 角色库生成——那是从上游项目移入的几百份角色 `.md`,分布在二十多个部门目录下。对用户有意义的是那 85 条;角色库的份数不在这里钉死,因为上游一刷新它就变。
58
60
  - 这张表**只在宿主侧**:客户端产物不再内联它。生成文件约 640 KB,曾把 `client.js` 推到约 711 KB。
59
61
  - 浏览器**懒加载、只调一次** Remote 的 `defaults` 方法(首次打开菜单或首次进设置卡),之后在进程内复用。用户已经有自己的模板时**一个字节都不拉**。
@@ -70,9 +72,9 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
70
72
  卸载:`dsh plugin --profile web remove @jayyuen66/dsh-dir-prep-organize`。包在公共 npm 上,安装不需要凭据,也不需要配作用域源。
71
73
 
72
74
  - **要求 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
- - **`dependencies` 里不放任何 `@deepseek-ai/*`,这是契约**(`test/publish-manifest.test.ts` 钉着)。消费方 profile 用 `nodeLinker: hoisted` 且 `autoInstallPeers: false` 安装,于是写在 `dependencies` 里的宿主包会被落成**真实目录**,与运行中的宿主已加载的那份并存。`@deepseek-ai/dsh-tools` 的工具运行期调度键是普通 `Symbol`(不是 `Symbol.for`),符号身份按模块实例算:宿主从 profile 副本上读那个键拿到 `undefined`,于是**每一次原生工具调用都抛**——而本包的构建、类型检查、覆盖率门禁在此之前全部照绿。
75
+ - **要求宿主 `dsh` 在 `0.2.2-rc.1` 这条宿主线上或更晚。** 宿主真正读的是 `engines.dsh`(`^0.2.2-rc.1`),而且它**单独决定**:`evaluatePluginCompatibility` 在 `engines.dsh` 那一支就返回了,根本走不到读 `peerDependencies` 的那段。对宿主真实代码实测:`0.2.0-rc.2`、`0.2.1-rc.5` 与 `0.2.2-alpha.3` **被拒**,`0.2.2-rc.1`、`0.2.2-rc.2` 与 `0.2.2` 通过,`0.3.0` 被拒。被拒的宿主需要走显式担责的授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证,窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
76
+ - **`@deepseek-ai/dsh-*` 的开发依赖钉在 `0.2.2-rc.2`**——本包编译与测试所对着的那条宿主线。`engines.dsh` 与 optional peer 范围承载单独判读的支持窗口(`^0.2.2-rc.1`);钉版是关于「它是对着哪个宿主版本**编译**的」的事实,不是那个窗口的复述。把两者混为一谈,正是发布门禁分开检查它们的原因。
77
+ - **`dependencies` 里不放任何 `@deepseek-ai/*`,这是约定**(`test/publish-manifest.test.ts` 钉着)。消费方 profile 用 `nodeLinker: hoisted` 且 `autoInstallPeers: false` 安装,于是写在 `dependencies` 里的宿主包会被落成**真实目录**,与运行中的宿主已加载的那份并存。`@deepseek-ai/dsh-tools` 的工具运行期调度键是普通 `Symbol`(不是 `Symbol.for`),符号身份按模块实例算:宿主从 profile 副本上读那个键拿到 `undefined`,于是**每一次原生工具调用都抛**——而本包的构建、类型检查、覆盖率检查在此之前全部照绿。
76
78
  - **`host.js` 按值导入的那两枚宿主包是必需 peer**:`@deepseek-ai/schemastery`(宿主 fork——只有它能把 `.volatile()` 字段解析成活引用)与 `@deepseek-ai/dsh-brand`。`build-host.mjs` 外部化 `dependencies` **与** `peerDependencies`,所以裸说明符留在产物里;只写 `devDependencies` 会让打包器把官方函数体内联进去。`test/build-host.test.ts` 同时钉「说明符在」与「函数体不在」。
77
79
  - **声明里点到的每一枚宿主包都落在 `peerDependencies`**,凡是只能从那里到达的都是 *optional*(`@deepseek-ai/cordis`、`cosmokit`,以及 `dsh-agent-default-model` / client-ui / `fs` / `llm` / `session` 那一族)。声明它们不是仪式:pnpm 严格布局下,`types/host.d.ts` 里一枚没有被任何 manifest 表点名的裸说明符在消费方侧解析不到,而本仓自己的类型检查照样绿。那条清单由测试从 `types/**/*.d.ts` 现量读,不从这段文字读,所以两边不会漂移。
78
80
  - **随包发的东西**:`host.js`、`client.js`、`templates.data.mjs`、`types/`、`cordis.patch.yml`、`agents/`、`locale/`、`docs/` 与 `THIRD_PARTY_NOTICES.md`。`package.json`、`README*` 与 `LICENSE` 由发布器无条件附带。
@@ -97,7 +99,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
97
99
  找之前先知道这几件事:
98
100
 
99
101
  - **它不注册任何模型工具。** 宿主半只 inject `settings`,从不碰工具注册表。没有 `organize_text` 这类工具可调。
100
- - **它没有自建的 HTTP 路由。** 数据面是官方 Typert Remote 命名空间 `dirPrepOrganize`,经注入的子 fiber 注册,走宿主 `/api` 网关。认证、Host/DNS 重绑定/Origin 判据、签名浏览器会话 cookie、body 上限全归网关——本包不持有 CSRF token,也没有路由表。
102
+ - **它没有自建的 HTTP 路由。** 数据那一栏是官方 Typert Remote 命名空间 `dirPrepOrganize`,经注入的子 fiber 注册,走宿主 `/api` 网关。认证、Host/DNS 重绑定/Origin判据、签名浏览器会话 cookie、body 上限全归网关——本包不持有 CSRF token,也没有路由表。
101
103
  - **它不加 CLI 子命令。**
102
104
  - **它不读任何环境变量**,也没有自己的出站请求。
103
105
  - 它**确实**消费的东西:宿主 `settings` 服务(硬注入,缺它条目根本不激活)、`llm.stream`、`agentDefaultModel`,以及会话、Agent 与文件系统服务。设置表单本身没就绪时,卡片禁用并显示状态提示,下拉回落到内置精选集。
@@ -107,7 +109,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
107
109
  - 安装即贡献组合包补丁层(`dsh.bundle.patch` → `./cordis.patch.yml`),插入 `- id: dir-prep-organize`,`name` 指向包名。
108
110
  - **客户端半**注册两个槽位外加设置卡:
109
111
  - `conversation.input.right`——润色按钮(id `dir-prep-organize`,order 99)与模板下拉(id `dir-prep-organize-templates`,order 100)。
110
- - `plugins.bundle.config`——设置卡,按 **bundle 包名** `@jayyuen66/dsh-dir-prep-organize` 作 key。宿主派发 `entryKey: pkg.name`(真源是 profile `package.json` 里的 `dsh.profile.bundles`),所以写成裸条目 id 永远匹配不上,卡片哪都不渲染。
112
+ - `plugins.bundle.config`——设置卡,按 **bundle 包名** `@jayyuen66/dsh-dir-prep-organize` 作 key。宿主派发 `entryKey: pkg.name`(唯一来源是 profile `package.json` 里的 `dsh.profile.bundles`),所以写成裸条目 id 永远匹配不上,卡片哪都不渲染。
111
113
  - 设置命名空间与 `configForms.get()` 仍是**裸条目 id** `dir-prep-organize`——与那个槽位 key 刻意不是同一个标识。
112
114
  - 客户端半是 `dsh.client.platform = web` 且带 `immediately`。
113
115
  - 卡片的文案遵循官方 locale 插件的偏好;宿主半每次请求现读该偏好,所以切语言不必重启。
@@ -119,7 +121,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
119
121
  |---|---|
120
122
  | 传输 | 宿主 `llm.stream`:一条**仅请求态**的 user 文本消息(无 `id`、无 `source`)加一段 `system` 规则块 |
121
123
  | 模型 | 先取会话活 Agent 的当前选择——新宿主读 `agent.model.current()`,旧宿主回落 `agent.options`——再回落 `agentDefaultModel.currentSelection()`。取不到时回报 "No model selection is available" |
122
- | 写回闸门 | 只有会话 id、输入动作面身份、草稿版本与输入阶段(`plain`)都没变时才写回。否则回报「输入框内容已变化,润色结果未写回」,草稿保持原样 |
124
+ | 写回条件 | 只有会话 id、输入动作对象的身份、草稿版本与输入阶段(`plain`)都没变时才写回。否则回报「输入框内容已变化,润色结果未写回」,草稿保持原样 |
123
125
  | 角色风格 | 可选的 `roleText` 注入 user 消息的 `<data>` 围栏(不进 system——见 `buildOrganizeSystem` 的信任序注释)。它只借用术语与语气,**从不执行该角色的任务** |
124
126
  | finish reason | 除 `stop` 之外(含缺 finish 块)一律**失败**,且绝不写回草稿 |
125
127
  | 超时 | `organizeTimeoutMs`,默认 120000 ms,每次请求经 `.get()` 读。客户端 fetch 超时是它 + 5000 ms |
@@ -133,7 +135,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
133
135
  | 条目形状 | `{ id, name, description, text, group, emoji }`,全部字符串。`description` / `group` / `emoji` 默认空串 |
134
136
  | 保存时校验 | `name` 或 `text` 为空的条目被丢掉;`emoji` 截到 12 字符;缺失或撞车的 `id` 确定性地替换成 `tpl-<index>` |
135
137
  | 内置集 | 从 `agents/` 角色库生成的 85 条精选模板。`templates` 未设置时下拉回落到它们 |
136
- | 插入 | 走输入框的版本校验插入面(`captureInsertion()` + `insertText()`)。文本写到光标处,引用块与附件保持原样;凭据过期时什么都不插入 |
138
+ | 插入 | 走输入框的版本校验插入接口(`captureInsertion()` + `insertText()`)。文本写到光标处,引用块与附件保持原样;凭据过期时什么都不插入 |
137
139
  | 「未设置」= 空数组 | 隐式注册下 schemastery 会把缺失的数组字段 cast 成 `[]`,所以**空列表永远意味着「回落到内置」**。只有非空数组且条目全部非法,才渲染成空列表 |
138
140
  | 恢复默认 | 把 `templates` 退回精选集,`importAllowRoots` 不动。两步确认,第二次点击须在 4 秒内 |
139
141
  | 导入 | 按路径:本地 `.md` 文件或目录。`path` 恰为空串 = 导入整套内置库。角色文件的代码围栏没有结束标记时直接拒绝,不会静默只导入半篇正文 |
@@ -172,10 +174,10 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
172
174
 
173
175
  | 面 | 事实 |
174
176
  |---|---|
175
- | 网络 | 没有自己的出站请求:数据面走宿主网关的 RPC 通道。不读任何环境变量 |
176
- | 落盘 | 唯一写盘的是宿主设置文件里的 `templates` 与 `importAllowRoots` |
177
+ | 网络 | 没有自己的出站请求:数据那一栏走宿主网关的 RPC 通道。不读任何环境变量 |
178
+ | 写到磁盘 | 唯一写盘的是宿主设置文件里的 `templates` 与 `importAllowRoots` |
177
179
  | 一次润色发出去什么 | 完整草稿、会话 cwd 路径、顶层目录条目**连同关键文本文件的全文**、真实的 user/assistant 轮次(框架注入的消息与工具结果被滤掉),以及可选的角色正文 |
178
- | 哪些文件会取摘要 | 只有 20 种代码/文档扩展名(ts/tsx/js/jsx/mjs/cjs/py/rs/go/java/rb/json/toml/md/sql/graphql/proto/css/scss/less)。`yaml` / `env` **不在**白名单 |
180
+ | 哪些文件会取摘要 | 只有 20 种代码/文档扩展名(ts/tsx/js/jsx/mjs/cjs/py/rs/go/java/rb/json/toml/md/sql/graphql/proto/css/scss/less)。`yaml` / `env` **不在**白名单里 |
179
181
  | 敏感文件名 | 名字在**分隔符边界**上命中 `credentials` / `secret(s)` / `id_rsa` / `pem` / `p12` / `pfx` / `keystore` / `env` / `key(s)` / `token(s)` / `auth` / `passwd` / `password` / `account(s)` 的文件,永不取摘要。边界是刻意的:朴素子串匹配会误杀 `monkey.js` 与 `AUTHORS.md`,而漏匹配会把凭据全文发给第三方模型 |
180
182
  | 上限与并发 | 单个文件超过 `maxSnippetBytes`、或大小未知,整份跳过——绝不半份摘要。收集到的摘要共享 2 MiB 总量预算;用完之后其余整份跳过并计入 `skipped.tooLarge`。读按 `readConcurrency` 跑 |
181
183
  | 计数器 | 过大 / 读不出 / 更深层 / 非角色这几类计入 `skipped`,在 UI 里显示,并由 `truncated` 如实反映 |