rulesync 3.5.0 → 3.5.1
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 +82 -99
- package/dist/index.js +82 -99
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -714,12 +714,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
714
714
|
this.frontmatter = frontmatter;
|
|
715
715
|
this.body = body;
|
|
716
716
|
}
|
|
717
|
-
static getSettablePaths() {
|
|
718
|
-
return {
|
|
719
|
-
relativeDirPath: ".claude/commands"
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
static getSettablePathsGlobal() {
|
|
717
|
+
static getSettablePaths(_options = {}) {
|
|
723
718
|
return {
|
|
724
719
|
relativeDirPath: (0, import_node_path6.join)(".claude", "commands")
|
|
725
720
|
};
|
|
@@ -758,7 +753,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
758
753
|
description: rulesyncFrontmatter.description
|
|
759
754
|
};
|
|
760
755
|
const body = rulesyncCommand.getBody();
|
|
761
|
-
const paths =
|
|
756
|
+
const paths = this.getSettablePaths({ global });
|
|
762
757
|
return new _ClaudecodeCommand({
|
|
763
758
|
baseDir,
|
|
764
759
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -796,7 +791,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
796
791
|
validate = true,
|
|
797
792
|
global = false
|
|
798
793
|
}) {
|
|
799
|
-
const paths =
|
|
794
|
+
const paths = this.getSettablePaths({ global });
|
|
800
795
|
const filePath = (0, import_node_path6.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
801
796
|
const fileContent = await readFileContent(filePath);
|
|
802
797
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -818,10 +813,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
818
813
|
// src/commands/codexcli-command.ts
|
|
819
814
|
var import_node_path7 = require("path");
|
|
820
815
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
821
|
-
static getSettablePaths() {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
816
|
+
static getSettablePaths({ global } = {}) {
|
|
817
|
+
if (!global) {
|
|
818
|
+
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
819
|
+
}
|
|
825
820
|
return {
|
|
826
821
|
relativeDirPath: (0, import_node_path7.join)(".codex", "prompts")
|
|
827
822
|
};
|
|
@@ -848,7 +843,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
848
843
|
validate = true,
|
|
849
844
|
global = false
|
|
850
845
|
}) {
|
|
851
|
-
const paths =
|
|
846
|
+
const paths = this.getSettablePaths({ global });
|
|
852
847
|
return new _CodexcliCommand({
|
|
853
848
|
baseDir,
|
|
854
849
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -875,7 +870,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
875
870
|
validate = true,
|
|
876
871
|
global = false
|
|
877
872
|
}) {
|
|
878
|
-
const paths =
|
|
873
|
+
const paths = this.getSettablePaths({ global });
|
|
879
874
|
const filePath = (0, import_node_path7.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
880
875
|
const fileContent = await readFileContent(filePath);
|
|
881
876
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -1013,12 +1008,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1013
1008
|
// src/commands/cursor-command.ts
|
|
1014
1009
|
var import_node_path9 = require("path");
|
|
1015
1010
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1016
|
-
static getSettablePaths() {
|
|
1017
|
-
return {
|
|
1018
|
-
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
1019
|
-
};
|
|
1020
|
-
}
|
|
1021
|
-
static getSettablePathsGlobal() {
|
|
1011
|
+
static getSettablePaths(_options = {}) {
|
|
1022
1012
|
return {
|
|
1023
1013
|
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
1024
1014
|
};
|
|
@@ -1045,7 +1035,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1045
1035
|
validate = true,
|
|
1046
1036
|
global = false
|
|
1047
1037
|
}) {
|
|
1048
|
-
const paths =
|
|
1038
|
+
const paths = this.getSettablePaths({ global });
|
|
1049
1039
|
return new _CursorCommand({
|
|
1050
1040
|
baseDir,
|
|
1051
1041
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -1072,7 +1062,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1072
1062
|
validate = true,
|
|
1073
1063
|
global = false
|
|
1074
1064
|
}) {
|
|
1075
|
-
const paths =
|
|
1065
|
+
const paths = this.getSettablePaths({ global });
|
|
1076
1066
|
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1077
1067
|
const fileContent = await readFileContent(filePath);
|
|
1078
1068
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -1103,12 +1093,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1103
1093
|
this.frontmatter = parsed;
|
|
1104
1094
|
this.body = parsed.prompt;
|
|
1105
1095
|
}
|
|
1106
|
-
static getSettablePaths() {
|
|
1107
|
-
return {
|
|
1108
|
-
relativeDirPath: ".gemini/commands"
|
|
1109
|
-
};
|
|
1110
|
-
}
|
|
1111
|
-
static getSettablePathsGlobal() {
|
|
1096
|
+
static getSettablePaths(_options = {}) {
|
|
1112
1097
|
return {
|
|
1113
1098
|
relativeDirPath: (0, import_node_path10.join)(".gemini", "commands")
|
|
1114
1099
|
};
|
|
@@ -1169,7 +1154,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1169
1154
|
prompt = """
|
|
1170
1155
|
${geminiFrontmatter.prompt}
|
|
1171
1156
|
"""`;
|
|
1172
|
-
const paths =
|
|
1157
|
+
const paths = this.getSettablePaths({ global });
|
|
1173
1158
|
return new _GeminiCliCommand({
|
|
1174
1159
|
baseDir,
|
|
1175
1160
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1184,7 +1169,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1184
1169
|
validate = true,
|
|
1185
1170
|
global = false
|
|
1186
1171
|
}) {
|
|
1187
|
-
const paths =
|
|
1172
|
+
const paths = this.getSettablePaths({ global });
|
|
1188
1173
|
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1189
1174
|
const fileContent = await readFileContent(filePath);
|
|
1190
1175
|
return new _GeminiCliCommand({
|
|
@@ -1578,7 +1563,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1578
1563
|
* Load Claude Code command configurations from .claude/commands/ directory
|
|
1579
1564
|
*/
|
|
1580
1565
|
async loadClaudecodeCommands() {
|
|
1581
|
-
const paths =
|
|
1566
|
+
const paths = ClaudecodeCommand.getSettablePaths({ global: this.global });
|
|
1582
1567
|
return await this.loadToolCommandDefault({
|
|
1583
1568
|
toolTarget: "claudecode",
|
|
1584
1569
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1589,7 +1574,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1589
1574
|
* Load Cursor command configurations from .cursor/commands/ directory
|
|
1590
1575
|
*/
|
|
1591
1576
|
async loadCursorCommands() {
|
|
1592
|
-
const paths =
|
|
1577
|
+
const paths = CursorCommand.getSettablePaths({ global: this.global });
|
|
1593
1578
|
return await this.loadToolCommandDefault({
|
|
1594
1579
|
toolTarget: "cursor",
|
|
1595
1580
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1600,7 +1585,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1600
1585
|
* Load Gemini CLI command configurations from .gemini/commands/ directory
|
|
1601
1586
|
*/
|
|
1602
1587
|
async loadGeminicliCommands() {
|
|
1603
|
-
const paths =
|
|
1588
|
+
const paths = GeminiCliCommand.getSettablePaths({ global: this.global });
|
|
1604
1589
|
return await this.loadToolCommandDefault({
|
|
1605
1590
|
toolTarget: "geminicli",
|
|
1606
1591
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1611,7 +1596,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1611
1596
|
* Load Codex CLI command configurations from .codex/prompts/ directory
|
|
1612
1597
|
*/
|
|
1613
1598
|
async loadCodexcliCommands() {
|
|
1614
|
-
const paths =
|
|
1599
|
+
const paths = CodexcliCommand.getSettablePaths({ global: this.global });
|
|
1615
1600
|
return await this.loadToolCommandDefault({
|
|
1616
1601
|
toolTarget: "codexcli",
|
|
1617
1602
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -2797,24 +2782,24 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2797
2782
|
getJson() {
|
|
2798
2783
|
return this.json;
|
|
2799
2784
|
}
|
|
2800
|
-
static getSettablePaths() {
|
|
2785
|
+
static getSettablePaths({ global } = {}) {
|
|
2786
|
+
if (global) {
|
|
2787
|
+
return {
|
|
2788
|
+
relativeDirPath: ".claude",
|
|
2789
|
+
relativeFilePath: ".claude.json"
|
|
2790
|
+
};
|
|
2791
|
+
}
|
|
2801
2792
|
return {
|
|
2802
2793
|
relativeDirPath: ".",
|
|
2803
2794
|
relativeFilePath: ".mcp.json"
|
|
2804
2795
|
};
|
|
2805
2796
|
}
|
|
2806
|
-
static getSettablePathsGlobal() {
|
|
2807
|
-
return {
|
|
2808
|
-
relativeDirPath: ".claude",
|
|
2809
|
-
relativeFilePath: ".claude.json"
|
|
2810
|
-
};
|
|
2811
|
-
}
|
|
2812
2797
|
static async fromFile({
|
|
2813
2798
|
baseDir = ".",
|
|
2814
2799
|
validate = true,
|
|
2815
2800
|
global = false
|
|
2816
2801
|
}) {
|
|
2817
|
-
const paths =
|
|
2802
|
+
const paths = this.getSettablePaths({ global });
|
|
2818
2803
|
const fileContent = await readOrInitializeFileContent(
|
|
2819
2804
|
(0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2820
2805
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2835,7 +2820,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2835
2820
|
validate = true,
|
|
2836
2821
|
global = false
|
|
2837
2822
|
}) {
|
|
2838
|
-
const paths =
|
|
2823
|
+
const paths = this.getSettablePaths({ global });
|
|
2839
2824
|
const fileContent = await readOrInitializeFileContent(
|
|
2840
2825
|
(0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2841
2826
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2938,10 +2923,10 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2938
2923
|
getToml() {
|
|
2939
2924
|
return this.toml;
|
|
2940
2925
|
}
|
|
2941
|
-
static getSettablePaths() {
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2926
|
+
static getSettablePaths({ global } = {}) {
|
|
2927
|
+
if (!global) {
|
|
2928
|
+
throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
|
|
2929
|
+
}
|
|
2945
2930
|
return {
|
|
2946
2931
|
relativeDirPath: ".codex",
|
|
2947
2932
|
relativeFilePath: "config.toml"
|
|
@@ -2952,7 +2937,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2952
2937
|
validate = true,
|
|
2953
2938
|
global = false
|
|
2954
2939
|
}) {
|
|
2955
|
-
const paths =
|
|
2940
|
+
const paths = this.getSettablePaths({ global });
|
|
2956
2941
|
const fileContent = await readFileContent(
|
|
2957
2942
|
(0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
2958
2943
|
);
|
|
@@ -2970,7 +2955,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2970
2955
|
validate = true,
|
|
2971
2956
|
global = false
|
|
2972
2957
|
}) {
|
|
2973
|
-
const paths =
|
|
2958
|
+
const paths = this.getSettablePaths({ global });
|
|
2974
2959
|
const configTomlFilePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2975
2960
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
2976
2961
|
configTomlFilePath,
|
|
@@ -3787,12 +3772,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3787
3772
|
this.frontmatter = frontmatter;
|
|
3788
3773
|
this.body = body;
|
|
3789
3774
|
}
|
|
3790
|
-
static getSettablePaths() {
|
|
3791
|
-
return {
|
|
3792
|
-
relativeDirPath: ".claude/agents"
|
|
3793
|
-
};
|
|
3794
|
-
}
|
|
3795
|
-
static getSettablePathsGlobal() {
|
|
3775
|
+
static getSettablePaths(_options = {}) {
|
|
3796
3776
|
return {
|
|
3797
3777
|
relativeDirPath: (0, import_node_path35.join)(".claude", "agents")
|
|
3798
3778
|
};
|
|
@@ -3840,7 +3820,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3840
3820
|
};
|
|
3841
3821
|
const body = rulesyncSubagent.getBody();
|
|
3842
3822
|
const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
|
|
3843
|
-
const paths =
|
|
3823
|
+
const paths = this.getSettablePaths({ global });
|
|
3844
3824
|
return new _ClaudecodeSubagent({
|
|
3845
3825
|
baseDir,
|
|
3846
3826
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -3879,7 +3859,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3879
3859
|
validate = true,
|
|
3880
3860
|
global = false
|
|
3881
3861
|
}) {
|
|
3882
|
-
const paths =
|
|
3862
|
+
const paths = this.getSettablePaths({ global });
|
|
3883
3863
|
const filePath = (0, import_node_path35.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3884
3864
|
const fileContent = await readFileContent(filePath);
|
|
3885
3865
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -4109,7 +4089,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4109
4089
|
* Load Claude Code subagent configurations from .claude/agents/ directory
|
|
4110
4090
|
*/
|
|
4111
4091
|
async loadClaudecodeSubagents() {
|
|
4112
|
-
const paths =
|
|
4092
|
+
const paths = ClaudecodeSubagent.getSettablePaths({ global: this.global });
|
|
4113
4093
|
return await this.loadToolSubagentsDefault({
|
|
4114
4094
|
relativeDirPath: paths.relativeDirPath,
|
|
4115
4095
|
fromFile: (relativeFilePath) => ClaudecodeSubagent.fromFile({
|
|
@@ -4345,10 +4325,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4345
4325
|
this.description = description;
|
|
4346
4326
|
this.globs = globs;
|
|
4347
4327
|
}
|
|
4348
|
-
static getSettablePaths() {
|
|
4349
|
-
throw new Error("Please implement this method in the subclass.");
|
|
4350
|
-
}
|
|
4351
|
-
static getSettablePathsGlobal() {
|
|
4328
|
+
static getSettablePaths(_options = {}) {
|
|
4352
4329
|
throw new Error("Please implement this method in the subclass.");
|
|
4353
4330
|
}
|
|
4354
4331
|
static async fromFile(_params) {
|
|
@@ -4712,7 +4689,17 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4712
4689
|
// src/rules/claudecode-rule.ts
|
|
4713
4690
|
var import_node_path43 = require("path");
|
|
4714
4691
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4715
|
-
static getSettablePaths(
|
|
4692
|
+
static getSettablePaths({
|
|
4693
|
+
global
|
|
4694
|
+
} = {}) {
|
|
4695
|
+
if (global) {
|
|
4696
|
+
return {
|
|
4697
|
+
root: {
|
|
4698
|
+
relativeDirPath: ".claude",
|
|
4699
|
+
relativeFilePath: "CLAUDE.md"
|
|
4700
|
+
}
|
|
4701
|
+
};
|
|
4702
|
+
}
|
|
4716
4703
|
return {
|
|
4717
4704
|
root: {
|
|
4718
4705
|
relativeDirPath: ".",
|
|
@@ -4723,21 +4710,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4723
4710
|
}
|
|
4724
4711
|
};
|
|
4725
4712
|
}
|
|
4726
|
-
static getSettablePathsGlobal() {
|
|
4727
|
-
return {
|
|
4728
|
-
root: {
|
|
4729
|
-
relativeDirPath: ".claude",
|
|
4730
|
-
relativeFilePath: "CLAUDE.md"
|
|
4731
|
-
}
|
|
4732
|
-
};
|
|
4733
|
-
}
|
|
4734
4713
|
static async fromFile({
|
|
4735
4714
|
baseDir = ".",
|
|
4736
4715
|
relativeFilePath,
|
|
4737
4716
|
validate = true,
|
|
4738
4717
|
global = false
|
|
4739
4718
|
}) {
|
|
4740
|
-
const paths =
|
|
4719
|
+
const paths = this.getSettablePaths({ global });
|
|
4741
4720
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4742
4721
|
if (isRoot) {
|
|
4743
4722
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4773,7 +4752,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4773
4752
|
validate = true,
|
|
4774
4753
|
global = false
|
|
4775
4754
|
}) {
|
|
4776
|
-
const paths =
|
|
4755
|
+
const paths = this.getSettablePaths({ global });
|
|
4777
4756
|
return new _ClaudecodeRule(
|
|
4778
4757
|
this.buildToolRuleParamsDefault({
|
|
4779
4758
|
baseDir,
|
|
@@ -4859,7 +4838,17 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4859
4838
|
// src/rules/codexcli-rule.ts
|
|
4860
4839
|
var import_node_path45 = require("path");
|
|
4861
4840
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4862
|
-
static getSettablePaths(
|
|
4841
|
+
static getSettablePaths({
|
|
4842
|
+
global
|
|
4843
|
+
} = {}) {
|
|
4844
|
+
if (global) {
|
|
4845
|
+
return {
|
|
4846
|
+
root: {
|
|
4847
|
+
relativeDirPath: ".codex",
|
|
4848
|
+
relativeFilePath: "AGENTS.md"
|
|
4849
|
+
}
|
|
4850
|
+
};
|
|
4851
|
+
}
|
|
4863
4852
|
return {
|
|
4864
4853
|
root: {
|
|
4865
4854
|
relativeDirPath: ".",
|
|
@@ -4870,21 +4859,13 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4870
4859
|
}
|
|
4871
4860
|
};
|
|
4872
4861
|
}
|
|
4873
|
-
static getSettablePathsGlobal() {
|
|
4874
|
-
return {
|
|
4875
|
-
root: {
|
|
4876
|
-
relativeDirPath: ".codex",
|
|
4877
|
-
relativeFilePath: "AGENTS.md"
|
|
4878
|
-
}
|
|
4879
|
-
};
|
|
4880
|
-
}
|
|
4881
4862
|
static async fromFile({
|
|
4882
4863
|
baseDir = ".",
|
|
4883
4864
|
relativeFilePath,
|
|
4884
4865
|
validate = true,
|
|
4885
4866
|
global = false
|
|
4886
4867
|
}) {
|
|
4887
|
-
const paths =
|
|
4868
|
+
const paths = this.getSettablePaths({ global });
|
|
4888
4869
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4889
4870
|
if (isRoot) {
|
|
4890
4871
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4920,7 +4901,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4920
4901
|
validate = true,
|
|
4921
4902
|
global = false
|
|
4922
4903
|
}) {
|
|
4923
|
-
const paths =
|
|
4904
|
+
const paths = this.getSettablePaths({ global });
|
|
4924
4905
|
return new _CodexcliRule(
|
|
4925
4906
|
this.buildToolRuleParamsAgentsmd({
|
|
4926
4907
|
baseDir,
|
|
@@ -5288,7 +5269,17 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5288
5269
|
// src/rules/geminicli-rule.ts
|
|
5289
5270
|
var import_node_path48 = require("path");
|
|
5290
5271
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5291
|
-
static getSettablePaths(
|
|
5272
|
+
static getSettablePaths({
|
|
5273
|
+
global
|
|
5274
|
+
} = {}) {
|
|
5275
|
+
if (global) {
|
|
5276
|
+
return {
|
|
5277
|
+
root: {
|
|
5278
|
+
relativeDirPath: ".gemini",
|
|
5279
|
+
relativeFilePath: "GEMINI.md"
|
|
5280
|
+
}
|
|
5281
|
+
};
|
|
5282
|
+
}
|
|
5292
5283
|
return {
|
|
5293
5284
|
root: {
|
|
5294
5285
|
relativeDirPath: ".",
|
|
@@ -5299,21 +5290,13 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5299
5290
|
}
|
|
5300
5291
|
};
|
|
5301
5292
|
}
|
|
5302
|
-
static getSettablePathsGlobal() {
|
|
5303
|
-
return {
|
|
5304
|
-
root: {
|
|
5305
|
-
relativeDirPath: ".gemini",
|
|
5306
|
-
relativeFilePath: "GEMINI.md"
|
|
5307
|
-
}
|
|
5308
|
-
};
|
|
5309
|
-
}
|
|
5310
5293
|
static async fromFile({
|
|
5311
5294
|
baseDir = ".",
|
|
5312
5295
|
relativeFilePath,
|
|
5313
5296
|
validate = true,
|
|
5314
5297
|
global = false
|
|
5315
5298
|
}) {
|
|
5316
|
-
const paths =
|
|
5299
|
+
const paths = this.getSettablePaths({ global });
|
|
5317
5300
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
5318
5301
|
if (isRoot) {
|
|
5319
5302
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -5349,7 +5332,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5349
5332
|
validate = true,
|
|
5350
5333
|
global = false
|
|
5351
5334
|
}) {
|
|
5352
|
-
const paths =
|
|
5335
|
+
const paths = this.getSettablePaths({ global });
|
|
5353
5336
|
return new _GeminiCliRule(
|
|
5354
5337
|
this.buildToolRuleParamsDefault({
|
|
5355
5338
|
baseDir,
|
|
@@ -6361,7 +6344,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6361
6344
|
* Load Claude Code rule configuration from CLAUDE.md file
|
|
6362
6345
|
*/
|
|
6363
6346
|
async loadClaudecodeRules() {
|
|
6364
|
-
const settablePaths =
|
|
6347
|
+
const settablePaths = ClaudecodeRule.getSettablePaths({ global: this.global });
|
|
6365
6348
|
return this.loadToolRulesDefault({
|
|
6366
6349
|
root: {
|
|
6367
6350
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6394,7 +6377,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6394
6377
|
* Load OpenAI Codex CLI rule configuration from AGENTS.md and .codex/memories/*.md files
|
|
6395
6378
|
*/
|
|
6396
6379
|
async loadCodexcliRules() {
|
|
6397
|
-
const settablePaths =
|
|
6380
|
+
const settablePaths = CodexcliRule.getSettablePaths({ global: this.global });
|
|
6398
6381
|
return await this.loadToolRulesDefault({
|
|
6399
6382
|
root: {
|
|
6400
6383
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6445,7 +6428,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6445
6428
|
* Load Gemini CLI rule configuration from GEMINI.md file
|
|
6446
6429
|
*/
|
|
6447
6430
|
async loadGeminicliRules() {
|
|
6448
|
-
const settablePaths =
|
|
6431
|
+
const settablePaths = GeminiCliRule.getSettablePaths({ global: this.global });
|
|
6449
6432
|
return await this.loadToolRulesDefault({
|
|
6450
6433
|
root: {
|
|
6451
6434
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -7172,7 +7155,7 @@ globs: ["**/*"]
|
|
|
7172
7155
|
}
|
|
7173
7156
|
|
|
7174
7157
|
// src/cli/index.ts
|
|
7175
|
-
var getVersion = () => "3.5.
|
|
7158
|
+
var getVersion = () => "3.5.1";
|
|
7176
7159
|
var main = async () => {
|
|
7177
7160
|
const program = new import_commander.Command();
|
|
7178
7161
|
const version = getVersion();
|
package/dist/index.js
CHANGED
|
@@ -691,12 +691,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
691
691
|
this.frontmatter = frontmatter;
|
|
692
692
|
this.body = body;
|
|
693
693
|
}
|
|
694
|
-
static getSettablePaths() {
|
|
695
|
-
return {
|
|
696
|
-
relativeDirPath: ".claude/commands"
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
static getSettablePathsGlobal() {
|
|
694
|
+
static getSettablePaths(_options = {}) {
|
|
700
695
|
return {
|
|
701
696
|
relativeDirPath: join5(".claude", "commands")
|
|
702
697
|
};
|
|
@@ -735,7 +730,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
735
730
|
description: rulesyncFrontmatter.description
|
|
736
731
|
};
|
|
737
732
|
const body = rulesyncCommand.getBody();
|
|
738
|
-
const paths =
|
|
733
|
+
const paths = this.getSettablePaths({ global });
|
|
739
734
|
return new _ClaudecodeCommand({
|
|
740
735
|
baseDir,
|
|
741
736
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -773,7 +768,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
773
768
|
validate = true,
|
|
774
769
|
global = false
|
|
775
770
|
}) {
|
|
776
|
-
const paths =
|
|
771
|
+
const paths = this.getSettablePaths({ global });
|
|
777
772
|
const filePath = join5(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
778
773
|
const fileContent = await readFileContent(filePath);
|
|
779
774
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -795,10 +790,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
795
790
|
// src/commands/codexcli-command.ts
|
|
796
791
|
import { basename as basename6, join as join6 } from "path";
|
|
797
792
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
798
|
-
static getSettablePaths() {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
793
|
+
static getSettablePaths({ global } = {}) {
|
|
794
|
+
if (!global) {
|
|
795
|
+
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
796
|
+
}
|
|
802
797
|
return {
|
|
803
798
|
relativeDirPath: join6(".codex", "prompts")
|
|
804
799
|
};
|
|
@@ -825,7 +820,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
825
820
|
validate = true,
|
|
826
821
|
global = false
|
|
827
822
|
}) {
|
|
828
|
-
const paths =
|
|
823
|
+
const paths = this.getSettablePaths({ global });
|
|
829
824
|
return new _CodexcliCommand({
|
|
830
825
|
baseDir,
|
|
831
826
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -852,7 +847,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
852
847
|
validate = true,
|
|
853
848
|
global = false
|
|
854
849
|
}) {
|
|
855
|
-
const paths =
|
|
850
|
+
const paths = this.getSettablePaths({ global });
|
|
856
851
|
const filePath = join6(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
857
852
|
const fileContent = await readFileContent(filePath);
|
|
858
853
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -990,12 +985,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
990
985
|
// src/commands/cursor-command.ts
|
|
991
986
|
import { basename as basename8, join as join8 } from "path";
|
|
992
987
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
993
|
-
static getSettablePaths() {
|
|
994
|
-
return {
|
|
995
|
-
relativeDirPath: join8(".cursor", "commands")
|
|
996
|
-
};
|
|
997
|
-
}
|
|
998
|
-
static getSettablePathsGlobal() {
|
|
988
|
+
static getSettablePaths(_options = {}) {
|
|
999
989
|
return {
|
|
1000
990
|
relativeDirPath: join8(".cursor", "commands")
|
|
1001
991
|
};
|
|
@@ -1022,7 +1012,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1022
1012
|
validate = true,
|
|
1023
1013
|
global = false
|
|
1024
1014
|
}) {
|
|
1025
|
-
const paths =
|
|
1015
|
+
const paths = this.getSettablePaths({ global });
|
|
1026
1016
|
return new _CursorCommand({
|
|
1027
1017
|
baseDir,
|
|
1028
1018
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -1049,7 +1039,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1049
1039
|
validate = true,
|
|
1050
1040
|
global = false
|
|
1051
1041
|
}) {
|
|
1052
|
-
const paths =
|
|
1042
|
+
const paths = this.getSettablePaths({ global });
|
|
1053
1043
|
const filePath = join8(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1054
1044
|
const fileContent = await readFileContent(filePath);
|
|
1055
1045
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -1080,12 +1070,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1080
1070
|
this.frontmatter = parsed;
|
|
1081
1071
|
this.body = parsed.prompt;
|
|
1082
1072
|
}
|
|
1083
|
-
static getSettablePaths() {
|
|
1084
|
-
return {
|
|
1085
|
-
relativeDirPath: ".gemini/commands"
|
|
1086
|
-
};
|
|
1087
|
-
}
|
|
1088
|
-
static getSettablePathsGlobal() {
|
|
1073
|
+
static getSettablePaths(_options = {}) {
|
|
1089
1074
|
return {
|
|
1090
1075
|
relativeDirPath: join9(".gemini", "commands")
|
|
1091
1076
|
};
|
|
@@ -1146,7 +1131,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1146
1131
|
prompt = """
|
|
1147
1132
|
${geminiFrontmatter.prompt}
|
|
1148
1133
|
"""`;
|
|
1149
|
-
const paths =
|
|
1134
|
+
const paths = this.getSettablePaths({ global });
|
|
1150
1135
|
return new _GeminiCliCommand({
|
|
1151
1136
|
baseDir,
|
|
1152
1137
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1161,7 +1146,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1161
1146
|
validate = true,
|
|
1162
1147
|
global = false
|
|
1163
1148
|
}) {
|
|
1164
|
-
const paths =
|
|
1149
|
+
const paths = this.getSettablePaths({ global });
|
|
1165
1150
|
const filePath = join9(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1166
1151
|
const fileContent = await readFileContent(filePath);
|
|
1167
1152
|
return new _GeminiCliCommand({
|
|
@@ -1555,7 +1540,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1555
1540
|
* Load Claude Code command configurations from .claude/commands/ directory
|
|
1556
1541
|
*/
|
|
1557
1542
|
async loadClaudecodeCommands() {
|
|
1558
|
-
const paths =
|
|
1543
|
+
const paths = ClaudecodeCommand.getSettablePaths({ global: this.global });
|
|
1559
1544
|
return await this.loadToolCommandDefault({
|
|
1560
1545
|
toolTarget: "claudecode",
|
|
1561
1546
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1566,7 +1551,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1566
1551
|
* Load Cursor command configurations from .cursor/commands/ directory
|
|
1567
1552
|
*/
|
|
1568
1553
|
async loadCursorCommands() {
|
|
1569
|
-
const paths =
|
|
1554
|
+
const paths = CursorCommand.getSettablePaths({ global: this.global });
|
|
1570
1555
|
return await this.loadToolCommandDefault({
|
|
1571
1556
|
toolTarget: "cursor",
|
|
1572
1557
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1577,7 +1562,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1577
1562
|
* Load Gemini CLI command configurations from .gemini/commands/ directory
|
|
1578
1563
|
*/
|
|
1579
1564
|
async loadGeminicliCommands() {
|
|
1580
|
-
const paths =
|
|
1565
|
+
const paths = GeminiCliCommand.getSettablePaths({ global: this.global });
|
|
1581
1566
|
return await this.loadToolCommandDefault({
|
|
1582
1567
|
toolTarget: "geminicli",
|
|
1583
1568
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1588,7 +1573,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1588
1573
|
* Load Codex CLI command configurations from .codex/prompts/ directory
|
|
1589
1574
|
*/
|
|
1590
1575
|
async loadCodexcliCommands() {
|
|
1591
|
-
const paths =
|
|
1576
|
+
const paths = CodexcliCommand.getSettablePaths({ global: this.global });
|
|
1592
1577
|
return await this.loadToolCommandDefault({
|
|
1593
1578
|
toolTarget: "codexcli",
|
|
1594
1579
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -2774,24 +2759,24 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2774
2759
|
getJson() {
|
|
2775
2760
|
return this.json;
|
|
2776
2761
|
}
|
|
2777
|
-
static getSettablePaths() {
|
|
2762
|
+
static getSettablePaths({ global } = {}) {
|
|
2763
|
+
if (global) {
|
|
2764
|
+
return {
|
|
2765
|
+
relativeDirPath: ".claude",
|
|
2766
|
+
relativeFilePath: ".claude.json"
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2778
2769
|
return {
|
|
2779
2770
|
relativeDirPath: ".",
|
|
2780
2771
|
relativeFilePath: ".mcp.json"
|
|
2781
2772
|
};
|
|
2782
2773
|
}
|
|
2783
|
-
static getSettablePathsGlobal() {
|
|
2784
|
-
return {
|
|
2785
|
-
relativeDirPath: ".claude",
|
|
2786
|
-
relativeFilePath: ".claude.json"
|
|
2787
|
-
};
|
|
2788
|
-
}
|
|
2789
2774
|
static async fromFile({
|
|
2790
2775
|
baseDir = ".",
|
|
2791
2776
|
validate = true,
|
|
2792
2777
|
global = false
|
|
2793
2778
|
}) {
|
|
2794
|
-
const paths =
|
|
2779
|
+
const paths = this.getSettablePaths({ global });
|
|
2795
2780
|
const fileContent = await readOrInitializeFileContent(
|
|
2796
2781
|
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2797
2782
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2812,7 +2797,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2812
2797
|
validate = true,
|
|
2813
2798
|
global = false
|
|
2814
2799
|
}) {
|
|
2815
|
-
const paths =
|
|
2800
|
+
const paths = this.getSettablePaths({ global });
|
|
2816
2801
|
const fileContent = await readOrInitializeFileContent(
|
|
2817
2802
|
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2818
2803
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2915,10 +2900,10 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2915
2900
|
getToml() {
|
|
2916
2901
|
return this.toml;
|
|
2917
2902
|
}
|
|
2918
|
-
static getSettablePaths() {
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2903
|
+
static getSettablePaths({ global } = {}) {
|
|
2904
|
+
if (!global) {
|
|
2905
|
+
throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
|
|
2906
|
+
}
|
|
2922
2907
|
return {
|
|
2923
2908
|
relativeDirPath: ".codex",
|
|
2924
2909
|
relativeFilePath: "config.toml"
|
|
@@ -2929,7 +2914,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2929
2914
|
validate = true,
|
|
2930
2915
|
global = false
|
|
2931
2916
|
}) {
|
|
2932
|
-
const paths =
|
|
2917
|
+
const paths = this.getSettablePaths({ global });
|
|
2933
2918
|
const fileContent = await readFileContent(
|
|
2934
2919
|
join28(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
2935
2920
|
);
|
|
@@ -2947,7 +2932,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2947
2932
|
validate = true,
|
|
2948
2933
|
global = false
|
|
2949
2934
|
}) {
|
|
2950
|
-
const paths =
|
|
2935
|
+
const paths = this.getSettablePaths({ global });
|
|
2951
2936
|
const configTomlFilePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2952
2937
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
2953
2938
|
configTomlFilePath,
|
|
@@ -3764,12 +3749,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3764
3749
|
this.frontmatter = frontmatter;
|
|
3765
3750
|
this.body = body;
|
|
3766
3751
|
}
|
|
3767
|
-
static getSettablePaths() {
|
|
3768
|
-
return {
|
|
3769
|
-
relativeDirPath: ".claude/agents"
|
|
3770
|
-
};
|
|
3771
|
-
}
|
|
3772
|
-
static getSettablePathsGlobal() {
|
|
3752
|
+
static getSettablePaths(_options = {}) {
|
|
3773
3753
|
return {
|
|
3774
3754
|
relativeDirPath: join34(".claude", "agents")
|
|
3775
3755
|
};
|
|
@@ -3817,7 +3797,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3817
3797
|
};
|
|
3818
3798
|
const body = rulesyncSubagent.getBody();
|
|
3819
3799
|
const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
|
|
3820
|
-
const paths =
|
|
3800
|
+
const paths = this.getSettablePaths({ global });
|
|
3821
3801
|
return new _ClaudecodeSubagent({
|
|
3822
3802
|
baseDir,
|
|
3823
3803
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -3856,7 +3836,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3856
3836
|
validate = true,
|
|
3857
3837
|
global = false
|
|
3858
3838
|
}) {
|
|
3859
|
-
const paths =
|
|
3839
|
+
const paths = this.getSettablePaths({ global });
|
|
3860
3840
|
const filePath = join34(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3861
3841
|
const fileContent = await readFileContent(filePath);
|
|
3862
3842
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -4086,7 +4066,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4086
4066
|
* Load Claude Code subagent configurations from .claude/agents/ directory
|
|
4087
4067
|
*/
|
|
4088
4068
|
async loadClaudecodeSubagents() {
|
|
4089
|
-
const paths =
|
|
4069
|
+
const paths = ClaudecodeSubagent.getSettablePaths({ global: this.global });
|
|
4090
4070
|
return await this.loadToolSubagentsDefault({
|
|
4091
4071
|
relativeDirPath: paths.relativeDirPath,
|
|
4092
4072
|
fromFile: (relativeFilePath) => ClaudecodeSubagent.fromFile({
|
|
@@ -4322,10 +4302,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4322
4302
|
this.description = description;
|
|
4323
4303
|
this.globs = globs;
|
|
4324
4304
|
}
|
|
4325
|
-
static getSettablePaths() {
|
|
4326
|
-
throw new Error("Please implement this method in the subclass.");
|
|
4327
|
-
}
|
|
4328
|
-
static getSettablePathsGlobal() {
|
|
4305
|
+
static getSettablePaths(_options = {}) {
|
|
4329
4306
|
throw new Error("Please implement this method in the subclass.");
|
|
4330
4307
|
}
|
|
4331
4308
|
static async fromFile(_params) {
|
|
@@ -4689,7 +4666,17 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4689
4666
|
// src/rules/claudecode-rule.ts
|
|
4690
4667
|
import { join as join42 } from "path";
|
|
4691
4668
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4692
|
-
static getSettablePaths(
|
|
4669
|
+
static getSettablePaths({
|
|
4670
|
+
global
|
|
4671
|
+
} = {}) {
|
|
4672
|
+
if (global) {
|
|
4673
|
+
return {
|
|
4674
|
+
root: {
|
|
4675
|
+
relativeDirPath: ".claude",
|
|
4676
|
+
relativeFilePath: "CLAUDE.md"
|
|
4677
|
+
}
|
|
4678
|
+
};
|
|
4679
|
+
}
|
|
4693
4680
|
return {
|
|
4694
4681
|
root: {
|
|
4695
4682
|
relativeDirPath: ".",
|
|
@@ -4700,21 +4687,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4700
4687
|
}
|
|
4701
4688
|
};
|
|
4702
4689
|
}
|
|
4703
|
-
static getSettablePathsGlobal() {
|
|
4704
|
-
return {
|
|
4705
|
-
root: {
|
|
4706
|
-
relativeDirPath: ".claude",
|
|
4707
|
-
relativeFilePath: "CLAUDE.md"
|
|
4708
|
-
}
|
|
4709
|
-
};
|
|
4710
|
-
}
|
|
4711
4690
|
static async fromFile({
|
|
4712
4691
|
baseDir = ".",
|
|
4713
4692
|
relativeFilePath,
|
|
4714
4693
|
validate = true,
|
|
4715
4694
|
global = false
|
|
4716
4695
|
}) {
|
|
4717
|
-
const paths =
|
|
4696
|
+
const paths = this.getSettablePaths({ global });
|
|
4718
4697
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4719
4698
|
if (isRoot) {
|
|
4720
4699
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4750,7 +4729,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4750
4729
|
validate = true,
|
|
4751
4730
|
global = false
|
|
4752
4731
|
}) {
|
|
4753
|
-
const paths =
|
|
4732
|
+
const paths = this.getSettablePaths({ global });
|
|
4754
4733
|
return new _ClaudecodeRule(
|
|
4755
4734
|
this.buildToolRuleParamsDefault({
|
|
4756
4735
|
baseDir,
|
|
@@ -4836,7 +4815,17 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4836
4815
|
// src/rules/codexcli-rule.ts
|
|
4837
4816
|
import { join as join44 } from "path";
|
|
4838
4817
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4839
|
-
static getSettablePaths(
|
|
4818
|
+
static getSettablePaths({
|
|
4819
|
+
global
|
|
4820
|
+
} = {}) {
|
|
4821
|
+
if (global) {
|
|
4822
|
+
return {
|
|
4823
|
+
root: {
|
|
4824
|
+
relativeDirPath: ".codex",
|
|
4825
|
+
relativeFilePath: "AGENTS.md"
|
|
4826
|
+
}
|
|
4827
|
+
};
|
|
4828
|
+
}
|
|
4840
4829
|
return {
|
|
4841
4830
|
root: {
|
|
4842
4831
|
relativeDirPath: ".",
|
|
@@ -4847,21 +4836,13 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4847
4836
|
}
|
|
4848
4837
|
};
|
|
4849
4838
|
}
|
|
4850
|
-
static getSettablePathsGlobal() {
|
|
4851
|
-
return {
|
|
4852
|
-
root: {
|
|
4853
|
-
relativeDirPath: ".codex",
|
|
4854
|
-
relativeFilePath: "AGENTS.md"
|
|
4855
|
-
}
|
|
4856
|
-
};
|
|
4857
|
-
}
|
|
4858
4839
|
static async fromFile({
|
|
4859
4840
|
baseDir = ".",
|
|
4860
4841
|
relativeFilePath,
|
|
4861
4842
|
validate = true,
|
|
4862
4843
|
global = false
|
|
4863
4844
|
}) {
|
|
4864
|
-
const paths =
|
|
4845
|
+
const paths = this.getSettablePaths({ global });
|
|
4865
4846
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4866
4847
|
if (isRoot) {
|
|
4867
4848
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4897,7 +4878,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4897
4878
|
validate = true,
|
|
4898
4879
|
global = false
|
|
4899
4880
|
}) {
|
|
4900
|
-
const paths =
|
|
4881
|
+
const paths = this.getSettablePaths({ global });
|
|
4901
4882
|
return new _CodexcliRule(
|
|
4902
4883
|
this.buildToolRuleParamsAgentsmd({
|
|
4903
4884
|
baseDir,
|
|
@@ -5265,7 +5246,17 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5265
5246
|
// src/rules/geminicli-rule.ts
|
|
5266
5247
|
import { join as join47 } from "path";
|
|
5267
5248
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5268
|
-
static getSettablePaths(
|
|
5249
|
+
static getSettablePaths({
|
|
5250
|
+
global
|
|
5251
|
+
} = {}) {
|
|
5252
|
+
if (global) {
|
|
5253
|
+
return {
|
|
5254
|
+
root: {
|
|
5255
|
+
relativeDirPath: ".gemini",
|
|
5256
|
+
relativeFilePath: "GEMINI.md"
|
|
5257
|
+
}
|
|
5258
|
+
};
|
|
5259
|
+
}
|
|
5269
5260
|
return {
|
|
5270
5261
|
root: {
|
|
5271
5262
|
relativeDirPath: ".",
|
|
@@ -5276,21 +5267,13 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5276
5267
|
}
|
|
5277
5268
|
};
|
|
5278
5269
|
}
|
|
5279
|
-
static getSettablePathsGlobal() {
|
|
5280
|
-
return {
|
|
5281
|
-
root: {
|
|
5282
|
-
relativeDirPath: ".gemini",
|
|
5283
|
-
relativeFilePath: "GEMINI.md"
|
|
5284
|
-
}
|
|
5285
|
-
};
|
|
5286
|
-
}
|
|
5287
5270
|
static async fromFile({
|
|
5288
5271
|
baseDir = ".",
|
|
5289
5272
|
relativeFilePath,
|
|
5290
5273
|
validate = true,
|
|
5291
5274
|
global = false
|
|
5292
5275
|
}) {
|
|
5293
|
-
const paths =
|
|
5276
|
+
const paths = this.getSettablePaths({ global });
|
|
5294
5277
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
5295
5278
|
if (isRoot) {
|
|
5296
5279
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -5326,7 +5309,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5326
5309
|
validate = true,
|
|
5327
5310
|
global = false
|
|
5328
5311
|
}) {
|
|
5329
|
-
const paths =
|
|
5312
|
+
const paths = this.getSettablePaths({ global });
|
|
5330
5313
|
return new _GeminiCliRule(
|
|
5331
5314
|
this.buildToolRuleParamsDefault({
|
|
5332
5315
|
baseDir,
|
|
@@ -6338,7 +6321,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6338
6321
|
* Load Claude Code rule configuration from CLAUDE.md file
|
|
6339
6322
|
*/
|
|
6340
6323
|
async loadClaudecodeRules() {
|
|
6341
|
-
const settablePaths =
|
|
6324
|
+
const settablePaths = ClaudecodeRule.getSettablePaths({ global: this.global });
|
|
6342
6325
|
return this.loadToolRulesDefault({
|
|
6343
6326
|
root: {
|
|
6344
6327
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6371,7 +6354,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6371
6354
|
* Load OpenAI Codex CLI rule configuration from AGENTS.md and .codex/memories/*.md files
|
|
6372
6355
|
*/
|
|
6373
6356
|
async loadCodexcliRules() {
|
|
6374
|
-
const settablePaths =
|
|
6357
|
+
const settablePaths = CodexcliRule.getSettablePaths({ global: this.global });
|
|
6375
6358
|
return await this.loadToolRulesDefault({
|
|
6376
6359
|
root: {
|
|
6377
6360
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6422,7 +6405,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6422
6405
|
* Load Gemini CLI rule configuration from GEMINI.md file
|
|
6423
6406
|
*/
|
|
6424
6407
|
async loadGeminicliRules() {
|
|
6425
|
-
const settablePaths =
|
|
6408
|
+
const settablePaths = GeminiCliRule.getSettablePaths({ global: this.global });
|
|
6426
6409
|
return await this.loadToolRulesDefault({
|
|
6427
6410
|
root: {
|
|
6428
6411
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -7149,7 +7132,7 @@ globs: ["**/*"]
|
|
|
7149
7132
|
}
|
|
7150
7133
|
|
|
7151
7134
|
// src/cli/index.ts
|
|
7152
|
-
var getVersion = () => "3.5.
|
|
7135
|
+
var getVersion = () => "3.5.1";
|
|
7153
7136
|
var main = async () => {
|
|
7154
7137
|
const program = new Command();
|
|
7155
7138
|
const version = getVersion();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulesync",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -50,33 +50,33 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@anthropic-ai/claude-agent-sdk": "0.1.14",
|
|
53
|
-
"@biomejs/biome": "2.2.
|
|
53
|
+
"@biomejs/biome": "2.2.6",
|
|
54
54
|
"@eslint/js": "9.37.0",
|
|
55
55
|
"@secretlint/secretlint-rule-preset-recommend": "11.2.5",
|
|
56
56
|
"@tsconfig/node24": "24.0.1",
|
|
57
57
|
"@types/js-yaml": "4.0.9",
|
|
58
58
|
"@types/micromatch": "4.0.9",
|
|
59
59
|
"@types/node": "24.7.2",
|
|
60
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
60
|
+
"@typescript/native-preview": "7.0.0-dev.20251013.1",
|
|
61
61
|
"@vitest/coverage-v8": "3.2.4",
|
|
62
62
|
"cspell": "9.2.1",
|
|
63
63
|
"eslint": "9.37.0",
|
|
64
64
|
"eslint-plugin-import": "2.32.0",
|
|
65
65
|
"eslint-plugin-no-type-assertion": "1.3.0",
|
|
66
|
-
"eslint-plugin-oxlint": "1.
|
|
66
|
+
"eslint-plugin-oxlint": "1.23.0",
|
|
67
67
|
"eslint-plugin-strict-dependencies": "1.3.26",
|
|
68
68
|
"eslint-plugin-zod-import": "0.3.0",
|
|
69
|
-
"knip": "5.
|
|
69
|
+
"knip": "5.65.0",
|
|
70
70
|
"lint-staged": "16.2.4",
|
|
71
71
|
"o3-search-mcp": "0.0.9",
|
|
72
|
-
"oxlint": "1.
|
|
72
|
+
"oxlint": "1.23.0",
|
|
73
73
|
"secretlint": "11.2.5",
|
|
74
74
|
"simple-git-hooks": "2.13.1",
|
|
75
75
|
"sort-package-json": "3.4.0",
|
|
76
76
|
"tsup": "8.5.0",
|
|
77
77
|
"tsx": "4.20.6",
|
|
78
78
|
"typescript": "5.9.3",
|
|
79
|
-
"typescript-eslint": "8.46.
|
|
79
|
+
"typescript-eslint": "8.46.1",
|
|
80
80
|
"vitest": "3.2.4"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|