rulesync 3.27.0 → 3.28.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 +2 -0
- package/dist/index.cjs +727 -513
- package/dist/index.js +720 -506
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -249,6 +249,7 @@ var import_mini2 = require("zod/mini");
|
|
|
249
249
|
var ALL_TOOL_TARGETS = [
|
|
250
250
|
"agentsmd",
|
|
251
251
|
"amazonqcli",
|
|
252
|
+
"antigravity",
|
|
252
253
|
"augmentcode",
|
|
253
254
|
"augmentcode-legacy",
|
|
254
255
|
"copilot",
|
|
@@ -506,8 +507,8 @@ var RULESYNC_OVERVIEW_FILE_NAME = "overview.md";
|
|
|
506
507
|
var RULESYNC_SKILLS_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "skills");
|
|
507
508
|
|
|
508
509
|
// src/features/commands/commands-processor.ts
|
|
509
|
-
var
|
|
510
|
-
var
|
|
510
|
+
var import_node_path15 = require("path");
|
|
511
|
+
var import_mini11 = require("zod/mini");
|
|
511
512
|
|
|
512
513
|
// src/types/feature-processor.ts
|
|
513
514
|
var FeatureProcessor = class {
|
|
@@ -879,7 +880,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
879
880
|
}
|
|
880
881
|
};
|
|
881
882
|
|
|
882
|
-
// src/features/commands/
|
|
883
|
+
// src/features/commands/antigravity-command.ts
|
|
883
884
|
var import_node_path8 = require("path");
|
|
884
885
|
var import_mini6 = require("zod/mini");
|
|
885
886
|
|
|
@@ -974,10 +975,134 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
974
975
|
}
|
|
975
976
|
};
|
|
976
977
|
|
|
977
|
-
// src/features/commands/
|
|
978
|
-
var
|
|
978
|
+
// src/features/commands/antigravity-command.ts
|
|
979
|
+
var AntigravityCommandFrontmatterSchema = import_mini6.z.object({
|
|
979
980
|
description: import_mini6.z.string()
|
|
980
981
|
});
|
|
982
|
+
var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
|
|
983
|
+
frontmatter;
|
|
984
|
+
body;
|
|
985
|
+
static getSettablePaths() {
|
|
986
|
+
return {
|
|
987
|
+
relativeDirPath: (0, import_node_path8.join)(".agent", "workflows")
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
991
|
+
if (rest.validate) {
|
|
992
|
+
const result = AntigravityCommandFrontmatterSchema.safeParse(frontmatter);
|
|
993
|
+
if (!result.success) {
|
|
994
|
+
throw new Error(
|
|
995
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
super({
|
|
1000
|
+
...rest,
|
|
1001
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
1002
|
+
});
|
|
1003
|
+
this.frontmatter = frontmatter;
|
|
1004
|
+
this.body = body;
|
|
1005
|
+
}
|
|
1006
|
+
getBody() {
|
|
1007
|
+
return this.body;
|
|
1008
|
+
}
|
|
1009
|
+
getFrontmatter() {
|
|
1010
|
+
return this.frontmatter;
|
|
1011
|
+
}
|
|
1012
|
+
toRulesyncCommand() {
|
|
1013
|
+
const rulesyncFrontmatter = {
|
|
1014
|
+
targets: ["antigravity"],
|
|
1015
|
+
description: this.frontmatter.description
|
|
1016
|
+
};
|
|
1017
|
+
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1018
|
+
return new RulesyncCommand({
|
|
1019
|
+
baseDir: ".",
|
|
1020
|
+
// RulesyncCommand baseDir is always the project root directory
|
|
1021
|
+
frontmatter: rulesyncFrontmatter,
|
|
1022
|
+
body: this.body,
|
|
1023
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
1024
|
+
relativeFilePath: this.relativeFilePath,
|
|
1025
|
+
fileContent,
|
|
1026
|
+
validate: true
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
static fromRulesyncCommand({
|
|
1030
|
+
baseDir = process.cwd(),
|
|
1031
|
+
rulesyncCommand,
|
|
1032
|
+
validate = true
|
|
1033
|
+
}) {
|
|
1034
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1035
|
+
const antigravityFrontmatter = {
|
|
1036
|
+
description: rulesyncFrontmatter.description
|
|
1037
|
+
};
|
|
1038
|
+
const body = rulesyncCommand.getBody();
|
|
1039
|
+
const fileContent = stringifyFrontmatter(body, antigravityFrontmatter);
|
|
1040
|
+
return new _AntigravityCommand({
|
|
1041
|
+
baseDir,
|
|
1042
|
+
frontmatter: antigravityFrontmatter,
|
|
1043
|
+
body,
|
|
1044
|
+
relativeDirPath: _AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
1045
|
+
relativeFilePath: rulesyncCommand.getRelativeFilePath(),
|
|
1046
|
+
fileContent,
|
|
1047
|
+
validate
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
validate() {
|
|
1051
|
+
if (!this.frontmatter) {
|
|
1052
|
+
return { success: true, error: null };
|
|
1053
|
+
}
|
|
1054
|
+
const result = AntigravityCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
1055
|
+
if (result.success) {
|
|
1056
|
+
return { success: true, error: null };
|
|
1057
|
+
} else {
|
|
1058
|
+
return {
|
|
1059
|
+
success: false,
|
|
1060
|
+
error: new Error(
|
|
1061
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1062
|
+
)
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
static isTargetedByRulesyncCommand(rulesyncCommand) {
|
|
1067
|
+
return this.isTargetedByRulesyncCommandDefault({
|
|
1068
|
+
rulesyncCommand,
|
|
1069
|
+
toolTarget: "antigravity"
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
static async fromFile({
|
|
1073
|
+
baseDir = process.cwd(),
|
|
1074
|
+
relativeFilePath,
|
|
1075
|
+
validate = true
|
|
1076
|
+
}) {
|
|
1077
|
+
const filePath = (0, import_node_path8.join)(
|
|
1078
|
+
baseDir,
|
|
1079
|
+
_AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
1080
|
+
relativeFilePath
|
|
1081
|
+
);
|
|
1082
|
+
const fileContent = await readFileContent(filePath);
|
|
1083
|
+
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1084
|
+
const result = AntigravityCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1085
|
+
if (!result.success) {
|
|
1086
|
+
throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
|
|
1087
|
+
}
|
|
1088
|
+
return new _AntigravityCommand({
|
|
1089
|
+
baseDir,
|
|
1090
|
+
relativeDirPath: _AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
1091
|
+
relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
|
|
1092
|
+
frontmatter: result.data,
|
|
1093
|
+
body: content.trim(),
|
|
1094
|
+
fileContent,
|
|
1095
|
+
validate
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
// src/features/commands/claudecode-command.ts
|
|
1101
|
+
var import_node_path9 = require("path");
|
|
1102
|
+
var import_mini7 = require("zod/mini");
|
|
1103
|
+
var ClaudecodeCommandFrontmatterSchema = import_mini7.z.object({
|
|
1104
|
+
description: import_mini7.z.string()
|
|
1105
|
+
});
|
|
981
1106
|
var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
982
1107
|
frontmatter;
|
|
983
1108
|
body;
|
|
@@ -986,7 +1111,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
986
1111
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
987
1112
|
if (!result.success) {
|
|
988
1113
|
throw new Error(
|
|
989
|
-
`Invalid frontmatter in ${(0,
|
|
1114
|
+
`Invalid frontmatter in ${(0, import_node_path9.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
990
1115
|
);
|
|
991
1116
|
}
|
|
992
1117
|
}
|
|
@@ -999,7 +1124,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
999
1124
|
}
|
|
1000
1125
|
static getSettablePaths(_options = {}) {
|
|
1001
1126
|
return {
|
|
1002
|
-
relativeDirPath: (0,
|
|
1127
|
+
relativeDirPath: (0, import_node_path9.join)(".claude", "commands")
|
|
1003
1128
|
};
|
|
1004
1129
|
}
|
|
1005
1130
|
getBody() {
|
|
@@ -1057,7 +1182,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1057
1182
|
return {
|
|
1058
1183
|
success: false,
|
|
1059
1184
|
error: new Error(
|
|
1060
|
-
`Invalid frontmatter in ${(0,
|
|
1185
|
+
`Invalid frontmatter in ${(0, import_node_path9.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1061
1186
|
)
|
|
1062
1187
|
};
|
|
1063
1188
|
}
|
|
@@ -1075,7 +1200,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1075
1200
|
global = false
|
|
1076
1201
|
}) {
|
|
1077
1202
|
const paths = this.getSettablePaths({ global });
|
|
1078
|
-
const filePath = (0,
|
|
1203
|
+
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1079
1204
|
const fileContent = await readFileContent(filePath);
|
|
1080
1205
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1081
1206
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1085,7 +1210,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1085
1210
|
return new _ClaudecodeCommand({
|
|
1086
1211
|
baseDir,
|
|
1087
1212
|
relativeDirPath: paths.relativeDirPath,
|
|
1088
|
-
relativeFilePath: (0,
|
|
1213
|
+
relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
|
|
1089
1214
|
frontmatter: result.data,
|
|
1090
1215
|
body: content.trim(),
|
|
1091
1216
|
validate
|
|
@@ -1094,14 +1219,14 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1094
1219
|
};
|
|
1095
1220
|
|
|
1096
1221
|
// src/features/commands/codexcli-command.ts
|
|
1097
|
-
var
|
|
1222
|
+
var import_node_path10 = require("path");
|
|
1098
1223
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
1099
1224
|
static getSettablePaths({ global } = {}) {
|
|
1100
1225
|
if (!global) {
|
|
1101
1226
|
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
1102
1227
|
}
|
|
1103
1228
|
return {
|
|
1104
|
-
relativeDirPath: (0,
|
|
1229
|
+
relativeDirPath: (0, import_node_path10.join)(".codex", "prompts")
|
|
1105
1230
|
};
|
|
1106
1231
|
}
|
|
1107
1232
|
toRulesyncCommand() {
|
|
@@ -1154,13 +1279,13 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1154
1279
|
global = false
|
|
1155
1280
|
}) {
|
|
1156
1281
|
const paths = this.getSettablePaths({ global });
|
|
1157
|
-
const filePath = (0,
|
|
1282
|
+
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1158
1283
|
const fileContent = await readFileContent(filePath);
|
|
1159
1284
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1160
1285
|
return new _CodexcliCommand({
|
|
1161
1286
|
baseDir,
|
|
1162
1287
|
relativeDirPath: paths.relativeDirPath,
|
|
1163
|
-
relativeFilePath: (0,
|
|
1288
|
+
relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
|
|
1164
1289
|
fileContent: content.trim(),
|
|
1165
1290
|
validate
|
|
1166
1291
|
});
|
|
@@ -1168,11 +1293,11 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1168
1293
|
};
|
|
1169
1294
|
|
|
1170
1295
|
// src/features/commands/copilot-command.ts
|
|
1171
|
-
var
|
|
1172
|
-
var
|
|
1173
|
-
var CopilotCommandFrontmatterSchema =
|
|
1174
|
-
mode:
|
|
1175
|
-
description:
|
|
1296
|
+
var import_node_path11 = require("path");
|
|
1297
|
+
var import_mini8 = require("zod/mini");
|
|
1298
|
+
var CopilotCommandFrontmatterSchema = import_mini8.z.object({
|
|
1299
|
+
mode: import_mini8.z.literal("agent"),
|
|
1300
|
+
description: import_mini8.z.string()
|
|
1176
1301
|
});
|
|
1177
1302
|
var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
1178
1303
|
frontmatter;
|
|
@@ -1182,7 +1307,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1182
1307
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1183
1308
|
if (!result.success) {
|
|
1184
1309
|
throw new Error(
|
|
1185
|
-
`Invalid frontmatter in ${(0,
|
|
1310
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1186
1311
|
);
|
|
1187
1312
|
}
|
|
1188
1313
|
}
|
|
@@ -1195,7 +1320,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1195
1320
|
}
|
|
1196
1321
|
static getSettablePaths() {
|
|
1197
1322
|
return {
|
|
1198
|
-
relativeDirPath: (0,
|
|
1323
|
+
relativeDirPath: (0, import_node_path11.join)(".github", "prompts")
|
|
1199
1324
|
};
|
|
1200
1325
|
}
|
|
1201
1326
|
getBody() {
|
|
@@ -1232,7 +1357,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1232
1357
|
return {
|
|
1233
1358
|
success: false,
|
|
1234
1359
|
error: new Error(
|
|
1235
|
-
`Invalid frontmatter in ${(0,
|
|
1360
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1236
1361
|
)
|
|
1237
1362
|
};
|
|
1238
1363
|
}
|
|
@@ -1266,7 +1391,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1266
1391
|
validate = true
|
|
1267
1392
|
}) {
|
|
1268
1393
|
const paths = this.getSettablePaths();
|
|
1269
|
-
const filePath = (0,
|
|
1394
|
+
const filePath = (0, import_node_path11.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1270
1395
|
const fileContent = await readFileContent(filePath);
|
|
1271
1396
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1272
1397
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1276,7 +1401,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1276
1401
|
return new _CopilotCommand({
|
|
1277
1402
|
baseDir,
|
|
1278
1403
|
relativeDirPath: paths.relativeDirPath,
|
|
1279
|
-
relativeFilePath: (0,
|
|
1404
|
+
relativeFilePath: (0, import_node_path11.basename)(relativeFilePath),
|
|
1280
1405
|
frontmatter: result.data,
|
|
1281
1406
|
body: content.trim(),
|
|
1282
1407
|
validate
|
|
@@ -1291,11 +1416,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1291
1416
|
};
|
|
1292
1417
|
|
|
1293
1418
|
// src/features/commands/cursor-command.ts
|
|
1294
|
-
var
|
|
1419
|
+
var import_node_path12 = require("path");
|
|
1295
1420
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1296
1421
|
static getSettablePaths(_options = {}) {
|
|
1297
1422
|
return {
|
|
1298
|
-
relativeDirPath: (0,
|
|
1423
|
+
relativeDirPath: (0, import_node_path12.join)(".cursor", "commands")
|
|
1299
1424
|
};
|
|
1300
1425
|
}
|
|
1301
1426
|
toRulesyncCommand() {
|
|
@@ -1348,13 +1473,13 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1348
1473
|
global = false
|
|
1349
1474
|
}) {
|
|
1350
1475
|
const paths = this.getSettablePaths({ global });
|
|
1351
|
-
const filePath = (0,
|
|
1476
|
+
const filePath = (0, import_node_path12.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1352
1477
|
const fileContent = await readFileContent(filePath);
|
|
1353
1478
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1354
1479
|
return new _CursorCommand({
|
|
1355
1480
|
baseDir,
|
|
1356
1481
|
relativeDirPath: paths.relativeDirPath,
|
|
1357
|
-
relativeFilePath: (0,
|
|
1482
|
+
relativeFilePath: (0, import_node_path12.basename)(relativeFilePath),
|
|
1358
1483
|
fileContent: content.trim(),
|
|
1359
1484
|
validate
|
|
1360
1485
|
});
|
|
@@ -1362,12 +1487,12 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1362
1487
|
};
|
|
1363
1488
|
|
|
1364
1489
|
// src/features/commands/geminicli-command.ts
|
|
1365
|
-
var
|
|
1490
|
+
var import_node_path13 = require("path");
|
|
1366
1491
|
var import_smol_toml = require("smol-toml");
|
|
1367
|
-
var
|
|
1368
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1369
|
-
description:
|
|
1370
|
-
prompt:
|
|
1492
|
+
var import_mini9 = require("zod/mini");
|
|
1493
|
+
var GeminiCliCommandFrontmatterSchema = import_mini9.z.object({
|
|
1494
|
+
description: import_mini9.z.optional(import_mini9.z.string()),
|
|
1495
|
+
prompt: import_mini9.z.string()
|
|
1371
1496
|
});
|
|
1372
1497
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1373
1498
|
frontmatter;
|
|
@@ -1380,7 +1505,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1380
1505
|
}
|
|
1381
1506
|
static getSettablePaths(_options = {}) {
|
|
1382
1507
|
return {
|
|
1383
|
-
relativeDirPath: (0,
|
|
1508
|
+
relativeDirPath: (0, import_node_path13.join)(".gemini", "commands")
|
|
1384
1509
|
};
|
|
1385
1510
|
}
|
|
1386
1511
|
parseTomlContent(content) {
|
|
@@ -1457,12 +1582,12 @@ ${geminiFrontmatter.prompt}
|
|
|
1457
1582
|
global = false
|
|
1458
1583
|
}) {
|
|
1459
1584
|
const paths = this.getSettablePaths({ global });
|
|
1460
|
-
const filePath = (0,
|
|
1585
|
+
const filePath = (0, import_node_path13.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1461
1586
|
const fileContent = await readFileContent(filePath);
|
|
1462
1587
|
return new _GeminiCliCommand({
|
|
1463
1588
|
baseDir,
|
|
1464
1589
|
relativeDirPath: paths.relativeDirPath,
|
|
1465
|
-
relativeFilePath: (0,
|
|
1590
|
+
relativeFilePath: (0, import_node_path13.basename)(relativeFilePath),
|
|
1466
1591
|
fileContent,
|
|
1467
1592
|
validate
|
|
1468
1593
|
});
|
|
@@ -1484,18 +1609,18 @@ ${geminiFrontmatter.prompt}
|
|
|
1484
1609
|
};
|
|
1485
1610
|
|
|
1486
1611
|
// src/features/commands/roo-command.ts
|
|
1487
|
-
var
|
|
1488
|
-
var
|
|
1489
|
-
var RooCommandFrontmatterSchema =
|
|
1490
|
-
description:
|
|
1491
|
-
"argument-hint": (0,
|
|
1612
|
+
var import_node_path14 = require("path");
|
|
1613
|
+
var import_mini10 = require("zod/mini");
|
|
1614
|
+
var RooCommandFrontmatterSchema = import_mini10.z.object({
|
|
1615
|
+
description: import_mini10.z.string(),
|
|
1616
|
+
"argument-hint": (0, import_mini10.optional)(import_mini10.z.string())
|
|
1492
1617
|
});
|
|
1493
1618
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
1494
1619
|
frontmatter;
|
|
1495
1620
|
body;
|
|
1496
1621
|
static getSettablePaths() {
|
|
1497
1622
|
return {
|
|
1498
|
-
relativeDirPath: (0,
|
|
1623
|
+
relativeDirPath: (0, import_node_path14.join)(".roo", "commands")
|
|
1499
1624
|
};
|
|
1500
1625
|
}
|
|
1501
1626
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -1503,7 +1628,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1503
1628
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1504
1629
|
if (!result.success) {
|
|
1505
1630
|
throw new Error(
|
|
1506
|
-
`Invalid frontmatter in ${(0,
|
|
1631
|
+
`Invalid frontmatter in ${(0, import_node_path14.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1507
1632
|
);
|
|
1508
1633
|
}
|
|
1509
1634
|
}
|
|
@@ -1569,7 +1694,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1569
1694
|
return {
|
|
1570
1695
|
success: false,
|
|
1571
1696
|
error: new Error(
|
|
1572
|
-
`Invalid frontmatter in ${(0,
|
|
1697
|
+
`Invalid frontmatter in ${(0, import_node_path14.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1573
1698
|
)
|
|
1574
1699
|
};
|
|
1575
1700
|
}
|
|
@@ -1585,7 +1710,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1585
1710
|
relativeFilePath,
|
|
1586
1711
|
validate = true
|
|
1587
1712
|
}) {
|
|
1588
|
-
const filePath = (0,
|
|
1713
|
+
const filePath = (0, import_node_path14.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
1589
1714
|
const fileContent = await readFileContent(filePath);
|
|
1590
1715
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1591
1716
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1595,7 +1720,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1595
1720
|
return new _RooCommand({
|
|
1596
1721
|
baseDir,
|
|
1597
1722
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
1598
|
-
relativeFilePath: (0,
|
|
1723
|
+
relativeFilePath: (0, import_node_path14.basename)(relativeFilePath),
|
|
1599
1724
|
frontmatter: result.data,
|
|
1600
1725
|
body: content.trim(),
|
|
1601
1726
|
fileContent,
|
|
@@ -1607,13 +1732,14 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1607
1732
|
// src/features/commands/commands-processor.ts
|
|
1608
1733
|
var commandsProcessorToolTargets = [
|
|
1609
1734
|
"agentsmd",
|
|
1735
|
+
"antigravity",
|
|
1610
1736
|
"claudecode",
|
|
1611
1737
|
"geminicli",
|
|
1612
1738
|
"roo",
|
|
1613
1739
|
"copilot",
|
|
1614
1740
|
"cursor"
|
|
1615
1741
|
];
|
|
1616
|
-
var CommandsProcessorToolTargetSchema =
|
|
1742
|
+
var CommandsProcessorToolTargetSchema = import_mini11.z.enum(
|
|
1617
1743
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
1618
1744
|
commandsProcessorToolTargets.concat("codexcli")
|
|
1619
1745
|
);
|
|
@@ -1656,6 +1782,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1656
1782
|
baseDir: this.baseDir,
|
|
1657
1783
|
rulesyncCommand
|
|
1658
1784
|
});
|
|
1785
|
+
case "antigravity":
|
|
1786
|
+
if (!AntigravityCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1787
|
+
return null;
|
|
1788
|
+
}
|
|
1789
|
+
return AntigravityCommand.fromRulesyncCommand({
|
|
1790
|
+
baseDir: this.baseDir,
|
|
1791
|
+
rulesyncCommand
|
|
1792
|
+
});
|
|
1659
1793
|
case "claudecode":
|
|
1660
1794
|
if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1661
1795
|
return null;
|
|
@@ -1731,11 +1865,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1731
1865
|
*/
|
|
1732
1866
|
async loadRulesyncFiles() {
|
|
1733
1867
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
1734
|
-
(0,
|
|
1868
|
+
(0, import_node_path15.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
1735
1869
|
);
|
|
1736
1870
|
const rulesyncCommands = await Promise.all(
|
|
1737
1871
|
rulesyncCommandPaths.map(
|
|
1738
|
-
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
1872
|
+
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path15.basename)(path3) })
|
|
1739
1873
|
)
|
|
1740
1874
|
);
|
|
1741
1875
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -1751,6 +1885,8 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1751
1885
|
switch (this.toolTarget) {
|
|
1752
1886
|
case "agentsmd":
|
|
1753
1887
|
return await this.loadAgentsmdCommands();
|
|
1888
|
+
case "antigravity":
|
|
1889
|
+
return await this.loadAntigravityCommands();
|
|
1754
1890
|
case "claudecode":
|
|
1755
1891
|
return await this.loadClaudecodeCommands();
|
|
1756
1892
|
case "geminicli":
|
|
@@ -1773,7 +1909,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1773
1909
|
extension
|
|
1774
1910
|
}) {
|
|
1775
1911
|
const commandFilePaths = await findFilesByGlobs(
|
|
1776
|
-
(0,
|
|
1912
|
+
(0, import_node_path15.join)(this.baseDir, relativeDirPath, `*.${extension}`)
|
|
1777
1913
|
);
|
|
1778
1914
|
const toolCommands = await Promise.all(
|
|
1779
1915
|
commandFilePaths.map((path3) => {
|
|
@@ -1781,40 +1917,45 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1781
1917
|
case "agentsmd":
|
|
1782
1918
|
return AgentsmdCommand.fromFile({
|
|
1783
1919
|
baseDir: this.baseDir,
|
|
1784
|
-
relativeFilePath: (0,
|
|
1920
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1921
|
+
});
|
|
1922
|
+
case "antigravity":
|
|
1923
|
+
return AntigravityCommand.fromFile({
|
|
1924
|
+
baseDir: this.baseDir,
|
|
1925
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1785
1926
|
});
|
|
1786
1927
|
case "claudecode":
|
|
1787
1928
|
return ClaudecodeCommand.fromFile({
|
|
1788
1929
|
baseDir: this.baseDir,
|
|
1789
|
-
relativeFilePath: (0,
|
|
1930
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1790
1931
|
global: this.global
|
|
1791
1932
|
});
|
|
1792
1933
|
case "geminicli":
|
|
1793
1934
|
return GeminiCliCommand.fromFile({
|
|
1794
1935
|
baseDir: this.baseDir,
|
|
1795
|
-
relativeFilePath: (0,
|
|
1936
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1796
1937
|
global: this.global
|
|
1797
1938
|
});
|
|
1798
1939
|
case "roo":
|
|
1799
1940
|
return RooCommand.fromFile({
|
|
1800
1941
|
baseDir: this.baseDir,
|
|
1801
|
-
relativeFilePath: (0,
|
|
1942
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1802
1943
|
});
|
|
1803
1944
|
case "copilot":
|
|
1804
1945
|
return CopilotCommand.fromFile({
|
|
1805
1946
|
baseDir: this.baseDir,
|
|
1806
|
-
relativeFilePath: (0,
|
|
1947
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1807
1948
|
});
|
|
1808
1949
|
case "cursor":
|
|
1809
1950
|
return CursorCommand.fromFile({
|
|
1810
1951
|
baseDir: this.baseDir,
|
|
1811
|
-
relativeFilePath: (0,
|
|
1952
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1812
1953
|
global: this.global
|
|
1813
1954
|
});
|
|
1814
1955
|
case "codexcli":
|
|
1815
1956
|
return CodexcliCommand.fromFile({
|
|
1816
1957
|
baseDir: this.baseDir,
|
|
1817
|
-
relativeFilePath: (0,
|
|
1958
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1818
1959
|
global: this.global
|
|
1819
1960
|
});
|
|
1820
1961
|
default:
|
|
@@ -1835,6 +1976,16 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1835
1976
|
extension: "md"
|
|
1836
1977
|
});
|
|
1837
1978
|
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Load Antigravity workflow configurations from .agent/workflows/ directory
|
|
1981
|
+
*/
|
|
1982
|
+
async loadAntigravityCommands() {
|
|
1983
|
+
return await this.loadToolCommandDefault({
|
|
1984
|
+
toolTarget: "antigravity",
|
|
1985
|
+
relativeDirPath: AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
1986
|
+
extension: "md"
|
|
1987
|
+
});
|
|
1988
|
+
}
|
|
1838
1989
|
/**
|
|
1839
1990
|
* Load Copilot command configurations from .github/prompts/ directory
|
|
1840
1991
|
*/
|
|
@@ -1923,17 +2074,17 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1923
2074
|
};
|
|
1924
2075
|
|
|
1925
2076
|
// src/features/ignore/ignore-processor.ts
|
|
1926
|
-
var
|
|
2077
|
+
var import_mini12 = require("zod/mini");
|
|
1927
2078
|
|
|
1928
2079
|
// src/features/ignore/amazonqcli-ignore.ts
|
|
1929
|
-
var
|
|
2080
|
+
var import_node_path17 = require("path");
|
|
1930
2081
|
|
|
1931
2082
|
// src/types/tool-file.ts
|
|
1932
2083
|
var ToolFile = class extends AiFile {
|
|
1933
2084
|
};
|
|
1934
2085
|
|
|
1935
2086
|
// src/features/ignore/rulesync-ignore.ts
|
|
1936
|
-
var
|
|
2087
|
+
var import_node_path16 = require("path");
|
|
1937
2088
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
1938
2089
|
validate() {
|
|
1939
2090
|
return { success: true, error: null };
|
|
@@ -1953,12 +2104,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
1953
2104
|
static async fromFile() {
|
|
1954
2105
|
const baseDir = process.cwd();
|
|
1955
2106
|
const paths = this.getSettablePaths();
|
|
1956
|
-
const recommendedPath = (0,
|
|
2107
|
+
const recommendedPath = (0, import_node_path16.join)(
|
|
1957
2108
|
baseDir,
|
|
1958
2109
|
paths.recommended.relativeDirPath,
|
|
1959
2110
|
paths.recommended.relativeFilePath
|
|
1960
2111
|
);
|
|
1961
|
-
const legacyPath = (0,
|
|
2112
|
+
const legacyPath = (0, import_node_path16.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
1962
2113
|
if (await fileExists(recommendedPath)) {
|
|
1963
2114
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
1964
2115
|
return new _RulesyncIgnore({
|
|
@@ -2067,7 +2218,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
2067
2218
|
validate = true
|
|
2068
2219
|
}) {
|
|
2069
2220
|
const fileContent = await readFileContent(
|
|
2070
|
-
(0,
|
|
2221
|
+
(0, import_node_path17.join)(
|
|
2071
2222
|
baseDir,
|
|
2072
2223
|
this.getSettablePaths().relativeDirPath,
|
|
2073
2224
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2084,7 +2235,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
2084
2235
|
};
|
|
2085
2236
|
|
|
2086
2237
|
// src/features/ignore/augmentcode-ignore.ts
|
|
2087
|
-
var
|
|
2238
|
+
var import_node_path18 = require("path");
|
|
2088
2239
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
2089
2240
|
static getSettablePaths() {
|
|
2090
2241
|
return {
|
|
@@ -2122,7 +2273,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2122
2273
|
validate = true
|
|
2123
2274
|
}) {
|
|
2124
2275
|
const fileContent = await readFileContent(
|
|
2125
|
-
(0,
|
|
2276
|
+
(0, import_node_path18.join)(
|
|
2126
2277
|
baseDir,
|
|
2127
2278
|
this.getSettablePaths().relativeDirPath,
|
|
2128
2279
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2139,7 +2290,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2139
2290
|
};
|
|
2140
2291
|
|
|
2141
2292
|
// src/features/ignore/claudecode-ignore.ts
|
|
2142
|
-
var
|
|
2293
|
+
var import_node_path19 = require("path");
|
|
2143
2294
|
var import_es_toolkit = require("es-toolkit");
|
|
2144
2295
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
2145
2296
|
constructor(params) {
|
|
@@ -2175,7 +2326,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2175
2326
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
2176
2327
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2177
2328
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
2178
|
-
const filePath = (0,
|
|
2329
|
+
const filePath = (0, import_node_path19.join)(
|
|
2179
2330
|
baseDir,
|
|
2180
2331
|
this.getSettablePaths().relativeDirPath,
|
|
2181
2332
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2203,7 +2354,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2203
2354
|
validate = true
|
|
2204
2355
|
}) {
|
|
2205
2356
|
const fileContent = await readFileContent(
|
|
2206
|
-
(0,
|
|
2357
|
+
(0, import_node_path19.join)(
|
|
2207
2358
|
baseDir,
|
|
2208
2359
|
this.getSettablePaths().relativeDirPath,
|
|
2209
2360
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2220,7 +2371,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2220
2371
|
};
|
|
2221
2372
|
|
|
2222
2373
|
// src/features/ignore/cline-ignore.ts
|
|
2223
|
-
var
|
|
2374
|
+
var import_node_path20 = require("path");
|
|
2224
2375
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
2225
2376
|
static getSettablePaths() {
|
|
2226
2377
|
return {
|
|
@@ -2257,7 +2408,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2257
2408
|
validate = true
|
|
2258
2409
|
}) {
|
|
2259
2410
|
const fileContent = await readFileContent(
|
|
2260
|
-
(0,
|
|
2411
|
+
(0, import_node_path20.join)(
|
|
2261
2412
|
baseDir,
|
|
2262
2413
|
this.getSettablePaths().relativeDirPath,
|
|
2263
2414
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2274,7 +2425,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2274
2425
|
};
|
|
2275
2426
|
|
|
2276
2427
|
// src/features/ignore/cursor-ignore.ts
|
|
2277
|
-
var
|
|
2428
|
+
var import_node_path21 = require("path");
|
|
2278
2429
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
2279
2430
|
static getSettablePaths() {
|
|
2280
2431
|
return {
|
|
@@ -2307,7 +2458,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2307
2458
|
validate = true
|
|
2308
2459
|
}) {
|
|
2309
2460
|
const fileContent = await readFileContent(
|
|
2310
|
-
(0,
|
|
2461
|
+
(0, import_node_path21.join)(
|
|
2311
2462
|
baseDir,
|
|
2312
2463
|
this.getSettablePaths().relativeDirPath,
|
|
2313
2464
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2324,7 +2475,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2324
2475
|
};
|
|
2325
2476
|
|
|
2326
2477
|
// src/features/ignore/geminicli-ignore.ts
|
|
2327
|
-
var
|
|
2478
|
+
var import_node_path22 = require("path");
|
|
2328
2479
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
2329
2480
|
static getSettablePaths() {
|
|
2330
2481
|
return {
|
|
@@ -2351,7 +2502,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2351
2502
|
validate = true
|
|
2352
2503
|
}) {
|
|
2353
2504
|
const fileContent = await readFileContent(
|
|
2354
|
-
(0,
|
|
2505
|
+
(0, import_node_path22.join)(
|
|
2355
2506
|
baseDir,
|
|
2356
2507
|
this.getSettablePaths().relativeDirPath,
|
|
2357
2508
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2368,7 +2519,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2368
2519
|
};
|
|
2369
2520
|
|
|
2370
2521
|
// src/features/ignore/junie-ignore.ts
|
|
2371
|
-
var
|
|
2522
|
+
var import_node_path23 = require("path");
|
|
2372
2523
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2373
2524
|
static getSettablePaths() {
|
|
2374
2525
|
return {
|
|
@@ -2395,7 +2546,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2395
2546
|
validate = true
|
|
2396
2547
|
}) {
|
|
2397
2548
|
const fileContent = await readFileContent(
|
|
2398
|
-
(0,
|
|
2549
|
+
(0, import_node_path23.join)(
|
|
2399
2550
|
baseDir,
|
|
2400
2551
|
this.getSettablePaths().relativeDirPath,
|
|
2401
2552
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2412,7 +2563,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2412
2563
|
};
|
|
2413
2564
|
|
|
2414
2565
|
// src/features/ignore/kiro-ignore.ts
|
|
2415
|
-
var
|
|
2566
|
+
var import_node_path24 = require("path");
|
|
2416
2567
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2417
2568
|
static getSettablePaths() {
|
|
2418
2569
|
return {
|
|
@@ -2439,7 +2590,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2439
2590
|
validate = true
|
|
2440
2591
|
}) {
|
|
2441
2592
|
const fileContent = await readFileContent(
|
|
2442
|
-
(0,
|
|
2593
|
+
(0, import_node_path24.join)(
|
|
2443
2594
|
baseDir,
|
|
2444
2595
|
this.getSettablePaths().relativeDirPath,
|
|
2445
2596
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2456,7 +2607,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2456
2607
|
};
|
|
2457
2608
|
|
|
2458
2609
|
// src/features/ignore/qwencode-ignore.ts
|
|
2459
|
-
var
|
|
2610
|
+
var import_node_path25 = require("path");
|
|
2460
2611
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2461
2612
|
static getSettablePaths() {
|
|
2462
2613
|
return {
|
|
@@ -2483,7 +2634,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2483
2634
|
validate = true
|
|
2484
2635
|
}) {
|
|
2485
2636
|
const fileContent = await readFileContent(
|
|
2486
|
-
(0,
|
|
2637
|
+
(0, import_node_path25.join)(
|
|
2487
2638
|
baseDir,
|
|
2488
2639
|
this.getSettablePaths().relativeDirPath,
|
|
2489
2640
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2500,7 +2651,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2500
2651
|
};
|
|
2501
2652
|
|
|
2502
2653
|
// src/features/ignore/roo-ignore.ts
|
|
2503
|
-
var
|
|
2654
|
+
var import_node_path26 = require("path");
|
|
2504
2655
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2505
2656
|
static getSettablePaths() {
|
|
2506
2657
|
return {
|
|
@@ -2527,7 +2678,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2527
2678
|
validate = true
|
|
2528
2679
|
}) {
|
|
2529
2680
|
const fileContent = await readFileContent(
|
|
2530
|
-
(0,
|
|
2681
|
+
(0, import_node_path26.join)(
|
|
2531
2682
|
baseDir,
|
|
2532
2683
|
this.getSettablePaths().relativeDirPath,
|
|
2533
2684
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2544,7 +2695,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2544
2695
|
};
|
|
2545
2696
|
|
|
2546
2697
|
// src/features/ignore/windsurf-ignore.ts
|
|
2547
|
-
var
|
|
2698
|
+
var import_node_path27 = require("path");
|
|
2548
2699
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2549
2700
|
static getSettablePaths() {
|
|
2550
2701
|
return {
|
|
@@ -2571,7 +2722,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2571
2722
|
validate = true
|
|
2572
2723
|
}) {
|
|
2573
2724
|
const fileContent = await readFileContent(
|
|
2574
|
-
(0,
|
|
2725
|
+
(0, import_node_path27.join)(
|
|
2575
2726
|
baseDir,
|
|
2576
2727
|
this.getSettablePaths().relativeDirPath,
|
|
2577
2728
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2601,7 +2752,7 @@ var ignoreProcessorToolTargets = [
|
|
|
2601
2752
|
"roo",
|
|
2602
2753
|
"windsurf"
|
|
2603
2754
|
];
|
|
2604
|
-
var IgnoreProcessorToolTargetSchema =
|
|
2755
|
+
var IgnoreProcessorToolTargetSchema = import_mini12.z.enum(ignoreProcessorToolTargets);
|
|
2605
2756
|
var IgnoreProcessor = class extends FeatureProcessor {
|
|
2606
2757
|
toolTarget;
|
|
2607
2758
|
constructor({
|
|
@@ -2784,54 +2935,54 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2784
2935
|
};
|
|
2785
2936
|
|
|
2786
2937
|
// src/features/mcp/mcp-processor.ts
|
|
2787
|
-
var
|
|
2938
|
+
var import_mini17 = require("zod/mini");
|
|
2788
2939
|
|
|
2789
2940
|
// src/features/mcp/amazonqcli-mcp.ts
|
|
2790
|
-
var
|
|
2941
|
+
var import_node_path29 = require("path");
|
|
2791
2942
|
|
|
2792
2943
|
// src/features/mcp/rulesync-mcp.ts
|
|
2793
|
-
var
|
|
2944
|
+
var import_node_path28 = require("path");
|
|
2794
2945
|
var import_object = require("es-toolkit/object");
|
|
2795
|
-
var
|
|
2946
|
+
var import_mini14 = require("zod/mini");
|
|
2796
2947
|
|
|
2797
2948
|
// src/types/mcp.ts
|
|
2798
|
-
var
|
|
2799
|
-
var McpServerSchema =
|
|
2800
|
-
type:
|
|
2801
|
-
command:
|
|
2802
|
-
args:
|
|
2803
|
-
url:
|
|
2804
|
-
httpUrl:
|
|
2805
|
-
env:
|
|
2806
|
-
disabled:
|
|
2807
|
-
networkTimeout:
|
|
2808
|
-
timeout:
|
|
2809
|
-
trust:
|
|
2810
|
-
cwd:
|
|
2811
|
-
transport:
|
|
2812
|
-
alwaysAllow:
|
|
2813
|
-
tools:
|
|
2814
|
-
kiroAutoApprove:
|
|
2815
|
-
kiroAutoBlock:
|
|
2816
|
-
headers:
|
|
2949
|
+
var import_mini13 = require("zod/mini");
|
|
2950
|
+
var McpServerSchema = import_mini13.z.object({
|
|
2951
|
+
type: import_mini13.z.optional(import_mini13.z.enum(["stdio", "sse", "http"])),
|
|
2952
|
+
command: import_mini13.z.optional(import_mini13.z.union([import_mini13.z.string(), import_mini13.z.array(import_mini13.z.string())])),
|
|
2953
|
+
args: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2954
|
+
url: import_mini13.z.optional(import_mini13.z.string()),
|
|
2955
|
+
httpUrl: import_mini13.z.optional(import_mini13.z.string()),
|
|
2956
|
+
env: import_mini13.z.optional(import_mini13.z.record(import_mini13.z.string(), import_mini13.z.string())),
|
|
2957
|
+
disabled: import_mini13.z.optional(import_mini13.z.boolean()),
|
|
2958
|
+
networkTimeout: import_mini13.z.optional(import_mini13.z.number()),
|
|
2959
|
+
timeout: import_mini13.z.optional(import_mini13.z.number()),
|
|
2960
|
+
trust: import_mini13.z.optional(import_mini13.z.boolean()),
|
|
2961
|
+
cwd: import_mini13.z.optional(import_mini13.z.string()),
|
|
2962
|
+
transport: import_mini13.z.optional(import_mini13.z.enum(["stdio", "sse", "http"])),
|
|
2963
|
+
alwaysAllow: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2964
|
+
tools: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2965
|
+
kiroAutoApprove: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2966
|
+
kiroAutoBlock: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2967
|
+
headers: import_mini13.z.optional(import_mini13.z.record(import_mini13.z.string(), import_mini13.z.string()))
|
|
2817
2968
|
});
|
|
2818
|
-
var McpServersSchema =
|
|
2969
|
+
var McpServersSchema = import_mini13.z.record(import_mini13.z.string(), McpServerSchema);
|
|
2819
2970
|
|
|
2820
2971
|
// src/features/mcp/rulesync-mcp.ts
|
|
2821
|
-
var RulesyncMcpServerSchema =
|
|
2822
|
-
|
|
2823
|
-
targets:
|
|
2824
|
-
description:
|
|
2825
|
-
exposed:
|
|
2972
|
+
var RulesyncMcpServerSchema = import_mini14.z.union([
|
|
2973
|
+
import_mini14.z.extend(McpServerSchema, {
|
|
2974
|
+
targets: import_mini14.z.optional(RulesyncTargetsSchema),
|
|
2975
|
+
description: import_mini14.z.optional(import_mini14.z.string()),
|
|
2976
|
+
exposed: import_mini14.z.optional(import_mini14.z.literal(false))
|
|
2826
2977
|
}),
|
|
2827
|
-
|
|
2828
|
-
targets:
|
|
2829
|
-
description:
|
|
2830
|
-
exposed:
|
|
2978
|
+
import_mini14.z.extend(McpServerSchema, {
|
|
2979
|
+
targets: import_mini14.z.optional(RulesyncTargetsSchema),
|
|
2980
|
+
description: import_mini14.z.undefined(),
|
|
2981
|
+
exposed: import_mini14.z.literal(true)
|
|
2831
2982
|
})
|
|
2832
2983
|
]);
|
|
2833
|
-
var RulesyncMcpConfigSchema =
|
|
2834
|
-
mcpServers:
|
|
2984
|
+
var RulesyncMcpConfigSchema = import_mini14.z.object({
|
|
2985
|
+
mcpServers: import_mini14.z.record(import_mini14.z.string(), RulesyncMcpServerSchema)
|
|
2835
2986
|
});
|
|
2836
2987
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2837
2988
|
json;
|
|
@@ -2872,12 +3023,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2872
3023
|
}) {
|
|
2873
3024
|
const baseDir = process.cwd();
|
|
2874
3025
|
const paths = this.getSettablePaths();
|
|
2875
|
-
const recommendedPath = (0,
|
|
3026
|
+
const recommendedPath = (0, import_node_path28.join)(
|
|
2876
3027
|
baseDir,
|
|
2877
3028
|
paths.recommended.relativeDirPath,
|
|
2878
3029
|
paths.recommended.relativeFilePath
|
|
2879
3030
|
);
|
|
2880
|
-
const legacyPath = (0,
|
|
3031
|
+
const legacyPath = (0, import_node_path28.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
2881
3032
|
if (await fileExists(recommendedPath)) {
|
|
2882
3033
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
2883
3034
|
return new _RulesyncMcp({
|
|
@@ -2997,7 +3148,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2997
3148
|
validate = true
|
|
2998
3149
|
}) {
|
|
2999
3150
|
const fileContent = await readFileContent(
|
|
3000
|
-
(0,
|
|
3151
|
+
(0, import_node_path29.join)(
|
|
3001
3152
|
baseDir,
|
|
3002
3153
|
this.getSettablePaths().relativeDirPath,
|
|
3003
3154
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3033,17 +3184,17 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
3033
3184
|
};
|
|
3034
3185
|
|
|
3035
3186
|
// src/features/mcp/claudecode-mcp.ts
|
|
3036
|
-
var
|
|
3187
|
+
var import_node_path31 = require("path");
|
|
3037
3188
|
|
|
3038
3189
|
// src/features/mcp/modular-mcp.ts
|
|
3039
|
-
var
|
|
3040
|
-
var
|
|
3041
|
-
var ModularMcpServerSchema =
|
|
3042
|
-
description:
|
|
3190
|
+
var import_node_path30 = require("path");
|
|
3191
|
+
var import_mini15 = require("zod/mini");
|
|
3192
|
+
var ModularMcpServerSchema = import_mini15.z.extend(McpServerSchema, {
|
|
3193
|
+
description: import_mini15.z.string()
|
|
3043
3194
|
// Required for modular-mcp
|
|
3044
3195
|
});
|
|
3045
|
-
var ModularMcpConfigSchema =
|
|
3046
|
-
mcpServers:
|
|
3196
|
+
var ModularMcpConfigSchema = import_mini15.z.object({
|
|
3197
|
+
mcpServers: import_mini15.z.record(import_mini15.z.string(), ModularMcpServerSchema)
|
|
3047
3198
|
});
|
|
3048
3199
|
var ModularMcp = class _ModularMcp extends AiFile {
|
|
3049
3200
|
json;
|
|
@@ -3099,7 +3250,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3099
3250
|
args: [
|
|
3100
3251
|
"-y",
|
|
3101
3252
|
"@kimuson/modular-mcp",
|
|
3102
|
-
(0,
|
|
3253
|
+
(0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3103
3254
|
],
|
|
3104
3255
|
env: {}
|
|
3105
3256
|
}
|
|
@@ -3164,7 +3315,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3164
3315
|
}) {
|
|
3165
3316
|
const paths = this.getSettablePaths({ global });
|
|
3166
3317
|
const fileContent = await readOrInitializeFileContent(
|
|
3167
|
-
(0,
|
|
3318
|
+
(0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3168
3319
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3169
3320
|
);
|
|
3170
3321
|
const json = JSON.parse(fileContent);
|
|
@@ -3186,7 +3337,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3186
3337
|
}) {
|
|
3187
3338
|
const paths = this.getSettablePaths({ global });
|
|
3188
3339
|
const fileContent = await readOrInitializeFileContent(
|
|
3189
|
-
(0,
|
|
3340
|
+
(0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3190
3341
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3191
3342
|
);
|
|
3192
3343
|
const json = JSON.parse(fileContent);
|
|
@@ -3221,7 +3372,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3221
3372
|
};
|
|
3222
3373
|
|
|
3223
3374
|
// src/features/mcp/cline-mcp.ts
|
|
3224
|
-
var
|
|
3375
|
+
var import_node_path32 = require("path");
|
|
3225
3376
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
3226
3377
|
json;
|
|
3227
3378
|
constructor(params) {
|
|
@@ -3242,7 +3393,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3242
3393
|
validate = true
|
|
3243
3394
|
}) {
|
|
3244
3395
|
const fileContent = await readFileContent(
|
|
3245
|
-
(0,
|
|
3396
|
+
(0, import_node_path32.join)(
|
|
3246
3397
|
baseDir,
|
|
3247
3398
|
this.getSettablePaths().relativeDirPath,
|
|
3248
3399
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3278,7 +3429,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3278
3429
|
};
|
|
3279
3430
|
|
|
3280
3431
|
// src/features/mcp/codexcli-mcp.ts
|
|
3281
|
-
var
|
|
3432
|
+
var import_node_path33 = require("path");
|
|
3282
3433
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
3283
3434
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
3284
3435
|
toml;
|
|
@@ -3314,7 +3465,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3314
3465
|
}) {
|
|
3315
3466
|
const paths = this.getSettablePaths({ global });
|
|
3316
3467
|
const fileContent = await readFileContent(
|
|
3317
|
-
(0,
|
|
3468
|
+
(0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3318
3469
|
);
|
|
3319
3470
|
return new _CodexcliMcp({
|
|
3320
3471
|
baseDir,
|
|
@@ -3331,7 +3482,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3331
3482
|
global = false
|
|
3332
3483
|
}) {
|
|
3333
3484
|
const paths = this.getSettablePaths({ global });
|
|
3334
|
-
const configTomlFilePath = (0,
|
|
3485
|
+
const configTomlFilePath = (0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3335
3486
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
3336
3487
|
configTomlFilePath,
|
|
3337
3488
|
smolToml.stringify({})
|
|
@@ -3372,7 +3523,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3372
3523
|
};
|
|
3373
3524
|
|
|
3374
3525
|
// src/features/mcp/copilot-mcp.ts
|
|
3375
|
-
var
|
|
3526
|
+
var import_node_path34 = require("path");
|
|
3376
3527
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
3377
3528
|
json;
|
|
3378
3529
|
constructor(params) {
|
|
@@ -3393,7 +3544,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3393
3544
|
validate = true
|
|
3394
3545
|
}) {
|
|
3395
3546
|
const fileContent = await readFileContent(
|
|
3396
|
-
(0,
|
|
3547
|
+
(0, import_node_path34.join)(
|
|
3397
3548
|
baseDir,
|
|
3398
3549
|
this.getSettablePaths().relativeDirPath,
|
|
3399
3550
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3429,7 +3580,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3429
3580
|
};
|
|
3430
3581
|
|
|
3431
3582
|
// src/features/mcp/cursor-mcp.ts
|
|
3432
|
-
var
|
|
3583
|
+
var import_node_path35 = require("path");
|
|
3433
3584
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
3434
3585
|
json;
|
|
3435
3586
|
constructor(params) {
|
|
@@ -3450,7 +3601,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3450
3601
|
validate = true
|
|
3451
3602
|
}) {
|
|
3452
3603
|
const fileContent = await readFileContent(
|
|
3453
|
-
(0,
|
|
3604
|
+
(0, import_node_path35.join)(
|
|
3454
3605
|
baseDir,
|
|
3455
3606
|
this.getSettablePaths().relativeDirPath,
|
|
3456
3607
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3497,7 +3648,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3497
3648
|
};
|
|
3498
3649
|
|
|
3499
3650
|
// src/features/mcp/geminicli-mcp.ts
|
|
3500
|
-
var
|
|
3651
|
+
var import_node_path36 = require("path");
|
|
3501
3652
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3502
3653
|
json;
|
|
3503
3654
|
constructor(params) {
|
|
@@ -3526,7 +3677,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3526
3677
|
}) {
|
|
3527
3678
|
const paths = this.getSettablePaths({ global });
|
|
3528
3679
|
const fileContent = await readOrInitializeFileContent(
|
|
3529
|
-
(0,
|
|
3680
|
+
(0, import_node_path36.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3530
3681
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3531
3682
|
);
|
|
3532
3683
|
const json = JSON.parse(fileContent);
|
|
@@ -3547,7 +3698,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3547
3698
|
}) {
|
|
3548
3699
|
const paths = this.getSettablePaths({ global });
|
|
3549
3700
|
const fileContent = await readOrInitializeFileContent(
|
|
3550
|
-
(0,
|
|
3701
|
+
(0, import_node_path36.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3551
3702
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3552
3703
|
);
|
|
3553
3704
|
const json = JSON.parse(fileContent);
|
|
@@ -3571,7 +3722,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3571
3722
|
};
|
|
3572
3723
|
|
|
3573
3724
|
// src/features/mcp/junie-mcp.ts
|
|
3574
|
-
var
|
|
3725
|
+
var import_node_path37 = require("path");
|
|
3575
3726
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
3576
3727
|
json;
|
|
3577
3728
|
constructor(params) {
|
|
@@ -3583,7 +3734,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3583
3734
|
}
|
|
3584
3735
|
static getSettablePaths() {
|
|
3585
3736
|
return {
|
|
3586
|
-
relativeDirPath: (0,
|
|
3737
|
+
relativeDirPath: (0, import_node_path37.join)(".junie", "mcp"),
|
|
3587
3738
|
relativeFilePath: "mcp.json"
|
|
3588
3739
|
};
|
|
3589
3740
|
}
|
|
@@ -3592,7 +3743,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3592
3743
|
validate = true
|
|
3593
3744
|
}) {
|
|
3594
3745
|
const fileContent = await readFileContent(
|
|
3595
|
-
(0,
|
|
3746
|
+
(0, import_node_path37.join)(
|
|
3596
3747
|
baseDir,
|
|
3597
3748
|
this.getSettablePaths().relativeDirPath,
|
|
3598
3749
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3628,28 +3779,28 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3628
3779
|
};
|
|
3629
3780
|
|
|
3630
3781
|
// src/features/mcp/opencode-mcp.ts
|
|
3631
|
-
var
|
|
3632
|
-
var
|
|
3633
|
-
var OpencodeMcpLocalServerSchema =
|
|
3634
|
-
type:
|
|
3635
|
-
command:
|
|
3636
|
-
environment:
|
|
3637
|
-
enabled:
|
|
3638
|
-
cwd:
|
|
3782
|
+
var import_node_path38 = require("path");
|
|
3783
|
+
var import_mini16 = require("zod/mini");
|
|
3784
|
+
var OpencodeMcpLocalServerSchema = import_mini16.z.object({
|
|
3785
|
+
type: import_mini16.z.literal("local"),
|
|
3786
|
+
command: import_mini16.z.array(import_mini16.z.string()),
|
|
3787
|
+
environment: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
|
|
3788
|
+
enabled: import_mini16.z._default(import_mini16.z.boolean(), true),
|
|
3789
|
+
cwd: import_mini16.z.optional(import_mini16.z.string())
|
|
3639
3790
|
});
|
|
3640
|
-
var OpencodeMcpRemoteServerSchema =
|
|
3641
|
-
type:
|
|
3642
|
-
url:
|
|
3643
|
-
headers:
|
|
3644
|
-
enabled:
|
|
3791
|
+
var OpencodeMcpRemoteServerSchema = import_mini16.z.object({
|
|
3792
|
+
type: import_mini16.z.literal("remote"),
|
|
3793
|
+
url: import_mini16.z.string(),
|
|
3794
|
+
headers: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
|
|
3795
|
+
enabled: import_mini16.z._default(import_mini16.z.boolean(), true)
|
|
3645
3796
|
});
|
|
3646
|
-
var OpencodeMcpServerSchema =
|
|
3797
|
+
var OpencodeMcpServerSchema = import_mini16.z.union([
|
|
3647
3798
|
OpencodeMcpLocalServerSchema,
|
|
3648
3799
|
OpencodeMcpRemoteServerSchema
|
|
3649
3800
|
]);
|
|
3650
|
-
var OpencodeConfigSchema =
|
|
3651
|
-
$schema:
|
|
3652
|
-
mcp:
|
|
3801
|
+
var OpencodeConfigSchema = import_mini16.z.looseObject({
|
|
3802
|
+
$schema: import_mini16.z.optional(import_mini16.z.string()),
|
|
3803
|
+
mcp: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), OpencodeMcpServerSchema))
|
|
3653
3804
|
});
|
|
3654
3805
|
function convertFromOpencodeFormat(opencodeMcp) {
|
|
3655
3806
|
return Object.fromEntries(
|
|
@@ -3746,7 +3897,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3746
3897
|
}) {
|
|
3747
3898
|
const paths = this.getSettablePaths({ global });
|
|
3748
3899
|
const fileContent = await readOrInitializeFileContent(
|
|
3749
|
-
(0,
|
|
3900
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3750
3901
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
3751
3902
|
);
|
|
3752
3903
|
const json = JSON.parse(fileContent);
|
|
@@ -3767,7 +3918,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3767
3918
|
}) {
|
|
3768
3919
|
const paths = this.getSettablePaths({ global });
|
|
3769
3920
|
const fileContent = await readOrInitializeFileContent(
|
|
3770
|
-
(0,
|
|
3921
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3771
3922
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
3772
3923
|
);
|
|
3773
3924
|
const json = JSON.parse(fileContent);
|
|
@@ -3798,7 +3949,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3798
3949
|
};
|
|
3799
3950
|
|
|
3800
3951
|
// src/features/mcp/roo-mcp.ts
|
|
3801
|
-
var
|
|
3952
|
+
var import_node_path39 = require("path");
|
|
3802
3953
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
3803
3954
|
json;
|
|
3804
3955
|
constructor(params) {
|
|
@@ -3819,7 +3970,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
3819
3970
|
validate = true
|
|
3820
3971
|
}) {
|
|
3821
3972
|
const fileContent = await readFileContent(
|
|
3822
|
-
(0,
|
|
3973
|
+
(0, import_node_path39.join)(
|
|
3823
3974
|
baseDir,
|
|
3824
3975
|
this.getSettablePaths().relativeDirPath,
|
|
3825
3976
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3867,7 +4018,7 @@ var mcpProcessorToolTargets = [
|
|
|
3867
4018
|
"opencode",
|
|
3868
4019
|
"roo"
|
|
3869
4020
|
];
|
|
3870
|
-
var McpProcessorToolTargetSchema =
|
|
4021
|
+
var McpProcessorToolTargetSchema = import_mini17.z.enum(
|
|
3871
4022
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
3872
4023
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3873
4024
|
);
|
|
@@ -4139,22 +4290,22 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
4139
4290
|
};
|
|
4140
4291
|
|
|
4141
4292
|
// src/features/rules/rules-processor.ts
|
|
4142
|
-
var
|
|
4293
|
+
var import_node_path81 = require("path");
|
|
4143
4294
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
4144
|
-
var
|
|
4295
|
+
var import_mini30 = require("zod/mini");
|
|
4145
4296
|
|
|
4146
4297
|
// src/features/skills/codexcli-skill.ts
|
|
4147
|
-
var
|
|
4298
|
+
var import_node_path42 = require("path");
|
|
4148
4299
|
|
|
4149
4300
|
// src/features/skills/simulated-skill.ts
|
|
4150
|
-
var
|
|
4151
|
-
var
|
|
4301
|
+
var import_node_path41 = require("path");
|
|
4302
|
+
var import_mini18 = require("zod/mini");
|
|
4152
4303
|
|
|
4153
4304
|
// src/constants/general.ts
|
|
4154
4305
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
4155
4306
|
|
|
4156
4307
|
// src/types/ai-dir.ts
|
|
4157
|
-
var
|
|
4308
|
+
var import_node_path40 = __toESM(require("path"), 1);
|
|
4158
4309
|
var AiDir = class {
|
|
4159
4310
|
/**
|
|
4160
4311
|
* @example "."
|
|
@@ -4188,7 +4339,7 @@ var AiDir = class {
|
|
|
4188
4339
|
otherFiles = [],
|
|
4189
4340
|
global = false
|
|
4190
4341
|
}) {
|
|
4191
|
-
if (dirName.includes(
|
|
4342
|
+
if (dirName.includes(import_node_path40.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
4192
4343
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
4193
4344
|
}
|
|
4194
4345
|
this.baseDir = baseDir;
|
|
@@ -4211,11 +4362,11 @@ var AiDir = class {
|
|
|
4211
4362
|
return this.dirName;
|
|
4212
4363
|
}
|
|
4213
4364
|
getDirPath() {
|
|
4214
|
-
const fullPath =
|
|
4215
|
-
const resolvedFull = (0,
|
|
4216
|
-
const resolvedBase = (0,
|
|
4217
|
-
const rel = (0,
|
|
4218
|
-
if (rel.startsWith("..") ||
|
|
4365
|
+
const fullPath = import_node_path40.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
4366
|
+
const resolvedFull = (0, import_node_path40.resolve)(fullPath);
|
|
4367
|
+
const resolvedBase = (0, import_node_path40.resolve)(this.baseDir);
|
|
4368
|
+
const rel = (0, import_node_path40.relative)(resolvedBase, resolvedFull);
|
|
4369
|
+
if (rel.startsWith("..") || import_node_path40.default.isAbsolute(rel)) {
|
|
4219
4370
|
throw new Error(
|
|
4220
4371
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
4221
4372
|
);
|
|
@@ -4229,7 +4380,7 @@ var AiDir = class {
|
|
|
4229
4380
|
return this.otherFiles;
|
|
4230
4381
|
}
|
|
4231
4382
|
getRelativePathFromCwd() {
|
|
4232
|
-
return
|
|
4383
|
+
return import_node_path40.default.join(this.relativeDirPath, this.dirName);
|
|
4233
4384
|
}
|
|
4234
4385
|
getGlobal() {
|
|
4235
4386
|
return this.global;
|
|
@@ -4248,15 +4399,15 @@ var AiDir = class {
|
|
|
4248
4399
|
* @returns Array of files with their relative paths and buffers
|
|
4249
4400
|
*/
|
|
4250
4401
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
4251
|
-
const dirPath = (0,
|
|
4252
|
-
const glob = (0,
|
|
4402
|
+
const dirPath = (0, import_node_path40.join)(baseDir, relativeDirPath, dirName);
|
|
4403
|
+
const glob = (0, import_node_path40.join)(dirPath, "**", "*");
|
|
4253
4404
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
4254
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
4405
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path40.basename)(filePath) !== excludeFileName);
|
|
4255
4406
|
const files = await Promise.all(
|
|
4256
4407
|
filteredPaths.map(async (filePath) => {
|
|
4257
4408
|
const fileBuffer = await readFileBuffer(filePath);
|
|
4258
4409
|
return {
|
|
4259
|
-
relativeFilePathToDirPath: (0,
|
|
4410
|
+
relativeFilePathToDirPath: (0, import_node_path40.relative)(dirPath, filePath),
|
|
4260
4411
|
fileBuffer
|
|
4261
4412
|
};
|
|
4262
4413
|
})
|
|
@@ -4322,9 +4473,9 @@ var ToolSkill = class extends AiDir {
|
|
|
4322
4473
|
};
|
|
4323
4474
|
|
|
4324
4475
|
// src/features/skills/simulated-skill.ts
|
|
4325
|
-
var SimulatedSkillFrontmatterSchema =
|
|
4326
|
-
name:
|
|
4327
|
-
description:
|
|
4476
|
+
var SimulatedSkillFrontmatterSchema = import_mini18.z.object({
|
|
4477
|
+
name: import_mini18.z.string(),
|
|
4478
|
+
description: import_mini18.z.string()
|
|
4328
4479
|
});
|
|
4329
4480
|
var SimulatedSkill = class extends ToolSkill {
|
|
4330
4481
|
frontmatter;
|
|
@@ -4355,7 +4506,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
4355
4506
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
4356
4507
|
if (!result.success) {
|
|
4357
4508
|
throw new Error(
|
|
4358
|
-
`Invalid frontmatter in ${(0,
|
|
4509
|
+
`Invalid frontmatter in ${(0, import_node_path41.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
4359
4510
|
);
|
|
4360
4511
|
}
|
|
4361
4512
|
}
|
|
@@ -4420,8 +4571,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
4420
4571
|
}) {
|
|
4421
4572
|
const settablePaths = this.getSettablePaths();
|
|
4422
4573
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
4423
|
-
const skillDirPath = (0,
|
|
4424
|
-
const skillFilePath = (0,
|
|
4574
|
+
const skillDirPath = (0, import_node_path41.join)(baseDir, actualRelativeDirPath, dirName);
|
|
4575
|
+
const skillFilePath = (0, import_node_path41.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4425
4576
|
if (!await fileExists(skillFilePath)) {
|
|
4426
4577
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4427
4578
|
}
|
|
@@ -4473,7 +4624,7 @@ var CodexCliSkill = class _CodexCliSkill extends SimulatedSkill {
|
|
|
4473
4624
|
throw new Error("CodexCliSkill does not support global mode.");
|
|
4474
4625
|
}
|
|
4475
4626
|
return {
|
|
4476
|
-
relativeDirPath: (0,
|
|
4627
|
+
relativeDirPath: (0, import_node_path42.join)(".codex", "skills")
|
|
4477
4628
|
};
|
|
4478
4629
|
}
|
|
4479
4630
|
static async fromDir(params) {
|
|
@@ -4496,14 +4647,14 @@ var CodexCliSkill = class _CodexCliSkill extends SimulatedSkill {
|
|
|
4496
4647
|
};
|
|
4497
4648
|
|
|
4498
4649
|
// src/features/skills/copilot-skill.ts
|
|
4499
|
-
var
|
|
4650
|
+
var import_node_path43 = require("path");
|
|
4500
4651
|
var CopilotSkill = class _CopilotSkill extends SimulatedSkill {
|
|
4501
4652
|
static getSettablePaths(options) {
|
|
4502
4653
|
if (options?.global) {
|
|
4503
4654
|
throw new Error("CopilotSkill does not support global mode.");
|
|
4504
4655
|
}
|
|
4505
4656
|
return {
|
|
4506
|
-
relativeDirPath: (0,
|
|
4657
|
+
relativeDirPath: (0, import_node_path43.join)(".github", "skills")
|
|
4507
4658
|
};
|
|
4508
4659
|
}
|
|
4509
4660
|
static async fromDir(params) {
|
|
@@ -4526,14 +4677,14 @@ var CopilotSkill = class _CopilotSkill extends SimulatedSkill {
|
|
|
4526
4677
|
};
|
|
4527
4678
|
|
|
4528
4679
|
// src/features/skills/cursor-skill.ts
|
|
4529
|
-
var
|
|
4680
|
+
var import_node_path44 = require("path");
|
|
4530
4681
|
var CursorSkill = class _CursorSkill extends SimulatedSkill {
|
|
4531
4682
|
static getSettablePaths(options) {
|
|
4532
4683
|
if (options?.global) {
|
|
4533
4684
|
throw new Error("CursorSkill does not support global mode.");
|
|
4534
4685
|
}
|
|
4535
4686
|
return {
|
|
4536
|
-
relativeDirPath: (0,
|
|
4687
|
+
relativeDirPath: (0, import_node_path44.join)(".cursor", "skills")
|
|
4537
4688
|
};
|
|
4538
4689
|
}
|
|
4539
4690
|
static async fromDir(params) {
|
|
@@ -4556,11 +4707,11 @@ var CursorSkill = class _CursorSkill extends SimulatedSkill {
|
|
|
4556
4707
|
};
|
|
4557
4708
|
|
|
4558
4709
|
// src/features/skills/skills-processor.ts
|
|
4559
|
-
var
|
|
4560
|
-
var
|
|
4710
|
+
var import_node_path50 = require("path");
|
|
4711
|
+
var import_mini21 = require("zod/mini");
|
|
4561
4712
|
|
|
4562
4713
|
// src/types/dir-feature-processor.ts
|
|
4563
|
-
var
|
|
4714
|
+
var import_node_path45 = require("path");
|
|
4564
4715
|
var DirFeatureProcessor = class {
|
|
4565
4716
|
baseDir;
|
|
4566
4717
|
constructor({ baseDir = process.cwd() }) {
|
|
@@ -4582,13 +4733,14 @@ var DirFeatureProcessor = class {
|
|
|
4582
4733
|
await ensureDir(dirPath);
|
|
4583
4734
|
const mainFile = aiDir.getMainFile();
|
|
4584
4735
|
if (mainFile) {
|
|
4585
|
-
const mainFilePath = (0,
|
|
4586
|
-
const
|
|
4736
|
+
const mainFilePath = (0, import_node_path45.join)(dirPath, mainFile.name);
|
|
4737
|
+
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
4738
|
+
const contentWithNewline = addTrailingNewline(content);
|
|
4587
4739
|
await writeFileContent(mainFilePath, contentWithNewline);
|
|
4588
4740
|
}
|
|
4589
4741
|
const otherFiles = aiDir.getOtherFiles();
|
|
4590
4742
|
for (const file of otherFiles) {
|
|
4591
|
-
const filePath = (0,
|
|
4743
|
+
const filePath = (0, import_node_path45.join)(dirPath, file.relativeFilePathToDirPath);
|
|
4592
4744
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
4593
4745
|
await writeFileContent(filePath, contentWithNewline);
|
|
4594
4746
|
}
|
|
@@ -4603,14 +4755,14 @@ var DirFeatureProcessor = class {
|
|
|
4603
4755
|
};
|
|
4604
4756
|
|
|
4605
4757
|
// src/features/skills/agentsmd-skill.ts
|
|
4606
|
-
var
|
|
4758
|
+
var import_node_path46 = require("path");
|
|
4607
4759
|
var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
4608
4760
|
static getSettablePaths(options) {
|
|
4609
4761
|
if (options?.global) {
|
|
4610
4762
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
4611
4763
|
}
|
|
4612
4764
|
return {
|
|
4613
|
-
relativeDirPath: (0,
|
|
4765
|
+
relativeDirPath: (0, import_node_path46.join)(".agents", "skills")
|
|
4614
4766
|
};
|
|
4615
4767
|
}
|
|
4616
4768
|
static async fromDir(params) {
|
|
@@ -4633,19 +4785,19 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
4633
4785
|
};
|
|
4634
4786
|
|
|
4635
4787
|
// src/features/skills/claudecode-skill.ts
|
|
4636
|
-
var
|
|
4637
|
-
var
|
|
4788
|
+
var import_node_path48 = require("path");
|
|
4789
|
+
var import_mini20 = require("zod/mini");
|
|
4638
4790
|
|
|
4639
4791
|
// src/features/skills/rulesync-skill.ts
|
|
4640
|
-
var
|
|
4641
|
-
var
|
|
4642
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
4643
|
-
name:
|
|
4644
|
-
description:
|
|
4645
|
-
targets:
|
|
4646
|
-
claudecode:
|
|
4647
|
-
|
|
4648
|
-
"allowed-tools":
|
|
4792
|
+
var import_node_path47 = require("path");
|
|
4793
|
+
var import_mini19 = require("zod/mini");
|
|
4794
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini19.z.object({
|
|
4795
|
+
name: import_mini19.z.string(),
|
|
4796
|
+
description: import_mini19.z.string(),
|
|
4797
|
+
targets: import_mini19.z._default(RulesyncTargetsSchema, ["*"]),
|
|
4798
|
+
claudecode: import_mini19.z.optional(
|
|
4799
|
+
import_mini19.z.object({
|
|
4800
|
+
"allowed-tools": import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string()))
|
|
4649
4801
|
})
|
|
4650
4802
|
)
|
|
4651
4803
|
});
|
|
@@ -4713,8 +4865,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
4713
4865
|
dirName,
|
|
4714
4866
|
global = false
|
|
4715
4867
|
}) {
|
|
4716
|
-
const skillDirPath = (0,
|
|
4717
|
-
const skillFilePath = (0,
|
|
4868
|
+
const skillDirPath = (0, import_node_path47.join)(baseDir, relativeDirPath, dirName);
|
|
4869
|
+
const skillFilePath = (0, import_node_path47.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4718
4870
|
if (!await fileExists(skillFilePath)) {
|
|
4719
4871
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4720
4872
|
}
|
|
@@ -4744,15 +4896,15 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
4744
4896
|
};
|
|
4745
4897
|
|
|
4746
4898
|
// src/features/skills/claudecode-skill.ts
|
|
4747
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
4748
|
-
name:
|
|
4749
|
-
description:
|
|
4750
|
-
"allowed-tools":
|
|
4899
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini20.z.object({
|
|
4900
|
+
name: import_mini20.z.string(),
|
|
4901
|
+
description: import_mini20.z.string(),
|
|
4902
|
+
"allowed-tools": import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
|
|
4751
4903
|
});
|
|
4752
4904
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
4753
4905
|
constructor({
|
|
4754
4906
|
baseDir = process.cwd(),
|
|
4755
|
-
relativeDirPath = (0,
|
|
4907
|
+
relativeDirPath = (0, import_node_path48.join)(".claude", "skills"),
|
|
4756
4908
|
dirName,
|
|
4757
4909
|
frontmatter,
|
|
4758
4910
|
body,
|
|
@@ -4783,7 +4935,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4783
4935
|
global: _global = false
|
|
4784
4936
|
} = {}) {
|
|
4785
4937
|
return {
|
|
4786
|
-
relativeDirPath: (0,
|
|
4938
|
+
relativeDirPath: (0, import_node_path48.join)(".claude", "skills")
|
|
4787
4939
|
};
|
|
4788
4940
|
}
|
|
4789
4941
|
getFrontmatter() {
|
|
@@ -4871,8 +5023,8 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4871
5023
|
}) {
|
|
4872
5024
|
const settablePaths = this.getSettablePaths({ global });
|
|
4873
5025
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
4874
|
-
const skillDirPath = (0,
|
|
4875
|
-
const skillFilePath = (0,
|
|
5026
|
+
const skillDirPath = (0, import_node_path48.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5027
|
+
const skillFilePath = (0, import_node_path48.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4876
5028
|
if (!await fileExists(skillFilePath)) {
|
|
4877
5029
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4878
5030
|
}
|
|
@@ -4902,14 +5054,14 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4902
5054
|
};
|
|
4903
5055
|
|
|
4904
5056
|
// src/features/skills/geminicli-skill.ts
|
|
4905
|
-
var
|
|
5057
|
+
var import_node_path49 = require("path");
|
|
4906
5058
|
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
4907
5059
|
static getSettablePaths(options) {
|
|
4908
5060
|
if (options?.global) {
|
|
4909
5061
|
throw new Error("GeminiCliSkill does not support global mode.");
|
|
4910
5062
|
}
|
|
4911
5063
|
return {
|
|
4912
|
-
relativeDirPath: (0,
|
|
5064
|
+
relativeDirPath: (0, import_node_path49.join)(".gemini", "skills")
|
|
4913
5065
|
};
|
|
4914
5066
|
}
|
|
4915
5067
|
static async fromDir(params) {
|
|
@@ -4948,7 +5100,7 @@ var skillsProcessorToolTargetsSimulated = [
|
|
|
4948
5100
|
"agentsmd"
|
|
4949
5101
|
];
|
|
4950
5102
|
var skillsProcessorToolTargetsGlobal = ["claudecode"];
|
|
4951
|
-
var SkillsProcessorToolTargetSchema =
|
|
5103
|
+
var SkillsProcessorToolTargetSchema = import_mini21.z.enum(skillsProcessorToolTargets);
|
|
4952
5104
|
var SkillsProcessor = class extends DirFeatureProcessor {
|
|
4953
5105
|
toolTarget;
|
|
4954
5106
|
global;
|
|
@@ -5059,9 +5211,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5059
5211
|
*/
|
|
5060
5212
|
async loadRulesyncDirs() {
|
|
5061
5213
|
const paths = RulesyncSkill.getSettablePaths();
|
|
5062
|
-
const rulesyncSkillsDirPath = (0,
|
|
5063
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5064
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
5214
|
+
const rulesyncSkillsDirPath = (0, import_node_path50.join)(this.baseDir, paths.relativeDirPath);
|
|
5215
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path50.join)(rulesyncSkillsDirPath, "*"), { type: "dir" });
|
|
5216
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path50.basename)(path3));
|
|
5065
5217
|
const rulesyncSkills = await Promise.all(
|
|
5066
5218
|
dirNames.map(
|
|
5067
5219
|
(dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
|
|
@@ -5100,9 +5252,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5100
5252
|
*/
|
|
5101
5253
|
async loadClaudecodeSkills() {
|
|
5102
5254
|
const paths = ClaudecodeSkill.getSettablePaths({ global: this.global });
|
|
5103
|
-
const skillsDirPath = (0,
|
|
5104
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5105
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
5255
|
+
const skillsDirPath = (0, import_node_path50.join)(this.baseDir, paths.relativeDirPath);
|
|
5256
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path50.join)(skillsDirPath, "*"), { type: "dir" });
|
|
5257
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path50.basename)(path3));
|
|
5106
5258
|
const toolSkills = await Promise.all(
|
|
5107
5259
|
dirNames.map(
|
|
5108
5260
|
(dirName) => ClaudecodeSkill.fromDir({
|
|
@@ -5120,9 +5272,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5120
5272
|
*/
|
|
5121
5273
|
async loadSimulatedSkills(SkillClass) {
|
|
5122
5274
|
const paths = SkillClass.getSettablePaths();
|
|
5123
|
-
const skillsDirPath = (0,
|
|
5124
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5125
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
5275
|
+
const skillsDirPath = (0, import_node_path50.join)(this.baseDir, paths.relativeDirPath);
|
|
5276
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path50.join)(skillsDirPath, "*"), { type: "dir" });
|
|
5277
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path50.basename)(path3));
|
|
5126
5278
|
const toolSkills = await Promise.all(
|
|
5127
5279
|
dirNames.map(
|
|
5128
5280
|
(dirName) => SkillClass.fromDir({
|
|
@@ -5167,11 +5319,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5167
5319
|
};
|
|
5168
5320
|
|
|
5169
5321
|
// src/features/subagents/agentsmd-subagent.ts
|
|
5170
|
-
var
|
|
5322
|
+
var import_node_path52 = require("path");
|
|
5171
5323
|
|
|
5172
5324
|
// src/features/subagents/simulated-subagent.ts
|
|
5173
|
-
var
|
|
5174
|
-
var
|
|
5325
|
+
var import_node_path51 = require("path");
|
|
5326
|
+
var import_mini22 = require("zod/mini");
|
|
5175
5327
|
|
|
5176
5328
|
// src/features/subagents/tool-subagent.ts
|
|
5177
5329
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -5206,9 +5358,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
5206
5358
|
};
|
|
5207
5359
|
|
|
5208
5360
|
// src/features/subagents/simulated-subagent.ts
|
|
5209
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
5210
|
-
name:
|
|
5211
|
-
description:
|
|
5361
|
+
var SimulatedSubagentFrontmatterSchema = import_mini22.z.object({
|
|
5362
|
+
name: import_mini22.z.string(),
|
|
5363
|
+
description: import_mini22.z.string()
|
|
5212
5364
|
});
|
|
5213
5365
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
5214
5366
|
frontmatter;
|
|
@@ -5218,7 +5370,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5218
5370
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5219
5371
|
if (!result.success) {
|
|
5220
5372
|
throw new Error(
|
|
5221
|
-
`Invalid frontmatter in ${(0,
|
|
5373
|
+
`Invalid frontmatter in ${(0, import_node_path51.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5222
5374
|
);
|
|
5223
5375
|
}
|
|
5224
5376
|
}
|
|
@@ -5269,7 +5421,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5269
5421
|
return {
|
|
5270
5422
|
success: false,
|
|
5271
5423
|
error: new Error(
|
|
5272
|
-
`Invalid frontmatter in ${(0,
|
|
5424
|
+
`Invalid frontmatter in ${(0, import_node_path51.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5273
5425
|
)
|
|
5274
5426
|
};
|
|
5275
5427
|
}
|
|
@@ -5279,7 +5431,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5279
5431
|
relativeFilePath,
|
|
5280
5432
|
validate = true
|
|
5281
5433
|
}) {
|
|
5282
|
-
const filePath = (0,
|
|
5434
|
+
const filePath = (0, import_node_path51.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
5283
5435
|
const fileContent = await readFileContent(filePath);
|
|
5284
5436
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5285
5437
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -5289,7 +5441,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5289
5441
|
return {
|
|
5290
5442
|
baseDir,
|
|
5291
5443
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
5292
|
-
relativeFilePath: (0,
|
|
5444
|
+
relativeFilePath: (0, import_node_path51.basename)(relativeFilePath),
|
|
5293
5445
|
frontmatter: result.data,
|
|
5294
5446
|
body: content.trim(),
|
|
5295
5447
|
validate
|
|
@@ -5301,7 +5453,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5301
5453
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
5302
5454
|
static getSettablePaths() {
|
|
5303
5455
|
return {
|
|
5304
|
-
relativeDirPath: (0,
|
|
5456
|
+
relativeDirPath: (0, import_node_path52.join)(".agents", "subagents")
|
|
5305
5457
|
};
|
|
5306
5458
|
}
|
|
5307
5459
|
static async fromFile(params) {
|
|
@@ -5321,11 +5473,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
5321
5473
|
};
|
|
5322
5474
|
|
|
5323
5475
|
// src/features/subagents/codexcli-subagent.ts
|
|
5324
|
-
var
|
|
5476
|
+
var import_node_path53 = require("path");
|
|
5325
5477
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
5326
5478
|
static getSettablePaths() {
|
|
5327
5479
|
return {
|
|
5328
|
-
relativeDirPath: (0,
|
|
5480
|
+
relativeDirPath: (0, import_node_path53.join)(".codex", "subagents")
|
|
5329
5481
|
};
|
|
5330
5482
|
}
|
|
5331
5483
|
static async fromFile(params) {
|
|
@@ -5345,11 +5497,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
5345
5497
|
};
|
|
5346
5498
|
|
|
5347
5499
|
// src/features/subagents/copilot-subagent.ts
|
|
5348
|
-
var
|
|
5500
|
+
var import_node_path54 = require("path");
|
|
5349
5501
|
var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
5350
5502
|
static getSettablePaths() {
|
|
5351
5503
|
return {
|
|
5352
|
-
relativeDirPath: (0,
|
|
5504
|
+
relativeDirPath: (0, import_node_path54.join)(".github", "subagents")
|
|
5353
5505
|
};
|
|
5354
5506
|
}
|
|
5355
5507
|
static async fromFile(params) {
|
|
@@ -5369,11 +5521,11 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
|
5369
5521
|
};
|
|
5370
5522
|
|
|
5371
5523
|
// src/features/subagents/cursor-subagent.ts
|
|
5372
|
-
var
|
|
5524
|
+
var import_node_path55 = require("path");
|
|
5373
5525
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
5374
5526
|
static getSettablePaths() {
|
|
5375
5527
|
return {
|
|
5376
|
-
relativeDirPath: (0,
|
|
5528
|
+
relativeDirPath: (0, import_node_path55.join)(".cursor", "subagents")
|
|
5377
5529
|
};
|
|
5378
5530
|
}
|
|
5379
5531
|
static async fromFile(params) {
|
|
@@ -5393,11 +5545,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
5393
5545
|
};
|
|
5394
5546
|
|
|
5395
5547
|
// src/features/subagents/geminicli-subagent.ts
|
|
5396
|
-
var
|
|
5548
|
+
var import_node_path56 = require("path");
|
|
5397
5549
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
5398
5550
|
static getSettablePaths() {
|
|
5399
5551
|
return {
|
|
5400
|
-
relativeDirPath: (0,
|
|
5552
|
+
relativeDirPath: (0, import_node_path56.join)(".gemini", "subagents")
|
|
5401
5553
|
};
|
|
5402
5554
|
}
|
|
5403
5555
|
static async fromFile(params) {
|
|
@@ -5417,11 +5569,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
5417
5569
|
};
|
|
5418
5570
|
|
|
5419
5571
|
// src/features/subagents/roo-subagent.ts
|
|
5420
|
-
var
|
|
5572
|
+
var import_node_path57 = require("path");
|
|
5421
5573
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
5422
5574
|
static getSettablePaths() {
|
|
5423
5575
|
return {
|
|
5424
|
-
relativeDirPath: (0,
|
|
5576
|
+
relativeDirPath: (0, import_node_path57.join)(".roo", "subagents")
|
|
5425
5577
|
};
|
|
5426
5578
|
}
|
|
5427
5579
|
static async fromFile(params) {
|
|
@@ -5441,23 +5593,23 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
5441
5593
|
};
|
|
5442
5594
|
|
|
5443
5595
|
// src/features/subagents/subagents-processor.ts
|
|
5596
|
+
var import_node_path60 = require("path");
|
|
5597
|
+
var import_mini25 = require("zod/mini");
|
|
5598
|
+
|
|
5599
|
+
// src/features/subagents/claudecode-subagent.ts
|
|
5444
5600
|
var import_node_path59 = require("path");
|
|
5445
5601
|
var import_mini24 = require("zod/mini");
|
|
5446
5602
|
|
|
5447
|
-
// src/features/subagents/
|
|
5603
|
+
// src/features/subagents/rulesync-subagent.ts
|
|
5448
5604
|
var import_node_path58 = require("path");
|
|
5449
5605
|
var import_mini23 = require("zod/mini");
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
var import_node_path57 = require("path");
|
|
5453
|
-
var import_mini22 = require("zod/mini");
|
|
5454
|
-
var RulesyncSubagentModelSchema = import_mini22.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
5455
|
-
var RulesyncSubagentFrontmatterSchema = import_mini22.z.object({
|
|
5606
|
+
var RulesyncSubagentModelSchema = import_mini23.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
5607
|
+
var RulesyncSubagentFrontmatterSchema = import_mini23.z.object({
|
|
5456
5608
|
targets: RulesyncTargetsSchema,
|
|
5457
|
-
name:
|
|
5458
|
-
description:
|
|
5459
|
-
claudecode:
|
|
5460
|
-
|
|
5609
|
+
name: import_mini23.z.string(),
|
|
5610
|
+
description: import_mini23.z.string(),
|
|
5611
|
+
claudecode: import_mini23.z.optional(
|
|
5612
|
+
import_mini23.z.object({
|
|
5461
5613
|
model: RulesyncSubagentModelSchema
|
|
5462
5614
|
})
|
|
5463
5615
|
)
|
|
@@ -5470,7 +5622,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5470
5622
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5471
5623
|
if (!result.success) {
|
|
5472
5624
|
throw new Error(
|
|
5473
|
-
`Invalid frontmatter in ${(0,
|
|
5625
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5474
5626
|
);
|
|
5475
5627
|
}
|
|
5476
5628
|
}
|
|
@@ -5503,7 +5655,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5503
5655
|
return {
|
|
5504
5656
|
success: false,
|
|
5505
5657
|
error: new Error(
|
|
5506
|
-
`Invalid frontmatter in ${(0,
|
|
5658
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5507
5659
|
)
|
|
5508
5660
|
};
|
|
5509
5661
|
}
|
|
@@ -5512,14 +5664,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5512
5664
|
relativeFilePath
|
|
5513
5665
|
}) {
|
|
5514
5666
|
const fileContent = await readFileContent(
|
|
5515
|
-
(0,
|
|
5667
|
+
(0, import_node_path58.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
5516
5668
|
);
|
|
5517
5669
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5518
5670
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5519
5671
|
if (!result.success) {
|
|
5520
5672
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
5521
5673
|
}
|
|
5522
|
-
const filename = (0,
|
|
5674
|
+
const filename = (0, import_node_path58.basename)(relativeFilePath);
|
|
5523
5675
|
return new _RulesyncSubagent({
|
|
5524
5676
|
baseDir: process.cwd(),
|
|
5525
5677
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -5531,10 +5683,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5531
5683
|
};
|
|
5532
5684
|
|
|
5533
5685
|
// src/features/subagents/claudecode-subagent.ts
|
|
5534
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
5535
|
-
name:
|
|
5536
|
-
description:
|
|
5537
|
-
model:
|
|
5686
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini24.z.object({
|
|
5687
|
+
name: import_mini24.z.string(),
|
|
5688
|
+
description: import_mini24.z.string(),
|
|
5689
|
+
model: import_mini24.z.optional(import_mini24.z.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
5538
5690
|
});
|
|
5539
5691
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
5540
5692
|
frontmatter;
|
|
@@ -5544,7 +5696,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5544
5696
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5545
5697
|
if (!result.success) {
|
|
5546
5698
|
throw new Error(
|
|
5547
|
-
`Invalid frontmatter in ${(0,
|
|
5699
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5548
5700
|
);
|
|
5549
5701
|
}
|
|
5550
5702
|
}
|
|
@@ -5556,7 +5708,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5556
5708
|
}
|
|
5557
5709
|
static getSettablePaths(_options = {}) {
|
|
5558
5710
|
return {
|
|
5559
|
-
relativeDirPath: (0,
|
|
5711
|
+
relativeDirPath: (0, import_node_path59.join)(".claude", "agents")
|
|
5560
5712
|
};
|
|
5561
5713
|
}
|
|
5562
5714
|
getFrontmatter() {
|
|
@@ -5622,7 +5774,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5622
5774
|
return {
|
|
5623
5775
|
success: false,
|
|
5624
5776
|
error: new Error(
|
|
5625
|
-
`Invalid frontmatter in ${(0,
|
|
5777
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5626
5778
|
)
|
|
5627
5779
|
};
|
|
5628
5780
|
}
|
|
@@ -5640,7 +5792,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5640
5792
|
global = false
|
|
5641
5793
|
}) {
|
|
5642
5794
|
const paths = this.getSettablePaths({ global });
|
|
5643
|
-
const filePath = (0,
|
|
5795
|
+
const filePath = (0, import_node_path59.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
5644
5796
|
const fileContent = await readFileContent(filePath);
|
|
5645
5797
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5646
5798
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -5678,7 +5830,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
5678
5830
|
"roo"
|
|
5679
5831
|
];
|
|
5680
5832
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
5681
|
-
var SubagentsProcessorToolTargetSchema =
|
|
5833
|
+
var SubagentsProcessorToolTargetSchema = import_mini25.z.enum(subagentsProcessorToolTargets);
|
|
5682
5834
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
5683
5835
|
toolTarget;
|
|
5684
5836
|
global;
|
|
@@ -5794,7 +5946,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5794
5946
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
5795
5947
|
*/
|
|
5796
5948
|
async loadRulesyncFiles() {
|
|
5797
|
-
const subagentsDir = (0,
|
|
5949
|
+
const subagentsDir = (0, import_node_path60.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
5798
5950
|
const dirExists = await directoryExists(subagentsDir);
|
|
5799
5951
|
if (!dirExists) {
|
|
5800
5952
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -5809,7 +5961,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5809
5961
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
5810
5962
|
const rulesyncSubagents = [];
|
|
5811
5963
|
for (const mdFile of mdFiles) {
|
|
5812
|
-
const filepath = (0,
|
|
5964
|
+
const filepath = (0, import_node_path60.join)(subagentsDir, mdFile);
|
|
5813
5965
|
try {
|
|
5814
5966
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
5815
5967
|
relativeFilePath: mdFile,
|
|
@@ -5927,8 +6079,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5927
6079
|
relativeDirPath,
|
|
5928
6080
|
fromFile
|
|
5929
6081
|
}) {
|
|
5930
|
-
const paths = await findFilesByGlobs((0,
|
|
5931
|
-
const subagents = await Promise.all(paths.map((path3) => fromFile((0,
|
|
6082
|
+
const paths = await findFilesByGlobs((0, import_node_path60.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
6083
|
+
const subagents = await Promise.all(paths.map((path3) => fromFile((0, import_node_path60.basename)(path3))));
|
|
5932
6084
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
5933
6085
|
return subagents;
|
|
5934
6086
|
}
|
|
@@ -5956,30 +6108,30 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5956
6108
|
};
|
|
5957
6109
|
|
|
5958
6110
|
// src/features/rules/agentsmd-rule.ts
|
|
5959
|
-
var
|
|
6111
|
+
var import_node_path63 = require("path");
|
|
5960
6112
|
|
|
5961
6113
|
// src/features/rules/tool-rule.ts
|
|
5962
|
-
var
|
|
6114
|
+
var import_node_path62 = require("path");
|
|
5963
6115
|
|
|
5964
6116
|
// src/features/rules/rulesync-rule.ts
|
|
5965
|
-
var
|
|
5966
|
-
var
|
|
5967
|
-
var RulesyncRuleFrontmatterSchema =
|
|
5968
|
-
root:
|
|
5969
|
-
targets:
|
|
5970
|
-
description:
|
|
5971
|
-
globs:
|
|
5972
|
-
agentsmd:
|
|
5973
|
-
|
|
6117
|
+
var import_node_path61 = require("path");
|
|
6118
|
+
var import_mini26 = require("zod/mini");
|
|
6119
|
+
var RulesyncRuleFrontmatterSchema = import_mini26.z.object({
|
|
6120
|
+
root: import_mini26.z.optional(import_mini26.z.optional(import_mini26.z.boolean())),
|
|
6121
|
+
targets: import_mini26.z.optional(RulesyncTargetsSchema),
|
|
6122
|
+
description: import_mini26.z.optional(import_mini26.z.string()),
|
|
6123
|
+
globs: import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string())),
|
|
6124
|
+
agentsmd: import_mini26.z.optional(
|
|
6125
|
+
import_mini26.z.object({
|
|
5974
6126
|
// @example "path/to/subproject"
|
|
5975
|
-
subprojectPath:
|
|
6127
|
+
subprojectPath: import_mini26.z.optional(import_mini26.z.string())
|
|
5976
6128
|
})
|
|
5977
6129
|
),
|
|
5978
|
-
cursor:
|
|
5979
|
-
|
|
5980
|
-
alwaysApply:
|
|
5981
|
-
description:
|
|
5982
|
-
globs:
|
|
6130
|
+
cursor: import_mini26.z.optional(
|
|
6131
|
+
import_mini26.z.object({
|
|
6132
|
+
alwaysApply: import_mini26.z.optional(import_mini26.z.boolean()),
|
|
6133
|
+
description: import_mini26.z.optional(import_mini26.z.string()),
|
|
6134
|
+
globs: import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
|
|
5983
6135
|
})
|
|
5984
6136
|
)
|
|
5985
6137
|
});
|
|
@@ -5991,7 +6143,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
5991
6143
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5992
6144
|
if (!result.success) {
|
|
5993
6145
|
throw new Error(
|
|
5994
|
-
`Invalid frontmatter in ${(0,
|
|
6146
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5995
6147
|
);
|
|
5996
6148
|
}
|
|
5997
6149
|
}
|
|
@@ -6026,7 +6178,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6026
6178
|
return {
|
|
6027
6179
|
success: false,
|
|
6028
6180
|
error: new Error(
|
|
6029
|
-
`Invalid frontmatter in ${(0,
|
|
6181
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6030
6182
|
)
|
|
6031
6183
|
};
|
|
6032
6184
|
}
|
|
@@ -6035,12 +6187,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6035
6187
|
relativeFilePath,
|
|
6036
6188
|
validate = true
|
|
6037
6189
|
}) {
|
|
6038
|
-
const legacyPath = (0,
|
|
6190
|
+
const legacyPath = (0, import_node_path61.join)(
|
|
6039
6191
|
process.cwd(),
|
|
6040
6192
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
6041
6193
|
relativeFilePath
|
|
6042
6194
|
);
|
|
6043
|
-
const recommendedPath = (0,
|
|
6195
|
+
const recommendedPath = (0, import_node_path61.join)(
|
|
6044
6196
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
6045
6197
|
relativeFilePath
|
|
6046
6198
|
);
|
|
@@ -6059,7 +6211,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6059
6211
|
agentsmd: result.data.agentsmd,
|
|
6060
6212
|
cursor: result.data.cursor
|
|
6061
6213
|
};
|
|
6062
|
-
const filename = (0,
|
|
6214
|
+
const filename = (0, import_node_path61.basename)(legacyPath);
|
|
6063
6215
|
return new _RulesyncRule({
|
|
6064
6216
|
baseDir: process.cwd(),
|
|
6065
6217
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -6073,7 +6225,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6073
6225
|
relativeFilePath,
|
|
6074
6226
|
validate = true
|
|
6075
6227
|
}) {
|
|
6076
|
-
const filePath = (0,
|
|
6228
|
+
const filePath = (0, import_node_path61.join)(
|
|
6077
6229
|
process.cwd(),
|
|
6078
6230
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
6079
6231
|
relativeFilePath
|
|
@@ -6092,7 +6244,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6092
6244
|
agentsmd: result.data.agentsmd,
|
|
6093
6245
|
cursor: result.data.cursor
|
|
6094
6246
|
};
|
|
6095
|
-
const filename = (0,
|
|
6247
|
+
const filename = (0, import_node_path61.basename)(filePath);
|
|
6096
6248
|
return new _RulesyncRule({
|
|
6097
6249
|
baseDir: process.cwd(),
|
|
6098
6250
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -6167,7 +6319,7 @@ var ToolRule = class extends ToolFile {
|
|
|
6167
6319
|
rulesyncRule,
|
|
6168
6320
|
validate = true,
|
|
6169
6321
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
6170
|
-
nonRootPath = { relativeDirPath: (0,
|
|
6322
|
+
nonRootPath = { relativeDirPath: (0, import_node_path62.join)(".agents", "memories") }
|
|
6171
6323
|
}) {
|
|
6172
6324
|
const params = this.buildToolRuleParamsDefault({
|
|
6173
6325
|
baseDir,
|
|
@@ -6178,7 +6330,7 @@ var ToolRule = class extends ToolFile {
|
|
|
6178
6330
|
});
|
|
6179
6331
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
6180
6332
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
6181
|
-
params.relativeDirPath = (0,
|
|
6333
|
+
params.relativeDirPath = (0, import_node_path62.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
6182
6334
|
params.relativeFilePath = "AGENTS.md";
|
|
6183
6335
|
}
|
|
6184
6336
|
return params;
|
|
@@ -6243,7 +6395,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6243
6395
|
relativeFilePath: "AGENTS.md"
|
|
6244
6396
|
},
|
|
6245
6397
|
nonRoot: {
|
|
6246
|
-
relativeDirPath: (0,
|
|
6398
|
+
relativeDirPath: (0, import_node_path63.join)(".agents", "memories")
|
|
6247
6399
|
}
|
|
6248
6400
|
};
|
|
6249
6401
|
}
|
|
@@ -6253,8 +6405,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6253
6405
|
validate = true
|
|
6254
6406
|
}) {
|
|
6255
6407
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
6256
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
6257
|
-
const fileContent = await readFileContent((0,
|
|
6408
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path63.join)(".agents", "memories", relativeFilePath);
|
|
6409
|
+
const fileContent = await readFileContent((0, import_node_path63.join)(baseDir, relativePath));
|
|
6258
6410
|
return new _AgentsMdRule({
|
|
6259
6411
|
baseDir,
|
|
6260
6412
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -6294,12 +6446,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6294
6446
|
};
|
|
6295
6447
|
|
|
6296
6448
|
// src/features/rules/amazonqcli-rule.ts
|
|
6297
|
-
var
|
|
6449
|
+
var import_node_path64 = require("path");
|
|
6298
6450
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
6299
6451
|
static getSettablePaths() {
|
|
6300
6452
|
return {
|
|
6301
6453
|
nonRoot: {
|
|
6302
|
-
relativeDirPath: (0,
|
|
6454
|
+
relativeDirPath: (0, import_node_path64.join)(".amazonq", "rules")
|
|
6303
6455
|
}
|
|
6304
6456
|
};
|
|
6305
6457
|
}
|
|
@@ -6309,7 +6461,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
6309
6461
|
validate = true
|
|
6310
6462
|
}) {
|
|
6311
6463
|
const fileContent = await readFileContent(
|
|
6312
|
-
(0,
|
|
6464
|
+
(0, import_node_path64.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6313
6465
|
);
|
|
6314
6466
|
return new _AmazonQCliRule({
|
|
6315
6467
|
baseDir,
|
|
@@ -6348,8 +6500,63 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
6348
6500
|
}
|
|
6349
6501
|
};
|
|
6350
6502
|
|
|
6503
|
+
// src/features/rules/antigravity-rule.ts
|
|
6504
|
+
var import_node_path65 = require("path");
|
|
6505
|
+
var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
6506
|
+
static getSettablePaths() {
|
|
6507
|
+
return {
|
|
6508
|
+
nonRoot: {
|
|
6509
|
+
relativeDirPath: (0, import_node_path65.join)(".agent", "rules")
|
|
6510
|
+
}
|
|
6511
|
+
};
|
|
6512
|
+
}
|
|
6513
|
+
static async fromFile({
|
|
6514
|
+
baseDir = process.cwd(),
|
|
6515
|
+
relativeFilePath,
|
|
6516
|
+
validate = true
|
|
6517
|
+
}) {
|
|
6518
|
+
const fileContent = await readFileContent(
|
|
6519
|
+
(0, import_node_path65.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6520
|
+
);
|
|
6521
|
+
return new _AntigravityRule({
|
|
6522
|
+
baseDir,
|
|
6523
|
+
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
6524
|
+
relativeFilePath,
|
|
6525
|
+
fileContent,
|
|
6526
|
+
validate,
|
|
6527
|
+
root: false
|
|
6528
|
+
});
|
|
6529
|
+
}
|
|
6530
|
+
static fromRulesyncRule({
|
|
6531
|
+
baseDir = process.cwd(),
|
|
6532
|
+
rulesyncRule,
|
|
6533
|
+
validate = true
|
|
6534
|
+
}) {
|
|
6535
|
+
return new _AntigravityRule(
|
|
6536
|
+
this.buildToolRuleParamsDefault({
|
|
6537
|
+
baseDir,
|
|
6538
|
+
rulesyncRule,
|
|
6539
|
+
validate,
|
|
6540
|
+
nonRootPath: this.getSettablePaths().nonRoot
|
|
6541
|
+
})
|
|
6542
|
+
);
|
|
6543
|
+
}
|
|
6544
|
+
toRulesyncRule() {
|
|
6545
|
+
return this.toRulesyncRuleDefault();
|
|
6546
|
+
}
|
|
6547
|
+
validate() {
|
|
6548
|
+
return { success: true, error: null };
|
|
6549
|
+
}
|
|
6550
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
6551
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
6552
|
+
rulesyncRule,
|
|
6553
|
+
toolTarget: "antigravity"
|
|
6554
|
+
});
|
|
6555
|
+
}
|
|
6556
|
+
};
|
|
6557
|
+
|
|
6351
6558
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
6352
|
-
var
|
|
6559
|
+
var import_node_path66 = require("path");
|
|
6353
6560
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
6354
6561
|
toRulesyncRule() {
|
|
6355
6562
|
const rulesyncFrontmatter = {
|
|
@@ -6375,7 +6582,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6375
6582
|
relativeFilePath: ".augment-guidelines"
|
|
6376
6583
|
},
|
|
6377
6584
|
nonRoot: {
|
|
6378
|
-
relativeDirPath: (0,
|
|
6585
|
+
relativeDirPath: (0, import_node_path66.join)(".augment", "rules")
|
|
6379
6586
|
}
|
|
6380
6587
|
};
|
|
6381
6588
|
}
|
|
@@ -6410,8 +6617,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6410
6617
|
}) {
|
|
6411
6618
|
const settablePaths = this.getSettablePaths();
|
|
6412
6619
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
6413
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
6414
|
-
const fileContent = await readFileContent((0,
|
|
6620
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path66.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6621
|
+
const fileContent = await readFileContent((0, import_node_path66.join)(baseDir, relativePath));
|
|
6415
6622
|
return new _AugmentcodeLegacyRule({
|
|
6416
6623
|
baseDir,
|
|
6417
6624
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -6424,7 +6631,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6424
6631
|
};
|
|
6425
6632
|
|
|
6426
6633
|
// src/features/rules/augmentcode-rule.ts
|
|
6427
|
-
var
|
|
6634
|
+
var import_node_path67 = require("path");
|
|
6428
6635
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
6429
6636
|
toRulesyncRule() {
|
|
6430
6637
|
return this.toRulesyncRuleDefault();
|
|
@@ -6432,7 +6639,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6432
6639
|
static getSettablePaths() {
|
|
6433
6640
|
return {
|
|
6434
6641
|
nonRoot: {
|
|
6435
|
-
relativeDirPath: (0,
|
|
6642
|
+
relativeDirPath: (0, import_node_path67.join)(".augment", "rules")
|
|
6436
6643
|
}
|
|
6437
6644
|
};
|
|
6438
6645
|
}
|
|
@@ -6456,7 +6663,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6456
6663
|
validate = true
|
|
6457
6664
|
}) {
|
|
6458
6665
|
const fileContent = await readFileContent(
|
|
6459
|
-
(0,
|
|
6666
|
+
(0, import_node_path67.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6460
6667
|
);
|
|
6461
6668
|
const { body: content } = parseFrontmatter(fileContent);
|
|
6462
6669
|
return new _AugmentcodeRule({
|
|
@@ -6479,7 +6686,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6479
6686
|
};
|
|
6480
6687
|
|
|
6481
6688
|
// src/features/rules/claudecode-rule.ts
|
|
6482
|
-
var
|
|
6689
|
+
var import_node_path68 = require("path");
|
|
6483
6690
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
6484
6691
|
static getSettablePaths({
|
|
6485
6692
|
global
|
|
@@ -6498,7 +6705,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6498
6705
|
relativeFilePath: "CLAUDE.md"
|
|
6499
6706
|
},
|
|
6500
6707
|
nonRoot: {
|
|
6501
|
-
relativeDirPath: (0,
|
|
6708
|
+
relativeDirPath: (0, import_node_path68.join)(".claude", "memories")
|
|
6502
6709
|
}
|
|
6503
6710
|
};
|
|
6504
6711
|
}
|
|
@@ -6513,7 +6720,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6513
6720
|
if (isRoot) {
|
|
6514
6721
|
const relativePath2 = paths.root.relativeFilePath;
|
|
6515
6722
|
const fileContent2 = await readFileContent(
|
|
6516
|
-
(0,
|
|
6723
|
+
(0, import_node_path68.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
6517
6724
|
);
|
|
6518
6725
|
return new _ClaudecodeRule({
|
|
6519
6726
|
baseDir,
|
|
@@ -6527,8 +6734,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6527
6734
|
if (!paths.nonRoot) {
|
|
6528
6735
|
throw new Error("nonRoot path is not set");
|
|
6529
6736
|
}
|
|
6530
|
-
const relativePath = (0,
|
|
6531
|
-
const fileContent = await readFileContent((0,
|
|
6737
|
+
const relativePath = (0, import_node_path68.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6738
|
+
const fileContent = await readFileContent((0, import_node_path68.join)(baseDir, relativePath));
|
|
6532
6739
|
return new _ClaudecodeRule({
|
|
6533
6740
|
baseDir,
|
|
6534
6741
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -6570,10 +6777,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6570
6777
|
};
|
|
6571
6778
|
|
|
6572
6779
|
// src/features/rules/cline-rule.ts
|
|
6573
|
-
var
|
|
6574
|
-
var
|
|
6575
|
-
var ClineRuleFrontmatterSchema =
|
|
6576
|
-
description:
|
|
6780
|
+
var import_node_path69 = require("path");
|
|
6781
|
+
var import_mini27 = require("zod/mini");
|
|
6782
|
+
var ClineRuleFrontmatterSchema = import_mini27.z.object({
|
|
6783
|
+
description: import_mini27.z.string()
|
|
6577
6784
|
});
|
|
6578
6785
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
6579
6786
|
static getSettablePaths() {
|
|
@@ -6615,7 +6822,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
6615
6822
|
validate = true
|
|
6616
6823
|
}) {
|
|
6617
6824
|
const fileContent = await readFileContent(
|
|
6618
|
-
(0,
|
|
6825
|
+
(0, import_node_path69.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6619
6826
|
);
|
|
6620
6827
|
return new _ClineRule({
|
|
6621
6828
|
baseDir,
|
|
@@ -6628,7 +6835,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
6628
6835
|
};
|
|
6629
6836
|
|
|
6630
6837
|
// src/features/rules/codexcli-rule.ts
|
|
6631
|
-
var
|
|
6838
|
+
var import_node_path70 = require("path");
|
|
6632
6839
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
6633
6840
|
static getSettablePaths({
|
|
6634
6841
|
global
|
|
@@ -6647,7 +6854,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6647
6854
|
relativeFilePath: "AGENTS.md"
|
|
6648
6855
|
},
|
|
6649
6856
|
nonRoot: {
|
|
6650
|
-
relativeDirPath: (0,
|
|
6857
|
+
relativeDirPath: (0, import_node_path70.join)(".codex", "memories")
|
|
6651
6858
|
}
|
|
6652
6859
|
};
|
|
6653
6860
|
}
|
|
@@ -6662,7 +6869,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6662
6869
|
if (isRoot) {
|
|
6663
6870
|
const relativePath2 = paths.root.relativeFilePath;
|
|
6664
6871
|
const fileContent2 = await readFileContent(
|
|
6665
|
-
(0,
|
|
6872
|
+
(0, import_node_path70.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
6666
6873
|
);
|
|
6667
6874
|
return new _CodexcliRule({
|
|
6668
6875
|
baseDir,
|
|
@@ -6676,8 +6883,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6676
6883
|
if (!paths.nonRoot) {
|
|
6677
6884
|
throw new Error("nonRoot path is not set");
|
|
6678
6885
|
}
|
|
6679
|
-
const relativePath = (0,
|
|
6680
|
-
const fileContent = await readFileContent((0,
|
|
6886
|
+
const relativePath = (0, import_node_path70.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6887
|
+
const fileContent = await readFileContent((0, import_node_path70.join)(baseDir, relativePath));
|
|
6681
6888
|
return new _CodexcliRule({
|
|
6682
6889
|
baseDir,
|
|
6683
6890
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -6719,11 +6926,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6719
6926
|
};
|
|
6720
6927
|
|
|
6721
6928
|
// src/features/rules/copilot-rule.ts
|
|
6722
|
-
var
|
|
6723
|
-
var
|
|
6724
|
-
var CopilotRuleFrontmatterSchema =
|
|
6725
|
-
description:
|
|
6726
|
-
applyTo:
|
|
6929
|
+
var import_node_path71 = require("path");
|
|
6930
|
+
var import_mini28 = require("zod/mini");
|
|
6931
|
+
var CopilotRuleFrontmatterSchema = import_mini28.z.object({
|
|
6932
|
+
description: import_mini28.z.optional(import_mini28.z.string()),
|
|
6933
|
+
applyTo: import_mini28.z.optional(import_mini28.z.string())
|
|
6727
6934
|
});
|
|
6728
6935
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
6729
6936
|
frontmatter;
|
|
@@ -6735,7 +6942,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6735
6942
|
relativeFilePath: "copilot-instructions.md"
|
|
6736
6943
|
},
|
|
6737
6944
|
nonRoot: {
|
|
6738
|
-
relativeDirPath: (0,
|
|
6945
|
+
relativeDirPath: (0, import_node_path71.join)(".github", "instructions")
|
|
6739
6946
|
}
|
|
6740
6947
|
};
|
|
6741
6948
|
}
|
|
@@ -6744,7 +6951,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6744
6951
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6745
6952
|
if (!result.success) {
|
|
6746
6953
|
throw new Error(
|
|
6747
|
-
`Invalid frontmatter in ${(0,
|
|
6954
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6748
6955
|
);
|
|
6749
6956
|
}
|
|
6750
6957
|
}
|
|
@@ -6822,11 +7029,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6822
7029
|
validate = true
|
|
6823
7030
|
}) {
|
|
6824
7031
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
6825
|
-
const relativePath = isRoot ? (0,
|
|
7032
|
+
const relativePath = isRoot ? (0, import_node_path71.join)(
|
|
6826
7033
|
this.getSettablePaths().root.relativeDirPath,
|
|
6827
7034
|
this.getSettablePaths().root.relativeFilePath
|
|
6828
|
-
) : (0,
|
|
6829
|
-
const fileContent = await readFileContent((0,
|
|
7035
|
+
) : (0, import_node_path71.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
7036
|
+
const fileContent = await readFileContent((0, import_node_path71.join)(baseDir, relativePath));
|
|
6830
7037
|
if (isRoot) {
|
|
6831
7038
|
return new _CopilotRule({
|
|
6832
7039
|
baseDir,
|
|
@@ -6845,7 +7052,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6845
7052
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6846
7053
|
if (!result.success) {
|
|
6847
7054
|
throw new Error(
|
|
6848
|
-
`Invalid frontmatter in ${(0,
|
|
7055
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
6849
7056
|
);
|
|
6850
7057
|
}
|
|
6851
7058
|
return new _CopilotRule({
|
|
@@ -6869,7 +7076,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6869
7076
|
return {
|
|
6870
7077
|
success: false,
|
|
6871
7078
|
error: new Error(
|
|
6872
|
-
`Invalid frontmatter in ${(0,
|
|
7079
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6873
7080
|
)
|
|
6874
7081
|
};
|
|
6875
7082
|
}
|
|
@@ -6889,12 +7096,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6889
7096
|
};
|
|
6890
7097
|
|
|
6891
7098
|
// src/features/rules/cursor-rule.ts
|
|
6892
|
-
var
|
|
6893
|
-
var
|
|
6894
|
-
var CursorRuleFrontmatterSchema =
|
|
6895
|
-
description:
|
|
6896
|
-
globs:
|
|
6897
|
-
alwaysApply:
|
|
7099
|
+
var import_node_path72 = require("path");
|
|
7100
|
+
var import_mini29 = require("zod/mini");
|
|
7101
|
+
var CursorRuleFrontmatterSchema = import_mini29.z.object({
|
|
7102
|
+
description: import_mini29.z.optional(import_mini29.z.string()),
|
|
7103
|
+
globs: import_mini29.z.optional(import_mini29.z.string()),
|
|
7104
|
+
alwaysApply: import_mini29.z.optional(import_mini29.z.boolean())
|
|
6898
7105
|
});
|
|
6899
7106
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
6900
7107
|
frontmatter;
|
|
@@ -6902,7 +7109,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
6902
7109
|
static getSettablePaths() {
|
|
6903
7110
|
return {
|
|
6904
7111
|
nonRoot: {
|
|
6905
|
-
relativeDirPath: (0,
|
|
7112
|
+
relativeDirPath: (0, import_node_path72.join)(".cursor", "rules")
|
|
6906
7113
|
}
|
|
6907
7114
|
};
|
|
6908
7115
|
}
|
|
@@ -6911,7 +7118,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
6911
7118
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6912
7119
|
if (!result.success) {
|
|
6913
7120
|
throw new Error(
|
|
6914
|
-
`Invalid frontmatter in ${(0,
|
|
7121
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6915
7122
|
);
|
|
6916
7123
|
}
|
|
6917
7124
|
}
|
|
@@ -7028,19 +7235,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7028
7235
|
validate = true
|
|
7029
7236
|
}) {
|
|
7030
7237
|
const fileContent = await readFileContent(
|
|
7031
|
-
(0,
|
|
7238
|
+
(0, import_node_path72.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7032
7239
|
);
|
|
7033
7240
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
7034
7241
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
7035
7242
|
if (!result.success) {
|
|
7036
7243
|
throw new Error(
|
|
7037
|
-
`Invalid frontmatter in ${(0,
|
|
7244
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
7038
7245
|
);
|
|
7039
7246
|
}
|
|
7040
7247
|
return new _CursorRule({
|
|
7041
7248
|
baseDir,
|
|
7042
7249
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
7043
|
-
relativeFilePath: (0,
|
|
7250
|
+
relativeFilePath: (0, import_node_path72.basename)(relativeFilePath),
|
|
7044
7251
|
frontmatter: result.data,
|
|
7045
7252
|
body: content.trim(),
|
|
7046
7253
|
validate
|
|
@@ -7057,7 +7264,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7057
7264
|
return {
|
|
7058
7265
|
success: false,
|
|
7059
7266
|
error: new Error(
|
|
7060
|
-
`Invalid frontmatter in ${(0,
|
|
7267
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7061
7268
|
)
|
|
7062
7269
|
};
|
|
7063
7270
|
}
|
|
@@ -7077,7 +7284,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7077
7284
|
};
|
|
7078
7285
|
|
|
7079
7286
|
// src/features/rules/geminicli-rule.ts
|
|
7080
|
-
var
|
|
7287
|
+
var import_node_path73 = require("path");
|
|
7081
7288
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
7082
7289
|
static getSettablePaths({
|
|
7083
7290
|
global
|
|
@@ -7096,7 +7303,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7096
7303
|
relativeFilePath: "GEMINI.md"
|
|
7097
7304
|
},
|
|
7098
7305
|
nonRoot: {
|
|
7099
|
-
relativeDirPath: (0,
|
|
7306
|
+
relativeDirPath: (0, import_node_path73.join)(".gemini", "memories")
|
|
7100
7307
|
}
|
|
7101
7308
|
};
|
|
7102
7309
|
}
|
|
@@ -7111,7 +7318,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7111
7318
|
if (isRoot) {
|
|
7112
7319
|
const relativePath2 = paths.root.relativeFilePath;
|
|
7113
7320
|
const fileContent2 = await readFileContent(
|
|
7114
|
-
(0,
|
|
7321
|
+
(0, import_node_path73.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
7115
7322
|
);
|
|
7116
7323
|
return new _GeminiCliRule({
|
|
7117
7324
|
baseDir,
|
|
@@ -7125,8 +7332,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7125
7332
|
if (!paths.nonRoot) {
|
|
7126
7333
|
throw new Error("nonRoot path is not set");
|
|
7127
7334
|
}
|
|
7128
|
-
const relativePath = (0,
|
|
7129
|
-
const fileContent = await readFileContent((0,
|
|
7335
|
+
const relativePath = (0, import_node_path73.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
7336
|
+
const fileContent = await readFileContent((0, import_node_path73.join)(baseDir, relativePath));
|
|
7130
7337
|
return new _GeminiCliRule({
|
|
7131
7338
|
baseDir,
|
|
7132
7339
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -7168,7 +7375,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7168
7375
|
};
|
|
7169
7376
|
|
|
7170
7377
|
// src/features/rules/junie-rule.ts
|
|
7171
|
-
var
|
|
7378
|
+
var import_node_path74 = require("path");
|
|
7172
7379
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
7173
7380
|
static getSettablePaths() {
|
|
7174
7381
|
return {
|
|
@@ -7177,7 +7384,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7177
7384
|
relativeFilePath: "guidelines.md"
|
|
7178
7385
|
},
|
|
7179
7386
|
nonRoot: {
|
|
7180
|
-
relativeDirPath: (0,
|
|
7387
|
+
relativeDirPath: (0, import_node_path74.join)(".junie", "memories")
|
|
7181
7388
|
}
|
|
7182
7389
|
};
|
|
7183
7390
|
}
|
|
@@ -7187,8 +7394,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7187
7394
|
validate = true
|
|
7188
7395
|
}) {
|
|
7189
7396
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
7190
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
7191
|
-
const fileContent = await readFileContent((0,
|
|
7397
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path74.join)(".junie", "memories", relativeFilePath);
|
|
7398
|
+
const fileContent = await readFileContent((0, import_node_path74.join)(baseDir, relativePath));
|
|
7192
7399
|
return new _JunieRule({
|
|
7193
7400
|
baseDir,
|
|
7194
7401
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7228,12 +7435,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7228
7435
|
};
|
|
7229
7436
|
|
|
7230
7437
|
// src/features/rules/kiro-rule.ts
|
|
7231
|
-
var
|
|
7438
|
+
var import_node_path75 = require("path");
|
|
7232
7439
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
7233
7440
|
static getSettablePaths() {
|
|
7234
7441
|
return {
|
|
7235
7442
|
nonRoot: {
|
|
7236
|
-
relativeDirPath: (0,
|
|
7443
|
+
relativeDirPath: (0, import_node_path75.join)(".kiro", "steering")
|
|
7237
7444
|
}
|
|
7238
7445
|
};
|
|
7239
7446
|
}
|
|
@@ -7243,7 +7450,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
7243
7450
|
validate = true
|
|
7244
7451
|
}) {
|
|
7245
7452
|
const fileContent = await readFileContent(
|
|
7246
|
-
(0,
|
|
7453
|
+
(0, import_node_path75.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7247
7454
|
);
|
|
7248
7455
|
return new _KiroRule({
|
|
7249
7456
|
baseDir,
|
|
@@ -7283,7 +7490,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
7283
7490
|
};
|
|
7284
7491
|
|
|
7285
7492
|
// src/features/rules/opencode-rule.ts
|
|
7286
|
-
var
|
|
7493
|
+
var import_node_path76 = require("path");
|
|
7287
7494
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
7288
7495
|
static getSettablePaths() {
|
|
7289
7496
|
return {
|
|
@@ -7292,7 +7499,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7292
7499
|
relativeFilePath: "AGENTS.md"
|
|
7293
7500
|
},
|
|
7294
7501
|
nonRoot: {
|
|
7295
|
-
relativeDirPath: (0,
|
|
7502
|
+
relativeDirPath: (0, import_node_path76.join)(".opencode", "memories")
|
|
7296
7503
|
}
|
|
7297
7504
|
};
|
|
7298
7505
|
}
|
|
@@ -7302,8 +7509,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7302
7509
|
validate = true
|
|
7303
7510
|
}) {
|
|
7304
7511
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
7305
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
7306
|
-
const fileContent = await readFileContent((0,
|
|
7512
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path76.join)(".opencode", "memories", relativeFilePath);
|
|
7513
|
+
const fileContent = await readFileContent((0, import_node_path76.join)(baseDir, relativePath));
|
|
7307
7514
|
return new _OpenCodeRule({
|
|
7308
7515
|
baseDir,
|
|
7309
7516
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7343,7 +7550,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7343
7550
|
};
|
|
7344
7551
|
|
|
7345
7552
|
// src/features/rules/qwencode-rule.ts
|
|
7346
|
-
var
|
|
7553
|
+
var import_node_path77 = require("path");
|
|
7347
7554
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
7348
7555
|
static getSettablePaths() {
|
|
7349
7556
|
return {
|
|
@@ -7352,7 +7559,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7352
7559
|
relativeFilePath: "QWEN.md"
|
|
7353
7560
|
},
|
|
7354
7561
|
nonRoot: {
|
|
7355
|
-
relativeDirPath: (0,
|
|
7562
|
+
relativeDirPath: (0, import_node_path77.join)(".qwen", "memories")
|
|
7356
7563
|
}
|
|
7357
7564
|
};
|
|
7358
7565
|
}
|
|
@@ -7362,8 +7569,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7362
7569
|
validate = true
|
|
7363
7570
|
}) {
|
|
7364
7571
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
7365
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
7366
|
-
const fileContent = await readFileContent((0,
|
|
7572
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path77.join)(".qwen", "memories", relativeFilePath);
|
|
7573
|
+
const fileContent = await readFileContent((0, import_node_path77.join)(baseDir, relativePath));
|
|
7367
7574
|
return new _QwencodeRule({
|
|
7368
7575
|
baseDir,
|
|
7369
7576
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7400,12 +7607,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7400
7607
|
};
|
|
7401
7608
|
|
|
7402
7609
|
// src/features/rules/roo-rule.ts
|
|
7403
|
-
var
|
|
7610
|
+
var import_node_path78 = require("path");
|
|
7404
7611
|
var RooRule = class _RooRule extends ToolRule {
|
|
7405
7612
|
static getSettablePaths() {
|
|
7406
7613
|
return {
|
|
7407
7614
|
nonRoot: {
|
|
7408
|
-
relativeDirPath: (0,
|
|
7615
|
+
relativeDirPath: (0, import_node_path78.join)(".roo", "rules")
|
|
7409
7616
|
}
|
|
7410
7617
|
};
|
|
7411
7618
|
}
|
|
@@ -7415,7 +7622,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
7415
7622
|
validate = true
|
|
7416
7623
|
}) {
|
|
7417
7624
|
const fileContent = await readFileContent(
|
|
7418
|
-
(0,
|
|
7625
|
+
(0, import_node_path78.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7419
7626
|
);
|
|
7420
7627
|
return new _RooRule({
|
|
7421
7628
|
baseDir,
|
|
@@ -7470,7 +7677,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
7470
7677
|
};
|
|
7471
7678
|
|
|
7472
7679
|
// src/features/rules/warp-rule.ts
|
|
7473
|
-
var
|
|
7680
|
+
var import_node_path79 = require("path");
|
|
7474
7681
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
7475
7682
|
constructor({ fileContent, root, ...rest }) {
|
|
7476
7683
|
super({
|
|
@@ -7486,7 +7693,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7486
7693
|
relativeFilePath: "WARP.md"
|
|
7487
7694
|
},
|
|
7488
7695
|
nonRoot: {
|
|
7489
|
-
relativeDirPath: (0,
|
|
7696
|
+
relativeDirPath: (0, import_node_path79.join)(".warp", "memories")
|
|
7490
7697
|
}
|
|
7491
7698
|
};
|
|
7492
7699
|
}
|
|
@@ -7496,8 +7703,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7496
7703
|
validate = true
|
|
7497
7704
|
}) {
|
|
7498
7705
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
7499
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
7500
|
-
const fileContent = await readFileContent((0,
|
|
7706
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path79.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
7707
|
+
const fileContent = await readFileContent((0, import_node_path79.join)(baseDir, relativePath));
|
|
7501
7708
|
return new _WarpRule({
|
|
7502
7709
|
baseDir,
|
|
7503
7710
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -7537,12 +7744,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7537
7744
|
};
|
|
7538
7745
|
|
|
7539
7746
|
// src/features/rules/windsurf-rule.ts
|
|
7540
|
-
var
|
|
7747
|
+
var import_node_path80 = require("path");
|
|
7541
7748
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
7542
7749
|
static getSettablePaths() {
|
|
7543
7750
|
return {
|
|
7544
7751
|
nonRoot: {
|
|
7545
|
-
relativeDirPath: (0,
|
|
7752
|
+
relativeDirPath: (0, import_node_path80.join)(".windsurf", "rules")
|
|
7546
7753
|
}
|
|
7547
7754
|
};
|
|
7548
7755
|
}
|
|
@@ -7552,7 +7759,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
7552
7759
|
validate = true
|
|
7553
7760
|
}) {
|
|
7554
7761
|
const fileContent = await readFileContent(
|
|
7555
|
-
(0,
|
|
7762
|
+
(0, import_node_path80.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7556
7763
|
);
|
|
7557
7764
|
return new _WindsurfRule({
|
|
7558
7765
|
baseDir,
|
|
@@ -7594,6 +7801,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
7594
7801
|
var rulesProcessorToolTargets = [
|
|
7595
7802
|
"agentsmd",
|
|
7596
7803
|
"amazonqcli",
|
|
7804
|
+
"antigravity",
|
|
7597
7805
|
"augmentcode",
|
|
7598
7806
|
"augmentcode-legacy",
|
|
7599
7807
|
"claudecode",
|
|
@@ -7610,7 +7818,7 @@ var rulesProcessorToolTargets = [
|
|
|
7610
7818
|
"warp",
|
|
7611
7819
|
"windsurf"
|
|
7612
7820
|
];
|
|
7613
|
-
var RulesProcessorToolTargetSchema =
|
|
7821
|
+
var RulesProcessorToolTargetSchema = import_mini30.z.enum(rulesProcessorToolTargets);
|
|
7614
7822
|
var rulesProcessorToolTargetsGlobal = [
|
|
7615
7823
|
"claudecode",
|
|
7616
7824
|
"codexcli",
|
|
@@ -7667,6 +7875,15 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7667
7875
|
rulesyncRule,
|
|
7668
7876
|
validate: true
|
|
7669
7877
|
});
|
|
7878
|
+
case "antigravity":
|
|
7879
|
+
if (!AntigravityRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
7880
|
+
return null;
|
|
7881
|
+
}
|
|
7882
|
+
return AntigravityRule.fromRulesyncRule({
|
|
7883
|
+
baseDir: this.baseDir,
|
|
7884
|
+
rulesyncRule,
|
|
7885
|
+
validate: true
|
|
7886
|
+
});
|
|
7670
7887
|
case "augmentcode":
|
|
7671
7888
|
if (!AugmentcodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
7672
7889
|
return null;
|
|
@@ -7964,10 +8181,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7964
8181
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
7965
8182
|
*/
|
|
7966
8183
|
async loadRulesyncFiles() {
|
|
7967
|
-
const files = await findFilesByGlobs((0,
|
|
8184
|
+
const files = await findFilesByGlobs((0, import_node_path81.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
7968
8185
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
7969
8186
|
const rulesyncRules = await Promise.all(
|
|
7970
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
8187
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path81.basename)(file) }))
|
|
7971
8188
|
);
|
|
7972
8189
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
7973
8190
|
if (rootRules.length > 1) {
|
|
@@ -7985,10 +8202,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7985
8202
|
return rulesyncRules;
|
|
7986
8203
|
}
|
|
7987
8204
|
async loadRulesyncFilesLegacy() {
|
|
7988
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
8205
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path81.join)(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
7989
8206
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
7990
8207
|
return Promise.all(
|
|
7991
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
8208
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path81.basename)(file) }))
|
|
7992
8209
|
);
|
|
7993
8210
|
}
|
|
7994
8211
|
/**
|
|
@@ -8051,13 +8268,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
8051
8268
|
return [];
|
|
8052
8269
|
}
|
|
8053
8270
|
const rootFilePaths = await findFilesByGlobs(
|
|
8054
|
-
(0,
|
|
8271
|
+
(0, import_node_path81.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
8055
8272
|
);
|
|
8056
8273
|
return await Promise.all(
|
|
8057
8274
|
rootFilePaths.map(
|
|
8058
8275
|
(filePath) => root.fromFile({
|
|
8059
8276
|
baseDir: this.baseDir,
|
|
8060
|
-
relativeFilePath: (0,
|
|
8277
|
+
relativeFilePath: (0, import_node_path81.basename)(filePath),
|
|
8061
8278
|
global: this.global
|
|
8062
8279
|
})
|
|
8063
8280
|
)
|
|
@@ -8069,13 +8286,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
8069
8286
|
return [];
|
|
8070
8287
|
}
|
|
8071
8288
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
8072
|
-
(0,
|
|
8289
|
+
(0, import_node_path81.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
8073
8290
|
);
|
|
8074
8291
|
return await Promise.all(
|
|
8075
8292
|
nonRootFilePaths.map(
|
|
8076
8293
|
(filePath) => nonRoot.fromFile({
|
|
8077
8294
|
baseDir: this.baseDir,
|
|
8078
|
-
relativeFilePath: (0,
|
|
8295
|
+
relativeFilePath: (0, import_node_path81.basename)(filePath),
|
|
8079
8296
|
global: this.global
|
|
8080
8297
|
})
|
|
8081
8298
|
)
|
|
@@ -8446,21 +8663,21 @@ s/<command> [arguments]
|
|
|
8446
8663
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
8447
8664
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
8448
8665
|
|
|
8449
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
8666
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path81.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
8450
8667
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
8451
8668
|
|
|
8452
8669
|
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.
|
|
8453
8670
|
|
|
8454
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
8671
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path81.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
8455
8672
|
|
|
8456
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
8673
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path81.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
8457
8674
|
const skillsSection = skills ? `## Simulated Skills
|
|
8458
8675
|
|
|
8459
8676
|
Simulated skills are specialized capabilities that can be invoked to handle specific types of tasks.
|
|
8460
8677
|
|
|
8461
|
-
When users invoke a simulated skill, look for the corresponding SKILL.md file in \`${(0,
|
|
8678
|
+
When users invoke a simulated skill, look for the corresponding SKILL.md file in \`${(0, import_node_path81.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "{skill}/SKILL.md")}\` and execute its contents as the block of operations.
|
|
8462
8679
|
|
|
8463
|
-
For example, if the user instructs \`Use the skill example-skill to achieve something\`, look for \`${(0,
|
|
8680
|
+
For example, if the user instructs \`Use the skill example-skill to achieve something\`, look for \`${(0, import_node_path81.join)(RULESYNC_SKILLS_RELATIVE_DIR_PATH, "example-skill/SKILL.md")}\` and execute its contents.
|
|
8464
8681
|
|
|
8465
8682
|
Additionally, you should proactively consider using available skills when they would help accomplish a task more effectively, even if the user doesn't explicitly request them.` : "";
|
|
8466
8683
|
const result = [
|
|
@@ -8722,15 +8939,14 @@ async function generateSkills(config) {
|
|
|
8722
8939
|
}
|
|
8723
8940
|
|
|
8724
8941
|
// src/cli/commands/gitignore.ts
|
|
8725
|
-
var
|
|
8942
|
+
var import_node_path82 = require("path");
|
|
8726
8943
|
var gitignoreCommand = async () => {
|
|
8727
|
-
const gitignorePath = (0,
|
|
8944
|
+
const gitignorePath = (0, import_node_path82.join)(process.cwd(), ".gitignore");
|
|
8728
8945
|
const rulesFilesToIgnore = [
|
|
8729
8946
|
"# Generated by rulesync - AI tool configuration files",
|
|
8730
8947
|
// AGENTS.md
|
|
8731
8948
|
"**/AGENTS.md",
|
|
8732
8949
|
"**/.agents/",
|
|
8733
|
-
"**/.agents/skills/",
|
|
8734
8950
|
// Amazon Q
|
|
8735
8951
|
"**/.amazonq/",
|
|
8736
8952
|
// Augment
|
|
@@ -8756,9 +8972,6 @@ var gitignoreCommand = async () => {
|
|
|
8756
8972
|
// Cursor
|
|
8757
8973
|
"**/.cursor/",
|
|
8758
8974
|
"**/.cursorignore",
|
|
8759
|
-
"**/.cursor/mcp.json",
|
|
8760
|
-
"**/.cursor/subagents/",
|
|
8761
|
-
"**/.cursor/skills/",
|
|
8762
8975
|
// Gemini
|
|
8763
8976
|
"**/GEMINI.md",
|
|
8764
8977
|
"**/.gemini/memories/",
|
|
@@ -8794,7 +9007,8 @@ var gitignoreCommand = async () => {
|
|
|
8794
9007
|
"**/.warp/",
|
|
8795
9008
|
"**/WARP.md",
|
|
8796
9009
|
// Others
|
|
8797
|
-
"**/modular-mcp.json"
|
|
9010
|
+
"**/modular-mcp.json",
|
|
9011
|
+
"!.rulesync/.aiignore"
|
|
8798
9012
|
];
|
|
8799
9013
|
let gitignoreContent = "";
|
|
8800
9014
|
if (await fileExists(gitignorePath)) {
|
|
@@ -9000,7 +9214,7 @@ async function importSkills(config, tool) {
|
|
|
9000
9214
|
}
|
|
9001
9215
|
|
|
9002
9216
|
// src/cli/commands/init.ts
|
|
9003
|
-
var
|
|
9217
|
+
var import_node_path83 = require("path");
|
|
9004
9218
|
async function initCommand() {
|
|
9005
9219
|
logger.info("Initializing rulesync...");
|
|
9006
9220
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -9163,14 +9377,14 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9163
9377
|
await ensureDir(commandPaths.relativeDirPath);
|
|
9164
9378
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
9165
9379
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
9166
|
-
const ruleFilepath = (0,
|
|
9380
|
+
const ruleFilepath = (0, import_node_path83.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
9167
9381
|
if (!await fileExists(ruleFilepath)) {
|
|
9168
9382
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
9169
9383
|
logger.success(`Created ${ruleFilepath}`);
|
|
9170
9384
|
} else {
|
|
9171
9385
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
9172
9386
|
}
|
|
9173
|
-
const mcpFilepath = (0,
|
|
9387
|
+
const mcpFilepath = (0, import_node_path83.join)(
|
|
9174
9388
|
mcpPaths.recommended.relativeDirPath,
|
|
9175
9389
|
mcpPaths.recommended.relativeFilePath
|
|
9176
9390
|
);
|
|
@@ -9180,21 +9394,21 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9180
9394
|
} else {
|
|
9181
9395
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
9182
9396
|
}
|
|
9183
|
-
const commandFilepath = (0,
|
|
9397
|
+
const commandFilepath = (0, import_node_path83.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
9184
9398
|
if (!await fileExists(commandFilepath)) {
|
|
9185
9399
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
9186
9400
|
logger.success(`Created ${commandFilepath}`);
|
|
9187
9401
|
} else {
|
|
9188
9402
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
9189
9403
|
}
|
|
9190
|
-
const subagentFilepath = (0,
|
|
9404
|
+
const subagentFilepath = (0, import_node_path83.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
9191
9405
|
if (!await fileExists(subagentFilepath)) {
|
|
9192
9406
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
9193
9407
|
logger.success(`Created ${subagentFilepath}`);
|
|
9194
9408
|
} else {
|
|
9195
9409
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
9196
9410
|
}
|
|
9197
|
-
const ignoreFilepath = (0,
|
|
9411
|
+
const ignoreFilepath = (0, import_node_path83.join)(
|
|
9198
9412
|
ignorePaths.recommended.relativeDirPath,
|
|
9199
9413
|
ignorePaths.recommended.relativeFilePath
|
|
9200
9414
|
);
|
|
@@ -9210,12 +9424,12 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9210
9424
|
var import_fastmcp = require("fastmcp");
|
|
9211
9425
|
|
|
9212
9426
|
// src/mcp/commands.ts
|
|
9213
|
-
var
|
|
9214
|
-
var
|
|
9427
|
+
var import_node_path84 = require("path");
|
|
9428
|
+
var import_mini31 = require("zod/mini");
|
|
9215
9429
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
9216
9430
|
var maxCommandsCount = 1e3;
|
|
9217
9431
|
async function listCommands() {
|
|
9218
|
-
const commandsDir = (0,
|
|
9432
|
+
const commandsDir = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
9219
9433
|
try {
|
|
9220
9434
|
const files = await listDirectoryFiles(commandsDir);
|
|
9221
9435
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9227,7 +9441,7 @@ async function listCommands() {
|
|
|
9227
9441
|
});
|
|
9228
9442
|
const frontmatter = command.getFrontmatter();
|
|
9229
9443
|
return {
|
|
9230
|
-
relativePathFromCwd: (0,
|
|
9444
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
9231
9445
|
frontmatter
|
|
9232
9446
|
};
|
|
9233
9447
|
} catch (error) {
|
|
@@ -9247,13 +9461,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
9247
9461
|
relativePath: relativePathFromCwd,
|
|
9248
9462
|
intendedRootDir: process.cwd()
|
|
9249
9463
|
});
|
|
9250
|
-
const filename = (0,
|
|
9464
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9251
9465
|
try {
|
|
9252
9466
|
const command = await RulesyncCommand.fromFile({
|
|
9253
9467
|
relativeFilePath: filename
|
|
9254
9468
|
});
|
|
9255
9469
|
return {
|
|
9256
|
-
relativePathFromCwd: (0,
|
|
9470
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
9257
9471
|
frontmatter: command.getFrontmatter(),
|
|
9258
9472
|
body: command.getBody()
|
|
9259
9473
|
};
|
|
@@ -9272,7 +9486,7 @@ async function putCommand({
|
|
|
9272
9486
|
relativePath: relativePathFromCwd,
|
|
9273
9487
|
intendedRootDir: process.cwd()
|
|
9274
9488
|
});
|
|
9275
|
-
const filename = (0,
|
|
9489
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9276
9490
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9277
9491
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
9278
9492
|
throw new Error(
|
|
@@ -9282,7 +9496,7 @@ async function putCommand({
|
|
|
9282
9496
|
try {
|
|
9283
9497
|
const existingCommands = await listCommands();
|
|
9284
9498
|
const isUpdate = existingCommands.some(
|
|
9285
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
9499
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
9286
9500
|
);
|
|
9287
9501
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
9288
9502
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -9297,11 +9511,11 @@ async function putCommand({
|
|
|
9297
9511
|
fileContent,
|
|
9298
9512
|
validate: true
|
|
9299
9513
|
});
|
|
9300
|
-
const commandsDir = (0,
|
|
9514
|
+
const commandsDir = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
9301
9515
|
await ensureDir(commandsDir);
|
|
9302
9516
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
9303
9517
|
return {
|
|
9304
|
-
relativePathFromCwd: (0,
|
|
9518
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
9305
9519
|
frontmatter: command.getFrontmatter(),
|
|
9306
9520
|
body: command.getBody()
|
|
9307
9521
|
};
|
|
@@ -9316,12 +9530,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
9316
9530
|
relativePath: relativePathFromCwd,
|
|
9317
9531
|
intendedRootDir: process.cwd()
|
|
9318
9532
|
});
|
|
9319
|
-
const filename = (0,
|
|
9320
|
-
const fullPath = (0,
|
|
9533
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9534
|
+
const fullPath = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
9321
9535
|
try {
|
|
9322
9536
|
await removeFile(fullPath);
|
|
9323
9537
|
return {
|
|
9324
|
-
relativePathFromCwd: (0,
|
|
9538
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
9325
9539
|
};
|
|
9326
9540
|
} catch (error) {
|
|
9327
9541
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -9330,23 +9544,23 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
9330
9544
|
}
|
|
9331
9545
|
}
|
|
9332
9546
|
var commandToolSchemas = {
|
|
9333
|
-
listCommands:
|
|
9334
|
-
getCommand:
|
|
9335
|
-
relativePathFromCwd:
|
|
9547
|
+
listCommands: import_mini31.z.object({}),
|
|
9548
|
+
getCommand: import_mini31.z.object({
|
|
9549
|
+
relativePathFromCwd: import_mini31.z.string()
|
|
9336
9550
|
}),
|
|
9337
|
-
putCommand:
|
|
9338
|
-
relativePathFromCwd:
|
|
9551
|
+
putCommand: import_mini31.z.object({
|
|
9552
|
+
relativePathFromCwd: import_mini31.z.string(),
|
|
9339
9553
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
9340
|
-
body:
|
|
9554
|
+
body: import_mini31.z.string()
|
|
9341
9555
|
}),
|
|
9342
|
-
deleteCommand:
|
|
9343
|
-
relativePathFromCwd:
|
|
9556
|
+
deleteCommand: import_mini31.z.object({
|
|
9557
|
+
relativePathFromCwd: import_mini31.z.string()
|
|
9344
9558
|
})
|
|
9345
9559
|
};
|
|
9346
9560
|
var commandTools = {
|
|
9347
9561
|
listCommands: {
|
|
9348
9562
|
name: "listCommands",
|
|
9349
|
-
description: `List all commands from ${(0,
|
|
9563
|
+
description: `List all commands from ${(0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9350
9564
|
parameters: commandToolSchemas.listCommands,
|
|
9351
9565
|
execute: async () => {
|
|
9352
9566
|
const commands = await listCommands();
|
|
@@ -9388,11 +9602,11 @@ var commandTools = {
|
|
|
9388
9602
|
};
|
|
9389
9603
|
|
|
9390
9604
|
// src/mcp/ignore.ts
|
|
9391
|
-
var
|
|
9392
|
-
var
|
|
9605
|
+
var import_node_path85 = require("path");
|
|
9606
|
+
var import_mini32 = require("zod/mini");
|
|
9393
9607
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
9394
9608
|
async function getIgnoreFile() {
|
|
9395
|
-
const ignoreFilePath = (0,
|
|
9609
|
+
const ignoreFilePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9396
9610
|
try {
|
|
9397
9611
|
const content = await readFileContent(ignoreFilePath);
|
|
9398
9612
|
return {
|
|
@@ -9406,7 +9620,7 @@ async function getIgnoreFile() {
|
|
|
9406
9620
|
}
|
|
9407
9621
|
}
|
|
9408
9622
|
async function putIgnoreFile({ content }) {
|
|
9409
|
-
const ignoreFilePath = (0,
|
|
9623
|
+
const ignoreFilePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9410
9624
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
9411
9625
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
9412
9626
|
throw new Error(
|
|
@@ -9427,8 +9641,8 @@ async function putIgnoreFile({ content }) {
|
|
|
9427
9641
|
}
|
|
9428
9642
|
}
|
|
9429
9643
|
async function deleteIgnoreFile() {
|
|
9430
|
-
const aiignorePath = (0,
|
|
9431
|
-
const legacyIgnorePath = (0,
|
|
9644
|
+
const aiignorePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9645
|
+
const legacyIgnorePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
9432
9646
|
try {
|
|
9433
9647
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
9434
9648
|
return {
|
|
@@ -9446,11 +9660,11 @@ async function deleteIgnoreFile() {
|
|
|
9446
9660
|
}
|
|
9447
9661
|
}
|
|
9448
9662
|
var ignoreToolSchemas = {
|
|
9449
|
-
getIgnoreFile:
|
|
9450
|
-
putIgnoreFile:
|
|
9451
|
-
content:
|
|
9663
|
+
getIgnoreFile: import_mini32.z.object({}),
|
|
9664
|
+
putIgnoreFile: import_mini32.z.object({
|
|
9665
|
+
content: import_mini32.z.string()
|
|
9452
9666
|
}),
|
|
9453
|
-
deleteIgnoreFile:
|
|
9667
|
+
deleteIgnoreFile: import_mini32.z.object({})
|
|
9454
9668
|
};
|
|
9455
9669
|
var ignoreTools = {
|
|
9456
9670
|
getIgnoreFile: {
|
|
@@ -9483,8 +9697,8 @@ var ignoreTools = {
|
|
|
9483
9697
|
};
|
|
9484
9698
|
|
|
9485
9699
|
// src/mcp/mcp.ts
|
|
9486
|
-
var
|
|
9487
|
-
var
|
|
9700
|
+
var import_node_path86 = require("path");
|
|
9701
|
+
var import_mini33 = require("zod/mini");
|
|
9488
9702
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
9489
9703
|
async function getMcpFile() {
|
|
9490
9704
|
const config = await ConfigResolver.resolve({});
|
|
@@ -9493,7 +9707,7 @@ async function getMcpFile() {
|
|
|
9493
9707
|
validate: true,
|
|
9494
9708
|
modularMcp: config.getModularMcp()
|
|
9495
9709
|
});
|
|
9496
|
-
const relativePathFromCwd = (0,
|
|
9710
|
+
const relativePathFromCwd = (0, import_node_path86.join)(
|
|
9497
9711
|
rulesyncMcp.getRelativeDirPath(),
|
|
9498
9712
|
rulesyncMcp.getRelativeFilePath()
|
|
9499
9713
|
);
|
|
@@ -9526,7 +9740,7 @@ async function putMcpFile({ content }) {
|
|
|
9526
9740
|
const paths = RulesyncMcp.getSettablePaths();
|
|
9527
9741
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
9528
9742
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
9529
|
-
const fullPath = (0,
|
|
9743
|
+
const fullPath = (0, import_node_path86.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
9530
9744
|
const rulesyncMcp = new RulesyncMcp({
|
|
9531
9745
|
baseDir,
|
|
9532
9746
|
relativeDirPath,
|
|
@@ -9535,9 +9749,9 @@ async function putMcpFile({ content }) {
|
|
|
9535
9749
|
validate: true,
|
|
9536
9750
|
modularMcp: config.getModularMcp()
|
|
9537
9751
|
});
|
|
9538
|
-
await ensureDir((0,
|
|
9752
|
+
await ensureDir((0, import_node_path86.join)(baseDir, relativeDirPath));
|
|
9539
9753
|
await writeFileContent(fullPath, content);
|
|
9540
|
-
const relativePathFromCwd = (0,
|
|
9754
|
+
const relativePathFromCwd = (0, import_node_path86.join)(relativeDirPath, relativeFilePath);
|
|
9541
9755
|
return {
|
|
9542
9756
|
relativePathFromCwd,
|
|
9543
9757
|
content: rulesyncMcp.getFileContent()
|
|
@@ -9552,15 +9766,15 @@ async function deleteMcpFile() {
|
|
|
9552
9766
|
try {
|
|
9553
9767
|
const baseDir = process.cwd();
|
|
9554
9768
|
const paths = RulesyncMcp.getSettablePaths();
|
|
9555
|
-
const recommendedPath = (0,
|
|
9769
|
+
const recommendedPath = (0, import_node_path86.join)(
|
|
9556
9770
|
baseDir,
|
|
9557
9771
|
paths.recommended.relativeDirPath,
|
|
9558
9772
|
paths.recommended.relativeFilePath
|
|
9559
9773
|
);
|
|
9560
|
-
const legacyPath = (0,
|
|
9774
|
+
const legacyPath = (0, import_node_path86.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
9561
9775
|
await removeFile(recommendedPath);
|
|
9562
9776
|
await removeFile(legacyPath);
|
|
9563
|
-
const relativePathFromCwd = (0,
|
|
9777
|
+
const relativePathFromCwd = (0, import_node_path86.join)(
|
|
9564
9778
|
paths.recommended.relativeDirPath,
|
|
9565
9779
|
paths.recommended.relativeFilePath
|
|
9566
9780
|
);
|
|
@@ -9574,11 +9788,11 @@ async function deleteMcpFile() {
|
|
|
9574
9788
|
}
|
|
9575
9789
|
}
|
|
9576
9790
|
var mcpToolSchemas = {
|
|
9577
|
-
getMcpFile:
|
|
9578
|
-
putMcpFile:
|
|
9579
|
-
content:
|
|
9791
|
+
getMcpFile: import_mini33.z.object({}),
|
|
9792
|
+
putMcpFile: import_mini33.z.object({
|
|
9793
|
+
content: import_mini33.z.string()
|
|
9580
9794
|
}),
|
|
9581
|
-
deleteMcpFile:
|
|
9795
|
+
deleteMcpFile: import_mini33.z.object({})
|
|
9582
9796
|
};
|
|
9583
9797
|
var mcpTools = {
|
|
9584
9798
|
getMcpFile: {
|
|
@@ -9611,12 +9825,12 @@ var mcpTools = {
|
|
|
9611
9825
|
};
|
|
9612
9826
|
|
|
9613
9827
|
// src/mcp/rules.ts
|
|
9614
|
-
var
|
|
9615
|
-
var
|
|
9828
|
+
var import_node_path87 = require("path");
|
|
9829
|
+
var import_mini34 = require("zod/mini");
|
|
9616
9830
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
9617
9831
|
var maxRulesCount = 1e3;
|
|
9618
9832
|
async function listRules() {
|
|
9619
|
-
const rulesDir = (0,
|
|
9833
|
+
const rulesDir = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
9620
9834
|
try {
|
|
9621
9835
|
const files = await listDirectoryFiles(rulesDir);
|
|
9622
9836
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9629,7 +9843,7 @@ async function listRules() {
|
|
|
9629
9843
|
});
|
|
9630
9844
|
const frontmatter = rule.getFrontmatter();
|
|
9631
9845
|
return {
|
|
9632
|
-
relativePathFromCwd: (0,
|
|
9846
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
9633
9847
|
frontmatter
|
|
9634
9848
|
};
|
|
9635
9849
|
} catch (error) {
|
|
@@ -9649,14 +9863,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
9649
9863
|
relativePath: relativePathFromCwd,
|
|
9650
9864
|
intendedRootDir: process.cwd()
|
|
9651
9865
|
});
|
|
9652
|
-
const filename = (0,
|
|
9866
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9653
9867
|
try {
|
|
9654
9868
|
const rule = await RulesyncRule.fromFile({
|
|
9655
9869
|
relativeFilePath: filename,
|
|
9656
9870
|
validate: true
|
|
9657
9871
|
});
|
|
9658
9872
|
return {
|
|
9659
|
-
relativePathFromCwd: (0,
|
|
9873
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
9660
9874
|
frontmatter: rule.getFrontmatter(),
|
|
9661
9875
|
body: rule.getBody()
|
|
9662
9876
|
};
|
|
@@ -9675,7 +9889,7 @@ async function putRule({
|
|
|
9675
9889
|
relativePath: relativePathFromCwd,
|
|
9676
9890
|
intendedRootDir: process.cwd()
|
|
9677
9891
|
});
|
|
9678
|
-
const filename = (0,
|
|
9892
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9679
9893
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9680
9894
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
9681
9895
|
throw new Error(
|
|
@@ -9685,7 +9899,7 @@ async function putRule({
|
|
|
9685
9899
|
try {
|
|
9686
9900
|
const existingRules = await listRules();
|
|
9687
9901
|
const isUpdate = existingRules.some(
|
|
9688
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
9902
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
9689
9903
|
);
|
|
9690
9904
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
9691
9905
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -9698,11 +9912,11 @@ async function putRule({
|
|
|
9698
9912
|
body,
|
|
9699
9913
|
validate: true
|
|
9700
9914
|
});
|
|
9701
|
-
const rulesDir = (0,
|
|
9915
|
+
const rulesDir = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
9702
9916
|
await ensureDir(rulesDir);
|
|
9703
9917
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
9704
9918
|
return {
|
|
9705
|
-
relativePathFromCwd: (0,
|
|
9919
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
9706
9920
|
frontmatter: rule.getFrontmatter(),
|
|
9707
9921
|
body: rule.getBody()
|
|
9708
9922
|
};
|
|
@@ -9717,12 +9931,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
9717
9931
|
relativePath: relativePathFromCwd,
|
|
9718
9932
|
intendedRootDir: process.cwd()
|
|
9719
9933
|
});
|
|
9720
|
-
const filename = (0,
|
|
9721
|
-
const fullPath = (0,
|
|
9934
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9935
|
+
const fullPath = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
9722
9936
|
try {
|
|
9723
9937
|
await removeFile(fullPath);
|
|
9724
9938
|
return {
|
|
9725
|
-
relativePathFromCwd: (0,
|
|
9939
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
9726
9940
|
};
|
|
9727
9941
|
} catch (error) {
|
|
9728
9942
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -9731,23 +9945,23 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
9731
9945
|
}
|
|
9732
9946
|
}
|
|
9733
9947
|
var ruleToolSchemas = {
|
|
9734
|
-
listRules:
|
|
9735
|
-
getRule:
|
|
9736
|
-
relativePathFromCwd:
|
|
9948
|
+
listRules: import_mini34.z.object({}),
|
|
9949
|
+
getRule: import_mini34.z.object({
|
|
9950
|
+
relativePathFromCwd: import_mini34.z.string()
|
|
9737
9951
|
}),
|
|
9738
|
-
putRule:
|
|
9739
|
-
relativePathFromCwd:
|
|
9952
|
+
putRule: import_mini34.z.object({
|
|
9953
|
+
relativePathFromCwd: import_mini34.z.string(),
|
|
9740
9954
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
9741
|
-
body:
|
|
9955
|
+
body: import_mini34.z.string()
|
|
9742
9956
|
}),
|
|
9743
|
-
deleteRule:
|
|
9744
|
-
relativePathFromCwd:
|
|
9957
|
+
deleteRule: import_mini34.z.object({
|
|
9958
|
+
relativePathFromCwd: import_mini34.z.string()
|
|
9745
9959
|
})
|
|
9746
9960
|
};
|
|
9747
9961
|
var ruleTools = {
|
|
9748
9962
|
listRules: {
|
|
9749
9963
|
name: "listRules",
|
|
9750
|
-
description: `List all rules from ${(0,
|
|
9964
|
+
description: `List all rules from ${(0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9751
9965
|
parameters: ruleToolSchemas.listRules,
|
|
9752
9966
|
execute: async () => {
|
|
9753
9967
|
const rules = await listRules();
|
|
@@ -9789,12 +10003,12 @@ var ruleTools = {
|
|
|
9789
10003
|
};
|
|
9790
10004
|
|
|
9791
10005
|
// src/mcp/subagents.ts
|
|
9792
|
-
var
|
|
9793
|
-
var
|
|
10006
|
+
var import_node_path88 = require("path");
|
|
10007
|
+
var import_mini35 = require("zod/mini");
|
|
9794
10008
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
9795
10009
|
var maxSubagentsCount = 1e3;
|
|
9796
10010
|
async function listSubagents() {
|
|
9797
|
-
const subagentsDir = (0,
|
|
10011
|
+
const subagentsDir = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
9798
10012
|
try {
|
|
9799
10013
|
const files = await listDirectoryFiles(subagentsDir);
|
|
9800
10014
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9807,7 +10021,7 @@ async function listSubagents() {
|
|
|
9807
10021
|
});
|
|
9808
10022
|
const frontmatter = subagent.getFrontmatter();
|
|
9809
10023
|
return {
|
|
9810
|
-
relativePathFromCwd: (0,
|
|
10024
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
9811
10025
|
frontmatter
|
|
9812
10026
|
};
|
|
9813
10027
|
} catch (error) {
|
|
@@ -9829,14 +10043,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
9829
10043
|
relativePath: relativePathFromCwd,
|
|
9830
10044
|
intendedRootDir: process.cwd()
|
|
9831
10045
|
});
|
|
9832
|
-
const filename = (0,
|
|
10046
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
9833
10047
|
try {
|
|
9834
10048
|
const subagent = await RulesyncSubagent.fromFile({
|
|
9835
10049
|
relativeFilePath: filename,
|
|
9836
10050
|
validate: true
|
|
9837
10051
|
});
|
|
9838
10052
|
return {
|
|
9839
|
-
relativePathFromCwd: (0,
|
|
10053
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
9840
10054
|
frontmatter: subagent.getFrontmatter(),
|
|
9841
10055
|
body: subagent.getBody()
|
|
9842
10056
|
};
|
|
@@ -9855,7 +10069,7 @@ async function putSubagent({
|
|
|
9855
10069
|
relativePath: relativePathFromCwd,
|
|
9856
10070
|
intendedRootDir: process.cwd()
|
|
9857
10071
|
});
|
|
9858
|
-
const filename = (0,
|
|
10072
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
9859
10073
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9860
10074
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
9861
10075
|
throw new Error(
|
|
@@ -9865,7 +10079,7 @@ async function putSubagent({
|
|
|
9865
10079
|
try {
|
|
9866
10080
|
const existingSubagents = await listSubagents();
|
|
9867
10081
|
const isUpdate = existingSubagents.some(
|
|
9868
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
10082
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
9869
10083
|
);
|
|
9870
10084
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
9871
10085
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -9878,11 +10092,11 @@ async function putSubagent({
|
|
|
9878
10092
|
body,
|
|
9879
10093
|
validate: true
|
|
9880
10094
|
});
|
|
9881
|
-
const subagentsDir = (0,
|
|
10095
|
+
const subagentsDir = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
9882
10096
|
await ensureDir(subagentsDir);
|
|
9883
10097
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
9884
10098
|
return {
|
|
9885
|
-
relativePathFromCwd: (0,
|
|
10099
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
9886
10100
|
frontmatter: subagent.getFrontmatter(),
|
|
9887
10101
|
body: subagent.getBody()
|
|
9888
10102
|
};
|
|
@@ -9897,12 +10111,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
9897
10111
|
relativePath: relativePathFromCwd,
|
|
9898
10112
|
intendedRootDir: process.cwd()
|
|
9899
10113
|
});
|
|
9900
|
-
const filename = (0,
|
|
9901
|
-
const fullPath = (0,
|
|
10114
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
10115
|
+
const fullPath = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
9902
10116
|
try {
|
|
9903
10117
|
await removeFile(fullPath);
|
|
9904
10118
|
return {
|
|
9905
|
-
relativePathFromCwd: (0,
|
|
10119
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
9906
10120
|
};
|
|
9907
10121
|
} catch (error) {
|
|
9908
10122
|
throw new Error(
|
|
@@ -9914,23 +10128,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
9914
10128
|
}
|
|
9915
10129
|
}
|
|
9916
10130
|
var subagentToolSchemas = {
|
|
9917
|
-
listSubagents:
|
|
9918
|
-
getSubagent:
|
|
9919
|
-
relativePathFromCwd:
|
|
10131
|
+
listSubagents: import_mini35.z.object({}),
|
|
10132
|
+
getSubagent: import_mini35.z.object({
|
|
10133
|
+
relativePathFromCwd: import_mini35.z.string()
|
|
9920
10134
|
}),
|
|
9921
|
-
putSubagent:
|
|
9922
|
-
relativePathFromCwd:
|
|
10135
|
+
putSubagent: import_mini35.z.object({
|
|
10136
|
+
relativePathFromCwd: import_mini35.z.string(),
|
|
9923
10137
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
9924
|
-
body:
|
|
10138
|
+
body: import_mini35.z.string()
|
|
9925
10139
|
}),
|
|
9926
|
-
deleteSubagent:
|
|
9927
|
-
relativePathFromCwd:
|
|
10140
|
+
deleteSubagent: import_mini35.z.object({
|
|
10141
|
+
relativePathFromCwd: import_mini35.z.string()
|
|
9928
10142
|
})
|
|
9929
10143
|
};
|
|
9930
10144
|
var subagentTools = {
|
|
9931
10145
|
listSubagents: {
|
|
9932
10146
|
name: "listSubagents",
|
|
9933
|
-
description: `List all subagents from ${(0,
|
|
10147
|
+
description: `List all subagents from ${(0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9934
10148
|
parameters: subagentToolSchemas.listSubagents,
|
|
9935
10149
|
execute: async () => {
|
|
9936
10150
|
const subagents = await listSubagents();
|
|
@@ -10004,7 +10218,7 @@ async function mcpCommand({ version }) {
|
|
|
10004
10218
|
}
|
|
10005
10219
|
|
|
10006
10220
|
// src/cli/index.ts
|
|
10007
|
-
var getVersion = () => "3.
|
|
10221
|
+
var getVersion = () => "3.28.0";
|
|
10008
10222
|
var main = async () => {
|
|
10009
10223
|
const program = new import_commander.Command();
|
|
10010
10224
|
const version = getVersion();
|