rulesync 1.0.0 → 1.1.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 +302 -211
- package/dist/index.js +286 -195
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/cli/index.ts
|
|
27
|
-
var
|
|
27
|
+
var import_node_path58 = require("path");
|
|
28
28
|
var import_node_url = require("url");
|
|
29
29
|
var import_commander = require("commander");
|
|
30
30
|
|
|
@@ -186,7 +186,7 @@ async function initConfig() {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// src/cli/commands/generate.ts
|
|
189
|
-
var
|
|
189
|
+
var import_es_toolkit2 = require("es-toolkit");
|
|
190
190
|
|
|
191
191
|
// src/commands/commands-processor.ts
|
|
192
192
|
var import_node_path11 = require("path");
|
|
@@ -1450,15 +1450,9 @@ var ConfigResolver = class {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
1452
|
|
|
1453
|
-
// src/ignore/ignore
|
|
1454
|
-
var import_mini9 = require("zod/mini");
|
|
1455
|
-
|
|
1456
|
-
// src/ignore/amazonqcli-ignore.ts
|
|
1453
|
+
// src/ignore/claudecode-ignore.ts
|
|
1457
1454
|
var import_node_path12 = require("path");
|
|
1458
|
-
|
|
1459
|
-
// src/types/tool-file.ts
|
|
1460
|
-
var ToolFile = class extends AiFile {
|
|
1461
|
-
};
|
|
1455
|
+
var import_es_toolkit = require("es-toolkit");
|
|
1462
1456
|
|
|
1463
1457
|
// src/ignore/rulesync-ignore.ts
|
|
1464
1458
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
@@ -1482,17 +1476,20 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
1482
1476
|
}
|
|
1483
1477
|
};
|
|
1484
1478
|
|
|
1479
|
+
// src/types/tool-file.ts
|
|
1480
|
+
var ToolFile = class extends AiFile {
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1485
1483
|
// src/ignore/tool-ignore.ts
|
|
1486
1484
|
var ToolIgnore = class extends ToolFile {
|
|
1487
1485
|
patterns;
|
|
1488
|
-
constructor(
|
|
1486
|
+
constructor(params) {
|
|
1489
1487
|
super({
|
|
1490
|
-
...
|
|
1488
|
+
...params,
|
|
1491
1489
|
validate: true
|
|
1492
|
-
// Skip validation during construction
|
|
1493
1490
|
});
|
|
1494
1491
|
this.patterns = this.fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1495
|
-
if (
|
|
1492
|
+
if (params.validate) {
|
|
1496
1493
|
const result = this.validate();
|
|
1497
1494
|
if (!result.success) {
|
|
1498
1495
|
throw result.error;
|
|
@@ -1524,7 +1521,90 @@ var ToolIgnore = class extends ToolFile {
|
|
|
1524
1521
|
}
|
|
1525
1522
|
};
|
|
1526
1523
|
|
|
1524
|
+
// src/ignore/claudecode-ignore.ts
|
|
1525
|
+
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
1526
|
+
constructor(params) {
|
|
1527
|
+
super(params);
|
|
1528
|
+
const jsonValue = JSON.parse(this.fileContent);
|
|
1529
|
+
this.patterns = jsonValue.permissions?.deny ?? [];
|
|
1530
|
+
}
|
|
1531
|
+
static getSettablePaths() {
|
|
1532
|
+
return {
|
|
1533
|
+
relativeDirPath: ".claude",
|
|
1534
|
+
relativeFilePath: "settings.local.json"
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
toRulesyncIgnore() {
|
|
1538
|
+
const rulesyncPatterns = this.patterns.map((pattern) => {
|
|
1539
|
+
if (pattern.startsWith("Read(") && pattern.endsWith(")")) {
|
|
1540
|
+
return pattern.slice(5, -1);
|
|
1541
|
+
}
|
|
1542
|
+
return pattern;
|
|
1543
|
+
}).filter((pattern) => pattern.length > 0);
|
|
1544
|
+
const fileContent = rulesyncPatterns.join("\n");
|
|
1545
|
+
return new RulesyncIgnore({
|
|
1546
|
+
baseDir: this.baseDir,
|
|
1547
|
+
relativeDirPath: RulesyncIgnore.getSettablePaths().relativeDirPath,
|
|
1548
|
+
relativeFilePath: RulesyncIgnore.getSettablePaths().relativeFilePath,
|
|
1549
|
+
fileContent
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
static async fromRulesyncIgnore({
|
|
1553
|
+
baseDir = ".",
|
|
1554
|
+
rulesyncIgnore
|
|
1555
|
+
}) {
|
|
1556
|
+
const fileContent = rulesyncIgnore.getFileContent();
|
|
1557
|
+
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1558
|
+
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
1559
|
+
const filePath = (0, import_node_path12.join)(
|
|
1560
|
+
baseDir,
|
|
1561
|
+
this.getSettablePaths().relativeDirPath,
|
|
1562
|
+
this.getSettablePaths().relativeFilePath
|
|
1563
|
+
);
|
|
1564
|
+
const exists = await fileExists(filePath);
|
|
1565
|
+
const existingFileContent = exists ? await readFileContent(filePath) : "{}";
|
|
1566
|
+
const existingJsonValue = JSON.parse(existingFileContent);
|
|
1567
|
+
const jsonValue = {
|
|
1568
|
+
...existingJsonValue,
|
|
1569
|
+
permissions: {
|
|
1570
|
+
...existingJsonValue.permissions,
|
|
1571
|
+
deny: (0, import_es_toolkit.uniq)([...existingJsonValue.permissions?.deny ?? [], ...deniedValues].sort())
|
|
1572
|
+
}
|
|
1573
|
+
};
|
|
1574
|
+
return new _ClaudecodeIgnore({
|
|
1575
|
+
baseDir,
|
|
1576
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1577
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1578
|
+
fileContent: JSON.stringify(jsonValue, null, 2),
|
|
1579
|
+
validate: true
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
static async fromFile({
|
|
1583
|
+
baseDir = ".",
|
|
1584
|
+
validate = true
|
|
1585
|
+
}) {
|
|
1586
|
+
const fileContent = await readFileContent(
|
|
1587
|
+
(0, import_node_path12.join)(
|
|
1588
|
+
baseDir,
|
|
1589
|
+
this.getSettablePaths().relativeDirPath,
|
|
1590
|
+
this.getSettablePaths().relativeFilePath
|
|
1591
|
+
)
|
|
1592
|
+
);
|
|
1593
|
+
return new _ClaudecodeIgnore({
|
|
1594
|
+
baseDir,
|
|
1595
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1596
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1597
|
+
fileContent,
|
|
1598
|
+
validate
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
// src/ignore/ignore-processor.ts
|
|
1604
|
+
var import_mini9 = require("zod/mini");
|
|
1605
|
+
|
|
1527
1606
|
// src/ignore/amazonqcli-ignore.ts
|
|
1607
|
+
var import_node_path13 = require("path");
|
|
1528
1608
|
var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
1529
1609
|
static getSettablePaths() {
|
|
1530
1610
|
return {
|
|
@@ -1563,7 +1643,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1563
1643
|
validate = true
|
|
1564
1644
|
}) {
|
|
1565
1645
|
const fileContent = await readFileContent(
|
|
1566
|
-
(0,
|
|
1646
|
+
(0, import_node_path13.join)(
|
|
1567
1647
|
baseDir,
|
|
1568
1648
|
this.getSettablePaths().relativeDirPath,
|
|
1569
1649
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1580,7 +1660,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1580
1660
|
};
|
|
1581
1661
|
|
|
1582
1662
|
// src/ignore/augmentcode-ignore.ts
|
|
1583
|
-
var
|
|
1663
|
+
var import_node_path14 = require("path");
|
|
1584
1664
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
1585
1665
|
static getSettablePaths() {
|
|
1586
1666
|
return {
|
|
@@ -1618,7 +1698,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1618
1698
|
validate = true
|
|
1619
1699
|
}) {
|
|
1620
1700
|
const fileContent = await readFileContent(
|
|
1621
|
-
(0,
|
|
1701
|
+
(0, import_node_path14.join)(
|
|
1622
1702
|
baseDir,
|
|
1623
1703
|
this.getSettablePaths().relativeDirPath,
|
|
1624
1704
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1635,7 +1715,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1635
1715
|
};
|
|
1636
1716
|
|
|
1637
1717
|
// src/ignore/cline-ignore.ts
|
|
1638
|
-
var
|
|
1718
|
+
var import_node_path15 = require("path");
|
|
1639
1719
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
1640
1720
|
static getSettablePaths() {
|
|
1641
1721
|
return {
|
|
@@ -1672,7 +1752,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1672
1752
|
validate = true
|
|
1673
1753
|
}) {
|
|
1674
1754
|
const fileContent = await readFileContent(
|
|
1675
|
-
(0,
|
|
1755
|
+
(0, import_node_path15.join)(
|
|
1676
1756
|
baseDir,
|
|
1677
1757
|
this.getSettablePaths().relativeDirPath,
|
|
1678
1758
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1689,7 +1769,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1689
1769
|
};
|
|
1690
1770
|
|
|
1691
1771
|
// src/ignore/codexcli-ignore.ts
|
|
1692
|
-
var
|
|
1772
|
+
var import_node_path16 = require("path");
|
|
1693
1773
|
var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
1694
1774
|
static getSettablePaths() {
|
|
1695
1775
|
return {
|
|
@@ -1719,7 +1799,7 @@ var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
|
1719
1799
|
validate = true
|
|
1720
1800
|
}) {
|
|
1721
1801
|
const fileContent = await readFileContent(
|
|
1722
|
-
(0,
|
|
1802
|
+
(0, import_node_path16.join)(
|
|
1723
1803
|
baseDir,
|
|
1724
1804
|
this.getSettablePaths().relativeDirPath,
|
|
1725
1805
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1736,7 +1816,7 @@ var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
|
1736
1816
|
};
|
|
1737
1817
|
|
|
1738
1818
|
// src/ignore/cursor-ignore.ts
|
|
1739
|
-
var
|
|
1819
|
+
var import_node_path17 = require("path");
|
|
1740
1820
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
1741
1821
|
static getSettablePaths() {
|
|
1742
1822
|
return {
|
|
@@ -1769,7 +1849,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1769
1849
|
validate = true
|
|
1770
1850
|
}) {
|
|
1771
1851
|
const fileContent = await readFileContent(
|
|
1772
|
-
(0,
|
|
1852
|
+
(0, import_node_path17.join)(
|
|
1773
1853
|
baseDir,
|
|
1774
1854
|
this.getSettablePaths().relativeDirPath,
|
|
1775
1855
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1786,7 +1866,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1786
1866
|
};
|
|
1787
1867
|
|
|
1788
1868
|
// src/ignore/geminicli-ignore.ts
|
|
1789
|
-
var
|
|
1869
|
+
var import_node_path18 = require("path");
|
|
1790
1870
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
1791
1871
|
static getSettablePaths() {
|
|
1792
1872
|
return {
|
|
@@ -1813,7 +1893,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
1813
1893
|
validate = true
|
|
1814
1894
|
}) {
|
|
1815
1895
|
const fileContent = await readFileContent(
|
|
1816
|
-
(0,
|
|
1896
|
+
(0, import_node_path18.join)(
|
|
1817
1897
|
baseDir,
|
|
1818
1898
|
this.getSettablePaths().relativeDirPath,
|
|
1819
1899
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1830,7 +1910,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
1830
1910
|
};
|
|
1831
1911
|
|
|
1832
1912
|
// src/ignore/junie-ignore.ts
|
|
1833
|
-
var
|
|
1913
|
+
var import_node_path19 = require("path");
|
|
1834
1914
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
1835
1915
|
static getSettablePaths() {
|
|
1836
1916
|
return {
|
|
@@ -1857,7 +1937,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
1857
1937
|
validate = true
|
|
1858
1938
|
}) {
|
|
1859
1939
|
const fileContent = await readFileContent(
|
|
1860
|
-
(0,
|
|
1940
|
+
(0, import_node_path19.join)(
|
|
1861
1941
|
baseDir,
|
|
1862
1942
|
this.getSettablePaths().relativeDirPath,
|
|
1863
1943
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1874,7 +1954,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
1874
1954
|
};
|
|
1875
1955
|
|
|
1876
1956
|
// src/ignore/kiro-ignore.ts
|
|
1877
|
-
var
|
|
1957
|
+
var import_node_path20 = require("path");
|
|
1878
1958
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
1879
1959
|
static getSettablePaths() {
|
|
1880
1960
|
return {
|
|
@@ -1901,7 +1981,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
1901
1981
|
validate = true
|
|
1902
1982
|
}) {
|
|
1903
1983
|
const fileContent = await readFileContent(
|
|
1904
|
-
(0,
|
|
1984
|
+
(0, import_node_path20.join)(
|
|
1905
1985
|
baseDir,
|
|
1906
1986
|
this.getSettablePaths().relativeDirPath,
|
|
1907
1987
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1918,7 +1998,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
1918
1998
|
};
|
|
1919
1999
|
|
|
1920
2000
|
// src/ignore/qwencode-ignore.ts
|
|
1921
|
-
var
|
|
2001
|
+
var import_node_path21 = require("path");
|
|
1922
2002
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
1923
2003
|
static getSettablePaths() {
|
|
1924
2004
|
return {
|
|
@@ -1945,7 +2025,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
1945
2025
|
validate = true
|
|
1946
2026
|
}) {
|
|
1947
2027
|
const fileContent = await readFileContent(
|
|
1948
|
-
(0,
|
|
2028
|
+
(0, import_node_path21.join)(
|
|
1949
2029
|
baseDir,
|
|
1950
2030
|
this.getSettablePaths().relativeDirPath,
|
|
1951
2031
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1962,7 +2042,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
1962
2042
|
};
|
|
1963
2043
|
|
|
1964
2044
|
// src/ignore/roo-ignore.ts
|
|
1965
|
-
var
|
|
2045
|
+
var import_node_path22 = require("path");
|
|
1966
2046
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
1967
2047
|
static getSettablePaths() {
|
|
1968
2048
|
return {
|
|
@@ -1989,7 +2069,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
1989
2069
|
validate = true
|
|
1990
2070
|
}) {
|
|
1991
2071
|
const fileContent = await readFileContent(
|
|
1992
|
-
(0,
|
|
2072
|
+
(0, import_node_path22.join)(
|
|
1993
2073
|
baseDir,
|
|
1994
2074
|
this.getSettablePaths().relativeDirPath,
|
|
1995
2075
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2006,7 +2086,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2006
2086
|
};
|
|
2007
2087
|
|
|
2008
2088
|
// src/ignore/windsurf-ignore.ts
|
|
2009
|
-
var
|
|
2089
|
+
var import_node_path23 = require("path");
|
|
2010
2090
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2011
2091
|
static getSettablePaths() {
|
|
2012
2092
|
return {
|
|
@@ -2033,7 +2113,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2033
2113
|
validate = true
|
|
2034
2114
|
}) {
|
|
2035
2115
|
const fileContent = await readFileContent(
|
|
2036
|
-
(0,
|
|
2116
|
+
(0, import_node_path23.join)(
|
|
2037
2117
|
baseDir,
|
|
2038
2118
|
this.getSettablePaths().relativeDirPath,
|
|
2039
2119
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2053,6 +2133,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2053
2133
|
var ignoreProcessorToolTargets = [
|
|
2054
2134
|
"amazonqcli",
|
|
2055
2135
|
"augmentcode",
|
|
2136
|
+
"claudecode",
|
|
2056
2137
|
"cline",
|
|
2057
2138
|
"codexcli",
|
|
2058
2139
|
"cursor",
|
|
@@ -2108,6 +2189,8 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2108
2189
|
return [await AmazonqcliIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2109
2190
|
case "augmentcode":
|
|
2110
2191
|
return [await AugmentcodeIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2192
|
+
case "claudecode":
|
|
2193
|
+
return [await ClaudecodeIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2111
2194
|
case "cline":
|
|
2112
2195
|
return [await ClineIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2113
2196
|
case "codexcli":
|
|
@@ -2141,67 +2224,74 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2141
2224
|
if (!rulesyncIgnore) {
|
|
2142
2225
|
throw new Error(`No .rulesyncignore found.`);
|
|
2143
2226
|
}
|
|
2144
|
-
const toolIgnores =
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2227
|
+
const toolIgnores = await Promise.all(
|
|
2228
|
+
[rulesyncIgnore].map(async (rulesyncIgnore2) => {
|
|
2229
|
+
switch (this.toolTarget) {
|
|
2230
|
+
case "amazonqcli":
|
|
2231
|
+
return AmazonqcliIgnore.fromRulesyncIgnore({
|
|
2232
|
+
baseDir: this.baseDir,
|
|
2233
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2234
|
+
});
|
|
2235
|
+
case "augmentcode":
|
|
2236
|
+
return AugmentcodeIgnore.fromRulesyncIgnore({
|
|
2237
|
+
baseDir: this.baseDir,
|
|
2238
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2239
|
+
});
|
|
2240
|
+
case "claudecode":
|
|
2241
|
+
return await ClaudecodeIgnore.fromRulesyncIgnore({
|
|
2242
|
+
baseDir: this.baseDir,
|
|
2243
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2244
|
+
});
|
|
2245
|
+
case "cline":
|
|
2246
|
+
return ClineIgnore.fromRulesyncIgnore({
|
|
2247
|
+
baseDir: this.baseDir,
|
|
2248
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2249
|
+
});
|
|
2250
|
+
case "codexcli":
|
|
2251
|
+
return CodexcliIgnore.fromRulesyncIgnore({
|
|
2252
|
+
baseDir: this.baseDir,
|
|
2253
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2254
|
+
});
|
|
2255
|
+
case "cursor":
|
|
2256
|
+
return CursorIgnore.fromRulesyncIgnore({
|
|
2257
|
+
baseDir: this.baseDir,
|
|
2258
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2259
|
+
});
|
|
2260
|
+
case "geminicli":
|
|
2261
|
+
return GeminiCliIgnore.fromRulesyncIgnore({
|
|
2262
|
+
baseDir: this.baseDir,
|
|
2263
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2264
|
+
});
|
|
2265
|
+
case "junie":
|
|
2266
|
+
return JunieIgnore.fromRulesyncIgnore({
|
|
2267
|
+
baseDir: this.baseDir,
|
|
2268
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2269
|
+
});
|
|
2270
|
+
case "kiro":
|
|
2271
|
+
return KiroIgnore.fromRulesyncIgnore({
|
|
2272
|
+
baseDir: this.baseDir,
|
|
2273
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2274
|
+
});
|
|
2275
|
+
case "qwencode":
|
|
2276
|
+
return QwencodeIgnore.fromRulesyncIgnore({
|
|
2277
|
+
baseDir: this.baseDir,
|
|
2278
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2279
|
+
});
|
|
2280
|
+
case "roo":
|
|
2281
|
+
return RooIgnore.fromRulesyncIgnore({
|
|
2282
|
+
baseDir: this.baseDir,
|
|
2283
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2284
|
+
});
|
|
2285
|
+
case "windsurf":
|
|
2286
|
+
return WindsurfIgnore.fromRulesyncIgnore({
|
|
2287
|
+
baseDir: this.baseDir,
|
|
2288
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2289
|
+
});
|
|
2290
|
+
default:
|
|
2291
|
+
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
2292
|
+
}
|
|
2293
|
+
})
|
|
2294
|
+
);
|
|
2205
2295
|
return toolIgnores;
|
|
2206
2296
|
}
|
|
2207
2297
|
/**
|
|
@@ -2228,10 +2318,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2228
2318
|
var import_mini11 = require("zod/mini");
|
|
2229
2319
|
|
|
2230
2320
|
// src/mcp/amazonqcli-mcp.ts
|
|
2231
|
-
var
|
|
2321
|
+
var import_node_path25 = require("path");
|
|
2232
2322
|
|
|
2233
2323
|
// src/mcp/rulesync-mcp.ts
|
|
2234
|
-
var
|
|
2324
|
+
var import_node_path24 = require("path");
|
|
2235
2325
|
var import_mini10 = require("zod/mini");
|
|
2236
2326
|
var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
|
|
2237
2327
|
var McpServerBaseSchema = import_mini10.z.object({
|
|
@@ -2282,7 +2372,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2282
2372
|
}
|
|
2283
2373
|
static async fromFile({ validate = true }) {
|
|
2284
2374
|
const fileContent = await readFileContent(
|
|
2285
|
-
(0,
|
|
2375
|
+
(0, import_node_path24.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
|
|
2286
2376
|
);
|
|
2287
2377
|
return new _RulesyncMcp({
|
|
2288
2378
|
baseDir: ".",
|
|
@@ -2349,7 +2439,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2349
2439
|
validate = true
|
|
2350
2440
|
}) {
|
|
2351
2441
|
const fileContent = await readFileContent(
|
|
2352
|
-
(0,
|
|
2442
|
+
(0, import_node_path25.join)(
|
|
2353
2443
|
baseDir,
|
|
2354
2444
|
this.getSettablePaths().relativeDirPath,
|
|
2355
2445
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2385,7 +2475,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2385
2475
|
};
|
|
2386
2476
|
|
|
2387
2477
|
// src/mcp/claudecode-mcp.ts
|
|
2388
|
-
var
|
|
2478
|
+
var import_node_path26 = require("path");
|
|
2389
2479
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
2390
2480
|
static getSettablePaths() {
|
|
2391
2481
|
return {
|
|
@@ -2398,7 +2488,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2398
2488
|
validate = true
|
|
2399
2489
|
}) {
|
|
2400
2490
|
const fileContent = await readFileContent(
|
|
2401
|
-
(0,
|
|
2491
|
+
(0, import_node_path26.join)(
|
|
2402
2492
|
baseDir,
|
|
2403
2493
|
this.getSettablePaths().relativeDirPath,
|
|
2404
2494
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2434,7 +2524,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2434
2524
|
};
|
|
2435
2525
|
|
|
2436
2526
|
// src/mcp/cline-mcp.ts
|
|
2437
|
-
var
|
|
2527
|
+
var import_node_path27 = require("path");
|
|
2438
2528
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
2439
2529
|
static getSettablePaths() {
|
|
2440
2530
|
return {
|
|
@@ -2447,7 +2537,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2447
2537
|
validate = true
|
|
2448
2538
|
}) {
|
|
2449
2539
|
const fileContent = await readFileContent(
|
|
2450
|
-
(0,
|
|
2540
|
+
(0, import_node_path27.join)(
|
|
2451
2541
|
baseDir,
|
|
2452
2542
|
this.getSettablePaths().relativeDirPath,
|
|
2453
2543
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2483,7 +2573,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2483
2573
|
};
|
|
2484
2574
|
|
|
2485
2575
|
// src/mcp/copilot-mcp.ts
|
|
2486
|
-
var
|
|
2576
|
+
var import_node_path28 = require("path");
|
|
2487
2577
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
2488
2578
|
static getSettablePaths() {
|
|
2489
2579
|
return {
|
|
@@ -2496,7 +2586,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2496
2586
|
validate = true
|
|
2497
2587
|
}) {
|
|
2498
2588
|
const fileContent = await readFileContent(
|
|
2499
|
-
(0,
|
|
2589
|
+
(0, import_node_path28.join)(
|
|
2500
2590
|
baseDir,
|
|
2501
2591
|
this.getSettablePaths().relativeDirPath,
|
|
2502
2592
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2532,7 +2622,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2532
2622
|
};
|
|
2533
2623
|
|
|
2534
2624
|
// src/mcp/cursor-mcp.ts
|
|
2535
|
-
var
|
|
2625
|
+
var import_node_path29 = require("path");
|
|
2536
2626
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
2537
2627
|
static getSettablePaths() {
|
|
2538
2628
|
return {
|
|
@@ -2545,7 +2635,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2545
2635
|
validate = true
|
|
2546
2636
|
}) {
|
|
2547
2637
|
const fileContent = await readFileContent(
|
|
2548
|
-
(0,
|
|
2638
|
+
(0, import_node_path29.join)(
|
|
2549
2639
|
baseDir,
|
|
2550
2640
|
this.getSettablePaths().relativeDirPath,
|
|
2551
2641
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2592,7 +2682,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2592
2682
|
};
|
|
2593
2683
|
|
|
2594
2684
|
// src/mcp/roo-mcp.ts
|
|
2595
|
-
var
|
|
2685
|
+
var import_node_path30 = require("path");
|
|
2596
2686
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
2597
2687
|
static getSettablePaths() {
|
|
2598
2688
|
return {
|
|
@@ -2605,7 +2695,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
2605
2695
|
validate = true
|
|
2606
2696
|
}) {
|
|
2607
2697
|
const fileContent = await readFileContent(
|
|
2608
|
-
(0,
|
|
2698
|
+
(0, import_node_path30.join)(
|
|
2609
2699
|
baseDir,
|
|
2610
2700
|
this.getSettablePaths().relativeDirPath,
|
|
2611
2701
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2809,20 +2899,20 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2809
2899
|
};
|
|
2810
2900
|
|
|
2811
2901
|
// src/rules/rules-processor.ts
|
|
2812
|
-
var
|
|
2902
|
+
var import_node_path55 = require("path");
|
|
2813
2903
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
2814
2904
|
var import_mini20 = require("zod/mini");
|
|
2815
2905
|
|
|
2816
2906
|
// src/constants/paths.ts
|
|
2817
|
-
var
|
|
2907
|
+
var import_node_path31 = require("path");
|
|
2818
2908
|
var RULESYNC_DIR = ".rulesync";
|
|
2819
|
-
var RULESYNC_RULES_DIR = (0,
|
|
2909
|
+
var RULESYNC_RULES_DIR = (0, import_node_path31.join)(".rulesync", "rules");
|
|
2820
2910
|
var RULESYNC_RULES_DIR_LEGACY = ".rulesync";
|
|
2821
|
-
var RULESYNC_MCP_FILE = (0,
|
|
2822
|
-
var RULESYNC_SUBAGENTS_DIR = (0,
|
|
2911
|
+
var RULESYNC_MCP_FILE = (0, import_node_path31.join)(".rulesync", ".mcp.json");
|
|
2912
|
+
var RULESYNC_SUBAGENTS_DIR = (0, import_node_path31.join)(".rulesync", "subagents");
|
|
2823
2913
|
|
|
2824
2914
|
// src/subagents/simulated-subagent.ts
|
|
2825
|
-
var
|
|
2915
|
+
var import_node_path32 = require("path");
|
|
2826
2916
|
var import_mini12 = require("zod/mini");
|
|
2827
2917
|
|
|
2828
2918
|
// src/subagents/tool-subagent.ts
|
|
@@ -2924,7 +3014,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
2924
3014
|
relativeFilePath,
|
|
2925
3015
|
validate = true
|
|
2926
3016
|
}) {
|
|
2927
|
-
const filePath = (0,
|
|
3017
|
+
const filePath = (0, import_node_path32.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2928
3018
|
const fileContent = await readFileContent(filePath);
|
|
2929
3019
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2930
3020
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2934,7 +3024,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
2934
3024
|
return {
|
|
2935
3025
|
baseDir,
|
|
2936
3026
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
2937
|
-
relativeFilePath: (0,
|
|
3027
|
+
relativeFilePath: (0, import_node_path32.basename)(relativeFilePath),
|
|
2938
3028
|
frontmatter: result.data,
|
|
2939
3029
|
body: content.trim(),
|
|
2940
3030
|
validate
|
|
@@ -3058,15 +3148,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3058
3148
|
};
|
|
3059
3149
|
|
|
3060
3150
|
// src/subagents/subagents-processor.ts
|
|
3061
|
-
var
|
|
3151
|
+
var import_node_path35 = require("path");
|
|
3062
3152
|
var import_mini15 = require("zod/mini");
|
|
3063
3153
|
|
|
3064
3154
|
// src/subagents/claudecode-subagent.ts
|
|
3065
|
-
var
|
|
3155
|
+
var import_node_path34 = require("path");
|
|
3066
3156
|
var import_mini14 = require("zod/mini");
|
|
3067
3157
|
|
|
3068
3158
|
// src/subagents/rulesync-subagent.ts
|
|
3069
|
-
var
|
|
3159
|
+
var import_node_path33 = require("path");
|
|
3070
3160
|
var import_mini13 = require("zod/mini");
|
|
3071
3161
|
var RulesyncSubagentModelSchema = import_mini13.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3072
3162
|
var RulesyncSubagentFrontmatterSchema = import_mini13.z.object({
|
|
@@ -3120,13 +3210,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3120
3210
|
static async fromFile({
|
|
3121
3211
|
relativeFilePath
|
|
3122
3212
|
}) {
|
|
3123
|
-
const fileContent = await readFileContent((0,
|
|
3213
|
+
const fileContent = await readFileContent((0, import_node_path33.join)(RULESYNC_SUBAGENTS_DIR, relativeFilePath));
|
|
3124
3214
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3125
3215
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3126
3216
|
if (!result.success) {
|
|
3127
3217
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
|
|
3128
3218
|
}
|
|
3129
|
-
const filename = (0,
|
|
3219
|
+
const filename = (0, import_node_path33.basename)(relativeFilePath);
|
|
3130
3220
|
return new _RulesyncSubagent({
|
|
3131
3221
|
baseDir: ".",
|
|
3132
3222
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -3238,7 +3328,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3238
3328
|
relativeFilePath,
|
|
3239
3329
|
validate = true
|
|
3240
3330
|
}) {
|
|
3241
|
-
const fileContent = await readFileContent((0,
|
|
3331
|
+
const fileContent = await readFileContent((0, import_node_path34.join)(baseDir, ".claude/agents", relativeFilePath));
|
|
3242
3332
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3243
3333
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3244
3334
|
if (!result.success) {
|
|
@@ -3369,7 +3459,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3369
3459
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
3370
3460
|
*/
|
|
3371
3461
|
async loadRulesyncFiles() {
|
|
3372
|
-
const subagentsDir = (0,
|
|
3462
|
+
const subagentsDir = (0, import_node_path35.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
3373
3463
|
const dirExists = await directoryExists(subagentsDir);
|
|
3374
3464
|
if (!dirExists) {
|
|
3375
3465
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -3384,7 +3474,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3384
3474
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
3385
3475
|
const rulesyncSubagents = [];
|
|
3386
3476
|
for (const mdFile of mdFiles) {
|
|
3387
|
-
const filepath = (0,
|
|
3477
|
+
const filepath = (0, import_node_path35.join)(subagentsDir, mdFile);
|
|
3388
3478
|
try {
|
|
3389
3479
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
3390
3480
|
relativeFilePath: mdFile,
|
|
@@ -3484,8 +3574,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3484
3574
|
relativeDirPath,
|
|
3485
3575
|
fromFile
|
|
3486
3576
|
}) {
|
|
3487
|
-
const paths = await findFilesByGlobs((0,
|
|
3488
|
-
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0,
|
|
3577
|
+
const paths = await findFilesByGlobs((0, import_node_path35.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
3578
|
+
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path35.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
3489
3579
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
3490
3580
|
return subagents;
|
|
3491
3581
|
}
|
|
@@ -3509,13 +3599,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3509
3599
|
};
|
|
3510
3600
|
|
|
3511
3601
|
// src/rules/agentsmd-rule.ts
|
|
3512
|
-
var
|
|
3602
|
+
var import_node_path38 = require("path");
|
|
3513
3603
|
|
|
3514
3604
|
// src/rules/tool-rule.ts
|
|
3515
|
-
var
|
|
3605
|
+
var import_node_path37 = require("path");
|
|
3516
3606
|
|
|
3517
3607
|
// src/rules/rulesync-rule.ts
|
|
3518
|
-
var
|
|
3608
|
+
var import_node_path36 = require("path");
|
|
3519
3609
|
var import_mini16 = require("zod/mini");
|
|
3520
3610
|
var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
|
|
3521
3611
|
root: import_mini16.z.optional(import_mini16.z.optional(import_mini16.z.boolean())),
|
|
@@ -3581,7 +3671,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3581
3671
|
relativeFilePath,
|
|
3582
3672
|
validate = true
|
|
3583
3673
|
}) {
|
|
3584
|
-
const filePath = (0,
|
|
3674
|
+
const filePath = (0, import_node_path36.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
3585
3675
|
const fileContent = await readFileContent(filePath);
|
|
3586
3676
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3587
3677
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3596,7 +3686,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3596
3686
|
agentsmd: result.data.agentsmd,
|
|
3597
3687
|
cursor: result.data.cursor
|
|
3598
3688
|
};
|
|
3599
|
-
const filename = (0,
|
|
3689
|
+
const filename = (0, import_node_path36.basename)(filePath);
|
|
3600
3690
|
return new _RulesyncRule({
|
|
3601
3691
|
baseDir: ".",
|
|
3602
3692
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3610,7 +3700,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3610
3700
|
relativeFilePath,
|
|
3611
3701
|
validate = true
|
|
3612
3702
|
}) {
|
|
3613
|
-
const filePath = (0,
|
|
3703
|
+
const filePath = (0, import_node_path36.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
3614
3704
|
const fileContent = await readFileContent(filePath);
|
|
3615
3705
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3616
3706
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3625,7 +3715,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3625
3715
|
agentsmd: result.data.agentsmd,
|
|
3626
3716
|
cursor: result.data.cursor
|
|
3627
3717
|
};
|
|
3628
|
-
const filename = (0,
|
|
3718
|
+
const filename = (0, import_node_path36.basename)(filePath);
|
|
3629
3719
|
return new _RulesyncRule({
|
|
3630
3720
|
baseDir: ".",
|
|
3631
3721
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -3692,7 +3782,7 @@ var ToolRule = class extends ToolFile {
|
|
|
3692
3782
|
});
|
|
3693
3783
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3694
3784
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3695
|
-
params.relativeDirPath = (0,
|
|
3785
|
+
params.relativeDirPath = (0, import_node_path37.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3696
3786
|
params.relativeFilePath = "AGENTS.md";
|
|
3697
3787
|
}
|
|
3698
3788
|
return params;
|
|
@@ -3767,8 +3857,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3767
3857
|
validate = true
|
|
3768
3858
|
}) {
|
|
3769
3859
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3770
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
3771
|
-
const fileContent = await readFileContent((0,
|
|
3860
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path38.join)(".agents/memories", relativeFilePath);
|
|
3861
|
+
const fileContent = await readFileContent((0, import_node_path38.join)(baseDir, relativePath));
|
|
3772
3862
|
return new _AgentsMdRule({
|
|
3773
3863
|
baseDir,
|
|
3774
3864
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -3808,7 +3898,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3808
3898
|
};
|
|
3809
3899
|
|
|
3810
3900
|
// src/rules/amazonqcli-rule.ts
|
|
3811
|
-
var
|
|
3901
|
+
var import_node_path39 = require("path");
|
|
3812
3902
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
3813
3903
|
static getSettablePaths() {
|
|
3814
3904
|
return {
|
|
@@ -3823,7 +3913,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3823
3913
|
validate = true
|
|
3824
3914
|
}) {
|
|
3825
3915
|
const fileContent = await readFileContent(
|
|
3826
|
-
(0,
|
|
3916
|
+
(0, import_node_path39.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3827
3917
|
);
|
|
3828
3918
|
return new _AmazonQCliRule({
|
|
3829
3919
|
baseDir,
|
|
@@ -3863,7 +3953,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3863
3953
|
};
|
|
3864
3954
|
|
|
3865
3955
|
// src/rules/augmentcode-legacy-rule.ts
|
|
3866
|
-
var
|
|
3956
|
+
var import_node_path40 = require("path");
|
|
3867
3957
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
3868
3958
|
toRulesyncRule() {
|
|
3869
3959
|
const rulesyncFrontmatter = {
|
|
@@ -3923,8 +4013,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3923
4013
|
}) {
|
|
3924
4014
|
const settablePaths = this.getSettablePaths();
|
|
3925
4015
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
3926
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
3927
|
-
const fileContent = await readFileContent((0,
|
|
4016
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path40.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
4017
|
+
const fileContent = await readFileContent((0, import_node_path40.join)(baseDir, relativePath));
|
|
3928
4018
|
return new _AugmentcodeLegacyRule({
|
|
3929
4019
|
baseDir,
|
|
3930
4020
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -3937,7 +4027,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3937
4027
|
};
|
|
3938
4028
|
|
|
3939
4029
|
// src/rules/augmentcode-rule.ts
|
|
3940
|
-
var
|
|
4030
|
+
var import_node_path41 = require("path");
|
|
3941
4031
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
3942
4032
|
toRulesyncRule() {
|
|
3943
4033
|
return this.toRulesyncRuleDefault();
|
|
@@ -3969,7 +4059,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3969
4059
|
validate = true
|
|
3970
4060
|
}) {
|
|
3971
4061
|
const fileContent = await readFileContent(
|
|
3972
|
-
(0,
|
|
4062
|
+
(0, import_node_path41.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3973
4063
|
);
|
|
3974
4064
|
const { body: content } = parseFrontmatter(fileContent);
|
|
3975
4065
|
return new _AugmentcodeRule({
|
|
@@ -3992,7 +4082,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3992
4082
|
};
|
|
3993
4083
|
|
|
3994
4084
|
// src/rules/claudecode-rule.ts
|
|
3995
|
-
var
|
|
4085
|
+
var import_node_path42 = require("path");
|
|
3996
4086
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
3997
4087
|
static getSettablePaths() {
|
|
3998
4088
|
return {
|
|
@@ -4011,8 +4101,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4011
4101
|
validate = true
|
|
4012
4102
|
}) {
|
|
4013
4103
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
4014
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
4015
|
-
const fileContent = await readFileContent((0,
|
|
4104
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path42.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4105
|
+
const fileContent = await readFileContent((0, import_node_path42.join)(baseDir, relativePath));
|
|
4016
4106
|
return new _ClaudecodeRule({
|
|
4017
4107
|
baseDir,
|
|
4018
4108
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4052,7 +4142,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4052
4142
|
};
|
|
4053
4143
|
|
|
4054
4144
|
// src/rules/cline-rule.ts
|
|
4055
|
-
var
|
|
4145
|
+
var import_node_path43 = require("path");
|
|
4056
4146
|
var import_mini17 = require("zod/mini");
|
|
4057
4147
|
var ClineRuleFrontmatterSchema = import_mini17.z.object({
|
|
4058
4148
|
description: import_mini17.z.string()
|
|
@@ -4097,7 +4187,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4097
4187
|
validate = true
|
|
4098
4188
|
}) {
|
|
4099
4189
|
const fileContent = await readFileContent(
|
|
4100
|
-
(0,
|
|
4190
|
+
(0, import_node_path43.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4101
4191
|
);
|
|
4102
4192
|
return new _ClineRule({
|
|
4103
4193
|
baseDir,
|
|
@@ -4110,7 +4200,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4110
4200
|
};
|
|
4111
4201
|
|
|
4112
4202
|
// src/rules/codexcli-rule.ts
|
|
4113
|
-
var
|
|
4203
|
+
var import_node_path44 = require("path");
|
|
4114
4204
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4115
4205
|
static getSettablePaths() {
|
|
4116
4206
|
return {
|
|
@@ -4129,8 +4219,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4129
4219
|
validate = true
|
|
4130
4220
|
}) {
|
|
4131
4221
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4132
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4133
|
-
const fileContent = await readFileContent((0,
|
|
4222
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path44.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4223
|
+
const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
|
|
4134
4224
|
return new _CodexcliRule({
|
|
4135
4225
|
baseDir,
|
|
4136
4226
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4170,7 +4260,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4170
4260
|
};
|
|
4171
4261
|
|
|
4172
4262
|
// src/rules/copilot-rule.ts
|
|
4173
|
-
var
|
|
4263
|
+
var import_node_path45 = require("path");
|
|
4174
4264
|
var import_mini18 = require("zod/mini");
|
|
4175
4265
|
var CopilotRuleFrontmatterSchema = import_mini18.z.object({
|
|
4176
4266
|
description: import_mini18.z.optional(import_mini18.z.string()),
|
|
@@ -4262,11 +4352,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4262
4352
|
validate = true
|
|
4263
4353
|
}) {
|
|
4264
4354
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4265
|
-
const relativePath = isRoot ? (0,
|
|
4355
|
+
const relativePath = isRoot ? (0, import_node_path45.join)(
|
|
4266
4356
|
this.getSettablePaths().root.relativeDirPath,
|
|
4267
4357
|
this.getSettablePaths().root.relativeFilePath
|
|
4268
|
-
) : (0,
|
|
4269
|
-
const fileContent = await readFileContent((0,
|
|
4358
|
+
) : (0, import_node_path45.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4359
|
+
const fileContent = await readFileContent((0, import_node_path45.join)(baseDir, relativePath));
|
|
4270
4360
|
if (isRoot) {
|
|
4271
4361
|
return new _CopilotRule({
|
|
4272
4362
|
baseDir,
|
|
@@ -4285,7 +4375,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4285
4375
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4286
4376
|
if (!result.success) {
|
|
4287
4377
|
throw new Error(
|
|
4288
|
-
`Invalid frontmatter in ${(0,
|
|
4378
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4289
4379
|
);
|
|
4290
4380
|
}
|
|
4291
4381
|
return new _CopilotRule({
|
|
@@ -4324,7 +4414,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4324
4414
|
};
|
|
4325
4415
|
|
|
4326
4416
|
// src/rules/cursor-rule.ts
|
|
4327
|
-
var
|
|
4417
|
+
var import_node_path46 = require("path");
|
|
4328
4418
|
var import_mini19 = require("zod/mini");
|
|
4329
4419
|
var CursorRuleFrontmatterSchema = import_mini19.z.object({
|
|
4330
4420
|
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
@@ -4360,9 +4450,6 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4360
4450
|
* MDC files don't support quotes in YAML, so globs patterns must be output without quotes
|
|
4361
4451
|
*/
|
|
4362
4452
|
static stringifyCursorFrontmatter(body, frontmatter) {
|
|
4363
|
-
if (!frontmatter.globs || typeof frontmatter.globs !== "string" || !frontmatter.globs.includes("*")) {
|
|
4364
|
-
return stringifyFrontmatter(body, frontmatter);
|
|
4365
|
-
}
|
|
4366
4453
|
const lines = ["---"];
|
|
4367
4454
|
if (frontmatter.alwaysApply !== void 0) {
|
|
4368
4455
|
lines.push(`alwaysApply: ${frontmatter.alwaysApply}`);
|
|
@@ -4454,19 +4541,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4454
4541
|
validate = true
|
|
4455
4542
|
}) {
|
|
4456
4543
|
const fileContent = await readFileContent(
|
|
4457
|
-
(0,
|
|
4544
|
+
(0, import_node_path46.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4458
4545
|
);
|
|
4459
4546
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4460
4547
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4461
4548
|
if (!result.success) {
|
|
4462
4549
|
throw new Error(
|
|
4463
|
-
`Invalid frontmatter in ${(0,
|
|
4550
|
+
`Invalid frontmatter in ${(0, import_node_path46.join)(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4464
4551
|
);
|
|
4465
4552
|
}
|
|
4466
4553
|
return new _CursorRule({
|
|
4467
4554
|
baseDir,
|
|
4468
4555
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
4469
|
-
relativeFilePath: (0,
|
|
4556
|
+
relativeFilePath: (0, import_node_path46.basename)(relativeFilePath),
|
|
4470
4557
|
frontmatter: result.data,
|
|
4471
4558
|
body: content.trim(),
|
|
4472
4559
|
validate
|
|
@@ -4498,7 +4585,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4498
4585
|
};
|
|
4499
4586
|
|
|
4500
4587
|
// src/rules/geminicli-rule.ts
|
|
4501
|
-
var
|
|
4588
|
+
var import_node_path47 = require("path");
|
|
4502
4589
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4503
4590
|
static getSettablePaths() {
|
|
4504
4591
|
return {
|
|
@@ -4517,8 +4604,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4517
4604
|
validate = true
|
|
4518
4605
|
}) {
|
|
4519
4606
|
const isRoot = relativeFilePath === "GEMINI.md";
|
|
4520
|
-
const relativePath = isRoot ? "GEMINI.md" : (0,
|
|
4521
|
-
const fileContent = await readFileContent((0,
|
|
4607
|
+
const relativePath = isRoot ? "GEMINI.md" : (0, import_node_path47.join)(".gemini/memories", relativeFilePath);
|
|
4608
|
+
const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
|
|
4522
4609
|
return new _GeminiCliRule({
|
|
4523
4610
|
baseDir,
|
|
4524
4611
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4558,7 +4645,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4558
4645
|
};
|
|
4559
4646
|
|
|
4560
4647
|
// src/rules/junie-rule.ts
|
|
4561
|
-
var
|
|
4648
|
+
var import_node_path48 = require("path");
|
|
4562
4649
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4563
4650
|
static getSettablePaths() {
|
|
4564
4651
|
return {
|
|
@@ -4577,8 +4664,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4577
4664
|
validate = true
|
|
4578
4665
|
}) {
|
|
4579
4666
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4580
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
4581
|
-
const fileContent = await readFileContent((0,
|
|
4667
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path48.join)(".junie/memories", relativeFilePath);
|
|
4668
|
+
const fileContent = await readFileContent((0, import_node_path48.join)(baseDir, relativePath));
|
|
4582
4669
|
return new _JunieRule({
|
|
4583
4670
|
baseDir,
|
|
4584
4671
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4618,7 +4705,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4618
4705
|
};
|
|
4619
4706
|
|
|
4620
4707
|
// src/rules/kiro-rule.ts
|
|
4621
|
-
var
|
|
4708
|
+
var import_node_path49 = require("path");
|
|
4622
4709
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4623
4710
|
static getSettablePaths() {
|
|
4624
4711
|
return {
|
|
@@ -4633,7 +4720,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4633
4720
|
validate = true
|
|
4634
4721
|
}) {
|
|
4635
4722
|
const fileContent = await readFileContent(
|
|
4636
|
-
(0,
|
|
4723
|
+
(0, import_node_path49.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4637
4724
|
);
|
|
4638
4725
|
return new _KiroRule({
|
|
4639
4726
|
baseDir,
|
|
@@ -4673,7 +4760,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4673
4760
|
};
|
|
4674
4761
|
|
|
4675
4762
|
// src/rules/opencode-rule.ts
|
|
4676
|
-
var
|
|
4763
|
+
var import_node_path50 = require("path");
|
|
4677
4764
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4678
4765
|
static getSettablePaths() {
|
|
4679
4766
|
return {
|
|
@@ -4692,8 +4779,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4692
4779
|
validate = true
|
|
4693
4780
|
}) {
|
|
4694
4781
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4695
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4696
|
-
const fileContent = await readFileContent((0,
|
|
4782
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path50.join)(".opencode/memories", relativeFilePath);
|
|
4783
|
+
const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
|
|
4697
4784
|
return new _OpenCodeRule({
|
|
4698
4785
|
baseDir,
|
|
4699
4786
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4733,7 +4820,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4733
4820
|
};
|
|
4734
4821
|
|
|
4735
4822
|
// src/rules/qwencode-rule.ts
|
|
4736
|
-
var
|
|
4823
|
+
var import_node_path51 = require("path");
|
|
4737
4824
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
4738
4825
|
static getSettablePaths() {
|
|
4739
4826
|
return {
|
|
@@ -4752,8 +4839,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4752
4839
|
validate = true
|
|
4753
4840
|
}) {
|
|
4754
4841
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
4755
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
4756
|
-
const fileContent = await readFileContent((0,
|
|
4842
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path51.join)(".qwen/memories", relativeFilePath);
|
|
4843
|
+
const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
|
|
4757
4844
|
return new _QwencodeRule({
|
|
4758
4845
|
baseDir,
|
|
4759
4846
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4790,7 +4877,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4790
4877
|
};
|
|
4791
4878
|
|
|
4792
4879
|
// src/rules/roo-rule.ts
|
|
4793
|
-
var
|
|
4880
|
+
var import_node_path52 = require("path");
|
|
4794
4881
|
var RooRule = class _RooRule extends ToolRule {
|
|
4795
4882
|
static getSettablePaths() {
|
|
4796
4883
|
return {
|
|
@@ -4805,7 +4892,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4805
4892
|
validate = true
|
|
4806
4893
|
}) {
|
|
4807
4894
|
const fileContent = await readFileContent(
|
|
4808
|
-
(0,
|
|
4895
|
+
(0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4809
4896
|
);
|
|
4810
4897
|
return new _RooRule({
|
|
4811
4898
|
baseDir,
|
|
@@ -4860,7 +4947,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4860
4947
|
};
|
|
4861
4948
|
|
|
4862
4949
|
// src/rules/warp-rule.ts
|
|
4863
|
-
var
|
|
4950
|
+
var import_node_path53 = require("path");
|
|
4864
4951
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
4865
4952
|
constructor({ fileContent, root, ...rest }) {
|
|
4866
4953
|
super({
|
|
@@ -4886,8 +4973,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4886
4973
|
validate = true
|
|
4887
4974
|
}) {
|
|
4888
4975
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
4889
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
4890
|
-
const fileContent = await readFileContent((0,
|
|
4976
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path53.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4977
|
+
const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
|
|
4891
4978
|
return new _WarpRule({
|
|
4892
4979
|
baseDir,
|
|
4893
4980
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -4927,7 +5014,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4927
5014
|
};
|
|
4928
5015
|
|
|
4929
5016
|
// src/rules/windsurf-rule.ts
|
|
4930
|
-
var
|
|
5017
|
+
var import_node_path54 = require("path");
|
|
4931
5018
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
4932
5019
|
static getSettablePaths() {
|
|
4933
5020
|
return {
|
|
@@ -4942,7 +5029,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
4942
5029
|
validate = true
|
|
4943
5030
|
}) {
|
|
4944
5031
|
const fileContent = await readFileContent(
|
|
4945
|
-
(0,
|
|
5032
|
+
(0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4946
5033
|
);
|
|
4947
5034
|
return new _WindsurfRule({
|
|
4948
5035
|
baseDir,
|
|
@@ -5321,17 +5408,17 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5321
5408
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5322
5409
|
*/
|
|
5323
5410
|
async loadRulesyncFiles() {
|
|
5324
|
-
const files = await findFilesByGlobs((0,
|
|
5411
|
+
const files = await findFilesByGlobs((0, import_node_path55.join)(RULESYNC_RULES_DIR, "*.md"));
|
|
5325
5412
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5326
5413
|
return Promise.all(
|
|
5327
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
5414
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path55.basename)(file) }))
|
|
5328
5415
|
);
|
|
5329
5416
|
}
|
|
5330
5417
|
async loadRulesyncFilesLegacy() {
|
|
5331
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
5418
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path55.join)(RULESYNC_RULES_DIR_LEGACY, "*.md"));
|
|
5332
5419
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5333
5420
|
return Promise.all(
|
|
5334
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
5421
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path55.basename)(file) }))
|
|
5335
5422
|
);
|
|
5336
5423
|
}
|
|
5337
5424
|
/**
|
|
@@ -5392,13 +5479,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5392
5479
|
return [];
|
|
5393
5480
|
}
|
|
5394
5481
|
const rootFilePaths = await findFilesByGlobs(
|
|
5395
|
-
(0,
|
|
5482
|
+
(0, import_node_path55.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5396
5483
|
);
|
|
5397
5484
|
return await Promise.all(
|
|
5398
5485
|
rootFilePaths.map(
|
|
5399
5486
|
(filePath) => root.fromFile({
|
|
5400
5487
|
baseDir: this.baseDir,
|
|
5401
|
-
relativeFilePath: (0,
|
|
5488
|
+
relativeFilePath: (0, import_node_path55.basename)(filePath)
|
|
5402
5489
|
})
|
|
5403
5490
|
)
|
|
5404
5491
|
);
|
|
@@ -5409,13 +5496,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5409
5496
|
return [];
|
|
5410
5497
|
}
|
|
5411
5498
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5412
|
-
(0,
|
|
5499
|
+
(0, import_node_path55.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5413
5500
|
);
|
|
5414
5501
|
return await Promise.all(
|
|
5415
5502
|
nonRootFilePaths.map(
|
|
5416
5503
|
(filePath) => nonRoot.fromFile({
|
|
5417
5504
|
baseDir: this.baseDir,
|
|
5418
|
-
relativeFilePath: (0,
|
|
5505
|
+
relativeFilePath: (0, import_node_path55.basename)(filePath)
|
|
5419
5506
|
})
|
|
5420
5507
|
)
|
|
5421
5508
|
);
|
|
@@ -5775,14 +5862,14 @@ s/<command> [arguments]
|
|
|
5775
5862
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
5776
5863
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
5777
5864
|
|
|
5778
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
5865
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path55.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.`;
|
|
5779
5866
|
const subagentsSection = `## Simulated Subagents
|
|
5780
5867
|
|
|
5781
5868
|
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.
|
|
5782
5869
|
|
|
5783
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
5870
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
5784
5871
|
|
|
5785
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
5872
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.`;
|
|
5786
5873
|
const result = [
|
|
5787
5874
|
overview,
|
|
5788
5875
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -5806,7 +5893,7 @@ async function generateCommand(options) {
|
|
|
5806
5893
|
if (config.getFeatures().includes("rules")) {
|
|
5807
5894
|
logger.info("Generating rule files...");
|
|
5808
5895
|
for (const baseDir of config.getBaseDirs()) {
|
|
5809
|
-
for (const toolTarget of (0,
|
|
5896
|
+
for (const toolTarget of (0, import_es_toolkit2.intersection)(config.getTargets(), RulesProcessor.getToolTargets())) {
|
|
5810
5897
|
const processor = new RulesProcessor({
|
|
5811
5898
|
baseDir,
|
|
5812
5899
|
toolTarget,
|
|
@@ -5845,7 +5932,7 @@ async function generateCommand(options) {
|
|
|
5845
5932
|
return supportedMcpTargets.some((supportedTarget) => supportedTarget === target);
|
|
5846
5933
|
});
|
|
5847
5934
|
for (const baseDir of config.getBaseDirs()) {
|
|
5848
|
-
for (const toolTarget of (0,
|
|
5935
|
+
for (const toolTarget of (0, import_es_toolkit2.intersection)(mcpSupportedTargets, McpProcessor.getToolTargets())) {
|
|
5849
5936
|
const processor = new McpProcessor({
|
|
5850
5937
|
baseDir,
|
|
5851
5938
|
toolTarget
|
|
@@ -5870,7 +5957,7 @@ async function generateCommand(options) {
|
|
|
5870
5957
|
if (config.getFeatures().includes("commands")) {
|
|
5871
5958
|
logger.info("Generating command files...");
|
|
5872
5959
|
for (const baseDir of config.getBaseDirs()) {
|
|
5873
|
-
for (const toolTarget of (0,
|
|
5960
|
+
for (const toolTarget of (0, import_es_toolkit2.intersection)(
|
|
5874
5961
|
config.getTargets(),
|
|
5875
5962
|
CommandsProcessor.getToolTargets({
|
|
5876
5963
|
includeSimulated: config.getExperimentalSimulateCommands()
|
|
@@ -5897,7 +5984,7 @@ async function generateCommand(options) {
|
|
|
5897
5984
|
let totalIgnoreOutputs = 0;
|
|
5898
5985
|
if (config.getFeatures().includes("ignore")) {
|
|
5899
5986
|
logger.info("Generating ignore files...");
|
|
5900
|
-
for (const toolTarget of (0,
|
|
5987
|
+
for (const toolTarget of (0, import_es_toolkit2.intersection)(config.getTargets(), IgnoreProcessor.getToolTargets())) {
|
|
5901
5988
|
for (const baseDir of config.getBaseDirs()) {
|
|
5902
5989
|
try {
|
|
5903
5990
|
const processor = new IgnoreProcessor({
|
|
@@ -5906,7 +5993,10 @@ async function generateCommand(options) {
|
|
|
5906
5993
|
});
|
|
5907
5994
|
if (config.getDelete()) {
|
|
5908
5995
|
const oldToolFiles = await processor.loadToolFiles();
|
|
5909
|
-
|
|
5996
|
+
const oldToolFilesForDelete = oldToolFiles.filter(
|
|
5997
|
+
(toolFile) => !(toolFile.getRelativeDirPath() === ClaudecodeIgnore.getSettablePaths().relativeDirPath && toolFile.getRelativeFilePath() === ClaudecodeIgnore.getSettablePaths().relativeFilePath)
|
|
5998
|
+
);
|
|
5999
|
+
await processor.removeAiFiles(oldToolFilesForDelete);
|
|
5910
6000
|
}
|
|
5911
6001
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
5912
6002
|
if (rulesyncFiles.length > 0) {
|
|
@@ -5929,7 +6019,7 @@ async function generateCommand(options) {
|
|
|
5929
6019
|
if (config.getFeatures().includes("subagents")) {
|
|
5930
6020
|
logger.info("Generating subagent files...");
|
|
5931
6021
|
for (const baseDir of config.getBaseDirs()) {
|
|
5932
|
-
for (const toolTarget of (0,
|
|
6022
|
+
for (const toolTarget of (0, import_es_toolkit2.intersection)(
|
|
5933
6023
|
config.getTargets(),
|
|
5934
6024
|
SubagentsProcessor.getToolTargets({
|
|
5935
6025
|
includeSimulated: config.getExperimentalSimulateSubagents()
|
|
@@ -5969,9 +6059,9 @@ async function generateCommand(options) {
|
|
|
5969
6059
|
}
|
|
5970
6060
|
|
|
5971
6061
|
// src/cli/commands/gitignore.ts
|
|
5972
|
-
var
|
|
6062
|
+
var import_node_path56 = require("path");
|
|
5973
6063
|
var gitignoreCommand = async () => {
|
|
5974
|
-
const gitignorePath = (0,
|
|
6064
|
+
const gitignorePath = (0, import_node_path56.join)(process.cwd(), ".gitignore");
|
|
5975
6065
|
const rulesFilesToIgnore = [
|
|
5976
6066
|
"# Generated by rulesync - AI tool configuration files",
|
|
5977
6067
|
"**/.amazonq/",
|
|
@@ -5985,6 +6075,7 @@ var gitignoreCommand = async () => {
|
|
|
5985
6075
|
"**/.claude/memories/",
|
|
5986
6076
|
"**/.claude/commands/",
|
|
5987
6077
|
"**/.claude/agents/",
|
|
6078
|
+
"**/.claude/settings.local.json",
|
|
5988
6079
|
"**/AGENTS.md",
|
|
5989
6080
|
"**/.agents/",
|
|
5990
6081
|
"**/.roo/rules/",
|
|
@@ -6161,7 +6252,7 @@ async function importCommand(options) {
|
|
|
6161
6252
|
}
|
|
6162
6253
|
|
|
6163
6254
|
// src/cli/commands/init.ts
|
|
6164
|
-
var
|
|
6255
|
+
var import_node_path57 = require("path");
|
|
6165
6256
|
async function initCommand() {
|
|
6166
6257
|
logger.info("Initializing rulesync...");
|
|
6167
6258
|
await ensureDir(RULESYNC_DIR);
|
|
@@ -6207,7 +6298,7 @@ globs: ["**/*"]
|
|
|
6207
6298
|
- Follow single responsibility principle
|
|
6208
6299
|
`
|
|
6209
6300
|
};
|
|
6210
|
-
const filepath = (0,
|
|
6301
|
+
const filepath = (0, import_node_path57.join)(RULESYNC_RULES_DIR, sampleFile.filename);
|
|
6211
6302
|
await ensureDir(RULESYNC_RULES_DIR);
|
|
6212
6303
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6213
6304
|
await ensureDir(RULESYNC_SUBAGENTS_DIR);
|
|
@@ -6226,15 +6317,15 @@ var getVersion = async () => {
|
|
|
6226
6317
|
let packageJsonPath;
|
|
6227
6318
|
if (typeof import_meta !== "undefined" && import_meta.url) {
|
|
6228
6319
|
const __filename = (0, import_node_url.fileURLToPath)(import_meta.url);
|
|
6229
|
-
const __dirname = (0,
|
|
6230
|
-
packageJsonPath = (0,
|
|
6320
|
+
const __dirname = (0, import_node_path58.join)(__filename, "..");
|
|
6321
|
+
packageJsonPath = (0, import_node_path58.join)(__dirname, "../../package.json");
|
|
6231
6322
|
} else {
|
|
6232
|
-
packageJsonPath = (0,
|
|
6323
|
+
packageJsonPath = (0, import_node_path58.join)(process.cwd(), "package.json");
|
|
6233
6324
|
}
|
|
6234
6325
|
const packageJson = await readJsonFile(packageJsonPath);
|
|
6235
6326
|
return packageJson.version;
|
|
6236
6327
|
} catch {
|
|
6237
|
-
return "1.
|
|
6328
|
+
return "1.1.0";
|
|
6238
6329
|
}
|
|
6239
6330
|
};
|
|
6240
6331
|
var main = async () => {
|