@jayyuen66/dsh-dir-prep-organize 0.1.8 → 0.1.10

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
@@ -1,30 +1,63 @@
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.10
8
+
9
+ 修复 0.1.9 引入的 web 启动隐患:设置卡与 dock 条目的组件收回 `client.js` 内联,移除对 `@jayyuen66/dsh-plugin-shared/client` 的模块表外置与 `cordis.patch.yml` 里的 shared 供应行。对外工具与 Remote 方法名单不变,默认配置不变。
10
+
11
+ ### Fixed
12
+
13
+ - **卡片组件内联进 `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 两枚,工厂替身对未知说明符的抛出把外置回流挡在装配层。
14
+
15
+ ## 0.1.9
16
+
17
+ 宿主开发基线抬到 `0.2.2-rc.1`,支持窗口从单条 `^0.2.1-rc.3` 改成两条宿主线的并集,`engines.node` 下限抬到 `>=24.9.0`;卡片组件改由 shared 的 `./client` 供。导入这条路径补上两条统一处理:越界回执的列举有界、允许根的形状统一处理。默认配置不变,需要留意的是 `engines.node` 抬高后 node 22 装不上本包,以及 cordis / cosmokit 的 peer 由确切版本改成范围后宿主装载门的差别。
18
+
19
+ ### Changed
20
+
21
+ - **shared 抬到 0.2.4**:catalog、生成物与 lockfile 随之同步;shared 新增的普通依赖 `@deepseek-ai/dsh-fs-patch` 由 shared 自己安装,本包不重复声明。
22
+ - **宿主开发基线**:`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` 随之重解。
23
+ - **支持窗口写成并集**:`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` 线宿主自己的下限,写低了等于承诺一个宿主不会启动的运行环境)。
24
+ - **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`,与两条宿主线各自的实装版本对齐。
25
+ - **卡片组件改由 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 会在插件页多出一个可关闭的组件,关掉后设置卡失去组件供应)。
26
+ - **CI 的 node 矩阵收敛**:`ci.yml` 的 `node: [22, 24]` 加 macOS 排除改为单格 `node: [24.9]`,`ci.yml` 与 `publish.yml` 的 `node-version` 由 `24` 改为 `24.9`,与 `engines.node` 同值。
27
+ - **发布预检按 catalog 的范围做法改判**:`publish.yml` 的依赖库可见性预检原先要求 catalog 里 shared 那条是**精确版本**,而伞根唯一来源按设计写的是范围(`^0.2.4`)——不符就拒发,等于让发布链与八仓的声明方式各说一套。现改为取**范围下限**那一版去查 registry:下限永远落在自己声明的范围里,与根侧 `sync --check` 比「该条范围的最低版本」的产物导出名单是同一做法。认不出的写法照旧拒发,`catalog:foo` 这类命名 catalog 仍然点名拒绝。
28
+
29
+ ### Fixed
30
+
31
+ - **越界回执有界**(`host.ts`):403 文本里的允许根最多列五处,其余折成 `…<条数>`。这条文本进会话日志与模型上下文,而允许根清单来自设置存储——手改过的 settings 或脏数据能把几百项拼进一条拒绝。省略数只用标点与数字表达,不引入未经 locale 的新词;`test/integration/filesystem.test.ts` 钉住截断形状。
32
+ - **允许根的形状归一**(`src/templates.ts`):登记项先剥末尾分隔符再去重,`/a` 与 `/a/` 认作同一棵树、不再在卡上摆两行;剥完为空(POSIX 根 `/`)或只剩盘符(`C:`)时保留原值,因为后者在 win32 是「该盘当前目录」的相对形式而不是根。`~` 归入「非绝对路径」一档被丢弃——它靠 shell 展开,而 host 的 `path.resolve` 不展开它,留着等于登记一条指向不明的允许根。
33
+
34
+ ### Docs
35
+
36
+ - **补齐 0.1.8 落下的一处文档**:frontmatter 行数上限当时已从 20 抬到 200(`src/templates.ts` 的 `FRONTMATTER_MAX_LINES`),两份 README 的 `unnamed` 计数说明仍写「前 20 行」,四处一并改到 200。
37
+ - **`importAllowRoots` 一行的语义**:补上「相对路径与 `~` 丢弃」与「末尾分隔符归一后去重」,与上面 Fixed 第二条的实现同值;dsh 徽章由 `^0.2.1-rc.3` 抬到 `^0.2.1-rc.5`,与 `engines.dsh` 首条同值。
5
38
 
6
39
  ## 0.1.8
7
40
 
8
- 一轮跨面审查修复:模板导入判据与解析收口,客户端超时与写回时序修正,CI 与发布链同步加固。
41
+ 一轮跨模块审查修复:模板导入判据与解析统一处理,客户端超时与写回时序修正,CI 与发布链同步加固。
9
42
 
10
43
  ### Changed
11
44
 
12
- - **发布链加固**(`.github/workflows/publish.yml`):拆 build/publish 两 job,`id-token: write` 只留 publish job;预检补本包版本占用检查与全部 `catalog:` 依赖可见性遍历;tarball 打包一次经 artifact 传递,发布前校验身份一致且无 `catalog:`/`workspace:` 残留,发布后轮询 registry 至可见(上限 5 分钟)。CI 侧 actionlint 改按文件豁免,codeql/scorecard/dependabot 同步收口。
45
+ - **发布链加固**(`.github/workflows/publish.yml`):拆 build/publish 两 job,`id-token: write` 只留 publish job;预检补本包版本占用检查与全部 `catalog:` 依赖可见性遍历;tarball 打包一次经 artifact 传递,发布前校验身份一致且无 `catalog:`/`workspace:` 残留,发布后轮询 registry 至可见(上限 5 分钟)。CI 侧 actionlint 改按文件豁免,codeql/scorecard/dependabot 同步统一处理。
13
46
  - **依赖与元数据**: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。
14
47
 
15
48
  ### Fixed
16
49
 
17
- - **模板导入**(`host.ts`):导入失败的 promise 先清出缓存再重抛,读面 Retry 不再永远重放同一 rejection;单文件正文围栏未闭合按 `truncated` 记账不再让整次导入失败;多根命中按绝对路径长度降序逐个复判,cwd 内合法登记不再被判隐藏段越权;子目录加 `fs.contains` 复判,链接进根外的目录按 escaped 记账;`.md` 后缀大小写不敏感;导入允许根拒收相对路径并按 resolve 去重。
50
+ - **模板导入**(`host.ts`):导入失败的 promise 先清出缓存再重抛,读取方法 Retry 不再永远重放同一 rejection;单文件正文围栏未闭合按 `truncated` 记录不再让整次导入失败;多根命中按绝对路径长度降序逐个复判,cwd 内合法登记不再被判隐藏段越权;子目录加 `fs.contains` 复判,链接进根外的目录按 escaped 记录;`.md` 后缀大小写不敏感;导入允许根拒收相对路径并按 resolve 去重。
18
51
  - **模板解析**(`src/templates.ts`):emoji 按 Unicode 码点截断不再劈开代理对;frontmatter 上限 20→200 行、缩进子键不再当顶层键;空 id 合并处理;`sanitizeAllowRoots` 只收绝对路径(POSIX/盘符/UNC)。
19
52
  - **客户端超时与写回**(`src/client-timeouts.ts`、`src/input-writeback.ts`、`src/client-entry.ts`):fetch 超时先压 base 再加余量,配置顶格时客户端时限不再等于宿主时限;导入回执 count 坏值回落真实条数并追加 truncated 提示;保存往返期间用户的新输入不再被清洗结果覆盖;写回 commit 现判 sessionId/phase,组件卸载作废在途票据;润色超时抛本地化错误,英文界面不再见硬编码中文。
20
53
 
21
54
  ### Added
22
55
 
23
- - **测试三层**:`test/e2e/product-load.e2e.test.ts`(rolldown 产物原生 import 装载加真宿主服务链全链)、`test/platform/paths.platform.test.ts`(跨平台路径形状)、`test/property/import-policy.property.test.ts`(fast-check 属性面)。
56
+ - **测试三层**:`test/e2e/product-load.e2e.test.ts`(rolldown 产物原生 import 装载加真宿主服务链全链)、`test/platform/paths.platform.test.ts`(跨平台路径形状)、`test/property/import-policy.property.test.ts`(fast-check 属性测试)。
24
57
 
25
58
  ## 0.1.7
26
59
 
27
- 这一版让润色跟随会话当前的模型选择,把模板写入改成宿主校验的光标插入,并把插件页展示面收进包内。
60
+ 这一版让润色跟随会话当前的模型选择,把模板写入改成宿主校验的光标插入,并把插件页展示收进包内。
28
61
 
29
62
  ### Changed
30
63
 
@@ -32,7 +65,7 @@
32
65
  两者都没有才用 `agentDefaultModel.currentSelection()`。
33
66
  - **模板改为光标插入**:`captureInsertion()` + `insertText()` 由宿主按发起的选区核验,草稿里的引用块与附件
34
67
  不再被整稿替换抹平;输入框处于提交期时两个入口禁用,宿主拒绝插入时不回落 `setDraft`。
35
- - **润色结果写回增加版本凭据**:新增 `src/input-writeback.ts`,按会话 id、草稿版本、输入动作面身份与
68
+ - **润色结果写回增加版本凭据**:新增 `src/input-writeback.ts`,按会话 id、草稿版本、输入动作对象的身份与
36
69
  `phase` 判定;请求期间继续输入、切换会话或进入提交期都会放弃写回,并提示「输入框内容已变化」。
37
70
  - **设置卡改用 shared 的卡片骨架**:正文改为「角色库」小节,保存与撤销走统一 `SaveBar`,样式使用
38
71
  `CARD_UI_CSS` 与 `dsu-*` 控件类。
@@ -46,29 +79,29 @@
46
79
  ### Fixed
47
80
 
48
81
  - **请求在途时用户继续编辑,旧润色结果会覆盖新草稿**:写回改为读最新一帧并核对版本戳,过期结果不再落地。
49
- - **模板插入会重建整份草稿**:改走输入框的插入面后只插入文本,引用块与附件保持原样。
50
- - **干净 npm 安装与宿主品牌包的 cordis 线冲突**:`@deepseek-ai/cordis` 的 optional peer 改为
82
+ - **模板插入会重建整份草稿**:改走输入框的插入接口后只插入文本,引用块与附件保持原样。
83
+ - **干净 npm 安装与宿主自带的 cordis 版本线冲突**:`@deepseek-ai/cordis` 的 optional peer 改为
51
84
  `~4.0.5 || 4.0.6-alpha.1`,既接受宿主当前要求的 `~4.0.5`,也接受编译所用的
52
85
  `4.0.6-alpha.1`;编译期精确钉版仍留在 `devDependencies`。
53
86
 
54
87
  ## 0.1.6
55
88
 
56
- 这一版收口客户端交互与错误文案,并把构建、CI 与伞工作区基线统一;模板数据与 85 条内置精选不变。
89
+ 这一版统一处理客户端交互与错误文案,并把构建、CI 与伞工作区基线统一;模板数据与 85 条内置精选不变。
57
90
 
58
91
  ### Changed
59
92
 
60
- - **宿主线抬到 `0.2.1-rc.3`**:`engines.dsh`、peer/dev 依赖、`pnpm-workspace.yaml` 的 overrides 与 README 徽标/正文同值;shared 下限随根真源投影。
93
+ - **宿主线抬到 `0.2.1-rc.3`**:`engines.dsh`、peer/dev 依赖、`pnpm-workspace.yaml` 的 overrides 与 README 徽标/正文同值;shared 下限随根唯一来源投影。
61
94
  - **构建编排统一进 shared 的 `lib/build-*`**:host/client/types 构建脚本只剩薄配置层,产物仍落 `dist/`。
62
95
  - **润色链路的错误文案跟随界面语言**:客户端自己产生的错误(目录上下文失败、读取模型失败、输入为空、回执不可解析)改走本地化消息键,宿主回执里的原文不翻译、作为 `{message}` 原样带出。
63
96
  - **超时值的非法输入回落到默认值**:`NaN`、`0`、负数与小数不再被折算成 1 ms 或负数——那会让「配错」看起来像「配了一个很小的合法值」,实际是立刻超时。
64
97
  - **编辑中的草稿与写入操作互斥**:模板行、导入面板与允许根面板在保存期间禁用;保存成功后只清本次真正写下的键。
65
- - **Remote 读面按运行期形状校验**:`ok: true` 但缺 `value` 的应答不再被当成「成功但空」;`$mount` 失败不缓存,下一次读会重试。
98
+ - **Remote 读取方法按运行期形状校验**:`ok: true` 但缺 `value` 的应答不再被当成「成功但空」;`$mount` 失败不缓存,下一次读会重试。
66
99
  - **样式补兜底与可访问性**:所有 `var()` 带回落值,错误态 hover 不被基础样式覆盖,补 `:focus-visible` 与 `prefers-reduced-motion`。
67
100
 
68
101
  ### Fixed
69
102
 
70
- - **同一轮事件里的第二次点击会再发一次 LLM 请求**:`loading` 要等一次重渲染才生效,两道读状态的闸门都拦不住;改为在 `await` 之前置同步在途标记。
71
- - **新增模板行的正文会把占位提示落盘**:占位改由 textarea 的 placeholder 承担,新行正文从空串开始。
103
+ - **同一轮事件里的第二次点击会再发一次 LLM 请求**:`loading` 要等一次重渲染才生效,两道读状态的检查都拦不住;改为在 `await` 之前置同步在途标记。
104
+ - **新增模板行的正文会把占位提示写到磁盘**:占位改由 textarea 的 placeholder 承担,新行正文从空串开始。
72
105
  - **角色文件的代码围栏没有结束标记时只导入半篇正文**:现在直接报错并点明起始行,不再静默截断。
73
106
  - **恢复默认的二次确认文案写死 4 秒**:改为按实际确认窗口插值。
74
107
 
@@ -83,15 +116,15 @@
83
116
 
84
117
  - **命名与文案统一**:「整理」改为「润色」,「提示词模板」改为「模板库」,「角色视角」改为「角色风格」;中英文案、`package.json` 描述与关键字、`cordis.patch.yml` 与两份 README 同步。
85
118
  - **prompt 信任序**:目录摘要、最近若干轮与角色正文改由 `buildOrganizeUser` 放进 user 消息的 `<data>` 围栏,system 只拿会话 cwd;数据行里的围栏标记先替换成 `[fence-open]` / `[fence-close]`,避免草稿自己关掉围栏。
86
- - **客户端竞态收口**:内置快照读面加世代号,`reset` 之后晚到的应答不再写回 store;「恢复默认」与「保存」共用 busy 门禁;▾ 菜单项与主按钮同用 `loading || !canWrite`;超时下界夹到 1 ms。
87
- - **Remote 读面**:`unwrap` 按运行期形状校验应答;`mount` 的 promise 失败后清缓存。
119
+ - **客户端竞态统一处理**:内置快照读取方法加世代号,`reset` 之后晚到的应答不再写回 store;「恢复默认」与「保存」共用 busy门禁;▾ 菜单项与主按钮同用 `loading || !canWrite`;超时下界夹到 1 ms。
120
+ - **Remote 读取方法**:`unwrap` 按运行期形状校验应答;`mount` 的 promise 失败后清缓存。
88
121
  - **跨平台构建**:`.gitattributes` 钉 `eol=lf`;生成器用 `process.execPath` 跑 oxfmt 包内入口;构建产物改临时文件 + `rename`;核对产物里的 `BUNDLE_PKG` 与包名同源;补 `dist-size` 预算与 `.prettierignore` 第二份生成物。
89
122
  - **CI 与发布**:新增三平台 × node 22/24 的 `ci.yml`、`codeql.yml`、`scorecard.yml` 与 `dependabot.yml`;`publish.yml` 改 OIDC 优先、静态 token 兜底,挂 `npm-publish` 环境、加 concurrency 与超时,action 钉 commit SHA。
90
123
 
91
124
  ### Fixed
92
125
 
93
126
  - 内置快照 `reset` 之后可能被恢复前那次请求的旧快照覆盖。
94
- - 「恢复默认」与「保存」并发时最后写入者赢,没有共同门禁。
127
+ - 「恢复默认」与「保存」并发时最后写入者赢,没有共同检查。
95
128
  - 写不回草稿时,▾ 菜单要烧完整次 LLM 往返才在写回那步报错。
96
129
  - `Math.trunc` 把 `(0,1)` 的配置值取整成 0,加完余量后可能变成 0 或负数,被当成「当场超时」。
97
130
 
@@ -108,11 +141,11 @@
108
141
 
109
142
  - **导入同 slug 碰撞时 id 改写进入死循环**(会同步阻塞宿主):改为循环内自增后缀,并加回归用例。
110
143
  - **允许根包含判据只按 `/` 拆段**:win32 上合法子路径一律判越界、`..\` 漏检;改用 `path.relative` + 双分隔符拆段。
111
- - **client 读面的模块级全局不随卸载清理**:收进 `ctx.effect` disposer,按身份比较防误清。
144
+ - **client 读取方法的模块级全局不随卸载清理**:收进 `ctx.effect` disposer,按身份比较防误清。
112
145
 
113
146
  ### Changed
114
147
 
115
- - **Typert 迁移收尾**:五条 `/_dsh/dir-prep/*` 端点改为官方 `dirPrepOrganize` Remote;HTTP handler、信任/CSRF 闸门、`guardBody` 与只为 body 上限存在的 `importBodyMaxBytes` 删除,webserver 集成测试一并删除。
148
+ - **Typert 迁移收尾**:五条 `/_dsh/dir-prep/*` 端点改为官方 `dirPrepOrganize` Remote;HTTP handler、信任与 CSRF 检查、`guardBody` 与只为 body 上限存在的 `importBodyMaxBytes` 删除,webserver 集成测试一并删除。
116
149
  - 删除 `peerDependencies.react`:宿主运行时是 18.x,devDependency 保留。
117
150
  - 清理迁移遗留的 HTTP 契约文本、`invalidJsonBody` 死键、指错行的证据引用与失真计数。
118
151
 
@@ -124,19 +157,19 @@
124
157
  - **单文件导入没有字节上限**:`cwd/roles.md` 直接调 `fs.readText`,不看 `maxSnippetBytes`;现在按官方 `stat` 判大小,未知或超限即跳过并计入 `skipped.tooLarge`。
125
158
  - **目录枚举逐个降级**:`fs.listDir` 在 `mapBounded` worker 里没有 try/catch,一个 `chmod 000` 的子目录就让整次导入归零;现在逐个降级并计入 `skipped.unreadable`。
126
159
  - **导入回填按最新草稿合并**:`onImported` 闭包用点击那一刻的草稿,等待一整次网络往返期间用户改的行会被整份旧草稿覆盖;改为函数式更新。
127
- - **fetch 超时夹到 2^31-1**:`organizeTimeoutMs + 5000` 越界时 V8 会静默夹成 1 ms,把「调大超时」反转成「立刻失败」;取值与夹位单源挪到 `src/client-timeouts.ts`。
160
+ - **fetch 超时夹到 2^31-1**:`organizeTimeoutMs + 5000` 越界时 V8 会静默夹成 1 ms,把「调大超时」反转成「立刻失败」;取值与夹位唯一来源挪到 `src/client-timeouts.ts`。
128
161
  - **「恢复默认」纳入 busy 门禁**;「整理」按钮在 `setDraft` 不可用时禁用。
129
162
 
130
163
  ### Changed
131
164
 
132
- - `@jayyuen66/dsh-plugin-shared` 从 `^0.1.4` 升到 `^0.1.5-rc`,吃进三处信任闸门修复;验证不止比版本号:`npm pack` 拉下发布产物逐条比对行为。
165
+ - `@jayyuen66/dsh-plugin-shared` 从 `^0.1.4` 升到 `^0.1.5-rc`,带上三处信任校验的修复;验证不止比版本号:`npm pack` 拉下发布产物逐条比对行为。
133
166
  - 新增集成层(真磁盘 + 真 FileSystem 抽象类):上面三条 host 缺陷都是手搓桩测不出来的。
134
167
 
135
168
  ## 0.1.2-rc
136
169
 
137
170
  ### Changed
138
171
 
139
- - **宿主包整体精确钉到 `0.2.1-alpha.2`**;`@jayyuen66/dsh-plugin-shared` 升到 `^0.1.4`,工具链随 catalog 更新。
172
+ - **宿主包整体精确对齐到 `0.2.1-alpha.2`**;`@jayyuen66/dsh-plugin-shared` 升到 `^0.1.4`,工具链随 catalog 更新。
140
173
  - **`servingNonLoopback` 改由 shared 的 `isNonLoopbackBindHost` 取**:宿主把 `Config.host` 收成任意本机接口 IP 字面量、通配地址在载入即拒,旧的 `=== "0.0.0.0"` 恒为 false,局域网请求整片吃 403 而本地门禁全绿。
141
174
  - **peerDependencies 补齐声明产物点名却未认领的宿主包**,写成 optional;值导入的 `dsh-brand` 与 `schemastery` 保持必选。
142
175
  - 升级带来的声明行号位移逐条对表修正。
@@ -158,7 +191,7 @@
158
191
  ### Fixed
159
192
 
160
193
  - `check` 补上 `build:types`:此前校验的声明产物压根没被构建过。
161
- - 发布清单门禁覆盖入口面、第三方声明、运行期产物、声明覆盖全部导出,以及不泄漏本机或包管理器内部路径。
194
+ - 发布清单检查覆盖入口、第三方声明、运行期产物、声明覆盖全部导出,以及不泄漏本机或包管理器内部路径。
162
195
 
163
196
  ## 0.1.0
164
197
 
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%3D22.12-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.3-658EFF?style=flat-square" alt="dsh" />
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 `>= 22.12`.** 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` in the `0.2.1-rc.3` → `0.2.2-alpha.2` window.** The requirement the host actually reads is `engines.dsh` (`^0.2.1-rc.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` is **refused**, `0.2.1-rc.3` 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 the three most recently released host versions 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-alpha.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.1-rc.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.
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; duplicates removed. With nothing registered, only the session cwd and the built-in role library are allowed |
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 20 frontmatter lines counts as `unnamed`** and is skipped rather than guessed.
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 20 frontmatter lines), `unreadable` (read failure) |
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%3D22.12-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.1--rc.3-658EFF?style=flat-square" alt="dsh" />
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
 
@@ -53,7 +53,7 @@
53
53
  - 下拉按条目的 `group` 字段分组,`group` 为空的条目落在「通用」里。
54
54
  - **润色**会把草稿、会话 cwd 的顶层(文件名、大小、关键文本文件的全文)以及会话里**真实的** user/assistant 轮次交给当前会话选定的模型(取不到时回落宿主默认模型),然后用重写结果替换草稿。只有会话、草稿版本与输入阶段都没变时才写回。
55
55
  - 失败时草稿**绝不**被改动:按钮进入错误态若干秒,原因写在其 tooltip 里。
56
- - **模板**经输入框的插入面写到光标处:引用块与附件保持原样;插入凭据过期时宿主拒绝插入,而不是重建整份草稿。输入框处于提交期时两个控件禁用。
56
+ - **模板**经输入框的插入接口写到光标处:引用块与附件保持原样;插入凭据过期时宿主拒绝插入,而不是重建整份草稿。输入框处于提交期时两个控件禁用。
57
57
  - 内置集是 **85 条精选角色模板**,由 `scripts/gen-defaults.mjs` 从本包的 `agents/` 角色库生成——那是从上游项目移入的几百份角色 `.md`,分布在二十多个部门目录下。对用户有意义的是那 85 条;角色库的份数不在这里钉死,因为上游一刷新它就变。
58
58
  - 这张表**只在宿主侧**:客户端产物不再内联它。生成文件约 640 KB,曾把 `client.js` 推到约 711 KB。
59
59
  - 浏览器**懒加载、只调一次** Remote 的 `defaults` 方法(首次打开菜单或首次进设置卡),之后在进程内复用。用户已经有自己的模板时**一个字节都不拉**。
@@ -69,10 +69,10 @@ 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 `>= 22.12`。** 本包是纯 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.3` → `0.2.2-alpha.2` 窗口内。** 宿主真正读的是 `engines.dsh`(`^0.2.1-rc.3`),而且它**单独决定**:`evaluatePluginCompatibility` 在 `engines.dsh` 那一支就返回了,根本走不到读 `peerDependencies` 的那段。对宿主真实代码实测:`0.2.0-rc.2` **被拒**,`0.2.1-rc.3` 与 `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-alpha.2`**——本包编译与测试所对着的那条宿主线。`engines.dsh` 与 optional peer 范围承载单独判读的支持窗口(`^0.2.1-rc.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`,于是**每一次原生工具调用都抛**——而本包的构建、类型检查、覆盖率门禁在此之前全部照绿。
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
+ - **`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` 现量读,不从这段文字读,所以两边不会漂移。
78
78
  - **随包发的东西**:`host.js`、`client.js`、`templates.data.mjs`、`types/`、`cordis.patch.yml`、`agents/`、`locale/`、`docs/` 与 `THIRD_PARTY_NOTICES.md`。`package.json`、`README*` 与 `LICENSE` 由发布器无条件附带。
@@ -97,7 +97,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
97
97
  找之前先知道这几件事:
98
98
 
99
99
  - **它不注册任何模型工具。** 宿主半只 inject `settings`,从不碰工具注册表。没有 `organize_text` 这类工具可调。
100
- - **它没有自建的 HTTP 路由。** 数据面是官方 Typert Remote 命名空间 `dirPrepOrganize`,经注入的子 fiber 注册,走宿主 `/api` 网关。认证、Host/DNS 重绑定/Origin 判据、签名浏览器会话 cookie、body 上限全归网关——本包不持有 CSRF token,也没有路由表。
100
+ - **它没有自建的 HTTP 路由。** 数据那一栏是官方 Typert Remote 命名空间 `dirPrepOrganize`,经注入的子 fiber 注册,走宿主 `/api` 网关。认证、Host/DNS 重绑定/Origin判据、签名浏览器会话 cookie、body 上限全归网关——本包不持有 CSRF token,也没有路由表。
101
101
  - **它不加 CLI 子命令。**
102
102
  - **它不读任何环境变量**,也没有自己的出站请求。
103
103
  - 它**确实**消费的东西:宿主 `settings` 服务(硬注入,缺它条目根本不激活)、`llm.stream`、`agentDefaultModel`,以及会话、Agent 与文件系统服务。设置表单本身没就绪时,卡片禁用并显示状态提示,下拉回落到内置精选集。
@@ -107,7 +107,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
107
107
  - 安装即贡献组合包补丁层(`dsh.bundle.patch` → `./cordis.patch.yml`),插入 `- id: dir-prep-organize`,`name` 指向包名。
108
108
  - **客户端半**注册两个槽位外加设置卡:
109
109
  - `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 永远匹配不上,卡片哪都不渲染。
110
+ - `plugins.bundle.config`——设置卡,按 **bundle 包名** `@jayyuen66/dsh-dir-prep-organize` 作 key。宿主派发 `entryKey: pkg.name`(唯一来源是 profile `package.json` 里的 `dsh.profile.bundles`),所以写成裸条目 id 永远匹配不上,卡片哪都不渲染。
111
111
  - 设置命名空间与 `configForms.get()` 仍是**裸条目 id** `dir-prep-organize`——与那个槽位 key 刻意不是同一个标识。
112
112
  - 客户端半是 `dsh.client.platform = web` 且带 `immediately`。
113
113
  - 卡片的文案遵循官方 locale 插件的偏好;宿主半每次请求现读该偏好,所以切语言不必重启。
@@ -119,7 +119,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
119
119
  |---|---|
120
120
  | 传输 | 宿主 `llm.stream`:一条**仅请求态**的 user 文本消息(无 `id`、无 `source`)加一段 `system` 规则块 |
121
121
  | 模型 | 先取会话活 Agent 的当前选择——新宿主读 `agent.model.current()`,旧宿主回落 `agent.options`——再回落 `agentDefaultModel.currentSelection()`。取不到时回报 "No model selection is available" |
122
- | 写回闸门 | 只有会话 id、输入动作面身份、草稿版本与输入阶段(`plain`)都没变时才写回。否则回报「输入框内容已变化,润色结果未写回」,草稿保持原样 |
122
+ | 写回条件 | 只有会话 id、输入动作对象的身份、草稿版本与输入阶段(`plain`)都没变时才写回。否则回报「输入框内容已变化,润色结果未写回」,草稿保持原样 |
123
123
  | 角色风格 | 可选的 `roleText` 注入 user 消息的 `<data>` 围栏(不进 system——见 `buildOrganizeSystem` 的信任序注释)。它只借用术语与语气,**从不执行该角色的任务** |
124
124
  | finish reason | 除 `stop` 之外(含缺 finish 块)一律**失败**,且绝不写回草稿 |
125
125
  | 超时 | `organizeTimeoutMs`,默认 120000 ms,每次请求经 `.get()` 读。客户端 fetch 超时是它 + 5000 ms |
@@ -133,7 +133,7 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
133
133
  | 条目形状 | `{ id, name, description, text, group, emoji }`,全部字符串。`description` / `group` / `emoji` 默认空串 |
134
134
  | 保存时校验 | `name` 或 `text` 为空的条目被丢掉;`emoji` 截到 12 字符;缺失或撞车的 `id` 确定性地替换成 `tpl-<index>` |
135
135
  | 内置集 | 从 `agents/` 角色库生成的 85 条精选模板。`templates` 未设置时下拉回落到它们 |
136
- | 插入 | 走输入框的版本校验插入面(`captureInsertion()` + `insertText()`)。文本写到光标处,引用块与附件保持原样;凭据过期时什么都不插入 |
136
+ | 插入 | 走输入框的版本校验插入接口(`captureInsertion()` + `insertText()`)。文本写到光标处,引用块与附件保持原样;凭据过期时什么都不插入 |
137
137
  | 「未设置」= 空数组 | 隐式注册下 schemastery 会把缺失的数组字段 cast 成 `[]`,所以**空列表永远意味着「回落到内置」**。只有非空数组且条目全部非法,才渲染成空列表 |
138
138
  | 恢复默认 | 把 `templates` 退回精选集,`importAllowRoots` 不动。两步确认,第二次点击须在 4 秒内 |
139
139
  | 导入 | 按路径:本地 `.md` 文件或目录。`path` 恰为空串 = 导入整套内置库。角色文件的代码围栏没有结束标记时直接拒绝,不会静默只导入半篇正文 |
@@ -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[]` | `[]` | **有** | 导入端点的额外允许根,逐个目录登记;非字符串与纯空白项丢弃,重复项去重。一个都没登记时只允许会话 cwd 与内置角色库 |
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 上限) |
@@ -172,10 +172,10 @@ dsh plugin --profile web add @jayyuen66/dsh-dir-prep-organize
172
172
 
173
173
  | 面 | 事实 |
174
174
  |---|---|
175
- | 网络 | 没有自己的出站请求:数据面走宿主网关的 RPC 通道。不读任何环境变量 |
176
- | 落盘 | 唯一写盘的是宿主设置文件里的 `templates` 与 `importAllowRoots` |
175
+ | 网络 | 没有自己的出站请求:数据那一栏走宿主网关的 RPC 通道。不读任何环境变量 |
176
+ | 写到磁盘 | 唯一写盘的是宿主设置文件里的 `templates` 与 `importAllowRoots` |
177
177
  | 一次润色发出去什么 | 完整草稿、会话 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` **不在**白名单 |
178
+ | 哪些文件会取摘要 | 只有 20 种代码/文档扩展名(ts/tsx/js/jsx/mjs/cjs/py/rs/go/java/rb/json/toml/md/sql/graphql/proto/css/scss/less)。`yaml` / `env` **不在**白名单里 |
179
179
  | 敏感文件名 | 名字在**分隔符边界**上命中 `credentials` / `secret(s)` / `id_rsa` / `pem` / `p12` / `pfx` / `keystore` / `env` / `key(s)` / `token(s)` / `auth` / `passwd` / `password` / `account(s)` 的文件,永不取摘要。边界是刻意的:朴素子串匹配会误杀 `monkey.js` 与 `AUTHORS.md`,而漏匹配会把凭据全文发给第三方模型 |
180
180
  | 上限与并发 | 单个文件超过 `maxSnippetBytes`、或大小未知,整份跳过——绝不半份摘要。收集到的摘要共享 2 MiB 总量预算;用完之后其余整份跳过并计入 `skipped.tooLarge`。读按 `readConcurrency` 跑 |
181
181
  | 计数器 | 过大 / 读不出 / 更深层 / 非角色这几类计入 `skipped`,在 UI 里显示,并由 `truncated` 如实反映 |
@@ -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
- - **前 20 行 frontmatter 里解析不出名字的文件计为 `unnamed`**,跳过而不是猜。
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`(前 20 行 frontmatter 里没有名字)、`unreadable`(读失败) |
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="" /> 开发
@@ -286,11 +286,11 @@ Operating Expenses(运营费用)
286
286
 
287
287
  **第 3 阶段 —— 估值**
288
288
 
289
- *内在价值法*
289
+ * 内在价值法*
290
290
  - DCF:5 年 FCF 预测 + 终值(Gordon 增长模型或退出倍数);以 WACC 折现
291
291
  - LBO 分析:在不同入场倍数下对杠杆回报建模;在目标 IRR 下反解最高出价
292
292
 
293
- *相对价值法*
293
+ * 相对价值法*
294
294
  - 可比公司分析(公开可比):EV/Revenue、EV/EBITDA、P/E
295
295
  - 先例交易分析:EV/Revenue、EV/EBITDA,含控制权溢价
296
296
 
@@ -252,7 +252,7 @@ if ('modelContext' in document) {
252
252
  | Perplexity 浏览器 | ⚠️ 部分 | ❌ 否 | 主要通过 DOM 使用声明式 |
253
253
  | 其他 Chromium 智能体 | ⚠️ 视情况 | ⚠️ 视情况 | 需逐一测试 |
254
254
 
255
- *注意:WebMCP 是 2026 年的草案规范。此矩阵反映截至 2026 年 Q1 的已知支持情况——请对照最新浏览器文档验证。*
255
+ * 注意:WebMCP 是 2026 年的草案规范。此矩阵反映截至 2026 年 Q1 的已知支持情况——请对照最新浏览器文档验证。*
256
256
 
257
257
  ### 需要消除的智能体敌对模式
258
258
 
@@ -37,14 +37,14 @@ color: "#5C7CFA"
37
37
  - "现在[功能]用的是什么工具?"
38
38
  - "你们团队围绕[职责]是怎么组织的?"
39
39
 
40
- *限制在 2-3 个。每一个你本可以事先调研到的 Situation 问题,都在暴露你的懒惰。资深客户在这里会很快失去耐心。*
40
+ * 限制在 2-3 个。每一个你本可以事先调研到的 Situation 问题,都在暴露你的懒惰。资深客户在这里会很快失去耐心。*
41
41
 
42
42
  **Problem 问题**——浮现不满
43
43
  - "这个流程在哪里会出问题?"
44
44
  - "当[场景]发生时会怎样?"
45
45
  - "目前这套做法中最让人头疼的部分是什么?"
46
46
 
47
- *这些问题打开了大门。大多数销售停在这里。这还不够。*
47
+ * 这些问题打开了大门。大多数销售停在这里。这还不够。*
48
48
 
49
49
  **Implication 问题**——放大痛点(赢单在这里)
50
50
  - "当这里出问题时,对[相关团队/指标]的连锁影响是什么?"
@@ -60,7 +60,7 @@ color: "#5C7CFA"
60
60
  - "那会怎样改变你们达成[目标]的能力?"
61
61
  - "如果[问题]不再是个障碍,对你的团队意味着什么?"
62
62
 
63
- *客户自己说服自己。他们用自己的话描述未来的状态。那些话后面会成为你的成交话术。*
63
+ * 客户自己说服自己。他们用自己的话描述未来的状态。那些话后面会成为你的成交话术。*
64
64
 
65
65
  ### 2. Gap Selling(Keenan)
66
66
 
@@ -111,7 +111,7 @@ color: "#5C7CFA"
111
111
  - "如果这个问题不解决,[项目/目标]会怎样?"
112
112
  - "如果事情维持现状,对你个人意味着什么?"
113
113
 
114
- *第三层是大多数销售从不触及的地方。但购买决策是情感决策加理性论证。那位告诉你"我们需要更好的报表"的 VP,内心的真相是:"Q3 我要向董事会汇报,但我不信任自己的数据。"第二个版本才是驱动紧迫性的东西。*
114
+ * 第三层是大多数销售从不触及的地方。但购买决策是情感决策加理性论证。那位告诉你"我们需要更好的报表"的 VP,内心的真相是:"Q3 我要向董事会汇报,但我不信任自己的数据。"第二个版本才是驱动紧迫性的东西。*
115
115
 
116
116
  ## 顶尖 Discovery 通话结构
117
117
 
@@ -221,8 +221,8 @@ ZK 管家的工作流引用了以下能力。它们不属于 The Agency 仓库
221
221
  | **随机漫步** | 在知识网络中随机游走;张力/遗忘/孤岛模式;配套仓库中有可选脚本。 |
222
222
  | **深度学习** | 一站式深度阅读(书籍/长文/报告/论文):结构 + 原子 + 方法笔记;Adler、Feynman、Luhmann、批评者视角。 |
223
223
 
224
- *配套技能定义(兼容 Cursor/Claude Code)在 **[zk-steward-companion](https://github.com/mikonos/zk-steward-companion)** 仓库中。克隆或复制 `skills/` 文件夹到你的项目(如 `.cursor/skills/`),并调整路径指向你的知识库,即可使用完整的 ZK 管家工作流。*
224
+ * 配套技能定义(兼容 Cursor/Claude Code)在 **[zk-steward-companion](https://github.com/mikonos/zk-steward-companion)** 仓库中。克隆或复制 `skills/` 文件夹到你的项目(如 `.cursor/skills/`),并调整路径指向你的知识库,即可使用完整的 ZK 管家工作流。*
225
225
 
226
226
  ---
227
227
 
228
- *起源*:从 Cursor 规则集(core-entry)中抽象而来,用于 Luhmann 风格的 Zettelkasten。贡献用于 Claude Code、Cursor、Aider 和其他智能体工具。适用于使用原子笔记和显式链接来构建或维护个人知识库的场景。
228
+ * 起源*:从 Cursor 规则集(core-entry)中抽象而来,用于 Luhmann 风格的 Zettelkasten。贡献用于 Claude Code、Cursor、Aider 和其他智能体工具。适用于使用原子笔记和显式链接来构建或维护个人知识库的场景。
@@ -1102,4 +1102,4 @@ T+1 到 T+7:上线后
1102
1102
 
1103
1103
  **NEXUS:9 个部门,7 个阶段,一套统一策略。**
1104
1104
 
1105
- *从发现到持续运营——每个智能体都知道自己的角色、时机和交接对象。*
1105
+ * 从发现到持续运营——每个智能体都知道自己的角色、时机和交接对象。*
@@ -175,4 +175,4 @@
175
175
 
176
176
  ---
177
177
 
178
- *当高管摘要生成器根据六个发现智能体的证据给出"继续"决策时,第 0 阶段结束。*
178
+ * 当高管摘要生成器根据六个发现智能体的证据给出"继续"决策时,第 0 阶段结束。*
@@ -235,4 +235,4 @@
235
235
 
236
236
  ---
237
237
 
238
- *当工作室制片人和现实检验者都在架构包上签字后,第 1 阶段结束。*
238
+ * 当工作室制片人和现实检验者都在架构包上签字后,第 1 阶段结束。*
@@ -275,4 +275,4 @@
275
275
 
276
276
  ---
277
277
 
278
- *当骨架应用跑起来、CI/CD 流水线可用、证据收集者用截图验证了所有基础组件后,第 2 阶段结束。*
278
+ * 当骨架应用跑起来、CI/CD 流水线可用、证据收集者用截图验证了所有基础组件后,第 2 阶段结束。*
@@ -283,4 +283,4 @@ Sprint 排序师激活:
283
283
 
284
284
  ---
285
285
 
286
- *当所有 Sprint 任务通过 QA、所有 API 端点已验证、性能基线达标、没有严重 bug 时,第 3 阶段结束。*
286
+ * 当所有 Sprint 任务通过 QA、所有 API 端点已验证、性能基线达标、没有严重 bug 时,第 3 阶段结束。*
@@ -329,4 +329,4 @@
329
329
 
330
330
  ---
331
331
 
332
- *当现实检验者给出"就绪"判定且有压倒性证据时,第 4 阶段结束。"需要改进"是首轮预期的正常结果——说明系统在跑,但还需要打磨。*
332
+ * 当现实检验者给出"就绪"判定且有压倒性证据时,第 4 阶段结束。"需要改进"是首轮预期的正常结果——说明系统在跑,但还需要打磨。*
@@ -274,4 +274,4 @@
274
274
 
275
275
  ---
276
276
 
277
- *当产品已部署、系统稳定 48 小时以上、增长渠道活跃、反馈循环可用时,第 5 阶段结束。*
277
+ * 当产品已部署、系统稳定 48 小时以上、增长渠道活跃、反馈循环可用时,第 5 阶段结束。*
@@ -315,4 +315,4 @@
315
315
 
316
316
  ---
317
317
 
318
- *第 6 阶段没有结束日期。只要产品还在市场上,它就一直跑,通过持续改进循环推动产品向前。需要做大的新功能或战略转向时,可以重新激活 NEXUS 流水线(NEXUS-Sprint 或 NEXUS-Micro)。*
318
+ * 第 6 阶段没有结束日期。只要产品还在市场上,它就一直跑,通过持续改进循环推动产品向前。需要做大的新功能或战略转向时,可以重新激活 NEXUS 流水线(NEXUS-Sprint 或 NEXUS-Micro)。*