rulesync 1.0.1 → 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 -208
- package/dist/index.js +286 -192
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli/index.ts
|
|
4
|
-
import { join as
|
|
4
|
+
import { join as join57 } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
|
|
@@ -1427,15 +1427,9 @@ var ConfigResolver = class {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
};
|
|
1429
1429
|
|
|
1430
|
-
// src/ignore/ignore
|
|
1431
|
-
import { z as z9 } from "zod/mini";
|
|
1432
|
-
|
|
1433
|
-
// src/ignore/amazonqcli-ignore.ts
|
|
1430
|
+
// src/ignore/claudecode-ignore.ts
|
|
1434
1431
|
import { join as join11 } from "path";
|
|
1435
|
-
|
|
1436
|
-
// src/types/tool-file.ts
|
|
1437
|
-
var ToolFile = class extends AiFile {
|
|
1438
|
-
};
|
|
1432
|
+
import { uniq } from "es-toolkit";
|
|
1439
1433
|
|
|
1440
1434
|
// src/ignore/rulesync-ignore.ts
|
|
1441
1435
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
@@ -1459,17 +1453,20 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
1459
1453
|
}
|
|
1460
1454
|
};
|
|
1461
1455
|
|
|
1456
|
+
// src/types/tool-file.ts
|
|
1457
|
+
var ToolFile = class extends AiFile {
|
|
1458
|
+
};
|
|
1459
|
+
|
|
1462
1460
|
// src/ignore/tool-ignore.ts
|
|
1463
1461
|
var ToolIgnore = class extends ToolFile {
|
|
1464
1462
|
patterns;
|
|
1465
|
-
constructor(
|
|
1463
|
+
constructor(params) {
|
|
1466
1464
|
super({
|
|
1467
|
-
...
|
|
1465
|
+
...params,
|
|
1468
1466
|
validate: true
|
|
1469
|
-
// Skip validation during construction
|
|
1470
1467
|
});
|
|
1471
1468
|
this.patterns = this.fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1472
|
-
if (
|
|
1469
|
+
if (params.validate) {
|
|
1473
1470
|
const result = this.validate();
|
|
1474
1471
|
if (!result.success) {
|
|
1475
1472
|
throw result.error;
|
|
@@ -1501,7 +1498,90 @@ var ToolIgnore = class extends ToolFile {
|
|
|
1501
1498
|
}
|
|
1502
1499
|
};
|
|
1503
1500
|
|
|
1501
|
+
// src/ignore/claudecode-ignore.ts
|
|
1502
|
+
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
1503
|
+
constructor(params) {
|
|
1504
|
+
super(params);
|
|
1505
|
+
const jsonValue = JSON.parse(this.fileContent);
|
|
1506
|
+
this.patterns = jsonValue.permissions?.deny ?? [];
|
|
1507
|
+
}
|
|
1508
|
+
static getSettablePaths() {
|
|
1509
|
+
return {
|
|
1510
|
+
relativeDirPath: ".claude",
|
|
1511
|
+
relativeFilePath: "settings.local.json"
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
toRulesyncIgnore() {
|
|
1515
|
+
const rulesyncPatterns = this.patterns.map((pattern) => {
|
|
1516
|
+
if (pattern.startsWith("Read(") && pattern.endsWith(")")) {
|
|
1517
|
+
return pattern.slice(5, -1);
|
|
1518
|
+
}
|
|
1519
|
+
return pattern;
|
|
1520
|
+
}).filter((pattern) => pattern.length > 0);
|
|
1521
|
+
const fileContent = rulesyncPatterns.join("\n");
|
|
1522
|
+
return new RulesyncIgnore({
|
|
1523
|
+
baseDir: this.baseDir,
|
|
1524
|
+
relativeDirPath: RulesyncIgnore.getSettablePaths().relativeDirPath,
|
|
1525
|
+
relativeFilePath: RulesyncIgnore.getSettablePaths().relativeFilePath,
|
|
1526
|
+
fileContent
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
static async fromRulesyncIgnore({
|
|
1530
|
+
baseDir = ".",
|
|
1531
|
+
rulesyncIgnore
|
|
1532
|
+
}) {
|
|
1533
|
+
const fileContent = rulesyncIgnore.getFileContent();
|
|
1534
|
+
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1535
|
+
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
1536
|
+
const filePath = join11(
|
|
1537
|
+
baseDir,
|
|
1538
|
+
this.getSettablePaths().relativeDirPath,
|
|
1539
|
+
this.getSettablePaths().relativeFilePath
|
|
1540
|
+
);
|
|
1541
|
+
const exists = await fileExists(filePath);
|
|
1542
|
+
const existingFileContent = exists ? await readFileContent(filePath) : "{}";
|
|
1543
|
+
const existingJsonValue = JSON.parse(existingFileContent);
|
|
1544
|
+
const jsonValue = {
|
|
1545
|
+
...existingJsonValue,
|
|
1546
|
+
permissions: {
|
|
1547
|
+
...existingJsonValue.permissions,
|
|
1548
|
+
deny: uniq([...existingJsonValue.permissions?.deny ?? [], ...deniedValues].sort())
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
return new _ClaudecodeIgnore({
|
|
1552
|
+
baseDir,
|
|
1553
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1554
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1555
|
+
fileContent: JSON.stringify(jsonValue, null, 2),
|
|
1556
|
+
validate: true
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
static async fromFile({
|
|
1560
|
+
baseDir = ".",
|
|
1561
|
+
validate = true
|
|
1562
|
+
}) {
|
|
1563
|
+
const fileContent = await readFileContent(
|
|
1564
|
+
join11(
|
|
1565
|
+
baseDir,
|
|
1566
|
+
this.getSettablePaths().relativeDirPath,
|
|
1567
|
+
this.getSettablePaths().relativeFilePath
|
|
1568
|
+
)
|
|
1569
|
+
);
|
|
1570
|
+
return new _ClaudecodeIgnore({
|
|
1571
|
+
baseDir,
|
|
1572
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
1573
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
1574
|
+
fileContent,
|
|
1575
|
+
validate
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
};
|
|
1579
|
+
|
|
1580
|
+
// src/ignore/ignore-processor.ts
|
|
1581
|
+
import { z as z9 } from "zod/mini";
|
|
1582
|
+
|
|
1504
1583
|
// src/ignore/amazonqcli-ignore.ts
|
|
1584
|
+
import { join as join12 } from "path";
|
|
1505
1585
|
var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
1506
1586
|
static getSettablePaths() {
|
|
1507
1587
|
return {
|
|
@@ -1540,7 +1620,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1540
1620
|
validate = true
|
|
1541
1621
|
}) {
|
|
1542
1622
|
const fileContent = await readFileContent(
|
|
1543
|
-
|
|
1623
|
+
join12(
|
|
1544
1624
|
baseDir,
|
|
1545
1625
|
this.getSettablePaths().relativeDirPath,
|
|
1546
1626
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1557,7 +1637,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1557
1637
|
};
|
|
1558
1638
|
|
|
1559
1639
|
// src/ignore/augmentcode-ignore.ts
|
|
1560
|
-
import { join as
|
|
1640
|
+
import { join as join13 } from "path";
|
|
1561
1641
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
1562
1642
|
static getSettablePaths() {
|
|
1563
1643
|
return {
|
|
@@ -1595,7 +1675,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1595
1675
|
validate = true
|
|
1596
1676
|
}) {
|
|
1597
1677
|
const fileContent = await readFileContent(
|
|
1598
|
-
|
|
1678
|
+
join13(
|
|
1599
1679
|
baseDir,
|
|
1600
1680
|
this.getSettablePaths().relativeDirPath,
|
|
1601
1681
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1612,7 +1692,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
1612
1692
|
};
|
|
1613
1693
|
|
|
1614
1694
|
// src/ignore/cline-ignore.ts
|
|
1615
|
-
import { join as
|
|
1695
|
+
import { join as join14 } from "path";
|
|
1616
1696
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
1617
1697
|
static getSettablePaths() {
|
|
1618
1698
|
return {
|
|
@@ -1649,7 +1729,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1649
1729
|
validate = true
|
|
1650
1730
|
}) {
|
|
1651
1731
|
const fileContent = await readFileContent(
|
|
1652
|
-
|
|
1732
|
+
join14(
|
|
1653
1733
|
baseDir,
|
|
1654
1734
|
this.getSettablePaths().relativeDirPath,
|
|
1655
1735
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1666,7 +1746,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
1666
1746
|
};
|
|
1667
1747
|
|
|
1668
1748
|
// src/ignore/codexcli-ignore.ts
|
|
1669
|
-
import { join as
|
|
1749
|
+
import { join as join15 } from "path";
|
|
1670
1750
|
var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
1671
1751
|
static getSettablePaths() {
|
|
1672
1752
|
return {
|
|
@@ -1696,7 +1776,7 @@ var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
|
1696
1776
|
validate = true
|
|
1697
1777
|
}) {
|
|
1698
1778
|
const fileContent = await readFileContent(
|
|
1699
|
-
|
|
1779
|
+
join15(
|
|
1700
1780
|
baseDir,
|
|
1701
1781
|
this.getSettablePaths().relativeDirPath,
|
|
1702
1782
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1713,7 +1793,7 @@ var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
|
|
|
1713
1793
|
};
|
|
1714
1794
|
|
|
1715
1795
|
// src/ignore/cursor-ignore.ts
|
|
1716
|
-
import { join as
|
|
1796
|
+
import { join as join16 } from "path";
|
|
1717
1797
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
1718
1798
|
static getSettablePaths() {
|
|
1719
1799
|
return {
|
|
@@ -1746,7 +1826,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1746
1826
|
validate = true
|
|
1747
1827
|
}) {
|
|
1748
1828
|
const fileContent = await readFileContent(
|
|
1749
|
-
|
|
1829
|
+
join16(
|
|
1750
1830
|
baseDir,
|
|
1751
1831
|
this.getSettablePaths().relativeDirPath,
|
|
1752
1832
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1763,7 +1843,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
1763
1843
|
};
|
|
1764
1844
|
|
|
1765
1845
|
// src/ignore/geminicli-ignore.ts
|
|
1766
|
-
import { join as
|
|
1846
|
+
import { join as join17 } from "path";
|
|
1767
1847
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
1768
1848
|
static getSettablePaths() {
|
|
1769
1849
|
return {
|
|
@@ -1790,7 +1870,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
1790
1870
|
validate = true
|
|
1791
1871
|
}) {
|
|
1792
1872
|
const fileContent = await readFileContent(
|
|
1793
|
-
|
|
1873
|
+
join17(
|
|
1794
1874
|
baseDir,
|
|
1795
1875
|
this.getSettablePaths().relativeDirPath,
|
|
1796
1876
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1807,7 +1887,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
1807
1887
|
};
|
|
1808
1888
|
|
|
1809
1889
|
// src/ignore/junie-ignore.ts
|
|
1810
|
-
import { join as
|
|
1890
|
+
import { join as join18 } from "path";
|
|
1811
1891
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
1812
1892
|
static getSettablePaths() {
|
|
1813
1893
|
return {
|
|
@@ -1834,7 +1914,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
1834
1914
|
validate = true
|
|
1835
1915
|
}) {
|
|
1836
1916
|
const fileContent = await readFileContent(
|
|
1837
|
-
|
|
1917
|
+
join18(
|
|
1838
1918
|
baseDir,
|
|
1839
1919
|
this.getSettablePaths().relativeDirPath,
|
|
1840
1920
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1851,7 +1931,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
1851
1931
|
};
|
|
1852
1932
|
|
|
1853
1933
|
// src/ignore/kiro-ignore.ts
|
|
1854
|
-
import { join as
|
|
1934
|
+
import { join as join19 } from "path";
|
|
1855
1935
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
1856
1936
|
static getSettablePaths() {
|
|
1857
1937
|
return {
|
|
@@ -1878,7 +1958,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
1878
1958
|
validate = true
|
|
1879
1959
|
}) {
|
|
1880
1960
|
const fileContent = await readFileContent(
|
|
1881
|
-
|
|
1961
|
+
join19(
|
|
1882
1962
|
baseDir,
|
|
1883
1963
|
this.getSettablePaths().relativeDirPath,
|
|
1884
1964
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1895,7 +1975,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
1895
1975
|
};
|
|
1896
1976
|
|
|
1897
1977
|
// src/ignore/qwencode-ignore.ts
|
|
1898
|
-
import { join as
|
|
1978
|
+
import { join as join20 } from "path";
|
|
1899
1979
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
1900
1980
|
static getSettablePaths() {
|
|
1901
1981
|
return {
|
|
@@ -1922,7 +2002,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
1922
2002
|
validate = true
|
|
1923
2003
|
}) {
|
|
1924
2004
|
const fileContent = await readFileContent(
|
|
1925
|
-
|
|
2005
|
+
join20(
|
|
1926
2006
|
baseDir,
|
|
1927
2007
|
this.getSettablePaths().relativeDirPath,
|
|
1928
2008
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1939,7 +2019,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
1939
2019
|
};
|
|
1940
2020
|
|
|
1941
2021
|
// src/ignore/roo-ignore.ts
|
|
1942
|
-
import { join as
|
|
2022
|
+
import { join as join21 } from "path";
|
|
1943
2023
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
1944
2024
|
static getSettablePaths() {
|
|
1945
2025
|
return {
|
|
@@ -1966,7 +2046,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
1966
2046
|
validate = true
|
|
1967
2047
|
}) {
|
|
1968
2048
|
const fileContent = await readFileContent(
|
|
1969
|
-
|
|
2049
|
+
join21(
|
|
1970
2050
|
baseDir,
|
|
1971
2051
|
this.getSettablePaths().relativeDirPath,
|
|
1972
2052
|
this.getSettablePaths().relativeFilePath
|
|
@@ -1983,7 +2063,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
1983
2063
|
};
|
|
1984
2064
|
|
|
1985
2065
|
// src/ignore/windsurf-ignore.ts
|
|
1986
|
-
import { join as
|
|
2066
|
+
import { join as join22 } from "path";
|
|
1987
2067
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
1988
2068
|
static getSettablePaths() {
|
|
1989
2069
|
return {
|
|
@@ -2010,7 +2090,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2010
2090
|
validate = true
|
|
2011
2091
|
}) {
|
|
2012
2092
|
const fileContent = await readFileContent(
|
|
2013
|
-
|
|
2093
|
+
join22(
|
|
2014
2094
|
baseDir,
|
|
2015
2095
|
this.getSettablePaths().relativeDirPath,
|
|
2016
2096
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2030,6 +2110,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2030
2110
|
var ignoreProcessorToolTargets = [
|
|
2031
2111
|
"amazonqcli",
|
|
2032
2112
|
"augmentcode",
|
|
2113
|
+
"claudecode",
|
|
2033
2114
|
"cline",
|
|
2034
2115
|
"codexcli",
|
|
2035
2116
|
"cursor",
|
|
@@ -2085,6 +2166,8 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2085
2166
|
return [await AmazonqcliIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2086
2167
|
case "augmentcode":
|
|
2087
2168
|
return [await AugmentcodeIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2169
|
+
case "claudecode":
|
|
2170
|
+
return [await ClaudecodeIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2088
2171
|
case "cline":
|
|
2089
2172
|
return [await ClineIgnore.fromFile({ baseDir: this.baseDir })];
|
|
2090
2173
|
case "codexcli":
|
|
@@ -2118,67 +2201,74 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2118
2201
|
if (!rulesyncIgnore) {
|
|
2119
2202
|
throw new Error(`No .rulesyncignore found.`);
|
|
2120
2203
|
}
|
|
2121
|
-
const toolIgnores =
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
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
|
-
|
|
2204
|
+
const toolIgnores = await Promise.all(
|
|
2205
|
+
[rulesyncIgnore].map(async (rulesyncIgnore2) => {
|
|
2206
|
+
switch (this.toolTarget) {
|
|
2207
|
+
case "amazonqcli":
|
|
2208
|
+
return AmazonqcliIgnore.fromRulesyncIgnore({
|
|
2209
|
+
baseDir: this.baseDir,
|
|
2210
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2211
|
+
});
|
|
2212
|
+
case "augmentcode":
|
|
2213
|
+
return AugmentcodeIgnore.fromRulesyncIgnore({
|
|
2214
|
+
baseDir: this.baseDir,
|
|
2215
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2216
|
+
});
|
|
2217
|
+
case "claudecode":
|
|
2218
|
+
return await ClaudecodeIgnore.fromRulesyncIgnore({
|
|
2219
|
+
baseDir: this.baseDir,
|
|
2220
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2221
|
+
});
|
|
2222
|
+
case "cline":
|
|
2223
|
+
return ClineIgnore.fromRulesyncIgnore({
|
|
2224
|
+
baseDir: this.baseDir,
|
|
2225
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2226
|
+
});
|
|
2227
|
+
case "codexcli":
|
|
2228
|
+
return CodexcliIgnore.fromRulesyncIgnore({
|
|
2229
|
+
baseDir: this.baseDir,
|
|
2230
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2231
|
+
});
|
|
2232
|
+
case "cursor":
|
|
2233
|
+
return CursorIgnore.fromRulesyncIgnore({
|
|
2234
|
+
baseDir: this.baseDir,
|
|
2235
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2236
|
+
});
|
|
2237
|
+
case "geminicli":
|
|
2238
|
+
return GeminiCliIgnore.fromRulesyncIgnore({
|
|
2239
|
+
baseDir: this.baseDir,
|
|
2240
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2241
|
+
});
|
|
2242
|
+
case "junie":
|
|
2243
|
+
return JunieIgnore.fromRulesyncIgnore({
|
|
2244
|
+
baseDir: this.baseDir,
|
|
2245
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2246
|
+
});
|
|
2247
|
+
case "kiro":
|
|
2248
|
+
return KiroIgnore.fromRulesyncIgnore({
|
|
2249
|
+
baseDir: this.baseDir,
|
|
2250
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2251
|
+
});
|
|
2252
|
+
case "qwencode":
|
|
2253
|
+
return QwencodeIgnore.fromRulesyncIgnore({
|
|
2254
|
+
baseDir: this.baseDir,
|
|
2255
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2256
|
+
});
|
|
2257
|
+
case "roo":
|
|
2258
|
+
return RooIgnore.fromRulesyncIgnore({
|
|
2259
|
+
baseDir: this.baseDir,
|
|
2260
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2261
|
+
});
|
|
2262
|
+
case "windsurf":
|
|
2263
|
+
return WindsurfIgnore.fromRulesyncIgnore({
|
|
2264
|
+
baseDir: this.baseDir,
|
|
2265
|
+
rulesyncIgnore: rulesyncIgnore2
|
|
2266
|
+
});
|
|
2267
|
+
default:
|
|
2268
|
+
throw new Error(`Unsupported tool target: ${this.toolTarget}`);
|
|
2269
|
+
}
|
|
2270
|
+
})
|
|
2271
|
+
);
|
|
2182
2272
|
return toolIgnores;
|
|
2183
2273
|
}
|
|
2184
2274
|
/**
|
|
@@ -2205,10 +2295,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2205
2295
|
import { z as z11 } from "zod/mini";
|
|
2206
2296
|
|
|
2207
2297
|
// src/mcp/amazonqcli-mcp.ts
|
|
2208
|
-
import { join as
|
|
2298
|
+
import { join as join24 } from "path";
|
|
2209
2299
|
|
|
2210
2300
|
// src/mcp/rulesync-mcp.ts
|
|
2211
|
-
import { join as
|
|
2301
|
+
import { join as join23 } from "path";
|
|
2212
2302
|
import { z as z10 } from "zod/mini";
|
|
2213
2303
|
var McpTransportTypeSchema = z10.enum(["stdio", "sse", "http"]);
|
|
2214
2304
|
var McpServerBaseSchema = z10.object({
|
|
@@ -2259,7 +2349,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2259
2349
|
}
|
|
2260
2350
|
static async fromFile({ validate = true }) {
|
|
2261
2351
|
const fileContent = await readFileContent(
|
|
2262
|
-
|
|
2352
|
+
join23(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
|
|
2263
2353
|
);
|
|
2264
2354
|
return new _RulesyncMcp({
|
|
2265
2355
|
baseDir: ".",
|
|
@@ -2326,7 +2416,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2326
2416
|
validate = true
|
|
2327
2417
|
}) {
|
|
2328
2418
|
const fileContent = await readFileContent(
|
|
2329
|
-
|
|
2419
|
+
join24(
|
|
2330
2420
|
baseDir,
|
|
2331
2421
|
this.getSettablePaths().relativeDirPath,
|
|
2332
2422
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2362,7 +2452,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2362
2452
|
};
|
|
2363
2453
|
|
|
2364
2454
|
// src/mcp/claudecode-mcp.ts
|
|
2365
|
-
import { join as
|
|
2455
|
+
import { join as join25 } from "path";
|
|
2366
2456
|
var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
2367
2457
|
static getSettablePaths() {
|
|
2368
2458
|
return {
|
|
@@ -2375,7 +2465,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2375
2465
|
validate = true
|
|
2376
2466
|
}) {
|
|
2377
2467
|
const fileContent = await readFileContent(
|
|
2378
|
-
|
|
2468
|
+
join25(
|
|
2379
2469
|
baseDir,
|
|
2380
2470
|
this.getSettablePaths().relativeDirPath,
|
|
2381
2471
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2411,7 +2501,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2411
2501
|
};
|
|
2412
2502
|
|
|
2413
2503
|
// src/mcp/cline-mcp.ts
|
|
2414
|
-
import { join as
|
|
2504
|
+
import { join as join26 } from "path";
|
|
2415
2505
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
2416
2506
|
static getSettablePaths() {
|
|
2417
2507
|
return {
|
|
@@ -2424,7 +2514,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2424
2514
|
validate = true
|
|
2425
2515
|
}) {
|
|
2426
2516
|
const fileContent = await readFileContent(
|
|
2427
|
-
|
|
2517
|
+
join26(
|
|
2428
2518
|
baseDir,
|
|
2429
2519
|
this.getSettablePaths().relativeDirPath,
|
|
2430
2520
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2460,7 +2550,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
2460
2550
|
};
|
|
2461
2551
|
|
|
2462
2552
|
// src/mcp/copilot-mcp.ts
|
|
2463
|
-
import { join as
|
|
2553
|
+
import { join as join27 } from "path";
|
|
2464
2554
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
2465
2555
|
static getSettablePaths() {
|
|
2466
2556
|
return {
|
|
@@ -2473,7 +2563,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2473
2563
|
validate = true
|
|
2474
2564
|
}) {
|
|
2475
2565
|
const fileContent = await readFileContent(
|
|
2476
|
-
|
|
2566
|
+
join27(
|
|
2477
2567
|
baseDir,
|
|
2478
2568
|
this.getSettablePaths().relativeDirPath,
|
|
2479
2569
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2509,7 +2599,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
2509
2599
|
};
|
|
2510
2600
|
|
|
2511
2601
|
// src/mcp/cursor-mcp.ts
|
|
2512
|
-
import { join as
|
|
2602
|
+
import { join as join28 } from "path";
|
|
2513
2603
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
2514
2604
|
static getSettablePaths() {
|
|
2515
2605
|
return {
|
|
@@ -2522,7 +2612,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2522
2612
|
validate = true
|
|
2523
2613
|
}) {
|
|
2524
2614
|
const fileContent = await readFileContent(
|
|
2525
|
-
|
|
2615
|
+
join28(
|
|
2526
2616
|
baseDir,
|
|
2527
2617
|
this.getSettablePaths().relativeDirPath,
|
|
2528
2618
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2569,7 +2659,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
2569
2659
|
};
|
|
2570
2660
|
|
|
2571
2661
|
// src/mcp/roo-mcp.ts
|
|
2572
|
-
import { join as
|
|
2662
|
+
import { join as join29 } from "path";
|
|
2573
2663
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
2574
2664
|
static getSettablePaths() {
|
|
2575
2665
|
return {
|
|
@@ -2582,7 +2672,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
2582
2672
|
validate = true
|
|
2583
2673
|
}) {
|
|
2584
2674
|
const fileContent = await readFileContent(
|
|
2585
|
-
|
|
2675
|
+
join29(
|
|
2586
2676
|
baseDir,
|
|
2587
2677
|
this.getSettablePaths().relativeDirPath,
|
|
2588
2678
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2786,20 +2876,20 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
2786
2876
|
};
|
|
2787
2877
|
|
|
2788
2878
|
// src/rules/rules-processor.ts
|
|
2789
|
-
import { basename as basename16, join as
|
|
2879
|
+
import { basename as basename16, join as join54 } from "path";
|
|
2790
2880
|
import { XMLBuilder } from "fast-xml-parser";
|
|
2791
2881
|
import { z as z20 } from "zod/mini";
|
|
2792
2882
|
|
|
2793
2883
|
// src/constants/paths.ts
|
|
2794
|
-
import { join as
|
|
2884
|
+
import { join as join30 } from "path";
|
|
2795
2885
|
var RULESYNC_DIR = ".rulesync";
|
|
2796
|
-
var RULESYNC_RULES_DIR =
|
|
2886
|
+
var RULESYNC_RULES_DIR = join30(".rulesync", "rules");
|
|
2797
2887
|
var RULESYNC_RULES_DIR_LEGACY = ".rulesync";
|
|
2798
|
-
var RULESYNC_MCP_FILE =
|
|
2799
|
-
var RULESYNC_SUBAGENTS_DIR =
|
|
2888
|
+
var RULESYNC_MCP_FILE = join30(".rulesync", ".mcp.json");
|
|
2889
|
+
var RULESYNC_SUBAGENTS_DIR = join30(".rulesync", "subagents");
|
|
2800
2890
|
|
|
2801
2891
|
// src/subagents/simulated-subagent.ts
|
|
2802
|
-
import { basename as basename11, join as
|
|
2892
|
+
import { basename as basename11, join as join31 } from "path";
|
|
2803
2893
|
import { z as z12 } from "zod/mini";
|
|
2804
2894
|
|
|
2805
2895
|
// src/subagents/tool-subagent.ts
|
|
@@ -2901,7 +2991,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
2901
2991
|
relativeFilePath,
|
|
2902
2992
|
validate = true
|
|
2903
2993
|
}) {
|
|
2904
|
-
const filePath =
|
|
2994
|
+
const filePath = join31(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2905
2995
|
const fileContent = await readFileContent(filePath);
|
|
2906
2996
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2907
2997
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3035,15 +3125,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3035
3125
|
};
|
|
3036
3126
|
|
|
3037
3127
|
// src/subagents/subagents-processor.ts
|
|
3038
|
-
import { basename as basename13, join as
|
|
3128
|
+
import { basename as basename13, join as join34 } from "path";
|
|
3039
3129
|
import { z as z15 } from "zod/mini";
|
|
3040
3130
|
|
|
3041
3131
|
// src/subagents/claudecode-subagent.ts
|
|
3042
|
-
import { join as
|
|
3132
|
+
import { join as join33 } from "path";
|
|
3043
3133
|
import { z as z14 } from "zod/mini";
|
|
3044
3134
|
|
|
3045
3135
|
// src/subagents/rulesync-subagent.ts
|
|
3046
|
-
import { basename as basename12, join as
|
|
3136
|
+
import { basename as basename12, join as join32 } from "path";
|
|
3047
3137
|
import { z as z13 } from "zod/mini";
|
|
3048
3138
|
var RulesyncSubagentModelSchema = z13.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3049
3139
|
var RulesyncSubagentFrontmatterSchema = z13.object({
|
|
@@ -3097,7 +3187,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3097
3187
|
static async fromFile({
|
|
3098
3188
|
relativeFilePath
|
|
3099
3189
|
}) {
|
|
3100
|
-
const fileContent = await readFileContent(
|
|
3190
|
+
const fileContent = await readFileContent(join32(RULESYNC_SUBAGENTS_DIR, relativeFilePath));
|
|
3101
3191
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3102
3192
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3103
3193
|
if (!result.success) {
|
|
@@ -3215,7 +3305,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3215
3305
|
relativeFilePath,
|
|
3216
3306
|
validate = true
|
|
3217
3307
|
}) {
|
|
3218
|
-
const fileContent = await readFileContent(
|
|
3308
|
+
const fileContent = await readFileContent(join33(baseDir, ".claude/agents", relativeFilePath));
|
|
3219
3309
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3220
3310
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3221
3311
|
if (!result.success) {
|
|
@@ -3346,7 +3436,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3346
3436
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
3347
3437
|
*/
|
|
3348
3438
|
async loadRulesyncFiles() {
|
|
3349
|
-
const subagentsDir =
|
|
3439
|
+
const subagentsDir = join34(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
3350
3440
|
const dirExists = await directoryExists(subagentsDir);
|
|
3351
3441
|
if (!dirExists) {
|
|
3352
3442
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -3361,7 +3451,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3361
3451
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
3362
3452
|
const rulesyncSubagents = [];
|
|
3363
3453
|
for (const mdFile of mdFiles) {
|
|
3364
|
-
const filepath =
|
|
3454
|
+
const filepath = join34(subagentsDir, mdFile);
|
|
3365
3455
|
try {
|
|
3366
3456
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
3367
3457
|
relativeFilePath: mdFile,
|
|
@@ -3461,7 +3551,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3461
3551
|
relativeDirPath,
|
|
3462
3552
|
fromFile
|
|
3463
3553
|
}) {
|
|
3464
|
-
const paths = await findFilesByGlobs(
|
|
3554
|
+
const paths = await findFilesByGlobs(join34(this.baseDir, relativeDirPath, "*.md"));
|
|
3465
3555
|
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile(basename13(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
3466
3556
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
3467
3557
|
return subagents;
|
|
@@ -3486,13 +3576,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
3486
3576
|
};
|
|
3487
3577
|
|
|
3488
3578
|
// src/rules/agentsmd-rule.ts
|
|
3489
|
-
import { join as
|
|
3579
|
+
import { join as join37 } from "path";
|
|
3490
3580
|
|
|
3491
3581
|
// src/rules/tool-rule.ts
|
|
3492
|
-
import { join as
|
|
3582
|
+
import { join as join36 } from "path";
|
|
3493
3583
|
|
|
3494
3584
|
// src/rules/rulesync-rule.ts
|
|
3495
|
-
import { basename as basename14, join as
|
|
3585
|
+
import { basename as basename14, join as join35 } from "path";
|
|
3496
3586
|
import { z as z16 } from "zod/mini";
|
|
3497
3587
|
var RulesyncRuleFrontmatterSchema = z16.object({
|
|
3498
3588
|
root: z16.optional(z16.optional(z16.boolean())),
|
|
@@ -3558,7 +3648,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3558
3648
|
relativeFilePath,
|
|
3559
3649
|
validate = true
|
|
3560
3650
|
}) {
|
|
3561
|
-
const filePath =
|
|
3651
|
+
const filePath = join35(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
|
|
3562
3652
|
const fileContent = await readFileContent(filePath);
|
|
3563
3653
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3564
3654
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3587,7 +3677,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
3587
3677
|
relativeFilePath,
|
|
3588
3678
|
validate = true
|
|
3589
3679
|
}) {
|
|
3590
|
-
const filePath =
|
|
3680
|
+
const filePath = join35(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
|
|
3591
3681
|
const fileContent = await readFileContent(filePath);
|
|
3592
3682
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3593
3683
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3669,7 +3759,7 @@ var ToolRule = class extends ToolFile {
|
|
|
3669
3759
|
});
|
|
3670
3760
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
3671
3761
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
3672
|
-
params.relativeDirPath =
|
|
3762
|
+
params.relativeDirPath = join36(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
3673
3763
|
params.relativeFilePath = "AGENTS.md";
|
|
3674
3764
|
}
|
|
3675
3765
|
return params;
|
|
@@ -3744,8 +3834,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3744
3834
|
validate = true
|
|
3745
3835
|
}) {
|
|
3746
3836
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
3747
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
3748
|
-
const fileContent = await readFileContent(
|
|
3837
|
+
const relativePath = isRoot ? "AGENTS.md" : join37(".agents/memories", relativeFilePath);
|
|
3838
|
+
const fileContent = await readFileContent(join37(baseDir, relativePath));
|
|
3749
3839
|
return new _AgentsMdRule({
|
|
3750
3840
|
baseDir,
|
|
3751
3841
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -3785,7 +3875,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
3785
3875
|
};
|
|
3786
3876
|
|
|
3787
3877
|
// src/rules/amazonqcli-rule.ts
|
|
3788
|
-
import { join as
|
|
3878
|
+
import { join as join38 } from "path";
|
|
3789
3879
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
3790
3880
|
static getSettablePaths() {
|
|
3791
3881
|
return {
|
|
@@ -3800,7 +3890,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3800
3890
|
validate = true
|
|
3801
3891
|
}) {
|
|
3802
3892
|
const fileContent = await readFileContent(
|
|
3803
|
-
|
|
3893
|
+
join38(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3804
3894
|
);
|
|
3805
3895
|
return new _AmazonQCliRule({
|
|
3806
3896
|
baseDir,
|
|
@@ -3840,7 +3930,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
3840
3930
|
};
|
|
3841
3931
|
|
|
3842
3932
|
// src/rules/augmentcode-legacy-rule.ts
|
|
3843
|
-
import { join as
|
|
3933
|
+
import { join as join39 } from "path";
|
|
3844
3934
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
3845
3935
|
toRulesyncRule() {
|
|
3846
3936
|
const rulesyncFrontmatter = {
|
|
@@ -3900,8 +3990,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3900
3990
|
}) {
|
|
3901
3991
|
const settablePaths = this.getSettablePaths();
|
|
3902
3992
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
3903
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath :
|
|
3904
|
-
const fileContent = await readFileContent(
|
|
3993
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : join39(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
3994
|
+
const fileContent = await readFileContent(join39(baseDir, relativePath));
|
|
3905
3995
|
return new _AugmentcodeLegacyRule({
|
|
3906
3996
|
baseDir,
|
|
3907
3997
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -3914,7 +4004,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
3914
4004
|
};
|
|
3915
4005
|
|
|
3916
4006
|
// src/rules/augmentcode-rule.ts
|
|
3917
|
-
import { join as
|
|
4007
|
+
import { join as join40 } from "path";
|
|
3918
4008
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
3919
4009
|
toRulesyncRule() {
|
|
3920
4010
|
return this.toRulesyncRuleDefault();
|
|
@@ -3946,7 +4036,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3946
4036
|
validate = true
|
|
3947
4037
|
}) {
|
|
3948
4038
|
const fileContent = await readFileContent(
|
|
3949
|
-
|
|
4039
|
+
join40(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
3950
4040
|
);
|
|
3951
4041
|
const { body: content } = parseFrontmatter(fileContent);
|
|
3952
4042
|
return new _AugmentcodeRule({
|
|
@@ -3969,7 +4059,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
3969
4059
|
};
|
|
3970
4060
|
|
|
3971
4061
|
// src/rules/claudecode-rule.ts
|
|
3972
|
-
import { join as
|
|
4062
|
+
import { join as join41 } from "path";
|
|
3973
4063
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
3974
4064
|
static getSettablePaths() {
|
|
3975
4065
|
return {
|
|
@@ -3988,8 +4078,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
3988
4078
|
validate = true
|
|
3989
4079
|
}) {
|
|
3990
4080
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
3991
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
3992
|
-
const fileContent = await readFileContent(
|
|
4081
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join41(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4082
|
+
const fileContent = await readFileContent(join41(baseDir, relativePath));
|
|
3993
4083
|
return new _ClaudecodeRule({
|
|
3994
4084
|
baseDir,
|
|
3995
4085
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4029,7 +4119,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4029
4119
|
};
|
|
4030
4120
|
|
|
4031
4121
|
// src/rules/cline-rule.ts
|
|
4032
|
-
import { join as
|
|
4122
|
+
import { join as join42 } from "path";
|
|
4033
4123
|
import { z as z17 } from "zod/mini";
|
|
4034
4124
|
var ClineRuleFrontmatterSchema = z17.object({
|
|
4035
4125
|
description: z17.string()
|
|
@@ -4074,7 +4164,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4074
4164
|
validate = true
|
|
4075
4165
|
}) {
|
|
4076
4166
|
const fileContent = await readFileContent(
|
|
4077
|
-
|
|
4167
|
+
join42(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4078
4168
|
);
|
|
4079
4169
|
return new _ClineRule({
|
|
4080
4170
|
baseDir,
|
|
@@ -4087,7 +4177,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4087
4177
|
};
|
|
4088
4178
|
|
|
4089
4179
|
// src/rules/codexcli-rule.ts
|
|
4090
|
-
import { join as
|
|
4180
|
+
import { join as join43 } from "path";
|
|
4091
4181
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4092
4182
|
static getSettablePaths() {
|
|
4093
4183
|
return {
|
|
@@ -4106,8 +4196,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4106
4196
|
validate = true
|
|
4107
4197
|
}) {
|
|
4108
4198
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4109
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4110
|
-
const fileContent = await readFileContent(
|
|
4199
|
+
const relativePath = isRoot ? "AGENTS.md" : join43(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4200
|
+
const fileContent = await readFileContent(join43(baseDir, relativePath));
|
|
4111
4201
|
return new _CodexcliRule({
|
|
4112
4202
|
baseDir,
|
|
4113
4203
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4147,7 +4237,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4147
4237
|
};
|
|
4148
4238
|
|
|
4149
4239
|
// src/rules/copilot-rule.ts
|
|
4150
|
-
import { join as
|
|
4240
|
+
import { join as join44 } from "path";
|
|
4151
4241
|
import { z as z18 } from "zod/mini";
|
|
4152
4242
|
var CopilotRuleFrontmatterSchema = z18.object({
|
|
4153
4243
|
description: z18.optional(z18.string()),
|
|
@@ -4239,11 +4329,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4239
4329
|
validate = true
|
|
4240
4330
|
}) {
|
|
4241
4331
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
4242
|
-
const relativePath = isRoot ?
|
|
4332
|
+
const relativePath = isRoot ? join44(
|
|
4243
4333
|
this.getSettablePaths().root.relativeDirPath,
|
|
4244
4334
|
this.getSettablePaths().root.relativeFilePath
|
|
4245
|
-
) :
|
|
4246
|
-
const fileContent = await readFileContent(
|
|
4335
|
+
) : join44(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4336
|
+
const fileContent = await readFileContent(join44(baseDir, relativePath));
|
|
4247
4337
|
if (isRoot) {
|
|
4248
4338
|
return new _CopilotRule({
|
|
4249
4339
|
baseDir,
|
|
@@ -4262,7 +4352,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4262
4352
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4263
4353
|
if (!result.success) {
|
|
4264
4354
|
throw new Error(
|
|
4265
|
-
`Invalid frontmatter in ${
|
|
4355
|
+
`Invalid frontmatter in ${join44(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4266
4356
|
);
|
|
4267
4357
|
}
|
|
4268
4358
|
return new _CopilotRule({
|
|
@@ -4301,7 +4391,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
4301
4391
|
};
|
|
4302
4392
|
|
|
4303
4393
|
// src/rules/cursor-rule.ts
|
|
4304
|
-
import { basename as basename15, join as
|
|
4394
|
+
import { basename as basename15, join as join45 } from "path";
|
|
4305
4395
|
import { z as z19 } from "zod/mini";
|
|
4306
4396
|
var CursorRuleFrontmatterSchema = z19.object({
|
|
4307
4397
|
description: z19.optional(z19.string()),
|
|
@@ -4428,13 +4518,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4428
4518
|
validate = true
|
|
4429
4519
|
}) {
|
|
4430
4520
|
const fileContent = await readFileContent(
|
|
4431
|
-
|
|
4521
|
+
join45(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4432
4522
|
);
|
|
4433
4523
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
4434
4524
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4435
4525
|
if (!result.success) {
|
|
4436
4526
|
throw new Error(
|
|
4437
|
-
`Invalid frontmatter in ${
|
|
4527
|
+
`Invalid frontmatter in ${join45(baseDir, relativeFilePath)}: ${result.error.message}`
|
|
4438
4528
|
);
|
|
4439
4529
|
}
|
|
4440
4530
|
return new _CursorRule({
|
|
@@ -4472,7 +4562,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
4472
4562
|
};
|
|
4473
4563
|
|
|
4474
4564
|
// src/rules/geminicli-rule.ts
|
|
4475
|
-
import { join as
|
|
4565
|
+
import { join as join46 } from "path";
|
|
4476
4566
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
4477
4567
|
static getSettablePaths() {
|
|
4478
4568
|
return {
|
|
@@ -4491,8 +4581,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4491
4581
|
validate = true
|
|
4492
4582
|
}) {
|
|
4493
4583
|
const isRoot = relativeFilePath === "GEMINI.md";
|
|
4494
|
-
const relativePath = isRoot ? "GEMINI.md" :
|
|
4495
|
-
const fileContent = await readFileContent(
|
|
4584
|
+
const relativePath = isRoot ? "GEMINI.md" : join46(".gemini/memories", relativeFilePath);
|
|
4585
|
+
const fileContent = await readFileContent(join46(baseDir, relativePath));
|
|
4496
4586
|
return new _GeminiCliRule({
|
|
4497
4587
|
baseDir,
|
|
4498
4588
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4532,7 +4622,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
4532
4622
|
};
|
|
4533
4623
|
|
|
4534
4624
|
// src/rules/junie-rule.ts
|
|
4535
|
-
import { join as
|
|
4625
|
+
import { join as join47 } from "path";
|
|
4536
4626
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
4537
4627
|
static getSettablePaths() {
|
|
4538
4628
|
return {
|
|
@@ -4551,8 +4641,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4551
4641
|
validate = true
|
|
4552
4642
|
}) {
|
|
4553
4643
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
4554
|
-
const relativePath = isRoot ? "guidelines.md" :
|
|
4555
|
-
const fileContent = await readFileContent(
|
|
4644
|
+
const relativePath = isRoot ? "guidelines.md" : join47(".junie/memories", relativeFilePath);
|
|
4645
|
+
const fileContent = await readFileContent(join47(baseDir, relativePath));
|
|
4556
4646
|
return new _JunieRule({
|
|
4557
4647
|
baseDir,
|
|
4558
4648
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4592,7 +4682,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
4592
4682
|
};
|
|
4593
4683
|
|
|
4594
4684
|
// src/rules/kiro-rule.ts
|
|
4595
|
-
import { join as
|
|
4685
|
+
import { join as join48 } from "path";
|
|
4596
4686
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
4597
4687
|
static getSettablePaths() {
|
|
4598
4688
|
return {
|
|
@@ -4607,7 +4697,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4607
4697
|
validate = true
|
|
4608
4698
|
}) {
|
|
4609
4699
|
const fileContent = await readFileContent(
|
|
4610
|
-
|
|
4700
|
+
join48(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4611
4701
|
);
|
|
4612
4702
|
return new _KiroRule({
|
|
4613
4703
|
baseDir,
|
|
@@ -4647,7 +4737,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
4647
4737
|
};
|
|
4648
4738
|
|
|
4649
4739
|
// src/rules/opencode-rule.ts
|
|
4650
|
-
import { join as
|
|
4740
|
+
import { join as join49 } from "path";
|
|
4651
4741
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
4652
4742
|
static getSettablePaths() {
|
|
4653
4743
|
return {
|
|
@@ -4666,8 +4756,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4666
4756
|
validate = true
|
|
4667
4757
|
}) {
|
|
4668
4758
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4669
|
-
const relativePath = isRoot ? "AGENTS.md" :
|
|
4670
|
-
const fileContent = await readFileContent(
|
|
4759
|
+
const relativePath = isRoot ? "AGENTS.md" : join49(".opencode/memories", relativeFilePath);
|
|
4760
|
+
const fileContent = await readFileContent(join49(baseDir, relativePath));
|
|
4671
4761
|
return new _OpenCodeRule({
|
|
4672
4762
|
baseDir,
|
|
4673
4763
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4707,7 +4797,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
4707
4797
|
};
|
|
4708
4798
|
|
|
4709
4799
|
// src/rules/qwencode-rule.ts
|
|
4710
|
-
import { join as
|
|
4800
|
+
import { join as join50 } from "path";
|
|
4711
4801
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
4712
4802
|
static getSettablePaths() {
|
|
4713
4803
|
return {
|
|
@@ -4726,8 +4816,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4726
4816
|
validate = true
|
|
4727
4817
|
}) {
|
|
4728
4818
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
4729
|
-
const relativePath = isRoot ? "QWEN.md" :
|
|
4730
|
-
const fileContent = await readFileContent(
|
|
4819
|
+
const relativePath = isRoot ? "QWEN.md" : join50(".qwen/memories", relativeFilePath);
|
|
4820
|
+
const fileContent = await readFileContent(join50(baseDir, relativePath));
|
|
4731
4821
|
return new _QwencodeRule({
|
|
4732
4822
|
baseDir,
|
|
4733
4823
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4764,7 +4854,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
4764
4854
|
};
|
|
4765
4855
|
|
|
4766
4856
|
// src/rules/roo-rule.ts
|
|
4767
|
-
import { join as
|
|
4857
|
+
import { join as join51 } from "path";
|
|
4768
4858
|
var RooRule = class _RooRule extends ToolRule {
|
|
4769
4859
|
static getSettablePaths() {
|
|
4770
4860
|
return {
|
|
@@ -4779,7 +4869,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4779
4869
|
validate = true
|
|
4780
4870
|
}) {
|
|
4781
4871
|
const fileContent = await readFileContent(
|
|
4782
|
-
|
|
4872
|
+
join51(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4783
4873
|
);
|
|
4784
4874
|
return new _RooRule({
|
|
4785
4875
|
baseDir,
|
|
@@ -4834,7 +4924,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
4834
4924
|
};
|
|
4835
4925
|
|
|
4836
4926
|
// src/rules/warp-rule.ts
|
|
4837
|
-
import { join as
|
|
4927
|
+
import { join as join52 } from "path";
|
|
4838
4928
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
4839
4929
|
constructor({ fileContent, root, ...rest }) {
|
|
4840
4930
|
super({
|
|
@@ -4860,8 +4950,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4860
4950
|
validate = true
|
|
4861
4951
|
}) {
|
|
4862
4952
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
4863
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath :
|
|
4864
|
-
const fileContent = await readFileContent(
|
|
4953
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join52(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
4954
|
+
const fileContent = await readFileContent(join52(baseDir, relativePath));
|
|
4865
4955
|
return new _WarpRule({
|
|
4866
4956
|
baseDir,
|
|
4867
4957
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -4901,7 +4991,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
4901
4991
|
};
|
|
4902
4992
|
|
|
4903
4993
|
// src/rules/windsurf-rule.ts
|
|
4904
|
-
import { join as
|
|
4994
|
+
import { join as join53 } from "path";
|
|
4905
4995
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
4906
4996
|
static getSettablePaths() {
|
|
4907
4997
|
return {
|
|
@@ -4916,7 +5006,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
4916
5006
|
validate = true
|
|
4917
5007
|
}) {
|
|
4918
5008
|
const fileContent = await readFileContent(
|
|
4919
|
-
|
|
5009
|
+
join53(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4920
5010
|
);
|
|
4921
5011
|
return new _WindsurfRule({
|
|
4922
5012
|
baseDir,
|
|
@@ -5295,14 +5385,14 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5295
5385
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
5296
5386
|
*/
|
|
5297
5387
|
async loadRulesyncFiles() {
|
|
5298
|
-
const files = await findFilesByGlobs(
|
|
5388
|
+
const files = await findFilesByGlobs(join54(RULESYNC_RULES_DIR, "*.md"));
|
|
5299
5389
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
5300
5390
|
return Promise.all(
|
|
5301
5391
|
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: basename16(file) }))
|
|
5302
5392
|
);
|
|
5303
5393
|
}
|
|
5304
5394
|
async loadRulesyncFilesLegacy() {
|
|
5305
|
-
const legacyFiles = await findFilesByGlobs(
|
|
5395
|
+
const legacyFiles = await findFilesByGlobs(join54(RULESYNC_RULES_DIR_LEGACY, "*.md"));
|
|
5306
5396
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
5307
5397
|
return Promise.all(
|
|
5308
5398
|
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: basename16(file) }))
|
|
@@ -5366,7 +5456,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5366
5456
|
return [];
|
|
5367
5457
|
}
|
|
5368
5458
|
const rootFilePaths = await findFilesByGlobs(
|
|
5369
|
-
|
|
5459
|
+
join54(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
5370
5460
|
);
|
|
5371
5461
|
return await Promise.all(
|
|
5372
5462
|
rootFilePaths.map(
|
|
@@ -5383,7 +5473,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
5383
5473
|
return [];
|
|
5384
5474
|
}
|
|
5385
5475
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
5386
|
-
|
|
5476
|
+
join54(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
5387
5477
|
);
|
|
5388
5478
|
return await Promise.all(
|
|
5389
5479
|
nonRootFilePaths.map(
|
|
@@ -5749,14 +5839,14 @@ s/<command> [arguments]
|
|
|
5749
5839
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
5750
5840
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
5751
5841
|
|
|
5752
|
-
When users call a custom slash command, you have to look for the markdown file, \`${
|
|
5842
|
+
When users call a custom slash command, you have to look for the markdown file, \`${join54(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.`;
|
|
5753
5843
|
const subagentsSection = `## Simulated Subagents
|
|
5754
5844
|
|
|
5755
5845
|
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.
|
|
5756
5846
|
|
|
5757
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${
|
|
5847
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${join54(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
5758
5848
|
|
|
5759
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${
|
|
5849
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join54(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.`;
|
|
5760
5850
|
const result = [
|
|
5761
5851
|
overview,
|
|
5762
5852
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -5880,7 +5970,10 @@ async function generateCommand(options) {
|
|
|
5880
5970
|
});
|
|
5881
5971
|
if (config.getDelete()) {
|
|
5882
5972
|
const oldToolFiles = await processor.loadToolFiles();
|
|
5883
|
-
|
|
5973
|
+
const oldToolFilesForDelete = oldToolFiles.filter(
|
|
5974
|
+
(toolFile) => !(toolFile.getRelativeDirPath() === ClaudecodeIgnore.getSettablePaths().relativeDirPath && toolFile.getRelativeFilePath() === ClaudecodeIgnore.getSettablePaths().relativeFilePath)
|
|
5975
|
+
);
|
|
5976
|
+
await processor.removeAiFiles(oldToolFilesForDelete);
|
|
5884
5977
|
}
|
|
5885
5978
|
const rulesyncFiles = await processor.loadRulesyncFiles();
|
|
5886
5979
|
if (rulesyncFiles.length > 0) {
|
|
@@ -5943,9 +6036,9 @@ async function generateCommand(options) {
|
|
|
5943
6036
|
}
|
|
5944
6037
|
|
|
5945
6038
|
// src/cli/commands/gitignore.ts
|
|
5946
|
-
import { join as
|
|
6039
|
+
import { join as join55 } from "path";
|
|
5947
6040
|
var gitignoreCommand = async () => {
|
|
5948
|
-
const gitignorePath =
|
|
6041
|
+
const gitignorePath = join55(process.cwd(), ".gitignore");
|
|
5949
6042
|
const rulesFilesToIgnore = [
|
|
5950
6043
|
"# Generated by rulesync - AI tool configuration files",
|
|
5951
6044
|
"**/.amazonq/",
|
|
@@ -5959,6 +6052,7 @@ var gitignoreCommand = async () => {
|
|
|
5959
6052
|
"**/.claude/memories/",
|
|
5960
6053
|
"**/.claude/commands/",
|
|
5961
6054
|
"**/.claude/agents/",
|
|
6055
|
+
"**/.claude/settings.local.json",
|
|
5962
6056
|
"**/AGENTS.md",
|
|
5963
6057
|
"**/.agents/",
|
|
5964
6058
|
"**/.roo/rules/",
|
|
@@ -6135,7 +6229,7 @@ async function importCommand(options) {
|
|
|
6135
6229
|
}
|
|
6136
6230
|
|
|
6137
6231
|
// src/cli/commands/init.ts
|
|
6138
|
-
import { join as
|
|
6232
|
+
import { join as join56 } from "path";
|
|
6139
6233
|
async function initCommand() {
|
|
6140
6234
|
logger.info("Initializing rulesync...");
|
|
6141
6235
|
await ensureDir(RULESYNC_DIR);
|
|
@@ -6181,7 +6275,7 @@ globs: ["**/*"]
|
|
|
6181
6275
|
- Follow single responsibility principle
|
|
6182
6276
|
`
|
|
6183
6277
|
};
|
|
6184
|
-
const filepath =
|
|
6278
|
+
const filepath = join56(RULESYNC_RULES_DIR, sampleFile.filename);
|
|
6185
6279
|
await ensureDir(RULESYNC_RULES_DIR);
|
|
6186
6280
|
await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
|
|
6187
6281
|
await ensureDir(RULESYNC_SUBAGENTS_DIR);
|
|
@@ -6199,15 +6293,15 @@ var getVersion = async () => {
|
|
|
6199
6293
|
let packageJsonPath;
|
|
6200
6294
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
6201
6295
|
const __filename = fileURLToPath(import.meta.url);
|
|
6202
|
-
const __dirname =
|
|
6203
|
-
packageJsonPath =
|
|
6296
|
+
const __dirname = join57(__filename, "..");
|
|
6297
|
+
packageJsonPath = join57(__dirname, "../../package.json");
|
|
6204
6298
|
} else {
|
|
6205
|
-
packageJsonPath =
|
|
6299
|
+
packageJsonPath = join57(process.cwd(), "package.json");
|
|
6206
6300
|
}
|
|
6207
6301
|
const packageJson = await readJsonFile(packageJsonPath);
|
|
6208
6302
|
return packageJson.version;
|
|
6209
6303
|
} catch {
|
|
6210
|
-
return "1.0
|
|
6304
|
+
return "1.1.0";
|
|
6211
6305
|
}
|
|
6212
6306
|
};
|
|
6213
6307
|
var main = async () => {
|