@ekay/claude-im 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import chalk from 'chalk';
3
3
  import { readFileSync, existsSync, unlinkSync, writeFileSync, readdirSync, mkdirSync, chmodSync } from 'fs';
4
4
  import { dirname, resolve, basename } from 'path';
5
+ import { homedir } from 'os';
5
6
  import { randomBytes, createCipheriv, createDecipheriv } from 'crypto';
6
7
  import { load, dump } from 'js-yaml';
7
8
  import readline from 'readline';
@@ -72,7 +73,7 @@ __export(lock_exports, {
72
73
  releaseLock: () => releaseLock
73
74
  });
74
75
  function getLockDir() {
75
- const home = process.env.CLAUDE_IM_HOME || resolve(process.env.HOME || "~", ".claude-im");
76
+ const home = process.env.CLAUDE_IM_HOME || resolve(homedir(), ".claude-im");
76
77
  return home;
77
78
  }
78
79
  function acquireLock(profile, cwd) {
@@ -210,7 +211,7 @@ var init_env = __esm({
210
211
  }
211
212
  });
212
213
  function getKeyPath() {
213
- const home = process.env.CLAUDE_IM_HOME || resolve(process.env.HOME || "~", ".claude-im");
214
+ const home = process.env.CLAUDE_IM_HOME || resolve(homedir(), ".claude-im");
214
215
  return resolve(home, ".key");
215
216
  }
216
217
  function loadOrCreateKey() {
@@ -362,7 +363,7 @@ var init_loader = __esm({
362
363
  init_env();
363
364
  init_crypto();
364
365
  init_logger();
365
- HOME = process.env.CLAUDE_IM_HOME || resolve(process.env.HOME || "~", ".claude-im");
366
+ HOME = process.env.CLAUDE_IM_HOME || resolve(homedir(), ".claude-im");
366
367
  GLOBAL_CONFIG_PATH = resolve(HOME, "config.yml");
367
368
  VAULT_DIR = resolve(HOME, "vault");
368
369
  }
@@ -457,7 +458,7 @@ var init_interactive = __esm({
457
458
  init_loader();
458
459
  init_logger();
459
460
  init_registry();
460
- HOME2 = process.env.CLAUDE_IM_HOME || resolve(process.env.HOME || "~", ".claude-im");
461
+ HOME2 = process.env.CLAUDE_IM_HOME || resolve(homedir(), ".claude-im");
461
462
  GLOBAL_CONFIG_PATH2 = resolve(HOME2, "config.yml");
462
463
  }
463
464
  });
@@ -477,7 +478,7 @@ var init_config = __esm({
477
478
  }
478
479
  });
479
480
  function getStateDir() {
480
- const home = process.env.CLAUDE_IM_HOME || resolve(process.env.HOME || "~", ".claude-im");
481
+ const home = process.env.CLAUDE_IM_HOME || resolve(homedir(), ".claude-im");
481
482
  return resolve(home, "state");
482
483
  }
483
484
  function getStatePath(profile) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekay/claude-im",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "通过飞书/企微等 IM 与 Claude Code 对话。WebSocket 长连接,流式卡片输出。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",