skiller 0.4.3

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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +989 -0
  3. package/dist/agents/AbstractAgent.js +92 -0
  4. package/dist/agents/AgentsMdAgent.js +85 -0
  5. package/dist/agents/AiderAgent.js +108 -0
  6. package/dist/agents/AmazonQCliAgent.js +103 -0
  7. package/dist/agents/AmpAgent.js +13 -0
  8. package/dist/agents/AugmentCodeAgent.js +70 -0
  9. package/dist/agents/ClaudeAgent.js +95 -0
  10. package/dist/agents/ClineAgent.js +53 -0
  11. package/dist/agents/CodexCliAgent.js +143 -0
  12. package/dist/agents/CopilotAgent.js +43 -0
  13. package/dist/agents/CrushAgent.js +128 -0
  14. package/dist/agents/CursorAgent.js +93 -0
  15. package/dist/agents/FirebaseAgent.js +61 -0
  16. package/dist/agents/FirebenderAgent.js +205 -0
  17. package/dist/agents/GeminiCliAgent.js +99 -0
  18. package/dist/agents/GooseAgent.js +58 -0
  19. package/dist/agents/IAgent.js +2 -0
  20. package/dist/agents/JulesAgent.js +14 -0
  21. package/dist/agents/JunieAgent.js +53 -0
  22. package/dist/agents/KiloCodeAgent.js +63 -0
  23. package/dist/agents/KiroAgent.js +50 -0
  24. package/dist/agents/OpenCodeAgent.js +99 -0
  25. package/dist/agents/OpenHandsAgent.js +56 -0
  26. package/dist/agents/QwenCodeAgent.js +82 -0
  27. package/dist/agents/RooCodeAgent.js +139 -0
  28. package/dist/agents/TraeAgent.js +54 -0
  29. package/dist/agents/WarpAgent.js +61 -0
  30. package/dist/agents/WindsurfAgent.js +27 -0
  31. package/dist/agents/ZedAgent.js +132 -0
  32. package/dist/agents/agent-utils.js +37 -0
  33. package/dist/agents/index.js +77 -0
  34. package/dist/cli/commands.js +136 -0
  35. package/dist/cli/handlers.js +221 -0
  36. package/dist/cli/index.js +5 -0
  37. package/dist/constants.js +58 -0
  38. package/dist/core/ConfigLoader.js +274 -0
  39. package/dist/core/FileSystemUtils.js +421 -0
  40. package/dist/core/FrontmatterParser.js +142 -0
  41. package/dist/core/GitignoreUtils.js +171 -0
  42. package/dist/core/RuleProcessor.js +60 -0
  43. package/dist/core/SkillsProcessor.js +528 -0
  44. package/dist/core/SkillsUtils.js +230 -0
  45. package/dist/core/UnifiedConfigLoader.js +432 -0
  46. package/dist/core/UnifiedConfigTypes.js +2 -0
  47. package/dist/core/agent-selection.js +52 -0
  48. package/dist/core/apply-engine.js +668 -0
  49. package/dist/core/config-utils.js +30 -0
  50. package/dist/core/hash.js +24 -0
  51. package/dist/core/revert-engine.js +413 -0
  52. package/dist/lib.js +196 -0
  53. package/dist/mcp/capabilities.js +65 -0
  54. package/dist/mcp/merge.js +39 -0
  55. package/dist/mcp/propagateOpenCodeMcp.js +116 -0
  56. package/dist/mcp/propagateOpenHandsMcp.js +169 -0
  57. package/dist/mcp/validate.js +17 -0
  58. package/dist/paths/mcp.js +120 -0
  59. package/dist/revert.js +186 -0
  60. package/dist/types.js +2 -0
  61. package/dist/vscode/settings.js +117 -0
  62. package/package.json +77 -0
@@ -0,0 +1,99 @@
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.GeminiCliAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const fs_1 = require("fs");
39
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
40
+ class GeminiCliAgent extends AgentsMdAgent_1.AgentsMdAgent {
41
+ getIdentifier() {
42
+ return 'gemini-cli';
43
+ }
44
+ getName() {
45
+ return 'Gemini CLI';
46
+ }
47
+ async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig) {
48
+ // First, perform idempotent write of AGENTS.md via base class
49
+ await super.applyRulerConfig(concatenatedRules, projectRoot, null, {
50
+ outputPath: agentConfig?.outputPath,
51
+ });
52
+ // Prepare .gemini/settings.json with contextFileName and MCP configuration
53
+ const settingsPath = path.join(projectRoot, '.gemini', 'settings.json');
54
+ let existingSettings = {};
55
+ try {
56
+ const raw = await fs_1.promises.readFile(settingsPath, 'utf8');
57
+ existingSettings = JSON.parse(raw);
58
+ }
59
+ catch (err) {
60
+ if (err.code !== 'ENOENT') {
61
+ throw err;
62
+ }
63
+ }
64
+ const updated = {
65
+ ...existingSettings,
66
+ contextFileName: 'AGENTS.md',
67
+ };
68
+ // Handle MCP server configuration if provided
69
+ const mcpEnabled = agentConfig?.mcp?.enabled ?? true;
70
+ if (mcpEnabled && rulerMcpJson) {
71
+ const strategy = agentConfig?.mcp?.strategy ?? 'merge';
72
+ if (strategy === 'overwrite') {
73
+ // For overwrite, preserve existing settings except MCP servers
74
+ const incomingServers = rulerMcpJson.mcpServers || {};
75
+ updated[this.getMcpServerKey()] = incomingServers;
76
+ }
77
+ else {
78
+ // For merge strategy, merge with existing MCP servers
79
+ const baseServers = existingSettings[this.getMcpServerKey()] || {};
80
+ const incomingServers = rulerMcpJson.mcpServers || {};
81
+ const mergedServers = { ...baseServers, ...incomingServers };
82
+ updated[this.getMcpServerKey()] = mergedServers;
83
+ }
84
+ }
85
+ await fs_1.promises.mkdir(path.dirname(settingsPath), { recursive: true });
86
+ await fs_1.promises.writeFile(settingsPath, JSON.stringify(updated, null, 2));
87
+ }
88
+ // Ensure MCP merging uses the correct key for Gemini (.gemini/settings.json)
89
+ getMcpServerKey() {
90
+ return 'mcpServers';
91
+ }
92
+ supportsMcpStdio() {
93
+ return true;
94
+ }
95
+ supportsMcpRemote() {
96
+ return true;
97
+ }
98
+ }
99
+ exports.GeminiCliAgent = GeminiCliAgent;
@@ -0,0 +1,58 @@
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.GooseAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ /**
40
+ * Goose agent adapter for Block's Goose AI assistant.
41
+ * Propagates rules to .goosehints file.
42
+ */
43
+ class GooseAgent extends AbstractAgent_1.AbstractAgent {
44
+ getIdentifier() {
45
+ return 'goose';
46
+ }
47
+ getName() {
48
+ return 'Goose';
49
+ }
50
+ getDefaultOutputPath(projectRoot) {
51
+ return path.join(projectRoot, '.goosehints');
52
+ }
53
+ getMcpServerKey() {
54
+ // Goose doesn't support MCP configuration via local config files
55
+ return '';
56
+ }
57
+ }
58
+ exports.GooseAgent = GooseAgent;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JulesAgent = void 0;
4
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
5
+ // Jules agent now simply inherits AgentsMdAgent behavior (idempotent AGENTS.md writes).
6
+ class JulesAgent extends AgentsMdAgent_1.AgentsMdAgent {
7
+ getIdentifier() {
8
+ return 'jules';
9
+ }
10
+ getName() {
11
+ return 'Jules';
12
+ }
13
+ }
14
+ exports.JulesAgent = JulesAgent;
@@ -0,0 +1,53 @@
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.JunieAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ /**
40
+ * JetBrains Junie agent adapter.
41
+ */
42
+ class JunieAgent extends AbstractAgent_1.AbstractAgent {
43
+ getIdentifier() {
44
+ return 'junie';
45
+ }
46
+ getName() {
47
+ return 'Junie';
48
+ }
49
+ getDefaultOutputPath(projectRoot) {
50
+ return path.join(projectRoot, '.junie', 'guidelines.md');
51
+ }
52
+ }
53
+ exports.JunieAgent = JunieAgent;
@@ -0,0 +1,63 @@
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.KiloCodeAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ /**
40
+ * Kilo Code agent adapter.
41
+ * Generates ruler_kilocode_instructions.md configuration file in .kilocode/rules/ directory.
42
+ */
43
+ class KiloCodeAgent extends AbstractAgent_1.AbstractAgent {
44
+ getIdentifier() {
45
+ return 'kilocode';
46
+ }
47
+ getName() {
48
+ return 'Kilo Code';
49
+ }
50
+ getDefaultOutputPath(projectRoot) {
51
+ return path.join(projectRoot, '.kilocode', 'rules', 'ruler_kilocode_instructions.md');
52
+ }
53
+ getMcpServerKey() {
54
+ return 'mcpServers';
55
+ }
56
+ supportsMcpStdio() {
57
+ return true;
58
+ }
59
+ supportsMcpRemote() {
60
+ return true;
61
+ }
62
+ }
63
+ exports.KiloCodeAgent = KiloCodeAgent;
@@ -0,0 +1,50 @@
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.KiroAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ class KiroAgent extends AbstractAgent_1.AbstractAgent {
40
+ getIdentifier() {
41
+ return 'kiro';
42
+ }
43
+ getName() {
44
+ return 'Kiro';
45
+ }
46
+ getDefaultOutputPath(projectRoot) {
47
+ return path.join(projectRoot, '.kiro', 'steering', 'ruler_kiro_instructions.md');
48
+ }
49
+ }
50
+ exports.KiroAgent = KiroAgent;
@@ -0,0 +1,99 @@
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.OpenCodeAgent = void 0;
37
+ const fs = __importStar(require("fs/promises"));
38
+ const path = __importStar(require("path"));
39
+ class OpenCodeAgent {
40
+ getIdentifier() {
41
+ return 'opencode';
42
+ }
43
+ getName() {
44
+ return 'OpenCode';
45
+ }
46
+ getDefaultOutputPath(projectRoot) {
47
+ return {
48
+ instructions: path.join(projectRoot, 'AGENTS.md'),
49
+ mcp: path.join(projectRoot, 'opencode.json'),
50
+ };
51
+ }
52
+ async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig) {
53
+ const outputPaths = this.getDefaultOutputPath(projectRoot);
54
+ const instructionsPath = path.resolve(projectRoot, agentConfig?.outputPathInstructions ?? outputPaths['instructions']);
55
+ const mcpPath = path.resolve(projectRoot, agentConfig?.outputPathConfig ?? outputPaths['mcp']);
56
+ await fs.writeFile(instructionsPath, concatenatedRules);
57
+ // Create OpenCode config with schema and MCP configuration
58
+ let finalMcpConfig = {
59
+ $schema: 'https://opencode.ai/config.json',
60
+ mcp: {},
61
+ };
62
+ try {
63
+ const existingMcpConfig = JSON.parse(await fs.readFile(mcpPath, 'utf-8'));
64
+ if (existingMcpConfig && typeof existingMcpConfig === 'object') {
65
+ finalMcpConfig = {
66
+ $schema: 'https://opencode.ai/config.json',
67
+ ...existingMcpConfig,
68
+ mcp: {
69
+ ...(existingMcpConfig.mcp || {}),
70
+ ...(rulerMcpJson?.mcpServers ?? {}),
71
+ },
72
+ };
73
+ }
74
+ else if (rulerMcpJson) {
75
+ finalMcpConfig = {
76
+ $schema: 'https://opencode.ai/config.json',
77
+ mcp: (rulerMcpJson?.mcpServers ?? {}),
78
+ };
79
+ }
80
+ }
81
+ catch {
82
+ if (rulerMcpJson) {
83
+ finalMcpConfig = {
84
+ $schema: 'https://opencode.ai/config.json',
85
+ mcp: (rulerMcpJson?.mcpServers ?? {}),
86
+ };
87
+ }
88
+ }
89
+ // Always write the config file, even if MCP is empty
90
+ await fs.writeFile(mcpPath, JSON.stringify(finalMcpConfig, null, 2));
91
+ }
92
+ supportsMcpStdio() {
93
+ return true;
94
+ }
95
+ supportsMcpRemote() {
96
+ return true;
97
+ }
98
+ }
99
+ exports.OpenCodeAgent = OpenCodeAgent;
@@ -0,0 +1,56 @@
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.OpenHandsAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ class OpenHandsAgent extends AbstractAgent_1.AbstractAgent {
40
+ getIdentifier() {
41
+ return 'openhands';
42
+ }
43
+ getName() {
44
+ return 'Open Hands';
45
+ }
46
+ getDefaultOutputPath(projectRoot) {
47
+ return path.join(projectRoot, '.openhands', 'microagents', 'repo.md');
48
+ }
49
+ supportsMcpStdio() {
50
+ return true;
51
+ }
52
+ supportsMcpRemote() {
53
+ return true;
54
+ }
55
+ }
56
+ exports.OpenHandsAgent = OpenHandsAgent;
@@ -0,0 +1,82 @@
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.QwenCodeAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const fs_1 = require("fs");
39
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
40
+ class QwenCodeAgent extends AgentsMdAgent_1.AgentsMdAgent {
41
+ getIdentifier() {
42
+ return 'qwen';
43
+ }
44
+ getName() {
45
+ return 'Qwen Code';
46
+ }
47
+ async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig) {
48
+ // First, perform idempotent write of AGENTS.md via base class
49
+ await super.applyRulerConfig(concatenatedRules, projectRoot, null, {
50
+ outputPath: agentConfig?.outputPath,
51
+ });
52
+ // Ensure .qwen/settings.json has contextFileName set to AGENTS.md
53
+ const settingsPath = path.join(projectRoot, '.qwen', 'settings.json');
54
+ let existingSettings = {};
55
+ try {
56
+ const raw = await fs_1.promises.readFile(settingsPath, 'utf8');
57
+ existingSettings = JSON.parse(raw);
58
+ }
59
+ catch (err) {
60
+ if (err.code !== 'ENOENT') {
61
+ throw err;
62
+ }
63
+ }
64
+ const updated = {
65
+ ...existingSettings,
66
+ contextFileName: 'AGENTS.md',
67
+ };
68
+ await fs_1.promises.mkdir(path.dirname(settingsPath), { recursive: true });
69
+ await fs_1.promises.writeFile(settingsPath, JSON.stringify(updated, null, 2));
70
+ }
71
+ // Ensure MCP merging uses the correct key for Qwen Code (.qwen/settings.json)
72
+ getMcpServerKey() {
73
+ return 'mcpServers';
74
+ }
75
+ supportsMcpStdio() {
76
+ return true;
77
+ }
78
+ supportsMcpRemote() {
79
+ return true;
80
+ }
81
+ }
82
+ exports.QwenCodeAgent = QwenCodeAgent;