rulesync 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +218 -239
- package/dist/index.js +208 -229
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -636,10 +636,84 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
636
636
|
};
|
|
637
637
|
|
|
638
638
|
// src/commands/codexcli-command.ts
|
|
639
|
-
var
|
|
639
|
+
var import_node_path5 = require("path");
|
|
640
|
+
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
641
|
+
static getSettablePaths() {
|
|
642
|
+
throw new Error("getSettablePaths is not supported for CodexcliCommand");
|
|
643
|
+
}
|
|
644
|
+
static getSettablePathsGlobal() {
|
|
645
|
+
return {
|
|
646
|
+
relativeDirPath: (0, import_node_path5.join)(".codex", "prompts")
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
toRulesyncCommand() {
|
|
650
|
+
const rulesyncFrontmatter = {
|
|
651
|
+
targets: ["*"],
|
|
652
|
+
description: ""
|
|
653
|
+
};
|
|
654
|
+
return new RulesyncCommand({
|
|
655
|
+
baseDir: ".",
|
|
656
|
+
// RulesyncCommand baseDir is always the project root directory
|
|
657
|
+
frontmatter: rulesyncFrontmatter,
|
|
658
|
+
body: this.getFileContent(),
|
|
659
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
660
|
+
relativeFilePath: this.relativeFilePath,
|
|
661
|
+
fileContent: this.getFileContent(),
|
|
662
|
+
validate: true
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
static fromRulesyncCommand({
|
|
666
|
+
baseDir = ".",
|
|
667
|
+
rulesyncCommand,
|
|
668
|
+
validate = true,
|
|
669
|
+
global = false
|
|
670
|
+
}) {
|
|
671
|
+
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
672
|
+
return new _CodexcliCommand({
|
|
673
|
+
baseDir,
|
|
674
|
+
fileContent: rulesyncCommand.getBody(),
|
|
675
|
+
relativeDirPath: paths.relativeDirPath,
|
|
676
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
677
|
+
validate
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
validate() {
|
|
681
|
+
return { success: true, error: null };
|
|
682
|
+
}
|
|
683
|
+
getBody() {
|
|
684
|
+
return this.getFileContent();
|
|
685
|
+
}
|
|
686
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
687
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
688
|
+
rulesyncCommand,
|
|
689
|
+
toolTarget: "codexcli"
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
static async fromFile({
|
|
693
|
+
baseDir = ".",
|
|
694
|
+
relativeFilePath,
|
|
695
|
+
validate = true,
|
|
696
|
+
global = false
|
|
697
|
+
}) {
|
|
698
|
+
const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
|
|
699
|
+
const filePath = (0, import_node_path5.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
700
|
+
const fileContent = await readFileContent(filePath);
|
|
701
|
+
const { body: content } = parseFrontmatter(fileContent);
|
|
702
|
+
return new _CodexcliCommand({
|
|
703
|
+
baseDir,
|
|
704
|
+
relativeDirPath: paths.relativeDirPath,
|
|
705
|
+
relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
|
|
706
|
+
fileContent: content.trim(),
|
|
707
|
+
validate
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
// src/commands/copilot-command.ts
|
|
713
|
+
var import_node_path7 = require("path");
|
|
640
714
|
|
|
641
715
|
// src/commands/simulated-command.ts
|
|
642
|
-
var
|
|
716
|
+
var import_node_path6 = require("path");
|
|
643
717
|
var import_mini5 = require("zod/mini");
|
|
644
718
|
var SimulatedCommandFrontmatterSchema = import_mini5.z.object({
|
|
645
719
|
description: import_mini5.z.string()
|
|
@@ -705,7 +779,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
705
779
|
relativeFilePath,
|
|
706
780
|
validate = true
|
|
707
781
|
}) {
|
|
708
|
-
const filePath = (0,
|
|
782
|
+
const filePath = (0, import_node_path6.join)(
|
|
709
783
|
baseDir,
|
|
710
784
|
_SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
711
785
|
relativeFilePath
|
|
@@ -719,65 +793,15 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
719
793
|
return {
|
|
720
794
|
baseDir,
|
|
721
795
|
relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
722
|
-
relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
|
|
723
|
-
frontmatter: result.data,
|
|
724
|
-
body: content.trim(),
|
|
725
|
-
validate
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
// src/commands/codexcli-command.ts
|
|
731
|
-
var CodexCliCommand = class _CodexCliCommand extends SimulatedCommand {
|
|
732
|
-
static getSettablePaths() {
|
|
733
|
-
return {
|
|
734
|
-
relativeDirPath: ".codex/commands"
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
static fromRulesyncCommand({
|
|
738
|
-
baseDir = ".",
|
|
739
|
-
rulesyncCommand,
|
|
740
|
-
validate = true
|
|
741
|
-
}) {
|
|
742
|
-
return new _CodexCliCommand(
|
|
743
|
-
this.fromRulesyncCommandDefault({ baseDir, rulesyncCommand, validate })
|
|
744
|
-
);
|
|
745
|
-
}
|
|
746
|
-
static async fromFile({
|
|
747
|
-
baseDir = ".",
|
|
748
|
-
relativeFilePath,
|
|
749
|
-
validate = true
|
|
750
|
-
}) {
|
|
751
|
-
const filePath = (0, import_node_path6.join)(
|
|
752
|
-
baseDir,
|
|
753
|
-
_CodexCliCommand.getSettablePaths().relativeDirPath,
|
|
754
|
-
relativeFilePath
|
|
755
|
-
);
|
|
756
|
-
const fileContent = await readFileContent(filePath);
|
|
757
|
-
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
758
|
-
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
759
|
-
if (!result.success) {
|
|
760
|
-
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
761
|
-
}
|
|
762
|
-
return new _CodexCliCommand({
|
|
763
|
-
baseDir,
|
|
764
|
-
relativeDirPath: _CodexCliCommand.getSettablePaths().relativeDirPath,
|
|
765
796
|
relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
|
|
766
797
|
frontmatter: result.data,
|
|
767
798
|
body: content.trim(),
|
|
768
799
|
validate
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
772
|
-
return this.isTargetedByRulesyncCommandDefault({
|
|
773
|
-
rulesyncCommand,
|
|
774
|
-
toolTarget: "codexcli"
|
|
775
|
-
});
|
|
800
|
+
};
|
|
776
801
|
}
|
|
777
802
|
};
|
|
778
803
|
|
|
779
804
|
// src/commands/copilot-command.ts
|
|
780
|
-
var import_node_path7 = require("path");
|
|
781
805
|
var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
782
806
|
static getSettablePaths() {
|
|
783
807
|
return {
|
|
@@ -1144,11 +1168,19 @@ var commandsProcessorToolTargets = [
|
|
|
1144
1168
|
"geminicli",
|
|
1145
1169
|
"roo",
|
|
1146
1170
|
"copilot",
|
|
1171
|
+
"cursor"
|
|
1172
|
+
];
|
|
1173
|
+
var CommandsProcessorToolTargetSchema = import_mini8.z.enum(
|
|
1174
|
+
// 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
|
|
1175
|
+
commandsProcessorToolTargets.concat("codexcli")
|
|
1176
|
+
);
|
|
1177
|
+
var commandsProcessorToolTargetsSimulated = ["copilot"];
|
|
1178
|
+
var commandsProcessorToolTargetsGlobal = [
|
|
1179
|
+
"claudecode",
|
|
1147
1180
|
"cursor",
|
|
1181
|
+
"geminicli",
|
|
1148
1182
|
"codexcli"
|
|
1149
1183
|
];
|
|
1150
|
-
var CommandsProcessorToolTargetSchema = import_mini8.z.enum(commandsProcessorToolTargets);
|
|
1151
|
-
var commandsProcessorToolTargetsSimulated = ["copilot", "codexcli"];
|
|
1152
1184
|
var CommandsProcessor = class extends FeatureProcessor {
|
|
1153
1185
|
toolTarget;
|
|
1154
1186
|
global;
|
|
@@ -1211,12 +1243,13 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1211
1243
|
global: this.global
|
|
1212
1244
|
});
|
|
1213
1245
|
case "codexcli":
|
|
1214
|
-
if (!
|
|
1246
|
+
if (!CodexcliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1215
1247
|
return null;
|
|
1216
1248
|
}
|
|
1217
|
-
return
|
|
1249
|
+
return CodexcliCommand.fromRulesyncCommand({
|
|
1218
1250
|
baseDir: this.baseDir,
|
|
1219
|
-
rulesyncCommand
|
|
1251
|
+
rulesyncCommand,
|
|
1252
|
+
global: this.global
|
|
1220
1253
|
});
|
|
1221
1254
|
default:
|
|
1222
1255
|
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
@@ -1316,9 +1349,10 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1316
1349
|
global: this.global
|
|
1317
1350
|
});
|
|
1318
1351
|
case "codexcli":
|
|
1319
|
-
return
|
|
1352
|
+
return CodexcliCommand.fromFile({
|
|
1320
1353
|
baseDir: this.baseDir,
|
|
1321
|
-
relativeFilePath: (0, import_node_path11.basename)(path2)
|
|
1354
|
+
relativeFilePath: (0, import_node_path11.basename)(path2),
|
|
1355
|
+
global: this.global
|
|
1322
1356
|
});
|
|
1323
1357
|
default:
|
|
1324
1358
|
throw new Error(`Unsupported tool target: ${toolTarget}`);
|
|
@@ -1372,12 +1406,13 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1372
1406
|
});
|
|
1373
1407
|
}
|
|
1374
1408
|
/**
|
|
1375
|
-
* Load
|
|
1409
|
+
* Load Codex CLI command configurations from .codex/prompts/ directory
|
|
1376
1410
|
*/
|
|
1377
1411
|
async loadCodexcliCommands() {
|
|
1412
|
+
const paths = this.global ? CodexcliCommand.getSettablePathsGlobal() : CodexcliCommand.getSettablePaths();
|
|
1378
1413
|
return await this.loadToolCommandDefault({
|
|
1379
1414
|
toolTarget: "codexcli",
|
|
1380
|
-
relativeDirPath:
|
|
1415
|
+
relativeDirPath: paths.relativeDirPath,
|
|
1381
1416
|
extension: "md"
|
|
1382
1417
|
});
|
|
1383
1418
|
}
|
|
@@ -1409,7 +1444,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1409
1444
|
return commandsProcessorToolTargetsSimulated;
|
|
1410
1445
|
}
|
|
1411
1446
|
static getToolTargetsGlobal() {
|
|
1412
|
-
return
|
|
1447
|
+
return commandsProcessorToolTargetsGlobal;
|
|
1413
1448
|
}
|
|
1414
1449
|
};
|
|
1415
1450
|
|
|
@@ -1879,55 +1914,8 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1879
1914
|
}
|
|
1880
1915
|
};
|
|
1881
1916
|
|
|
1882
|
-
// src/ignore/codexcli-ignore.ts
|
|
1883
|
-
var import_node_path17 = require("path");
|
|
1884
|
-
var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
1885
|
-
static getSettablePaths() {
|
|
1886
|
-
return {
|
|
1887
|
-
relativeDirPath: ".",
|
|
1888
|
-
relativeFilePath: ".codexignore"
|
|
1889
|
-
};
|
|
1890
|
-
}
|
|
1891
|
-
toRulesyncIgnore() {
|
|
1892
|
-
return this.toRulesyncIgnoreDefault();
|
|
1893
|
-
}
|
|
1894
|
-
static fromRulesyncIgnore({
|
|
1895
|
-
baseDir = ".",
|
|
1896
|
-
rulesyncIgnore
|
|
1897
|
-
}) {
|
|
1898
|
-
const fileContent = rulesyncIgnore.getFileContent();
|
|
1899
|
-
return new _CodexcliIgnore({
|
|
1900
|
-
baseDir,
|
|
1901
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1902
|
-
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1903
|
-
fileContent,
|
|
1904
|
-
validate: true
|
|
1905
|
-
// Skip validation to allow empty patterns
|
|
1906
|
-
});
|
|
1907
|
-
}
|
|
1908
|
-
static async fromFile({
|
|
1909
|
-
baseDir = ".",
|
|
1910
|
-
validate = true
|
|
1911
|
-
}) {
|
|
1912
|
-
const fileContent = await readFileContent(
|
|
1913
|
-
(0, import_node_path17.join)(
|
|
1914
|
-
baseDir,
|
|
1915
|
-
this.getSettablePaths().relativeDirPath,
|
|
1916
|
-
this.getSettablePaths().relativeFilePath
|
|
1917
|
-
)
|
|
1918
|
-
);
|
|
1919
|
-
return new _CodexcliIgnore({
|
|
1920
|
-
baseDir,
|
|
1921
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1922
|
-
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1923
|
-
fileContent,
|
|
1924
|
-
validate
|
|
1925
|
-
});
|
|
1926
|
-
}
|
|
1927
|
-
};
|
|
1928
|
-
|
|
1929
1917
|
// src/ignore/cursor-ignore.ts
|
|
1930
|
-
var
|
|
1918
|
+
var import_node_path17 = require("path");
|
|
1931
1919
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
1932
1920
|
static getSettablePaths() {
|
|
1933
1921
|
return {
|
|
@@ -1960,7 +1948,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1960
1948
|
validate = true
|
|
1961
1949
|
}) {
|
|
1962
1950
|
const fileContent = await readFileContent(
|
|
1963
|
-
(0,
|
|
1951
|
+
(0, import_node_path17.join)(
|
|
1964
1952
|
baseDir,
|
|
1965
1953
|
this.getSettablePaths().relativeDirPath,
|
|
1966
1954
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1977,7 +1965,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1977
1965
|
};
|
|
1978
1966
|
|
|
1979
1967
|
// src/ignore/geminicli-ignore.ts
|
|
1980
|
-
var
|
|
1968
|
+
var import_node_path18 = require("path");
|
|
1981
1969
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
1982
1970
|
static getSettablePaths() {
|
|
1983
1971
|
return {
|
|
@@ -2004,7 +1992,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2004
1992
|
validate = true
|
|
2005
1993
|
}) {
|
|
2006
1994
|
const fileContent = await readFileContent(
|
|
2007
|
-
(0,
|
|
1995
|
+
(0, import_node_path18.join)(
|
|
2008
1996
|
baseDir,
|
|
2009
1997
|
this.getSettablePaths().relativeDirPath,
|
|
2010
1998
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2021,7 +2009,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2021
2009
|
};
|
|
2022
2010
|
|
|
2023
2011
|
// src/ignore/junie-ignore.ts
|
|
2024
|
-
var
|
|
2012
|
+
var import_node_path19 = require("path");
|
|
2025
2013
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2026
2014
|
static getSettablePaths() {
|
|
2027
2015
|
return {
|
|
@@ -2048,7 +2036,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2048
2036
|
validate = true
|
|
2049
2037
|
}) {
|
|
2050
2038
|
const fileContent = await readFileContent(
|
|
2051
|
-
(0,
|
|
2039
|
+
(0, import_node_path19.join)(
|
|
2052
2040
|
baseDir,
|
|
2053
2041
|
this.getSettablePaths().relativeDirPath,
|
|
2054
2042
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2065,7 +2053,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2065
2053
|
};
|
|
2066
2054
|
|
|
2067
2055
|
// src/ignore/kiro-ignore.ts
|
|
2068
|
-
var
|
|
2056
|
+
var import_node_path20 = require("path");
|
|
2069
2057
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2070
2058
|
static getSettablePaths() {
|
|
2071
2059
|
return {
|
|
@@ -2092,7 +2080,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2092
2080
|
validate = true
|
|
2093
2081
|
}) {
|
|
2094
2082
|
const fileContent = await readFileContent(
|
|
2095
|
-
(0,
|
|
2083
|
+
(0, import_node_path20.join)(
|
|
2096
2084
|
baseDir,
|
|
2097
2085
|
this.getSettablePaths().relativeDirPath,
|
|
2098
2086
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2109,7 +2097,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2109
2097
|
};
|
|
2110
2098
|
|
|
2111
2099
|
// src/ignore/qwencode-ignore.ts
|
|
2112
|
-
var
|
|
2100
|
+
var import_node_path21 = require("path");
|
|
2113
2101
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2114
2102
|
static getSettablePaths() {
|
|
2115
2103
|
return {
|
|
@@ -2136,7 +2124,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2136
2124
|
validate = true
|
|
2137
2125
|
}) {
|
|
2138
2126
|
const fileContent = await readFileContent(
|
|
2139
|
-
(0,
|
|
2127
|
+
(0, import_node_path21.join)(
|
|
2140
2128
|
baseDir,
|
|
2141
2129
|
this.getSettablePaths().relativeDirPath,
|
|
2142
2130
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2153,7 +2141,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2153
2141
|
};
|
|
2154
2142
|
|
|
2155
2143
|
// src/ignore/roo-ignore.ts
|
|
2156
|
-
var
|
|
2144
|
+
var import_node_path22 = require("path");
|
|
2157
2145
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2158
2146
|
static getSettablePaths() {
|
|
2159
2147
|
return {
|
|
@@ -2180,7 +2168,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2180
2168
|
validate = true
|
|
2181
2169
|
}) {
|
|
2182
2170
|
const fileContent = await readFileContent(
|
|
2183
|
-
(0,
|
|
2171
|
+
(0, import_node_path22.join)(
|
|
2184
2172
|
baseDir,
|
|
2185
2173
|
this.getSettablePaths().relativeDirPath,
|
|
2186
2174
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2197,7 +2185,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2197
2185
|
};
|
|
2198
2186
|
|
|
2199
2187
|
// src/ignore/windsurf-ignore.ts
|
|
2200
|
-
var
|
|
2188
|
+
var import_node_path23 = require("path");
|
|
2201
2189
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2202
2190
|
static getSettablePaths() {
|
|
2203
2191
|
return {
|
|
@@ -2224,7 +2212,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2224
2212
|
validate = true
|
|
2225
2213
|
}) {
|
|
2226
2214
|
const fileContent = await readFileContent(
|
|
2227
|
-
(0,
|
|
2215
|
+
(0, import_node_path23.join)(
|
|
2228
2216
|
baseDir,
|
|
2229
2217
|
this.getSettablePaths().relativeDirPath,
|
|
2230
2218
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2246,7 +2234,6 @@ var ignoreProcessorToolTargets = [
|
|
|
2246
2234
|
"augmentcode",
|
|
2247
2235
|
"claudecode",
|
|
2248
2236
|
"cline",
|
|
2249
|
-
"codexcli",
|
|
2250
2237
|
"cursor",
|
|
2251
2238
|
"geminicli",
|
|
2252
2239
|
"junie",
|
|
@@ -2304,8 +2291,6 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2304
2291
|
return [await ClaudecodeIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2305
2292
|
case "cline":
|
|
2306
2293
|
return [await ClineIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2307
|
-
case "codexcli":
|
|
2308
|
-
return [await CodexcliIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2309
2294
|
case "cursor":
|
|
2310
2295
|
return [await CursorIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2311
2296
|
case "geminicli":
|
|
@@ -2363,11 +2348,6 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2363
2348
|
baseDir: this.baseDir,
|
|
2364
2349
|
rulesyncIgnore: rulesyncIgnore2
|
|
2365
2350
|
});
|
|
2366
|
-
case "codexcli":
|
|
2367
|
-
return CodexcliIgnore.fromRulesyncIgnore({
|
|
2368
|
-
baseDir: this.baseDir,
|
|
2369
|
-
rulesyncIgnore: rulesyncIgnore2
|
|
2370
|
-
});
|
|
2371
2351
|
case "cursor":
|
|
2372
2352
|
return CursorIgnore.fromRulesyncIgnore({
|
|
2373
2353
|
baseDir: this.baseDir,
|
|
@@ -2434,10 +2414,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2434
2414
|
var import_mini11 = require("zod/mini");
|
|
2435
2415
|
|
|
2436
2416
|
// src/mcp/amazonqcli-mcp.ts
|
|
2437
|
-
var
|
|
2417
|
+
var import_node_path25 = require("path");
|
|
2438
2418
|
|
|
2439
2419
|
// src/mcp/rulesync-mcp.ts
|
|
2440
|
-
var
|
|
2420
|
+
var import_node_path24 = require("path");
|
|
2441
2421
|
var import_mini10 = require("zod/mini");
|
|
2442
2422
|
var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
|
|
2443
2423
|
var McpServerBaseSchema = import_mini10.z.object({
|
|
@@ -2488,7 +2468,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2488
2468
|
}
|
|
2489
2469
|
static async fromFile({ validate = true }) {
|
|
2490
2470
|
const fileContent = await readFileContent(
|
|
2491
|
-
(0,
|
|
2471
|
+
(0, import_node_path24.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
|
|
2492
2472
|
);
|
|
2493
2473
|
return new _RulesyncMcp({
|
|
2494
2474
|
baseDir: ".",
|
|
@@ -2555,7 +2535,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2555
2535
|
validate = true
|
|
2556
2536
|
}) {
|
|
2557
2537
|
const fileContent = await readFileContent(
|
|
2558
|
-
(0,
|
|
2538
|
+
(0, import_node_path25.join)(
|
|
2559
2539
|
baseDir,
|
|
2560
2540
|
this.getSettablePaths().relativeDirPath,
|
|
2561
2541
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2591,7 +2571,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2591
2571
|
};
|
|
2592
2572
|
|
|
2593
2573
|
// src/mcp/claudecode-mcp.ts
|
|
2594
|
-
var
|
|
2574
|
+
var import_node_path26 = require("path");
|
|
2595
2575
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
2596
2576
|
static getSettablePaths() {
|
|
2597
2577
|
return {
|
|
@@ -2604,7 +2584,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2604
2584
|
validate = true
|
|
2605
2585
|
}) {
|
|
2606
2586
|
const fileContent = await readFileContent(
|
|
2607
|
-
(0,
|
|
2587
|
+
(0, import_node_path26.join)(
|
|
2608
2588
|
baseDir,
|
|
2609
2589
|
this.getSettablePaths().relativeDirPath,
|
|
2610
2590
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2640,7 +2620,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2640
2620
|
};
|
|
2641
2621
|
|
|
2642
2622
|
// src/mcp/cline-mcp.ts
|
|
2643
|
-
var
|
|
2623
|
+
var import_node_path27 = require("path");
|
|
2644
2624
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
2645
2625
|
static getSettablePaths() {
|
|
2646
2626
|
return {
|
|
@@ -2653,7 +2633,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2653
2633
|
validate = true
|
|
2654
2634
|
}) {
|
|
2655
2635
|
const fileContent = await readFileContent(
|
|
2656
|
-
(0,
|
|
2636
|
+
(0, import_node_path27.join)(
|
|
2657
2637
|
baseDir,
|
|
2658
2638
|
this.getSettablePaths().relativeDirPath,
|
|
2659
2639
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2689,7 +2669,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2689
2669
|
};
|
|
2690
2670
|
|
|
2691
2671
|
// src/mcp/copilot-mcp.ts
|
|
2692
|
-
var
|
|
2672
|
+
var import_node_path28 = require("path");
|
|
2693
2673
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
2694
2674
|
static getSettablePaths() {
|
|
2695
2675
|
return {
|
|
@@ -2702,7 +2682,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2702
2682
|
validate = true
|
|
2703
2683
|
}) {
|
|
2704
2684
|
const fileContent = await readFileContent(
|
|
2705
|
-
(0,
|
|
2685
|
+
(0, import_node_path28.join)(
|
|
2706
2686
|
baseDir,
|
|
2707
2687
|
this.getSettablePaths().relativeDirPath,
|
|
2708
2688
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2738,7 +2718,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2738
2718
|
};
|
|
2739
2719
|
|
|
2740
2720
|
// src/mcp/cursor-mcp.ts
|
|
2741
|
-
var
|
|
2721
|
+
var import_node_path29 = require("path");
|
|
2742
2722
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
2743
2723
|
static getSettablePaths() {
|
|
2744
2724
|
return {
|
|
@@ -2751,7 +2731,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2751
2731
|
validate = true
|
|
2752
2732
|
}) {
|
|
2753
2733
|
const fileContent = await readFileContent(
|
|
2754
|
-
(0,
|
|
2734
|
+
(0, import_node_path29.join)(
|
|
2755
2735
|
baseDir,
|
|
2756
2736
|
this.getSettablePaths().relativeDirPath,
|
|
2757
2737
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2798,7 +2778,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2798
2778
|
};
|
|
2799
2779
|
|
|
2800
2780
|
// src/mcp/roo-mcp.ts
|
|
2801
|
-
var
|
|
2781
|
+
var import_node_path30 = require("path");
|
|
2802
2782
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
2803
2783
|
static getSettablePaths() {
|
|
2804
2784
|
return {
|
|
@@ -2811,7 +2791,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
2811
2791
|
validate = true
|
|
2812
2792
|
}) {
|
|
2813
2793
|
const fileContent = await readFileContent(
|
|
2814
|
-
(0,
|
|
2794
|
+
(0, import_node_path30.join)(
|
|
2815
2795
|
baseDir,
|
|
2816
2796
|
this.getSettablePaths().relativeDirPath,
|
|
2817
2797
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3018,12 +2998,12 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3018
2998
|
};
|
|
3019
2999
|
|
|
3020
3000
|
// src/rules/rules-processor.ts
|
|
3021
|
-
var
|
|
3001
|
+
var import_node_path54 = require("path");
|
|
3022
3002
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3023
3003
|
var import_mini20 = require("zod/mini");
|
|
3024
3004
|
|
|
3025
3005
|
// src/subagents/simulated-subagent.ts
|
|
3026
|
-
var
|
|
3006
|
+
var import_node_path31 = require("path");
|
|
3027
3007
|
var import_mini12 = require("zod/mini");
|
|
3028
3008
|
|
|
3029
3009
|
// src/subagents/tool-subagent.ts
|
|
@@ -3125,7 +3105,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3125
3105
|
relativeFilePath,
|
|
3126
3106
|
validate = true
|
|
3127
3107
|
}) {
|
|
3128
|
-
const filePath = (0,
|
|
3108
|
+
const filePath = (0, import_node_path31.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
3129
3109
|
const fileContent = await readFileContent(filePath);
|
|
3130
3110
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3131
3111
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3135,7 +3115,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3135
3115
|
return {
|
|
3136
3116
|
baseDir,
|
|
3137
3117
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
3138
|
-
relativeFilePath: (0,
|
|
3118
|
+
relativeFilePath: (0, import_node_path31.basename)(relativeFilePath),
|
|
3139
3119
|
frontmatter: result.data,
|
|
3140
3120
|
body: content.trim(),
|
|
3141
3121
|
validate
|
|
@@ -3259,15 +3239,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3259
3239
|
};
|
|
3260
3240
|
|
|
3261
3241
|
// src/subagents/subagents-processor.ts
|
|
3262
|
-
var
|
|
3242
|
+
var import_node_path34 = require("path");
|
|
3263
3243
|
var import_mini15 = require("zod/mini");
|
|
3264
3244
|
|
|
3265
3245
|
// src/subagents/claudecode-subagent.ts
|
|
3266
|
-
var
|
|
3246
|
+
var import_node_path33 = require("path");
|
|
3267
3247
|
var import_mini14 = require("zod/mini");
|
|
3268
3248
|
|
|
3269
3249
|
// src/subagents/rulesync-subagent.ts
|
|
3270
|
-
var
|
|
3250
|
+
var import_node_path32 = require("path");
|
|
3271
3251
|
var import_mini13 = require("zod/mini");
|
|
3272
3252
|
var RulesyncSubagentModelSchema = import_mini13.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3273
3253
|
var RulesyncSubagentFrontmatterSchema = import_mini13.z.object({
|
|
@@ -3321,13 +3301,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3321
3301
|
static async fromFile({
|
|
3322
3302
|
relativeFilePath
|
|
3323
3303
|
}) {
|
|
3324
|
-
const fileContent = await readFileContent((0,
|
|
3304
|
+
const fileContent = await readFileContent((0, import_node_path32.join)(".rulesync/subagents", relativeFilePath));
|
|
3325
3305
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3326
3306
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3327
3307
|
if (!result.success) {
|
|
3328
3308
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
|
|
3329
3309
|
}
|
|
3330
|
-
const filename = (0,
|
|
3310
|
+
const filename = (0, import_node_path32.basename)(relativeFilePath);
|
|
3331
3311
|
return new _RulesyncSubagent({
|
|
3332
3312
|
baseDir: ".",
|
|
3333
3313
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -3439,7 +3419,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3439
3419
|
relativeFilePath,
|
|
3440
3420
|
validate = true
|
|
3441
3421
|
}) {
|
|
3442
|
-
const fileContent = await readFileContent((0,
|
|
3422
|
+
const fileContent = await readFileContent((0, import_node_path33.join)(baseDir, ".claude/agents", relativeFilePath));
|
|
3443
3423
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3444
3424
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3445
3425
|
if (!result.success) {
|
|
@@ -3570,7 +3550,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3570
3550
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
3571
3551
|
*/
|
|
3572
3552
|
async loadRulesyncFiles() {
|
|
3573
|
-
const subagentsDir = (0,
|
|
3553
|
+
const subagentsDir = (0, import_node_path34.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
3574
3554
|
const dirExists = await directoryExists(subagentsDir);
|
|
3575
3555
|
if (!dirExists) {
|
|
3576
3556
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -3585,7 +3565,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3585
3565
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
3586
3566
|
const rulesyncSubagents = [];
|
|
3587
3567
|
for (const mdFile of mdFiles) {
|
|
3588
|
-
const filepath = (0,
|
|
3568
|
+
const filepath = (0, import_node_path34.join)(subagentsDir, mdFile);
|
|
3589
3569
|
try {
|
|
3590
3570
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
3591
3571
|
relativeFilePath: mdFile,
|
|
@@ -3688,8 +3668,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3688
3668
|
relativeDirPath,
|
|
3689
3669
|
fromFile
|
|
3690
3670
|
}) {
|
|
3691
|
-
const paths = await findFilesByGlobs((0,
|
|
3692
|
-
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0,
|
|
3671
|
+
const paths = await findFilesByGlobs((0, import_node_path34.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
3672
|
+
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path34.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
3693
3673
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
3694
3674
|
return subagents;
|
|
3695
3675
|
}
|
|
@@ -3713,13 +3693,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3713
3693
|
};
|
|
3714
3694
|
|
|
3715
3695
|
// src/rules/agentsmd-rule.ts
|
|
3716
|
-
var
|
|
3696
|
+
var import_node_path37 = require("path");
|
|
3717
3697
|
|
|
3718
3698
|
// src/rules/tool-rule.ts
|
|
3719
|
-
var
|
|
3699
|
+
var import_node_path36 = require("path");
|
|
3720
3700
|
|
|
3721
3701
|
// src/rules/rulesync-rule.ts
|
|
3722
|
-
var
|
|
3702
|
+
var import_node_path35 = require("path");
|
|
3723
3703
|
var import_mini16 = require("zod/mini");
|
|
3724
3704
|
var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
|
|
3725
3705
|
root: import_mini16.z.optional(import_mini16.z.optional(import_mini16.z.boolean())),
|
|
@@ -3785,7 +3765,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3785
3765
|
relativeFilePath,
|
|
3786
3766
|
validate = true
|
|
3787
3767
|
}) {
|
|
3788
|
-
const filePath = (0,
|
|
3768
|
+
const filePath = (0, import_node_path35.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
3789
3769
|
const fileContent = await readFileContent(filePath);
|
|
3790
3770
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3791
3771
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3800,7 +3780,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3800
3780
|
agentsmd: result.data.agentsmd,
|
|
3801
3781
|
cursor: result.data.cursor
|
|
3802
3782
|
};
|
|
3803
|
-
const filename = (0,
|
|
3783
|
+
const filename = (0, import_node_path35.basename)(filePath);
|
|
3804
3784
|
return new _RulesyncRule({
|
|
3805
3785
|
baseDir: ".",
|
|
3806
3786
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3814,7 +3794,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3814
3794
|
relativeFilePath,
|
|
3815
3795
|
validate = true
|
|
3816
3796
|
}) {
|
|
3817
|
-
const filePath = (0,
|
|
3797
|
+
const filePath = (0, import_node_path35.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
3818
3798
|
const fileContent = await readFileContent(filePath);
|
|
3819
3799
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3820
3800
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3829,7 +3809,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3829
3809
|
agentsmd: result.data.agentsmd,
|
|
3830
3810
|
cursor: result.data.cursor
|
|
3831
3811
|
};
|
|
3832
|
-
const filename = (0,
|
|
3812
|
+
const filename = (0, import_node_path35.basename)(filePath);
|
|
3833
3813
|
return new _RulesyncRule({
|
|
3834
3814
|
baseDir: ".",
|
|
3835
3815
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3918,7 +3898,7 @@ var ToolRule = class extends ToolFile {
|
|
|
3918
3898
|
});
|
|
3919
3899
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3920
3900
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3921
|
-
params.relativeDirPath = (0,
|
|
3901
|
+
params.relativeDirPath = (0, import_node_path36.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3922
3902
|
params.relativeFilePath = "AGENTS.md";
|
|
3923
3903
|
}
|
|
3924
3904
|
return params;
|
|
@@ -3994,8 +3974,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3994
3974
|
validate = true
|
|
3995
3975
|
}) {
|
|
3996
3976
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3997
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
3998
|
-
const fileContent = await readFileContent((0,
|
|
3977
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path37.join)(".agents/memories", relativeFilePath);
|
|
3978
|
+
const fileContent = await readFileContent((0, import_node_path37.join)(baseDir, relativePath));
|
|
3999
3979
|
return new _AgentsMdRule({
|
|
4000
3980
|
baseDir,
|
|
4001
3981
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4035,7 +4015,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4035
4015
|
};
|
|
4036
4016
|
|
|
4037
4017
|
// src/rules/amazonqcli-rule.ts
|
|
4038
|
-
var
|
|
4018
|
+
var import_node_path38 = require("path");
|
|
4039
4019
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4040
4020
|
static getSettablePaths() {
|
|
4041
4021
|
return {
|
|
@@ -4050,7 +4030,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4050
4030
|
validate = true
|
|
4051
4031
|
}) {
|
|
4052
4032
|
const fileContent = await readFileContent(
|
|
4053
|
-
(0,
|
|
4033
|
+
(0, import_node_path38.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4054
4034
|
);
|
|
4055
4035
|
return new _AmazonQCliRule({
|
|
4056
4036
|
baseDir,
|
|
@@ -4090,7 +4070,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4090
4070
|
};
|
|
4091
4071
|
|
|
4092
4072
|
// src/rules/augmentcode-legacy-rule.ts
|
|
4093
|
-
var
|
|
4073
|
+
var import_node_path39 = require("path");
|
|
4094
4074
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4095
4075
|
toRulesyncRule() {
|
|
4096
4076
|
const rulesyncFrontmatter = {
|
|
@@ -4151,8 +4131,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4151
4131
|
}) {
|
|
4152
4132
|
const settablePaths = this.getSettablePaths();
|
|
4153
4133
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
4154
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
4155
|
-
const fileContent = await readFileContent((0,
|
|
4134
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path39.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4135
|
+
const fileContent = await readFileContent((0, import_node_path39.join)(baseDir, relativePath));
|
|
4156
4136
|
return new _AugmentcodeLegacyRule({
|
|
4157
4137
|
baseDir,
|
|
4158
4138
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -4165,7 +4145,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4165
4145
|
};
|
|
4166
4146
|
|
|
4167
4147
|
// src/rules/augmentcode-rule.ts
|
|
4168
|
-
var
|
|
4148
|
+
var import_node_path40 = require("path");
|
|
4169
4149
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
4170
4150
|
toRulesyncRule() {
|
|
4171
4151
|
return this.toRulesyncRuleDefault();
|
|
@@ -4197,7 +4177,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4197
4177
|
validate = true
|
|
4198
4178
|
}) {
|
|
4199
4179
|
const fileContent = await readFileContent(
|
|
4200
|
-
(0,
|
|
4180
|
+
(0, import_node_path40.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4201
4181
|
);
|
|
4202
4182
|
const { body: content } = parseFrontmatter(fileContent);
|
|
4203
4183
|
return new _AugmentcodeRule({
|
|
@@ -4220,7 +4200,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4220
4200
|
};
|
|
4221
4201
|
|
|
4222
4202
|
// src/rules/claudecode-rule.ts
|
|
4223
|
-
var
|
|
4203
|
+
var import_node_path41 = require("path");
|
|
4224
4204
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4225
4205
|
static getSettablePaths() {
|
|
4226
4206
|
return {
|
|
@@ -4229,7 +4209,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4229
4209
|
relativeFilePath: "CLAUDE.md"
|
|
4230
4210
|
},
|
|
4231
4211
|
nonRoot: {
|
|
4232
|
-
relativeDirPath: (0,
|
|
4212
|
+
relativeDirPath: (0, import_node_path41.join)(".claude", "memories")
|
|
4233
4213
|
}
|
|
4234
4214
|
};
|
|
4235
4215
|
}
|
|
@@ -4252,7 +4232,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4252
4232
|
if (isRoot) {
|
|
4253
4233
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4254
4234
|
const fileContent2 = await readFileContent(
|
|
4255
|
-
(0,
|
|
4235
|
+
(0, import_node_path41.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4256
4236
|
);
|
|
4257
4237
|
return new _ClaudecodeRule({
|
|
4258
4238
|
baseDir,
|
|
@@ -4266,8 +4246,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4266
4246
|
if (!paths.nonRoot) {
|
|
4267
4247
|
throw new Error("nonRoot path is not set");
|
|
4268
4248
|
}
|
|
4269
|
-
const relativePath = (0,
|
|
4270
|
-
const fileContent = await readFileContent((0,
|
|
4249
|
+
const relativePath = (0, import_node_path41.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4250
|
+
const fileContent = await readFileContent((0, import_node_path41.join)(baseDir, relativePath));
|
|
4271
4251
|
return new _ClaudecodeRule({
|
|
4272
4252
|
baseDir,
|
|
4273
4253
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4309,7 +4289,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4309
4289
|
};
|
|
4310
4290
|
|
|
4311
4291
|
// src/rules/cline-rule.ts
|
|
4312
|
-
var
|
|
4292
|
+
var import_node_path42 = require("path");
|
|
4313
4293
|
var import_mini17 = require("zod/mini");
|
|
4314
4294
|
var ClineRuleFrontmatterSchema = import_mini17.z.object({
|
|
4315
4295
|
description: import_mini17.z.string()
|
|
@@ -4354,7 +4334,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4354
4334
|
validate = true
|
|
4355
4335
|
}) {
|
|
4356
4336
|
const fileContent = await readFileContent(
|
|
4357
|
-
(0,
|
|
4337
|
+
(0, import_node_path42.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4358
4338
|
);
|
|
4359
4339
|
return new _ClineRule({
|
|
4360
4340
|
baseDir,
|
|
@@ -4367,7 +4347,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4367
4347
|
};
|
|
4368
4348
|
|
|
4369
4349
|
// src/rules/codexcli-rule.ts
|
|
4370
|
-
var
|
|
4350
|
+
var import_node_path43 = require("path");
|
|
4371
4351
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4372
4352
|
static getSettablePaths() {
|
|
4373
4353
|
return {
|
|
@@ -4399,7 +4379,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4399
4379
|
if (isRoot) {
|
|
4400
4380
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4401
4381
|
const fileContent2 = await readFileContent(
|
|
4402
|
-
(0,
|
|
4382
|
+
(0, import_node_path43.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4403
4383
|
);
|
|
4404
4384
|
return new _CodexcliRule({
|
|
4405
4385
|
baseDir,
|
|
@@ -4413,8 +4393,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4413
4393
|
if (!paths.nonRoot) {
|
|
4414
4394
|
throw new Error("nonRoot path is not set");
|
|
4415
4395
|
}
|
|
4416
|
-
const relativePath = (0,
|
|
4417
|
-
const fileContent = await readFileContent((0,
|
|
4396
|
+
const relativePath = (0, import_node_path43.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4397
|
+
const fileContent = await readFileContent((0, import_node_path43.join)(baseDir, relativePath));
|
|
4418
4398
|
return new _CodexcliRule({
|
|
4419
4399
|
baseDir,
|
|
4420
4400
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4456,7 +4436,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4456
4436
|
};
|
|
4457
4437
|
|
|
4458
4438
|
// src/rules/copilot-rule.ts
|
|
4459
|
-
var
|
|
4439
|
+
var import_node_path44 = require("path");
|
|
4460
4440
|
var import_mini18 = require("zod/mini");
|
|
4461
4441
|
var CopilotRuleFrontmatterSchema = import_mini18.z.object({
|
|
4462
4442
|
description: import_mini18.z.optional(import_mini18.z.string()),
|
|
@@ -4549,11 +4529,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4549
4529
|
validate = true
|
|
4550
4530
|
}) {
|
|
4551
4531
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4552
|
-
const relativePath = isRoot ? (0,
|
|
4532
|
+
const relativePath = isRoot ? (0, import_node_path44.join)(
|
|
4553
4533
|
this.getSettablePaths().root.relativeDirPath,
|
|
4554
4534
|
this.getSettablePaths().root.relativeFilePath
|
|
4555
|
-
) : (0,
|
|
4556
|
-
const fileContent = await readFileContent((0,
|
|
4535
|
+
) : (0, import_node_path44.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4536
|
+
const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
|
|
4557
4537
|
if (isRoot) {
|
|
4558
4538
|
return new _CopilotRule({
|
|
4559
4539
|
baseDir,
|
|
@@ -4572,7 +4552,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4572
4552
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4573
4553
|
if (!result.success) {
|
|
4574
4554
|
throw new Error(
|
|
4575
|
-
`Invalid frontmatter in ${(0,
|
|
4555
|
+
`Invalid frontmatter in ${(0, import_node_path44.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4576
4556
|
);
|
|
4577
4557
|
}
|
|
4578
4558
|
return new _CopilotRule({
|
|
@@ -4611,7 +4591,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4611
4591
|
};
|
|
4612
4592
|
|
|
4613
4593
|
// src/rules/cursor-rule.ts
|
|
4614
|
-
var
|
|
4594
|
+
var import_node_path45 = require("path");
|
|
4615
4595
|
var import_mini19 = require("zod/mini");
|
|
4616
4596
|
var CursorRuleFrontmatterSchema = import_mini19.z.object({
|
|
4617
4597
|
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
@@ -4738,19 +4718,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4738
4718
|
validate = true
|
|
4739
4719
|
}) {
|
|
4740
4720
|
const fileContent = await readFileContent(
|
|
4741
|
-
(0,
|
|
4721
|
+
(0, import_node_path45.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4742
4722
|
);
|
|
4743
4723
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4744
4724
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4745
4725
|
if (!result.success) {
|
|
4746
4726
|
throw new Error(
|
|
4747
|
-
`Invalid frontmatter in ${(0,
|
|
4727
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4748
4728
|
);
|
|
4749
4729
|
}
|
|
4750
4730
|
return new _CursorRule({
|
|
4751
4731
|
baseDir,
|
|
4752
4732
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
4753
|
-
relativeFilePath: (0,
|
|
4733
|
+
relativeFilePath: (0, import_node_path45.basename)(relativeFilePath),
|
|
4754
4734
|
frontmatter: result.data,
|
|
4755
4735
|
body: content.trim(),
|
|
4756
4736
|
validate
|
|
@@ -4782,7 +4762,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4782
4762
|
};
|
|
4783
4763
|
|
|
4784
4764
|
// src/rules/geminicli-rule.ts
|
|
4785
|
-
var
|
|
4765
|
+
var import_node_path46 = require("path");
|
|
4786
4766
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4787
4767
|
static getSettablePaths() {
|
|
4788
4768
|
return {
|
|
@@ -4814,7 +4794,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4814
4794
|
if (isRoot) {
|
|
4815
4795
|
const relativePath2 = paths.root.relativeFilePath;
|
|
4816
4796
|
const fileContent2 = await readFileContent(
|
|
4817
|
-
(0,
|
|
4797
|
+
(0, import_node_path46.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
4818
4798
|
);
|
|
4819
4799
|
return new _GeminiCliRule({
|
|
4820
4800
|
baseDir,
|
|
@@ -4828,8 +4808,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4828
4808
|
if (!paths.nonRoot) {
|
|
4829
4809
|
throw new Error("nonRoot path is not set");
|
|
4830
4810
|
}
|
|
4831
|
-
const relativePath = (0,
|
|
4832
|
-
const fileContent = await readFileContent((0,
|
|
4811
|
+
const relativePath = (0, import_node_path46.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4812
|
+
const fileContent = await readFileContent((0, import_node_path46.join)(baseDir, relativePath));
|
|
4833
4813
|
return new _GeminiCliRule({
|
|
4834
4814
|
baseDir,
|
|
4835
4815
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -4871,7 +4851,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4871
4851
|
};
|
|
4872
4852
|
|
|
4873
4853
|
// src/rules/junie-rule.ts
|
|
4874
|
-
var
|
|
4854
|
+
var import_node_path47 = require("path");
|
|
4875
4855
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4876
4856
|
static getSettablePaths() {
|
|
4877
4857
|
return {
|
|
@@ -4890,8 +4870,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4890
4870
|
validate = true
|
|
4891
4871
|
}) {
|
|
4892
4872
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4893
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
4894
|
-
const fileContent = await readFileContent((0,
|
|
4873
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path47.join)(".junie/memories", relativeFilePath);
|
|
4874
|
+
const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
|
|
4895
4875
|
return new _JunieRule({
|
|
4896
4876
|
baseDir,
|
|
4897
4877
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4931,7 +4911,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4931
4911
|
};
|
|
4932
4912
|
|
|
4933
4913
|
// src/rules/kiro-rule.ts
|
|
4934
|
-
var
|
|
4914
|
+
var import_node_path48 = require("path");
|
|
4935
4915
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4936
4916
|
static getSettablePaths() {
|
|
4937
4917
|
return {
|
|
@@ -4946,7 +4926,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4946
4926
|
validate = true
|
|
4947
4927
|
}) {
|
|
4948
4928
|
const fileContent = await readFileContent(
|
|
4949
|
-
(0,
|
|
4929
|
+
(0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4950
4930
|
);
|
|
4951
4931
|
return new _KiroRule({
|
|
4952
4932
|
baseDir,
|
|
@@ -4986,7 +4966,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4986
4966
|
};
|
|
4987
4967
|
|
|
4988
4968
|
// src/rules/opencode-rule.ts
|
|
4989
|
-
var
|
|
4969
|
+
var import_node_path49 = require("path");
|
|
4990
4970
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4991
4971
|
static getSettablePaths() {
|
|
4992
4972
|
return {
|
|
@@ -5005,8 +4985,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5005
4985
|
validate = true
|
|
5006
4986
|
}) {
|
|
5007
4987
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
5008
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
5009
|
-
const fileContent = await readFileContent((0,
|
|
4988
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path49.join)(".opencode/memories", relativeFilePath);
|
|
4989
|
+
const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
|
|
5010
4990
|
return new _OpenCodeRule({
|
|
5011
4991
|
baseDir,
|
|
5012
4992
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5046,7 +5026,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5046
5026
|
};
|
|
5047
5027
|
|
|
5048
5028
|
// src/rules/qwencode-rule.ts
|
|
5049
|
-
var
|
|
5029
|
+
var import_node_path50 = require("path");
|
|
5050
5030
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5051
5031
|
static getSettablePaths() {
|
|
5052
5032
|
return {
|
|
@@ -5065,8 +5045,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5065
5045
|
validate = true
|
|
5066
5046
|
}) {
|
|
5067
5047
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5068
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
5069
|
-
const fileContent = await readFileContent((0,
|
|
5048
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path50.join)(".qwen/memories", relativeFilePath);
|
|
5049
|
+
const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
|
|
5070
5050
|
return new _QwencodeRule({
|
|
5071
5051
|
baseDir,
|
|
5072
5052
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5103,7 +5083,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5103
5083
|
};
|
|
5104
5084
|
|
|
5105
5085
|
// src/rules/roo-rule.ts
|
|
5106
|
-
var
|
|
5086
|
+
var import_node_path51 = require("path");
|
|
5107
5087
|
var RooRule = class _RooRule extends ToolRule {
|
|
5108
5088
|
static getSettablePaths() {
|
|
5109
5089
|
return {
|
|
@@ -5118,7 +5098,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5118
5098
|
validate = true
|
|
5119
5099
|
}) {
|
|
5120
5100
|
const fileContent = await readFileContent(
|
|
5121
|
-
(0,
|
|
5101
|
+
(0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5122
5102
|
);
|
|
5123
5103
|
return new _RooRule({
|
|
5124
5104
|
baseDir,
|
|
@@ -5173,7 +5153,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
5173
5153
|
};
|
|
5174
5154
|
|
|
5175
5155
|
// src/rules/warp-rule.ts
|
|
5176
|
-
var
|
|
5156
|
+
var import_node_path52 = require("path");
|
|
5177
5157
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
5178
5158
|
constructor({ fileContent, root, ...rest }) {
|
|
5179
5159
|
super({
|
|
@@ -5199,8 +5179,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5199
5179
|
validate = true
|
|
5200
5180
|
}) {
|
|
5201
5181
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
5202
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
5203
|
-
const fileContent = await readFileContent((0,
|
|
5182
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path52.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5183
|
+
const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
|
|
5204
5184
|
return new _WarpRule({
|
|
5205
5185
|
baseDir,
|
|
5206
5186
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -5240,7 +5220,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
5240
5220
|
};
|
|
5241
5221
|
|
|
5242
5222
|
// src/rules/windsurf-rule.ts
|
|
5243
|
-
var
|
|
5223
|
+
var import_node_path53 = require("path");
|
|
5244
5224
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
5245
5225
|
static getSettablePaths() {
|
|
5246
5226
|
return {
|
|
@@ -5255,7 +5235,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
5255
5235
|
validate = true
|
|
5256
5236
|
}) {
|
|
5257
5237
|
const fileContent = await readFileContent(
|
|
5258
|
-
(0,
|
|
5238
|
+
(0, import_node_path53.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5259
5239
|
);
|
|
5260
5240
|
return new _WindsurfRule({
|
|
5261
5241
|
baseDir,
|
|
@@ -5569,7 +5549,6 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5569
5549
|
const rootRule = toolRules[rootRuleIndex];
|
|
5570
5550
|
rootRule?.setFileContent(
|
|
5571
5551
|
this.generateXmlReferencesSection(toolRules) + this.generateAdditionalConventionsSection({
|
|
5572
|
-
commands: { relativeDirPath: CodexCliCommand.getSettablePaths().relativeDirPath },
|
|
5573
5552
|
subagents: {
|
|
5574
5553
|
relativeDirPath: CodexCliSubagent.getSettablePaths().relativeDirPath
|
|
5575
5554
|
}
|
|
@@ -5645,10 +5624,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5645
5624
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5646
5625
|
*/
|
|
5647
5626
|
async loadRulesyncFiles() {
|
|
5648
|
-
const files = await findFilesByGlobs((0,
|
|
5627
|
+
const files = await findFilesByGlobs((0, import_node_path54.join)(".rulesync/rules", "*.md"));
|
|
5649
5628
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5650
5629
|
const rulesyncRules = await Promise.all(
|
|
5651
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
5630
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path54.basename)(file) }))
|
|
5652
5631
|
);
|
|
5653
5632
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
5654
5633
|
if (rootRules.length > 1) {
|
|
@@ -5666,10 +5645,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5666
5645
|
return rulesyncRules;
|
|
5667
5646
|
}
|
|
5668
5647
|
async loadRulesyncFilesLegacy() {
|
|
5669
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
5648
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path54.join)(".rulesync", "*.md"));
|
|
5670
5649
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5671
5650
|
return Promise.all(
|
|
5672
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
5651
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path54.basename)(file) }))
|
|
5673
5652
|
);
|
|
5674
5653
|
}
|
|
5675
5654
|
/**
|
|
@@ -5733,13 +5712,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5733
5712
|
return [];
|
|
5734
5713
|
}
|
|
5735
5714
|
const rootFilePaths = await findFilesByGlobs(
|
|
5736
|
-
(0,
|
|
5715
|
+
(0, import_node_path54.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5737
5716
|
);
|
|
5738
5717
|
return await Promise.all(
|
|
5739
5718
|
rootFilePaths.map(
|
|
5740
5719
|
(filePath) => root.fromFile({
|
|
5741
5720
|
baseDir: this.baseDir,
|
|
5742
|
-
relativeFilePath: (0,
|
|
5721
|
+
relativeFilePath: (0, import_node_path54.basename)(filePath),
|
|
5743
5722
|
global: this.global
|
|
5744
5723
|
})
|
|
5745
5724
|
)
|
|
@@ -5751,13 +5730,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5751
5730
|
return [];
|
|
5752
5731
|
}
|
|
5753
5732
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5754
|
-
(0,
|
|
5733
|
+
(0, import_node_path54.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5755
5734
|
);
|
|
5756
5735
|
return await Promise.all(
|
|
5757
5736
|
nonRootFilePaths.map(
|
|
5758
5737
|
(filePath) => nonRoot.fromFile({
|
|
5759
5738
|
baseDir: this.baseDir,
|
|
5760
|
-
relativeFilePath: (0,
|
|
5739
|
+
relativeFilePath: (0, import_node_path54.basename)(filePath),
|
|
5761
5740
|
global: this.global
|
|
5762
5741
|
})
|
|
5763
5742
|
)
|
|
@@ -6112,7 +6091,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6112
6091
|
const overview = `# Additional Conventions Beyond the Built-in Functions
|
|
6113
6092
|
|
|
6114
6093
|
As this project's AI coding tool, you must follow the additional conventions below, in addition to the built-in functions.`;
|
|
6115
|
-
const commandsSection = `## Simulated Custom Slash Commands
|
|
6094
|
+
const commandsSection = commands ? `## Simulated Custom Slash Commands
|
|
6116
6095
|
|
|
6117
6096
|
Custom slash commands allow you to define frequently-used prompts as Markdown files that you can execute.
|
|
6118
6097
|
|
|
@@ -6127,14 +6106,14 @@ s/<command> [arguments]
|
|
|
6127
6106
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
6128
6107
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
6129
6108
|
|
|
6130
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
6131
|
-
const subagentsSection = `## Simulated Subagents
|
|
6109
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path54.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
6110
|
+
const subagentsSection = subagents ? `## Simulated Subagents
|
|
6132
6111
|
|
|
6133
6112
|
Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
|
|
6134
6113
|
|
|
6135
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
6114
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
6136
6115
|
|
|
6137
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
6116
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
6138
6117
|
const result = [
|
|
6139
6118
|
overview,
|
|
6140
6119
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -6359,9 +6338,9 @@ async function generateSubagents(config) {
|
|
|
6359
6338
|
}
|
|
6360
6339
|
|
|
6361
6340
|
// src/cli/commands/gitignore.ts
|
|
6362
|
-
var
|
|
6341
|
+
var import_node_path55 = require("path");
|
|
6363
6342
|
var gitignoreCommand = async () => {
|
|
6364
|
-
const gitignorePath = (0,
|
|
6343
|
+
const gitignorePath = (0, import_node_path55.join)(process.cwd(), ".gitignore");
|
|
6365
6344
|
const rulesFilesToIgnore = [
|
|
6366
6345
|
"# Generated by rulesync - AI tool configuration files",
|
|
6367
6346
|
"**/.amazonq/",
|
|
@@ -6598,7 +6577,7 @@ async function importSubagents(config, tool) {
|
|
|
6598
6577
|
}
|
|
6599
6578
|
|
|
6600
6579
|
// src/cli/commands/init.ts
|
|
6601
|
-
var
|
|
6580
|
+
var import_node_path56 = require("path");
|
|
6602
6581
|
async function initCommand() {
|
|
6603
6582
|
logger.info("Initializing rulesync...");
|
|
6604
6583
|
await ensureDir(".rulesync");
|
|
@@ -6669,7 +6648,7 @@ globs: ["**/*"]
|
|
|
6669
6648
|
- Follow single responsibility principle
|
|
6670
6649
|
`
|
|
6671
6650
|
};
|
|
6672
|
-
const filepath = (0,
|
|
6651
|
+
const filepath = (0, import_node_path56.join)(".rulesync/rules", sampleFile.filename);
|
|
6673
6652
|
await ensureDir(".rulesync/rules");
|
|
6674
6653
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6675
6654
|
await ensureDir(".rulesync/subagents");
|
|
@@ -6682,7 +6661,7 @@ globs: ["**/*"]
|
|
|
6682
6661
|
}
|
|
6683
6662
|
|
|
6684
6663
|
// src/cli/index.ts
|
|
6685
|
-
var getVersion = () => "
|
|
6664
|
+
var getVersion = () => "3.0.0";
|
|
6686
6665
|
var main = async () => {
|
|
6687
6666
|
const program = new import_commander.Command();
|
|
6688
6667
|
const version = getVersion();
|