@jayyuen66/dsh-zvec-grep 0.1.10 → 0.1.12

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/cordis.patch.yml CHANGED
@@ -12,5 +12,8 @@
12
12
  # 行按裸包名引用本包(client-modules 只扫描裸包名条目的 dsh.client 声明)。
13
13
  # 注意 pnpm ≥12.3.0:12.0.0 的 add 本地目录有 #14437 bug。
14
14
  - insert:
15
+ # 故意不写 id:shared 是本包 patch 启用的内部组件行,不是用户可停用的独立组件;
16
+ # 写 id 会让插件页出现一个可关闭的组件,关闭后本包设置卡会失去组件供应。
17
+ - name: "@jayyuen66/dsh-plugin-shared"
15
18
  - id: zvec-grep
16
19
  name: "@jayyuen66/dsh-zvec-grep"
package/docs/DETAIL.md CHANGED
@@ -15,9 +15,9 @@ The card's Rebuild button runs the equivalent of `zg index --rebuild` for a work
15
15
 
16
16
  ## Restart-only values
17
17
 
18
- Ten deployment values stay off the card: `searchTimeoutMs` (300000), `statusTimeoutMs` (60000), `indexTimeoutMs` (600000), `stdoutMaxBytes` (400000), `rebuildWaitMs`, `clientMode` (`auto` / `direct` / `server`), `allowRemoteEmbedding` (false), `remoteEmbeddingEndpoint`, `remoteEmbeddingApiKeyFrom`, `requireApprovalForExplicitRoot` (false).
18
+ Ten deployment values stay off the card: `searchTimeoutMs` (300000), `statusTimeoutMs` (60000), `indexTimeoutMs` (600000), `stdoutMaxBytes` (400000), `rebuildWaitMs` (120000), `clientMode` (`auto` / `direct` / `server`), `allowRemoteEmbedding` (false), `remoteEmbeddingEndpoint`, `remoteEmbeddingApiKeyFrom`, `requireApprovalForExplicitRoot` (false). None of these ten has a card control; the only thing that makes them take effect is the `config:` block of the registration row in the next paragraph, and precedence is row `config:` > the `.default()` in code.
19
19
 
20
- Whether workspace content may leave the machine at all is treated as a deployment decision rather than a model-visible choice, which is why the remote-embedding trio appears in neither the card nor the tool parameters; and even when it is enabled, `zg` itself still requires `--allow-remote` or `zg auth grant`. Set all of these in the `config:` block of this plugin's row in your profile's `cordis.yml` (the `cordis.patch.yml` shipped in this package only carries the row's `id` / `name`); they take effect on restart.
20
+ Whether workspace content may leave the machine at all is treated as a deployment decision rather than a model-visible choice, which is why the remote-embedding trio appears in neither the card nor the tool parameters; and even when it is enabled, `zg` itself still requires `--allow-remote` or `zg auth grant`. Set all of these in the `config:` block of this plugin's row in your profile's `cordis.yml` (the `cordis.patch.yml` shipped in this package carries that row's `id` / `name` plus a second, **id-less** entry for `@jayyuen66/dsh-plugin-shared` that supplies the card components — deleting it leaves the settings card without its component supplier); they take effect on restart.
21
21
 
22
22
  ## What it needs from outside
23
23
 
package/docs/DETAIL.zh.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## 设置卡上改的是什么
6
6
 
7
7
  - **检索模型** — `defaultEmbedding`(默认 `local/qwen3-embedding-0.6b`,约 640 MB)只作用于**新建**的索引;已有索引沿用它自己的模型,要换得先重建。`defaultLimit`(1–50,默认 10)是每组结果返回多少条命中。
8
- - **网络与索引** — `hfEndpoint` 默认指向 ModelScope 镜像(`https://modelscope.cn/models`);留空就是 huggingface.co,而这个环境通常连不上,所以默认值应当保留。`enforceSearchFirst`(默认开)在已建索引的工作区里拦住 `grep` / `rg`。`grepBudgetPerSearch`(默认 3)是一次成功的 `zg_search` 解锁多少次直查,`unlockWindowMin`(默认 10)是这份解锁维持几分钟。有效期在每次取用配额时现判,窗口一过就不再放行直查、不需要重启;分片表按会话数封顶 256,超出时先淘汰最久未用的那一份。本步骤的工具准入不含 `zg_search` 时,门禁让路,不强迫模型去调一个本步骤调不动的工具。
8
+ - **网络与索引** — `hfEndpoint` 默认指向 ModelScope 镜像(`https://modelscope.cn/models`);留空就是 huggingface.co,而这个环境通常连不上,所以默认值应当保留。`enforceSearchFirst`(默认开)在已建索引的工作区里拦住 `grep` / `rg`。`grepBudgetPerSearch`(默认 3)是一次**走索引的** `zg_search` 解锁多少次直查(无索引时自动改走穷举词法的检索同样成功,但不发配额),`unlockWindowMin`(默认 10)是这份解锁维持几分钟。配额按「会话 × 索引根」记账(索引根是 root 或最近的含索引祖先,最多上溯 8 层),不是全局一份;「让路」只在宿主提供了步骤准入(`toolSet`)且该视图不含 `zg_search` 时成立——不提供准入信息的宿主仍按原判据拦截。有效期在每次取用配额时现判,窗口一过就不再放行直查、不需要重启;分片表按会话数封顶 256,超出时先淘汰最久未用的那一份。该索引根上有活跃重建时,门禁临时放行且**不消耗配额**:重建持着写锁,这期间语义检索必然失败,门禁不能再把直查一起堵死。本步骤的工具准入不含 `zg_search` 时,门禁让路,不强迫模型去调一个本步骤调不动的工具。
9
9
 
10
10
  这些每次调用现读,改完不需要重启宿主。
11
11
 
@@ -15,9 +15,9 @@
15
15
 
16
16
  ## 要重启的值
17
17
 
18
- 十项部署值刻意不进设置卡:`searchTimeoutMs`(300000)、`statusTimeoutMs`(60000)、`indexTimeoutMs`(600000)、`stdoutMaxBytes`(400000)、`rebuildWaitMs`、`clientMode`(`auto` / `direct` / `server`)、`allowRemoteEmbedding`(false)、`remoteEmbeddingEndpoint`、`remoteEmbeddingApiKeyFrom`、`requireApprovalForExplicitRoot`(false)。
18
+ 十项部署值刻意不进设置卡:`searchTimeoutMs`(300000)、`statusTimeoutMs`(60000)、`indexTimeoutMs`(600000)、`stdoutMaxBytes`(400000)、`rebuildWaitMs`(120000)、`clientMode`(`auto` / `direct` / `server`)、`allowRemoteEmbedding`(false)、`remoteEmbeddingEndpoint`、`remoteEmbeddingApiKeyFrom`、`requireApprovalForExplicitRoot`(false)。这十项在卡上没有入口,能生效的只有下一段那条注册行 `config:`;优先级是注册行 `config:` > 代码里的 `.default()`。
19
19
 
20
- 「工作区内容能不能离开本机」被当成部署决定,而不是给模型选的开关,所以远程嵌入那三枚既不在卡上也不在工具参数里;即便开了,`zg` 自己仍要求 `--allow-remote` 或 `zg auth grant`。这些值都写在**自己 profile 的 `cordis.yml`** 里本插件注册行的 `config:` 块(随包那份 `cordis.patch.yml` 只带 `id` / `name` 两行),改值随重启生效。
20
+ 「工作区内容能不能离开本机」被当成部署决定,而不是给模型选的开关,所以远程嵌入那三枚既不在卡上也不在工具参数里;即便开了,`zg` 自己仍要求 `--allow-remote` 或 `zg auth grant`。这些值都写在**自己 profile 的 `cordis.yml`** 里本插件注册行的 `config:` 块(随包那份 `cordis.patch.yml` 带本行的 `id` / `name`,另有一条**不写 id** 的 `@jayyuen66/dsh-plugin-shared` 条目供应卡片组件——删掉它设置卡会失去组件供应),改值随重启生效。
21
21
 
22
22
  ## 需要外部提供什么
23
23
 
@@ -25,4 +25,4 @@
25
25
 
26
26
  ## 更完整的说明
27
27
 
28
- 错误码表、参数守卫与后台作业面都写在随包 README(`README.md` / `README.zh-CN.md`)。
28
+ 参数守卫、`root` 判据与后台作业面都写在随包 README(`README.md` / `README.zh-CN.md`)。README 没有独立的错误码表:`zg` 不在 PATH 上按 `exit 127` 归到「未安装」(见「外部依赖」一节),其余失败按工具回执里的 `reason` 读。
package/host.js CHANGED
@@ -219,6 +219,7 @@ const MESSAGES = {
219
219
  limitInvalid: "limit 必须是非负整数(省略则用默认值)",
220
220
  limitOutOfRange: "limit 超出允许范围 {min}–{max}(省略则用默认值)",
221
221
  mustBeStringArray: "{name} 必须是字符串数组",
222
+ mustBeStringOrArray: "必须是字符串或字符串数组",
222
223
  tooManyItems: "{name} 最多 {maxItems} 项(实际 {actual})",
223
224
  nonStringItem: "{name} 含非字符串项({received})",
224
225
  commandTooLong: "zg 命令总长 {length} 字节,超过 {maxBytes} 字节上限,请缩小检索范围",
@@ -374,6 +375,7 @@ const MESSAGES = {
374
375
  rootRequiredWithFallback: "root is required and must be an absolute workspace path (it may be omitted: defaults to the current session workspace)",
375
376
  limitInvalid: "limit must be a non-negative integer (omit it to use the default)",
376
377
  limitOutOfRange: "limit is out of the allowed range {min}–{max} (omit it to use the default)",
378
+ mustBeStringOrArray: "must be a string or an array of strings",
377
379
  mustBeStringArray: "{name} must be an array of strings",
378
380
  tooManyItems: "{name} allows at most {maxItems} items (actual {actual})",
379
381
  nonStringItem: "{name} contains a non-string item ({received})",
@@ -483,6 +485,7 @@ function stringList(value, name, messages, maxItems = MAX_FILTER_ITEMS, maxChars
483
485
  * 其余类型错误(非字符串、非数组的其它值)仍然照旧报错,不做任何静默降级。
484
486
  */
485
487
  function singleOrList(value, name, messages, maxItems = MAX_FILTER_ITEMS, maxChars = MAX_FILTER_CHARS) {
488
+ if (value !== void 0 && value !== null && typeof value !== "string" && !Array.isArray(value)) throw new TypeError(fill(messages.mustBeStringOrArray, { name }));
486
489
  return stringList(typeof value === "string" ? [value] : value, name, messages, maxItems, maxChars);
487
490
  }
488
491
  /**
@@ -1060,6 +1063,26 @@ const PROBE_FLAGS = /* @__PURE__ */ new Set([
1060
1063
  * 包装/前缀命令:其首个实参本身就是「被执行的命令」,同样算命令位
1061
1064
  * (`git grep`、`… | xargs grep TODO`、`env rg foo` 都是真检索)。
1062
1065
  */
1066
+ /**
1067
+ * 壳层包装命令:它们 `-c` 后面那一枚参数本身就是「要被执行的命令」,
1068
+ * 不看进去就等于 `bash -c 'grep -r secret /'` 凭一层引号绕过门禁。
1069
+ *
1070
+ * 与 SEARCH_PREFIX_WORDS 分开列:那里的包装是「首个实参是被执行的命令」,
1071
+ * 这里要多走一步——先认 `-c` 这类旗标,再把它后面那枚参数当脚本递归判一次。
1072
+ */
1073
+ const SHELL_WRAPPER_NAMES = /* @__PURE__ */ new Set([
1074
+ "sh",
1075
+ "bash",
1076
+ "zsh",
1077
+ "dash",
1078
+ "ksh",
1079
+ "csh",
1080
+ "fish"
1081
+ ]);
1082
+ /** 壳层旗标里「其后一枚参数是脚本」的那些:`-c`、`-lc`、`-xc`(只认以 c 收尾的短旗标)。 */
1083
+ const SHELL_SCRIPT_FLAG = /^-[^c]*c$/u;
1084
+ /** 递归深度上限:一层脚本里的再一层脚本够了;更深的不判(也不该有)。 */
1085
+ const MAX_SHELL_DEPTH = 2;
1063
1086
  const SEARCH_PREFIX_WORDS = /* @__PURE__ */ new Set([
1064
1087
  "git",
1065
1088
  "xargs",
@@ -1300,6 +1323,16 @@ function consumeGroupChar(char, state) {
1300
1323
  if (state.buffer.length > 0) state.buffer += char;
1301
1324
  else if (char === "(" || char === "{") state.atCommand = true;
1302
1325
  }
1326
+ /**
1327
+ * `$(` 是命令替换的开头:`$` 已经是 buffer 的全部(引号外)时,这一对字符不是词内展开。
1328
+ *
1329
+ * 不拆开的话 `$(grep x y)` 只能切出一枚 `$(grep` token——它对不上任何检索命令名,
1330
+ * 门禁就凭一层括号放行(与注释里那几条“实测过的绕过形态”同一类)。`${DIR}/src` 不受影响:
1331
+ * 那里跟在 `$` 后面的是 `{`,仍按词内展开并进当前 token。
1332
+ */
1333
+ function isCommandSubstitutionOpen(char, state) {
1334
+ return char === "(" && state.quote === "" && state.buffer === "$";
1335
+ }
1303
1336
  /** 引号外、词首的 `#` 起为注释(整段跳到行尾)。 */
1304
1337
  function isCommentStart(char, state) {
1305
1338
  return state.quote === "" && char === "#" && state.buffer.length === 0;
@@ -1425,6 +1458,10 @@ function tokenizeShell(command) {
1425
1458
  else if (COMMAND_BREAK_CHARS.has(char)) {
1426
1459
  flush();
1427
1460
  markCommandBreak(command, index, char, state);
1461
+ } else if (isCommandSubstitutionOpen(char, state)) {
1462
+ state.buffer = "";
1463
+ flush();
1464
+ markCommandBreak(command, index, char, state);
1428
1465
  } else if (GROUP_CHARS.has(char)) consumeGroupChar(char, state);
1429
1466
  else if (REDIRECT_CHARS.has(char)) {
1430
1467
  flush();
@@ -1459,6 +1496,16 @@ function commandPositionIndexes(tokens) {
1459
1496
  }
1460
1497
  return out;
1461
1498
  }
1499
+ /** 取壳层包装那条 `-c` 脚本参数(`bash -c '…'` 里引号内那一整枚 token)。 */
1500
+ function shellScriptArguments(tokens) {
1501
+ const scripts = [];
1502
+ for (const [index, token] of tokens.entries()) {
1503
+ const flag = tokens[index + 1];
1504
+ const script = tokens[index + 2];
1505
+ if (token.atCommand && SHELL_WRAPPER_NAMES.has(baseName(token.text)) && flag !== void 0 && script !== void 0 && SHELL_SCRIPT_FLAG.test(flag.text) && !script.atCommand) scripts.push(script.text);
1506
+ }
1507
+ return scripts;
1508
+ }
1462
1509
  /**
1463
1510
  * 该命令位 token 之后的实参里是否出现路径形状的操作数(旗标不算)。
1464
1511
  * `.` 与 `..` 都算:`grep foo .` 检索的就是当前工作区。
@@ -1491,15 +1538,19 @@ function hasPathOperand(tokens, from) {
1491
1538
  * - shell 关键字(`for … ; do grep`、`if … ; then rg`)不是控制符,其后的
1492
1539
  * grep 不在命令位。壳层赋值(`VAR=1 grep x`)**不**属此列:commandPositionIndexes
1493
1540
  * 把 `VAR=1` 当「跳过但不断链」处理。
1541
+ * - 嵌套只认壳层包装名单里 `-c` 后面那一段,且最多看进去两层;名单外的前缀
1542
+ * (`watch -n 5 grep`)与 `awk 'BEGIN{system("grep x y")}'` 一类不递归。
1494
1543
  */
1495
- function isGrepRgCommand(command) {
1544
+ function isGrepRgCommand(command, depth = 0) {
1496
1545
  const tokens = tokenizeShell(command);
1497
1546
  if (tokens.some((token) => PROBE_FLAGS.has(token.text))) return false;
1498
- return commandPositionIndexes(tokens).some((index) => {
1547
+ if (commandPositionIndexes(tokens).some((index) => {
1499
1548
  const token = tokens[index];
1500
1549
  if (token === void 0 || !GREP_COMMAND_NAMES.has(baseName(token.text))) return false;
1501
1550
  return !(token.piped && !hasPathOperand(tokens, index));
1502
- });
1551
+ })) return true;
1552
+ if (depth >= MAX_SHELL_DEPTH) return false;
1553
+ return shellScriptArguments(tokens).some((script) => isGrepRgCommand(script, depth + 1));
1503
1554
  }
1504
1555
  /**
1505
1556
  * 去掉尾部斜杠的 root 归一化('/' 自身保持 '/')。
@@ -1793,6 +1844,14 @@ function gateReasonAt(indexRoot, cwd, scope, deps, messages) {
1793
1844
  }
1794
1845
  return reason;
1795
1846
  }
1847
+ /**
1848
+ * 索引根已定后的门禁裁决:无索引根 / 检索索引根之外 / 有可扣额度 → 放行
1849
+ * (undefined);否则返回拦截文案。放行会触发 consumeGrep 副作用。
1850
+ * 两个拦截面的「之内/之外」都以**索引根**为准(不是会话工作区):会话开在索引根的
1851
+ * 子目录时,`../sibling` 或 `/repo/other` 相对 cwd 出界、相对索引根却在界内——shell 面
1852
+ * 的 hasExternalTarget 本来就按索引根判,原生 grep 面若按 cwd 判,同样的目标会从
1853
+ * 工具面绕过门禁,两个面各说各话。
1854
+ */
1796
1855
  function buildSearchFirstReason(cwd, scope, deps, messages) {
1797
1856
  const indexRoot = findIndexRoot(cwd, deps.indexProbe, deps.findIndexDepth);
1798
1857
  return indexRoot === void 0 ? void 0 : gateReasonAt(indexRoot, cwd, scope, deps, messages);
@@ -2305,15 +2364,6 @@ function readClientMode(config, messages) {
2305
2364
  // lib/rebuild-remote.ts
2306
2365
  /** 本包作业的 kind(宿主据此发出的 id 形如 `zvec-grep-rebuild-<hex>`)。 */
2307
2366
  const REBUILD_JOB_KIND = "zvec-grep-rebuild";
2308
- /**
2309
- * 本 kind 在注册表里的**已落定**记录上限:每次 start 前先剪到 `MAX-1` 条,新那条落定后
2310
- * 正好 `MAX` 条在册(文案与卡片拒绝提示都按这个数说)。同时能跑几个不在这里——那是
2311
- * 注册表的容量闸(实测未拥有桶 10,满员是**拒绝**新 start,不是淘汰旧的)。官方件**不会**
2312
- * 自行回收落定记录("A settled record stays listed until its owner's disposal, service
2313
- * disposal, or an explicit remove"),而注册表又随宿主活着、不随本插件卸载而死 ⇒ 这条
2314
- * 裁剪是本包的责任。
2315
- */
2316
- const REBUILD_HISTORY_MAX = 10;
2317
2367
  /** 卡片视图的尾部长度(打标文案在 lib/messages.ts,随语言走)。 */
2318
2368
  const JOB_OUT_VIEW_CHARS = 4e3;
2319
2369
  /** 从名册投影推导身份证(官方 `JobView` 的三段稳定事实)。 */
@@ -2637,8 +2687,11 @@ async function spawnIndexWrite(routes, started, indexArgs, embedding) {
2637
2687
  /**
2638
2688
  * 把起来的那条进程登记进官方注册表与本包侧表,交回宿主签发的 id。
2639
2689
  *
2640
- * 三种失败(注册表换人 / 同名不同命 / start 抛错)都**先把那条进程杀掉**再交回错误:
2690
+ * 两类失败(注册表缺席 / start 或登记抛错)都**先把那条进程杀掉**再交回错误:
2641
2691
  * 此刻作业没进名册,没人能通过 job 工具收它,不杀就是一条孤儿 zg 占着这棵树的写锁。
2692
+ * (没有「同 id 撞车」那一臂:jobId 由宿主签发,见 records.set 前的注释。)
2693
+ * start 之后 get 抛错时同样先杀——但那条作业可能已登记进官方注册表,本包侧表
2694
+ * 看不见它,要等注册表自身的 prune 兜底。
2642
2695
  * 同样地,本函数不释放占位——那件事由调用方做。
2643
2696
  * @param routes 本次注册的共享依赖(jobsOf 现读、侧表引用)
2644
2697
  * @param root 已过前置校验的工作区(写进侧表供卡片回显)
@@ -2830,7 +2883,7 @@ var ZvecRebuildService = class extends TypertRemoteService {
2830
2883
  const record = typeof raw === "string" && raw.length > 0 ? this.deps.records.get(raw) : void 0;
2831
2884
  if (record === void 0) return {
2832
2885
  ok: false,
2833
- error: fill(marks.unknownJobId, { maxJobs: REBUILD_HISTORY_MAX }),
2886
+ error: fill(marks.unknownJobId, { maxJobs: 10 }),
2834
2887
  status: 404
2835
2888
  };
2836
2889
  const jobs = this.deps.jobsOf();
@@ -2842,12 +2895,12 @@ var ZvecRebuildService = class extends TypertRemoteService {
2842
2895
  const output = readRebuildOutput(jobs, record.id);
2843
2896
  if (output === null) return {
2844
2897
  ok: false,
2845
- error: fill(marks.unknownJobId, { maxJobs: REBUILD_HISTORY_MAX }),
2898
+ error: fill(marks.unknownJobId, { maxJobs: 10 }),
2846
2899
  status: 404
2847
2900
  };
2848
2901
  if (!sameJob(record.state, output.view)) return {
2849
2902
  ok: false,
2850
- error: fill(marks.unknownJobId, { maxJobs: REBUILD_HISTORY_MAX }),
2903
+ error: fill(marks.unknownJobId, { maxJobs: 10 }),
2851
2904
  status: 404
2852
2905
  };
2853
2906
  const { view, retained } = output;
@@ -3592,7 +3645,14 @@ const INDEX_PROBE_CACHE_MAX = 32;
3592
3645
  */
3593
3646
  function createIndexProbeCache(probe, now = Date.now, ttlMs = INDEX_PROBE_TTL_MS, max = 32) {
3594
3647
  const cache = /* @__PURE__ */ new Map();
3595
- return (dir) => {
3648
+ /** 显式失效通道:zg_index 的 drop / 重建成功会真删真建 `.zvec-grep/`,缓存的
3649
+ * `result: true` 若只等 TTL 过期,60 秒内门禁仍按「已建索引」拦 grep/rg,
3650
+ * findIndexRoot 也仍走索引通道(实际会以 WORKSPACE_INDEX_NOT_FOUND 失败)——
3651
+ * 模型被卡在既搜不到也 grep 不了的窗口里。 */
3652
+ const invalidate = (dir) => {
3653
+ cache.delete(dir);
3654
+ };
3655
+ const cached = (dir) => {
3596
3656
  const at = now();
3597
3657
  const hit = cache.get(dir);
3598
3658
  if (hit !== void 0 && at - hit.probedAt < ttlMs) {
@@ -3608,6 +3668,8 @@ function createIndexProbeCache(probe, now = Date.now, ttlMs = INDEX_PROBE_TTL_MS
3608
3668
  evictAged(cache, max, (entry) => entry.probedAt + ttlMs, at);
3609
3669
  return result;
3610
3670
  };
3671
+ cached.invalidate = invalidate;
3672
+ return cached;
3611
3673
  }
3612
3674
  /**
3613
3675
  * 工作区白名单:只认本 daemon 真实观测过的会话工作区(重建与 root 授权共用)。
@@ -4063,12 +4125,14 @@ async function runIndexTool(runtime, args, exec, messages) {
4063
4125
  try {
4064
4126
  assertIgnoreFilesExist(indexArgs, root, messages);
4065
4127
  const { command, workdir } = buildIndexCommand(indexArgs, readDefaultEmbedding(config), messages, readClientMode(config, messages), allowRemoteEmbedding(config));
4066
- return { text: await runForeground(host, command, workdir, config.indexTimeoutMs, {
4128
+ const text = await runForeground(host, command, workdir, config.indexTimeoutMs, {
4067
4129
  signal: exec.signal,
4068
4130
  env: zgEnv(config),
4069
4131
  stdoutMaxBytes: config.stdoutMaxBytes,
4070
4132
  messages
4071
- }) };
4133
+ });
4134
+ runtime.indexProbe.invalidate(root);
4135
+ return { text };
4072
4136
  } finally {
4073
4137
  if (foregroundClaim !== void 0) rebuilds.release(root, foregroundClaim);
4074
4138
  }
@@ -4106,7 +4170,7 @@ async function runStatusTool(runtime, args, exec, messages) {
4106
4170
  root,
4107
4171
  checkReady
4108
4172
  }, messages, readClientMode(config, messages));
4109
- return { text: `${await runForeground(host, command, workdir, config.statusTimeoutMs, {
4173
+ const text = await runForeground(host, command, workdir, config.statusTimeoutMs, {
4110
4174
  signal: exec.signal,
4111
4175
  env: zgEnv(config),
4112
4176
  stdoutMaxBytes: config.stdoutMaxBytes,
@@ -4125,7 +4189,12 @@ async function runStatusTool(runtime, args, exec, messages) {
4125
4189
  detail: failure
4126
4190
  })}` : null;
4127
4191
  } } : {}
4128
- })}\n${await runtime.serverGate.ready() ? messages.serverReadyNote : messages.serverUnavailableNote}` };
4192
+ });
4193
+ const mode = readClientMode(config, messages);
4194
+ const ready = await runtime.serverGate.ready();
4195
+ let daemonNote = null;
4196
+ if (mode !== "direct") daemonNote = ready ? messages.serverReadyNote : messages.serverUnavailableNote;
4197
+ return daemonNote === null ? { text } : { text: `${text}\n${daemonNote}` };
4129
4198
  }
4130
4199
  function registerStatusTool(runtime, registered) {
4131
4200
  define(runtime.host, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayyuen66/dsh-zvec-grep",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "dsh 工作区语义检索插件(zg):zg_search / zg_index / zg_status + 本地 embedding 设置卡片 + systemPrompt 路由规则 + guard 安全兜底。",
5
5
  "keywords": [
6
6
  "cordis",
@@ -51,69 +51,68 @@
51
51
  "registry": "https://registry.npmjs.org"
52
52
  },
53
53
  "dependencies": {
54
- "@jayyuen66/dsh-plugin-shared": "0.2.2",
54
+ "@jayyuen66/dsh-plugin-shared": "^0.2.4",
55
55
  "zod": "4.6.7"
56
56
  },
57
57
  "devDependencies": {
58
- "@deepseek-ai/cordis": "4.0.6-alpha.1",
59
- "@deepseek-ai/cordis-plugin-group": "1.0.6-alpha.1",
60
- "@deepseek-ai/cordis-plugin-timer": "1.1.8-alpha.1",
61
- "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
62
- "@deepseek-ai/dsh-api-remotes": "0.2.2-alpha.2",
63
- "@deepseek-ai/dsh-bash-local": "0.2.2-alpha.2",
64
- "@deepseek-ai/dsh-client-locale": "0.2.2-alpha.2",
65
- "@deepseek-ai/dsh-client-store": "0.2.2-alpha.2",
66
- "@deepseek-ai/dsh-client-ui-layout": "0.2.2-alpha.2",
67
- "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-alpha.2",
68
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-alpha.2",
69
- "@deepseek-ai/dsh-client-ui-settings": "0.2.2-alpha.2",
70
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-alpha.2",
71
- "@deepseek-ai/dsh-host-webserver": "0.2.2-alpha.2",
72
- "@deepseek-ai/dsh-http-proxy": "0.2.2-alpha.2",
73
- "@deepseek-ai/dsh-jobs": "0.2.2-alpha.2",
74
- "@deepseek-ai/dsh-jobs-local": "0.2.2-alpha.2",
75
- "@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
76
- "@deepseek-ai/dsh-output-retention": "0.2.2-alpha.2",
77
- "@deepseek-ai/dsh-package-manifest": "0.2.2-alpha.2",
78
- "@deepseek-ai/dsh-ptc-runtime": "0.2.2-alpha.2",
79
- "@deepseek-ai/dsh-sandbox": "0.2.2-alpha.2",
80
- "@deepseek-ai/dsh-scope": "0.2.2-alpha.2",
81
- "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
82
- "@deepseek-ai/dsh-session-projection": "0.2.2-alpha.2",
83
- "@deepseek-ai/dsh-settings": "0.2.2-alpha.2",
84
- "@deepseek-ai/dsh-shell": "0.2.2-alpha.2",
85
- "@deepseek-ai/dsh-subprocess": "0.2.2-alpha.2",
86
- "@deepseek-ai/dsh-subprocess-local": "0.2.2-alpha.2",
87
- "@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.2",
88
- "@deepseek-ai/dsh-timeout": "0.2.2-alpha.2",
89
- "@deepseek-ai/dsh-tool-executor-native": "0.2.2-alpha.2",
90
- "@deepseek-ai/dsh-tools": "0.2.2-alpha.2",
91
- "@deepseek-ai/dsh-typert-protocol": "0.2.2-alpha.2",
92
- "@deepseek-ai/dsh-user-approval": "0.2.2-alpha.2",
93
- "@deepseek-ai/schemastery": "3.18.6-alpha.1",
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.1",
62
+ "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.1",
63
+ "@deepseek-ai/dsh-bash-local": "0.2.2-rc.1",
64
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.1",
65
+ "@deepseek-ai/dsh-client-store": "0.2.2-rc.1",
66
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.1",
67
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.2-rc.1",
68
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.1",
69
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.1",
70
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
71
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
72
+ "@deepseek-ai/dsh-http-proxy": "0.2.2-rc.1",
73
+ "@deepseek-ai/dsh-jobs": "0.2.2-rc.1",
74
+ "@deepseek-ai/dsh-jobs-local": "0.2.2-rc.1",
75
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.1",
76
+ "@deepseek-ai/dsh-output-retention": "0.2.2-rc.1",
77
+ "@deepseek-ai/dsh-package-manifest": "0.2.2-rc.1",
78
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
79
+ "@deepseek-ai/dsh-scope": "0.2.2-rc.1",
80
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1",
81
+ "@deepseek-ai/dsh-session-projection": "0.2.2-rc.1",
82
+ "@deepseek-ai/dsh-settings": "0.2.2-rc.1",
83
+ "@deepseek-ai/dsh-shell": "0.2.2-rc.1",
84
+ "@deepseek-ai/dsh-subprocess": "0.2.2-rc.1",
85
+ "@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.1",
86
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.1",
87
+ "@deepseek-ai/dsh-timeout": "0.2.2-rc.1",
88
+ "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.1",
89
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1",
90
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.1",
91
+ "@deepseek-ai/dsh-user-approval": "0.2.2-rc.1",
92
+ "@deepseek-ai/schemastery": "3.19.0",
94
93
  "@e18e/eslint-plugin": "0.8.1",
95
94
  "@types/node": "26.6.6",
96
95
  "@types/react": "19.3.0",
97
- "@vitest/coverage-v8": "5.0.5",
98
- "eslint-plugin-regexp": "3.3.2",
96
+ "@vitest/coverage-v8": "5.1.0",
97
+ "eslint-plugin-regexp": "3.3.3",
99
98
  "eslint-plugin-sonarjs": "4.2.2",
100
99
  "eslint-plugin-zod": "5.2.2",
101
100
  "fast-check": "4.10.2",
102
- "oxfmt": "0.75.0",
103
- "oxlint": "1.90.0",
101
+ "oxfmt": "0.76.0",
102
+ "oxlint": "1.91.0",
104
103
  "oxlint-tsgolint": "7.0.2005",
105
104
  "react": "^19.3.0",
106
- "rolldown": "1.2.15",
105
+ "rolldown": "1.2.16",
107
106
  "typescript": "7.0.2",
108
- "vite": "8.3.5",
109
- "vitest": "5.0.5"
107
+ "vite": "8.3.6",
108
+ "vitest": "5.1.0"
110
109
  },
111
110
  "peerDependencies": {
112
- "@deepseek-ai/dsh": "^0.2.1-rc.3",
113
- "@deepseek-ai/dsh-output-retention": "^0.2.1-rc.3",
114
- "@deepseek-ai/dsh-scope": "^0.2.1-rc.3",
115
- "@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.3",
116
- "@deepseek-ai/schemastery": "^3.18.6-alpha.1"
111
+ "@deepseek-ai/dsh": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
112
+ "@deepseek-ai/dsh-output-retention": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
113
+ "@deepseek-ai/dsh-scope": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
114
+ "@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
115
+ "@deepseek-ai/schemastery": "^3.18.5 || ^3.18.6-alpha.1"
117
116
  },
118
117
  "peerDependenciesMeta": {
119
118
  "@deepseek-ai/dsh": {
@@ -122,8 +121,8 @@
122
121
  },
123
122
  "icon": "icon.svg",
124
123
  "engines": {
125
- "dsh": "^0.2.1-rc.3",
126
- "node": ">=22.12.0"
124
+ "dsh": "^0.2.1-rc.5 || ^0.2.2-alpha.3",
125
+ "node": ">=24.9.0"
127
126
  },
128
127
  "dsh": {
129
128
  "manifestVersion": 1,
@@ -132,7 +131,10 @@
132
131
  },
133
132
  "client": {
134
133
  "platform": "web",
135
- "immediately": true
134
+ "immediately": true,
135
+ "external": [
136
+ "@jayyuen66/dsh-plugin-shared/client"
137
+ ]
136
138
  }
137
139
  },
138
140
  "scripts": {