@jayyuen66/dsh-zvec-grep 0.1.19 → 0.1.20
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 +11 -0
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/client.js +1 -3
- package/host.js +7 -7
- package/package.json +52 -49
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
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.20
|
|
6
|
+
|
|
7
|
+
宿主基线抬到 `0.2.2-rc.5`;daemon token 的原子落盘换官方件;上游 zg 0.3.1 的密钥跳过行为对齐。
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **宿主依赖线抬到 `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 的支持窗口徽章同步。
|
|
12
|
+
- **`persistToken` 的原子替换换官方 `writeFileAtomic`**(devDependencies 加 `dsh-atomic-write`,peer 同窗口,产物保持裸说明符):`wx` 独占创建保证新建 inode 必带 0600、随机后缀临时件、失败自带临时件清理、win32 对瞬态 rename 错误退避重试。「失败不外抛、返 boolean」的降级契约由本函数这一层保持——官方件抛错,写不进去时本会话仍用内存 token,恢复退化为 daemonStartFailed 的指引(变异验证:摘掉吞错层,失败路径用例当场红)。
|
|
13
|
+
- **上游 zg 0.3.1 的密钥跳过行为对齐**:0.3.0 默认把 binary/unsupported 两类都挡在索引外,0.3.1 实测只跳 `secret.pem`(binary),未知扩展名的 `.P12` 已随正常源码收进索引——插件的排除规则(README 密钥清单,含大小写不敏感的 `*.p12`)回到唯一防线,e2e 用例按 0.3.1 的实测行为改写(两种开关都真建索引、真检索对质)。
|
|
14
|
+
- **rebuild-reader 的 `RemoteHost` / `isRemoteMounter` 收编 shared `./lib/typert-client`**(七仓逐字副本的正主)。
|
|
15
|
+
|
|
5
16
|
## 0.1.19
|
|
6
17
|
|
|
7
18
|
将 `@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
|
@@ -12,7 +12,7 @@
|
|
|
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
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.
|
|
15
|
+
<img src="https://img.shields.io/badge/dsh-%5E0.2.2--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
|
|
|
@@ -79,8 +79,8 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
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
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.
|
|
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.
|
|
82
|
+
- **Host `dsh` on the `0.2.2-rc.5` line or later.** The host reads `engines.dsh` (`^0.2.2-rc.5`) 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.5` passes the host gate; strict npm peer resolution starts at `0.2.2-rc.5`. `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.5`), 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
|
|
package/README.zh-CN.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
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
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.
|
|
15
|
+
<img src="https://img.shields.io/badge/dsh-%5E0.2.2--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
|
|
|
@@ -79,8 +79,8 @@ dsh plugin --profile web add @jayyuen66/dsh-zvec-grep
|
|
|
79
79
|
卸载用 `dsh plugin --profile web remove @jayyuen66/dsh-zvec-grep`。包在公共 npm registry 上,不需要凭据,也不需要 scoped-registry 配置行。
|
|
80
80
|
|
|
81
81
|
- **Node.js `>= 24.9`**(纯 ESM;正是这个下限让 `require()` 一枚 ESM 入口成为可能,`engines.node` 因此声明)。
|
|
82
|
-
- **宿主 `dsh` 在 `0.2.2-rc.
|
|
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.
|
|
82
|
+
- **宿主 `dsh` 在 `0.2.2-rc.5` 或更新的 `0.2.2` 这条线上。** 宿主读 `engines.dsh`(`^0.2.2-rc.5`)且**单独决定**——该字段在场时兼容性先于 `peerDependencies` 判定,prerelease 参与比较。`0.2.x` 里不低于 `0.2.2-rc.5` 的都通过宿主装载门;npm 的严格 peer 解析从 `0.2.2-rc.5` 起算。`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.5`),`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
|
|
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){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}}function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const S=e=>x(e)&&typeof e.$mount==`function`,C=`zvecGrepRebuild`,w=`remote.${C}`,T=`@jayyuen66/dsh-zvec-grep`;function E(e,n){let r=e.safeParse(n);if(!r.success)throw TypeError(t.z.prettifyError(r.error));return r.data}const D=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`}),O=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:`${T}#${C}/roots`,service:C,namespace:C,method:`roots`,invocation:{kind:`direct`},parameters:[],result:{mode:`src-json`}},{id:`${T}#${C}/rebuild`,service:C,namespace:C,method:`rebuild`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${T}#rebuild-request`,create:()=>({parse(e){return E(D,e)}})}}],result:{mode:`src-json`}},{id:`${T}#${C}/status`,service:C,namespace:C,method:`status`,invocation:{kind:`direct`},parameters:[{name:`request`,wire:`request`,source:`json`,codec:{mode:`strict`,typeSymbol:`${T}#rebuild-status-request`,create:()=>({parse(e){return E(O,e)}})}}],result:{mode:`src-json`}}],k=e=>(0,n.isRecord)(e)&&typeof e.roots==`function`&&typeof e.rebuild==`function`&&typeof e.status==`function`;async function A(e){let t=await e;if(t.ok)return t.value;throw Error(`${t.error.code}: ${t.error.message}`)}function j(e,t){let n,r=async()=>{let r=e.get?.(`remote`);if(!S(r))throw Error(t.remoteMissing());try{n??=r.$mount({package:T,descriptors:ee}),await n}catch(e){throw n=void 0,e}let i=e.get?.(w);if(!k(i))throw Error(t.namespaceMissing(w));return i};return{async roots(){return A((await r()).roots())},async rebuild(e){let t=await A((await r()).rebuild({root:e}));if(t.ok)return t;throw Error(t.error)},async status(e){let t=await A((await r()).status({jobId:e}));if(t.ok)return{...t};throw Error(t.error)}}}function M(e,t){return typeof e.get==`function`?j(e,t):void 0}const N=`https://modelscope.cn/models`,te={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`。",rebuildHint:`以当前默认模型重建:{embedding};等价于 zg --index --rebuild。{roots}`,rootsNoteWith:`候选工作区来自本 daemon 已打开过的会话(服务端白名单)。`,rootsNoteEmpty:`尚无可选工作区:先在该工作区里开一个会话(任一次工具调用即登记)。`,rebuildButton:`重建索引(动作,点击即执行)`,rebuildRunning:`重建中…`,rebuildDone:`重建完成`,rebuildStatusTitle:`重建作业`,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}`,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`,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),F=/^[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,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`),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 zgc-rebuildInput`,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,d,f)}function X(t){let{t:n}=t,r=l(t.serverReady);return r===void 0?null:(0,e.createElement)(`p`,{className:`dsu-hint`},n(r))}function Z(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`},a)}function ne(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,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:q(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`),count:o(`fieldCount`,{count:`5`})},s,c,l,(0,e.createElement)(n.FieldTwoCol,null,u,d),X(t),Y(t),Z(t))}function re(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),ne(t),i)}function ie(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 ae(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(`/`)||F.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 oe(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,h]=(0,e.useState)(null),g=ae(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)):ie(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 re({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 se=[`slots`,`configForms`,`locale`];exports.apply=function(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}`,document.head.append(t),()=>{t.remove(),e()}},`zvec-grep-card: styles`);let t=e.configForms.get(I),r=u(t);e.effect(()=>e.locale.register(I,te),`zvec-grep-card: locale dictionaries`);let i=e.locale.bind(I),a=M(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})},oe))},exports.cardStore=u,exports.draftFields=m,exports.inject=se,exports.parseRebuildPoll=b;
|
|
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,
|
|
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";
|
|
@@ -3451,18 +3452,17 @@ async function readPersistedToken(file) {
|
|
|
3451
3452
|
return token;
|
|
3452
3453
|
}
|
|
3453
3454
|
/**
|
|
3454
|
-
* 原子写入 token
|
|
3455
|
-
*
|
|
3455
|
+
* 原子写入 token,权限 0600。原子替换本体交官方 `writeFileAtomic`(同目录随机后缀临时件 +
|
|
3456
|
+
* rename;`wx` 独占创建保证新建 inode 必带 mode,失败自带临时件清理,win32 对瞬态 rename
|
|
3457
|
+
* 错误退避重试)。失败**不外抛**:持久化只是恢复路径的增强,写不进去时本次会话仍用内存
|
|
3458
|
+
* token,恢复退化为 daemonStartFailed 的指引——官方件抛错,吞错语义由本函数这一层保持。
|
|
3456
3459
|
* @param file 目标路径
|
|
3457
3460
|
* @param token 待写入的 token
|
|
3458
3461
|
* @returns 是否写入成功(测试用;生产调用可忽略)
|
|
3459
3462
|
*/
|
|
3460
3463
|
async function persistToken(file, token) {
|
|
3461
3464
|
try {
|
|
3462
|
-
await
|
|
3463
|
-
const temporary = `${file}.${String(process.pid)}.tmp`;
|
|
3464
|
-
await writeFile(temporary, token, { mode: 384 });
|
|
3465
|
-
await rename(temporary, file);
|
|
3465
|
+
await writeFileAtomic(file, token, { mode: 384 });
|
|
3466
3466
|
return true;
|
|
3467
3467
|
} catch {
|
|
3468
3468
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayyuen66/dsh-zvec-grep",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "dsh 工作区语义检索插件(zg):zg_search / zg_index / zg_status + 本地 embedding 设置卡片 + systemPrompt 路由规则 + guard 安全兜底。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cordis",
|
|
@@ -51,70 +51,73 @@
|
|
|
51
51
|
"registry": "https://registry.npmjs.org"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@jayyuen66/dsh-plugin-shared": "^0.2.
|
|
54
|
+
"@jayyuen66/dsh-plugin-shared": "^0.2.12",
|
|
55
55
|
"zod": "4.6.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@deepseek-ai/cordis": "4.1.0",
|
|
59
59
|
"@deepseek-ai/cordis-plugin-group": "1.1.0",
|
|
60
60
|
"@deepseek-ai/cordis-plugin-timer": "1.2.0",
|
|
61
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
62
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.2-rc.
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-client-
|
|
66
|
-
"@deepseek-ai/dsh-client-
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
74
|
-
"@deepseek-ai/dsh-
|
|
75
|
-
"@deepseek-ai/dsh-jobs
|
|
76
|
-
"@deepseek-ai/dsh-
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/dsh-
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-session
|
|
83
|
-
"@deepseek-ai/dsh-
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-
|
|
86
|
-
"@deepseek-ai/dsh-
|
|
87
|
-
"@deepseek-ai/dsh-subprocess
|
|
88
|
-
"@deepseek-ai/dsh-
|
|
89
|
-
"@deepseek-ai/dsh-
|
|
90
|
-
"@deepseek-ai/dsh-
|
|
91
|
-
"@deepseek-ai/dsh-
|
|
92
|
-
"@deepseek-ai/dsh-
|
|
93
|
-
"@deepseek-ai/dsh-
|
|
61
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.5",
|
|
62
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.2-rc.5",
|
|
63
|
+
"@deepseek-ai/dsh-atomic-write": "0.2.2-rc.5",
|
|
64
|
+
"@deepseek-ai/dsh-bash-local": "0.2.2-rc.5",
|
|
65
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
|
|
66
|
+
"@deepseek-ai/dsh-client-store": "0.2.2-rc.5",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.5",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.5",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.5",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
|
|
72
|
+
"@deepseek-ai/dsh-error": "0.2.2-rc.5",
|
|
73
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.5",
|
|
74
|
+
"@deepseek-ai/dsh-http-proxy": "0.2.2-rc.5",
|
|
75
|
+
"@deepseek-ai/dsh-jobs": "0.2.2-rc.5",
|
|
76
|
+
"@deepseek-ai/dsh-jobs-local": "0.2.2-rc.5",
|
|
77
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.5",
|
|
78
|
+
"@deepseek-ai/dsh-output-retention": "0.2.2-rc.5",
|
|
79
|
+
"@deepseek-ai/dsh-package-manifest": "0.2.2-rc.5",
|
|
80
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.5",
|
|
81
|
+
"@deepseek-ai/dsh-scope": "0.2.2-rc.5",
|
|
82
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
|
|
83
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.5",
|
|
84
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.5",
|
|
85
|
+
"@deepseek-ai/dsh-shell": "0.2.2-rc.5",
|
|
86
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.5",
|
|
87
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.5",
|
|
88
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.5",
|
|
89
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.5",
|
|
90
|
+
"@deepseek-ai/dsh-timeout": "0.2.2-rc.5",
|
|
91
|
+
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.5",
|
|
92
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5",
|
|
93
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.5",
|
|
94
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.5",
|
|
94
95
|
"@deepseek-ai/schemastery": "3.19.0",
|
|
95
96
|
"@e18e/eslint-plugin": "0.8.1",
|
|
96
97
|
"@types/node": "26.6.6",
|
|
97
98
|
"@types/react": "19.3.0",
|
|
98
|
-
"@vitest/coverage-v8": "5.1.
|
|
99
|
+
"@vitest/coverage-v8": "5.1.1",
|
|
99
100
|
"eslint-plugin-regexp": "3.3.3",
|
|
100
101
|
"eslint-plugin-sonarjs": "4.2.2",
|
|
101
|
-
"eslint-plugin-zod": "5.
|
|
102
|
-
"fast-check": "4.10.
|
|
103
|
-
"oxfmt": "0.
|
|
104
|
-
"oxlint": "1.
|
|
105
|
-
"oxlint-tsgolint": "7.0.
|
|
102
|
+
"eslint-plugin-zod": "5.3.0",
|
|
103
|
+
"fast-check": "4.10.3",
|
|
104
|
+
"oxfmt": "0.79.0",
|
|
105
|
+
"oxlint": "1.94.0",
|
|
106
|
+
"oxlint-tsgolint": "7.0.2007",
|
|
106
107
|
"react": "^19.3.0",
|
|
107
|
-
"
|
|
108
|
+
"react-dom": "^19.3.0",
|
|
109
|
+
"rolldown": "1.3.3",
|
|
108
110
|
"typescript": "7.0.2",
|
|
109
111
|
"vite": "8.3.8",
|
|
110
|
-
"vitest": "5.1.
|
|
112
|
+
"vitest": "5.1.1"
|
|
111
113
|
},
|
|
112
114
|
"peerDependencies": {
|
|
113
|
-
"@deepseek-ai/dsh": "^0.2.2-rc.
|
|
114
|
-
"@deepseek-ai/dsh-
|
|
115
|
-
"@deepseek-ai/dsh-
|
|
116
|
-
"@deepseek-ai/dsh-
|
|
117
|
-
"@deepseek-ai/dsh-
|
|
115
|
+
"@deepseek-ai/dsh": "^0.2.2-rc.5",
|
|
116
|
+
"@deepseek-ai/dsh-atomic-write": "^0.2.2-rc.5",
|
|
117
|
+
"@deepseek-ai/dsh-error": "^0.2.2-rc.5",
|
|
118
|
+
"@deepseek-ai/dsh-output-retention": "^0.2.2-rc.5",
|
|
119
|
+
"@deepseek-ai/dsh-scope": "^0.2.2-rc.5",
|
|
120
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.2.2-rc.5",
|
|
118
121
|
"@deepseek-ai/schemastery": "^3.19.0"
|
|
119
122
|
},
|
|
120
123
|
"peerDependenciesMeta": {
|
|
@@ -124,7 +127,7 @@
|
|
|
124
127
|
},
|
|
125
128
|
"icon": "icon.svg",
|
|
126
129
|
"engines": {
|
|
127
|
-
"dsh": "^0.2.2-rc.
|
|
130
|
+
"dsh": "^0.2.2-rc.5",
|
|
128
131
|
"node": ">=24.9.0"
|
|
129
132
|
},
|
|
130
133
|
"dsh": {
|