@wu529778790/open-im 1.1.1-beta.0 → 1.1.1

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/cli.js +12 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4,7 +4,8 @@ import { readFileSync, writeFileSync, existsSync, unlinkSync } from "node:fs";
4
4
  import { join, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { main, needsSetup, runInteractiveSetup } from "./index.js";
7
- import { loadConfig } from "./config.js";
7
+ import { loadConfig, getPlatformsWithCredentials } from "./config.js";
8
+ import { runPlatformSelectionPrompt } from "./setup.js";
8
9
  import { APP_HOME, SHUTDOWN_PORT } from "./constants.js";
9
10
  const __dirname = dirname(fileURLToPath(import.meta.url));
10
11
  const PID_FILE = join(APP_HOME, "open-im.pid");
@@ -88,6 +89,16 @@ async function cmdStart() {
88
89
  if (!(await validateOrSetup())) {
89
90
  process.exit(1);
90
91
  }
92
+ // 多通道时在父进程(有 TTY)让用户选择,再启动子进程
93
+ let config = loadConfig();
94
+ if (getPlatformsWithCredentials(config).length > 1 &&
95
+ process.stdin.isTTY) {
96
+ const updated = await runPlatformSelectionPrompt(config);
97
+ if (!updated) {
98
+ console.log("已取消启动。");
99
+ process.exit(0);
100
+ }
101
+ }
91
102
  const child = spawn(process.execPath, [INDEX_JS], {
92
103
  detached: true,
93
104
  stdio: "ignore",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.1.1-beta.0",
3
+ "version": "1.1.1",
4
4
  "description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, Cursor)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",