rulesync 6.3.0 → 6.4.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 +787 -434
- package/dist/index.js +776 -423
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -294,6 +294,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
294
294
|
"codexcli",
|
|
295
295
|
"copilot",
|
|
296
296
|
"cursor",
|
|
297
|
+
"factorydroid",
|
|
297
298
|
"geminicli",
|
|
298
299
|
"junie",
|
|
299
300
|
"kilo",
|
|
@@ -535,10 +536,10 @@ function getBaseDirsInLightOfGlobal({
|
|
|
535
536
|
|
|
536
537
|
// src/lib/generate.ts
|
|
537
538
|
var import_es_toolkit4 = require("es-toolkit");
|
|
538
|
-
var
|
|
539
|
+
var import_node_path107 = require("path");
|
|
539
540
|
|
|
540
541
|
// src/features/commands/commands-processor.ts
|
|
541
|
-
var
|
|
542
|
+
var import_node_path20 = require("path");
|
|
542
543
|
var import_mini12 = require("zod/mini");
|
|
543
544
|
|
|
544
545
|
// src/types/feature-processor.ts
|
|
@@ -1768,8 +1769,66 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1768
1769
|
}
|
|
1769
1770
|
};
|
|
1770
1771
|
|
|
1771
|
-
// src/features/commands/
|
|
1772
|
+
// src/features/commands/factorydroid-command.ts
|
|
1772
1773
|
var import_node_path14 = require("path");
|
|
1774
|
+
var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
|
|
1775
|
+
static getSettablePaths(_options) {
|
|
1776
|
+
return {
|
|
1777
|
+
relativeDirPath: (0, import_node_path14.join)(".factorydroid", "commands")
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
static fromRulesyncCommand({
|
|
1781
|
+
baseDir = process.cwd(),
|
|
1782
|
+
rulesyncCommand,
|
|
1783
|
+
validate = true,
|
|
1784
|
+
global = false
|
|
1785
|
+
}) {
|
|
1786
|
+
return new _FactorydroidCommand(
|
|
1787
|
+
this.fromRulesyncCommandDefault({ baseDir, rulesyncCommand, validate, global })
|
|
1788
|
+
);
|
|
1789
|
+
}
|
|
1790
|
+
static async fromFile({
|
|
1791
|
+
baseDir = process.cwd(),
|
|
1792
|
+
relativeFilePath,
|
|
1793
|
+
validate = true,
|
|
1794
|
+
global = false
|
|
1795
|
+
}) {
|
|
1796
|
+
const paths = _FactorydroidCommand.getSettablePaths({ global });
|
|
1797
|
+
const filePath = (0, import_node_path14.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1798
|
+
const fileContent = await readFileContent(filePath);
|
|
1799
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1800
|
+
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1801
|
+
if (!result.success) {
|
|
1802
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
1803
|
+
}
|
|
1804
|
+
return new _FactorydroidCommand({
|
|
1805
|
+
baseDir,
|
|
1806
|
+
relativeDirPath: paths.relativeDirPath,
|
|
1807
|
+
relativeFilePath: (0, import_node_path14.basename)(relativeFilePath),
|
|
1808
|
+
frontmatter: result.data,
|
|
1809
|
+
body: content.trim(),
|
|
1810
|
+
validate
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1814
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
1815
|
+
rulesyncCommand,
|
|
1816
|
+
toolTarget: "factorydroid"
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
static forDeletion({
|
|
1820
|
+
baseDir = process.cwd(),
|
|
1821
|
+
relativeDirPath,
|
|
1822
|
+
relativeFilePath
|
|
1823
|
+
}) {
|
|
1824
|
+
return new _FactorydroidCommand(
|
|
1825
|
+
this.forDeletionDefault({ baseDir, relativeDirPath, relativeFilePath })
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
// src/features/commands/geminicli-command.ts
|
|
1831
|
+
var import_node_path15 = require("path");
|
|
1773
1832
|
var import_smol_toml = require("smol-toml");
|
|
1774
1833
|
var import_mini9 = require("zod/mini");
|
|
1775
1834
|
var GeminiCliCommandFrontmatterSchema = import_mini9.z.looseObject({
|
|
@@ -1787,7 +1846,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1787
1846
|
}
|
|
1788
1847
|
static getSettablePaths(_options = {}) {
|
|
1789
1848
|
return {
|
|
1790
|
-
relativeDirPath: (0,
|
|
1849
|
+
relativeDirPath: (0, import_node_path15.join)(".gemini", "commands")
|
|
1791
1850
|
};
|
|
1792
1851
|
}
|
|
1793
1852
|
parseTomlContent(content) {
|
|
@@ -1869,12 +1928,12 @@ ${geminiFrontmatter.prompt}
|
|
|
1869
1928
|
global = false
|
|
1870
1929
|
}) {
|
|
1871
1930
|
const paths = this.getSettablePaths({ global });
|
|
1872
|
-
const filePath = (0,
|
|
1931
|
+
const filePath = (0, import_node_path15.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1873
1932
|
const fileContent = await readFileContent(filePath);
|
|
1874
1933
|
return new _GeminiCliCommand({
|
|
1875
1934
|
baseDir,
|
|
1876
1935
|
relativeDirPath: paths.relativeDirPath,
|
|
1877
|
-
relativeFilePath: (0,
|
|
1936
|
+
relativeFilePath: (0, import_node_path15.basename)(relativeFilePath),
|
|
1878
1937
|
fileContent,
|
|
1879
1938
|
validate
|
|
1880
1939
|
});
|
|
@@ -1911,11 +1970,11 @@ prompt = ""`;
|
|
|
1911
1970
|
};
|
|
1912
1971
|
|
|
1913
1972
|
// src/features/commands/kilo-command.ts
|
|
1914
|
-
var
|
|
1973
|
+
var import_node_path16 = require("path");
|
|
1915
1974
|
var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
1916
1975
|
static getSettablePaths(_options = {}) {
|
|
1917
1976
|
return {
|
|
1918
|
-
relativeDirPath: (0,
|
|
1977
|
+
relativeDirPath: (0, import_node_path16.join)(".kilocode", "workflows")
|
|
1919
1978
|
};
|
|
1920
1979
|
}
|
|
1921
1980
|
toRulesyncCommand() {
|
|
@@ -1965,13 +2024,13 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
1965
2024
|
validate = true
|
|
1966
2025
|
}) {
|
|
1967
2026
|
const paths = this.getSettablePaths();
|
|
1968
|
-
const filePath = (0,
|
|
2027
|
+
const filePath = (0, import_node_path16.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1969
2028
|
const fileContent = await readFileContent(filePath);
|
|
1970
2029
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1971
2030
|
return new _KiloCommand({
|
|
1972
2031
|
baseDir,
|
|
1973
2032
|
relativeDirPath: paths.relativeDirPath,
|
|
1974
|
-
relativeFilePath: (0,
|
|
2033
|
+
relativeFilePath: (0, import_node_path16.basename)(relativeFilePath),
|
|
1975
2034
|
fileContent: content.trim(),
|
|
1976
2035
|
validate
|
|
1977
2036
|
});
|
|
@@ -1992,11 +2051,11 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
1992
2051
|
};
|
|
1993
2052
|
|
|
1994
2053
|
// src/features/commands/kiro-command.ts
|
|
1995
|
-
var
|
|
2054
|
+
var import_node_path17 = require("path");
|
|
1996
2055
|
var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
1997
2056
|
static getSettablePaths(_options = {}) {
|
|
1998
2057
|
return {
|
|
1999
|
-
relativeDirPath: (0,
|
|
2058
|
+
relativeDirPath: (0, import_node_path17.join)(".kiro", "prompts")
|
|
2000
2059
|
};
|
|
2001
2060
|
}
|
|
2002
2061
|
toRulesyncCommand() {
|
|
@@ -2046,13 +2105,13 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2046
2105
|
validate = true
|
|
2047
2106
|
}) {
|
|
2048
2107
|
const paths = this.getSettablePaths();
|
|
2049
|
-
const filePath = (0,
|
|
2108
|
+
const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2050
2109
|
const fileContent = await readFileContent(filePath);
|
|
2051
2110
|
const { body: content } = parseFrontmatter(fileContent);
|
|
2052
2111
|
return new _KiroCommand({
|
|
2053
2112
|
baseDir,
|
|
2054
2113
|
relativeDirPath: paths.relativeDirPath,
|
|
2055
|
-
relativeFilePath: (0,
|
|
2114
|
+
relativeFilePath: (0, import_node_path17.basename)(relativeFilePath),
|
|
2056
2115
|
fileContent: content.trim(),
|
|
2057
2116
|
validate
|
|
2058
2117
|
});
|
|
@@ -2073,7 +2132,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
|
2073
2132
|
};
|
|
2074
2133
|
|
|
2075
2134
|
// src/features/commands/opencode-command.ts
|
|
2076
|
-
var
|
|
2135
|
+
var import_node_path18 = require("path");
|
|
2077
2136
|
var import_mini10 = require("zod/mini");
|
|
2078
2137
|
var OpenCodeCommandFrontmatterSchema = import_mini10.z.looseObject({
|
|
2079
2138
|
description: import_mini10.z.string(),
|
|
@@ -2089,7 +2148,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2089
2148
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2090
2149
|
if (!result.success) {
|
|
2091
2150
|
throw new Error(
|
|
2092
|
-
`Invalid frontmatter in ${(0,
|
|
2151
|
+
`Invalid frontmatter in ${(0, import_node_path18.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2093
2152
|
);
|
|
2094
2153
|
}
|
|
2095
2154
|
}
|
|
@@ -2102,7 +2161,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2102
2161
|
}
|
|
2103
2162
|
static getSettablePaths({ global } = {}) {
|
|
2104
2163
|
return {
|
|
2105
|
-
relativeDirPath: global ? (0,
|
|
2164
|
+
relativeDirPath: global ? (0, import_node_path18.join)(".config", "opencode", "command") : (0, import_node_path18.join)(".opencode", "command")
|
|
2106
2165
|
};
|
|
2107
2166
|
}
|
|
2108
2167
|
getBody() {
|
|
@@ -2163,7 +2222,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2163
2222
|
return {
|
|
2164
2223
|
success: false,
|
|
2165
2224
|
error: new Error(
|
|
2166
|
-
`Invalid frontmatter in ${(0,
|
|
2225
|
+
`Invalid frontmatter in ${(0, import_node_path18.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2167
2226
|
)
|
|
2168
2227
|
};
|
|
2169
2228
|
}
|
|
@@ -2174,7 +2233,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2174
2233
|
global = false
|
|
2175
2234
|
}) {
|
|
2176
2235
|
const paths = this.getSettablePaths({ global });
|
|
2177
|
-
const filePath = (0,
|
|
2236
|
+
const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2178
2237
|
const fileContent = await readFileContent(filePath);
|
|
2179
2238
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2180
2239
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2184,7 +2243,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2184
2243
|
return new _OpenCodeCommand({
|
|
2185
2244
|
baseDir,
|
|
2186
2245
|
relativeDirPath: paths.relativeDirPath,
|
|
2187
|
-
relativeFilePath: (0,
|
|
2246
|
+
relativeFilePath: (0, import_node_path18.basename)(relativeFilePath),
|
|
2188
2247
|
frontmatter: result.data,
|
|
2189
2248
|
body: content.trim(),
|
|
2190
2249
|
validate
|
|
@@ -2213,7 +2272,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2213
2272
|
};
|
|
2214
2273
|
|
|
2215
2274
|
// src/features/commands/roo-command.ts
|
|
2216
|
-
var
|
|
2275
|
+
var import_node_path19 = require("path");
|
|
2217
2276
|
var import_mini11 = require("zod/mini");
|
|
2218
2277
|
var RooCommandFrontmatterSchema = import_mini11.z.looseObject({
|
|
2219
2278
|
description: import_mini11.z.string(),
|
|
@@ -2224,7 +2283,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2224
2283
|
body;
|
|
2225
2284
|
static getSettablePaths() {
|
|
2226
2285
|
return {
|
|
2227
|
-
relativeDirPath: (0,
|
|
2286
|
+
relativeDirPath: (0, import_node_path19.join)(".roo", "commands")
|
|
2228
2287
|
};
|
|
2229
2288
|
}
|
|
2230
2289
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -2232,7 +2291,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2232
2291
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2233
2292
|
if (!result.success) {
|
|
2234
2293
|
throw new Error(
|
|
2235
|
-
`Invalid frontmatter in ${(0,
|
|
2294
|
+
`Invalid frontmatter in ${(0, import_node_path19.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2236
2295
|
);
|
|
2237
2296
|
}
|
|
2238
2297
|
}
|
|
@@ -2303,7 +2362,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2303
2362
|
return {
|
|
2304
2363
|
success: false,
|
|
2305
2364
|
error: new Error(
|
|
2306
|
-
`Invalid frontmatter in ${(0,
|
|
2365
|
+
`Invalid frontmatter in ${(0, import_node_path19.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2307
2366
|
)
|
|
2308
2367
|
};
|
|
2309
2368
|
}
|
|
@@ -2319,7 +2378,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2319
2378
|
relativeFilePath,
|
|
2320
2379
|
validate = true
|
|
2321
2380
|
}) {
|
|
2322
|
-
const filePath = (0,
|
|
2381
|
+
const filePath = (0, import_node_path19.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2323
2382
|
const fileContent = await readFileContent(filePath);
|
|
2324
2383
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2325
2384
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2329,7 +2388,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2329
2388
|
return new _RooCommand({
|
|
2330
2389
|
baseDir,
|
|
2331
2390
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
2332
|
-
relativeFilePath: (0,
|
|
2391
|
+
relativeFilePath: (0, import_node_path19.basename)(relativeFilePath),
|
|
2333
2392
|
frontmatter: result.data,
|
|
2334
2393
|
body: content.trim(),
|
|
2335
2394
|
fileContent,
|
|
@@ -2363,6 +2422,7 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2363
2422
|
"codexcli",
|
|
2364
2423
|
"copilot",
|
|
2365
2424
|
"cursor",
|
|
2425
|
+
"factorydroid",
|
|
2366
2426
|
"geminicli",
|
|
2367
2427
|
"kilo",
|
|
2368
2428
|
"kiro",
|
|
@@ -2432,6 +2492,13 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2432
2492
|
meta: { extension: "md", supportsProject: true, supportsGlobal: true, isSimulated: false }
|
|
2433
2493
|
}
|
|
2434
2494
|
],
|
|
2495
|
+
[
|
|
2496
|
+
"factorydroid",
|
|
2497
|
+
{
|
|
2498
|
+
class: FactorydroidCommand,
|
|
2499
|
+
meta: { extension: "md", supportsProject: true, supportsGlobal: true, isSimulated: true }
|
|
2500
|
+
}
|
|
2501
|
+
],
|
|
2435
2502
|
[
|
|
2436
2503
|
"geminicli",
|
|
2437
2504
|
{
|
|
@@ -2543,11 +2610,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2543
2610
|
*/
|
|
2544
2611
|
async loadRulesyncFiles() {
|
|
2545
2612
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
2546
|
-
(0,
|
|
2613
|
+
(0, import_node_path20.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
2547
2614
|
);
|
|
2548
2615
|
const rulesyncCommands = await Promise.all(
|
|
2549
2616
|
rulesyncCommandPaths.map(
|
|
2550
|
-
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
2617
|
+
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path20.basename)(path3) })
|
|
2551
2618
|
)
|
|
2552
2619
|
);
|
|
2553
2620
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -2563,14 +2630,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2563
2630
|
const factory = this.getFactory(this.toolTarget);
|
|
2564
2631
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
2565
2632
|
const commandFilePaths = await findFilesByGlobs(
|
|
2566
|
-
(0,
|
|
2633
|
+
(0, import_node_path20.join)(this.baseDir, paths.relativeDirPath, `*.${factory.meta.extension}`)
|
|
2567
2634
|
);
|
|
2568
2635
|
if (forDeletion) {
|
|
2569
2636
|
const toolCommands2 = commandFilePaths.map(
|
|
2570
2637
|
(path3) => factory.class.forDeletion({
|
|
2571
2638
|
baseDir: this.baseDir,
|
|
2572
2639
|
relativeDirPath: paths.relativeDirPath,
|
|
2573
|
-
relativeFilePath: (0,
|
|
2640
|
+
relativeFilePath: (0, import_node_path20.basename)(path3),
|
|
2574
2641
|
global: this.global
|
|
2575
2642
|
})
|
|
2576
2643
|
).filter((cmd) => cmd.isDeletable());
|
|
@@ -2581,7 +2648,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2581
2648
|
commandFilePaths.map(
|
|
2582
2649
|
(path3) => factory.class.fromFile({
|
|
2583
2650
|
baseDir: this.baseDir,
|
|
2584
|
-
relativeFilePath: (0,
|
|
2651
|
+
relativeFilePath: (0, import_node_path20.basename)(path3),
|
|
2585
2652
|
global: this.global
|
|
2586
2653
|
})
|
|
2587
2654
|
)
|
|
@@ -2683,14 +2750,14 @@ var CLAUDE_TO_CURSOR_EVENT_NAMES = Object.fromEntries(
|
|
|
2683
2750
|
);
|
|
2684
2751
|
|
|
2685
2752
|
// src/features/hooks/claudecode-hooks.ts
|
|
2686
|
-
var
|
|
2753
|
+
var import_node_path22 = require("path");
|
|
2687
2754
|
|
|
2688
2755
|
// src/types/tool-file.ts
|
|
2689
2756
|
var ToolFile = class extends AiFile {
|
|
2690
2757
|
};
|
|
2691
2758
|
|
|
2692
2759
|
// src/features/hooks/rulesync-hooks.ts
|
|
2693
|
-
var
|
|
2760
|
+
var import_node_path21 = require("path");
|
|
2694
2761
|
var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
2695
2762
|
json;
|
|
2696
2763
|
constructor(params) {
|
|
@@ -2721,7 +2788,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
|
|
|
2721
2788
|
validate = true
|
|
2722
2789
|
}) {
|
|
2723
2790
|
const paths = _RulesyncHooks.getSettablePaths();
|
|
2724
|
-
const filePath = (0,
|
|
2791
|
+
const filePath = (0, import_node_path21.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2725
2792
|
if (!await fileExists(filePath)) {
|
|
2726
2793
|
throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
|
|
2727
2794
|
}
|
|
@@ -2879,7 +2946,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
2879
2946
|
global = false
|
|
2880
2947
|
}) {
|
|
2881
2948
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
2882
|
-
const filePath = (0,
|
|
2949
|
+
const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2883
2950
|
const fileContent = await readOrInitializeFileContent(
|
|
2884
2951
|
filePath,
|
|
2885
2952
|
JSON.stringify({ hooks: {} }, null, 2)
|
|
@@ -2899,7 +2966,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
2899
2966
|
global = false
|
|
2900
2967
|
}) {
|
|
2901
2968
|
const paths = _ClaudecodeHooks.getSettablePaths({ global });
|
|
2902
|
-
const filePath = (0,
|
|
2969
|
+
const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2903
2970
|
const existingContent = await readOrInitializeFileContent(
|
|
2904
2971
|
filePath,
|
|
2905
2972
|
JSON.stringify({}, null, 2)
|
|
@@ -2958,7 +3025,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
|
|
|
2958
3025
|
};
|
|
2959
3026
|
|
|
2960
3027
|
// src/features/hooks/cursor-hooks.ts
|
|
2961
|
-
var
|
|
3028
|
+
var import_node_path23 = require("path");
|
|
2962
3029
|
var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
2963
3030
|
constructor(params) {
|
|
2964
3031
|
const { rulesyncHooks: _r, ...rest } = params;
|
|
@@ -2979,7 +3046,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
|
|
|
2979
3046
|
}) {
|
|
2980
3047
|
const paths = _CursorHooks.getSettablePaths();
|
|
2981
3048
|
const fileContent = await readFileContent(
|
|
2982
|
-
(0,
|
|
3049
|
+
(0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
2983
3050
|
);
|
|
2984
3051
|
return new _CursorHooks({
|
|
2985
3052
|
baseDir,
|
|
@@ -3182,10 +3249,10 @@ var HooksProcessor = class extends FeatureProcessor {
|
|
|
3182
3249
|
var import_mini15 = require("zod/mini");
|
|
3183
3250
|
|
|
3184
3251
|
// src/features/ignore/augmentcode-ignore.ts
|
|
3185
|
-
var
|
|
3252
|
+
var import_node_path25 = require("path");
|
|
3186
3253
|
|
|
3187
3254
|
// src/features/ignore/rulesync-ignore.ts
|
|
3188
|
-
var
|
|
3255
|
+
var import_node_path24 = require("path");
|
|
3189
3256
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
3190
3257
|
validate() {
|
|
3191
3258
|
return { success: true, error: null };
|
|
@@ -3205,12 +3272,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
3205
3272
|
static async fromFile() {
|
|
3206
3273
|
const baseDir = process.cwd();
|
|
3207
3274
|
const paths = this.getSettablePaths();
|
|
3208
|
-
const recommendedPath = (0,
|
|
3275
|
+
const recommendedPath = (0, import_node_path24.join)(
|
|
3209
3276
|
baseDir,
|
|
3210
3277
|
paths.recommended.relativeDirPath,
|
|
3211
3278
|
paths.recommended.relativeFilePath
|
|
3212
3279
|
);
|
|
3213
|
-
const legacyPath = (0,
|
|
3280
|
+
const legacyPath = (0, import_node_path24.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
3214
3281
|
if (await fileExists(recommendedPath)) {
|
|
3215
3282
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
3216
3283
|
return new _RulesyncIgnore({
|
|
@@ -3326,7 +3393,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
3326
3393
|
validate = true
|
|
3327
3394
|
}) {
|
|
3328
3395
|
const fileContent = await readFileContent(
|
|
3329
|
-
(0,
|
|
3396
|
+
(0, import_node_path25.join)(
|
|
3330
3397
|
baseDir,
|
|
3331
3398
|
this.getSettablePaths().relativeDirPath,
|
|
3332
3399
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3357,7 +3424,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
3357
3424
|
|
|
3358
3425
|
// src/features/ignore/claudecode-ignore.ts
|
|
3359
3426
|
var import_es_toolkit2 = require("es-toolkit");
|
|
3360
|
-
var
|
|
3427
|
+
var import_node_path26 = require("path");
|
|
3361
3428
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
3362
3429
|
constructor(params) {
|
|
3363
3430
|
super(params);
|
|
@@ -3399,7 +3466,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
3399
3466
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
3400
3467
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
3401
3468
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
3402
|
-
const filePath = (0,
|
|
3469
|
+
const filePath = (0, import_node_path26.join)(
|
|
3403
3470
|
baseDir,
|
|
3404
3471
|
this.getSettablePaths().relativeDirPath,
|
|
3405
3472
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3435,7 +3502,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
3435
3502
|
validate = true
|
|
3436
3503
|
}) {
|
|
3437
3504
|
const fileContent = await readFileContent(
|
|
3438
|
-
(0,
|
|
3505
|
+
(0, import_node_path26.join)(
|
|
3439
3506
|
baseDir,
|
|
3440
3507
|
this.getSettablePaths().relativeDirPath,
|
|
3441
3508
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3465,7 +3532,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
3465
3532
|
};
|
|
3466
3533
|
|
|
3467
3534
|
// src/features/ignore/cline-ignore.ts
|
|
3468
|
-
var
|
|
3535
|
+
var import_node_path27 = require("path");
|
|
3469
3536
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
3470
3537
|
static getSettablePaths() {
|
|
3471
3538
|
return {
|
|
@@ -3502,7 +3569,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
3502
3569
|
validate = true
|
|
3503
3570
|
}) {
|
|
3504
3571
|
const fileContent = await readFileContent(
|
|
3505
|
-
(0,
|
|
3572
|
+
(0, import_node_path27.join)(
|
|
3506
3573
|
baseDir,
|
|
3507
3574
|
this.getSettablePaths().relativeDirPath,
|
|
3508
3575
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3532,7 +3599,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
3532
3599
|
};
|
|
3533
3600
|
|
|
3534
3601
|
// src/features/ignore/cursor-ignore.ts
|
|
3535
|
-
var
|
|
3602
|
+
var import_node_path28 = require("path");
|
|
3536
3603
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
3537
3604
|
static getSettablePaths() {
|
|
3538
3605
|
return {
|
|
@@ -3565,7 +3632,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
3565
3632
|
validate = true
|
|
3566
3633
|
}) {
|
|
3567
3634
|
const fileContent = await readFileContent(
|
|
3568
|
-
(0,
|
|
3635
|
+
(0, import_node_path28.join)(
|
|
3569
3636
|
baseDir,
|
|
3570
3637
|
this.getSettablePaths().relativeDirPath,
|
|
3571
3638
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3595,7 +3662,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
3595
3662
|
};
|
|
3596
3663
|
|
|
3597
3664
|
// src/features/ignore/geminicli-ignore.ts
|
|
3598
|
-
var
|
|
3665
|
+
var import_node_path29 = require("path");
|
|
3599
3666
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
3600
3667
|
static getSettablePaths() {
|
|
3601
3668
|
return {
|
|
@@ -3622,7 +3689,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
3622
3689
|
validate = true
|
|
3623
3690
|
}) {
|
|
3624
3691
|
const fileContent = await readFileContent(
|
|
3625
|
-
(0,
|
|
3692
|
+
(0, import_node_path29.join)(
|
|
3626
3693
|
baseDir,
|
|
3627
3694
|
this.getSettablePaths().relativeDirPath,
|
|
3628
3695
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3652,7 +3719,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
3652
3719
|
};
|
|
3653
3720
|
|
|
3654
3721
|
// src/features/ignore/junie-ignore.ts
|
|
3655
|
-
var
|
|
3722
|
+
var import_node_path30 = require("path");
|
|
3656
3723
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
3657
3724
|
static getSettablePaths() {
|
|
3658
3725
|
return {
|
|
@@ -3679,7 +3746,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
3679
3746
|
validate = true
|
|
3680
3747
|
}) {
|
|
3681
3748
|
const fileContent = await readFileContent(
|
|
3682
|
-
(0,
|
|
3749
|
+
(0, import_node_path30.join)(
|
|
3683
3750
|
baseDir,
|
|
3684
3751
|
this.getSettablePaths().relativeDirPath,
|
|
3685
3752
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3709,7 +3776,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
3709
3776
|
};
|
|
3710
3777
|
|
|
3711
3778
|
// src/features/ignore/kilo-ignore.ts
|
|
3712
|
-
var
|
|
3779
|
+
var import_node_path31 = require("path");
|
|
3713
3780
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
3714
3781
|
static getSettablePaths() {
|
|
3715
3782
|
return {
|
|
@@ -3746,7 +3813,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
3746
3813
|
validate = true
|
|
3747
3814
|
}) {
|
|
3748
3815
|
const fileContent = await readFileContent(
|
|
3749
|
-
(0,
|
|
3816
|
+
(0, import_node_path31.join)(
|
|
3750
3817
|
baseDir,
|
|
3751
3818
|
this.getSettablePaths().relativeDirPath,
|
|
3752
3819
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3776,7 +3843,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
3776
3843
|
};
|
|
3777
3844
|
|
|
3778
3845
|
// src/features/ignore/kiro-ignore.ts
|
|
3779
|
-
var
|
|
3846
|
+
var import_node_path32 = require("path");
|
|
3780
3847
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
3781
3848
|
static getSettablePaths() {
|
|
3782
3849
|
return {
|
|
@@ -3803,7 +3870,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
3803
3870
|
validate = true
|
|
3804
3871
|
}) {
|
|
3805
3872
|
const fileContent = await readFileContent(
|
|
3806
|
-
(0,
|
|
3873
|
+
(0, import_node_path32.join)(
|
|
3807
3874
|
baseDir,
|
|
3808
3875
|
this.getSettablePaths().relativeDirPath,
|
|
3809
3876
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3833,7 +3900,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
3833
3900
|
};
|
|
3834
3901
|
|
|
3835
3902
|
// src/features/ignore/qwencode-ignore.ts
|
|
3836
|
-
var
|
|
3903
|
+
var import_node_path33 = require("path");
|
|
3837
3904
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
3838
3905
|
static getSettablePaths() {
|
|
3839
3906
|
return {
|
|
@@ -3860,7 +3927,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
3860
3927
|
validate = true
|
|
3861
3928
|
}) {
|
|
3862
3929
|
const fileContent = await readFileContent(
|
|
3863
|
-
(0,
|
|
3930
|
+
(0, import_node_path33.join)(
|
|
3864
3931
|
baseDir,
|
|
3865
3932
|
this.getSettablePaths().relativeDirPath,
|
|
3866
3933
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3890,7 +3957,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
3890
3957
|
};
|
|
3891
3958
|
|
|
3892
3959
|
// src/features/ignore/roo-ignore.ts
|
|
3893
|
-
var
|
|
3960
|
+
var import_node_path34 = require("path");
|
|
3894
3961
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
3895
3962
|
static getSettablePaths() {
|
|
3896
3963
|
return {
|
|
@@ -3917,7 +3984,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3917
3984
|
validate = true
|
|
3918
3985
|
}) {
|
|
3919
3986
|
const fileContent = await readFileContent(
|
|
3920
|
-
(0,
|
|
3987
|
+
(0, import_node_path34.join)(
|
|
3921
3988
|
baseDir,
|
|
3922
3989
|
this.getSettablePaths().relativeDirPath,
|
|
3923
3990
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3947,7 +4014,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3947
4014
|
};
|
|
3948
4015
|
|
|
3949
4016
|
// src/features/ignore/windsurf-ignore.ts
|
|
3950
|
-
var
|
|
4017
|
+
var import_node_path35 = require("path");
|
|
3951
4018
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
3952
4019
|
static getSettablePaths() {
|
|
3953
4020
|
return {
|
|
@@ -3974,7 +4041,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
3974
4041
|
validate = true
|
|
3975
4042
|
}) {
|
|
3976
4043
|
const fileContent = await readFileContent(
|
|
3977
|
-
(0,
|
|
4044
|
+
(0, import_node_path35.join)(
|
|
3978
4045
|
baseDir,
|
|
3979
4046
|
this.getSettablePaths().relativeDirPath,
|
|
3980
4047
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4005,7 +4072,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
4005
4072
|
|
|
4006
4073
|
// src/features/ignore/zed-ignore.ts
|
|
4007
4074
|
var import_es_toolkit3 = require("es-toolkit");
|
|
4008
|
-
var
|
|
4075
|
+
var import_node_path36 = require("path");
|
|
4009
4076
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
4010
4077
|
constructor(params) {
|
|
4011
4078
|
super(params);
|
|
@@ -4041,7 +4108,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4041
4108
|
}) {
|
|
4042
4109
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
4043
4110
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4044
|
-
const filePath = (0,
|
|
4111
|
+
const filePath = (0, import_node_path36.join)(
|
|
4045
4112
|
baseDir,
|
|
4046
4113
|
this.getSettablePaths().relativeDirPath,
|
|
4047
4114
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4068,7 +4135,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
4068
4135
|
validate = true
|
|
4069
4136
|
}) {
|
|
4070
4137
|
const fileContent = await readFileContent(
|
|
4071
|
-
(0,
|
|
4138
|
+
(0, import_node_path36.join)(
|
|
4072
4139
|
baseDir,
|
|
4073
4140
|
this.getSettablePaths().relativeDirPath,
|
|
4074
4141
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4250,10 +4317,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
4250
4317
|
var import_mini20 = require("zod/mini");
|
|
4251
4318
|
|
|
4252
4319
|
// src/features/mcp/claudecode-mcp.ts
|
|
4253
|
-
var
|
|
4320
|
+
var import_node_path39 = require("path");
|
|
4254
4321
|
|
|
4255
4322
|
// src/features/mcp/modular-mcp.ts
|
|
4256
|
-
var
|
|
4323
|
+
var import_node_path37 = require("path");
|
|
4257
4324
|
var import_mini17 = require("zod/mini");
|
|
4258
4325
|
|
|
4259
4326
|
// src/types/mcp.ts
|
|
@@ -4341,7 +4408,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
4341
4408
|
args: [
|
|
4342
4409
|
"-y",
|
|
4343
4410
|
"@kimuson/modular-mcp",
|
|
4344
|
-
(0,
|
|
4411
|
+
(0, import_node_path37.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4345
4412
|
],
|
|
4346
4413
|
env: {}
|
|
4347
4414
|
}
|
|
@@ -4379,7 +4446,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
4379
4446
|
|
|
4380
4447
|
// src/features/mcp/rulesync-mcp.ts
|
|
4381
4448
|
var import_object = require("es-toolkit/object");
|
|
4382
|
-
var
|
|
4449
|
+
var import_node_path38 = require("path");
|
|
4383
4450
|
var import_mini18 = require("zod/mini");
|
|
4384
4451
|
var RulesyncMcpServerSchema = import_mini18.z.union([
|
|
4385
4452
|
import_mini18.z.extend(McpServerSchema, {
|
|
@@ -4435,12 +4502,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
4435
4502
|
}) {
|
|
4436
4503
|
const baseDir = process.cwd();
|
|
4437
4504
|
const paths = this.getSettablePaths();
|
|
4438
|
-
const recommendedPath = (0,
|
|
4505
|
+
const recommendedPath = (0, import_node_path38.join)(
|
|
4439
4506
|
baseDir,
|
|
4440
4507
|
paths.recommended.relativeDirPath,
|
|
4441
4508
|
paths.recommended.relativeFilePath
|
|
4442
4509
|
);
|
|
4443
|
-
const legacyPath = (0,
|
|
4510
|
+
const legacyPath = (0, import_node_path38.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
4444
4511
|
if (await fileExists(recommendedPath)) {
|
|
4445
4512
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
4446
4513
|
return new _RulesyncMcp({
|
|
@@ -4584,7 +4651,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
4584
4651
|
}) {
|
|
4585
4652
|
const paths = this.getSettablePaths({ global });
|
|
4586
4653
|
const fileContent = await readOrInitializeFileContent(
|
|
4587
|
-
(0,
|
|
4654
|
+
(0, import_node_path39.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4588
4655
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4589
4656
|
);
|
|
4590
4657
|
const json = JSON.parse(fileContent);
|
|
@@ -4606,7 +4673,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
4606
4673
|
}) {
|
|
4607
4674
|
const paths = this.getSettablePaths({ global });
|
|
4608
4675
|
const fileContent = await readOrInitializeFileContent(
|
|
4609
|
-
(0,
|
|
4676
|
+
(0, import_node_path39.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4610
4677
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4611
4678
|
);
|
|
4612
4679
|
const json = JSON.parse(fileContent);
|
|
@@ -4656,7 +4723,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
4656
4723
|
};
|
|
4657
4724
|
|
|
4658
4725
|
// src/features/mcp/cline-mcp.ts
|
|
4659
|
-
var
|
|
4726
|
+
var import_node_path40 = require("path");
|
|
4660
4727
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
4661
4728
|
json;
|
|
4662
4729
|
constructor(params) {
|
|
@@ -4677,7 +4744,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
4677
4744
|
validate = true
|
|
4678
4745
|
}) {
|
|
4679
4746
|
const fileContent = await readFileContent(
|
|
4680
|
-
(0,
|
|
4747
|
+
(0, import_node_path40.join)(
|
|
4681
4748
|
baseDir,
|
|
4682
4749
|
this.getSettablePaths().relativeDirPath,
|
|
4683
4750
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4726,7 +4793,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
4726
4793
|
};
|
|
4727
4794
|
|
|
4728
4795
|
// src/features/mcp/codexcli-mcp.ts
|
|
4729
|
-
var
|
|
4796
|
+
var import_node_path41 = require("path");
|
|
4730
4797
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
4731
4798
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
4732
4799
|
toml;
|
|
@@ -4762,7 +4829,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4762
4829
|
}) {
|
|
4763
4830
|
const paths = this.getSettablePaths({ global });
|
|
4764
4831
|
const fileContent = await readFileContent(
|
|
4765
|
-
(0,
|
|
4832
|
+
(0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4766
4833
|
);
|
|
4767
4834
|
return new _CodexcliMcp({
|
|
4768
4835
|
baseDir,
|
|
@@ -4779,7 +4846,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4779
4846
|
global = false
|
|
4780
4847
|
}) {
|
|
4781
4848
|
const paths = this.getSettablePaths({ global });
|
|
4782
|
-
const configTomlFilePath = (0,
|
|
4849
|
+
const configTomlFilePath = (0, import_node_path41.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4783
4850
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
4784
4851
|
configTomlFilePath,
|
|
4785
4852
|
smolToml.stringify({})
|
|
@@ -4833,7 +4900,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4833
4900
|
};
|
|
4834
4901
|
|
|
4835
4902
|
// src/features/mcp/copilot-mcp.ts
|
|
4836
|
-
var
|
|
4903
|
+
var import_node_path42 = require("path");
|
|
4837
4904
|
function convertToCopilotFormat(mcpServers) {
|
|
4838
4905
|
return { servers: mcpServers };
|
|
4839
4906
|
}
|
|
@@ -4860,7 +4927,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
4860
4927
|
validate = true
|
|
4861
4928
|
}) {
|
|
4862
4929
|
const fileContent = await readFileContent(
|
|
4863
|
-
(0,
|
|
4930
|
+
(0, import_node_path42.join)(
|
|
4864
4931
|
baseDir,
|
|
4865
4932
|
this.getSettablePaths().relativeDirPath,
|
|
4866
4933
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4913,7 +4980,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
4913
4980
|
};
|
|
4914
4981
|
|
|
4915
4982
|
// src/features/mcp/cursor-mcp.ts
|
|
4916
|
-
var
|
|
4983
|
+
var import_node_path43 = require("path");
|
|
4917
4984
|
var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
|
|
4918
4985
|
function isMcpServers(value) {
|
|
4919
4986
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
@@ -4974,7 +5041,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
4974
5041
|
validate = true
|
|
4975
5042
|
}) {
|
|
4976
5043
|
const fileContent = await readFileContent(
|
|
4977
|
-
(0,
|
|
5044
|
+
(0, import_node_path43.join)(
|
|
4978
5045
|
baseDir,
|
|
4979
5046
|
this.getSettablePaths().relativeDirPath,
|
|
4980
5047
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5041,8 +5108,89 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
5041
5108
|
}
|
|
5042
5109
|
};
|
|
5043
5110
|
|
|
5111
|
+
// src/features/mcp/factorydroid-mcp.ts
|
|
5112
|
+
var import_node_path44 = require("path");
|
|
5113
|
+
var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
|
|
5114
|
+
json;
|
|
5115
|
+
constructor(params) {
|
|
5116
|
+
super(params);
|
|
5117
|
+
this.json = this.fileContent !== void 0 ? JSON.parse(this.fileContent) : {};
|
|
5118
|
+
}
|
|
5119
|
+
getJson() {
|
|
5120
|
+
return this.json;
|
|
5121
|
+
}
|
|
5122
|
+
static getSettablePaths() {
|
|
5123
|
+
return {
|
|
5124
|
+
relativeDirPath: ".factorydroid",
|
|
5125
|
+
relativeFilePath: "mcp.json"
|
|
5126
|
+
};
|
|
5127
|
+
}
|
|
5128
|
+
static async fromFile({
|
|
5129
|
+
baseDir = process.cwd(),
|
|
5130
|
+
validate = true
|
|
5131
|
+
}) {
|
|
5132
|
+
const fileContent = await readFileContent(
|
|
5133
|
+
(0, import_node_path44.join)(
|
|
5134
|
+
baseDir,
|
|
5135
|
+
this.getSettablePaths().relativeDirPath,
|
|
5136
|
+
this.getSettablePaths().relativeFilePath
|
|
5137
|
+
)
|
|
5138
|
+
);
|
|
5139
|
+
return new _FactorydroidMcp({
|
|
5140
|
+
baseDir,
|
|
5141
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
5142
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
5143
|
+
fileContent,
|
|
5144
|
+
validate
|
|
5145
|
+
});
|
|
5146
|
+
}
|
|
5147
|
+
static fromRulesyncMcp({
|
|
5148
|
+
baseDir = process.cwd(),
|
|
5149
|
+
rulesyncMcp,
|
|
5150
|
+
validate = true
|
|
5151
|
+
}) {
|
|
5152
|
+
const json = rulesyncMcp.getJson();
|
|
5153
|
+
const factorydroidConfig = {
|
|
5154
|
+
mcpServers: json.mcpServers || {}
|
|
5155
|
+
};
|
|
5156
|
+
const fileContent = JSON.stringify(factorydroidConfig, null, 2);
|
|
5157
|
+
return new _FactorydroidMcp({
|
|
5158
|
+
baseDir,
|
|
5159
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
5160
|
+
relativeFilePath: this.getSettablePaths().relativeFilePath,
|
|
5161
|
+
fileContent,
|
|
5162
|
+
validate
|
|
5163
|
+
});
|
|
5164
|
+
}
|
|
5165
|
+
toRulesyncMcp() {
|
|
5166
|
+
return new RulesyncMcp({
|
|
5167
|
+
baseDir: this.baseDir,
|
|
5168
|
+
relativeDirPath: this.relativeDirPath,
|
|
5169
|
+
relativeFilePath: "rulesync.mcp.json",
|
|
5170
|
+
fileContent: JSON.stringify(this.json),
|
|
5171
|
+
validate: true
|
|
5172
|
+
});
|
|
5173
|
+
}
|
|
5174
|
+
validate() {
|
|
5175
|
+
return { success: true, error: null };
|
|
5176
|
+
}
|
|
5177
|
+
static forDeletion({
|
|
5178
|
+
baseDir = process.cwd(),
|
|
5179
|
+
relativeDirPath,
|
|
5180
|
+
relativeFilePath
|
|
5181
|
+
}) {
|
|
5182
|
+
return new _FactorydroidMcp({
|
|
5183
|
+
baseDir,
|
|
5184
|
+
relativeDirPath,
|
|
5185
|
+
relativeFilePath,
|
|
5186
|
+
fileContent: "{}",
|
|
5187
|
+
validate: false
|
|
5188
|
+
});
|
|
5189
|
+
}
|
|
5190
|
+
};
|
|
5191
|
+
|
|
5044
5192
|
// src/features/mcp/geminicli-mcp.ts
|
|
5045
|
-
var
|
|
5193
|
+
var import_node_path45 = require("path");
|
|
5046
5194
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
5047
5195
|
json;
|
|
5048
5196
|
constructor(params) {
|
|
@@ -5071,7 +5219,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5071
5219
|
}) {
|
|
5072
5220
|
const paths = this.getSettablePaths({ global });
|
|
5073
5221
|
const fileContent = await readOrInitializeFileContent(
|
|
5074
|
-
(0,
|
|
5222
|
+
(0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5075
5223
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5076
5224
|
);
|
|
5077
5225
|
const json = JSON.parse(fileContent);
|
|
@@ -5092,7 +5240,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5092
5240
|
}) {
|
|
5093
5241
|
const paths = this.getSettablePaths({ global });
|
|
5094
5242
|
const fileContent = await readOrInitializeFileContent(
|
|
5095
|
-
(0,
|
|
5243
|
+
(0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5096
5244
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5097
5245
|
);
|
|
5098
5246
|
const json = JSON.parse(fileContent);
|
|
@@ -5137,7 +5285,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
5137
5285
|
};
|
|
5138
5286
|
|
|
5139
5287
|
// src/features/mcp/junie-mcp.ts
|
|
5140
|
-
var
|
|
5288
|
+
var import_node_path46 = require("path");
|
|
5141
5289
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
5142
5290
|
json;
|
|
5143
5291
|
constructor(params) {
|
|
@@ -5149,7 +5297,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5149
5297
|
}
|
|
5150
5298
|
static getSettablePaths() {
|
|
5151
5299
|
return {
|
|
5152
|
-
relativeDirPath: (0,
|
|
5300
|
+
relativeDirPath: (0, import_node_path46.join)(".junie", "mcp"),
|
|
5153
5301
|
relativeFilePath: "mcp.json"
|
|
5154
5302
|
};
|
|
5155
5303
|
}
|
|
@@ -5158,7 +5306,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5158
5306
|
validate = true
|
|
5159
5307
|
}) {
|
|
5160
5308
|
const fileContent = await readFileContent(
|
|
5161
|
-
(0,
|
|
5309
|
+
(0, import_node_path46.join)(
|
|
5162
5310
|
baseDir,
|
|
5163
5311
|
this.getSettablePaths().relativeDirPath,
|
|
5164
5312
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5207,7 +5355,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
5207
5355
|
};
|
|
5208
5356
|
|
|
5209
5357
|
// src/features/mcp/kilo-mcp.ts
|
|
5210
|
-
var
|
|
5358
|
+
var import_node_path47 = require("path");
|
|
5211
5359
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
5212
5360
|
json;
|
|
5213
5361
|
constructor(params) {
|
|
@@ -5229,7 +5377,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
5229
5377
|
}) {
|
|
5230
5378
|
const paths = this.getSettablePaths();
|
|
5231
5379
|
const fileContent = await readOrInitializeFileContent(
|
|
5232
|
-
(0,
|
|
5380
|
+
(0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5233
5381
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5234
5382
|
);
|
|
5235
5383
|
return new _KiloMcp({
|
|
@@ -5283,7 +5431,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
5283
5431
|
};
|
|
5284
5432
|
|
|
5285
5433
|
// src/features/mcp/kiro-mcp.ts
|
|
5286
|
-
var
|
|
5434
|
+
var import_node_path48 = require("path");
|
|
5287
5435
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
5288
5436
|
json;
|
|
5289
5437
|
constructor(params) {
|
|
@@ -5295,7 +5443,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
5295
5443
|
}
|
|
5296
5444
|
static getSettablePaths() {
|
|
5297
5445
|
return {
|
|
5298
|
-
relativeDirPath: (0,
|
|
5446
|
+
relativeDirPath: (0, import_node_path48.join)(".kiro", "settings"),
|
|
5299
5447
|
relativeFilePath: "mcp.json"
|
|
5300
5448
|
};
|
|
5301
5449
|
}
|
|
@@ -5305,7 +5453,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
5305
5453
|
}) {
|
|
5306
5454
|
const paths = this.getSettablePaths();
|
|
5307
5455
|
const fileContent = await readOrInitializeFileContent(
|
|
5308
|
-
(0,
|
|
5456
|
+
(0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5309
5457
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
5310
5458
|
);
|
|
5311
5459
|
return new _KiroMcp({
|
|
@@ -5359,7 +5507,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
5359
5507
|
};
|
|
5360
5508
|
|
|
5361
5509
|
// src/features/mcp/opencode-mcp.ts
|
|
5362
|
-
var
|
|
5510
|
+
var import_node_path49 = require("path");
|
|
5363
5511
|
var import_mini19 = require("zod/mini");
|
|
5364
5512
|
var OpencodeMcpLocalServerSchema = import_mini19.z.object({
|
|
5365
5513
|
type: import_mini19.z.literal("local"),
|
|
@@ -5483,7 +5631,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
5483
5631
|
}) {
|
|
5484
5632
|
const paths = this.getSettablePaths({ global });
|
|
5485
5633
|
const fileContent = await readOrInitializeFileContent(
|
|
5486
|
-
(0,
|
|
5634
|
+
(0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5487
5635
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
5488
5636
|
);
|
|
5489
5637
|
const json = JSON.parse(fileContent);
|
|
@@ -5504,7 +5652,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
5504
5652
|
}) {
|
|
5505
5653
|
const paths = this.getSettablePaths({ global });
|
|
5506
5654
|
const fileContent = await readOrInitializeFileContent(
|
|
5507
|
-
(0,
|
|
5655
|
+
(0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
5508
5656
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
5509
5657
|
);
|
|
5510
5658
|
const json = JSON.parse(fileContent);
|
|
@@ -5550,7 +5698,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
5550
5698
|
};
|
|
5551
5699
|
|
|
5552
5700
|
// src/features/mcp/roo-mcp.ts
|
|
5553
|
-
var
|
|
5701
|
+
var import_node_path50 = require("path");
|
|
5554
5702
|
function isRooMcpServers(value) {
|
|
5555
5703
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
5556
5704
|
}
|
|
@@ -5602,7 +5750,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
5602
5750
|
validate = true
|
|
5603
5751
|
}) {
|
|
5604
5752
|
const fileContent = await readFileContent(
|
|
5605
|
-
(0,
|
|
5753
|
+
(0, import_node_path50.join)(
|
|
5606
5754
|
baseDir,
|
|
5607
5755
|
this.getSettablePaths().relativeDirPath,
|
|
5608
5756
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5665,6 +5813,7 @@ var mcpProcessorToolTargetTuple = [
|
|
|
5665
5813
|
"codexcli",
|
|
5666
5814
|
"copilot",
|
|
5667
5815
|
"cursor",
|
|
5816
|
+
"factorydroid",
|
|
5668
5817
|
"geminicli",
|
|
5669
5818
|
"kilo",
|
|
5670
5819
|
"kiro",
|
|
@@ -5716,6 +5865,13 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
|
|
|
5716
5865
|
meta: { supportsProject: true, supportsGlobal: false, supportsModular: false }
|
|
5717
5866
|
}
|
|
5718
5867
|
],
|
|
5868
|
+
[
|
|
5869
|
+
"factorydroid",
|
|
5870
|
+
{
|
|
5871
|
+
class: FactorydroidMcp,
|
|
5872
|
+
meta: { supportsProject: true, supportsGlobal: true, supportsModular: false }
|
|
5873
|
+
}
|
|
5874
|
+
],
|
|
5719
5875
|
[
|
|
5720
5876
|
"geminicli",
|
|
5721
5877
|
{
|
|
@@ -5917,24 +6073,24 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
5917
6073
|
|
|
5918
6074
|
// src/features/rules/rules-processor.ts
|
|
5919
6075
|
var import_toon = require("@toon-format/toon");
|
|
5920
|
-
var
|
|
6076
|
+
var import_node_path106 = require("path");
|
|
5921
6077
|
var import_mini48 = require("zod/mini");
|
|
5922
6078
|
|
|
5923
6079
|
// src/constants/general.ts
|
|
5924
6080
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
5925
6081
|
|
|
5926
6082
|
// src/features/skills/agentsmd-skill.ts
|
|
5927
|
-
var
|
|
6083
|
+
var import_node_path54 = require("path");
|
|
5928
6084
|
|
|
5929
6085
|
// src/features/skills/simulated-skill.ts
|
|
5930
|
-
var
|
|
6086
|
+
var import_node_path53 = require("path");
|
|
5931
6087
|
var import_mini21 = require("zod/mini");
|
|
5932
6088
|
|
|
5933
6089
|
// src/features/skills/tool-skill.ts
|
|
5934
|
-
var
|
|
6090
|
+
var import_node_path52 = require("path");
|
|
5935
6091
|
|
|
5936
6092
|
// src/types/ai-dir.ts
|
|
5937
|
-
var
|
|
6093
|
+
var import_node_path51 = __toESM(require("path"), 1);
|
|
5938
6094
|
var AiDir = class {
|
|
5939
6095
|
/**
|
|
5940
6096
|
* @example "."
|
|
@@ -5968,7 +6124,7 @@ var AiDir = class {
|
|
|
5968
6124
|
otherFiles = [],
|
|
5969
6125
|
global = false
|
|
5970
6126
|
}) {
|
|
5971
|
-
if (dirName.includes(
|
|
6127
|
+
if (dirName.includes(import_node_path51.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
5972
6128
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
5973
6129
|
}
|
|
5974
6130
|
this.baseDir = baseDir;
|
|
@@ -5991,11 +6147,11 @@ var AiDir = class {
|
|
|
5991
6147
|
return this.dirName;
|
|
5992
6148
|
}
|
|
5993
6149
|
getDirPath() {
|
|
5994
|
-
const fullPath =
|
|
5995
|
-
const resolvedFull = (0,
|
|
5996
|
-
const resolvedBase = (0,
|
|
5997
|
-
const rel = (0,
|
|
5998
|
-
if (rel.startsWith("..") ||
|
|
6150
|
+
const fullPath = import_node_path51.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
6151
|
+
const resolvedFull = (0, import_node_path51.resolve)(fullPath);
|
|
6152
|
+
const resolvedBase = (0, import_node_path51.resolve)(this.baseDir);
|
|
6153
|
+
const rel = (0, import_node_path51.relative)(resolvedBase, resolvedFull);
|
|
6154
|
+
if (rel.startsWith("..") || import_node_path51.default.isAbsolute(rel)) {
|
|
5999
6155
|
throw new Error(
|
|
6000
6156
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
6001
6157
|
);
|
|
@@ -6009,7 +6165,7 @@ var AiDir = class {
|
|
|
6009
6165
|
return this.otherFiles;
|
|
6010
6166
|
}
|
|
6011
6167
|
getRelativePathFromCwd() {
|
|
6012
|
-
return
|
|
6168
|
+
return import_node_path51.default.join(this.relativeDirPath, this.dirName);
|
|
6013
6169
|
}
|
|
6014
6170
|
getGlobal() {
|
|
6015
6171
|
return this.global;
|
|
@@ -6028,15 +6184,15 @@ var AiDir = class {
|
|
|
6028
6184
|
* @returns Array of files with their relative paths and buffers
|
|
6029
6185
|
*/
|
|
6030
6186
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
6031
|
-
const dirPath = (0,
|
|
6032
|
-
const glob = (0,
|
|
6187
|
+
const dirPath = (0, import_node_path51.join)(baseDir, relativeDirPath, dirName);
|
|
6188
|
+
const glob = (0, import_node_path51.join)(dirPath, "**", "*");
|
|
6033
6189
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
6034
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
6190
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path51.basename)(filePath) !== excludeFileName);
|
|
6035
6191
|
const files = await Promise.all(
|
|
6036
6192
|
filteredPaths.map(async (filePath) => {
|
|
6037
6193
|
const fileBuffer = await readFileBuffer(filePath);
|
|
6038
6194
|
return {
|
|
6039
|
-
relativeFilePathToDirPath: (0,
|
|
6195
|
+
relativeFilePathToDirPath: (0, import_node_path51.relative)(dirPath, filePath),
|
|
6040
6196
|
fileBuffer
|
|
6041
6197
|
};
|
|
6042
6198
|
})
|
|
@@ -6127,8 +6283,8 @@ var ToolSkill = class extends AiDir {
|
|
|
6127
6283
|
}) {
|
|
6128
6284
|
const settablePaths = getSettablePaths({ global });
|
|
6129
6285
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
6130
|
-
const skillDirPath = (0,
|
|
6131
|
-
const skillFilePath = (0,
|
|
6286
|
+
const skillDirPath = (0, import_node_path52.join)(baseDir, actualRelativeDirPath, dirName);
|
|
6287
|
+
const skillFilePath = (0, import_node_path52.join)(skillDirPath, SKILL_FILE_NAME);
|
|
6132
6288
|
if (!await fileExists(skillFilePath)) {
|
|
6133
6289
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
6134
6290
|
}
|
|
@@ -6186,7 +6342,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
6186
6342
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
6187
6343
|
if (!result.success) {
|
|
6188
6344
|
throw new Error(
|
|
6189
|
-
`Invalid frontmatter in ${(0,
|
|
6345
|
+
`Invalid frontmatter in ${(0, import_node_path53.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
6190
6346
|
);
|
|
6191
6347
|
}
|
|
6192
6348
|
}
|
|
@@ -6244,8 +6400,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
6244
6400
|
}) {
|
|
6245
6401
|
const settablePaths = this.getSettablePaths();
|
|
6246
6402
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
6247
|
-
const skillDirPath = (0,
|
|
6248
|
-
const skillFilePath = (0,
|
|
6403
|
+
const skillDirPath = (0, import_node_path53.join)(baseDir, actualRelativeDirPath, dirName);
|
|
6404
|
+
const skillFilePath = (0, import_node_path53.join)(skillDirPath, SKILL_FILE_NAME);
|
|
6249
6405
|
if (!await fileExists(skillFilePath)) {
|
|
6250
6406
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
6251
6407
|
}
|
|
@@ -6322,7 +6478,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
6322
6478
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
6323
6479
|
}
|
|
6324
6480
|
return {
|
|
6325
|
-
relativeDirPath: (0,
|
|
6481
|
+
relativeDirPath: (0, import_node_path54.join)(".agents", "skills")
|
|
6326
6482
|
};
|
|
6327
6483
|
}
|
|
6328
6484
|
static async fromDir(params) {
|
|
@@ -6348,15 +6504,46 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
6348
6504
|
}
|
|
6349
6505
|
};
|
|
6350
6506
|
|
|
6507
|
+
// src/features/skills/factorydroid-skill.ts
|
|
6508
|
+
var import_node_path55 = require("path");
|
|
6509
|
+
var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
|
|
6510
|
+
static getSettablePaths(_options) {
|
|
6511
|
+
return {
|
|
6512
|
+
relativeDirPath: (0, import_node_path55.join)(".factorydroid", "skills")
|
|
6513
|
+
};
|
|
6514
|
+
}
|
|
6515
|
+
static async fromDir(params) {
|
|
6516
|
+
const baseParams = await this.fromDirDefault(params);
|
|
6517
|
+
return new _FactorydroidSkill(baseParams);
|
|
6518
|
+
}
|
|
6519
|
+
static fromRulesyncSkill(params) {
|
|
6520
|
+
const baseParams = {
|
|
6521
|
+
...this.fromRulesyncSkillDefault(params),
|
|
6522
|
+
relativeDirPath: this.getSettablePaths().relativeDirPath
|
|
6523
|
+
};
|
|
6524
|
+
return new _FactorydroidSkill(baseParams);
|
|
6525
|
+
}
|
|
6526
|
+
static isTargetedByRulesyncSkill(rulesyncSkill) {
|
|
6527
|
+
return this.isTargetedByRulesyncSkillDefault({
|
|
6528
|
+
rulesyncSkill,
|
|
6529
|
+
toolTarget: "factorydroid"
|
|
6530
|
+
});
|
|
6531
|
+
}
|
|
6532
|
+
static forDeletion(params) {
|
|
6533
|
+
const baseParams = this.forDeletionDefault(params);
|
|
6534
|
+
return new _FactorydroidSkill(baseParams);
|
|
6535
|
+
}
|
|
6536
|
+
};
|
|
6537
|
+
|
|
6351
6538
|
// src/features/skills/geminicli-skill.ts
|
|
6352
|
-
var
|
|
6539
|
+
var import_node_path56 = require("path");
|
|
6353
6540
|
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
6354
6541
|
static getSettablePaths(options) {
|
|
6355
6542
|
if (options?.global) {
|
|
6356
6543
|
throw new Error("GeminiCliSkill does not support global mode.");
|
|
6357
6544
|
}
|
|
6358
6545
|
return {
|
|
6359
|
-
relativeDirPath: (0,
|
|
6546
|
+
relativeDirPath: (0, import_node_path56.join)(".gemini", "skills")
|
|
6360
6547
|
};
|
|
6361
6548
|
}
|
|
6362
6549
|
static async fromDir(params) {
|
|
@@ -6383,11 +6570,11 @@ var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
|
6383
6570
|
};
|
|
6384
6571
|
|
|
6385
6572
|
// src/features/skills/skills-processor.ts
|
|
6386
|
-
var
|
|
6573
|
+
var import_node_path69 = require("path");
|
|
6387
6574
|
var import_mini33 = require("zod/mini");
|
|
6388
6575
|
|
|
6389
6576
|
// src/types/dir-feature-processor.ts
|
|
6390
|
-
var
|
|
6577
|
+
var import_node_path57 = require("path");
|
|
6391
6578
|
var DirFeatureProcessor = class {
|
|
6392
6579
|
baseDir;
|
|
6393
6580
|
constructor({ baseDir = process.cwd() }) {
|
|
@@ -6409,14 +6596,14 @@ var DirFeatureProcessor = class {
|
|
|
6409
6596
|
await ensureDir(dirPath);
|
|
6410
6597
|
const mainFile = aiDir.getMainFile();
|
|
6411
6598
|
if (mainFile) {
|
|
6412
|
-
const mainFilePath = (0,
|
|
6599
|
+
const mainFilePath = (0, import_node_path57.join)(dirPath, mainFile.name);
|
|
6413
6600
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
6414
6601
|
const contentWithNewline = addTrailingNewline(content);
|
|
6415
6602
|
await writeFileContent(mainFilePath, contentWithNewline);
|
|
6416
6603
|
}
|
|
6417
6604
|
const otherFiles = aiDir.getOtherFiles();
|
|
6418
6605
|
for (const file of otherFiles) {
|
|
6419
|
-
const filePath = (0,
|
|
6606
|
+
const filePath = (0, import_node_path57.join)(dirPath, file.relativeFilePathToDirPath);
|
|
6420
6607
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
6421
6608
|
await writeFileContent(filePath, contentWithNewline);
|
|
6422
6609
|
}
|
|
@@ -6431,11 +6618,11 @@ var DirFeatureProcessor = class {
|
|
|
6431
6618
|
};
|
|
6432
6619
|
|
|
6433
6620
|
// src/features/skills/antigravity-skill.ts
|
|
6434
|
-
var
|
|
6621
|
+
var import_node_path59 = require("path");
|
|
6435
6622
|
var import_mini23 = require("zod/mini");
|
|
6436
6623
|
|
|
6437
6624
|
// src/features/skills/rulesync-skill.ts
|
|
6438
|
-
var
|
|
6625
|
+
var import_node_path58 = require("path");
|
|
6439
6626
|
var import_mini22 = require("zod/mini");
|
|
6440
6627
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini22.z.looseObject({
|
|
6441
6628
|
name: import_mini22.z.string(),
|
|
@@ -6527,8 +6714,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
6527
6714
|
dirName,
|
|
6528
6715
|
global = false
|
|
6529
6716
|
}) {
|
|
6530
|
-
const skillDirPath = (0,
|
|
6531
|
-
const skillFilePath = (0,
|
|
6717
|
+
const skillDirPath = (0, import_node_path58.join)(baseDir, relativeDirPath, dirName);
|
|
6718
|
+
const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
|
|
6532
6719
|
if (!await fileExists(skillFilePath)) {
|
|
6533
6720
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
6534
6721
|
}
|
|
@@ -6565,7 +6752,7 @@ var AntigravitySkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
|
6565
6752
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
6566
6753
|
constructor({
|
|
6567
6754
|
baseDir = process.cwd(),
|
|
6568
|
-
relativeDirPath = (0,
|
|
6755
|
+
relativeDirPath = (0, import_node_path59.join)(".agent", "skills"),
|
|
6569
6756
|
dirName,
|
|
6570
6757
|
frontmatter,
|
|
6571
6758
|
body,
|
|
@@ -6597,11 +6784,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6597
6784
|
} = {}) {
|
|
6598
6785
|
if (global) {
|
|
6599
6786
|
return {
|
|
6600
|
-
relativeDirPath: (0,
|
|
6787
|
+
relativeDirPath: (0, import_node_path59.join)(".gemini", "antigravity", "skills")
|
|
6601
6788
|
};
|
|
6602
6789
|
}
|
|
6603
6790
|
return {
|
|
6604
|
-
relativeDirPath: (0,
|
|
6791
|
+
relativeDirPath: (0, import_node_path59.join)(".agent", "skills")
|
|
6605
6792
|
};
|
|
6606
6793
|
}
|
|
6607
6794
|
getFrontmatter() {
|
|
@@ -6683,9 +6870,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6683
6870
|
});
|
|
6684
6871
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6685
6872
|
if (!result.success) {
|
|
6686
|
-
const skillDirPath = (0,
|
|
6873
|
+
const skillDirPath = (0, import_node_path59.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6687
6874
|
throw new Error(
|
|
6688
|
-
`Invalid frontmatter in ${(0,
|
|
6875
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6689
6876
|
);
|
|
6690
6877
|
}
|
|
6691
6878
|
return new _AntigravitySkill({
|
|
@@ -6719,7 +6906,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
6719
6906
|
};
|
|
6720
6907
|
|
|
6721
6908
|
// src/features/skills/claudecode-skill.ts
|
|
6722
|
-
var
|
|
6909
|
+
var import_node_path60 = require("path");
|
|
6723
6910
|
var import_mini24 = require("zod/mini");
|
|
6724
6911
|
var ClaudecodeSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
6725
6912
|
name: import_mini24.z.string(),
|
|
@@ -6729,7 +6916,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
|
6729
6916
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
6730
6917
|
constructor({
|
|
6731
6918
|
baseDir = process.cwd(),
|
|
6732
|
-
relativeDirPath = (0,
|
|
6919
|
+
relativeDirPath = (0, import_node_path60.join)(".claude", "skills"),
|
|
6733
6920
|
dirName,
|
|
6734
6921
|
frontmatter,
|
|
6735
6922
|
body,
|
|
@@ -6760,7 +6947,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6760
6947
|
global: _global = false
|
|
6761
6948
|
} = {}) {
|
|
6762
6949
|
return {
|
|
6763
|
-
relativeDirPath: (0,
|
|
6950
|
+
relativeDirPath: (0, import_node_path60.join)(".claude", "skills")
|
|
6764
6951
|
};
|
|
6765
6952
|
}
|
|
6766
6953
|
getFrontmatter() {
|
|
@@ -6848,9 +7035,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6848
7035
|
});
|
|
6849
7036
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6850
7037
|
if (!result.success) {
|
|
6851
|
-
const skillDirPath = (0,
|
|
7038
|
+
const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6852
7039
|
throw new Error(
|
|
6853
|
-
`Invalid frontmatter in ${(0,
|
|
7040
|
+
`Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6854
7041
|
);
|
|
6855
7042
|
}
|
|
6856
7043
|
return new _ClaudecodeSkill({
|
|
@@ -6884,7 +7071,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6884
7071
|
};
|
|
6885
7072
|
|
|
6886
7073
|
// src/features/skills/codexcli-skill.ts
|
|
6887
|
-
var
|
|
7074
|
+
var import_node_path61 = require("path");
|
|
6888
7075
|
var import_mini25 = require("zod/mini");
|
|
6889
7076
|
var CodexCliSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
6890
7077
|
name: import_mini25.z.string(),
|
|
@@ -6898,7 +7085,7 @@ var CodexCliSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
|
6898
7085
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
6899
7086
|
constructor({
|
|
6900
7087
|
baseDir = process.cwd(),
|
|
6901
|
-
relativeDirPath = (0,
|
|
7088
|
+
relativeDirPath = (0, import_node_path61.join)(".codex", "skills"),
|
|
6902
7089
|
dirName,
|
|
6903
7090
|
frontmatter,
|
|
6904
7091
|
body,
|
|
@@ -6929,7 +7116,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
6929
7116
|
global: _global = false
|
|
6930
7117
|
} = {}) {
|
|
6931
7118
|
return {
|
|
6932
|
-
relativeDirPath: (0,
|
|
7119
|
+
relativeDirPath: (0, import_node_path61.join)(".codex", "skills")
|
|
6933
7120
|
};
|
|
6934
7121
|
}
|
|
6935
7122
|
getFrontmatter() {
|
|
@@ -7021,9 +7208,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7021
7208
|
});
|
|
7022
7209
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7023
7210
|
if (!result.success) {
|
|
7024
|
-
const skillDirPath = (0,
|
|
7211
|
+
const skillDirPath = (0, import_node_path61.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7025
7212
|
throw new Error(
|
|
7026
|
-
`Invalid frontmatter in ${(0,
|
|
7213
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7027
7214
|
);
|
|
7028
7215
|
}
|
|
7029
7216
|
return new _CodexCliSkill({
|
|
@@ -7057,7 +7244,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
7057
7244
|
};
|
|
7058
7245
|
|
|
7059
7246
|
// src/features/skills/copilot-skill.ts
|
|
7060
|
-
var
|
|
7247
|
+
var import_node_path62 = require("path");
|
|
7061
7248
|
var import_mini26 = require("zod/mini");
|
|
7062
7249
|
var CopilotSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
7063
7250
|
name: import_mini26.z.string(),
|
|
@@ -7067,7 +7254,7 @@ var CopilotSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
|
7067
7254
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
7068
7255
|
constructor({
|
|
7069
7256
|
baseDir = process.cwd(),
|
|
7070
|
-
relativeDirPath = (0,
|
|
7257
|
+
relativeDirPath = (0, import_node_path62.join)(".github", "skills"),
|
|
7071
7258
|
dirName,
|
|
7072
7259
|
frontmatter,
|
|
7073
7260
|
body,
|
|
@@ -7099,7 +7286,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7099
7286
|
throw new Error("CopilotSkill does not support global mode.");
|
|
7100
7287
|
}
|
|
7101
7288
|
return {
|
|
7102
|
-
relativeDirPath: (0,
|
|
7289
|
+
relativeDirPath: (0, import_node_path62.join)(".github", "skills")
|
|
7103
7290
|
};
|
|
7104
7291
|
}
|
|
7105
7292
|
getFrontmatter() {
|
|
@@ -7187,9 +7374,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7187
7374
|
});
|
|
7188
7375
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7189
7376
|
if (!result.success) {
|
|
7190
|
-
const skillDirPath = (0,
|
|
7377
|
+
const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7191
7378
|
throw new Error(
|
|
7192
|
-
`Invalid frontmatter in ${(0,
|
|
7379
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7193
7380
|
);
|
|
7194
7381
|
}
|
|
7195
7382
|
return new _CopilotSkill({
|
|
@@ -7224,7 +7411,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
7224
7411
|
};
|
|
7225
7412
|
|
|
7226
7413
|
// src/features/skills/cursor-skill.ts
|
|
7227
|
-
var
|
|
7414
|
+
var import_node_path63 = require("path");
|
|
7228
7415
|
var import_mini27 = require("zod/mini");
|
|
7229
7416
|
var CursorSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
7230
7417
|
name: import_mini27.z.string(),
|
|
@@ -7233,7 +7420,7 @@ var CursorSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
|
7233
7420
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
7234
7421
|
constructor({
|
|
7235
7422
|
baseDir = process.cwd(),
|
|
7236
|
-
relativeDirPath = (0,
|
|
7423
|
+
relativeDirPath = (0, import_node_path63.join)(".cursor", "skills"),
|
|
7237
7424
|
dirName,
|
|
7238
7425
|
frontmatter,
|
|
7239
7426
|
body,
|
|
@@ -7262,7 +7449,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7262
7449
|
}
|
|
7263
7450
|
static getSettablePaths(_options) {
|
|
7264
7451
|
return {
|
|
7265
|
-
relativeDirPath: (0,
|
|
7452
|
+
relativeDirPath: (0, import_node_path63.join)(".cursor", "skills")
|
|
7266
7453
|
};
|
|
7267
7454
|
}
|
|
7268
7455
|
getFrontmatter() {
|
|
@@ -7344,9 +7531,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7344
7531
|
});
|
|
7345
7532
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7346
7533
|
if (!result.success) {
|
|
7347
|
-
const skillDirPath = (0,
|
|
7534
|
+
const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7348
7535
|
throw new Error(
|
|
7349
|
-
`Invalid frontmatter in ${(0,
|
|
7536
|
+
`Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7350
7537
|
);
|
|
7351
7538
|
}
|
|
7352
7539
|
return new _CursorSkill({
|
|
@@ -7381,7 +7568,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
7381
7568
|
};
|
|
7382
7569
|
|
|
7383
7570
|
// src/features/skills/kilo-skill.ts
|
|
7384
|
-
var
|
|
7571
|
+
var import_node_path64 = require("path");
|
|
7385
7572
|
var import_mini28 = require("zod/mini");
|
|
7386
7573
|
var KiloSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
7387
7574
|
name: import_mini28.z.string(),
|
|
@@ -7390,7 +7577,7 @@ var KiloSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
|
7390
7577
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
7391
7578
|
constructor({
|
|
7392
7579
|
baseDir = process.cwd(),
|
|
7393
|
-
relativeDirPath = (0,
|
|
7580
|
+
relativeDirPath = (0, import_node_path64.join)(".kilocode", "skills"),
|
|
7394
7581
|
dirName,
|
|
7395
7582
|
frontmatter,
|
|
7396
7583
|
body,
|
|
@@ -7421,7 +7608,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
7421
7608
|
global: _global = false
|
|
7422
7609
|
} = {}) {
|
|
7423
7610
|
return {
|
|
7424
|
-
relativeDirPath: (0,
|
|
7611
|
+
relativeDirPath: (0, import_node_path64.join)(".kilocode", "skills")
|
|
7425
7612
|
};
|
|
7426
7613
|
}
|
|
7427
7614
|
getFrontmatter() {
|
|
@@ -7511,13 +7698,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
7511
7698
|
});
|
|
7512
7699
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7513
7700
|
if (!result.success) {
|
|
7514
|
-
const skillDirPath = (0,
|
|
7701
|
+
const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7515
7702
|
throw new Error(
|
|
7516
|
-
`Invalid frontmatter in ${(0,
|
|
7703
|
+
`Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7517
7704
|
);
|
|
7518
7705
|
}
|
|
7519
7706
|
if (result.data.name !== loaded.dirName) {
|
|
7520
|
-
const skillFilePath = (0,
|
|
7707
|
+
const skillFilePath = (0, import_node_path64.join)(
|
|
7521
7708
|
loaded.baseDir,
|
|
7522
7709
|
loaded.relativeDirPath,
|
|
7523
7710
|
loaded.dirName,
|
|
@@ -7558,7 +7745,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
7558
7745
|
};
|
|
7559
7746
|
|
|
7560
7747
|
// src/features/skills/kiro-skill.ts
|
|
7561
|
-
var
|
|
7748
|
+
var import_node_path65 = require("path");
|
|
7562
7749
|
var import_mini29 = require("zod/mini");
|
|
7563
7750
|
var KiroSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
7564
7751
|
name: import_mini29.z.string(),
|
|
@@ -7567,7 +7754,7 @@ var KiroSkillFrontmatterSchema = import_mini29.z.looseObject({
|
|
|
7567
7754
|
var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
7568
7755
|
constructor({
|
|
7569
7756
|
baseDir = process.cwd(),
|
|
7570
|
-
relativeDirPath = (0,
|
|
7757
|
+
relativeDirPath = (0, import_node_path65.join)(".kiro", "skills"),
|
|
7571
7758
|
dirName,
|
|
7572
7759
|
frontmatter,
|
|
7573
7760
|
body,
|
|
@@ -7599,7 +7786,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
7599
7786
|
throw new Error("KiroSkill does not support global mode.");
|
|
7600
7787
|
}
|
|
7601
7788
|
return {
|
|
7602
|
-
relativeDirPath: (0,
|
|
7789
|
+
relativeDirPath: (0, import_node_path65.join)(".kiro", "skills")
|
|
7603
7790
|
};
|
|
7604
7791
|
}
|
|
7605
7792
|
getFrontmatter() {
|
|
@@ -7689,13 +7876,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
7689
7876
|
});
|
|
7690
7877
|
const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7691
7878
|
if (!result.success) {
|
|
7692
|
-
const skillDirPath = (0,
|
|
7879
|
+
const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7693
7880
|
throw new Error(
|
|
7694
|
-
`Invalid frontmatter in ${(0,
|
|
7881
|
+
`Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7695
7882
|
);
|
|
7696
7883
|
}
|
|
7697
7884
|
if (result.data.name !== loaded.dirName) {
|
|
7698
|
-
const skillFilePath = (0,
|
|
7885
|
+
const skillFilePath = (0, import_node_path65.join)(
|
|
7699
7886
|
loaded.baseDir,
|
|
7700
7887
|
loaded.relativeDirPath,
|
|
7701
7888
|
loaded.dirName,
|
|
@@ -7737,7 +7924,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
|
|
|
7737
7924
|
};
|
|
7738
7925
|
|
|
7739
7926
|
// src/features/skills/opencode-skill.ts
|
|
7740
|
-
var
|
|
7927
|
+
var import_node_path66 = require("path");
|
|
7741
7928
|
var import_mini30 = require("zod/mini");
|
|
7742
7929
|
var OpenCodeSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
7743
7930
|
name: import_mini30.z.string(),
|
|
@@ -7747,7 +7934,7 @@ var OpenCodeSkillFrontmatterSchema = import_mini30.z.looseObject({
|
|
|
7747
7934
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
7748
7935
|
constructor({
|
|
7749
7936
|
baseDir = process.cwd(),
|
|
7750
|
-
relativeDirPath = (0,
|
|
7937
|
+
relativeDirPath = (0, import_node_path66.join)(".opencode", "skill"),
|
|
7751
7938
|
dirName,
|
|
7752
7939
|
frontmatter,
|
|
7753
7940
|
body,
|
|
@@ -7776,7 +7963,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
7776
7963
|
}
|
|
7777
7964
|
static getSettablePaths({ global = false } = {}) {
|
|
7778
7965
|
return {
|
|
7779
|
-
relativeDirPath: global ? (0,
|
|
7966
|
+
relativeDirPath: global ? (0, import_node_path66.join)(".config", "opencode", "skill") : (0, import_node_path66.join)(".opencode", "skill")
|
|
7780
7967
|
};
|
|
7781
7968
|
}
|
|
7782
7969
|
getFrontmatter() {
|
|
@@ -7864,9 +8051,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
7864
8051
|
});
|
|
7865
8052
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7866
8053
|
if (!result.success) {
|
|
7867
|
-
const skillDirPath = (0,
|
|
8054
|
+
const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7868
8055
|
throw new Error(
|
|
7869
|
-
`Invalid frontmatter in ${(0,
|
|
8056
|
+
`Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7870
8057
|
);
|
|
7871
8058
|
}
|
|
7872
8059
|
return new _OpenCodeSkill({
|
|
@@ -7900,7 +8087,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
7900
8087
|
};
|
|
7901
8088
|
|
|
7902
8089
|
// src/features/skills/replit-skill.ts
|
|
7903
|
-
var
|
|
8090
|
+
var import_node_path67 = require("path");
|
|
7904
8091
|
var import_mini31 = require("zod/mini");
|
|
7905
8092
|
var ReplitSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
7906
8093
|
name: import_mini31.z.string(),
|
|
@@ -7909,7 +8096,7 @@ var ReplitSkillFrontmatterSchema = import_mini31.z.looseObject({
|
|
|
7909
8096
|
var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
7910
8097
|
constructor({
|
|
7911
8098
|
baseDir = process.cwd(),
|
|
7912
|
-
relativeDirPath = (0,
|
|
8099
|
+
relativeDirPath = (0, import_node_path67.join)(".agent", "skills"),
|
|
7913
8100
|
dirName,
|
|
7914
8101
|
frontmatter,
|
|
7915
8102
|
body,
|
|
@@ -7941,7 +8128,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
7941
8128
|
throw new Error("ReplitSkill does not support global mode.");
|
|
7942
8129
|
}
|
|
7943
8130
|
return {
|
|
7944
|
-
relativeDirPath: (0,
|
|
8131
|
+
relativeDirPath: (0, import_node_path67.join)(".agent", "skills")
|
|
7945
8132
|
};
|
|
7946
8133
|
}
|
|
7947
8134
|
getFrontmatter() {
|
|
@@ -8023,9 +8210,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
8023
8210
|
});
|
|
8024
8211
|
const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8025
8212
|
if (!result.success) {
|
|
8026
|
-
const skillDirPath = (0,
|
|
8213
|
+
const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8027
8214
|
throw new Error(
|
|
8028
|
-
`Invalid frontmatter in ${(0,
|
|
8215
|
+
`Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8029
8216
|
);
|
|
8030
8217
|
}
|
|
8031
8218
|
return new _ReplitSkill({
|
|
@@ -8060,7 +8247,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
|
|
|
8060
8247
|
};
|
|
8061
8248
|
|
|
8062
8249
|
// src/features/skills/roo-skill.ts
|
|
8063
|
-
var
|
|
8250
|
+
var import_node_path68 = require("path");
|
|
8064
8251
|
var import_mini32 = require("zod/mini");
|
|
8065
8252
|
var RooSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
8066
8253
|
name: import_mini32.z.string(),
|
|
@@ -8069,7 +8256,7 @@ var RooSkillFrontmatterSchema = import_mini32.z.looseObject({
|
|
|
8069
8256
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
8070
8257
|
constructor({
|
|
8071
8258
|
baseDir = process.cwd(),
|
|
8072
|
-
relativeDirPath = (0,
|
|
8259
|
+
relativeDirPath = (0, import_node_path68.join)(".roo", "skills"),
|
|
8073
8260
|
dirName,
|
|
8074
8261
|
frontmatter,
|
|
8075
8262
|
body,
|
|
@@ -8100,7 +8287,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
8100
8287
|
global: _global = false
|
|
8101
8288
|
} = {}) {
|
|
8102
8289
|
return {
|
|
8103
|
-
relativeDirPath: (0,
|
|
8290
|
+
relativeDirPath: (0, import_node_path68.join)(".roo", "skills")
|
|
8104
8291
|
};
|
|
8105
8292
|
}
|
|
8106
8293
|
getFrontmatter() {
|
|
@@ -8190,13 +8377,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
8190
8377
|
});
|
|
8191
8378
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
8192
8379
|
if (!result.success) {
|
|
8193
|
-
const skillDirPath = (0,
|
|
8380
|
+
const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
8194
8381
|
throw new Error(
|
|
8195
|
-
`Invalid frontmatter in ${(0,
|
|
8382
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
8196
8383
|
);
|
|
8197
8384
|
}
|
|
8198
8385
|
if (result.data.name !== loaded.dirName) {
|
|
8199
|
-
const skillFilePath = (0,
|
|
8386
|
+
const skillFilePath = (0, import_node_path68.join)(
|
|
8200
8387
|
loaded.baseDir,
|
|
8201
8388
|
loaded.relativeDirPath,
|
|
8202
8389
|
loaded.dirName,
|
|
@@ -8245,6 +8432,7 @@ var skillsProcessorToolTargetTuple = [
|
|
|
8245
8432
|
"codexcli",
|
|
8246
8433
|
"copilot",
|
|
8247
8434
|
"cursor",
|
|
8435
|
+
"factorydroid",
|
|
8248
8436
|
"geminicli",
|
|
8249
8437
|
"kilo",
|
|
8250
8438
|
"kiro",
|
|
@@ -8303,6 +8491,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
|
|
|
8303
8491
|
meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
|
|
8304
8492
|
}
|
|
8305
8493
|
],
|
|
8494
|
+
[
|
|
8495
|
+
"factorydroid",
|
|
8496
|
+
{
|
|
8497
|
+
class: FactorydroidSkill,
|
|
8498
|
+
meta: { supportsProject: true, supportsSimulated: true, supportsGlobal: true }
|
|
8499
|
+
}
|
|
8500
|
+
],
|
|
8306
8501
|
[
|
|
8307
8502
|
"geminicli",
|
|
8308
8503
|
{
|
|
@@ -8423,9 +8618,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
8423
8618
|
*/
|
|
8424
8619
|
async loadRulesyncDirs() {
|
|
8425
8620
|
const paths = RulesyncSkill.getSettablePaths();
|
|
8426
|
-
const rulesyncSkillsDirPath = (0,
|
|
8427
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
8428
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
8621
|
+
const rulesyncSkillsDirPath = (0, import_node_path69.join)(this.baseDir, paths.relativeDirPath);
|
|
8622
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path69.join)(rulesyncSkillsDirPath, "*"), { type: "dir" });
|
|
8623
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path69.basename)(path3));
|
|
8429
8624
|
const rulesyncSkills = await Promise.all(
|
|
8430
8625
|
dirNames.map(
|
|
8431
8626
|
(dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
|
|
@@ -8441,9 +8636,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
8441
8636
|
async loadToolDirs() {
|
|
8442
8637
|
const factory = this.getFactory(this.toolTarget);
|
|
8443
8638
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
8444
|
-
const skillsDirPath = (0,
|
|
8445
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
8446
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
8639
|
+
const skillsDirPath = (0, import_node_path69.join)(this.baseDir, paths.relativeDirPath);
|
|
8640
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path69.join)(skillsDirPath, "*"), { type: "dir" });
|
|
8641
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path69.basename)(path3));
|
|
8447
8642
|
const toolSkills = await Promise.all(
|
|
8448
8643
|
dirNames.map(
|
|
8449
8644
|
(dirName) => factory.class.fromDir({
|
|
@@ -8459,9 +8654,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
8459
8654
|
async loadToolDirsToDelete() {
|
|
8460
8655
|
const factory = this.getFactory(this.toolTarget);
|
|
8461
8656
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
8462
|
-
const skillsDirPath = (0,
|
|
8463
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
8464
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
8657
|
+
const skillsDirPath = (0, import_node_path69.join)(this.baseDir, paths.relativeDirPath);
|
|
8658
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path69.join)(skillsDirPath, "*"), { type: "dir" });
|
|
8659
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path69.basename)(path3));
|
|
8465
8660
|
const toolSkills = dirNames.map(
|
|
8466
8661
|
(dirName) => factory.class.forDeletion({
|
|
8467
8662
|
baseDir: this.baseDir,
|
|
@@ -8509,10 +8704,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
8509
8704
|
};
|
|
8510
8705
|
|
|
8511
8706
|
// src/features/subagents/agentsmd-subagent.ts
|
|
8512
|
-
var
|
|
8707
|
+
var import_node_path71 = require("path");
|
|
8513
8708
|
|
|
8514
8709
|
// src/features/subagents/simulated-subagent.ts
|
|
8515
|
-
var
|
|
8710
|
+
var import_node_path70 = require("path");
|
|
8516
8711
|
var import_mini34 = require("zod/mini");
|
|
8517
8712
|
|
|
8518
8713
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -8568,7 +8763,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
8568
8763
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8569
8764
|
if (!result.success) {
|
|
8570
8765
|
throw new Error(
|
|
8571
|
-
`Invalid frontmatter in ${(0,
|
|
8766
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8572
8767
|
);
|
|
8573
8768
|
}
|
|
8574
8769
|
}
|
|
@@ -8619,7 +8814,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
8619
8814
|
return {
|
|
8620
8815
|
success: false,
|
|
8621
8816
|
error: new Error(
|
|
8622
|
-
`Invalid frontmatter in ${(0,
|
|
8817
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8623
8818
|
)
|
|
8624
8819
|
};
|
|
8625
8820
|
}
|
|
@@ -8629,7 +8824,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
8629
8824
|
relativeFilePath,
|
|
8630
8825
|
validate = true
|
|
8631
8826
|
}) {
|
|
8632
|
-
const filePath = (0,
|
|
8827
|
+
const filePath = (0, import_node_path70.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
8633
8828
|
const fileContent = await readFileContent(filePath);
|
|
8634
8829
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8635
8830
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -8639,7 +8834,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
8639
8834
|
return {
|
|
8640
8835
|
baseDir,
|
|
8641
8836
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
8642
|
-
relativeFilePath: (0,
|
|
8837
|
+
relativeFilePath: (0, import_node_path70.basename)(relativeFilePath),
|
|
8643
8838
|
frontmatter: result.data,
|
|
8644
8839
|
body: content.trim(),
|
|
8645
8840
|
validate
|
|
@@ -8665,7 +8860,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
8665
8860
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
8666
8861
|
static getSettablePaths() {
|
|
8667
8862
|
return {
|
|
8668
|
-
relativeDirPath: (0,
|
|
8863
|
+
relativeDirPath: (0, import_node_path71.join)(".agents", "subagents")
|
|
8669
8864
|
};
|
|
8670
8865
|
}
|
|
8671
8866
|
static async fromFile(params) {
|
|
@@ -8688,11 +8883,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
8688
8883
|
};
|
|
8689
8884
|
|
|
8690
8885
|
// src/features/subagents/codexcli-subagent.ts
|
|
8691
|
-
var
|
|
8886
|
+
var import_node_path72 = require("path");
|
|
8692
8887
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
8693
8888
|
static getSettablePaths() {
|
|
8694
8889
|
return {
|
|
8695
|
-
relativeDirPath: (0,
|
|
8890
|
+
relativeDirPath: (0, import_node_path72.join)(".codex", "subagents")
|
|
8696
8891
|
};
|
|
8697
8892
|
}
|
|
8698
8893
|
static async fromFile(params) {
|
|
@@ -8714,12 +8909,39 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
8714
8909
|
}
|
|
8715
8910
|
};
|
|
8716
8911
|
|
|
8912
|
+
// src/features/subagents/factorydroid-subagent.ts
|
|
8913
|
+
var import_node_path73 = require("path");
|
|
8914
|
+
var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
|
|
8915
|
+
static getSettablePaths(_options) {
|
|
8916
|
+
return {
|
|
8917
|
+
relativeDirPath: (0, import_node_path73.join)(".factorydroid", "droids")
|
|
8918
|
+
};
|
|
8919
|
+
}
|
|
8920
|
+
static async fromFile(params) {
|
|
8921
|
+
const baseParams = await this.fromFileDefault(params);
|
|
8922
|
+
return new _FactorydroidSubagent(baseParams);
|
|
8923
|
+
}
|
|
8924
|
+
static fromRulesyncSubagent(params) {
|
|
8925
|
+
const baseParams = this.fromRulesyncSubagentDefault(params);
|
|
8926
|
+
return new _FactorydroidSubagent(baseParams);
|
|
8927
|
+
}
|
|
8928
|
+
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
8929
|
+
return this.isTargetedByRulesyncSubagentDefault({
|
|
8930
|
+
rulesyncSubagent,
|
|
8931
|
+
toolTarget: "factorydroid"
|
|
8932
|
+
});
|
|
8933
|
+
}
|
|
8934
|
+
static forDeletion(params) {
|
|
8935
|
+
return new _FactorydroidSubagent(this.forDeletionDefault(params));
|
|
8936
|
+
}
|
|
8937
|
+
};
|
|
8938
|
+
|
|
8717
8939
|
// src/features/subagents/geminicli-subagent.ts
|
|
8718
|
-
var
|
|
8940
|
+
var import_node_path74 = require("path");
|
|
8719
8941
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
8720
8942
|
static getSettablePaths() {
|
|
8721
8943
|
return {
|
|
8722
|
-
relativeDirPath: (0,
|
|
8944
|
+
relativeDirPath: (0, import_node_path74.join)(".gemini", "subagents")
|
|
8723
8945
|
};
|
|
8724
8946
|
}
|
|
8725
8947
|
static async fromFile(params) {
|
|
@@ -8742,11 +8964,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
8742
8964
|
};
|
|
8743
8965
|
|
|
8744
8966
|
// src/features/subagents/roo-subagent.ts
|
|
8745
|
-
var
|
|
8967
|
+
var import_node_path75 = require("path");
|
|
8746
8968
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
8747
8969
|
static getSettablePaths() {
|
|
8748
8970
|
return {
|
|
8749
|
-
relativeDirPath: (0,
|
|
8971
|
+
relativeDirPath: (0, import_node_path75.join)(".roo", "subagents")
|
|
8750
8972
|
};
|
|
8751
8973
|
}
|
|
8752
8974
|
static async fromFile(params) {
|
|
@@ -8769,15 +8991,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
8769
8991
|
};
|
|
8770
8992
|
|
|
8771
8993
|
// src/features/subagents/subagents-processor.ts
|
|
8772
|
-
var
|
|
8994
|
+
var import_node_path82 = require("path");
|
|
8773
8995
|
var import_mini41 = require("zod/mini");
|
|
8774
8996
|
|
|
8775
8997
|
// src/features/subagents/claudecode-subagent.ts
|
|
8776
|
-
var
|
|
8998
|
+
var import_node_path77 = require("path");
|
|
8777
8999
|
var import_mini36 = require("zod/mini");
|
|
8778
9000
|
|
|
8779
9001
|
// src/features/subagents/rulesync-subagent.ts
|
|
8780
|
-
var
|
|
9002
|
+
var import_node_path76 = require("path");
|
|
8781
9003
|
var import_mini35 = require("zod/mini");
|
|
8782
9004
|
var RulesyncSubagentFrontmatterSchema = import_mini35.z.looseObject({
|
|
8783
9005
|
targets: RulesyncTargetsSchema,
|
|
@@ -8792,7 +9014,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
8792
9014
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8793
9015
|
if (!result.success) {
|
|
8794
9016
|
throw new Error(
|
|
8795
|
-
`Invalid frontmatter in ${(0,
|
|
9017
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8796
9018
|
);
|
|
8797
9019
|
}
|
|
8798
9020
|
}
|
|
@@ -8825,7 +9047,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
8825
9047
|
return {
|
|
8826
9048
|
success: false,
|
|
8827
9049
|
error: new Error(
|
|
8828
|
-
`Invalid frontmatter in ${(0,
|
|
9050
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8829
9051
|
)
|
|
8830
9052
|
};
|
|
8831
9053
|
}
|
|
@@ -8834,14 +9056,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
8834
9056
|
relativeFilePath
|
|
8835
9057
|
}) {
|
|
8836
9058
|
const fileContent = await readFileContent(
|
|
8837
|
-
(0,
|
|
9059
|
+
(0, import_node_path76.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
8838
9060
|
);
|
|
8839
9061
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8840
9062
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8841
9063
|
if (!result.success) {
|
|
8842
9064
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
8843
9065
|
}
|
|
8844
|
-
const filename = (0,
|
|
9066
|
+
const filename = (0, import_node_path76.basename)(relativeFilePath);
|
|
8845
9067
|
return new _RulesyncSubagent({
|
|
8846
9068
|
baseDir: process.cwd(),
|
|
8847
9069
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -8869,7 +9091,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
8869
9091
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8870
9092
|
if (!result.success) {
|
|
8871
9093
|
throw new Error(
|
|
8872
|
-
`Invalid frontmatter in ${(0,
|
|
9094
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8873
9095
|
);
|
|
8874
9096
|
}
|
|
8875
9097
|
}
|
|
@@ -8881,7 +9103,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
8881
9103
|
}
|
|
8882
9104
|
static getSettablePaths(_options = {}) {
|
|
8883
9105
|
return {
|
|
8884
|
-
relativeDirPath: (0,
|
|
9106
|
+
relativeDirPath: (0, import_node_path77.join)(".claude", "agents")
|
|
8885
9107
|
};
|
|
8886
9108
|
}
|
|
8887
9109
|
getFrontmatter() {
|
|
@@ -8955,7 +9177,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
8955
9177
|
return {
|
|
8956
9178
|
success: false,
|
|
8957
9179
|
error: new Error(
|
|
8958
|
-
`Invalid frontmatter in ${(0,
|
|
9180
|
+
`Invalid frontmatter in ${(0, import_node_path77.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8959
9181
|
)
|
|
8960
9182
|
};
|
|
8961
9183
|
}
|
|
@@ -8973,7 +9195,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
8973
9195
|
global = false
|
|
8974
9196
|
}) {
|
|
8975
9197
|
const paths = this.getSettablePaths({ global });
|
|
8976
|
-
const filePath = (0,
|
|
9198
|
+
const filePath = (0, import_node_path77.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
8977
9199
|
const fileContent = await readFileContent(filePath);
|
|
8978
9200
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8979
9201
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9008,7 +9230,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
9008
9230
|
};
|
|
9009
9231
|
|
|
9010
9232
|
// src/features/subagents/copilot-subagent.ts
|
|
9011
|
-
var
|
|
9233
|
+
var import_node_path78 = require("path");
|
|
9012
9234
|
var import_mini37 = require("zod/mini");
|
|
9013
9235
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
9014
9236
|
var CopilotSubagentFrontmatterSchema = import_mini37.z.looseObject({
|
|
@@ -9034,7 +9256,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9034
9256
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
9035
9257
|
if (!result.success) {
|
|
9036
9258
|
throw new Error(
|
|
9037
|
-
`Invalid frontmatter in ${(0,
|
|
9259
|
+
`Invalid frontmatter in ${(0, import_node_path78.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9038
9260
|
);
|
|
9039
9261
|
}
|
|
9040
9262
|
}
|
|
@@ -9046,7 +9268,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9046
9268
|
}
|
|
9047
9269
|
static getSettablePaths(_options = {}) {
|
|
9048
9270
|
return {
|
|
9049
|
-
relativeDirPath: (0,
|
|
9271
|
+
relativeDirPath: (0, import_node_path78.join)(".github", "agents")
|
|
9050
9272
|
};
|
|
9051
9273
|
}
|
|
9052
9274
|
getFrontmatter() {
|
|
@@ -9120,7 +9342,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9120
9342
|
return {
|
|
9121
9343
|
success: false,
|
|
9122
9344
|
error: new Error(
|
|
9123
|
-
`Invalid frontmatter in ${(0,
|
|
9345
|
+
`Invalid frontmatter in ${(0, import_node_path78.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9124
9346
|
)
|
|
9125
9347
|
};
|
|
9126
9348
|
}
|
|
@@ -9138,7 +9360,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9138
9360
|
global = false
|
|
9139
9361
|
}) {
|
|
9140
9362
|
const paths = this.getSettablePaths({ global });
|
|
9141
|
-
const filePath = (0,
|
|
9363
|
+
const filePath = (0, import_node_path78.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
9142
9364
|
const fileContent = await readFileContent(filePath);
|
|
9143
9365
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9144
9366
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9174,7 +9396,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
9174
9396
|
};
|
|
9175
9397
|
|
|
9176
9398
|
// src/features/subagents/cursor-subagent.ts
|
|
9177
|
-
var
|
|
9399
|
+
var import_node_path79 = require("path");
|
|
9178
9400
|
var import_mini38 = require("zod/mini");
|
|
9179
9401
|
var CursorSubagentFrontmatterSchema = import_mini38.z.looseObject({
|
|
9180
9402
|
name: import_mini38.z.string(),
|
|
@@ -9188,7 +9410,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9188
9410
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
9189
9411
|
if (!result.success) {
|
|
9190
9412
|
throw new Error(
|
|
9191
|
-
`Invalid frontmatter in ${(0,
|
|
9413
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9192
9414
|
);
|
|
9193
9415
|
}
|
|
9194
9416
|
}
|
|
@@ -9200,7 +9422,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9200
9422
|
}
|
|
9201
9423
|
static getSettablePaths(_options = {}) {
|
|
9202
9424
|
return {
|
|
9203
|
-
relativeDirPath: (0,
|
|
9425
|
+
relativeDirPath: (0, import_node_path79.join)(".cursor", "agents")
|
|
9204
9426
|
};
|
|
9205
9427
|
}
|
|
9206
9428
|
getFrontmatter() {
|
|
@@ -9267,7 +9489,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9267
9489
|
return {
|
|
9268
9490
|
success: false,
|
|
9269
9491
|
error: new Error(
|
|
9270
|
-
`Invalid frontmatter in ${(0,
|
|
9492
|
+
`Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9271
9493
|
)
|
|
9272
9494
|
};
|
|
9273
9495
|
}
|
|
@@ -9285,7 +9507,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9285
9507
|
global = false
|
|
9286
9508
|
}) {
|
|
9287
9509
|
const paths = this.getSettablePaths({ global });
|
|
9288
|
-
const filePath = (0,
|
|
9510
|
+
const filePath = (0, import_node_path79.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
9289
9511
|
const fileContent = await readFileContent(filePath);
|
|
9290
9512
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9291
9513
|
const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9321,7 +9543,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
|
|
|
9321
9543
|
};
|
|
9322
9544
|
|
|
9323
9545
|
// src/features/subagents/kiro-subagent.ts
|
|
9324
|
-
var
|
|
9546
|
+
var import_node_path80 = require("path");
|
|
9325
9547
|
var import_mini39 = require("zod/mini");
|
|
9326
9548
|
var KiroCliSubagentJsonSchema = import_mini39.z.looseObject({
|
|
9327
9549
|
name: import_mini39.z.string(),
|
|
@@ -9349,7 +9571,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
9349
9571
|
}
|
|
9350
9572
|
static getSettablePaths(_options = {}) {
|
|
9351
9573
|
return {
|
|
9352
|
-
relativeDirPath: (0,
|
|
9574
|
+
relativeDirPath: (0, import_node_path80.join)(".kiro", "agents")
|
|
9353
9575
|
};
|
|
9354
9576
|
}
|
|
9355
9577
|
getBody() {
|
|
@@ -9429,7 +9651,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
9429
9651
|
global = false
|
|
9430
9652
|
}) {
|
|
9431
9653
|
const paths = this.getSettablePaths({ global });
|
|
9432
|
-
const filePath = (0,
|
|
9654
|
+
const filePath = (0, import_node_path80.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
9433
9655
|
const fileContent = await readFileContent(filePath);
|
|
9434
9656
|
return new _KiroSubagent({
|
|
9435
9657
|
baseDir,
|
|
@@ -9458,7 +9680,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
|
|
|
9458
9680
|
};
|
|
9459
9681
|
|
|
9460
9682
|
// src/features/subagents/opencode-subagent.ts
|
|
9461
|
-
var
|
|
9683
|
+
var import_node_path81 = require("path");
|
|
9462
9684
|
var import_mini40 = require("zod/mini");
|
|
9463
9685
|
var OpenCodeSubagentFrontmatterSchema = import_mini40.z.looseObject({
|
|
9464
9686
|
description: import_mini40.z.string(),
|
|
@@ -9473,7 +9695,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
9473
9695
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
9474
9696
|
if (!result.success) {
|
|
9475
9697
|
throw new Error(
|
|
9476
|
-
`Invalid frontmatter in ${(0,
|
|
9698
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9477
9699
|
);
|
|
9478
9700
|
}
|
|
9479
9701
|
}
|
|
@@ -9487,7 +9709,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
9487
9709
|
global = false
|
|
9488
9710
|
} = {}) {
|
|
9489
9711
|
return {
|
|
9490
|
-
relativeDirPath: global ? (0,
|
|
9712
|
+
relativeDirPath: global ? (0, import_node_path81.join)(".config", "opencode", "agent") : (0, import_node_path81.join)(".opencode", "agent")
|
|
9491
9713
|
};
|
|
9492
9714
|
}
|
|
9493
9715
|
getFrontmatter() {
|
|
@@ -9500,7 +9722,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
9500
9722
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
9501
9723
|
const rulesyncFrontmatter = {
|
|
9502
9724
|
targets: ["*"],
|
|
9503
|
-
name: name ?? (0,
|
|
9725
|
+
name: name ?? (0, import_node_path81.basename)(this.getRelativeFilePath(), ".md"),
|
|
9504
9726
|
description,
|
|
9505
9727
|
opencode: { mode, ...opencodeSection }
|
|
9506
9728
|
};
|
|
@@ -9553,7 +9775,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
9553
9775
|
return {
|
|
9554
9776
|
success: false,
|
|
9555
9777
|
error: new Error(
|
|
9556
|
-
`Invalid frontmatter in ${(0,
|
|
9778
|
+
`Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9557
9779
|
)
|
|
9558
9780
|
};
|
|
9559
9781
|
}
|
|
@@ -9570,7 +9792,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
9570
9792
|
global = false
|
|
9571
9793
|
}) {
|
|
9572
9794
|
const paths = this.getSettablePaths({ global });
|
|
9573
|
-
const filePath = (0,
|
|
9795
|
+
const filePath = (0, import_node_path81.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
9574
9796
|
const fileContent = await readFileContent(filePath);
|
|
9575
9797
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9576
9798
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -9613,6 +9835,7 @@ var subagentsProcessorToolTargetTuple = [
|
|
|
9613
9835
|
"codexcli",
|
|
9614
9836
|
"copilot",
|
|
9615
9837
|
"cursor",
|
|
9838
|
+
"factorydroid",
|
|
9616
9839
|
"geminicli",
|
|
9617
9840
|
"kiro",
|
|
9618
9841
|
"opencode",
|
|
@@ -9662,6 +9885,13 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
9662
9885
|
meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
|
|
9663
9886
|
}
|
|
9664
9887
|
],
|
|
9888
|
+
[
|
|
9889
|
+
"factorydroid",
|
|
9890
|
+
{
|
|
9891
|
+
class: FactorydroidSubagent,
|
|
9892
|
+
meta: { supportsSimulated: true, supportsGlobal: true, filePattern: "*.md" }
|
|
9893
|
+
}
|
|
9894
|
+
],
|
|
9665
9895
|
[
|
|
9666
9896
|
"geminicli",
|
|
9667
9897
|
{
|
|
@@ -9772,7 +10002,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
9772
10002
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
9773
10003
|
*/
|
|
9774
10004
|
async loadRulesyncFiles() {
|
|
9775
|
-
const subagentsDir = (0,
|
|
10005
|
+
const subagentsDir = (0, import_node_path82.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
9776
10006
|
const dirExists = await directoryExists(subagentsDir);
|
|
9777
10007
|
if (!dirExists) {
|
|
9778
10008
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -9787,7 +10017,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
9787
10017
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
9788
10018
|
const rulesyncSubagents = [];
|
|
9789
10019
|
for (const mdFile of mdFiles) {
|
|
9790
|
-
const filepath = (0,
|
|
10020
|
+
const filepath = (0, import_node_path82.join)(subagentsDir, mdFile);
|
|
9791
10021
|
try {
|
|
9792
10022
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
9793
10023
|
relativeFilePath: mdFile,
|
|
@@ -9817,14 +10047,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
9817
10047
|
const factory = this.getFactory(this.toolTarget);
|
|
9818
10048
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
9819
10049
|
const subagentFilePaths = await findFilesByGlobs(
|
|
9820
|
-
(0,
|
|
10050
|
+
(0, import_node_path82.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
|
|
9821
10051
|
);
|
|
9822
10052
|
if (forDeletion) {
|
|
9823
10053
|
const toolSubagents2 = subagentFilePaths.map(
|
|
9824
10054
|
(path3) => factory.class.forDeletion({
|
|
9825
10055
|
baseDir: this.baseDir,
|
|
9826
10056
|
relativeDirPath: paths.relativeDirPath,
|
|
9827
|
-
relativeFilePath: (0,
|
|
10057
|
+
relativeFilePath: (0, import_node_path82.basename)(path3),
|
|
9828
10058
|
global: this.global
|
|
9829
10059
|
})
|
|
9830
10060
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -9835,7 +10065,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
9835
10065
|
subagentFilePaths.map(
|
|
9836
10066
|
(path3) => factory.class.fromFile({
|
|
9837
10067
|
baseDir: this.baseDir,
|
|
9838
|
-
relativeFilePath: (0,
|
|
10068
|
+
relativeFilePath: (0, import_node_path82.basename)(path3),
|
|
9839
10069
|
global: this.global
|
|
9840
10070
|
})
|
|
9841
10071
|
)
|
|
@@ -9867,13 +10097,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
9867
10097
|
};
|
|
9868
10098
|
|
|
9869
10099
|
// src/features/rules/agentsmd-rule.ts
|
|
9870
|
-
var
|
|
10100
|
+
var import_node_path85 = require("path");
|
|
9871
10101
|
|
|
9872
10102
|
// src/features/rules/tool-rule.ts
|
|
9873
|
-
var
|
|
10103
|
+
var import_node_path84 = require("path");
|
|
9874
10104
|
|
|
9875
10105
|
// src/features/rules/rulesync-rule.ts
|
|
9876
|
-
var
|
|
10106
|
+
var import_node_path83 = require("path");
|
|
9877
10107
|
var import_mini42 = require("zod/mini");
|
|
9878
10108
|
var RulesyncRuleFrontmatterSchema = import_mini42.z.object({
|
|
9879
10109
|
root: import_mini42.z.optional(import_mini42.z.boolean()),
|
|
@@ -9890,8 +10120,8 @@ var RulesyncRuleFrontmatterSchema = import_mini42.z.object({
|
|
|
9890
10120
|
claudecode: import_mini42.z.optional(
|
|
9891
10121
|
import_mini42.z.object({
|
|
9892
10122
|
// Glob patterns for conditional rules (takes precedence over globs)
|
|
9893
|
-
// @example "src/**/*.ts, tests/**/*.test.ts"
|
|
9894
|
-
paths: import_mini42.z.optional(import_mini42.z.string())
|
|
10123
|
+
// @example ["src/**/*.ts", "tests/**/*.test.ts"]
|
|
10124
|
+
paths: import_mini42.z.optional(import_mini42.z.array(import_mini42.z.string()))
|
|
9895
10125
|
})
|
|
9896
10126
|
),
|
|
9897
10127
|
cursor: import_mini42.z.optional(
|
|
@@ -9921,7 +10151,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
9921
10151
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9922
10152
|
if (!result.success) {
|
|
9923
10153
|
throw new Error(
|
|
9924
|
-
`Invalid frontmatter in ${(0,
|
|
10154
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9925
10155
|
);
|
|
9926
10156
|
}
|
|
9927
10157
|
}
|
|
@@ -9956,7 +10186,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
9956
10186
|
return {
|
|
9957
10187
|
success: false,
|
|
9958
10188
|
error: new Error(
|
|
9959
|
-
`Invalid frontmatter in ${(0,
|
|
10189
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9960
10190
|
)
|
|
9961
10191
|
};
|
|
9962
10192
|
}
|
|
@@ -9965,7 +10195,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
9965
10195
|
relativeFilePath,
|
|
9966
10196
|
validate = true
|
|
9967
10197
|
}) {
|
|
9968
|
-
const filePath = (0,
|
|
10198
|
+
const filePath = (0, import_node_path83.join)(
|
|
9969
10199
|
process.cwd(),
|
|
9970
10200
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
9971
10201
|
relativeFilePath
|
|
@@ -10067,7 +10297,7 @@ var ToolRule = class extends ToolFile {
|
|
|
10067
10297
|
rulesyncRule,
|
|
10068
10298
|
validate = true,
|
|
10069
10299
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
10070
|
-
nonRootPath = { relativeDirPath: (0,
|
|
10300
|
+
nonRootPath = { relativeDirPath: (0, import_node_path84.join)(".agents", "memories") }
|
|
10071
10301
|
}) {
|
|
10072
10302
|
const params = this.buildToolRuleParamsDefault({
|
|
10073
10303
|
baseDir,
|
|
@@ -10078,7 +10308,7 @@ var ToolRule = class extends ToolFile {
|
|
|
10078
10308
|
});
|
|
10079
10309
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
10080
10310
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
10081
|
-
params.relativeDirPath = (0,
|
|
10311
|
+
params.relativeDirPath = (0, import_node_path84.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
10082
10312
|
params.relativeFilePath = "AGENTS.md";
|
|
10083
10313
|
}
|
|
10084
10314
|
return params;
|
|
@@ -10143,7 +10373,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
10143
10373
|
relativeFilePath: "AGENTS.md"
|
|
10144
10374
|
},
|
|
10145
10375
|
nonRoot: {
|
|
10146
|
-
relativeDirPath: (0,
|
|
10376
|
+
relativeDirPath: (0, import_node_path85.join)(".agents", "memories")
|
|
10147
10377
|
}
|
|
10148
10378
|
};
|
|
10149
10379
|
}
|
|
@@ -10153,8 +10383,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
10153
10383
|
validate = true
|
|
10154
10384
|
}) {
|
|
10155
10385
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
10156
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
10157
|
-
const fileContent = await readFileContent((0,
|
|
10386
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path85.join)(".agents", "memories", relativeFilePath);
|
|
10387
|
+
const fileContent = await readFileContent((0, import_node_path85.join)(baseDir, relativePath));
|
|
10158
10388
|
return new _AgentsMdRule({
|
|
10159
10389
|
baseDir,
|
|
10160
10390
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10209,7 +10439,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
10209
10439
|
};
|
|
10210
10440
|
|
|
10211
10441
|
// src/features/rules/antigravity-rule.ts
|
|
10212
|
-
var
|
|
10442
|
+
var import_node_path86 = require("path");
|
|
10213
10443
|
var import_mini43 = require("zod/mini");
|
|
10214
10444
|
var AntigravityRuleFrontmatterSchema = import_mini43.z.looseObject({
|
|
10215
10445
|
trigger: import_mini43.z.optional(
|
|
@@ -10368,7 +10598,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
10368
10598
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10369
10599
|
if (!result.success) {
|
|
10370
10600
|
throw new Error(
|
|
10371
|
-
`Invalid frontmatter in ${(0,
|
|
10601
|
+
`Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10372
10602
|
);
|
|
10373
10603
|
}
|
|
10374
10604
|
}
|
|
@@ -10383,7 +10613,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
10383
10613
|
static getSettablePaths() {
|
|
10384
10614
|
return {
|
|
10385
10615
|
nonRoot: {
|
|
10386
|
-
relativeDirPath: (0,
|
|
10616
|
+
relativeDirPath: (0, import_node_path86.join)(".agent", "rules")
|
|
10387
10617
|
}
|
|
10388
10618
|
};
|
|
10389
10619
|
}
|
|
@@ -10392,7 +10622,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
10392
10622
|
relativeFilePath,
|
|
10393
10623
|
validate = true
|
|
10394
10624
|
}) {
|
|
10395
|
-
const filePath = (0,
|
|
10625
|
+
const filePath = (0, import_node_path86.join)(
|
|
10396
10626
|
baseDir,
|
|
10397
10627
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
10398
10628
|
relativeFilePath
|
|
@@ -10533,7 +10763,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
10533
10763
|
};
|
|
10534
10764
|
|
|
10535
10765
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
10536
|
-
var
|
|
10766
|
+
var import_node_path87 = require("path");
|
|
10537
10767
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
10538
10768
|
toRulesyncRule() {
|
|
10539
10769
|
const rulesyncFrontmatter = {
|
|
@@ -10559,7 +10789,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
10559
10789
|
relativeFilePath: ".augment-guidelines"
|
|
10560
10790
|
},
|
|
10561
10791
|
nonRoot: {
|
|
10562
|
-
relativeDirPath: (0,
|
|
10792
|
+
relativeDirPath: (0, import_node_path87.join)(".augment", "rules")
|
|
10563
10793
|
}
|
|
10564
10794
|
};
|
|
10565
10795
|
}
|
|
@@ -10594,8 +10824,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
10594
10824
|
}) {
|
|
10595
10825
|
const settablePaths = this.getSettablePaths();
|
|
10596
10826
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
10597
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
10598
|
-
const fileContent = await readFileContent((0,
|
|
10827
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path87.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
10828
|
+
const fileContent = await readFileContent((0, import_node_path87.join)(baseDir, relativePath));
|
|
10599
10829
|
return new _AugmentcodeLegacyRule({
|
|
10600
10830
|
baseDir,
|
|
10601
10831
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -10624,7 +10854,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
10624
10854
|
};
|
|
10625
10855
|
|
|
10626
10856
|
// src/features/rules/augmentcode-rule.ts
|
|
10627
|
-
var
|
|
10857
|
+
var import_node_path88 = require("path");
|
|
10628
10858
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
10629
10859
|
toRulesyncRule() {
|
|
10630
10860
|
return this.toRulesyncRuleDefault();
|
|
@@ -10632,7 +10862,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
10632
10862
|
static getSettablePaths() {
|
|
10633
10863
|
return {
|
|
10634
10864
|
nonRoot: {
|
|
10635
|
-
relativeDirPath: (0,
|
|
10865
|
+
relativeDirPath: (0, import_node_path88.join)(".augment", "rules")
|
|
10636
10866
|
}
|
|
10637
10867
|
};
|
|
10638
10868
|
}
|
|
@@ -10656,7 +10886,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
10656
10886
|
validate = true
|
|
10657
10887
|
}) {
|
|
10658
10888
|
const fileContent = await readFileContent(
|
|
10659
|
-
(0,
|
|
10889
|
+
(0, import_node_path88.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10660
10890
|
);
|
|
10661
10891
|
const { body: content } = parseFrontmatter(fileContent);
|
|
10662
10892
|
return new _AugmentcodeRule({
|
|
@@ -10692,7 +10922,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
10692
10922
|
};
|
|
10693
10923
|
|
|
10694
10924
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
10695
|
-
var
|
|
10925
|
+
var import_node_path89 = require("path");
|
|
10696
10926
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
10697
10927
|
static getSettablePaths({
|
|
10698
10928
|
global
|
|
@@ -10711,7 +10941,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
10711
10941
|
relativeFilePath: "CLAUDE.md"
|
|
10712
10942
|
},
|
|
10713
10943
|
nonRoot: {
|
|
10714
|
-
relativeDirPath: (0,
|
|
10944
|
+
relativeDirPath: (0, import_node_path89.join)(".claude", "memories")
|
|
10715
10945
|
}
|
|
10716
10946
|
};
|
|
10717
10947
|
}
|
|
@@ -10726,7 +10956,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
10726
10956
|
if (isRoot) {
|
|
10727
10957
|
const relativePath2 = paths.root.relativeFilePath;
|
|
10728
10958
|
const fileContent2 = await readFileContent(
|
|
10729
|
-
(0,
|
|
10959
|
+
(0, import_node_path89.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
10730
10960
|
);
|
|
10731
10961
|
return new _ClaudecodeLegacyRule({
|
|
10732
10962
|
baseDir,
|
|
@@ -10740,8 +10970,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
10740
10970
|
if (!paths.nonRoot) {
|
|
10741
10971
|
throw new Error("nonRoot path is not set");
|
|
10742
10972
|
}
|
|
10743
|
-
const relativePath = (0,
|
|
10744
|
-
const fileContent = await readFileContent((0,
|
|
10973
|
+
const relativePath = (0, import_node_path89.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
10974
|
+
const fileContent = await readFileContent((0, import_node_path89.join)(baseDir, relativePath));
|
|
10745
10975
|
return new _ClaudecodeLegacyRule({
|
|
10746
10976
|
baseDir,
|
|
10747
10977
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -10800,10 +11030,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
10800
11030
|
};
|
|
10801
11031
|
|
|
10802
11032
|
// src/features/rules/claudecode-rule.ts
|
|
10803
|
-
var
|
|
11033
|
+
var import_node_path90 = require("path");
|
|
10804
11034
|
var import_mini44 = require("zod/mini");
|
|
10805
11035
|
var ClaudecodeRuleFrontmatterSchema = import_mini44.z.object({
|
|
10806
|
-
paths: import_mini44.z.optional(import_mini44.z.string())
|
|
11036
|
+
paths: import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string()))
|
|
10807
11037
|
});
|
|
10808
11038
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
10809
11039
|
frontmatter;
|
|
@@ -10825,7 +11055,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10825
11055
|
relativeFilePath: "CLAUDE.md"
|
|
10826
11056
|
},
|
|
10827
11057
|
nonRoot: {
|
|
10828
|
-
relativeDirPath: (0,
|
|
11058
|
+
relativeDirPath: (0, import_node_path90.join)(".claude", "rules")
|
|
10829
11059
|
}
|
|
10830
11060
|
};
|
|
10831
11061
|
}
|
|
@@ -10834,7 +11064,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10834
11064
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10835
11065
|
if (!result.success) {
|
|
10836
11066
|
throw new Error(
|
|
10837
|
-
`Invalid frontmatter in ${(0,
|
|
11067
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
10838
11068
|
);
|
|
10839
11069
|
}
|
|
10840
11070
|
}
|
|
@@ -10862,7 +11092,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10862
11092
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
10863
11093
|
if (isRoot) {
|
|
10864
11094
|
const fileContent2 = await readFileContent(
|
|
10865
|
-
(0,
|
|
11095
|
+
(0, import_node_path90.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
10866
11096
|
);
|
|
10867
11097
|
return new _ClaudecodeRule({
|
|
10868
11098
|
baseDir,
|
|
@@ -10877,13 +11107,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10877
11107
|
if (!paths.nonRoot) {
|
|
10878
11108
|
throw new Error("nonRoot path is not set");
|
|
10879
11109
|
}
|
|
10880
|
-
const relativePath = (0,
|
|
10881
|
-
const fileContent = await readFileContent((0,
|
|
11110
|
+
const relativePath = (0, import_node_path90.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
11111
|
+
const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
|
|
10882
11112
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
10883
11113
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10884
11114
|
if (!result.success) {
|
|
10885
11115
|
throw new Error(
|
|
10886
|
-
`Invalid frontmatter in ${(0,
|
|
11116
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
10887
11117
|
);
|
|
10888
11118
|
}
|
|
10889
11119
|
return new _ClaudecodeRule({
|
|
@@ -10925,7 +11155,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10925
11155
|
const paths = this.getSettablePaths({ global });
|
|
10926
11156
|
const claudecodePaths = rulesyncFrontmatter.claudecode?.paths;
|
|
10927
11157
|
const globs = rulesyncFrontmatter.globs;
|
|
10928
|
-
const pathsValue = claudecodePaths ?? (globs?.length ? globs
|
|
11158
|
+
const pathsValue = claudecodePaths ?? (globs?.length ? globs : void 0);
|
|
10929
11159
|
const claudecodeFrontmatter = {
|
|
10930
11160
|
paths: root ? void 0 : pathsValue
|
|
10931
11161
|
};
|
|
@@ -10959,7 +11189,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10959
11189
|
if (this.isRoot()) {
|
|
10960
11190
|
globs = ["**/*"];
|
|
10961
11191
|
} else if (this.frontmatter.paths) {
|
|
10962
|
-
globs = this.frontmatter.paths
|
|
11192
|
+
globs = this.frontmatter.paths;
|
|
10963
11193
|
}
|
|
10964
11194
|
const rulesyncFrontmatter = {
|
|
10965
11195
|
targets: ["*"],
|
|
@@ -10990,7 +11220,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
10990
11220
|
return {
|
|
10991
11221
|
success: false,
|
|
10992
11222
|
error: new Error(
|
|
10993
|
-
`Invalid frontmatter in ${(0,
|
|
11223
|
+
`Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10994
11224
|
)
|
|
10995
11225
|
};
|
|
10996
11226
|
}
|
|
@@ -11010,7 +11240,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
11010
11240
|
};
|
|
11011
11241
|
|
|
11012
11242
|
// src/features/rules/cline-rule.ts
|
|
11013
|
-
var
|
|
11243
|
+
var import_node_path91 = require("path");
|
|
11014
11244
|
var import_mini45 = require("zod/mini");
|
|
11015
11245
|
var ClineRuleFrontmatterSchema = import_mini45.z.object({
|
|
11016
11246
|
description: import_mini45.z.string()
|
|
@@ -11055,7 +11285,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
11055
11285
|
validate = true
|
|
11056
11286
|
}) {
|
|
11057
11287
|
const fileContent = await readFileContent(
|
|
11058
|
-
(0,
|
|
11288
|
+
(0, import_node_path91.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
11059
11289
|
);
|
|
11060
11290
|
return new _ClineRule({
|
|
11061
11291
|
baseDir,
|
|
@@ -11081,7 +11311,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
11081
11311
|
};
|
|
11082
11312
|
|
|
11083
11313
|
// src/features/rules/codexcli-rule.ts
|
|
11084
|
-
var
|
|
11314
|
+
var import_node_path92 = require("path");
|
|
11085
11315
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
11086
11316
|
static getSettablePaths({
|
|
11087
11317
|
global
|
|
@@ -11100,7 +11330,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11100
11330
|
relativeFilePath: "AGENTS.md"
|
|
11101
11331
|
},
|
|
11102
11332
|
nonRoot: {
|
|
11103
|
-
relativeDirPath: (0,
|
|
11333
|
+
relativeDirPath: (0, import_node_path92.join)(".codex", "memories")
|
|
11104
11334
|
}
|
|
11105
11335
|
};
|
|
11106
11336
|
}
|
|
@@ -11115,7 +11345,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11115
11345
|
if (isRoot) {
|
|
11116
11346
|
const relativePath2 = paths.root.relativeFilePath;
|
|
11117
11347
|
const fileContent2 = await readFileContent(
|
|
11118
|
-
(0,
|
|
11348
|
+
(0, import_node_path92.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
11119
11349
|
);
|
|
11120
11350
|
return new _CodexcliRule({
|
|
11121
11351
|
baseDir,
|
|
@@ -11129,8 +11359,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11129
11359
|
if (!paths.nonRoot) {
|
|
11130
11360
|
throw new Error("nonRoot path is not set");
|
|
11131
11361
|
}
|
|
11132
|
-
const relativePath = (0,
|
|
11133
|
-
const fileContent = await readFileContent((0,
|
|
11362
|
+
const relativePath = (0, import_node_path92.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
11363
|
+
const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
|
|
11134
11364
|
return new _CodexcliRule({
|
|
11135
11365
|
baseDir,
|
|
11136
11366
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -11189,7 +11419,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
11189
11419
|
};
|
|
11190
11420
|
|
|
11191
11421
|
// src/features/rules/copilot-rule.ts
|
|
11192
|
-
var
|
|
11422
|
+
var import_node_path93 = require("path");
|
|
11193
11423
|
var import_mini46 = require("zod/mini");
|
|
11194
11424
|
var CopilotRuleFrontmatterSchema = import_mini46.z.object({
|
|
11195
11425
|
description: import_mini46.z.optional(import_mini46.z.string()),
|
|
@@ -11206,7 +11436,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11206
11436
|
relativeFilePath: "copilot-instructions.md"
|
|
11207
11437
|
},
|
|
11208
11438
|
nonRoot: {
|
|
11209
|
-
relativeDirPath: (0,
|
|
11439
|
+
relativeDirPath: (0, import_node_path93.join)(".github", "instructions")
|
|
11210
11440
|
}
|
|
11211
11441
|
};
|
|
11212
11442
|
}
|
|
@@ -11215,7 +11445,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11215
11445
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11216
11446
|
if (!result.success) {
|
|
11217
11447
|
throw new Error(
|
|
11218
|
-
`Invalid frontmatter in ${(0,
|
|
11448
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11219
11449
|
);
|
|
11220
11450
|
}
|
|
11221
11451
|
}
|
|
@@ -11297,11 +11527,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11297
11527
|
validate = true
|
|
11298
11528
|
}) {
|
|
11299
11529
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
11300
|
-
const relativePath = isRoot ? (0,
|
|
11530
|
+
const relativePath = isRoot ? (0, import_node_path93.join)(
|
|
11301
11531
|
this.getSettablePaths().root.relativeDirPath,
|
|
11302
11532
|
this.getSettablePaths().root.relativeFilePath
|
|
11303
|
-
) : (0,
|
|
11304
|
-
const fileContent = await readFileContent((0,
|
|
11533
|
+
) : (0, import_node_path93.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
11534
|
+
const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
|
|
11305
11535
|
if (isRoot) {
|
|
11306
11536
|
return new _CopilotRule({
|
|
11307
11537
|
baseDir,
|
|
@@ -11317,7 +11547,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11317
11547
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11318
11548
|
if (!result.success) {
|
|
11319
11549
|
throw new Error(
|
|
11320
|
-
`Invalid frontmatter in ${(0,
|
|
11550
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
11321
11551
|
);
|
|
11322
11552
|
}
|
|
11323
11553
|
return new _CopilotRule({
|
|
@@ -11357,7 +11587,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11357
11587
|
return {
|
|
11358
11588
|
success: false,
|
|
11359
11589
|
error: new Error(
|
|
11360
|
-
`Invalid frontmatter in ${(0,
|
|
11590
|
+
`Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11361
11591
|
)
|
|
11362
11592
|
};
|
|
11363
11593
|
}
|
|
@@ -11377,7 +11607,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
11377
11607
|
};
|
|
11378
11608
|
|
|
11379
11609
|
// src/features/rules/cursor-rule.ts
|
|
11380
|
-
var
|
|
11610
|
+
var import_node_path94 = require("path");
|
|
11381
11611
|
var import_mini47 = require("zod/mini");
|
|
11382
11612
|
var CursorRuleFrontmatterSchema = import_mini47.z.object({
|
|
11383
11613
|
description: import_mini47.z.optional(import_mini47.z.string()),
|
|
@@ -11390,7 +11620,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
11390
11620
|
static getSettablePaths() {
|
|
11391
11621
|
return {
|
|
11392
11622
|
nonRoot: {
|
|
11393
|
-
relativeDirPath: (0,
|
|
11623
|
+
relativeDirPath: (0, import_node_path94.join)(".cursor", "rules")
|
|
11394
11624
|
}
|
|
11395
11625
|
};
|
|
11396
11626
|
}
|
|
@@ -11399,7 +11629,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
11399
11629
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11400
11630
|
if (!result.success) {
|
|
11401
11631
|
throw new Error(
|
|
11402
|
-
`Invalid frontmatter in ${(0,
|
|
11632
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
11403
11633
|
);
|
|
11404
11634
|
}
|
|
11405
11635
|
}
|
|
@@ -11516,13 +11746,13 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
11516
11746
|
validate = true
|
|
11517
11747
|
}) {
|
|
11518
11748
|
const fileContent = await readFileContent(
|
|
11519
|
-
(0,
|
|
11749
|
+
(0, import_node_path94.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
11520
11750
|
);
|
|
11521
11751
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
11522
11752
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
11523
11753
|
if (!result.success) {
|
|
11524
11754
|
throw new Error(
|
|
11525
|
-
`Invalid frontmatter in ${(0,
|
|
11755
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
11526
11756
|
);
|
|
11527
11757
|
}
|
|
11528
11758
|
return new _CursorRule({
|
|
@@ -11559,7 +11789,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
11559
11789
|
return {
|
|
11560
11790
|
success: false,
|
|
11561
11791
|
error: new Error(
|
|
11562
|
-
`Invalid frontmatter in ${(0,
|
|
11792
|
+
`Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
11563
11793
|
)
|
|
11564
11794
|
};
|
|
11565
11795
|
}
|
|
@@ -11578,8 +11808,107 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
11578
11808
|
}
|
|
11579
11809
|
};
|
|
11580
11810
|
|
|
11811
|
+
// src/features/rules/factorydroid-rule.ts
|
|
11812
|
+
var import_node_path95 = require("path");
|
|
11813
|
+
var FactorydroidRule = class _FactorydroidRule extends ToolRule {
|
|
11814
|
+
constructor({ fileContent, root, ...rest }) {
|
|
11815
|
+
super({
|
|
11816
|
+
...rest,
|
|
11817
|
+
fileContent,
|
|
11818
|
+
root: root ?? false
|
|
11819
|
+
});
|
|
11820
|
+
}
|
|
11821
|
+
static getSettablePaths(options) {
|
|
11822
|
+
if (options?.global) {
|
|
11823
|
+
return {
|
|
11824
|
+
root: {
|
|
11825
|
+
relativeDirPath: ".factorydroid",
|
|
11826
|
+
relativeFilePath: "AGENTS.md"
|
|
11827
|
+
},
|
|
11828
|
+
nonRoot: {
|
|
11829
|
+
relativeDirPath: (0, import_node_path95.join)(".factorydroid", "memories")
|
|
11830
|
+
}
|
|
11831
|
+
};
|
|
11832
|
+
}
|
|
11833
|
+
return {
|
|
11834
|
+
root: {
|
|
11835
|
+
relativeDirPath: ".factorydroid",
|
|
11836
|
+
relativeFilePath: "AGENTS.md"
|
|
11837
|
+
},
|
|
11838
|
+
nonRoot: {
|
|
11839
|
+
relativeDirPath: (0, import_node_path95.join)(".factorydroid", "memories")
|
|
11840
|
+
}
|
|
11841
|
+
};
|
|
11842
|
+
}
|
|
11843
|
+
static async fromFile({
|
|
11844
|
+
baseDir = process.cwd(),
|
|
11845
|
+
relativeFilePath,
|
|
11846
|
+
validate = true,
|
|
11847
|
+
global = false
|
|
11848
|
+
}) {
|
|
11849
|
+
const paths = this.getSettablePaths({ global });
|
|
11850
|
+
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
11851
|
+
const relativePath = isRoot ? (0, import_node_path95.join)(paths.root.relativeDirPath, paths.root.relativeFilePath) : (0, import_node_path95.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
11852
|
+
const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
|
|
11853
|
+
return new _FactorydroidRule({
|
|
11854
|
+
baseDir,
|
|
11855
|
+
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
11856
|
+
relativeFilePath: isRoot ? paths.root.relativeFilePath : relativeFilePath,
|
|
11857
|
+
fileContent,
|
|
11858
|
+
validate,
|
|
11859
|
+
root: isRoot
|
|
11860
|
+
});
|
|
11861
|
+
}
|
|
11862
|
+
static forDeletion({
|
|
11863
|
+
baseDir = process.cwd(),
|
|
11864
|
+
relativeDirPath,
|
|
11865
|
+
relativeFilePath,
|
|
11866
|
+
global = false
|
|
11867
|
+
}) {
|
|
11868
|
+
const paths = this.getSettablePaths({ global });
|
|
11869
|
+
const isRoot = relativeFilePath === "AGENTS.md" && relativeDirPath === paths.root.relativeDirPath;
|
|
11870
|
+
return new _FactorydroidRule({
|
|
11871
|
+
baseDir,
|
|
11872
|
+
relativeDirPath,
|
|
11873
|
+
relativeFilePath,
|
|
11874
|
+
fileContent: "",
|
|
11875
|
+
validate: false,
|
|
11876
|
+
root: isRoot
|
|
11877
|
+
});
|
|
11878
|
+
}
|
|
11879
|
+
static fromRulesyncRule({
|
|
11880
|
+
baseDir = process.cwd(),
|
|
11881
|
+
rulesyncRule,
|
|
11882
|
+
validate = true,
|
|
11883
|
+
global = false
|
|
11884
|
+
}) {
|
|
11885
|
+
const paths = this.getSettablePaths({ global });
|
|
11886
|
+
return new _FactorydroidRule(
|
|
11887
|
+
this.buildToolRuleParamsAgentsmd({
|
|
11888
|
+
baseDir,
|
|
11889
|
+
rulesyncRule,
|
|
11890
|
+
validate,
|
|
11891
|
+
rootPath: paths.root,
|
|
11892
|
+
nonRootPath: paths.nonRoot
|
|
11893
|
+
})
|
|
11894
|
+
);
|
|
11895
|
+
}
|
|
11896
|
+
toRulesyncRule() {
|
|
11897
|
+
return this.toRulesyncRuleDefault();
|
|
11898
|
+
}
|
|
11899
|
+
validate() {
|
|
11900
|
+
return { success: true, error: null };
|
|
11901
|
+
}
|
|
11902
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
11903
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
11904
|
+
rulesyncRule,
|
|
11905
|
+
toolTarget: "factorydroid"
|
|
11906
|
+
});
|
|
11907
|
+
}
|
|
11908
|
+
};
|
|
11909
|
+
|
|
11581
11910
|
// src/features/rules/geminicli-rule.ts
|
|
11582
|
-
var
|
|
11911
|
+
var import_node_path96 = require("path");
|
|
11583
11912
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
11584
11913
|
static getSettablePaths({
|
|
11585
11914
|
global
|
|
@@ -11598,7 +11927,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
11598
11927
|
relativeFilePath: "GEMINI.md"
|
|
11599
11928
|
},
|
|
11600
11929
|
nonRoot: {
|
|
11601
|
-
relativeDirPath: (0,
|
|
11930
|
+
relativeDirPath: (0, import_node_path96.join)(".gemini", "memories")
|
|
11602
11931
|
}
|
|
11603
11932
|
};
|
|
11604
11933
|
}
|
|
@@ -11613,7 +11942,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
11613
11942
|
if (isRoot) {
|
|
11614
11943
|
const relativePath2 = paths.root.relativeFilePath;
|
|
11615
11944
|
const fileContent2 = await readFileContent(
|
|
11616
|
-
(0,
|
|
11945
|
+
(0, import_node_path96.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
11617
11946
|
);
|
|
11618
11947
|
return new _GeminiCliRule({
|
|
11619
11948
|
baseDir,
|
|
@@ -11627,8 +11956,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
11627
11956
|
if (!paths.nonRoot) {
|
|
11628
11957
|
throw new Error("nonRoot path is not set");
|
|
11629
11958
|
}
|
|
11630
|
-
const relativePath = (0,
|
|
11631
|
-
const fileContent = await readFileContent((0,
|
|
11959
|
+
const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
11960
|
+
const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
|
|
11632
11961
|
return new _GeminiCliRule({
|
|
11633
11962
|
baseDir,
|
|
11634
11963
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -11687,7 +12016,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
11687
12016
|
};
|
|
11688
12017
|
|
|
11689
12018
|
// src/features/rules/junie-rule.ts
|
|
11690
|
-
var
|
|
12019
|
+
var import_node_path97 = require("path");
|
|
11691
12020
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
11692
12021
|
static getSettablePaths() {
|
|
11693
12022
|
return {
|
|
@@ -11696,7 +12025,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
11696
12025
|
relativeFilePath: "guidelines.md"
|
|
11697
12026
|
},
|
|
11698
12027
|
nonRoot: {
|
|
11699
|
-
relativeDirPath: (0,
|
|
12028
|
+
relativeDirPath: (0, import_node_path97.join)(".junie", "memories")
|
|
11700
12029
|
}
|
|
11701
12030
|
};
|
|
11702
12031
|
}
|
|
@@ -11706,8 +12035,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
11706
12035
|
validate = true
|
|
11707
12036
|
}) {
|
|
11708
12037
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
11709
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
11710
|
-
const fileContent = await readFileContent((0,
|
|
12038
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path97.join)(".junie", "memories", relativeFilePath);
|
|
12039
|
+
const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
|
|
11711
12040
|
return new _JunieRule({
|
|
11712
12041
|
baseDir,
|
|
11713
12042
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -11762,12 +12091,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
11762
12091
|
};
|
|
11763
12092
|
|
|
11764
12093
|
// src/features/rules/kilo-rule.ts
|
|
11765
|
-
var
|
|
12094
|
+
var import_node_path98 = require("path");
|
|
11766
12095
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
11767
12096
|
static getSettablePaths(_options = {}) {
|
|
11768
12097
|
return {
|
|
11769
12098
|
nonRoot: {
|
|
11770
|
-
relativeDirPath: (0,
|
|
12099
|
+
relativeDirPath: (0, import_node_path98.join)(".kilocode", "rules")
|
|
11771
12100
|
}
|
|
11772
12101
|
};
|
|
11773
12102
|
}
|
|
@@ -11777,7 +12106,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
11777
12106
|
validate = true
|
|
11778
12107
|
}) {
|
|
11779
12108
|
const fileContent = await readFileContent(
|
|
11780
|
-
(0,
|
|
12109
|
+
(0, import_node_path98.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
11781
12110
|
);
|
|
11782
12111
|
return new _KiloRule({
|
|
11783
12112
|
baseDir,
|
|
@@ -11829,12 +12158,12 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
11829
12158
|
};
|
|
11830
12159
|
|
|
11831
12160
|
// src/features/rules/kiro-rule.ts
|
|
11832
|
-
var
|
|
12161
|
+
var import_node_path99 = require("path");
|
|
11833
12162
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
11834
12163
|
static getSettablePaths() {
|
|
11835
12164
|
return {
|
|
11836
12165
|
nonRoot: {
|
|
11837
|
-
relativeDirPath: (0,
|
|
12166
|
+
relativeDirPath: (0, import_node_path99.join)(".kiro", "steering")
|
|
11838
12167
|
}
|
|
11839
12168
|
};
|
|
11840
12169
|
}
|
|
@@ -11844,7 +12173,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
11844
12173
|
validate = true
|
|
11845
12174
|
}) {
|
|
11846
12175
|
const fileContent = await readFileContent(
|
|
11847
|
-
(0,
|
|
12176
|
+
(0, import_node_path99.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
11848
12177
|
);
|
|
11849
12178
|
return new _KiroRule({
|
|
11850
12179
|
baseDir,
|
|
@@ -11898,7 +12227,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
11898
12227
|
};
|
|
11899
12228
|
|
|
11900
12229
|
// src/features/rules/opencode-rule.ts
|
|
11901
|
-
var
|
|
12230
|
+
var import_node_path100 = require("path");
|
|
11902
12231
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
11903
12232
|
static getSettablePaths() {
|
|
11904
12233
|
return {
|
|
@@ -11907,7 +12236,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
11907
12236
|
relativeFilePath: "AGENTS.md"
|
|
11908
12237
|
},
|
|
11909
12238
|
nonRoot: {
|
|
11910
|
-
relativeDirPath: (0,
|
|
12239
|
+
relativeDirPath: (0, import_node_path100.join)(".opencode", "memories")
|
|
11911
12240
|
}
|
|
11912
12241
|
};
|
|
11913
12242
|
}
|
|
@@ -11917,8 +12246,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
11917
12246
|
validate = true
|
|
11918
12247
|
}) {
|
|
11919
12248
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
11920
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
11921
|
-
const fileContent = await readFileContent((0,
|
|
12249
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path100.join)(".opencode", "memories", relativeFilePath);
|
|
12250
|
+
const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
|
|
11922
12251
|
return new _OpenCodeRule({
|
|
11923
12252
|
baseDir,
|
|
11924
12253
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -11973,7 +12302,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
11973
12302
|
};
|
|
11974
12303
|
|
|
11975
12304
|
// src/features/rules/qwencode-rule.ts
|
|
11976
|
-
var
|
|
12305
|
+
var import_node_path101 = require("path");
|
|
11977
12306
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
11978
12307
|
static getSettablePaths() {
|
|
11979
12308
|
return {
|
|
@@ -11982,7 +12311,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
11982
12311
|
relativeFilePath: "QWEN.md"
|
|
11983
12312
|
},
|
|
11984
12313
|
nonRoot: {
|
|
11985
|
-
relativeDirPath: (0,
|
|
12314
|
+
relativeDirPath: (0, import_node_path101.join)(".qwen", "memories")
|
|
11986
12315
|
}
|
|
11987
12316
|
};
|
|
11988
12317
|
}
|
|
@@ -11992,8 +12321,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
11992
12321
|
validate = true
|
|
11993
12322
|
}) {
|
|
11994
12323
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
11995
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
11996
|
-
const fileContent = await readFileContent((0,
|
|
12324
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path101.join)(".qwen", "memories", relativeFilePath);
|
|
12325
|
+
const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
|
|
11997
12326
|
return new _QwencodeRule({
|
|
11998
12327
|
baseDir,
|
|
11999
12328
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -12045,7 +12374,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
12045
12374
|
};
|
|
12046
12375
|
|
|
12047
12376
|
// src/features/rules/replit-rule.ts
|
|
12048
|
-
var
|
|
12377
|
+
var import_node_path102 = require("path");
|
|
12049
12378
|
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
12050
12379
|
static getSettablePaths() {
|
|
12051
12380
|
return {
|
|
@@ -12067,7 +12396,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
12067
12396
|
}
|
|
12068
12397
|
const relativePath = paths.root.relativeFilePath;
|
|
12069
12398
|
const fileContent = await readFileContent(
|
|
12070
|
-
(0,
|
|
12399
|
+
(0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
12071
12400
|
);
|
|
12072
12401
|
return new _ReplitRule({
|
|
12073
12402
|
baseDir,
|
|
@@ -12133,12 +12462,12 @@ var ReplitRule = class _ReplitRule extends ToolRule {
|
|
|
12133
12462
|
};
|
|
12134
12463
|
|
|
12135
12464
|
// src/features/rules/roo-rule.ts
|
|
12136
|
-
var
|
|
12465
|
+
var import_node_path103 = require("path");
|
|
12137
12466
|
var RooRule = class _RooRule extends ToolRule {
|
|
12138
12467
|
static getSettablePaths() {
|
|
12139
12468
|
return {
|
|
12140
12469
|
nonRoot: {
|
|
12141
|
-
relativeDirPath: (0,
|
|
12470
|
+
relativeDirPath: (0, import_node_path103.join)(".roo", "rules")
|
|
12142
12471
|
}
|
|
12143
12472
|
};
|
|
12144
12473
|
}
|
|
@@ -12148,7 +12477,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
12148
12477
|
validate = true
|
|
12149
12478
|
}) {
|
|
12150
12479
|
const fileContent = await readFileContent(
|
|
12151
|
-
(0,
|
|
12480
|
+
(0, import_node_path103.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12152
12481
|
);
|
|
12153
12482
|
return new _RooRule({
|
|
12154
12483
|
baseDir,
|
|
@@ -12217,7 +12546,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
12217
12546
|
};
|
|
12218
12547
|
|
|
12219
12548
|
// src/features/rules/warp-rule.ts
|
|
12220
|
-
var
|
|
12549
|
+
var import_node_path104 = require("path");
|
|
12221
12550
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
12222
12551
|
constructor({ fileContent, root, ...rest }) {
|
|
12223
12552
|
super({
|
|
@@ -12233,7 +12562,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
12233
12562
|
relativeFilePath: "WARP.md"
|
|
12234
12563
|
},
|
|
12235
12564
|
nonRoot: {
|
|
12236
|
-
relativeDirPath: (0,
|
|
12565
|
+
relativeDirPath: (0, import_node_path104.join)(".warp", "memories")
|
|
12237
12566
|
}
|
|
12238
12567
|
};
|
|
12239
12568
|
}
|
|
@@ -12243,8 +12572,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
12243
12572
|
validate = true
|
|
12244
12573
|
}) {
|
|
12245
12574
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
12246
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
12247
|
-
const fileContent = await readFileContent((0,
|
|
12575
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path104.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
12576
|
+
const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
|
|
12248
12577
|
return new _WarpRule({
|
|
12249
12578
|
baseDir,
|
|
12250
12579
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -12299,12 +12628,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
12299
12628
|
};
|
|
12300
12629
|
|
|
12301
12630
|
// src/features/rules/windsurf-rule.ts
|
|
12302
|
-
var
|
|
12631
|
+
var import_node_path105 = require("path");
|
|
12303
12632
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
12304
12633
|
static getSettablePaths() {
|
|
12305
12634
|
return {
|
|
12306
12635
|
nonRoot: {
|
|
12307
|
-
relativeDirPath: (0,
|
|
12636
|
+
relativeDirPath: (0, import_node_path105.join)(".windsurf", "rules")
|
|
12308
12637
|
}
|
|
12309
12638
|
};
|
|
12310
12639
|
}
|
|
@@ -12314,7 +12643,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
12314
12643
|
validate = true
|
|
12315
12644
|
}) {
|
|
12316
12645
|
const fileContent = await readFileContent(
|
|
12317
|
-
(0,
|
|
12646
|
+
(0, import_node_path105.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
12318
12647
|
);
|
|
12319
12648
|
return new _WindsurfRule({
|
|
12320
12649
|
baseDir,
|
|
@@ -12377,6 +12706,7 @@ var rulesProcessorToolTargets = [
|
|
|
12377
12706
|
"codexcli",
|
|
12378
12707
|
"copilot",
|
|
12379
12708
|
"cursor",
|
|
12709
|
+
"factorydroid",
|
|
12380
12710
|
"geminicli",
|
|
12381
12711
|
"junie",
|
|
12382
12712
|
"kilo",
|
|
@@ -12484,6 +12814,22 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
12484
12814
|
}
|
|
12485
12815
|
}
|
|
12486
12816
|
],
|
|
12817
|
+
[
|
|
12818
|
+
"factorydroid",
|
|
12819
|
+
{
|
|
12820
|
+
class: FactorydroidRule,
|
|
12821
|
+
meta: {
|
|
12822
|
+
extension: "md",
|
|
12823
|
+
supportsGlobal: true,
|
|
12824
|
+
ruleDiscoveryMode: "toon",
|
|
12825
|
+
additionalConventions: {
|
|
12826
|
+
commands: { commandClass: FactorydroidCommand },
|
|
12827
|
+
subagents: { subagentClass: FactorydroidSubagent },
|
|
12828
|
+
skills: { skillClass: FactorydroidSkill }
|
|
12829
|
+
}
|
|
12830
|
+
}
|
|
12831
|
+
}
|
|
12832
|
+
],
|
|
12487
12833
|
[
|
|
12488
12834
|
"geminicli",
|
|
12489
12835
|
{
|
|
@@ -12683,7 +13029,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12683
13029
|
}).relativeDirPath;
|
|
12684
13030
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
12685
13031
|
const frontmatter = skill.getFrontmatter();
|
|
12686
|
-
const relativePath = (0,
|
|
13032
|
+
const relativePath = (0, import_node_path106.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
12687
13033
|
return {
|
|
12688
13034
|
name: frontmatter.name,
|
|
12689
13035
|
description: frontmatter.description,
|
|
@@ -12794,12 +13140,12 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12794
13140
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
12795
13141
|
*/
|
|
12796
13142
|
async loadRulesyncFiles() {
|
|
12797
|
-
const rulesyncBaseDir = (0,
|
|
12798
|
-
const files = await findFilesByGlobs((0,
|
|
13143
|
+
const rulesyncBaseDir = (0, import_node_path106.join)(this.baseDir, RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
13144
|
+
const files = await findFilesByGlobs((0, import_node_path106.join)(rulesyncBaseDir, "**", "*.md"));
|
|
12799
13145
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
12800
13146
|
const rulesyncRules = await Promise.all(
|
|
12801
13147
|
files.map((file) => {
|
|
12802
|
-
const relativeFilePath = (0,
|
|
13148
|
+
const relativeFilePath = (0, import_node_path106.relative)(rulesyncBaseDir, file);
|
|
12803
13149
|
checkPathTraversal({ relativePath: relativeFilePath, intendedRootDir: rulesyncBaseDir });
|
|
12804
13150
|
return RulesyncRule.fromFile({
|
|
12805
13151
|
relativeFilePath
|
|
@@ -12853,7 +13199,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12853
13199
|
return [];
|
|
12854
13200
|
}
|
|
12855
13201
|
const rootFilePaths = await findFilesByGlobs(
|
|
12856
|
-
(0,
|
|
13202
|
+
(0, import_node_path106.join)(
|
|
12857
13203
|
this.baseDir,
|
|
12858
13204
|
settablePaths.root.relativeDirPath ?? ".",
|
|
12859
13205
|
settablePaths.root.relativeFilePath
|
|
@@ -12864,7 +13210,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12864
13210
|
(filePath) => factory.class.forDeletion({
|
|
12865
13211
|
baseDir: this.baseDir,
|
|
12866
13212
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
12867
|
-
relativeFilePath: (0,
|
|
13213
|
+
relativeFilePath: (0, import_node_path106.basename)(filePath),
|
|
12868
13214
|
global: this.global
|
|
12869
13215
|
})
|
|
12870
13216
|
).filter((rule) => rule.isDeletable());
|
|
@@ -12873,7 +13219,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12873
13219
|
rootFilePaths.map(
|
|
12874
13220
|
(filePath) => factory.class.fromFile({
|
|
12875
13221
|
baseDir: this.baseDir,
|
|
12876
|
-
relativeFilePath: (0,
|
|
13222
|
+
relativeFilePath: (0, import_node_path106.basename)(filePath),
|
|
12877
13223
|
global: this.global
|
|
12878
13224
|
})
|
|
12879
13225
|
)
|
|
@@ -12891,13 +13237,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12891
13237
|
return [];
|
|
12892
13238
|
}
|
|
12893
13239
|
const localRootFilePaths = await findFilesByGlobs(
|
|
12894
|
-
(0,
|
|
13240
|
+
(0, import_node_path106.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
|
|
12895
13241
|
);
|
|
12896
13242
|
return localRootFilePaths.map(
|
|
12897
13243
|
(filePath) => factory.class.forDeletion({
|
|
12898
13244
|
baseDir: this.baseDir,
|
|
12899
13245
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
12900
|
-
relativeFilePath: (0,
|
|
13246
|
+
relativeFilePath: (0, import_node_path106.basename)(filePath),
|
|
12901
13247
|
global: this.global
|
|
12902
13248
|
})
|
|
12903
13249
|
).filter((rule) => rule.isDeletable());
|
|
@@ -12907,13 +13253,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12907
13253
|
if (!settablePaths.nonRoot) {
|
|
12908
13254
|
return [];
|
|
12909
13255
|
}
|
|
12910
|
-
const nonRootBaseDir = (0,
|
|
13256
|
+
const nonRootBaseDir = (0, import_node_path106.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
|
|
12911
13257
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
12912
|
-
(0,
|
|
13258
|
+
(0, import_node_path106.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
|
|
12913
13259
|
);
|
|
12914
13260
|
if (forDeletion) {
|
|
12915
13261
|
return nonRootFilePaths.map((filePath) => {
|
|
12916
|
-
const relativeFilePath = (0,
|
|
13262
|
+
const relativeFilePath = (0, import_node_path106.relative)(nonRootBaseDir, filePath);
|
|
12917
13263
|
checkPathTraversal({
|
|
12918
13264
|
relativePath: relativeFilePath,
|
|
12919
13265
|
intendedRootDir: nonRootBaseDir
|
|
@@ -12928,7 +13274,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
12928
13274
|
}
|
|
12929
13275
|
return await Promise.all(
|
|
12930
13276
|
nonRootFilePaths.map((filePath) => {
|
|
12931
|
-
const relativeFilePath = (0,
|
|
13277
|
+
const relativeFilePath = (0, import_node_path106.relative)(nonRootBaseDir, filePath);
|
|
12932
13278
|
checkPathTraversal({ relativePath: relativeFilePath, intendedRootDir: nonRootBaseDir });
|
|
12933
13279
|
return factory.class.fromFile({
|
|
12934
13280
|
baseDir: this.baseDir,
|
|
@@ -13025,14 +13371,14 @@ s/<command> [arguments]
|
|
|
13025
13371
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
13026
13372
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
13027
13373
|
|
|
13028
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
13374
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path106.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
13029
13375
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
13030
13376
|
|
|
13031
13377
|
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.
|
|
13032
13378
|
|
|
13033
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
13379
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path106.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
13034
13380
|
|
|
13035
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
13381
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path106.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
13036
13382
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
13037
13383
|
const result = [
|
|
13038
13384
|
overview,
|
|
@@ -13061,7 +13407,7 @@ ${toonContent}`;
|
|
|
13061
13407
|
|
|
13062
13408
|
// src/lib/generate.ts
|
|
13063
13409
|
async function checkRulesyncDirExists(params) {
|
|
13064
|
-
return fileExists((0,
|
|
13410
|
+
return fileExists((0, import_node_path107.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
|
|
13065
13411
|
}
|
|
13066
13412
|
async function generate(params) {
|
|
13067
13413
|
const { config } = params;
|
|
@@ -13395,7 +13741,7 @@ async function generateCommand(options) {
|
|
|
13395
13741
|
}
|
|
13396
13742
|
|
|
13397
13743
|
// src/cli/commands/gitignore.ts
|
|
13398
|
-
var
|
|
13744
|
+
var import_node_path108 = require("path");
|
|
13399
13745
|
var RULESYNC_HEADER = "# Generated by Rulesync";
|
|
13400
13746
|
var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
|
|
13401
13747
|
var RULESYNC_IGNORE_ENTRIES = [
|
|
@@ -13435,6 +13781,13 @@ var RULESYNC_IGNORE_ENTRIES = [
|
|
|
13435
13781
|
// Cursor
|
|
13436
13782
|
"**/.cursor/",
|
|
13437
13783
|
"**/.cursorignore",
|
|
13784
|
+
// Factory Droid
|
|
13785
|
+
"**/.factorydroid/AGENTS.md",
|
|
13786
|
+
"**/.factorydroid/memories/",
|
|
13787
|
+
"**/.factorydroid/commands/",
|
|
13788
|
+
"**/.factorydroid/droids/",
|
|
13789
|
+
"**/.factorydroid/skills/",
|
|
13790
|
+
"**/.factorydroid/mcp.json",
|
|
13438
13791
|
// Gemini
|
|
13439
13792
|
"**/GEMINI.md",
|
|
13440
13793
|
"**/.gemini/memories/",
|
|
@@ -13540,7 +13893,7 @@ var removeExistingRulesyncEntries = (content) => {
|
|
|
13540
13893
|
return result;
|
|
13541
13894
|
};
|
|
13542
13895
|
var gitignoreCommand = async () => {
|
|
13543
|
-
const gitignorePath = (0,
|
|
13896
|
+
const gitignorePath = (0, import_node_path108.join)(process.cwd(), ".gitignore");
|
|
13544
13897
|
let gitignoreContent = "";
|
|
13545
13898
|
if (await fileExists(gitignorePath)) {
|
|
13546
13899
|
gitignoreContent = await readFileContent(gitignorePath);
|
|
@@ -13806,7 +14159,7 @@ async function importCommand(options) {
|
|
|
13806
14159
|
}
|
|
13807
14160
|
|
|
13808
14161
|
// src/cli/commands/init.ts
|
|
13809
|
-
var
|
|
14162
|
+
var import_node_path109 = require("path");
|
|
13810
14163
|
async function initCommand() {
|
|
13811
14164
|
logger.info("Initializing rulesync...");
|
|
13812
14165
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -13985,14 +14338,14 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
13985
14338
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
13986
14339
|
await ensureDir(skillPaths.relativeDirPath);
|
|
13987
14340
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
13988
|
-
const ruleFilepath = (0,
|
|
14341
|
+
const ruleFilepath = (0, import_node_path109.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
13989
14342
|
if (!await fileExists(ruleFilepath)) {
|
|
13990
14343
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
13991
14344
|
logger.success(`Created ${ruleFilepath}`);
|
|
13992
14345
|
} else {
|
|
13993
14346
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
13994
14347
|
}
|
|
13995
|
-
const mcpFilepath = (0,
|
|
14348
|
+
const mcpFilepath = (0, import_node_path109.join)(
|
|
13996
14349
|
mcpPaths.recommended.relativeDirPath,
|
|
13997
14350
|
mcpPaths.recommended.relativeFilePath
|
|
13998
14351
|
);
|
|
@@ -14002,30 +14355,30 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
14002
14355
|
} else {
|
|
14003
14356
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
14004
14357
|
}
|
|
14005
|
-
const commandFilepath = (0,
|
|
14358
|
+
const commandFilepath = (0, import_node_path109.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
14006
14359
|
if (!await fileExists(commandFilepath)) {
|
|
14007
14360
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
14008
14361
|
logger.success(`Created ${commandFilepath}`);
|
|
14009
14362
|
} else {
|
|
14010
14363
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
14011
14364
|
}
|
|
14012
|
-
const subagentFilepath = (0,
|
|
14365
|
+
const subagentFilepath = (0, import_node_path109.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
14013
14366
|
if (!await fileExists(subagentFilepath)) {
|
|
14014
14367
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
14015
14368
|
logger.success(`Created ${subagentFilepath}`);
|
|
14016
14369
|
} else {
|
|
14017
14370
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
14018
14371
|
}
|
|
14019
|
-
const skillDirPath = (0,
|
|
14372
|
+
const skillDirPath = (0, import_node_path109.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
|
|
14020
14373
|
await ensureDir(skillDirPath);
|
|
14021
|
-
const skillFilepath = (0,
|
|
14374
|
+
const skillFilepath = (0, import_node_path109.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14022
14375
|
if (!await fileExists(skillFilepath)) {
|
|
14023
14376
|
await writeFileContent(skillFilepath, sampleSkillFile.content);
|
|
14024
14377
|
logger.success(`Created ${skillFilepath}`);
|
|
14025
14378
|
} else {
|
|
14026
14379
|
logger.info(`Skipped ${skillFilepath} (already exists)`);
|
|
14027
14380
|
}
|
|
14028
|
-
const ignoreFilepath = (0,
|
|
14381
|
+
const ignoreFilepath = (0, import_node_path109.join)(
|
|
14029
14382
|
ignorePaths.recommended.relativeDirPath,
|
|
14030
14383
|
ignorePaths.recommended.relativeFilePath
|
|
14031
14384
|
);
|
|
@@ -14044,12 +14397,12 @@ var import_fastmcp = require("fastmcp");
|
|
|
14044
14397
|
var import_mini55 = require("zod/mini");
|
|
14045
14398
|
|
|
14046
14399
|
// src/mcp/commands.ts
|
|
14047
|
-
var
|
|
14400
|
+
var import_node_path110 = require("path");
|
|
14048
14401
|
var import_mini49 = require("zod/mini");
|
|
14049
14402
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
14050
14403
|
var maxCommandsCount = 1e3;
|
|
14051
14404
|
async function listCommands() {
|
|
14052
|
-
const commandsDir = (0,
|
|
14405
|
+
const commandsDir = (0, import_node_path110.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
14053
14406
|
try {
|
|
14054
14407
|
const files = await listDirectoryFiles(commandsDir);
|
|
14055
14408
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -14061,7 +14414,7 @@ async function listCommands() {
|
|
|
14061
14414
|
});
|
|
14062
14415
|
const frontmatter = command.getFrontmatter();
|
|
14063
14416
|
return {
|
|
14064
|
-
relativePathFromCwd: (0,
|
|
14417
|
+
relativePathFromCwd: (0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
14065
14418
|
frontmatter
|
|
14066
14419
|
};
|
|
14067
14420
|
} catch (error) {
|
|
@@ -14081,13 +14434,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
14081
14434
|
relativePath: relativePathFromCwd,
|
|
14082
14435
|
intendedRootDir: process.cwd()
|
|
14083
14436
|
});
|
|
14084
|
-
const filename = (0,
|
|
14437
|
+
const filename = (0, import_node_path110.basename)(relativePathFromCwd);
|
|
14085
14438
|
try {
|
|
14086
14439
|
const command = await RulesyncCommand.fromFile({
|
|
14087
14440
|
relativeFilePath: filename
|
|
14088
14441
|
});
|
|
14089
14442
|
return {
|
|
14090
|
-
relativePathFromCwd: (0,
|
|
14443
|
+
relativePathFromCwd: (0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
14091
14444
|
frontmatter: command.getFrontmatter(),
|
|
14092
14445
|
body: command.getBody()
|
|
14093
14446
|
};
|
|
@@ -14106,7 +14459,7 @@ async function putCommand({
|
|
|
14106
14459
|
relativePath: relativePathFromCwd,
|
|
14107
14460
|
intendedRootDir: process.cwd()
|
|
14108
14461
|
});
|
|
14109
|
-
const filename = (0,
|
|
14462
|
+
const filename = (0, import_node_path110.basename)(relativePathFromCwd);
|
|
14110
14463
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
14111
14464
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
14112
14465
|
throw new Error(
|
|
@@ -14116,7 +14469,7 @@ async function putCommand({
|
|
|
14116
14469
|
try {
|
|
14117
14470
|
const existingCommands = await listCommands();
|
|
14118
14471
|
const isUpdate = existingCommands.some(
|
|
14119
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
14472
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
14120
14473
|
);
|
|
14121
14474
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
14122
14475
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -14131,11 +14484,11 @@ async function putCommand({
|
|
|
14131
14484
|
fileContent,
|
|
14132
14485
|
validate: true
|
|
14133
14486
|
});
|
|
14134
|
-
const commandsDir = (0,
|
|
14487
|
+
const commandsDir = (0, import_node_path110.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
14135
14488
|
await ensureDir(commandsDir);
|
|
14136
14489
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
14137
14490
|
return {
|
|
14138
|
-
relativePathFromCwd: (0,
|
|
14491
|
+
relativePathFromCwd: (0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
14139
14492
|
frontmatter: command.getFrontmatter(),
|
|
14140
14493
|
body: command.getBody()
|
|
14141
14494
|
};
|
|
@@ -14150,12 +14503,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
14150
14503
|
relativePath: relativePathFromCwd,
|
|
14151
14504
|
intendedRootDir: process.cwd()
|
|
14152
14505
|
});
|
|
14153
|
-
const filename = (0,
|
|
14154
|
-
const fullPath = (0,
|
|
14506
|
+
const filename = (0, import_node_path110.basename)(relativePathFromCwd);
|
|
14507
|
+
const fullPath = (0, import_node_path110.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
14155
14508
|
try {
|
|
14156
14509
|
await removeFile(fullPath);
|
|
14157
14510
|
return {
|
|
14158
|
-
relativePathFromCwd: (0,
|
|
14511
|
+
relativePathFromCwd: (0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
14159
14512
|
};
|
|
14160
14513
|
} catch (error) {
|
|
14161
14514
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -14180,7 +14533,7 @@ var commandToolSchemas = {
|
|
|
14180
14533
|
var commandTools = {
|
|
14181
14534
|
listCommands: {
|
|
14182
14535
|
name: "listCommands",
|
|
14183
|
-
description: `List all commands from ${(0,
|
|
14536
|
+
description: `List all commands from ${(0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
14184
14537
|
parameters: commandToolSchemas.listCommands,
|
|
14185
14538
|
execute: async () => {
|
|
14186
14539
|
const commands = await listCommands();
|
|
@@ -14222,11 +14575,11 @@ var commandTools = {
|
|
|
14222
14575
|
};
|
|
14223
14576
|
|
|
14224
14577
|
// src/mcp/ignore.ts
|
|
14225
|
-
var
|
|
14578
|
+
var import_node_path111 = require("path");
|
|
14226
14579
|
var import_mini50 = require("zod/mini");
|
|
14227
14580
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
14228
14581
|
async function getIgnoreFile() {
|
|
14229
|
-
const ignoreFilePath = (0,
|
|
14582
|
+
const ignoreFilePath = (0, import_node_path111.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
14230
14583
|
try {
|
|
14231
14584
|
const content = await readFileContent(ignoreFilePath);
|
|
14232
14585
|
return {
|
|
@@ -14240,7 +14593,7 @@ async function getIgnoreFile() {
|
|
|
14240
14593
|
}
|
|
14241
14594
|
}
|
|
14242
14595
|
async function putIgnoreFile({ content }) {
|
|
14243
|
-
const ignoreFilePath = (0,
|
|
14596
|
+
const ignoreFilePath = (0, import_node_path111.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
14244
14597
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
14245
14598
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
14246
14599
|
throw new Error(
|
|
@@ -14261,8 +14614,8 @@ async function putIgnoreFile({ content }) {
|
|
|
14261
14614
|
}
|
|
14262
14615
|
}
|
|
14263
14616
|
async function deleteIgnoreFile() {
|
|
14264
|
-
const aiignorePath = (0,
|
|
14265
|
-
const legacyIgnorePath = (0,
|
|
14617
|
+
const aiignorePath = (0, import_node_path111.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
14618
|
+
const legacyIgnorePath = (0, import_node_path111.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
14266
14619
|
try {
|
|
14267
14620
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
14268
14621
|
return {
|
|
@@ -14317,7 +14670,7 @@ var ignoreTools = {
|
|
|
14317
14670
|
};
|
|
14318
14671
|
|
|
14319
14672
|
// src/mcp/mcp.ts
|
|
14320
|
-
var
|
|
14673
|
+
var import_node_path112 = require("path");
|
|
14321
14674
|
var import_mini51 = require("zod/mini");
|
|
14322
14675
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
14323
14676
|
async function getMcpFile() {
|
|
@@ -14327,7 +14680,7 @@ async function getMcpFile() {
|
|
|
14327
14680
|
validate: true,
|
|
14328
14681
|
modularMcp: config.getModularMcp()
|
|
14329
14682
|
});
|
|
14330
|
-
const relativePathFromCwd = (0,
|
|
14683
|
+
const relativePathFromCwd = (0, import_node_path112.join)(
|
|
14331
14684
|
rulesyncMcp.getRelativeDirPath(),
|
|
14332
14685
|
rulesyncMcp.getRelativeFilePath()
|
|
14333
14686
|
);
|
|
@@ -14360,7 +14713,7 @@ async function putMcpFile({ content }) {
|
|
|
14360
14713
|
const paths = RulesyncMcp.getSettablePaths();
|
|
14361
14714
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
14362
14715
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
14363
|
-
const fullPath = (0,
|
|
14716
|
+
const fullPath = (0, import_node_path112.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
14364
14717
|
const rulesyncMcp = new RulesyncMcp({
|
|
14365
14718
|
baseDir,
|
|
14366
14719
|
relativeDirPath,
|
|
@@ -14369,9 +14722,9 @@ async function putMcpFile({ content }) {
|
|
|
14369
14722
|
validate: true,
|
|
14370
14723
|
modularMcp: config.getModularMcp()
|
|
14371
14724
|
});
|
|
14372
|
-
await ensureDir((0,
|
|
14725
|
+
await ensureDir((0, import_node_path112.join)(baseDir, relativeDirPath));
|
|
14373
14726
|
await writeFileContent(fullPath, content);
|
|
14374
|
-
const relativePathFromCwd = (0,
|
|
14727
|
+
const relativePathFromCwd = (0, import_node_path112.join)(relativeDirPath, relativeFilePath);
|
|
14375
14728
|
return {
|
|
14376
14729
|
relativePathFromCwd,
|
|
14377
14730
|
content: rulesyncMcp.getFileContent()
|
|
@@ -14386,15 +14739,15 @@ async function deleteMcpFile() {
|
|
|
14386
14739
|
try {
|
|
14387
14740
|
const baseDir = process.cwd();
|
|
14388
14741
|
const paths = RulesyncMcp.getSettablePaths();
|
|
14389
|
-
const recommendedPath = (0,
|
|
14742
|
+
const recommendedPath = (0, import_node_path112.join)(
|
|
14390
14743
|
baseDir,
|
|
14391
14744
|
paths.recommended.relativeDirPath,
|
|
14392
14745
|
paths.recommended.relativeFilePath
|
|
14393
14746
|
);
|
|
14394
|
-
const legacyPath = (0,
|
|
14747
|
+
const legacyPath = (0, import_node_path112.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
14395
14748
|
await removeFile(recommendedPath);
|
|
14396
14749
|
await removeFile(legacyPath);
|
|
14397
|
-
const relativePathFromCwd = (0,
|
|
14750
|
+
const relativePathFromCwd = (0, import_node_path112.join)(
|
|
14398
14751
|
paths.recommended.relativeDirPath,
|
|
14399
14752
|
paths.recommended.relativeFilePath
|
|
14400
14753
|
);
|
|
@@ -14445,12 +14798,12 @@ var mcpTools = {
|
|
|
14445
14798
|
};
|
|
14446
14799
|
|
|
14447
14800
|
// src/mcp/rules.ts
|
|
14448
|
-
var
|
|
14801
|
+
var import_node_path113 = require("path");
|
|
14449
14802
|
var import_mini52 = require("zod/mini");
|
|
14450
14803
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
14451
14804
|
var maxRulesCount = 1e3;
|
|
14452
14805
|
async function listRules() {
|
|
14453
|
-
const rulesDir = (0,
|
|
14806
|
+
const rulesDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
14454
14807
|
try {
|
|
14455
14808
|
const files = await listDirectoryFiles(rulesDir);
|
|
14456
14809
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -14463,7 +14816,7 @@ async function listRules() {
|
|
|
14463
14816
|
});
|
|
14464
14817
|
const frontmatter = rule.getFrontmatter();
|
|
14465
14818
|
return {
|
|
14466
|
-
relativePathFromCwd: (0,
|
|
14819
|
+
relativePathFromCwd: (0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
14467
14820
|
frontmatter
|
|
14468
14821
|
};
|
|
14469
14822
|
} catch (error) {
|
|
@@ -14483,14 +14836,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
14483
14836
|
relativePath: relativePathFromCwd,
|
|
14484
14837
|
intendedRootDir: process.cwd()
|
|
14485
14838
|
});
|
|
14486
|
-
const filename = (0,
|
|
14839
|
+
const filename = (0, import_node_path113.basename)(relativePathFromCwd);
|
|
14487
14840
|
try {
|
|
14488
14841
|
const rule = await RulesyncRule.fromFile({
|
|
14489
14842
|
relativeFilePath: filename,
|
|
14490
14843
|
validate: true
|
|
14491
14844
|
});
|
|
14492
14845
|
return {
|
|
14493
|
-
relativePathFromCwd: (0,
|
|
14846
|
+
relativePathFromCwd: (0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
14494
14847
|
frontmatter: rule.getFrontmatter(),
|
|
14495
14848
|
body: rule.getBody()
|
|
14496
14849
|
};
|
|
@@ -14509,7 +14862,7 @@ async function putRule({
|
|
|
14509
14862
|
relativePath: relativePathFromCwd,
|
|
14510
14863
|
intendedRootDir: process.cwd()
|
|
14511
14864
|
});
|
|
14512
|
-
const filename = (0,
|
|
14865
|
+
const filename = (0, import_node_path113.basename)(relativePathFromCwd);
|
|
14513
14866
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
14514
14867
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
14515
14868
|
throw new Error(
|
|
@@ -14519,7 +14872,7 @@ async function putRule({
|
|
|
14519
14872
|
try {
|
|
14520
14873
|
const existingRules = await listRules();
|
|
14521
14874
|
const isUpdate = existingRules.some(
|
|
14522
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
14875
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
14523
14876
|
);
|
|
14524
14877
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
14525
14878
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -14532,11 +14885,11 @@ async function putRule({
|
|
|
14532
14885
|
body,
|
|
14533
14886
|
validate: true
|
|
14534
14887
|
});
|
|
14535
|
-
const rulesDir = (0,
|
|
14888
|
+
const rulesDir = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
14536
14889
|
await ensureDir(rulesDir);
|
|
14537
14890
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
14538
14891
|
return {
|
|
14539
|
-
relativePathFromCwd: (0,
|
|
14892
|
+
relativePathFromCwd: (0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
14540
14893
|
frontmatter: rule.getFrontmatter(),
|
|
14541
14894
|
body: rule.getBody()
|
|
14542
14895
|
};
|
|
@@ -14551,12 +14904,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
14551
14904
|
relativePath: relativePathFromCwd,
|
|
14552
14905
|
intendedRootDir: process.cwd()
|
|
14553
14906
|
});
|
|
14554
|
-
const filename = (0,
|
|
14555
|
-
const fullPath = (0,
|
|
14907
|
+
const filename = (0, import_node_path113.basename)(relativePathFromCwd);
|
|
14908
|
+
const fullPath = (0, import_node_path113.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
14556
14909
|
try {
|
|
14557
14910
|
await removeFile(fullPath);
|
|
14558
14911
|
return {
|
|
14559
|
-
relativePathFromCwd: (0,
|
|
14912
|
+
relativePathFromCwd: (0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
14560
14913
|
};
|
|
14561
14914
|
} catch (error) {
|
|
14562
14915
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -14581,7 +14934,7 @@ var ruleToolSchemas = {
|
|
|
14581
14934
|
var ruleTools = {
|
|
14582
14935
|
listRules: {
|
|
14583
14936
|
name: "listRules",
|
|
14584
|
-
description: `List all rules from ${(0,
|
|
14937
|
+
description: `List all rules from ${(0, import_node_path113.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
14585
14938
|
parameters: ruleToolSchemas.listRules,
|
|
14586
14939
|
execute: async () => {
|
|
14587
14940
|
const rules = await listRules();
|
|
@@ -14623,7 +14976,7 @@ var ruleTools = {
|
|
|
14623
14976
|
};
|
|
14624
14977
|
|
|
14625
14978
|
// src/mcp/skills.ts
|
|
14626
|
-
var
|
|
14979
|
+
var import_node_path114 = require("path");
|
|
14627
14980
|
var import_mini53 = require("zod/mini");
|
|
14628
14981
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
14629
14982
|
var maxSkillsCount = 1e3;
|
|
@@ -14640,19 +14993,19 @@ function mcpSkillFileToAiDirFile(file) {
|
|
|
14640
14993
|
};
|
|
14641
14994
|
}
|
|
14642
14995
|
function extractDirName(relativeDirPathFromCwd) {
|
|
14643
|
-
const dirName = (0,
|
|
14996
|
+
const dirName = (0, import_node_path114.basename)(relativeDirPathFromCwd);
|
|
14644
14997
|
if (!dirName) {
|
|
14645
14998
|
throw new Error(`Invalid path: ${relativeDirPathFromCwd}`);
|
|
14646
14999
|
}
|
|
14647
15000
|
return dirName;
|
|
14648
15001
|
}
|
|
14649
15002
|
async function listSkills() {
|
|
14650
|
-
const skillsDir = (0,
|
|
15003
|
+
const skillsDir = (0, import_node_path114.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
14651
15004
|
try {
|
|
14652
|
-
const skillDirPaths = await findFilesByGlobs((0,
|
|
15005
|
+
const skillDirPaths = await findFilesByGlobs((0, import_node_path114.join)(skillsDir, "*"), { type: "dir" });
|
|
14653
15006
|
const skills = await Promise.all(
|
|
14654
15007
|
skillDirPaths.map(async (dirPath) => {
|
|
14655
|
-
const dirName = (0,
|
|
15008
|
+
const dirName = (0, import_node_path114.basename)(dirPath);
|
|
14656
15009
|
if (!dirName) return null;
|
|
14657
15010
|
try {
|
|
14658
15011
|
const skill = await RulesyncSkill.fromDir({
|
|
@@ -14660,7 +15013,7 @@ async function listSkills() {
|
|
|
14660
15013
|
});
|
|
14661
15014
|
const frontmatter = skill.getFrontmatter();
|
|
14662
15015
|
return {
|
|
14663
|
-
relativeDirPathFromCwd: (0,
|
|
15016
|
+
relativeDirPathFromCwd: (0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
14664
15017
|
frontmatter
|
|
14665
15018
|
};
|
|
14666
15019
|
} catch (error) {
|
|
@@ -14686,7 +15039,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
|
|
|
14686
15039
|
dirName
|
|
14687
15040
|
});
|
|
14688
15041
|
return {
|
|
14689
|
-
relativeDirPathFromCwd: (0,
|
|
15042
|
+
relativeDirPathFromCwd: (0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
14690
15043
|
frontmatter: skill.getFrontmatter(),
|
|
14691
15044
|
body: skill.getBody(),
|
|
14692
15045
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -14720,7 +15073,7 @@ async function putSkill({
|
|
|
14720
15073
|
try {
|
|
14721
15074
|
const existingSkills = await listSkills();
|
|
14722
15075
|
const isUpdate = existingSkills.some(
|
|
14723
|
-
(skill2) => skill2.relativeDirPathFromCwd === (0,
|
|
15076
|
+
(skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
14724
15077
|
);
|
|
14725
15078
|
if (!isUpdate && existingSkills.length >= maxSkillsCount) {
|
|
14726
15079
|
throw new Error(`Maximum number of skills (${maxSkillsCount}) reached`);
|
|
@@ -14735,9 +15088,9 @@ async function putSkill({
|
|
|
14735
15088
|
otherFiles: aiDirFiles,
|
|
14736
15089
|
validate: true
|
|
14737
15090
|
});
|
|
14738
|
-
const skillDirPath = (0,
|
|
15091
|
+
const skillDirPath = (0, import_node_path114.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
14739
15092
|
await ensureDir(skillDirPath);
|
|
14740
|
-
const skillFilePath = (0,
|
|
15093
|
+
const skillFilePath = (0, import_node_path114.join)(skillDirPath, SKILL_FILE_NAME);
|
|
14741
15094
|
const skillFileContent = stringifyFrontmatter(body, frontmatter);
|
|
14742
15095
|
await writeFileContent(skillFilePath, skillFileContent);
|
|
14743
15096
|
for (const file of otherFiles) {
|
|
@@ -14745,15 +15098,15 @@ async function putSkill({
|
|
|
14745
15098
|
relativePath: file.name,
|
|
14746
15099
|
intendedRootDir: skillDirPath
|
|
14747
15100
|
});
|
|
14748
|
-
const filePath = (0,
|
|
14749
|
-
const fileDir = (0,
|
|
15101
|
+
const filePath = (0, import_node_path114.join)(skillDirPath, file.name);
|
|
15102
|
+
const fileDir = (0, import_node_path114.join)(skillDirPath, (0, import_node_path114.dirname)(file.name));
|
|
14750
15103
|
if (fileDir !== skillDirPath) {
|
|
14751
15104
|
await ensureDir(fileDir);
|
|
14752
15105
|
}
|
|
14753
15106
|
await writeFileContent(filePath, file.body);
|
|
14754
15107
|
}
|
|
14755
15108
|
return {
|
|
14756
|
-
relativeDirPathFromCwd: (0,
|
|
15109
|
+
relativeDirPathFromCwd: (0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
14757
15110
|
frontmatter: skill.getFrontmatter(),
|
|
14758
15111
|
body: skill.getBody(),
|
|
14759
15112
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -14775,13 +15128,13 @@ async function deleteSkill({
|
|
|
14775
15128
|
intendedRootDir: process.cwd()
|
|
14776
15129
|
});
|
|
14777
15130
|
const dirName = extractDirName(relativeDirPathFromCwd);
|
|
14778
|
-
const skillDirPath = (0,
|
|
15131
|
+
const skillDirPath = (0, import_node_path114.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
14779
15132
|
try {
|
|
14780
15133
|
if (await directoryExists(skillDirPath)) {
|
|
14781
15134
|
await removeDirectory(skillDirPath);
|
|
14782
15135
|
}
|
|
14783
15136
|
return {
|
|
14784
|
-
relativeDirPathFromCwd: (0,
|
|
15137
|
+
relativeDirPathFromCwd: (0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
14785
15138
|
};
|
|
14786
15139
|
} catch (error) {
|
|
14787
15140
|
throw new Error(
|
|
@@ -14814,7 +15167,7 @@ var skillToolSchemas = {
|
|
|
14814
15167
|
var skillTools = {
|
|
14815
15168
|
listSkills: {
|
|
14816
15169
|
name: "listSkills",
|
|
14817
|
-
description: `List all skills from ${(0,
|
|
15170
|
+
description: `List all skills from ${(0, import_node_path114.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
|
|
14818
15171
|
parameters: skillToolSchemas.listSkills,
|
|
14819
15172
|
execute: async () => {
|
|
14820
15173
|
const skills = await listSkills();
|
|
@@ -14857,12 +15210,12 @@ var skillTools = {
|
|
|
14857
15210
|
};
|
|
14858
15211
|
|
|
14859
15212
|
// src/mcp/subagents.ts
|
|
14860
|
-
var
|
|
15213
|
+
var import_node_path115 = require("path");
|
|
14861
15214
|
var import_mini54 = require("zod/mini");
|
|
14862
15215
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
14863
15216
|
var maxSubagentsCount = 1e3;
|
|
14864
15217
|
async function listSubagents() {
|
|
14865
|
-
const subagentsDir = (0,
|
|
15218
|
+
const subagentsDir = (0, import_node_path115.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
14866
15219
|
try {
|
|
14867
15220
|
const files = await listDirectoryFiles(subagentsDir);
|
|
14868
15221
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -14875,7 +15228,7 @@ async function listSubagents() {
|
|
|
14875
15228
|
});
|
|
14876
15229
|
const frontmatter = subagent.getFrontmatter();
|
|
14877
15230
|
return {
|
|
14878
|
-
relativePathFromCwd: (0,
|
|
15231
|
+
relativePathFromCwd: (0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
14879
15232
|
frontmatter
|
|
14880
15233
|
};
|
|
14881
15234
|
} catch (error) {
|
|
@@ -14897,14 +15250,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
14897
15250
|
relativePath: relativePathFromCwd,
|
|
14898
15251
|
intendedRootDir: process.cwd()
|
|
14899
15252
|
});
|
|
14900
|
-
const filename = (0,
|
|
15253
|
+
const filename = (0, import_node_path115.basename)(relativePathFromCwd);
|
|
14901
15254
|
try {
|
|
14902
15255
|
const subagent = await RulesyncSubagent.fromFile({
|
|
14903
15256
|
relativeFilePath: filename,
|
|
14904
15257
|
validate: true
|
|
14905
15258
|
});
|
|
14906
15259
|
return {
|
|
14907
|
-
relativePathFromCwd: (0,
|
|
15260
|
+
relativePathFromCwd: (0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
14908
15261
|
frontmatter: subagent.getFrontmatter(),
|
|
14909
15262
|
body: subagent.getBody()
|
|
14910
15263
|
};
|
|
@@ -14923,7 +15276,7 @@ async function putSubagent({
|
|
|
14923
15276
|
relativePath: relativePathFromCwd,
|
|
14924
15277
|
intendedRootDir: process.cwd()
|
|
14925
15278
|
});
|
|
14926
|
-
const filename = (0,
|
|
15279
|
+
const filename = (0, import_node_path115.basename)(relativePathFromCwd);
|
|
14927
15280
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
14928
15281
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
14929
15282
|
throw new Error(
|
|
@@ -14933,7 +15286,7 @@ async function putSubagent({
|
|
|
14933
15286
|
try {
|
|
14934
15287
|
const existingSubagents = await listSubagents();
|
|
14935
15288
|
const isUpdate = existingSubagents.some(
|
|
14936
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
15289
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
14937
15290
|
);
|
|
14938
15291
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
14939
15292
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -14946,11 +15299,11 @@ async function putSubagent({
|
|
|
14946
15299
|
body,
|
|
14947
15300
|
validate: true
|
|
14948
15301
|
});
|
|
14949
|
-
const subagentsDir = (0,
|
|
15302
|
+
const subagentsDir = (0, import_node_path115.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
14950
15303
|
await ensureDir(subagentsDir);
|
|
14951
15304
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
14952
15305
|
return {
|
|
14953
|
-
relativePathFromCwd: (0,
|
|
15306
|
+
relativePathFromCwd: (0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
14954
15307
|
frontmatter: subagent.getFrontmatter(),
|
|
14955
15308
|
body: subagent.getBody()
|
|
14956
15309
|
};
|
|
@@ -14965,12 +15318,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
14965
15318
|
relativePath: relativePathFromCwd,
|
|
14966
15319
|
intendedRootDir: process.cwd()
|
|
14967
15320
|
});
|
|
14968
|
-
const filename = (0,
|
|
14969
|
-
const fullPath = (0,
|
|
15321
|
+
const filename = (0, import_node_path115.basename)(relativePathFromCwd);
|
|
15322
|
+
const fullPath = (0, import_node_path115.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
14970
15323
|
try {
|
|
14971
15324
|
await removeFile(fullPath);
|
|
14972
15325
|
return {
|
|
14973
|
-
relativePathFromCwd: (0,
|
|
15326
|
+
relativePathFromCwd: (0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
14974
15327
|
};
|
|
14975
15328
|
} catch (error) {
|
|
14976
15329
|
throw new Error(
|
|
@@ -14998,7 +15351,7 @@ var subagentToolSchemas = {
|
|
|
14998
15351
|
var subagentTools = {
|
|
14999
15352
|
listSubagents: {
|
|
15000
15353
|
name: "listSubagents",
|
|
15001
|
-
description: `List all subagents from ${(0,
|
|
15354
|
+
description: `List all subagents from ${(0, import_node_path115.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
15002
15355
|
parameters: subagentToolSchemas.listSubagents,
|
|
15003
15356
|
execute: async () => {
|
|
15004
15357
|
const subagents = await listSubagents();
|
|
@@ -15249,7 +15602,7 @@ async function mcpCommand({ version }) {
|
|
|
15249
15602
|
}
|
|
15250
15603
|
|
|
15251
15604
|
// src/cli/index.ts
|
|
15252
|
-
var getVersion = () => "6.
|
|
15605
|
+
var getVersion = () => "6.4.0";
|
|
15253
15606
|
var main = async () => {
|
|
15254
15607
|
const program = new import_commander.Command();
|
|
15255
15608
|
const version = getVersion();
|