idea-manager 0.9.4 → 0.9.5

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/package.json +1 -1
  2. package/src/cli.ts +27 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-manager",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "AI 기반 브레인스토밍 → 구조화 → 프롬프트 생성 도구. MCP Server 내장.",
5
5
  "keywords": [
6
6
  "brainstorm",
package/src/cli.ts CHANGED
@@ -22,32 +22,44 @@ try {
22
22
  }
23
23
 
24
24
  async function openAsApp(url: string) {
25
- const { exec: execCb } = await import('child_process');
25
+ const { execFile: execFileCb } = await import('child_process');
26
+ const fs = await import('fs');
26
27
  const platform = process.platform;
27
28
 
28
- // Shell commands for --app mode per platform
29
- const commands: string[] =
29
+ // Direct browser binary paths — avoids macOS `open -a --args` being ignored
30
+ // when browser is already running
31
+ const browsers: { bin: string; args: string[] }[] =
30
32
  platform === 'darwin'
31
33
  ? [
32
- `open -a "Google Chrome" --args --app=${url}`,
33
- `open -a "Microsoft Edge" --args --app=${url}`,
34
- `open -a "Chromium" --args --app=${url}`,
34
+ { bin: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', args: [`--app=${url}`] },
35
+ { bin: '/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge', args: [`--app=${url}`] },
36
+ { bin: '/Applications/Chromium.app/Contents/MacOS/Chromium', args: [`--app=${url}`] },
35
37
  ]
36
38
  : platform === 'win32'
37
39
  ? [
38
- `start "" "chrome" "--app=${url}"`,
39
- `start "" "msedge" "--app=${url}"`,
40
- ]
40
+ { bin: 'chrome', args: [`--app=${url}`] },
41
+ { bin: 'msedge', args: [`--app=${url}`] },
42
+ ]
41
43
  : [
42
- `google-chrome --app=${url}`,
43
- `chromium-browser --app=${url}`,
44
- `microsoft-edge --app=${url}`,
45
- ];
44
+ { bin: 'google-chrome', args: [`--app=${url}`] },
45
+ { bin: 'chromium-browser', args: [`--app=${url}`] },
46
+ { bin: 'microsoft-edge', args: [`--app=${url}`] },
47
+ ];
48
+
49
+ for (const browser of browsers) {
50
+ // On macOS, check binary exists before trying
51
+ if (platform === 'darwin' && !fs.existsSync(browser.bin)) continue;
46
52
 
47
- for (const cmd of commands) {
48
53
  try {
49
54
  await new Promise<void>((resolve, reject) => {
50
- execCb(cmd, (err) => { if (err) reject(err); else resolve(); });
55
+ const child = execFileCb(browser.bin, browser.args, {
56
+ shell: platform === 'win32',
57
+ detached: true,
58
+ stdio: 'ignore',
59
+ }, (err) => { if (err) reject(err); });
60
+ child.unref();
61
+ // Browser launched — resolve after brief delay
62
+ setTimeout(resolve, 500);
51
63
  });
52
64
  return; // success
53
65
  } catch {