dsh-zspace 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # 变更日志
2
2
 
3
+ ## 0.3.2 — 2026-10-11
4
+
5
+ 修正**注入给模型的指南**滞后于工具演进的问题(只影响文档文案,行为不变):
6
+
7
+ - `lib/prompt.js`:补 `zspace_write`;说明两条通道与自动选路(并指向 `zspace_status` 的 `transport` / `webdavProbe`);修正"删除必进回收站"的说法——云中转通道进回收站,**WebDAV 直连通道由 NAS 侧决定**,要确保可找回就先确认通道或临时 `transportMode: relay`。
8
+ - `lib/tools/remove.js`:工具描述与渲染同步标注该通道差异。
9
+ - 起因:收尾复核时发现系统提示里的工具清单还停在 0.1.x(缺 `zspace_write`、把回收站语义写死),会误导每个新会话。
10
+
3
11
  ## 0.3.1 — 2026-10-07
4
12
 
5
13
  - WebDAV 地址也支持环境变量 `ZS_WEBDAV_URL`:**三个环境变量即可启用直连,零 patch 改动**(避开 profile 层同 id 插两次导致挂载两次的坑);`zspace_status` 报告统一走同一取值。
package/lib/prompt.js CHANGED
@@ -15,12 +15,13 @@ function guideText(config) {
15
15
  const down = config.downloadDir || "~/Downloads/zspace";
16
16
  return [
17
17
  "### 极空间 NAS(dsh-zspace)",
18
- "已通过极空间桌面客户端的本地代理接入这台 NAS,**跨网络可用**(不需要同一局域网、WebDAV 或 SSH,仅要求本机桌面客户端保持登录)。",
18
+ "这台 NAS 有两条通道,插件自动选路:**同一网络时直连 WebDAV**(更快、不依赖桌面客户端),**跨网络时走桌面客户端云中转**。当前在用哪条、以及另一条为什么没选,跑 `zspace_status` 看(它的 transport / webdavProbe 字段)。跨网络只要求桌面客户端保持登录。",
19
19
  "- 远程路径写法:`home:`=个人空间根、`public:`=公共空间根、相对路径=相对个人空间、以 `/` 开头=NAS 绝对路径;两个根的真实位置先跑 `zspace_status` 查看。",
20
20
  "- 只读:`zspace_ls`(支持 depth 递归)、`zspace_stat`、`zspace_find`(按名称在目录树里遍历查找,受 depth/scanLimit 预算限制,结果里会报告扫了多少项)、`zspace_read`(小文本读入上下文)、`zspace_download`(下载到本机,默认 " +
21
21
  down +
22
22
  ")。",
23
- "- 写入:`zspace_upload`(大文件自动分片、支持中文名)、`zspace_mkdir`、`zspace_rename`、`zspace_move`、`zspace_copy`、`zspace_remove`(进回收站,必须显式 confirm=true)。",
23
+ "- 写入:`zspace_upload`(本地文件,大文件自动分片,支持中文名)、`zspace_write`(**文本直接写进 NAS**,省掉本地临时文件;默认覆盖,`overwrite: false` 时拒绝覆盖)、`zspace_mkdir`、`zspace_rename`、`zspace_move`、`zspace_copy`、`zspace_remove`(必须显式 confirm=true)。",
24
24
  "- 删除/移动/重命名属于破坏性操作:先用 `zspace_ls` 或 `zspace_stat` 核实目标,再执行;批量删除前先向用户确认。",
25
+ "- 删除语义随通道而变:云中转通道进 NAS 回收站;**WebDAV 直连通道由 NAS 侧决定**(通常不进回收站)。要确保可找回,就先用 `zspace_status` 确认当前通道,或临时把 `transportMode` 设为 `relay`。",
25
26
  ].join("\n");
26
27
  }
@@ -9,7 +9,7 @@ export function createRemoveTool(ctx) {
9
9
  return {
10
10
  name: "zspace_remove",
11
11
  description:
12
- "Delete files or directories from the 极空间 / ZSpace NAS. The NAS moves them to its recycle bin. Requires confirm=true so a bulk delete can never be a slip; ask the user before removing anything they did not name explicitly.",
12
+ "Delete files or directories from the 极空间 / ZSpace NAS. On the relay transport they land in the NAS recycle bin; on the direct WebDAV transport the NAS decides (usually permanent) — check zspace_status to see which transport is active. Requires confirm=true so a bulk delete can never be a slip; ask the user before removing anything they did not name explicitly.",
13
13
  parameters: {
14
14
  paths: { type: "array", required: true, items: { type: "string" }, description: "Paths to delete." },
15
15
  confirm: { type: "boolean", required: true, description: "Must be true — explicit confirmation that these paths should be deleted." },
@@ -24,7 +24,12 @@ export function createRemoveTool(ctx) {
24
24
  },
25
25
  },
26
26
  call: (args) => ({ card: "generic", title: `zspace_remove ${(args.paths ?? []).length} 项`, kind: "edit" }),
27
- render: (_args, value) => [{ type: "text", text: `已删除 ${value.count} 项(进回收站):\n${value.paths.join("\n")}` }],
27
+ render: (_args, value) => [
28
+ {
29
+ type: "text",
30
+ text: `已删除 ${value.count} 项(云中转通道进回收站;WebDAV 直连通道由 NAS 侧决定):\n${value.paths.join("\n")}`,
31
+ },
32
+ ],
28
33
  execute: (args) =>
29
34
  guarded(async () => {
30
35
  if (args.confirm !== true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-zspace",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "极空间(ZSpace)NAS plugin for DeepSeek Harness: cross-network agent tools for browsing, searching, reading, uploading and organizing NAS files through the desktop client's relay — no LAN, no WebDAV, no SSH, no Python.",
5
5
  "type": "module",
6
6
  "license": "MIT",