rulesync 5.4.0 → 5.5.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 +5 -1
- package/dist/index.cjs +630 -398
- package/dist/index.js +622 -390
- package/package.json +18 -18
package/dist/index.cjs
CHANGED
|
@@ -271,6 +271,7 @@ var ALL_TOOL_TARGETS = [
|
|
|
271
271
|
"kiro",
|
|
272
272
|
"opencode",
|
|
273
273
|
"qwencode",
|
|
274
|
+
"replit",
|
|
274
275
|
"roo",
|
|
275
276
|
"warp",
|
|
276
277
|
"windsurf",
|
|
@@ -486,7 +487,7 @@ var RULESYNC_OVERVIEW_FILE_NAME = "overview.md";
|
|
|
486
487
|
var RULESYNC_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "skills");
|
|
487
488
|
|
|
488
489
|
// src/features/commands/commands-processor.ts
|
|
489
|
-
var
|
|
490
|
+
var import_node_path19 = require("path");
|
|
490
491
|
var import_mini12 = require("zod/mini");
|
|
491
492
|
|
|
492
493
|
// src/types/feature-processor.ts
|
|
@@ -904,6 +905,11 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
904
905
|
var import_node_path8 = require("path");
|
|
905
906
|
var import_mini6 = require("zod/mini");
|
|
906
907
|
|
|
908
|
+
// src/utils/type-guards.ts
|
|
909
|
+
function isRecord(value) {
|
|
910
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
911
|
+
}
|
|
912
|
+
|
|
907
913
|
// src/features/commands/rulesync-command.ts
|
|
908
914
|
var import_node_path7 = require("path");
|
|
909
915
|
var import_mini5 = require("zod/mini");
|
|
@@ -996,8 +1002,14 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
996
1002
|
};
|
|
997
1003
|
|
|
998
1004
|
// src/features/commands/antigravity-command.ts
|
|
999
|
-
var
|
|
1000
|
-
|
|
1005
|
+
var AntigravityWorkflowFrontmatterSchema = import_mini6.z.looseObject({
|
|
1006
|
+
trigger: import_mini6.z.optional(import_mini6.z.string()),
|
|
1007
|
+
turbo: import_mini6.z.optional(import_mini6.z.boolean())
|
|
1008
|
+
});
|
|
1009
|
+
var AntigravityCommandFrontmatterSchema = import_mini6.z.looseObject({
|
|
1010
|
+
description: import_mini6.z.string(),
|
|
1011
|
+
// Support for workflow-specific configuration
|
|
1012
|
+
...AntigravityWorkflowFrontmatterSchema.shape
|
|
1001
1013
|
});
|
|
1002
1014
|
var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
|
|
1003
1015
|
frontmatter;
|
|
@@ -1030,9 +1042,12 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
|
|
|
1030
1042
|
return this.frontmatter;
|
|
1031
1043
|
}
|
|
1032
1044
|
toRulesyncCommand() {
|
|
1045
|
+
const { description, ...restFields } = this.frontmatter;
|
|
1033
1046
|
const rulesyncFrontmatter = {
|
|
1034
1047
|
targets: ["antigravity"],
|
|
1035
|
-
description
|
|
1048
|
+
description,
|
|
1049
|
+
// Preserve extra fields in antigravity section
|
|
1050
|
+
...Object.keys(restFields).length > 0 && { antigravity: restFields }
|
|
1036
1051
|
};
|
|
1037
1052
|
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1038
1053
|
return new RulesyncCommand({
|
|
@@ -1046,27 +1061,56 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
|
|
|
1046
1061
|
validate: true
|
|
1047
1062
|
});
|
|
1048
1063
|
}
|
|
1064
|
+
static extractAntigravityConfig(rulesyncCommand) {
|
|
1065
|
+
const antigravity = rulesyncCommand.getFrontmatter().antigravity;
|
|
1066
|
+
return isRecord(antigravity) ? antigravity : void 0;
|
|
1067
|
+
}
|
|
1049
1068
|
static fromRulesyncCommand({
|
|
1050
1069
|
baseDir = process.cwd(),
|
|
1051
1070
|
rulesyncCommand,
|
|
1052
1071
|
validate = true
|
|
1053
1072
|
}) {
|
|
1054
1073
|
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1074
|
+
const antigravityConfig = this.extractAntigravityConfig(rulesyncCommand);
|
|
1075
|
+
const trigger = this.resolveTrigger(rulesyncCommand, antigravityConfig);
|
|
1076
|
+
const turbo = typeof antigravityConfig?.turbo === "boolean" ? antigravityConfig.turbo : true;
|
|
1077
|
+
let relativeFilePath = rulesyncCommand.getRelativeFilePath();
|
|
1078
|
+
let body = rulesyncCommand.getBody().replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, "").trim();
|
|
1079
|
+
const sanitizedTrigger = trigger.replace(/[^a-zA-Z0-9-_]/g, "-").replace(/^-+|-+$/g, "");
|
|
1080
|
+
if (!sanitizedTrigger) {
|
|
1081
|
+
throw new Error(`Invalid trigger: sanitization resulted in empty string from "${trigger}"`);
|
|
1082
|
+
}
|
|
1083
|
+
const validFilename = sanitizedTrigger + ".md";
|
|
1084
|
+
relativeFilePath = validFilename;
|
|
1085
|
+
const turboDirective = turbo ? "\n\n// turbo" : "";
|
|
1086
|
+
body = `# Workflow: ${trigger}
|
|
1087
|
+
|
|
1088
|
+
${body}${turboDirective}`;
|
|
1089
|
+
const description = rulesyncFrontmatter.description;
|
|
1055
1090
|
const antigravityFrontmatter = {
|
|
1056
|
-
description
|
|
1091
|
+
description,
|
|
1092
|
+
trigger,
|
|
1093
|
+
turbo
|
|
1057
1094
|
};
|
|
1058
|
-
const body = rulesyncCommand.getBody();
|
|
1059
1095
|
const fileContent = stringifyFrontmatter(body, antigravityFrontmatter);
|
|
1060
1096
|
return new _AntigravityCommand({
|
|
1061
1097
|
baseDir,
|
|
1062
1098
|
frontmatter: antigravityFrontmatter,
|
|
1063
1099
|
body,
|
|
1064
1100
|
relativeDirPath: _AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
1065
|
-
relativeFilePath
|
|
1101
|
+
relativeFilePath,
|
|
1066
1102
|
fileContent,
|
|
1067
1103
|
validate
|
|
1068
1104
|
});
|
|
1069
1105
|
}
|
|
1106
|
+
static resolveTrigger(rulesyncCommand, antigravityConfig) {
|
|
1107
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1108
|
+
const antigravityTrigger = antigravityConfig && typeof antigravityConfig.trigger === "string" ? antigravityConfig.trigger : void 0;
|
|
1109
|
+
const rootTrigger = typeof rulesyncFrontmatter.trigger === "string" ? rulesyncFrontmatter.trigger : void 0;
|
|
1110
|
+
const bodyTriggerMatch = rulesyncCommand.getBody().match(/trigger:\s*(\/[\w-]+)/);
|
|
1111
|
+
const filenameTrigger = `/${(0, import_node_path8.basename)(rulesyncCommand.getRelativeFilePath(), ".md")}`;
|
|
1112
|
+
return antigravityTrigger || rootTrigger || (bodyTriggerMatch ? bodyTriggerMatch[1] : void 0) || filenameTrigger;
|
|
1113
|
+
}
|
|
1070
1114
|
validate() {
|
|
1071
1115
|
if (!this.frontmatter) {
|
|
1072
1116
|
return { success: true, error: null };
|
|
@@ -1899,8 +1943,89 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
|
|
|
1899
1943
|
}
|
|
1900
1944
|
};
|
|
1901
1945
|
|
|
1902
|
-
// src/features/commands/
|
|
1946
|
+
// src/features/commands/kiro-command.ts
|
|
1903
1947
|
var import_node_path16 = require("path");
|
|
1948
|
+
var KiroCommand = class _KiroCommand extends ToolCommand {
|
|
1949
|
+
static getSettablePaths(_options = {}) {
|
|
1950
|
+
return {
|
|
1951
|
+
relativeDirPath: (0, import_node_path16.join)(".kiro", "prompts")
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1954
|
+
toRulesyncCommand() {
|
|
1955
|
+
const rulesyncFrontmatter = {
|
|
1956
|
+
targets: ["*"],
|
|
1957
|
+
description: ""
|
|
1958
|
+
};
|
|
1959
|
+
return new RulesyncCommand({
|
|
1960
|
+
baseDir: process.cwd(),
|
|
1961
|
+
frontmatter: rulesyncFrontmatter,
|
|
1962
|
+
body: this.getFileContent(),
|
|
1963
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
1964
|
+
relativeFilePath: this.relativeFilePath,
|
|
1965
|
+
fileContent: this.getFileContent(),
|
|
1966
|
+
validate: true
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
static fromRulesyncCommand({
|
|
1970
|
+
baseDir = process.cwd(),
|
|
1971
|
+
rulesyncCommand,
|
|
1972
|
+
validate = true
|
|
1973
|
+
}) {
|
|
1974
|
+
const paths = this.getSettablePaths();
|
|
1975
|
+
return new _KiroCommand({
|
|
1976
|
+
baseDir,
|
|
1977
|
+
fileContent: rulesyncCommand.getBody(),
|
|
1978
|
+
relativeDirPath: paths.relativeDirPath,
|
|
1979
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
1980
|
+
validate
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
validate() {
|
|
1984
|
+
return { success: true, error: null };
|
|
1985
|
+
}
|
|
1986
|
+
getBody() {
|
|
1987
|
+
return this.getFileContent();
|
|
1988
|
+
}
|
|
1989
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1990
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
1991
|
+
rulesyncCommand,
|
|
1992
|
+
toolTarget: "kiro"
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
static async fromFile({
|
|
1996
|
+
baseDir = process.cwd(),
|
|
1997
|
+
relativeFilePath,
|
|
1998
|
+
validate = true
|
|
1999
|
+
}) {
|
|
2000
|
+
const paths = this.getSettablePaths();
|
|
2001
|
+
const filePath = (0, import_node_path16.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2002
|
+
const fileContent = await readFileContent(filePath);
|
|
2003
|
+
const { body: content } = parseFrontmatter(fileContent);
|
|
2004
|
+
return new _KiroCommand({
|
|
2005
|
+
baseDir,
|
|
2006
|
+
relativeDirPath: paths.relativeDirPath,
|
|
2007
|
+
relativeFilePath: (0, import_node_path16.basename)(relativeFilePath),
|
|
2008
|
+
fileContent: content.trim(),
|
|
2009
|
+
validate
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
static forDeletion({
|
|
2013
|
+
baseDir = process.cwd(),
|
|
2014
|
+
relativeDirPath,
|
|
2015
|
+
relativeFilePath
|
|
2016
|
+
}) {
|
|
2017
|
+
return new _KiroCommand({
|
|
2018
|
+
baseDir,
|
|
2019
|
+
relativeDirPath,
|
|
2020
|
+
relativeFilePath,
|
|
2021
|
+
fileContent: "",
|
|
2022
|
+
validate: false
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
// src/features/commands/opencode-command.ts
|
|
2028
|
+
var import_node_path17 = require("path");
|
|
1904
2029
|
var import_mini10 = require("zod/mini");
|
|
1905
2030
|
var OpenCodeCommandFrontmatterSchema = import_mini10.z.looseObject({
|
|
1906
2031
|
description: import_mini10.z.string(),
|
|
@@ -1916,7 +2041,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1916
2041
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1917
2042
|
if (!result.success) {
|
|
1918
2043
|
throw new Error(
|
|
1919
|
-
`Invalid frontmatter in ${(0,
|
|
2044
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1920
2045
|
);
|
|
1921
2046
|
}
|
|
1922
2047
|
}
|
|
@@ -1929,7 +2054,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1929
2054
|
}
|
|
1930
2055
|
static getSettablePaths({ global } = {}) {
|
|
1931
2056
|
return {
|
|
1932
|
-
relativeDirPath: global ? (0,
|
|
2057
|
+
relativeDirPath: global ? (0, import_node_path17.join)(".config", "opencode", "command") : (0, import_node_path17.join)(".opencode", "command")
|
|
1933
2058
|
};
|
|
1934
2059
|
}
|
|
1935
2060
|
getBody() {
|
|
@@ -1990,7 +2115,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
1990
2115
|
return {
|
|
1991
2116
|
success: false,
|
|
1992
2117
|
error: new Error(
|
|
1993
|
-
`Invalid frontmatter in ${(0,
|
|
2118
|
+
`Invalid frontmatter in ${(0, import_node_path17.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1994
2119
|
)
|
|
1995
2120
|
};
|
|
1996
2121
|
}
|
|
@@ -2001,7 +2126,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2001
2126
|
global = false
|
|
2002
2127
|
}) {
|
|
2003
2128
|
const paths = this.getSettablePaths({ global });
|
|
2004
|
-
const filePath = (0,
|
|
2129
|
+
const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
2005
2130
|
const fileContent = await readFileContent(filePath);
|
|
2006
2131
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2007
2132
|
const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2011,7 +2136,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2011
2136
|
return new _OpenCodeCommand({
|
|
2012
2137
|
baseDir,
|
|
2013
2138
|
relativeDirPath: paths.relativeDirPath,
|
|
2014
|
-
relativeFilePath: (0,
|
|
2139
|
+
relativeFilePath: (0, import_node_path17.basename)(relativeFilePath),
|
|
2015
2140
|
frontmatter: result.data,
|
|
2016
2141
|
body: content.trim(),
|
|
2017
2142
|
validate
|
|
@@ -2040,7 +2165,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
|
|
|
2040
2165
|
};
|
|
2041
2166
|
|
|
2042
2167
|
// src/features/commands/roo-command.ts
|
|
2043
|
-
var
|
|
2168
|
+
var import_node_path18 = require("path");
|
|
2044
2169
|
var import_mini11 = require("zod/mini");
|
|
2045
2170
|
var RooCommandFrontmatterSchema = import_mini11.z.looseObject({
|
|
2046
2171
|
description: import_mini11.z.string(),
|
|
@@ -2051,7 +2176,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2051
2176
|
body;
|
|
2052
2177
|
static getSettablePaths() {
|
|
2053
2178
|
return {
|
|
2054
|
-
relativeDirPath: (0,
|
|
2179
|
+
relativeDirPath: (0, import_node_path18.join)(".roo", "commands")
|
|
2055
2180
|
};
|
|
2056
2181
|
}
|
|
2057
2182
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -2059,7 +2184,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2059
2184
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
2060
2185
|
if (!result.success) {
|
|
2061
2186
|
throw new Error(
|
|
2062
|
-
`Invalid frontmatter in ${(0,
|
|
2187
|
+
`Invalid frontmatter in ${(0, import_node_path18.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
2063
2188
|
);
|
|
2064
2189
|
}
|
|
2065
2190
|
}
|
|
@@ -2130,7 +2255,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2130
2255
|
return {
|
|
2131
2256
|
success: false,
|
|
2132
2257
|
error: new Error(
|
|
2133
|
-
`Invalid frontmatter in ${(0,
|
|
2258
|
+
`Invalid frontmatter in ${(0, import_node_path18.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
2134
2259
|
)
|
|
2135
2260
|
};
|
|
2136
2261
|
}
|
|
@@ -2146,7 +2271,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2146
2271
|
relativeFilePath,
|
|
2147
2272
|
validate = true
|
|
2148
2273
|
}) {
|
|
2149
|
-
const filePath = (0,
|
|
2274
|
+
const filePath = (0, import_node_path18.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
2150
2275
|
const fileContent = await readFileContent(filePath);
|
|
2151
2276
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
2152
2277
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -2156,7 +2281,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
2156
2281
|
return new _RooCommand({
|
|
2157
2282
|
baseDir,
|
|
2158
2283
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
2159
|
-
relativeFilePath: (0,
|
|
2284
|
+
relativeFilePath: (0, import_node_path18.basename)(relativeFilePath),
|
|
2160
2285
|
frontmatter: result.data,
|
|
2161
2286
|
body: content.trim(),
|
|
2162
2287
|
fileContent,
|
|
@@ -2192,6 +2317,7 @@ var commandsProcessorToolTargetTuple = [
|
|
|
2192
2317
|
"cursor",
|
|
2193
2318
|
"geminicli",
|
|
2194
2319
|
"kilo",
|
|
2320
|
+
"kiro",
|
|
2195
2321
|
"opencode",
|
|
2196
2322
|
"roo"
|
|
2197
2323
|
];
|
|
@@ -2272,6 +2398,13 @@ var toolCommandFactories = /* @__PURE__ */ new Map([
|
|
|
2272
2398
|
meta: { extension: "md", supportsProject: true, supportsGlobal: true, isSimulated: false }
|
|
2273
2399
|
}
|
|
2274
2400
|
],
|
|
2401
|
+
[
|
|
2402
|
+
"kiro",
|
|
2403
|
+
{
|
|
2404
|
+
class: KiroCommand,
|
|
2405
|
+
meta: { extension: "md", supportsProject: true, supportsGlobal: false, isSimulated: false }
|
|
2406
|
+
}
|
|
2407
|
+
],
|
|
2275
2408
|
[
|
|
2276
2409
|
"opencode",
|
|
2277
2410
|
{
|
|
@@ -2362,11 +2495,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2362
2495
|
*/
|
|
2363
2496
|
async loadRulesyncFiles() {
|
|
2364
2497
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
2365
|
-
(0,
|
|
2498
|
+
(0, import_node_path19.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
2366
2499
|
);
|
|
2367
2500
|
const rulesyncCommands = await Promise.all(
|
|
2368
2501
|
rulesyncCommandPaths.map(
|
|
2369
|
-
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
2502
|
+
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path19.basename)(path3) })
|
|
2370
2503
|
)
|
|
2371
2504
|
);
|
|
2372
2505
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -2382,14 +2515,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2382
2515
|
const factory = this.getFactory(this.toolTarget);
|
|
2383
2516
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
2384
2517
|
const commandFilePaths = await findFilesByGlobs(
|
|
2385
|
-
(0,
|
|
2518
|
+
(0, import_node_path19.join)(this.baseDir, paths.relativeDirPath, `*.${factory.meta.extension}`)
|
|
2386
2519
|
);
|
|
2387
2520
|
if (forDeletion) {
|
|
2388
2521
|
const toolCommands2 = commandFilePaths.map(
|
|
2389
2522
|
(path3) => factory.class.forDeletion({
|
|
2390
2523
|
baseDir: this.baseDir,
|
|
2391
2524
|
relativeDirPath: paths.relativeDirPath,
|
|
2392
|
-
relativeFilePath: (0,
|
|
2525
|
+
relativeFilePath: (0, import_node_path19.basename)(path3),
|
|
2393
2526
|
global: this.global
|
|
2394
2527
|
})
|
|
2395
2528
|
).filter((cmd) => cmd.isDeletable());
|
|
@@ -2400,7 +2533,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2400
2533
|
commandFilePaths.map(
|
|
2401
2534
|
(path3) => factory.class.fromFile({
|
|
2402
2535
|
baseDir: this.baseDir,
|
|
2403
|
-
relativeFilePath: (0,
|
|
2536
|
+
relativeFilePath: (0, import_node_path19.basename)(path3),
|
|
2404
2537
|
global: this.global
|
|
2405
2538
|
})
|
|
2406
2539
|
)
|
|
@@ -2435,14 +2568,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
2435
2568
|
var import_mini13 = require("zod/mini");
|
|
2436
2569
|
|
|
2437
2570
|
// src/features/ignore/augmentcode-ignore.ts
|
|
2438
|
-
var
|
|
2571
|
+
var import_node_path21 = require("path");
|
|
2439
2572
|
|
|
2440
2573
|
// src/types/tool-file.ts
|
|
2441
2574
|
var ToolFile = class extends AiFile {
|
|
2442
2575
|
};
|
|
2443
2576
|
|
|
2444
2577
|
// src/features/ignore/rulesync-ignore.ts
|
|
2445
|
-
var
|
|
2578
|
+
var import_node_path20 = require("path");
|
|
2446
2579
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
2447
2580
|
validate() {
|
|
2448
2581
|
return { success: true, error: null };
|
|
@@ -2462,12 +2595,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
2462
2595
|
static async fromFile() {
|
|
2463
2596
|
const baseDir = process.cwd();
|
|
2464
2597
|
const paths = this.getSettablePaths();
|
|
2465
|
-
const recommendedPath = (0,
|
|
2598
|
+
const recommendedPath = (0, import_node_path20.join)(
|
|
2466
2599
|
baseDir,
|
|
2467
2600
|
paths.recommended.relativeDirPath,
|
|
2468
2601
|
paths.recommended.relativeFilePath
|
|
2469
2602
|
);
|
|
2470
|
-
const legacyPath = (0,
|
|
2603
|
+
const legacyPath = (0, import_node_path20.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
2471
2604
|
if (await fileExists(recommendedPath)) {
|
|
2472
2605
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
2473
2606
|
return new _RulesyncIgnore({
|
|
@@ -2583,7 +2716,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2583
2716
|
validate = true
|
|
2584
2717
|
}) {
|
|
2585
2718
|
const fileContent = await readFileContent(
|
|
2586
|
-
(0,
|
|
2719
|
+
(0, import_node_path21.join)(
|
|
2587
2720
|
baseDir,
|
|
2588
2721
|
this.getSettablePaths().relativeDirPath,
|
|
2589
2722
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2614,7 +2747,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2614
2747
|
|
|
2615
2748
|
// src/features/ignore/claudecode-ignore.ts
|
|
2616
2749
|
var import_es_toolkit2 = require("es-toolkit");
|
|
2617
|
-
var
|
|
2750
|
+
var import_node_path22 = require("path");
|
|
2618
2751
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
2619
2752
|
constructor(params) {
|
|
2620
2753
|
super(params);
|
|
@@ -2656,7 +2789,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2656
2789
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
2657
2790
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2658
2791
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
2659
|
-
const filePath = (0,
|
|
2792
|
+
const filePath = (0, import_node_path22.join)(
|
|
2660
2793
|
baseDir,
|
|
2661
2794
|
this.getSettablePaths().relativeDirPath,
|
|
2662
2795
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2692,7 +2825,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2692
2825
|
validate = true
|
|
2693
2826
|
}) {
|
|
2694
2827
|
const fileContent = await readFileContent(
|
|
2695
|
-
(0,
|
|
2828
|
+
(0, import_node_path22.join)(
|
|
2696
2829
|
baseDir,
|
|
2697
2830
|
this.getSettablePaths().relativeDirPath,
|
|
2698
2831
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2722,7 +2855,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2722
2855
|
};
|
|
2723
2856
|
|
|
2724
2857
|
// src/features/ignore/cline-ignore.ts
|
|
2725
|
-
var
|
|
2858
|
+
var import_node_path23 = require("path");
|
|
2726
2859
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
2727
2860
|
static getSettablePaths() {
|
|
2728
2861
|
return {
|
|
@@ -2759,7 +2892,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2759
2892
|
validate = true
|
|
2760
2893
|
}) {
|
|
2761
2894
|
const fileContent = await readFileContent(
|
|
2762
|
-
(0,
|
|
2895
|
+
(0, import_node_path23.join)(
|
|
2763
2896
|
baseDir,
|
|
2764
2897
|
this.getSettablePaths().relativeDirPath,
|
|
2765
2898
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2789,7 +2922,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2789
2922
|
};
|
|
2790
2923
|
|
|
2791
2924
|
// src/features/ignore/cursor-ignore.ts
|
|
2792
|
-
var
|
|
2925
|
+
var import_node_path24 = require("path");
|
|
2793
2926
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
2794
2927
|
static getSettablePaths() {
|
|
2795
2928
|
return {
|
|
@@ -2822,7 +2955,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2822
2955
|
validate = true
|
|
2823
2956
|
}) {
|
|
2824
2957
|
const fileContent = await readFileContent(
|
|
2825
|
-
(0,
|
|
2958
|
+
(0, import_node_path24.join)(
|
|
2826
2959
|
baseDir,
|
|
2827
2960
|
this.getSettablePaths().relativeDirPath,
|
|
2828
2961
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2852,7 +2985,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2852
2985
|
};
|
|
2853
2986
|
|
|
2854
2987
|
// src/features/ignore/geminicli-ignore.ts
|
|
2855
|
-
var
|
|
2988
|
+
var import_node_path25 = require("path");
|
|
2856
2989
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
2857
2990
|
static getSettablePaths() {
|
|
2858
2991
|
return {
|
|
@@ -2879,7 +3012,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2879
3012
|
validate = true
|
|
2880
3013
|
}) {
|
|
2881
3014
|
const fileContent = await readFileContent(
|
|
2882
|
-
(0,
|
|
3015
|
+
(0, import_node_path25.join)(
|
|
2883
3016
|
baseDir,
|
|
2884
3017
|
this.getSettablePaths().relativeDirPath,
|
|
2885
3018
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2909,7 +3042,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2909
3042
|
};
|
|
2910
3043
|
|
|
2911
3044
|
// src/features/ignore/junie-ignore.ts
|
|
2912
|
-
var
|
|
3045
|
+
var import_node_path26 = require("path");
|
|
2913
3046
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2914
3047
|
static getSettablePaths() {
|
|
2915
3048
|
return {
|
|
@@ -2936,7 +3069,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2936
3069
|
validate = true
|
|
2937
3070
|
}) {
|
|
2938
3071
|
const fileContent = await readFileContent(
|
|
2939
|
-
(0,
|
|
3072
|
+
(0, import_node_path26.join)(
|
|
2940
3073
|
baseDir,
|
|
2941
3074
|
this.getSettablePaths().relativeDirPath,
|
|
2942
3075
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2966,7 +3099,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2966
3099
|
};
|
|
2967
3100
|
|
|
2968
3101
|
// src/features/ignore/kilo-ignore.ts
|
|
2969
|
-
var
|
|
3102
|
+
var import_node_path27 = require("path");
|
|
2970
3103
|
var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
2971
3104
|
static getSettablePaths() {
|
|
2972
3105
|
return {
|
|
@@ -3003,7 +3136,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
3003
3136
|
validate = true
|
|
3004
3137
|
}) {
|
|
3005
3138
|
const fileContent = await readFileContent(
|
|
3006
|
-
(0,
|
|
3139
|
+
(0, import_node_path27.join)(
|
|
3007
3140
|
baseDir,
|
|
3008
3141
|
this.getSettablePaths().relativeDirPath,
|
|
3009
3142
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3033,7 +3166,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
|
|
|
3033
3166
|
};
|
|
3034
3167
|
|
|
3035
3168
|
// src/features/ignore/kiro-ignore.ts
|
|
3036
|
-
var
|
|
3169
|
+
var import_node_path28 = require("path");
|
|
3037
3170
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
3038
3171
|
static getSettablePaths() {
|
|
3039
3172
|
return {
|
|
@@ -3060,7 +3193,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
3060
3193
|
validate = true
|
|
3061
3194
|
}) {
|
|
3062
3195
|
const fileContent = await readFileContent(
|
|
3063
|
-
(0,
|
|
3196
|
+
(0, import_node_path28.join)(
|
|
3064
3197
|
baseDir,
|
|
3065
3198
|
this.getSettablePaths().relativeDirPath,
|
|
3066
3199
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3090,7 +3223,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
3090
3223
|
};
|
|
3091
3224
|
|
|
3092
3225
|
// src/features/ignore/qwencode-ignore.ts
|
|
3093
|
-
var
|
|
3226
|
+
var import_node_path29 = require("path");
|
|
3094
3227
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
3095
3228
|
static getSettablePaths() {
|
|
3096
3229
|
return {
|
|
@@ -3117,7 +3250,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
3117
3250
|
validate = true
|
|
3118
3251
|
}) {
|
|
3119
3252
|
const fileContent = await readFileContent(
|
|
3120
|
-
(0,
|
|
3253
|
+
(0, import_node_path29.join)(
|
|
3121
3254
|
baseDir,
|
|
3122
3255
|
this.getSettablePaths().relativeDirPath,
|
|
3123
3256
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3147,7 +3280,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
3147
3280
|
};
|
|
3148
3281
|
|
|
3149
3282
|
// src/features/ignore/roo-ignore.ts
|
|
3150
|
-
var
|
|
3283
|
+
var import_node_path30 = require("path");
|
|
3151
3284
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
3152
3285
|
static getSettablePaths() {
|
|
3153
3286
|
return {
|
|
@@ -3174,7 +3307,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3174
3307
|
validate = true
|
|
3175
3308
|
}) {
|
|
3176
3309
|
const fileContent = await readFileContent(
|
|
3177
|
-
(0,
|
|
3310
|
+
(0, import_node_path30.join)(
|
|
3178
3311
|
baseDir,
|
|
3179
3312
|
this.getSettablePaths().relativeDirPath,
|
|
3180
3313
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3204,7 +3337,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
3204
3337
|
};
|
|
3205
3338
|
|
|
3206
3339
|
// src/features/ignore/windsurf-ignore.ts
|
|
3207
|
-
var
|
|
3340
|
+
var import_node_path31 = require("path");
|
|
3208
3341
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
3209
3342
|
static getSettablePaths() {
|
|
3210
3343
|
return {
|
|
@@ -3231,7 +3364,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
3231
3364
|
validate = true
|
|
3232
3365
|
}) {
|
|
3233
3366
|
const fileContent = await readFileContent(
|
|
3234
|
-
(0,
|
|
3367
|
+
(0, import_node_path31.join)(
|
|
3235
3368
|
baseDir,
|
|
3236
3369
|
this.getSettablePaths().relativeDirPath,
|
|
3237
3370
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3262,7 +3395,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
3262
3395
|
|
|
3263
3396
|
// src/features/ignore/zed-ignore.ts
|
|
3264
3397
|
var import_es_toolkit3 = require("es-toolkit");
|
|
3265
|
-
var
|
|
3398
|
+
var import_node_path32 = require("path");
|
|
3266
3399
|
var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
3267
3400
|
constructor(params) {
|
|
3268
3401
|
super(params);
|
|
@@ -3298,7 +3431,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
3298
3431
|
}) {
|
|
3299
3432
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
3300
3433
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
3301
|
-
const filePath = (0,
|
|
3434
|
+
const filePath = (0, import_node_path32.join)(
|
|
3302
3435
|
baseDir,
|
|
3303
3436
|
this.getSettablePaths().relativeDirPath,
|
|
3304
3437
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3325,7 +3458,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
|
|
|
3325
3458
|
validate = true
|
|
3326
3459
|
}) {
|
|
3327
3460
|
const fileContent = await readFileContent(
|
|
3328
|
-
(0,
|
|
3461
|
+
(0, import_node_path32.join)(
|
|
3329
3462
|
baseDir,
|
|
3330
3463
|
this.getSettablePaths().relativeDirPath,
|
|
3331
3464
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3507,10 +3640,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
3507
3640
|
var import_mini18 = require("zod/mini");
|
|
3508
3641
|
|
|
3509
3642
|
// src/features/mcp/claudecode-mcp.ts
|
|
3510
|
-
var
|
|
3643
|
+
var import_node_path35 = require("path");
|
|
3511
3644
|
|
|
3512
3645
|
// src/features/mcp/modular-mcp.ts
|
|
3513
|
-
var
|
|
3646
|
+
var import_node_path33 = require("path");
|
|
3514
3647
|
var import_mini15 = require("zod/mini");
|
|
3515
3648
|
|
|
3516
3649
|
// src/types/mcp.ts
|
|
@@ -3598,7 +3731,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3598
3731
|
args: [
|
|
3599
3732
|
"-y",
|
|
3600
3733
|
"@kimuson/modular-mcp",
|
|
3601
|
-
(0,
|
|
3734
|
+
(0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3602
3735
|
],
|
|
3603
3736
|
env: {}
|
|
3604
3737
|
}
|
|
@@ -3636,7 +3769,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3636
3769
|
|
|
3637
3770
|
// src/features/mcp/rulesync-mcp.ts
|
|
3638
3771
|
var import_object = require("es-toolkit/object");
|
|
3639
|
-
var
|
|
3772
|
+
var import_node_path34 = require("path");
|
|
3640
3773
|
var import_mini16 = require("zod/mini");
|
|
3641
3774
|
var RulesyncMcpServerSchema = import_mini16.z.union([
|
|
3642
3775
|
import_mini16.z.extend(McpServerSchema, {
|
|
@@ -3692,12 +3825,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
3692
3825
|
}) {
|
|
3693
3826
|
const baseDir = process.cwd();
|
|
3694
3827
|
const paths = this.getSettablePaths();
|
|
3695
|
-
const recommendedPath = (0,
|
|
3828
|
+
const recommendedPath = (0, import_node_path34.join)(
|
|
3696
3829
|
baseDir,
|
|
3697
3830
|
paths.recommended.relativeDirPath,
|
|
3698
3831
|
paths.recommended.relativeFilePath
|
|
3699
3832
|
);
|
|
3700
|
-
const legacyPath = (0,
|
|
3833
|
+
const legacyPath = (0, import_node_path34.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
3701
3834
|
if (await fileExists(recommendedPath)) {
|
|
3702
3835
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
3703
3836
|
return new _RulesyncMcp({
|
|
@@ -3841,7 +3974,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3841
3974
|
}) {
|
|
3842
3975
|
const paths = this.getSettablePaths({ global });
|
|
3843
3976
|
const fileContent = await readOrInitializeFileContent(
|
|
3844
|
-
(0,
|
|
3977
|
+
(0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3845
3978
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3846
3979
|
);
|
|
3847
3980
|
const json = JSON.parse(fileContent);
|
|
@@ -3863,7 +3996,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3863
3996
|
}) {
|
|
3864
3997
|
const paths = this.getSettablePaths({ global });
|
|
3865
3998
|
const fileContent = await readOrInitializeFileContent(
|
|
3866
|
-
(0,
|
|
3999
|
+
(0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3867
4000
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3868
4001
|
);
|
|
3869
4002
|
const json = JSON.parse(fileContent);
|
|
@@ -3911,7 +4044,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3911
4044
|
};
|
|
3912
4045
|
|
|
3913
4046
|
// src/features/mcp/cline-mcp.ts
|
|
3914
|
-
var
|
|
4047
|
+
var import_node_path36 = require("path");
|
|
3915
4048
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
3916
4049
|
json;
|
|
3917
4050
|
constructor(params) {
|
|
@@ -3932,7 +4065,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3932
4065
|
validate = true
|
|
3933
4066
|
}) {
|
|
3934
4067
|
const fileContent = await readFileContent(
|
|
3935
|
-
(0,
|
|
4068
|
+
(0, import_node_path36.join)(
|
|
3936
4069
|
baseDir,
|
|
3937
4070
|
this.getSettablePaths().relativeDirPath,
|
|
3938
4071
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3981,7 +4114,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3981
4114
|
};
|
|
3982
4115
|
|
|
3983
4116
|
// src/features/mcp/codexcli-mcp.ts
|
|
3984
|
-
var
|
|
4117
|
+
var import_node_path37 = require("path");
|
|
3985
4118
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
3986
4119
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
3987
4120
|
toml;
|
|
@@ -4017,7 +4150,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4017
4150
|
}) {
|
|
4018
4151
|
const paths = this.getSettablePaths({ global });
|
|
4019
4152
|
const fileContent = await readFileContent(
|
|
4020
|
-
(0,
|
|
4153
|
+
(0, import_node_path37.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
4021
4154
|
);
|
|
4022
4155
|
return new _CodexcliMcp({
|
|
4023
4156
|
baseDir,
|
|
@@ -4034,7 +4167,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4034
4167
|
global = false
|
|
4035
4168
|
}) {
|
|
4036
4169
|
const paths = this.getSettablePaths({ global });
|
|
4037
|
-
const configTomlFilePath = (0,
|
|
4170
|
+
const configTomlFilePath = (0, import_node_path37.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
4038
4171
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
4039
4172
|
configTomlFilePath,
|
|
4040
4173
|
smolToml.stringify({})
|
|
@@ -4088,7 +4221,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
4088
4221
|
};
|
|
4089
4222
|
|
|
4090
4223
|
// src/features/mcp/copilot-mcp.ts
|
|
4091
|
-
var
|
|
4224
|
+
var import_node_path38 = require("path");
|
|
4092
4225
|
function convertToCopilotFormat(mcpServers) {
|
|
4093
4226
|
return { servers: mcpServers };
|
|
4094
4227
|
}
|
|
@@ -4115,7 +4248,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
4115
4248
|
validate = true
|
|
4116
4249
|
}) {
|
|
4117
4250
|
const fileContent = await readFileContent(
|
|
4118
|
-
(0,
|
|
4251
|
+
(0, import_node_path38.join)(
|
|
4119
4252
|
baseDir,
|
|
4120
4253
|
this.getSettablePaths().relativeDirPath,
|
|
4121
4254
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4168,7 +4301,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
4168
4301
|
};
|
|
4169
4302
|
|
|
4170
4303
|
// src/features/mcp/cursor-mcp.ts
|
|
4171
|
-
var
|
|
4304
|
+
var import_node_path39 = require("path");
|
|
4172
4305
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
4173
4306
|
json;
|
|
4174
4307
|
constructor(params) {
|
|
@@ -4189,7 +4322,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
4189
4322
|
validate = true
|
|
4190
4323
|
}) {
|
|
4191
4324
|
const fileContent = await readFileContent(
|
|
4192
|
-
(0,
|
|
4325
|
+
(0, import_node_path39.join)(
|
|
4193
4326
|
baseDir,
|
|
4194
4327
|
this.getSettablePaths().relativeDirPath,
|
|
4195
4328
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4249,7 +4382,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
4249
4382
|
};
|
|
4250
4383
|
|
|
4251
4384
|
// src/features/mcp/geminicli-mcp.ts
|
|
4252
|
-
var
|
|
4385
|
+
var import_node_path40 = require("path");
|
|
4253
4386
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
4254
4387
|
json;
|
|
4255
4388
|
constructor(params) {
|
|
@@ -4278,7 +4411,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4278
4411
|
}) {
|
|
4279
4412
|
const paths = this.getSettablePaths({ global });
|
|
4280
4413
|
const fileContent = await readOrInitializeFileContent(
|
|
4281
|
-
(0,
|
|
4414
|
+
(0, import_node_path40.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4282
4415
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4283
4416
|
);
|
|
4284
4417
|
const json = JSON.parse(fileContent);
|
|
@@ -4299,7 +4432,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4299
4432
|
}) {
|
|
4300
4433
|
const paths = this.getSettablePaths({ global });
|
|
4301
4434
|
const fileContent = await readOrInitializeFileContent(
|
|
4302
|
-
(0,
|
|
4435
|
+
(0, import_node_path40.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4303
4436
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4304
4437
|
);
|
|
4305
4438
|
const json = JSON.parse(fileContent);
|
|
@@ -4336,7 +4469,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
4336
4469
|
};
|
|
4337
4470
|
|
|
4338
4471
|
// src/features/mcp/junie-mcp.ts
|
|
4339
|
-
var
|
|
4472
|
+
var import_node_path41 = require("path");
|
|
4340
4473
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
4341
4474
|
json;
|
|
4342
4475
|
constructor(params) {
|
|
@@ -4348,7 +4481,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4348
4481
|
}
|
|
4349
4482
|
static getSettablePaths() {
|
|
4350
4483
|
return {
|
|
4351
|
-
relativeDirPath: (0,
|
|
4484
|
+
relativeDirPath: (0, import_node_path41.join)(".junie", "mcp"),
|
|
4352
4485
|
relativeFilePath: "mcp.json"
|
|
4353
4486
|
};
|
|
4354
4487
|
}
|
|
@@ -4357,7 +4490,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4357
4490
|
validate = true
|
|
4358
4491
|
}) {
|
|
4359
4492
|
const fileContent = await readFileContent(
|
|
4360
|
-
(0,
|
|
4493
|
+
(0, import_node_path41.join)(
|
|
4361
4494
|
baseDir,
|
|
4362
4495
|
this.getSettablePaths().relativeDirPath,
|
|
4363
4496
|
this.getSettablePaths().relativeFilePath
|
|
@@ -4406,7 +4539,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
4406
4539
|
};
|
|
4407
4540
|
|
|
4408
4541
|
// src/features/mcp/kilo-mcp.ts
|
|
4409
|
-
var
|
|
4542
|
+
var import_node_path42 = require("path");
|
|
4410
4543
|
var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
4411
4544
|
json;
|
|
4412
4545
|
constructor(params) {
|
|
@@ -4428,7 +4561,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
4428
4561
|
}) {
|
|
4429
4562
|
const paths = this.getSettablePaths();
|
|
4430
4563
|
const fileContent = await readOrInitializeFileContent(
|
|
4431
|
-
(0,
|
|
4564
|
+
(0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4432
4565
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4433
4566
|
);
|
|
4434
4567
|
return new _KiloMcp({
|
|
@@ -4482,7 +4615,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
|
|
|
4482
4615
|
};
|
|
4483
4616
|
|
|
4484
4617
|
// src/features/mcp/kiro-mcp.ts
|
|
4485
|
-
var
|
|
4618
|
+
var import_node_path43 = require("path");
|
|
4486
4619
|
var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
4487
4620
|
json;
|
|
4488
4621
|
constructor(params) {
|
|
@@ -4494,7 +4627,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
4494
4627
|
}
|
|
4495
4628
|
static getSettablePaths() {
|
|
4496
4629
|
return {
|
|
4497
|
-
relativeDirPath: (0,
|
|
4630
|
+
relativeDirPath: (0, import_node_path43.join)(".kiro", "settings"),
|
|
4498
4631
|
relativeFilePath: "mcp.json"
|
|
4499
4632
|
};
|
|
4500
4633
|
}
|
|
@@ -4504,7 +4637,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
4504
4637
|
}) {
|
|
4505
4638
|
const paths = this.getSettablePaths();
|
|
4506
4639
|
const fileContent = await readOrInitializeFileContent(
|
|
4507
|
-
(0,
|
|
4640
|
+
(0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4508
4641
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
4509
4642
|
);
|
|
4510
4643
|
return new _KiroMcp({
|
|
@@ -4558,7 +4691,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
|
|
|
4558
4691
|
};
|
|
4559
4692
|
|
|
4560
4693
|
// src/features/mcp/opencode-mcp.ts
|
|
4561
|
-
var
|
|
4694
|
+
var import_node_path44 = require("path");
|
|
4562
4695
|
var import_mini17 = require("zod/mini");
|
|
4563
4696
|
var OpencodeMcpLocalServerSchema = import_mini17.z.object({
|
|
4564
4697
|
type: import_mini17.z.literal("local"),
|
|
@@ -4682,7 +4815,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4682
4815
|
}) {
|
|
4683
4816
|
const paths = this.getSettablePaths({ global });
|
|
4684
4817
|
const fileContent = await readOrInitializeFileContent(
|
|
4685
|
-
(0,
|
|
4818
|
+
(0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4686
4819
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
4687
4820
|
);
|
|
4688
4821
|
const json = JSON.parse(fileContent);
|
|
@@ -4703,7 +4836,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4703
4836
|
}) {
|
|
4704
4837
|
const paths = this.getSettablePaths({ global });
|
|
4705
4838
|
const fileContent = await readOrInitializeFileContent(
|
|
4706
|
-
(0,
|
|
4839
|
+
(0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
4707
4840
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
4708
4841
|
);
|
|
4709
4842
|
const json = JSON.parse(fileContent);
|
|
@@ -4747,7 +4880,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
4747
4880
|
};
|
|
4748
4881
|
|
|
4749
4882
|
// src/features/mcp/roo-mcp.ts
|
|
4750
|
-
var
|
|
4883
|
+
var import_node_path45 = require("path");
|
|
4751
4884
|
function isRooMcpServers(value) {
|
|
4752
4885
|
return value !== void 0 && value !== null && typeof value === "object";
|
|
4753
4886
|
}
|
|
@@ -4799,7 +4932,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
4799
4932
|
validate = true
|
|
4800
4933
|
}) {
|
|
4801
4934
|
const fileContent = await readFileContent(
|
|
4802
|
-
(0,
|
|
4935
|
+
(0, import_node_path45.join)(
|
|
4803
4936
|
baseDir,
|
|
4804
4937
|
this.getSettablePaths().relativeDirPath,
|
|
4805
4938
|
this.getSettablePaths().relativeFilePath
|
|
@@ -5114,24 +5247,24 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
5114
5247
|
|
|
5115
5248
|
// src/features/rules/rules-processor.ts
|
|
5116
5249
|
var import_toon = require("@toon-format/toon");
|
|
5117
|
-
var
|
|
5250
|
+
var import_node_path95 = require("path");
|
|
5118
5251
|
var import_mini42 = require("zod/mini");
|
|
5119
5252
|
|
|
5120
5253
|
// src/constants/general.ts
|
|
5121
5254
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
5122
5255
|
|
|
5123
5256
|
// src/features/skills/agentsmd-skill.ts
|
|
5124
|
-
var
|
|
5257
|
+
var import_node_path49 = require("path");
|
|
5125
5258
|
|
|
5126
5259
|
// src/features/skills/simulated-skill.ts
|
|
5127
|
-
var
|
|
5260
|
+
var import_node_path48 = require("path");
|
|
5128
5261
|
var import_mini19 = require("zod/mini");
|
|
5129
5262
|
|
|
5130
5263
|
// src/features/skills/tool-skill.ts
|
|
5131
|
-
var
|
|
5264
|
+
var import_node_path47 = require("path");
|
|
5132
5265
|
|
|
5133
5266
|
// src/types/ai-dir.ts
|
|
5134
|
-
var
|
|
5267
|
+
var import_node_path46 = __toESM(require("path"), 1);
|
|
5135
5268
|
var AiDir = class {
|
|
5136
5269
|
/**
|
|
5137
5270
|
* @example "."
|
|
@@ -5165,7 +5298,7 @@ var AiDir = class {
|
|
|
5165
5298
|
otherFiles = [],
|
|
5166
5299
|
global = false
|
|
5167
5300
|
}) {
|
|
5168
|
-
if (dirName.includes(
|
|
5301
|
+
if (dirName.includes(import_node_path46.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
5169
5302
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
5170
5303
|
}
|
|
5171
5304
|
this.baseDir = baseDir;
|
|
@@ -5188,11 +5321,11 @@ var AiDir = class {
|
|
|
5188
5321
|
return this.dirName;
|
|
5189
5322
|
}
|
|
5190
5323
|
getDirPath() {
|
|
5191
|
-
const fullPath =
|
|
5192
|
-
const resolvedFull = (0,
|
|
5193
|
-
const resolvedBase = (0,
|
|
5194
|
-
const rel = (0,
|
|
5195
|
-
if (rel.startsWith("..") ||
|
|
5324
|
+
const fullPath = import_node_path46.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
5325
|
+
const resolvedFull = (0, import_node_path46.resolve)(fullPath);
|
|
5326
|
+
const resolvedBase = (0, import_node_path46.resolve)(this.baseDir);
|
|
5327
|
+
const rel = (0, import_node_path46.relative)(resolvedBase, resolvedFull);
|
|
5328
|
+
if (rel.startsWith("..") || import_node_path46.default.isAbsolute(rel)) {
|
|
5196
5329
|
throw new Error(
|
|
5197
5330
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
5198
5331
|
);
|
|
@@ -5206,7 +5339,7 @@ var AiDir = class {
|
|
|
5206
5339
|
return this.otherFiles;
|
|
5207
5340
|
}
|
|
5208
5341
|
getRelativePathFromCwd() {
|
|
5209
|
-
return
|
|
5342
|
+
return import_node_path46.default.join(this.relativeDirPath, this.dirName);
|
|
5210
5343
|
}
|
|
5211
5344
|
getGlobal() {
|
|
5212
5345
|
return this.global;
|
|
@@ -5225,15 +5358,15 @@ var AiDir = class {
|
|
|
5225
5358
|
* @returns Array of files with their relative paths and buffers
|
|
5226
5359
|
*/
|
|
5227
5360
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
5228
|
-
const dirPath = (0,
|
|
5229
|
-
const glob = (0,
|
|
5361
|
+
const dirPath = (0, import_node_path46.join)(baseDir, relativeDirPath, dirName);
|
|
5362
|
+
const glob = (0, import_node_path46.join)(dirPath, "**", "*");
|
|
5230
5363
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
5231
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
5364
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path46.basename)(filePath) !== excludeFileName);
|
|
5232
5365
|
const files = await Promise.all(
|
|
5233
5366
|
filteredPaths.map(async (filePath) => {
|
|
5234
5367
|
const fileBuffer = await readFileBuffer(filePath);
|
|
5235
5368
|
return {
|
|
5236
|
-
relativeFilePathToDirPath: (0,
|
|
5369
|
+
relativeFilePathToDirPath: (0, import_node_path46.relative)(dirPath, filePath),
|
|
5237
5370
|
fileBuffer
|
|
5238
5371
|
};
|
|
5239
5372
|
})
|
|
@@ -5324,8 +5457,8 @@ var ToolSkill = class extends AiDir {
|
|
|
5324
5457
|
}) {
|
|
5325
5458
|
const settablePaths = getSettablePaths({ global });
|
|
5326
5459
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
5327
|
-
const skillDirPath = (0,
|
|
5328
|
-
const skillFilePath = (0,
|
|
5460
|
+
const skillDirPath = (0, import_node_path47.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5461
|
+
const skillFilePath = (0, import_node_path47.join)(skillDirPath, SKILL_FILE_NAME);
|
|
5329
5462
|
if (!await fileExists(skillFilePath)) {
|
|
5330
5463
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
5331
5464
|
}
|
|
@@ -5383,7 +5516,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
5383
5516
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
5384
5517
|
if (!result.success) {
|
|
5385
5518
|
throw new Error(
|
|
5386
|
-
`Invalid frontmatter in ${(0,
|
|
5519
|
+
`Invalid frontmatter in ${(0, import_node_path48.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
5387
5520
|
);
|
|
5388
5521
|
}
|
|
5389
5522
|
}
|
|
@@ -5441,8 +5574,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
5441
5574
|
}) {
|
|
5442
5575
|
const settablePaths = this.getSettablePaths();
|
|
5443
5576
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
5444
|
-
const skillDirPath = (0,
|
|
5445
|
-
const skillFilePath = (0,
|
|
5577
|
+
const skillDirPath = (0, import_node_path48.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5578
|
+
const skillFilePath = (0, import_node_path48.join)(skillDirPath, SKILL_FILE_NAME);
|
|
5446
5579
|
if (!await fileExists(skillFilePath)) {
|
|
5447
5580
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
5448
5581
|
}
|
|
@@ -5519,7 +5652,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
5519
5652
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
5520
5653
|
}
|
|
5521
5654
|
return {
|
|
5522
|
-
relativeDirPath: (0,
|
|
5655
|
+
relativeDirPath: (0, import_node_path49.join)(".agents", "skills")
|
|
5523
5656
|
};
|
|
5524
5657
|
}
|
|
5525
5658
|
static async fromDir(params) {
|
|
@@ -5546,14 +5679,14 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
5546
5679
|
};
|
|
5547
5680
|
|
|
5548
5681
|
// src/features/skills/geminicli-skill.ts
|
|
5549
|
-
var
|
|
5682
|
+
var import_node_path50 = require("path");
|
|
5550
5683
|
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
5551
5684
|
static getSettablePaths(options) {
|
|
5552
5685
|
if (options?.global) {
|
|
5553
5686
|
throw new Error("GeminiCliSkill does not support global mode.");
|
|
5554
5687
|
}
|
|
5555
5688
|
return {
|
|
5556
|
-
relativeDirPath: (0,
|
|
5689
|
+
relativeDirPath: (0, import_node_path50.join)(".gemini", "skills")
|
|
5557
5690
|
};
|
|
5558
5691
|
}
|
|
5559
5692
|
static async fromDir(params) {
|
|
@@ -5580,11 +5713,11 @@ var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
|
5580
5713
|
};
|
|
5581
5714
|
|
|
5582
5715
|
// src/features/skills/skills-processor.ts
|
|
5583
|
-
var
|
|
5716
|
+
var import_node_path61 = require("path");
|
|
5584
5717
|
var import_mini29 = require("zod/mini");
|
|
5585
5718
|
|
|
5586
5719
|
// src/types/dir-feature-processor.ts
|
|
5587
|
-
var
|
|
5720
|
+
var import_node_path51 = require("path");
|
|
5588
5721
|
var DirFeatureProcessor = class {
|
|
5589
5722
|
baseDir;
|
|
5590
5723
|
constructor({ baseDir = process.cwd() }) {
|
|
@@ -5606,14 +5739,14 @@ var DirFeatureProcessor = class {
|
|
|
5606
5739
|
await ensureDir(dirPath);
|
|
5607
5740
|
const mainFile = aiDir.getMainFile();
|
|
5608
5741
|
if (mainFile) {
|
|
5609
|
-
const mainFilePath = (0,
|
|
5742
|
+
const mainFilePath = (0, import_node_path51.join)(dirPath, mainFile.name);
|
|
5610
5743
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
5611
5744
|
const contentWithNewline = addTrailingNewline(content);
|
|
5612
5745
|
await writeFileContent(mainFilePath, contentWithNewline);
|
|
5613
5746
|
}
|
|
5614
5747
|
const otherFiles = aiDir.getOtherFiles();
|
|
5615
5748
|
for (const file of otherFiles) {
|
|
5616
|
-
const filePath = (0,
|
|
5749
|
+
const filePath = (0, import_node_path51.join)(dirPath, file.relativeFilePathToDirPath);
|
|
5617
5750
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
5618
5751
|
await writeFileContent(filePath, contentWithNewline);
|
|
5619
5752
|
}
|
|
@@ -5628,11 +5761,11 @@ var DirFeatureProcessor = class {
|
|
|
5628
5761
|
};
|
|
5629
5762
|
|
|
5630
5763
|
// src/features/skills/antigravity-skill.ts
|
|
5631
|
-
var
|
|
5764
|
+
var import_node_path53 = require("path");
|
|
5632
5765
|
var import_mini21 = require("zod/mini");
|
|
5633
5766
|
|
|
5634
5767
|
// src/features/skills/rulesync-skill.ts
|
|
5635
|
-
var
|
|
5768
|
+
var import_node_path52 = require("path");
|
|
5636
5769
|
var import_mini20 = require("zod/mini");
|
|
5637
5770
|
var RulesyncSkillFrontmatterSchemaInternal = import_mini20.z.looseObject({
|
|
5638
5771
|
name: import_mini20.z.string(),
|
|
@@ -5724,8 +5857,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
5724
5857
|
dirName,
|
|
5725
5858
|
global = false
|
|
5726
5859
|
}) {
|
|
5727
|
-
const skillDirPath = (0,
|
|
5728
|
-
const skillFilePath = (0,
|
|
5860
|
+
const skillDirPath = (0, import_node_path52.join)(baseDir, relativeDirPath, dirName);
|
|
5861
|
+
const skillFilePath = (0, import_node_path52.join)(skillDirPath, SKILL_FILE_NAME);
|
|
5729
5862
|
if (!await fileExists(skillFilePath)) {
|
|
5730
5863
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
5731
5864
|
}
|
|
@@ -5762,7 +5895,7 @@ var AntigravitySkillFrontmatterSchema = import_mini21.z.looseObject({
|
|
|
5762
5895
|
var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
5763
5896
|
constructor({
|
|
5764
5897
|
baseDir = process.cwd(),
|
|
5765
|
-
relativeDirPath = (0,
|
|
5898
|
+
relativeDirPath = (0, import_node_path53.join)(".agent", "skills"),
|
|
5766
5899
|
dirName,
|
|
5767
5900
|
frontmatter,
|
|
5768
5901
|
body,
|
|
@@ -5794,11 +5927,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
5794
5927
|
} = {}) {
|
|
5795
5928
|
if (global) {
|
|
5796
5929
|
return {
|
|
5797
|
-
relativeDirPath: (0,
|
|
5930
|
+
relativeDirPath: (0, import_node_path53.join)(".gemini", "antigravity", "skills")
|
|
5798
5931
|
};
|
|
5799
5932
|
}
|
|
5800
5933
|
return {
|
|
5801
|
-
relativeDirPath: (0,
|
|
5934
|
+
relativeDirPath: (0, import_node_path53.join)(".agent", "skills")
|
|
5802
5935
|
};
|
|
5803
5936
|
}
|
|
5804
5937
|
getFrontmatter() {
|
|
@@ -5880,9 +6013,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
5880
6013
|
});
|
|
5881
6014
|
const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
5882
6015
|
if (!result.success) {
|
|
5883
|
-
const skillDirPath = (0,
|
|
6016
|
+
const skillDirPath = (0, import_node_path53.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
5884
6017
|
throw new Error(
|
|
5885
|
-
`Invalid frontmatter in ${(0,
|
|
6018
|
+
`Invalid frontmatter in ${(0, import_node_path53.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
5886
6019
|
);
|
|
5887
6020
|
}
|
|
5888
6021
|
return new _AntigravitySkill({
|
|
@@ -5916,7 +6049,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
|
|
|
5916
6049
|
};
|
|
5917
6050
|
|
|
5918
6051
|
// src/features/skills/claudecode-skill.ts
|
|
5919
|
-
var
|
|
6052
|
+
var import_node_path54 = require("path");
|
|
5920
6053
|
var import_mini22 = require("zod/mini");
|
|
5921
6054
|
var ClaudecodeSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
5922
6055
|
name: import_mini22.z.string(),
|
|
@@ -5926,7 +6059,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini22.z.looseObject({
|
|
|
5926
6059
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
5927
6060
|
constructor({
|
|
5928
6061
|
baseDir = process.cwd(),
|
|
5929
|
-
relativeDirPath = (0,
|
|
6062
|
+
relativeDirPath = (0, import_node_path54.join)(".claude", "skills"),
|
|
5930
6063
|
dirName,
|
|
5931
6064
|
frontmatter,
|
|
5932
6065
|
body,
|
|
@@ -5957,7 +6090,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
5957
6090
|
global: _global = false
|
|
5958
6091
|
} = {}) {
|
|
5959
6092
|
return {
|
|
5960
|
-
relativeDirPath: (0,
|
|
6093
|
+
relativeDirPath: (0, import_node_path54.join)(".claude", "skills")
|
|
5961
6094
|
};
|
|
5962
6095
|
}
|
|
5963
6096
|
getFrontmatter() {
|
|
@@ -6045,9 +6178,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6045
6178
|
});
|
|
6046
6179
|
const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6047
6180
|
if (!result.success) {
|
|
6048
|
-
const skillDirPath = (0,
|
|
6181
|
+
const skillDirPath = (0, import_node_path54.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6049
6182
|
throw new Error(
|
|
6050
|
-
`Invalid frontmatter in ${(0,
|
|
6183
|
+
`Invalid frontmatter in ${(0, import_node_path54.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6051
6184
|
);
|
|
6052
6185
|
}
|
|
6053
6186
|
return new _ClaudecodeSkill({
|
|
@@ -6081,7 +6214,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
6081
6214
|
};
|
|
6082
6215
|
|
|
6083
6216
|
// src/features/skills/codexcli-skill.ts
|
|
6084
|
-
var
|
|
6217
|
+
var import_node_path55 = require("path");
|
|
6085
6218
|
var import_mini23 = require("zod/mini");
|
|
6086
6219
|
var CodexCliSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
6087
6220
|
name: import_mini23.z.string(),
|
|
@@ -6095,7 +6228,7 @@ var CodexCliSkillFrontmatterSchema = import_mini23.z.looseObject({
|
|
|
6095
6228
|
var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
6096
6229
|
constructor({
|
|
6097
6230
|
baseDir = process.cwd(),
|
|
6098
|
-
relativeDirPath = (0,
|
|
6231
|
+
relativeDirPath = (0, import_node_path55.join)(".codex", "skills"),
|
|
6099
6232
|
dirName,
|
|
6100
6233
|
frontmatter,
|
|
6101
6234
|
body,
|
|
@@ -6126,7 +6259,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
6126
6259
|
global: _global = false
|
|
6127
6260
|
} = {}) {
|
|
6128
6261
|
return {
|
|
6129
|
-
relativeDirPath: (0,
|
|
6262
|
+
relativeDirPath: (0, import_node_path55.join)(".codex", "skills")
|
|
6130
6263
|
};
|
|
6131
6264
|
}
|
|
6132
6265
|
getFrontmatter() {
|
|
@@ -6218,9 +6351,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
6218
6351
|
});
|
|
6219
6352
|
const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6220
6353
|
if (!result.success) {
|
|
6221
|
-
const skillDirPath = (0,
|
|
6354
|
+
const skillDirPath = (0, import_node_path55.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6222
6355
|
throw new Error(
|
|
6223
|
-
`Invalid frontmatter in ${(0,
|
|
6356
|
+
`Invalid frontmatter in ${(0, import_node_path55.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6224
6357
|
);
|
|
6225
6358
|
}
|
|
6226
6359
|
return new _CodexCliSkill({
|
|
@@ -6254,7 +6387,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
|
|
|
6254
6387
|
};
|
|
6255
6388
|
|
|
6256
6389
|
// src/features/skills/copilot-skill.ts
|
|
6257
|
-
var
|
|
6390
|
+
var import_node_path56 = require("path");
|
|
6258
6391
|
var import_mini24 = require("zod/mini");
|
|
6259
6392
|
var CopilotSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
6260
6393
|
name: import_mini24.z.string(),
|
|
@@ -6264,7 +6397,7 @@ var CopilotSkillFrontmatterSchema = import_mini24.z.looseObject({
|
|
|
6264
6397
|
var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
6265
6398
|
constructor({
|
|
6266
6399
|
baseDir = process.cwd(),
|
|
6267
|
-
relativeDirPath = (0,
|
|
6400
|
+
relativeDirPath = (0, import_node_path56.join)(".github", "skills"),
|
|
6268
6401
|
dirName,
|
|
6269
6402
|
frontmatter,
|
|
6270
6403
|
body,
|
|
@@ -6296,7 +6429,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
6296
6429
|
throw new Error("CopilotSkill does not support global mode.");
|
|
6297
6430
|
}
|
|
6298
6431
|
return {
|
|
6299
|
-
relativeDirPath: (0,
|
|
6432
|
+
relativeDirPath: (0, import_node_path56.join)(".github", "skills")
|
|
6300
6433
|
};
|
|
6301
6434
|
}
|
|
6302
6435
|
getFrontmatter() {
|
|
@@ -6384,9 +6517,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
6384
6517
|
});
|
|
6385
6518
|
const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6386
6519
|
if (!result.success) {
|
|
6387
|
-
const skillDirPath = (0,
|
|
6520
|
+
const skillDirPath = (0, import_node_path56.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6388
6521
|
throw new Error(
|
|
6389
|
-
`Invalid frontmatter in ${(0,
|
|
6522
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6390
6523
|
);
|
|
6391
6524
|
}
|
|
6392
6525
|
return new _CopilotSkill({
|
|
@@ -6421,7 +6554,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
|
|
|
6421
6554
|
};
|
|
6422
6555
|
|
|
6423
6556
|
// src/features/skills/cursor-skill.ts
|
|
6424
|
-
var
|
|
6557
|
+
var import_node_path57 = require("path");
|
|
6425
6558
|
var import_mini25 = require("zod/mini");
|
|
6426
6559
|
var CursorSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
6427
6560
|
name: import_mini25.z.string(),
|
|
@@ -6430,7 +6563,7 @@ var CursorSkillFrontmatterSchema = import_mini25.z.looseObject({
|
|
|
6430
6563
|
var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
6431
6564
|
constructor({
|
|
6432
6565
|
baseDir = process.cwd(),
|
|
6433
|
-
relativeDirPath = (0,
|
|
6566
|
+
relativeDirPath = (0, import_node_path57.join)(".cursor", "skills"),
|
|
6434
6567
|
dirName,
|
|
6435
6568
|
frontmatter,
|
|
6436
6569
|
body,
|
|
@@ -6462,7 +6595,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
6462
6595
|
throw new Error("CursorSkill does not support global mode.");
|
|
6463
6596
|
}
|
|
6464
6597
|
return {
|
|
6465
|
-
relativeDirPath: (0,
|
|
6598
|
+
relativeDirPath: (0, import_node_path57.join)(".cursor", "skills")
|
|
6466
6599
|
};
|
|
6467
6600
|
}
|
|
6468
6601
|
getFrontmatter() {
|
|
@@ -6544,9 +6677,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
6544
6677
|
});
|
|
6545
6678
|
const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6546
6679
|
if (!result.success) {
|
|
6547
|
-
const skillDirPath = (0,
|
|
6680
|
+
const skillDirPath = (0, import_node_path57.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6548
6681
|
throw new Error(
|
|
6549
|
-
`Invalid frontmatter in ${(0,
|
|
6682
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6550
6683
|
);
|
|
6551
6684
|
}
|
|
6552
6685
|
return new _CursorSkill({
|
|
@@ -6581,7 +6714,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
|
|
|
6581
6714
|
};
|
|
6582
6715
|
|
|
6583
6716
|
// src/features/skills/kilo-skill.ts
|
|
6584
|
-
var
|
|
6717
|
+
var import_node_path58 = require("path");
|
|
6585
6718
|
var import_mini26 = require("zod/mini");
|
|
6586
6719
|
var KiloSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
6587
6720
|
name: import_mini26.z.string(),
|
|
@@ -6590,7 +6723,7 @@ var KiloSkillFrontmatterSchema = import_mini26.z.looseObject({
|
|
|
6590
6723
|
var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
6591
6724
|
constructor({
|
|
6592
6725
|
baseDir = process.cwd(),
|
|
6593
|
-
relativeDirPath = (0,
|
|
6726
|
+
relativeDirPath = (0, import_node_path58.join)(".kilocode", "skills"),
|
|
6594
6727
|
dirName,
|
|
6595
6728
|
frontmatter,
|
|
6596
6729
|
body,
|
|
@@ -6621,7 +6754,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
6621
6754
|
global: _global = false
|
|
6622
6755
|
} = {}) {
|
|
6623
6756
|
return {
|
|
6624
|
-
relativeDirPath: (0,
|
|
6757
|
+
relativeDirPath: (0, import_node_path58.join)(".kilocode", "skills")
|
|
6625
6758
|
};
|
|
6626
6759
|
}
|
|
6627
6760
|
getFrontmatter() {
|
|
@@ -6711,13 +6844,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
6711
6844
|
});
|
|
6712
6845
|
const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6713
6846
|
if (!result.success) {
|
|
6714
|
-
const skillDirPath = (0,
|
|
6847
|
+
const skillDirPath = (0, import_node_path58.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6715
6848
|
throw new Error(
|
|
6716
|
-
`Invalid frontmatter in ${(0,
|
|
6849
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6717
6850
|
);
|
|
6718
6851
|
}
|
|
6719
6852
|
if (result.data.name !== loaded.dirName) {
|
|
6720
|
-
const skillFilePath = (0,
|
|
6853
|
+
const skillFilePath = (0, import_node_path58.join)(
|
|
6721
6854
|
loaded.baseDir,
|
|
6722
6855
|
loaded.relativeDirPath,
|
|
6723
6856
|
loaded.dirName,
|
|
@@ -6758,7 +6891,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
|
|
|
6758
6891
|
};
|
|
6759
6892
|
|
|
6760
6893
|
// src/features/skills/opencode-skill.ts
|
|
6761
|
-
var
|
|
6894
|
+
var import_node_path59 = require("path");
|
|
6762
6895
|
var import_mini27 = require("zod/mini");
|
|
6763
6896
|
var OpenCodeSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
6764
6897
|
name: import_mini27.z.string(),
|
|
@@ -6768,7 +6901,7 @@ var OpenCodeSkillFrontmatterSchema = import_mini27.z.looseObject({
|
|
|
6768
6901
|
var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
6769
6902
|
constructor({
|
|
6770
6903
|
baseDir = process.cwd(),
|
|
6771
|
-
relativeDirPath = (0,
|
|
6904
|
+
relativeDirPath = (0, import_node_path59.join)(".opencode", "skill"),
|
|
6772
6905
|
dirName,
|
|
6773
6906
|
frontmatter,
|
|
6774
6907
|
body,
|
|
@@ -6797,7 +6930,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6797
6930
|
}
|
|
6798
6931
|
static getSettablePaths({ global = false } = {}) {
|
|
6799
6932
|
return {
|
|
6800
|
-
relativeDirPath: global ? (0,
|
|
6933
|
+
relativeDirPath: global ? (0, import_node_path59.join)(".config", "opencode", "skill") : (0, import_node_path59.join)(".opencode", "skill")
|
|
6801
6934
|
};
|
|
6802
6935
|
}
|
|
6803
6936
|
getFrontmatter() {
|
|
@@ -6885,9 +7018,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6885
7018
|
});
|
|
6886
7019
|
const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
6887
7020
|
if (!result.success) {
|
|
6888
|
-
const skillDirPath = (0,
|
|
7021
|
+
const skillDirPath = (0, import_node_path59.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
6889
7022
|
throw new Error(
|
|
6890
|
-
`Invalid frontmatter in ${(0,
|
|
7023
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
6891
7024
|
);
|
|
6892
7025
|
}
|
|
6893
7026
|
return new _OpenCodeSkill({
|
|
@@ -6921,7 +7054,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
|
|
|
6921
7054
|
};
|
|
6922
7055
|
|
|
6923
7056
|
// src/features/skills/roo-skill.ts
|
|
6924
|
-
var
|
|
7057
|
+
var import_node_path60 = require("path");
|
|
6925
7058
|
var import_mini28 = require("zod/mini");
|
|
6926
7059
|
var RooSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
6927
7060
|
name: import_mini28.z.string(),
|
|
@@ -6930,7 +7063,7 @@ var RooSkillFrontmatterSchema = import_mini28.z.looseObject({
|
|
|
6930
7063
|
var RooSkill = class _RooSkill extends ToolSkill {
|
|
6931
7064
|
constructor({
|
|
6932
7065
|
baseDir = process.cwd(),
|
|
6933
|
-
relativeDirPath = (0,
|
|
7066
|
+
relativeDirPath = (0, import_node_path60.join)(".roo", "skills"),
|
|
6934
7067
|
dirName,
|
|
6935
7068
|
frontmatter,
|
|
6936
7069
|
body,
|
|
@@ -6961,7 +7094,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
6961
7094
|
global: _global = false
|
|
6962
7095
|
} = {}) {
|
|
6963
7096
|
return {
|
|
6964
|
-
relativeDirPath: (0,
|
|
7097
|
+
relativeDirPath: (0, import_node_path60.join)(".roo", "skills")
|
|
6965
7098
|
};
|
|
6966
7099
|
}
|
|
6967
7100
|
getFrontmatter() {
|
|
@@ -7051,13 +7184,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
|
|
|
7051
7184
|
});
|
|
7052
7185
|
const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
|
|
7053
7186
|
if (!result.success) {
|
|
7054
|
-
const skillDirPath = (0,
|
|
7187
|
+
const skillDirPath = (0, import_node_path60.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
|
|
7055
7188
|
throw new Error(
|
|
7056
|
-
`Invalid frontmatter in ${(0,
|
|
7189
|
+
`Invalid frontmatter in ${(0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
|
|
7057
7190
|
);
|
|
7058
7191
|
}
|
|
7059
7192
|
if (result.data.name !== loaded.dirName) {
|
|
7060
|
-
const skillFilePath = (0,
|
|
7193
|
+
const skillFilePath = (0, import_node_path60.join)(
|
|
7061
7194
|
loaded.baseDir,
|
|
7062
7195
|
loaded.relativeDirPath,
|
|
7063
7196
|
loaded.dirName,
|
|
@@ -7268,9 +7401,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
7268
7401
|
*/
|
|
7269
7402
|
async loadRulesyncDirs() {
|
|
7270
7403
|
const paths = RulesyncSkill.getSettablePaths();
|
|
7271
|
-
const rulesyncSkillsDirPath = (0,
|
|
7272
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
7273
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
7404
|
+
const rulesyncSkillsDirPath = (0, import_node_path61.join)(this.baseDir, paths.relativeDirPath);
|
|
7405
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path61.join)(rulesyncSkillsDirPath, "*"), { type: "dir" });
|
|
7406
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path61.basename)(path3));
|
|
7274
7407
|
const rulesyncSkills = await Promise.all(
|
|
7275
7408
|
dirNames.map(
|
|
7276
7409
|
(dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
|
|
@@ -7286,9 +7419,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
7286
7419
|
async loadToolDirs() {
|
|
7287
7420
|
const factory = this.getFactory(this.toolTarget);
|
|
7288
7421
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
7289
|
-
const skillsDirPath = (0,
|
|
7290
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
7291
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
7422
|
+
const skillsDirPath = (0, import_node_path61.join)(this.baseDir, paths.relativeDirPath);
|
|
7423
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path61.join)(skillsDirPath, "*"), { type: "dir" });
|
|
7424
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path61.basename)(path3));
|
|
7292
7425
|
const toolSkills = await Promise.all(
|
|
7293
7426
|
dirNames.map(
|
|
7294
7427
|
(dirName) => factory.class.fromDir({
|
|
@@ -7304,9 +7437,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
7304
7437
|
async loadToolDirsToDelete() {
|
|
7305
7438
|
const factory = this.getFactory(this.toolTarget);
|
|
7306
7439
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
7307
|
-
const skillsDirPath = (0,
|
|
7308
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
7309
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
7440
|
+
const skillsDirPath = (0, import_node_path61.join)(this.baseDir, paths.relativeDirPath);
|
|
7441
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path61.join)(skillsDirPath, "*"), { type: "dir" });
|
|
7442
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path61.basename)(path3));
|
|
7310
7443
|
const toolSkills = dirNames.map(
|
|
7311
7444
|
(dirName) => factory.class.forDeletion({
|
|
7312
7445
|
baseDir: this.baseDir,
|
|
@@ -7354,10 +7487,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
7354
7487
|
};
|
|
7355
7488
|
|
|
7356
7489
|
// src/features/subagents/agentsmd-subagent.ts
|
|
7357
|
-
var
|
|
7490
|
+
var import_node_path63 = require("path");
|
|
7358
7491
|
|
|
7359
7492
|
// src/features/subagents/simulated-subagent.ts
|
|
7360
|
-
var
|
|
7493
|
+
var import_node_path62 = require("path");
|
|
7361
7494
|
var import_mini30 = require("zod/mini");
|
|
7362
7495
|
|
|
7363
7496
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -7413,7 +7546,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
7413
7546
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7414
7547
|
if (!result.success) {
|
|
7415
7548
|
throw new Error(
|
|
7416
|
-
`Invalid frontmatter in ${(0,
|
|
7549
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7417
7550
|
);
|
|
7418
7551
|
}
|
|
7419
7552
|
}
|
|
@@ -7464,7 +7597,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
7464
7597
|
return {
|
|
7465
7598
|
success: false,
|
|
7466
7599
|
error: new Error(
|
|
7467
|
-
`Invalid frontmatter in ${(0,
|
|
7600
|
+
`Invalid frontmatter in ${(0, import_node_path62.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7468
7601
|
)
|
|
7469
7602
|
};
|
|
7470
7603
|
}
|
|
@@ -7474,7 +7607,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
7474
7607
|
relativeFilePath,
|
|
7475
7608
|
validate = true
|
|
7476
7609
|
}) {
|
|
7477
|
-
const filePath = (0,
|
|
7610
|
+
const filePath = (0, import_node_path62.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
7478
7611
|
const fileContent = await readFileContent(filePath);
|
|
7479
7612
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7480
7613
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -7484,7 +7617,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
7484
7617
|
return {
|
|
7485
7618
|
baseDir,
|
|
7486
7619
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
7487
|
-
relativeFilePath: (0,
|
|
7620
|
+
relativeFilePath: (0, import_node_path62.basename)(relativeFilePath),
|
|
7488
7621
|
frontmatter: result.data,
|
|
7489
7622
|
body: content.trim(),
|
|
7490
7623
|
validate
|
|
@@ -7510,7 +7643,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
7510
7643
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
7511
7644
|
static getSettablePaths() {
|
|
7512
7645
|
return {
|
|
7513
|
-
relativeDirPath: (0,
|
|
7646
|
+
relativeDirPath: (0, import_node_path63.join)(".agents", "subagents")
|
|
7514
7647
|
};
|
|
7515
7648
|
}
|
|
7516
7649
|
static async fromFile(params) {
|
|
@@ -7533,11 +7666,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
7533
7666
|
};
|
|
7534
7667
|
|
|
7535
7668
|
// src/features/subagents/codexcli-subagent.ts
|
|
7536
|
-
var
|
|
7669
|
+
var import_node_path64 = require("path");
|
|
7537
7670
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
7538
7671
|
static getSettablePaths() {
|
|
7539
7672
|
return {
|
|
7540
|
-
relativeDirPath: (0,
|
|
7673
|
+
relativeDirPath: (0, import_node_path64.join)(".codex", "subagents")
|
|
7541
7674
|
};
|
|
7542
7675
|
}
|
|
7543
7676
|
static async fromFile(params) {
|
|
@@ -7560,11 +7693,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
7560
7693
|
};
|
|
7561
7694
|
|
|
7562
7695
|
// src/features/subagents/cursor-subagent.ts
|
|
7563
|
-
var
|
|
7696
|
+
var import_node_path65 = require("path");
|
|
7564
7697
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
7565
7698
|
static getSettablePaths() {
|
|
7566
7699
|
return {
|
|
7567
|
-
relativeDirPath: (0,
|
|
7700
|
+
relativeDirPath: (0, import_node_path65.join)(".cursor", "subagents")
|
|
7568
7701
|
};
|
|
7569
7702
|
}
|
|
7570
7703
|
static async fromFile(params) {
|
|
@@ -7587,11 +7720,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
7587
7720
|
};
|
|
7588
7721
|
|
|
7589
7722
|
// src/features/subagents/geminicli-subagent.ts
|
|
7590
|
-
var
|
|
7723
|
+
var import_node_path66 = require("path");
|
|
7591
7724
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
7592
7725
|
static getSettablePaths() {
|
|
7593
7726
|
return {
|
|
7594
|
-
relativeDirPath: (0,
|
|
7727
|
+
relativeDirPath: (0, import_node_path66.join)(".gemini", "subagents")
|
|
7595
7728
|
};
|
|
7596
7729
|
}
|
|
7597
7730
|
static async fromFile(params) {
|
|
@@ -7614,11 +7747,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
7614
7747
|
};
|
|
7615
7748
|
|
|
7616
7749
|
// src/features/subagents/roo-subagent.ts
|
|
7617
|
-
var
|
|
7750
|
+
var import_node_path67 = require("path");
|
|
7618
7751
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
7619
7752
|
static getSettablePaths() {
|
|
7620
7753
|
return {
|
|
7621
|
-
relativeDirPath: (0,
|
|
7754
|
+
relativeDirPath: (0, import_node_path67.join)(".roo", "subagents")
|
|
7622
7755
|
};
|
|
7623
7756
|
}
|
|
7624
7757
|
static async fromFile(params) {
|
|
@@ -7641,15 +7774,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
7641
7774
|
};
|
|
7642
7775
|
|
|
7643
7776
|
// src/features/subagents/subagents-processor.ts
|
|
7644
|
-
var
|
|
7777
|
+
var import_node_path72 = require("path");
|
|
7645
7778
|
var import_mini35 = require("zod/mini");
|
|
7646
7779
|
|
|
7647
7780
|
// src/features/subagents/claudecode-subagent.ts
|
|
7648
|
-
var
|
|
7781
|
+
var import_node_path69 = require("path");
|
|
7649
7782
|
var import_mini32 = require("zod/mini");
|
|
7650
7783
|
|
|
7651
7784
|
// src/features/subagents/rulesync-subagent.ts
|
|
7652
|
-
var
|
|
7785
|
+
var import_node_path68 = require("path");
|
|
7653
7786
|
var import_mini31 = require("zod/mini");
|
|
7654
7787
|
var RulesyncSubagentFrontmatterSchema = import_mini31.z.looseObject({
|
|
7655
7788
|
targets: RulesyncTargetsSchema,
|
|
@@ -7664,7 +7797,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
7664
7797
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7665
7798
|
if (!result.success) {
|
|
7666
7799
|
throw new Error(
|
|
7667
|
-
`Invalid frontmatter in ${(0,
|
|
7800
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7668
7801
|
);
|
|
7669
7802
|
}
|
|
7670
7803
|
}
|
|
@@ -7697,7 +7830,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
7697
7830
|
return {
|
|
7698
7831
|
success: false,
|
|
7699
7832
|
error: new Error(
|
|
7700
|
-
`Invalid frontmatter in ${(0,
|
|
7833
|
+
`Invalid frontmatter in ${(0, import_node_path68.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7701
7834
|
)
|
|
7702
7835
|
};
|
|
7703
7836
|
}
|
|
@@ -7706,14 +7839,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
7706
7839
|
relativeFilePath
|
|
7707
7840
|
}) {
|
|
7708
7841
|
const fileContent = await readFileContent(
|
|
7709
|
-
(0,
|
|
7842
|
+
(0, import_node_path68.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
7710
7843
|
);
|
|
7711
7844
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7712
7845
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7713
7846
|
if (!result.success) {
|
|
7714
7847
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
7715
7848
|
}
|
|
7716
|
-
const filename = (0,
|
|
7849
|
+
const filename = (0, import_node_path68.basename)(relativeFilePath);
|
|
7717
7850
|
return new _RulesyncSubagent({
|
|
7718
7851
|
baseDir: process.cwd(),
|
|
7719
7852
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -7741,7 +7874,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7741
7874
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7742
7875
|
if (!result.success) {
|
|
7743
7876
|
throw new Error(
|
|
7744
|
-
`Invalid frontmatter in ${(0,
|
|
7877
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7745
7878
|
);
|
|
7746
7879
|
}
|
|
7747
7880
|
}
|
|
@@ -7753,7 +7886,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7753
7886
|
}
|
|
7754
7887
|
static getSettablePaths(_options = {}) {
|
|
7755
7888
|
return {
|
|
7756
|
-
relativeDirPath: (0,
|
|
7889
|
+
relativeDirPath: (0, import_node_path69.join)(".claude", "agents")
|
|
7757
7890
|
};
|
|
7758
7891
|
}
|
|
7759
7892
|
getFrontmatter() {
|
|
@@ -7827,7 +7960,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7827
7960
|
return {
|
|
7828
7961
|
success: false,
|
|
7829
7962
|
error: new Error(
|
|
7830
|
-
`Invalid frontmatter in ${(0,
|
|
7963
|
+
`Invalid frontmatter in ${(0, import_node_path69.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7831
7964
|
)
|
|
7832
7965
|
};
|
|
7833
7966
|
}
|
|
@@ -7845,7 +7978,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7845
7978
|
global = false
|
|
7846
7979
|
}) {
|
|
7847
7980
|
const paths = this.getSettablePaths({ global });
|
|
7848
|
-
const filePath = (0,
|
|
7981
|
+
const filePath = (0, import_node_path69.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
7849
7982
|
const fileContent = await readFileContent(filePath);
|
|
7850
7983
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
7851
7984
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -7880,7 +8013,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
7880
8013
|
};
|
|
7881
8014
|
|
|
7882
8015
|
// src/features/subagents/copilot-subagent.ts
|
|
7883
|
-
var
|
|
8016
|
+
var import_node_path70 = require("path");
|
|
7884
8017
|
var import_mini33 = require("zod/mini");
|
|
7885
8018
|
var REQUIRED_TOOL = "agent/runSubagent";
|
|
7886
8019
|
var CopilotSubagentFrontmatterSchema = import_mini33.z.looseObject({
|
|
@@ -7906,7 +8039,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7906
8039
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
7907
8040
|
if (!result.success) {
|
|
7908
8041
|
throw new Error(
|
|
7909
|
-
`Invalid frontmatter in ${(0,
|
|
8042
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
7910
8043
|
);
|
|
7911
8044
|
}
|
|
7912
8045
|
}
|
|
@@ -7918,7 +8051,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7918
8051
|
}
|
|
7919
8052
|
static getSettablePaths(_options = {}) {
|
|
7920
8053
|
return {
|
|
7921
|
-
relativeDirPath: (0,
|
|
8054
|
+
relativeDirPath: (0, import_node_path70.join)(".github", "agents")
|
|
7922
8055
|
};
|
|
7923
8056
|
}
|
|
7924
8057
|
getFrontmatter() {
|
|
@@ -7992,7 +8125,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
7992
8125
|
return {
|
|
7993
8126
|
success: false,
|
|
7994
8127
|
error: new Error(
|
|
7995
|
-
`Invalid frontmatter in ${(0,
|
|
8128
|
+
`Invalid frontmatter in ${(0, import_node_path70.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7996
8129
|
)
|
|
7997
8130
|
};
|
|
7998
8131
|
}
|
|
@@ -8010,7 +8143,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
8010
8143
|
global = false
|
|
8011
8144
|
}) {
|
|
8012
8145
|
const paths = this.getSettablePaths({ global });
|
|
8013
|
-
const filePath = (0,
|
|
8146
|
+
const filePath = (0, import_node_path70.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
8014
8147
|
const fileContent = await readFileContent(filePath);
|
|
8015
8148
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8016
8149
|
const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -8046,7 +8179,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
|
|
|
8046
8179
|
};
|
|
8047
8180
|
|
|
8048
8181
|
// src/features/subagents/opencode-subagent.ts
|
|
8049
|
-
var
|
|
8182
|
+
var import_node_path71 = require("path");
|
|
8050
8183
|
var import_mini34 = require("zod/mini");
|
|
8051
8184
|
var OpenCodeSubagentFrontmatterSchema = import_mini34.z.looseObject({
|
|
8052
8185
|
description: import_mini34.z.string(),
|
|
@@ -8061,7 +8194,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8061
8194
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
8062
8195
|
if (!result.success) {
|
|
8063
8196
|
throw new Error(
|
|
8064
|
-
`Invalid frontmatter in ${(0,
|
|
8197
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8065
8198
|
);
|
|
8066
8199
|
}
|
|
8067
8200
|
}
|
|
@@ -8075,7 +8208,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8075
8208
|
global = false
|
|
8076
8209
|
} = {}) {
|
|
8077
8210
|
return {
|
|
8078
|
-
relativeDirPath: global ? (0,
|
|
8211
|
+
relativeDirPath: global ? (0, import_node_path71.join)(".config", "opencode", "agent") : (0, import_node_path71.join)(".opencode", "agent")
|
|
8079
8212
|
};
|
|
8080
8213
|
}
|
|
8081
8214
|
getFrontmatter() {
|
|
@@ -8088,7 +8221,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8088
8221
|
const { description, mode, name, ...opencodeSection } = this.frontmatter;
|
|
8089
8222
|
const rulesyncFrontmatter = {
|
|
8090
8223
|
targets: ["opencode"],
|
|
8091
|
-
name: name ?? (0,
|
|
8224
|
+
name: name ?? (0, import_node_path71.basename)(this.getRelativeFilePath(), ".md"),
|
|
8092
8225
|
description,
|
|
8093
8226
|
opencode: { mode, ...opencodeSection }
|
|
8094
8227
|
};
|
|
@@ -8141,7 +8274,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8141
8274
|
return {
|
|
8142
8275
|
success: false,
|
|
8143
8276
|
error: new Error(
|
|
8144
|
-
`Invalid frontmatter in ${(0,
|
|
8277
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8145
8278
|
)
|
|
8146
8279
|
};
|
|
8147
8280
|
}
|
|
@@ -8158,7 +8291,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
|
|
|
8158
8291
|
global = false
|
|
8159
8292
|
}) {
|
|
8160
8293
|
const paths = this.getSettablePaths({ global });
|
|
8161
|
-
const filePath = (0,
|
|
8294
|
+
const filePath = (0, import_node_path71.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
8162
8295
|
const fileContent = await readFileContent(filePath);
|
|
8163
8296
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
8164
8297
|
const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -8319,7 +8452,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8319
8452
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
8320
8453
|
*/
|
|
8321
8454
|
async loadRulesyncFiles() {
|
|
8322
|
-
const subagentsDir = (0,
|
|
8455
|
+
const subagentsDir = (0, import_node_path72.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
8323
8456
|
const dirExists = await directoryExists(subagentsDir);
|
|
8324
8457
|
if (!dirExists) {
|
|
8325
8458
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -8334,7 +8467,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8334
8467
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
8335
8468
|
const rulesyncSubagents = [];
|
|
8336
8469
|
for (const mdFile of mdFiles) {
|
|
8337
|
-
const filepath = (0,
|
|
8470
|
+
const filepath = (0, import_node_path72.join)(subagentsDir, mdFile);
|
|
8338
8471
|
try {
|
|
8339
8472
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
8340
8473
|
relativeFilePath: mdFile,
|
|
@@ -8364,14 +8497,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8364
8497
|
const factory = this.getFactory(this.toolTarget);
|
|
8365
8498
|
const paths = factory.class.getSettablePaths({ global: this.global });
|
|
8366
8499
|
const subagentFilePaths = await findFilesByGlobs(
|
|
8367
|
-
(0,
|
|
8500
|
+
(0, import_node_path72.join)(this.baseDir, paths.relativeDirPath, "*.md")
|
|
8368
8501
|
);
|
|
8369
8502
|
if (forDeletion) {
|
|
8370
8503
|
const toolSubagents2 = subagentFilePaths.map(
|
|
8371
8504
|
(path3) => factory.class.forDeletion({
|
|
8372
8505
|
baseDir: this.baseDir,
|
|
8373
8506
|
relativeDirPath: paths.relativeDirPath,
|
|
8374
|
-
relativeFilePath: (0,
|
|
8507
|
+
relativeFilePath: (0, import_node_path72.basename)(path3),
|
|
8375
8508
|
global: this.global
|
|
8376
8509
|
})
|
|
8377
8510
|
).filter((subagent) => subagent.isDeletable());
|
|
@@ -8382,7 +8515,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8382
8515
|
subagentFilePaths.map(
|
|
8383
8516
|
(path3) => factory.class.fromFile({
|
|
8384
8517
|
baseDir: this.baseDir,
|
|
8385
|
-
relativeFilePath: (0,
|
|
8518
|
+
relativeFilePath: (0, import_node_path72.basename)(path3),
|
|
8386
8519
|
global: this.global
|
|
8387
8520
|
})
|
|
8388
8521
|
)
|
|
@@ -8414,13 +8547,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
8414
8547
|
};
|
|
8415
8548
|
|
|
8416
8549
|
// src/features/rules/agentsmd-rule.ts
|
|
8417
|
-
var
|
|
8550
|
+
var import_node_path75 = require("path");
|
|
8418
8551
|
|
|
8419
8552
|
// src/features/rules/tool-rule.ts
|
|
8420
|
-
var
|
|
8553
|
+
var import_node_path74 = require("path");
|
|
8421
8554
|
|
|
8422
8555
|
// src/features/rules/rulesync-rule.ts
|
|
8423
|
-
var
|
|
8556
|
+
var import_node_path73 = require("path");
|
|
8424
8557
|
var import_mini36 = require("zod/mini");
|
|
8425
8558
|
var RulesyncRuleFrontmatterSchema = import_mini36.z.object({
|
|
8426
8559
|
root: import_mini36.z.optional(import_mini36.z.optional(import_mini36.z.boolean())),
|
|
@@ -8467,7 +8600,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8467
8600
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8468
8601
|
if (!result.success) {
|
|
8469
8602
|
throw new Error(
|
|
8470
|
-
`Invalid frontmatter in ${(0,
|
|
8603
|
+
`Invalid frontmatter in ${(0, import_node_path73.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8471
8604
|
);
|
|
8472
8605
|
}
|
|
8473
8606
|
}
|
|
@@ -8502,7 +8635,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8502
8635
|
return {
|
|
8503
8636
|
success: false,
|
|
8504
8637
|
error: new Error(
|
|
8505
|
-
`Invalid frontmatter in ${(0,
|
|
8638
|
+
`Invalid frontmatter in ${(0, import_node_path73.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
8506
8639
|
)
|
|
8507
8640
|
};
|
|
8508
8641
|
}
|
|
@@ -8511,12 +8644,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8511
8644
|
relativeFilePath,
|
|
8512
8645
|
validate = true
|
|
8513
8646
|
}) {
|
|
8514
|
-
const legacyPath = (0,
|
|
8647
|
+
const legacyPath = (0, import_node_path73.join)(
|
|
8515
8648
|
process.cwd(),
|
|
8516
8649
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
8517
8650
|
relativeFilePath
|
|
8518
8651
|
);
|
|
8519
|
-
const recommendedPath = (0,
|
|
8652
|
+
const recommendedPath = (0, import_node_path73.join)(
|
|
8520
8653
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
8521
8654
|
relativeFilePath
|
|
8522
8655
|
);
|
|
@@ -8537,7 +8670,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8537
8670
|
agentsmd: result.data.agentsmd,
|
|
8538
8671
|
cursor: result.data.cursor
|
|
8539
8672
|
};
|
|
8540
|
-
const filename = (0,
|
|
8673
|
+
const filename = (0, import_node_path73.basename)(legacyPath);
|
|
8541
8674
|
return new _RulesyncRule({
|
|
8542
8675
|
baseDir: process.cwd(),
|
|
8543
8676
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -8551,7 +8684,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8551
8684
|
relativeFilePath,
|
|
8552
8685
|
validate = true
|
|
8553
8686
|
}) {
|
|
8554
|
-
const filePath = (0,
|
|
8687
|
+
const filePath = (0, import_node_path73.join)(
|
|
8555
8688
|
process.cwd(),
|
|
8556
8689
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
8557
8690
|
relativeFilePath
|
|
@@ -8570,7 +8703,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
8570
8703
|
agentsmd: result.data.agentsmd,
|
|
8571
8704
|
cursor: result.data.cursor
|
|
8572
8705
|
};
|
|
8573
|
-
const filename = (0,
|
|
8706
|
+
const filename = (0, import_node_path73.basename)(filePath);
|
|
8574
8707
|
return new _RulesyncRule({
|
|
8575
8708
|
baseDir: process.cwd(),
|
|
8576
8709
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -8653,7 +8786,7 @@ var ToolRule = class extends ToolFile {
|
|
|
8653
8786
|
rulesyncRule,
|
|
8654
8787
|
validate = true,
|
|
8655
8788
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
8656
|
-
nonRootPath = { relativeDirPath: (0,
|
|
8789
|
+
nonRootPath = { relativeDirPath: (0, import_node_path74.join)(".agents", "memories") }
|
|
8657
8790
|
}) {
|
|
8658
8791
|
const params = this.buildToolRuleParamsDefault({
|
|
8659
8792
|
baseDir,
|
|
@@ -8664,7 +8797,7 @@ var ToolRule = class extends ToolFile {
|
|
|
8664
8797
|
});
|
|
8665
8798
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
8666
8799
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
8667
|
-
params.relativeDirPath = (0,
|
|
8800
|
+
params.relativeDirPath = (0, import_node_path74.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
8668
8801
|
params.relativeFilePath = "AGENTS.md";
|
|
8669
8802
|
}
|
|
8670
8803
|
return params;
|
|
@@ -8729,7 +8862,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8729
8862
|
relativeFilePath: "AGENTS.md"
|
|
8730
8863
|
},
|
|
8731
8864
|
nonRoot: {
|
|
8732
|
-
relativeDirPath: (0,
|
|
8865
|
+
relativeDirPath: (0, import_node_path75.join)(".agents", "memories")
|
|
8733
8866
|
}
|
|
8734
8867
|
};
|
|
8735
8868
|
}
|
|
@@ -8739,8 +8872,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8739
8872
|
validate = true
|
|
8740
8873
|
}) {
|
|
8741
8874
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
8742
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
8743
|
-
const fileContent = await readFileContent((0,
|
|
8875
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path75.join)(".agents", "memories", relativeFilePath);
|
|
8876
|
+
const fileContent = await readFileContent((0, import_node_path75.join)(baseDir, relativePath));
|
|
8744
8877
|
return new _AgentsMdRule({
|
|
8745
8878
|
baseDir,
|
|
8746
8879
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -8795,7 +8928,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
8795
8928
|
};
|
|
8796
8929
|
|
|
8797
8930
|
// src/features/rules/antigravity-rule.ts
|
|
8798
|
-
var
|
|
8931
|
+
var import_node_path76 = require("path");
|
|
8799
8932
|
var import_mini37 = require("zod/mini");
|
|
8800
8933
|
var AntigravityRuleFrontmatterSchema = import_mini37.z.looseObject({
|
|
8801
8934
|
trigger: import_mini37.z.optional(
|
|
@@ -8954,7 +9087,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8954
9087
|
const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
|
|
8955
9088
|
if (!result.success) {
|
|
8956
9089
|
throw new Error(
|
|
8957
|
-
`Invalid frontmatter in ${(0,
|
|
9090
|
+
`Invalid frontmatter in ${(0, import_node_path76.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
8958
9091
|
);
|
|
8959
9092
|
}
|
|
8960
9093
|
}
|
|
@@ -8969,7 +9102,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8969
9102
|
static getSettablePaths() {
|
|
8970
9103
|
return {
|
|
8971
9104
|
nonRoot: {
|
|
8972
|
-
relativeDirPath: (0,
|
|
9105
|
+
relativeDirPath: (0, import_node_path76.join)(".agent", "rules")
|
|
8973
9106
|
}
|
|
8974
9107
|
};
|
|
8975
9108
|
}
|
|
@@ -8978,7 +9111,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
8978
9111
|
relativeFilePath,
|
|
8979
9112
|
validate = true
|
|
8980
9113
|
}) {
|
|
8981
|
-
const filePath = (0,
|
|
9114
|
+
const filePath = (0, import_node_path76.join)(
|
|
8982
9115
|
baseDir,
|
|
8983
9116
|
this.getSettablePaths().nonRoot.relativeDirPath,
|
|
8984
9117
|
relativeFilePath
|
|
@@ -9119,7 +9252,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
|
9119
9252
|
};
|
|
9120
9253
|
|
|
9121
9254
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
9122
|
-
var
|
|
9255
|
+
var import_node_path77 = require("path");
|
|
9123
9256
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
9124
9257
|
toRulesyncRule() {
|
|
9125
9258
|
const rulesyncFrontmatter = {
|
|
@@ -9145,7 +9278,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9145
9278
|
relativeFilePath: ".augment-guidelines"
|
|
9146
9279
|
},
|
|
9147
9280
|
nonRoot: {
|
|
9148
|
-
relativeDirPath: (0,
|
|
9281
|
+
relativeDirPath: (0, import_node_path77.join)(".augment", "rules")
|
|
9149
9282
|
}
|
|
9150
9283
|
};
|
|
9151
9284
|
}
|
|
@@ -9180,8 +9313,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9180
9313
|
}) {
|
|
9181
9314
|
const settablePaths = this.getSettablePaths();
|
|
9182
9315
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
9183
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
9184
|
-
const fileContent = await readFileContent((0,
|
|
9316
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path77.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9317
|
+
const fileContent = await readFileContent((0, import_node_path77.join)(baseDir, relativePath));
|
|
9185
9318
|
return new _AugmentcodeLegacyRule({
|
|
9186
9319
|
baseDir,
|
|
9187
9320
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -9210,7 +9343,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
9210
9343
|
};
|
|
9211
9344
|
|
|
9212
9345
|
// src/features/rules/augmentcode-rule.ts
|
|
9213
|
-
var
|
|
9346
|
+
var import_node_path78 = require("path");
|
|
9214
9347
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
9215
9348
|
toRulesyncRule() {
|
|
9216
9349
|
return this.toRulesyncRuleDefault();
|
|
@@ -9218,7 +9351,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9218
9351
|
static getSettablePaths() {
|
|
9219
9352
|
return {
|
|
9220
9353
|
nonRoot: {
|
|
9221
|
-
relativeDirPath: (0,
|
|
9354
|
+
relativeDirPath: (0, import_node_path78.join)(".augment", "rules")
|
|
9222
9355
|
}
|
|
9223
9356
|
};
|
|
9224
9357
|
}
|
|
@@ -9242,7 +9375,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9242
9375
|
validate = true
|
|
9243
9376
|
}) {
|
|
9244
9377
|
const fileContent = await readFileContent(
|
|
9245
|
-
(0,
|
|
9378
|
+
(0, import_node_path78.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9246
9379
|
);
|
|
9247
9380
|
const { body: content } = parseFrontmatter(fileContent);
|
|
9248
9381
|
return new _AugmentcodeRule({
|
|
@@ -9278,7 +9411,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
9278
9411
|
};
|
|
9279
9412
|
|
|
9280
9413
|
// src/features/rules/claudecode-legacy-rule.ts
|
|
9281
|
-
var
|
|
9414
|
+
var import_node_path79 = require("path");
|
|
9282
9415
|
var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
9283
9416
|
static getSettablePaths({
|
|
9284
9417
|
global
|
|
@@ -9297,7 +9430,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9297
9430
|
relativeFilePath: "CLAUDE.md"
|
|
9298
9431
|
},
|
|
9299
9432
|
nonRoot: {
|
|
9300
|
-
relativeDirPath: (0,
|
|
9433
|
+
relativeDirPath: (0, import_node_path79.join)(".claude", "memories")
|
|
9301
9434
|
}
|
|
9302
9435
|
};
|
|
9303
9436
|
}
|
|
@@ -9312,7 +9445,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9312
9445
|
if (isRoot) {
|
|
9313
9446
|
const relativePath2 = paths.root.relativeFilePath;
|
|
9314
9447
|
const fileContent2 = await readFileContent(
|
|
9315
|
-
(0,
|
|
9448
|
+
(0, import_node_path79.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
9316
9449
|
);
|
|
9317
9450
|
return new _ClaudecodeLegacyRule({
|
|
9318
9451
|
baseDir,
|
|
@@ -9326,8 +9459,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9326
9459
|
if (!paths.nonRoot) {
|
|
9327
9460
|
throw new Error("nonRoot path is not set");
|
|
9328
9461
|
}
|
|
9329
|
-
const relativePath = (0,
|
|
9330
|
-
const fileContent = await readFileContent((0,
|
|
9462
|
+
const relativePath = (0, import_node_path79.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9463
|
+
const fileContent = await readFileContent((0, import_node_path79.join)(baseDir, relativePath));
|
|
9331
9464
|
return new _ClaudecodeLegacyRule({
|
|
9332
9465
|
baseDir,
|
|
9333
9466
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -9386,7 +9519,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
|
|
|
9386
9519
|
};
|
|
9387
9520
|
|
|
9388
9521
|
// src/features/rules/claudecode-rule.ts
|
|
9389
|
-
var
|
|
9522
|
+
var import_node_path80 = require("path");
|
|
9390
9523
|
var import_mini38 = require("zod/mini");
|
|
9391
9524
|
var ClaudecodeRuleFrontmatterSchema = import_mini38.z.object({
|
|
9392
9525
|
paths: import_mini38.z.optional(import_mini38.z.string())
|
|
@@ -9411,7 +9544,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9411
9544
|
relativeFilePath: "CLAUDE.md"
|
|
9412
9545
|
},
|
|
9413
9546
|
nonRoot: {
|
|
9414
|
-
relativeDirPath: (0,
|
|
9547
|
+
relativeDirPath: (0, import_node_path80.join)(".claude", "rules")
|
|
9415
9548
|
}
|
|
9416
9549
|
};
|
|
9417
9550
|
}
|
|
@@ -9420,7 +9553,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9420
9553
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9421
9554
|
if (!result.success) {
|
|
9422
9555
|
throw new Error(
|
|
9423
|
-
`Invalid frontmatter in ${(0,
|
|
9556
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9424
9557
|
);
|
|
9425
9558
|
}
|
|
9426
9559
|
}
|
|
@@ -9448,7 +9581,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9448
9581
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
9449
9582
|
if (isRoot) {
|
|
9450
9583
|
const fileContent2 = await readFileContent(
|
|
9451
|
-
(0,
|
|
9584
|
+
(0, import_node_path80.join)(baseDir, paths.root.relativeDirPath, paths.root.relativeFilePath)
|
|
9452
9585
|
);
|
|
9453
9586
|
return new _ClaudecodeRule({
|
|
9454
9587
|
baseDir,
|
|
@@ -9463,13 +9596,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9463
9596
|
if (!paths.nonRoot) {
|
|
9464
9597
|
throw new Error("nonRoot path is not set");
|
|
9465
9598
|
}
|
|
9466
|
-
const relativePath = (0,
|
|
9467
|
-
const fileContent = await readFileContent((0,
|
|
9599
|
+
const relativePath = (0, import_node_path80.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9600
|
+
const fileContent = await readFileContent((0, import_node_path80.join)(baseDir, relativePath));
|
|
9468
9601
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
9469
9602
|
const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9470
9603
|
if (!result.success) {
|
|
9471
9604
|
throw new Error(
|
|
9472
|
-
`Invalid frontmatter in ${(0,
|
|
9605
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(baseDir, relativePath)}: ${formatError(result.error)}`
|
|
9473
9606
|
);
|
|
9474
9607
|
}
|
|
9475
9608
|
return new _ClaudecodeRule({
|
|
@@ -9576,7 +9709,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9576
9709
|
return {
|
|
9577
9710
|
success: false,
|
|
9578
9711
|
error: new Error(
|
|
9579
|
-
`Invalid frontmatter in ${(0,
|
|
9712
|
+
`Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9580
9713
|
)
|
|
9581
9714
|
};
|
|
9582
9715
|
}
|
|
@@ -9596,7 +9729,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
9596
9729
|
};
|
|
9597
9730
|
|
|
9598
9731
|
// src/features/rules/cline-rule.ts
|
|
9599
|
-
var
|
|
9732
|
+
var import_node_path81 = require("path");
|
|
9600
9733
|
var import_mini39 = require("zod/mini");
|
|
9601
9734
|
var ClineRuleFrontmatterSchema = import_mini39.z.object({
|
|
9602
9735
|
description: import_mini39.z.string()
|
|
@@ -9641,7 +9774,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
9641
9774
|
validate = true
|
|
9642
9775
|
}) {
|
|
9643
9776
|
const fileContent = await readFileContent(
|
|
9644
|
-
(0,
|
|
9777
|
+
(0, import_node_path81.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
9645
9778
|
);
|
|
9646
9779
|
return new _ClineRule({
|
|
9647
9780
|
baseDir,
|
|
@@ -9667,7 +9800,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
9667
9800
|
};
|
|
9668
9801
|
|
|
9669
9802
|
// src/features/rules/codexcli-rule.ts
|
|
9670
|
-
var
|
|
9803
|
+
var import_node_path82 = require("path");
|
|
9671
9804
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
9672
9805
|
static getSettablePaths({
|
|
9673
9806
|
global
|
|
@@ -9686,7 +9819,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9686
9819
|
relativeFilePath: "AGENTS.md"
|
|
9687
9820
|
},
|
|
9688
9821
|
nonRoot: {
|
|
9689
|
-
relativeDirPath: (0,
|
|
9822
|
+
relativeDirPath: (0, import_node_path82.join)(".codex", "memories")
|
|
9690
9823
|
}
|
|
9691
9824
|
};
|
|
9692
9825
|
}
|
|
@@ -9701,7 +9834,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9701
9834
|
if (isRoot) {
|
|
9702
9835
|
const relativePath2 = paths.root.relativeFilePath;
|
|
9703
9836
|
const fileContent2 = await readFileContent(
|
|
9704
|
-
(0,
|
|
9837
|
+
(0, import_node_path82.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
9705
9838
|
);
|
|
9706
9839
|
return new _CodexcliRule({
|
|
9707
9840
|
baseDir,
|
|
@@ -9715,8 +9848,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9715
9848
|
if (!paths.nonRoot) {
|
|
9716
9849
|
throw new Error("nonRoot path is not set");
|
|
9717
9850
|
}
|
|
9718
|
-
const relativePath = (0,
|
|
9719
|
-
const fileContent = await readFileContent((0,
|
|
9851
|
+
const relativePath = (0, import_node_path82.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
9852
|
+
const fileContent = await readFileContent((0, import_node_path82.join)(baseDir, relativePath));
|
|
9720
9853
|
return new _CodexcliRule({
|
|
9721
9854
|
baseDir,
|
|
9722
9855
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -9775,7 +9908,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
9775
9908
|
};
|
|
9776
9909
|
|
|
9777
9910
|
// src/features/rules/copilot-rule.ts
|
|
9778
|
-
var
|
|
9911
|
+
var import_node_path83 = require("path");
|
|
9779
9912
|
var import_mini40 = require("zod/mini");
|
|
9780
9913
|
var CopilotRuleFrontmatterSchema = import_mini40.z.object({
|
|
9781
9914
|
description: import_mini40.z.optional(import_mini40.z.string()),
|
|
@@ -9792,7 +9925,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9792
9925
|
relativeFilePath: "copilot-instructions.md"
|
|
9793
9926
|
},
|
|
9794
9927
|
nonRoot: {
|
|
9795
|
-
relativeDirPath: (0,
|
|
9928
|
+
relativeDirPath: (0, import_node_path83.join)(".github", "instructions")
|
|
9796
9929
|
}
|
|
9797
9930
|
};
|
|
9798
9931
|
}
|
|
@@ -9801,7 +9934,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9801
9934
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9802
9935
|
if (!result.success) {
|
|
9803
9936
|
throw new Error(
|
|
9804
|
-
`Invalid frontmatter in ${(0,
|
|
9937
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9805
9938
|
);
|
|
9806
9939
|
}
|
|
9807
9940
|
}
|
|
@@ -9883,11 +10016,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9883
10016
|
validate = true
|
|
9884
10017
|
}) {
|
|
9885
10018
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
9886
|
-
const relativePath = isRoot ? (0,
|
|
10019
|
+
const relativePath = isRoot ? (0, import_node_path83.join)(
|
|
9887
10020
|
this.getSettablePaths().root.relativeDirPath,
|
|
9888
10021
|
this.getSettablePaths().root.relativeFilePath
|
|
9889
|
-
) : (0,
|
|
9890
|
-
const fileContent = await readFileContent((0,
|
|
10022
|
+
) : (0, import_node_path83.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
10023
|
+
const fileContent = await readFileContent((0, import_node_path83.join)(baseDir, relativePath));
|
|
9891
10024
|
if (isRoot) {
|
|
9892
10025
|
return new _CopilotRule({
|
|
9893
10026
|
baseDir,
|
|
@@ -9903,7 +10036,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9903
10036
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9904
10037
|
if (!result.success) {
|
|
9905
10038
|
throw new Error(
|
|
9906
|
-
`Invalid frontmatter in ${(0,
|
|
10039
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
9907
10040
|
);
|
|
9908
10041
|
}
|
|
9909
10042
|
return new _CopilotRule({
|
|
@@ -9943,7 +10076,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9943
10076
|
return {
|
|
9944
10077
|
success: false,
|
|
9945
10078
|
error: new Error(
|
|
9946
|
-
`Invalid frontmatter in ${(0,
|
|
10079
|
+
`Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
9947
10080
|
)
|
|
9948
10081
|
};
|
|
9949
10082
|
}
|
|
@@ -9963,7 +10096,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
9963
10096
|
};
|
|
9964
10097
|
|
|
9965
10098
|
// src/features/rules/cursor-rule.ts
|
|
9966
|
-
var
|
|
10099
|
+
var import_node_path84 = require("path");
|
|
9967
10100
|
var import_mini41 = require("zod/mini");
|
|
9968
10101
|
var CursorRuleFrontmatterSchema = import_mini41.z.object({
|
|
9969
10102
|
description: import_mini41.z.optional(import_mini41.z.string()),
|
|
@@ -9976,7 +10109,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9976
10109
|
static getSettablePaths() {
|
|
9977
10110
|
return {
|
|
9978
10111
|
nonRoot: {
|
|
9979
|
-
relativeDirPath: (0,
|
|
10112
|
+
relativeDirPath: (0, import_node_path84.join)(".cursor", "rules")
|
|
9980
10113
|
}
|
|
9981
10114
|
};
|
|
9982
10115
|
}
|
|
@@ -9985,7 +10118,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
9985
10118
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
9986
10119
|
if (!result.success) {
|
|
9987
10120
|
throw new Error(
|
|
9988
|
-
`Invalid frontmatter in ${(0,
|
|
10121
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
9989
10122
|
);
|
|
9990
10123
|
}
|
|
9991
10124
|
}
|
|
@@ -10102,19 +10235,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10102
10235
|
validate = true
|
|
10103
10236
|
}) {
|
|
10104
10237
|
const fileContent = await readFileContent(
|
|
10105
|
-
(0,
|
|
10238
|
+
(0, import_node_path84.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10106
10239
|
);
|
|
10107
10240
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
10108
10241
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
10109
10242
|
if (!result.success) {
|
|
10110
10243
|
throw new Error(
|
|
10111
|
-
`Invalid frontmatter in ${(0,
|
|
10244
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
10112
10245
|
);
|
|
10113
10246
|
}
|
|
10114
10247
|
return new _CursorRule({
|
|
10115
10248
|
baseDir,
|
|
10116
10249
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
10117
|
-
relativeFilePath: (0,
|
|
10250
|
+
relativeFilePath: (0, import_node_path84.basename)(relativeFilePath),
|
|
10118
10251
|
frontmatter: result.data,
|
|
10119
10252
|
body: content.trim(),
|
|
10120
10253
|
validate
|
|
@@ -10145,7 +10278,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10145
10278
|
return {
|
|
10146
10279
|
success: false,
|
|
10147
10280
|
error: new Error(
|
|
10148
|
-
`Invalid frontmatter in ${(0,
|
|
10281
|
+
`Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
10149
10282
|
)
|
|
10150
10283
|
};
|
|
10151
10284
|
}
|
|
@@ -10165,7 +10298,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
10165
10298
|
};
|
|
10166
10299
|
|
|
10167
10300
|
// src/features/rules/geminicli-rule.ts
|
|
10168
|
-
var
|
|
10301
|
+
var import_node_path85 = require("path");
|
|
10169
10302
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
10170
10303
|
static getSettablePaths({
|
|
10171
10304
|
global
|
|
@@ -10184,7 +10317,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10184
10317
|
relativeFilePath: "GEMINI.md"
|
|
10185
10318
|
},
|
|
10186
10319
|
nonRoot: {
|
|
10187
|
-
relativeDirPath: (0,
|
|
10320
|
+
relativeDirPath: (0, import_node_path85.join)(".gemini", "memories")
|
|
10188
10321
|
}
|
|
10189
10322
|
};
|
|
10190
10323
|
}
|
|
@@ -10199,7 +10332,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10199
10332
|
if (isRoot) {
|
|
10200
10333
|
const relativePath2 = paths.root.relativeFilePath;
|
|
10201
10334
|
const fileContent2 = await readFileContent(
|
|
10202
|
-
(0,
|
|
10335
|
+
(0, import_node_path85.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
10203
10336
|
);
|
|
10204
10337
|
return new _GeminiCliRule({
|
|
10205
10338
|
baseDir,
|
|
@@ -10213,8 +10346,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10213
10346
|
if (!paths.nonRoot) {
|
|
10214
10347
|
throw new Error("nonRoot path is not set");
|
|
10215
10348
|
}
|
|
10216
|
-
const relativePath = (0,
|
|
10217
|
-
const fileContent = await readFileContent((0,
|
|
10349
|
+
const relativePath = (0, import_node_path85.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
10350
|
+
const fileContent = await readFileContent((0, import_node_path85.join)(baseDir, relativePath));
|
|
10218
10351
|
return new _GeminiCliRule({
|
|
10219
10352
|
baseDir,
|
|
10220
10353
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -10273,7 +10406,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
10273
10406
|
};
|
|
10274
10407
|
|
|
10275
10408
|
// src/features/rules/junie-rule.ts
|
|
10276
|
-
var
|
|
10409
|
+
var import_node_path86 = require("path");
|
|
10277
10410
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
10278
10411
|
static getSettablePaths() {
|
|
10279
10412
|
return {
|
|
@@ -10282,7 +10415,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10282
10415
|
relativeFilePath: "guidelines.md"
|
|
10283
10416
|
},
|
|
10284
10417
|
nonRoot: {
|
|
10285
|
-
relativeDirPath: (0,
|
|
10418
|
+
relativeDirPath: (0, import_node_path86.join)(".junie", "memories")
|
|
10286
10419
|
}
|
|
10287
10420
|
};
|
|
10288
10421
|
}
|
|
@@ -10292,8 +10425,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10292
10425
|
validate = true
|
|
10293
10426
|
}) {
|
|
10294
10427
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
10295
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
10296
|
-
const fileContent = await readFileContent((0,
|
|
10428
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path86.join)(".junie", "memories", relativeFilePath);
|
|
10429
|
+
const fileContent = await readFileContent((0, import_node_path86.join)(baseDir, relativePath));
|
|
10297
10430
|
return new _JunieRule({
|
|
10298
10431
|
baseDir,
|
|
10299
10432
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10348,12 +10481,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
10348
10481
|
};
|
|
10349
10482
|
|
|
10350
10483
|
// src/features/rules/kilo-rule.ts
|
|
10351
|
-
var
|
|
10484
|
+
var import_node_path87 = require("path");
|
|
10352
10485
|
var KiloRule = class _KiloRule extends ToolRule {
|
|
10353
10486
|
static getSettablePaths(_options = {}) {
|
|
10354
10487
|
return {
|
|
10355
10488
|
nonRoot: {
|
|
10356
|
-
relativeDirPath: (0,
|
|
10489
|
+
relativeDirPath: (0, import_node_path87.join)(".kilocode", "rules")
|
|
10357
10490
|
}
|
|
10358
10491
|
};
|
|
10359
10492
|
}
|
|
@@ -10363,7 +10496,7 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
10363
10496
|
validate = true
|
|
10364
10497
|
}) {
|
|
10365
10498
|
const fileContent = await readFileContent(
|
|
10366
|
-
(0,
|
|
10499
|
+
(0, import_node_path87.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10367
10500
|
);
|
|
10368
10501
|
return new _KiloRule({
|
|
10369
10502
|
baseDir,
|
|
@@ -10415,12 +10548,12 @@ var KiloRule = class _KiloRule extends ToolRule {
|
|
|
10415
10548
|
};
|
|
10416
10549
|
|
|
10417
10550
|
// src/features/rules/kiro-rule.ts
|
|
10418
|
-
var
|
|
10551
|
+
var import_node_path88 = require("path");
|
|
10419
10552
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
10420
10553
|
static getSettablePaths() {
|
|
10421
10554
|
return {
|
|
10422
10555
|
nonRoot: {
|
|
10423
|
-
relativeDirPath: (0,
|
|
10556
|
+
relativeDirPath: (0, import_node_path88.join)(".kiro", "steering")
|
|
10424
10557
|
}
|
|
10425
10558
|
};
|
|
10426
10559
|
}
|
|
@@ -10430,7 +10563,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
10430
10563
|
validate = true
|
|
10431
10564
|
}) {
|
|
10432
10565
|
const fileContent = await readFileContent(
|
|
10433
|
-
(0,
|
|
10566
|
+
(0, import_node_path88.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10434
10567
|
);
|
|
10435
10568
|
return new _KiroRule({
|
|
10436
10569
|
baseDir,
|
|
@@ -10484,7 +10617,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
10484
10617
|
};
|
|
10485
10618
|
|
|
10486
10619
|
// src/features/rules/opencode-rule.ts
|
|
10487
|
-
var
|
|
10620
|
+
var import_node_path89 = require("path");
|
|
10488
10621
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
10489
10622
|
static getSettablePaths() {
|
|
10490
10623
|
return {
|
|
@@ -10493,7 +10626,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10493
10626
|
relativeFilePath: "AGENTS.md"
|
|
10494
10627
|
},
|
|
10495
10628
|
nonRoot: {
|
|
10496
|
-
relativeDirPath: (0,
|
|
10629
|
+
relativeDirPath: (0, import_node_path89.join)(".opencode", "memories")
|
|
10497
10630
|
}
|
|
10498
10631
|
};
|
|
10499
10632
|
}
|
|
@@ -10503,8 +10636,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10503
10636
|
validate = true
|
|
10504
10637
|
}) {
|
|
10505
10638
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
10506
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
10507
|
-
const fileContent = await readFileContent((0,
|
|
10639
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path89.join)(".opencode", "memories", relativeFilePath);
|
|
10640
|
+
const fileContent = await readFileContent((0, import_node_path89.join)(baseDir, relativePath));
|
|
10508
10641
|
return new _OpenCodeRule({
|
|
10509
10642
|
baseDir,
|
|
10510
10643
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10559,7 +10692,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
10559
10692
|
};
|
|
10560
10693
|
|
|
10561
10694
|
// src/features/rules/qwencode-rule.ts
|
|
10562
|
-
var
|
|
10695
|
+
var import_node_path90 = require("path");
|
|
10563
10696
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
10564
10697
|
static getSettablePaths() {
|
|
10565
10698
|
return {
|
|
@@ -10568,7 +10701,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10568
10701
|
relativeFilePath: "QWEN.md"
|
|
10569
10702
|
},
|
|
10570
10703
|
nonRoot: {
|
|
10571
|
-
relativeDirPath: (0,
|
|
10704
|
+
relativeDirPath: (0, import_node_path90.join)(".qwen", "memories")
|
|
10572
10705
|
}
|
|
10573
10706
|
};
|
|
10574
10707
|
}
|
|
@@ -10578,8 +10711,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10578
10711
|
validate = true
|
|
10579
10712
|
}) {
|
|
10580
10713
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
10581
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
10582
|
-
const fileContent = await readFileContent((0,
|
|
10714
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path90.join)(".qwen", "memories", relativeFilePath);
|
|
10715
|
+
const fileContent = await readFileContent((0, import_node_path90.join)(baseDir, relativePath));
|
|
10583
10716
|
return new _QwencodeRule({
|
|
10584
10717
|
baseDir,
|
|
10585
10718
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -10630,13 +10763,101 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
10630
10763
|
}
|
|
10631
10764
|
};
|
|
10632
10765
|
|
|
10766
|
+
// src/features/rules/replit-rule.ts
|
|
10767
|
+
var import_node_path91 = require("path");
|
|
10768
|
+
var ReplitRule = class _ReplitRule extends ToolRule {
|
|
10769
|
+
static getSettablePaths() {
|
|
10770
|
+
return {
|
|
10771
|
+
root: {
|
|
10772
|
+
relativeDirPath: ".",
|
|
10773
|
+
relativeFilePath: "replit.md"
|
|
10774
|
+
}
|
|
10775
|
+
};
|
|
10776
|
+
}
|
|
10777
|
+
static async fromFile({
|
|
10778
|
+
baseDir = process.cwd(),
|
|
10779
|
+
relativeFilePath,
|
|
10780
|
+
validate = true
|
|
10781
|
+
}) {
|
|
10782
|
+
const paths = this.getSettablePaths();
|
|
10783
|
+
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
10784
|
+
if (!isRoot) {
|
|
10785
|
+
throw new Error("ReplitRule only supports root rules");
|
|
10786
|
+
}
|
|
10787
|
+
const relativePath = paths.root.relativeFilePath;
|
|
10788
|
+
const fileContent = await readFileContent(
|
|
10789
|
+
(0, import_node_path91.join)(baseDir, paths.root.relativeDirPath, relativePath)
|
|
10790
|
+
);
|
|
10791
|
+
return new _ReplitRule({
|
|
10792
|
+
baseDir,
|
|
10793
|
+
relativeDirPath: paths.root.relativeDirPath,
|
|
10794
|
+
relativeFilePath: paths.root.relativeFilePath,
|
|
10795
|
+
fileContent,
|
|
10796
|
+
validate,
|
|
10797
|
+
root: true
|
|
10798
|
+
});
|
|
10799
|
+
}
|
|
10800
|
+
static fromRulesyncRule({
|
|
10801
|
+
baseDir = process.cwd(),
|
|
10802
|
+
rulesyncRule,
|
|
10803
|
+
validate = true
|
|
10804
|
+
}) {
|
|
10805
|
+
const paths = this.getSettablePaths();
|
|
10806
|
+
const isRoot = rulesyncRule.getFrontmatter().root ?? false;
|
|
10807
|
+
if (!isRoot) {
|
|
10808
|
+
throw new Error("ReplitRule only supports root rules");
|
|
10809
|
+
}
|
|
10810
|
+
return new _ReplitRule(
|
|
10811
|
+
this.buildToolRuleParamsDefault({
|
|
10812
|
+
baseDir,
|
|
10813
|
+
rulesyncRule,
|
|
10814
|
+
validate,
|
|
10815
|
+
rootPath: paths.root,
|
|
10816
|
+
nonRootPath: void 0
|
|
10817
|
+
})
|
|
10818
|
+
);
|
|
10819
|
+
}
|
|
10820
|
+
toRulesyncRule() {
|
|
10821
|
+
return this.toRulesyncRuleDefault();
|
|
10822
|
+
}
|
|
10823
|
+
validate() {
|
|
10824
|
+
return { success: true, error: null };
|
|
10825
|
+
}
|
|
10826
|
+
static forDeletion({
|
|
10827
|
+
baseDir = process.cwd(),
|
|
10828
|
+
relativeDirPath,
|
|
10829
|
+
relativeFilePath
|
|
10830
|
+
}) {
|
|
10831
|
+
const paths = this.getSettablePaths();
|
|
10832
|
+
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
10833
|
+
return new _ReplitRule({
|
|
10834
|
+
baseDir,
|
|
10835
|
+
relativeDirPath,
|
|
10836
|
+
relativeFilePath,
|
|
10837
|
+
fileContent: "",
|
|
10838
|
+
validate: false,
|
|
10839
|
+
root: isRoot
|
|
10840
|
+
});
|
|
10841
|
+
}
|
|
10842
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
10843
|
+
const isRoot = rulesyncRule.getFrontmatter().root ?? false;
|
|
10844
|
+
if (!isRoot) {
|
|
10845
|
+
return false;
|
|
10846
|
+
}
|
|
10847
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
10848
|
+
rulesyncRule,
|
|
10849
|
+
toolTarget: "replit"
|
|
10850
|
+
});
|
|
10851
|
+
}
|
|
10852
|
+
};
|
|
10853
|
+
|
|
10633
10854
|
// src/features/rules/roo-rule.ts
|
|
10634
|
-
var
|
|
10855
|
+
var import_node_path92 = require("path");
|
|
10635
10856
|
var RooRule = class _RooRule extends ToolRule {
|
|
10636
10857
|
static getSettablePaths() {
|
|
10637
10858
|
return {
|
|
10638
10859
|
nonRoot: {
|
|
10639
|
-
relativeDirPath: (0,
|
|
10860
|
+
relativeDirPath: (0, import_node_path92.join)(".roo", "rules")
|
|
10640
10861
|
}
|
|
10641
10862
|
};
|
|
10642
10863
|
}
|
|
@@ -10646,7 +10867,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
10646
10867
|
validate = true
|
|
10647
10868
|
}) {
|
|
10648
10869
|
const fileContent = await readFileContent(
|
|
10649
|
-
(0,
|
|
10870
|
+
(0, import_node_path92.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10650
10871
|
);
|
|
10651
10872
|
return new _RooRule({
|
|
10652
10873
|
baseDir,
|
|
@@ -10715,7 +10936,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
10715
10936
|
};
|
|
10716
10937
|
|
|
10717
10938
|
// src/features/rules/warp-rule.ts
|
|
10718
|
-
var
|
|
10939
|
+
var import_node_path93 = require("path");
|
|
10719
10940
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
10720
10941
|
constructor({ fileContent, root, ...rest }) {
|
|
10721
10942
|
super({
|
|
@@ -10731,7 +10952,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10731
10952
|
relativeFilePath: "WARP.md"
|
|
10732
10953
|
},
|
|
10733
10954
|
nonRoot: {
|
|
10734
|
-
relativeDirPath: (0,
|
|
10955
|
+
relativeDirPath: (0, import_node_path93.join)(".warp", "memories")
|
|
10735
10956
|
}
|
|
10736
10957
|
};
|
|
10737
10958
|
}
|
|
@@ -10741,8 +10962,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10741
10962
|
validate = true
|
|
10742
10963
|
}) {
|
|
10743
10964
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
10744
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
10745
|
-
const fileContent = await readFileContent((0,
|
|
10965
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path93.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
10966
|
+
const fileContent = await readFileContent((0, import_node_path93.join)(baseDir, relativePath));
|
|
10746
10967
|
return new _WarpRule({
|
|
10747
10968
|
baseDir,
|
|
10748
10969
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -10797,12 +11018,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
10797
11018
|
};
|
|
10798
11019
|
|
|
10799
11020
|
// src/features/rules/windsurf-rule.ts
|
|
10800
|
-
var
|
|
11021
|
+
var import_node_path94 = require("path");
|
|
10801
11022
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
10802
11023
|
static getSettablePaths() {
|
|
10803
11024
|
return {
|
|
10804
11025
|
nonRoot: {
|
|
10805
|
-
relativeDirPath: (0,
|
|
11026
|
+
relativeDirPath: (0, import_node_path94.join)(".windsurf", "rules")
|
|
10806
11027
|
}
|
|
10807
11028
|
};
|
|
10808
11029
|
}
|
|
@@ -10812,7 +11033,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
10812
11033
|
validate = true
|
|
10813
11034
|
}) {
|
|
10814
11035
|
const fileContent = await readFileContent(
|
|
10815
|
-
(0,
|
|
11036
|
+
(0, import_node_path94.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
10816
11037
|
);
|
|
10817
11038
|
return new _WindsurfRule({
|
|
10818
11039
|
baseDir,
|
|
@@ -10881,6 +11102,7 @@ var rulesProcessorToolTargets = [
|
|
|
10881
11102
|
"kiro",
|
|
10882
11103
|
"opencode",
|
|
10883
11104
|
"qwencode",
|
|
11105
|
+
"replit",
|
|
10884
11106
|
"roo",
|
|
10885
11107
|
"warp",
|
|
10886
11108
|
"windsurf"
|
|
@@ -11035,6 +11257,13 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
|
|
|
11035
11257
|
meta: { extension: "md", supportsGlobal: false, ruleDiscoveryMode: "toon" }
|
|
11036
11258
|
}
|
|
11037
11259
|
],
|
|
11260
|
+
[
|
|
11261
|
+
"replit",
|
|
11262
|
+
{
|
|
11263
|
+
class: ReplitRule,
|
|
11264
|
+
meta: { extension: "md", supportsGlobal: false, ruleDiscoveryMode: "auto" }
|
|
11265
|
+
}
|
|
11266
|
+
],
|
|
11038
11267
|
[
|
|
11039
11268
|
"roo",
|
|
11040
11269
|
{
|
|
@@ -11169,7 +11398,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11169
11398
|
}).relativeDirPath;
|
|
11170
11399
|
return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
|
|
11171
11400
|
const frontmatter = skill.getFrontmatter();
|
|
11172
|
-
const relativePath = (0,
|
|
11401
|
+
const relativePath = (0, import_node_path95.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
|
|
11173
11402
|
return {
|
|
11174
11403
|
name: frontmatter.name,
|
|
11175
11404
|
description: frontmatter.description,
|
|
@@ -11236,10 +11465,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11236
11465
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
11237
11466
|
*/
|
|
11238
11467
|
async loadRulesyncFiles() {
|
|
11239
|
-
const files = await findFilesByGlobs((0,
|
|
11468
|
+
const files = await findFilesByGlobs((0, import_node_path95.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
11240
11469
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
11241
11470
|
const rulesyncRules = await Promise.all(
|
|
11242
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
11471
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path95.basename)(file) }))
|
|
11243
11472
|
);
|
|
11244
11473
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
11245
11474
|
if (rootRules.length > 1) {
|
|
@@ -11257,10 +11486,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11257
11486
|
return rulesyncRules;
|
|
11258
11487
|
}
|
|
11259
11488
|
async loadRulesyncFilesLegacy() {
|
|
11260
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
11489
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path95.join)(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
11261
11490
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
11262
11491
|
return Promise.all(
|
|
11263
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
11492
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path95.basename)(file) }))
|
|
11264
11493
|
);
|
|
11265
11494
|
}
|
|
11266
11495
|
/**
|
|
@@ -11278,7 +11507,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11278
11507
|
return [];
|
|
11279
11508
|
}
|
|
11280
11509
|
const rootFilePaths = await findFilesByGlobs(
|
|
11281
|
-
(0,
|
|
11510
|
+
(0, import_node_path95.join)(
|
|
11282
11511
|
this.baseDir,
|
|
11283
11512
|
settablePaths.root.relativeDirPath ?? ".",
|
|
11284
11513
|
settablePaths.root.relativeFilePath
|
|
@@ -11289,7 +11518,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11289
11518
|
(filePath) => factory.class.forDeletion({
|
|
11290
11519
|
baseDir: this.baseDir,
|
|
11291
11520
|
relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
|
|
11292
|
-
relativeFilePath: (0,
|
|
11521
|
+
relativeFilePath: (0, import_node_path95.basename)(filePath),
|
|
11293
11522
|
global: this.global
|
|
11294
11523
|
})
|
|
11295
11524
|
).filter((rule) => rule.isDeletable());
|
|
@@ -11298,7 +11527,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11298
11527
|
rootFilePaths.map(
|
|
11299
11528
|
(filePath) => factory.class.fromFile({
|
|
11300
11529
|
baseDir: this.baseDir,
|
|
11301
|
-
relativeFilePath: (0,
|
|
11530
|
+
relativeFilePath: (0, import_node_path95.basename)(filePath),
|
|
11302
11531
|
global: this.global
|
|
11303
11532
|
})
|
|
11304
11533
|
)
|
|
@@ -11310,14 +11539,14 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11310
11539
|
return [];
|
|
11311
11540
|
}
|
|
11312
11541
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
11313
|
-
(0,
|
|
11542
|
+
(0, import_node_path95.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath, `*.${factory.meta.extension}`)
|
|
11314
11543
|
);
|
|
11315
11544
|
if (forDeletion) {
|
|
11316
11545
|
return nonRootFilePaths.map(
|
|
11317
11546
|
(filePath) => factory.class.forDeletion({
|
|
11318
11547
|
baseDir: this.baseDir,
|
|
11319
11548
|
relativeDirPath: settablePaths.nonRoot?.relativeDirPath ?? ".",
|
|
11320
|
-
relativeFilePath: (0,
|
|
11549
|
+
relativeFilePath: (0, import_node_path95.basename)(filePath),
|
|
11321
11550
|
global: this.global
|
|
11322
11551
|
})
|
|
11323
11552
|
).filter((rule) => rule.isDeletable());
|
|
@@ -11326,7 +11555,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
11326
11555
|
nonRootFilePaths.map(
|
|
11327
11556
|
(filePath) => factory.class.fromFile({
|
|
11328
11557
|
baseDir: this.baseDir,
|
|
11329
|
-
relativeFilePath: (0,
|
|
11558
|
+
relativeFilePath: (0, import_node_path95.basename)(filePath),
|
|
11330
11559
|
global: this.global
|
|
11331
11560
|
})
|
|
11332
11561
|
)
|
|
@@ -11419,14 +11648,14 @@ s/<command> [arguments]
|
|
|
11419
11648
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
11420
11649
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
11421
11650
|
|
|
11422
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
11651
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path95.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
11423
11652
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
11424
11653
|
|
|
11425
11654
|
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.
|
|
11426
11655
|
|
|
11427
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
11656
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path95.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
11428
11657
|
|
|
11429
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
11658
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path95.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
11430
11659
|
const skillsSection = skills ? this.generateSkillsSection(skills) : "";
|
|
11431
11660
|
const result = [
|
|
11432
11661
|
overview,
|
|
@@ -11708,7 +11937,7 @@ async function generateSkills(config) {
|
|
|
11708
11937
|
}
|
|
11709
11938
|
|
|
11710
11939
|
// src/cli/commands/gitignore.ts
|
|
11711
|
-
var
|
|
11940
|
+
var import_node_path96 = require("path");
|
|
11712
11941
|
var RULESYNC_HEADER = "# Generated by Rulesync";
|
|
11713
11942
|
var LEGACY_RULESYNC_HEADER = "# Generated by rulesync - AI tool configuration files";
|
|
11714
11943
|
var RULESYNC_IGNORE_ENTRIES = [
|
|
@@ -11771,6 +12000,7 @@ var RULESYNC_IGNORE_ENTRIES = [
|
|
|
11771
12000
|
"**/.kilocodeignore",
|
|
11772
12001
|
// Kiro
|
|
11773
12002
|
"**/.kiro/steering/",
|
|
12003
|
+
"**/.kiro/prompts/",
|
|
11774
12004
|
"**/.kiro/settings/mcp.json",
|
|
11775
12005
|
"**/.aiignore",
|
|
11776
12006
|
// OpenCode
|
|
@@ -11781,6 +12011,8 @@ var RULESYNC_IGNORE_ENTRIES = [
|
|
|
11781
12011
|
// Qwen
|
|
11782
12012
|
"**/QWEN.md",
|
|
11783
12013
|
"**/.qwen/memories/",
|
|
12014
|
+
// Replit
|
|
12015
|
+
"**/replit.md",
|
|
11784
12016
|
// Roo
|
|
11785
12017
|
"**/.roo/rules/",
|
|
11786
12018
|
"**/.roo/skills/",
|
|
@@ -11844,7 +12076,7 @@ var removeExistingRulesyncEntries = (content) => {
|
|
|
11844
12076
|
return result;
|
|
11845
12077
|
};
|
|
11846
12078
|
var gitignoreCommand = async () => {
|
|
11847
|
-
const gitignorePath = (0,
|
|
12079
|
+
const gitignorePath = (0, import_node_path96.join)(process.cwd(), ".gitignore");
|
|
11848
12080
|
let gitignoreContent = "";
|
|
11849
12081
|
if (await fileExists(gitignorePath)) {
|
|
11850
12082
|
gitignoreContent = await readFileContent(gitignorePath);
|
|
@@ -12043,7 +12275,7 @@ async function importSkills(config, tool) {
|
|
|
12043
12275
|
}
|
|
12044
12276
|
|
|
12045
12277
|
// src/cli/commands/init.ts
|
|
12046
|
-
var
|
|
12278
|
+
var import_node_path97 = require("path");
|
|
12047
12279
|
async function initCommand() {
|
|
12048
12280
|
logger.info("Initializing rulesync...");
|
|
12049
12281
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -12221,14 +12453,14 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
12221
12453
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
12222
12454
|
await ensureDir(skillPaths.relativeDirPath);
|
|
12223
12455
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
12224
|
-
const ruleFilepath = (0,
|
|
12456
|
+
const ruleFilepath = (0, import_node_path97.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
12225
12457
|
if (!await fileExists(ruleFilepath)) {
|
|
12226
12458
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
12227
12459
|
logger.success(`Created ${ruleFilepath}`);
|
|
12228
12460
|
} else {
|
|
12229
12461
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
12230
12462
|
}
|
|
12231
|
-
const mcpFilepath = (0,
|
|
12463
|
+
const mcpFilepath = (0, import_node_path97.join)(
|
|
12232
12464
|
mcpPaths.recommended.relativeDirPath,
|
|
12233
12465
|
mcpPaths.recommended.relativeFilePath
|
|
12234
12466
|
);
|
|
@@ -12238,30 +12470,30 @@ Keep the summary concise and ready to reuse in future tasks.`
|
|
|
12238
12470
|
} else {
|
|
12239
12471
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
12240
12472
|
}
|
|
12241
|
-
const commandFilepath = (0,
|
|
12473
|
+
const commandFilepath = (0, import_node_path97.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
12242
12474
|
if (!await fileExists(commandFilepath)) {
|
|
12243
12475
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
12244
12476
|
logger.success(`Created ${commandFilepath}`);
|
|
12245
12477
|
} else {
|
|
12246
12478
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
12247
12479
|
}
|
|
12248
|
-
const subagentFilepath = (0,
|
|
12480
|
+
const subagentFilepath = (0, import_node_path97.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
12249
12481
|
if (!await fileExists(subagentFilepath)) {
|
|
12250
12482
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
12251
12483
|
logger.success(`Created ${subagentFilepath}`);
|
|
12252
12484
|
} else {
|
|
12253
12485
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
12254
12486
|
}
|
|
12255
|
-
const skillDirPath = (0,
|
|
12487
|
+
const skillDirPath = (0, import_node_path97.join)(skillPaths.relativeDirPath, sampleSkillFile.dirName);
|
|
12256
12488
|
await ensureDir(skillDirPath);
|
|
12257
|
-
const skillFilepath = (0,
|
|
12489
|
+
const skillFilepath = (0, import_node_path97.join)(skillDirPath, SKILL_FILE_NAME);
|
|
12258
12490
|
if (!await fileExists(skillFilepath)) {
|
|
12259
12491
|
await writeFileContent(skillFilepath, sampleSkillFile.content);
|
|
12260
12492
|
logger.success(`Created ${skillFilepath}`);
|
|
12261
12493
|
} else {
|
|
12262
12494
|
logger.info(`Skipped ${skillFilepath} (already exists)`);
|
|
12263
12495
|
}
|
|
12264
|
-
const ignoreFilepath = (0,
|
|
12496
|
+
const ignoreFilepath = (0, import_node_path97.join)(
|
|
12265
12497
|
ignorePaths.recommended.relativeDirPath,
|
|
12266
12498
|
ignorePaths.recommended.relativeFilePath
|
|
12267
12499
|
);
|
|
@@ -12280,12 +12512,12 @@ var import_fastmcp = require("fastmcp");
|
|
|
12280
12512
|
var import_mini49 = require("zod/mini");
|
|
12281
12513
|
|
|
12282
12514
|
// src/mcp/commands.ts
|
|
12283
|
-
var
|
|
12515
|
+
var import_node_path98 = require("path");
|
|
12284
12516
|
var import_mini43 = require("zod/mini");
|
|
12285
12517
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
12286
12518
|
var maxCommandsCount = 1e3;
|
|
12287
12519
|
async function listCommands() {
|
|
12288
|
-
const commandsDir = (0,
|
|
12520
|
+
const commandsDir = (0, import_node_path98.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
12289
12521
|
try {
|
|
12290
12522
|
const files = await listDirectoryFiles(commandsDir);
|
|
12291
12523
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -12297,7 +12529,7 @@ async function listCommands() {
|
|
|
12297
12529
|
});
|
|
12298
12530
|
const frontmatter = command.getFrontmatter();
|
|
12299
12531
|
return {
|
|
12300
|
-
relativePathFromCwd: (0,
|
|
12532
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
12301
12533
|
frontmatter
|
|
12302
12534
|
};
|
|
12303
12535
|
} catch (error) {
|
|
@@ -12317,13 +12549,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
12317
12549
|
relativePath: relativePathFromCwd,
|
|
12318
12550
|
intendedRootDir: process.cwd()
|
|
12319
12551
|
});
|
|
12320
|
-
const filename = (0,
|
|
12552
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12321
12553
|
try {
|
|
12322
12554
|
const command = await RulesyncCommand.fromFile({
|
|
12323
12555
|
relativeFilePath: filename
|
|
12324
12556
|
});
|
|
12325
12557
|
return {
|
|
12326
|
-
relativePathFromCwd: (0,
|
|
12558
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
12327
12559
|
frontmatter: command.getFrontmatter(),
|
|
12328
12560
|
body: command.getBody()
|
|
12329
12561
|
};
|
|
@@ -12342,7 +12574,7 @@ async function putCommand({
|
|
|
12342
12574
|
relativePath: relativePathFromCwd,
|
|
12343
12575
|
intendedRootDir: process.cwd()
|
|
12344
12576
|
});
|
|
12345
|
-
const filename = (0,
|
|
12577
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12346
12578
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
12347
12579
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
12348
12580
|
throw new Error(
|
|
@@ -12352,7 +12584,7 @@ async function putCommand({
|
|
|
12352
12584
|
try {
|
|
12353
12585
|
const existingCommands = await listCommands();
|
|
12354
12586
|
const isUpdate = existingCommands.some(
|
|
12355
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
12587
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
12356
12588
|
);
|
|
12357
12589
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
12358
12590
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -12367,11 +12599,11 @@ async function putCommand({
|
|
|
12367
12599
|
fileContent,
|
|
12368
12600
|
validate: true
|
|
12369
12601
|
});
|
|
12370
|
-
const commandsDir = (0,
|
|
12602
|
+
const commandsDir = (0, import_node_path98.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
12371
12603
|
await ensureDir(commandsDir);
|
|
12372
12604
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
12373
12605
|
return {
|
|
12374
|
-
relativePathFromCwd: (0,
|
|
12606
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
12375
12607
|
frontmatter: command.getFrontmatter(),
|
|
12376
12608
|
body: command.getBody()
|
|
12377
12609
|
};
|
|
@@ -12386,12 +12618,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
12386
12618
|
relativePath: relativePathFromCwd,
|
|
12387
12619
|
intendedRootDir: process.cwd()
|
|
12388
12620
|
});
|
|
12389
|
-
const filename = (0,
|
|
12390
|
-
const fullPath = (0,
|
|
12621
|
+
const filename = (0, import_node_path98.basename)(relativePathFromCwd);
|
|
12622
|
+
const fullPath = (0, import_node_path98.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
12391
12623
|
try {
|
|
12392
12624
|
await removeFile(fullPath);
|
|
12393
12625
|
return {
|
|
12394
|
-
relativePathFromCwd: (0,
|
|
12626
|
+
relativePathFromCwd: (0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
12395
12627
|
};
|
|
12396
12628
|
} catch (error) {
|
|
12397
12629
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -12416,7 +12648,7 @@ var commandToolSchemas = {
|
|
|
12416
12648
|
var commandTools = {
|
|
12417
12649
|
listCommands: {
|
|
12418
12650
|
name: "listCommands",
|
|
12419
|
-
description: `List all commands from ${(0,
|
|
12651
|
+
description: `List all commands from ${(0, import_node_path98.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
12420
12652
|
parameters: commandToolSchemas.listCommands,
|
|
12421
12653
|
execute: async () => {
|
|
12422
12654
|
const commands = await listCommands();
|
|
@@ -12458,11 +12690,11 @@ var commandTools = {
|
|
|
12458
12690
|
};
|
|
12459
12691
|
|
|
12460
12692
|
// src/mcp/ignore.ts
|
|
12461
|
-
var
|
|
12693
|
+
var import_node_path99 = require("path");
|
|
12462
12694
|
var import_mini44 = require("zod/mini");
|
|
12463
12695
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
12464
12696
|
async function getIgnoreFile() {
|
|
12465
|
-
const ignoreFilePath = (0,
|
|
12697
|
+
const ignoreFilePath = (0, import_node_path99.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12466
12698
|
try {
|
|
12467
12699
|
const content = await readFileContent(ignoreFilePath);
|
|
12468
12700
|
return {
|
|
@@ -12476,7 +12708,7 @@ async function getIgnoreFile() {
|
|
|
12476
12708
|
}
|
|
12477
12709
|
}
|
|
12478
12710
|
async function putIgnoreFile({ content }) {
|
|
12479
|
-
const ignoreFilePath = (0,
|
|
12711
|
+
const ignoreFilePath = (0, import_node_path99.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12480
12712
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
12481
12713
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
12482
12714
|
throw new Error(
|
|
@@ -12497,8 +12729,8 @@ async function putIgnoreFile({ content }) {
|
|
|
12497
12729
|
}
|
|
12498
12730
|
}
|
|
12499
12731
|
async function deleteIgnoreFile() {
|
|
12500
|
-
const aiignorePath = (0,
|
|
12501
|
-
const legacyIgnorePath = (0,
|
|
12732
|
+
const aiignorePath = (0, import_node_path99.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
12733
|
+
const legacyIgnorePath = (0, import_node_path99.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
12502
12734
|
try {
|
|
12503
12735
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
12504
12736
|
return {
|
|
@@ -12553,7 +12785,7 @@ var ignoreTools = {
|
|
|
12553
12785
|
};
|
|
12554
12786
|
|
|
12555
12787
|
// src/mcp/mcp.ts
|
|
12556
|
-
var
|
|
12788
|
+
var import_node_path100 = require("path");
|
|
12557
12789
|
var import_mini45 = require("zod/mini");
|
|
12558
12790
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
12559
12791
|
async function getMcpFile() {
|
|
@@ -12563,7 +12795,7 @@ async function getMcpFile() {
|
|
|
12563
12795
|
validate: true,
|
|
12564
12796
|
modularMcp: config.getModularMcp()
|
|
12565
12797
|
});
|
|
12566
|
-
const relativePathFromCwd = (0,
|
|
12798
|
+
const relativePathFromCwd = (0, import_node_path100.join)(
|
|
12567
12799
|
rulesyncMcp.getRelativeDirPath(),
|
|
12568
12800
|
rulesyncMcp.getRelativeFilePath()
|
|
12569
12801
|
);
|
|
@@ -12596,7 +12828,7 @@ async function putMcpFile({ content }) {
|
|
|
12596
12828
|
const paths = RulesyncMcp.getSettablePaths();
|
|
12597
12829
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
12598
12830
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
12599
|
-
const fullPath = (0,
|
|
12831
|
+
const fullPath = (0, import_node_path100.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
12600
12832
|
const rulesyncMcp = new RulesyncMcp({
|
|
12601
12833
|
baseDir,
|
|
12602
12834
|
relativeDirPath,
|
|
@@ -12605,9 +12837,9 @@ async function putMcpFile({ content }) {
|
|
|
12605
12837
|
validate: true,
|
|
12606
12838
|
modularMcp: config.getModularMcp()
|
|
12607
12839
|
});
|
|
12608
|
-
await ensureDir((0,
|
|
12840
|
+
await ensureDir((0, import_node_path100.join)(baseDir, relativeDirPath));
|
|
12609
12841
|
await writeFileContent(fullPath, content);
|
|
12610
|
-
const relativePathFromCwd = (0,
|
|
12842
|
+
const relativePathFromCwd = (0, import_node_path100.join)(relativeDirPath, relativeFilePath);
|
|
12611
12843
|
return {
|
|
12612
12844
|
relativePathFromCwd,
|
|
12613
12845
|
content: rulesyncMcp.getFileContent()
|
|
@@ -12622,15 +12854,15 @@ async function deleteMcpFile() {
|
|
|
12622
12854
|
try {
|
|
12623
12855
|
const baseDir = process.cwd();
|
|
12624
12856
|
const paths = RulesyncMcp.getSettablePaths();
|
|
12625
|
-
const recommendedPath = (0,
|
|
12857
|
+
const recommendedPath = (0, import_node_path100.join)(
|
|
12626
12858
|
baseDir,
|
|
12627
12859
|
paths.recommended.relativeDirPath,
|
|
12628
12860
|
paths.recommended.relativeFilePath
|
|
12629
12861
|
);
|
|
12630
|
-
const legacyPath = (0,
|
|
12862
|
+
const legacyPath = (0, import_node_path100.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
12631
12863
|
await removeFile(recommendedPath);
|
|
12632
12864
|
await removeFile(legacyPath);
|
|
12633
|
-
const relativePathFromCwd = (0,
|
|
12865
|
+
const relativePathFromCwd = (0, import_node_path100.join)(
|
|
12634
12866
|
paths.recommended.relativeDirPath,
|
|
12635
12867
|
paths.recommended.relativeFilePath
|
|
12636
12868
|
);
|
|
@@ -12681,12 +12913,12 @@ var mcpTools = {
|
|
|
12681
12913
|
};
|
|
12682
12914
|
|
|
12683
12915
|
// src/mcp/rules.ts
|
|
12684
|
-
var
|
|
12916
|
+
var import_node_path101 = require("path");
|
|
12685
12917
|
var import_mini46 = require("zod/mini");
|
|
12686
12918
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
12687
12919
|
var maxRulesCount = 1e3;
|
|
12688
12920
|
async function listRules() {
|
|
12689
|
-
const rulesDir = (0,
|
|
12921
|
+
const rulesDir = (0, import_node_path101.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
12690
12922
|
try {
|
|
12691
12923
|
const files = await listDirectoryFiles(rulesDir);
|
|
12692
12924
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -12699,7 +12931,7 @@ async function listRules() {
|
|
|
12699
12931
|
});
|
|
12700
12932
|
const frontmatter = rule.getFrontmatter();
|
|
12701
12933
|
return {
|
|
12702
|
-
relativePathFromCwd: (0,
|
|
12934
|
+
relativePathFromCwd: (0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
12703
12935
|
frontmatter
|
|
12704
12936
|
};
|
|
12705
12937
|
} catch (error) {
|
|
@@ -12719,14 +12951,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
12719
12951
|
relativePath: relativePathFromCwd,
|
|
12720
12952
|
intendedRootDir: process.cwd()
|
|
12721
12953
|
});
|
|
12722
|
-
const filename = (0,
|
|
12954
|
+
const filename = (0, import_node_path101.basename)(relativePathFromCwd);
|
|
12723
12955
|
try {
|
|
12724
12956
|
const rule = await RulesyncRule.fromFile({
|
|
12725
12957
|
relativeFilePath: filename,
|
|
12726
12958
|
validate: true
|
|
12727
12959
|
});
|
|
12728
12960
|
return {
|
|
12729
|
-
relativePathFromCwd: (0,
|
|
12961
|
+
relativePathFromCwd: (0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
12730
12962
|
frontmatter: rule.getFrontmatter(),
|
|
12731
12963
|
body: rule.getBody()
|
|
12732
12964
|
};
|
|
@@ -12745,7 +12977,7 @@ async function putRule({
|
|
|
12745
12977
|
relativePath: relativePathFromCwd,
|
|
12746
12978
|
intendedRootDir: process.cwd()
|
|
12747
12979
|
});
|
|
12748
|
-
const filename = (0,
|
|
12980
|
+
const filename = (0, import_node_path101.basename)(relativePathFromCwd);
|
|
12749
12981
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
12750
12982
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
12751
12983
|
throw new Error(
|
|
@@ -12755,7 +12987,7 @@ async function putRule({
|
|
|
12755
12987
|
try {
|
|
12756
12988
|
const existingRules = await listRules();
|
|
12757
12989
|
const isUpdate = existingRules.some(
|
|
12758
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
12990
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
12759
12991
|
);
|
|
12760
12992
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
12761
12993
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -12768,11 +13000,11 @@ async function putRule({
|
|
|
12768
13000
|
body,
|
|
12769
13001
|
validate: true
|
|
12770
13002
|
});
|
|
12771
|
-
const rulesDir = (0,
|
|
13003
|
+
const rulesDir = (0, import_node_path101.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
12772
13004
|
await ensureDir(rulesDir);
|
|
12773
13005
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
12774
13006
|
return {
|
|
12775
|
-
relativePathFromCwd: (0,
|
|
13007
|
+
relativePathFromCwd: (0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
12776
13008
|
frontmatter: rule.getFrontmatter(),
|
|
12777
13009
|
body: rule.getBody()
|
|
12778
13010
|
};
|
|
@@ -12787,12 +13019,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
12787
13019
|
relativePath: relativePathFromCwd,
|
|
12788
13020
|
intendedRootDir: process.cwd()
|
|
12789
13021
|
});
|
|
12790
|
-
const filename = (0,
|
|
12791
|
-
const fullPath = (0,
|
|
13022
|
+
const filename = (0, import_node_path101.basename)(relativePathFromCwd);
|
|
13023
|
+
const fullPath = (0, import_node_path101.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
12792
13024
|
try {
|
|
12793
13025
|
await removeFile(fullPath);
|
|
12794
13026
|
return {
|
|
12795
|
-
relativePathFromCwd: (0,
|
|
13027
|
+
relativePathFromCwd: (0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
12796
13028
|
};
|
|
12797
13029
|
} catch (error) {
|
|
12798
13030
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -12817,7 +13049,7 @@ var ruleToolSchemas = {
|
|
|
12817
13049
|
var ruleTools = {
|
|
12818
13050
|
listRules: {
|
|
12819
13051
|
name: "listRules",
|
|
12820
|
-
description: `List all rules from ${(0,
|
|
13052
|
+
description: `List all rules from ${(0, import_node_path101.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
12821
13053
|
parameters: ruleToolSchemas.listRules,
|
|
12822
13054
|
execute: async () => {
|
|
12823
13055
|
const rules = await listRules();
|
|
@@ -12859,7 +13091,7 @@ var ruleTools = {
|
|
|
12859
13091
|
};
|
|
12860
13092
|
|
|
12861
13093
|
// src/mcp/skills.ts
|
|
12862
|
-
var
|
|
13094
|
+
var import_node_path102 = require("path");
|
|
12863
13095
|
var import_mini47 = require("zod/mini");
|
|
12864
13096
|
var maxSkillSizeBytes = 1024 * 1024;
|
|
12865
13097
|
var maxSkillsCount = 1e3;
|
|
@@ -12876,19 +13108,19 @@ function mcpSkillFileToAiDirFile(file) {
|
|
|
12876
13108
|
};
|
|
12877
13109
|
}
|
|
12878
13110
|
function extractDirName(relativeDirPathFromCwd) {
|
|
12879
|
-
const dirName = (0,
|
|
13111
|
+
const dirName = (0, import_node_path102.basename)(relativeDirPathFromCwd);
|
|
12880
13112
|
if (!dirName) {
|
|
12881
13113
|
throw new Error(`Invalid path: ${relativeDirPathFromCwd}`);
|
|
12882
13114
|
}
|
|
12883
13115
|
return dirName;
|
|
12884
13116
|
}
|
|
12885
13117
|
async function listSkills() {
|
|
12886
|
-
const skillsDir = (0,
|
|
13118
|
+
const skillsDir = (0, import_node_path102.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH);
|
|
12887
13119
|
try {
|
|
12888
|
-
const skillDirPaths = await findFilesByGlobs((0,
|
|
13120
|
+
const skillDirPaths = await findFilesByGlobs((0, import_node_path102.join)(skillsDir, "*"), { type: "dir" });
|
|
12889
13121
|
const skills = await Promise.all(
|
|
12890
13122
|
skillDirPaths.map(async (dirPath) => {
|
|
12891
|
-
const dirName = (0,
|
|
13123
|
+
const dirName = (0, import_node_path102.basename)(dirPath);
|
|
12892
13124
|
if (!dirName) return null;
|
|
12893
13125
|
try {
|
|
12894
13126
|
const skill = await RulesyncSkill.fromDir({
|
|
@@ -12896,7 +13128,7 @@ async function listSkills() {
|
|
|
12896
13128
|
});
|
|
12897
13129
|
const frontmatter = skill.getFrontmatter();
|
|
12898
13130
|
return {
|
|
12899
|
-
relativeDirPathFromCwd: (0,
|
|
13131
|
+
relativeDirPathFromCwd: (0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
12900
13132
|
frontmatter
|
|
12901
13133
|
};
|
|
12902
13134
|
} catch (error) {
|
|
@@ -12922,7 +13154,7 @@ async function getSkill({ relativeDirPathFromCwd }) {
|
|
|
12922
13154
|
dirName
|
|
12923
13155
|
});
|
|
12924
13156
|
return {
|
|
12925
|
-
relativeDirPathFromCwd: (0,
|
|
13157
|
+
relativeDirPathFromCwd: (0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
12926
13158
|
frontmatter: skill.getFrontmatter(),
|
|
12927
13159
|
body: skill.getBody(),
|
|
12928
13160
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -12956,7 +13188,7 @@ async function putSkill({
|
|
|
12956
13188
|
try {
|
|
12957
13189
|
const existingSkills = await listSkills();
|
|
12958
13190
|
const isUpdate = existingSkills.some(
|
|
12959
|
-
(skill2) => skill2.relativeDirPathFromCwd === (0,
|
|
13191
|
+
(skill2) => skill2.relativeDirPathFromCwd === (0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
12960
13192
|
);
|
|
12961
13193
|
if (!isUpdate && existingSkills.length >= maxSkillsCount) {
|
|
12962
13194
|
throw new Error(`Maximum number of skills (${maxSkillsCount}) reached`);
|
|
@@ -12971,9 +13203,9 @@ async function putSkill({
|
|
|
12971
13203
|
otherFiles: aiDirFiles,
|
|
12972
13204
|
validate: true
|
|
12973
13205
|
});
|
|
12974
|
-
const skillDirPath = (0,
|
|
13206
|
+
const skillDirPath = (0, import_node_path102.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
12975
13207
|
await ensureDir(skillDirPath);
|
|
12976
|
-
const skillFilePath = (0,
|
|
13208
|
+
const skillFilePath = (0, import_node_path102.join)(skillDirPath, SKILL_FILE_NAME);
|
|
12977
13209
|
const skillFileContent = stringifyFrontmatter(body, frontmatter);
|
|
12978
13210
|
await writeFileContent(skillFilePath, skillFileContent);
|
|
12979
13211
|
for (const file of otherFiles) {
|
|
@@ -12981,15 +13213,15 @@ async function putSkill({
|
|
|
12981
13213
|
relativePath: file.name,
|
|
12982
13214
|
intendedRootDir: skillDirPath
|
|
12983
13215
|
});
|
|
12984
|
-
const filePath = (0,
|
|
12985
|
-
const fileDir = (0,
|
|
13216
|
+
const filePath = (0, import_node_path102.join)(skillDirPath, file.name);
|
|
13217
|
+
const fileDir = (0, import_node_path102.join)(skillDirPath, (0, import_node_path102.dirname)(file.name));
|
|
12986
13218
|
if (fileDir !== skillDirPath) {
|
|
12987
13219
|
await ensureDir(fileDir);
|
|
12988
13220
|
}
|
|
12989
13221
|
await writeFileContent(filePath, file.body);
|
|
12990
13222
|
}
|
|
12991
13223
|
return {
|
|
12992
|
-
relativeDirPathFromCwd: (0,
|
|
13224
|
+
relativeDirPathFromCwd: (0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName),
|
|
12993
13225
|
frontmatter: skill.getFrontmatter(),
|
|
12994
13226
|
body: skill.getBody(),
|
|
12995
13227
|
otherFiles: skill.getOtherFiles().map(aiDirFileToMcpSkillFile)
|
|
@@ -13011,13 +13243,13 @@ async function deleteSkill({
|
|
|
13011
13243
|
intendedRootDir: process.cwd()
|
|
13012
13244
|
});
|
|
13013
13245
|
const dirName = extractDirName(relativeDirPathFromCwd);
|
|
13014
|
-
const skillDirPath = (0,
|
|
13246
|
+
const skillDirPath = (0, import_node_path102.join)(process.cwd(), RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName);
|
|
13015
13247
|
try {
|
|
13016
13248
|
if (await directoryExists(skillDirPath)) {
|
|
13017
13249
|
await removeDirectory(skillDirPath);
|
|
13018
13250
|
}
|
|
13019
13251
|
return {
|
|
13020
|
-
relativeDirPathFromCwd: (0,
|
|
13252
|
+
relativeDirPathFromCwd: (0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, dirName)
|
|
13021
13253
|
};
|
|
13022
13254
|
} catch (error) {
|
|
13023
13255
|
throw new Error(
|
|
@@ -13050,7 +13282,7 @@ var skillToolSchemas = {
|
|
|
13050
13282
|
var skillTools = {
|
|
13051
13283
|
listSkills: {
|
|
13052
13284
|
name: "listSkills",
|
|
13053
|
-
description: `List all skills from ${(0,
|
|
13285
|
+
description: `List all skills from ${(0, import_node_path102.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "*", SKILL_FILE_NAME)} with their frontmatter.`,
|
|
13054
13286
|
parameters: skillToolSchemas.listSkills,
|
|
13055
13287
|
execute: async () => {
|
|
13056
13288
|
const skills = await listSkills();
|
|
@@ -13093,12 +13325,12 @@ var skillTools = {
|
|
|
13093
13325
|
};
|
|
13094
13326
|
|
|
13095
13327
|
// src/mcp/subagents.ts
|
|
13096
|
-
var
|
|
13328
|
+
var import_node_path103 = require("path");
|
|
13097
13329
|
var import_mini48 = require("zod/mini");
|
|
13098
13330
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
13099
13331
|
var maxSubagentsCount = 1e3;
|
|
13100
13332
|
async function listSubagents() {
|
|
13101
|
-
const subagentsDir = (0,
|
|
13333
|
+
const subagentsDir = (0, import_node_path103.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
13102
13334
|
try {
|
|
13103
13335
|
const files = await listDirectoryFiles(subagentsDir);
|
|
13104
13336
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -13111,7 +13343,7 @@ async function listSubagents() {
|
|
|
13111
13343
|
});
|
|
13112
13344
|
const frontmatter = subagent.getFrontmatter();
|
|
13113
13345
|
return {
|
|
13114
|
-
relativePathFromCwd: (0,
|
|
13346
|
+
relativePathFromCwd: (0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
13115
13347
|
frontmatter
|
|
13116
13348
|
};
|
|
13117
13349
|
} catch (error) {
|
|
@@ -13133,14 +13365,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
13133
13365
|
relativePath: relativePathFromCwd,
|
|
13134
13366
|
intendedRootDir: process.cwd()
|
|
13135
13367
|
});
|
|
13136
|
-
const filename = (0,
|
|
13368
|
+
const filename = (0, import_node_path103.basename)(relativePathFromCwd);
|
|
13137
13369
|
try {
|
|
13138
13370
|
const subagent = await RulesyncSubagent.fromFile({
|
|
13139
13371
|
relativeFilePath: filename,
|
|
13140
13372
|
validate: true
|
|
13141
13373
|
});
|
|
13142
13374
|
return {
|
|
13143
|
-
relativePathFromCwd: (0,
|
|
13375
|
+
relativePathFromCwd: (0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
13144
13376
|
frontmatter: subagent.getFrontmatter(),
|
|
13145
13377
|
body: subagent.getBody()
|
|
13146
13378
|
};
|
|
@@ -13159,7 +13391,7 @@ async function putSubagent({
|
|
|
13159
13391
|
relativePath: relativePathFromCwd,
|
|
13160
13392
|
intendedRootDir: process.cwd()
|
|
13161
13393
|
});
|
|
13162
|
-
const filename = (0,
|
|
13394
|
+
const filename = (0, import_node_path103.basename)(relativePathFromCwd);
|
|
13163
13395
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
13164
13396
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
13165
13397
|
throw new Error(
|
|
@@ -13169,7 +13401,7 @@ async function putSubagent({
|
|
|
13169
13401
|
try {
|
|
13170
13402
|
const existingSubagents = await listSubagents();
|
|
13171
13403
|
const isUpdate = existingSubagents.some(
|
|
13172
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
13404
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
13173
13405
|
);
|
|
13174
13406
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
13175
13407
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -13182,11 +13414,11 @@ async function putSubagent({
|
|
|
13182
13414
|
body,
|
|
13183
13415
|
validate: true
|
|
13184
13416
|
});
|
|
13185
|
-
const subagentsDir = (0,
|
|
13417
|
+
const subagentsDir = (0, import_node_path103.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
13186
13418
|
await ensureDir(subagentsDir);
|
|
13187
13419
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
13188
13420
|
return {
|
|
13189
|
-
relativePathFromCwd: (0,
|
|
13421
|
+
relativePathFromCwd: (0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
13190
13422
|
frontmatter: subagent.getFrontmatter(),
|
|
13191
13423
|
body: subagent.getBody()
|
|
13192
13424
|
};
|
|
@@ -13201,12 +13433,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
13201
13433
|
relativePath: relativePathFromCwd,
|
|
13202
13434
|
intendedRootDir: process.cwd()
|
|
13203
13435
|
});
|
|
13204
|
-
const filename = (0,
|
|
13205
|
-
const fullPath = (0,
|
|
13436
|
+
const filename = (0, import_node_path103.basename)(relativePathFromCwd);
|
|
13437
|
+
const fullPath = (0, import_node_path103.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
13206
13438
|
try {
|
|
13207
13439
|
await removeFile(fullPath);
|
|
13208
13440
|
return {
|
|
13209
|
-
relativePathFromCwd: (0,
|
|
13441
|
+
relativePathFromCwd: (0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
13210
13442
|
};
|
|
13211
13443
|
} catch (error) {
|
|
13212
13444
|
throw new Error(
|
|
@@ -13234,7 +13466,7 @@ var subagentToolSchemas = {
|
|
|
13234
13466
|
var subagentTools = {
|
|
13235
13467
|
listSubagents: {
|
|
13236
13468
|
name: "listSubagents",
|
|
13237
|
-
description: `List all subagents from ${(0,
|
|
13469
|
+
description: `List all subagents from ${(0, import_node_path103.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
13238
13470
|
parameters: subagentToolSchemas.listSubagents,
|
|
13239
13471
|
execute: async () => {
|
|
13240
13472
|
const subagents = await listSubagents();
|
|
@@ -13485,7 +13717,7 @@ async function mcpCommand({ version }) {
|
|
|
13485
13717
|
}
|
|
13486
13718
|
|
|
13487
13719
|
// src/cli/index.ts
|
|
13488
|
-
var getVersion = () => "5.
|
|
13720
|
+
var getVersion = () => "5.5.0";
|
|
13489
13721
|
var main = async () => {
|
|
13490
13722
|
const program = new import_commander.Command();
|
|
13491
13723
|
const version = getVersion();
|