@wu529778790/open-im 0.2.10 → 0.2.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.
@@ -159,14 +159,20 @@ export class SessionManager {
159
159
  const drivePathMatch = targetDir.match(/^([a-zA-Z]):(.*)$/);
160
160
  if (drivePathMatch) {
161
161
  const [, drive, rest] = drivePathMatch;
162
- // 如果 rest 为空或以 \ 或 / 开头,则是驱动器根目录的绝对路径
163
- // 如果 rest 不为空且不以 \ 或 / 开头,则是驱动器当前目录的相对路径
164
- if (rest === '' || rest.startsWith('/') || rest.startsWith('\\')) {
165
- resolved = `${drive}:${rest}`;
162
+ // 使用 resolve 确保路径格式正确
163
+ // 如果 rest 为空,则是驱动器根目录
164
+ // 如果 rest 不为空,resolve 会正确处理斜杠
165
+ const driveRoot = `${drive}:`;
166
+ if (rest === '') {
167
+ resolved = driveRoot;
168
+ }
169
+ else if (rest.startsWith('/') || rest.startsWith('\\')) {
170
+ // 已是绝对路径,直接使用
171
+ resolved = `${drive}${rest}`;
166
172
  }
167
173
  else {
168
- // 需要获取该驱动器的当前目录,这里简化处理,当作绝对路径
169
- resolved = `${drive}:${rest}`;
174
+ // 相对于驱动器根目录的路径,使用 resolve 处理
175
+ resolved = resolve(driveRoot, rest);
170
176
  }
171
177
  }
172
178
  else if (targetDir === '~' || targetDir.startsWith('~/')) {
@@ -175,7 +181,7 @@ export class SessionManager {
175
181
  resolved = join(home, targetDir.slice(1));
176
182
  }
177
183
  else if (targetDir.startsWith('/') || (targetDir.length >= 3 && targetDir[1] === ':' && (targetDir[2] === '\\' || targetDir[2] === '/'))) {
178
- // 绝对路径
184
+ // 绝对路径(包括 Windows 绝对路径)
179
185
  resolved = targetDir;
180
186
  }
181
187
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, Cursor)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",