@intellectronica/ruler 0.3.40 → 0.3.42
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/README.md +59 -46
- package/dist/agents/AbstractAgent.d.ts +53 -0
- package/dist/agents/AgentsMdAgent.d.ts +14 -0
- package/dist/agents/AiderAgent.d.ts +14 -0
- package/dist/agents/AiderAgent.js +3 -1
- package/dist/agents/AmazonQCliAgent.d.ts +13 -0
- package/dist/agents/AmpAgent.d.ts +6 -0
- package/dist/agents/AntigravityAgent.d.ts +10 -0
- package/dist/agents/AugmentCodeAgent.d.ts +13 -0
- package/dist/agents/ClaudeAgent.d.ts +13 -0
- package/dist/agents/ClineAgent.d.ts +9 -0
- package/dist/agents/CodexCliAgent.d.ts +31 -0
- package/dist/agents/CopilotAgent.d.ts +20 -0
- package/dist/agents/CrushAgent.d.ts +14 -0
- package/dist/agents/CrushAgent.js +5 -2
- package/dist/agents/CursorAgent.d.ts +17 -0
- package/dist/agents/FactoryDroidAgent.d.ts +13 -0
- package/dist/agents/FirebaseAgent.d.ts +11 -0
- package/dist/agents/FirebenderAgent.d.ts +36 -0
- package/dist/agents/GeminiCliAgent.d.ts +11 -0
- package/dist/agents/GeminiCliAgent.js +2 -2
- package/dist/agents/GooseAgent.d.ts +12 -0
- package/dist/agents/IAgent.d.ts +72 -0
- package/dist/agents/JetBrainsAiAssistantAgent.d.ts +10 -0
- package/dist/agents/JulesAgent.d.ts +5 -0
- package/dist/agents/JunieAgent.d.ts +12 -0
- package/dist/agents/KiloCodeAgent.d.ts +14 -0
- package/dist/agents/KiroAgent.d.ts +8 -0
- package/dist/agents/MistralVibeAgent.d.ts +31 -0
- package/dist/agents/OpenCodeAgent.d.ts +11 -0
- package/dist/agents/OpenCodeAgent.js +14 -9
- package/dist/agents/OpenHandsAgent.d.ts +8 -0
- package/dist/agents/PiAgent.d.ts +9 -0
- package/dist/agents/QwenCodeAgent.d.ts +10 -0
- package/dist/agents/QwenCodeAgent.js +2 -2
- package/dist/agents/RooCodeAgent.d.ts +16 -0
- package/dist/agents/TraeAgent.d.ts +10 -0
- package/dist/agents/WarpAgent.d.ts +12 -0
- package/dist/agents/WindsurfAgent.d.ts +13 -0
- package/dist/agents/ZedAgent.d.ts +21 -0
- package/dist/agents/ZedAgent.js +5 -2
- package/dist/agents/agent-utils.d.ts +5 -0
- package/dist/agents/agent-utils.js +8 -5
- package/dist/agents/index.d.ts +9 -0
- package/dist/cli/commands.d.ts +4 -0
- package/dist/cli/commands.js +2 -3
- package/dist/cli/handlers.d.ts +41 -0
- package/dist/cli/handlers.js +76 -60
- package/dist/cli/index.d.ts +2 -0
- package/dist/constants.d.ts +35 -0
- package/dist/core/ConfigLoader.d.ts +57 -0
- package/dist/core/ConfigLoader.js +123 -41
- package/dist/core/FileSystemUtils.d.ts +51 -0
- package/dist/core/FileSystemUtils.js +37 -17
- package/dist/core/GitignoreUtils.d.ts +15 -0
- package/dist/core/GitignoreUtils.js +32 -1
- package/dist/core/RuleProcessor.d.ts +8 -0
- package/dist/core/SkillsProcessor.d.ts +127 -0
- package/dist/core/SkillsProcessor.js +104 -218
- package/dist/core/SkillsUtils.d.ts +26 -0
- package/dist/core/SubagentsProcessor.d.ts +38 -0
- package/dist/core/SubagentsProcessor.js +68 -22
- package/dist/core/SubagentsUtils.d.ts +34 -0
- package/dist/core/UnifiedConfigLoader.d.ts +10 -0
- package/dist/core/UnifiedConfigLoader.js +61 -31
- package/dist/core/UnifiedConfigTypes.d.ts +95 -0
- package/dist/core/agent-selection.d.ts +12 -0
- package/dist/core/agent-selection.js +11 -3
- package/dist/core/apply-engine.d.ts +69 -0
- package/dist/core/apply-engine.js +57 -50
- package/dist/core/config-utils.d.ts +14 -0
- package/dist/core/config-utils.js +9 -3
- package/dist/core/hash.d.ts +2 -0
- package/dist/core/path-utils.d.ts +1 -0
- package/dist/core/path-utils.js +42 -0
- package/dist/core/revert-engine.d.ts +36 -0
- package/dist/core/revert-engine.js +70 -9
- package/dist/lib.d.ts +13 -0
- package/dist/lib.js +23 -5
- package/dist/mcp/capabilities.d.ts +20 -0
- package/dist/mcp/merge.d.ts +10 -0
- package/dist/mcp/merge.js +19 -1
- package/dist/mcp/propagateOpenCodeMcp.d.ts +2 -0
- package/dist/mcp/propagateOpenCodeMcp.js +21 -9
- package/dist/mcp/propagateOpenHandsMcp.d.ts +2 -0
- package/dist/mcp/propagateOpenHandsMcp.js +31 -15
- package/dist/mcp/validate.d.ts +7 -0
- package/dist/mcp/validate.js +6 -1
- package/dist/paths/mcp.d.ts +8 -0
- package/dist/paths/mcp.js +33 -4
- package/dist/revert.d.ts +6 -0
- package/dist/revert.js +39 -27
- package/dist/types.d.ts +87 -0
- package/dist/vscode/settings.d.ts +40 -0
- package/package.json +7 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface defining an AI agent configuration adapter.
|
|
3
|
+
*/
|
|
4
|
+
import { McpConfig } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration overrides for a specific agent.
|
|
7
|
+
*/
|
|
8
|
+
export interface IAgentConfig {
|
|
9
|
+
/** Explicit enable/disable agent */
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
/** Override for primary output path */
|
|
12
|
+
outputPath?: string;
|
|
13
|
+
/** Override for Aider instruction file path */
|
|
14
|
+
outputPathInstructions?: string;
|
|
15
|
+
/** Override for Aider config file path */
|
|
16
|
+
outputPathConfig?: string;
|
|
17
|
+
/** MCP propagation config for this agent. */
|
|
18
|
+
mcp?: McpConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface IAgent {
|
|
21
|
+
/**
|
|
22
|
+
* Returns the lowercase identifier of the agent (e.g., "copilot", "claude", "aider").
|
|
23
|
+
*/
|
|
24
|
+
getIdentifier(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the display name of the agent.
|
|
27
|
+
*/
|
|
28
|
+
getName(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Applies the concatenated ruler rules to the agent's configuration.
|
|
31
|
+
* @param concatenatedRules The combined rules text
|
|
32
|
+
* @param projectRoot The root directory of the project
|
|
33
|
+
*/
|
|
34
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, rulerMcpJson: Record<string, unknown> | null, agentConfig?: IAgentConfig, backup?: boolean): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the default output path(s) for this agent given the project root.
|
|
37
|
+
*/
|
|
38
|
+
getDefaultOutputPath(projectRoot: string): string | Record<string, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the specific key to be used for the server object in MCP JSON.
|
|
41
|
+
* Defaults to 'mcpServers' if not implemented.
|
|
42
|
+
*/
|
|
43
|
+
getMcpServerKey?(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Returns whether this agent supports MCP STDIO servers.
|
|
46
|
+
* Defaults to false if not implemented.
|
|
47
|
+
*/
|
|
48
|
+
supportsMcpStdio?(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Returns whether this agent supports MCP remote servers.
|
|
51
|
+
* Defaults to false if not implemented.
|
|
52
|
+
*/
|
|
53
|
+
supportsMcpRemote?(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Returns whether this agent supports MCP server timeout configuration.
|
|
56
|
+
* Defaults to false if not implemented.
|
|
57
|
+
*/
|
|
58
|
+
supportsMcpTimeout?(): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Returns whether this agent has native skills support (like Claude Code).
|
|
61
|
+
* When true, skills are copied directly to the agent's skills directory.
|
|
62
|
+
* Defaults to false if not implemented.
|
|
63
|
+
*/
|
|
64
|
+
supportsNativeSkills?(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Returns whether this agent has native subagent support (like Claude Code,
|
|
67
|
+
* Cursor, Codex CLI, GitHub Copilot). When true, subagent definitions from
|
|
68
|
+
* `.ruler/agents/` are propagated to the agent's native subagent location.
|
|
69
|
+
* Defaults to false if not implemented.
|
|
70
|
+
*/
|
|
71
|
+
supportsNativeSubagents?(): boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
/**
|
|
3
|
+
* JetBrains AI Assistant agent adapter.
|
|
4
|
+
* Writes rules to .aiassistant/rules/AGENTS.md.
|
|
5
|
+
*/
|
|
6
|
+
export declare class JetBrainsAiAssistantAgent extends AbstractAgent {
|
|
7
|
+
getIdentifier(): string;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
/**
|
|
3
|
+
* JetBrains Junie agent adapter.
|
|
4
|
+
*/
|
|
5
|
+
export declare class JunieAgent extends AbstractAgent {
|
|
6
|
+
getIdentifier(): string;
|
|
7
|
+
getName(): string;
|
|
8
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
9
|
+
supportsMcpStdio(): boolean;
|
|
10
|
+
supportsMcpRemote(): boolean;
|
|
11
|
+
supportsNativeSkills(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgentsMdAgent } from './AgentsMdAgent';
|
|
2
|
+
/**
|
|
3
|
+
* Kilo Code agent adapter.
|
|
4
|
+
* Uses AGENTS.md for instructions and .kilocode/mcp.json for MCP configuration.
|
|
5
|
+
*/
|
|
6
|
+
export declare class KiloCodeAgent extends AgentsMdAgent {
|
|
7
|
+
getIdentifier(): string;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
10
|
+
getMcpServerKey(): string;
|
|
11
|
+
supportsMcpStdio(): boolean;
|
|
12
|
+
supportsMcpRemote(): boolean;
|
|
13
|
+
supportsNativeSkills(): boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
export declare class KiroAgent extends AbstractAgent {
|
|
3
|
+
getIdentifier(): string;
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
6
|
+
supportsMcpStdio(): boolean;
|
|
7
|
+
supportsMcpRemote(): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IAgent, IAgentConfig } from './IAgent';
|
|
2
|
+
interface RulerMcpServer {
|
|
3
|
+
command?: string;
|
|
4
|
+
args?: string[];
|
|
5
|
+
url?: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
env?: Record<string, string>;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
interface RulerMcp {
|
|
11
|
+
mcpServers?: Record<string, RulerMcpServer>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mistral Vibe CLI agent adapter.
|
|
15
|
+
* Propagates rules to AGENTS.md and MCP servers to .vibe/config.toml.
|
|
16
|
+
*/
|
|
17
|
+
export declare class MistralVibeAgent implements IAgent {
|
|
18
|
+
private agentsMdAgent;
|
|
19
|
+
getIdentifier(): string;
|
|
20
|
+
getName(): string;
|
|
21
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, rulerMcpJson: RulerMcp | null, agentConfig?: IAgentConfig, backup?: boolean): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Determines the transport type based on server configuration.
|
|
24
|
+
*/
|
|
25
|
+
private determineTransport;
|
|
26
|
+
getDefaultOutputPath(projectRoot: string): Record<string, string>;
|
|
27
|
+
supportsMcpStdio(): boolean;
|
|
28
|
+
supportsMcpRemote(): boolean;
|
|
29
|
+
supportsNativeSkills(): boolean;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IAgent, IAgentConfig } from './IAgent';
|
|
2
|
+
export declare class OpenCodeAgent implements IAgent {
|
|
3
|
+
getIdentifier(): string;
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDefaultOutputPath(projectRoot: string): Record<string, string>;
|
|
6
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, rulerMcpJson: Record<string, unknown> | null, agentConfig?: IAgentConfig): Promise<void>;
|
|
7
|
+
supportsMcpStdio(): boolean;
|
|
8
|
+
supportsMcpRemote(): boolean;
|
|
9
|
+
supportsMcpTimeout(): boolean;
|
|
10
|
+
supportsNativeSkills(): boolean;
|
|
11
|
+
}
|
|
@@ -51,9 +51,15 @@ class OpenCodeAgent {
|
|
|
51
51
|
}
|
|
52
52
|
async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig) {
|
|
53
53
|
const outputPaths = this.getDefaultOutputPath(projectRoot);
|
|
54
|
-
const instructionsPath = path.resolve(projectRoot, agentConfig?.
|
|
54
|
+
const instructionsPath = path.resolve(projectRoot, agentConfig?.outputPath ??
|
|
55
|
+
agentConfig?.outputPathInstructions ??
|
|
56
|
+
outputPaths['instructions']);
|
|
55
57
|
const mcpPath = path.resolve(projectRoot, agentConfig?.outputPathConfig ?? outputPaths['mcp']);
|
|
58
|
+
await fs.mkdir(path.dirname(instructionsPath), { recursive: true });
|
|
56
59
|
await fs.writeFile(instructionsPath, concatenatedRules);
|
|
60
|
+
if (!rulerMcpJson) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
57
63
|
// Create OpenCode config with schema and MCP configuration
|
|
58
64
|
let finalMcpConfig = {
|
|
59
65
|
$schema: 'https://opencode.ai/config.json',
|
|
@@ -71,22 +77,21 @@ class OpenCodeAgent {
|
|
|
71
77
|
},
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
|
-
else
|
|
80
|
+
else {
|
|
75
81
|
finalMcpConfig = {
|
|
76
82
|
$schema: 'https://opencode.ai/config.json',
|
|
77
|
-
mcp: (rulerMcpJson
|
|
83
|
+
mcp: (rulerMcpJson.mcpServers ?? {}),
|
|
78
84
|
};
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
catch {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
+
finalMcpConfig = {
|
|
89
|
+
$schema: 'https://opencode.ai/config.json',
|
|
90
|
+
mcp: (rulerMcpJson.mcpServers ?? {}),
|
|
91
|
+
};
|
|
88
92
|
}
|
|
89
93
|
// Always write the config file, even if MCP is empty
|
|
94
|
+
await fs.mkdir(path.dirname(mcpPath), { recursive: true });
|
|
90
95
|
await fs.writeFile(mcpPath, JSON.stringify(finalMcpConfig, null, 2));
|
|
91
96
|
}
|
|
92
97
|
supportsMcpStdio() {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
export declare class OpenHandsAgent extends AbstractAgent {
|
|
3
|
+
getIdentifier(): string;
|
|
4
|
+
getName(): string;
|
|
5
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
6
|
+
supportsMcpStdio(): boolean;
|
|
7
|
+
supportsMcpRemote(): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAgentConfig } from './IAgent';
|
|
2
|
+
import { AgentsMdAgent } from './AgentsMdAgent';
|
|
3
|
+
export declare class QwenCodeAgent extends AgentsMdAgent {
|
|
4
|
+
getIdentifier(): string;
|
|
5
|
+
getName(): string;
|
|
6
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, _rulerMcpJson: Record<string, unknown> | null, agentConfig?: IAgentConfig, backup?: boolean): Promise<void>;
|
|
7
|
+
getMcpServerKey(): string;
|
|
8
|
+
supportsMcpStdio(): boolean;
|
|
9
|
+
supportsMcpRemote(): boolean;
|
|
10
|
+
}
|
|
@@ -44,11 +44,11 @@ class QwenCodeAgent extends AgentsMdAgent_1.AgentsMdAgent {
|
|
|
44
44
|
getName() {
|
|
45
45
|
return 'Qwen Code';
|
|
46
46
|
}
|
|
47
|
-
async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig) {
|
|
47
|
+
async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true) {
|
|
48
48
|
// First, perform idempotent write of AGENTS.md via base class
|
|
49
49
|
await super.applyRulerConfig(concatenatedRules, projectRoot, null, {
|
|
50
50
|
outputPath: agentConfig?.outputPath,
|
|
51
|
-
});
|
|
51
|
+
}, backup);
|
|
52
52
|
// Ensure .qwen/settings.json has contextFileName set to AGENTS.md
|
|
53
53
|
const settingsPath = path.join(projectRoot, '.qwen', 'settings.json');
|
|
54
54
|
let existingSettings = {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IAgent, IAgentConfig } from './IAgent';
|
|
2
|
+
/**
|
|
3
|
+
* Agent for RooCode that writes to AGENTS.md and generates .roo/mcp.json
|
|
4
|
+
* with project-level MCP server configuration.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RooCodeAgent implements IAgent {
|
|
7
|
+
private agentsMdAgent;
|
|
8
|
+
getIdentifier(): string;
|
|
9
|
+
getName(): string;
|
|
10
|
+
getDefaultOutputPath(projectRoot: string): Record<string, string>;
|
|
11
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, rulerMcpJson: Record<string, unknown> | null, agentConfig?: IAgentConfig, backup?: boolean): Promise<void>;
|
|
12
|
+
supportsMcpStdio(): boolean;
|
|
13
|
+
supportsMcpRemote(): boolean;
|
|
14
|
+
getMcpServerKey(): string;
|
|
15
|
+
supportsNativeSkills(): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
/**
|
|
3
|
+
* Trae AI agent adapter.
|
|
4
|
+
* Generates project_rules.md configuration file.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TraeAgent extends AbstractAgent {
|
|
7
|
+
getIdentifier(): string;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
2
|
+
/**
|
|
3
|
+
* Warp Agent Mode adapter.
|
|
4
|
+
* Generates WARP.md configuration file in the project root.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WarpAgent extends AbstractAgent {
|
|
7
|
+
getIdentifier(): string;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getDefaultOutputPath(projectRoot: string): string;
|
|
10
|
+
supportsMcpStdio(): boolean;
|
|
11
|
+
supportsMcpRemote(): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AgentsMdAgent } from './AgentsMdAgent';
|
|
2
|
+
/**
|
|
3
|
+
* Windsurf agent adapter.
|
|
4
|
+
* Now uses AGENTS.md format like other agents.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WindsurfAgent extends AgentsMdAgent {
|
|
7
|
+
getIdentifier(): string;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getMcpServerKey(): string;
|
|
10
|
+
supportsMcpStdio(): boolean;
|
|
11
|
+
supportsMcpRemote(): boolean;
|
|
12
|
+
supportsNativeSkills(): boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AgentsMdAgent } from './AgentsMdAgent';
|
|
2
|
+
import { IAgentConfig } from './IAgent';
|
|
3
|
+
/**
|
|
4
|
+
* Zed editor agent adapter.
|
|
5
|
+
* Inherits from AgentsMdAgent to write instructions to AGENTS.md and handles
|
|
6
|
+
* MCP server configuration in .zed/settings.json at the project root.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ZedAgent extends AgentsMdAgent {
|
|
9
|
+
getIdentifier(): string;
|
|
10
|
+
getName(): string;
|
|
11
|
+
applyRulerConfig(concatenatedRules: string, projectRoot: string, rulerMcpJson: Record<string, unknown> | null, agentConfig?: IAgentConfig, backup?: boolean): Promise<void>;
|
|
12
|
+
getMcpServerKey(): string;
|
|
13
|
+
supportsMcpStdio(): boolean;
|
|
14
|
+
supportsMcpRemote(): boolean;
|
|
15
|
+
supportsNativeSkills(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Transform MCP server configuration from ruler format to Zed format.
|
|
18
|
+
* Converts "type": "stdio" to "source": "custom" and preserves other fields.
|
|
19
|
+
*/
|
|
20
|
+
private transformMcpServerForZed;
|
|
21
|
+
}
|
package/dist/agents/ZedAgent.js
CHANGED
|
@@ -49,11 +49,11 @@ class ZedAgent extends AgentsMdAgent_1.AgentsMdAgent {
|
|
|
49
49
|
getName() {
|
|
50
50
|
return 'Zed';
|
|
51
51
|
}
|
|
52
|
-
async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig) {
|
|
52
|
+
async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig, backup = true) {
|
|
53
53
|
// First, perform idempotent AGENTS.md write via base class
|
|
54
54
|
await super.applyRulerConfig(concatenatedRules, projectRoot, null, {
|
|
55
55
|
outputPath: agentConfig?.outputPath,
|
|
56
|
-
});
|
|
56
|
+
}, backup);
|
|
57
57
|
// Handle MCP server configuration if enabled and provided
|
|
58
58
|
const mcpEnabled = agentConfig?.mcp?.enabled ?? true;
|
|
59
59
|
if (mcpEnabled && rulerMcpJson) {
|
|
@@ -116,6 +116,9 @@ class ZedAgent extends AgentsMdAgent_1.AgentsMdAgent {
|
|
|
116
116
|
supportsMcpRemote() {
|
|
117
117
|
return true;
|
|
118
118
|
}
|
|
119
|
+
supportsNativeSkills() {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
119
122
|
/**
|
|
120
123
|
* Transform MCP server configuration from ruler format to Zed format.
|
|
121
124
|
* Converts "type": "stdio" to "source": "custom" and preserves other fields.
|
|
@@ -17,17 +17,20 @@ function getAgentOutputPaths(agent, projectRoot, agentConfig) {
|
|
|
17
17
|
const defaultPaths = defaults;
|
|
18
18
|
// Handle instructions path
|
|
19
19
|
if ('instructions' in defaultPaths) {
|
|
20
|
-
const instructionsPath = agentConfig?.
|
|
20
|
+
const instructionsPath = agentConfig?.outputPath ??
|
|
21
|
+
agentConfig?.outputPathInstructions ??
|
|
22
|
+
defaultPaths.instructions;
|
|
21
23
|
paths.push(instructionsPath);
|
|
22
24
|
}
|
|
23
|
-
// Handle config path
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
// Handle config/MCP path
|
|
26
|
+
const configKey = 'config' in defaultPaths ? 'config' : 'mcp';
|
|
27
|
+
if (configKey in defaultPaths) {
|
|
28
|
+
const configPath = agentConfig?.outputPathConfig ?? defaultPaths[configKey];
|
|
26
29
|
paths.push(configPath);
|
|
27
30
|
}
|
|
28
31
|
// Handle any other paths in the default paths record
|
|
29
32
|
for (const [key, defaultPath] of Object.entries(defaultPaths)) {
|
|
30
|
-
if (key !== 'instructions' && key !==
|
|
33
|
+
if (key !== 'instructions' && key !== configKey) {
|
|
31
34
|
// For unknown path types, use the default since we don't have specific config overrides
|
|
32
35
|
paths.push(defaultPath);
|
|
33
36
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAgent } from './IAgent';
|
|
2
|
+
import { AbstractAgent } from './AbstractAgent';
|
|
3
|
+
export { AbstractAgent };
|
|
4
|
+
export declare const allAgents: IAgent[];
|
|
5
|
+
/**
|
|
6
|
+
* Generates a comma-separated list of agent identifiers for CLI help text.
|
|
7
|
+
* Returns identifiers in alphabetical order, with 'agentsmd' always first.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAgentIdentifiersForCliHelp(): string;
|
package/dist/cli/commands.js
CHANGED
|
@@ -71,8 +71,7 @@ function run() {
|
|
|
71
71
|
})
|
|
72
72
|
.option('backup', {
|
|
73
73
|
type: 'boolean',
|
|
74
|
-
description: 'Enable/disable creation of .bak backup files (default: enabled)',
|
|
75
|
-
default: true,
|
|
74
|
+
description: 'Enable/disable creation of .bak backup files (default: from config or enabled)',
|
|
76
75
|
})
|
|
77
76
|
.option('skills', {
|
|
78
77
|
type: 'boolean',
|
|
@@ -80,7 +79,7 @@ function run() {
|
|
|
80
79
|
})
|
|
81
80
|
.option('subagents', {
|
|
82
81
|
type: 'boolean',
|
|
83
|
-
description: 'Enable/disable subagents support (experimental, default:
|
|
82
|
+
description: 'Enable/disable subagents support (experimental, default: disabled)',
|
|
84
83
|
});
|
|
85
84
|
}, handlers_1.applyHandler)
|
|
86
85
|
.command('init', 'Scaffold a .ruler directory with default files', (y) => {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ApplyArgs {
|
|
2
|
+
'project-root': string;
|
|
3
|
+
agents?: string;
|
|
4
|
+
config?: string;
|
|
5
|
+
mcp: boolean;
|
|
6
|
+
'mcp-overwrite': boolean;
|
|
7
|
+
gitignore?: boolean;
|
|
8
|
+
'gitignore-local'?: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
'dry-run': boolean;
|
|
11
|
+
'local-only': boolean;
|
|
12
|
+
nested?: boolean;
|
|
13
|
+
backup?: boolean;
|
|
14
|
+
skills?: boolean;
|
|
15
|
+
subagents?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface InitArgs {
|
|
18
|
+
'project-root': string;
|
|
19
|
+
global: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface RevertArgs {
|
|
22
|
+
'project-root': string;
|
|
23
|
+
agents?: string;
|
|
24
|
+
config?: string;
|
|
25
|
+
'keep-backups': boolean;
|
|
26
|
+
verbose: boolean;
|
|
27
|
+
'dry-run': boolean;
|
|
28
|
+
'local-only': boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Handler for the 'apply' command.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyHandler(argv: ApplyArgs): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Handler for the 'init' command.
|
|
36
|
+
*/
|
|
37
|
+
export declare function initHandler(argv: InitArgs): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Handler for the 'revert' command.
|
|
40
|
+
*/
|
|
41
|
+
export declare function revertHandler(argv: RevertArgs): Promise<void>;
|