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,90 @@
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.GeminiAdapter = void 0;
37
+ const os = __importStar(require("os"));
38
+ const path = __importStar(require("path"));
39
+ const base_adapter_1 = require("./base-adapter");
40
+ const file_system_1 = require("../../utils/file-system");
41
+ /**
42
+ * Gemini CLI adapter
43
+ * Commands stored as TOML files under .gemini/commands/clavix by default
44
+ */
45
+ class GeminiAdapter extends base_adapter_1.BaseAdapter {
46
+ constructor(options = {}) {
47
+ super();
48
+ this.options = options;
49
+ this.name = 'gemini';
50
+ this.displayName = 'Gemini CLI';
51
+ this.fileExtension = '.toml';
52
+ this.features = {
53
+ supportsSubdirectories: true,
54
+ supportsFrontmatter: false,
55
+ argumentPlaceholder: '{{args}}',
56
+ };
57
+ }
58
+ get directory() {
59
+ const useNamespace = this.options.useNamespace ?? true;
60
+ return useNamespace ? path.join('.gemini', 'commands', 'clavix') : path.join('.gemini', 'commands');
61
+ }
62
+ async detectProject() {
63
+ if (await file_system_1.FileSystem.exists('.gemini')) {
64
+ return true;
65
+ }
66
+ const homePath = path.join(this.getHomeDir(), '.gemini');
67
+ return await file_system_1.FileSystem.exists(homePath);
68
+ }
69
+ getCommandPath() {
70
+ return this.directory;
71
+ }
72
+ getTargetFilename(name) {
73
+ const commandPath = this.getCommandPath();
74
+ const namespaced = commandPath.endsWith(path.join('commands', 'clavix'));
75
+ const baseName = namespaced ? name : `clavix-${name}`;
76
+ return `${baseName}${this.fileExtension}`;
77
+ }
78
+ formatCommand(template) {
79
+ const description = template.description.trim().length > 0
80
+ ? `description = ${JSON.stringify(template.description)}\n\n`
81
+ : '';
82
+ const content = template.content.replace(/\{\{ARGS\}\}/g, '{{args}}');
83
+ return `${description}prompt = """\n${content}\n"""\n`;
84
+ }
85
+ getHomeDir() {
86
+ return process.env.CLAVIX_HOME_OVERRIDE || os.homedir();
87
+ }
88
+ }
89
+ exports.GeminiAdapter = GeminiAdapter;
90
+ //# sourceMappingURL=gemini-adapter.js.map
@@ -0,0 +1,34 @@
1
+ import { BaseAdapter } from './base-adapter';
2
+ /**
3
+ * Kilocode adapter
4
+ * Workflows stored in .kilocode/workflows/ (flat structure, no subdirectories)
5
+ * Slash command format: /[name.md] (includes .md extension)
6
+ *
7
+ * Features:
8
+ * - Simple markdown with step-by-step instructions
9
+ * - Supports built-in tools and MCP integrations
10
+ * - Project-specific workflows only
11
+ *
12
+ * Reference: https://kilocode.ai/docs/features/slash-commands/workflows
13
+ */
14
+ export declare class KilocodeAdapter extends BaseAdapter {
15
+ readonly name = "kilocode";
16
+ readonly displayName = "Kilocode";
17
+ readonly directory = ".kilocode/workflows";
18
+ readonly fileExtension = ".md";
19
+ readonly features: {
20
+ supportsSubdirectories: boolean;
21
+ supportsFrontmatter: boolean;
22
+ };
23
+ /**
24
+ * Detect if Kilocode is available in the project
25
+ * Checks for .kilocode directory
26
+ */
27
+ detectProject(): Promise<boolean>;
28
+ /**
29
+ * Get command path for Kilocode
30
+ */
31
+ getCommandPath(): string;
32
+ getTargetFilename(name: string): string;
33
+ }
34
+ //# sourceMappingURL=kilocode-adapter.d.ts.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KilocodeAdapter = void 0;
4
+ const base_adapter_1 = require("./base-adapter");
5
+ const file_system_1 = require("../../utils/file-system");
6
+ /**
7
+ * Kilocode adapter
8
+ * Workflows stored in .kilocode/workflows/ (flat structure, no subdirectories)
9
+ * Slash command format: /[name.md] (includes .md extension)
10
+ *
11
+ * Features:
12
+ * - Simple markdown with step-by-step instructions
13
+ * - Supports built-in tools and MCP integrations
14
+ * - Project-specific workflows only
15
+ *
16
+ * Reference: https://kilocode.ai/docs/features/slash-commands/workflows
17
+ */
18
+ class KilocodeAdapter extends base_adapter_1.BaseAdapter {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.name = 'kilocode';
22
+ this.displayName = 'Kilocode';
23
+ this.directory = '.kilocode/workflows';
24
+ this.fileExtension = '.md';
25
+ this.features = {
26
+ supportsSubdirectories: false,
27
+ supportsFrontmatter: false,
28
+ };
29
+ // Uses default formatCommand and generateCommands from BaseAdapter
30
+ }
31
+ /**
32
+ * Detect if Kilocode is available in the project
33
+ * Checks for .kilocode directory
34
+ */
35
+ async detectProject() {
36
+ return await file_system_1.FileSystem.exists('.kilocode');
37
+ }
38
+ /**
39
+ * Get command path for Kilocode
40
+ */
41
+ getCommandPath() {
42
+ return this.directory;
43
+ }
44
+ getTargetFilename(name) {
45
+ return `clavix-${name}${this.fileExtension}`;
46
+ }
47
+ }
48
+ exports.KilocodeAdapter = KilocodeAdapter;
49
+ //# sourceMappingURL=kilocode-adapter.js.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Generator for Octofriend OCTO.md file
3
+ * Provides workflow instructions optimized for Octofriend capabilities
4
+ */
5
+ export declare class OctoMdGenerator {
6
+ static readonly TARGET_FILE = "OCTO.md";
7
+ static readonly START_MARKER = "<!-- CLAVIX:START -->";
8
+ static readonly END_MARKER = "<!-- CLAVIX:END -->";
9
+ /**
10
+ * Generate or update OCTO.md with Clavix workflows
11
+ */
12
+ static generate(): Promise<void>;
13
+ /**
14
+ * Inject or update managed block in OCTO.md
15
+ */
16
+ private static injectManagedBlock;
17
+ /**
18
+ * Escape special regex characters
19
+ */
20
+ private static escapeRegex;
21
+ /**
22
+ * Check if OCTO.md has Clavix block
23
+ */
24
+ static hasClavixBlock(): Promise<boolean>;
25
+ }
26
+ //# sourceMappingURL=octo-md-generator.d.ts.map
@@ -0,0 +1,102 @@
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.OctoMdGenerator = void 0;
37
+ const file_system_1 = require("../../utils/file-system");
38
+ const path = __importStar(require("path"));
39
+ /**
40
+ * Generator for Octofriend OCTO.md file
41
+ * Provides workflow instructions optimized for Octofriend capabilities
42
+ */
43
+ class OctoMdGenerator {
44
+ /**
45
+ * Generate or update OCTO.md with Clavix workflows
46
+ */
47
+ static async generate() {
48
+ const templatePath = path.join(__dirname, '../../templates/agents/octo.md');
49
+ // Check if template exists
50
+ if (!(await file_system_1.FileSystem.exists(templatePath))) {
51
+ throw new Error(`OCTO.md template not found at ${templatePath}`);
52
+ }
53
+ const template = await file_system_1.FileSystem.readFile(templatePath);
54
+ // Inject into OCTO.md using managed blocks
55
+ await this.injectManagedBlock(this.TARGET_FILE, template);
56
+ }
57
+ /**
58
+ * Inject or update managed block in OCTO.md
59
+ */
60
+ static async injectManagedBlock(filePath, content) {
61
+ let fileContent = '';
62
+ // Read existing file or start with empty content
63
+ if (await file_system_1.FileSystem.exists(filePath)) {
64
+ fileContent = await file_system_1.FileSystem.readFile(filePath);
65
+ }
66
+ const blockRegex = new RegExp(`${this.escapeRegex(this.START_MARKER)}[\\s\\S]*?${this.escapeRegex(this.END_MARKER)}`, 'g');
67
+ const wrappedContent = `${this.START_MARKER}\n${content}\n${this.END_MARKER}`;
68
+ if (blockRegex.test(fileContent)) {
69
+ // Replace existing block
70
+ fileContent = fileContent.replace(blockRegex, wrappedContent);
71
+ }
72
+ else {
73
+ // Append new block
74
+ if (fileContent && !fileContent.endsWith('\n\n')) {
75
+ fileContent += '\n\n';
76
+ }
77
+ fileContent += wrappedContent + '\n';
78
+ }
79
+ await file_system_1.FileSystem.writeFileAtomic(filePath, fileContent);
80
+ }
81
+ /**
82
+ * Escape special regex characters
83
+ */
84
+ static escapeRegex(str) {
85
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
86
+ }
87
+ /**
88
+ * Check if OCTO.md has Clavix block
89
+ */
90
+ static async hasClavixBlock() {
91
+ if (!(await file_system_1.FileSystem.exists(this.TARGET_FILE))) {
92
+ return false;
93
+ }
94
+ const content = await file_system_1.FileSystem.readFile(this.TARGET_FILE);
95
+ return content.includes(this.START_MARKER);
96
+ }
97
+ }
98
+ exports.OctoMdGenerator = OctoMdGenerator;
99
+ OctoMdGenerator.TARGET_FILE = 'OCTO.md';
100
+ OctoMdGenerator.START_MARKER = '<!-- CLAVIX:START -->';
101
+ OctoMdGenerator.END_MARKER = '<!-- CLAVIX:END -->';
102
+ //# sourceMappingURL=octo-md-generator.js.map
@@ -0,0 +1,33 @@
1
+ import { BaseAdapter } from './base-adapter';
2
+ import { CommandTemplate } from '../../types/agent';
3
+ /**
4
+ * OpenCode adapter
5
+ * Commands stored in .opencode/command/ with frontmatter
6
+ * Uses $ARGUMENTS, $1, $2 placeholders
7
+ */
8
+ export declare class OpenCodeAdapter extends BaseAdapter {
9
+ readonly name = "opencode";
10
+ readonly displayName = "OpenCode";
11
+ readonly directory = ".opencode/command";
12
+ readonly fileExtension = ".md";
13
+ readonly features: {
14
+ supportsSubdirectories: boolean;
15
+ supportsFrontmatter: boolean;
16
+ frontmatterFields: string[];
17
+ argumentPlaceholder: string;
18
+ };
19
+ /**
20
+ * Detect if OpenCode is available in the project
21
+ */
22
+ detectProject(): Promise<boolean>;
23
+ /**
24
+ * Get command path for OpenCode
25
+ */
26
+ getCommandPath(): string;
27
+ getTargetFilename(name: string): string;
28
+ /**
29
+ * Format command with frontmatter for OpenCode
30
+ */
31
+ protected formatCommand(template: CommandTemplate): string;
32
+ }
33
+ //# sourceMappingURL=opencode-adapter.d.ts.map
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenCodeAdapter = void 0;
4
+ const base_adapter_1 = require("./base-adapter");
5
+ const file_system_1 = require("../../utils/file-system");
6
+ /**
7
+ * OpenCode adapter
8
+ * Commands stored in .opencode/command/ with frontmatter
9
+ * Uses $ARGUMENTS, $1, $2 placeholders
10
+ */
11
+ class OpenCodeAdapter extends base_adapter_1.BaseAdapter {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.name = 'opencode';
15
+ this.displayName = 'OpenCode';
16
+ this.directory = '.opencode/command';
17
+ this.fileExtension = '.md';
18
+ this.features = {
19
+ supportsSubdirectories: false,
20
+ supportsFrontmatter: true,
21
+ frontmatterFields: ['description', 'agent', 'model'],
22
+ argumentPlaceholder: '$ARGUMENTS',
23
+ };
24
+ }
25
+ /**
26
+ * Detect if OpenCode is available in the project
27
+ */
28
+ async detectProject() {
29
+ return await file_system_1.FileSystem.exists('.opencode');
30
+ }
31
+ /**
32
+ * Get command path for OpenCode
33
+ */
34
+ getCommandPath() {
35
+ return this.directory;
36
+ }
37
+ getTargetFilename(name) {
38
+ return `clavix-${name}${this.fileExtension}`;
39
+ }
40
+ /**
41
+ * Format command with frontmatter for OpenCode
42
+ */
43
+ formatCommand(template) {
44
+ // Add frontmatter
45
+ const frontmatter = `---
46
+ description: ${template.description}
47
+ ---
48
+
49
+ `;
50
+ // Replace generic argument placeholder with $ARGUMENTS
51
+ const content = template.content.replace(/\{\{ARGS\}\}/g, '$ARGUMENTS');
52
+ return frontmatter + content;
53
+ }
54
+ }
55
+ exports.OpenCodeAdapter = OpenCodeAdapter;
56
+ //# sourceMappingURL=opencode-adapter.js.map
@@ -0,0 +1,27 @@
1
+ import { BaseAdapter } from './base-adapter';
2
+ import { CommandTemplate } from '../../types/agent';
3
+ /**
4
+ * Qwen Code CLI adapter
5
+ * Commands stored as TOML files under .qwen/commands/clavix by default
6
+ */
7
+ export declare class QwenAdapter extends BaseAdapter {
8
+ private readonly options;
9
+ readonly name = "qwen";
10
+ readonly displayName = "Qwen Code";
11
+ readonly fileExtension = ".toml";
12
+ readonly features: {
13
+ supportsSubdirectories: boolean;
14
+ supportsFrontmatter: boolean;
15
+ argumentPlaceholder: string;
16
+ };
17
+ constructor(options?: {
18
+ useNamespace?: boolean;
19
+ });
20
+ get directory(): string;
21
+ detectProject(): Promise<boolean>;
22
+ getCommandPath(): string;
23
+ getTargetFilename(name: string): string;
24
+ protected formatCommand(template: CommandTemplate): string;
25
+ private getHomeDir;
26
+ }
27
+ //# sourceMappingURL=qwen-adapter.d.ts.map
@@ -0,0 +1,90 @@
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.QwenAdapter = void 0;
37
+ const os = __importStar(require("os"));
38
+ const path = __importStar(require("path"));
39
+ const base_adapter_1 = require("./base-adapter");
40
+ const file_system_1 = require("../../utils/file-system");
41
+ /**
42
+ * Qwen Code CLI adapter
43
+ * Commands stored as TOML files under .qwen/commands/clavix by default
44
+ */
45
+ class QwenAdapter extends base_adapter_1.BaseAdapter {
46
+ constructor(options = {}) {
47
+ super();
48
+ this.options = options;
49
+ this.name = 'qwen';
50
+ this.displayName = 'Qwen Code';
51
+ this.fileExtension = '.toml';
52
+ this.features = {
53
+ supportsSubdirectories: true,
54
+ supportsFrontmatter: false,
55
+ argumentPlaceholder: '{{args}}',
56
+ };
57
+ }
58
+ get directory() {
59
+ const useNamespace = this.options.useNamespace ?? true;
60
+ return useNamespace ? path.join('.qwen', 'commands', 'clavix') : path.join('.qwen', 'commands');
61
+ }
62
+ async detectProject() {
63
+ if (await file_system_1.FileSystem.exists('.qwen')) {
64
+ return true;
65
+ }
66
+ const homePath = path.join(this.getHomeDir(), '.qwen');
67
+ return await file_system_1.FileSystem.exists(homePath);
68
+ }
69
+ getCommandPath() {
70
+ return this.directory;
71
+ }
72
+ getTargetFilename(name) {
73
+ const commandPath = this.getCommandPath();
74
+ const namespaced = commandPath.endsWith(path.join('commands', 'clavix'));
75
+ const baseName = namespaced ? name : `clavix-${name}`;
76
+ return `${baseName}${this.fileExtension}`;
77
+ }
78
+ formatCommand(template) {
79
+ const description = template.description.trim().length > 0
80
+ ? `description = ${JSON.stringify(template.description)}\n\n`
81
+ : '';
82
+ const content = template.content.replace(/\{\{ARGS\}\}/g, '{{args}}');
83
+ return `${description}prompt = """\n${content}\n"""\n`;
84
+ }
85
+ getHomeDir() {
86
+ return process.env.CLAVIX_HOME_OVERRIDE || os.homedir();
87
+ }
88
+ }
89
+ exports.QwenAdapter = QwenAdapter;
90
+ //# sourceMappingURL=qwen-adapter.js.map
@@ -0,0 +1,40 @@
1
+ import { BaseAdapter } from './base-adapter';
2
+ import { CommandTemplate } from '../../types/agent';
3
+ /**
4
+ * Roocode adapter
5
+ * Commands stored in .roo/commands/ (flat structure, no subdirectories)
6
+ * Slash command format: /[name] (no .md extension, auto-converts to lowercase/dashes)
7
+ *
8
+ * Features:
9
+ * - Supports optional frontmatter (description, argument-hint)
10
+ * - Command names automatically processed: lowercase, spaces→dashes, special chars removed
11
+ * - Project commands override global commands
12
+ *
13
+ * Reference: https://docs.roocode.com/features/slash-commands
14
+ */
15
+ export declare class RoocodeAdapter extends BaseAdapter {
16
+ readonly name = "roocode";
17
+ readonly displayName = "Roocode";
18
+ readonly directory = ".roo/commands";
19
+ readonly fileExtension = ".md";
20
+ readonly features: {
21
+ supportsSubdirectories: boolean;
22
+ supportsFrontmatter: boolean;
23
+ };
24
+ /**
25
+ * Detect if Roocode is available in the project
26
+ * Checks for .roo directory
27
+ */
28
+ detectProject(): Promise<boolean>;
29
+ /**
30
+ * Get command path for Roocode
31
+ */
32
+ getCommandPath(): string;
33
+ getTargetFilename(name: string): string;
34
+ /**
35
+ * Format command content for Roocode
36
+ * Adds frontmatter with description and argument-hint if not already present
37
+ */
38
+ protected formatCommand(template: CommandTemplate): string;
39
+ }
40
+ //# sourceMappingURL=roocode-adapter.d.ts.map
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoocodeAdapter = void 0;
4
+ const base_adapter_1 = require("./base-adapter");
5
+ const file_system_1 = require("../../utils/file-system");
6
+ /**
7
+ * Roocode adapter
8
+ * Commands stored in .roo/commands/ (flat structure, no subdirectories)
9
+ * Slash command format: /[name] (no .md extension, auto-converts to lowercase/dashes)
10
+ *
11
+ * Features:
12
+ * - Supports optional frontmatter (description, argument-hint)
13
+ * - Command names automatically processed: lowercase, spaces→dashes, special chars removed
14
+ * - Project commands override global commands
15
+ *
16
+ * Reference: https://docs.roocode.com/features/slash-commands
17
+ */
18
+ class RoocodeAdapter extends base_adapter_1.BaseAdapter {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.name = 'roocode';
22
+ this.displayName = 'Roocode';
23
+ this.directory = '.roo/commands';
24
+ this.fileExtension = '.md';
25
+ this.features = {
26
+ supportsSubdirectories: false,
27
+ supportsFrontmatter: true,
28
+ };
29
+ }
30
+ /**
31
+ * Detect if Roocode is available in the project
32
+ * Checks for .roo directory
33
+ */
34
+ async detectProject() {
35
+ return await file_system_1.FileSystem.exists('.roo');
36
+ }
37
+ /**
38
+ * Get command path for Roocode
39
+ */
40
+ getCommandPath() {
41
+ return this.directory;
42
+ }
43
+ getTargetFilename(name) {
44
+ return `clavix-${name}${this.fileExtension}`;
45
+ }
46
+ /**
47
+ * Format command content for Roocode
48
+ * Adds frontmatter with description and argument-hint if not already present
49
+ */
50
+ formatCommand(template) {
51
+ const content = template.content;
52
+ // Check if frontmatter already exists
53
+ if (content.trim().startsWith('---')) {
54
+ // Frontmatter already exists, use as-is
55
+ return content;
56
+ }
57
+ // Add Roocode-specific frontmatter
58
+ const frontmatter = `---
59
+ description: ${template.description || `Clavix ${template.name} command`}
60
+ argument-hint: <prompt>
61
+ ---
62
+
63
+ `;
64
+ return frontmatter + content;
65
+ }
66
+ }
67
+ exports.RoocodeAdapter = RoocodeAdapter;
68
+ //# sourceMappingURL=roocode-adapter.js.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generator for Warp WARP.md file
3
+ * Provides workflow instructions optimized for Warp users
4
+ */
5
+ export declare class WarpMdGenerator {
6
+ static readonly TARGET_FILE = "WARP.md";
7
+ static readonly START_MARKER = "<!-- CLAVIX:START -->";
8
+ static readonly END_MARKER = "<!-- CLAVIX:END -->";
9
+ /**
10
+ * Generate or update WARP.md with Clavix workflows
11
+ */
12
+ static generate(): Promise<void>;
13
+ private static injectManagedBlock;
14
+ private static escapeRegex;
15
+ static hasClavixBlock(): Promise<boolean>;
16
+ }
17
+ //# sourceMappingURL=warp-md-generator.d.ts.map