project-iris 0.2.0 → 0.2.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/lib/installer.js +118 -23
  2. package/package.json +1 -1
package/lib/installer.js CHANGED
@@ -71,6 +71,99 @@ async function detectTools() {
71
71
  // VS Code-based tools that can use the iris Dashboard extension
72
72
  const VSCODE_TOOLS = ['claude', 'cursor', 'copilot', 'windsurf', 'cline', 'roo', 'antigravity'];
73
73
 
74
+ /**
75
+ * Find VS Code CLI executable
76
+ * @returns {string|null} Path to VS Code CLI or null if not found
77
+ */
78
+ function findVSCodeCLI() {
79
+ const platform = process.platform;
80
+
81
+ // Possible CLI paths by platform
82
+ const paths = [];
83
+
84
+ if (platform === 'darwin') {
85
+ // macOS - check common application locations
86
+ paths.push(
87
+ '/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',
88
+ '/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code',
89
+ `${process.env.HOME}/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code`
90
+ );
91
+ } else if (platform === 'win32') {
92
+ // Windows
93
+ const localAppData = process.env.LOCALAPPDATA || '';
94
+ const programFiles = process.env['ProgramFiles'] || 'C:\\Program Files';
95
+ paths.push(
96
+ `${localAppData}\\Programs\\Microsoft VS Code\\bin\\code.cmd`,
97
+ `${programFiles}\\Microsoft VS Code\\bin\\code.cmd`
98
+ );
99
+ } else {
100
+ // Linux
101
+ paths.push(
102
+ '/usr/bin/code',
103
+ '/usr/local/bin/code',
104
+ '/snap/bin/code'
105
+ );
106
+ }
107
+
108
+ // Check each path
109
+ for (const p of paths) {
110
+ try {
111
+ if (fs.existsSync(p)) {
112
+ return p;
113
+ }
114
+ } catch {
115
+ // Ignore errors
116
+ }
117
+ }
118
+
119
+ // Fall back to trying 'code' from PATH
120
+ try {
121
+ execSync('which code || where code', { stdio: 'pipe' });
122
+ return 'code';
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Find Cursor CLI executable
130
+ * @returns {string|null} Path to Cursor CLI or null if not found
131
+ */
132
+ function findCursorCLI() {
133
+ const platform = process.platform;
134
+
135
+ const paths = [];
136
+
137
+ if (platform === 'darwin') {
138
+ paths.push(
139
+ '/Applications/Cursor.app/Contents/Resources/app/bin/cursor',
140
+ `${process.env.HOME}/Applications/Cursor.app/Contents/Resources/app/bin/cursor`
141
+ );
142
+ } else if (platform === 'win32') {
143
+ const localAppData = process.env.LOCALAPPDATA || '';
144
+ paths.push(
145
+ `${localAppData}\\Programs\\Cursor\\resources\\app\\bin\\cursor.cmd`
146
+ );
147
+ }
148
+
149
+ for (const p of paths) {
150
+ try {
151
+ if (fs.existsSync(p)) {
152
+ return p;
153
+ }
154
+ } catch {
155
+ // Ignore errors
156
+ }
157
+ }
158
+
159
+ try {
160
+ execSync('which cursor || where cursor', { stdio: 'pipe' });
161
+ return 'cursor';
162
+ } catch {
163
+ return null;
164
+ }
165
+ }
166
+
74
167
  /**
75
168
  * Install VS Code extension if any VS Code-based tool is selected
76
169
  * @param {string[]} selectedToolKeys - Selected tool keys
@@ -93,46 +186,48 @@ async function installVSCodeExtension(selectedToolKeys) {
93
186
 
94
187
  console.log(theme.dim(' Installing iris Dashboard VS Code extension...'));
95
188
 
96
- try {
97
- // Try 'code' command first (VS Code), then 'cursor' for Cursor
98
- let installed = false;
189
+ let installed = false;
99
190
 
100
- // Try VS Code
191
+ // Try VS Code
192
+ const vscodeCLI = findVSCodeCLI();
193
+ if (vscodeCLI) {
101
194
  try {
102
- execSync(`code --install-extension "${extensionPath}" --force`, {
195
+ execSync(`"${vscodeCLI}" --install-extension "${extensionPath}" --force`, {
103
196
  stdio: 'pipe',
104
- timeout: 30000
197
+ timeout: 60000,
198
+ shell: true
105
199
  });
106
200
  installed = true;
107
201
  CLIUtils.displayStatus('', 'Installed iris Dashboard extension for VS Code', 'success');
108
- } catch {
109
- // VS Code not available or failed
202
+ } catch (err) {
203
+ console.log(theme.dim(` VS Code install failed: ${err.message}`));
110
204
  }
205
+ }
111
206
 
112
- // Try Cursor if selected
113
- if (selectedToolKeys.includes('cursor')) {
207
+ // Try Cursor if selected
208
+ if (selectedToolKeys.includes('cursor')) {
209
+ const cursorCLI = findCursorCLI();
210
+ if (cursorCLI) {
114
211
  try {
115
- execSync(`cursor --install-extension "${extensionPath}" --force`, {
212
+ execSync(`"${cursorCLI}" --install-extension "${extensionPath}" --force`, {
116
213
  stdio: 'pipe',
117
- timeout: 30000
214
+ timeout: 60000,
215
+ shell: true
118
216
  });
119
217
  installed = true;
120
218
  CLIUtils.displayStatus('', 'Installed iris Dashboard extension for Cursor', 'success');
121
- } catch {
122
- // Cursor not available or failed
219
+ } catch (err) {
220
+ console.log(theme.dim(` Cursor install failed: ${err.message}`));
123
221
  }
124
222
  }
223
+ }
125
224
 
126
- if (!installed) {
127
- console.log(theme.dim(' Could not auto-install extension. Install manually:'));
128
- console.log(theme.dim(` code --install-extension "${extensionPath}"`));
129
- }
130
-
131
- return installed;
132
- } catch (error) {
133
- console.log(theme.dim(` Extension install skipped: ${error.message}`));
134
- return false;
225
+ if (!installed) {
226
+ console.log(theme.dim(' Could not auto-install extension. Install manually:'));
227
+ console.log(theme.dim(` code --install-extension "${extensionPath}"`));
135
228
  }
229
+
230
+ return installed;
136
231
  }
137
232
 
138
233
  async function install() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-iris",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {