specweave 0.4.0 → 0.4.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.
- package/CLAUDE.md +501 -28
- package/README.md +99 -57
- package/bin/specweave.js +16 -0
- package/dist/adapters/adapter-base.d.ts +21 -0
- package/dist/adapters/adapter-base.d.ts.map +1 -1
- package/dist/adapters/adapter-base.js +28 -0
- package/dist/adapters/adapter-base.js.map +1 -1
- package/dist/adapters/adapter-interface.d.ts +41 -0
- package/dist/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.d.ts +36 -0
- package/dist/adapters/claude/adapter.d.ts.map +1 -1
- package/dist/adapters/claude/adapter.js +135 -0
- package/dist/adapters/claude/adapter.js.map +1 -1
- package/dist/adapters/copilot/adapter.d.ts +25 -0
- package/dist/adapters/copilot/adapter.d.ts.map +1 -1
- package/dist/adapters/copilot/adapter.js +112 -0
- package/dist/adapters/copilot/adapter.js.map +1 -1
- package/dist/adapters/cursor/adapter.d.ts +36 -0
- package/dist/adapters/cursor/adapter.d.ts.map +1 -1
- package/dist/adapters/cursor/adapter.js +140 -0
- package/dist/adapters/cursor/adapter.js.map +1 -1
- package/dist/adapters/generic/adapter.d.ts +25 -0
- package/dist/adapters/generic/adapter.d.ts.map +1 -1
- package/dist/adapters/generic/adapter.js +111 -0
- package/dist/adapters/generic/adapter.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +48 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts +37 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -0
- package/dist/cli/commands/plugin.js +296 -0
- package/dist/cli/commands/plugin.js.map +1 -0
- package/dist/core/plugin-detector.d.ts +96 -0
- package/dist/core/plugin-detector.d.ts.map +1 -0
- package/dist/core/plugin-detector.js +349 -0
- package/dist/core/plugin-detector.js.map +1 -0
- package/dist/core/plugin-loader.d.ts +111 -0
- package/dist/core/plugin-loader.d.ts.map +1 -0
- package/dist/core/plugin-loader.js +319 -0
- package/dist/core/plugin-loader.js.map +1 -0
- package/dist/core/plugin-manager.d.ts +144 -0
- package/dist/core/plugin-manager.d.ts.map +1 -0
- package/dist/core/plugin-manager.js +393 -0
- package/dist/core/plugin-manager.js.map +1 -0
- package/dist/core/schemas/plugin-manifest.schema.json +253 -0
- package/dist/core/types/plugin.d.ts +252 -0
- package/dist/core/types/plugin.d.ts.map +1 -0
- package/dist/core/types/plugin.js +48 -0
- package/dist/core/types/plugin.js.map +1 -0
- package/dist/integrations/jira/jira-mapper.d.ts +2 -2
- package/dist/integrations/jira/jira-mapper.js +2 -2
- package/package.json +13 -9
- package/src/adapters/adapter-base.ts +33 -0
- package/src/adapters/adapter-interface.ts +46 -0
- package/src/adapters/claude/adapter.ts +164 -0
- package/src/adapters/copilot/adapter.ts +138 -0
- package/src/adapters/cursor/adapter.ts +170 -0
- package/src/adapters/generic/adapter.ts +137 -0
- package/src/commands/specweave.increment.md +48 -4
- package/src/hooks/post-increment-plugin-detect.sh +142 -0
- package/src/hooks/post-task-completion.sh +53 -11
- package/src/hooks/pre-task-plugin-detect.sh +96 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AdapterBase } from '../adapter-base.js';
|
|
10
10
|
import { AdapterOptions, AdapterFile } from '../adapter-interface.js';
|
|
11
|
+
import type { Plugin } from '../../core/types/plugin.js';
|
|
11
12
|
export declare class CopilotAdapter extends AdapterBase {
|
|
12
13
|
name: string;
|
|
13
14
|
description: string;
|
|
@@ -39,5 +40,29 @@ export declare class CopilotAdapter extends AdapterBase {
|
|
|
39
40
|
* Get usage instructions for Copilot adapter
|
|
40
41
|
*/
|
|
41
42
|
getInstructions(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Check if Copilot adapter supports plugins
|
|
45
|
+
*
|
|
46
|
+
* Copilot has plugin support via AGENTS.md compilation (same as Cursor)
|
|
47
|
+
*
|
|
48
|
+
* @returns boolean True for Copilot
|
|
49
|
+
*/
|
|
50
|
+
supportsPlugins(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Compile and install a plugin for Copilot
|
|
53
|
+
*
|
|
54
|
+
* Copilot uses AGENTS.md compilation (same as Cursor)
|
|
55
|
+
*
|
|
56
|
+
* @param plugin Plugin to install
|
|
57
|
+
*/
|
|
58
|
+
compilePlugin(plugin: Plugin): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Unload a plugin from Copilot
|
|
61
|
+
*/
|
|
62
|
+
unloadPlugin(pluginName: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Get list of installed plugins for Copilot
|
|
65
|
+
*/
|
|
66
|
+
getInstalledPlugins(): Promise<string[]>;
|
|
42
67
|
}
|
|
43
68
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/copilot/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/copilot/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,qBAAa,cAAe,SAAQ,WAAW;IAC7C,IAAI,SAAa;IACjB,WAAW,SAA8D;IACzE,eAAe,EAAG,OAAO,CAAU;IAEnC;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAMhC;;;;;OAKG;IACH,QAAQ,IAAI,WAAW,EAAE;IAIzB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrD;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACH,eAAe,IAAI,MAAM;IAuHzB;;;;;;OAMG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0DlD;;OAEG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCrD;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAmB/C"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This adapter requires no additional files - Copilot reads AGENTS.md automatically.
|
|
8
8
|
*/
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import fs from 'fs-extra';
|
|
9
11
|
import { AdapterBase } from '../adapter-base.js';
|
|
10
12
|
export class CopilotAdapter extends AdapterBase {
|
|
11
13
|
constructor() {
|
|
@@ -170,5 +172,115 @@ Note: For better automation, consider Claude Code (full) or Cursor (semi).
|
|
|
170
172
|
Copilot is best for simple projects or when already using VS Code + Copilot.
|
|
171
173
|
`;
|
|
172
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Check if Copilot adapter supports plugins
|
|
177
|
+
*
|
|
178
|
+
* Copilot has plugin support via AGENTS.md compilation (same as Cursor)
|
|
179
|
+
*
|
|
180
|
+
* @returns boolean True for Copilot
|
|
181
|
+
*/
|
|
182
|
+
supportsPlugins() {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Compile and install a plugin for Copilot
|
|
187
|
+
*
|
|
188
|
+
* Copilot uses AGENTS.md compilation (same as Cursor)
|
|
189
|
+
*
|
|
190
|
+
* @param plugin Plugin to install
|
|
191
|
+
*/
|
|
192
|
+
async compilePlugin(plugin) {
|
|
193
|
+
const projectPath = process.cwd();
|
|
194
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
195
|
+
console.log(`\n📦 Compiling plugin for Copilot: ${plugin.manifest.name}`);
|
|
196
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
197
|
+
throw new Error('AGENTS.md not found. Run specweave init first.');
|
|
198
|
+
}
|
|
199
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
200
|
+
const pluginMarker = `<!-- Plugin: ${plugin.manifest.name} -->`;
|
|
201
|
+
if (agentsMd.includes(pluginMarker)) {
|
|
202
|
+
console.log(` ℹ️ Plugin ${plugin.manifest.name} already compiled to AGENTS.md`);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
let pluginSection = `\n\n${pluginMarker}\n\n`;
|
|
206
|
+
pluginSection += `# Plugin: ${plugin.manifest.name}\n\n`;
|
|
207
|
+
pluginSection += `${plugin.manifest.description}\n\n`;
|
|
208
|
+
if (plugin.skills.length > 0) {
|
|
209
|
+
pluginSection += `## Skills\n\n`;
|
|
210
|
+
for (const skill of plugin.skills) {
|
|
211
|
+
const skillContent = await fs.readFile(path.join(skill.path, 'SKILL.md'), 'utf-8');
|
|
212
|
+
const contentWithoutFrontmatter = skillContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
213
|
+
pluginSection += `### ${skill.name}\n\n${contentWithoutFrontmatter}\n\n`;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (plugin.agents.length > 0) {
|
|
217
|
+
pluginSection += `## Agents\n\n`;
|
|
218
|
+
for (const agent of plugin.agents) {
|
|
219
|
+
const agentContent = await fs.readFile(path.join(agent.path, 'AGENT.md'), 'utf-8');
|
|
220
|
+
pluginSection += `### ${agent.name}\n\n${agentContent}\n\n`;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (plugin.commands.length > 0) {
|
|
224
|
+
pluginSection += `## Commands\n\n`;
|
|
225
|
+
for (const command of plugin.commands) {
|
|
226
|
+
const commandContent = await fs.readFile(command.path, 'utf-8');
|
|
227
|
+
const contentWithoutFrontmatter = commandContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
228
|
+
pluginSection += `### /${command.name}\n\n${contentWithoutFrontmatter}\n\n`;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
pluginSection += `<!-- End Plugin: ${plugin.manifest.name} -->\n`;
|
|
232
|
+
agentsMd += pluginSection;
|
|
233
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
234
|
+
console.log(` ✓ Compiled to AGENTS.md`);
|
|
235
|
+
console.log(` ✓ ${plugin.skills.length} skills, ${plugin.agents.length} agents, ${plugin.commands.length} commands`);
|
|
236
|
+
console.log(`\n✅ Plugin ${plugin.manifest.name} compiled for Copilot!`);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Unload a plugin from Copilot
|
|
240
|
+
*/
|
|
241
|
+
async unloadPlugin(pluginName) {
|
|
242
|
+
const projectPath = process.cwd();
|
|
243
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
244
|
+
console.log(`\n🗑️ Unloading plugin from Copilot: ${pluginName}`);
|
|
245
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
246
|
+
console.warn(`⚠️ AGENTS.md not found`);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
250
|
+
const startMarker = `<!-- Plugin: ${pluginName} -->`;
|
|
251
|
+
const endMarker = `<!-- End Plugin: ${pluginName} -->`;
|
|
252
|
+
const startIndex = agentsMd.indexOf(startMarker);
|
|
253
|
+
if (startIndex === -1) {
|
|
254
|
+
console.warn(`⚠️ Plugin ${pluginName} not found in AGENTS.md`);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const endIndex = agentsMd.indexOf(endMarker, startIndex);
|
|
258
|
+
if (endIndex === -1) {
|
|
259
|
+
console.warn(`⚠️ Plugin ${pluginName} section malformed`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
agentsMd = agentsMd.slice(0, startIndex) + agentsMd.slice(endIndex + endMarker.length);
|
|
263
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
264
|
+
console.log(` ✓ Removed from AGENTS.md`);
|
|
265
|
+
console.log(`\n✅ Plugin ${pluginName} unloaded!`);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Get list of installed plugins for Copilot
|
|
269
|
+
*/
|
|
270
|
+
async getInstalledPlugins() {
|
|
271
|
+
const projectPath = process.cwd();
|
|
272
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
273
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
274
|
+
return [];
|
|
275
|
+
}
|
|
276
|
+
const agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
277
|
+
const pluginMarkerRegex = /<!-- Plugin: (specweave-[a-z0-9-]+) -->/g;
|
|
278
|
+
const matches = agentsMd.matchAll(pluginMarkerRegex);
|
|
279
|
+
const plugins = [];
|
|
280
|
+
for (const match of matches) {
|
|
281
|
+
plugins.push(match[1]);
|
|
282
|
+
}
|
|
283
|
+
return plugins;
|
|
284
|
+
}
|
|
173
285
|
}
|
|
174
286
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/copilot/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/copilot/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC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G,CAAC,6BAA6B,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,YAAY,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAEzD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,iBAAiB,GAAG,0CAA0C,CAAC;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAErD,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { AdapterBase } from '../adapter-base.js';
|
|
11
11
|
import { AdapterOptions, AdapterFile } from '../adapter-interface.js';
|
|
12
|
+
import type { Plugin } from '../../core/types/plugin.js';
|
|
12
13
|
export declare class CursorAdapter extends AdapterBase {
|
|
13
14
|
name: string;
|
|
14
15
|
description: string;
|
|
@@ -40,5 +41,40 @@ export declare class CursorAdapter extends AdapterBase {
|
|
|
40
41
|
* Get usage instructions for Cursor adapter
|
|
41
42
|
*/
|
|
42
43
|
getInstructions(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Check if Cursor adapter supports plugins
|
|
46
|
+
*
|
|
47
|
+
* Cursor has plugin support via AGENTS.md compilation
|
|
48
|
+
*
|
|
49
|
+
* @returns boolean True for Cursor
|
|
50
|
+
*/
|
|
51
|
+
supportsPlugins(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Compile and install a plugin for Cursor
|
|
54
|
+
*
|
|
55
|
+
* Cursor uses AGENTS.md compilation:
|
|
56
|
+
* - Append skills to AGENTS.md
|
|
57
|
+
* - Append agents to AGENTS.md
|
|
58
|
+
* - Append commands to team commands JSON
|
|
59
|
+
*
|
|
60
|
+
* @param plugin Plugin to install
|
|
61
|
+
*/
|
|
62
|
+
compilePlugin(plugin: Plugin): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Unload a plugin from Cursor
|
|
65
|
+
*
|
|
66
|
+
* Removes plugin section from AGENTS.md
|
|
67
|
+
*
|
|
68
|
+
* @param pluginName Name of plugin to unload
|
|
69
|
+
*/
|
|
70
|
+
unloadPlugin(pluginName: string): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Get list of installed plugins for Cursor
|
|
73
|
+
*
|
|
74
|
+
* Parses AGENTS.md for plugin markers
|
|
75
|
+
*
|
|
76
|
+
* @returns Array of installed plugin names
|
|
77
|
+
*/
|
|
78
|
+
getInstalledPlugins(): Promise<string[]>;
|
|
43
79
|
}
|
|
44
80
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/cursor/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/cursor/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,qBAAa,aAAc,SAAQ,WAAW;IAC5C,IAAI,SAAY;IAChB,WAAW,SAA6E;IACxF,eAAe,EAAG,MAAM,CAAU;IAElC;;;;;;OAMG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAOhC;;;;;OAKG;IACH,QAAQ,IAAI,WAAW,EAAE;IA8BzB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrD;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACH,eAAe,IAAI,MAAM;IA2HzB;;;;;;OAMG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;;;;;OASG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0ElD;;;;;;OAMG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCrD;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAmB/C"}
|
|
@@ -210,5 +210,145 @@ Pro tip: Say "act as [role]" to follow AGENTS.md patterns:
|
|
|
210
210
|
- "act as DevOps and create infrastructure" (AGENTS.md defines DevOps role)
|
|
211
211
|
`;
|
|
212
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Check if Cursor adapter supports plugins
|
|
215
|
+
*
|
|
216
|
+
* Cursor has plugin support via AGENTS.md compilation
|
|
217
|
+
*
|
|
218
|
+
* @returns boolean True for Cursor
|
|
219
|
+
*/
|
|
220
|
+
supportsPlugins() {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Compile and install a plugin for Cursor
|
|
225
|
+
*
|
|
226
|
+
* Cursor uses AGENTS.md compilation:
|
|
227
|
+
* - Append skills to AGENTS.md
|
|
228
|
+
* - Append agents to AGENTS.md
|
|
229
|
+
* - Append commands to team commands JSON
|
|
230
|
+
*
|
|
231
|
+
* @param plugin Plugin to install
|
|
232
|
+
*/
|
|
233
|
+
async compilePlugin(plugin) {
|
|
234
|
+
const projectPath = process.cwd();
|
|
235
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
236
|
+
console.log(`\n📦 Compiling plugin for Cursor: ${plugin.manifest.name}`);
|
|
237
|
+
// Ensure AGENTS.md exists
|
|
238
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
239
|
+
throw new Error('AGENTS.md not found. Run specweave init first.');
|
|
240
|
+
}
|
|
241
|
+
// Read current AGENTS.md
|
|
242
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
243
|
+
// Check if plugin already compiled
|
|
244
|
+
const pluginMarker = `<!-- Plugin: ${plugin.manifest.name} -->`;
|
|
245
|
+
if (agentsMd.includes(pluginMarker)) {
|
|
246
|
+
console.log(` ℹ️ Plugin ${plugin.manifest.name} already compiled to AGENTS.md`);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
// Generate plugin section for AGENTS.md
|
|
250
|
+
let pluginSection = `\n\n${pluginMarker}\n\n`;
|
|
251
|
+
pluginSection += `# Plugin: ${plugin.manifest.name}\n\n`;
|
|
252
|
+
pluginSection += `${plugin.manifest.description}\n\n`;
|
|
253
|
+
// Add skills
|
|
254
|
+
if (plugin.skills.length > 0) {
|
|
255
|
+
pluginSection += `## Skills\n\n`;
|
|
256
|
+
for (const skill of plugin.skills) {
|
|
257
|
+
const skillContent = await fs.readFile(path.join(skill.path, 'SKILL.md'), 'utf-8');
|
|
258
|
+
// Remove frontmatter for AGENTS.md
|
|
259
|
+
const contentWithoutFrontmatter = skillContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
260
|
+
pluginSection += `### ${skill.name}\n\n`;
|
|
261
|
+
pluginSection += `${contentWithoutFrontmatter}\n\n`;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Add agents
|
|
265
|
+
if (plugin.agents.length > 0) {
|
|
266
|
+
pluginSection += `## Agents\n\n`;
|
|
267
|
+
for (const agent of plugin.agents) {
|
|
268
|
+
const agentContent = await fs.readFile(path.join(agent.path, 'AGENT.md'), 'utf-8');
|
|
269
|
+
pluginSection += `### ${agent.name}\n\n`;
|
|
270
|
+
pluginSection += `${agentContent}\n\n`;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Add commands
|
|
274
|
+
if (plugin.commands.length > 0) {
|
|
275
|
+
pluginSection += `## Commands\n\n`;
|
|
276
|
+
for (const command of plugin.commands) {
|
|
277
|
+
const commandContent = await fs.readFile(command.path, 'utf-8');
|
|
278
|
+
// Remove frontmatter
|
|
279
|
+
const contentWithoutFrontmatter = commandContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
280
|
+
pluginSection += `### /${command.name}\n\n`;
|
|
281
|
+
pluginSection += `${contentWithoutFrontmatter}\n\n`;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
pluginSection += `<!-- End Plugin: ${plugin.manifest.name} -->\n`;
|
|
285
|
+
// Append to AGENTS.md
|
|
286
|
+
agentsMd += pluginSection;
|
|
287
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
288
|
+
console.log(` ✓ Compiled to AGENTS.md`);
|
|
289
|
+
console.log(` ✓ ${plugin.skills.length} skills added`);
|
|
290
|
+
console.log(` ✓ ${plugin.agents.length} agents added`);
|
|
291
|
+
console.log(` ✓ ${plugin.commands.length} commands added`);
|
|
292
|
+
console.log(`\n✅ Plugin ${plugin.manifest.name} compiled for Cursor!`);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Unload a plugin from Cursor
|
|
296
|
+
*
|
|
297
|
+
* Removes plugin section from AGENTS.md
|
|
298
|
+
*
|
|
299
|
+
* @param pluginName Name of plugin to unload
|
|
300
|
+
*/
|
|
301
|
+
async unloadPlugin(pluginName) {
|
|
302
|
+
const projectPath = process.cwd();
|
|
303
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
304
|
+
console.log(`\n🗑️ Unloading plugin from Cursor: ${pluginName}`);
|
|
305
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
306
|
+
console.warn(`⚠️ AGENTS.md not found`);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
// Read AGENTS.md
|
|
310
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
311
|
+
// Find plugin section
|
|
312
|
+
const startMarker = `<!-- Plugin: ${pluginName} -->`;
|
|
313
|
+
const endMarker = `<!-- End Plugin: ${pluginName} -->`;
|
|
314
|
+
const startIndex = agentsMd.indexOf(startMarker);
|
|
315
|
+
if (startIndex === -1) {
|
|
316
|
+
console.warn(`⚠️ Plugin ${pluginName} not found in AGENTS.md`);
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const endIndex = agentsMd.indexOf(endMarker, startIndex);
|
|
320
|
+
if (endIndex === -1) {
|
|
321
|
+
console.warn(`⚠️ Plugin ${pluginName} section malformed in AGENTS.md`);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
// Remove plugin section
|
|
325
|
+
agentsMd = agentsMd.slice(0, startIndex) + agentsMd.slice(endIndex + endMarker.length);
|
|
326
|
+
// Write back
|
|
327
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
328
|
+
console.log(` ✓ Removed from AGENTS.md`);
|
|
329
|
+
console.log(`\n✅ Plugin ${pluginName} unloaded!`);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Get list of installed plugins for Cursor
|
|
333
|
+
*
|
|
334
|
+
* Parses AGENTS.md for plugin markers
|
|
335
|
+
*
|
|
336
|
+
* @returns Array of installed plugin names
|
|
337
|
+
*/
|
|
338
|
+
async getInstalledPlugins() {
|
|
339
|
+
const projectPath = process.cwd();
|
|
340
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
341
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
342
|
+
return [];
|
|
343
|
+
}
|
|
344
|
+
const agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
345
|
+
const pluginMarkerRegex = /<!-- Plugin: (specweave-[a-z0-9-]+) -->/g;
|
|
346
|
+
const matches = agentsMd.matchAll(pluginMarkerRegex);
|
|
347
|
+
const plugins = [];
|
|
348
|
+
for (const match of matches) {
|
|
349
|
+
plugins.push(match[1]);
|
|
350
|
+
}
|
|
351
|
+
return plugins;
|
|
352
|
+
}
|
|
213
353
|
}
|
|
214
354
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/cursor/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/cursor/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,SAAI,GAAG,QAAQ,CAAC;QAChB,gBAAW,GAAG,yEAAyE,CAAC;QACxF,oBAAe,GAAG,MAAe,CAAC;IAoXpC,CAAC;IAlXC;;;;;;OAMG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,Y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C;IACpD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAEzD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,iBAAiB,GAAG,0CAA0C,CAAC;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAErD,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { AdapterBase } from '../adapter-base.js';
|
|
11
11
|
import { AdapterOptions, AdapterFile } from '../adapter-interface.js';
|
|
12
|
+
import type { Plugin } from '../../core/types/plugin.js';
|
|
12
13
|
export declare class GenericAdapter extends AdapterBase {
|
|
13
14
|
name: string;
|
|
14
15
|
description: string;
|
|
@@ -39,5 +40,29 @@ export declare class GenericAdapter extends AdapterBase {
|
|
|
39
40
|
* Get usage instructions for Generic adapter
|
|
40
41
|
*/
|
|
41
42
|
getInstructions(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Check if Generic adapter supports plugins
|
|
45
|
+
*
|
|
46
|
+
* Generic has manual plugin support via AGENTS.md
|
|
47
|
+
*
|
|
48
|
+
* @returns boolean True
|
|
49
|
+
*/
|
|
50
|
+
supportsPlugins(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Compile and install a plugin for Generic adapter
|
|
53
|
+
*
|
|
54
|
+
* Appends plugin content to AGENTS.md for manual copy-paste workflows
|
|
55
|
+
*
|
|
56
|
+
* @param plugin Plugin to install
|
|
57
|
+
*/
|
|
58
|
+
compilePlugin(plugin: Plugin): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Unload a plugin from Generic adapter
|
|
61
|
+
*/
|
|
62
|
+
unloadPlugin(pluginName: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Get list of installed plugins for Generic adapter
|
|
65
|
+
*/
|
|
66
|
+
getInstalledPlugins(): Promise<string[]>;
|
|
42
67
|
}
|
|
43
68
|
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/generic/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/generic/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,qBAAa,cAAe,SAAQ,WAAW;IAC7C,IAAI,SAAa;IACjB,WAAW,SAAgF;IAC3F,eAAe,EAAG,QAAQ,CAAU;IAEpC;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAKhC;;;;;OAKG;IACH,QAAQ,IAAI,WAAW,EAAE;IAIzB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrD;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACH,eAAe,IAAI,MAAM;IAsGzB;;;;;;OAMG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyDlD;;OAEG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCrD;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAmB/C"}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* This adapter ensures 100% compatibility - works with ChatGPT web, Claude web,
|
|
8
8
|
* Gemini, or literally ANY AI that can read markdown and follow instructions.
|
|
9
9
|
*/
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import fs from 'fs-extra';
|
|
10
12
|
import { AdapterBase } from '../adapter-base.js';
|
|
11
13
|
export class GenericAdapter extends AdapterBase {
|
|
12
14
|
constructor() {
|
|
@@ -152,5 +154,114 @@ You're ready to build with SpecWeave using ANY AI tool!
|
|
|
152
154
|
Remember: AGENTS.md is the universal standard - it works everywhere!
|
|
153
155
|
`;
|
|
154
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Check if Generic adapter supports plugins
|
|
159
|
+
*
|
|
160
|
+
* Generic has manual plugin support via AGENTS.md
|
|
161
|
+
*
|
|
162
|
+
* @returns boolean True
|
|
163
|
+
*/
|
|
164
|
+
supportsPlugins() {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Compile and install a plugin for Generic adapter
|
|
169
|
+
*
|
|
170
|
+
* Appends plugin content to AGENTS.md for manual copy-paste workflows
|
|
171
|
+
*
|
|
172
|
+
* @param plugin Plugin to install
|
|
173
|
+
*/
|
|
174
|
+
async compilePlugin(plugin) {
|
|
175
|
+
const projectPath = process.cwd();
|
|
176
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
177
|
+
console.log(`\n📦 Adding plugin to AGENTS.md: ${plugin.manifest.name}`);
|
|
178
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
179
|
+
throw new Error('AGENTS.md not found. Run specweave init first.');
|
|
180
|
+
}
|
|
181
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
182
|
+
const pluginMarker = `<!-- Plugin: ${plugin.manifest.name} -->`;
|
|
183
|
+
if (agentsMd.includes(pluginMarker)) {
|
|
184
|
+
console.log(` ℹ️ Plugin ${plugin.manifest.name} already in AGENTS.md`);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
let pluginSection = `\n\n${pluginMarker}\n\n`;
|
|
188
|
+
pluginSection += `# Plugin: ${plugin.manifest.name}\n\n`;
|
|
189
|
+
pluginSection += `${plugin.manifest.description}\n\n`;
|
|
190
|
+
if (plugin.skills.length > 0) {
|
|
191
|
+
pluginSection += `## Skills\n\n`;
|
|
192
|
+
for (const skill of plugin.skills) {
|
|
193
|
+
const skillContent = await fs.readFile(path.join(skill.path, 'SKILL.md'), 'utf-8');
|
|
194
|
+
const contentWithoutFrontmatter = skillContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
195
|
+
pluginSection += `### ${skill.name}\n\n${contentWithoutFrontmatter}\n\n`;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (plugin.agents.length > 0) {
|
|
199
|
+
pluginSection += `## Agents\n\n`;
|
|
200
|
+
for (const agent of plugin.agents) {
|
|
201
|
+
const agentContent = await fs.readFile(path.join(agent.path, 'AGENT.md'), 'utf-8');
|
|
202
|
+
pluginSection += `### ${agent.name}\n\n${agentContent}\n\n`;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (plugin.commands.length > 0) {
|
|
206
|
+
pluginSection += `## Workflows (Manual)\n\n`;
|
|
207
|
+
for (const command of plugin.commands) {
|
|
208
|
+
const commandContent = await fs.readFile(command.path, 'utf-8');
|
|
209
|
+
const contentWithoutFrontmatter = commandContent.replace(/^---\n[\s\S]+?\n---\n/, '');
|
|
210
|
+
pluginSection += `### ${command.name.replace('specweave.', '')}\n\n${contentWithoutFrontmatter}\n\n`;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
pluginSection += `<!-- End Plugin: ${plugin.manifest.name} -->\n`;
|
|
214
|
+
agentsMd += pluginSection;
|
|
215
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
216
|
+
console.log(` ✓ Added to AGENTS.md (copy-paste workflows)`);
|
|
217
|
+
console.log(`\n✅ Plugin ${plugin.manifest.name} available for manual use!`);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Unload a plugin from Generic adapter
|
|
221
|
+
*/
|
|
222
|
+
async unloadPlugin(pluginName) {
|
|
223
|
+
const projectPath = process.cwd();
|
|
224
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
225
|
+
console.log(`\n🗑️ Removing plugin from AGENTS.md: ${pluginName}`);
|
|
226
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
227
|
+
console.warn(`⚠️ AGENTS.md not found`);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
let agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
231
|
+
const startMarker = `<!-- Plugin: ${pluginName} -->`;
|
|
232
|
+
const endMarker = `<!-- End Plugin: ${pluginName} -->`;
|
|
233
|
+
const startIndex = agentsMd.indexOf(startMarker);
|
|
234
|
+
if (startIndex === -1) {
|
|
235
|
+
console.warn(`⚠️ Plugin ${pluginName} not found in AGENTS.md`);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
const endIndex = agentsMd.indexOf(endMarker, startIndex);
|
|
239
|
+
if (endIndex === -1) {
|
|
240
|
+
console.warn(`⚠️ Plugin ${pluginName} section malformed`);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
agentsMd = agentsMd.slice(0, startIndex) + agentsMd.slice(endIndex + endMarker.length);
|
|
244
|
+
await fs.writeFile(agentsMdPath, agentsMd, 'utf-8');
|
|
245
|
+
console.log(` ✓ Removed from AGENTS.md`);
|
|
246
|
+
console.log(`\n✅ Plugin ${pluginName} removed!`);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Get list of installed plugins for Generic adapter
|
|
250
|
+
*/
|
|
251
|
+
async getInstalledPlugins() {
|
|
252
|
+
const projectPath = process.cwd();
|
|
253
|
+
const agentsMdPath = path.join(projectPath, 'AGENTS.md');
|
|
254
|
+
if (!(await fs.pathExists(agentsMdPath))) {
|
|
255
|
+
return [];
|
|
256
|
+
}
|
|
257
|
+
const agentsMd = await fs.readFile(agentsMdPath, 'utf-8');
|
|
258
|
+
const pluginMarkerRegex = /<!-- Plugin: (specweave-[a-z0-9-]+) -->/g;
|
|
259
|
+
const matches = agentsMd.matchAll(pluginMarkerRegex);
|
|
260
|
+
const plugins = [];
|
|
261
|
+
for (const match of matches) {
|
|
262
|
+
plugins.push(match[1]);
|
|
263
|
+
}
|
|
264
|
+
return plugins;
|
|
265
|
+
}
|
|
155
266
|
}
|
|
156
267
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/generic/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/adapters/generic/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MA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AG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAEzD,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,iBAAiB,GAAG,0CAA0C,CAAC;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAErD,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAeA,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,WAAW,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAeA,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,WAAW,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAmUf"}
|
|
@@ -241,7 +241,54 @@ export async function initCommand(projectName, options = {}) {
|
|
|
241
241
|
spinner.text = 'Using existing Git repository...';
|
|
242
242
|
}
|
|
243
243
|
spinner.succeed('SpecWeave project created successfully!');
|
|
244
|
-
// 11.
|
|
244
|
+
// 11. Auto-detect and suggest plugins (T-018)
|
|
245
|
+
console.log('');
|
|
246
|
+
const pluginSpinner = ora('Detecting plugins...').start();
|
|
247
|
+
try {
|
|
248
|
+
const { PluginDetector } = await import('../../core/plugin-detector.js');
|
|
249
|
+
const { PluginManager } = await import('../../core/plugin-manager.js');
|
|
250
|
+
const detector = new PluginDetector();
|
|
251
|
+
const detectionResults = await detector.detectFromProject(targetDir);
|
|
252
|
+
const suggestedPlugins = detectionResults.map(r => r.pluginName);
|
|
253
|
+
pluginSpinner.succeed(`Detected ${suggestedPlugins.length} suggested plugins`);
|
|
254
|
+
if (suggestedPlugins.length > 0) {
|
|
255
|
+
console.log(chalk.cyan('\n💡 Suggested Plugins:'));
|
|
256
|
+
for (const pluginName of suggestedPlugins) {
|
|
257
|
+
console.log(` • ${chalk.white(pluginName)}`);
|
|
258
|
+
}
|
|
259
|
+
const { enablePlugins } = await inquirer.prompt([
|
|
260
|
+
{
|
|
261
|
+
type: 'confirm',
|
|
262
|
+
name: 'enablePlugins',
|
|
263
|
+
message: 'Enable suggested plugins now?',
|
|
264
|
+
default: true
|
|
265
|
+
}
|
|
266
|
+
]);
|
|
267
|
+
if (enablePlugins) {
|
|
268
|
+
const adapter = adapterLoader.getAdapter(toolName);
|
|
269
|
+
if (!adapter) {
|
|
270
|
+
throw new Error(`Adapter not found for tool: ${toolName}`);
|
|
271
|
+
}
|
|
272
|
+
const manager = new PluginManager(targetDir);
|
|
273
|
+
const enableSpinner = ora('Enabling plugins...').start();
|
|
274
|
+
for (const pluginName of suggestedPlugins) {
|
|
275
|
+
try {
|
|
276
|
+
await manager.loadPlugin(pluginName, adapter, { skipDependencies: false });
|
|
277
|
+
enableSpinner.text = `Enabled ${pluginName}`;
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
enableSpinner.warn(`Failed to enable ${pluginName}: ${error instanceof Error ? error.message : error}`);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
enableSpinner.succeed('Plugins enabled');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
pluginSpinner.warn('Plugin detection skipped');
|
|
289
|
+
console.log(chalk.gray(` You can enable plugins later with: specweave plugin enable <name>`));
|
|
290
|
+
}
|
|
291
|
+
// 12. Show tool-specific next steps
|
|
245
292
|
if (toolName !== 'claude') {
|
|
246
293
|
const adapter = adapterLoader.getAdapter(toolName);
|
|
247
294
|
if (adapter) {
|