@jayyuen66/dsh-zvec-grep 0.1.18 → 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 +15 -0
- package/README.md +11 -4
- package/README.zh-CN.md +11 -4
- package/client.js +1 -1766
- package/cordis.patch.yml +4 -0
- package/docs/DETAIL.md +7 -1
- package/docs/DETAIL.zh.md +7 -1
- package/host.js +9 -8
- package/package.json +56 -50
package/cordis.patch.yml
CHANGED
|
@@ -12,5 +12,9 @@
|
|
|
12
12
|
# 行按裸包名引用本包(client-modules 只扫描裸包名条目的 dsh.client 声明)。
|
|
13
13
|
# 注意 pnpm ≥12.3.0:12.0.0 的 add 本地目录有 #14437 bug。
|
|
14
14
|
- insert:
|
|
15
|
+
# 固定 id:该供应行必须保持开启;停用后本包设置卡会失去 shared 客户端供应。
|
|
16
|
+
# 多个插件共用同一个 id,宿主会把开关标成“无法唯一定位”并禁用。
|
|
17
|
+
- id: dsh-plugin-shared
|
|
18
|
+
name: "@jayyuen66/dsh-plugin-shared"
|
|
15
19
|
- id: zvec-grep
|
|
16
20
|
name: "@jayyuen66/dsh-zvec-grep"
|
package/docs/DETAIL.md
CHANGED
|
@@ -24,7 +24,7 @@ The card's Rebuild button runs the equivalent of `zg --index --rebuild` for a wo
|
|
|
24
24
|
|
|
25
25
|
Eleven deployment values stay off the card: `searchTimeoutMs` (300000), `statusTimeoutMs` (60000), `indexTimeoutMs` (600000), `stdoutMaxBytes` (400000), `rebuildWaitMs` (120000), `clientMode` (`auto` / `direct` / `server`), `daemonUrl` (`http://127.0.0.1:7999/mcp`, the MCP transport's daemon endpoint), `allowRemoteEmbedding` (false), `remoteEmbeddingEndpoint`, `remoteEmbeddingApiKeyFrom`, `requireApprovalForExplicitRoot` (false). None of these eleven 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.
|
|
26
26
|
|
|
27
|
-
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` (added automatically by this plugin to remote-reference index commands once the deployment switch is on) or a one-time persistent `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`; the card components
|
|
27
|
+
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` (added automatically by this plugin to remote-reference index commands once the deployment switch is on) or a one-time persistent `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 the `dsh-plugin-shared` supplier row plus that row's `id` / `name`; the card components come from the shared client row, externalized as `@jayyuen66/dsh-plugin-shared/client`); they take effect on restart.
|
|
28
28
|
|
|
29
29
|
## What it needs from outside
|
|
30
30
|
|
|
@@ -33,3 +33,9 @@ The external `zg` CLI (`@zvec/zvec-grep`, installed with `npm install -g @zvec/z
|
|
|
33
33
|
## Further detail
|
|
34
34
|
|
|
35
35
|
The error-code table, the argument guards and the background-job surface are in the package README (`README.md` / `README.zh-CN.md`).
|
|
36
|
+
|
|
37
|
+
## Feedback
|
|
38
|
+
|
|
39
|
+
Issues and pull requests are welcome: [https://github.com/JayYuen666/dsh-zvec-grep/issues](https://github.com/JayYuen666/dsh-zvec-grep/issues).
|
|
40
|
+
|
|
41
|
+
If a plugin fails to boot, include the dsh host version, the profile install shape, and the browser console line. The `missed the module table` line is especially useful: it tells us whether the shared client row was materialized.
|
package/docs/DETAIL.zh.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
十一项部署值刻意不进设置卡:`searchTimeoutMs`(300000)、`statusTimeoutMs`(60000)、`indexTimeoutMs`(600000)、`stdoutMaxBytes`(400000)、`rebuildWaitMs`(120000)、`clientMode`(`auto` / `direct` / `server`)、`daemonUrl`(`http://127.0.0.1:7999/mcp`,MCP 传输的守护进程端点)、`allowRemoteEmbedding`(false)、`remoteEmbeddingEndpoint`、`remoteEmbeddingApiKeyFrom`、`requireApprovalForExplicitRoot`(false)。这十一项在卡上没有入口,能生效的只有下一段那条注册行 `config:`;优先级是注册行 `config:` > 代码里的 `.default()`。
|
|
26
26
|
|
|
27
|
-
「工作区内容能不能离开本机」被当成部署决定,而不是给模型选的开关,所以远程嵌入那三枚既不在卡上也不在工具参数里;即便开了,`zg` 自己仍要求 `--allow-remote`(部署开放后本插件在远程引用的索引命令上自动补)或一次 `zg --auth grant` 持久授权。这些值都写在**自己 profile 的 `cordis.yml`** 里本插件注册行的 `config:` 块(随包那份 `cordis.patch.yml`
|
|
27
|
+
「工作区内容能不能离开本机」被当成部署决定,而不是给模型选的开关,所以远程嵌入那三枚既不在卡上也不在工具参数里;即便开了,`zg` 自己仍要求 `--allow-remote`(部署开放后本插件在远程引用的索引命令上自动补)或一次 `zg --auth grant` 持久授权。这些值都写在**自己 profile 的 `cordis.yml`** 里本插件注册行的 `config:` 块(随包那份 `cordis.patch.yml` 带 `dsh-plugin-shared` 供应行与本行的 `id` / `name`;卡片组件来自 shared 客户端行,以 `@jayyuen66/dsh-plugin-shared/client` 外置),改值随重启生效。
|
|
28
28
|
|
|
29
29
|
## 需要外部提供什么
|
|
30
30
|
|
|
@@ -33,3 +33,9 @@
|
|
|
33
33
|
## 更完整的说明
|
|
34
34
|
|
|
35
35
|
参数守卫、`root`判据与后台作业那一节都写在随包 README(`README.md` / `README.zh-CN.md`)。README 没有独立的错误码表:`zg` 不在 PATH 上按 `exit 127` 归到「未安装」(见「外部依赖」一节),其余失败按工具回执里的 `reason` 读。
|
|
36
|
+
|
|
37
|
+
## 反馈
|
|
38
|
+
|
|
39
|
+
欢迎提 issue 和 PR:[https://github.com/JayYuen666/dsh-zvec-grep/issues](https://github.com/JayYuen666/dsh-zvec-grep/issues)。
|
|
40
|
+
|
|
41
|
+
插件启动失败时,请附上 dsh 宿主版本、profile 安装形态和浏览器控制台原文。`missed the module table` 这一行尤其有用:它能直接说明 shared 客户端供应行有没有被物化。
|
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";
|
|
@@ -2525,7 +2526,8 @@ const SKILL_NAME = "zvec-grep";
|
|
|
2525
2526
|
*
|
|
2526
2527
|
* 文案随调用点传入而不是在这里取:语言由 apply 时的官方 locale 偏好决定,与工具描述、
|
|
2527
2528
|
* 参数说明同源——三处各取一次就会出现「工具描述是中文、skill 正文是英文」那种错位。
|
|
2528
|
-
* @param ctx - 只需 `get`(读可选服务),不要求 skills 进 inject
|
|
2529
|
+
* @param ctx - 只需 `get`(读可选服务),不要求 skills 进 inject;带上 `effect` 时注册的
|
|
2530
|
+
* 撤销权交给插件 fiber(见文件头)
|
|
2529
2531
|
* @param content - 规则全文(`messages.routingText`)
|
|
2530
2532
|
* @param description - skill 目录里那行说明(模型据此决定要不要加载)
|
|
2531
2533
|
* @returns 注册成功与否;未装载 skill 服务或正文为空时为 false(不抛,摘要段照旧生效)
|
|
@@ -3450,18 +3452,17 @@ async function readPersistedToken(file) {
|
|
|
3450
3452
|
return token;
|
|
3451
3453
|
}
|
|
3452
3454
|
/**
|
|
3453
|
-
* 原子写入 token
|
|
3454
|
-
*
|
|
3455
|
+
* 原子写入 token,权限 0600。原子替换本体交官方 `writeFileAtomic`(同目录随机后缀临时件 +
|
|
3456
|
+
* rename;`wx` 独占创建保证新建 inode 必带 mode,失败自带临时件清理,win32 对瞬态 rename
|
|
3457
|
+
* 错误退避重试)。失败**不外抛**:持久化只是恢复路径的增强,写不进去时本次会话仍用内存
|
|
3458
|
+
* token,恢复退化为 daemonStartFailed 的指引——官方件抛错,吞错语义由本函数这一层保持。
|
|
3455
3459
|
* @param file 目标路径
|
|
3456
3460
|
* @param token 待写入的 token
|
|
3457
3461
|
* @returns 是否写入成功(测试用;生产调用可忽略)
|
|
3458
3462
|
*/
|
|
3459
3463
|
async function persistToken(file, token) {
|
|
3460
3464
|
try {
|
|
3461
|
-
await
|
|
3462
|
-
const temporary = `${file}.${String(process.pid)}.tmp`;
|
|
3463
|
-
await writeFile(temporary, token, { mode: 384 });
|
|
3464
|
-
await rename(temporary, file);
|
|
3465
|
+
await writeFileAtomic(file, token, { mode: 384 });
|
|
3465
3466
|
return true;
|
|
3466
3467
|
} catch {
|
|
3467
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": {
|
|
@@ -134,7 +137,10 @@
|
|
|
134
137
|
},
|
|
135
138
|
"client": {
|
|
136
139
|
"platform": "web",
|
|
137
|
-
"immediately": true
|
|
140
|
+
"immediately": true,
|
|
141
|
+
"external": [
|
|
142
|
+
"@jayyuen66/dsh-plugin-shared/client"
|
|
143
|
+
]
|
|
138
144
|
}
|
|
139
145
|
},
|
|
140
146
|
"scripts": {
|