rulesync 3.23.0 → 3.23.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.
- package/dist/index.cjs +138 -145
- package/dist/index.js +138 -145
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -581,7 +581,6 @@ var AiFile = class {
|
|
|
581
581
|
relativeDirPath,
|
|
582
582
|
relativeFilePath,
|
|
583
583
|
fileContent,
|
|
584
|
-
validate = true,
|
|
585
584
|
global = false
|
|
586
585
|
}) {
|
|
587
586
|
this.baseDir = baseDir;
|
|
@@ -589,12 +588,6 @@ var AiFile = class {
|
|
|
589
588
|
this.relativeFilePath = relativeFilePath;
|
|
590
589
|
this.fileContent = fileContent;
|
|
591
590
|
this.global = global;
|
|
592
|
-
if (validate) {
|
|
593
|
-
const result = this.validate();
|
|
594
|
-
if (!result.success) {
|
|
595
|
-
throw result.error;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
591
|
}
|
|
599
592
|
static async fromFile(_params) {
|
|
600
593
|
throw new Error("Please implement this method in the subclass.");
|
|
@@ -2711,7 +2704,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2711
2704
|
};
|
|
2712
2705
|
|
|
2713
2706
|
// src/features/mcp/mcp-processor.ts
|
|
2714
|
-
var
|
|
2707
|
+
var import_mini15 = require("zod/mini");
|
|
2715
2708
|
|
|
2716
2709
|
// src/features/mcp/amazonqcli-mcp.ts
|
|
2717
2710
|
var import_node_path28 = require("path");
|
|
@@ -2719,9 +2712,11 @@ var import_node_path28 = require("path");
|
|
|
2719
2712
|
// src/features/mcp/rulesync-mcp.ts
|
|
2720
2713
|
var import_node_path27 = require("path");
|
|
2721
2714
|
var import_object = require("es-toolkit/object");
|
|
2715
|
+
var import_mini13 = require("zod/mini");
|
|
2716
|
+
|
|
2717
|
+
// src/types/mcp.ts
|
|
2722
2718
|
var import_mini12 = require("zod/mini");
|
|
2723
|
-
var
|
|
2724
|
-
var McpServerBaseSchema = import_mini12.z.object({
|
|
2719
|
+
var McpServerSchema = import_mini12.z.object({
|
|
2725
2720
|
type: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
|
|
2726
2721
|
command: import_mini12.z.optional(import_mini12.z.union([import_mini12.z.string(), import_mini12.z.array(import_mini12.z.string())])),
|
|
2727
2722
|
args: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
|
|
@@ -2733,27 +2728,30 @@ var McpServerBaseSchema = import_mini12.z.object({
|
|
|
2733
2728
|
timeout: import_mini12.z.optional(import_mini12.z.number()),
|
|
2734
2729
|
trust: import_mini12.z.optional(import_mini12.z.boolean()),
|
|
2735
2730
|
cwd: import_mini12.z.optional(import_mini12.z.string()),
|
|
2736
|
-
transport: import_mini12.z.optional(
|
|
2731
|
+
transport: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
|
|
2737
2732
|
alwaysAllow: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
|
|
2738
2733
|
tools: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
|
|
2739
2734
|
kiroAutoApprove: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
|
|
2740
2735
|
kiroAutoBlock: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
|
|
2741
2736
|
headers: import_mini12.z.optional(import_mini12.z.record(import_mini12.z.string(), import_mini12.z.string()))
|
|
2742
2737
|
});
|
|
2743
|
-
var
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2738
|
+
var McpServersSchema = import_mini12.z.record(import_mini12.z.string(), McpServerSchema);
|
|
2739
|
+
|
|
2740
|
+
// src/features/mcp/rulesync-mcp.ts
|
|
2741
|
+
var RulesyncMcpServerSchema = import_mini13.z.union([
|
|
2742
|
+
import_mini13.z.extend(McpServerSchema, {
|
|
2743
|
+
targets: import_mini13.z.optional(RulesyncTargetsSchema),
|
|
2744
|
+
description: import_mini13.z.optional(import_mini13.z.string()),
|
|
2745
|
+
exposed: import_mini13.z.optional(import_mini13.z.literal(false))
|
|
2748
2746
|
}),
|
|
2749
|
-
|
|
2750
|
-
targets:
|
|
2751
|
-
description:
|
|
2752
|
-
exposed:
|
|
2747
|
+
import_mini13.z.extend(McpServerSchema, {
|
|
2748
|
+
targets: import_mini13.z.optional(RulesyncTargetsSchema),
|
|
2749
|
+
description: import_mini13.z.undefined(),
|
|
2750
|
+
exposed: import_mini13.z.literal(true)
|
|
2753
2751
|
})
|
|
2754
2752
|
]);
|
|
2755
|
-
var RulesyncMcpConfigSchema =
|
|
2756
|
-
mcpServers:
|
|
2753
|
+
var RulesyncMcpConfigSchema = import_mini13.z.object({
|
|
2754
|
+
mcpServers: import_mini13.z.record(import_mini13.z.string(), RulesyncMcpServerSchema)
|
|
2757
2755
|
});
|
|
2758
2756
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2759
2757
|
json;
|
|
@@ -2782,6 +2780,10 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2782
2780
|
};
|
|
2783
2781
|
}
|
|
2784
2782
|
validate() {
|
|
2783
|
+
const result = RulesyncMcpConfigSchema.safeParse(this.json);
|
|
2784
|
+
if (!result.success) {
|
|
2785
|
+
return { success: false, error: result.error };
|
|
2786
|
+
}
|
|
2785
2787
|
return { success: true, error: null };
|
|
2786
2788
|
}
|
|
2787
2789
|
static async fromFile({
|
|
@@ -2831,46 +2833,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2831
2833
|
modularMcp
|
|
2832
2834
|
});
|
|
2833
2835
|
}
|
|
2834
|
-
|
|
2835
|
-
if (!this.json || typeof this.json !== "object") {
|
|
2836
|
-
return {};
|
|
2837
|
-
}
|
|
2838
|
-
if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
|
|
2839
|
-
return {};
|
|
2840
|
-
}
|
|
2836
|
+
getExposedMcpServers() {
|
|
2841
2837
|
return Object.fromEntries(
|
|
2842
|
-
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => serverConfig.exposed
|
|
2838
|
+
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
|
|
2843
2839
|
serverName,
|
|
2844
|
-
(0, import_object.omit)(serverConfig, ["description", "exposed"])
|
|
2840
|
+
(0, import_object.omit)(serverConfig, ["targets", "description", "exposed"])
|
|
2845
2841
|
])
|
|
2846
2842
|
);
|
|
2847
2843
|
}
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
}
|
|
2852
|
-
if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
|
|
2853
|
-
return this.json;
|
|
2854
|
-
}
|
|
2855
|
-
if (modularMcp) {
|
|
2856
|
-
const mcpServersForModularMcp = Object.fromEntries(
|
|
2857
|
-
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !serverConfig.exposed).map(([serverName, serverConfig]) => [serverName, (0, import_object.omit)(serverConfig, ["exposed"])])
|
|
2858
|
-
);
|
|
2859
|
-
return {
|
|
2860
|
-
...this.json,
|
|
2861
|
-
mcpServers: mcpServersForModularMcp
|
|
2862
|
-
};
|
|
2863
|
-
}
|
|
2864
|
-
const mcpServersWithoutDescription = Object.fromEntries(
|
|
2865
|
-
Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
|
|
2844
|
+
getModularizedMcpServers() {
|
|
2845
|
+
return Object.fromEntries(
|
|
2846
|
+
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
|
|
2866
2847
|
serverName,
|
|
2867
|
-
|
|
2848
|
+
// description is required for modular-mcp servers
|
|
2849
|
+
(0, import_object.omit)(serverConfig, ["targets", "exposed"])
|
|
2868
2850
|
])
|
|
2869
2851
|
);
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
};
|
|
2852
|
+
}
|
|
2853
|
+
getJson() {
|
|
2854
|
+
return this.json;
|
|
2874
2855
|
}
|
|
2875
2856
|
};
|
|
2876
2857
|
|
|
@@ -2974,6 +2955,14 @@ var import_node_path30 = require("path");
|
|
|
2974
2955
|
|
|
2975
2956
|
// src/features/mcp/modular-mcp.ts
|
|
2976
2957
|
var import_node_path29 = require("path");
|
|
2958
|
+
var import_mini14 = require("zod/mini");
|
|
2959
|
+
var ModularMcpServerSchema = import_mini14.z.extend(McpServerSchema, {
|
|
2960
|
+
description: import_mini14.z.string()
|
|
2961
|
+
// Required for modular-mcp
|
|
2962
|
+
});
|
|
2963
|
+
var ModularMcpConfigSchema = import_mini14.z.object({
|
|
2964
|
+
mcpServers: import_mini14.z.record(import_mini14.z.string(), ModularMcpServerSchema)
|
|
2965
|
+
});
|
|
2977
2966
|
var ModularMcp = class _ModularMcp extends AiFile {
|
|
2978
2967
|
json;
|
|
2979
2968
|
constructor(params) {
|
|
@@ -3045,7 +3034,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3045
3034
|
global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
|
|
3046
3035
|
);
|
|
3047
3036
|
const modularMcpJson = {
|
|
3048
|
-
mcpServers: rulesyncMcp.
|
|
3037
|
+
mcpServers: rulesyncMcp.getModularizedMcpServers()
|
|
3049
3038
|
};
|
|
3050
3039
|
return new _ModularMcp({
|
|
3051
3040
|
baseDir,
|
|
@@ -3056,6 +3045,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3056
3045
|
});
|
|
3057
3046
|
}
|
|
3058
3047
|
validate() {
|
|
3048
|
+
const result = ModularMcpConfigSchema.safeParse(this.json);
|
|
3049
|
+
if (!result.success) {
|
|
3050
|
+
return { success: false, error: result.error };
|
|
3051
|
+
}
|
|
3059
3052
|
return { success: true, error: null };
|
|
3060
3053
|
}
|
|
3061
3054
|
};
|
|
@@ -3124,9 +3117,9 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3124
3117
|
relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
|
|
3125
3118
|
}) : ModularMcp.getMcpServers({ baseDir, global: false }),
|
|
3126
3119
|
// Merge exposed servers
|
|
3127
|
-
...rulesyncMcp.
|
|
3120
|
+
...rulesyncMcp.getExposedMcpServers()
|
|
3128
3121
|
}
|
|
3129
|
-
} : { ...json, mcpServers: rulesyncMcp.
|
|
3122
|
+
} : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
|
|
3130
3123
|
return new _ClaudecodeMcp({
|
|
3131
3124
|
baseDir,
|
|
3132
3125
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -3262,7 +3255,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3262
3255
|
smolToml.stringify({})
|
|
3263
3256
|
);
|
|
3264
3257
|
const configToml = smolToml.parse(configTomlFileContent);
|
|
3265
|
-
const mcpServers = rulesyncMcp.getJson(
|
|
3258
|
+
const mcpServers = rulesyncMcp.getJson().mcpServers;
|
|
3266
3259
|
const filteredMcpServers = this.removeEmptyEntries(mcpServers);
|
|
3267
3260
|
configToml["mcp_servers"] = filteredMcpServers;
|
|
3268
3261
|
return new _CodexcliMcp({
|
|
@@ -3394,7 +3387,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3394
3387
|
rulesyncMcp,
|
|
3395
3388
|
validate = true
|
|
3396
3389
|
}) {
|
|
3397
|
-
const json = rulesyncMcp.getJson(
|
|
3390
|
+
const json = rulesyncMcp.getJson();
|
|
3398
3391
|
const cursorConfig = {
|
|
3399
3392
|
mcpServers: json.mcpServers || {}
|
|
3400
3393
|
};
|
|
@@ -3476,7 +3469,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3476
3469
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3477
3470
|
);
|
|
3478
3471
|
const json = JSON.parse(fileContent);
|
|
3479
|
-
const newJson = { ...json, mcpServers: rulesyncMcp.getJson(
|
|
3472
|
+
const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
|
|
3480
3473
|
return new _GeminiCliMcp({
|
|
3481
3474
|
baseDir,
|
|
3482
3475
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -3563,7 +3556,7 @@ var mcpProcessorToolTargets = [
|
|
|
3563
3556
|
"geminicli",
|
|
3564
3557
|
"roo"
|
|
3565
3558
|
];
|
|
3566
|
-
var McpProcessorToolTargetSchema =
|
|
3559
|
+
var McpProcessorToolTargetSchema = import_mini15.z.enum(
|
|
3567
3560
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
3568
3561
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3569
3562
|
);
|
|
@@ -3802,14 +3795,14 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3802
3795
|
// src/features/rules/rules-processor.ts
|
|
3803
3796
|
var import_node_path66 = require("path");
|
|
3804
3797
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3805
|
-
var
|
|
3798
|
+
var import_mini24 = require("zod/mini");
|
|
3806
3799
|
|
|
3807
3800
|
// src/features/subagents/agentsmd-subagent.ts
|
|
3808
3801
|
var import_node_path38 = require("path");
|
|
3809
3802
|
|
|
3810
3803
|
// src/features/subagents/simulated-subagent.ts
|
|
3811
3804
|
var import_node_path37 = require("path");
|
|
3812
|
-
var
|
|
3805
|
+
var import_mini16 = require("zod/mini");
|
|
3813
3806
|
|
|
3814
3807
|
// src/features/subagents/tool-subagent.ts
|
|
3815
3808
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -3844,9 +3837,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
3844
3837
|
};
|
|
3845
3838
|
|
|
3846
3839
|
// src/features/subagents/simulated-subagent.ts
|
|
3847
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
3848
|
-
name:
|
|
3849
|
-
description:
|
|
3840
|
+
var SimulatedSubagentFrontmatterSchema = import_mini16.z.object({
|
|
3841
|
+
name: import_mini16.z.string(),
|
|
3842
|
+
description: import_mini16.z.string()
|
|
3850
3843
|
});
|
|
3851
3844
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
3852
3845
|
frontmatter;
|
|
@@ -4080,22 +4073,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
4080
4073
|
|
|
4081
4074
|
// src/features/subagents/subagents-processor.ts
|
|
4082
4075
|
var import_node_path46 = require("path");
|
|
4083
|
-
var
|
|
4076
|
+
var import_mini19 = require("zod/mini");
|
|
4084
4077
|
|
|
4085
4078
|
// src/features/subagents/claudecode-subagent.ts
|
|
4086
4079
|
var import_node_path45 = require("path");
|
|
4087
|
-
var
|
|
4080
|
+
var import_mini18 = require("zod/mini");
|
|
4088
4081
|
|
|
4089
4082
|
// src/features/subagents/rulesync-subagent.ts
|
|
4090
4083
|
var import_node_path44 = require("path");
|
|
4091
|
-
var
|
|
4092
|
-
var RulesyncSubagentModelSchema =
|
|
4093
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
4084
|
+
var import_mini17 = require("zod/mini");
|
|
4085
|
+
var RulesyncSubagentModelSchema = import_mini17.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
4086
|
+
var RulesyncSubagentFrontmatterSchema = import_mini17.z.object({
|
|
4094
4087
|
targets: RulesyncTargetsSchema,
|
|
4095
|
-
name:
|
|
4096
|
-
description:
|
|
4097
|
-
claudecode:
|
|
4098
|
-
|
|
4088
|
+
name: import_mini17.z.string(),
|
|
4089
|
+
description: import_mini17.z.string(),
|
|
4090
|
+
claudecode: import_mini17.z.optional(
|
|
4091
|
+
import_mini17.z.object({
|
|
4099
4092
|
model: RulesyncSubagentModelSchema
|
|
4100
4093
|
})
|
|
4101
4094
|
)
|
|
@@ -4169,10 +4162,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4169
4162
|
};
|
|
4170
4163
|
|
|
4171
4164
|
// src/features/subagents/claudecode-subagent.ts
|
|
4172
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
4173
|
-
name:
|
|
4174
|
-
description:
|
|
4175
|
-
model:
|
|
4165
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini18.z.object({
|
|
4166
|
+
name: import_mini18.z.string(),
|
|
4167
|
+
description: import_mini18.z.string(),
|
|
4168
|
+
model: import_mini18.z.optional(import_mini18.z.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
4176
4169
|
});
|
|
4177
4170
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
4178
4171
|
frontmatter;
|
|
@@ -4316,7 +4309,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
4316
4309
|
"roo"
|
|
4317
4310
|
];
|
|
4318
4311
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
4319
|
-
var SubagentsProcessorToolTargetSchema =
|
|
4312
|
+
var SubagentsProcessorToolTargetSchema = import_mini19.z.enum(subagentsProcessorToolTargets);
|
|
4320
4313
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
4321
4314
|
toolTarget;
|
|
4322
4315
|
global;
|
|
@@ -4601,23 +4594,23 @@ var import_node_path48 = require("path");
|
|
|
4601
4594
|
|
|
4602
4595
|
// src/features/rules/rulesync-rule.ts
|
|
4603
4596
|
var import_node_path47 = require("path");
|
|
4604
|
-
var
|
|
4605
|
-
var RulesyncRuleFrontmatterSchema =
|
|
4606
|
-
root:
|
|
4607
|
-
targets:
|
|
4608
|
-
description:
|
|
4609
|
-
globs:
|
|
4610
|
-
agentsmd:
|
|
4611
|
-
|
|
4597
|
+
var import_mini20 = require("zod/mini");
|
|
4598
|
+
var RulesyncRuleFrontmatterSchema = import_mini20.z.object({
|
|
4599
|
+
root: import_mini20.z.optional(import_mini20.z.optional(import_mini20.z.boolean())),
|
|
4600
|
+
targets: import_mini20.z.optional(RulesyncTargetsSchema),
|
|
4601
|
+
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
4602
|
+
globs: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string())),
|
|
4603
|
+
agentsmd: import_mini20.z.optional(
|
|
4604
|
+
import_mini20.z.object({
|
|
4612
4605
|
// @example "path/to/subproject"
|
|
4613
|
-
subprojectPath:
|
|
4606
|
+
subprojectPath: import_mini20.z.optional(import_mini20.z.string())
|
|
4614
4607
|
})
|
|
4615
4608
|
),
|
|
4616
|
-
cursor:
|
|
4617
|
-
|
|
4618
|
-
alwaysApply:
|
|
4619
|
-
description:
|
|
4620
|
-
globs:
|
|
4609
|
+
cursor: import_mini20.z.optional(
|
|
4610
|
+
import_mini20.z.object({
|
|
4611
|
+
alwaysApply: import_mini20.z.optional(import_mini20.z.boolean()),
|
|
4612
|
+
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
4613
|
+
globs: import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
|
|
4621
4614
|
})
|
|
4622
4615
|
)
|
|
4623
4616
|
});
|
|
@@ -5209,9 +5202,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5209
5202
|
|
|
5210
5203
|
// src/features/rules/cline-rule.ts
|
|
5211
5204
|
var import_node_path54 = require("path");
|
|
5212
|
-
var
|
|
5213
|
-
var ClineRuleFrontmatterSchema =
|
|
5214
|
-
description:
|
|
5205
|
+
var import_mini21 = require("zod/mini");
|
|
5206
|
+
var ClineRuleFrontmatterSchema = import_mini21.z.object({
|
|
5207
|
+
description: import_mini21.z.string()
|
|
5215
5208
|
});
|
|
5216
5209
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
5217
5210
|
static getSettablePaths() {
|
|
@@ -5358,10 +5351,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5358
5351
|
|
|
5359
5352
|
// src/features/rules/copilot-rule.ts
|
|
5360
5353
|
var import_node_path56 = require("path");
|
|
5361
|
-
var
|
|
5362
|
-
var CopilotRuleFrontmatterSchema =
|
|
5363
|
-
description:
|
|
5364
|
-
applyTo:
|
|
5354
|
+
var import_mini22 = require("zod/mini");
|
|
5355
|
+
var CopilotRuleFrontmatterSchema = import_mini22.z.object({
|
|
5356
|
+
description: import_mini22.z.optional(import_mini22.z.string()),
|
|
5357
|
+
applyTo: import_mini22.z.optional(import_mini22.z.string())
|
|
5365
5358
|
});
|
|
5366
5359
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
5367
5360
|
frontmatter;
|
|
@@ -5528,11 +5521,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5528
5521
|
|
|
5529
5522
|
// src/features/rules/cursor-rule.ts
|
|
5530
5523
|
var import_node_path57 = require("path");
|
|
5531
|
-
var
|
|
5532
|
-
var CursorRuleFrontmatterSchema =
|
|
5533
|
-
description:
|
|
5534
|
-
globs:
|
|
5535
|
-
alwaysApply:
|
|
5524
|
+
var import_mini23 = require("zod/mini");
|
|
5525
|
+
var CursorRuleFrontmatterSchema = import_mini23.z.object({
|
|
5526
|
+
description: import_mini23.z.optional(import_mini23.z.string()),
|
|
5527
|
+
globs: import_mini23.z.optional(import_mini23.z.string()),
|
|
5528
|
+
alwaysApply: import_mini23.z.optional(import_mini23.z.boolean())
|
|
5536
5529
|
});
|
|
5537
5530
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
5538
5531
|
frontmatter;
|
|
@@ -6248,7 +6241,7 @@ var rulesProcessorToolTargets = [
|
|
|
6248
6241
|
"warp",
|
|
6249
6242
|
"windsurf"
|
|
6250
6243
|
];
|
|
6251
|
-
var RulesProcessorToolTargetSchema =
|
|
6244
|
+
var RulesProcessorToolTargetSchema = import_mini24.z.enum(rulesProcessorToolTargets);
|
|
6252
6245
|
var rulesProcessorToolTargetsGlobal = [
|
|
6253
6246
|
"claudecode",
|
|
6254
6247
|
"codexcli",
|
|
@@ -7744,7 +7737,7 @@ var import_fastmcp = require("fastmcp");
|
|
|
7744
7737
|
|
|
7745
7738
|
// src/mcp/commands.ts
|
|
7746
7739
|
var import_node_path69 = require("path");
|
|
7747
|
-
var
|
|
7740
|
+
var import_mini25 = require("zod/mini");
|
|
7748
7741
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
7749
7742
|
var maxCommandsCount = 1e3;
|
|
7750
7743
|
async function listCommands() {
|
|
@@ -7863,17 +7856,17 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
7863
7856
|
}
|
|
7864
7857
|
}
|
|
7865
7858
|
var commandToolSchemas = {
|
|
7866
|
-
listCommands:
|
|
7867
|
-
getCommand:
|
|
7868
|
-
relativePathFromCwd:
|
|
7859
|
+
listCommands: import_mini25.z.object({}),
|
|
7860
|
+
getCommand: import_mini25.z.object({
|
|
7861
|
+
relativePathFromCwd: import_mini25.z.string()
|
|
7869
7862
|
}),
|
|
7870
|
-
putCommand:
|
|
7871
|
-
relativePathFromCwd:
|
|
7863
|
+
putCommand: import_mini25.z.object({
|
|
7864
|
+
relativePathFromCwd: import_mini25.z.string(),
|
|
7872
7865
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
7873
|
-
body:
|
|
7866
|
+
body: import_mini25.z.string()
|
|
7874
7867
|
}),
|
|
7875
|
-
deleteCommand:
|
|
7876
|
-
relativePathFromCwd:
|
|
7868
|
+
deleteCommand: import_mini25.z.object({
|
|
7869
|
+
relativePathFromCwd: import_mini25.z.string()
|
|
7877
7870
|
})
|
|
7878
7871
|
};
|
|
7879
7872
|
var commandTools = {
|
|
@@ -7922,7 +7915,7 @@ var commandTools = {
|
|
|
7922
7915
|
|
|
7923
7916
|
// src/mcp/ignore.ts
|
|
7924
7917
|
var import_node_path70 = require("path");
|
|
7925
|
-
var
|
|
7918
|
+
var import_mini26 = require("zod/mini");
|
|
7926
7919
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
7927
7920
|
async function getIgnoreFile() {
|
|
7928
7921
|
const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
@@ -7973,11 +7966,11 @@ async function deleteIgnoreFile() {
|
|
|
7973
7966
|
}
|
|
7974
7967
|
}
|
|
7975
7968
|
var ignoreToolSchemas = {
|
|
7976
|
-
getIgnoreFile:
|
|
7977
|
-
putIgnoreFile:
|
|
7978
|
-
content:
|
|
7969
|
+
getIgnoreFile: import_mini26.z.object({}),
|
|
7970
|
+
putIgnoreFile: import_mini26.z.object({
|
|
7971
|
+
content: import_mini26.z.string()
|
|
7979
7972
|
}),
|
|
7980
|
-
deleteIgnoreFile:
|
|
7973
|
+
deleteIgnoreFile: import_mini26.z.object({})
|
|
7981
7974
|
};
|
|
7982
7975
|
var ignoreTools = {
|
|
7983
7976
|
getIgnoreFile: {
|
|
@@ -8011,7 +8004,7 @@ var ignoreTools = {
|
|
|
8011
8004
|
|
|
8012
8005
|
// src/mcp/mcp.ts
|
|
8013
8006
|
var import_node_path71 = require("path");
|
|
8014
|
-
var
|
|
8007
|
+
var import_mini27 = require("zod/mini");
|
|
8015
8008
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
8016
8009
|
async function getMcpFile() {
|
|
8017
8010
|
try {
|
|
@@ -8099,11 +8092,11 @@ async function deleteMcpFile() {
|
|
|
8099
8092
|
}
|
|
8100
8093
|
}
|
|
8101
8094
|
var mcpToolSchemas = {
|
|
8102
|
-
getMcpFile:
|
|
8103
|
-
putMcpFile:
|
|
8104
|
-
content:
|
|
8095
|
+
getMcpFile: import_mini27.z.object({}),
|
|
8096
|
+
putMcpFile: import_mini27.z.object({
|
|
8097
|
+
content: import_mini27.z.string()
|
|
8105
8098
|
}),
|
|
8106
|
-
deleteMcpFile:
|
|
8099
|
+
deleteMcpFile: import_mini27.z.object({})
|
|
8107
8100
|
};
|
|
8108
8101
|
var mcpTools = {
|
|
8109
8102
|
getMcpFile: {
|
|
@@ -8137,7 +8130,7 @@ var mcpTools = {
|
|
|
8137
8130
|
|
|
8138
8131
|
// src/mcp/rules.ts
|
|
8139
8132
|
var import_node_path72 = require("path");
|
|
8140
|
-
var
|
|
8133
|
+
var import_mini28 = require("zod/mini");
|
|
8141
8134
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
8142
8135
|
var maxRulesCount = 1e3;
|
|
8143
8136
|
async function listRules() {
|
|
@@ -8256,17 +8249,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
8256
8249
|
}
|
|
8257
8250
|
}
|
|
8258
8251
|
var ruleToolSchemas = {
|
|
8259
|
-
listRules:
|
|
8260
|
-
getRule:
|
|
8261
|
-
relativePathFromCwd:
|
|
8252
|
+
listRules: import_mini28.z.object({}),
|
|
8253
|
+
getRule: import_mini28.z.object({
|
|
8254
|
+
relativePathFromCwd: import_mini28.z.string()
|
|
8262
8255
|
}),
|
|
8263
|
-
putRule:
|
|
8264
|
-
relativePathFromCwd:
|
|
8256
|
+
putRule: import_mini28.z.object({
|
|
8257
|
+
relativePathFromCwd: import_mini28.z.string(),
|
|
8265
8258
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
8266
|
-
body:
|
|
8259
|
+
body: import_mini28.z.string()
|
|
8267
8260
|
}),
|
|
8268
|
-
deleteRule:
|
|
8269
|
-
relativePathFromCwd:
|
|
8261
|
+
deleteRule: import_mini28.z.object({
|
|
8262
|
+
relativePathFromCwd: import_mini28.z.string()
|
|
8270
8263
|
})
|
|
8271
8264
|
};
|
|
8272
8265
|
var ruleTools = {
|
|
@@ -8315,7 +8308,7 @@ var ruleTools = {
|
|
|
8315
8308
|
|
|
8316
8309
|
// src/mcp/subagents.ts
|
|
8317
8310
|
var import_node_path73 = require("path");
|
|
8318
|
-
var
|
|
8311
|
+
var import_mini29 = require("zod/mini");
|
|
8319
8312
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
8320
8313
|
var maxSubagentsCount = 1e3;
|
|
8321
8314
|
async function listSubagents() {
|
|
@@ -8439,17 +8432,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
8439
8432
|
}
|
|
8440
8433
|
}
|
|
8441
8434
|
var subagentToolSchemas = {
|
|
8442
|
-
listSubagents:
|
|
8443
|
-
getSubagent:
|
|
8444
|
-
relativePathFromCwd:
|
|
8435
|
+
listSubagents: import_mini29.z.object({}),
|
|
8436
|
+
getSubagent: import_mini29.z.object({
|
|
8437
|
+
relativePathFromCwd: import_mini29.z.string()
|
|
8445
8438
|
}),
|
|
8446
|
-
putSubagent:
|
|
8447
|
-
relativePathFromCwd:
|
|
8439
|
+
putSubagent: import_mini29.z.object({
|
|
8440
|
+
relativePathFromCwd: import_mini29.z.string(),
|
|
8448
8441
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
8449
|
-
body:
|
|
8442
|
+
body: import_mini29.z.string()
|
|
8450
8443
|
}),
|
|
8451
|
-
deleteSubagent:
|
|
8452
|
-
relativePathFromCwd:
|
|
8444
|
+
deleteSubagent: import_mini29.z.object({
|
|
8445
|
+
relativePathFromCwd: import_mini29.z.string()
|
|
8453
8446
|
})
|
|
8454
8447
|
};
|
|
8455
8448
|
var subagentTools = {
|
|
@@ -8529,7 +8522,7 @@ async function mcpCommand({ version }) {
|
|
|
8529
8522
|
}
|
|
8530
8523
|
|
|
8531
8524
|
// src/cli/index.ts
|
|
8532
|
-
var getVersion = () => "3.23.
|
|
8525
|
+
var getVersion = () => "3.23.3";
|
|
8533
8526
|
var main = async () => {
|
|
8534
8527
|
const program = new import_commander.Command();
|
|
8535
8528
|
const version = getVersion();
|
package/dist/index.js
CHANGED
|
@@ -558,7 +558,6 @@ var AiFile = class {
|
|
|
558
558
|
relativeDirPath,
|
|
559
559
|
relativeFilePath,
|
|
560
560
|
fileContent,
|
|
561
|
-
validate = true,
|
|
562
561
|
global = false
|
|
563
562
|
}) {
|
|
564
563
|
this.baseDir = baseDir;
|
|
@@ -566,12 +565,6 @@ var AiFile = class {
|
|
|
566
565
|
this.relativeFilePath = relativeFilePath;
|
|
567
566
|
this.fileContent = fileContent;
|
|
568
567
|
this.global = global;
|
|
569
|
-
if (validate) {
|
|
570
|
-
const result = this.validate();
|
|
571
|
-
if (!result.success) {
|
|
572
|
-
throw result.error;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
568
|
}
|
|
576
569
|
static async fromFile(_params) {
|
|
577
570
|
throw new Error("Please implement this method in the subclass.");
|
|
@@ -2688,7 +2681,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2688
2681
|
};
|
|
2689
2682
|
|
|
2690
2683
|
// src/features/mcp/mcp-processor.ts
|
|
2691
|
-
import { z as
|
|
2684
|
+
import { z as z15 } from "zod/mini";
|
|
2692
2685
|
|
|
2693
2686
|
// src/features/mcp/amazonqcli-mcp.ts
|
|
2694
2687
|
import { join as join26 } from "path";
|
|
@@ -2696,9 +2689,11 @@ import { join as join26 } from "path";
|
|
|
2696
2689
|
// src/features/mcp/rulesync-mcp.ts
|
|
2697
2690
|
import { join as join25 } from "path";
|
|
2698
2691
|
import { omit } from "es-toolkit/object";
|
|
2692
|
+
import { z as z13 } from "zod/mini";
|
|
2693
|
+
|
|
2694
|
+
// src/types/mcp.ts
|
|
2699
2695
|
import { z as z12 } from "zod/mini";
|
|
2700
|
-
var
|
|
2701
|
-
var McpServerBaseSchema = z12.object({
|
|
2696
|
+
var McpServerSchema = z12.object({
|
|
2702
2697
|
type: z12.optional(z12.enum(["stdio", "sse", "http"])),
|
|
2703
2698
|
command: z12.optional(z12.union([z12.string(), z12.array(z12.string())])),
|
|
2704
2699
|
args: z12.optional(z12.array(z12.string())),
|
|
@@ -2710,27 +2705,30 @@ var McpServerBaseSchema = z12.object({
|
|
|
2710
2705
|
timeout: z12.optional(z12.number()),
|
|
2711
2706
|
trust: z12.optional(z12.boolean()),
|
|
2712
2707
|
cwd: z12.optional(z12.string()),
|
|
2713
|
-
transport: z12.optional(
|
|
2708
|
+
transport: z12.optional(z12.enum(["stdio", "sse", "http"])),
|
|
2714
2709
|
alwaysAllow: z12.optional(z12.array(z12.string())),
|
|
2715
2710
|
tools: z12.optional(z12.array(z12.string())),
|
|
2716
2711
|
kiroAutoApprove: z12.optional(z12.array(z12.string())),
|
|
2717
2712
|
kiroAutoBlock: z12.optional(z12.array(z12.string())),
|
|
2718
2713
|
headers: z12.optional(z12.record(z12.string(), z12.string()))
|
|
2719
2714
|
});
|
|
2720
|
-
var
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2715
|
+
var McpServersSchema = z12.record(z12.string(), McpServerSchema);
|
|
2716
|
+
|
|
2717
|
+
// src/features/mcp/rulesync-mcp.ts
|
|
2718
|
+
var RulesyncMcpServerSchema = z13.union([
|
|
2719
|
+
z13.extend(McpServerSchema, {
|
|
2720
|
+
targets: z13.optional(RulesyncTargetsSchema),
|
|
2721
|
+
description: z13.optional(z13.string()),
|
|
2722
|
+
exposed: z13.optional(z13.literal(false))
|
|
2725
2723
|
}),
|
|
2726
|
-
|
|
2727
|
-
targets:
|
|
2728
|
-
description:
|
|
2729
|
-
exposed:
|
|
2724
|
+
z13.extend(McpServerSchema, {
|
|
2725
|
+
targets: z13.optional(RulesyncTargetsSchema),
|
|
2726
|
+
description: z13.undefined(),
|
|
2727
|
+
exposed: z13.literal(true)
|
|
2730
2728
|
})
|
|
2731
2729
|
]);
|
|
2732
|
-
var RulesyncMcpConfigSchema =
|
|
2733
|
-
mcpServers:
|
|
2730
|
+
var RulesyncMcpConfigSchema = z13.object({
|
|
2731
|
+
mcpServers: z13.record(z13.string(), RulesyncMcpServerSchema)
|
|
2734
2732
|
});
|
|
2735
2733
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2736
2734
|
json;
|
|
@@ -2759,6 +2757,10 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2759
2757
|
};
|
|
2760
2758
|
}
|
|
2761
2759
|
validate() {
|
|
2760
|
+
const result = RulesyncMcpConfigSchema.safeParse(this.json);
|
|
2761
|
+
if (!result.success) {
|
|
2762
|
+
return { success: false, error: result.error };
|
|
2763
|
+
}
|
|
2762
2764
|
return { success: true, error: null };
|
|
2763
2765
|
}
|
|
2764
2766
|
static async fromFile({
|
|
@@ -2808,46 +2810,25 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2808
2810
|
modularMcp
|
|
2809
2811
|
});
|
|
2810
2812
|
}
|
|
2811
|
-
|
|
2812
|
-
if (!this.json || typeof this.json !== "object") {
|
|
2813
|
-
return {};
|
|
2814
|
-
}
|
|
2815
|
-
if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
|
|
2816
|
-
return {};
|
|
2817
|
-
}
|
|
2813
|
+
getExposedMcpServers() {
|
|
2818
2814
|
return Object.fromEntries(
|
|
2819
|
-
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => serverConfig.exposed
|
|
2815
|
+
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !this.modularMcp || serverConfig.exposed).map(([serverName, serverConfig]) => [
|
|
2820
2816
|
serverName,
|
|
2821
|
-
omit(serverConfig, ["description", "exposed"])
|
|
2817
|
+
omit(serverConfig, ["targets", "description", "exposed"])
|
|
2822
2818
|
])
|
|
2823
2819
|
);
|
|
2824
2820
|
}
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
}
|
|
2829
|
-
if (!this.json.mcpServers || typeof this.json.mcpServers !== "object") {
|
|
2830
|
-
return this.json;
|
|
2831
|
-
}
|
|
2832
|
-
if (modularMcp) {
|
|
2833
|
-
const mcpServersForModularMcp = Object.fromEntries(
|
|
2834
|
-
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => !serverConfig.exposed).map(([serverName, serverConfig]) => [serverName, omit(serverConfig, ["exposed"])])
|
|
2835
|
-
);
|
|
2836
|
-
return {
|
|
2837
|
-
...this.json,
|
|
2838
|
-
mcpServers: mcpServersForModularMcp
|
|
2839
|
-
};
|
|
2840
|
-
}
|
|
2841
|
-
const mcpServersWithoutDescription = Object.fromEntries(
|
|
2842
|
-
Object.entries(this.json.mcpServers).map(([serverName, serverConfig]) => [
|
|
2821
|
+
getModularizedMcpServers() {
|
|
2822
|
+
return Object.fromEntries(
|
|
2823
|
+
Object.entries(this.json.mcpServers).filter(([, serverConfig]) => this.modularMcp && !serverConfig.exposed).map(([serverName, serverConfig]) => [
|
|
2843
2824
|
serverName,
|
|
2844
|
-
|
|
2825
|
+
// description is required for modular-mcp servers
|
|
2826
|
+
omit(serverConfig, ["targets", "exposed"])
|
|
2845
2827
|
])
|
|
2846
2828
|
);
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
};
|
|
2829
|
+
}
|
|
2830
|
+
getJson() {
|
|
2831
|
+
return this.json;
|
|
2851
2832
|
}
|
|
2852
2833
|
};
|
|
2853
2834
|
|
|
@@ -2951,6 +2932,14 @@ import { join as join28 } from "path";
|
|
|
2951
2932
|
|
|
2952
2933
|
// src/features/mcp/modular-mcp.ts
|
|
2953
2934
|
import { join as join27 } from "path";
|
|
2935
|
+
import { z as z14 } from "zod/mini";
|
|
2936
|
+
var ModularMcpServerSchema = z14.extend(McpServerSchema, {
|
|
2937
|
+
description: z14.string()
|
|
2938
|
+
// Required for modular-mcp
|
|
2939
|
+
});
|
|
2940
|
+
var ModularMcpConfigSchema = z14.object({
|
|
2941
|
+
mcpServers: z14.record(z14.string(), ModularMcpServerSchema)
|
|
2942
|
+
});
|
|
2954
2943
|
var ModularMcp = class _ModularMcp extends AiFile {
|
|
2955
2944
|
json;
|
|
2956
2945
|
constructor(params) {
|
|
@@ -3022,7 +3011,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3022
3011
|
global && relativeDirPath ? { global: true, relativeDirPath } : { global: false, relativeDirPath: void 0 }
|
|
3023
3012
|
);
|
|
3024
3013
|
const modularMcpJson = {
|
|
3025
|
-
mcpServers: rulesyncMcp.
|
|
3014
|
+
mcpServers: rulesyncMcp.getModularizedMcpServers()
|
|
3026
3015
|
};
|
|
3027
3016
|
return new _ModularMcp({
|
|
3028
3017
|
baseDir,
|
|
@@ -3033,6 +3022,10 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3033
3022
|
});
|
|
3034
3023
|
}
|
|
3035
3024
|
validate() {
|
|
3025
|
+
const result = ModularMcpConfigSchema.safeParse(this.json);
|
|
3026
|
+
if (!result.success) {
|
|
3027
|
+
return { success: false, error: result.error };
|
|
3028
|
+
}
|
|
3036
3029
|
return { success: true, error: null };
|
|
3037
3030
|
}
|
|
3038
3031
|
};
|
|
@@ -3101,9 +3094,9 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3101
3094
|
relativeDirPath: this.getSettablePaths({ global: true }).relativeDirPath
|
|
3102
3095
|
}) : ModularMcp.getMcpServers({ baseDir, global: false }),
|
|
3103
3096
|
// Merge exposed servers
|
|
3104
|
-
...rulesyncMcp.
|
|
3097
|
+
...rulesyncMcp.getExposedMcpServers()
|
|
3105
3098
|
}
|
|
3106
|
-
} : { ...json, mcpServers: rulesyncMcp.
|
|
3099
|
+
} : { ...json, mcpServers: rulesyncMcp.getExposedMcpServers() };
|
|
3107
3100
|
return new _ClaudecodeMcp({
|
|
3108
3101
|
baseDir,
|
|
3109
3102
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -3239,7 +3232,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3239
3232
|
smolToml.stringify({})
|
|
3240
3233
|
);
|
|
3241
3234
|
const configToml = smolToml.parse(configTomlFileContent);
|
|
3242
|
-
const mcpServers = rulesyncMcp.getJson(
|
|
3235
|
+
const mcpServers = rulesyncMcp.getJson().mcpServers;
|
|
3243
3236
|
const filteredMcpServers = this.removeEmptyEntries(mcpServers);
|
|
3244
3237
|
configToml["mcp_servers"] = filteredMcpServers;
|
|
3245
3238
|
return new _CodexcliMcp({
|
|
@@ -3371,7 +3364,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3371
3364
|
rulesyncMcp,
|
|
3372
3365
|
validate = true
|
|
3373
3366
|
}) {
|
|
3374
|
-
const json = rulesyncMcp.getJson(
|
|
3367
|
+
const json = rulesyncMcp.getJson();
|
|
3375
3368
|
const cursorConfig = {
|
|
3376
3369
|
mcpServers: json.mcpServers || {}
|
|
3377
3370
|
};
|
|
@@ -3453,7 +3446,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3453
3446
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3454
3447
|
);
|
|
3455
3448
|
const json = JSON.parse(fileContent);
|
|
3456
|
-
const newJson = { ...json, mcpServers: rulesyncMcp.getJson(
|
|
3449
|
+
const newJson = { ...json, mcpServers: rulesyncMcp.getJson().mcpServers };
|
|
3457
3450
|
return new _GeminiCliMcp({
|
|
3458
3451
|
baseDir,
|
|
3459
3452
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -3540,7 +3533,7 @@ var mcpProcessorToolTargets = [
|
|
|
3540
3533
|
"geminicli",
|
|
3541
3534
|
"roo"
|
|
3542
3535
|
];
|
|
3543
|
-
var McpProcessorToolTargetSchema =
|
|
3536
|
+
var McpProcessorToolTargetSchema = z15.enum(
|
|
3544
3537
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
3545
3538
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3546
3539
|
);
|
|
@@ -3779,14 +3772,14 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3779
3772
|
// src/features/rules/rules-processor.ts
|
|
3780
3773
|
import { basename as basename17, join as join64 } from "path";
|
|
3781
3774
|
import { XMLBuilder } from "fast-xml-parser";
|
|
3782
|
-
import { z as
|
|
3775
|
+
import { z as z24 } from "zod/mini";
|
|
3783
3776
|
|
|
3784
3777
|
// src/features/subagents/agentsmd-subagent.ts
|
|
3785
3778
|
import { join as join36 } from "path";
|
|
3786
3779
|
|
|
3787
3780
|
// src/features/subagents/simulated-subagent.ts
|
|
3788
3781
|
import { basename as basename12, join as join35 } from "path";
|
|
3789
|
-
import { z as
|
|
3782
|
+
import { z as z16 } from "zod/mini";
|
|
3790
3783
|
|
|
3791
3784
|
// src/features/subagents/tool-subagent.ts
|
|
3792
3785
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -3821,9 +3814,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
3821
3814
|
};
|
|
3822
3815
|
|
|
3823
3816
|
// src/features/subagents/simulated-subagent.ts
|
|
3824
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
3825
|
-
name:
|
|
3826
|
-
description:
|
|
3817
|
+
var SimulatedSubagentFrontmatterSchema = z16.object({
|
|
3818
|
+
name: z16.string(),
|
|
3819
|
+
description: z16.string()
|
|
3827
3820
|
});
|
|
3828
3821
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
3829
3822
|
frontmatter;
|
|
@@ -4057,22 +4050,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
4057
4050
|
|
|
4058
4051
|
// src/features/subagents/subagents-processor.ts
|
|
4059
4052
|
import { basename as basename14, join as join44 } from "path";
|
|
4060
|
-
import { z as
|
|
4053
|
+
import { z as z19 } from "zod/mini";
|
|
4061
4054
|
|
|
4062
4055
|
// src/features/subagents/claudecode-subagent.ts
|
|
4063
4056
|
import { join as join43 } from "path";
|
|
4064
|
-
import { z as
|
|
4057
|
+
import { z as z18 } from "zod/mini";
|
|
4065
4058
|
|
|
4066
4059
|
// src/features/subagents/rulesync-subagent.ts
|
|
4067
4060
|
import { basename as basename13, join as join42 } from "path";
|
|
4068
|
-
import { z as
|
|
4069
|
-
var RulesyncSubagentModelSchema =
|
|
4070
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
4061
|
+
import { z as z17 } from "zod/mini";
|
|
4062
|
+
var RulesyncSubagentModelSchema = z17.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
4063
|
+
var RulesyncSubagentFrontmatterSchema = z17.object({
|
|
4071
4064
|
targets: RulesyncTargetsSchema,
|
|
4072
|
-
name:
|
|
4073
|
-
description:
|
|
4074
|
-
claudecode:
|
|
4075
|
-
|
|
4065
|
+
name: z17.string(),
|
|
4066
|
+
description: z17.string(),
|
|
4067
|
+
claudecode: z17.optional(
|
|
4068
|
+
z17.object({
|
|
4076
4069
|
model: RulesyncSubagentModelSchema
|
|
4077
4070
|
})
|
|
4078
4071
|
)
|
|
@@ -4146,10 +4139,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4146
4139
|
};
|
|
4147
4140
|
|
|
4148
4141
|
// src/features/subagents/claudecode-subagent.ts
|
|
4149
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
4150
|
-
name:
|
|
4151
|
-
description:
|
|
4152
|
-
model:
|
|
4142
|
+
var ClaudecodeSubagentFrontmatterSchema = z18.object({
|
|
4143
|
+
name: z18.string(),
|
|
4144
|
+
description: z18.string(),
|
|
4145
|
+
model: z18.optional(z18.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
4153
4146
|
});
|
|
4154
4147
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
4155
4148
|
frontmatter;
|
|
@@ -4293,7 +4286,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
4293
4286
|
"roo"
|
|
4294
4287
|
];
|
|
4295
4288
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
4296
|
-
var SubagentsProcessorToolTargetSchema =
|
|
4289
|
+
var SubagentsProcessorToolTargetSchema = z19.enum(subagentsProcessorToolTargets);
|
|
4297
4290
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
4298
4291
|
toolTarget;
|
|
4299
4292
|
global;
|
|
@@ -4578,23 +4571,23 @@ import { join as join46 } from "path";
|
|
|
4578
4571
|
|
|
4579
4572
|
// src/features/rules/rulesync-rule.ts
|
|
4580
4573
|
import { basename as basename15, join as join45 } from "path";
|
|
4581
|
-
import { z as
|
|
4582
|
-
var RulesyncRuleFrontmatterSchema =
|
|
4583
|
-
root:
|
|
4584
|
-
targets:
|
|
4585
|
-
description:
|
|
4586
|
-
globs:
|
|
4587
|
-
agentsmd:
|
|
4588
|
-
|
|
4574
|
+
import { z as z20 } from "zod/mini";
|
|
4575
|
+
var RulesyncRuleFrontmatterSchema = z20.object({
|
|
4576
|
+
root: z20.optional(z20.optional(z20.boolean())),
|
|
4577
|
+
targets: z20.optional(RulesyncTargetsSchema),
|
|
4578
|
+
description: z20.optional(z20.string()),
|
|
4579
|
+
globs: z20.optional(z20.array(z20.string())),
|
|
4580
|
+
agentsmd: z20.optional(
|
|
4581
|
+
z20.object({
|
|
4589
4582
|
// @example "path/to/subproject"
|
|
4590
|
-
subprojectPath:
|
|
4583
|
+
subprojectPath: z20.optional(z20.string())
|
|
4591
4584
|
})
|
|
4592
4585
|
),
|
|
4593
|
-
cursor:
|
|
4594
|
-
|
|
4595
|
-
alwaysApply:
|
|
4596
|
-
description:
|
|
4597
|
-
globs:
|
|
4586
|
+
cursor: z20.optional(
|
|
4587
|
+
z20.object({
|
|
4588
|
+
alwaysApply: z20.optional(z20.boolean()),
|
|
4589
|
+
description: z20.optional(z20.string()),
|
|
4590
|
+
globs: z20.optional(z20.array(z20.string()))
|
|
4598
4591
|
})
|
|
4599
4592
|
)
|
|
4600
4593
|
});
|
|
@@ -5186,9 +5179,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5186
5179
|
|
|
5187
5180
|
// src/features/rules/cline-rule.ts
|
|
5188
5181
|
import { join as join52 } from "path";
|
|
5189
|
-
import { z as
|
|
5190
|
-
var ClineRuleFrontmatterSchema =
|
|
5191
|
-
description:
|
|
5182
|
+
import { z as z21 } from "zod/mini";
|
|
5183
|
+
var ClineRuleFrontmatterSchema = z21.object({
|
|
5184
|
+
description: z21.string()
|
|
5192
5185
|
});
|
|
5193
5186
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
5194
5187
|
static getSettablePaths() {
|
|
@@ -5335,10 +5328,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5335
5328
|
|
|
5336
5329
|
// src/features/rules/copilot-rule.ts
|
|
5337
5330
|
import { join as join54 } from "path";
|
|
5338
|
-
import { z as
|
|
5339
|
-
var CopilotRuleFrontmatterSchema =
|
|
5340
|
-
description:
|
|
5341
|
-
applyTo:
|
|
5331
|
+
import { z as z22 } from "zod/mini";
|
|
5332
|
+
var CopilotRuleFrontmatterSchema = z22.object({
|
|
5333
|
+
description: z22.optional(z22.string()),
|
|
5334
|
+
applyTo: z22.optional(z22.string())
|
|
5342
5335
|
});
|
|
5343
5336
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
5344
5337
|
frontmatter;
|
|
@@ -5505,11 +5498,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5505
5498
|
|
|
5506
5499
|
// src/features/rules/cursor-rule.ts
|
|
5507
5500
|
import { basename as basename16, join as join55 } from "path";
|
|
5508
|
-
import { z as
|
|
5509
|
-
var CursorRuleFrontmatterSchema =
|
|
5510
|
-
description:
|
|
5511
|
-
globs:
|
|
5512
|
-
alwaysApply:
|
|
5501
|
+
import { z as z23 } from "zod/mini";
|
|
5502
|
+
var CursorRuleFrontmatterSchema = z23.object({
|
|
5503
|
+
description: z23.optional(z23.string()),
|
|
5504
|
+
globs: z23.optional(z23.string()),
|
|
5505
|
+
alwaysApply: z23.optional(z23.boolean())
|
|
5513
5506
|
});
|
|
5514
5507
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
5515
5508
|
frontmatter;
|
|
@@ -6225,7 +6218,7 @@ var rulesProcessorToolTargets = [
|
|
|
6225
6218
|
"warp",
|
|
6226
6219
|
"windsurf"
|
|
6227
6220
|
];
|
|
6228
|
-
var RulesProcessorToolTargetSchema =
|
|
6221
|
+
var RulesProcessorToolTargetSchema = z24.enum(rulesProcessorToolTargets);
|
|
6229
6222
|
var rulesProcessorToolTargetsGlobal = [
|
|
6230
6223
|
"claudecode",
|
|
6231
6224
|
"codexcli",
|
|
@@ -7721,7 +7714,7 @@ import { FastMCP } from "fastmcp";
|
|
|
7721
7714
|
|
|
7722
7715
|
// src/mcp/commands.ts
|
|
7723
7716
|
import { basename as basename18, join as join67 } from "path";
|
|
7724
|
-
import { z as
|
|
7717
|
+
import { z as z25 } from "zod/mini";
|
|
7725
7718
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
7726
7719
|
var maxCommandsCount = 1e3;
|
|
7727
7720
|
async function listCommands() {
|
|
@@ -7840,17 +7833,17 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
7840
7833
|
}
|
|
7841
7834
|
}
|
|
7842
7835
|
var commandToolSchemas = {
|
|
7843
|
-
listCommands:
|
|
7844
|
-
getCommand:
|
|
7845
|
-
relativePathFromCwd:
|
|
7836
|
+
listCommands: z25.object({}),
|
|
7837
|
+
getCommand: z25.object({
|
|
7838
|
+
relativePathFromCwd: z25.string()
|
|
7846
7839
|
}),
|
|
7847
|
-
putCommand:
|
|
7848
|
-
relativePathFromCwd:
|
|
7840
|
+
putCommand: z25.object({
|
|
7841
|
+
relativePathFromCwd: z25.string(),
|
|
7849
7842
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
7850
|
-
body:
|
|
7843
|
+
body: z25.string()
|
|
7851
7844
|
}),
|
|
7852
|
-
deleteCommand:
|
|
7853
|
-
relativePathFromCwd:
|
|
7845
|
+
deleteCommand: z25.object({
|
|
7846
|
+
relativePathFromCwd: z25.string()
|
|
7854
7847
|
})
|
|
7855
7848
|
};
|
|
7856
7849
|
var commandTools = {
|
|
@@ -7899,7 +7892,7 @@ var commandTools = {
|
|
|
7899
7892
|
|
|
7900
7893
|
// src/mcp/ignore.ts
|
|
7901
7894
|
import { join as join68 } from "path";
|
|
7902
|
-
import { z as
|
|
7895
|
+
import { z as z26 } from "zod/mini";
|
|
7903
7896
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
7904
7897
|
async function getIgnoreFile() {
|
|
7905
7898
|
const ignoreFilePath = join68(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
@@ -7950,11 +7943,11 @@ async function deleteIgnoreFile() {
|
|
|
7950
7943
|
}
|
|
7951
7944
|
}
|
|
7952
7945
|
var ignoreToolSchemas = {
|
|
7953
|
-
getIgnoreFile:
|
|
7954
|
-
putIgnoreFile:
|
|
7955
|
-
content:
|
|
7946
|
+
getIgnoreFile: z26.object({}),
|
|
7947
|
+
putIgnoreFile: z26.object({
|
|
7948
|
+
content: z26.string()
|
|
7956
7949
|
}),
|
|
7957
|
-
deleteIgnoreFile:
|
|
7950
|
+
deleteIgnoreFile: z26.object({})
|
|
7958
7951
|
};
|
|
7959
7952
|
var ignoreTools = {
|
|
7960
7953
|
getIgnoreFile: {
|
|
@@ -7988,7 +7981,7 @@ var ignoreTools = {
|
|
|
7988
7981
|
|
|
7989
7982
|
// src/mcp/mcp.ts
|
|
7990
7983
|
import { join as join69 } from "path";
|
|
7991
|
-
import { z as
|
|
7984
|
+
import { z as z27 } from "zod/mini";
|
|
7992
7985
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
7993
7986
|
async function getMcpFile() {
|
|
7994
7987
|
try {
|
|
@@ -8076,11 +8069,11 @@ async function deleteMcpFile() {
|
|
|
8076
8069
|
}
|
|
8077
8070
|
}
|
|
8078
8071
|
var mcpToolSchemas = {
|
|
8079
|
-
getMcpFile:
|
|
8080
|
-
putMcpFile:
|
|
8081
|
-
content:
|
|
8072
|
+
getMcpFile: z27.object({}),
|
|
8073
|
+
putMcpFile: z27.object({
|
|
8074
|
+
content: z27.string()
|
|
8082
8075
|
}),
|
|
8083
|
-
deleteMcpFile:
|
|
8076
|
+
deleteMcpFile: z27.object({})
|
|
8084
8077
|
};
|
|
8085
8078
|
var mcpTools = {
|
|
8086
8079
|
getMcpFile: {
|
|
@@ -8114,7 +8107,7 @@ var mcpTools = {
|
|
|
8114
8107
|
|
|
8115
8108
|
// src/mcp/rules.ts
|
|
8116
8109
|
import { basename as basename19, join as join70 } from "path";
|
|
8117
|
-
import { z as
|
|
8110
|
+
import { z as z28 } from "zod/mini";
|
|
8118
8111
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
8119
8112
|
var maxRulesCount = 1e3;
|
|
8120
8113
|
async function listRules() {
|
|
@@ -8233,17 +8226,17 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
8233
8226
|
}
|
|
8234
8227
|
}
|
|
8235
8228
|
var ruleToolSchemas = {
|
|
8236
|
-
listRules:
|
|
8237
|
-
getRule:
|
|
8238
|
-
relativePathFromCwd:
|
|
8229
|
+
listRules: z28.object({}),
|
|
8230
|
+
getRule: z28.object({
|
|
8231
|
+
relativePathFromCwd: z28.string()
|
|
8239
8232
|
}),
|
|
8240
|
-
putRule:
|
|
8241
|
-
relativePathFromCwd:
|
|
8233
|
+
putRule: z28.object({
|
|
8234
|
+
relativePathFromCwd: z28.string(),
|
|
8242
8235
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
8243
|
-
body:
|
|
8236
|
+
body: z28.string()
|
|
8244
8237
|
}),
|
|
8245
|
-
deleteRule:
|
|
8246
|
-
relativePathFromCwd:
|
|
8238
|
+
deleteRule: z28.object({
|
|
8239
|
+
relativePathFromCwd: z28.string()
|
|
8247
8240
|
})
|
|
8248
8241
|
};
|
|
8249
8242
|
var ruleTools = {
|
|
@@ -8292,7 +8285,7 @@ var ruleTools = {
|
|
|
8292
8285
|
|
|
8293
8286
|
// src/mcp/subagents.ts
|
|
8294
8287
|
import { basename as basename20, join as join71 } from "path";
|
|
8295
|
-
import { z as
|
|
8288
|
+
import { z as z29 } from "zod/mini";
|
|
8296
8289
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
8297
8290
|
var maxSubagentsCount = 1e3;
|
|
8298
8291
|
async function listSubagents() {
|
|
@@ -8416,17 +8409,17 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
8416
8409
|
}
|
|
8417
8410
|
}
|
|
8418
8411
|
var subagentToolSchemas = {
|
|
8419
|
-
listSubagents:
|
|
8420
|
-
getSubagent:
|
|
8421
|
-
relativePathFromCwd:
|
|
8412
|
+
listSubagents: z29.object({}),
|
|
8413
|
+
getSubagent: z29.object({
|
|
8414
|
+
relativePathFromCwd: z29.string()
|
|
8422
8415
|
}),
|
|
8423
|
-
putSubagent:
|
|
8424
|
-
relativePathFromCwd:
|
|
8416
|
+
putSubagent: z29.object({
|
|
8417
|
+
relativePathFromCwd: z29.string(),
|
|
8425
8418
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
8426
|
-
body:
|
|
8419
|
+
body: z29.string()
|
|
8427
8420
|
}),
|
|
8428
|
-
deleteSubagent:
|
|
8429
|
-
relativePathFromCwd:
|
|
8421
|
+
deleteSubagent: z29.object({
|
|
8422
|
+
relativePathFromCwd: z29.string()
|
|
8430
8423
|
})
|
|
8431
8424
|
};
|
|
8432
8425
|
var subagentTools = {
|
|
@@ -8506,7 +8499,7 @@ async function mcpCommand({ version }) {
|
|
|
8506
8499
|
}
|
|
8507
8500
|
|
|
8508
8501
|
// src/cli/index.ts
|
|
8509
|
-
var getVersion = () => "3.23.
|
|
8502
|
+
var getVersion = () => "3.23.3";
|
|
8510
8503
|
var main = async () => {
|
|
8511
8504
|
const program = new Command();
|
|
8512
8505
|
const version = getVersion();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulesync",
|
|
3
|
-
"version": "3.23.
|
|
3
|
+
"version": "3.23.3",
|
|
4
4
|
"description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"pre-commit": "pnpm exec lint-staged"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@kimuson/modular-mcp": "0.0.5",
|
|
40
39
|
"@modelcontextprotocol/sdk": "1.21.2",
|
|
41
40
|
"chokidar": "4.0.3",
|
|
42
41
|
"commander": "14.0.2",
|