rulesync 5.0.0 → 5.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 -0
- package/dist/index.cjs +1035 -526
- package/dist/index.js +1044 -535
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -267,6 +267,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
267
267
|
"cursor",
|
|
268
268
|
"geminicli",
|
|
269
269
|
"junie",
|
|
270
|
+
"kilo",
|
|
270
271
|
"kiro",
|
|
271
272
|
"opencode",
|
|
272
273
|
"qwencode",
|
|
@@ -484,7 +485,7 @@ var RULESYNC_OVERVIEW_FILE_NAME = "overview.md";
|
|
|
484
485
|
var RULESYNC_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "skills");
|
|
485
486
|
|
|
486
487
|
// src/features/commands/commands-processor.ts
|
|
487
|
-
var
|
|
488
|
+
var import_node_path18 = require("path");
|
|
488
489
|
var import_mini12 = require("zod/mini");
|
|
489
490
|
|
|
490
491
|
// src/types/feature-processor.ts
|
|
@@ -1816,8 +1817,89 @@ prompt = ""`;
|
|
|
1816
1817
|
}
|
|
1817
1818
|
};
|
|
1818
1819
|
|
|
1819
|
-
// src/features/commands/
|
|
1820
|
+
// src/features/commands/kilo-command.ts
|
|
1820
1821
|
var import_node_path15 = require("path");
|
|
1822
|
+
var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
1823
|
+
static getSettablePaths(_options = {}) {
|
|
1824
|
+
return {
|
|
1825
|
+
relativeDirPath: (0, import_node_path15.join)(".kilocode", "workflows")
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
toRulesyncCommand() {
|
|
1829
|
+
const rulesyncFrontmatter = {
|
|
1830
|
+
targets: ["*"],
|
|
1831
|
+
description: ""
|
|
1832
|
+
};
|
|
1833
|
+
return new RulesyncCommand({
|
|
1834
|
+
baseDir: process.cwd(),
|
|
1835
|
+
frontmatter: rulesyncFrontmatter,
|
|
1836
|
+
body: this.getFileContent(),
|
|
1837
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
1838
|
+
relativeFilePath: this.relativeFilePath,
|
|
1839
|
+
fileContent: this.getFileContent(),
|
|
1840
|
+
validate: true
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
static fromRulesyncCommand({
|
|
1844
|
+
baseDir = process.cwd(),
|
|
1845
|
+
rulesyncCommand,
|
|
1846
|
+
validate = true
|
|
1847
|
+
}) {
|
|
1848
|
+
const paths = this.getSettablePaths();
|
|
1849
|
+
return new _KiloCommand({
|
|
1850
|
+
baseDir,
|
|
1851
|
+
fileContent: rulesyncCommand.getBody(),
|
|
1852
|
+
relativeDirPath: paths.relativeDirPath,
|
|
1853
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
1854
|
+
validate
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
validate() {
|
|
1858
|
+
return { success: true, error: null };
|
|
1859
|
+
}
|
|
1860
|
+
getBody() {
|
|
1861
|
+
return this.getFileContent();
|
|
1862
|
+
}
|
|
1863
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1864
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
1865
|
+
rulesyncCommand,
|
|
1866
|
+
toolTarget: "kilo"
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
static async fromFile({
|
|
1870
|
+
baseDir = process.cwd(),
|
|
1871
|
+
relativeFilePath,
|
|
1872
|
+
validate = true
|
|
1873
|
+
}) {
|
|
1874
|
+
const paths = this.getSettablePaths();
|
|
1875
|
+
const filePath = (0, import_node_path15.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1876
|
+
const fileContent = await readFileContent(filePath);
|
|
1877
|
+
const { body: content } = parseFrontmatter(fileContent);
|
|
1878
|
+
return new _KiloCommand({
|
|
1879
|
+
baseDir,
|
|
1880
|
+
relativeDirPath: paths.relativeDirPath,
|
|
1881
|
+
relativeFilePath: (0, import_node_path15.basename)(relativeFilePath),
|
|
1882
|
+
fileContent: content.trim(),
|
|
1883
|
+
validate
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
static forDeletion({
|
|
1887
|
+
baseDir = process.cwd(),
|
|
1888
|
+
relativeDirPath,
|
|
1889
|
+
relativeFilePath
|
|
1890
|
+
}) {
|
|
1891
|
+
return new _KiloCommand({
|
|
1892
|
+
baseDir,
|
|
1893
|
+
relativeDirPath,
|
|
1894
|
+
relativeFilePath,
|
|
1895
|
+
fileContent: "",
|
|
1896
|
+
validate: false
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
// src/features/commands/opencode-command.ts
|
|
1902
|
+
var import_node_path16 = require("path");
|
|
1821
1903
|
var import_mini10 = require("zod/mini");
|
|
1822
1904
|
var OpenCodeCommandFrontmatterSchema = import_mini10.z.looseObject({
|
|
1823
1905
|
description: import_mini10.z.string(),
|
|
@@ -1833,7 +1915,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1833
1915
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1834
1916
|
if (!result.success) {
|
|
1835
1917
|
throw new Error(
|
|
1836
|
-
`Invalid frontmatter in ${(0,
|
|
1918
|
+
`Invalid frontmatter in ${(0, import_node_path16.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1837
1919
|
);
|
|
1838
1920
|
}
|
|
1839
1921
|
}
|
|
@@ -1846,7 +1928,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1846
1928
|
}
|
|
1847
1929
|
static getSettablePaths({ global } = {}) {
|
|
1848
1930
|
return {
|
|
1849
|
-
relativeDirPath: global ? (0,
|
|
1931
|
+
relativeDirPath: global ? (0, import_node_path16.join)(".config", "opencode", "command") : (0, import_node_path16.join)(".opencode", "command")
|
|
1850
1932
|
};
|
|
1851
1933
|
}
|
|
1852
1934
|
getBody() {
|
|
@@ -1907,7 +1989,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1907
1989
|
return {
|
|
1908
1990
|
success: false,
|
|
1909
1991
|
error: new Error(
|
|
1910
|
-
`Invalid frontmatter in ${(0,
|
|
1992
|
+
`Invalid frontmatter in ${(0, import_node_path16.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1911
1993
|
)
|
|
1912
1994
|
};
|
|
1913
1995
|
}
|
|
@@ -1918,7 +2000,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1918
2000
|
global = false
|
|
1919
2001
|
}) {
|
|
1920
2002
|
const paths = this.getSettablePaths({ global });
|
|
1921
|
-
const filePath = (0,
|
|
2003
|
+
const filePath = (0, import_node_path16.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1922
2004
|
const fileContent = await readFileContent(filePath);
|
|
1923
2005
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1924
2006
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1928,7 +2010,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1928
2010
|
return new _OpenCodeCommand({
|
|
1929
2011
|
baseDir,
|
|
1930
2012
|
relativeDirPath: paths.relativeDirPath,
|
|
1931
|
-
relativeFilePath: (0,
|
|
2013
|
+
relativeFilePath: (0, import_node_path16.basename)(relativeFilePath),
|
|
1932
2014
|
frontmatter: result.data,
|
|
1933
2015
|
body: content.trim(),
|
|
1934
2016
|
validate
|
|
@@ -1957,7 +2039,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1957
2039
|
};
|
|
1958
2040
|
|
|
1959
2041
|
// src/features/commands/roo-command.ts
|
|
1960
|
-
var
|
|
2042
|
+
var import_node_path17 = require("path");
|
|
1961
2043
|
var import_mini11 = require("zod/mini");
|
|
1962
2044
|
var RooCommandFrontmatterSchema = import_mini11.z.looseObject({
|
|
1963
2045
|
description: import_mini11.z.string(),
|
|
@@ -1968,7 +2050,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1968
2050
|
body;
|
|
1969
2051
|
static getSettablePaths() {
|
|
1970
2052
|
return {
|
|
1971
|
-
relativeDirPath: (0,
|
|
2053
|
+
relativeDirPath: (0, import_node_path17.join)(".roo", "commands")
|
|
1972
2054
|
};
|
|
1973
2055
|
}
|
|
1974
2056
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -1976,7 +2058,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1976
2058
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1977
2059
|
if (!result.success) {
|
|
1978
2060
|
throw new Error(
|
|
1979
|
-
`Invalid frontmatter in ${(0,
|
|
2061
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1980
2062
|
);
|
|
1981
2063
|
}
|
|
1982
2064
|
}
|
|
@@ -2047,7 +2129,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2047
2129
|
return {
|
|
2048
2130
|
success: false,
|
|
2049
2131
|
error: new Error(
|
|
2050
|
-
`Invalid frontmatter in ${(0,
|
|
2132
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2051
2133
|
)
|
|
2052
2134
|
};
|
|
2053
2135
|
}
|
|
@@ -2063,7 +2145,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2063
2145
|
relativeFilePath,
|
|
2064
2146
|
validate = true
|
|
2065
2147
|
}) {
|
|
2066
|
-
const filePath = (0,
|
|
2148
|
+
const filePath = (0, import_node_path17.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2067
2149
|
const fileContent = await readFileContent(filePath);
|
|
2068
2150
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2069
2151
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2073,7 +2155,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2073
2155
|
return new _RooCommand({
|
|
2074
2156
|
baseDir,
|
|
2075
2157
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
2076
|
-
relativeFilePath: (0,
|
|
2158
|
+
relativeFilePath: (0, import_node_path17.basename)(relativeFilePath),
|
|
2077
2159
|
frontmatter: result.data,
|
|
2078
2160
|
body: content.trim(),
|
|
2079
2161
|
fileContent,
|
|
@@ -2108,6 +2190,7 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2108
2190
|
"copilot",
|
|
2109
2191
|
"cursor",
|
|
2110
2192
|
"geminicli",
|
|
2193
|
+
"kilo",
|
|
2111
2194
|
"opencode",
|
|
2112
2195
|
"roo"
|
|
2113
2196
|
];
|
|
@@ -2181,6 +2264,13 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2181
2264
|
meta: { extension: "toml", supportsProject: true, supportsGlobal: true, isSimulated: false }
|
|
2182
2265
|
}
|
|
2183
2266
|
],
|
|
2267
|
+
[
|
|
2268
|
+
"kilo",
|
|
2269
|
+
{
|
|
2270
|
+
class: KiloCommand,
|
|
2271
|
+
meta: { extension: "md", supportsProject: true, supportsGlobal: true, isSimulated: false }
|
|
2272
|
+
}
|
|
2273
|
+
],
|
|
2184
2274
|
[
|
|
2185
2275
|
"opencode",
|
|
2186
2276
|
{
|
|
@@ -2271,11 +2361,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2271
2361
|
*/
|
|
2272
2362
|
async loadRulesyncFiles() {
|
|
2273
2363
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
2274
|
-
(0,
|
|
2364
|
+
(0, import_node_path18.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
2275
2365
|
);
|
|
2276
2366
|
const rulesyncCommands = await Promise.all(
|
|
2277
2367
|
rulesyncCommandPaths.map(
|
|
2278
|
-
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
2368
|
+
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path18.basename)(path3) })
|
|
2279
2369
|
)
|
|
2280
2370
|
);
|
|
2281
2371
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -2291,14 +2381,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2291
2381
|
const factory = this.getFactory(this.toolTarget);
|
|
2292
2382
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
2293
2383
|
const commandFilePaths = await findFilesByGlobs(
|
|
2294
|
-
(0,
|
|
2384
|
+
(0, import_node_path18.join)(this.baseDir, paths.relativeDirPath, `*.${factory.meta.extension}`)
|
|
2295
2385
|
);
|
|
2296
2386
|
if (forDeletion) {
|
|
2297
2387
|
const toolCommands2 = commandFilePaths.map(
|
|
2298
2388
|
(path3) => factory.class.forDeletion({
|
|
2299
2389
|
baseDir: this.baseDir,
|
|
2300
2390
|
relativeDirPath: paths.relativeDirPath,
|
|
2301
|
-
relativeFilePath: (0,
|
|
2391
|
+
relativeFilePath: (0, import_node_path18.basename)(path3),
|
|
2302
2392
|
global: this.global
|
|
2303
2393
|
})
|
|
2304
2394
|
).filter((cmd) => cmd.isDeletable());
|
|
@@ -2309,7 +2399,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2309
2399
|
commandFilePaths.map(
|
|
2310
2400
|
(path3) => factory.class.fromFile({
|
|
2311
2401
|
baseDir: this.baseDir,
|
|
2312
|
-
relativeFilePath: (0,
|
|
2402
|
+
relativeFilePath: (0, import_node_path18.basename)(path3),
|
|
2313
2403
|
global: this.global
|
|
2314
2404
|
})
|
|
2315
2405
|
)
|
|
@@ -2344,14 +2434,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2344
2434
|
var import_mini13 = require("zod/mini");
|
|
2345
2435
|
|
|
2346
2436
|
// src/features/ignore/augmentcode-ignore.ts
|
|
2347
|
-
var
|
|
2437
|
+
var import_node_path20 = require("path");
|
|
2348
2438
|
|
|
2349
2439
|
// src/types/tool-file.ts
|
|
2350
2440
|
var ToolFile = class extends AiFile {
|
|
2351
2441
|
};
|
|
2352
2442
|
|
|
2353
2443
|
// src/features/ignore/rulesync-ignore.ts
|
|
2354
|
-
var
|
|
2444
|
+
var import_node_path19 = require("path");
|
|
2355
2445
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
2356
2446
|
validate() {
|
|
2357
2447
|
return { success: true, error: null };
|
|
@@ -2371,12 +2461,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
2371
2461
|
static async fromFile() {
|
|
2372
2462
|
const baseDir = process.cwd();
|
|
2373
2463
|
const paths = this.getSettablePaths();
|
|
2374
|
-
const recommendedPath = (0,
|
|
2464
|
+
const recommendedPath = (0, import_node_path19.join)(
|
|
2375
2465
|
baseDir,
|
|
2376
2466
|
paths.recommended.relativeDirPath,
|
|
2377
2467
|
paths.recommended.relativeFilePath
|
|
2378
2468
|
);
|
|
2379
|
-
const legacyPath = (0,
|
|
2469
|
+
const legacyPath = (0, import_node_path19.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
2380
2470
|
if (await fileExists(recommendedPath)) {
|
|
2381
2471
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
2382
2472
|
return new _RulesyncIgnore({
|
|
@@ -2492,7 +2582,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2492
2582
|
validate = true
|
|
2493
2583
|
}) {
|
|
2494
2584
|
const fileContent = await readFileContent(
|
|
2495
|
-
(0,
|
|
2585
|
+
(0, import_node_path20.join)(
|
|
2496
2586
|
baseDir,
|
|
2497
2587
|
this.getSettablePaths().relativeDirPath,
|
|
2498
2588
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2522,7 +2612,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2522
2612
|
};
|
|
2523
2613
|
|
|
2524
2614
|
// src/features/ignore/claudecode-ignore.ts
|
|
2525
|
-
var
|
|
2615
|
+
var import_node_path21 = require("path");
|
|
2526
2616
|
var import_es_toolkit2 = require("es-toolkit");
|
|
2527
2617
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
2528
2618
|
constructor(params) {
|
|
@@ -2565,7 +2655,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2565
2655
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
2566
2656
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2567
2657
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
2568
|
-
const filePath = (0,
|
|
2658
|
+
const filePath = (0, import_node_path21.join)(
|
|
2569
2659
|
baseDir,
|
|
2570
2660
|
this.getSettablePaths().relativeDirPath,
|
|
2571
2661
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2601,7 +2691,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2601
2691
|
validate = true
|
|
2602
2692
|
}) {
|
|
2603
2693
|
const fileContent = await readFileContent(
|
|
2604
|
-
(0,
|
|
2694
|
+
(0, import_node_path21.join)(
|
|
2605
2695
|
baseDir,
|
|
2606
2696
|
this.getSettablePaths().relativeDirPath,
|
|
2607
2697
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2631,7 +2721,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2631
2721
|
};
|
|
2632
2722
|
|
|
2633
2723
|
// src/features/ignore/cline-ignore.ts
|
|
2634
|
-
var
|
|
2724
|
+
var import_node_path22 = require("path");
|
|
2635
2725
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
2636
2726
|
static getSettablePaths() {
|
|
2637
2727
|
return {
|
|
@@ -2668,7 +2758,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2668
2758
|
validate = true
|
|
2669
2759
|
}) {
|
|
2670
2760
|
const fileContent = await readFileContent(
|
|
2671
|
-
(0,
|
|
2761
|
+
(0, import_node_path22.join)(
|
|
2672
2762
|
baseDir,
|
|
2673
2763
|
this.getSettablePaths().relativeDirPath,
|
|
2674
2764
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2698,7 +2788,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2698
2788
|
};
|
|
2699
2789
|
|
|
2700
2790
|
// src/features/ignore/cursor-ignore.ts
|
|
2701
|
-
var
|
|
2791
|
+
var import_node_path23 = require("path");
|
|
2702
2792
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
2703
2793
|
static getSettablePaths() {
|
|
2704
2794
|
return {
|
|
@@ -2731,7 +2821,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2731
2821
|
validate = true
|
|
2732
2822
|
}) {
|
|
2733
2823
|
const fileContent = await readFileContent(
|
|
2734
|
-
(0,
|
|
2824
|
+
(0, import_node_path23.join)(
|
|
2735
2825
|
baseDir,
|
|
2736
2826
|
this.getSettablePaths().relativeDirPath,
|
|
2737
2827
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2761,7 +2851,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2761
2851
|
};
|
|
2762
2852
|
|
|
2763
2853
|
// src/features/ignore/geminicli-ignore.ts
|
|
2764
|
-
var
|
|
2854
|
+
var import_node_path24 = require("path");
|
|
2765
2855
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
2766
2856
|
static getSettablePaths() {
|
|
2767
2857
|
return {
|
|
@@ -2788,7 +2878,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2788
2878
|
validate = true
|
|
2789
2879
|
}) {
|
|
2790
2880
|
const fileContent = await readFileContent(
|
|
2791
|
-
(0,
|
|
2881
|
+
(0, import_node_path24.join)(
|
|
2792
2882
|
baseDir,
|
|
2793
2883
|
this.getSettablePaths().relativeDirPath,
|
|
2794
2884
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2818,7 +2908,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2818
2908
|
};
|
|
2819
2909
|
|
|
2820
2910
|
// src/features/ignore/junie-ignore.ts
|
|
2821
|
-
var
|
|
2911
|
+
var import_node_path25 = require("path");
|
|
2822
2912
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2823
2913
|
static getSettablePaths() {
|
|
2824
2914
|
return {
|
|
@@ -2845,7 +2935,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2845
2935
|
validate = true
|
|
2846
2936
|
}) {
|
|
2847
2937
|
const fileContent = await readFileContent(
|
|
2848
|
-
(0,
|
|
2938
|
+
(0, import_node_path25.join)(
|
|
2849
2939
|
baseDir,
|
|
2850
2940
|
this.getSettablePaths().relativeDirPath,
|
|
2851
2941
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2874,8 +2964,75 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2874
2964
|
}
|
|
2875
2965
|
};
|
|
2876
2966
|
|
|
2967
|
+
// src/features/ignore/kilo-ignore.ts
|
|
2968
|
+
var import_node_path26 = require("path");
|
|
2969
|
+
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
2970
|
+
static getSettablePaths() {
|
|
2971
|
+
return {
|
|
2972
|
+
relativeDirPath: ".",
|
|
2973
|
+
relativeFilePath: ".kilocodeignore"
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* Convert KiloIgnore to RulesyncIgnore format
|
|
2978
|
+
*/
|
|
2979
|
+
toRulesyncIgnore() {
|
|
2980
|
+
return this.toRulesyncIgnoreDefault();
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* Create KiloIgnore from RulesyncIgnore
|
|
2984
|
+
*/
|
|
2985
|
+
static fromRulesyncIgnore({
|
|
2986
|
+
baseDir = process.cwd(),
|
|
2987
|
+
rulesyncIgnore
|
|
2988
|
+
}) {
|
|
2989
|
+
const body = rulesyncIgnore.getFileContent();
|
|
2990
|
+
return new _KiloIgnore({
|
|
2991
|
+
baseDir,
|
|
2992
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
2993
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
2994
|
+
fileContent: body
|
|
2995
|
+
});
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Load KiloIgnore from .kilocodeignore file
|
|
2999
|
+
*/
|
|
3000
|
+
static async fromFile({
|
|
3001
|
+
baseDir = process.cwd(),
|
|
3002
|
+
validate = true
|
|
3003
|
+
}) {
|
|
3004
|
+
const fileContent = await readFileContent(
|
|
3005
|
+
(0, import_node_path26.join)(
|
|
3006
|
+
baseDir,
|
|
3007
|
+
this.getSettablePaths().relativeDirPath,
|
|
3008
|
+
this.getSettablePaths().relativeFilePath
|
|
3009
|
+
)
|
|
3010
|
+
);
|
|
3011
|
+
return new _KiloIgnore({
|
|
3012
|
+
baseDir,
|
|
3013
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
3014
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
3015
|
+
fileContent,
|
|
3016
|
+
validate
|
|
3017
|
+
});
|
|
3018
|
+
}
|
|
3019
|
+
static forDeletion({
|
|
3020
|
+
baseDir = process.cwd(),
|
|
3021
|
+
relativeDirPath,
|
|
3022
|
+
relativeFilePath
|
|
3023
|
+
}) {
|
|
3024
|
+
return new _KiloIgnore({
|
|
3025
|
+
baseDir,
|
|
3026
|
+
relativeDirPath,
|
|
3027
|
+
relativeFilePath,
|
|
3028
|
+
fileContent: "",
|
|
3029
|
+
validate: false
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
};
|
|
3033
|
+
|
|
2877
3034
|
// src/features/ignore/kiro-ignore.ts
|
|
2878
|
-
var
|
|
3035
|
+
var import_node_path27 = require("path");
|
|
2879
3036
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2880
3037
|
static getSettablePaths() {
|
|
2881
3038
|
return {
|
|
@@ -2902,7 +3059,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2902
3059
|
validate = true
|
|
2903
3060
|
}) {
|
|
2904
3061
|
const fileContent = await readFileContent(
|
|
2905
|
-
(0,
|
|
3062
|
+
(0, import_node_path27.join)(
|
|
2906
3063
|
baseDir,
|
|
2907
3064
|
this.getSettablePaths().relativeDirPath,
|
|
2908
3065
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2932,7 +3089,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2932
3089
|
};
|
|
2933
3090
|
|
|
2934
3091
|
// src/features/ignore/qwencode-ignore.ts
|
|
2935
|
-
var
|
|
3092
|
+
var import_node_path28 = require("path");
|
|
2936
3093
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2937
3094
|
static getSettablePaths() {
|
|
2938
3095
|
return {
|
|
@@ -2959,7 +3116,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2959
3116
|
validate = true
|
|
2960
3117
|
}) {
|
|
2961
3118
|
const fileContent = await readFileContent(
|
|
2962
|
-
(0,
|
|
3119
|
+
(0, import_node_path28.join)(
|
|
2963
3120
|
baseDir,
|
|
2964
3121
|
this.getSettablePaths().relativeDirPath,
|
|
2965
3122
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2989,7 +3146,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2989
3146
|
};
|
|
2990
3147
|
|
|
2991
3148
|
// src/features/ignore/roo-ignore.ts
|
|
2992
|
-
var
|
|
3149
|
+
var import_node_path29 = require("path");
|
|
2993
3150
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2994
3151
|
static getSettablePaths() {
|
|
2995
3152
|
return {
|
|
@@ -3016,7 +3173,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3016
3173
|
validate = true
|
|
3017
3174
|
}) {
|
|
3018
3175
|
const fileContent = await readFileContent(
|
|
3019
|
-
(0,
|
|
3176
|
+
(0, import_node_path29.join)(
|
|
3020
3177
|
baseDir,
|
|
3021
3178
|
this.getSettablePaths().relativeDirPath,
|
|
3022
3179
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3046,7 +3203,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3046
3203
|
};
|
|
3047
3204
|
|
|
3048
3205
|
// src/features/ignore/windsurf-ignore.ts
|
|
3049
|
-
var
|
|
3206
|
+
var import_node_path30 = require("path");
|
|
3050
3207
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
3051
3208
|
static getSettablePaths() {
|
|
3052
3209
|
return {
|
|
@@ -3073,7 +3230,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
3073
3230
|
validate = true
|
|
3074
3231
|
}) {
|
|
3075
3232
|
const fileContent = await readFileContent(
|
|
3076
|
-
(0,
|
|
3233
|
+
(0, import_node_path30.join)(
|
|
3077
3234
|
baseDir,
|
|
3078
3235
|
this.getSettablePaths().relativeDirPath,
|
|
3079
3236
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3111,6 +3268,7 @@ var ignoreProcessorToolTargets = [
|
|
|
3111
3268
|
"cursor",
|
|
3112
3269
|
"geminicli",
|
|
3113
3270
|
"junie",
|
|
3271
|
+
"kilo",
|
|
3114
3272
|
"kiro",
|
|
3115
3273
|
"qwencode",
|
|
3116
3274
|
"roo",
|
|
@@ -3125,6 +3283,7 @@ var toolIgnoreFactories = /* @__PURE__ */ new Map([
|
|
|
3125
3283
|
["cursor", { class: CursorIgnore }],
|
|
3126
3284
|
["geminicli", { class: GeminiCliIgnore }],
|
|
3127
3285
|
["junie", { class: JunieIgnore }],
|
|
3286
|
+
["kilo", { class: KiloIgnore }],
|
|
3128
3287
|
["kiro", { class: KiroIgnore }],
|
|
3129
3288
|
["qwencode", { class: QwencodeIgnore }],
|
|
3130
3289
|
["roo", { class: RooIgnore }],
|
|
@@ -3251,10 +3410,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
3251
3410
|
var import_mini18 = require("zod/mini");
|
|
3252
3411
|
|
|
3253
3412
|
// src/features/mcp/claudecode-mcp.ts
|
|
3254
|
-
var
|
|
3413
|
+
var import_node_path33 = require("path");
|
|
3255
3414
|
|
|
3256
3415
|
// src/features/mcp/modular-mcp.ts
|
|
3257
|
-
var
|
|
3416
|
+
var import_node_path31 = require("path");
|
|
3258
3417
|
var import_mini15 = require("zod/mini");
|
|
3259
3418
|
|
|
3260
3419
|
// src/types/mcp.ts
|
|
@@ -3342,7 +3501,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3342
3501
|
args: [
|
|
3343
3502
|
"-y",
|
|
3344
3503
|
"@kimuson/modular-mcp",
|
|
3345
|
-
(0,
|
|
3504
|
+
(0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3346
3505
|
],
|
|
3347
3506
|
env: {}
|
|
3348
3507
|
}
|
|
@@ -3379,7 +3538,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3379
3538
|
};
|
|
3380
3539
|
|
|
3381
3540
|
// src/features/mcp/rulesync-mcp.ts
|
|
3382
|
-
var
|
|
3541
|
+
var import_node_path32 = require("path");
|
|
3383
3542
|
var import_object = require("es-toolkit/object");
|
|
3384
3543
|
var import_mini16 = require("zod/mini");
|
|
3385
3544
|
var RulesyncMcpServerSchema = import_mini16.z.union([
|
|
@@ -3436,12 +3595,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
3436
3595
|
}) {
|
|
3437
3596
|
const baseDir = process.cwd();
|
|
3438
3597
|
const paths = this.getSettablePaths();
|
|
3439
|
-
const recommendedPath = (0,
|
|
3598
|
+
const recommendedPath = (0, import_node_path32.join)(
|
|
3440
3599
|
baseDir,
|
|
3441
3600
|
paths.recommended.relativeDirPath,
|
|
3442
3601
|
paths.recommended.relativeFilePath
|
|
3443
3602
|
);
|
|
3444
|
-
const legacyPath = (0,
|
|
3603
|
+
const legacyPath = (0, import_node_path32.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
3445
3604
|
if (await fileExists(recommendedPath)) {
|
|
3446
3605
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
3447
3606
|
return new _RulesyncMcp({
|
|
@@ -3585,7 +3744,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3585
3744
|
}) {
|
|
3586
3745
|
const paths = this.getSettablePaths({ global });
|
|
3587
3746
|
const fileContent = await readOrInitializeFileContent(
|
|
3588
|
-
(0,
|
|
3747
|
+
(0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3589
3748
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3590
3749
|
);
|
|
3591
3750
|
const json = JSON.parse(fileContent);
|
|
@@ -3607,7 +3766,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3607
3766
|
}) {
|
|
3608
3767
|
const paths = this.getSettablePaths({ global });
|
|
3609
3768
|
const fileContent = await readOrInitializeFileContent(
|
|
3610
|
-
(0,
|
|
3769
|
+
(0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3611
3770
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3612
3771
|
);
|
|
3613
3772
|
const json = JSON.parse(fileContent);
|
|
@@ -3655,7 +3814,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3655
3814
|
};
|
|
3656
3815
|
|
|
3657
3816
|
// src/features/mcp/cline-mcp.ts
|
|
3658
|
-
var
|
|
3817
|
+
var import_node_path34 = require("path");
|
|
3659
3818
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
3660
3819
|
json;
|
|
3661
3820
|
constructor(params) {
|
|
@@ -3676,7 +3835,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3676
3835
|
validate = true
|
|
3677
3836
|
}) {
|
|
3678
3837
|
const fileContent = await readFileContent(
|
|
3679
|
-
(0,
|
|
3838
|
+
(0, import_node_path34.join)(
|
|
3680
3839
|
baseDir,
|
|
3681
3840
|
this.getSettablePaths().relativeDirPath,
|
|
3682
3841
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3725,7 +3884,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3725
3884
|
};
|
|
3726
3885
|
|
|
3727
3886
|
// src/features/mcp/codexcli-mcp.ts
|
|
3728
|
-
var
|
|
3887
|
+
var import_node_path35 = require("path");
|
|
3729
3888
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
3730
3889
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
3731
3890
|
toml;
|
|
@@ -3761,7 +3920,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3761
3920
|
}) {
|
|
3762
3921
|
const paths = this.getSettablePaths({ global });
|
|
3763
3922
|
const fileContent = await readFileContent(
|
|
3764
|
-
(0,
|
|
3923
|
+
(0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3765
3924
|
);
|
|
3766
3925
|
return new _CodexcliMcp({
|
|
3767
3926
|
baseDir,
|
|
@@ -3778,7 +3937,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3778
3937
|
global = false
|
|
3779
3938
|
}) {
|
|
3780
3939
|
const paths = this.getSettablePaths({ global });
|
|
3781
|
-
const configTomlFilePath = (0,
|
|
3940
|
+
const configTomlFilePath = (0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3782
3941
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
3783
3942
|
configTomlFilePath,
|
|
3784
3943
|
smolToml.stringify({})
|
|
@@ -3832,7 +3991,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3832
3991
|
};
|
|
3833
3992
|
|
|
3834
3993
|
// src/features/mcp/copilot-mcp.ts
|
|
3835
|
-
var
|
|
3994
|
+
var import_node_path36 = require("path");
|
|
3836
3995
|
function convertToCopilotFormat(mcpServers) {
|
|
3837
3996
|
return { servers: mcpServers };
|
|
3838
3997
|
}
|
|
@@ -3859,7 +4018,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3859
4018
|
validate = true
|
|
3860
4019
|
}) {
|
|
3861
4020
|
const fileContent = await readFileContent(
|
|
3862
|
-
(0,
|
|
4021
|
+
(0, import_node_path36.join)(
|
|
3863
4022
|
baseDir,
|
|
3864
4023
|
this.getSettablePaths().relativeDirPath,
|
|
3865
4024
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3912,7 +4071,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3912
4071
|
};
|
|
3913
4072
|
|
|
3914
4073
|
// src/features/mcp/cursor-mcp.ts
|
|
3915
|
-
var
|
|
4074
|
+
var import_node_path37 = require("path");
|
|
3916
4075
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
3917
4076
|
json;
|
|
3918
4077
|
constructor(params) {
|
|
@@ -3933,7 +4092,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3933
4092
|
validate = true
|
|
3934
4093
|
}) {
|
|
3935
4094
|
const fileContent = await readFileContent(
|
|
3936
|
-
(0,
|
|
4095
|
+
(0, import_node_path37.join)(
|
|
3937
4096
|
baseDir,
|
|
3938
4097
|
this.getSettablePaths().relativeDirPath,
|
|
3939
4098
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3993,7 +4152,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3993
4152
|
};
|
|
3994
4153
|
|
|
3995
4154
|
// src/features/mcp/geminicli-mcp.ts
|
|
3996
|
-
var
|
|
4155
|
+
var import_node_path38 = require("path");
|
|
3997
4156
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3998
4157
|
json;
|
|
3999
4158
|
constructor(params) {
|
|
@@ -4022,7 +4181,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4022
4181
|
}) {
|
|
4023
4182
|
const paths = this.getSettablePaths({ global });
|
|
4024
4183
|
const fileContent = await readOrInitializeFileContent(
|
|
4025
|
-
(0,
|
|
4184
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4026
4185
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4027
4186
|
);
|
|
4028
4187
|
const json = JSON.parse(fileContent);
|
|
@@ -4043,7 +4202,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4043
4202
|
}) {
|
|
4044
4203
|
const paths = this.getSettablePaths({ global });
|
|
4045
4204
|
const fileContent = await readOrInitializeFileContent(
|
|
4046
|
-
(0,
|
|
4205
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4047
4206
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4048
4207
|
);
|
|
4049
4208
|
const json = JSON.parse(fileContent);
|
|
@@ -4080,7 +4239,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4080
4239
|
};
|
|
4081
4240
|
|
|
4082
4241
|
// src/features/mcp/junie-mcp.ts
|
|
4083
|
-
var
|
|
4242
|
+
var import_node_path39 = require("path");
|
|
4084
4243
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
4085
4244
|
json;
|
|
4086
4245
|
constructor(params) {
|
|
@@ -4092,7 +4251,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4092
4251
|
}
|
|
4093
4252
|
static getSettablePaths() {
|
|
4094
4253
|
return {
|
|
4095
|
-
relativeDirPath: (0,
|
|
4254
|
+
relativeDirPath: (0, import_node_path39.join)(".junie", "mcp"),
|
|
4096
4255
|
relativeFilePath: "mcp.json"
|
|
4097
4256
|
};
|
|
4098
4257
|
}
|
|
@@ -4101,7 +4260,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4101
4260
|
validate = true
|
|
4102
4261
|
}) {
|
|
4103
4262
|
const fileContent = await readFileContent(
|
|
4104
|
-
(0,
|
|
4263
|
+
(0, import_node_path39.join)(
|
|
4105
4264
|
baseDir,
|
|
4106
4265
|
this.getSettablePaths().relativeDirPath,
|
|
4107
4266
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4149,8 +4308,84 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4149
4308
|
}
|
|
4150
4309
|
};
|
|
4151
4310
|
|
|
4311
|
+
// src/features/mcp/kilo-mcp.ts
|
|
4312
|
+
var import_node_path40 = require("path");
|
|
4313
|
+
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
4314
|
+
json;
|
|
4315
|
+
constructor(params) {
|
|
4316
|
+
super(params);
|
|
4317
|
+
this.json = JSON.parse(this.fileContent || "{}");
|
|
4318
|
+
}
|
|
4319
|
+
getJson() {
|
|
4320
|
+
return this.json;
|
|
4321
|
+
}
|
|
4322
|
+
static getSettablePaths() {
|
|
4323
|
+
return {
|
|
4324
|
+
relativeDirPath: ".kilocode",
|
|
4325
|
+
relativeFilePath: "mcp.json"
|
|
4326
|
+
};
|
|
4327
|
+
}
|
|
4328
|
+
static async fromFile({
|
|
4329
|
+
baseDir = process.cwd(),
|
|
4330
|
+
validate = true
|
|
4331
|
+
}) {
|
|
4332
|
+
const paths = this.getSettablePaths();
|
|
4333
|
+
const fileContent = await readOrInitializeFileContent(
|
|
4334
|
+
(0, import_node_path40.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4335
|
+
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4336
|
+
);
|
|
4337
|
+
return new _KiloMcp({
|
|
4338
|
+
baseDir,
|
|
4339
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4340
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4341
|
+
fileContent,
|
|
4342
|
+
validate
|
|
4343
|
+
});
|
|
4344
|
+
}
|
|
4345
|
+
static fromRulesyncMcp({
|
|
4346
|
+
baseDir = process.cwd(),
|
|
4347
|
+
rulesyncMcp,
|
|
4348
|
+
validate = true
|
|
4349
|
+
}) {
|
|
4350
|
+
const paths = this.getSettablePaths();
|
|
4351
|
+
const fileContent = JSON.stringify(
|
|
4352
|
+
{ mcpServers: rulesyncMcp.getMcpServers({ type: "exposed" }) },
|
|
4353
|
+
null,
|
|
4354
|
+
2
|
|
4355
|
+
);
|
|
4356
|
+
return new _KiloMcp({
|
|
4357
|
+
baseDir,
|
|
4358
|
+
relativeDirPath: paths.relativeDirPath,
|
|
4359
|
+
relativeFilePath: paths.relativeFilePath,
|
|
4360
|
+
fileContent,
|
|
4361
|
+
validate
|
|
4362
|
+
});
|
|
4363
|
+
}
|
|
4364
|
+
toRulesyncMcp() {
|
|
4365
|
+
return this.toRulesyncMcpDefault({
|
|
4366
|
+
fileContent: JSON.stringify({ mcpServers: this.json.mcpServers ?? {} }, null, 2)
|
|
4367
|
+
});
|
|
4368
|
+
}
|
|
4369
|
+
validate() {
|
|
4370
|
+
return { success: true, error: null };
|
|
4371
|
+
}
|
|
4372
|
+
static forDeletion({
|
|
4373
|
+
baseDir = process.cwd(),
|
|
4374
|
+
relativeDirPath,
|
|
4375
|
+
relativeFilePath
|
|
4376
|
+
}) {
|
|
4377
|
+
return new _KiloMcp({
|
|
4378
|
+
baseDir,
|
|
4379
|
+
relativeDirPath,
|
|
4380
|
+
relativeFilePath,
|
|
4381
|
+
fileContent: "{}",
|
|
4382
|
+
validate: false
|
|
4383
|
+
});
|
|
4384
|
+
}
|
|
4385
|
+
};
|
|
4386
|
+
|
|
4152
4387
|
// src/features/mcp/opencode-mcp.ts
|
|
4153
|
-
var
|
|
4388
|
+
var import_node_path41 = require("path");
|
|
4154
4389
|
var import_mini17 = require("zod/mini");
|
|
4155
4390
|
var OpencodeMcpLocalServerSchema = import_mini17.z.object({
|
|
4156
4391
|
type: import_mini17.z.literal("local"),
|
|
@@ -4274,7 +4509,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4274
4509
|
}) {
|
|
4275
4510
|
const paths = this.getSettablePaths({ global });
|
|
4276
4511
|
const fileContent = await readOrInitializeFileContent(
|
|
4277
|
-
(0,
|
|
4512
|
+
(0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4278
4513
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
4279
4514
|
);
|
|
4280
4515
|
const json = JSON.parse(fileContent);
|
|
@@ -4295,7 +4530,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4295
4530
|
}) {
|
|
4296
4531
|
const paths = this.getSettablePaths({ global });
|
|
4297
4532
|
const fileContent = await readOrInitializeFileContent(
|
|
4298
|
-
(0,
|
|
4533
|
+
(0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4299
4534
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
4300
4535
|
);
|
|
4301
4536
|
const json = JSON.parse(fileContent);
|
|
@@ -4339,7 +4574,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4339
4574
|
};
|
|
4340
4575
|
|
|
4341
4576
|
// src/features/mcp/roo-mcp.ts
|
|
4342
|
-
var
|
|
4577
|
+
var import_node_path42 = require("path");
|
|
4343
4578
|
function isRooMcpServers(value) {
|
|
4344
4579
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
4345
4580
|
}
|
|
@@ -4391,7 +4626,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
4391
4626
|
validate = true
|
|
4392
4627
|
}) {
|
|
4393
4628
|
const fileContent = await readFileContent(
|
|
4394
|
-
(0,
|
|
4629
|
+
(0, import_node_path42.join)(
|
|
4395
4630
|
baseDir,
|
|
4396
4631
|
this.getSettablePaths().relativeDirPath,
|
|
4397
4632
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4455,6 +4690,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
4455
4690
|
"copilot",
|
|
4456
4691
|
"cursor",
|
|
4457
4692
|
"geminicli",
|
|
4693
|
+
"kilo",
|
|
4458
4694
|
"junie",
|
|
4459
4695
|
"opencode",
|
|
4460
4696
|
"roo"
|
|
@@ -4510,6 +4746,13 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
4510
4746
|
meta: { supportsProject: true, supportsGlobal: true, supportsModular: false }
|
|
4511
4747
|
}
|
|
4512
4748
|
],
|
|
4749
|
+
[
|
|
4750
|
+
"kilo",
|
|
4751
|
+
{
|
|
4752
|
+
class: KiloMcp,
|
|
4753
|
+
meta: { supportsProject: true, supportsGlobal: false, supportsModular: false }
|
|
4754
|
+
}
|
|
4755
|
+
],
|
|
4513
4756
|
[
|
|
4514
4757
|
"junie",
|
|
4515
4758
|
{
|
|
@@ -4689,25 +4932,25 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
4689
4932
|
};
|
|
4690
4933
|
|
|
4691
4934
|
// src/features/rules/rules-processor.ts
|
|
4692
|
-
var
|
|
4935
|
+
var import_node_path90 = require("path");
|
|
4693
4936
|
var import_toon = require("@toon-format/toon");
|
|
4694
|
-
var
|
|
4937
|
+
var import_mini41 = require("zod/mini");
|
|
4695
4938
|
|
|
4696
4939
|
// src/constants/general.ts
|
|
4697
4940
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
4698
4941
|
|
|
4699
4942
|
// src/features/skills/agentsmd-skill.ts
|
|
4700
|
-
var
|
|
4943
|
+
var import_node_path46 = require("path");
|
|
4701
4944
|
|
|
4702
4945
|
// src/features/skills/simulated-skill.ts
|
|
4703
|
-
var
|
|
4946
|
+
var import_node_path45 = require("path");
|
|
4704
4947
|
var import_mini19 = require("zod/mini");
|
|
4705
4948
|
|
|
4706
4949
|
// src/features/skills/tool-skill.ts
|
|
4707
|
-
var
|
|
4950
|
+
var import_node_path44 = require("path");
|
|
4708
4951
|
|
|
4709
4952
|
// src/types/ai-dir.ts
|
|
4710
|
-
var
|
|
4953
|
+
var import_node_path43 = __toESM(require("path"), 1);
|
|
4711
4954
|
var AiDir = class {
|
|
4712
4955
|
/**
|
|
4713
4956
|
* @example "."
|
|
@@ -4741,7 +4984,7 @@ var AiDir = class {
|
|
|
4741
4984
|
otherFiles = [],
|
|
4742
4985
|
global = false
|
|
4743
4986
|
}) {
|
|
4744
|
-
if (dirName.includes(
|
|
4987
|
+
if (dirName.includes(import_node_path43.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
4745
4988
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
4746
4989
|
}
|
|
4747
4990
|
this.baseDir = baseDir;
|
|
@@ -4764,11 +5007,11 @@ var AiDir = class {
|
|
|
4764
5007
|
return this.dirName;
|
|
4765
5008
|
}
|
|
4766
5009
|
getDirPath() {
|
|
4767
|
-
const fullPath =
|
|
4768
|
-
const resolvedFull = (0,
|
|
4769
|
-
const resolvedBase = (0,
|
|
4770
|
-
const rel = (0,
|
|
4771
|
-
if (rel.startsWith("..") ||
|
|
5010
|
+
const fullPath = import_node_path43.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
5011
|
+
const resolvedFull = (0, import_node_path43.resolve)(fullPath);
|
|
5012
|
+
const resolvedBase = (0, import_node_path43.resolve)(this.baseDir);
|
|
5013
|
+
const rel = (0, import_node_path43.relative)(resolvedBase, resolvedFull);
|
|
5014
|
+
if (rel.startsWith("..") || import_node_path43.default.isAbsolute(rel)) {
|
|
4772
5015
|
throw new Error(
|
|
4773
5016
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
4774
5017
|
);
|
|
@@ -4782,7 +5025,7 @@ var AiDir = class {
|
|
|
4782
5025
|
return this.otherFiles;
|
|
4783
5026
|
}
|
|
4784
5027
|
getRelativePathFromCwd() {
|
|
4785
|
-
return
|
|
5028
|
+
return import_node_path43.default.join(this.relativeDirPath, this.dirName);
|
|
4786
5029
|
}
|
|
4787
5030
|
getGlobal() {
|
|
4788
5031
|
return this.global;
|
|
@@ -4801,15 +5044,15 @@ var AiDir = class {
|
|
|
4801
5044
|
* @returns Array of files with their relative paths and buffers
|
|
4802
5045
|
*/
|
|
4803
5046
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
4804
|
-
const dirPath = (0,
|
|
4805
|
-
const glob = (0,
|
|
5047
|
+
const dirPath = (0, import_node_path43.join)(baseDir, relativeDirPath, dirName);
|
|
5048
|
+
const glob = (0, import_node_path43.join)(dirPath, "**", "*");
|
|
4806
5049
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
4807
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
5050
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path43.basename)(filePath) !== excludeFileName);
|
|
4808
5051
|
const files = await Promise.all(
|
|
4809
5052
|
filteredPaths.map(async (filePath) => {
|
|
4810
5053
|
const fileBuffer = await readFileBuffer(filePath);
|
|
4811
5054
|
return {
|
|
4812
|
-
relativeFilePathToDirPath: (0,
|
|
5055
|
+
relativeFilePathToDirPath: (0, import_node_path43.relative)(dirPath, filePath),
|
|
4813
5056
|
fileBuffer
|
|
4814
5057
|
};
|
|
4815
5058
|
})
|
|
@@ -4900,8 +5143,8 @@ var ToolSkill = class extends AiDir {
|
|
|
4900
5143
|
}) {
|
|
4901
5144
|
const settablePaths = getSettablePaths({ global });
|
|
4902
5145
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
4903
|
-
const skillDirPath = (0,
|
|
4904
|
-
const skillFilePath = (0,
|
|
5146
|
+
const skillDirPath = (0, import_node_path44.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5147
|
+
const skillFilePath = (0, import_node_path44.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4905
5148
|
if (!await fileExists(skillFilePath)) {
|
|
4906
5149
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4907
5150
|
}
|
|
@@ -4959,7 +5202,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
4959
5202
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
4960
5203
|
if (!result.success) {
|
|
4961
5204
|
throw new Error(
|
|
4962
|
-
`Invalid frontmatter in ${(0,
|
|
5205
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
4963
5206
|
);
|
|
4964
5207
|
}
|
|
4965
5208
|
}
|
|
@@ -5017,8 +5260,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
5017
5260
|
}) {
|
|
5018
5261
|
const settablePaths = this.getSettablePaths();
|
|
5019
5262
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
5020
|
-
const skillDirPath = (0,
|
|
5021
|
-
const skillFilePath = (0,
|
|
5263
|
+
const skillDirPath = (0, import_node_path45.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5264
|
+
const skillFilePath = (0, import_node_path45.join)(skillDirPath, SKILL_FILE_NAME);
|
|
5022
5265
|
if (!await fileExists(skillFilePath)) {
|
|
5023
5266
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
5024
5267
|
}
|
|
@@ -5095,7 +5338,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
5095
5338
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
5096
5339
|
}
|
|
5097
5340
|
return {
|
|
5098
|
-
relativeDirPath: (0,
|
|
5341
|
+
relativeDirPath: (0, import_node_path46.join)(".agents", "skills")
|
|
5099
5342
|
};
|
|
5100
5343
|
}
|
|
5101
5344
|
static async fromDir(params) {
|
|
@@ -5122,14 +5365,14 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
5122
5365
|
};
|
|
5123
5366
|
|
|
5124
5367
|
// src/features/skills/geminicli-skill.ts
|
|
5125
|
-
var
|
|
5368
|
+
var import_node_path47 = require("path");
|
|
5126
5369
|
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
5127
5370
|
static getSettablePaths(options) {
|
|
5128
5371
|
if (options?.global) {
|
|
5129
5372
|
throw new Error("GeminiCliSkill does not support global mode.");
|
|
5130
5373
|
}
|
|
5131
5374
|
return {
|
|
5132
|
-
relativeDirPath: (0,
|
|
5375
|
+
relativeDirPath: (0, import_node_path47.join)(".gemini", "skills")
|
|
5133
5376
|
};
|
|
5134
5377
|
}
|
|
5135
5378
|
static async fromDir(params) {
|
|
@@ -5156,11 +5399,11 @@ var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
|
5156
5399
|
};
|
|
5157
5400
|
|
|
5158
5401
|
// src/features/skills/skills-processor.ts
|
|
5159
|
-
var
|
|
5160
|
-
var
|
|
5402
|
+
var import_node_path57 = require("path");
|
|
5403
|
+
var import_mini28 = require("zod/mini");
|
|
5161
5404
|
|
|
5162
5405
|
// src/types/dir-feature-processor.ts
|
|
5163
|
-
var
|
|
5406
|
+
var import_node_path48 = require("path");
|
|
5164
5407
|
var DirFeatureProcessor = class {
|
|
5165
5408
|
baseDir;
|
|
5166
5409
|
constructor({ baseDir = process.cwd() }) {
|
|
@@ -5182,14 +5425,14 @@ var DirFeatureProcessor = class {
|
|
|
5182
5425
|
await ensureDir(dirPath);
|
|
5183
5426
|
const mainFile = aiDir.getMainFile();
|
|
5184
5427
|
if (mainFile) {
|
|
5185
|
-
const mainFilePath = (0,
|
|
5428
|
+
const mainFilePath = (0, import_node_path48.join)(dirPath, mainFile.name);
|
|
5186
5429
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
5187
5430
|
const contentWithNewline = addTrailingNewline(content);
|
|
5188
5431
|
await writeFileContent(mainFilePath, contentWithNewline);
|
|
5189
5432
|
}
|
|
5190
5433
|
const otherFiles = aiDir.getOtherFiles();
|
|
5191
5434
|
for (const file of otherFiles) {
|
|
5192
|
-
const filePath = (0,
|
|
5435
|
+
const filePath = (0, import_node_path48.join)(dirPath, file.relativeFilePathToDirPath);
|
|
5193
5436
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
5194
5437
|
await writeFileContent(filePath, contentWithNewline);
|
|
5195
5438
|
}
|
|
@@ -5204,11 +5447,11 @@ var DirFeatureProcessor = class {
|
|
|
5204
5447
|
};
|
|
5205
5448
|
|
|
5206
5449
|
// src/features/skills/claudecode-skill.ts
|
|
5207
|
-
var
|
|
5450
|
+
var import_node_path50 = require("path");
|
|
5208
5451
|
var import_mini21 = require("zod/mini");
|
|
5209
5452
|
|
|
5210
5453
|
// src/features/skills/rulesync-skill.ts
|
|
5211
|
-
var
|
|
5454
|
+
var import_node_path49 = require("path");
|
|
5212
5455
|
var import_mini20 = require("zod/mini");
|
|
5213
5456
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini20.z.looseObject({
|
|
5214
5457
|
name: import_mini20.z.string(),
|
|
@@ -5295,8 +5538,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
5295
5538
|
dirName,
|
|
5296
5539
|
global = false
|
|
5297
5540
|
}) {
|
|
5298
|
-
const skillDirPath = (0,
|
|
5299
|
-
const skillFilePath = (0,
|
|
5541
|
+
const skillDirPath = (0, import_node_path49.join)(baseDir, relativeDirPath, dirName);
|
|
5542
|
+
const skillFilePath = (0, import_node_path49.join)(skillDirPath, SKILL_FILE_NAME);
|
|
5300
5543
|
if (!await fileExists(skillFilePath)) {
|
|
5301
5544
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
5302
5545
|
}
|
|
@@ -5334,7 +5577,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini21.z.looseObject({
|
|
|
5334
5577
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
5335
5578
|
constructor({
|
|
5336
5579
|
baseDir = process.cwd(),
|
|
5337
|
-
relativeDirPath = (0,
|
|
5580
|
+
relativeDirPath = (0, import_node_path50.join)(".claude", "skills"),
|
|
5338
5581
|
dirName,
|
|
5339
5582
|
frontmatter,
|
|
5340
5583
|
body,
|
|
@@ -5365,7 +5608,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
5365
5608
|
global: _global = false
|
|
5366
5609
|
} = {}) {
|
|
5367
5610
|
return {
|
|
5368
|
-
relativeDirPath: (0,
|
|
5611
|
+
relativeDirPath: (0, import_node_path50.join)(".claude", "skills")
|
|
5369
5612
|
};
|
|
5370
5613
|
}
|
|
5371
5614
|
getFrontmatter() {
|
|
@@ -5453,9 +5696,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
5453
5696
|
});
|
|
5454
5697
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
5455
5698
|
if (!result.success) {
|
|
5456
|
-
const skillDirPath = (0,
|
|
5699
|
+
const skillDirPath = (0, import_node_path50.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
5457
5700
|
throw new Error(
|
|
5458
|
-
`Invalid frontmatter in ${(0,
|
|
5701
|
+
`Invalid frontmatter in ${(0, import_node_path50.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
5459
5702
|
);
|
|
5460
5703
|
}
|
|
5461
5704
|
return new _ClaudecodeSkill({
|
|
@@ -5489,7 +5732,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
5489
5732
|
};
|
|
5490
5733
|
|
|
5491
5734
|
// src/features/skills/codexcli-skill.ts
|
|
5492
|
-
var
|
|
5735
|
+
var import_node_path51 = require("path");
|
|
5493
5736
|
var import_mini22 = require("zod/mini");
|
|
5494
5737
|
var CodexCliSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
5495
5738
|
name: import_mini22.z.string(),
|
|
@@ -5498,7 +5741,7 @@ var CodexCliSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
|
5498
5741
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
5499
5742
|
constructor({
|
|
5500
5743
|
baseDir = process.cwd(),
|
|
5501
|
-
relativeDirPath = (0,
|
|
5744
|
+
relativeDirPath = (0, import_node_path51.join)(".codex", "skills"),
|
|
5502
5745
|
dirName,
|
|
5503
5746
|
frontmatter,
|
|
5504
5747
|
body,
|
|
@@ -5530,7 +5773,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
5530
5773
|
throw new Error("CodexCliSkill only supports global mode. Please pass { global: true }.");
|
|
5531
5774
|
}
|
|
5532
5775
|
return {
|
|
5533
|
-
relativeDirPath: (0,
|
|
5776
|
+
relativeDirPath: (0, import_node_path51.join)(".codex", "skills")
|
|
5534
5777
|
};
|
|
5535
5778
|
}
|
|
5536
5779
|
getFrontmatter() {
|
|
@@ -5612,9 +5855,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
5612
5855
|
});
|
|
5613
5856
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
5614
5857
|
if (!result.success) {
|
|
5615
|
-
const skillDirPath = (0,
|
|
5858
|
+
const skillDirPath = (0, import_node_path51.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
5616
5859
|
throw new Error(
|
|
5617
|
-
`Invalid frontmatter in ${(0,
|
|
5860
|
+
`Invalid frontmatter in ${(0, import_node_path51.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
5618
5861
|
);
|
|
5619
5862
|
}
|
|
5620
5863
|
return new _CodexCliSkill({
|
|
@@ -5648,7 +5891,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
5648
5891
|
};
|
|
5649
5892
|
|
|
5650
5893
|
// src/features/skills/copilot-skill.ts
|
|
5651
|
-
var
|
|
5894
|
+
var import_node_path52 = require("path");
|
|
5652
5895
|
var import_mini23 = require("zod/mini");
|
|
5653
5896
|
var CopilotSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
5654
5897
|
name: import_mini23.z.string(),
|
|
@@ -5658,7 +5901,7 @@ var CopilotSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
|
5658
5901
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
5659
5902
|
constructor({
|
|
5660
5903
|
baseDir = process.cwd(),
|
|
5661
|
-
relativeDirPath = (0,
|
|
5904
|
+
relativeDirPath = (0, import_node_path52.join)(".github", "skills"),
|
|
5662
5905
|
dirName,
|
|
5663
5906
|
frontmatter,
|
|
5664
5907
|
body,
|
|
@@ -5690,7 +5933,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
5690
5933
|
throw new Error("CopilotSkill does not support global mode.");
|
|
5691
5934
|
}
|
|
5692
5935
|
return {
|
|
5693
|
-
relativeDirPath: (0,
|
|
5936
|
+
relativeDirPath: (0, import_node_path52.join)(".github", "skills")
|
|
5694
5937
|
};
|
|
5695
5938
|
}
|
|
5696
5939
|
getFrontmatter() {
|
|
@@ -5778,9 +6021,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
5778
6021
|
});
|
|
5779
6022
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
5780
6023
|
if (!result.success) {
|
|
5781
|
-
const skillDirPath = (0,
|
|
6024
|
+
const skillDirPath = (0, import_node_path52.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
5782
6025
|
throw new Error(
|
|
5783
|
-
`Invalid frontmatter in ${(0,
|
|
6026
|
+
`Invalid frontmatter in ${(0, import_node_path52.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
5784
6027
|
);
|
|
5785
6028
|
}
|
|
5786
6029
|
return new _CopilotSkill({
|
|
@@ -5815,7 +6058,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
5815
6058
|
};
|
|
5816
6059
|
|
|
5817
6060
|
// src/features/skills/cursor-skill.ts
|
|
5818
|
-
var
|
|
6061
|
+
var import_node_path53 = require("path");
|
|
5819
6062
|
var import_mini24 = require("zod/mini");
|
|
5820
6063
|
var CursorSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
5821
6064
|
name: import_mini24.z.string(),
|
|
@@ -5824,7 +6067,7 @@ var CursorSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
|
5824
6067
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
5825
6068
|
constructor({
|
|
5826
6069
|
baseDir = process.cwd(),
|
|
5827
|
-
relativeDirPath = (0,
|
|
6070
|
+
relativeDirPath = (0, import_node_path53.join)(".cursor", "skills"),
|
|
5828
6071
|
dirName,
|
|
5829
6072
|
frontmatter,
|
|
5830
6073
|
body,
|
|
@@ -5856,7 +6099,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
5856
6099
|
throw new Error("CursorSkill does not support global mode.");
|
|
5857
6100
|
}
|
|
5858
6101
|
return {
|
|
5859
|
-
relativeDirPath: (0,
|
|
6102
|
+
relativeDirPath: (0, import_node_path53.join)(".cursor", "skills")
|
|
5860
6103
|
};
|
|
5861
6104
|
}
|
|
5862
6105
|
getFrontmatter() {
|
|
@@ -5929,21 +6172,199 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
5929
6172
|
}
|
|
5930
6173
|
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
5931
6174
|
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
5932
|
-
return targets.includes("*") || targets.includes("cursor");
|
|
6175
|
+
return targets.includes("*") || targets.includes("cursor");
|
|
6176
|
+
}
|
|
6177
|
+
static async fromDir(params) {
|
|
6178
|
+
const loaded = await this.loadSkillDirContent({
|
|
6179
|
+
...params,
|
|
6180
|
+
getSettablePaths: _CursorSkill.getSettablePaths
|
|
6181
|
+
});
|
|
6182
|
+
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6183
|
+
if (!result.success) {
|
|
6184
|
+
const skillDirPath = (0, import_node_path53.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6185
|
+
throw new Error(
|
|
6186
|
+
`Invalid frontmatter in ${(0, import_node_path53.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6187
|
+
);
|
|
6188
|
+
}
|
|
6189
|
+
return new _CursorSkill({
|
|
6190
|
+
baseDir: loaded.baseDir,
|
|
6191
|
+
relativeDirPath: loaded.relativeDirPath,
|
|
6192
|
+
dirName: loaded.dirName,
|
|
6193
|
+
frontmatter: result.data,
|
|
6194
|
+
body: loaded.body,
|
|
6195
|
+
otherFiles: loaded.otherFiles,
|
|
6196
|
+
validate: true,
|
|
6197
|
+
global: loaded.global
|
|
6198
|
+
});
|
|
6199
|
+
}
|
|
6200
|
+
static forDeletion({
|
|
6201
|
+
baseDir = process.cwd(),
|
|
6202
|
+
relativeDirPath,
|
|
6203
|
+
dirName,
|
|
6204
|
+
global = false
|
|
6205
|
+
}) {
|
|
6206
|
+
const settablePaths = _CursorSkill.getSettablePaths({ global });
|
|
6207
|
+
return new _CursorSkill({
|
|
6208
|
+
baseDir,
|
|
6209
|
+
relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
|
|
6210
|
+
dirName,
|
|
6211
|
+
frontmatter: { name: "", description: "" },
|
|
6212
|
+
body: "",
|
|
6213
|
+
otherFiles: [],
|
|
6214
|
+
validate: false,
|
|
6215
|
+
global
|
|
6216
|
+
});
|
|
6217
|
+
}
|
|
6218
|
+
};
|
|
6219
|
+
|
|
6220
|
+
// src/features/skills/kilo-skill.ts
|
|
6221
|
+
var import_node_path54 = require("path");
|
|
6222
|
+
var import_mini25 = require("zod/mini");
|
|
6223
|
+
var KiloSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
6224
|
+
name: import_mini25.z.string(),
|
|
6225
|
+
description: import_mini25.z.string()
|
|
6226
|
+
});
|
|
6227
|
+
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
6228
|
+
constructor({
|
|
6229
|
+
baseDir = process.cwd(),
|
|
6230
|
+
relativeDirPath = (0, import_node_path54.join)(".kilocode", "skills"),
|
|
6231
|
+
dirName,
|
|
6232
|
+
frontmatter,
|
|
6233
|
+
body,
|
|
6234
|
+
otherFiles = [],
|
|
6235
|
+
validate = true,
|
|
6236
|
+
global = false
|
|
6237
|
+
}) {
|
|
6238
|
+
super({
|
|
6239
|
+
baseDir,
|
|
6240
|
+
relativeDirPath,
|
|
6241
|
+
dirName,
|
|
6242
|
+
mainFile: {
|
|
6243
|
+
name: SKILL_FILE_NAME,
|
|
6244
|
+
body,
|
|
6245
|
+
frontmatter: { ...frontmatter }
|
|
6246
|
+
},
|
|
6247
|
+
otherFiles,
|
|
6248
|
+
global
|
|
6249
|
+
});
|
|
6250
|
+
if (validate) {
|
|
6251
|
+
const result = this.validate();
|
|
6252
|
+
if (!result.success) {
|
|
6253
|
+
throw result.error;
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
static getSettablePaths({
|
|
6258
|
+
global: _global = false
|
|
6259
|
+
} = {}) {
|
|
6260
|
+
return {
|
|
6261
|
+
relativeDirPath: (0, import_node_path54.join)(".kilocode", "skills")
|
|
6262
|
+
};
|
|
6263
|
+
}
|
|
6264
|
+
getFrontmatter() {
|
|
6265
|
+
if (!this.mainFile?.frontmatter) {
|
|
6266
|
+
throw new Error("Frontmatter is not defined");
|
|
6267
|
+
}
|
|
6268
|
+
const result = KiloSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
|
|
6269
|
+
return result;
|
|
6270
|
+
}
|
|
6271
|
+
getBody() {
|
|
6272
|
+
return this.mainFile?.body ?? "";
|
|
6273
|
+
}
|
|
6274
|
+
validate() {
|
|
6275
|
+
if (!this.mainFile) {
|
|
6276
|
+
return {
|
|
6277
|
+
success: false,
|
|
6278
|
+
error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
|
|
6279
|
+
};
|
|
6280
|
+
}
|
|
6281
|
+
const result = KiloSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
|
|
6282
|
+
if (!result.success) {
|
|
6283
|
+
return {
|
|
6284
|
+
success: false,
|
|
6285
|
+
error: new Error(
|
|
6286
|
+
`Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
|
|
6287
|
+
)
|
|
6288
|
+
};
|
|
6289
|
+
}
|
|
6290
|
+
if (result.data.name !== this.getDirName()) {
|
|
6291
|
+
return {
|
|
6292
|
+
success: false,
|
|
6293
|
+
error: new Error(
|
|
6294
|
+
`${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
|
|
6295
|
+
)
|
|
6296
|
+
};
|
|
6297
|
+
}
|
|
6298
|
+
return { success: true, error: null };
|
|
6299
|
+
}
|
|
6300
|
+
toRulesyncSkill() {
|
|
6301
|
+
const frontmatter = this.getFrontmatter();
|
|
6302
|
+
const rulesyncFrontmatter = {
|
|
6303
|
+
name: frontmatter.name,
|
|
6304
|
+
description: frontmatter.description,
|
|
6305
|
+
targets: ["*"]
|
|
6306
|
+
};
|
|
6307
|
+
return new RulesyncSkill({
|
|
6308
|
+
baseDir: this.baseDir,
|
|
6309
|
+
relativeDirPath: this.relativeDirPath,
|
|
6310
|
+
dirName: this.getDirName(),
|
|
6311
|
+
frontmatter: rulesyncFrontmatter,
|
|
6312
|
+
body: this.getBody(),
|
|
6313
|
+
otherFiles: this.getOtherFiles(),
|
|
6314
|
+
validate: true,
|
|
6315
|
+
global: this.global
|
|
6316
|
+
});
|
|
6317
|
+
}
|
|
6318
|
+
static fromRulesyncSkill({
|
|
6319
|
+
rulesyncSkill,
|
|
6320
|
+
validate = true,
|
|
6321
|
+
global = false
|
|
6322
|
+
}) {
|
|
6323
|
+
const settablePaths = _KiloSkill.getSettablePaths({ global });
|
|
6324
|
+
const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
|
|
6325
|
+
const kiloFrontmatter = {
|
|
6326
|
+
name: rulesyncFrontmatter.name,
|
|
6327
|
+
description: rulesyncFrontmatter.description
|
|
6328
|
+
};
|
|
6329
|
+
return new _KiloSkill({
|
|
6330
|
+
baseDir: rulesyncSkill.getBaseDir(),
|
|
6331
|
+
relativeDirPath: settablePaths.relativeDirPath,
|
|
6332
|
+
dirName: kiloFrontmatter.name,
|
|
6333
|
+
frontmatter: kiloFrontmatter,
|
|
6334
|
+
body: rulesyncSkill.getBody(),
|
|
6335
|
+
otherFiles: rulesyncSkill.getOtherFiles(),
|
|
6336
|
+
validate,
|
|
6337
|
+
global
|
|
6338
|
+
});
|
|
6339
|
+
}
|
|
6340
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
6341
|
+
const targets = rulesyncSkill.getFrontmatter().targets;
|
|
6342
|
+
return targets.includes("*") || targets.includes("kilo");
|
|
5933
6343
|
}
|
|
5934
6344
|
static async fromDir(params) {
|
|
5935
6345
|
const loaded = await this.loadSkillDirContent({
|
|
5936
6346
|
...params,
|
|
5937
|
-
getSettablePaths:
|
|
6347
|
+
getSettablePaths: _KiloSkill.getSettablePaths
|
|
5938
6348
|
});
|
|
5939
|
-
const result =
|
|
6349
|
+
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
5940
6350
|
if (!result.success) {
|
|
5941
|
-
const skillDirPath = (0,
|
|
6351
|
+
const skillDirPath = (0, import_node_path54.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
5942
6352
|
throw new Error(
|
|
5943
|
-
`Invalid frontmatter in ${(0,
|
|
6353
|
+
`Invalid frontmatter in ${(0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
5944
6354
|
);
|
|
5945
6355
|
}
|
|
5946
|
-
|
|
6356
|
+
if (result.data.name !== loaded.dirName) {
|
|
6357
|
+
const skillFilePath = (0, import_node_path54.join)(
|
|
6358
|
+
loaded.baseDir,
|
|
6359
|
+
loaded.relativeDirPath,
|
|
6360
|
+
loaded.dirName,
|
|
6361
|
+
SKILL_FILE_NAME
|
|
6362
|
+
);
|
|
6363
|
+
throw new Error(
|
|
6364
|
+
`Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
|
|
6365
|
+
);
|
|
6366
|
+
}
|
|
6367
|
+
return new _KiloSkill({
|
|
5947
6368
|
baseDir: loaded.baseDir,
|
|
5948
6369
|
relativeDirPath: loaded.relativeDirPath,
|
|
5949
6370
|
dirName: loaded.dirName,
|
|
@@ -5960,10 +6381,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
5960
6381
|
dirName,
|
|
5961
6382
|
global = false
|
|
5962
6383
|
}) {
|
|
5963
|
-
|
|
5964
|
-
return new _CursorSkill({
|
|
6384
|
+
return new _KiloSkill({
|
|
5965
6385
|
baseDir,
|
|
5966
|
-
relativeDirPath
|
|
6386
|
+
relativeDirPath,
|
|
5967
6387
|
dirName,
|
|
5968
6388
|
frontmatter: { name: "", description: "" },
|
|
5969
6389
|
body: "",
|
|
@@ -5975,17 +6395,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
5975
6395
|
};
|
|
5976
6396
|
|
|
5977
6397
|
// src/features/skills/opencode-skill.ts
|
|
5978
|
-
var
|
|
5979
|
-
var
|
|
5980
|
-
var OpenCodeSkillFrontmatterSchema =
|
|
5981
|
-
name:
|
|
5982
|
-
description:
|
|
5983
|
-
"allowed-tools":
|
|
6398
|
+
var import_node_path55 = require("path");
|
|
6399
|
+
var import_mini26 = require("zod/mini");
|
|
6400
|
+
var OpenCodeSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
6401
|
+
name: import_mini26.z.string(),
|
|
6402
|
+
description: import_mini26.z.string(),
|
|
6403
|
+
"allowed-tools": import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
|
|
5984
6404
|
});
|
|
5985
6405
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
5986
6406
|
constructor({
|
|
5987
6407
|
baseDir = process.cwd(),
|
|
5988
|
-
relativeDirPath = (0,
|
|
6408
|
+
relativeDirPath = (0, import_node_path55.join)(".opencode", "skill"),
|
|
5989
6409
|
dirName,
|
|
5990
6410
|
frontmatter,
|
|
5991
6411
|
body,
|
|
@@ -6014,7 +6434,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6014
6434
|
}
|
|
6015
6435
|
static getSettablePaths({ global = false } = {}) {
|
|
6016
6436
|
return {
|
|
6017
|
-
relativeDirPath: global ? (0,
|
|
6437
|
+
relativeDirPath: global ? (0, import_node_path55.join)(".config", "opencode", "skill") : (0, import_node_path55.join)(".opencode", "skill")
|
|
6018
6438
|
};
|
|
6019
6439
|
}
|
|
6020
6440
|
getFrontmatter() {
|
|
@@ -6102,9 +6522,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6102
6522
|
});
|
|
6103
6523
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6104
6524
|
if (!result.success) {
|
|
6105
|
-
const skillDirPath = (0,
|
|
6525
|
+
const skillDirPath = (0, import_node_path55.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6106
6526
|
throw new Error(
|
|
6107
|
-
`Invalid frontmatter in ${(0,
|
|
6527
|
+
`Invalid frontmatter in ${(0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6108
6528
|
);
|
|
6109
6529
|
}
|
|
6110
6530
|
return new _OpenCodeSkill({
|
|
@@ -6138,16 +6558,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6138
6558
|
};
|
|
6139
6559
|
|
|
6140
6560
|
// src/features/skills/roo-skill.ts
|
|
6141
|
-
var
|
|
6142
|
-
var
|
|
6143
|
-
var RooSkillFrontmatterSchema =
|
|
6144
|
-
name:
|
|
6145
|
-
description:
|
|
6561
|
+
var import_node_path56 = require("path");
|
|
6562
|
+
var import_mini27 = require("zod/mini");
|
|
6563
|
+
var RooSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
6564
|
+
name: import_mini27.z.string(),
|
|
6565
|
+
description: import_mini27.z.string()
|
|
6146
6566
|
});
|
|
6147
6567
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
6148
6568
|
constructor({
|
|
6149
6569
|
baseDir = process.cwd(),
|
|
6150
|
-
relativeDirPath = (0,
|
|
6570
|
+
relativeDirPath = (0, import_node_path56.join)(".roo", "skills"),
|
|
6151
6571
|
dirName,
|
|
6152
6572
|
frontmatter,
|
|
6153
6573
|
body,
|
|
@@ -6178,7 +6598,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
6178
6598
|
global: _global = false
|
|
6179
6599
|
} = {}) {
|
|
6180
6600
|
return {
|
|
6181
|
-
relativeDirPath: (0,
|
|
6601
|
+
relativeDirPath: (0, import_node_path56.join)(".roo", "skills")
|
|
6182
6602
|
};
|
|
6183
6603
|
}
|
|
6184
6604
|
getFrontmatter() {
|
|
@@ -6268,13 +6688,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
6268
6688
|
});
|
|
6269
6689
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6270
6690
|
if (!result.success) {
|
|
6271
|
-
const skillDirPath = (0,
|
|
6691
|
+
const skillDirPath = (0, import_node_path56.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6272
6692
|
throw new Error(
|
|
6273
|
-
`Invalid frontmatter in ${(0,
|
|
6693
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6274
6694
|
);
|
|
6275
6695
|
}
|
|
6276
6696
|
if (result.data.name !== loaded.dirName) {
|
|
6277
|
-
const skillFilePath = (0,
|
|
6697
|
+
const skillFilePath = (0, import_node_path56.join)(
|
|
6278
6698
|
loaded.baseDir,
|
|
6279
6699
|
loaded.relativeDirPath,
|
|
6280
6700
|
loaded.dirName,
|
|
@@ -6323,10 +6743,11 @@ var skillsProcessorToolTargetTuple = [
|
|
|
6323
6743
|
"copilot",
|
|
6324
6744
|
"cursor",
|
|
6325
6745
|
"geminicli",
|
|
6746
|
+
"kilo",
|
|
6326
6747
|
"opencode",
|
|
6327
6748
|
"roo"
|
|
6328
6749
|
];
|
|
6329
|
-
var SkillsProcessorToolTargetSchema =
|
|
6750
|
+
var SkillsProcessorToolTargetSchema = import_mini28.z.enum(skillsProcessorToolTargetTuple);
|
|
6330
6751
|
var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
6331
6752
|
[
|
|
6332
6753
|
"agentsmd",
|
|
@@ -6377,6 +6798,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
6377
6798
|
meta: { supportsProject: true, supportsSimulated: true, supportsGlobal: false }
|
|
6378
6799
|
}
|
|
6379
6800
|
],
|
|
6801
|
+
[
|
|
6802
|
+
"kilo",
|
|
6803
|
+
{
|
|
6804
|
+
class: KiloSkill,
|
|
6805
|
+
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
6806
|
+
}
|
|
6807
|
+
],
|
|
6380
6808
|
[
|
|
6381
6809
|
"opencode",
|
|
6382
6810
|
{
|
|
@@ -6469,9 +6897,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
6469
6897
|
*/
|
|
6470
6898
|
async loadRulesyncDirs() {
|
|
6471
6899
|
const paths = RulesyncSkill.getSettablePaths();
|
|
6472
|
-
const rulesyncSkillsDirPath = (0,
|
|
6473
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
6474
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
6900
|
+
const rulesyncSkillsDirPath = (0, import_node_path57.join)(this.baseDir, paths.relativeDirPath);
|
|
6901
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path57.join)(rulesyncSkillsDirPath, "*"), { type: "dir" });
|
|
6902
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path57.basename)(path3));
|
|
6475
6903
|
const rulesyncSkills = await Promise.all(
|
|
6476
6904
|
dirNames.map(
|
|
6477
6905
|
(dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
|
|
@@ -6487,9 +6915,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
6487
6915
|
async loadToolDirs() {
|
|
6488
6916
|
const factory = this.getFactory(this.toolTarget);
|
|
6489
6917
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
6490
|
-
const skillsDirPath = (0,
|
|
6491
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
6492
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
6918
|
+
const skillsDirPath = (0, import_node_path57.join)(this.baseDir, paths.relativeDirPath);
|
|
6919
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path57.join)(skillsDirPath, "*"), { type: "dir" });
|
|
6920
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path57.basename)(path3));
|
|
6493
6921
|
const toolSkills = await Promise.all(
|
|
6494
6922
|
dirNames.map(
|
|
6495
6923
|
(dirName) => factory.class.fromDir({
|
|
@@ -6505,9 +6933,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
6505
6933
|
async loadToolDirsToDelete() {
|
|
6506
6934
|
const factory = this.getFactory(this.toolTarget);
|
|
6507
6935
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
6508
|
-
const skillsDirPath = (0,
|
|
6509
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
6510
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
6936
|
+
const skillsDirPath = (0, import_node_path57.join)(this.baseDir, paths.relativeDirPath);
|
|
6937
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path57.join)(skillsDirPath, "*"), { type: "dir" });
|
|
6938
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path57.basename)(path3));
|
|
6511
6939
|
const toolSkills = dirNames.map(
|
|
6512
6940
|
(dirName) => factory.class.forDeletion({
|
|
6513
6941
|
baseDir: this.baseDir,
|
|
@@ -6555,11 +6983,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
6555
6983
|
};
|
|
6556
6984
|
|
|
6557
6985
|
// src/features/subagents/agentsmd-subagent.ts
|
|
6558
|
-
var
|
|
6986
|
+
var import_node_path59 = require("path");
|
|
6559
6987
|
|
|
6560
6988
|
// src/features/subagents/simulated-subagent.ts
|
|
6561
|
-
var
|
|
6562
|
-
var
|
|
6989
|
+
var import_node_path58 = require("path");
|
|
6990
|
+
var import_mini29 = require("zod/mini");
|
|
6563
6991
|
|
|
6564
6992
|
// src/features/subagents/tool-subagent.ts
|
|
6565
6993
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -6602,9 +7030,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
6602
7030
|
};
|
|
6603
7031
|
|
|
6604
7032
|
// src/features/subagents/simulated-subagent.ts
|
|
6605
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
6606
|
-
name:
|
|
6607
|
-
description:
|
|
7033
|
+
var SimulatedSubagentFrontmatterSchema = import_mini29.z.object({
|
|
7034
|
+
name: import_mini29.z.string(),
|
|
7035
|
+
description: import_mini29.z.string()
|
|
6608
7036
|
});
|
|
6609
7037
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
6610
7038
|
frontmatter;
|
|
@@ -6614,7 +7042,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
6614
7042
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
6615
7043
|
if (!result.success) {
|
|
6616
7044
|
throw new Error(
|
|
6617
|
-
`Invalid frontmatter in ${(0,
|
|
7045
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6618
7046
|
);
|
|
6619
7047
|
}
|
|
6620
7048
|
}
|
|
@@ -6665,7 +7093,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
6665
7093
|
return {
|
|
6666
7094
|
success: false,
|
|
6667
7095
|
error: new Error(
|
|
6668
|
-
`Invalid frontmatter in ${(0,
|
|
7096
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6669
7097
|
)
|
|
6670
7098
|
};
|
|
6671
7099
|
}
|
|
@@ -6675,7 +7103,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
6675
7103
|
relativeFilePath,
|
|
6676
7104
|
validate = true
|
|
6677
7105
|
}) {
|
|
6678
|
-
const filePath = (0,
|
|
7106
|
+
const filePath = (0, import_node_path58.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
6679
7107
|
const fileContent = await readFileContent(filePath);
|
|
6680
7108
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
6681
7109
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -6685,7 +7113,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
6685
7113
|
return {
|
|
6686
7114
|
baseDir,
|
|
6687
7115
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
6688
|
-
relativeFilePath: (0,
|
|
7116
|
+
relativeFilePath: (0, import_node_path58.basename)(relativeFilePath),
|
|
6689
7117
|
frontmatter: result.data,
|
|
6690
7118
|
body: content.trim(),
|
|
6691
7119
|
validate
|
|
@@ -6711,7 +7139,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
6711
7139
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
6712
7140
|
static getSettablePaths() {
|
|
6713
7141
|
return {
|
|
6714
|
-
relativeDirPath: (0,
|
|
7142
|
+
relativeDirPath: (0, import_node_path59.join)(".agents", "subagents")
|
|
6715
7143
|
};
|
|
6716
7144
|
}
|
|
6717
7145
|
static async fromFile(params) {
|
|
@@ -6734,11 +7162,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
6734
7162
|
};
|
|
6735
7163
|
|
|
6736
7164
|
// src/features/subagents/codexcli-subagent.ts
|
|
6737
|
-
var
|
|
7165
|
+
var import_node_path60 = require("path");
|
|
6738
7166
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
6739
7167
|
static getSettablePaths() {
|
|
6740
7168
|
return {
|
|
6741
|
-
relativeDirPath: (0,
|
|
7169
|
+
relativeDirPath: (0, import_node_path60.join)(".codex", "subagents")
|
|
6742
7170
|
};
|
|
6743
7171
|
}
|
|
6744
7172
|
static async fromFile(params) {
|
|
@@ -6761,11 +7189,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
6761
7189
|
};
|
|
6762
7190
|
|
|
6763
7191
|
// src/features/subagents/cursor-subagent.ts
|
|
6764
|
-
var
|
|
7192
|
+
var import_node_path61 = require("path");
|
|
6765
7193
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
6766
7194
|
static getSettablePaths() {
|
|
6767
7195
|
return {
|
|
6768
|
-
relativeDirPath: (0,
|
|
7196
|
+
relativeDirPath: (0, import_node_path61.join)(".cursor", "subagents")
|
|
6769
7197
|
};
|
|
6770
7198
|
}
|
|
6771
7199
|
static async fromFile(params) {
|
|
@@ -6788,11 +7216,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
6788
7216
|
};
|
|
6789
7217
|
|
|
6790
7218
|
// src/features/subagents/geminicli-subagent.ts
|
|
6791
|
-
var
|
|
7219
|
+
var import_node_path62 = require("path");
|
|
6792
7220
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
6793
7221
|
static getSettablePaths() {
|
|
6794
7222
|
return {
|
|
6795
|
-
relativeDirPath: (0,
|
|
7223
|
+
relativeDirPath: (0, import_node_path62.join)(".gemini", "subagents")
|
|
6796
7224
|
};
|
|
6797
7225
|
}
|
|
6798
7226
|
static async fromFile(params) {
|
|
@@ -6815,11 +7243,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
6815
7243
|
};
|
|
6816
7244
|
|
|
6817
7245
|
// src/features/subagents/roo-subagent.ts
|
|
6818
|
-
var
|
|
7246
|
+
var import_node_path63 = require("path");
|
|
6819
7247
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
6820
7248
|
static getSettablePaths() {
|
|
6821
7249
|
return {
|
|
6822
|
-
relativeDirPath: (0,
|
|
7250
|
+
relativeDirPath: (0, import_node_path63.join)(".roo", "subagents")
|
|
6823
7251
|
};
|
|
6824
7252
|
}
|
|
6825
7253
|
static async fromFile(params) {
|
|
@@ -6842,20 +7270,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
6842
7270
|
};
|
|
6843
7271
|
|
|
6844
7272
|
// src/features/subagents/subagents-processor.ts
|
|
6845
|
-
var
|
|
6846
|
-
var
|
|
7273
|
+
var import_node_path68 = require("path");
|
|
7274
|
+
var import_mini34 = require("zod/mini");
|
|
6847
7275
|
|
|
6848
7276
|
// src/features/subagents/claudecode-subagent.ts
|
|
6849
|
-
var
|
|
6850
|
-
var
|
|
7277
|
+
var import_node_path65 = require("path");
|
|
7278
|
+
var import_mini31 = require("zod/mini");
|
|
6851
7279
|
|
|
6852
7280
|
// src/features/subagents/rulesync-subagent.ts
|
|
6853
|
-
var
|
|
6854
|
-
var
|
|
6855
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
7281
|
+
var import_node_path64 = require("path");
|
|
7282
|
+
var import_mini30 = require("zod/mini");
|
|
7283
|
+
var RulesyncSubagentFrontmatterSchema = import_mini30.z.looseObject({
|
|
6856
7284
|
targets: RulesyncTargetsSchema,
|
|
6857
|
-
name:
|
|
6858
|
-
description:
|
|
7285
|
+
name: import_mini30.z.string(),
|
|
7286
|
+
description: import_mini30.z.string()
|
|
6859
7287
|
});
|
|
6860
7288
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
6861
7289
|
frontmatter;
|
|
@@ -6865,7 +7293,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
6865
7293
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
6866
7294
|
if (!result.success) {
|
|
6867
7295
|
throw new Error(
|
|
6868
|
-
`Invalid frontmatter in ${(0,
|
|
7296
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6869
7297
|
);
|
|
6870
7298
|
}
|
|
6871
7299
|
}
|
|
@@ -6898,7 +7326,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
6898
7326
|
return {
|
|
6899
7327
|
success: false,
|
|
6900
7328
|
error: new Error(
|
|
6901
|
-
`Invalid frontmatter in ${(0,
|
|
7329
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6902
7330
|
)
|
|
6903
7331
|
};
|
|
6904
7332
|
}
|
|
@@ -6907,14 +7335,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
6907
7335
|
relativeFilePath
|
|
6908
7336
|
}) {
|
|
6909
7337
|
const fileContent = await readFileContent(
|
|
6910
|
-
(0,
|
|
7338
|
+
(0, import_node_path64.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
6911
7339
|
);
|
|
6912
7340
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
6913
7341
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
6914
7342
|
if (!result.success) {
|
|
6915
7343
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
6916
7344
|
}
|
|
6917
|
-
const filename = (0,
|
|
7345
|
+
const filename = (0, import_node_path64.basename)(relativeFilePath);
|
|
6918
7346
|
return new _RulesyncSubagent({
|
|
6919
7347
|
baseDir: process.cwd(),
|
|
6920
7348
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -6926,13 +7354,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
6926
7354
|
};
|
|
6927
7355
|
|
|
6928
7356
|
// src/features/subagents/claudecode-subagent.ts
|
|
6929
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
6930
|
-
name:
|
|
6931
|
-
description:
|
|
6932
|
-
model:
|
|
6933
|
-
tools:
|
|
6934
|
-
permissionMode:
|
|
6935
|
-
skills:
|
|
7357
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini31.z.looseObject({
|
|
7358
|
+
name: import_mini31.z.string(),
|
|
7359
|
+
description: import_mini31.z.string(),
|
|
7360
|
+
model: import_mini31.z.optional(import_mini31.z.string()),
|
|
7361
|
+
tools: import_mini31.z.optional(import_mini31.z.union([import_mini31.z.string(), import_mini31.z.array(import_mini31.z.string())])),
|
|
7362
|
+
permissionMode: import_mini31.z.optional(import_mini31.z.string()),
|
|
7363
|
+
skills: import_mini31.z.optional(import_mini31.z.union([import_mini31.z.string(), import_mini31.z.array(import_mini31.z.string())]))
|
|
6936
7364
|
});
|
|
6937
7365
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
6938
7366
|
frontmatter;
|
|
@@ -6942,7 +7370,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
6942
7370
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
6943
7371
|
if (!result.success) {
|
|
6944
7372
|
throw new Error(
|
|
6945
|
-
`Invalid frontmatter in ${(0,
|
|
7373
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6946
7374
|
);
|
|
6947
7375
|
}
|
|
6948
7376
|
}
|
|
@@ -6954,7 +7382,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
6954
7382
|
}
|
|
6955
7383
|
static getSettablePaths(_options = {}) {
|
|
6956
7384
|
return {
|
|
6957
|
-
relativeDirPath: (0,
|
|
7385
|
+
relativeDirPath: (0, import_node_path65.join)(".claude", "agents")
|
|
6958
7386
|
};
|
|
6959
7387
|
}
|
|
6960
7388
|
getFrontmatter() {
|
|
@@ -7028,7 +7456,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7028
7456
|
return {
|
|
7029
7457
|
success: false,
|
|
7030
7458
|
error: new Error(
|
|
7031
|
-
`Invalid frontmatter in ${(0,
|
|
7459
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7032
7460
|
)
|
|
7033
7461
|
};
|
|
7034
7462
|
}
|
|
@@ -7046,7 +7474,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7046
7474
|
global = false
|
|
7047
7475
|
}) {
|
|
7048
7476
|
const paths = this.getSettablePaths({ global });
|
|
7049
|
-
const filePath = (0,
|
|
7477
|
+
const filePath = (0, import_node_path65.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
7050
7478
|
const fileContent = await readFileContent(filePath);
|
|
7051
7479
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7052
7480
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -7081,13 +7509,13 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7081
7509
|
};
|
|
7082
7510
|
|
|
7083
7511
|
// src/features/subagents/copilot-subagent.ts
|
|
7084
|
-
var
|
|
7085
|
-
var
|
|
7512
|
+
var import_node_path66 = require("path");
|
|
7513
|
+
var import_mini32 = require("zod/mini");
|
|
7086
7514
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
7087
|
-
var CopilotSubagentFrontmatterSchema =
|
|
7088
|
-
name:
|
|
7089
|
-
description:
|
|
7090
|
-
tools:
|
|
7515
|
+
var CopilotSubagentFrontmatterSchema = import_mini32.z.looseObject({
|
|
7516
|
+
name: import_mini32.z.string(),
|
|
7517
|
+
description: import_mini32.z.string(),
|
|
7518
|
+
tools: import_mini32.z.optional(import_mini32.z.union([import_mini32.z.string(), import_mini32.z.array(import_mini32.z.string())]))
|
|
7091
7519
|
});
|
|
7092
7520
|
var normalizeTools = (tools) => {
|
|
7093
7521
|
if (!tools) {
|
|
@@ -7107,7 +7535,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7107
7535
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7108
7536
|
if (!result.success) {
|
|
7109
7537
|
throw new Error(
|
|
7110
|
-
`Invalid frontmatter in ${(0,
|
|
7538
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7111
7539
|
);
|
|
7112
7540
|
}
|
|
7113
7541
|
}
|
|
@@ -7119,7 +7547,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7119
7547
|
}
|
|
7120
7548
|
static getSettablePaths(_options = {}) {
|
|
7121
7549
|
return {
|
|
7122
|
-
relativeDirPath: (0,
|
|
7550
|
+
relativeDirPath: (0, import_node_path66.join)(".github", "agents")
|
|
7123
7551
|
};
|
|
7124
7552
|
}
|
|
7125
7553
|
getFrontmatter() {
|
|
@@ -7193,7 +7621,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7193
7621
|
return {
|
|
7194
7622
|
success: false,
|
|
7195
7623
|
error: new Error(
|
|
7196
|
-
`Invalid frontmatter in ${(0,
|
|
7624
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7197
7625
|
)
|
|
7198
7626
|
};
|
|
7199
7627
|
}
|
|
@@ -7211,7 +7639,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7211
7639
|
global = false
|
|
7212
7640
|
}) {
|
|
7213
7641
|
const paths = this.getSettablePaths({ global });
|
|
7214
|
-
const filePath = (0,
|
|
7642
|
+
const filePath = (0, import_node_path66.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
7215
7643
|
const fileContent = await readFileContent(filePath);
|
|
7216
7644
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7217
7645
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -7247,12 +7675,12 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7247
7675
|
};
|
|
7248
7676
|
|
|
7249
7677
|
// src/features/subagents/opencode-subagent.ts
|
|
7250
|
-
var
|
|
7251
|
-
var
|
|
7252
|
-
var OpenCodeSubagentFrontmatterSchema =
|
|
7253
|
-
description:
|
|
7254
|
-
mode:
|
|
7255
|
-
name:
|
|
7678
|
+
var import_node_path67 = require("path");
|
|
7679
|
+
var import_mini33 = require("zod/mini");
|
|
7680
|
+
var OpenCodeSubagentFrontmatterSchema = import_mini33.z.looseObject({
|
|
7681
|
+
description: import_mini33.z.string(),
|
|
7682
|
+
mode: import_mini33.z.literal("subagent"),
|
|
7683
|
+
name: import_mini33.z.optional(import_mini33.z.string())
|
|
7256
7684
|
});
|
|
7257
7685
|
var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
7258
7686
|
frontmatter;
|
|
@@ -7262,7 +7690,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
7262
7690
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7263
7691
|
if (!result.success) {
|
|
7264
7692
|
throw new Error(
|
|
7265
|
-
`Invalid frontmatter in ${(0,
|
|
7693
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7266
7694
|
);
|
|
7267
7695
|
}
|
|
7268
7696
|
}
|
|
@@ -7276,7 +7704,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
7276
7704
|
global = false
|
|
7277
7705
|
} = {}) {
|
|
7278
7706
|
return {
|
|
7279
|
-
relativeDirPath: global ? (0,
|
|
7707
|
+
relativeDirPath: global ? (0, import_node_path67.join)(".config", "opencode", "agent") : (0, import_node_path67.join)(".opencode", "agent")
|
|
7280
7708
|
};
|
|
7281
7709
|
}
|
|
7282
7710
|
getFrontmatter() {
|
|
@@ -7289,7 +7717,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
7289
7717
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
7290
7718
|
const rulesyncFrontmatter = {
|
|
7291
7719
|
targets: ["opencode"],
|
|
7292
|
-
name: name ?? (0,
|
|
7720
|
+
name: name ?? (0, import_node_path67.basename)(this.getRelativeFilePath(), ".md"),
|
|
7293
7721
|
description,
|
|
7294
7722
|
opencode: { mode, ...opencodeSection }
|
|
7295
7723
|
};
|
|
@@ -7342,7 +7770,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
7342
7770
|
return {
|
|
7343
7771
|
success: false,
|
|
7344
7772
|
error: new Error(
|
|
7345
|
-
`Invalid frontmatter in ${(0,
|
|
7773
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7346
7774
|
)
|
|
7347
7775
|
};
|
|
7348
7776
|
}
|
|
@@ -7359,7 +7787,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
7359
7787
|
global = false
|
|
7360
7788
|
}) {
|
|
7361
7789
|
const paths = this.getSettablePaths({ global });
|
|
7362
|
-
const filePath = (0,
|
|
7790
|
+
const filePath = (0, import_node_path67.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
7363
7791
|
const fileContent = await readFileContent(filePath);
|
|
7364
7792
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7365
7793
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -7406,7 +7834,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
7406
7834
|
"opencode",
|
|
7407
7835
|
"roo"
|
|
7408
7836
|
];
|
|
7409
|
-
var SubagentsProcessorToolTargetSchema =
|
|
7837
|
+
var SubagentsProcessorToolTargetSchema = import_mini34.z.enum(subagentsProcessorToolTargetTuple);
|
|
7410
7838
|
var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
7411
7839
|
[
|
|
7412
7840
|
"agentsmd",
|
|
@@ -7520,7 +7948,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
7520
7948
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
7521
7949
|
*/
|
|
7522
7950
|
async loadRulesyncFiles() {
|
|
7523
|
-
const subagentsDir = (0,
|
|
7951
|
+
const subagentsDir = (0, import_node_path68.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
7524
7952
|
const dirExists = await directoryExists(subagentsDir);
|
|
7525
7953
|
if (!dirExists) {
|
|
7526
7954
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -7535,7 +7963,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
7535
7963
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
7536
7964
|
const rulesyncSubagents = [];
|
|
7537
7965
|
for (const mdFile of mdFiles) {
|
|
7538
|
-
const filepath = (0,
|
|
7966
|
+
const filepath = (0, import_node_path68.join)(subagentsDir, mdFile);
|
|
7539
7967
|
try {
|
|
7540
7968
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
7541
7969
|
relativeFilePath: mdFile,
|
|
@@ -7565,14 +7993,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
7565
7993
|
const factory = this.getFactory(this.toolTarget);
|
|
7566
7994
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
7567
7995
|
const subagentFilePaths = await findFilesByGlobs(
|
|
7568
|
-
(0,
|
|
7996
|
+
(0, import_node_path68.join)(this.baseDir, paths.relativeDirPath, "*.md")
|
|
7569
7997
|
);
|
|
7570
7998
|
if (forDeletion) {
|
|
7571
7999
|
const toolSubagents2 = subagentFilePaths.map(
|
|
7572
8000
|
(path3) => factory.class.forDeletion({
|
|
7573
8001
|
baseDir: this.baseDir,
|
|
7574
8002
|
relativeDirPath: paths.relativeDirPath,
|
|
7575
|
-
relativeFilePath: (0,
|
|
8003
|
+
relativeFilePath: (0, import_node_path68.basename)(path3),
|
|
7576
8004
|
global: this.global
|
|
7577
8005
|
})
|
|
7578
8006
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -7583,7 +8011,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
7583
8011
|
subagentFilePaths.map(
|
|
7584
8012
|
(path3) => factory.class.fromFile({
|
|
7585
8013
|
baseDir: this.baseDir,
|
|
7586
|
-
relativeFilePath: (0,
|
|
8014
|
+
relativeFilePath: (0, import_node_path68.basename)(path3),
|
|
7587
8015
|
global: this.global
|
|
7588
8016
|
})
|
|
7589
8017
|
)
|
|
@@ -7615,48 +8043,48 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
7615
8043
|
};
|
|
7616
8044
|
|
|
7617
8045
|
// src/features/rules/agentsmd-rule.ts
|
|
7618
|
-
var
|
|
8046
|
+
var import_node_path71 = require("path");
|
|
7619
8047
|
|
|
7620
8048
|
// src/features/rules/tool-rule.ts
|
|
7621
|
-
var
|
|
8049
|
+
var import_node_path70 = require("path");
|
|
7622
8050
|
|
|
7623
8051
|
// src/features/rules/rulesync-rule.ts
|
|
7624
|
-
var
|
|
7625
|
-
var
|
|
7626
|
-
var RulesyncRuleFrontmatterSchema =
|
|
7627
|
-
root:
|
|
7628
|
-
targets:
|
|
7629
|
-
description:
|
|
7630
|
-
globs:
|
|
7631
|
-
agentsmd:
|
|
7632
|
-
|
|
8052
|
+
var import_node_path69 = require("path");
|
|
8053
|
+
var import_mini35 = require("zod/mini");
|
|
8054
|
+
var RulesyncRuleFrontmatterSchema = import_mini35.z.object({
|
|
8055
|
+
root: import_mini35.z.optional(import_mini35.z.optional(import_mini35.z.boolean())),
|
|
8056
|
+
targets: import_mini35.z.optional(RulesyncTargetsSchema),
|
|
8057
|
+
description: import_mini35.z.optional(import_mini35.z.string()),
|
|
8058
|
+
globs: import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string())),
|
|
8059
|
+
agentsmd: import_mini35.z.optional(
|
|
8060
|
+
import_mini35.z.object({
|
|
7633
8061
|
// @example "path/to/subproject"
|
|
7634
|
-
subprojectPath:
|
|
8062
|
+
subprojectPath: import_mini35.z.optional(import_mini35.z.string())
|
|
7635
8063
|
})
|
|
7636
8064
|
),
|
|
7637
|
-
claudecode:
|
|
7638
|
-
|
|
8065
|
+
claudecode: import_mini35.z.optional(
|
|
8066
|
+
import_mini35.z.object({
|
|
7639
8067
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
7640
8068
|
// @example "src/**/*.ts, tests/**/*.test.ts"
|
|
7641
|
-
paths:
|
|
8069
|
+
paths: import_mini35.z.optional(import_mini35.z.string())
|
|
7642
8070
|
})
|
|
7643
8071
|
),
|
|
7644
|
-
cursor:
|
|
7645
|
-
|
|
7646
|
-
alwaysApply:
|
|
7647
|
-
description:
|
|
7648
|
-
globs:
|
|
8072
|
+
cursor: import_mini35.z.optional(
|
|
8073
|
+
import_mini35.z.object({
|
|
8074
|
+
alwaysApply: import_mini35.z.optional(import_mini35.z.boolean()),
|
|
8075
|
+
description: import_mini35.z.optional(import_mini35.z.string()),
|
|
8076
|
+
globs: import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string()))
|
|
7649
8077
|
})
|
|
7650
8078
|
),
|
|
7651
|
-
copilot:
|
|
7652
|
-
|
|
7653
|
-
excludeAgent:
|
|
8079
|
+
copilot: import_mini35.z.optional(
|
|
8080
|
+
import_mini35.z.object({
|
|
8081
|
+
excludeAgent: import_mini35.z.optional(import_mini35.z.union([import_mini35.z.literal("code-review"), import_mini35.z.literal("coding-agent")]))
|
|
7654
8082
|
})
|
|
7655
8083
|
),
|
|
7656
|
-
antigravity:
|
|
7657
|
-
|
|
7658
|
-
trigger:
|
|
7659
|
-
globs:
|
|
8084
|
+
antigravity: import_mini35.z.optional(
|
|
8085
|
+
import_mini35.z.looseObject({
|
|
8086
|
+
trigger: import_mini35.z.optional(import_mini35.z.string()),
|
|
8087
|
+
globs: import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string()))
|
|
7660
8088
|
})
|
|
7661
8089
|
)
|
|
7662
8090
|
});
|
|
@@ -7668,7 +8096,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7668
8096
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
7669
8097
|
if (!result.success) {
|
|
7670
8098
|
throw new Error(
|
|
7671
|
-
`Invalid frontmatter in ${(0,
|
|
8099
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7672
8100
|
);
|
|
7673
8101
|
}
|
|
7674
8102
|
}
|
|
@@ -7703,7 +8131,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7703
8131
|
return {
|
|
7704
8132
|
success: false,
|
|
7705
8133
|
error: new Error(
|
|
7706
|
-
`Invalid frontmatter in ${(0,
|
|
8134
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7707
8135
|
)
|
|
7708
8136
|
};
|
|
7709
8137
|
}
|
|
@@ -7712,12 +8140,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7712
8140
|
relativeFilePath,
|
|
7713
8141
|
validate = true
|
|
7714
8142
|
}) {
|
|
7715
|
-
const legacyPath = (0,
|
|
8143
|
+
const legacyPath = (0, import_node_path69.join)(
|
|
7716
8144
|
process.cwd(),
|
|
7717
8145
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
7718
8146
|
relativeFilePath
|
|
7719
8147
|
);
|
|
7720
|
-
const recommendedPath = (0,
|
|
8148
|
+
const recommendedPath = (0, import_node_path69.join)(
|
|
7721
8149
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
7722
8150
|
relativeFilePath
|
|
7723
8151
|
);
|
|
@@ -7736,7 +8164,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7736
8164
|
agentsmd: result.data.agentsmd,
|
|
7737
8165
|
cursor: result.data.cursor
|
|
7738
8166
|
};
|
|
7739
|
-
const filename = (0,
|
|
8167
|
+
const filename = (0, import_node_path69.basename)(legacyPath);
|
|
7740
8168
|
return new _RulesyncRule({
|
|
7741
8169
|
baseDir: process.cwd(),
|
|
7742
8170
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -7750,7 +8178,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7750
8178
|
relativeFilePath,
|
|
7751
8179
|
validate = true
|
|
7752
8180
|
}) {
|
|
7753
|
-
const filePath = (0,
|
|
8181
|
+
const filePath = (0, import_node_path69.join)(
|
|
7754
8182
|
process.cwd(),
|
|
7755
8183
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
7756
8184
|
relativeFilePath
|
|
@@ -7769,7 +8197,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
7769
8197
|
agentsmd: result.data.agentsmd,
|
|
7770
8198
|
cursor: result.data.cursor
|
|
7771
8199
|
};
|
|
7772
|
-
const filename = (0,
|
|
8200
|
+
const filename = (0, import_node_path69.basename)(filePath);
|
|
7773
8201
|
return new _RulesyncRule({
|
|
7774
8202
|
baseDir: process.cwd(),
|
|
7775
8203
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -7852,7 +8280,7 @@ var ToolRule = class extends ToolFile {
|
|
|
7852
8280
|
rulesyncRule,
|
|
7853
8281
|
validate = true,
|
|
7854
8282
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
7855
|
-
nonRootPath = { relativeDirPath: (0,
|
|
8283
|
+
nonRootPath = { relativeDirPath: (0, import_node_path70.join)(".agents", "memories") }
|
|
7856
8284
|
}) {
|
|
7857
8285
|
const params = this.buildToolRuleParamsDefault({
|
|
7858
8286
|
baseDir,
|
|
@@ -7863,7 +8291,7 @@ var ToolRule = class extends ToolFile {
|
|
|
7863
8291
|
});
|
|
7864
8292
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
7865
8293
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
7866
|
-
params.relativeDirPath = (0,
|
|
8294
|
+
params.relativeDirPath = (0, import_node_path70.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
7867
8295
|
params.relativeFilePath = "AGENTS.md";
|
|
7868
8296
|
}
|
|
7869
8297
|
return params;
|
|
@@ -7928,7 +8356,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
7928
8356
|
relativeFilePath: "AGENTS.md"
|
|
7929
8357
|
},
|
|
7930
8358
|
nonRoot: {
|
|
7931
|
-
relativeDirPath: (0,
|
|
8359
|
+
relativeDirPath: (0, import_node_path71.join)(".agents", "memories")
|
|
7932
8360
|
}
|
|
7933
8361
|
};
|
|
7934
8362
|
}
|
|
@@ -7938,8 +8366,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
7938
8366
|
validate = true
|
|
7939
8367
|
}) {
|
|
7940
8368
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
7941
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
7942
|
-
const fileContent = await readFileContent((0,
|
|
8369
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path71.join)(".agents", "memories", relativeFilePath);
|
|
8370
|
+
const fileContent = await readFileContent((0, import_node_path71.join)(baseDir, relativePath));
|
|
7943
8371
|
return new _AgentsMdRule({
|
|
7944
8372
|
baseDir,
|
|
7945
8373
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7994,21 +8422,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
7994
8422
|
};
|
|
7995
8423
|
|
|
7996
8424
|
// src/features/rules/antigravity-rule.ts
|
|
7997
|
-
var
|
|
7998
|
-
var
|
|
7999
|
-
var AntigravityRuleFrontmatterSchema =
|
|
8000
|
-
trigger:
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8425
|
+
var import_node_path72 = require("path");
|
|
8426
|
+
var import_mini36 = require("zod/mini");
|
|
8427
|
+
var AntigravityRuleFrontmatterSchema = import_mini36.z.looseObject({
|
|
8428
|
+
trigger: import_mini36.z.optional(
|
|
8429
|
+
import_mini36.z.union([
|
|
8430
|
+
import_mini36.z.literal("always_on"),
|
|
8431
|
+
import_mini36.z.literal("glob"),
|
|
8432
|
+
import_mini36.z.literal("manual"),
|
|
8433
|
+
import_mini36.z.literal("model_decision"),
|
|
8434
|
+
import_mini36.z.string()
|
|
8007
8435
|
// accepts any string for forward compatibility
|
|
8008
8436
|
])
|
|
8009
8437
|
),
|
|
8010
|
-
globs:
|
|
8011
|
-
description:
|
|
8438
|
+
globs: import_mini36.z.optional(import_mini36.z.string()),
|
|
8439
|
+
description: import_mini36.z.optional(import_mini36.z.string())
|
|
8012
8440
|
});
|
|
8013
8441
|
function parseGlobsString(globs) {
|
|
8014
8442
|
if (!globs) {
|
|
@@ -8153,7 +8581,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8153
8581
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8154
8582
|
if (!result.success) {
|
|
8155
8583
|
throw new Error(
|
|
8156
|
-
`Invalid frontmatter in ${(0,
|
|
8584
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8157
8585
|
);
|
|
8158
8586
|
}
|
|
8159
8587
|
}
|
|
@@ -8168,7 +8596,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8168
8596
|
static getSettablePaths() {
|
|
8169
8597
|
return {
|
|
8170
8598
|
nonRoot: {
|
|
8171
|
-
relativeDirPath: (0,
|
|
8599
|
+
relativeDirPath: (0, import_node_path72.join)(".agent", "rules")
|
|
8172
8600
|
}
|
|
8173
8601
|
};
|
|
8174
8602
|
}
|
|
@@ -8177,7 +8605,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8177
8605
|
relativeFilePath,
|
|
8178
8606
|
validate = true
|
|
8179
8607
|
}) {
|
|
8180
|
-
const filePath = (0,
|
|
8608
|
+
const filePath = (0, import_node_path72.join)(
|
|
8181
8609
|
baseDir,
|
|
8182
8610
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
8183
8611
|
relativeFilePath
|
|
@@ -8318,7 +8746,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8318
8746
|
};
|
|
8319
8747
|
|
|
8320
8748
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
8321
|
-
var
|
|
8749
|
+
var import_node_path73 = require("path");
|
|
8322
8750
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
8323
8751
|
toRulesyncRule() {
|
|
8324
8752
|
const rulesyncFrontmatter = {
|
|
@@ -8344,7 +8772,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
8344
8772
|
relativeFilePath: ".augment-guidelines"
|
|
8345
8773
|
},
|
|
8346
8774
|
nonRoot: {
|
|
8347
|
-
relativeDirPath: (0,
|
|
8775
|
+
relativeDirPath: (0, import_node_path73.join)(".augment", "rules")
|
|
8348
8776
|
}
|
|
8349
8777
|
};
|
|
8350
8778
|
}
|
|
@@ -8379,8 +8807,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
8379
8807
|
}) {
|
|
8380
8808
|
const settablePaths = this.getSettablePaths();
|
|
8381
8809
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
8382
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
8383
|
-
const fileContent = await readFileContent((0,
|
|
8810
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path73.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
8811
|
+
const fileContent = await readFileContent((0, import_node_path73.join)(baseDir, relativePath));
|
|
8384
8812
|
return new _AugmentcodeLegacyRule({
|
|
8385
8813
|
baseDir,
|
|
8386
8814
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -8409,7 +8837,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
8409
8837
|
};
|
|
8410
8838
|
|
|
8411
8839
|
// src/features/rules/augmentcode-rule.ts
|
|
8412
|
-
var
|
|
8840
|
+
var import_node_path74 = require("path");
|
|
8413
8841
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
8414
8842
|
toRulesyncRule() {
|
|
8415
8843
|
return this.toRulesyncRuleDefault();
|
|
@@ -8417,7 +8845,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
8417
8845
|
static getSettablePaths() {
|
|
8418
8846
|
return {
|
|
8419
8847
|
nonRoot: {
|
|
8420
|
-
relativeDirPath: (0,
|
|
8848
|
+
relativeDirPath: (0, import_node_path74.join)(".augment", "rules")
|
|
8421
8849
|
}
|
|
8422
8850
|
};
|
|
8423
8851
|
}
|
|
@@ -8441,7 +8869,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
8441
8869
|
validate = true
|
|
8442
8870
|
}) {
|
|
8443
8871
|
const fileContent = await readFileContent(
|
|
8444
|
-
(0,
|
|
8872
|
+
(0, import_node_path74.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
8445
8873
|
);
|
|
8446
8874
|
const { body: content } = parseFrontmatter(fileContent);
|
|
8447
8875
|
return new _AugmentcodeRule({
|
|
@@ -8477,7 +8905,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
8477
8905
|
};
|
|
8478
8906
|
|
|
8479
8907
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
8480
|
-
var
|
|
8908
|
+
var import_node_path75 = require("path");
|
|
8481
8909
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
8482
8910
|
static getSettablePaths({
|
|
8483
8911
|
global
|
|
@@ -8496,7 +8924,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
8496
8924
|
relativeFilePath: "CLAUDE.md"
|
|
8497
8925
|
},
|
|
8498
8926
|
nonRoot: {
|
|
8499
|
-
relativeDirPath: (0,
|
|
8927
|
+
relativeDirPath: (0, import_node_path75.join)(".claude", "memories")
|
|
8500
8928
|
}
|
|
8501
8929
|
};
|
|
8502
8930
|
}
|
|
@@ -8511,7 +8939,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
8511
8939
|
if (isRoot) {
|
|
8512
8940
|
const relativePath2 = paths.root.relativeFilePath;
|
|
8513
8941
|
const fileContent2 = await readFileContent(
|
|
8514
|
-
(0,
|
|
8942
|
+
(0, import_node_path75.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
8515
8943
|
);
|
|
8516
8944
|
return new _ClaudecodeLegacyRule({
|
|
8517
8945
|
baseDir,
|
|
@@ -8525,8 +8953,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
8525
8953
|
if (!paths.nonRoot) {
|
|
8526
8954
|
throw new Error("nonRoot path is not set");
|
|
8527
8955
|
}
|
|
8528
|
-
const relativePath = (0,
|
|
8529
|
-
const fileContent = await readFileContent((0,
|
|
8956
|
+
const relativePath = (0, import_node_path75.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
8957
|
+
const fileContent = await readFileContent((0, import_node_path75.join)(baseDir, relativePath));
|
|
8530
8958
|
return new _ClaudecodeLegacyRule({
|
|
8531
8959
|
baseDir,
|
|
8532
8960
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -8585,10 +9013,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
8585
9013
|
};
|
|
8586
9014
|
|
|
8587
9015
|
// src/features/rules/claudecode-rule.ts
|
|
8588
|
-
var
|
|
8589
|
-
var
|
|
8590
|
-
var ClaudecodeRuleFrontmatterSchema =
|
|
8591
|
-
paths:
|
|
9016
|
+
var import_node_path76 = require("path");
|
|
9017
|
+
var import_mini37 = require("zod/mini");
|
|
9018
|
+
var ClaudecodeRuleFrontmatterSchema = import_mini37.z.object({
|
|
9019
|
+
paths: import_mini37.z.optional(import_mini37.z.string())
|
|
8592
9020
|
});
|
|
8593
9021
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
8594
9022
|
frontmatter;
|
|
@@ -8610,7 +9038,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8610
9038
|
relativeFilePath: "CLAUDE.md"
|
|
8611
9039
|
},
|
|
8612
9040
|
nonRoot: {
|
|
8613
|
-
relativeDirPath: (0,
|
|
9041
|
+
relativeDirPath: (0, import_node_path76.join)(".claude", "rules")
|
|
8614
9042
|
}
|
|
8615
9043
|
};
|
|
8616
9044
|
}
|
|
@@ -8619,7 +9047,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8619
9047
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8620
9048
|
if (!result.success) {
|
|
8621
9049
|
throw new Error(
|
|
8622
|
-
`Invalid frontmatter in ${(0,
|
|
9050
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8623
9051
|
);
|
|
8624
9052
|
}
|
|
8625
9053
|
}
|
|
@@ -8647,7 +9075,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8647
9075
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
8648
9076
|
if (isRoot) {
|
|
8649
9077
|
const fileContent2 = await readFileContent(
|
|
8650
|
-
(0,
|
|
9078
|
+
(0, import_node_path76.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
8651
9079
|
);
|
|
8652
9080
|
return new _ClaudecodeRule({
|
|
8653
9081
|
baseDir,
|
|
@@ -8662,13 +9090,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8662
9090
|
if (!paths.nonRoot) {
|
|
8663
9091
|
throw new Error("nonRoot path is not set");
|
|
8664
9092
|
}
|
|
8665
|
-
const relativePath = (0,
|
|
8666
|
-
const fileContent = await readFileContent((0,
|
|
9093
|
+
const relativePath = (0, import_node_path76.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9094
|
+
const fileContent = await readFileContent((0, import_node_path76.join)(baseDir, relativePath));
|
|
8667
9095
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8668
9096
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8669
9097
|
if (!result.success) {
|
|
8670
9098
|
throw new Error(
|
|
8671
|
-
`Invalid frontmatter in ${(0,
|
|
9099
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
8672
9100
|
);
|
|
8673
9101
|
}
|
|
8674
9102
|
return new _ClaudecodeRule({
|
|
@@ -8775,7 +9203,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8775
9203
|
return {
|
|
8776
9204
|
success: false,
|
|
8777
9205
|
error: new Error(
|
|
8778
|
-
`Invalid frontmatter in ${(0,
|
|
9206
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8779
9207
|
)
|
|
8780
9208
|
};
|
|
8781
9209
|
}
|
|
@@ -8795,10 +9223,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
8795
9223
|
};
|
|
8796
9224
|
|
|
8797
9225
|
// src/features/rules/cline-rule.ts
|
|
8798
|
-
var
|
|
8799
|
-
var
|
|
8800
|
-
var ClineRuleFrontmatterSchema =
|
|
8801
|
-
description:
|
|
9226
|
+
var import_node_path77 = require("path");
|
|
9227
|
+
var import_mini38 = require("zod/mini");
|
|
9228
|
+
var ClineRuleFrontmatterSchema = import_mini38.z.object({
|
|
9229
|
+
description: import_mini38.z.string()
|
|
8802
9230
|
});
|
|
8803
9231
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
8804
9232
|
static getSettablePaths() {
|
|
@@ -8840,7 +9268,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
8840
9268
|
validate = true
|
|
8841
9269
|
}) {
|
|
8842
9270
|
const fileContent = await readFileContent(
|
|
8843
|
-
(0,
|
|
9271
|
+
(0, import_node_path77.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
8844
9272
|
);
|
|
8845
9273
|
return new _ClineRule({
|
|
8846
9274
|
baseDir,
|
|
@@ -8866,7 +9294,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
8866
9294
|
};
|
|
8867
9295
|
|
|
8868
9296
|
// src/features/rules/codexcli-rule.ts
|
|
8869
|
-
var
|
|
9297
|
+
var import_node_path78 = require("path");
|
|
8870
9298
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
8871
9299
|
static getSettablePaths({
|
|
8872
9300
|
global
|
|
@@ -8885,7 +9313,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
8885
9313
|
relativeFilePath: "AGENTS.md"
|
|
8886
9314
|
},
|
|
8887
9315
|
nonRoot: {
|
|
8888
|
-
relativeDirPath: (0,
|
|
9316
|
+
relativeDirPath: (0, import_node_path78.join)(".codex", "memories")
|
|
8889
9317
|
}
|
|
8890
9318
|
};
|
|
8891
9319
|
}
|
|
@@ -8900,7 +9328,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
8900
9328
|
if (isRoot) {
|
|
8901
9329
|
const relativePath2 = paths.root.relativeFilePath;
|
|
8902
9330
|
const fileContent2 = await readFileContent(
|
|
8903
|
-
(0,
|
|
9331
|
+
(0, import_node_path78.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
8904
9332
|
);
|
|
8905
9333
|
return new _CodexcliRule({
|
|
8906
9334
|
baseDir,
|
|
@@ -8914,8 +9342,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
8914
9342
|
if (!paths.nonRoot) {
|
|
8915
9343
|
throw new Error("nonRoot path is not set");
|
|
8916
9344
|
}
|
|
8917
|
-
const relativePath = (0,
|
|
8918
|
-
const fileContent = await readFileContent((0,
|
|
9345
|
+
const relativePath = (0, import_node_path78.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9346
|
+
const fileContent = await readFileContent((0, import_node_path78.join)(baseDir, relativePath));
|
|
8919
9347
|
return new _CodexcliRule({
|
|
8920
9348
|
baseDir,
|
|
8921
9349
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -8974,12 +9402,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
8974
9402
|
};
|
|
8975
9403
|
|
|
8976
9404
|
// src/features/rules/copilot-rule.ts
|
|
8977
|
-
var
|
|
8978
|
-
var
|
|
8979
|
-
var CopilotRuleFrontmatterSchema =
|
|
8980
|
-
description:
|
|
8981
|
-
applyTo:
|
|
8982
|
-
excludeAgent:
|
|
9405
|
+
var import_node_path79 = require("path");
|
|
9406
|
+
var import_mini39 = require("zod/mini");
|
|
9407
|
+
var CopilotRuleFrontmatterSchema = import_mini39.z.object({
|
|
9408
|
+
description: import_mini39.z.optional(import_mini39.z.string()),
|
|
9409
|
+
applyTo: import_mini39.z.optional(import_mini39.z.string()),
|
|
9410
|
+
excludeAgent: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.literal("code-review"), import_mini39.z.literal("coding-agent")]))
|
|
8983
9411
|
});
|
|
8984
9412
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
8985
9413
|
frontmatter;
|
|
@@ -8991,7 +9419,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
8991
9419
|
relativeFilePath: "copilot-instructions.md"
|
|
8992
9420
|
},
|
|
8993
9421
|
nonRoot: {
|
|
8994
|
-
relativeDirPath: (0,
|
|
9422
|
+
relativeDirPath: (0, import_node_path79.join)(".github", "instructions")
|
|
8995
9423
|
}
|
|
8996
9424
|
};
|
|
8997
9425
|
}
|
|
@@ -9000,7 +9428,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9000
9428
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9001
9429
|
if (!result.success) {
|
|
9002
9430
|
throw new Error(
|
|
9003
|
-
`Invalid frontmatter in ${(0,
|
|
9431
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9004
9432
|
);
|
|
9005
9433
|
}
|
|
9006
9434
|
}
|
|
@@ -9082,11 +9510,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9082
9510
|
validate = true
|
|
9083
9511
|
}) {
|
|
9084
9512
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
9085
|
-
const relativePath = isRoot ? (0,
|
|
9513
|
+
const relativePath = isRoot ? (0, import_node_path79.join)(
|
|
9086
9514
|
this.getSettablePaths().root.relativeDirPath,
|
|
9087
9515
|
this.getSettablePaths().root.relativeFilePath
|
|
9088
|
-
) : (0,
|
|
9089
|
-
const fileContent = await readFileContent((0,
|
|
9516
|
+
) : (0, import_node_path79.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
9517
|
+
const fileContent = await readFileContent((0, import_node_path79.join)(baseDir, relativePath));
|
|
9090
9518
|
if (isRoot) {
|
|
9091
9519
|
return new _CopilotRule({
|
|
9092
9520
|
baseDir,
|
|
@@ -9102,7 +9530,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9102
9530
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9103
9531
|
if (!result.success) {
|
|
9104
9532
|
throw new Error(
|
|
9105
|
-
`Invalid frontmatter in ${(0,
|
|
9533
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
9106
9534
|
);
|
|
9107
9535
|
}
|
|
9108
9536
|
return new _CopilotRule({
|
|
@@ -9142,7 +9570,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9142
9570
|
return {
|
|
9143
9571
|
success: false,
|
|
9144
9572
|
error: new Error(
|
|
9145
|
-
`Invalid frontmatter in ${(0,
|
|
9573
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9146
9574
|
)
|
|
9147
9575
|
};
|
|
9148
9576
|
}
|
|
@@ -9162,12 +9590,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9162
9590
|
};
|
|
9163
9591
|
|
|
9164
9592
|
// src/features/rules/cursor-rule.ts
|
|
9165
|
-
var
|
|
9166
|
-
var
|
|
9167
|
-
var CursorRuleFrontmatterSchema =
|
|
9168
|
-
description:
|
|
9169
|
-
globs:
|
|
9170
|
-
alwaysApply:
|
|
9593
|
+
var import_node_path80 = require("path");
|
|
9594
|
+
var import_mini40 = require("zod/mini");
|
|
9595
|
+
var CursorRuleFrontmatterSchema = import_mini40.z.object({
|
|
9596
|
+
description: import_mini40.z.optional(import_mini40.z.string()),
|
|
9597
|
+
globs: import_mini40.z.optional(import_mini40.z.string()),
|
|
9598
|
+
alwaysApply: import_mini40.z.optional(import_mini40.z.boolean())
|
|
9171
9599
|
});
|
|
9172
9600
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
9173
9601
|
frontmatter;
|
|
@@ -9175,7 +9603,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9175
9603
|
static getSettablePaths() {
|
|
9176
9604
|
return {
|
|
9177
9605
|
nonRoot: {
|
|
9178
|
-
relativeDirPath: (0,
|
|
9606
|
+
relativeDirPath: (0, import_node_path80.join)(".cursor", "rules")
|
|
9179
9607
|
}
|
|
9180
9608
|
};
|
|
9181
9609
|
}
|
|
@@ -9184,7 +9612,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9184
9612
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9185
9613
|
if (!result.success) {
|
|
9186
9614
|
throw new Error(
|
|
9187
|
-
`Invalid frontmatter in ${(0,
|
|
9615
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9188
9616
|
);
|
|
9189
9617
|
}
|
|
9190
9618
|
}
|
|
@@ -9301,19 +9729,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9301
9729
|
validate = true
|
|
9302
9730
|
}) {
|
|
9303
9731
|
const fileContent = await readFileContent(
|
|
9304
|
-
(0,
|
|
9732
|
+
(0, import_node_path80.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9305
9733
|
);
|
|
9306
9734
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
9307
9735
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9308
9736
|
if (!result.success) {
|
|
9309
9737
|
throw new Error(
|
|
9310
|
-
`Invalid frontmatter in ${(0,
|
|
9738
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
9311
9739
|
);
|
|
9312
9740
|
}
|
|
9313
9741
|
return new _CursorRule({
|
|
9314
9742
|
baseDir,
|
|
9315
9743
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
9316
|
-
relativeFilePath: (0,
|
|
9744
|
+
relativeFilePath: (0, import_node_path80.basename)(relativeFilePath),
|
|
9317
9745
|
frontmatter: result.data,
|
|
9318
9746
|
body: content.trim(),
|
|
9319
9747
|
validate
|
|
@@ -9344,7 +9772,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9344
9772
|
return {
|
|
9345
9773
|
success: false,
|
|
9346
9774
|
error: new Error(
|
|
9347
|
-
`Invalid frontmatter in ${(0,
|
|
9775
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9348
9776
|
)
|
|
9349
9777
|
};
|
|
9350
9778
|
}
|
|
@@ -9364,7 +9792,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9364
9792
|
};
|
|
9365
9793
|
|
|
9366
9794
|
// src/features/rules/geminicli-rule.ts
|
|
9367
|
-
var
|
|
9795
|
+
var import_node_path81 = require("path");
|
|
9368
9796
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
9369
9797
|
static getSettablePaths({
|
|
9370
9798
|
global
|
|
@@ -9383,7 +9811,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
9383
9811
|
relativeFilePath: "GEMINI.md"
|
|
9384
9812
|
},
|
|
9385
9813
|
nonRoot: {
|
|
9386
|
-
relativeDirPath: (0,
|
|
9814
|
+
relativeDirPath: (0, import_node_path81.join)(".gemini", "memories")
|
|
9387
9815
|
}
|
|
9388
9816
|
};
|
|
9389
9817
|
}
|
|
@@ -9398,7 +9826,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
9398
9826
|
if (isRoot) {
|
|
9399
9827
|
const relativePath2 = paths.root.relativeFilePath;
|
|
9400
9828
|
const fileContent2 = await readFileContent(
|
|
9401
|
-
(0,
|
|
9829
|
+
(0, import_node_path81.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
9402
9830
|
);
|
|
9403
9831
|
return new _GeminiCliRule({
|
|
9404
9832
|
baseDir,
|
|
@@ -9412,8 +9840,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
9412
9840
|
if (!paths.nonRoot) {
|
|
9413
9841
|
throw new Error("nonRoot path is not set");
|
|
9414
9842
|
}
|
|
9415
|
-
const relativePath = (0,
|
|
9416
|
-
const fileContent = await readFileContent((0,
|
|
9843
|
+
const relativePath = (0, import_node_path81.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9844
|
+
const fileContent = await readFileContent((0, import_node_path81.join)(baseDir, relativePath));
|
|
9417
9845
|
return new _GeminiCliRule({
|
|
9418
9846
|
baseDir,
|
|
9419
9847
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -9472,7 +9900,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
9472
9900
|
};
|
|
9473
9901
|
|
|
9474
9902
|
// src/features/rules/junie-rule.ts
|
|
9475
|
-
var
|
|
9903
|
+
var import_node_path82 = require("path");
|
|
9476
9904
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
9477
9905
|
static getSettablePaths() {
|
|
9478
9906
|
return {
|
|
@@ -9481,7 +9909,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
9481
9909
|
relativeFilePath: "guidelines.md"
|
|
9482
9910
|
},
|
|
9483
9911
|
nonRoot: {
|
|
9484
|
-
relativeDirPath: (0,
|
|
9912
|
+
relativeDirPath: (0, import_node_path82.join)(".junie", "memories")
|
|
9485
9913
|
}
|
|
9486
9914
|
};
|
|
9487
9915
|
}
|
|
@@ -9491,8 +9919,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
9491
9919
|
validate = true
|
|
9492
9920
|
}) {
|
|
9493
9921
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
9494
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
9495
|
-
const fileContent = await readFileContent((0,
|
|
9922
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path82.join)(".junie", "memories", relativeFilePath);
|
|
9923
|
+
const fileContent = await readFileContent((0, import_node_path82.join)(baseDir, relativePath));
|
|
9496
9924
|
return new _JunieRule({
|
|
9497
9925
|
baseDir,
|
|
9498
9926
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -9546,13 +9974,80 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
9546
9974
|
}
|
|
9547
9975
|
};
|
|
9548
9976
|
|
|
9977
|
+
// src/features/rules/kilo-rule.ts
|
|
9978
|
+
var import_node_path83 = require("path");
|
|
9979
|
+
var KiloRule = class _KiloRule extends ToolRule {
|
|
9980
|
+
static getSettablePaths(_options = {}) {
|
|
9981
|
+
return {
|
|
9982
|
+
nonRoot: {
|
|
9983
|
+
relativeDirPath: (0, import_node_path83.join)(".kilocode", "rules")
|
|
9984
|
+
}
|
|
9985
|
+
};
|
|
9986
|
+
}
|
|
9987
|
+
static async fromFile({
|
|
9988
|
+
baseDir = process.cwd(),
|
|
9989
|
+
relativeFilePath,
|
|
9990
|
+
validate = true
|
|
9991
|
+
}) {
|
|
9992
|
+
const fileContent = await readFileContent(
|
|
9993
|
+
(0, import_node_path83.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9994
|
+
);
|
|
9995
|
+
return new _KiloRule({
|
|
9996
|
+
baseDir,
|
|
9997
|
+
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
9998
|
+
relativeFilePath,
|
|
9999
|
+
fileContent,
|
|
10000
|
+
validate
|
|
10001
|
+
});
|
|
10002
|
+
}
|
|
10003
|
+
static fromRulesyncRule({
|
|
10004
|
+
baseDir = process.cwd(),
|
|
10005
|
+
rulesyncRule,
|
|
10006
|
+
validate = true
|
|
10007
|
+
}) {
|
|
10008
|
+
return new _KiloRule(
|
|
10009
|
+
this.buildToolRuleParamsDefault({
|
|
10010
|
+
baseDir,
|
|
10011
|
+
rulesyncRule,
|
|
10012
|
+
validate,
|
|
10013
|
+
nonRootPath: this.getSettablePaths().nonRoot
|
|
10014
|
+
})
|
|
10015
|
+
);
|
|
10016
|
+
}
|
|
10017
|
+
toRulesyncRule() {
|
|
10018
|
+
return this.toRulesyncRuleDefault();
|
|
10019
|
+
}
|
|
10020
|
+
validate() {
|
|
10021
|
+
return { success: true, error: null };
|
|
10022
|
+
}
|
|
10023
|
+
static forDeletion({
|
|
10024
|
+
baseDir = process.cwd(),
|
|
10025
|
+
relativeDirPath,
|
|
10026
|
+
relativeFilePath
|
|
10027
|
+
}) {
|
|
10028
|
+
return new _KiloRule({
|
|
10029
|
+
baseDir,
|
|
10030
|
+
relativeDirPath,
|
|
10031
|
+
relativeFilePath,
|
|
10032
|
+
fileContent: "",
|
|
10033
|
+
validate: false
|
|
10034
|
+
});
|
|
10035
|
+
}
|
|
10036
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
10037
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
10038
|
+
rulesyncRule,
|
|
10039
|
+
toolTarget: "kilo"
|
|
10040
|
+
});
|
|
10041
|
+
}
|
|
10042
|
+
};
|
|
10043
|
+
|
|
9549
10044
|
// src/features/rules/kiro-rule.ts
|
|
9550
|
-
var
|
|
10045
|
+
var import_node_path84 = require("path");
|
|
9551
10046
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
9552
10047
|
static getSettablePaths() {
|
|
9553
10048
|
return {
|
|
9554
10049
|
nonRoot: {
|
|
9555
|
-
relativeDirPath: (0,
|
|
10050
|
+
relativeDirPath: (0, import_node_path84.join)(".kiro", "steering")
|
|
9556
10051
|
}
|
|
9557
10052
|
};
|
|
9558
10053
|
}
|
|
@@ -9562,7 +10057,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
9562
10057
|
validate = true
|
|
9563
10058
|
}) {
|
|
9564
10059
|
const fileContent = await readFileContent(
|
|
9565
|
-
(0,
|
|
10060
|
+
(0, import_node_path84.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9566
10061
|
);
|
|
9567
10062
|
return new _KiroRule({
|
|
9568
10063
|
baseDir,
|
|
@@ -9616,7 +10111,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
9616
10111
|
};
|
|
9617
10112
|
|
|
9618
10113
|
// src/features/rules/opencode-rule.ts
|
|
9619
|
-
var
|
|
10114
|
+
var import_node_path85 = require("path");
|
|
9620
10115
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
9621
10116
|
static getSettablePaths() {
|
|
9622
10117
|
return {
|
|
@@ -9625,7 +10120,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
9625
10120
|
relativeFilePath: "AGENTS.md"
|
|
9626
10121
|
},
|
|
9627
10122
|
nonRoot: {
|
|
9628
|
-
relativeDirPath: (0,
|
|
10123
|
+
relativeDirPath: (0, import_node_path85.join)(".opencode", "memories")
|
|
9629
10124
|
}
|
|
9630
10125
|
};
|
|
9631
10126
|
}
|
|
@@ -9635,8 +10130,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
9635
10130
|
validate = true
|
|
9636
10131
|
}) {
|
|
9637
10132
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
9638
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
9639
|
-
const fileContent = await readFileContent((0,
|
|
10133
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path85.join)(".opencode", "memories", relativeFilePath);
|
|
10134
|
+
const fileContent = await readFileContent((0, import_node_path85.join)(baseDir, relativePath));
|
|
9640
10135
|
return new _OpenCodeRule({
|
|
9641
10136
|
baseDir,
|
|
9642
10137
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -9691,7 +10186,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
9691
10186
|
};
|
|
9692
10187
|
|
|
9693
10188
|
// src/features/rules/qwencode-rule.ts
|
|
9694
|
-
var
|
|
10189
|
+
var import_node_path86 = require("path");
|
|
9695
10190
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
9696
10191
|
static getSettablePaths() {
|
|
9697
10192
|
return {
|
|
@@ -9700,7 +10195,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
9700
10195
|
relativeFilePath: "QWEN.md"
|
|
9701
10196
|
},
|
|
9702
10197
|
nonRoot: {
|
|
9703
|
-
relativeDirPath: (0,
|
|
10198
|
+
relativeDirPath: (0, import_node_path86.join)(".qwen", "memories")
|
|
9704
10199
|
}
|
|
9705
10200
|
};
|
|
9706
10201
|
}
|
|
@@ -9710,8 +10205,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
9710
10205
|
validate = true
|
|
9711
10206
|
}) {
|
|
9712
10207
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
9713
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
9714
|
-
const fileContent = await readFileContent((0,
|
|
10208
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path86.join)(".qwen", "memories", relativeFilePath);
|
|
10209
|
+
const fileContent = await readFileContent((0, import_node_path86.join)(baseDir, relativePath));
|
|
9715
10210
|
return new _QwencodeRule({
|
|
9716
10211
|
baseDir,
|
|
9717
10212
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -9763,12 +10258,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
9763
10258
|
};
|
|
9764
10259
|
|
|
9765
10260
|
// src/features/rules/roo-rule.ts
|
|
9766
|
-
var
|
|
10261
|
+
var import_node_path87 = require("path");
|
|
9767
10262
|
var RooRule = class _RooRule extends ToolRule {
|
|
9768
10263
|
static getSettablePaths() {
|
|
9769
10264
|
return {
|
|
9770
10265
|
nonRoot: {
|
|
9771
|
-
relativeDirPath: (0,
|
|
10266
|
+
relativeDirPath: (0, import_node_path87.join)(".roo", "rules")
|
|
9772
10267
|
}
|
|
9773
10268
|
};
|
|
9774
10269
|
}
|
|
@@ -9778,7 +10273,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
9778
10273
|
validate = true
|
|
9779
10274
|
}) {
|
|
9780
10275
|
const fileContent = await readFileContent(
|
|
9781
|
-
(0,
|
|
10276
|
+
(0, import_node_path87.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9782
10277
|
);
|
|
9783
10278
|
return new _RooRule({
|
|
9784
10279
|
baseDir,
|
|
@@ -9847,7 +10342,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
9847
10342
|
};
|
|
9848
10343
|
|
|
9849
10344
|
// src/features/rules/warp-rule.ts
|
|
9850
|
-
var
|
|
10345
|
+
var import_node_path88 = require("path");
|
|
9851
10346
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
9852
10347
|
constructor({ fileContent, root, ...rest }) {
|
|
9853
10348
|
super({
|
|
@@ -9863,7 +10358,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
9863
10358
|
relativeFilePath: "WARP.md"
|
|
9864
10359
|
},
|
|
9865
10360
|
nonRoot: {
|
|
9866
|
-
relativeDirPath: (0,
|
|
10361
|
+
relativeDirPath: (0, import_node_path88.join)(".warp", "memories")
|
|
9867
10362
|
}
|
|
9868
10363
|
};
|
|
9869
10364
|
}
|
|
@@ -9873,8 +10368,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
9873
10368
|
validate = true
|
|
9874
10369
|
}) {
|
|
9875
10370
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
9876
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
9877
|
-
const fileContent = await readFileContent((0,
|
|
10371
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path88.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
10372
|
+
const fileContent = await readFileContent((0, import_node_path88.join)(baseDir, relativePath));
|
|
9878
10373
|
return new _WarpRule({
|
|
9879
10374
|
baseDir,
|
|
9880
10375
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -9929,12 +10424,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
9929
10424
|
};
|
|
9930
10425
|
|
|
9931
10426
|
// src/features/rules/windsurf-rule.ts
|
|
9932
|
-
var
|
|
10427
|
+
var import_node_path89 = require("path");
|
|
9933
10428
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
9934
10429
|
static getSettablePaths() {
|
|
9935
10430
|
return {
|
|
9936
10431
|
nonRoot: {
|
|
9937
|
-
relativeDirPath: (0,
|
|
10432
|
+
relativeDirPath: (0, import_node_path89.join)(".windsurf", "rules")
|
|
9938
10433
|
}
|
|
9939
10434
|
};
|
|
9940
10435
|
}
|
|
@@ -9944,7 +10439,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
9944
10439
|
validate = true
|
|
9945
10440
|
}) {
|
|
9946
10441
|
const fileContent = await readFileContent(
|
|
9947
|
-
(0,
|
|
10442
|
+
(0, import_node_path89.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9948
10443
|
);
|
|
9949
10444
|
return new _WindsurfRule({
|
|
9950
10445
|
baseDir,
|
|
@@ -10009,6 +10504,7 @@ var rulesProcessorToolTargets = [
|
|
|
10009
10504
|
"cursor",
|
|
10010
10505
|
"geminicli",
|
|
10011
10506
|
"junie",
|
|
10507
|
+
"kilo",
|
|
10012
10508
|
"kiro",
|
|
10013
10509
|
"opencode",
|
|
10014
10510
|
"qwencode",
|
|
@@ -10016,7 +10512,7 @@ var rulesProcessorToolTargets = [
|
|
|
10016
10512
|
"warp",
|
|
10017
10513
|
"windsurf"
|
|
10018
10514
|
];
|
|
10019
|
-
var RulesProcessorToolTargetSchema =
|
|
10515
|
+
var RulesProcessorToolTargetSchema = import_mini41.z.enum(rulesProcessorToolTargets);
|
|
10020
10516
|
var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
10021
10517
|
[
|
|
10022
10518
|
"agentsmd",
|
|
@@ -10138,6 +10634,13 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
10138
10634
|
meta: { extension: "md", supportsGlobal: false, ruleDiscoveryMode: "toon" }
|
|
10139
10635
|
}
|
|
10140
10636
|
],
|
|
10637
|
+
[
|
|
10638
|
+
"kilo",
|
|
10639
|
+
{
|
|
10640
|
+
class: KiloRule,
|
|
10641
|
+
meta: { extension: "md", supportsGlobal: true, ruleDiscoveryMode: "auto" }
|
|
10642
|
+
}
|
|
10643
|
+
],
|
|
10141
10644
|
[
|
|
10142
10645
|
"kiro",
|
|
10143
10646
|
{
|
|
@@ -10293,7 +10796,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10293
10796
|
}).relativeDirPath;
|
|
10294
10797
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
10295
10798
|
const frontmatter = skill.getFrontmatter();
|
|
10296
|
-
const relativePath = (0,
|
|
10799
|
+
const relativePath = (0, import_node_path90.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
10297
10800
|
return {
|
|
10298
10801
|
name: frontmatter.name,
|
|
10299
10802
|
description: frontmatter.description,
|
|
@@ -10360,10 +10863,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10360
10863
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
10361
10864
|
*/
|
|
10362
10865
|
async loadRulesyncFiles() {
|
|
10363
|
-
const files = await findFilesByGlobs((0,
|
|
10866
|
+
const files = await findFilesByGlobs((0, import_node_path90.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
10364
10867
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
10365
10868
|
const rulesyncRules = await Promise.all(
|
|
10366
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
10869
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path90.basename)(file) }))
|
|
10367
10870
|
);
|
|
10368
10871
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
10369
10872
|
if (rootRules.length > 1) {
|
|
@@ -10381,10 +10884,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10381
10884
|
return rulesyncRules;
|
|
10382
10885
|
}
|
|
10383
10886
|
async loadRulesyncFilesLegacy() {
|
|
10384
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
10887
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path90.join)(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
10385
10888
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
10386
10889
|
return Promise.all(
|
|
10387
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
10890
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path90.basename)(file) }))
|
|
10388
10891
|
);
|
|
10389
10892
|
}
|
|
10390
10893
|
/**
|
|
@@ -10402,7 +10905,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10402
10905
|
return [];
|
|
10403
10906
|
}
|
|
10404
10907
|
const rootFilePaths = await findFilesByGlobs(
|
|
10405
|
-
(0,
|
|
10908
|
+
(0, import_node_path90.join)(
|
|
10406
10909
|
this.baseDir,
|
|
10407
10910
|
settablePaths.root.relativeDirPath ?? ".",
|
|
10408
10911
|
settablePaths.root.relativeFilePath
|
|
@@ -10413,7 +10916,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10413
10916
|
(filePath) => factory.class.forDeletion({
|
|
10414
10917
|
baseDir: this.baseDir,
|
|
10415
10918
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
10416
|
-
relativeFilePath: (0,
|
|
10919
|
+
relativeFilePath: (0, import_node_path90.basename)(filePath),
|
|
10417
10920
|
global: this.global
|
|
10418
10921
|
})
|
|
10419
10922
|
).filter((rule) => rule.isDeletable());
|
|
@@ -10422,7 +10925,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10422
10925
|
rootFilePaths.map(
|
|
10423
10926
|
(filePath) => factory.class.fromFile({
|
|
10424
10927
|
baseDir: this.baseDir,
|
|
10425
|
-
relativeFilePath: (0,
|
|
10928
|
+
relativeFilePath: (0, import_node_path90.basename)(filePath),
|
|
10426
10929
|
global: this.global
|
|
10427
10930
|
})
|
|
10428
10931
|
)
|
|
@@ -10434,14 +10937,14 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10434
10937
|
return [];
|
|
10435
10938
|
}
|
|
10436
10939
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
10437
|
-
(0,
|
|
10940
|
+
(0, import_node_path90.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath, `*.${factory.meta.extension}`)
|
|
10438
10941
|
);
|
|
10439
10942
|
if (forDeletion) {
|
|
10440
10943
|
return nonRootFilePaths.map(
|
|
10441
10944
|
(filePath) => factory.class.forDeletion({
|
|
10442
10945
|
baseDir: this.baseDir,
|
|
10443
10946
|
relativeDirPath: settablePaths.nonRoot?.relativeDirPath ?? ".",
|
|
10444
|
-
relativeFilePath: (0,
|
|
10947
|
+
relativeFilePath: (0, import_node_path90.basename)(filePath),
|
|
10445
10948
|
global: this.global
|
|
10446
10949
|
})
|
|
10447
10950
|
).filter((rule) => rule.isDeletable());
|
|
@@ -10450,7 +10953,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
10450
10953
|
nonRootFilePaths.map(
|
|
10451
10954
|
(filePath) => factory.class.fromFile({
|
|
10452
10955
|
baseDir: this.baseDir,
|
|
10453
|
-
relativeFilePath: (0,
|
|
10956
|
+
relativeFilePath: (0, import_node_path90.basename)(filePath),
|
|
10454
10957
|
global: this.global
|
|
10455
10958
|
})
|
|
10456
10959
|
)
|
|
@@ -10543,14 +11046,14 @@ s/<command> [arguments]
|
|
|
10543
11046
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
10544
11047
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
10545
11048
|
|
|
10546
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
11049
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path90.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
10547
11050
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
10548
11051
|
|
|
10549
11052
|
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.
|
|
10550
11053
|
|
|
10551
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
11054
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path90.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
10552
11055
|
|
|
10553
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
11056
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path90.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
10554
11057
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
10555
11058
|
const result = [
|
|
10556
11059
|
overview,
|
|
@@ -10832,7 +11335,7 @@ async function generateSkills(config) {
|
|
|
10832
11335
|
}
|
|
10833
11336
|
|
|
10834
11337
|
// src/cli/commands/gitignore.ts
|
|
10835
|
-
var
|
|
11338
|
+
var import_node_path91 = require("path");
|
|
10836
11339
|
var RULESYNC_HEADER = "# Generated by Rulesync";
|
|
10837
11340
|
var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
|
|
10838
11341
|
var RULESYNC_IGNORE_ENTRIES = [
|
|
@@ -10882,6 +11385,12 @@ var RULESYNC_IGNORE_ENTRIES = [
|
|
|
10882
11385
|
// Junie
|
|
10883
11386
|
"**/.junie/guidelines.md",
|
|
10884
11387
|
"**/.junie/mcp.json",
|
|
11388
|
+
// Kilo Code
|
|
11389
|
+
"**/.kilocode/rules/",
|
|
11390
|
+
"**/.kilocode/skills/",
|
|
11391
|
+
"**/.kilocode/workflows/",
|
|
11392
|
+
"**/.kilocode/mcp.json",
|
|
11393
|
+
"**/.kilocodeignore",
|
|
10885
11394
|
// Kiro
|
|
10886
11395
|
"**/.kiro/steering/",
|
|
10887
11396
|
"**/.aiignore",
|
|
@@ -10957,7 +11466,7 @@ var removeExistingRulesyncEntries = (content) => {
|
|
|
10957
11466
|
return result;
|
|
10958
11467
|
};
|
|
10959
11468
|
var gitignoreCommand = async () => {
|
|
10960
|
-
const gitignorePath = (0,
|
|
11469
|
+
const gitignorePath = (0, import_node_path91.join)(process.cwd(), ".gitignore");
|
|
10961
11470
|
let gitignoreContent = "";
|
|
10962
11471
|
if (await fileExists(gitignorePath)) {
|
|
10963
11472
|
gitignoreContent = await readFileContent(gitignorePath);
|
|
@@ -11156,7 +11665,7 @@ async function importSkills(config, tool) {
|
|
|
11156
11665
|
}
|
|
11157
11666
|
|
|
11158
11667
|
// src/cli/commands/init.ts
|
|
11159
|
-
var
|
|
11668
|
+
var import_node_path92 = require("path");
|
|
11160
11669
|
async function initCommand() {
|
|
11161
11670
|
logger.info("Initializing rulesync...");
|
|
11162
11671
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -11319,14 +11828,14 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
11319
11828
|
await ensureDir(commandPaths.relativeDirPath);
|
|
11320
11829
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
11321
11830
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
11322
|
-
const ruleFilepath = (0,
|
|
11831
|
+
const ruleFilepath = (0, import_node_path92.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
11323
11832
|
if (!await fileExists(ruleFilepath)) {
|
|
11324
11833
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
11325
11834
|
logger.success(`Created ${ruleFilepath}`);
|
|
11326
11835
|
} else {
|
|
11327
11836
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
11328
11837
|
}
|
|
11329
|
-
const mcpFilepath = (0,
|
|
11838
|
+
const mcpFilepath = (0, import_node_path92.join)(
|
|
11330
11839
|
mcpPaths.recommended.relativeDirPath,
|
|
11331
11840
|
mcpPaths.recommended.relativeFilePath
|
|
11332
11841
|
);
|
|
@@ -11336,21 +11845,21 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
11336
11845
|
} else {
|
|
11337
11846
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
11338
11847
|
}
|
|
11339
|
-
const commandFilepath = (0,
|
|
11848
|
+
const commandFilepath = (0, import_node_path92.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
11340
11849
|
if (!await fileExists(commandFilepath)) {
|
|
11341
11850
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
11342
11851
|
logger.success(`Created ${commandFilepath}`);
|
|
11343
11852
|
} else {
|
|
11344
11853
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
11345
11854
|
}
|
|
11346
|
-
const subagentFilepath = (0,
|
|
11855
|
+
const subagentFilepath = (0, import_node_path92.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
11347
11856
|
if (!await fileExists(subagentFilepath)) {
|
|
11348
11857
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
11349
11858
|
logger.success(`Created ${subagentFilepath}`);
|
|
11350
11859
|
} else {
|
|
11351
11860
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
11352
11861
|
}
|
|
11353
|
-
const ignoreFilepath = (0,
|
|
11862
|
+
const ignoreFilepath = (0, import_node_path92.join)(
|
|
11354
11863
|
ignorePaths.recommended.relativeDirPath,
|
|
11355
11864
|
ignorePaths.recommended.relativeFilePath
|
|
11356
11865
|
);
|
|
@@ -11366,15 +11875,15 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
11366
11875
|
var import_fastmcp = require("fastmcp");
|
|
11367
11876
|
|
|
11368
11877
|
// src/mcp/tools.ts
|
|
11369
|
-
var
|
|
11878
|
+
var import_mini48 = require("zod/mini");
|
|
11370
11879
|
|
|
11371
11880
|
// src/mcp/commands.ts
|
|
11372
|
-
var
|
|
11373
|
-
var
|
|
11881
|
+
var import_node_path93 = require("path");
|
|
11882
|
+
var import_mini42 = require("zod/mini");
|
|
11374
11883
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
11375
11884
|
var maxCommandsCount = 1e3;
|
|
11376
11885
|
async function listCommands() {
|
|
11377
|
-
const commandsDir = (0,
|
|
11886
|
+
const commandsDir = (0, import_node_path93.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
11378
11887
|
try {
|
|
11379
11888
|
const files = await listDirectoryFiles(commandsDir);
|
|
11380
11889
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -11386,7 +11895,7 @@ async function listCommands() {
|
|
|
11386
11895
|
});
|
|
11387
11896
|
const frontmatter = command.getFrontmatter();
|
|
11388
11897
|
return {
|
|
11389
|
-
relativePathFromCwd: (0,
|
|
11898
|
+
relativePathFromCwd: (0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
11390
11899
|
frontmatter
|
|
11391
11900
|
};
|
|
11392
11901
|
} catch (error) {
|
|
@@ -11406,13 +11915,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
11406
11915
|
relativePath: relativePathFromCwd,
|
|
11407
11916
|
intendedRootDir: process.cwd()
|
|
11408
11917
|
});
|
|
11409
|
-
const filename = (0,
|
|
11918
|
+
const filename = (0, import_node_path93.basename)(relativePathFromCwd);
|
|
11410
11919
|
try {
|
|
11411
11920
|
const command = await RulesyncCommand.fromFile({
|
|
11412
11921
|
relativeFilePath: filename
|
|
11413
11922
|
});
|
|
11414
11923
|
return {
|
|
11415
|
-
relativePathFromCwd: (0,
|
|
11924
|
+
relativePathFromCwd: (0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
11416
11925
|
frontmatter: command.getFrontmatter(),
|
|
11417
11926
|
body: command.getBody()
|
|
11418
11927
|
};
|
|
@@ -11431,7 +11940,7 @@ async function putCommand({
|
|
|
11431
11940
|
relativePath: relativePathFromCwd,
|
|
11432
11941
|
intendedRootDir: process.cwd()
|
|
11433
11942
|
});
|
|
11434
|
-
const filename = (0,
|
|
11943
|
+
const filename = (0, import_node_path93.basename)(relativePathFromCwd);
|
|
11435
11944
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
11436
11945
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
11437
11946
|
throw new Error(
|
|
@@ -11441,7 +11950,7 @@ async function putCommand({
|
|
|
11441
11950
|
try {
|
|
11442
11951
|
const existingCommands = await listCommands();
|
|
11443
11952
|
const isUpdate = existingCommands.some(
|
|
11444
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
11953
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
11445
11954
|
);
|
|
11446
11955
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
11447
11956
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -11456,11 +11965,11 @@ async function putCommand({
|
|
|
11456
11965
|
fileContent,
|
|
11457
11966
|
validate: true
|
|
11458
11967
|
});
|
|
11459
|
-
const commandsDir = (0,
|
|
11968
|
+
const commandsDir = (0, import_node_path93.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
11460
11969
|
await ensureDir(commandsDir);
|
|
11461
11970
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
11462
11971
|
return {
|
|
11463
|
-
relativePathFromCwd: (0,
|
|
11972
|
+
relativePathFromCwd: (0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
11464
11973
|
frontmatter: command.getFrontmatter(),
|
|
11465
11974
|
body: command.getBody()
|
|
11466
11975
|
};
|
|
@@ -11475,12 +11984,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
11475
11984
|
relativePath: relativePathFromCwd,
|
|
11476
11985
|
intendedRootDir: process.cwd()
|
|
11477
11986
|
});
|
|
11478
|
-
const filename = (0,
|
|
11479
|
-
const fullPath = (0,
|
|
11987
|
+
const filename = (0, import_node_path93.basename)(relativePathFromCwd);
|
|
11988
|
+
const fullPath = (0, import_node_path93.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
11480
11989
|
try {
|
|
11481
11990
|
await removeFile(fullPath);
|
|
11482
11991
|
return {
|
|
11483
|
-
relativePathFromCwd: (0,
|
|
11992
|
+
relativePathFromCwd: (0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
11484
11993
|
};
|
|
11485
11994
|
} catch (error) {
|
|
11486
11995
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -11489,23 +11998,23 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
11489
11998
|
}
|
|
11490
11999
|
}
|
|
11491
12000
|
var commandToolSchemas = {
|
|
11492
|
-
listCommands:
|
|
11493
|
-
getCommand:
|
|
11494
|
-
relativePathFromCwd:
|
|
12001
|
+
listCommands: import_mini42.z.object({}),
|
|
12002
|
+
getCommand: import_mini42.z.object({
|
|
12003
|
+
relativePathFromCwd: import_mini42.z.string()
|
|
11495
12004
|
}),
|
|
11496
|
-
putCommand:
|
|
11497
|
-
relativePathFromCwd:
|
|
12005
|
+
putCommand: import_mini42.z.object({
|
|
12006
|
+
relativePathFromCwd: import_mini42.z.string(),
|
|
11498
12007
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
11499
|
-
body:
|
|
12008
|
+
body: import_mini42.z.string()
|
|
11500
12009
|
}),
|
|
11501
|
-
deleteCommand:
|
|
11502
|
-
relativePathFromCwd:
|
|
12010
|
+
deleteCommand: import_mini42.z.object({
|
|
12011
|
+
relativePathFromCwd: import_mini42.z.string()
|
|
11503
12012
|
})
|
|
11504
12013
|
};
|
|
11505
12014
|
var commandTools = {
|
|
11506
12015
|
listCommands: {
|
|
11507
12016
|
name: "listCommands",
|
|
11508
|
-
description: `List all commands from ${(0,
|
|
12017
|
+
description: `List all commands from ${(0, import_node_path93.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
11509
12018
|
parameters: commandToolSchemas.listCommands,
|
|
11510
12019
|
execute: async () => {
|
|
11511
12020
|
const commands = await listCommands();
|
|
@@ -11547,11 +12056,11 @@ var commandTools = {
|
|
|
11547
12056
|
};
|
|
11548
12057
|
|
|
11549
12058
|
// src/mcp/ignore.ts
|
|
11550
|
-
var
|
|
11551
|
-
var
|
|
12059
|
+
var import_node_path94 = require("path");
|
|
12060
|
+
var import_mini43 = require("zod/mini");
|
|
11552
12061
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
11553
12062
|
async function getIgnoreFile() {
|
|
11554
|
-
const ignoreFilePath = (0,
|
|
12063
|
+
const ignoreFilePath = (0, import_node_path94.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
11555
12064
|
try {
|
|
11556
12065
|
const content = await readFileContent(ignoreFilePath);
|
|
11557
12066
|
return {
|
|
@@ -11565,7 +12074,7 @@ async function getIgnoreFile() {
|
|
|
11565
12074
|
}
|
|
11566
12075
|
}
|
|
11567
12076
|
async function putIgnoreFile({ content }) {
|
|
11568
|
-
const ignoreFilePath = (0,
|
|
12077
|
+
const ignoreFilePath = (0, import_node_path94.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
11569
12078
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
11570
12079
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
11571
12080
|
throw new Error(
|
|
@@ -11586,8 +12095,8 @@ async function putIgnoreFile({ content }) {
|
|
|
11586
12095
|
}
|
|
11587
12096
|
}
|
|
11588
12097
|
async function deleteIgnoreFile() {
|
|
11589
|
-
const aiignorePath = (0,
|
|
11590
|
-
const legacyIgnorePath = (0,
|
|
12098
|
+
const aiignorePath = (0, import_node_path94.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12099
|
+
const legacyIgnorePath = (0, import_node_path94.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
11591
12100
|
try {
|
|
11592
12101
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
11593
12102
|
return {
|
|
@@ -11605,11 +12114,11 @@ async function deleteIgnoreFile() {
|
|
|
11605
12114
|
}
|
|
11606
12115
|
}
|
|
11607
12116
|
var ignoreToolSchemas = {
|
|
11608
|
-
getIgnoreFile:
|
|
11609
|
-
putIgnoreFile:
|
|
11610
|
-
content:
|
|
12117
|
+
getIgnoreFile: import_mini43.z.object({}),
|
|
12118
|
+
putIgnoreFile: import_mini43.z.object({
|
|
12119
|
+
content: import_mini43.z.string()
|
|
11611
12120
|
}),
|
|
11612
|
-
deleteIgnoreFile:
|
|
12121
|
+
deleteIgnoreFile: import_mini43.z.object({})
|
|
11613
12122
|
};
|
|
11614
12123
|
var ignoreTools = {
|
|
11615
12124
|
getIgnoreFile: {
|
|
@@ -11642,8 +12151,8 @@ var ignoreTools = {
|
|
|
11642
12151
|
};
|
|
11643
12152
|
|
|
11644
12153
|
// src/mcp/mcp.ts
|
|
11645
|
-
var
|
|
11646
|
-
var
|
|
12154
|
+
var import_node_path95 = require("path");
|
|
12155
|
+
var import_mini44 = require("zod/mini");
|
|
11647
12156
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
11648
12157
|
async function getMcpFile() {
|
|
11649
12158
|
const config = await ConfigResolver.resolve({});
|
|
@@ -11652,7 +12161,7 @@ async function getMcpFile() {
|
|
|
11652
12161
|
validate: true,
|
|
11653
12162
|
modularMcp: config.getModularMcp()
|
|
11654
12163
|
});
|
|
11655
|
-
const relativePathFromCwd = (0,
|
|
12164
|
+
const relativePathFromCwd = (0, import_node_path95.join)(
|
|
11656
12165
|
rulesyncMcp.getRelativeDirPath(),
|
|
11657
12166
|
rulesyncMcp.getRelativeFilePath()
|
|
11658
12167
|
);
|
|
@@ -11685,7 +12194,7 @@ async function putMcpFile({ content }) {
|
|
|
11685
12194
|
const paths = RulesyncMcp.getSettablePaths();
|
|
11686
12195
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
11687
12196
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
11688
|
-
const fullPath = (0,
|
|
12197
|
+
const fullPath = (0, import_node_path95.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
11689
12198
|
const rulesyncMcp = new RulesyncMcp({
|
|
11690
12199
|
baseDir,
|
|
11691
12200
|
relativeDirPath,
|
|
@@ -11694,9 +12203,9 @@ async function putMcpFile({ content }) {
|
|
|
11694
12203
|
validate: true,
|
|
11695
12204
|
modularMcp: config.getModularMcp()
|
|
11696
12205
|
});
|
|
11697
|
-
await ensureDir((0,
|
|
12206
|
+
await ensureDir((0, import_node_path95.join)(baseDir, relativeDirPath));
|
|
11698
12207
|
await writeFileContent(fullPath, content);
|
|
11699
|
-
const relativePathFromCwd = (0,
|
|
12208
|
+
const relativePathFromCwd = (0, import_node_path95.join)(relativeDirPath, relativeFilePath);
|
|
11700
12209
|
return {
|
|
11701
12210
|
relativePathFromCwd,
|
|
11702
12211
|
content: rulesyncMcp.getFileContent()
|
|
@@ -11711,15 +12220,15 @@ async function deleteMcpFile() {
|
|
|
11711
12220
|
try {
|
|
11712
12221
|
const baseDir = process.cwd();
|
|
11713
12222
|
const paths = RulesyncMcp.getSettablePaths();
|
|
11714
|
-
const recommendedPath = (0,
|
|
12223
|
+
const recommendedPath = (0, import_node_path95.join)(
|
|
11715
12224
|
baseDir,
|
|
11716
12225
|
paths.recommended.relativeDirPath,
|
|
11717
12226
|
paths.recommended.relativeFilePath
|
|
11718
12227
|
);
|
|
11719
|
-
const legacyPath = (0,
|
|
12228
|
+
const legacyPath = (0, import_node_path95.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
11720
12229
|
await removeFile(recommendedPath);
|
|
11721
12230
|
await removeFile(legacyPath);
|
|
11722
|
-
const relativePathFromCwd = (0,
|
|
12231
|
+
const relativePathFromCwd = (0, import_node_path95.join)(
|
|
11723
12232
|
paths.recommended.relativeDirPath,
|
|
11724
12233
|
paths.recommended.relativeFilePath
|
|
11725
12234
|
);
|
|
@@ -11733,11 +12242,11 @@ async function deleteMcpFile() {
|
|
|
11733
12242
|
}
|
|
11734
12243
|
}
|
|
11735
12244
|
var mcpToolSchemas = {
|
|
11736
|
-
getMcpFile:
|
|
11737
|
-
putMcpFile:
|
|
11738
|
-
content:
|
|
12245
|
+
getMcpFile: import_mini44.z.object({}),
|
|
12246
|
+
putMcpFile: import_mini44.z.object({
|
|
12247
|
+
content: import_mini44.z.string()
|
|
11739
12248
|
}),
|
|
11740
|
-
deleteMcpFile:
|
|
12249
|
+
deleteMcpFile: import_mini44.z.object({})
|
|
11741
12250
|
};
|
|
11742
12251
|
var mcpTools = {
|
|
11743
12252
|
getMcpFile: {
|
|
@@ -11770,12 +12279,12 @@ var mcpTools = {
|
|
|
11770
12279
|
};
|
|
11771
12280
|
|
|
11772
12281
|
// src/mcp/rules.ts
|
|
11773
|
-
var
|
|
11774
|
-
var
|
|
12282
|
+
var import_node_path96 = require("path");
|
|
12283
|
+
var import_mini45 = require("zod/mini");
|
|
11775
12284
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
11776
12285
|
var maxRulesCount = 1e3;
|
|
11777
12286
|
async function listRules() {
|
|
11778
|
-
const rulesDir = (0,
|
|
12287
|
+
const rulesDir = (0, import_node_path96.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
11779
12288
|
try {
|
|
11780
12289
|
const files = await listDirectoryFiles(rulesDir);
|
|
11781
12290
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -11788,7 +12297,7 @@ async function listRules() {
|
|
|
11788
12297
|
});
|
|
11789
12298
|
const frontmatter = rule.getFrontmatter();
|
|
11790
12299
|
return {
|
|
11791
|
-
relativePathFromCwd: (0,
|
|
12300
|
+
relativePathFromCwd: (0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
11792
12301
|
frontmatter
|
|
11793
12302
|
};
|
|
11794
12303
|
} catch (error) {
|
|
@@ -11808,14 +12317,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
11808
12317
|
relativePath: relativePathFromCwd,
|
|
11809
12318
|
intendedRootDir: process.cwd()
|
|
11810
12319
|
});
|
|
11811
|
-
const filename = (0,
|
|
12320
|
+
const filename = (0, import_node_path96.basename)(relativePathFromCwd);
|
|
11812
12321
|
try {
|
|
11813
12322
|
const rule = await RulesyncRule.fromFile({
|
|
11814
12323
|
relativeFilePath: filename,
|
|
11815
12324
|
validate: true
|
|
11816
12325
|
});
|
|
11817
12326
|
return {
|
|
11818
|
-
relativePathFromCwd: (0,
|
|
12327
|
+
relativePathFromCwd: (0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
11819
12328
|
frontmatter: rule.getFrontmatter(),
|
|
11820
12329
|
body: rule.getBody()
|
|
11821
12330
|
};
|
|
@@ -11834,7 +12343,7 @@ async function putRule({
|
|
|
11834
12343
|
relativePath: relativePathFromCwd,
|
|
11835
12344
|
intendedRootDir: process.cwd()
|
|
11836
12345
|
});
|
|
11837
|
-
const filename = (0,
|
|
12346
|
+
const filename = (0, import_node_path96.basename)(relativePathFromCwd);
|
|
11838
12347
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
11839
12348
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
11840
12349
|
throw new Error(
|
|
@@ -11844,7 +12353,7 @@ async function putRule({
|
|
|
11844
12353
|
try {
|
|
11845
12354
|
const existingRules = await listRules();
|
|
11846
12355
|
const isUpdate = existingRules.some(
|
|
11847
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
12356
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
11848
12357
|
);
|
|
11849
12358
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
11850
12359
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -11857,11 +12366,11 @@ async function putRule({
|
|
|
11857
12366
|
body,
|
|
11858
12367
|
validate: true
|
|
11859
12368
|
});
|
|
11860
|
-
const rulesDir = (0,
|
|
12369
|
+
const rulesDir = (0, import_node_path96.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
11861
12370
|
await ensureDir(rulesDir);
|
|
11862
12371
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
11863
12372
|
return {
|
|
11864
|
-
relativePathFromCwd: (0,
|
|
12373
|
+
relativePathFromCwd: (0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
11865
12374
|
frontmatter: rule.getFrontmatter(),
|
|
11866
12375
|
body: rule.getBody()
|
|
11867
12376
|
};
|
|
@@ -11876,12 +12385,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
11876
12385
|
relativePath: relativePathFromCwd,
|
|
11877
12386
|
intendedRootDir: process.cwd()
|
|
11878
12387
|
});
|
|
11879
|
-
const filename = (0,
|
|
11880
|
-
const fullPath = (0,
|
|
12388
|
+
const filename = (0, import_node_path96.basename)(relativePathFromCwd);
|
|
12389
|
+
const fullPath = (0, import_node_path96.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
11881
12390
|
try {
|
|
11882
12391
|
await removeFile(fullPath);
|
|
11883
12392
|
return {
|
|
11884
|
-
relativePathFromCwd: (0,
|
|
12393
|
+
relativePathFromCwd: (0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
11885
12394
|
};
|
|
11886
12395
|
} catch (error) {
|
|
11887
12396
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -11890,23 +12399,23 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
11890
12399
|
}
|
|
11891
12400
|
}
|
|
11892
12401
|
var ruleToolSchemas = {
|
|
11893
|
-
listRules:
|
|
11894
|
-
getRule:
|
|
11895
|
-
relativePathFromCwd:
|
|
12402
|
+
listRules: import_mini45.z.object({}),
|
|
12403
|
+
getRule: import_mini45.z.object({
|
|
12404
|
+
relativePathFromCwd: import_mini45.z.string()
|
|
11896
12405
|
}),
|
|
11897
|
-
putRule:
|
|
11898
|
-
relativePathFromCwd:
|
|
12406
|
+
putRule: import_mini45.z.object({
|
|
12407
|
+
relativePathFromCwd: import_mini45.z.string(),
|
|
11899
12408
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
11900
|
-
body:
|
|
12409
|
+
body: import_mini45.z.string()
|
|
11901
12410
|
}),
|
|
11902
|
-
deleteRule:
|
|
11903
|
-
relativePathFromCwd:
|
|
12411
|
+
deleteRule: import_mini45.z.object({
|
|
12412
|
+
relativePathFromCwd: import_mini45.z.string()
|
|
11904
12413
|
})
|
|
11905
12414
|
};
|
|
11906
12415
|
var ruleTools = {
|
|
11907
12416
|
listRules: {
|
|
11908
12417
|
name: "listRules",
|
|
11909
|
-
description: `List all rules from ${(0,
|
|
12418
|
+
description: `List all rules from ${(0, import_node_path96.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
11910
12419
|
parameters: ruleToolSchemas.listRules,
|
|
11911
12420
|
execute: async () => {
|
|
11912
12421
|
const rules = await listRules();
|
|
@@ -11948,8 +12457,8 @@ var ruleTools = {
|
|
|
11948
12457
|
};
|
|
11949
12458
|
|
|
11950
12459
|
// src/mcp/skills.ts
|
|
11951
|
-
var
|
|
11952
|
-
var
|
|
12460
|
+
var import_node_path97 = require("path");
|
|
12461
|
+
var import_mini46 = require("zod/mini");
|
|
11953
12462
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
11954
12463
|
var maxSkillsCount = 1e3;
|
|
11955
12464
|
function aiDirFileToMcpSkillFile(file) {
|
|
@@ -11965,19 +12474,19 @@ function mcpSkillFileToAiDirFile(file) {
|
|
|
11965
12474
|
};
|
|
11966
12475
|
}
|
|
11967
12476
|
function extractDirName(relativeDirPathFromCwd) {
|
|
11968
|
-
const dirName = (0,
|
|
12477
|
+
const dirName = (0, import_node_path97.basename)(relativeDirPathFromCwd);
|
|
11969
12478
|
if (!dirName) {
|
|
11970
12479
|
throw new Error(`Invalid path: ${relativeDirPathFromCwd}`);
|
|
11971
12480
|
}
|
|
11972
12481
|
return dirName;
|
|
11973
12482
|
}
|
|
11974
12483
|
async function listSkills() {
|
|
11975
|
-
const skillsDir = (0,
|
|
12484
|
+
const skillsDir = (0, import_node_path97.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
11976
12485
|
try {
|
|
11977
|
-
const skillDirPaths = await findFilesByGlobs((0,
|
|
12486
|
+
const skillDirPaths = await findFilesByGlobs((0, import_node_path97.join)(skillsDir, "*"), { type: "dir" });
|
|
11978
12487
|
const skills = await Promise.all(
|
|
11979
12488
|
skillDirPaths.map(async (dirPath) => {
|
|
11980
|
-
const dirName = (0,
|
|
12489
|
+
const dirName = (0, import_node_path97.basename)(dirPath);
|
|
11981
12490
|
if (!dirName) return null;
|
|
11982
12491
|
try {
|
|
11983
12492
|
const skill = await RulesyncSkill.fromDir({
|
|
@@ -11985,7 +12494,7 @@ async function listSkills() {
|
|
|
11985
12494
|
});
|
|
11986
12495
|
const frontmatter = skill.getFrontmatter();
|
|
11987
12496
|
return {
|
|
11988
|
-
relativeDirPathFromCwd: (0,
|
|
12497
|
+
relativeDirPathFromCwd: (0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
11989
12498
|
frontmatter
|
|
11990
12499
|
};
|
|
11991
12500
|
} catch (error) {
|
|
@@ -12011,7 +12520,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
|
|
|
12011
12520
|
dirName
|
|
12012
12521
|
});
|
|
12013
12522
|
return {
|
|
12014
|
-
relativeDirPathFromCwd: (0,
|
|
12523
|
+
relativeDirPathFromCwd: (0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
12015
12524
|
frontmatter: skill.getFrontmatter(),
|
|
12016
12525
|
body: skill.getBody(),
|
|
12017
12526
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -12045,7 +12554,7 @@ async function putSkill({
|
|
|
12045
12554
|
try {
|
|
12046
12555
|
const existingSkills = await listSkills();
|
|
12047
12556
|
const isUpdate = existingSkills.some(
|
|
12048
|
-
(skill2) => skill2.relativeDirPathFromCwd === (0,
|
|
12557
|
+
(skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
12049
12558
|
);
|
|
12050
12559
|
if (!isUpdate && existingSkills.length >= maxSkillsCount) {
|
|
12051
12560
|
throw new Error(`Maximum number of skills (${maxSkillsCount}) reached`);
|
|
@@ -12060,9 +12569,9 @@ async function putSkill({
|
|
|
12060
12569
|
otherFiles: aiDirFiles,
|
|
12061
12570
|
validate: true
|
|
12062
12571
|
});
|
|
12063
|
-
const skillDirPath = (0,
|
|
12572
|
+
const skillDirPath = (0, import_node_path97.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
12064
12573
|
await ensureDir(skillDirPath);
|
|
12065
|
-
const skillFilePath = (0,
|
|
12574
|
+
const skillFilePath = (0, import_node_path97.join)(skillDirPath, SKILL_FILE_NAME);
|
|
12066
12575
|
const skillFileContent = stringifyFrontmatter(body, frontmatter);
|
|
12067
12576
|
await writeFileContent(skillFilePath, skillFileContent);
|
|
12068
12577
|
for (const file of otherFiles) {
|
|
@@ -12070,15 +12579,15 @@ async function putSkill({
|
|
|
12070
12579
|
relativePath: file.name,
|
|
12071
12580
|
intendedRootDir: skillDirPath
|
|
12072
12581
|
});
|
|
12073
|
-
const filePath = (0,
|
|
12074
|
-
const fileDir = (0,
|
|
12582
|
+
const filePath = (0, import_node_path97.join)(skillDirPath, file.name);
|
|
12583
|
+
const fileDir = (0, import_node_path97.join)(skillDirPath, (0, import_node_path97.dirname)(file.name));
|
|
12075
12584
|
if (fileDir !== skillDirPath) {
|
|
12076
12585
|
await ensureDir(fileDir);
|
|
12077
12586
|
}
|
|
12078
12587
|
await writeFileContent(filePath, file.body);
|
|
12079
12588
|
}
|
|
12080
12589
|
return {
|
|
12081
|
-
relativeDirPathFromCwd: (0,
|
|
12590
|
+
relativeDirPathFromCwd: (0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
12082
12591
|
frontmatter: skill.getFrontmatter(),
|
|
12083
12592
|
body: skill.getBody(),
|
|
12084
12593
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -12100,13 +12609,13 @@ async function deleteSkill({
|
|
|
12100
12609
|
intendedRootDir: process.cwd()
|
|
12101
12610
|
});
|
|
12102
12611
|
const dirName = extractDirName(relativeDirPathFromCwd);
|
|
12103
|
-
const skillDirPath = (0,
|
|
12612
|
+
const skillDirPath = (0, import_node_path97.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
12104
12613
|
try {
|
|
12105
12614
|
if (await directoryExists(skillDirPath)) {
|
|
12106
12615
|
await removeDirectory(skillDirPath);
|
|
12107
12616
|
}
|
|
12108
12617
|
return {
|
|
12109
|
-
relativeDirPathFromCwd: (0,
|
|
12618
|
+
relativeDirPathFromCwd: (0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
12110
12619
|
};
|
|
12111
12620
|
} catch (error) {
|
|
12112
12621
|
throw new Error(
|
|
@@ -12117,29 +12626,29 @@ async function deleteSkill({
|
|
|
12117
12626
|
);
|
|
12118
12627
|
}
|
|
12119
12628
|
}
|
|
12120
|
-
var McpSkillFileSchema =
|
|
12121
|
-
name:
|
|
12122
|
-
body:
|
|
12629
|
+
var McpSkillFileSchema = import_mini46.z.object({
|
|
12630
|
+
name: import_mini46.z.string(),
|
|
12631
|
+
body: import_mini46.z.string()
|
|
12123
12632
|
});
|
|
12124
12633
|
var skillToolSchemas = {
|
|
12125
|
-
listSkills:
|
|
12126
|
-
getSkill:
|
|
12127
|
-
relativeDirPathFromCwd:
|
|
12634
|
+
listSkills: import_mini46.z.object({}),
|
|
12635
|
+
getSkill: import_mini46.z.object({
|
|
12636
|
+
relativeDirPathFromCwd: import_mini46.z.string()
|
|
12128
12637
|
}),
|
|
12129
|
-
putSkill:
|
|
12130
|
-
relativeDirPathFromCwd:
|
|
12638
|
+
putSkill: import_mini46.z.object({
|
|
12639
|
+
relativeDirPathFromCwd: import_mini46.z.string(),
|
|
12131
12640
|
frontmatter: RulesyncSkillFrontmatterSchema,
|
|
12132
|
-
body:
|
|
12133
|
-
otherFiles:
|
|
12641
|
+
body: import_mini46.z.string(),
|
|
12642
|
+
otherFiles: import_mini46.z.optional(import_mini46.z.array(McpSkillFileSchema))
|
|
12134
12643
|
}),
|
|
12135
|
-
deleteSkill:
|
|
12136
|
-
relativeDirPathFromCwd:
|
|
12644
|
+
deleteSkill: import_mini46.z.object({
|
|
12645
|
+
relativeDirPathFromCwd: import_mini46.z.string()
|
|
12137
12646
|
})
|
|
12138
12647
|
};
|
|
12139
12648
|
var skillTools = {
|
|
12140
12649
|
listSkills: {
|
|
12141
12650
|
name: "listSkills",
|
|
12142
|
-
description: `List all skills from ${(0,
|
|
12651
|
+
description: `List all skills from ${(0, import_node_path97.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
|
|
12143
12652
|
parameters: skillToolSchemas.listSkills,
|
|
12144
12653
|
execute: async () => {
|
|
12145
12654
|
const skills = await listSkills();
|
|
@@ -12182,12 +12691,12 @@ var skillTools = {
|
|
|
12182
12691
|
};
|
|
12183
12692
|
|
|
12184
12693
|
// src/mcp/subagents.ts
|
|
12185
|
-
var
|
|
12186
|
-
var
|
|
12694
|
+
var import_node_path98 = require("path");
|
|
12695
|
+
var import_mini47 = require("zod/mini");
|
|
12187
12696
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
12188
12697
|
var maxSubagentsCount = 1e3;
|
|
12189
12698
|
async function listSubagents() {
|
|
12190
|
-
const subagentsDir = (0,
|
|
12699
|
+
const subagentsDir = (0, import_node_path98.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
12191
12700
|
try {
|
|
12192
12701
|
const files = await listDirectoryFiles(subagentsDir);
|
|
12193
12702
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -12200,7 +12709,7 @@ async function listSubagents() {
|
|
|
12200
12709
|
});
|
|
12201
12710
|
const frontmatter = subagent.getFrontmatter();
|
|
12202
12711
|
return {
|
|
12203
|
-
relativePathFromCwd: (0,
|
|
12712
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
12204
12713
|
frontmatter
|
|
12205
12714
|
};
|
|
12206
12715
|
} catch (error) {
|
|
@@ -12222,14 +12731,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
12222
12731
|
relativePath: relativePathFromCwd,
|
|
12223
12732
|
intendedRootDir: process.cwd()
|
|
12224
12733
|
});
|
|
12225
|
-
const filename = (0,
|
|
12734
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12226
12735
|
try {
|
|
12227
12736
|
const subagent = await RulesyncSubagent.fromFile({
|
|
12228
12737
|
relativeFilePath: filename,
|
|
12229
12738
|
validate: true
|
|
12230
12739
|
});
|
|
12231
12740
|
return {
|
|
12232
|
-
relativePathFromCwd: (0,
|
|
12741
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
12233
12742
|
frontmatter: subagent.getFrontmatter(),
|
|
12234
12743
|
body: subagent.getBody()
|
|
12235
12744
|
};
|
|
@@ -12248,7 +12757,7 @@ async function putSubagent({
|
|
|
12248
12757
|
relativePath: relativePathFromCwd,
|
|
12249
12758
|
intendedRootDir: process.cwd()
|
|
12250
12759
|
});
|
|
12251
|
-
const filename = (0,
|
|
12760
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12252
12761
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
12253
12762
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
12254
12763
|
throw new Error(
|
|
@@ -12258,7 +12767,7 @@ async function putSubagent({
|
|
|
12258
12767
|
try {
|
|
12259
12768
|
const existingSubagents = await listSubagents();
|
|
12260
12769
|
const isUpdate = existingSubagents.some(
|
|
12261
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
12770
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
12262
12771
|
);
|
|
12263
12772
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
12264
12773
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -12271,11 +12780,11 @@ async function putSubagent({
|
|
|
12271
12780
|
body,
|
|
12272
12781
|
validate: true
|
|
12273
12782
|
});
|
|
12274
|
-
const subagentsDir = (0,
|
|
12783
|
+
const subagentsDir = (0, import_node_path98.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
12275
12784
|
await ensureDir(subagentsDir);
|
|
12276
12785
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
12277
12786
|
return {
|
|
12278
|
-
relativePathFromCwd: (0,
|
|
12787
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
12279
12788
|
frontmatter: subagent.getFrontmatter(),
|
|
12280
12789
|
body: subagent.getBody()
|
|
12281
12790
|
};
|
|
@@ -12290,12 +12799,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
12290
12799
|
relativePath: relativePathFromCwd,
|
|
12291
12800
|
intendedRootDir: process.cwd()
|
|
12292
12801
|
});
|
|
12293
|
-
const filename = (0,
|
|
12294
|
-
const fullPath = (0,
|
|
12802
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12803
|
+
const fullPath = (0, import_node_path98.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
12295
12804
|
try {
|
|
12296
12805
|
await removeFile(fullPath);
|
|
12297
12806
|
return {
|
|
12298
|
-
relativePathFromCwd: (0,
|
|
12807
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
12299
12808
|
};
|
|
12300
12809
|
} catch (error) {
|
|
12301
12810
|
throw new Error(
|
|
@@ -12307,23 +12816,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
12307
12816
|
}
|
|
12308
12817
|
}
|
|
12309
12818
|
var subagentToolSchemas = {
|
|
12310
|
-
listSubagents:
|
|
12311
|
-
getSubagent:
|
|
12312
|
-
relativePathFromCwd:
|
|
12819
|
+
listSubagents: import_mini47.z.object({}),
|
|
12820
|
+
getSubagent: import_mini47.z.object({
|
|
12821
|
+
relativePathFromCwd: import_mini47.z.string()
|
|
12313
12822
|
}),
|
|
12314
|
-
putSubagent:
|
|
12315
|
-
relativePathFromCwd:
|
|
12823
|
+
putSubagent: import_mini47.z.object({
|
|
12824
|
+
relativePathFromCwd: import_mini47.z.string(),
|
|
12316
12825
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
12317
|
-
body:
|
|
12826
|
+
body: import_mini47.z.string()
|
|
12318
12827
|
}),
|
|
12319
|
-
deleteSubagent:
|
|
12320
|
-
relativePathFromCwd:
|
|
12828
|
+
deleteSubagent: import_mini47.z.object({
|
|
12829
|
+
relativePathFromCwd: import_mini47.z.string()
|
|
12321
12830
|
})
|
|
12322
12831
|
};
|
|
12323
12832
|
var subagentTools = {
|
|
12324
12833
|
listSubagents: {
|
|
12325
12834
|
name: "listSubagents",
|
|
12326
|
-
description: `List all subagents from ${(0,
|
|
12835
|
+
description: `List all subagents from ${(0, import_node_path98.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
12327
12836
|
parameters: subagentToolSchemas.listSubagents,
|
|
12328
12837
|
execute: async () => {
|
|
12329
12838
|
const subagents = await listSubagents();
|
|
@@ -12365,20 +12874,20 @@ var subagentTools = {
|
|
|
12365
12874
|
};
|
|
12366
12875
|
|
|
12367
12876
|
// src/mcp/tools.ts
|
|
12368
|
-
var rulesyncFeatureSchema =
|
|
12369
|
-
var rulesyncOperationSchema =
|
|
12370
|
-
var skillFileSchema =
|
|
12371
|
-
name:
|
|
12372
|
-
body:
|
|
12877
|
+
var rulesyncFeatureSchema = import_mini48.z.enum(["rule", "command", "subagent", "skill", "ignore", "mcp"]);
|
|
12878
|
+
var rulesyncOperationSchema = import_mini48.z.enum(["list", "get", "put", "delete"]);
|
|
12879
|
+
var skillFileSchema = import_mini48.z.object({
|
|
12880
|
+
name: import_mini48.z.string(),
|
|
12881
|
+
body: import_mini48.z.string()
|
|
12373
12882
|
});
|
|
12374
|
-
var rulesyncToolSchema =
|
|
12883
|
+
var rulesyncToolSchema = import_mini48.z.object({
|
|
12375
12884
|
feature: rulesyncFeatureSchema,
|
|
12376
12885
|
operation: rulesyncOperationSchema,
|
|
12377
|
-
targetPathFromCwd:
|
|
12378
|
-
frontmatter:
|
|
12379
|
-
body:
|
|
12380
|
-
otherFiles:
|
|
12381
|
-
content:
|
|
12886
|
+
targetPathFromCwd: import_mini48.z.optional(import_mini48.z.string()),
|
|
12887
|
+
frontmatter: import_mini48.z.optional(import_mini48.z.unknown()),
|
|
12888
|
+
body: import_mini48.z.optional(import_mini48.z.string()),
|
|
12889
|
+
otherFiles: import_mini48.z.optional(import_mini48.z.array(skillFileSchema)),
|
|
12890
|
+
content: import_mini48.z.optional(import_mini48.z.string())
|
|
12382
12891
|
});
|
|
12383
12892
|
var supportedOperationsByFeature = {
|
|
12384
12893
|
rule: ["list", "get", "put", "delete"],
|
|
@@ -12574,7 +13083,7 @@ async function mcpCommand({ version }) {
|
|
|
12574
13083
|
}
|
|
12575
13084
|
|
|
12576
13085
|
// src/cli/index.ts
|
|
12577
|
-
var getVersion = () => "5.
|
|
13086
|
+
var getVersion = () => "5.1.0";
|
|
12578
13087
|
var main = async () => {
|
|
12579
13088
|
const program = new import_commander.Command();
|
|
12580
13089
|
const version = getVersion();
|