idea-manager 0.9.3 → 0.9.4

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 +23 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-manager",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "AI 기반 브레인스토밍 → 구조화 → 프롬프트 생성 도구. MCP Server 내장.",
5
5
  "keywords": [
6
6
  "brainstorm",
package/src/cli.ts CHANGED
@@ -130,11 +130,29 @@ program
130
130
  process.exit(1);
131
131
  });
132
132
 
133
- setTimeout(async () => {
134
- try {
135
- await openAsApp(`http://localhost:${port}`);
136
- } catch { /* ignore */ }
137
- }, 3000);
133
+ // Wait for server to be ready, then open browser
134
+ const waitAndOpen = async () => {
135
+ const url = `http://localhost:${port}`;
136
+ for (let i = 0; i < 30; i++) {
137
+ try {
138
+ await new Promise<void>((resolve, reject) => {
139
+ const http = require('http');
140
+ const req = http.get(url, (res: { statusCode: number }) => {
141
+ if (res.statusCode === 200) resolve();
142
+ else reject();
143
+ });
144
+ req.on('error', reject);
145
+ req.setTimeout(1000, () => { req.destroy(); reject(); });
146
+ });
147
+ // Server is ready
148
+ await openAsApp(url);
149
+ return;
150
+ } catch {
151
+ await new Promise(r => setTimeout(r, 1000));
152
+ }
153
+ }
154
+ };
155
+ waitAndOpen().catch(() => {});
138
156
 
139
157
  process.on('SIGINT', () => { child.kill(); process.exit(0); });
140
158
  process.on('SIGTERM', () => { child.kill(); process.exit(0); });