MCPcopy Index your code
hub / github.com/Fission-AI/OpenSpec / detectNewTools

Method detectNewTools

src/core/update.ts:338–356  ·  view source on GitHub ↗

* Detects new tool directories that aren't currently configured and displays a hint.

(projectPath: string, configuredTools: string[])

Source from the content-addressed store, hash-verified

336 * Detects new tool directories that aren't currently configured and displays a hint.
337 */
338 private detectNewTools(projectPath: string, configuredTools: string[]): void {
339 const availableTools = getAvailableTools(projectPath);
340 const configuredSet = new Set(configuredTools);
341
342 const newTools = availableTools.filter((t) => !configuredSet.has(t.value));
343
344 if (newTools.length > 0) {
345 const newToolNames = newTools.map((tool) => tool.name);
346 const isSingleTool = newToolNames.length === 1;
347 const toolNoun = isSingleTool ? 'tool' : 'tools';
348 const pronoun = isSingleTool ? 'it' : 'them';
349 console.log();
350 console.log(
351 chalk.yellow(
352 `Detected new ${toolNoun}: ${newToolNames.join(', ')}. Run 'openspec init' to add ${pronoun}.`
353 )
354 );
355 }
356 }
357
358 /**
359 * Displays a note about extra workflows installed that aren't in the current profile.

Callers 1

executeMethod · 0.95

Calls 2

getAvailableToolsFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected