@deepseek-ai/dsh-util-workspace-path 0.1.2-alpha.5 → 0.1.3-alpha.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/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/util/workspace-path/README.md
5
- README.md: 72addf2d85c62ef5afbfc4824af8c96c59bfbecb
6
- README.zh.md: 2a115f1a9dbdb23b7121dea41eb6da75b1515358
5
+ README.md: 1b09bda74c8836655789c57fa05d03a2892c16b9
6
+ README.zh.md: 25128e5fec504e1724f5cc7952fed976985912d5
package/README.md CHANGED
@@ -22,7 +22,7 @@ Browser-safe path helpers shared by Workspace-facing client and controller packa
22
22
 
23
23
  <a id="known-limitations-and-deferred-work"></a>
24
24
 
25
- - **Resolution is lexical** — it recognizes POSIX absolute paths, Windows drive paths, and UNC paths but does not access a filesystem or canonicalize `.` and `..` segments.
25
+ - **Resolution is lexical** — it recognizes POSIX absolute paths, Windows drive paths, and UNC paths, preserves the Workspace path's separator when joining a relative path, and does not access a filesystem or canonicalize `.` and `..` segments.
26
26
  - **Home abbreviation is POSIX-only** — Windows paths remain unchanged because a portable browser cannot infer Windows home-path equivalence safely.
27
27
 
28
28
 
package/README.zh.md CHANGED
@@ -22,7 +22,7 @@ kind: "package-library"
22
22
 
23
23
  <a id="known-limitations-and-deferred-work"></a>
24
24
 
25
- - **路径解析仅处理字面值**——它识别 POSIX 绝对路径、Windows 盘符路径和 UNC 路径,但不访问文件系统,也不规范化 `.` 与 `..` 路径段。
25
+ - **路径解析仅处理字面值**——它识别 POSIX 绝对路径、Windows 盘符路径和 UNC 路径,拼接相对路径时保留 Workspace 路径的分隔符,但不访问文件系统,也不规范化 `.` 与 `..` 路径段。
26
26
  - **主目录缩写仅支持 POSIX**——Windows 路径保持不变,因为可移植浏览器无法安全推断 Windows 主目录路径等价关系。
27
27
 
28
28
 
package/lib/index.js CHANGED
@@ -16,7 +16,8 @@ function isWindowsStylePath(value) {
16
16
  function resolveWorkspacePath(cwd, path) {
17
17
  if (path.startsWith("/") || isWindowsStylePath(path)) return path;
18
18
  if (cwd === void 0 || cwd === "") return path;
19
- return `${cwd.replace(/[/\\]+$/, "")}/${path.replace(/^[/\\]+/, "")}`;
19
+ const separator = isWindowsStylePath(cwd) && cwd.includes("\\") ? "\\" : "/";
20
+ return `${cwd.replace(/[/\\]+$/, "")}${separator}${path.replace(/^[/\\]+/, "")}`;
20
21
  }
21
22
  /**
22
23
  * Abbreviate a POSIX home directory for display.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-util-workspace-path",
3
3
  "description": "Browser-safe Workspace path and display helpers",
4
- "version": "0.1.2-alpha.5",
4
+ "version": "0.1.3-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },