clavix 2.3.0 → 2.4.0

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 (180) hide show
  1. package/dist/cli/commands/init.js +1 -1
  2. package/dist/core 2/adapters/agents-md-generator.d.ts +26 -0
  3. package/dist/core 2/adapters/agents-md-generator.js +102 -0
  4. package/dist/core 2/adapters/amp-adapter.d.ts +27 -0
  5. package/dist/core 2/adapters/amp-adapter.js +42 -0
  6. package/dist/core 2/adapters/augment-adapter.d.ts +22 -0
  7. package/dist/core 2/adapters/augment-adapter.js +77 -0
  8. package/dist/core 2/adapters/base-adapter.d.ts +45 -0
  9. package/dist/core 2/adapters/base-adapter.js +142 -0
  10. package/dist/core 2/adapters/claude-code-adapter.d.ts +32 -0
  11. package/dist/core 2/adapters/claude-code-adapter.js +116 -0
  12. package/dist/core 2/adapters/cline-adapter.d.ts +34 -0
  13. package/dist/core 2/adapters/cline-adapter.js +52 -0
  14. package/dist/core 2/adapters/codebuddy-adapter.d.ts +24 -0
  15. package/dist/core 2/adapters/codebuddy-adapter.js +82 -0
  16. package/dist/core 2/adapters/codex-adapter.d.ts +24 -0
  17. package/dist/core 2/adapters/codex-adapter.js +79 -0
  18. package/dist/core 2/adapters/copilot-instructions-generator.d.ts +26 -0
  19. package/dist/core 2/adapters/copilot-instructions-generator.js +104 -0
  20. package/dist/core 2/adapters/crush-adapter.d.ts +35 -0
  21. package/dist/core 2/adapters/crush-adapter.js +49 -0
  22. package/dist/core 2/adapters/cursor-adapter.d.ts +25 -0
  23. package/dist/core 2/adapters/cursor-adapter.js +40 -0
  24. package/dist/core 2/adapters/droid-adapter.d.ts +33 -0
  25. package/dist/core 2/adapters/droid-adapter.js +57 -0
  26. package/dist/core 2/adapters/gemini-adapter.d.ts +27 -0
  27. package/dist/core 2/adapters/gemini-adapter.js +90 -0
  28. package/dist/core 2/adapters/kilocode-adapter.d.ts +34 -0
  29. package/dist/core 2/adapters/kilocode-adapter.js +49 -0
  30. package/dist/core 2/adapters/octo-md-generator.d.ts +26 -0
  31. package/dist/core 2/adapters/octo-md-generator.js +102 -0
  32. package/dist/core 2/adapters/opencode-adapter.d.ts +33 -0
  33. package/dist/core 2/adapters/opencode-adapter.js +56 -0
  34. package/dist/core 2/adapters/qwen-adapter.d.ts +27 -0
  35. package/dist/core 2/adapters/qwen-adapter.js +90 -0
  36. package/dist/core 2/adapters/roocode-adapter.d.ts +40 -0
  37. package/dist/core 2/adapters/roocode-adapter.js +68 -0
  38. package/dist/core 2/adapters/warp-md-generator.d.ts +17 -0
  39. package/dist/core 2/adapters/warp-md-generator.js +88 -0
  40. package/dist/core 2/adapters/windsurf-adapter.d.ts +34 -0
  41. package/dist/core 2/adapters/windsurf-adapter.js +49 -0
  42. package/dist/core 2/agent-manager.d.ts +51 -0
  43. package/dist/core 2/agent-manager.js +126 -0
  44. package/dist/core 2/archive-manager.d.ts +100 -0
  45. package/dist/core 2/archive-manager.js +338 -0
  46. package/dist/core 2/conversation-analyzer.d.ts +86 -0
  47. package/dist/core 2/doc-injector.d.ts +51 -0
  48. package/dist/core 2/doc-injector.js +236 -0
  49. package/dist/core 2/git-manager.d.ts +100 -0
  50. package/dist/core 2/git-manager.js +214 -0
  51. package/dist/core 2/prompt-optimizer.d.ts +268 -0
  52. package/dist/core 2/prompt-optimizer.js +963 -0
  53. package/dist/core 2/question-engine.d.ts +167 -0
  54. package/dist/core 2/question-engine.js +395 -0
  55. package/dist/core 2/session-manager.d.ts +139 -0
  56. package/dist/core 2/session-manager.js +403 -0
  57. package/dist/core 2/task-manager.d.ts +155 -0
  58. package/dist/core 2/task-manager.js +689 -0
  59. package/dist/utils/template-loader.js +24 -22
  60. package/package.json +1 -1
  61. package/dist/templates/slash-commands/augment/archive.md +0 -291
  62. package/dist/templates/slash-commands/augment/deep.md +0 -207
  63. package/dist/templates/slash-commands/augment/fast.md +0 -183
  64. package/dist/templates/slash-commands/augment/implement.md +0 -267
  65. package/dist/templates/slash-commands/augment/plan.md +0 -173
  66. package/dist/templates/slash-commands/augment/prd.md +0 -178
  67. package/dist/templates/slash-commands/augment/start.md +0 -142
  68. package/dist/templates/slash-commands/augment/summarize.md +0 -179
  69. package/dist/templates/slash-commands/claude-code/archive.md +0 -291
  70. package/dist/templates/slash-commands/claude-code/deep.md +0 -207
  71. package/dist/templates/slash-commands/claude-code/fast.md +0 -183
  72. package/dist/templates/slash-commands/claude-code/implement.md +0 -267
  73. package/dist/templates/slash-commands/claude-code/plan.md +0 -173
  74. package/dist/templates/slash-commands/claude-code/prd.md +0 -178
  75. package/dist/templates/slash-commands/claude-code/start.md +0 -142
  76. package/dist/templates/slash-commands/claude-code/summarize.md +0 -179
  77. package/dist/templates/slash-commands/cline/archive.md +0 -291
  78. package/dist/templates/slash-commands/cline/deep.md +0 -207
  79. package/dist/templates/slash-commands/cline/fast.md +0 -183
  80. package/dist/templates/slash-commands/cline/implement.md +0 -267
  81. package/dist/templates/slash-commands/cline/plan.md +0 -173
  82. package/dist/templates/slash-commands/cline/prd.md +0 -178
  83. package/dist/templates/slash-commands/cline/start.md +0 -142
  84. package/dist/templates/slash-commands/cline/summarize.md +0 -179
  85. package/dist/templates/slash-commands/codebuddy/archive.md +0 -291
  86. package/dist/templates/slash-commands/codebuddy/deep.md +0 -207
  87. package/dist/templates/slash-commands/codebuddy/fast.md +0 -183
  88. package/dist/templates/slash-commands/codebuddy/implement.md +0 -267
  89. package/dist/templates/slash-commands/codebuddy/plan.md +0 -173
  90. package/dist/templates/slash-commands/codebuddy/prd.md +0 -178
  91. package/dist/templates/slash-commands/codebuddy/start.md +0 -142
  92. package/dist/templates/slash-commands/codebuddy/summarize.md +0 -179
  93. package/dist/templates/slash-commands/codex/archive.md +0 -291
  94. package/dist/templates/slash-commands/codex/deep.md +0 -207
  95. package/dist/templates/slash-commands/codex/fast.md +0 -183
  96. package/dist/templates/slash-commands/codex/implement.md +0 -267
  97. package/dist/templates/slash-commands/codex/plan.md +0 -173
  98. package/dist/templates/slash-commands/codex/prd.md +0 -178
  99. package/dist/templates/slash-commands/codex/start.md +0 -142
  100. package/dist/templates/slash-commands/codex/summarize.md +0 -179
  101. package/dist/templates/slash-commands/crush/archive.md +0 -291
  102. package/dist/templates/slash-commands/crush/deep.md +0 -207
  103. package/dist/templates/slash-commands/crush/fast.md +0 -183
  104. package/dist/templates/slash-commands/crush/implement.md +0 -267
  105. package/dist/templates/slash-commands/crush/plan.md +0 -173
  106. package/dist/templates/slash-commands/crush/prd.md +0 -178
  107. package/dist/templates/slash-commands/crush/start.md +0 -142
  108. package/dist/templates/slash-commands/crush/summarize.md +0 -179
  109. package/dist/templates/slash-commands/cursor/archive.md +0 -291
  110. package/dist/templates/slash-commands/cursor/deep.md +0 -207
  111. package/dist/templates/slash-commands/cursor/fast.md +0 -183
  112. package/dist/templates/slash-commands/cursor/implement.md +0 -267
  113. package/dist/templates/slash-commands/cursor/plan.md +0 -173
  114. package/dist/templates/slash-commands/cursor/prd.md +0 -178
  115. package/dist/templates/slash-commands/cursor/start.md +0 -142
  116. package/dist/templates/slash-commands/cursor/summarize.md +0 -179
  117. package/dist/templates/slash-commands/droid/archive.md +0 -291
  118. package/dist/templates/slash-commands/droid/deep.md +0 -207
  119. package/dist/templates/slash-commands/droid/fast.md +0 -183
  120. package/dist/templates/slash-commands/droid/implement.md +0 -267
  121. package/dist/templates/slash-commands/droid/plan.md +0 -173
  122. package/dist/templates/slash-commands/droid/prd.md +0 -178
  123. package/dist/templates/slash-commands/droid/start.md +0 -142
  124. package/dist/templates/slash-commands/droid/summarize.md +0 -179
  125. package/dist/templates/slash-commands/gemini/archive.toml +0 -290
  126. package/dist/templates/slash-commands/gemini/deep.toml +0 -206
  127. package/dist/templates/slash-commands/gemini/fast.toml +0 -182
  128. package/dist/templates/slash-commands/gemini/implement.toml +0 -266
  129. package/dist/templates/slash-commands/gemini/plan.toml +0 -170
  130. package/dist/templates/slash-commands/gemini/prd.toml +0 -177
  131. package/dist/templates/slash-commands/gemini/start.toml +0 -141
  132. package/dist/templates/slash-commands/gemini/summarize.toml +0 -178
  133. package/dist/templates/slash-commands/kilocode/archive.md +0 -291
  134. package/dist/templates/slash-commands/kilocode/deep.md +0 -207
  135. package/dist/templates/slash-commands/kilocode/fast.md +0 -183
  136. package/dist/templates/slash-commands/kilocode/implement.md +0 -267
  137. package/dist/templates/slash-commands/kilocode/plan.md +0 -173
  138. package/dist/templates/slash-commands/kilocode/prd.md +0 -178
  139. package/dist/templates/slash-commands/kilocode/start.md +0 -142
  140. package/dist/templates/slash-commands/kilocode/summarize.md +0 -179
  141. package/dist/templates/slash-commands/opencode/archive.md +0 -291
  142. package/dist/templates/slash-commands/opencode/deep.md +0 -207
  143. package/dist/templates/slash-commands/opencode/fast.md +0 -183
  144. package/dist/templates/slash-commands/opencode/implement.md +0 -267
  145. package/dist/templates/slash-commands/opencode/plan.md +0 -173
  146. package/dist/templates/slash-commands/opencode/prd.md +0 -178
  147. package/dist/templates/slash-commands/opencode/start.md +0 -142
  148. package/dist/templates/slash-commands/opencode/summarize.md +0 -179
  149. package/dist/templates/slash-commands/qwen/archive.toml +0 -290
  150. package/dist/templates/slash-commands/qwen/deep.toml +0 -206
  151. package/dist/templates/slash-commands/qwen/fast.toml +0 -182
  152. package/dist/templates/slash-commands/qwen/implement.toml +0 -266
  153. package/dist/templates/slash-commands/qwen/plan.toml +0 -170
  154. package/dist/templates/slash-commands/qwen/prd.toml +0 -177
  155. package/dist/templates/slash-commands/qwen/start.toml +0 -141
  156. package/dist/templates/slash-commands/qwen/summarize.toml +0 -178
  157. package/dist/templates/slash-commands/roocode/archive.md +0 -291
  158. package/dist/templates/slash-commands/roocode/deep.md +0 -207
  159. package/dist/templates/slash-commands/roocode/fast.md +0 -183
  160. package/dist/templates/slash-commands/roocode/implement.md +0 -267
  161. package/dist/templates/slash-commands/roocode/plan.md +0 -173
  162. package/dist/templates/slash-commands/roocode/prd.md +0 -178
  163. package/dist/templates/slash-commands/roocode/start.md +0 -142
  164. package/dist/templates/slash-commands/roocode/summarize.md +0 -179
  165. package/dist/templates/slash-commands/windsurf/archive.md +0 -291
  166. package/dist/templates/slash-commands/windsurf/deep.md +0 -207
  167. package/dist/templates/slash-commands/windsurf/fast.md +0 -183
  168. package/dist/templates/slash-commands/windsurf/implement.md +0 -267
  169. package/dist/templates/slash-commands/windsurf/plan.md +0 -173
  170. package/dist/templates/slash-commands/windsurf/prd.md +0 -178
  171. package/dist/templates/slash-commands/windsurf/start.md +0 -142
  172. package/dist/templates/slash-commands/windsurf/summarize.md +0 -179
  173. /package/dist/templates/slash-commands/{amp → _canonical}/archive.md +0 -0
  174. /package/dist/templates/slash-commands/{amp → _canonical}/deep.md +0 -0
  175. /package/dist/templates/slash-commands/{amp → _canonical}/fast.md +0 -0
  176. /package/dist/templates/slash-commands/{amp → _canonical}/implement.md +0 -0
  177. /package/dist/templates/slash-commands/{amp → _canonical}/plan.md +0 -0
  178. /package/dist/templates/slash-commands/{amp → _canonical}/prd.md +0 -0
  179. /package/dist/templates/slash-commands/{amp → _canonical}/start.md +0 -0
  180. /package/dist/templates/slash-commands/{amp → _canonical}/summarize.md +0 -0
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.WarpMdGenerator = void 0;
37
+ const file_system_1 = require("../../utils/file-system");
38
+ const path = __importStar(require("path"));
39
+ /**
40
+ * Generator for Warp WARP.md file
41
+ * Provides workflow instructions optimized for Warp users
42
+ */
43
+ class WarpMdGenerator {
44
+ /**
45
+ * Generate or update WARP.md with Clavix workflows
46
+ */
47
+ static async generate() {
48
+ const templatePath = path.join(__dirname, '../../templates/agents/warp.md');
49
+ if (!(await file_system_1.FileSystem.exists(templatePath))) {
50
+ throw new Error(`WARP.md template not found at ${templatePath}`);
51
+ }
52
+ const template = await file_system_1.FileSystem.readFile(templatePath);
53
+ await this.injectManagedBlock(this.TARGET_FILE, template);
54
+ }
55
+ static async injectManagedBlock(filePath, content) {
56
+ let fileContent = '';
57
+ if (await file_system_1.FileSystem.exists(filePath)) {
58
+ fileContent = await file_system_1.FileSystem.readFile(filePath);
59
+ }
60
+ const blockRegex = new RegExp(`${this.escapeRegex(this.START_MARKER)}[\\s\\S]*?${this.escapeRegex(this.END_MARKER)}`, 'g');
61
+ const wrappedContent = `${this.START_MARKER}\n${content}\n${this.END_MARKER}`;
62
+ if (blockRegex.test(fileContent)) {
63
+ fileContent = fileContent.replace(blockRegex, wrappedContent);
64
+ }
65
+ else {
66
+ if (fileContent && !fileContent.endsWith('\n\n')) {
67
+ fileContent += '\n\n';
68
+ }
69
+ fileContent += wrappedContent + '\n';
70
+ }
71
+ await file_system_1.FileSystem.writeFileAtomic(filePath, fileContent);
72
+ }
73
+ static escapeRegex(str) {
74
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
75
+ }
76
+ static async hasClavixBlock() {
77
+ if (!(await file_system_1.FileSystem.exists(this.TARGET_FILE))) {
78
+ return false;
79
+ }
80
+ const content = await file_system_1.FileSystem.readFile(this.TARGET_FILE);
81
+ return content.includes(this.START_MARKER);
82
+ }
83
+ }
84
+ exports.WarpMdGenerator = WarpMdGenerator;
85
+ WarpMdGenerator.TARGET_FILE = 'WARP.md';
86
+ WarpMdGenerator.START_MARKER = '<!-- CLAVIX:START -->';
87
+ WarpMdGenerator.END_MARKER = '<!-- CLAVIX:END -->';
88
+ //# sourceMappingURL=warp-md-generator.js.map
@@ -0,0 +1,34 @@
1
+ import { BaseAdapter } from './base-adapter';
2
+ /**
3
+ * Windsurf adapter
4
+ * Workflows stored in .windsurf/workflows/ (supports subdirectories)
5
+ * Slash command format: /[name] (no .md extension)
6
+ *
7
+ * Features:
8
+ * - Supports subdirectories for workflow organization
9
+ * - 12,000 character limit per workflow file
10
+ * - Auto-discovers from workspace, subdirectories, and parent dirs up to git root
11
+ *
12
+ * Reference: https://docs.windsurf.com/windsurf/cascade/workflows
13
+ */
14
+ export declare class WindsurfAdapter extends BaseAdapter {
15
+ readonly name = "windsurf";
16
+ readonly displayName = "Windsurf";
17
+ readonly directory = ".windsurf/workflows";
18
+ readonly fileExtension = ".md";
19
+ readonly features: {
20
+ supportsSubdirectories: boolean;
21
+ supportsFrontmatter: boolean;
22
+ };
23
+ /**
24
+ * Detect if Windsurf is available in the project
25
+ * Checks for .windsurf directory
26
+ */
27
+ detectProject(): Promise<boolean>;
28
+ /**
29
+ * Get command path for Windsurf
30
+ */
31
+ getCommandPath(): string;
32
+ getTargetFilename(name: string): string;
33
+ }
34
+ //# sourceMappingURL=windsurf-adapter.d.ts.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WindsurfAdapter = void 0;
4
+ const base_adapter_1 = require("./base-adapter");
5
+ const file_system_1 = require("../../utils/file-system");
6
+ /**
7
+ * Windsurf adapter
8
+ * Workflows stored in .windsurf/workflows/ (supports subdirectories)
9
+ * Slash command format: /[name] (no .md extension)
10
+ *
11
+ * Features:
12
+ * - Supports subdirectories for workflow organization
13
+ * - 12,000 character limit per workflow file
14
+ * - Auto-discovers from workspace, subdirectories, and parent dirs up to git root
15
+ *
16
+ * Reference: https://docs.windsurf.com/windsurf/cascade/workflows
17
+ */
18
+ class WindsurfAdapter extends base_adapter_1.BaseAdapter {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.name = 'windsurf';
22
+ this.displayName = 'Windsurf';
23
+ this.directory = '.windsurf/workflows';
24
+ this.fileExtension = '.md';
25
+ this.features = {
26
+ supportsSubdirectories: true,
27
+ supportsFrontmatter: false,
28
+ };
29
+ // Uses default formatCommand and generateCommands from BaseAdapter
30
+ }
31
+ /**
32
+ * Detect if Windsurf is available in the project
33
+ * Checks for .windsurf directory
34
+ */
35
+ async detectProject() {
36
+ return await file_system_1.FileSystem.exists('.windsurf');
37
+ }
38
+ /**
39
+ * Get command path for Windsurf
40
+ */
41
+ getCommandPath() {
42
+ return this.directory;
43
+ }
44
+ getTargetFilename(name) {
45
+ return `clavix-${name}${this.fileExtension}`;
46
+ }
47
+ }
48
+ exports.WindsurfAdapter = WindsurfAdapter;
49
+ //# sourceMappingURL=windsurf-adapter.js.map
@@ -0,0 +1,51 @@
1
+ import { AgentAdapter, ValidationResult } from '../types/agent';
2
+ /**
3
+ * Agent Manager - handles agent detection and registration
4
+ */
5
+ export declare class AgentManager {
6
+ private adapters;
7
+ constructor();
8
+ /**
9
+ * Register a new agent adapter
10
+ */
11
+ registerAdapter(adapter: AgentAdapter): void;
12
+ /**
13
+ * Get all registered adapters
14
+ */
15
+ getAdapters(): AgentAdapter[];
16
+ /**
17
+ * Get adapter by name
18
+ */
19
+ getAdapter(name: string): AgentAdapter | undefined;
20
+ /**
21
+ * Detect which agents are available in the current project
22
+ */
23
+ detectAgents(): Promise<AgentAdapter[]>;
24
+ /**
25
+ * Get agent adapter by name or throw error
26
+ */
27
+ requireAdapter(name: string): AgentAdapter;
28
+ /**
29
+ * Check if an agent is available
30
+ */
31
+ hasAgent(name: string): boolean;
32
+ /**
33
+ * Get list of available agent names
34
+ */
35
+ getAvailableAgents(): string[];
36
+ /**
37
+ * Validate multiple adapters
38
+ * Returns map of adapter name to validation result
39
+ */
40
+ validateAdapters(adapterNames: string[]): Promise<Map<string, ValidationResult>>;
41
+ /**
42
+ * Get adapter choices for inquirer checkbox prompt
43
+ * Returns array of choices with pre-selected defaults
44
+ */
45
+ getAdapterChoices(): Array<{
46
+ name: string;
47
+ value: string;
48
+ checked?: boolean;
49
+ }>;
50
+ }
51
+ //# sourceMappingURL=agent-manager.d.ts.map
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentManager = void 0;
4
+ const claude_code_adapter_1 = require("./adapters/claude-code-adapter");
5
+ const cursor_adapter_1 = require("./adapters/cursor-adapter");
6
+ const droid_adapter_1 = require("./adapters/droid-adapter");
7
+ const opencode_adapter_1 = require("./adapters/opencode-adapter");
8
+ const amp_adapter_1 = require("./adapters/amp-adapter");
9
+ const crush_adapter_1 = require("./adapters/crush-adapter");
10
+ const windsurf_adapter_1 = require("./adapters/windsurf-adapter");
11
+ const kilocode_adapter_1 = require("./adapters/kilocode-adapter");
12
+ const cline_adapter_1 = require("./adapters/cline-adapter");
13
+ const roocode_adapter_1 = require("./adapters/roocode-adapter");
14
+ const errors_1 = require("../types/errors");
15
+ const codebuddy_adapter_1 = require("./adapters/codebuddy-adapter");
16
+ const gemini_adapter_1 = require("./adapters/gemini-adapter");
17
+ const qwen_adapter_1 = require("./adapters/qwen-adapter");
18
+ const codex_adapter_1 = require("./adapters/codex-adapter");
19
+ const augment_adapter_1 = require("./adapters/augment-adapter");
20
+ /**
21
+ * Agent Manager - handles agent detection and registration
22
+ */
23
+ class AgentManager {
24
+ constructor() {
25
+ this.adapters = new Map();
26
+ // Register all built-in adapters
27
+ this.registerAdapter(new claude_code_adapter_1.ClaudeCodeAdapter());
28
+ this.registerAdapter(new cursor_adapter_1.CursorAdapter());
29
+ this.registerAdapter(new droid_adapter_1.DroidAdapter());
30
+ this.registerAdapter(new opencode_adapter_1.OpenCodeAdapter());
31
+ this.registerAdapter(new amp_adapter_1.AmpAdapter());
32
+ this.registerAdapter(new crush_adapter_1.CrushAdapter());
33
+ this.registerAdapter(new windsurf_adapter_1.WindsurfAdapter());
34
+ this.registerAdapter(new kilocode_adapter_1.KilocodeAdapter());
35
+ this.registerAdapter(new cline_adapter_1.ClineAdapter());
36
+ this.registerAdapter(new roocode_adapter_1.RoocodeAdapter());
37
+ this.registerAdapter(new augment_adapter_1.AugmentAdapter());
38
+ this.registerAdapter(new codebuddy_adapter_1.CodeBuddyAdapter());
39
+ this.registerAdapter(new gemini_adapter_1.GeminiAdapter());
40
+ this.registerAdapter(new qwen_adapter_1.QwenAdapter());
41
+ this.registerAdapter(new codex_adapter_1.CodexAdapter());
42
+ }
43
+ /**
44
+ * Register a new agent adapter
45
+ */
46
+ registerAdapter(adapter) {
47
+ this.adapters.set(adapter.name, adapter);
48
+ }
49
+ /**
50
+ * Get all registered adapters
51
+ */
52
+ getAdapters() {
53
+ return Array.from(this.adapters.values());
54
+ }
55
+ /**
56
+ * Get adapter by name
57
+ */
58
+ getAdapter(name) {
59
+ return this.adapters.get(name);
60
+ }
61
+ /**
62
+ * Detect which agents are available in the current project
63
+ */
64
+ async detectAgents() {
65
+ const detected = [];
66
+ for (const adapter of this.adapters.values()) {
67
+ if (await adapter.detectProject()) {
68
+ detected.push(adapter);
69
+ }
70
+ }
71
+ return detected;
72
+ }
73
+ /**
74
+ * Get agent adapter by name or throw error
75
+ */
76
+ requireAdapter(name) {
77
+ const adapter = this.getAdapter(name);
78
+ if (!adapter) {
79
+ throw new errors_1.IntegrationError(`Agent "${name}" is not registered`, `Available agents: ${Array.from(this.adapters.keys()).join(', ')}`);
80
+ }
81
+ return adapter;
82
+ }
83
+ /**
84
+ * Check if an agent is available
85
+ */
86
+ hasAgent(name) {
87
+ return this.adapters.has(name);
88
+ }
89
+ /**
90
+ * Get list of available agent names
91
+ */
92
+ getAvailableAgents() {
93
+ return Array.from(this.adapters.keys());
94
+ }
95
+ /**
96
+ * Validate multiple adapters
97
+ * Returns map of adapter name to validation result
98
+ */
99
+ async validateAdapters(adapterNames) {
100
+ const results = new Map();
101
+ for (const name of adapterNames) {
102
+ const adapter = this.requireAdapter(name);
103
+ if (adapter.validate) {
104
+ results.set(name, await adapter.validate());
105
+ }
106
+ else {
107
+ // No validation method - assume valid
108
+ results.set(name, { valid: true });
109
+ }
110
+ }
111
+ return results;
112
+ }
113
+ /**
114
+ * Get adapter choices for inquirer checkbox prompt
115
+ * Returns array of choices with pre-selected defaults
116
+ */
117
+ getAdapterChoices() {
118
+ return Array.from(this.adapters.values()).map((adapter) => ({
119
+ name: `${adapter.displayName} (${adapter.directory})`,
120
+ value: adapter.name,
121
+ checked: adapter.name === 'claude-code', // Pre-select Claude Code by default
122
+ }));
123
+ }
124
+ }
125
+ exports.AgentManager = AgentManager;
126
+ //# sourceMappingURL=agent-manager.js.map
@@ -0,0 +1,100 @@
1
+ /**
2
+ * ArchiveManager - Manages archival of completed PRD projects
3
+ *
4
+ * This class handles:
5
+ * - Listing active and archived PRD projects
6
+ * - Checking task completion status
7
+ * - Moving completed projects to archive
8
+ * - Managing archive directory structure
9
+ */
10
+ /**
11
+ * Status of a PRD project's tasks
12
+ */
13
+ export interface TaskStatus {
14
+ hasTasksFile: boolean;
15
+ total: number;
16
+ completed: number;
17
+ remaining: number;
18
+ percentage: number;
19
+ allCompleted: boolean;
20
+ }
21
+ /**
22
+ * Information about a PRD project
23
+ */
24
+ export interface PrdProject {
25
+ name: string;
26
+ path: string;
27
+ taskStatus: TaskStatus;
28
+ modifiedTime: Date;
29
+ isArchived: boolean;
30
+ }
31
+ /**
32
+ * ArchiveManager class
33
+ *
34
+ * Manages archival of completed PRD projects
35
+ */
36
+ export declare class ArchiveManager {
37
+ private readonly taskManager;
38
+ private readonly outputsDir;
39
+ private readonly archiveDir;
40
+ constructor();
41
+ /**
42
+ * List all PRD projects in outputs directory
43
+ *
44
+ * @param includeArchived - Include archived projects in results
45
+ * @returns Array of PRD projects
46
+ */
47
+ listPrdProjects(includeArchived?: boolean): Promise<PrdProject[]>;
48
+ /**
49
+ * List archived PRD projects
50
+ *
51
+ * @returns Array of archived PRD projects
52
+ */
53
+ listArchivedProjects(): Promise<PrdProject[]>;
54
+ /**
55
+ * Get PRD projects that are ready to archive (all tasks completed)
56
+ *
57
+ * @returns Array of archivable PRD projects
58
+ */
59
+ getArchivablePrds(): Promise<PrdProject[]>;
60
+ /**
61
+ * Check task completion status for a PRD project
62
+ *
63
+ * @param projectPath - Path to the PRD project directory
64
+ * @returns Task status information
65
+ */
66
+ checkTasksStatus(projectPath: string): Promise<TaskStatus>;
67
+ /**
68
+ * Archive a PRD project (move to archive directory)
69
+ *
70
+ * @param projectName - Name of the project to archive
71
+ * @param force - Force archive even if tasks are incomplete
72
+ * @returns Success status and message
73
+ */
74
+ archiveProject(projectName: string, force?: boolean): Promise<{
75
+ success: boolean;
76
+ message: string;
77
+ }>;
78
+ /**
79
+ * Restore an archived project back to active outputs
80
+ *
81
+ * @param projectName - Name of the archived project to restore
82
+ * @returns Success status and message
83
+ */
84
+ restoreProject(projectName: string): Promise<{
85
+ success: boolean;
86
+ message: string;
87
+ }>;
88
+ /**
89
+ * Check if a directory contains a PRD file
90
+ */
91
+ private hasPrdFile;
92
+ /**
93
+ * Get incomplete tasks for a project (for display purposes)
94
+ *
95
+ * @param projectPath - Path to the PRD project
96
+ * @returns Array of incomplete task descriptions
97
+ */
98
+ getIncompleteTasks(projectPath: string): Promise<string[]>;
99
+ }
100
+ //# sourceMappingURL=archive-manager.d.ts.map