@jayyuen66/dsh-zvec-grep 0.1.19 → 0.1.21

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
@@ -2,6 +2,21 @@
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). The deviations below are deliberate: version headings carry no release date (publish times are recorded by the registry — `npm view <package> time`), and a release may add sections beyond the standard six, such as `Not changed, deliberately` and `Earlier`.
4
4
 
5
+ ## 0.1.21
6
+
7
+ 宿主基线切到 `dsh 0.2.3-alpha.2`(Node `^24.22.3 || >=26.13.1`),shared 经 catalog 抬到 `^0.2.13`。root 判据改用会话的活动工作目录(`workingDirectory` 活值优先、服务缺席或无值回落 `header.cwd`),`cd` 之后相对 root 仍按当前目录解析。设置卡随 shared v3 视觉层更新,并新增 `ZgPanelSection` 会话面板段与 roots/server 就绪文案;客户端槽位/清理与路由用例同步。
8
+
9
+ ## 0.1.20
10
+
11
+ 宿主基线抬到 `0.2.2-rc.5`;daemon token 的原子落盘换官方件;上游 zg 0.3.1 的密钥跳过行为对齐。
12
+
13
+ ### Changed
14
+
15
+ - **宿主依赖线抬到 `0.2.2-rc.5`**:devDependencies 全族精确钉 rc.5,`engines.dsh` 与 dsh 家族 peer 同一条窗口;shared 经 catalog 抬到 `^0.2.12`,`pnpm-lock.yaml` 经 `pnpm install --lockfile-only` 重解到 registry 现量;devDependencies 补 `react-dom`(`^19.3.0`,与 react 相邻)——shared 0.2.12 的 card-ui 经 `createPortal` 引 `react-dom`,客户端测试经 ESM 链解析到它(与 danger-guard / dir-prep / session-rescue 的既有供应同形)。两份 README 的支持窗口徽章同步。
16
+ - **`persistToken` 的原子替换换官方 `writeFileAtomic`**(devDependencies 加 `dsh-atomic-write`,peer 同窗口,产物保持裸说明符):`wx` 独占创建保证新建 inode 必带 0600、随机后缀临时件、失败自带临时件清理、win32 对瞬态 rename 错误退避重试。「失败不外抛、返 boolean」的降级契约由本函数这一层保持——官方件抛错,写不进去时本会话仍用内存 token,恢复退化为 daemonStartFailed 的指引(变异验证:摘掉吞错层,失败路径用例当场红)。
17
+ - **上游 zg 0.3.1 的密钥跳过行为对齐**:0.3.0 默认把 binary/unsupported 两类都挡在索引外,0.3.1 实测只跳 `secret.pem`(binary),未知扩展名的 `.P12` 已随正常源码收进索引——插件的排除规则(README 密钥清单,含大小写不敏感的 `*.p12`)回到唯一防线,e2e 用例按 0.3.1 的实测行为改写(两种开关都真建索引、真检索对质)。
18
+ - **rebuild-reader 的 `RemoteHost` / `isRemoteMounter` 收编 shared `./lib/typert-client`**(七仓逐字副本的正主)。
19
+
5
20
  ## 0.1.19
6
21
 
7
22
  将 `@jayyuen66/dsh-plugin-shared` 抬到 `^0.2.10`。设置卡吸底保存条的旧固定 id 冲突与底色随 shared 修复;shared 的 `registerSkill` 在 effect 挂不上时立即撤销注册并回 `false`,本包 skill 不会再在卸载后留在目录里。装载面反转 0.1.14 的内联取舍:`cordis.patch.yml` 显式插入固定 id `dsh-plugin-shared` 的供应行(停用后卡片失去 shared 组件供应),`package.json` 的 `dsh.client.external` 同步声明 `@jayyuen66/dsh-plugin-shared/client`,卡片组件改由 shared 客户端行供应;client bundle 开启 minify,产物 65,390 B → 23,818 B,体积预算按新实量重定。`registerRoutingSkill` 的入参改用 shared 的 `SkillRegistryContext`,让 `effect` 这条撤销权契约进类型。工具面与 grep/rg 门禁行为不变。
package/README.md CHANGED
@@ -11,8 +11,8 @@
11
11
  <a href="https://www.npmjs.com/package/@jayyuen66/dsh-zvec-grep"><img src="https://img.shields.io/npm/d18m/@jayyuen66/dsh-zvec-grep?style=flat-square" alt="npm downloads (total)" /></a>
12
12
  <a href="https://github.com/JayYuen666/dsh-zvec-grep/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-zvec-grep/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%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.2-658EFF?style=flat-square" alt="dsh" />
14
+ <img src="https://img.shields.io/badge/node-%5E24.22.3%7C%7C%3E%3D26.13.1-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.3--alpha.2-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
 
@@ -78,9 +78,9 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
78
78
 
79
79
  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.
80
80
 
81
- - **Node.js `>= 24.9`** (ESM-only; that floor is what makes `require()` of an ESM entry work, hence `engines.node`).
82
- - **Host `dsh` on the `0.2.2-rc.2` line or later.** The host reads `engines.dsh` (`^0.2.2-rc.2`) 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.2-rc.2` passes the host gate; strict npm peer resolution starts at `0.2.2-rc.2`. `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: at publish time this package is checked against every released host version inside the window - the judgement is the host's `--dump-config` layer line for this package, while the settings card and its namespace calls are verified once in full on the release's development baseline - and re-verified once the window moves, so the version number in this bullet is not a standing promise.
83
- - **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.2-rc.2`), while the exact pins in `devDependencies` are the compile-time discipline against a second host type surface - not a claim the host consults.
81
+ - **Node.js `^24.22.3 || >=26.13.1`** (ESM-only; that floor is what makes `require()` of an ESM entry work, hence `engines.node`).
82
+ - **Host `dsh` on the `0.2.3-alpha.2` line or later.** The host reads `engines.dsh` (`^0.2.3-alpha.2`) 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.3-alpha.2` passes the host gate; strict npm peer resolution starts at `0.2.3-alpha.2`. `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: at publish time this package is checked against every released host version inside the window - the judgement is the host's `--dump-config` layer line for this package, while the settings card and its namespace calls are verified once in full on the release's development baseline - and re-verified once the window moves, so the version number in this bullet is not a standing promise.
83
+ - **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.3-alpha.2`), while the exact pins in `devDependencies` are the compile-time discipline against a second host type surface - not a claim the host consults.
84
84
  - **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).
85
85
  - **What ships**: `host.js`, `client.js`, `cordis.patch.yml`, `icon.svg`, both READMEs, `CHANGELOG.md`, `THIRD_PARTY_NOTICES.md`, `locale/zh.json` + `locale/en.json`, and `docs/` (both DETAIL files). Artifacts are rebuilt by `prepack`, never committed.
86
86
 
@@ -117,7 +117,7 @@ If your profile pins `@jayyuen66/dsh-plugin-shared` with a pnpm `overrides` entr
117
117
 
118
118
  ## <img src="https://api.iconify.design/lucide/search.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> Tools exposed to the model
119
119
 
120
- Output is plain text; timeouts 5 min (search) / 10 min (index) / 60 s (status); stdout capped at 400000 bytes, truncated to the tail with a note. Sandbox runner failure, policy denial and a genuine zg failure are told apart; incomplete results are flagged. A `root` must be a string, and the constructed command is capped in UTF-8 bytes (not code units): a non-string root or an over-long command is refused instead of falling back to the session workspace or hitting the OS argument limit. A `limit` outside 1-50 is refused the same way, naming the allowed range - a silently clamped count would read as the truth about this search; omit it for the default.
120
+ Output is plain text; timeouts 5 min (search) / 10 min (index) / 60 s (status); stdout capped at 400000 bytes, truncated to the tail with a note. Sandbox runner failure, policy denial and a genuine zg failure are told apart; incomplete results are flagged. A `root` must be a string, and the constructed command is capped in UTF-8 bytes (not code units): a non-string root or an over-long command is refused instead of falling back to the session's working directory or hitting the OS argument limit. A `limit` outside 1-50 is refused the same way, naming the allowed range - a silently clamped count would read as the truth about this search; omit it for the default.
121
121
 
122
122
  ### zg_search
123
123
 
@@ -149,8 +149,8 @@ Output is plain text; timeouts 5 min (search) / 10 min (index) / 60 s (status);
149
149
 
150
150
  ### Root rules
151
151
 
152
- - `root` is optional in all three tools (defaults to the session workspace). Validation: absolute path starting with `/`, lexically normalised; empty/non-string/NUL/relative/escaping `..` and `/` itself are refused; a missing directory is reported as such, not as a spawn ENOENT.
153
- - A root outside the session workspace passes only via the "ancestor or descendant" branch of the shared predicate (`judgeRoot`), and every accepted root is registered in the observed-workspace whitelist the card's rebuild draws on. Guard and execute share the predicate - nothing is refused twice with different wording.
152
+ - `root` is optional in all three tools (defaults to the session's active working directory — the live `workingDirectory` when the host service provides one, `header.cwd` otherwise; after a `cd`, a relative root still resolves against the current directory). Validation: absolute path starting with `/`, lexically normalised; empty/non-string/NUL/relative/escaping `..` and `/` itself are refused; a missing directory is reported as such, not as a spawn ENOENT.
153
+ - A root outside the session's active working directory passes only via the "ancestor or descendant" branch of the shared predicate (`judgeRoot`), and every accepted root is registered in the observed-workspace whitelist the card's rebuild draws on. Guard and execute share the predicate - nothing is refused twice with different wording.
154
154
 
155
155
  ## <img src="https://api.iconify.design/lucide/ban.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> The search-first gate
156
156
 
package/README.zh-CN.md CHANGED
@@ -11,8 +11,8 @@
11
11
  <a href="https://www.npmjs.com/package/@jayyuen66/dsh-zvec-grep"><img src="https://img.shields.io/npm/d18m/@jayyuen66/dsh-zvec-grep?style=flat-square" alt="npm downloads (total)" /></a>
12
12
  <a href="https://github.com/JayYuen666/dsh-zvec-grep/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayYuen666/dsh-zvec-grep/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%3D24.9-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
- <img src="https://img.shields.io/badge/dsh-%5E0.2.2--rc.2-658EFF?style=flat-square" alt="dsh" />
14
+ <img src="https://img.shields.io/badge/node-%5E24.22.3%7C%7C%3E%3D26.13.1-4c1?style=flat-square&logo=nodedotjs&logoColor=white" alt="node" />
15
+ <img src="https://img.shields.io/badge/dsh-%5E0.2.3--alpha.2-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
 
@@ -78,9 +78,9 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
78
78
 
79
79
  卸载用 `dsh plugin --profile web remove @jayyuen66/dsh-zvec-grep`。包在公共 npm registry 上,不需要凭据,也不需要 scoped-registry 配置行。
80
80
 
81
- - **Node.js `>= 24.9`**(纯 ESM;正是这个下限让 `require()` 一枚 ESM 入口成为可能,`engines.node` 因此声明)。
82
- - **宿主 `dsh` 在 `0.2.2-rc.2` 或更新的 `0.2.2` 这条线上。** 宿主读 `engines.dsh`(`^0.2.2-rc.2`)且**单独决定**——该字段在场时兼容性先于 `peerDependencies` 判定,prerelease 参与比较。`0.2.x` 里不低于 `0.2.2-rc.2` 的都通过宿主装载门;npm 的严格 peer 解析从 `0.2.2-rc.2` 起算。`0.3.0` 及以上需要风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <确切版本> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证(判据是宿主 `--dump-config` 里本包的层行;设置卡与它的命名空间调用另在发布基线上全量取证一次),窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
83
- - **按约定,`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.2-rc.2`),`devDependencies` 里的精确钉版才是防「第二份宿主类型」的编译期纪律——那不是宿主会去读的声明。
81
+ - **Node.js `^24.22.3 || >=26.13.1`**(纯 ESM;正是这个下限让 `require()` 一枚 ESM 入口成为可能,`engines.node` 因此声明)。
82
+ - **宿主 `dsh` 在 `0.2.3-alpha.2` 这条线上(含更晚的 `0.2.x`)。** 宿主读 `engines.dsh`(`^0.2.3-alpha.2`)且**单独决定**——该字段在场时兼容性先于 `peerDependencies` 判定,prerelease 参与比较。`0.2.x` 里不低于 `0.2.3-alpha.2` 的都通过宿主装载门;npm 的严格 peer 解析从 `0.2.3-alpha.2` 起算。`0.3.0` 及以上需要风险授权 `dsh plugin --profile <p> allow-version <pkg>@<ver> --dsh-version <确切版本> --accept-risk`。支持窗口是滚动的:本包在发布时把窗口内的每个已发布宿主版本逐版取证(判据是宿主 `--dump-config` 里本包的层行;设置卡与它的命名空间调用另在发布基线上全量取证一次),窗口滚动后重新取证,不把这一句里的版本号当长期承诺。
83
+ - **按约定,`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.3-alpha.2`),`devDependencies` 里的精确钉版才是防「第二份宿主类型」的编译期纪律——那不是宿主会去读的声明。
84
84
  - **值导入都是必需 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 校验)。
85
85
  - **随包发什么**:`host.js`、`client.js`、`cordis.patch.yml`、`icon.svg`、两份 README、`CHANGELOG.md`、`THIRD_PARTY_NOTICES.md`、`locale/zh.json` + `locale/en.json`、`docs/`(两份 DETAIL)。产物由 `prepack` 现产,不入库。
86
86
 
@@ -117,7 +117,7 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
117
117
 
118
118
  ## <img src="https://api.iconify.design/lucide/search.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> 提供给模型的工具
119
119
 
120
- 输出为纯文本;超时 5 分钟(search)/ 10 分钟(index)/ 60 秒(status);stdout 上限 400000 字节,超限截尾并提示。沙箱 runner 失败、策略拒绝与 zg 自身失败分开归因;结果可能不完整时显式打标。`root` 必须是字符串,构造出的命令按 UTF-8 字节(不是码元)封顶:非字符串的 root 与超长命令直接拒绝,不会回落到会话工作区,也不会撞上内核参数上限。`limit` 越出 1-50 同样直接拒绝并点名区间,不会静默钳制——钳过的少结果会被模型当成这次检索的事实;省略则用默认值。
120
+ 输出为纯文本;超时 5 分钟(search)/ 10 分钟(index)/ 60 秒(status);stdout 上限 400000 字节,超限截尾并提示。沙箱 runner 失败、策略拒绝与 zg 自身失败分开归因;结果可能不完整时显式打标。`root` 必须是字符串,构造出的命令按 UTF-8 字节(不是码元)封顶:非字符串的 root 与超长命令直接拒绝,不会回落到会话的工作目录,也不会撞上内核参数上限。`limit` 越出 1-50 同样直接拒绝并点名区间,不会静默钳制——钳过的少结果会被模型当成这次检索的事实;省略则用默认值。
121
121
 
122
122
  ### zg_search
123
123
 
@@ -149,8 +149,8 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
149
149
 
150
150
  ### root 判据
151
151
 
152
- - 三者的 root 都可省略(缺省=当前会话工作区)。校验:以 `/` 开头的绝对路径、词典归一;空串/非字符串/NUL/相对路径/越界的 `..`、归一后为 `/` 都拒;目录不存在单报「root 目录不存在」,不冒成 spawn ENOENT。
153
- - 会话工作区之外的 root 只有走共享判据(`judgeRoot`)的「祖先/后代」分支才放行,且每个过判据的 root 都登记进卡片重建所用的观测白名单。guard 与 execute 同一套判据——不会同一件事拒两遍、说法还不同。
152
+ - 三者的 root 都可省略(缺省=会话的活动工作目录:宿主服务在场且给出活值时用它,否则回落 `header.cwd`;`cd` 之后相对 root 仍按当前目录解析)。校验:以 `/` 开头的绝对路径、词典归一;空串/非字符串/NUL/相对路径/越界的 `..`、归一后为 `/` 都拒;目录不存在单报「root 目录不存在」,不冒成 spawn ENOENT。
153
+ - 会话活动工作目录之外的 root 只有走共享判据(`judgeRoot`)的「祖先/后代」分支才放行,且每个过判据的 root 都登记进卡片重建所用的观测白名单。guard 与 execute 同一套判据——不会同一件事拒两遍、说法还不同。
154
154
 
155
155
  ## <img src="https://api.iconify.design/lucide/ban.svg?color=%23658EFF&height=22" height="22" width="22" align="absmiddle" alt="" /> search-first 门禁
156
156
 
package/client.js CHANGED
@@ -5,9 +5,7 @@ window.__ModuleLoader__.load({
5
5
  'use strict';
6
6
  const module = { exports: {} };
7
7
  let exports = module.exports;
8
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("zod"),n=require("@jayyuen66/dsh-plugin-shared/client");const r=`transformers-js`,i=Object.freeze([{reference:`local/qwen3-embedding-0.6b`,backend:`llama-cpp`,dimension:1024},{reference:`local/embeddinggemma-300m`,backend:`llama-cpp`,dimension:768},{reference:`local/potion-code-16m-v2`,backend:`model2vec`,dimension:256},{reference:`local/potion-multilingual-128m`,backend:`model2vec`,dimension:256},{reference:`local/potion-retrieval-32m`,backend:`model2vec`,dimension:512},{reference:`local/bge-small-en-v1.5`,backend:r,dimension:384},{reference:`local/all-minilm-l6-v2`,backend:r,dimension:384},{reference:`local/multilingual-e5-small`,backend:r,dimension:384},{reference:`local/jina-embeddings-v2-base-code`,backend:r,dimension:768},{reference:`local/gte-modernbert-base`,backend:r,dimension:768},{reference:`local/nomic-embed-text-v1.5`,backend:r,dimension:768}].map(e=>Object.freeze(e))),a=Object.freeze([{reference:`qwen/qwen3-vl-embedding`,dimension:2560},{reference:`qwen/qwen3.7-text-embedding`,dimension:1024},{reference:`qwen/text-embedding-v4`,dimension:1024}].map(e=>Object.freeze(e)));function o(e,t){return Object.hasOwn(e,t)}function s(e,t,n){return o(e,n)?e[n]:Object.hasOwn(t,n)?t[n]:void 0}function c(e,t){return typeof e==`number`&&Number.isFinite(e)?String(e):t}function l(e){let t;return e===!0?t=`daemonReadyNote`:e===!1&&(t=`daemonOfflineNote`),t}function u(e){let t={status:`loading`,writable:!1,value:{}},n=null,r=t;return{getSnapshot(){let t=e.getSnapshot();return t!==n&&(n=t,r={status:t.status,writable:t.writable,value:t.value??{}}),r},subscribe(t){return e.subscribe(t)}}}function d(e,t,n,r){let i=s(e,t,n);return i===void 0?o(e,n)?``:r:c(i,r)}const f=t.z.url({protocol:/^https?$/u});function p(e,t){if(Object.hasOwn(e,`hfEndpoint`)){let t=e.hfEndpoint;return typeof t==`string`?t:``}let n=t.hfEndpoint;return typeof n==`string`&&f.safeParse(n).success?n:``}function m(e,t){let n=s(e,t,`defaultEmbedding`),r=s(e,t,`enforceSearchFirst`),i=s(e,t,`transport`);return{embedding:typeof n==`string`&&n.length>0?n:`local/qwen3-embedding-0.6b`,limitDisplay:d(e,t,`defaultLimit`,`10`),hfEndpoint:p(e,t),enforceSearchFirst:r!==!1,grepBudget:d(e,t,`grepBudgetPerSearch`,`3`),unlockWindow:d(e,t,`unlockWindowMin`,`10`),transport:i===`cli`||i===`mcp`||i===`auto`?i:`auto`}}const h=t.z.int().min(1).max(50),g=t.z.int().min(1).max(20),_=t.z.int().min(1).max(240),v=[`running`,`stopping`,`completed`,`killed`,`failed`],y=t.z.object({status:t.z.preprocess(e=>typeof e==`string`&&v.some(t=>t===e)?e:void 0,t.z.enum(v).optional()),exitCode:t.z.preprocess(e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,t.z.number().optional()),output:t.z.preprocess(e=>typeof e==`string`?e:void 0,t.z.string().optional())});function b(e,t){let n=y.safeParse(e),{status:r,exitCode:i,output:a}=n.success?n.data:{},o=a??``;if(r===`running`||r===`stopping`)return{phase:`running`,output:o.length>0?o:t(`rebuildRunning`)};if(r===`completed`&&i===0)return{phase:`done`,output:o};let s;return s=r===`killed`?t(`rebuildKilled`):r===`failed`?t(`rebuildFailed`):typeof i==`number`&&Number.isFinite(i)?t(`rebuildExitCode`,{exitCode:i}):t(`rebuildExitUnknown`),{phase:`error`,output:o.length>0?`${s}\n${o}`:s}}const x=`zvecGrepRebuild`,S=`remote.${x}`,C=`@jayyuen66/dsh-zvec-grep`;function w(e,n){let r=e.safeParse(n);if(!r.success)throw TypeError(t.z.prettifyError(r.error));return r.data}const T=t.z.object({root:t.z.string({error:`rebuild request requires a string root`}).trim().min(1,{error:`rebuild request requires a non-empty root`})},{error:`rebuild request requires a string root`}),E=t.z.object({jobId:t.z.string({error:`rebuild status request requires a string jobId`}).trim().min(1,{error:`rebuild status request requires a non-empty jobId`})},{error:`rebuild status request requires a string jobId`}),D=[{id:`${C}#${x}/roots`,service:x,namespace:x,method:`roots`,invocation:{kind:`direct`},parameters:[],result:{mode:`src-json`}},{id:`${C}#${x}/rebuild`,service:x,namespace:x,method:`rebuild`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${C}#rebuild-request`,create:()=>({parse(e){return w(T,e)}})}}],result:{mode:`src-json`}},{id:`${C}#${x}/status`,service:x,namespace:x,method:`status`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${C}#rebuild-status-request`,create:()=>({parse(e){return w(E,e)}})}}],result:{mode:`src-json`}}],O=e=>(0,n.isRecord)(e)&&typeof e.$mount==`function`,ee=e=>(0,n.isRecord)(e)&&typeof e.roots==`function`&&typeof e.rebuild==`function`&&typeof e.status==`function`;async function k(e){let t=await e;if(t.ok)return t.value;throw Error(`${t.error.code}: ${t.error.message}`)}function A(e,t){let n,r=async()=>{let r=e.get?.(`remote`);if(!O(r))throw Error(t.remoteMissing());try{n??=r.$mount({package:C,descriptors:D}),await n}catch(e){throw n=void 0,e}let i=e.get?.(S);if(!ee(i))throw Error(t.namespaceMissing(S));return i};return{async roots(){return k((await r()).roots())},async rebuild(e){let t=await k((await r()).rebuild({root:e}));if(t.ok)return t;throw Error(t.error)},async status(e){let t=await k((await r()).status({jobId:e}));if(t.ok)return{...t};throw Error(t.error)}}}function j(e,t){return typeof e.get==`function`?A(e,t):void 0}const M=`https://modelscope.cn/models`,N={zh:{statusReadOnly:`当前作用域只读`,statusClean:`无未保存的修改`,dirtyCount:`已修改 {count} 项`,save:`保存`,saving:`保存中…`,revert:`撤销`,saveFailed:`保存失败:{reason}`,invalidFields:`有字段超出范围,先修正或撤销后再保存。`,saveRejected:`保存被宿主拒绝(配置校验未通过或写入被跳过),修改未生效`,modelSection:`检索模型`,indexSection:`网络与索引`,unitResults:`条`,unitTimes:`次`,unitMinutes:`分钟`,outOfRange:`超出允许范围,未保存`,embeddingLabel:`默认 embedding`,embeddingHint:`本地模型直接可选;远程 qwen 模型需在插件部署配置里打开 allowRemoteEmbedding(内容会送往外部端点,首次索引需 zg --auth grant 授权)。只影响「新建」索引;切换并保存后,已有索引需点下方「重建」重新 embedding`,transportLabel:`检索传输方式`,transportHint:`自动 = 守护进程在跑时检索走 MCP(常驻模型池、队列调度),否则走 CLI;仅 CLI = 永不碰守护进程;仅 MCP = 检索恒走守护进程,缺席时由插件自动拉起(会开 127.0.0.1:7999 回环端口;拉起失败会明确报错而不是回退 CLI)`,transportAuto:`自动(守护进程在跑走 MCP,否则 CLI)`,transportCli:`仅 CLI(每次 spawn zg 进程)`,transportMcp:`仅 MCP(走守护进程,缺席自动拉起)`,backendRemote:`qwen 远程(内容出本机,需部署开放并授权)`,limitLabel:`默认每组结果数`,limitInvalid:`请输入 {min}-{max} 的整数`,limitClamped:`已钳到 {min}-{max} 范围:{value}`,endpointLabel:`HuggingFace 镜像地址`,endpointHint:`留空走 huggingface.co;国内网络可填 ${M} 等兼容镜像(仅 llama-cpp 后端生效,如 qwen3)`,enforceLabel:`强制 search-first(先 zg_search 再 grep/rg)`,enforceHint:`开启后,已建索引工作区内的 grep/rg 受配额门禁约束:每次成功 zg_search 解锁下方次数的 grep/rg(时效见下),用尽或过期后再次拦截(提高检索覆盖与准确性)`,budgetLabel:`每次 zg_search 解锁的 grep/rg 次数`,budgetHint:`配额越小语义检索越频繁、准确性约束越强;清空恢复默认 {default}`,windowLabel:`解锁时效`,windowHint:`超过该时长未再次 zg_search,配额整体过期;清空恢复默认 {default}(单位:分钟)`,rebuildLabel:`工作区重建(切换 embedding 并保存后执行)`,rebuildInputPlaceholder:`/workspace 的绝对路径`,daemonReadyNote:`守护进程:就绪(zg --server 在跑)。`,daemonOfflineNote:"守护进程:未就绪。守护进程提供的索引增量刷新、refresh=background 与常驻模型池在缺席时都不可用;需要时在终端执行 `zg --server on`。",rebuildHint:`以当前默认模型重建:{embedding};等价于 zg --index --rebuild。{roots}`,rootsNoteWith:`候选工作区来自本 daemon 已打开过的会话(服务端白名单)。`,rootsNoteEmpty:`尚无可选工作区:先在该工作区里开一个会话(任一次工具调用即登记)。`,rebuildButton:`重建索引(动作,点击即执行)`,rebuildRunning:`重建中…`,rebuildDone:`重建完成`,rebuildStarting:`正在后台重建索引…(首次会下载 embedding 模型,可能较慢)`,rebuildKilled:`重建进程被终止`,rebuildFailed:`重建作业被宿主注册表判定失败(没拿到进程退出码)`,rebuildExitCode:`重建进程退出码 {exitCode}(zg 未安装/权限不足/沙箱拒绝都会走到这里)`,rebuildExitUnknown:`重建没有可判定的结果(应答的 status 无法识别,或缺少进程退出码)`,rebuildMissingJobId:`启动重建失败:应答缺 jobId`,rebuildRootNotAbsolute:`root 必须是绝对路径(以 / 开头)`,rebuildUnavailable:`宿主没有提供工作区重建读面(未装远程服务)`,rebuildRemoteMissing:`工作区重建读面不可用:宿主网关没有提供 remote 服务`,rebuildNamespaceMissing:`{serviceKey} 未提供:宿主网关没有挂上这枚命名空间`,modelOption:`{reference}({dimension}维)`,backendLlamaCpp:`llama-cpp(原生,需 node-llama-cpp)`,backendTransformersJs:`transformers-js(纯 JS ONNX)`,backendModel2Vec:`model2vec(纯 JS worker,最轻)`},en:{statusReadOnly:`This scope is read-only`,statusClean:`No unsaved changes`,dirtyCount:`{count} changed`,save:`Save`,saving:`Saving…`,revert:`Revert`,saveFailed:`save failed: {reason}`,invalidFields:`Some fields are out of range; fix them or revert before saving.`,saveRejected:`save rejected by host (validation failed or write skipped) — changes not applied`,modelSection:`Retrieval model`,indexSection:`Network and index`,unitResults:`hits`,unitTimes:`times`,unitMinutes:`minutes`,outOfRange:`Out of the allowed range — not saved`,embeddingLabel:`Default embedding`,embeddingHint:`Local models are always selectable; the remote qwen models additionally require allowRemoteEmbedding in the deployment config (content leaves the machine, and the first index build needs a zg --auth grant). Affects newly built indexes only; after switching and saving, press Rebuild below to re-embed existing indexes`,transportLabel:`Search transport`,transportHint:`auto = searches go through the daemon (MCP) when it is running, CLI otherwise; CLI-only = never touch the daemon; MCP-only = searches always go through the daemon, auto-starting it when absent (opens the 127.0.0.1:7999 loopback port; a failed start is reported explicitly, never silently downgraded to CLI)`,transportAuto:`auto (daemon → MCP, otherwise CLI)`,transportCli:`CLI only (spawn zg each call)`,transportMcp:`MCP only (via daemon, auto-started when absent)`,backendRemote:`qwen remote (content leaves the machine; needs the deployment switch + grant)`,limitLabel:`Default hits per group`,limitInvalid:`enter an integer between {min} and {max}`,limitClamped:`clamped into the {min}-{max} range: {value}`,endpointLabel:`HuggingFace mirror URL`,endpointHint:`Leave empty for huggingface.co; on networks that cannot reach HF, fill a compatible mirror such as ${M} (llama-cpp backends only, e.g. qwen3)`,enforceLabel:`Enforce search-first (zg_search before grep/rg)`,enforceHint:`When on, grep/rg inside indexed workspaces is quota-gated: each successful zg_search unlocks the number of grep/rg calls below (valid for the window below), and the gate blocks again once it is spent or expired (better coverage and relevance)`,budgetLabel:`grep/rg calls unlocked per zg_search`,budgetHint:`A smaller quota means more semantic searches and a stronger relevance constraint; clear to restore the default {default}`,windowLabel:`Unlock window`,windowHint:`Without another zg_search inside this window the whole quota expires; clear to restore the default {default} (minutes)`,rebuildLabel:`Workspace rebuild (run after switching embedding and saving)`,rebuildInputPlaceholder:`absolute path to a /workspace`,daemonReadyNote:`Daemon: ready (zg --server is running).`,daemonOfflineNote:"Daemon: not ready. What the daemon provides — incremental index refresh, refresh=background and the resident embedding model pool — is unavailable while it is absent; run `zg --server on` in a terminal when you want it.",rebuildHint:`Rebuild with the current default model: {embedding}; same as zg --index --rebuild. {roots}`,rootsNoteWith:`Candidates come from sessions this daemon already opened (server-side whitelist).`,rootsNoteEmpty:`No workspace to pick yet: open a session in that workspace first (any tool call registers it).`,rebuildButton:`Rebuild index (action, runs on click)`,rebuildRunning:`rebuilding…`,rebuildDone:`rebuild finished`,rebuildStarting:`Rebuilding in the background… (the first run downloads the embedding model and may be slow)`,rebuildKilled:`the rebuild process was terminated`,rebuildFailed:`the host job registry reported the rebuild as failed (no process exit code)`,rebuildExitCode:`the rebuild process exited with code {exitCode} (missing zg, insufficient permissions and sandbox denials all land here)`,rebuildExitUnknown:`the rebuild has no determinable outcome (the response status is unrecognized, or its exit code is missing)`,rebuildMissingJobId:`failed to start the rebuild: the response has no jobId`,rebuildRootNotAbsolute:`root must be an absolute path (starting with /)`,rebuildUnavailable:`the host does not expose the rebuild Remote API`,rebuildRemoteMissing:`the rebuild Remote API is unavailable: the host gateway provides no remote service`,rebuildNamespaceMissing:`{serviceKey} was not provided: the host gateway did not mount this namespace`,modelOption:`{reference} ({dimension} dims)`,backendLlamaCpp:`llama-cpp (native, requires node-llama-cpp)`,backendTransformersJs:`transformers-js (pure JS ONNX)`,backendModel2Vec:`model2vec (pure JS worker, lightest)`}},P=String.fromCodePoint(92),te=/^[A-Za-z]:[\\/]/u,F=`zvec-grep`,I=[`llama-cpp`,`transformers-js`,`model2vec`],L=`zgc-rebuild-root-options`,R={"llama-cpp":`backendLlamaCpp`,"transformers-js":`backendTransformersJs`,model2vec:`backendModel2Vec`};function z(e){return e.value}function B(e,t,n){return e(`modelOption`,{reference:t,dimension:n})}function V(e,t,n){return e(`rebuildHint`,{embedding:t,roots:e(n?`rootsNoteWith`:`rootsNoteEmpty`)})}function H(e){let t=[];for(let n of I)for(let r of i)r.backend===n&&t.push({value:r.reference,label:B(e,r.reference,r.dimension),group:e(R[n])});for(let n of a)t.push({value:n.reference,label:B(e,n.reference,n.dimension),group:e(`backendRemote`)});return t}const U=[{value:`auto`},{value:`cli`},{value:`mcp`}],W={auto:`transportAuto`,cli:`transportCli`,mcp:`transportMcp`};function G(e){return U.map(t=>({value:t.value,label:e(W[t.value])}))}function K(e,t){let n=t.safeParse(e===``?NaN:Number(e));return n.success?n.data:void 0}function q(t){let{editable:r,fields:i,setField:a,t:o}=t,s=(0,e.createElement)(n.SelectField,{label:o(`embeddingLabel`),...(0,n.splitHint)(o(`embeddingHint`)),field:`defaultEmbedding`,value:i.embedding,options:H(o),disabled:!r,onChange:e=>{a(`defaultEmbedding`,e)}}),c=(0,e.createElement)(n.NumberField,{label:o(`limitLabel`),hint:o(`limitInvalid`,{min:1,max:50}),field:`defaultLimit`,value:K(i.limitDisplay,h),min:h.minValue??1,max:h.maxValue??50,step:1,unit:o(`unitResults`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`defaultLimit`,e)},onChange:e=>{a(`defaultLimit`,e)}});return(0,e.createElement)(n.Section,{title:o(`modelSection`)},s,c)}function J(t){let{fields:r,rebuild:i,root:a,roots:o,setRoot:s,t:c}=t,l=o.map(t=>(0,e.createElement)(`option`,{key:t,value:t})),u=(0,e.createElement)(`datalist`,{id:L},...l),d=(0,e.createElement)(`input`,{className:`dsu-input zgc-rebuildInput`,value:a,list:L,placeholder:c(`rebuildInputPlaceholder`),onChange:e=>{s(e.target.value)}}),f=(0,e.createElement)(`button`,{type:`button`,className:`dsu-btn`,"data-field":`rebuild`,disabled:i.phase===`running`,onClick:t.onRebuild},i.phase===`running`?c(`rebuildRunning`):c(`rebuildButton`));return(0,e.createElement)(n.Field,{label:c(`rebuildLabel`),...(0,n.splitHint)(V(c,r.embedding,o.length>0)),wide:!0},u,d,f)}function Y(t){let{t:n}=t,r=l(t.serverReady);return r===void 0?null:(0,e.createElement)(`p`,{className:`dsu-hint`},n(r))}function X(t){let{rebuild:n,t:r}=t;if(n.phase===`idle`)return null;let i=n.phase===`error`?`zgc-error`:`zgc-output`,a;return a=n.output===``?n.phase===`done`?r(`rebuildDone`):``:n.output,(0,e.createElement)(`div`,{className:i},a)}function Z(t){let{editable:r,fields:i,setField:a,t:o}=t,s=(0,e.createElement)(n.SelectField,{label:o(`transportLabel`),...(0,n.splitHint)(o(`transportHint`)),field:`transport`,value:i.transport,options:G(o),disabled:!r,onChange:e=>{a(`transport`,e)}}),c=(0,e.createElement)(n.TextField,{label:o(`endpointLabel`),...(0,n.splitHint)(o(`endpointHint`)),field:`hfEndpoint`,value:i.hfEndpoint,placeholder:M,monospace:!0,disabled:!r,onChange:e=>{a(`hfEndpoint`,e.trim()===``?void 0:e.trim())}}),l=(0,e.createElement)(n.ToggleField,{label:o(`enforceLabel`),...(0,n.splitHint)(o(`enforceHint`)),field:`enforceSearchFirst`,checked:i.enforceSearchFirst,disabled:!r,onChange:e=>{a(`enforceSearchFirst`,e)}}),u=(0,e.createElement)(n.NumberField,{label:o(`budgetLabel`),...(0,n.splitHint)(o(`budgetHint`,{default:3})),field:`grepBudgetPerSearch`,value:K(i.grepBudget,g),min:g.minValue??1,max:g.maxValue??20,step:1,unit:o(`unitTimes`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`grepBudgetPerSearch`,e)},onChange:e=>{a(`grepBudgetPerSearch`,e)}}),d=(0,e.createElement)(n.NumberField,{label:o(`windowLabel`),...(0,n.splitHint)(o(`windowHint`,{default:10})),field:`unlockWindowMin`,value:K(i.unlockWindow,_),min:_.minValue??1,max:_.maxValue??240,step:1,unit:o(`unitMinutes`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`unlockWindowMin`,e)},onChange:e=>{a(`unlockWindowMin`,e)}});return(0,e.createElement)(n.Section,{title:o(`indexSection`)},s,c,l,u,d,Y(t),J(t),X(t))}function ne(t){let{t:r}=t,i=(0,e.createElement)(n.SaveBar,{dirty:t.dirty,blocked:t.blocked,busy:t.busy,writable:t.writable,error:t.saveError??(t.blocked?r(`invalidFields`):null),saveLabel:r(`save`),savingLabel:r(`saving`),revertLabel:r(`revert`),dirtyLabel:r(`dirtyCount`,{count:t.dirtyCount}),cleanLabel:r(`statusClean`),readOnlyLabel:r(`statusReadOnly`),onSave:t.onSave,onDiscard:t.onDiscard});return(0,e.createElement)(n.CardForm,null,q(t),Z(t),i)}function re(e,t,n,r){t===`defaultEmbedding`?e.push(r(`defaultEmbedding`,n)):t===`defaultLimit`?e.push(r(`defaultLimit`,n)):t===`hfEndpoint`?e.push(r(`hfEndpoint`,n)):t===`enforceSearchFirst`?e.push(r(`enforceSearchFirst`,n)):t===`grepBudgetPerSearch`?e.push(r(`grepBudgetPerSearch`,n)):t===`unlockWindowMin`?e.push(r(`unlockWindowMin`,n)):t===`transport`&&e.push(r(`transport`,n))}function Q(e,t){if(e===void 0)throw Error(t(`rebuildUnavailable`));return e}const $={roots:[],serverReady:void 0};function ie(r,i){let[a,o]=(0,e.useState)(``),[s,c]=(0,e.useState)($),[l,u]=(0,e.useState)({phase:`idle`,output:``}),d=(0,e.useRef)(null),f=(0,e.useRef)(!1),p=(0,e.useRef)(null),m=(0,e.useRef)(!0),h=()=>m.current;function g(){p.current=null,d.current!==null&&(clearInterval(d.current),d.current=null)}(0,e.useEffect)(()=>(m.current=!0,()=>{m.current=!1,g()}),[]);let _=(0,e.useCallback)(async()=>{let e=await Q(i,r).roots(),t={roots:[...e.roots],serverReady:e.serverReady};return c(t),t},[i,r]);(0,e.useEffect)(()=>{(async()=>{try{await _()}catch{c($)}})()},[_]);async function v(e){if(!f.current&&h()&&p.current===e){f.current=!0;try{let t=await Q(i,r).status(e);if(!h()||p.current!==e)return;let n=b(t,r);n.phase!==`running`&&g(),u({phase:n.phase,output:n.output})}catch(t){if(!h()||p.current!==e)return;g(),u({phase:`error`,output:(0,n.errorText)(t)})}finally{f.current=!1}}}async function y(){let e=await Q(i,r).rebuild(a.trim()),n=t.z.object({jobId:t.z.string()}).safeParse(e);if(!n.success)throw TypeError(r(`rebuildMissingJobId`));let{jobId:o}=n.data;p.current=o,d.current=setInterval(()=>{v(o)},2e3)}async function x(){let e=a.trim();if(!(e.startsWith(`/`)||te.test(e)||e.startsWith(P+P)))u({phase:`error`,output:r(`rebuildRootNotAbsolute`)});else{g(),u({phase:`running`,output:r(`rebuildStarting`)});try{await y()}catch(e){g(),u({phase:`error`,output:(0,n.errorText)(e)})}}}return{root:a,roots:s.roots,serverReady:s.serverReady,state:l,setRoot:o,start:x}}function ae(t){let{t:r}=t,i=t.useCard(e=>e),{status:a,writable:o}=i,s=a===`ready`&&o,c=z(i),[l,u]=(0,e.useState)({}),[d,f]=(0,e.useState)(!1),[p,h]=(0,e.useState)(null),g=ie(r,t.rebuildRemote),_=m(l,c),v=(0,n.useInvalidFields)(),{blocked:y,fields:b,resetToken:x,reportInvalid:S}=v,C=new Set([...(0,n.diffTouched)(l,c),...b]).size,w=C>0||y,T=(e,t)=>{u(n=>({...n,[e]:t}))},E=async()=>{let e=(0,n.diffTouched)(l,c);if(e.length===0||y)return;f(!0),h(null);let i=[];for(let n of e){let e=l[n];e===void 0?i.push(t.unset(n)):re(i,n,e,t.set)}try{if((await Promise.all(i)).some(e=>!e)){f(!1),h(r(`saveRejected`));return}}catch(e){f(!1),h(r(`saveFailed`,{reason:(0,n.errorText)(e)}));return}let a=new Set(e),o=Object.fromEntries(Object.entries(l).filter(([e])=>!a.has(e)));f(!1),u(o),v.clear()};return ne({t:r,fields:_,writable:s,editable:s&&!d,roots:g.roots,serverReady:g.serverReady,root:g.root,rebuild:g.state,dirty:w,blocked:y,resetToken:x,reportInvalid:S,dirtyCount:C,busy:d,saveError:p,setField:T,setRoot:g.setRoot,onSave:()=>{E()},onDiscard:()=>{u({}),h(null),v.clear()},onRebuild:()=>{g.start()}})}const oe=[`slots`,`configForms`,`locale`];function se(e){e.effect(()=>{let e=(0,n.ensureCardUiCss)(),t=document.createElement(`style`);return t.id=`zvec-grep-card-css`,t.textContent=`.zgc-rebuildInput{flex:1 1 240px;min-width:0}
9
- .zgc-output{font-size:12px;line-height:1.6;color:var(--dsw-alias-label-secondary,inherit);white-space:pre-wrap;word-break:break-all;max-height:180px;overflow:auto;background:var(--dsw-alias-fill-primary,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:8px;margin-top:8px}
10
- .zgc-error{font-size:12px;color:var(--dsw-alias-text-danger,#d33);margin-top:8px}`,document.head.append(t),()=>{t.remove(),e()}},`zvec-grep-card: styles`);let t=e.configForms.get(F),r=u(t);e.effect(()=>e.locale.register(F,N),`zvec-grep-card: locale dictionaries`);let i=e.locale.bind(F),a=j(e,{remoteMissing:()=>i(`rebuildRemoteMissing`),namespaceMissing:e=>i(`rebuildNamespaceMissing`,{serviceKey:e})}),o=async(e,n)=>{try{return await t.set(e,n)}catch(t){throw console.error(`[zvec-grep] set ${e} failed:`,t),t}},s=async e=>{try{return await t.unset(e)}catch(t){throw console.error(`[zvec-grep] unset ${e} failed:`,t),t}};e.slots.inject(`plugins.bundle.config`,()=>e.slots.register({name:`plugins.bundle.config`,key:`@jayyuen66/dsh-zvec-grep`,inject:()=>({t:i,hooks:{card:r},set:o,unset:s,rebuildRemote:a})},ae))}exports.apply=se,exports.cardStore=u,exports.draftFields=m,exports.inject=oe,exports.parseRebuildPoll=b;
8
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("zod"),n=require("@jayyuen66/dsh-plugin-shared/client");const r=`transformers-js`,i=Object.freeze([{reference:`local/qwen3-embedding-0.6b`,backend:`llama-cpp`,dimension:1024},{reference:`local/embeddinggemma-300m`,backend:`llama-cpp`,dimension:768},{reference:`local/potion-code-16m-v2`,backend:`model2vec`,dimension:256},{reference:`local/potion-multilingual-128m`,backend:`model2vec`,dimension:256},{reference:`local/potion-retrieval-32m`,backend:`model2vec`,dimension:512},{reference:`local/bge-small-en-v1.5`,backend:r,dimension:384},{reference:`local/all-minilm-l6-v2`,backend:r,dimension:384},{reference:`local/multilingual-e5-small`,backend:r,dimension:384},{reference:`local/jina-embeddings-v2-base-code`,backend:r,dimension:768},{reference:`local/gte-modernbert-base`,backend:r,dimension:768},{reference:`local/nomic-embed-text-v1.5`,backend:r,dimension:768}].map(e=>Object.freeze(e))),a=Object.freeze([{reference:`qwen/qwen3-vl-embedding`,dimension:2560},{reference:`qwen/qwen3.7-text-embedding`,dimension:1024},{reference:`qwen/text-embedding-v4`,dimension:1024}].map(e=>Object.freeze(e)));function o(e,t){return Object.hasOwn(e,t)}function s(e,t,n){return o(e,n)?e[n]:Object.hasOwn(t,n)?t[n]:void 0}function c(e,t){return typeof e==`number`&&Number.isFinite(e)?String(e):t}function l(e){let t;return e===!0?t=`daemonReadyNote`:e===!1&&(t=`daemonOfflineNote`),t}function u(e){return e?`ok`:`warn`}function d(e){let t={status:`loading`,writable:!1,value:{}},n=null,r=t;return{getSnapshot(){let t=e.getSnapshot();return t!==n&&(n=t,r={status:t.status,writable:t.writable,value:t.value??{}}),r},subscribe(t){return e.subscribe(t)}}}function f(e,t,n,r){let i=s(e,t,n);return i===void 0?o(e,n)?``:r:c(i,r)}const p=t.z.url({protocol:/^https?$/u});function m(e,t){if(Object.hasOwn(e,`hfEndpoint`)){let t=e.hfEndpoint;return typeof t==`string`?t:``}let n=t.hfEndpoint;return typeof n==`string`&&p.safeParse(n).success?n:``}function h(e,t){let n=s(e,t,`defaultEmbedding`),r=s(e,t,`enforceSearchFirst`),i=s(e,t,`transport`);return{embedding:typeof n==`string`&&n.length>0?n:`local/qwen3-embedding-0.6b`,limitDisplay:f(e,t,`defaultLimit`,`10`),hfEndpoint:m(e,t),enforceSearchFirst:r!==!1,grepBudget:f(e,t,`grepBudgetPerSearch`,`3`),unlockWindow:f(e,t,`unlockWindowMin`,`10`),transport:i===`cli`||i===`mcp`||i===`auto`?i:`auto`}}const g=t.z.int().min(1).max(50),_=t.z.int().min(1).max(20),v=t.z.int().min(1).max(240),y=[`running`,`stopping`,`completed`,`killed`,`failed`],b=t.z.object({status:t.z.preprocess(e=>typeof e==`string`&&y.some(t=>t===e)?e:void 0,t.z.enum(y).optional()),exitCode:t.z.preprocess(e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,t.z.number().optional()),output:t.z.preprocess(e=>typeof e==`string`?e:void 0,t.z.string().optional())});function x(e,t){let n=b.safeParse(e),{status:r,exitCode:i,output:a}=n.success?n.data:{},o=a??``;if(r===`running`||r===`stopping`)return{phase:`running`,output:o.length>0?o:t(`rebuildRunning`)};if(r===`completed`&&i===0)return{phase:`done`,output:o};let s;return s=r===`killed`?t(`rebuildKilled`):r===`failed`?t(`rebuildFailed`):typeof i==`number`&&Number.isFinite(i)?t(`rebuildExitCode`,{exitCode:i}):t(`rebuildExitUnknown`),{phase:`error`,output:o.length>0?`${s}\n${o}`:s}}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const C=e=>S(e)&&typeof e.$mount==`function`,w=`zvecGrepRebuild`,T=`remote.${w}`,E=`@jayyuen66/dsh-zvec-grep`;function D(e,n){let r=e.safeParse(n);if(!r.success)throw TypeError(t.z.prettifyError(r.error));return r.data}const O=t.z.object({root:t.z.string({error:`rebuild request requires a string root`}).trim().min(1,{error:`rebuild request requires a non-empty root`})},{error:`rebuild request requires a string root`}),k=t.z.object({jobId:t.z.string({error:`rebuild status request requires a string jobId`}).trim().min(1,{error:`rebuild status request requires a non-empty jobId`})},{error:`rebuild status request requires a string jobId`}),ee=[{id:`${E}#${w}/roots`,service:w,namespace:w,method:`roots`,invocation:{kind:`direct`},parameters:[],result:{mode:`src-json`}},{id:`${E}#${w}/rebuild`,service:w,namespace:w,method:`rebuild`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${E}#rebuild-request`,create:()=>({parse(e){return D(O,e)}})}}],result:{mode:`src-json`}},{id:`${E}#${w}/status`,service:w,namespace:w,method:`status`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${E}#rebuild-status-request`,create:()=>({parse(e){return D(k,e)}})}}],result:{mode:`src-json`}}],A=e=>(0,n.isRecord)(e)&&typeof e.roots==`function`&&typeof e.rebuild==`function`&&typeof e.status==`function`;async function j(e){let t=await e;if(t.ok)return t.value;throw Error(`${t.error.code}: ${t.error.message}`)}function M(e,t){let n,r=async()=>{let r=e.get?.(`remote`);if(!C(r))throw Error(t.remoteMissing());try{n??=r.$mount({package:E,descriptors:ee}),await n}catch(e){throw n=void 0,e}let i=e.get?.(T);if(!A(i))throw Error(t.namespaceMissing(T));return i};return{async roots(){return j((await r()).roots())},async rebuild(e){let t=await j((await r()).rebuild({root:e}));if(t.ok)return t;throw Error(t.error)},async status(e){let t=await j((await r()).status({jobId:e}));if(t.ok)return{...t};throw Error(t.error)}}}function te(e,t){return typeof e.get==`function`?M(e,t):void 0}const N=`https://modelscope.cn/models`,P={zh:{statusReadOnly:`当前作用域只读`,statusClean:`无未保存的修改`,dirtyCount:`已修改 {count} 项`,save:`保存`,saving:`保存中…`,revert:`撤销`,saveFailed:`保存失败:{reason}`,invalidFields:`有字段超出范围,先修正或撤销后再保存。`,saveRejected:`保存被宿主拒绝(配置校验未通过或写入被跳过),修改未生效`,modelSection:`检索模型`,fieldCount:`{count} 字段`,indexSection:`网络与索引`,unitResults:`条`,unitTimes:`次`,unitMinutes:`分钟`,outOfRange:`超出允许范围,未保存`,embeddingLabel:`默认 embedding`,embeddingHint:`本地模型直接可选;远程 qwen 模型需在插件部署配置里打开 allowRemoteEmbedding(内容会送往外部端点,首次索引需 zg --auth grant 授权)。只影响「新建」索引;切换并保存后,已有索引需点下方「重建」重新 embedding`,transportLabel:`检索传输方式`,transportHint:`自动 = 守护进程在跑时检索走 MCP(常驻模型池、队列调度),否则走 CLI;仅 CLI = 永不碰守护进程;仅 MCP = 检索恒走守护进程,缺席时由插件自动拉起(会开 127.0.0.1:7999 回环端口;拉起失败会明确报错而不是回退 CLI)`,transportAuto:`自动(守护进程在跑走 MCP,否则 CLI)`,transportCli:`仅 CLI(每次 spawn zg 进程)`,transportMcp:`仅 MCP(走守护进程,缺席自动拉起)`,backendRemote:`qwen 远程(内容出本机,需部署开放并授权)`,limitLabel:`默认每组结果数`,limitInvalid:`请输入 {min}-{max} 的整数`,limitClamped:`已钳到 {min}-{max} 范围:{value}`,endpointLabel:`HuggingFace 镜像地址`,endpointHint:`留空走 huggingface.co;国内网络可填 ${N} 等兼容镜像(仅 llama-cpp 后端生效,如 qwen3)`,enforceLabel:`强制 search-first(先 zg_search 再 grep/rg)`,enforceHint:`开启后,已建索引工作区内的 grep/rg 受配额门禁约束:每次成功 zg_search 解锁下方次数的 grep/rg(时效见下),用尽或过期后再次拦截(提高检索覆盖与准确性)`,budgetLabel:`每次 zg_search 解锁的 grep/rg 次数`,budgetHint:`配额越小语义检索越频繁、准确性约束越强;清空恢复默认 {default}`,windowLabel:`解锁时效`,windowHint:`超过该时长未再次 zg_search,配额整体过期;清空恢复默认 {default}(单位:分钟)`,rebuildLabel:`工作区重建(切换 embedding 并保存后执行)`,rebuildInputPlaceholder:`/workspace 的绝对路径`,daemonReadyNote:`守护进程:就绪(zg --server 在跑)。`,daemonOfflineNote:"守护进程:未就绪。守护进程提供的索引增量刷新、refresh=background 与常驻模型池在缺席时都不可用;需要时在终端执行 `zg --server on`。",panelRoots:`索引根`,panelServer:`索引服务`,panelReady:`就绪`,panelNotReady:`未就绪`,rebuildHint:`以当前默认模型重建:{embedding};等价于 zg --index --rebuild。{roots}`,rootsNoteWith:`候选工作区来自本 daemon 已打开过的会话(服务端白名单)。`,rootsNoteEmpty:`尚无可选工作区:先在该工作区里开一个会话(任一次工具调用即登记)。`,rebuildButton:`重建索引(动作,点击即执行)`,rebuildRunning:`重建中…`,rebuildDone:`重建完成`,rebuildStatusTitle:`重建作业`,copy:`复制`,copied:`已复制`,rebuildStarting:`正在后台重建索引…(首次会下载 embedding 模型,可能较慢)`,rebuildKilled:`重建进程被终止`,rebuildFailed:`重建作业被宿主注册表判定失败(没拿到进程退出码)`,rebuildExitCode:`重建进程退出码 {exitCode}(zg 未安装/权限不足/沙箱拒绝都会走到这里)`,rebuildExitUnknown:`重建没有可判定的结果(应答的 status 无法识别,或缺少进程退出码)`,rebuildMissingJobId:`启动重建失败:应答缺 jobId`,rebuildRootNotAbsolute:`root 必须是绝对路径(以 / 开头)`,rebuildUnavailable:`宿主没有提供工作区重建读面(未装远程服务)`,rebuildRemoteMissing:`工作区重建读面不可用:宿主网关没有提供 remote 服务`,rebuildNamespaceMissing:`{serviceKey} 未提供:宿主网关没有挂上这枚命名空间`,modelOption:`{reference}({dimension}维)`,backendLlamaCpp:`llama-cpp(原生,需 node-llama-cpp)`,backendTransformersJs:`transformers-js(纯 JS ONNX)`,backendModel2Vec:`model2vec(纯 JS worker,最轻)`},en:{statusReadOnly:`This scope is read-only`,statusClean:`No unsaved changes`,dirtyCount:`{count} changed`,save:`Save`,saving:`Saving…`,revert:`Revert`,saveFailed:`save failed: {reason}`,invalidFields:`Some fields are out of range; fix them or revert before saving.`,saveRejected:`save rejected by host (validation failed or write skipped) — changes not applied`,modelSection:`Retrieval model`,fieldCount:`{count} fields`,indexSection:`Network and index`,unitResults:`hits`,unitTimes:`times`,unitMinutes:`minutes`,outOfRange:`Out of the allowed range — not saved`,embeddingLabel:`Default embedding`,embeddingHint:`Local models are always selectable; the remote qwen models additionally require allowRemoteEmbedding in the deployment config (content leaves the machine, and the first index build needs a zg --auth grant). Affects newly built indexes only; after switching and saving, press Rebuild below to re-embed existing indexes`,transportLabel:`Search transport`,transportHint:`auto = searches go through the daemon (MCP) when it is running, CLI otherwise; CLI-only = never touch the daemon; MCP-only = searches always go through the daemon, auto-starting it when absent (opens the 127.0.0.1:7999 loopback port; a failed start is reported explicitly, never silently downgraded to CLI)`,transportAuto:`auto (daemon → MCP, otherwise CLI)`,transportCli:`CLI only (spawn zg each call)`,transportMcp:`MCP only (via daemon, auto-started when absent)`,backendRemote:`qwen remote (content leaves the machine; needs the deployment switch + grant)`,limitLabel:`Default hits per group`,limitInvalid:`enter an integer between {min} and {max}`,limitClamped:`clamped into the {min}-{max} range: {value}`,endpointLabel:`HuggingFace mirror URL`,endpointHint:`Leave empty for huggingface.co; on networks that cannot reach HF, fill a compatible mirror such as ${N} (llama-cpp backends only, e.g. qwen3)`,enforceLabel:`Enforce search-first (zg_search before grep/rg)`,enforceHint:`When on, grep/rg inside indexed workspaces is quota-gated: each successful zg_search unlocks the number of grep/rg calls below (valid for the window below), and the gate blocks again once it is spent or expired (better coverage and relevance)`,budgetLabel:`grep/rg calls unlocked per zg_search`,budgetHint:`A smaller quota means more semantic searches and a stronger relevance constraint; clear to restore the default {default}`,windowLabel:`Unlock window`,windowHint:`Without another zg_search inside this window the whole quota expires; clear to restore the default {default} (minutes)`,rebuildLabel:`Workspace rebuild (run after switching embedding and saving)`,rebuildInputPlaceholder:`absolute path to a /workspace`,daemonReadyNote:`Daemon: ready (zg --server is running).`,daemonOfflineNote:"Daemon: not ready. What the daemon provides — incremental index refresh, refresh=background and the resident embedding model pool — is unavailable while it is absent; run `zg --server on` in a terminal when you want it.",rebuildHint:`Rebuild with the current default model: {embedding}; same as zg --index --rebuild. {roots}`,panelRoots:`Index roots`,panelServer:`Index server`,panelReady:`Ready`,panelNotReady:`Not ready`,rootsNoteWith:`Candidates come from sessions this daemon already opened (server-side whitelist).`,rootsNoteEmpty:`No workspace to pick yet: open a session in that workspace first (any tool call registers it).`,rebuildButton:`Rebuild index (action, runs on click)`,rebuildRunning:`rebuilding…`,rebuildDone:`rebuild finished`,rebuildStatusTitle:`rebuild job`,copy:`Copy`,copied:`Copied`,rebuildStarting:`Rebuilding in the background… (the first run downloads the embedding model and may be slow)`,rebuildKilled:`the rebuild process was terminated`,rebuildFailed:`the host job registry reported the rebuild as failed (no process exit code)`,rebuildExitCode:`the rebuild process exited with code {exitCode} (missing zg, insufficient permissions and sandbox denials all land here)`,rebuildExitUnknown:`the rebuild has no determinable outcome (the response status is unrecognized, or its exit code is missing)`,rebuildMissingJobId:`failed to start the rebuild: the response has no jobId`,rebuildRootNotAbsolute:`root must be an absolute path (starting with /)`,rebuildUnavailable:`the host does not expose the rebuild Remote API`,rebuildRemoteMissing:`the rebuild Remote API is unavailable: the host gateway provides no remote service`,rebuildNamespaceMissing:`{serviceKey} was not provided: the host gateway did not mount this namespace`,modelOption:`{reference} ({dimension} dims)`,backendLlamaCpp:`llama-cpp (native, requires node-llama-cpp)`,backendTransformersJs:`transformers-js (pure JS ONNX)`,backendModel2Vec:`model2vec (pure JS worker, lightest)`}},F=String.fromCodePoint(92),ne=/^[A-Za-z]:[\\/]/u,I=`zvec-grep`,L=[`llama-cpp`,`transformers-js`,`model2vec`],R=`zgc-rebuild-root-options`,z={"llama-cpp":`backendLlamaCpp`,"transformers-js":`backendTransformersJs`,model2vec:`backendModel2Vec`};function B(e){return e.value}function V(e,t,n){return e(`modelOption`,{reference:t,dimension:n})}function H(e,t,n){return e(`rebuildHint`,{embedding:t,roots:e(n?`rootsNoteWith`:`rootsNoteEmpty`)})}function U(e){let t=[];for(let n of L)for(let r of i)r.backend===n&&t.push({value:r.reference,label:V(e,r.reference,r.dimension),group:e(z[n])});for(let n of a)t.push({value:n.reference,label:V(e,n.reference,n.dimension),group:e(`backendRemote`)});return t}const W=[{value:`auto`},{value:`cli`},{value:`mcp`}],G={auto:`transportAuto`,cli:`transportCli`,mcp:`transportMcp`};function K(e){return W.map(t=>({value:t.value,label:e(G[t.value])}))}function q(e,t){let n=t.safeParse(e===``?NaN:Number(e));return n.success?n.data:void 0}function J(t){let{editable:r,fields:i,setField:a,t:o}=t,s=(0,e.createElement)(n.SelectField,{label:o(`embeddingLabel`),...(0,n.splitHint)(o(`embeddingHint`)),field:`defaultEmbedding`,value:i.embedding,options:U(o),disabled:!r,onChange:e=>{a(`defaultEmbedding`,e)}}),c=(0,e.createElement)(n.NumberField,{label:o(`limitLabel`),hint:o(`limitInvalid`,{min:1,max:50}),field:`defaultLimit`,value:q(i.limitDisplay,g),min:g.minValue??1,max:g.maxValue??50,step:1,unit:o(`unitResults`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`defaultLimit`,e)},onChange:e=>{a(`defaultLimit`,e)}});return(0,e.createElement)(n.Section,{title:o(`modelSection`),count:o(`fieldCount`,{count:`2`})},s,c)}function Y(t){let{fields:r,rebuild:i,root:a,roots:o,setRoot:s,t:c}=t,l=o.map(t=>(0,e.createElement)(`option`,{key:t,value:t})),u=(0,e.createElement)(`datalist`,{id:R},...l),d=(0,e.createElement)(`input`,{className:`dsu-input dsu-grow`,value:a,list:R,placeholder:c(`rebuildInputPlaceholder`),onChange:e=>{s(e.target.value)}}),f=(0,e.createElement)(`button`,{type:`button`,className:`dsu-btn`,"data-field":`rebuild`,disabled:i.phase===`running`,onClick:t.onRebuild},i.phase===`running`?c(`rebuildRunning`):c(`rebuildButton`));return(0,e.createElement)(n.Field,{label:c(`rebuildLabel`),...(0,n.splitHint)(H(c,r.embedding,o.length>0)),wide:!0},u,(0,e.createElement)(`div`,{className:`dsu-inlineRow`},d,f))}function X(t){let{t:r}=t,i=l(t.serverReady);return i===void 0?null:(0,e.createElement)(`div`,{className:`dsu-inlineRow`,"data-field":`daemon-status`},(0,e.createElement)(n.StatusDot,{tone:u(t.serverReady===!0)}),(0,e.createElement)(`p`,{className:`dsu-hint`},r(i)))}function re(t){let{rebuild:r,t:i}=t;if(r.phase===`idle`)return null;if(r.phase===`error`)return(0,e.createElement)(n.Callout,{tone:`err`},r.output);let a;return a=r.output===``?r.phase===`done`?i(`rebuildDone`):``:r.output,(0,e.createElement)(n.LogPanel,{label:i(`rebuildStatusTitle`),tone:r.phase===`done`?`ok`:`mute`,semanticLines:!0,copyText:a,copyLabel:i(`copy`),copiedLabel:i(`copied`)},a)}function ie(t){let{editable:r,fields:i,setField:a,t:o}=t,s=(0,e.createElement)(n.SelectField,{label:o(`transportLabel`),...(0,n.splitHint)(o(`transportHint`)),field:`transport`,value:i.transport,options:K(o),disabled:!r,onChange:e=>{a(`transport`,e)}}),c=(0,e.createElement)(n.TextField,{label:o(`endpointLabel`),...(0,n.splitHint)(o(`endpointHint`)),field:`hfEndpoint`,value:i.hfEndpoint,placeholder:N,monospace:!0,disabled:!r,onChange:e=>{a(`hfEndpoint`,e.trim()===``?void 0:e.trim())}}),l=(0,e.createElement)(n.ToggleField,{label:o(`enforceLabel`),...(0,n.splitHint)(o(`enforceHint`)),field:`enforceSearchFirst`,checked:i.enforceSearchFirst,disabled:!r,onChange:e=>{a(`enforceSearchFirst`,e)}}),u=(0,e.createElement)(n.NumberField,{label:o(`budgetLabel`),...(0,n.splitHint)(o(`budgetHint`,{default:3})),field:`grepBudgetPerSearch`,value:q(i.grepBudget,_),min:_.minValue??1,max:_.maxValue??20,step:1,unit:o(`unitTimes`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`grepBudgetPerSearch`,e)},onChange:e=>{a(`grepBudgetPerSearch`,e)}}),d=(0,e.createElement)(n.NumberField,{label:o(`windowLabel`),...(0,n.splitHint)(o(`windowHint`,{default:10})),field:`unlockWindowMin`,value:q(i.unlockWindow,v),min:v.minValue??1,max:v.maxValue??240,step:1,unit:o(`unitMinutes`),invalidHint:o(`outOfRange`),disabled:!r,resetToken:t.resetToken,onInvalidChange:e=>{t.reportInvalid(`unlockWindowMin`,e)},onChange:e=>{a(`unlockWindowMin`,e)}});return(0,e.createElement)(n.Section,{title:o(`indexSection`),count:o(`fieldCount`,{count:`5`})},s,c,l,(0,e.createElement)(n.FieldTwoCol,null,u,d),X(t),Y(t),re(t))}function ae(t){let{t:r}=t,i=(0,e.createElement)(n.SaveBar,{dirty:t.dirty,blocked:t.blocked,busy:t.busy,writable:t.writable,error:t.saveError??(t.blocked?r(`invalidFields`):null),saveLabel:r(`save`),savingLabel:r(`saving`),revertLabel:r(`revert`),dirtyLabel:r(`dirtyCount`,{count:t.dirtyCount}),cleanLabel:r(`statusClean`),readOnlyLabel:r(`statusReadOnly`),onSave:t.onSave,onDiscard:t.onDiscard});return(0,e.createElement)(n.CardForm,null,J(t),ie(t),i)}function oe(e,t,n,r){t===`defaultEmbedding`?e.push(r(`defaultEmbedding`,n)):t===`defaultLimit`?e.push(r(`defaultLimit`,n)):t===`hfEndpoint`?e.push(r(`hfEndpoint`,n)):t===`enforceSearchFirst`?e.push(r(`enforceSearchFirst`,n)):t===`grepBudgetPerSearch`?e.push(r(`grepBudgetPerSearch`,n)):t===`unlockWindowMin`?e.push(r(`unlockWindowMin`,n)):t===`transport`&&e.push(r(`transport`,n))}function Z(e,t){if(e===void 0)throw Error(t(`rebuildUnavailable`));return e}const Q={roots:[],serverReady:void 0};function se(r,i){let[a,o]=(0,e.useState)(``),[s,c]=(0,e.useState)(Q),[l,u]=(0,e.useState)({phase:`idle`,output:``}),d=(0,e.useRef)(null),f=(0,e.useRef)(!1),p=(0,e.useRef)(null),m=(0,e.useRef)(!0),h=()=>m.current;function g(){p.current=null,d.current!==null&&(clearInterval(d.current),d.current=null)}(0,e.useEffect)(()=>(m.current=!0,()=>{m.current=!1,g()}),[]);let _=(0,e.useCallback)(async()=>{let e=await Z(i,r).roots(),t={roots:[...e.roots],serverReady:e.serverReady};return c(t),t},[i,r]);(0,e.useEffect)(()=>{(async()=>{try{await _()}catch{c(Q)}})()},[_]);async function v(e){if(!f.current&&h()&&p.current===e){f.current=!0;try{let t=await Z(i,r).status(e);if(!h()||p.current!==e)return;let n=x(t,r);n.phase!==`running`&&g(),u({phase:n.phase,output:n.output})}catch(t){if(!h()||p.current!==e)return;g(),u({phase:`error`,output:(0,n.errorText)(t)})}finally{f.current=!1}}}async function y(){let e=await Z(i,r).rebuild(a.trim()),n=t.z.object({jobId:t.z.string()}).safeParse(e);if(!n.success)throw TypeError(r(`rebuildMissingJobId`));let{jobId:o}=n.data;p.current=o,d.current=setInterval(()=>{v(o)},2e3)}async function b(){let e=a.trim();if(!(e.startsWith(`/`)||ne.test(e)||e.startsWith(F+F)))u({phase:`error`,output:r(`rebuildRootNotAbsolute`)});else{g(),u({phase:`running`,output:r(`rebuildStarting`)});try{await y()}catch(e){g(),u({phase:`error`,output:(0,n.errorText)(e)})}}}return{root:a,roots:s.roots,serverReady:s.serverReady,state:l,setRoot:o,start:b}}function ce(t){let{t:r}=t,i=t.useCard(e=>e),{status:a,writable:o}=i,s=a===`ready`&&o,c=B(i),[l,u]=(0,e.useState)({}),[d,f]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null),g=se(r,t.rebuildRemote),_=h(l,c),v=(0,n.useInvalidFields)(),{blocked:y,fields:b,resetToken:x,reportInvalid:S}=v,C=new Set([...(0,n.diffTouched)(l,c),...b]).size,w=C>0||y,T=(e,t)=>{u(n=>({...n,[e]:t}))},E=async()=>{let e=(0,n.diffTouched)(l,c);if(e.length===0||y)return;f(!0),m(null);let i=[];for(let n of e){let e=l[n];e===void 0?i.push(t.unset(n)):oe(i,n,e,t.set)}try{if((await Promise.all(i)).some(e=>!e)){f(!1),m(r(`saveRejected`));return}}catch(e){f(!1),m(r(`saveFailed`,{reason:(0,n.errorText)(e)}));return}let a=new Set(e),o=Object.fromEntries(Object.entries(l).filter(([e])=>!a.has(e)));f(!1),u(o),v.clear()};return ae({t:r,fields:_,writable:s,editable:s&&!d,roots:g.roots,serverReady:g.serverReady,root:g.root,rebuild:g.state,dirty:w,blocked:y,resetToken:x,reportInvalid:S,dirtyCount:C,busy:d,saveError:p,setField:T,setRoot:g.setRoot,onSave:()=>{E()},onDiscard:()=>{u({}),m(null),v.clear()},onRebuild:()=>{g.start()}})}const $=`conversation.session.panel.section`;function le(t){let{t:r,reader:i}=t,[a,o]=(0,e.useState)(null);if((0,e.useEffect)(()=>{let e=!0;return(async()=>{if(i!==void 0)try{let t=await i.roots();e&&o(t)}catch{}})(),()=>{e=!1}},[i]),i===void 0||a===null)return null;let s=a.serverReady===!0;return(0,e.createElement)(n.KpiGrid,null,(0,e.createElement)(n.KpiTile,{label:r(`panelRoots`),value:a.roots.length,count:a.roots.length}),(0,e.createElement)(n.KpiTile,{label:r(`panelServer`),value:r(s?`panelReady`:`panelNotReady`)}))}const ue=[`slots`,`configForms`,`locale`];exports.apply=function(e){e.effect(()=>(0,n.ensureCardUiCss)(),`zvec-grep-card: shared styles`);let t=e.configForms.get(I),r=d(t);e.effect(()=>e.locale.register(I,P),`zvec-grep-card: locale dictionaries`);let i=e.locale.bind(I),a=te(e,{remoteMissing:()=>i(`rebuildRemoteMissing`),namespaceMissing:e=>i(`rebuildNamespaceMissing`,{serviceKey:e})}),o=async(e,n)=>{try{return await t.set(e,n)}catch(t){throw console.error(`[zvec-grep] set ${e} failed:`,t),t}},s=async e=>{try{return await t.unset(e)}catch(t){throw console.error(`[zvec-grep] unset ${e} failed:`,t),t}};e.slots.inject($,()=>e.slots.register({name:$,id:`zvec-index`,order:130,label:()=>i(`indexSection`),inject:()=>({t:i,reader:a})},le)),e.slots.inject(`plugins.bundle.config`,()=>e.slots.register({name:`plugins.bundle.config`,key:`@jayyuen66/dsh-zvec-grep`,inject:()=>({t:i,hooks:{card:r},set:o,unset:s,rebuildRemote:a})},ce))},exports.cardStore=d,exports.draftFields=h,exports.inject=ue,exports.parseRebuildPoll=x;
11
9
  return module.exports;
12
10
  },
13
11
  });
package/host.js CHANGED
@@ -15,7 +15,8 @@ import { truncateEnd, truncateStart } from "@jayyuen66/dsh-plugin-shared/lib/tex
15
15
  import { claimInstance } from "@jayyuen66/dsh-plugin-shared/lib/instance-lock";
16
16
  import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
17
17
  import { jobOutcomeOf } from "@jayyuen66/dsh-plugin-shared/lib/job-outcome";
18
- import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
18
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
19
+ import { writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
19
20
  // lib/embedding-catalog.ts
20
21
  /** 默认模型:本地最强(1024 维 / 8192 上下文 / 中英通用),约 640MB 一次性下载。 */
21
22
  const DEFAULT_EMBEDDING = "local/qwen3-embedding-0.6b";
@@ -1981,9 +1982,21 @@ function searchAdmitted(execution) {
1981
1982
  const scope = execution.agent?.ctx === void 0 ? void 0 : scopeOf(execution.agent.ctx);
1982
1983
  return toolSet.view(scope).has(ZG_SEARCH_NAME);
1983
1984
  }
1984
- /** 会话工作区(官方 Agent.session.header.cwd;值按 unknown 读,理由见 SessionFace)。 */
1985
- function sessionHeaderCwd$1(execution) {
1986
- const raw = execution.agent?.session?.header?.cwd;
1985
+ function isWorkingDirectory(value) {
1986
+ if (!isRecord(value)) return false;
1987
+ return value["get"] === void 0 || typeof value["get"] === "function";
1988
+ }
1989
+ /** 会话**当前**工作区:活目录优先(`ctx.workingDirectory.get(session)`),服务缺席或
1990
+ * 给不出非空串时回落 `header.cwd`(创建期快照)。宿主 `cd` 之后只有前者会跟着变,
1991
+ * 相对 root 的判据必须按它解析,否则会把目标归一到建会话时的旧目录。 */
1992
+ function sessionWorkingDirectory(execution) {
1993
+ const session = execution.agent?.session;
1994
+ const service = execution.agent?.ctx?.get("workingDirectory");
1995
+ if (session !== void 0 && isWorkingDirectory(service)) {
1996
+ const live = service.get?.(session);
1997
+ if (typeof live === "string" && live.length > 0) return live;
1998
+ }
1999
+ const raw = session?.header?.cwd;
1987
2000
  return typeof raw === "string" && raw.length > 0 ? raw : void 0;
1988
2001
  }
1989
2002
  /**
@@ -2007,7 +2020,7 @@ function zgToolProblem(name, args, execution, messages, platform) {
2007
2020
  const { root } = args;
2008
2021
  let problem;
2009
2022
  if (name === "zg_index" && args["confirm"] !== true) problem = messages.guardIndexConfirmRequired;
2010
- else if (root === void 0 || root === null || root === "") problem = sessionHeaderCwd$1(execution) === void 0 ? fill(messages.guardAbsoluteRootRequired, { name }) : void 0;
2023
+ else if (root === void 0 || root === null || root === "") problem = sessionWorkingDirectory(execution) === void 0 ? fill(messages.guardAbsoluteRootRequired, { name }) : void 0;
2011
2024
  else problem = rootProblem(name, root, messages, platform);
2012
2025
  return problem;
2013
2026
  }
@@ -2211,7 +2224,7 @@ function nativeGrepProblem(args, cwd, deps, messages) {
2211
2224
  function searchFirstGuard(execution, deps, messages) {
2212
2225
  const { name } = execution;
2213
2226
  const args = isRecord(execution.arguments) ? execution.arguments : {};
2214
- const cwd = sessionHeaderCwd$1(execution);
2227
+ const cwd = sessionWorkingDirectory(execution);
2215
2228
  let reason;
2216
2229
  if (deps.enabled && cwd !== void 0 && searchAdmitted(execution)) {
2217
2230
  if (name === "bash" || name === "pwsh") reason = shellSearchProblem(args, cwd, deps, messages);
@@ -3451,18 +3464,17 @@ async function readPersistedToken(file) {
3451
3464
  return token;
3452
3465
  }
3453
3466
  /**
3454
- * 原子写入 token(同目录临时文件 → rename),权限 0600。失败**不外抛**:持久化只是恢复
3455
- * 路径的增强,写不进去时本次会话仍用内存 token,恢复退化为 daemonStartFailed 的指引。
3467
+ * 原子写入 token,权限 0600。原子替换本体交官方 `writeFileAtomic`(同目录随机后缀临时件 +
3468
+ * rename;`wx` 独占创建保证新建 inode 必带 mode,失败自带临时件清理,win32 对瞬态 rename
3469
+ * 错误退避重试)。失败**不外抛**:持久化只是恢复路径的增强,写不进去时本次会话仍用内存
3470
+ * token,恢复退化为 daemonStartFailed 的指引——官方件抛错,吞错语义由本函数这一层保持。
3456
3471
  * @param file 目标路径
3457
3472
  * @param token 待写入的 token
3458
3473
  * @returns 是否写入成功(测试用;生产调用可忽略)
3459
3474
  */
3460
3475
  async function persistToken(file, token) {
3461
3476
  try {
3462
- await mkdir(nodePath.dirname(file), { recursive: true });
3463
- const temporary = `${file}.${String(process.pid)}.tmp`;
3464
- await writeFile(temporary, token, { mode: 384 });
3465
- await rename(temporary, file);
3477
+ await writeFileAtomic(file, token, { mode: 384 });
3466
3478
  return true;
3467
3479
  } catch {
3468
3480
  return false;
@@ -3883,11 +3895,7 @@ function isZvecGrepHost(value) {
3883
3895
  if (!isRecord(value)) return false;
3884
3896
  return hasMethod(value, "settings", ["describe"]) && hasMethod(value, "shell", ["resolve", "execute"]) && hasMethod(value, "tools", ["register", "guard"]) && hasMethod(value, "systemPrompt", ["section"]) && hasMethod(value, "timer", ["timeout"]) && typeof value["get"] === "function";
3885
3897
  }
3886
- /** 当前会话工作区(root 缺省回退源);非字符串视为缺(读取方式见 lib/routing.ts 的 SessionFace)。 */
3887
- function sessionHeaderCwd(exec) {
3888
- const raw = exec.agent?.session?.header?.cwd;
3889
- return typeof raw === "string" && raw.length > 0 ? raw : void 0;
3890
- }
3898
+ /** 当前会话工作区(root 缺省回退源);活目录读数与判据共用 lib/routing.ts 的同一条函数。 */
3891
3899
  /**
3892
3900
  * JSON.stringify 在本包**拥有的声明**上把返回宽成 `string | undefined`:lib 的签名恒为
3893
3901
  * `string`,但 ECMA-262 规定入参是 undefined / 函数 / 符号时它返回 undefined(下面
@@ -4550,7 +4558,7 @@ function judgeRoot(rawRoot, cwd, messages, ledger, platform) {
4550
4558
  }
4551
4559
  /** 工具入参的 root:过 root 判据,放行后登记进白名单(一处三工具共用)。 */
4552
4560
  function rootOf(args, exec, messages, ledger, platform) {
4553
- const decision = judgeRoot(args["root"], sessionHeaderCwd(exec), messages, ledger, platform);
4561
+ const decision = judgeRoot(args["root"], sessionWorkingDirectory(exec), messages, ledger, platform);
4554
4562
  if (!decision.allowed) throw new ZgToolError(ZG_TOOL_ERROR_CODES.rootRejected, decision.reason);
4555
4563
  ledger.add(decision.root);
4556
4564
  return decision.root;
@@ -4842,7 +4850,7 @@ function createLocaleMessages(host) {
4842
4850
  }
4843
4851
  /** 观测到的工作区:既给重建当白名单,也让卡片能列出可重建的 root。 */
4844
4852
  function trackObservedRoot(ledger, exec) {
4845
- const cwd = sessionHeaderCwd(exec);
4853
+ const cwd = sessionWorkingDirectory(exec);
4846
4854
  if (cwd !== void 0) ledger.add(cwd);
4847
4855
  }
4848
4856
  /** 会话分片的条数上限:常驻进程只增不减会随会话数无界增长,超上限按最近使用淘汰最冷的分片。 */
@@ -5531,7 +5539,7 @@ function explicitRootAsk(execution, ledger, messages, platform) {
5531
5539
  const raw = (isRecord(execution.arguments) ? execution.arguments : void 0)?.["root"];
5532
5540
  let question;
5533
5541
  if (typeof raw === "string" && raw.trim().length > 0) {
5534
- const decision = judgeRoot(raw, sessionHeaderCwd(execution), messages, ledger, platform);
5542
+ const decision = judgeRoot(raw, sessionWorkingDirectory(execution), messages, ledger, platform);
5535
5543
  question = decision.allowed ? decision.question : void 0;
5536
5544
  }
5537
5545
  return question === void 0 ? void 0 : {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayyuen66/dsh-zvec-grep",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "dsh 工作区语义检索插件(zg):zg_search / zg_index / zg_status + 本地 embedding 设置卡片 + systemPrompt 路由规则 + guard 安全兜底。",
5
5
  "keywords": [
6
6
  "cordis",
@@ -51,71 +51,75 @@
51
51
  "registry": "https://registry.npmjs.org"
52
52
  },
53
53
  "dependencies": {
54
- "@jayyuen66/dsh-plugin-shared": "^0.2.10",
54
+ "@jayyuen66/dsh-plugin-shared": "^0.2.13",
55
55
  "zod": "4.6.7"
56
56
  },
57
57
  "devDependencies": {
58
- "@deepseek-ai/cordis": "4.1.0",
59
- "@deepseek-ai/cordis-plugin-group": "1.1.0",
60
- "@deepseek-ai/cordis-plugin-timer": "1.2.0",
61
- "@deepseek-ai/dsh-agent": "0.2.2-rc.2",
62
- "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.2",
63
- "@deepseek-ai/dsh-bash-local": "0.2.2-rc.2",
64
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.2",
65
- "@deepseek-ai/dsh-client-store": "0.2.2-rc.2",
66
- "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.2",
67
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.2",
68
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.2",
69
- "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.2",
70
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.2",
71
- "@deepseek-ai/dsh-error": "0.2.2-rc.2",
72
- "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.2",
73
- "@deepseek-ai/dsh-http-proxy": "0.2.2-rc.2",
74
- "@deepseek-ai/dsh-jobs": "0.2.2-rc.2",
75
- "@deepseek-ai/dsh-jobs-local": "0.2.2-rc.2",
76
- "@deepseek-ai/dsh-llm": "0.2.2-rc.2",
77
- "@deepseek-ai/dsh-output-retention": "0.2.2-rc.2",
78
- "@deepseek-ai/dsh-package-manifest": "0.2.2-rc.2",
79
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
80
- "@deepseek-ai/dsh-scope": "0.2.2-rc.2",
81
- "@deepseek-ai/dsh-session": "0.2.2-rc.2",
82
- "@deepseek-ai/dsh-session-projection": "0.2.2-rc.2",
83
- "@deepseek-ai/dsh-settings": "0.2.2-rc.2",
84
- "@deepseek-ai/dsh-shell": "0.2.2-rc.2",
85
- "@deepseek-ai/dsh-skill": "0.2.2-rc.2",
86
- "@deepseek-ai/dsh-subprocess": "0.2.2-rc.2",
87
- "@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.2",
88
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
89
- "@deepseek-ai/dsh-timeout": "0.2.2-rc.2",
90
- "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.2",
91
- "@deepseek-ai/dsh-tools": "0.2.2-rc.2",
92
- "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.2",
93
- "@deepseek-ai/dsh-user-approval": "0.2.2-rc.2",
94
- "@deepseek-ai/schemastery": "3.19.0",
58
+ "@deepseek-ai/cordis": "4.2.0-alpha.1",
59
+ "@deepseek-ai/cordis-plugin-group": "1.2.0-alpha.1",
60
+ "@deepseek-ai/cordis-plugin-timer": "1.3.0-alpha.1",
61
+ "@deepseek-ai/dsh-agent": "0.2.3-alpha.2",
62
+ "@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.2",
63
+ "@deepseek-ai/dsh-atomic-write": "0.2.3-alpha.2",
64
+ "@deepseek-ai/dsh-bash-local": "0.2.3-alpha.2",
65
+ "@deepseek-ai/dsh-client-locale": "0.2.3-alpha.2",
66
+ "@deepseek-ai/dsh-client-store": "0.2.3-alpha.2",
67
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.3-alpha.2",
68
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.3-alpha.2",
69
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.2",
70
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.3-alpha.2",
71
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.2",
72
+ "@deepseek-ai/dsh-error": "0.2.3-alpha.2",
73
+ "@deepseek-ai/dsh-host-webserver": "0.2.3-alpha.2",
74
+ "@deepseek-ai/dsh-http-proxy": "0.2.3-alpha.2",
75
+ "@deepseek-ai/dsh-jobs": "0.2.3-alpha.2",
76
+ "@deepseek-ai/dsh-jobs-local": "0.2.3-alpha.2",
77
+ "@deepseek-ai/dsh-llm": "0.2.3-alpha.2",
78
+ "@deepseek-ai/dsh-output-retention": "0.2.3-alpha.2",
79
+ "@deepseek-ai/dsh-package-manifest": "0.2.3-alpha.2",
80
+ "@deepseek-ai/dsh-sandbox": "0.2.3-alpha.2",
81
+ "@deepseek-ai/dsh-scope": "0.2.3-alpha.2",
82
+ "@deepseek-ai/dsh-session": "0.2.3-alpha.2",
83
+ "@deepseek-ai/dsh-session-projection": "0.2.3-alpha.2",
84
+ "@deepseek-ai/dsh-settings": "0.2.3-alpha.2",
85
+ "@deepseek-ai/dsh-shell": "0.2.3-alpha.2",
86
+ "@deepseek-ai/dsh-skill": "0.2.3-alpha.2",
87
+ "@deepseek-ai/dsh-subprocess": "0.2.3-alpha.2",
88
+ "@deepseek-ai/dsh-subprocess-local": "0.2.3-alpha.2",
89
+ "@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.2",
90
+ "@deepseek-ai/dsh-timeout": "0.2.3-alpha.2",
91
+ "@deepseek-ai/dsh-tool-executor-native": "0.2.3-alpha.2",
92
+ "@deepseek-ai/dsh-tools": "0.2.3-alpha.2",
93
+ "@deepseek-ai/dsh-typert-protocol": "0.2.3-alpha.2",
94
+ "@deepseek-ai/dsh-user-approval": "0.2.3-alpha.2",
95
+ "@deepseek-ai/dsh-working-directory": "0.2.3-alpha.2",
96
+ "@deepseek-ai/schemastery": "3.20.0-alpha.1",
95
97
  "@e18e/eslint-plugin": "0.8.1",
96
98
  "@types/node": "26.6.6",
97
99
  "@types/react": "19.3.0",
98
- "@vitest/coverage-v8": "5.1.0",
100
+ "@vitest/coverage-v8": "5.1.1",
99
101
  "eslint-plugin-regexp": "3.3.3",
100
102
  "eslint-plugin-sonarjs": "4.2.2",
101
- "eslint-plugin-zod": "5.2.2",
102
- "fast-check": "4.10.2",
103
- "oxfmt": "0.78.0",
104
- "oxlint": "1.93.0",
105
- "oxlint-tsgolint": "7.0.2006",
103
+ "eslint-plugin-zod": "5.3.0",
104
+ "fast-check": "4.10.3",
105
+ "oxfmt": "0.79.0",
106
+ "oxlint": "1.94.0",
107
+ "oxlint-tsgolint": "7.0.2007",
106
108
  "react": "^19.3.0",
107
- "rolldown": "1.3.2",
109
+ "react-dom": "^19.3.0",
110
+ "rolldown": "1.3.3",
108
111
  "typescript": "7.0.2",
109
112
  "vite": "8.3.8",
110
- "vitest": "5.1.0"
113
+ "vitest": "5.1.1"
111
114
  },
112
115
  "peerDependencies": {
113
- "@deepseek-ai/dsh": "^0.2.2-rc.2",
114
- "@deepseek-ai/dsh-error": "^0.2.2-rc.2",
115
- "@deepseek-ai/dsh-output-retention": "^0.2.2-rc.2",
116
- "@deepseek-ai/dsh-scope": "^0.2.2-rc.2",
117
- "@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.2",
118
- "@deepseek-ai/schemastery": "^3.19.0"
116
+ "@deepseek-ai/dsh": "^0.2.3-alpha.2",
117
+ "@deepseek-ai/dsh-atomic-write": "^0.2.3-alpha.2",
118
+ "@deepseek-ai/dsh-error": "^0.2.3-alpha.2",
119
+ "@deepseek-ai/dsh-output-retention": "^0.2.3-alpha.2",
120
+ "@deepseek-ai/dsh-scope": "^0.2.3-alpha.2",
121
+ "@deepseek-ai/dsh-typert-protocol": "^0.2.3-alpha.2",
122
+ "@deepseek-ai/schemastery": "^3.20.0-alpha.1"
119
123
  },
120
124
  "peerDependenciesMeta": {
121
125
  "@deepseek-ai/dsh": {
@@ -124,8 +128,8 @@
124
128
  },
125
129
  "icon": "icon.svg",
126
130
  "engines": {
127
- "dsh": "^0.2.2-rc.2",
128
- "node": ">=24.9.0"
131
+ "dsh": "^0.2.3-alpha.2",
132
+ "node": "^24.22.3 || >=26.13.1"
129
133
  },
130
134
  "dsh": {
131
135
  "manifestVersion": 1,