@jayyuen66/dsh-zvec-grep 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 +29 -0
- package/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/THIRD_PARTY_NOTICES.md +6 -4
- package/client.js +735 -320
- package/docs/DETAIL.md +28 -0
- package/docs/DETAIL.zh.md +28 -0
- package/host.js +34 -10
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +53 -41
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## 0.1.9
|
|
6
|
+
|
|
7
|
+
这一版让 search-first 门禁认识宿主的步骤准入,并把设置卡与读面校验统一到 shared 组件和 zod;
|
|
8
|
+
宿主开发线抬到 0.2.2-alpha.2。
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **设置卡迁到 shared 组件与 zod**:字段版式、保存条与状态条改用 `@jayyuen66/dsh-plugin-shared/lib/card-ui`;
|
|
13
|
+
`defaultLimit` / `grepBudgetPerSearch` / `unlockWindowMin` 的输入与显示共用 zod 区间 schema,
|
|
14
|
+
`hfEndpoint` 只接受 http(s) URL。
|
|
15
|
+
- **重建轮询回执改按 schema 容错投影**:未知状态、非数字退出码、非字符串输出都折成缺位,坏类型不再带到
|
|
16
|
+
渲染期;`src/rebuild-reader.ts` 的两个 strict codec 改由 zod 生成。
|
|
17
|
+
- **client 产物按宿主 `PLATFORM_MODULES` 外置 zod**;`zod` 进入 `dependencies`。
|
|
18
|
+
- **宿主开发线抬到 `0.2.2-alpha.2`**:devDependencies 与 catalog/overrides 同值;`@deepseek-ai/dsh*` 的 peer
|
|
19
|
+
改为同一条支持窗口范围(`^0.2.1-rc.3`,schemastery 仍钉宿主自带版本),精确钉版只留在 devDependencies。
|
|
20
|
+
- **插件页展示面进包**:新增 `locale/en.json`、`locale/zh.json` 与 `docs/DETAIL.md`、`docs/DETAIL.zh.md`;
|
|
21
|
+
`exports` 增加 `./locale/*.json`,`files` 收进 locale 与 docs。
|
|
22
|
+
- **正则常量提取**:错误明细解析、命中计数行等内联正则改为命名常量,行为不变。
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **单仓安装态下 lint 把 `ToolBatchInput["agent"]` 读成 error 类型**:`@deepseek-ai/dsh-agent`
|
|
27
|
+
只是 `@deepseek-ai/dsh-tools` 的 peer,单仓安装不会自动装它;补进 `devDependencies` 后
|
|
28
|
+
`typescript(no-unsafe-assignment)` 与 `no-unnecessary-type-assertion` 两族告警消失。
|
|
29
|
+
- **受限子代理与条件工具步骤被 search-first 门禁拦死**:门禁原先只看 `zg_search` 在注册表里是否存在,
|
|
30
|
+
不看本步骤的准入视图;模型因此被迫调用一个本步骤调不动的工具。现在执行体带 `toolSet` 时按
|
|
31
|
+
`view(scope)` 判,`zg_search` 不在视图里就让路;没有步骤准入的宿主沿用原判据。为此新增
|
|
32
|
+
`@deepseek-ai/dsh-scope` 值导入(`scopeOf`),并列入 peer 与 devDependencies。
|
|
33
|
+
|
|
5
34
|
## 0.1.8
|
|
6
35
|
|
|
7
36
|
### Changed
|
package/README.md
CHANGED
|
@@ -77,9 +77,9 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
77
77
|
Remove with `dsh plugin --profile web remove @jayyuen66/dsh-zvec-grep`. The package is on the public npm registry; no credentials, no scoped-registry line.
|
|
78
78
|
|
|
79
79
|
- **Node.js `>= 22.12`** (ESM-only; that floor is what makes `require()` of an ESM entry work, hence `engines.node`).
|
|
80
|
-
- **Host `dsh` on the `0.2.1-rc.3` line.** The host reads `engines.dsh` (`^0.2.1-rc.3`) and it **decides alone** - with that field present, compatibility is judged before `peerDependencies` is ever consulted, prereleases included. Any `0.2.x` at or above `0.2.1-rc.3` passes; `0.3.0` and later need the risk grant `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <exact> --accept-risk`.
|
|
81
|
-
- **No `@deepseek-ai/*` under `dependencies`, by contract** (`test/publish-manifest.test.ts`). Profiles install with `nodeLinker: hoisted` and `autoInstallPeers: false`, so a host package there becomes a real second copy; `@deepseek-ai/dsh-tools` keys its scheduler with a plain `Symbol`, so **every native tool call throws** in that profile while build, typecheck and coverage stay green. The
|
|
82
|
-
- **Value imports are required peers.** `@deepseek-ai/schemastery` is the host fork (only its `resolve` wraps `.volatile()` fields); `@deepseek-ai/dsh-typert-protocol` provides `TypertRemoteService`, a class to `extends`; shared's `lib/text` value-imports `@deepseek-ai/dsh-output-retention`. Each sits in `peerDependencies` plus the same exact pin in `devDependencies` - missing one is `ERR_MODULE_NOT_FOUND` at load, not a graceful downgrade.
|
|
80
|
+
- **Host `dsh` on the `0.2.1-rc.3` line.** The host reads `engines.dsh` (`^0.2.1-rc.3`) and it **decides alone** - with that field present, compatibility is judged before `peerDependencies` is ever consulted, prereleases included. Any `0.2.x` at or above `0.2.1-rc.3` passes; `0.3.0` and later need the 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.
|
|
81
|
+
- **No `@deepseek-ai/*` under `dependencies`, by contract** (`test/publish-manifest.test.ts`). Profiles install with `nodeLinker: hoisted` and `autoInstallPeers: false`, so a host package there becomes a real second copy; `@deepseek-ai/dsh-tools` keys its scheduler with a plain `Symbol`, so **every native tool call throws** in that profile while build, typecheck and coverage stay green. The `@deepseek-ai/dsh*` peers carry the same support-window range (`^0.2.1-rc.3`), while the exact pins in `devDependencies` are the compile-time discipline against a second host type surface - not a claim the host consults.
|
|
82
|
+
- **Value imports are required peers.** `@deepseek-ai/schemastery` is the host fork (only its `resolve` wraps `.volatile()` fields); `@deepseek-ai/dsh-typert-protocol` provides `TypertRemoteService`, a class to `extends`; `@deepseek-ai/dsh-scope` provides `scopeOf` for the step-admission lookup; shared's `lib/text` value-imports `@deepseek-ai/dsh-output-retention`. Each sits in `peerDependencies` plus the same exact pin in `devDependencies` - missing one is `ERR_MODULE_NOT_FOUND` at load, not a graceful downgrade. `dependencies` holds `@jayyuen66/dsh-plugin-shared` and `zod` (the latter versioned through the umbrella catalog, used by the settings card's strict codecs).
|
|
83
83
|
- **What ships**: `host.js`, `client.js`, `cordis.patch.yml`, `icon.svg`, both READMEs, `CHANGELOG.md`, `THIRD_PARTY_NOTICES.md`. Artifacts are rebuilt by `prepack`, never committed.
|
|
84
84
|
|
|
85
85
|
### <img src="https://api.iconify.design/lucide/arrow-down-to-line.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Shared version floor
|
|
@@ -154,6 +154,7 @@ Output is plain text; timeouts 5 min (search) / 10 min (index) / 60 s (status);
|
|
|
154
154
|
- **What counts as searching**: after quote/comment-aware tokenising of a bash/pwsh command string, grep/egrep/fgrep/rg at a command position, plus the native grep tool. `--help` / `--version`, `echo "grep x"` and commit messages do not.
|
|
155
155
|
- **Quota per "session x index root"**: each successful `zg_search` re-arms `grepBudgetPerSearch` calls valid for `unlockWindowMin` minutes; the index root is the root itself or its nearest indexed ancestor (up to 8 levels up).
|
|
156
156
|
- **Partitioning uses the root session** (walked up `header.parentSession`): the main agent and its subagents **share one quota**. Degradation never throws - a missing parent stops at the last known hop, a cycle stops before the first repeat.
|
|
157
|
+
- **Step admission stands the gate down**: when the host supplies a `toolSet` and this step's view does not admit `zg_search` (a restricted subagent or a conditional-tool step), grep/rg are not blocked - requiring a call this step cannot make is a dead end. Hosts without step admission keep the old criterion.
|
|
157
158
|
- **"Indexed" means `<root>/.zvec-grep/manifest.json` exists *and* parses** with `manifestVersion` strictly 1 and `rootPaths` covering this directory (normalized equality, `/private` prefix stripped on macOS). The directory name alone is not enough - it is also zg's global home (`~/.zvec-grep`), and an existence-only check misreads a truncated or foreign manifest as "indexed", deadlocking both search and the gate.
|
|
158
159
|
- The whitelist and unlock tables live in bounded memory (64 roots / 256 partitions) with touch-on-hit, expiry-then-LRU eviction; whitelist entries carry a one-day validity.
|
|
159
160
|
- `enforceSearchFirst=false` disables only the gate; the confirm and root backstops stay.
|
package/README.zh-CN.md
CHANGED
|
@@ -77,9 +77,9 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
77
77
|
卸载用 `dsh plugin --profile web remove @jayyuen66/dsh-zvec-grep`。包在公共 npm registry 上,不需要凭据,也不需要 scoped-registry 配置行。
|
|
78
78
|
|
|
79
79
|
- **Node.js `>= 22.12`**(纯 ESM;正是这个下限让 `require()` 一枚 ESM 入口成为可能,`engines.node` 因此声明)。
|
|
80
|
-
- **宿主 `dsh` 在 `0.2.1-rc.3` 这条线上。** 宿主读 `engines.dsh`(`^0.2.1-rc.3`)且**单独决定**——该字段在场时兼容性先于 `peerDependencies` 判定,prerelease 参与比较。`0.2.x` 里不低于 `0.2.1-rc.3` 的都通过;`0.3.0` 及以上需要风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <确切版本> --accept-risk
|
|
81
|
-
- **按契约,`dependencies` 下不放任何 `@deepseek-ai/*`**(`test/publish-manifest.test.ts` 钉住)。profile 以 `nodeLinker: hoisted` 与 `autoInstallPeers: false` 安装,宿主包在那里会落成真实的第二份副本;`@deepseek-ai/dsh-tools` 用普通 `Symbol` 给调度器做键,那个 profile
|
|
82
|
-
- **值导入都是必需 peer。** `@deepseek-ai/schemastery` 是宿主 fork(只有它的 `resolve` 认 `.volatile()` 字段);`@deepseek-ai/dsh-typert-protocol` 提供 `TypertRemoteService` 这个要 `extends`
|
|
80
|
+
- **宿主 `dsh` 在 `0.2.1-rc.3` 这条线上。** 宿主读 `engines.dsh`(`^0.2.1-rc.3`)且**单独决定**——该字段在场时兼容性先于 `peerDependencies` 判定,prerelease 参与比较。`0.2.x` 里不低于 `0.2.1-rc.3` 的都通过;`0.3.0` 及以上需要风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <确切版本> --accept-risk`。支持窗口是滚动的:本包在发布时最近的三个已发布宿主版本上逐版取证,窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
|
|
81
|
+
- **按契约,`dependencies` 下不放任何 `@deepseek-ai/*`**(`test/publish-manifest.test.ts` 钉住)。profile 以 `nodeLinker: hoisted` 与 `autoInstallPeers: false` 安装,宿主包在那里会落成真实的第二份副本;`@deepseek-ai/dsh-tools` 用普通 `Symbol` 给调度器做键,那个 profile 里**每一次原生工具调用都抛错**,而构建、类型检查与覆盖率照绿。`@deepseek-ai/dsh*` 的 peer 写同一条支持窗口范围(`^0.2.1-rc.3`),`devDependencies` 里的精确钉版才是防「第二份宿主类型面」的编译期纪律——那不是宿主会去读的声明。
|
|
82
|
+
- **值导入都是必需 peer。** `@deepseek-ai/schemastery` 是宿主 fork(只有它的 `resolve` 认 `.volatile()` 字段);`@deepseek-ai/dsh-typert-protocol` 提供 `TypertRemoteService` 这个要 `extends` 的类;`@deepseek-ai/dsh-scope` 提供步骤准入判定用的 `scopeOf`;shared 的 `lib/text` 自己值导入 `@deepseek-ai/dsh-output-retention`。四者都落 peer 加同版精确钉的 devDependencies——缺一枚就是装载期 `ERR_MODULE_NOT_FOUND`,不是优雅降级。`dependencies` 里是 `@jayyuen66/dsh-plugin-shared` 与 `zod`(后者版本走伞根 catalog,供设置卡的 strict codec 校验)。
|
|
83
83
|
- **随包发什么**:`host.js`、`client.js`、`cordis.patch.yml`、`icon.svg`、两份 README、`CHANGELOG.md`、`THIRD_PARTY_NOTICES.md`。产物由 `prepack` 现产,不入库。
|
|
84
84
|
|
|
85
85
|
### <img src="https://api.iconify.design/lucide/arrow-down-to-line.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> shared 的版本下限
|
|
@@ -154,6 +154,7 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
154
154
|
- **什么算检索**:bash/pwsh 命令串经引号/注释感知切词后,命令位上的 grep/egrep/fgrep/rg 与原生 grep 工具。`--help` / `--version`、`echo "grep x"`、commit message 不算。
|
|
155
155
|
- **配额按「会话 × 索引根」**:每次成功 zg_search 重新武装 grepBudgetPerSearch 次、unlockWindowMin 分钟有效;索引根是 root 自身或含索引的最近祖先(最多上溯 8 层)。
|
|
156
156
|
- **分片用根会话**(沿 `header.parentSession` 上溯到顶):主代理与子代理**共享一份额度**。上溯降级不抛错——查不到父就停在已知的最后一跳,成环就停在首次重复前。
|
|
157
|
+
- **步骤准入让路**:宿主提供 `toolSet` 且本步骤的视图不含 `zg_search` 时(受限子代理或条件工具步骤),grep/rg 不被拦——强迫模型去调一个本步骤调不动的工具是死路。不提供步骤准入的宿主沿用原判据。
|
|
157
158
|
- **「含索引」= `<root>/.zvec-grep/manifest.json` 在盘上,*并且*解析得开**:`manifestVersion` 严格等于 1、`rootPaths` 覆盖该目录(归一相等,macOS 两侧剥 `/private` 前缀)。只判目录名不够——它同时是 zg 的全局 home(`~/.zvec-grep`);只判存在会把半截或外来的清单误判成有索引,把检索与门禁双向堵死。
|
|
158
159
|
- 白名单/解锁表在内存里有界(64 根 / 256 分片),命中即触摸、先过期后 LRU 淘汰;白名单条目带一天有效期。
|
|
159
160
|
- enforceSearchFirst=false 只关门禁;confirm 与 root 兜底照旧。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
- 数据边界:索引与向量库(`.zvec-grep/`、`manifest.json`)由上游读写,本包只判它是否存在、是否覆盖
|
|
20
20
|
目标根,不解析也不改写其内部结构。
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## 编译期与运行期依赖
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
24
|
+
- `@jayyuen66/dsh-plugin-shared`(MIT):同作者的共享工具库,随包从公共 npm 安装。
|
|
25
|
+
- `zod`(MIT):设置卡 `src/rebuild-reader.ts` 的 strict codec 用它校验形状;版本走伞根 catalog,
|
|
26
|
+
client 产物按宿主 `PLATFORM_MODULES` 保持 `require("zod")` 外部化。
|
|
27
|
+
- shared 自己的宿主包 peer(含 `@deepseek-ai/dsh-output-retention`)由 dsh 运行时提供——本包必须把
|
|
28
|
+
这几枚也声明在 peer ∪ dev 上,否则装出去即 `ERR_MODULE_NOT_FOUND`(判据见
|
|
27
29
|
`test/publish-manifest.test.ts`)。
|
|
28
30
|
|
|
29
31
|
## 宿主:dsh 与 `@deepseek-ai/*`
|