rulesync 3.27.1 → 3.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/index.cjs +769 -531
- package/dist/index.js +762 -524
- 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
|
|
|
@@ -898,7 +899,7 @@ var RulesyncFile = class extends AiFile {
|
|
|
898
899
|
};
|
|
899
900
|
|
|
900
901
|
// src/features/commands/rulesync-command.ts
|
|
901
|
-
var RulesyncCommandFrontmatterSchema = import_mini5.z.
|
|
902
|
+
var RulesyncCommandFrontmatterSchema = import_mini5.z.looseObject({
|
|
902
903
|
targets: RulesyncTargetsSchema,
|
|
903
904
|
description: import_mini5.z.string()
|
|
904
905
|
});
|
|
@@ -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.looseObject({
|
|
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() {
|
|
@@ -1009,9 +1134,12 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1009
1134
|
return this.frontmatter;
|
|
1010
1135
|
}
|
|
1011
1136
|
toRulesyncCommand() {
|
|
1137
|
+
const { description, ...restFields } = this.frontmatter;
|
|
1012
1138
|
const rulesyncFrontmatter = {
|
|
1013
1139
|
targets: ["*"],
|
|
1014
|
-
description
|
|
1140
|
+
description,
|
|
1141
|
+
// Preserve extra fields in claudecode section
|
|
1142
|
+
...Object.keys(restFields).length > 0 && { claudecode: restFields }
|
|
1015
1143
|
};
|
|
1016
1144
|
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1017
1145
|
return new RulesyncCommand({
|
|
@@ -1032,8 +1160,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1032
1160
|
global = false
|
|
1033
1161
|
}) {
|
|
1034
1162
|
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1163
|
+
const claudecodeFields = rulesyncFrontmatter.claudecode ?? {};
|
|
1035
1164
|
const claudecodeFrontmatter = {
|
|
1036
|
-
description: rulesyncFrontmatter.description
|
|
1165
|
+
description: rulesyncFrontmatter.description,
|
|
1166
|
+
...claudecodeFields
|
|
1037
1167
|
};
|
|
1038
1168
|
const body = rulesyncCommand.getBody();
|
|
1039
1169
|
const paths = this.getSettablePaths({ global });
|
|
@@ -1057,7 +1187,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1057
1187
|
return {
|
|
1058
1188
|
success: false,
|
|
1059
1189
|
error: new Error(
|
|
1060
|
-
`Invalid frontmatter in ${(0,
|
|
1190
|
+
`Invalid frontmatter in ${(0, import_node_path9.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1061
1191
|
)
|
|
1062
1192
|
};
|
|
1063
1193
|
}
|
|
@@ -1075,7 +1205,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1075
1205
|
global = false
|
|
1076
1206
|
}) {
|
|
1077
1207
|
const paths = this.getSettablePaths({ global });
|
|
1078
|
-
const filePath = (0,
|
|
1208
|
+
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1079
1209
|
const fileContent = await readFileContent(filePath);
|
|
1080
1210
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1081
1211
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1085,7 +1215,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1085
1215
|
return new _ClaudecodeCommand({
|
|
1086
1216
|
baseDir,
|
|
1087
1217
|
relativeDirPath: paths.relativeDirPath,
|
|
1088
|
-
relativeFilePath: (0,
|
|
1218
|
+
relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
|
|
1089
1219
|
frontmatter: result.data,
|
|
1090
1220
|
body: content.trim(),
|
|
1091
1221
|
validate
|
|
@@ -1094,14 +1224,14 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1094
1224
|
};
|
|
1095
1225
|
|
|
1096
1226
|
// src/features/commands/codexcli-command.ts
|
|
1097
|
-
var
|
|
1227
|
+
var import_node_path10 = require("path");
|
|
1098
1228
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
1099
1229
|
static getSettablePaths({ global } = {}) {
|
|
1100
1230
|
if (!global) {
|
|
1101
1231
|
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
1102
1232
|
}
|
|
1103
1233
|
return {
|
|
1104
|
-
relativeDirPath: (0,
|
|
1234
|
+
relativeDirPath: (0, import_node_path10.join)(".codex", "prompts")
|
|
1105
1235
|
};
|
|
1106
1236
|
}
|
|
1107
1237
|
toRulesyncCommand() {
|
|
@@ -1154,13 +1284,13 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1154
1284
|
global = false
|
|
1155
1285
|
}) {
|
|
1156
1286
|
const paths = this.getSettablePaths({ global });
|
|
1157
|
-
const filePath = (0,
|
|
1287
|
+
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1158
1288
|
const fileContent = await readFileContent(filePath);
|
|
1159
1289
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1160
1290
|
return new _CodexcliCommand({
|
|
1161
1291
|
baseDir,
|
|
1162
1292
|
relativeDirPath: paths.relativeDirPath,
|
|
1163
|
-
relativeFilePath: (0,
|
|
1293
|
+
relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
|
|
1164
1294
|
fileContent: content.trim(),
|
|
1165
1295
|
validate
|
|
1166
1296
|
});
|
|
@@ -1168,11 +1298,11 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1168
1298
|
};
|
|
1169
1299
|
|
|
1170
1300
|
// src/features/commands/copilot-command.ts
|
|
1171
|
-
var
|
|
1172
|
-
var
|
|
1173
|
-
var CopilotCommandFrontmatterSchema =
|
|
1174
|
-
mode:
|
|
1175
|
-
description:
|
|
1301
|
+
var import_node_path11 = require("path");
|
|
1302
|
+
var import_mini8 = require("zod/mini");
|
|
1303
|
+
var CopilotCommandFrontmatterSchema = import_mini8.z.looseObject({
|
|
1304
|
+
mode: import_mini8.z.literal("agent"),
|
|
1305
|
+
description: import_mini8.z.string()
|
|
1176
1306
|
});
|
|
1177
1307
|
var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
1178
1308
|
frontmatter;
|
|
@@ -1182,7 +1312,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1182
1312
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1183
1313
|
if (!result.success) {
|
|
1184
1314
|
throw new Error(
|
|
1185
|
-
`Invalid frontmatter in ${(0,
|
|
1315
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1186
1316
|
);
|
|
1187
1317
|
}
|
|
1188
1318
|
}
|
|
@@ -1195,7 +1325,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1195
1325
|
}
|
|
1196
1326
|
static getSettablePaths() {
|
|
1197
1327
|
return {
|
|
1198
|
-
relativeDirPath: (0,
|
|
1328
|
+
relativeDirPath: (0, import_node_path11.join)(".github", "prompts")
|
|
1199
1329
|
};
|
|
1200
1330
|
}
|
|
1201
1331
|
getBody() {
|
|
@@ -1205,9 +1335,12 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1205
1335
|
return this.frontmatter;
|
|
1206
1336
|
}
|
|
1207
1337
|
toRulesyncCommand() {
|
|
1338
|
+
const { mode: _mode, description, ...restFields } = this.frontmatter;
|
|
1208
1339
|
const rulesyncFrontmatter = {
|
|
1209
1340
|
targets: ["*"],
|
|
1210
|
-
description
|
|
1341
|
+
description,
|
|
1342
|
+
// Preserve extra fields in copilot section (excluding mode which is fixed)
|
|
1343
|
+
...Object.keys(restFields).length > 0 && { copilot: restFields }
|
|
1211
1344
|
};
|
|
1212
1345
|
const originalFilePath = this.relativeFilePath;
|
|
1213
1346
|
const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
|
|
@@ -1232,7 +1365,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1232
1365
|
return {
|
|
1233
1366
|
success: false,
|
|
1234
1367
|
error: new Error(
|
|
1235
|
-
`Invalid frontmatter in ${(0,
|
|
1368
|
+
`Invalid frontmatter in ${(0, import_node_path11.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1236
1369
|
)
|
|
1237
1370
|
};
|
|
1238
1371
|
}
|
|
@@ -1244,9 +1377,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1244
1377
|
}) {
|
|
1245
1378
|
const paths = this.getSettablePaths();
|
|
1246
1379
|
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1380
|
+
const copilotFields = rulesyncFrontmatter.copilot ?? {};
|
|
1247
1381
|
const copilotFrontmatter = {
|
|
1248
1382
|
mode: "agent",
|
|
1249
|
-
description: rulesyncFrontmatter.description
|
|
1383
|
+
description: rulesyncFrontmatter.description,
|
|
1384
|
+
...copilotFields
|
|
1250
1385
|
};
|
|
1251
1386
|
const body = rulesyncCommand.getBody();
|
|
1252
1387
|
const originalFilePath = rulesyncCommand.getRelativeFilePath();
|
|
@@ -1266,7 +1401,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1266
1401
|
validate = true
|
|
1267
1402
|
}) {
|
|
1268
1403
|
const paths = this.getSettablePaths();
|
|
1269
|
-
const filePath = (0,
|
|
1404
|
+
const filePath = (0, import_node_path11.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1270
1405
|
const fileContent = await readFileContent(filePath);
|
|
1271
1406
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1272
1407
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1276,7 +1411,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1276
1411
|
return new _CopilotCommand({
|
|
1277
1412
|
baseDir,
|
|
1278
1413
|
relativeDirPath: paths.relativeDirPath,
|
|
1279
|
-
relativeFilePath: (0,
|
|
1414
|
+
relativeFilePath: (0, import_node_path11.basename)(relativeFilePath),
|
|
1280
1415
|
frontmatter: result.data,
|
|
1281
1416
|
body: content.trim(),
|
|
1282
1417
|
validate
|
|
@@ -1291,11 +1426,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1291
1426
|
};
|
|
1292
1427
|
|
|
1293
1428
|
// src/features/commands/cursor-command.ts
|
|
1294
|
-
var
|
|
1429
|
+
var import_node_path12 = require("path");
|
|
1295
1430
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1296
1431
|
static getSettablePaths(_options = {}) {
|
|
1297
1432
|
return {
|
|
1298
|
-
relativeDirPath: (0,
|
|
1433
|
+
relativeDirPath: (0, import_node_path12.join)(".cursor", "commands")
|
|
1299
1434
|
};
|
|
1300
1435
|
}
|
|
1301
1436
|
toRulesyncCommand() {
|
|
@@ -1348,13 +1483,13 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1348
1483
|
global = false
|
|
1349
1484
|
}) {
|
|
1350
1485
|
const paths = this.getSettablePaths({ global });
|
|
1351
|
-
const filePath = (0,
|
|
1486
|
+
const filePath = (0, import_node_path12.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1352
1487
|
const fileContent = await readFileContent(filePath);
|
|
1353
1488
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1354
1489
|
return new _CursorCommand({
|
|
1355
1490
|
baseDir,
|
|
1356
1491
|
relativeDirPath: paths.relativeDirPath,
|
|
1357
|
-
relativeFilePath: (0,
|
|
1492
|
+
relativeFilePath: (0, import_node_path12.basename)(relativeFilePath),
|
|
1358
1493
|
fileContent: content.trim(),
|
|
1359
1494
|
validate
|
|
1360
1495
|
});
|
|
@@ -1362,12 +1497,12 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1362
1497
|
};
|
|
1363
1498
|
|
|
1364
1499
|
// src/features/commands/geminicli-command.ts
|
|
1365
|
-
var
|
|
1500
|
+
var import_node_path13 = require("path");
|
|
1366
1501
|
var import_smol_toml = require("smol-toml");
|
|
1367
|
-
var
|
|
1368
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1369
|
-
description:
|
|
1370
|
-
prompt:
|
|
1502
|
+
var import_mini9 = require("zod/mini");
|
|
1503
|
+
var GeminiCliCommandFrontmatterSchema = import_mini9.z.looseObject({
|
|
1504
|
+
description: import_mini9.z.optional(import_mini9.z.string()),
|
|
1505
|
+
prompt: import_mini9.z.string()
|
|
1371
1506
|
});
|
|
1372
1507
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1373
1508
|
frontmatter;
|
|
@@ -1380,7 +1515,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1380
1515
|
}
|
|
1381
1516
|
static getSettablePaths(_options = {}) {
|
|
1382
1517
|
return {
|
|
1383
|
-
relativeDirPath: (0,
|
|
1518
|
+
relativeDirPath: (0, import_node_path13.join)(".gemini", "commands")
|
|
1384
1519
|
};
|
|
1385
1520
|
}
|
|
1386
1521
|
parseTomlContent(content) {
|
|
@@ -1393,8 +1528,8 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1393
1528
|
);
|
|
1394
1529
|
}
|
|
1395
1530
|
return {
|
|
1396
|
-
|
|
1397
|
-
|
|
1531
|
+
...result.data,
|
|
1532
|
+
description: result.data.description || ""
|
|
1398
1533
|
};
|
|
1399
1534
|
} catch (error) {
|
|
1400
1535
|
throw new Error(`Failed to parse TOML command file: ${error}`, { cause: error });
|
|
@@ -1410,9 +1545,12 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1410
1545
|
};
|
|
1411
1546
|
}
|
|
1412
1547
|
toRulesyncCommand() {
|
|
1548
|
+
const { description, prompt: _prompt, ...restFields } = this.frontmatter;
|
|
1413
1549
|
const rulesyncFrontmatter = {
|
|
1414
1550
|
targets: ["geminicli"],
|
|
1415
|
-
description:
|
|
1551
|
+
description: description ?? "",
|
|
1552
|
+
// Preserve extra fields in geminicli section (excluding prompt which is the body)
|
|
1553
|
+
...Object.keys(restFields).length > 0 && { geminicli: restFields }
|
|
1416
1554
|
};
|
|
1417
1555
|
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1418
1556
|
return new RulesyncCommand({
|
|
@@ -1433,9 +1571,11 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1433
1571
|
global = false
|
|
1434
1572
|
}) {
|
|
1435
1573
|
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1574
|
+
const geminicliFields = rulesyncFrontmatter.geminicli ?? {};
|
|
1436
1575
|
const geminiFrontmatter = {
|
|
1437
1576
|
description: rulesyncFrontmatter.description,
|
|
1438
|
-
prompt: rulesyncCommand.getBody()
|
|
1577
|
+
prompt: rulesyncCommand.getBody(),
|
|
1578
|
+
...geminicliFields
|
|
1439
1579
|
};
|
|
1440
1580
|
const tomlContent = `description = "${geminiFrontmatter.description}"
|
|
1441
1581
|
prompt = """
|
|
@@ -1457,12 +1597,12 @@ ${geminiFrontmatter.prompt}
|
|
|
1457
1597
|
global = false
|
|
1458
1598
|
}) {
|
|
1459
1599
|
const paths = this.getSettablePaths({ global });
|
|
1460
|
-
const filePath = (0,
|
|
1600
|
+
const filePath = (0, import_node_path13.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1461
1601
|
const fileContent = await readFileContent(filePath);
|
|
1462
1602
|
return new _GeminiCliCommand({
|
|
1463
1603
|
baseDir,
|
|
1464
1604
|
relativeDirPath: paths.relativeDirPath,
|
|
1465
|
-
relativeFilePath: (0,
|
|
1605
|
+
relativeFilePath: (0, import_node_path13.basename)(relativeFilePath),
|
|
1466
1606
|
fileContent,
|
|
1467
1607
|
validate
|
|
1468
1608
|
});
|
|
@@ -1484,18 +1624,18 @@ ${geminiFrontmatter.prompt}
|
|
|
1484
1624
|
};
|
|
1485
1625
|
|
|
1486
1626
|
// src/features/commands/roo-command.ts
|
|
1487
|
-
var
|
|
1488
|
-
var
|
|
1489
|
-
var RooCommandFrontmatterSchema =
|
|
1490
|
-
description:
|
|
1491
|
-
"argument-hint": (0,
|
|
1627
|
+
var import_node_path14 = require("path");
|
|
1628
|
+
var import_mini10 = require("zod/mini");
|
|
1629
|
+
var RooCommandFrontmatterSchema = import_mini10.z.looseObject({
|
|
1630
|
+
description: import_mini10.z.string(),
|
|
1631
|
+
"argument-hint": (0, import_mini10.optional)(import_mini10.z.string())
|
|
1492
1632
|
});
|
|
1493
1633
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
1494
1634
|
frontmatter;
|
|
1495
1635
|
body;
|
|
1496
1636
|
static getSettablePaths() {
|
|
1497
1637
|
return {
|
|
1498
|
-
relativeDirPath: (0,
|
|
1638
|
+
relativeDirPath: (0, import_node_path14.join)(".roo", "commands")
|
|
1499
1639
|
};
|
|
1500
1640
|
}
|
|
1501
1641
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -1503,7 +1643,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1503
1643
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1504
1644
|
if (!result.success) {
|
|
1505
1645
|
throw new Error(
|
|
1506
|
-
`Invalid frontmatter in ${(0,
|
|
1646
|
+
`Invalid frontmatter in ${(0, import_node_path14.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1507
1647
|
);
|
|
1508
1648
|
}
|
|
1509
1649
|
}
|
|
@@ -1521,9 +1661,12 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1521
1661
|
return this.frontmatter;
|
|
1522
1662
|
}
|
|
1523
1663
|
toRulesyncCommand() {
|
|
1664
|
+
const { description, ...restFields } = this.frontmatter;
|
|
1524
1665
|
const rulesyncFrontmatter = {
|
|
1525
1666
|
targets: ["roo"],
|
|
1526
|
-
description
|
|
1667
|
+
description,
|
|
1668
|
+
// Preserve extra fields in roo section
|
|
1669
|
+
...Object.keys(restFields).length > 0 && { roo: restFields }
|
|
1527
1670
|
};
|
|
1528
1671
|
const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
|
|
1529
1672
|
return new RulesyncCommand({
|
|
@@ -1543,8 +1686,10 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1543
1686
|
validate = true
|
|
1544
1687
|
}) {
|
|
1545
1688
|
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
1689
|
+
const rooFields = rulesyncFrontmatter.roo ?? {};
|
|
1546
1690
|
const rooFrontmatter = {
|
|
1547
|
-
description: rulesyncFrontmatter.description
|
|
1691
|
+
description: rulesyncFrontmatter.description,
|
|
1692
|
+
...rooFields
|
|
1548
1693
|
};
|
|
1549
1694
|
const body = rulesyncCommand.getBody();
|
|
1550
1695
|
const fileContent = stringifyFrontmatter(body, rooFrontmatter);
|
|
@@ -1569,7 +1714,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1569
1714
|
return {
|
|
1570
1715
|
success: false,
|
|
1571
1716
|
error: new Error(
|
|
1572
|
-
`Invalid frontmatter in ${(0,
|
|
1717
|
+
`Invalid frontmatter in ${(0, import_node_path14.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1573
1718
|
)
|
|
1574
1719
|
};
|
|
1575
1720
|
}
|
|
@@ -1585,7 +1730,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1585
1730
|
relativeFilePath,
|
|
1586
1731
|
validate = true
|
|
1587
1732
|
}) {
|
|
1588
|
-
const filePath = (0,
|
|
1733
|
+
const filePath = (0, import_node_path14.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
1589
1734
|
const fileContent = await readFileContent(filePath);
|
|
1590
1735
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1591
1736
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1595,7 +1740,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1595
1740
|
return new _RooCommand({
|
|
1596
1741
|
baseDir,
|
|
1597
1742
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
1598
|
-
relativeFilePath: (0,
|
|
1743
|
+
relativeFilePath: (0, import_node_path14.basename)(relativeFilePath),
|
|
1599
1744
|
frontmatter: result.data,
|
|
1600
1745
|
body: content.trim(),
|
|
1601
1746
|
fileContent,
|
|
@@ -1607,13 +1752,14 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1607
1752
|
// src/features/commands/commands-processor.ts
|
|
1608
1753
|
var commandsProcessorToolTargets = [
|
|
1609
1754
|
"agentsmd",
|
|
1755
|
+
"antigravity",
|
|
1610
1756
|
"claudecode",
|
|
1611
1757
|
"geminicli",
|
|
1612
1758
|
"roo",
|
|
1613
1759
|
"copilot",
|
|
1614
1760
|
"cursor"
|
|
1615
1761
|
];
|
|
1616
|
-
var CommandsProcessorToolTargetSchema =
|
|
1762
|
+
var CommandsProcessorToolTargetSchema = import_mini11.z.enum(
|
|
1617
1763
|
// 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
1764
|
commandsProcessorToolTargets.concat("codexcli")
|
|
1619
1765
|
);
|
|
@@ -1656,6 +1802,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1656
1802
|
baseDir: this.baseDir,
|
|
1657
1803
|
rulesyncCommand
|
|
1658
1804
|
});
|
|
1805
|
+
case "antigravity":
|
|
1806
|
+
if (!AntigravityCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1807
|
+
return null;
|
|
1808
|
+
}
|
|
1809
|
+
return AntigravityCommand.fromRulesyncCommand({
|
|
1810
|
+
baseDir: this.baseDir,
|
|
1811
|
+
rulesyncCommand
|
|
1812
|
+
});
|
|
1659
1813
|
case "claudecode":
|
|
1660
1814
|
if (!ClaudecodeCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
|
|
1661
1815
|
return null;
|
|
@@ -1731,11 +1885,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1731
1885
|
*/
|
|
1732
1886
|
async loadRulesyncFiles() {
|
|
1733
1887
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
1734
|
-
(0,
|
|
1888
|
+
(0, import_node_path15.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
1735
1889
|
);
|
|
1736
1890
|
const rulesyncCommands = await Promise.all(
|
|
1737
1891
|
rulesyncCommandPaths.map(
|
|
1738
|
-
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
1892
|
+
(path3) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path15.basename)(path3) })
|
|
1739
1893
|
)
|
|
1740
1894
|
);
|
|
1741
1895
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -1751,6 +1905,8 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1751
1905
|
switch (this.toolTarget) {
|
|
1752
1906
|
case "agentsmd":
|
|
1753
1907
|
return await this.loadAgentsmdCommands();
|
|
1908
|
+
case "antigravity":
|
|
1909
|
+
return await this.loadAntigravityCommands();
|
|
1754
1910
|
case "claudecode":
|
|
1755
1911
|
return await this.loadClaudecodeCommands();
|
|
1756
1912
|
case "geminicli":
|
|
@@ -1773,7 +1929,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1773
1929
|
extension
|
|
1774
1930
|
}) {
|
|
1775
1931
|
const commandFilePaths = await findFilesByGlobs(
|
|
1776
|
-
(0,
|
|
1932
|
+
(0, import_node_path15.join)(this.baseDir, relativeDirPath, `*.${extension}`)
|
|
1777
1933
|
);
|
|
1778
1934
|
const toolCommands = await Promise.all(
|
|
1779
1935
|
commandFilePaths.map((path3) => {
|
|
@@ -1781,40 +1937,45 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1781
1937
|
case "agentsmd":
|
|
1782
1938
|
return AgentsmdCommand.fromFile({
|
|
1783
1939
|
baseDir: this.baseDir,
|
|
1784
|
-
relativeFilePath: (0,
|
|
1940
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1941
|
+
});
|
|
1942
|
+
case "antigravity":
|
|
1943
|
+
return AntigravityCommand.fromFile({
|
|
1944
|
+
baseDir: this.baseDir,
|
|
1945
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1785
1946
|
});
|
|
1786
1947
|
case "claudecode":
|
|
1787
1948
|
return ClaudecodeCommand.fromFile({
|
|
1788
1949
|
baseDir: this.baseDir,
|
|
1789
|
-
relativeFilePath: (0,
|
|
1950
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1790
1951
|
global: this.global
|
|
1791
1952
|
});
|
|
1792
1953
|
case "geminicli":
|
|
1793
1954
|
return GeminiCliCommand.fromFile({
|
|
1794
1955
|
baseDir: this.baseDir,
|
|
1795
|
-
relativeFilePath: (0,
|
|
1956
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1796
1957
|
global: this.global
|
|
1797
1958
|
});
|
|
1798
1959
|
case "roo":
|
|
1799
1960
|
return RooCommand.fromFile({
|
|
1800
1961
|
baseDir: this.baseDir,
|
|
1801
|
-
relativeFilePath: (0,
|
|
1962
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1802
1963
|
});
|
|
1803
1964
|
case "copilot":
|
|
1804
1965
|
return CopilotCommand.fromFile({
|
|
1805
1966
|
baseDir: this.baseDir,
|
|
1806
|
-
relativeFilePath: (0,
|
|
1967
|
+
relativeFilePath: (0, import_node_path15.basename)(path3)
|
|
1807
1968
|
});
|
|
1808
1969
|
case "cursor":
|
|
1809
1970
|
return CursorCommand.fromFile({
|
|
1810
1971
|
baseDir: this.baseDir,
|
|
1811
|
-
relativeFilePath: (0,
|
|
1972
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1812
1973
|
global: this.global
|
|
1813
1974
|
});
|
|
1814
1975
|
case "codexcli":
|
|
1815
1976
|
return CodexcliCommand.fromFile({
|
|
1816
1977
|
baseDir: this.baseDir,
|
|
1817
|
-
relativeFilePath: (0,
|
|
1978
|
+
relativeFilePath: (0, import_node_path15.basename)(path3),
|
|
1818
1979
|
global: this.global
|
|
1819
1980
|
});
|
|
1820
1981
|
default:
|
|
@@ -1835,6 +1996,16 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1835
1996
|
extension: "md"
|
|
1836
1997
|
});
|
|
1837
1998
|
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Load Antigravity workflow configurations from .agent/workflows/ directory
|
|
2001
|
+
*/
|
|
2002
|
+
async loadAntigravityCommands() {
|
|
2003
|
+
return await this.loadToolCommandDefault({
|
|
2004
|
+
toolTarget: "antigravity",
|
|
2005
|
+
relativeDirPath: AntigravityCommand.getSettablePaths().relativeDirPath,
|
|
2006
|
+
extension: "md"
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
1838
2009
|
/**
|
|
1839
2010
|
* Load Copilot command configurations from .github/prompts/ directory
|
|
1840
2011
|
*/
|
|
@@ -1923,17 +2094,17 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1923
2094
|
};
|
|
1924
2095
|
|
|
1925
2096
|
// src/features/ignore/ignore-processor.ts
|
|
1926
|
-
var
|
|
2097
|
+
var import_mini12 = require("zod/mini");
|
|
1927
2098
|
|
|
1928
2099
|
// src/features/ignore/amazonqcli-ignore.ts
|
|
1929
|
-
var
|
|
2100
|
+
var import_node_path17 = require("path");
|
|
1930
2101
|
|
|
1931
2102
|
// src/types/tool-file.ts
|
|
1932
2103
|
var ToolFile = class extends AiFile {
|
|
1933
2104
|
};
|
|
1934
2105
|
|
|
1935
2106
|
// src/features/ignore/rulesync-ignore.ts
|
|
1936
|
-
var
|
|
2107
|
+
var import_node_path16 = require("path");
|
|
1937
2108
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
1938
2109
|
validate() {
|
|
1939
2110
|
return { success: true, error: null };
|
|
@@ -1953,12 +2124,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
1953
2124
|
static async fromFile() {
|
|
1954
2125
|
const baseDir = process.cwd();
|
|
1955
2126
|
const paths = this.getSettablePaths();
|
|
1956
|
-
const recommendedPath = (0,
|
|
2127
|
+
const recommendedPath = (0, import_node_path16.join)(
|
|
1957
2128
|
baseDir,
|
|
1958
2129
|
paths.recommended.relativeDirPath,
|
|
1959
2130
|
paths.recommended.relativeFilePath
|
|
1960
2131
|
);
|
|
1961
|
-
const legacyPath = (0,
|
|
2132
|
+
const legacyPath = (0, import_node_path16.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
1962
2133
|
if (await fileExists(recommendedPath)) {
|
|
1963
2134
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
1964
2135
|
return new _RulesyncIgnore({
|
|
@@ -2067,7 +2238,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
2067
2238
|
validate = true
|
|
2068
2239
|
}) {
|
|
2069
2240
|
const fileContent = await readFileContent(
|
|
2070
|
-
(0,
|
|
2241
|
+
(0, import_node_path17.join)(
|
|
2071
2242
|
baseDir,
|
|
2072
2243
|
this.getSettablePaths().relativeDirPath,
|
|
2073
2244
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2084,7 +2255,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
2084
2255
|
};
|
|
2085
2256
|
|
|
2086
2257
|
// src/features/ignore/augmentcode-ignore.ts
|
|
2087
|
-
var
|
|
2258
|
+
var import_node_path18 = require("path");
|
|
2088
2259
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
2089
2260
|
static getSettablePaths() {
|
|
2090
2261
|
return {
|
|
@@ -2122,7 +2293,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2122
2293
|
validate = true
|
|
2123
2294
|
}) {
|
|
2124
2295
|
const fileContent = await readFileContent(
|
|
2125
|
-
(0,
|
|
2296
|
+
(0, import_node_path18.join)(
|
|
2126
2297
|
baseDir,
|
|
2127
2298
|
this.getSettablePaths().relativeDirPath,
|
|
2128
2299
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2139,7 +2310,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2139
2310
|
};
|
|
2140
2311
|
|
|
2141
2312
|
// src/features/ignore/claudecode-ignore.ts
|
|
2142
|
-
var
|
|
2313
|
+
var import_node_path19 = require("path");
|
|
2143
2314
|
var import_es_toolkit = require("es-toolkit");
|
|
2144
2315
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
2145
2316
|
constructor(params) {
|
|
@@ -2175,7 +2346,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2175
2346
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
2176
2347
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2177
2348
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
2178
|
-
const filePath = (0,
|
|
2349
|
+
const filePath = (0, import_node_path19.join)(
|
|
2179
2350
|
baseDir,
|
|
2180
2351
|
this.getSettablePaths().relativeDirPath,
|
|
2181
2352
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2203,7 +2374,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2203
2374
|
validate = true
|
|
2204
2375
|
}) {
|
|
2205
2376
|
const fileContent = await readFileContent(
|
|
2206
|
-
(0,
|
|
2377
|
+
(0, import_node_path19.join)(
|
|
2207
2378
|
baseDir,
|
|
2208
2379
|
this.getSettablePaths().relativeDirPath,
|
|
2209
2380
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2220,7 +2391,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2220
2391
|
};
|
|
2221
2392
|
|
|
2222
2393
|
// src/features/ignore/cline-ignore.ts
|
|
2223
|
-
var
|
|
2394
|
+
var import_node_path20 = require("path");
|
|
2224
2395
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
2225
2396
|
static getSettablePaths() {
|
|
2226
2397
|
return {
|
|
@@ -2257,7 +2428,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2257
2428
|
validate = true
|
|
2258
2429
|
}) {
|
|
2259
2430
|
const fileContent = await readFileContent(
|
|
2260
|
-
(0,
|
|
2431
|
+
(0, import_node_path20.join)(
|
|
2261
2432
|
baseDir,
|
|
2262
2433
|
this.getSettablePaths().relativeDirPath,
|
|
2263
2434
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2274,7 +2445,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2274
2445
|
};
|
|
2275
2446
|
|
|
2276
2447
|
// src/features/ignore/cursor-ignore.ts
|
|
2277
|
-
var
|
|
2448
|
+
var import_node_path21 = require("path");
|
|
2278
2449
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
2279
2450
|
static getSettablePaths() {
|
|
2280
2451
|
return {
|
|
@@ -2307,7 +2478,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2307
2478
|
validate = true
|
|
2308
2479
|
}) {
|
|
2309
2480
|
const fileContent = await readFileContent(
|
|
2310
|
-
(0,
|
|
2481
|
+
(0, import_node_path21.join)(
|
|
2311
2482
|
baseDir,
|
|
2312
2483
|
this.getSettablePaths().relativeDirPath,
|
|
2313
2484
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2324,7 +2495,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2324
2495
|
};
|
|
2325
2496
|
|
|
2326
2497
|
// src/features/ignore/geminicli-ignore.ts
|
|
2327
|
-
var
|
|
2498
|
+
var import_node_path22 = require("path");
|
|
2328
2499
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
2329
2500
|
static getSettablePaths() {
|
|
2330
2501
|
return {
|
|
@@ -2351,7 +2522,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2351
2522
|
validate = true
|
|
2352
2523
|
}) {
|
|
2353
2524
|
const fileContent = await readFileContent(
|
|
2354
|
-
(0,
|
|
2525
|
+
(0, import_node_path22.join)(
|
|
2355
2526
|
baseDir,
|
|
2356
2527
|
this.getSettablePaths().relativeDirPath,
|
|
2357
2528
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2368,7 +2539,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2368
2539
|
};
|
|
2369
2540
|
|
|
2370
2541
|
// src/features/ignore/junie-ignore.ts
|
|
2371
|
-
var
|
|
2542
|
+
var import_node_path23 = require("path");
|
|
2372
2543
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2373
2544
|
static getSettablePaths() {
|
|
2374
2545
|
return {
|
|
@@ -2395,7 +2566,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2395
2566
|
validate = true
|
|
2396
2567
|
}) {
|
|
2397
2568
|
const fileContent = await readFileContent(
|
|
2398
|
-
(0,
|
|
2569
|
+
(0, import_node_path23.join)(
|
|
2399
2570
|
baseDir,
|
|
2400
2571
|
this.getSettablePaths().relativeDirPath,
|
|
2401
2572
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2412,7 +2583,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2412
2583
|
};
|
|
2413
2584
|
|
|
2414
2585
|
// src/features/ignore/kiro-ignore.ts
|
|
2415
|
-
var
|
|
2586
|
+
var import_node_path24 = require("path");
|
|
2416
2587
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2417
2588
|
static getSettablePaths() {
|
|
2418
2589
|
return {
|
|
@@ -2439,7 +2610,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2439
2610
|
validate = true
|
|
2440
2611
|
}) {
|
|
2441
2612
|
const fileContent = await readFileContent(
|
|
2442
|
-
(0,
|
|
2613
|
+
(0, import_node_path24.join)(
|
|
2443
2614
|
baseDir,
|
|
2444
2615
|
this.getSettablePaths().relativeDirPath,
|
|
2445
2616
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2456,7 +2627,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2456
2627
|
};
|
|
2457
2628
|
|
|
2458
2629
|
// src/features/ignore/qwencode-ignore.ts
|
|
2459
|
-
var
|
|
2630
|
+
var import_node_path25 = require("path");
|
|
2460
2631
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2461
2632
|
static getSettablePaths() {
|
|
2462
2633
|
return {
|
|
@@ -2483,7 +2654,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2483
2654
|
validate = true
|
|
2484
2655
|
}) {
|
|
2485
2656
|
const fileContent = await readFileContent(
|
|
2486
|
-
(0,
|
|
2657
|
+
(0, import_node_path25.join)(
|
|
2487
2658
|
baseDir,
|
|
2488
2659
|
this.getSettablePaths().relativeDirPath,
|
|
2489
2660
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2500,7 +2671,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2500
2671
|
};
|
|
2501
2672
|
|
|
2502
2673
|
// src/features/ignore/roo-ignore.ts
|
|
2503
|
-
var
|
|
2674
|
+
var import_node_path26 = require("path");
|
|
2504
2675
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2505
2676
|
static getSettablePaths() {
|
|
2506
2677
|
return {
|
|
@@ -2527,7 +2698,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2527
2698
|
validate = true
|
|
2528
2699
|
}) {
|
|
2529
2700
|
const fileContent = await readFileContent(
|
|
2530
|
-
(0,
|
|
2701
|
+
(0, import_node_path26.join)(
|
|
2531
2702
|
baseDir,
|
|
2532
2703
|
this.getSettablePaths().relativeDirPath,
|
|
2533
2704
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2544,7 +2715,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2544
2715
|
};
|
|
2545
2716
|
|
|
2546
2717
|
// src/features/ignore/windsurf-ignore.ts
|
|
2547
|
-
var
|
|
2718
|
+
var import_node_path27 = require("path");
|
|
2548
2719
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2549
2720
|
static getSettablePaths() {
|
|
2550
2721
|
return {
|
|
@@ -2571,7 +2742,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2571
2742
|
validate = true
|
|
2572
2743
|
}) {
|
|
2573
2744
|
const fileContent = await readFileContent(
|
|
2574
|
-
(0,
|
|
2745
|
+
(0, import_node_path27.join)(
|
|
2575
2746
|
baseDir,
|
|
2576
2747
|
this.getSettablePaths().relativeDirPath,
|
|
2577
2748
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2601,7 +2772,7 @@ var ignoreProcessorToolTargets = [
|
|
|
2601
2772
|
"roo",
|
|
2602
2773
|
"windsurf"
|
|
2603
2774
|
];
|
|
2604
|
-
var IgnoreProcessorToolTargetSchema =
|
|
2775
|
+
var IgnoreProcessorToolTargetSchema = import_mini12.z.enum(ignoreProcessorToolTargets);
|
|
2605
2776
|
var IgnoreProcessor = class extends FeatureProcessor {
|
|
2606
2777
|
toolTarget;
|
|
2607
2778
|
constructor({
|
|
@@ -2784,54 +2955,54 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2784
2955
|
};
|
|
2785
2956
|
|
|
2786
2957
|
// src/features/mcp/mcp-processor.ts
|
|
2787
|
-
var
|
|
2958
|
+
var import_mini17 = require("zod/mini");
|
|
2788
2959
|
|
|
2789
2960
|
// src/features/mcp/amazonqcli-mcp.ts
|
|
2790
|
-
var
|
|
2961
|
+
var import_node_path29 = require("path");
|
|
2791
2962
|
|
|
2792
2963
|
// src/features/mcp/rulesync-mcp.ts
|
|
2793
|
-
var
|
|
2964
|
+
var import_node_path28 = require("path");
|
|
2794
2965
|
var import_object = require("es-toolkit/object");
|
|
2795
|
-
var
|
|
2966
|
+
var import_mini14 = require("zod/mini");
|
|
2796
2967
|
|
|
2797
2968
|
// 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:
|
|
2969
|
+
var import_mini13 = require("zod/mini");
|
|
2970
|
+
var McpServerSchema = import_mini13.z.object({
|
|
2971
|
+
type: import_mini13.z.optional(import_mini13.z.enum(["stdio", "sse", "http"])),
|
|
2972
|
+
command: import_mini13.z.optional(import_mini13.z.union([import_mini13.z.string(), import_mini13.z.array(import_mini13.z.string())])),
|
|
2973
|
+
args: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2974
|
+
url: import_mini13.z.optional(import_mini13.z.string()),
|
|
2975
|
+
httpUrl: import_mini13.z.optional(import_mini13.z.string()),
|
|
2976
|
+
env: import_mini13.z.optional(import_mini13.z.record(import_mini13.z.string(), import_mini13.z.string())),
|
|
2977
|
+
disabled: import_mini13.z.optional(import_mini13.z.boolean()),
|
|
2978
|
+
networkTimeout: import_mini13.z.optional(import_mini13.z.number()),
|
|
2979
|
+
timeout: import_mini13.z.optional(import_mini13.z.number()),
|
|
2980
|
+
trust: import_mini13.z.optional(import_mini13.z.boolean()),
|
|
2981
|
+
cwd: import_mini13.z.optional(import_mini13.z.string()),
|
|
2982
|
+
transport: import_mini13.z.optional(import_mini13.z.enum(["stdio", "sse", "http"])),
|
|
2983
|
+
alwaysAllow: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2984
|
+
tools: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2985
|
+
kiroAutoApprove: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2986
|
+
kiroAutoBlock: import_mini13.z.optional(import_mini13.z.array(import_mini13.z.string())),
|
|
2987
|
+
headers: import_mini13.z.optional(import_mini13.z.record(import_mini13.z.string(), import_mini13.z.string()))
|
|
2817
2988
|
});
|
|
2818
|
-
var McpServersSchema =
|
|
2989
|
+
var McpServersSchema = import_mini13.z.record(import_mini13.z.string(), McpServerSchema);
|
|
2819
2990
|
|
|
2820
2991
|
// src/features/mcp/rulesync-mcp.ts
|
|
2821
|
-
var RulesyncMcpServerSchema =
|
|
2822
|
-
|
|
2823
|
-
targets:
|
|
2824
|
-
description:
|
|
2825
|
-
exposed:
|
|
2992
|
+
var RulesyncMcpServerSchema = import_mini14.z.union([
|
|
2993
|
+
import_mini14.z.extend(McpServerSchema, {
|
|
2994
|
+
targets: import_mini14.z.optional(RulesyncTargetsSchema),
|
|
2995
|
+
description: import_mini14.z.optional(import_mini14.z.string()),
|
|
2996
|
+
exposed: import_mini14.z.optional(import_mini14.z.literal(false))
|
|
2826
2997
|
}),
|
|
2827
|
-
|
|
2828
|
-
targets:
|
|
2829
|
-
description:
|
|
2830
|
-
exposed:
|
|
2998
|
+
import_mini14.z.extend(McpServerSchema, {
|
|
2999
|
+
targets: import_mini14.z.optional(RulesyncTargetsSchema),
|
|
3000
|
+
description: import_mini14.z.undefined(),
|
|
3001
|
+
exposed: import_mini14.z.literal(true)
|
|
2831
3002
|
})
|
|
2832
3003
|
]);
|
|
2833
|
-
var RulesyncMcpConfigSchema =
|
|
2834
|
-
mcpServers:
|
|
3004
|
+
var RulesyncMcpConfigSchema = import_mini14.z.object({
|
|
3005
|
+
mcpServers: import_mini14.z.record(import_mini14.z.string(), RulesyncMcpServerSchema)
|
|
2835
3006
|
});
|
|
2836
3007
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2837
3008
|
json;
|
|
@@ -2872,12 +3043,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2872
3043
|
}) {
|
|
2873
3044
|
const baseDir = process.cwd();
|
|
2874
3045
|
const paths = this.getSettablePaths();
|
|
2875
|
-
const recommendedPath = (0,
|
|
3046
|
+
const recommendedPath = (0, import_node_path28.join)(
|
|
2876
3047
|
baseDir,
|
|
2877
3048
|
paths.recommended.relativeDirPath,
|
|
2878
3049
|
paths.recommended.relativeFilePath
|
|
2879
3050
|
);
|
|
2880
|
-
const legacyPath = (0,
|
|
3051
|
+
const legacyPath = (0, import_node_path28.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
2881
3052
|
if (await fileExists(recommendedPath)) {
|
|
2882
3053
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
2883
3054
|
return new _RulesyncMcp({
|
|
@@ -2997,7 +3168,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2997
3168
|
validate = true
|
|
2998
3169
|
}) {
|
|
2999
3170
|
const fileContent = await readFileContent(
|
|
3000
|
-
(0,
|
|
3171
|
+
(0, import_node_path29.join)(
|
|
3001
3172
|
baseDir,
|
|
3002
3173
|
this.getSettablePaths().relativeDirPath,
|
|
3003
3174
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3033,17 +3204,17 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
3033
3204
|
};
|
|
3034
3205
|
|
|
3035
3206
|
// src/features/mcp/claudecode-mcp.ts
|
|
3036
|
-
var
|
|
3207
|
+
var import_node_path31 = require("path");
|
|
3037
3208
|
|
|
3038
3209
|
// src/features/mcp/modular-mcp.ts
|
|
3039
|
-
var
|
|
3040
|
-
var
|
|
3041
|
-
var ModularMcpServerSchema =
|
|
3042
|
-
description:
|
|
3210
|
+
var import_node_path30 = require("path");
|
|
3211
|
+
var import_mini15 = require("zod/mini");
|
|
3212
|
+
var ModularMcpServerSchema = import_mini15.z.extend(McpServerSchema, {
|
|
3213
|
+
description: import_mini15.z.string()
|
|
3043
3214
|
// Required for modular-mcp
|
|
3044
3215
|
});
|
|
3045
|
-
var ModularMcpConfigSchema =
|
|
3046
|
-
mcpServers:
|
|
3216
|
+
var ModularMcpConfigSchema = import_mini15.z.object({
|
|
3217
|
+
mcpServers: import_mini15.z.record(import_mini15.z.string(), ModularMcpServerSchema)
|
|
3047
3218
|
});
|
|
3048
3219
|
var ModularMcp = class _ModularMcp extends AiFile {
|
|
3049
3220
|
json;
|
|
@@ -3099,7 +3270,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3099
3270
|
args: [
|
|
3100
3271
|
"-y",
|
|
3101
3272
|
"@kimuson/modular-mcp",
|
|
3102
|
-
(0,
|
|
3273
|
+
(0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3103
3274
|
],
|
|
3104
3275
|
env: {}
|
|
3105
3276
|
}
|
|
@@ -3164,7 +3335,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3164
3335
|
}) {
|
|
3165
3336
|
const paths = this.getSettablePaths({ global });
|
|
3166
3337
|
const fileContent = await readOrInitializeFileContent(
|
|
3167
|
-
(0,
|
|
3338
|
+
(0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3168
3339
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3169
3340
|
);
|
|
3170
3341
|
const json = JSON.parse(fileContent);
|
|
@@ -3186,7 +3357,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3186
3357
|
}) {
|
|
3187
3358
|
const paths = this.getSettablePaths({ global });
|
|
3188
3359
|
const fileContent = await readOrInitializeFileContent(
|
|
3189
|
-
(0,
|
|
3360
|
+
(0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3190
3361
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3191
3362
|
);
|
|
3192
3363
|
const json = JSON.parse(fileContent);
|
|
@@ -3221,7 +3392,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3221
3392
|
};
|
|
3222
3393
|
|
|
3223
3394
|
// src/features/mcp/cline-mcp.ts
|
|
3224
|
-
var
|
|
3395
|
+
var import_node_path32 = require("path");
|
|
3225
3396
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
3226
3397
|
json;
|
|
3227
3398
|
constructor(params) {
|
|
@@ -3242,7 +3413,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3242
3413
|
validate = true
|
|
3243
3414
|
}) {
|
|
3244
3415
|
const fileContent = await readFileContent(
|
|
3245
|
-
(0,
|
|
3416
|
+
(0, import_node_path32.join)(
|
|
3246
3417
|
baseDir,
|
|
3247
3418
|
this.getSettablePaths().relativeDirPath,
|
|
3248
3419
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3278,7 +3449,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3278
3449
|
};
|
|
3279
3450
|
|
|
3280
3451
|
// src/features/mcp/codexcli-mcp.ts
|
|
3281
|
-
var
|
|
3452
|
+
var import_node_path33 = require("path");
|
|
3282
3453
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
3283
3454
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
3284
3455
|
toml;
|
|
@@ -3314,7 +3485,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3314
3485
|
}) {
|
|
3315
3486
|
const paths = this.getSettablePaths({ global });
|
|
3316
3487
|
const fileContent = await readFileContent(
|
|
3317
|
-
(0,
|
|
3488
|
+
(0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3318
3489
|
);
|
|
3319
3490
|
return new _CodexcliMcp({
|
|
3320
3491
|
baseDir,
|
|
@@ -3331,7 +3502,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3331
3502
|
global = false
|
|
3332
3503
|
}) {
|
|
3333
3504
|
const paths = this.getSettablePaths({ global });
|
|
3334
|
-
const configTomlFilePath = (0,
|
|
3505
|
+
const configTomlFilePath = (0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3335
3506
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
3336
3507
|
configTomlFilePath,
|
|
3337
3508
|
smolToml.stringify({})
|
|
@@ -3372,7 +3543,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3372
3543
|
};
|
|
3373
3544
|
|
|
3374
3545
|
// src/features/mcp/copilot-mcp.ts
|
|
3375
|
-
var
|
|
3546
|
+
var import_node_path34 = require("path");
|
|
3376
3547
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
3377
3548
|
json;
|
|
3378
3549
|
constructor(params) {
|
|
@@ -3393,7 +3564,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3393
3564
|
validate = true
|
|
3394
3565
|
}) {
|
|
3395
3566
|
const fileContent = await readFileContent(
|
|
3396
|
-
(0,
|
|
3567
|
+
(0, import_node_path34.join)(
|
|
3397
3568
|
baseDir,
|
|
3398
3569
|
this.getSettablePaths().relativeDirPath,
|
|
3399
3570
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3429,7 +3600,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3429
3600
|
};
|
|
3430
3601
|
|
|
3431
3602
|
// src/features/mcp/cursor-mcp.ts
|
|
3432
|
-
var
|
|
3603
|
+
var import_node_path35 = require("path");
|
|
3433
3604
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
3434
3605
|
json;
|
|
3435
3606
|
constructor(params) {
|
|
@@ -3450,7 +3621,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3450
3621
|
validate = true
|
|
3451
3622
|
}) {
|
|
3452
3623
|
const fileContent = await readFileContent(
|
|
3453
|
-
(0,
|
|
3624
|
+
(0, import_node_path35.join)(
|
|
3454
3625
|
baseDir,
|
|
3455
3626
|
this.getSettablePaths().relativeDirPath,
|
|
3456
3627
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3497,7 +3668,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3497
3668
|
};
|
|
3498
3669
|
|
|
3499
3670
|
// src/features/mcp/geminicli-mcp.ts
|
|
3500
|
-
var
|
|
3671
|
+
var import_node_path36 = require("path");
|
|
3501
3672
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3502
3673
|
json;
|
|
3503
3674
|
constructor(params) {
|
|
@@ -3526,7 +3697,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3526
3697
|
}) {
|
|
3527
3698
|
const paths = this.getSettablePaths({ global });
|
|
3528
3699
|
const fileContent = await readOrInitializeFileContent(
|
|
3529
|
-
(0,
|
|
3700
|
+
(0, import_node_path36.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3530
3701
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3531
3702
|
);
|
|
3532
3703
|
const json = JSON.parse(fileContent);
|
|
@@ -3547,7 +3718,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3547
3718
|
}) {
|
|
3548
3719
|
const paths = this.getSettablePaths({ global });
|
|
3549
3720
|
const fileContent = await readOrInitializeFileContent(
|
|
3550
|
-
(0,
|
|
3721
|
+
(0, import_node_path36.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3551
3722
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3552
3723
|
);
|
|
3553
3724
|
const json = JSON.parse(fileContent);
|
|
@@ -3571,7 +3742,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3571
3742
|
};
|
|
3572
3743
|
|
|
3573
3744
|
// src/features/mcp/junie-mcp.ts
|
|
3574
|
-
var
|
|
3745
|
+
var import_node_path37 = require("path");
|
|
3575
3746
|
var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
3576
3747
|
json;
|
|
3577
3748
|
constructor(params) {
|
|
@@ -3583,7 +3754,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3583
3754
|
}
|
|
3584
3755
|
static getSettablePaths() {
|
|
3585
3756
|
return {
|
|
3586
|
-
relativeDirPath: (0,
|
|
3757
|
+
relativeDirPath: (0, import_node_path37.join)(".junie", "mcp"),
|
|
3587
3758
|
relativeFilePath: "mcp.json"
|
|
3588
3759
|
};
|
|
3589
3760
|
}
|
|
@@ -3592,7 +3763,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3592
3763
|
validate = true
|
|
3593
3764
|
}) {
|
|
3594
3765
|
const fileContent = await readFileContent(
|
|
3595
|
-
(0,
|
|
3766
|
+
(0, import_node_path37.join)(
|
|
3596
3767
|
baseDir,
|
|
3597
3768
|
this.getSettablePaths().relativeDirPath,
|
|
3598
3769
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3628,28 +3799,28 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
|
|
|
3628
3799
|
};
|
|
3629
3800
|
|
|
3630
3801
|
// src/features/mcp/opencode-mcp.ts
|
|
3631
|
-
var
|
|
3632
|
-
var
|
|
3633
|
-
var OpencodeMcpLocalServerSchema =
|
|
3634
|
-
type:
|
|
3635
|
-
command:
|
|
3636
|
-
environment:
|
|
3637
|
-
enabled:
|
|
3638
|
-
cwd:
|
|
3802
|
+
var import_node_path38 = require("path");
|
|
3803
|
+
var import_mini16 = require("zod/mini");
|
|
3804
|
+
var OpencodeMcpLocalServerSchema = import_mini16.z.object({
|
|
3805
|
+
type: import_mini16.z.literal("local"),
|
|
3806
|
+
command: import_mini16.z.array(import_mini16.z.string()),
|
|
3807
|
+
environment: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
|
|
3808
|
+
enabled: import_mini16.z._default(import_mini16.z.boolean(), true),
|
|
3809
|
+
cwd: import_mini16.z.optional(import_mini16.z.string())
|
|
3639
3810
|
});
|
|
3640
|
-
var OpencodeMcpRemoteServerSchema =
|
|
3641
|
-
type:
|
|
3642
|
-
url:
|
|
3643
|
-
headers:
|
|
3644
|
-
enabled:
|
|
3811
|
+
var OpencodeMcpRemoteServerSchema = import_mini16.z.object({
|
|
3812
|
+
type: import_mini16.z.literal("remote"),
|
|
3813
|
+
url: import_mini16.z.string(),
|
|
3814
|
+
headers: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), import_mini16.z.string())),
|
|
3815
|
+
enabled: import_mini16.z._default(import_mini16.z.boolean(), true)
|
|
3645
3816
|
});
|
|
3646
|
-
var OpencodeMcpServerSchema =
|
|
3817
|
+
var OpencodeMcpServerSchema = import_mini16.z.union([
|
|
3647
3818
|
OpencodeMcpLocalServerSchema,
|
|
3648
3819
|
OpencodeMcpRemoteServerSchema
|
|
3649
3820
|
]);
|
|
3650
|
-
var OpencodeConfigSchema =
|
|
3651
|
-
$schema:
|
|
3652
|
-
mcp:
|
|
3821
|
+
var OpencodeConfigSchema = import_mini16.z.looseObject({
|
|
3822
|
+
$schema: import_mini16.z.optional(import_mini16.z.string()),
|
|
3823
|
+
mcp: import_mini16.z.optional(import_mini16.z.record(import_mini16.z.string(), OpencodeMcpServerSchema))
|
|
3653
3824
|
});
|
|
3654
3825
|
function convertFromOpencodeFormat(opencodeMcp) {
|
|
3655
3826
|
return Object.fromEntries(
|
|
@@ -3746,7 +3917,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3746
3917
|
}) {
|
|
3747
3918
|
const paths = this.getSettablePaths({ global });
|
|
3748
3919
|
const fileContent = await readOrInitializeFileContent(
|
|
3749
|
-
(0,
|
|
3920
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3750
3921
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
3751
3922
|
);
|
|
3752
3923
|
const json = JSON.parse(fileContent);
|
|
@@ -3767,7 +3938,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3767
3938
|
}) {
|
|
3768
3939
|
const paths = this.getSettablePaths({ global });
|
|
3769
3940
|
const fileContent = await readOrInitializeFileContent(
|
|
3770
|
-
(0,
|
|
3941
|
+
(0, import_node_path38.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3771
3942
|
JSON.stringify({ mcp: {} }, null, 2)
|
|
3772
3943
|
);
|
|
3773
3944
|
const json = JSON.parse(fileContent);
|
|
@@ -3798,7 +3969,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
|
|
|
3798
3969
|
};
|
|
3799
3970
|
|
|
3800
3971
|
// src/features/mcp/roo-mcp.ts
|
|
3801
|
-
var
|
|
3972
|
+
var import_node_path39 = require("path");
|
|
3802
3973
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
3803
3974
|
json;
|
|
3804
3975
|
constructor(params) {
|
|
@@ -3819,7 +3990,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
3819
3990
|
validate = true
|
|
3820
3991
|
}) {
|
|
3821
3992
|
const fileContent = await readFileContent(
|
|
3822
|
-
(0,
|
|
3993
|
+
(0, import_node_path39.join)(
|
|
3823
3994
|
baseDir,
|
|
3824
3995
|
this.getSettablePaths().relativeDirPath,
|
|
3825
3996
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3867,7 +4038,7 @@ var mcpProcessorToolTargets = [
|
|
|
3867
4038
|
"opencode",
|
|
3868
4039
|
"roo"
|
|
3869
4040
|
];
|
|
3870
|
-
var McpProcessorToolTargetSchema =
|
|
4041
|
+
var McpProcessorToolTargetSchema = import_mini17.z.enum(
|
|
3871
4042
|
// 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
4043
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3873
4044
|
);
|
|
@@ -4139,22 +4310,22 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
4139
4310
|
};
|
|
4140
4311
|
|
|
4141
4312
|
// src/features/rules/rules-processor.ts
|
|
4142
|
-
var
|
|
4313
|
+
var import_node_path81 = require("path");
|
|
4143
4314
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
4144
|
-
var
|
|
4315
|
+
var import_mini30 = require("zod/mini");
|
|
4145
4316
|
|
|
4146
4317
|
// src/features/skills/codexcli-skill.ts
|
|
4147
|
-
var
|
|
4318
|
+
var import_node_path42 = require("path");
|
|
4148
4319
|
|
|
4149
4320
|
// src/features/skills/simulated-skill.ts
|
|
4150
|
-
var
|
|
4151
|
-
var
|
|
4321
|
+
var import_node_path41 = require("path");
|
|
4322
|
+
var import_mini18 = require("zod/mini");
|
|
4152
4323
|
|
|
4153
4324
|
// src/constants/general.ts
|
|
4154
4325
|
var SKILL_FILE_NAME = "SKILL.md";
|
|
4155
4326
|
|
|
4156
4327
|
// src/types/ai-dir.ts
|
|
4157
|
-
var
|
|
4328
|
+
var import_node_path40 = __toESM(require("path"), 1);
|
|
4158
4329
|
var AiDir = class {
|
|
4159
4330
|
/**
|
|
4160
4331
|
* @example "."
|
|
@@ -4188,7 +4359,7 @@ var AiDir = class {
|
|
|
4188
4359
|
otherFiles = [],
|
|
4189
4360
|
global = false
|
|
4190
4361
|
}) {
|
|
4191
|
-
if (dirName.includes(
|
|
4362
|
+
if (dirName.includes(import_node_path40.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
|
|
4192
4363
|
throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
|
|
4193
4364
|
}
|
|
4194
4365
|
this.baseDir = baseDir;
|
|
@@ -4211,11 +4382,11 @@ var AiDir = class {
|
|
|
4211
4382
|
return this.dirName;
|
|
4212
4383
|
}
|
|
4213
4384
|
getDirPath() {
|
|
4214
|
-
const fullPath =
|
|
4215
|
-
const resolvedFull = (0,
|
|
4216
|
-
const resolvedBase = (0,
|
|
4217
|
-
const rel = (0,
|
|
4218
|
-
if (rel.startsWith("..") ||
|
|
4385
|
+
const fullPath = import_node_path40.default.join(this.baseDir, this.relativeDirPath, this.dirName);
|
|
4386
|
+
const resolvedFull = (0, import_node_path40.resolve)(fullPath);
|
|
4387
|
+
const resolvedBase = (0, import_node_path40.resolve)(this.baseDir);
|
|
4388
|
+
const rel = (0, import_node_path40.relative)(resolvedBase, resolvedFull);
|
|
4389
|
+
if (rel.startsWith("..") || import_node_path40.default.isAbsolute(rel)) {
|
|
4219
4390
|
throw new Error(
|
|
4220
4391
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
|
|
4221
4392
|
);
|
|
@@ -4229,7 +4400,7 @@ var AiDir = class {
|
|
|
4229
4400
|
return this.otherFiles;
|
|
4230
4401
|
}
|
|
4231
4402
|
getRelativePathFromCwd() {
|
|
4232
|
-
return
|
|
4403
|
+
return import_node_path40.default.join(this.relativeDirPath, this.dirName);
|
|
4233
4404
|
}
|
|
4234
4405
|
getGlobal() {
|
|
4235
4406
|
return this.global;
|
|
@@ -4248,15 +4419,15 @@ var AiDir = class {
|
|
|
4248
4419
|
* @returns Array of files with their relative paths and buffers
|
|
4249
4420
|
*/
|
|
4250
4421
|
static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
|
|
4251
|
-
const dirPath = (0,
|
|
4252
|
-
const glob = (0,
|
|
4422
|
+
const dirPath = (0, import_node_path40.join)(baseDir, relativeDirPath, dirName);
|
|
4423
|
+
const glob = (0, import_node_path40.join)(dirPath, "**", "*");
|
|
4253
4424
|
const filePaths = await findFilesByGlobs(glob, { type: "file" });
|
|
4254
|
-
const filteredPaths = filePaths.filter((filePath) => (0,
|
|
4425
|
+
const filteredPaths = filePaths.filter((filePath) => (0, import_node_path40.basename)(filePath) !== excludeFileName);
|
|
4255
4426
|
const files = await Promise.all(
|
|
4256
4427
|
filteredPaths.map(async (filePath) => {
|
|
4257
4428
|
const fileBuffer = await readFileBuffer(filePath);
|
|
4258
4429
|
return {
|
|
4259
|
-
relativeFilePathToDirPath: (0,
|
|
4430
|
+
relativeFilePathToDirPath: (0, import_node_path40.relative)(dirPath, filePath),
|
|
4260
4431
|
fileBuffer
|
|
4261
4432
|
};
|
|
4262
4433
|
})
|
|
@@ -4322,9 +4493,9 @@ var ToolSkill = class extends AiDir {
|
|
|
4322
4493
|
};
|
|
4323
4494
|
|
|
4324
4495
|
// src/features/skills/simulated-skill.ts
|
|
4325
|
-
var SimulatedSkillFrontmatterSchema =
|
|
4326
|
-
name:
|
|
4327
|
-
description:
|
|
4496
|
+
var SimulatedSkillFrontmatterSchema = import_mini18.z.object({
|
|
4497
|
+
name: import_mini18.z.string(),
|
|
4498
|
+
description: import_mini18.z.string()
|
|
4328
4499
|
});
|
|
4329
4500
|
var SimulatedSkill = class extends ToolSkill {
|
|
4330
4501
|
frontmatter;
|
|
@@ -4355,7 +4526,7 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
4355
4526
|
const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
|
|
4356
4527
|
if (!result.success) {
|
|
4357
4528
|
throw new Error(
|
|
4358
|
-
`Invalid frontmatter in ${(0,
|
|
4529
|
+
`Invalid frontmatter in ${(0, import_node_path41.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
|
|
4359
4530
|
);
|
|
4360
4531
|
}
|
|
4361
4532
|
}
|
|
@@ -4420,8 +4591,8 @@ var SimulatedSkill = class extends ToolSkill {
|
|
|
4420
4591
|
}) {
|
|
4421
4592
|
const settablePaths = this.getSettablePaths();
|
|
4422
4593
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
4423
|
-
const skillDirPath = (0,
|
|
4424
|
-
const skillFilePath = (0,
|
|
4594
|
+
const skillDirPath = (0, import_node_path41.join)(baseDir, actualRelativeDirPath, dirName);
|
|
4595
|
+
const skillFilePath = (0, import_node_path41.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4425
4596
|
if (!await fileExists(skillFilePath)) {
|
|
4426
4597
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4427
4598
|
}
|
|
@@ -4473,7 +4644,7 @@ var CodexCliSkill = class _CodexCliSkill extends SimulatedSkill {
|
|
|
4473
4644
|
throw new Error("CodexCliSkill does not support global mode.");
|
|
4474
4645
|
}
|
|
4475
4646
|
return {
|
|
4476
|
-
relativeDirPath: (0,
|
|
4647
|
+
relativeDirPath: (0, import_node_path42.join)(".codex", "skills")
|
|
4477
4648
|
};
|
|
4478
4649
|
}
|
|
4479
4650
|
static async fromDir(params) {
|
|
@@ -4496,14 +4667,14 @@ var CodexCliSkill = class _CodexCliSkill extends SimulatedSkill {
|
|
|
4496
4667
|
};
|
|
4497
4668
|
|
|
4498
4669
|
// src/features/skills/copilot-skill.ts
|
|
4499
|
-
var
|
|
4670
|
+
var import_node_path43 = require("path");
|
|
4500
4671
|
var CopilotSkill = class _CopilotSkill extends SimulatedSkill {
|
|
4501
4672
|
static getSettablePaths(options) {
|
|
4502
4673
|
if (options?.global) {
|
|
4503
4674
|
throw new Error("CopilotSkill does not support global mode.");
|
|
4504
4675
|
}
|
|
4505
4676
|
return {
|
|
4506
|
-
relativeDirPath: (0,
|
|
4677
|
+
relativeDirPath: (0, import_node_path43.join)(".github", "skills")
|
|
4507
4678
|
};
|
|
4508
4679
|
}
|
|
4509
4680
|
static async fromDir(params) {
|
|
@@ -4526,14 +4697,14 @@ var CopilotSkill = class _CopilotSkill extends SimulatedSkill {
|
|
|
4526
4697
|
};
|
|
4527
4698
|
|
|
4528
4699
|
// src/features/skills/cursor-skill.ts
|
|
4529
|
-
var
|
|
4700
|
+
var import_node_path44 = require("path");
|
|
4530
4701
|
var CursorSkill = class _CursorSkill extends SimulatedSkill {
|
|
4531
4702
|
static getSettablePaths(options) {
|
|
4532
4703
|
if (options?.global) {
|
|
4533
4704
|
throw new Error("CursorSkill does not support global mode.");
|
|
4534
4705
|
}
|
|
4535
4706
|
return {
|
|
4536
|
-
relativeDirPath: (0,
|
|
4707
|
+
relativeDirPath: (0, import_node_path44.join)(".cursor", "skills")
|
|
4537
4708
|
};
|
|
4538
4709
|
}
|
|
4539
4710
|
static async fromDir(params) {
|
|
@@ -4556,11 +4727,11 @@ var CursorSkill = class _CursorSkill extends SimulatedSkill {
|
|
|
4556
4727
|
};
|
|
4557
4728
|
|
|
4558
4729
|
// src/features/skills/skills-processor.ts
|
|
4559
|
-
var
|
|
4560
|
-
var
|
|
4730
|
+
var import_node_path50 = require("path");
|
|
4731
|
+
var import_mini21 = require("zod/mini");
|
|
4561
4732
|
|
|
4562
4733
|
// src/types/dir-feature-processor.ts
|
|
4563
|
-
var
|
|
4734
|
+
var import_node_path45 = require("path");
|
|
4564
4735
|
var DirFeatureProcessor = class {
|
|
4565
4736
|
baseDir;
|
|
4566
4737
|
constructor({ baseDir = process.cwd() }) {
|
|
@@ -4582,14 +4753,14 @@ var DirFeatureProcessor = class {
|
|
|
4582
4753
|
await ensureDir(dirPath);
|
|
4583
4754
|
const mainFile = aiDir.getMainFile();
|
|
4584
4755
|
if (mainFile) {
|
|
4585
|
-
const mainFilePath = (0,
|
|
4756
|
+
const mainFilePath = (0, import_node_path45.join)(dirPath, mainFile.name);
|
|
4586
4757
|
const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
|
|
4587
4758
|
const contentWithNewline = addTrailingNewline(content);
|
|
4588
4759
|
await writeFileContent(mainFilePath, contentWithNewline);
|
|
4589
4760
|
}
|
|
4590
4761
|
const otherFiles = aiDir.getOtherFiles();
|
|
4591
4762
|
for (const file of otherFiles) {
|
|
4592
|
-
const filePath = (0,
|
|
4763
|
+
const filePath = (0, import_node_path45.join)(dirPath, file.relativeFilePathToDirPath);
|
|
4593
4764
|
const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
|
|
4594
4765
|
await writeFileContent(filePath, contentWithNewline);
|
|
4595
4766
|
}
|
|
@@ -4604,14 +4775,14 @@ var DirFeatureProcessor = class {
|
|
|
4604
4775
|
};
|
|
4605
4776
|
|
|
4606
4777
|
// src/features/skills/agentsmd-skill.ts
|
|
4607
|
-
var
|
|
4778
|
+
var import_node_path46 = require("path");
|
|
4608
4779
|
var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
4609
4780
|
static getSettablePaths(options) {
|
|
4610
4781
|
if (options?.global) {
|
|
4611
4782
|
throw new Error("AgentsmdSkill does not support global mode.");
|
|
4612
4783
|
}
|
|
4613
4784
|
return {
|
|
4614
|
-
relativeDirPath: (0,
|
|
4785
|
+
relativeDirPath: (0, import_node_path46.join)(".agents", "skills")
|
|
4615
4786
|
};
|
|
4616
4787
|
}
|
|
4617
4788
|
static async fromDir(params) {
|
|
@@ -4634,19 +4805,19 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
|
|
|
4634
4805
|
};
|
|
4635
4806
|
|
|
4636
4807
|
// src/features/skills/claudecode-skill.ts
|
|
4637
|
-
var
|
|
4638
|
-
var
|
|
4808
|
+
var import_node_path48 = require("path");
|
|
4809
|
+
var import_mini20 = require("zod/mini");
|
|
4639
4810
|
|
|
4640
4811
|
// src/features/skills/rulesync-skill.ts
|
|
4641
|
-
var
|
|
4642
|
-
var
|
|
4643
|
-
var RulesyncSkillFrontmatterSchemaInternal =
|
|
4644
|
-
name:
|
|
4645
|
-
description:
|
|
4646
|
-
targets:
|
|
4647
|
-
claudecode:
|
|
4648
|
-
|
|
4649
|
-
"allowed-tools":
|
|
4812
|
+
var import_node_path47 = require("path");
|
|
4813
|
+
var import_mini19 = require("zod/mini");
|
|
4814
|
+
var RulesyncSkillFrontmatterSchemaInternal = import_mini19.z.object({
|
|
4815
|
+
name: import_mini19.z.string(),
|
|
4816
|
+
description: import_mini19.z.string(),
|
|
4817
|
+
targets: import_mini19.z._default(RulesyncTargetsSchema, ["*"]),
|
|
4818
|
+
claudecode: import_mini19.z.optional(
|
|
4819
|
+
import_mini19.z.object({
|
|
4820
|
+
"allowed-tools": import_mini19.z.optional(import_mini19.z.array(import_mini19.z.string()))
|
|
4650
4821
|
})
|
|
4651
4822
|
)
|
|
4652
4823
|
});
|
|
@@ -4714,8 +4885,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
4714
4885
|
dirName,
|
|
4715
4886
|
global = false
|
|
4716
4887
|
}) {
|
|
4717
|
-
const skillDirPath = (0,
|
|
4718
|
-
const skillFilePath = (0,
|
|
4888
|
+
const skillDirPath = (0, import_node_path47.join)(baseDir, relativeDirPath, dirName);
|
|
4889
|
+
const skillFilePath = (0, import_node_path47.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4719
4890
|
if (!await fileExists(skillFilePath)) {
|
|
4720
4891
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4721
4892
|
}
|
|
@@ -4745,15 +4916,15 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
|
|
|
4745
4916
|
};
|
|
4746
4917
|
|
|
4747
4918
|
// src/features/skills/claudecode-skill.ts
|
|
4748
|
-
var ClaudecodeSkillFrontmatterSchema =
|
|
4749
|
-
name:
|
|
4750
|
-
description:
|
|
4751
|
-
"allowed-tools":
|
|
4919
|
+
var ClaudecodeSkillFrontmatterSchema = import_mini20.z.object({
|
|
4920
|
+
name: import_mini20.z.string(),
|
|
4921
|
+
description: import_mini20.z.string(),
|
|
4922
|
+
"allowed-tools": import_mini20.z.optional(import_mini20.z.array(import_mini20.z.string()))
|
|
4752
4923
|
});
|
|
4753
4924
|
var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
4754
4925
|
constructor({
|
|
4755
4926
|
baseDir = process.cwd(),
|
|
4756
|
-
relativeDirPath = (0,
|
|
4927
|
+
relativeDirPath = (0, import_node_path48.join)(".claude", "skills"),
|
|
4757
4928
|
dirName,
|
|
4758
4929
|
frontmatter,
|
|
4759
4930
|
body,
|
|
@@ -4784,7 +4955,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4784
4955
|
global: _global = false
|
|
4785
4956
|
} = {}) {
|
|
4786
4957
|
return {
|
|
4787
|
-
relativeDirPath: (0,
|
|
4958
|
+
relativeDirPath: (0, import_node_path48.join)(".claude", "skills")
|
|
4788
4959
|
};
|
|
4789
4960
|
}
|
|
4790
4961
|
getFrontmatter() {
|
|
@@ -4872,8 +5043,8 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4872
5043
|
}) {
|
|
4873
5044
|
const settablePaths = this.getSettablePaths({ global });
|
|
4874
5045
|
const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
|
|
4875
|
-
const skillDirPath = (0,
|
|
4876
|
-
const skillFilePath = (0,
|
|
5046
|
+
const skillDirPath = (0, import_node_path48.join)(baseDir, actualRelativeDirPath, dirName);
|
|
5047
|
+
const skillFilePath = (0, import_node_path48.join)(skillDirPath, SKILL_FILE_NAME);
|
|
4877
5048
|
if (!await fileExists(skillFilePath)) {
|
|
4878
5049
|
throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
|
|
4879
5050
|
}
|
|
@@ -4903,14 +5074,14 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
|
|
|
4903
5074
|
};
|
|
4904
5075
|
|
|
4905
5076
|
// src/features/skills/geminicli-skill.ts
|
|
4906
|
-
var
|
|
5077
|
+
var import_node_path49 = require("path");
|
|
4907
5078
|
var GeminiCliSkill = class _GeminiCliSkill extends SimulatedSkill {
|
|
4908
5079
|
static getSettablePaths(options) {
|
|
4909
5080
|
if (options?.global) {
|
|
4910
5081
|
throw new Error("GeminiCliSkill does not support global mode.");
|
|
4911
5082
|
}
|
|
4912
5083
|
return {
|
|
4913
|
-
relativeDirPath: (0,
|
|
5084
|
+
relativeDirPath: (0, import_node_path49.join)(".gemini", "skills")
|
|
4914
5085
|
};
|
|
4915
5086
|
}
|
|
4916
5087
|
static async fromDir(params) {
|
|
@@ -4949,7 +5120,7 @@ var skillsProcessorToolTargetsSimulated = [
|
|
|
4949
5120
|
"agentsmd"
|
|
4950
5121
|
];
|
|
4951
5122
|
var skillsProcessorToolTargetsGlobal = ["claudecode"];
|
|
4952
|
-
var SkillsProcessorToolTargetSchema =
|
|
5123
|
+
var SkillsProcessorToolTargetSchema = import_mini21.z.enum(skillsProcessorToolTargets);
|
|
4953
5124
|
var SkillsProcessor = class extends DirFeatureProcessor {
|
|
4954
5125
|
toolTarget;
|
|
4955
5126
|
global;
|
|
@@ -5060,9 +5231,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5060
5231
|
*/
|
|
5061
5232
|
async loadRulesyncDirs() {
|
|
5062
5233
|
const paths = RulesyncSkill.getSettablePaths();
|
|
5063
|
-
const rulesyncSkillsDirPath = (0,
|
|
5064
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5065
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
5234
|
+
const rulesyncSkillsDirPath = (0, import_node_path50.join)(this.baseDir, paths.relativeDirPath);
|
|
5235
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path50.join)(rulesyncSkillsDirPath, "*"), { type: "dir" });
|
|
5236
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path50.basename)(path3));
|
|
5066
5237
|
const rulesyncSkills = await Promise.all(
|
|
5067
5238
|
dirNames.map(
|
|
5068
5239
|
(dirName) => RulesyncSkill.fromDir({ baseDir: this.baseDir, dirName, global: this.global })
|
|
@@ -5101,9 +5272,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5101
5272
|
*/
|
|
5102
5273
|
async loadClaudecodeSkills() {
|
|
5103
5274
|
const paths = ClaudecodeSkill.getSettablePaths({ global: this.global });
|
|
5104
|
-
const skillsDirPath = (0,
|
|
5105
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5106
|
-
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));
|
|
5107
5278
|
const toolSkills = await Promise.all(
|
|
5108
5279
|
dirNames.map(
|
|
5109
5280
|
(dirName) => ClaudecodeSkill.fromDir({
|
|
@@ -5121,9 +5292,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5121
5292
|
*/
|
|
5122
5293
|
async loadSimulatedSkills(SkillClass) {
|
|
5123
5294
|
const paths = SkillClass.getSettablePaths();
|
|
5124
|
-
const skillsDirPath = (0,
|
|
5125
|
-
const dirPaths = await findFilesByGlobs((0,
|
|
5126
|
-
const dirNames = dirPaths.map((path3) => (0,
|
|
5295
|
+
const skillsDirPath = (0, import_node_path50.join)(this.baseDir, paths.relativeDirPath);
|
|
5296
|
+
const dirPaths = await findFilesByGlobs((0, import_node_path50.join)(skillsDirPath, "*"), { type: "dir" });
|
|
5297
|
+
const dirNames = dirPaths.map((path3) => (0, import_node_path50.basename)(path3));
|
|
5127
5298
|
const toolSkills = await Promise.all(
|
|
5128
5299
|
dirNames.map(
|
|
5129
5300
|
(dirName) => SkillClass.fromDir({
|
|
@@ -5168,11 +5339,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
|
|
|
5168
5339
|
};
|
|
5169
5340
|
|
|
5170
5341
|
// src/features/subagents/agentsmd-subagent.ts
|
|
5171
|
-
var
|
|
5342
|
+
var import_node_path52 = require("path");
|
|
5172
5343
|
|
|
5173
5344
|
// src/features/subagents/simulated-subagent.ts
|
|
5174
|
-
var
|
|
5175
|
-
var
|
|
5345
|
+
var import_node_path51 = require("path");
|
|
5346
|
+
var import_mini22 = require("zod/mini");
|
|
5176
5347
|
|
|
5177
5348
|
// src/features/subagents/tool-subagent.ts
|
|
5178
5349
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -5207,9 +5378,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
5207
5378
|
};
|
|
5208
5379
|
|
|
5209
5380
|
// src/features/subagents/simulated-subagent.ts
|
|
5210
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
5211
|
-
name:
|
|
5212
|
-
description:
|
|
5381
|
+
var SimulatedSubagentFrontmatterSchema = import_mini22.z.object({
|
|
5382
|
+
name: import_mini22.z.string(),
|
|
5383
|
+
description: import_mini22.z.string()
|
|
5213
5384
|
});
|
|
5214
5385
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
5215
5386
|
frontmatter;
|
|
@@ -5219,7 +5390,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5219
5390
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5220
5391
|
if (!result.success) {
|
|
5221
5392
|
throw new Error(
|
|
5222
|
-
`Invalid frontmatter in ${(0,
|
|
5393
|
+
`Invalid frontmatter in ${(0, import_node_path51.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5223
5394
|
);
|
|
5224
5395
|
}
|
|
5225
5396
|
}
|
|
@@ -5270,7 +5441,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5270
5441
|
return {
|
|
5271
5442
|
success: false,
|
|
5272
5443
|
error: new Error(
|
|
5273
|
-
`Invalid frontmatter in ${(0,
|
|
5444
|
+
`Invalid frontmatter in ${(0, import_node_path51.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5274
5445
|
)
|
|
5275
5446
|
};
|
|
5276
5447
|
}
|
|
@@ -5280,7 +5451,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5280
5451
|
relativeFilePath,
|
|
5281
5452
|
validate = true
|
|
5282
5453
|
}) {
|
|
5283
|
-
const filePath = (0,
|
|
5454
|
+
const filePath = (0, import_node_path51.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
5284
5455
|
const fileContent = await readFileContent(filePath);
|
|
5285
5456
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5286
5457
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -5290,7 +5461,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5290
5461
|
return {
|
|
5291
5462
|
baseDir,
|
|
5292
5463
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
5293
|
-
relativeFilePath: (0,
|
|
5464
|
+
relativeFilePath: (0, import_node_path51.basename)(relativeFilePath),
|
|
5294
5465
|
frontmatter: result.data,
|
|
5295
5466
|
body: content.trim(),
|
|
5296
5467
|
validate
|
|
@@ -5302,7 +5473,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
5302
5473
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
5303
5474
|
static getSettablePaths() {
|
|
5304
5475
|
return {
|
|
5305
|
-
relativeDirPath: (0,
|
|
5476
|
+
relativeDirPath: (0, import_node_path52.join)(".agents", "subagents")
|
|
5306
5477
|
};
|
|
5307
5478
|
}
|
|
5308
5479
|
static async fromFile(params) {
|
|
@@ -5322,11 +5493,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
5322
5493
|
};
|
|
5323
5494
|
|
|
5324
5495
|
// src/features/subagents/codexcli-subagent.ts
|
|
5325
|
-
var
|
|
5496
|
+
var import_node_path53 = require("path");
|
|
5326
5497
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
5327
5498
|
static getSettablePaths() {
|
|
5328
5499
|
return {
|
|
5329
|
-
relativeDirPath: (0,
|
|
5500
|
+
relativeDirPath: (0, import_node_path53.join)(".codex", "subagents")
|
|
5330
5501
|
};
|
|
5331
5502
|
}
|
|
5332
5503
|
static async fromFile(params) {
|
|
@@ -5346,11 +5517,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
5346
5517
|
};
|
|
5347
5518
|
|
|
5348
5519
|
// src/features/subagents/copilot-subagent.ts
|
|
5349
|
-
var
|
|
5520
|
+
var import_node_path54 = require("path");
|
|
5350
5521
|
var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
5351
5522
|
static getSettablePaths() {
|
|
5352
5523
|
return {
|
|
5353
|
-
relativeDirPath: (0,
|
|
5524
|
+
relativeDirPath: (0, import_node_path54.join)(".github", "subagents")
|
|
5354
5525
|
};
|
|
5355
5526
|
}
|
|
5356
5527
|
static async fromFile(params) {
|
|
@@ -5370,11 +5541,11 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
|
5370
5541
|
};
|
|
5371
5542
|
|
|
5372
5543
|
// src/features/subagents/cursor-subagent.ts
|
|
5373
|
-
var
|
|
5544
|
+
var import_node_path55 = require("path");
|
|
5374
5545
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
5375
5546
|
static getSettablePaths() {
|
|
5376
5547
|
return {
|
|
5377
|
-
relativeDirPath: (0,
|
|
5548
|
+
relativeDirPath: (0, import_node_path55.join)(".cursor", "subagents")
|
|
5378
5549
|
};
|
|
5379
5550
|
}
|
|
5380
5551
|
static async fromFile(params) {
|
|
@@ -5394,11 +5565,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
5394
5565
|
};
|
|
5395
5566
|
|
|
5396
5567
|
// src/features/subagents/geminicli-subagent.ts
|
|
5397
|
-
var
|
|
5568
|
+
var import_node_path56 = require("path");
|
|
5398
5569
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
5399
5570
|
static getSettablePaths() {
|
|
5400
5571
|
return {
|
|
5401
|
-
relativeDirPath: (0,
|
|
5572
|
+
relativeDirPath: (0, import_node_path56.join)(".gemini", "subagents")
|
|
5402
5573
|
};
|
|
5403
5574
|
}
|
|
5404
5575
|
static async fromFile(params) {
|
|
@@ -5418,11 +5589,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
5418
5589
|
};
|
|
5419
5590
|
|
|
5420
5591
|
// src/features/subagents/roo-subagent.ts
|
|
5421
|
-
var
|
|
5592
|
+
var import_node_path57 = require("path");
|
|
5422
5593
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
5423
5594
|
static getSettablePaths() {
|
|
5424
5595
|
return {
|
|
5425
|
-
relativeDirPath: (0,
|
|
5596
|
+
relativeDirPath: (0, import_node_path57.join)(".roo", "subagents")
|
|
5426
5597
|
};
|
|
5427
5598
|
}
|
|
5428
5599
|
static async fromFile(params) {
|
|
@@ -5442,26 +5613,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
5442
5613
|
};
|
|
5443
5614
|
|
|
5444
5615
|
// src/features/subagents/subagents-processor.ts
|
|
5616
|
+
var import_node_path60 = require("path");
|
|
5617
|
+
var import_mini25 = require("zod/mini");
|
|
5618
|
+
|
|
5619
|
+
// src/features/subagents/claudecode-subagent.ts
|
|
5445
5620
|
var import_node_path59 = require("path");
|
|
5446
5621
|
var import_mini24 = require("zod/mini");
|
|
5447
5622
|
|
|
5448
|
-
// src/features/subagents/
|
|
5623
|
+
// src/features/subagents/rulesync-subagent.ts
|
|
5449
5624
|
var import_node_path58 = require("path");
|
|
5450
5625
|
var import_mini23 = require("zod/mini");
|
|
5451
|
-
|
|
5452
|
-
// src/features/subagents/rulesync-subagent.ts
|
|
5453
|
-
var import_node_path57 = require("path");
|
|
5454
|
-
var import_mini22 = require("zod/mini");
|
|
5455
|
-
var RulesyncSubagentModelSchema = import_mini22.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
5456
|
-
var RulesyncSubagentFrontmatterSchema = import_mini22.z.object({
|
|
5626
|
+
var RulesyncSubagentFrontmatterSchema = import_mini23.z.looseObject({
|
|
5457
5627
|
targets: RulesyncTargetsSchema,
|
|
5458
|
-
name:
|
|
5459
|
-
description:
|
|
5460
|
-
claudecode: import_mini22.z.optional(
|
|
5461
|
-
import_mini22.z.object({
|
|
5462
|
-
model: RulesyncSubagentModelSchema
|
|
5463
|
-
})
|
|
5464
|
-
)
|
|
5628
|
+
name: import_mini23.z.string(),
|
|
5629
|
+
description: import_mini23.z.string()
|
|
5465
5630
|
});
|
|
5466
5631
|
var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
5467
5632
|
frontmatter;
|
|
@@ -5471,7 +5636,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5471
5636
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5472
5637
|
if (!result.success) {
|
|
5473
5638
|
throw new Error(
|
|
5474
|
-
`Invalid frontmatter in ${(0,
|
|
5639
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5475
5640
|
);
|
|
5476
5641
|
}
|
|
5477
5642
|
}
|
|
@@ -5504,7 +5669,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5504
5669
|
return {
|
|
5505
5670
|
success: false,
|
|
5506
5671
|
error: new Error(
|
|
5507
|
-
`Invalid frontmatter in ${(0,
|
|
5672
|
+
`Invalid frontmatter in ${(0, import_node_path58.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5508
5673
|
)
|
|
5509
5674
|
};
|
|
5510
5675
|
}
|
|
@@ -5513,14 +5678,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5513
5678
|
relativeFilePath
|
|
5514
5679
|
}) {
|
|
5515
5680
|
const fileContent = await readFileContent(
|
|
5516
|
-
(0,
|
|
5681
|
+
(0, import_node_path58.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
5517
5682
|
);
|
|
5518
5683
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5519
5684
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5520
5685
|
if (!result.success) {
|
|
5521
5686
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
5522
5687
|
}
|
|
5523
|
-
const filename = (0,
|
|
5688
|
+
const filename = (0, import_node_path58.basename)(relativeFilePath);
|
|
5524
5689
|
return new _RulesyncSubagent({
|
|
5525
5690
|
baseDir: process.cwd(),
|
|
5526
5691
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -5532,10 +5697,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
5532
5697
|
};
|
|
5533
5698
|
|
|
5534
5699
|
// src/features/subagents/claudecode-subagent.ts
|
|
5535
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
5536
|
-
name:
|
|
5537
|
-
description:
|
|
5538
|
-
model:
|
|
5700
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini24.z.looseObject({
|
|
5701
|
+
name: import_mini24.z.string(),
|
|
5702
|
+
description: import_mini24.z.string(),
|
|
5703
|
+
model: import_mini24.z.optional(import_mini24.z.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
5539
5704
|
});
|
|
5540
5705
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
5541
5706
|
frontmatter;
|
|
@@ -5545,7 +5710,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5545
5710
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
5546
5711
|
if (!result.success) {
|
|
5547
5712
|
throw new Error(
|
|
5548
|
-
`Invalid frontmatter in ${(0,
|
|
5713
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5549
5714
|
);
|
|
5550
5715
|
}
|
|
5551
5716
|
}
|
|
@@ -5557,7 +5722,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5557
5722
|
}
|
|
5558
5723
|
static getSettablePaths(_options = {}) {
|
|
5559
5724
|
return {
|
|
5560
|
-
relativeDirPath: (0,
|
|
5725
|
+
relativeDirPath: (0, import_node_path59.join)(".claude", "agents")
|
|
5561
5726
|
};
|
|
5562
5727
|
}
|
|
5563
5728
|
getFrontmatter() {
|
|
@@ -5567,15 +5732,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5567
5732
|
return this.body;
|
|
5568
5733
|
}
|
|
5569
5734
|
toRulesyncSubagent() {
|
|
5735
|
+
const { name, description, model, ...restFields } = this.frontmatter;
|
|
5736
|
+
const claudecodeSection = {
|
|
5737
|
+
...model && { model },
|
|
5738
|
+
...restFields
|
|
5739
|
+
};
|
|
5570
5740
|
const rulesyncFrontmatter = {
|
|
5571
5741
|
targets: ["claudecode"],
|
|
5572
|
-
name
|
|
5573
|
-
description
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
model: this.frontmatter.model
|
|
5577
|
-
}
|
|
5578
|
-
}
|
|
5742
|
+
name,
|
|
5743
|
+
description,
|
|
5744
|
+
// Only include claudecode section if there are fields
|
|
5745
|
+
...Object.keys(claudecodeSection).length > 0 && { claudecode: claudecodeSection }
|
|
5579
5746
|
};
|
|
5580
5747
|
return new RulesyncSubagent({
|
|
5581
5748
|
baseDir: ".",
|
|
@@ -5594,11 +5761,17 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5594
5761
|
global = false
|
|
5595
5762
|
}) {
|
|
5596
5763
|
const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
|
|
5597
|
-
const
|
|
5764
|
+
const claudecodeSection = rulesyncFrontmatter.claudecode ?? {};
|
|
5765
|
+
const rawClaudecodeFrontmatter = {
|
|
5598
5766
|
name: rulesyncFrontmatter.name,
|
|
5599
5767
|
description: rulesyncFrontmatter.description,
|
|
5600
|
-
|
|
5768
|
+
...claudecodeSection
|
|
5601
5769
|
};
|
|
5770
|
+
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(rawClaudecodeFrontmatter);
|
|
5771
|
+
if (!result.success) {
|
|
5772
|
+
throw new Error(`Invalid claudecode subagent frontmatter: ${formatError(result.error)}`);
|
|
5773
|
+
}
|
|
5774
|
+
const claudecodeFrontmatter = result.data;
|
|
5602
5775
|
const body = rulesyncSubagent.getBody();
|
|
5603
5776
|
const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
|
|
5604
5777
|
const paths = this.getSettablePaths({ global });
|
|
@@ -5623,7 +5796,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5623
5796
|
return {
|
|
5624
5797
|
success: false,
|
|
5625
5798
|
error: new Error(
|
|
5626
|
-
`Invalid frontmatter in ${(0,
|
|
5799
|
+
`Invalid frontmatter in ${(0, import_node_path59.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5627
5800
|
)
|
|
5628
5801
|
};
|
|
5629
5802
|
}
|
|
@@ -5641,7 +5814,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
5641
5814
|
global = false
|
|
5642
5815
|
}) {
|
|
5643
5816
|
const paths = this.getSettablePaths({ global });
|
|
5644
|
-
const filePath = (0,
|
|
5817
|
+
const filePath = (0, import_node_path59.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
5645
5818
|
const fileContent = await readFileContent(filePath);
|
|
5646
5819
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
5647
5820
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -5679,7 +5852,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
5679
5852
|
"roo"
|
|
5680
5853
|
];
|
|
5681
5854
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
5682
|
-
var SubagentsProcessorToolTargetSchema =
|
|
5855
|
+
var SubagentsProcessorToolTargetSchema = import_mini25.z.enum(subagentsProcessorToolTargets);
|
|
5683
5856
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
5684
5857
|
toolTarget;
|
|
5685
5858
|
global;
|
|
@@ -5795,7 +5968,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5795
5968
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
5796
5969
|
*/
|
|
5797
5970
|
async loadRulesyncFiles() {
|
|
5798
|
-
const subagentsDir = (0,
|
|
5971
|
+
const subagentsDir = (0, import_node_path60.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
5799
5972
|
const dirExists = await directoryExists(subagentsDir);
|
|
5800
5973
|
if (!dirExists) {
|
|
5801
5974
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -5810,7 +5983,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5810
5983
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
5811
5984
|
const rulesyncSubagents = [];
|
|
5812
5985
|
for (const mdFile of mdFiles) {
|
|
5813
|
-
const filepath = (0,
|
|
5986
|
+
const filepath = (0, import_node_path60.join)(subagentsDir, mdFile);
|
|
5814
5987
|
try {
|
|
5815
5988
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
5816
5989
|
relativeFilePath: mdFile,
|
|
@@ -5928,8 +6101,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5928
6101
|
relativeDirPath,
|
|
5929
6102
|
fromFile
|
|
5930
6103
|
}) {
|
|
5931
|
-
const paths = await findFilesByGlobs((0,
|
|
5932
|
-
const subagents = await Promise.all(paths.map((path3) => fromFile((0,
|
|
6104
|
+
const paths = await findFilesByGlobs((0, import_node_path60.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
6105
|
+
const subagents = await Promise.all(paths.map((path3) => fromFile((0, import_node_path60.basename)(path3))));
|
|
5933
6106
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
5934
6107
|
return subagents;
|
|
5935
6108
|
}
|
|
@@ -5957,30 +6130,30 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
5957
6130
|
};
|
|
5958
6131
|
|
|
5959
6132
|
// src/features/rules/agentsmd-rule.ts
|
|
5960
|
-
var
|
|
6133
|
+
var import_node_path63 = require("path");
|
|
5961
6134
|
|
|
5962
6135
|
// src/features/rules/tool-rule.ts
|
|
5963
|
-
var
|
|
6136
|
+
var import_node_path62 = require("path");
|
|
5964
6137
|
|
|
5965
6138
|
// src/features/rules/rulesync-rule.ts
|
|
5966
|
-
var
|
|
5967
|
-
var
|
|
5968
|
-
var RulesyncRuleFrontmatterSchema =
|
|
5969
|
-
root:
|
|
5970
|
-
targets:
|
|
5971
|
-
description:
|
|
5972
|
-
globs:
|
|
5973
|
-
agentsmd:
|
|
5974
|
-
|
|
6139
|
+
var import_node_path61 = require("path");
|
|
6140
|
+
var import_mini26 = require("zod/mini");
|
|
6141
|
+
var RulesyncRuleFrontmatterSchema = import_mini26.z.object({
|
|
6142
|
+
root: import_mini26.z.optional(import_mini26.z.optional(import_mini26.z.boolean())),
|
|
6143
|
+
targets: import_mini26.z.optional(RulesyncTargetsSchema),
|
|
6144
|
+
description: import_mini26.z.optional(import_mini26.z.string()),
|
|
6145
|
+
globs: import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string())),
|
|
6146
|
+
agentsmd: import_mini26.z.optional(
|
|
6147
|
+
import_mini26.z.object({
|
|
5975
6148
|
// @example "path/to/subproject"
|
|
5976
|
-
subprojectPath:
|
|
6149
|
+
subprojectPath: import_mini26.z.optional(import_mini26.z.string())
|
|
5977
6150
|
})
|
|
5978
6151
|
),
|
|
5979
|
-
cursor:
|
|
5980
|
-
|
|
5981
|
-
alwaysApply:
|
|
5982
|
-
description:
|
|
5983
|
-
globs:
|
|
6152
|
+
cursor: import_mini26.z.optional(
|
|
6153
|
+
import_mini26.z.object({
|
|
6154
|
+
alwaysApply: import_mini26.z.optional(import_mini26.z.boolean()),
|
|
6155
|
+
description: import_mini26.z.optional(import_mini26.z.string()),
|
|
6156
|
+
globs: import_mini26.z.optional(import_mini26.z.array(import_mini26.z.string()))
|
|
5984
6157
|
})
|
|
5985
6158
|
)
|
|
5986
6159
|
});
|
|
@@ -5992,7 +6165,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
5992
6165
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5993
6166
|
if (!result.success) {
|
|
5994
6167
|
throw new Error(
|
|
5995
|
-
`Invalid frontmatter in ${(0,
|
|
6168
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5996
6169
|
);
|
|
5997
6170
|
}
|
|
5998
6171
|
}
|
|
@@ -6027,7 +6200,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6027
6200
|
return {
|
|
6028
6201
|
success: false,
|
|
6029
6202
|
error: new Error(
|
|
6030
|
-
`Invalid frontmatter in ${(0,
|
|
6203
|
+
`Invalid frontmatter in ${(0, import_node_path61.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6031
6204
|
)
|
|
6032
6205
|
};
|
|
6033
6206
|
}
|
|
@@ -6036,12 +6209,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6036
6209
|
relativeFilePath,
|
|
6037
6210
|
validate = true
|
|
6038
6211
|
}) {
|
|
6039
|
-
const legacyPath = (0,
|
|
6212
|
+
const legacyPath = (0, import_node_path61.join)(
|
|
6040
6213
|
process.cwd(),
|
|
6041
6214
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
6042
6215
|
relativeFilePath
|
|
6043
6216
|
);
|
|
6044
|
-
const recommendedPath = (0,
|
|
6217
|
+
const recommendedPath = (0, import_node_path61.join)(
|
|
6045
6218
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
6046
6219
|
relativeFilePath
|
|
6047
6220
|
);
|
|
@@ -6060,7 +6233,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6060
6233
|
agentsmd: result.data.agentsmd,
|
|
6061
6234
|
cursor: result.data.cursor
|
|
6062
6235
|
};
|
|
6063
|
-
const filename = (0,
|
|
6236
|
+
const filename = (0, import_node_path61.basename)(legacyPath);
|
|
6064
6237
|
return new _RulesyncRule({
|
|
6065
6238
|
baseDir: process.cwd(),
|
|
6066
6239
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -6074,7 +6247,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6074
6247
|
relativeFilePath,
|
|
6075
6248
|
validate = true
|
|
6076
6249
|
}) {
|
|
6077
|
-
const filePath = (0,
|
|
6250
|
+
const filePath = (0, import_node_path61.join)(
|
|
6078
6251
|
process.cwd(),
|
|
6079
6252
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
6080
6253
|
relativeFilePath
|
|
@@ -6093,7 +6266,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
6093
6266
|
agentsmd: result.data.agentsmd,
|
|
6094
6267
|
cursor: result.data.cursor
|
|
6095
6268
|
};
|
|
6096
|
-
const filename = (0,
|
|
6269
|
+
const filename = (0, import_node_path61.basename)(filePath);
|
|
6097
6270
|
return new _RulesyncRule({
|
|
6098
6271
|
baseDir: process.cwd(),
|
|
6099
6272
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -6168,7 +6341,7 @@ var ToolRule = class extends ToolFile {
|
|
|
6168
6341
|
rulesyncRule,
|
|
6169
6342
|
validate = true,
|
|
6170
6343
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
6171
|
-
nonRootPath = { relativeDirPath: (0,
|
|
6344
|
+
nonRootPath = { relativeDirPath: (0, import_node_path62.join)(".agents", "memories") }
|
|
6172
6345
|
}) {
|
|
6173
6346
|
const params = this.buildToolRuleParamsDefault({
|
|
6174
6347
|
baseDir,
|
|
@@ -6179,7 +6352,7 @@ var ToolRule = class extends ToolFile {
|
|
|
6179
6352
|
});
|
|
6180
6353
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
6181
6354
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
6182
|
-
params.relativeDirPath = (0,
|
|
6355
|
+
params.relativeDirPath = (0, import_node_path62.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
6183
6356
|
params.relativeFilePath = "AGENTS.md";
|
|
6184
6357
|
}
|
|
6185
6358
|
return params;
|
|
@@ -6244,7 +6417,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6244
6417
|
relativeFilePath: "AGENTS.md"
|
|
6245
6418
|
},
|
|
6246
6419
|
nonRoot: {
|
|
6247
|
-
relativeDirPath: (0,
|
|
6420
|
+
relativeDirPath: (0, import_node_path63.join)(".agents", "memories")
|
|
6248
6421
|
}
|
|
6249
6422
|
};
|
|
6250
6423
|
}
|
|
@@ -6254,8 +6427,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6254
6427
|
validate = true
|
|
6255
6428
|
}) {
|
|
6256
6429
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
6257
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
6258
|
-
const fileContent = await readFileContent((0,
|
|
6430
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path63.join)(".agents", "memories", relativeFilePath);
|
|
6431
|
+
const fileContent = await readFileContent((0, import_node_path63.join)(baseDir, relativePath));
|
|
6259
6432
|
return new _AgentsMdRule({
|
|
6260
6433
|
baseDir,
|
|
6261
6434
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -6295,12 +6468,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
6295
6468
|
};
|
|
6296
6469
|
|
|
6297
6470
|
// src/features/rules/amazonqcli-rule.ts
|
|
6298
|
-
var
|
|
6471
|
+
var import_node_path64 = require("path");
|
|
6299
6472
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
6300
6473
|
static getSettablePaths() {
|
|
6301
6474
|
return {
|
|
6302
6475
|
nonRoot: {
|
|
6303
|
-
relativeDirPath: (0,
|
|
6476
|
+
relativeDirPath: (0, import_node_path64.join)(".amazonq", "rules")
|
|
6304
6477
|
}
|
|
6305
6478
|
};
|
|
6306
6479
|
}
|
|
@@ -6310,7 +6483,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
6310
6483
|
validate = true
|
|
6311
6484
|
}) {
|
|
6312
6485
|
const fileContent = await readFileContent(
|
|
6313
|
-
(0,
|
|
6486
|
+
(0, import_node_path64.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6314
6487
|
);
|
|
6315
6488
|
return new _AmazonQCliRule({
|
|
6316
6489
|
baseDir,
|
|
@@ -6349,8 +6522,63 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
6349
6522
|
}
|
|
6350
6523
|
};
|
|
6351
6524
|
|
|
6525
|
+
// src/features/rules/antigravity-rule.ts
|
|
6526
|
+
var import_node_path65 = require("path");
|
|
6527
|
+
var AntigravityRule = class _AntigravityRule extends ToolRule {
|
|
6528
|
+
static getSettablePaths() {
|
|
6529
|
+
return {
|
|
6530
|
+
nonRoot: {
|
|
6531
|
+
relativeDirPath: (0, import_node_path65.join)(".agent", "rules")
|
|
6532
|
+
}
|
|
6533
|
+
};
|
|
6534
|
+
}
|
|
6535
|
+
static async fromFile({
|
|
6536
|
+
baseDir = process.cwd(),
|
|
6537
|
+
relativeFilePath,
|
|
6538
|
+
validate = true
|
|
6539
|
+
}) {
|
|
6540
|
+
const fileContent = await readFileContent(
|
|
6541
|
+
(0, import_node_path65.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6542
|
+
);
|
|
6543
|
+
return new _AntigravityRule({
|
|
6544
|
+
baseDir,
|
|
6545
|
+
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
6546
|
+
relativeFilePath,
|
|
6547
|
+
fileContent,
|
|
6548
|
+
validate,
|
|
6549
|
+
root: false
|
|
6550
|
+
});
|
|
6551
|
+
}
|
|
6552
|
+
static fromRulesyncRule({
|
|
6553
|
+
baseDir = process.cwd(),
|
|
6554
|
+
rulesyncRule,
|
|
6555
|
+
validate = true
|
|
6556
|
+
}) {
|
|
6557
|
+
return new _AntigravityRule(
|
|
6558
|
+
this.buildToolRuleParamsDefault({
|
|
6559
|
+
baseDir,
|
|
6560
|
+
rulesyncRule,
|
|
6561
|
+
validate,
|
|
6562
|
+
nonRootPath: this.getSettablePaths().nonRoot
|
|
6563
|
+
})
|
|
6564
|
+
);
|
|
6565
|
+
}
|
|
6566
|
+
toRulesyncRule() {
|
|
6567
|
+
return this.toRulesyncRuleDefault();
|
|
6568
|
+
}
|
|
6569
|
+
validate() {
|
|
6570
|
+
return { success: true, error: null };
|
|
6571
|
+
}
|
|
6572
|
+
static isTargetedByRulesyncRule(rulesyncRule) {
|
|
6573
|
+
return this.isTargetedByRulesyncRuleDefault({
|
|
6574
|
+
rulesyncRule,
|
|
6575
|
+
toolTarget: "antigravity"
|
|
6576
|
+
});
|
|
6577
|
+
}
|
|
6578
|
+
};
|
|
6579
|
+
|
|
6352
6580
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
6353
|
-
var
|
|
6581
|
+
var import_node_path66 = require("path");
|
|
6354
6582
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
6355
6583
|
toRulesyncRule() {
|
|
6356
6584
|
const rulesyncFrontmatter = {
|
|
@@ -6376,7 +6604,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6376
6604
|
relativeFilePath: ".augment-guidelines"
|
|
6377
6605
|
},
|
|
6378
6606
|
nonRoot: {
|
|
6379
|
-
relativeDirPath: (0,
|
|
6607
|
+
relativeDirPath: (0, import_node_path66.join)(".augment", "rules")
|
|
6380
6608
|
}
|
|
6381
6609
|
};
|
|
6382
6610
|
}
|
|
@@ -6411,8 +6639,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6411
6639
|
}) {
|
|
6412
6640
|
const settablePaths = this.getSettablePaths();
|
|
6413
6641
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
6414
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
6415
|
-
const fileContent = await readFileContent((0,
|
|
6642
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path66.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6643
|
+
const fileContent = await readFileContent((0, import_node_path66.join)(baseDir, relativePath));
|
|
6416
6644
|
return new _AugmentcodeLegacyRule({
|
|
6417
6645
|
baseDir,
|
|
6418
6646
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -6425,7 +6653,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
6425
6653
|
};
|
|
6426
6654
|
|
|
6427
6655
|
// src/features/rules/augmentcode-rule.ts
|
|
6428
|
-
var
|
|
6656
|
+
var import_node_path67 = require("path");
|
|
6429
6657
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
6430
6658
|
toRulesyncRule() {
|
|
6431
6659
|
return this.toRulesyncRuleDefault();
|
|
@@ -6433,7 +6661,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6433
6661
|
static getSettablePaths() {
|
|
6434
6662
|
return {
|
|
6435
6663
|
nonRoot: {
|
|
6436
|
-
relativeDirPath: (0,
|
|
6664
|
+
relativeDirPath: (0, import_node_path67.join)(".augment", "rules")
|
|
6437
6665
|
}
|
|
6438
6666
|
};
|
|
6439
6667
|
}
|
|
@@ -6457,7 +6685,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6457
6685
|
validate = true
|
|
6458
6686
|
}) {
|
|
6459
6687
|
const fileContent = await readFileContent(
|
|
6460
|
-
(0,
|
|
6688
|
+
(0, import_node_path67.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6461
6689
|
);
|
|
6462
6690
|
const { body: content } = parseFrontmatter(fileContent);
|
|
6463
6691
|
return new _AugmentcodeRule({
|
|
@@ -6480,7 +6708,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
6480
6708
|
};
|
|
6481
6709
|
|
|
6482
6710
|
// src/features/rules/claudecode-rule.ts
|
|
6483
|
-
var
|
|
6711
|
+
var import_node_path68 = require("path");
|
|
6484
6712
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
6485
6713
|
static getSettablePaths({
|
|
6486
6714
|
global
|
|
@@ -6499,7 +6727,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6499
6727
|
relativeFilePath: "CLAUDE.md"
|
|
6500
6728
|
},
|
|
6501
6729
|
nonRoot: {
|
|
6502
|
-
relativeDirPath: (0,
|
|
6730
|
+
relativeDirPath: (0, import_node_path68.join)(".claude", "memories")
|
|
6503
6731
|
}
|
|
6504
6732
|
};
|
|
6505
6733
|
}
|
|
@@ -6514,7 +6742,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6514
6742
|
if (isRoot) {
|
|
6515
6743
|
const relativePath2 = paths.root.relativeFilePath;
|
|
6516
6744
|
const fileContent2 = await readFileContent(
|
|
6517
|
-
(0,
|
|
6745
|
+
(0, import_node_path68.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
6518
6746
|
);
|
|
6519
6747
|
return new _ClaudecodeRule({
|
|
6520
6748
|
baseDir,
|
|
@@ -6528,8 +6756,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6528
6756
|
if (!paths.nonRoot) {
|
|
6529
6757
|
throw new Error("nonRoot path is not set");
|
|
6530
6758
|
}
|
|
6531
|
-
const relativePath = (0,
|
|
6532
|
-
const fileContent = await readFileContent((0,
|
|
6759
|
+
const relativePath = (0, import_node_path68.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6760
|
+
const fileContent = await readFileContent((0, import_node_path68.join)(baseDir, relativePath));
|
|
6533
6761
|
return new _ClaudecodeRule({
|
|
6534
6762
|
baseDir,
|
|
6535
6763
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -6571,10 +6799,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
6571
6799
|
};
|
|
6572
6800
|
|
|
6573
6801
|
// src/features/rules/cline-rule.ts
|
|
6574
|
-
var
|
|
6575
|
-
var
|
|
6576
|
-
var ClineRuleFrontmatterSchema =
|
|
6577
|
-
description:
|
|
6802
|
+
var import_node_path69 = require("path");
|
|
6803
|
+
var import_mini27 = require("zod/mini");
|
|
6804
|
+
var ClineRuleFrontmatterSchema = import_mini27.z.object({
|
|
6805
|
+
description: import_mini27.z.string()
|
|
6578
6806
|
});
|
|
6579
6807
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
6580
6808
|
static getSettablePaths() {
|
|
@@ -6616,7 +6844,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
6616
6844
|
validate = true
|
|
6617
6845
|
}) {
|
|
6618
6846
|
const fileContent = await readFileContent(
|
|
6619
|
-
(0,
|
|
6847
|
+
(0, import_node_path69.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6620
6848
|
);
|
|
6621
6849
|
return new _ClineRule({
|
|
6622
6850
|
baseDir,
|
|
@@ -6629,7 +6857,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
6629
6857
|
};
|
|
6630
6858
|
|
|
6631
6859
|
// src/features/rules/codexcli-rule.ts
|
|
6632
|
-
var
|
|
6860
|
+
var import_node_path70 = require("path");
|
|
6633
6861
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
6634
6862
|
static getSettablePaths({
|
|
6635
6863
|
global
|
|
@@ -6648,7 +6876,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6648
6876
|
relativeFilePath: "AGENTS.md"
|
|
6649
6877
|
},
|
|
6650
6878
|
nonRoot: {
|
|
6651
|
-
relativeDirPath: (0,
|
|
6879
|
+
relativeDirPath: (0, import_node_path70.join)(".codex", "memories")
|
|
6652
6880
|
}
|
|
6653
6881
|
};
|
|
6654
6882
|
}
|
|
@@ -6663,7 +6891,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6663
6891
|
if (isRoot) {
|
|
6664
6892
|
const relativePath2 = paths.root.relativeFilePath;
|
|
6665
6893
|
const fileContent2 = await readFileContent(
|
|
6666
|
-
(0,
|
|
6894
|
+
(0, import_node_path70.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
6667
6895
|
);
|
|
6668
6896
|
return new _CodexcliRule({
|
|
6669
6897
|
baseDir,
|
|
@@ -6677,8 +6905,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6677
6905
|
if (!paths.nonRoot) {
|
|
6678
6906
|
throw new Error("nonRoot path is not set");
|
|
6679
6907
|
}
|
|
6680
|
-
const relativePath = (0,
|
|
6681
|
-
const fileContent = await readFileContent((0,
|
|
6908
|
+
const relativePath = (0, import_node_path70.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
6909
|
+
const fileContent = await readFileContent((0, import_node_path70.join)(baseDir, relativePath));
|
|
6682
6910
|
return new _CodexcliRule({
|
|
6683
6911
|
baseDir,
|
|
6684
6912
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -6720,11 +6948,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
6720
6948
|
};
|
|
6721
6949
|
|
|
6722
6950
|
// src/features/rules/copilot-rule.ts
|
|
6723
|
-
var
|
|
6724
|
-
var
|
|
6725
|
-
var CopilotRuleFrontmatterSchema =
|
|
6726
|
-
description:
|
|
6727
|
-
applyTo:
|
|
6951
|
+
var import_node_path71 = require("path");
|
|
6952
|
+
var import_mini28 = require("zod/mini");
|
|
6953
|
+
var CopilotRuleFrontmatterSchema = import_mini28.z.object({
|
|
6954
|
+
description: import_mini28.z.optional(import_mini28.z.string()),
|
|
6955
|
+
applyTo: import_mini28.z.optional(import_mini28.z.string())
|
|
6728
6956
|
});
|
|
6729
6957
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
6730
6958
|
frontmatter;
|
|
@@ -6736,7 +6964,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6736
6964
|
relativeFilePath: "copilot-instructions.md"
|
|
6737
6965
|
},
|
|
6738
6966
|
nonRoot: {
|
|
6739
|
-
relativeDirPath: (0,
|
|
6967
|
+
relativeDirPath: (0, import_node_path71.join)(".github", "instructions")
|
|
6740
6968
|
}
|
|
6741
6969
|
};
|
|
6742
6970
|
}
|
|
@@ -6745,7 +6973,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6745
6973
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6746
6974
|
if (!result.success) {
|
|
6747
6975
|
throw new Error(
|
|
6748
|
-
`Invalid frontmatter in ${(0,
|
|
6976
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6749
6977
|
);
|
|
6750
6978
|
}
|
|
6751
6979
|
}
|
|
@@ -6823,11 +7051,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6823
7051
|
validate = true
|
|
6824
7052
|
}) {
|
|
6825
7053
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
6826
|
-
const relativePath = isRoot ? (0,
|
|
7054
|
+
const relativePath = isRoot ? (0, import_node_path71.join)(
|
|
6827
7055
|
this.getSettablePaths().root.relativeDirPath,
|
|
6828
7056
|
this.getSettablePaths().root.relativeFilePath
|
|
6829
|
-
) : (0,
|
|
6830
|
-
const fileContent = await readFileContent((0,
|
|
7057
|
+
) : (0, import_node_path71.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
7058
|
+
const fileContent = await readFileContent((0, import_node_path71.join)(baseDir, relativePath));
|
|
6831
7059
|
if (isRoot) {
|
|
6832
7060
|
return new _CopilotRule({
|
|
6833
7061
|
baseDir,
|
|
@@ -6846,7 +7074,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6846
7074
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6847
7075
|
if (!result.success) {
|
|
6848
7076
|
throw new Error(
|
|
6849
|
-
`Invalid frontmatter in ${(0,
|
|
7077
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
6850
7078
|
);
|
|
6851
7079
|
}
|
|
6852
7080
|
return new _CopilotRule({
|
|
@@ -6870,7 +7098,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6870
7098
|
return {
|
|
6871
7099
|
success: false,
|
|
6872
7100
|
error: new Error(
|
|
6873
|
-
`Invalid frontmatter in ${(0,
|
|
7101
|
+
`Invalid frontmatter in ${(0, import_node_path71.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
6874
7102
|
)
|
|
6875
7103
|
};
|
|
6876
7104
|
}
|
|
@@ -6890,12 +7118,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
6890
7118
|
};
|
|
6891
7119
|
|
|
6892
7120
|
// src/features/rules/cursor-rule.ts
|
|
6893
|
-
var
|
|
6894
|
-
var
|
|
6895
|
-
var CursorRuleFrontmatterSchema =
|
|
6896
|
-
description:
|
|
6897
|
-
globs:
|
|
6898
|
-
alwaysApply:
|
|
7121
|
+
var import_node_path72 = require("path");
|
|
7122
|
+
var import_mini29 = require("zod/mini");
|
|
7123
|
+
var CursorRuleFrontmatterSchema = import_mini29.z.object({
|
|
7124
|
+
description: import_mini29.z.optional(import_mini29.z.string()),
|
|
7125
|
+
globs: import_mini29.z.optional(import_mini29.z.string()),
|
|
7126
|
+
alwaysApply: import_mini29.z.optional(import_mini29.z.boolean())
|
|
6899
7127
|
});
|
|
6900
7128
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
6901
7129
|
frontmatter;
|
|
@@ -6903,7 +7131,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
6903
7131
|
static getSettablePaths() {
|
|
6904
7132
|
return {
|
|
6905
7133
|
nonRoot: {
|
|
6906
|
-
relativeDirPath: (0,
|
|
7134
|
+
relativeDirPath: (0, import_node_path72.join)(".cursor", "rules")
|
|
6907
7135
|
}
|
|
6908
7136
|
};
|
|
6909
7137
|
}
|
|
@@ -6912,7 +7140,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
6912
7140
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
6913
7141
|
if (!result.success) {
|
|
6914
7142
|
throw new Error(
|
|
6915
|
-
`Invalid frontmatter in ${(0,
|
|
7143
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
6916
7144
|
);
|
|
6917
7145
|
}
|
|
6918
7146
|
}
|
|
@@ -7029,19 +7257,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7029
7257
|
validate = true
|
|
7030
7258
|
}) {
|
|
7031
7259
|
const fileContent = await readFileContent(
|
|
7032
|
-
(0,
|
|
7260
|
+
(0, import_node_path72.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7033
7261
|
);
|
|
7034
7262
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
7035
7263
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
7036
7264
|
if (!result.success) {
|
|
7037
7265
|
throw new Error(
|
|
7038
|
-
`Invalid frontmatter in ${(0,
|
|
7266
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
7039
7267
|
);
|
|
7040
7268
|
}
|
|
7041
7269
|
return new _CursorRule({
|
|
7042
7270
|
baseDir,
|
|
7043
7271
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
7044
|
-
relativeFilePath: (0,
|
|
7272
|
+
relativeFilePath: (0, import_node_path72.basename)(relativeFilePath),
|
|
7045
7273
|
frontmatter: result.data,
|
|
7046
7274
|
body: content.trim(),
|
|
7047
7275
|
validate
|
|
@@ -7058,7 +7286,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7058
7286
|
return {
|
|
7059
7287
|
success: false,
|
|
7060
7288
|
error: new Error(
|
|
7061
|
-
`Invalid frontmatter in ${(0,
|
|
7289
|
+
`Invalid frontmatter in ${(0, import_node_path72.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
7062
7290
|
)
|
|
7063
7291
|
};
|
|
7064
7292
|
}
|
|
@@ -7078,7 +7306,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
7078
7306
|
};
|
|
7079
7307
|
|
|
7080
7308
|
// src/features/rules/geminicli-rule.ts
|
|
7081
|
-
var
|
|
7309
|
+
var import_node_path73 = require("path");
|
|
7082
7310
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
7083
7311
|
static getSettablePaths({
|
|
7084
7312
|
global
|
|
@@ -7097,7 +7325,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7097
7325
|
relativeFilePath: "GEMINI.md"
|
|
7098
7326
|
},
|
|
7099
7327
|
nonRoot: {
|
|
7100
|
-
relativeDirPath: (0,
|
|
7328
|
+
relativeDirPath: (0, import_node_path73.join)(".gemini", "memories")
|
|
7101
7329
|
}
|
|
7102
7330
|
};
|
|
7103
7331
|
}
|
|
@@ -7112,7 +7340,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7112
7340
|
if (isRoot) {
|
|
7113
7341
|
const relativePath2 = paths.root.relativeFilePath;
|
|
7114
7342
|
const fileContent2 = await readFileContent(
|
|
7115
|
-
(0,
|
|
7343
|
+
(0, import_node_path73.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
7116
7344
|
);
|
|
7117
7345
|
return new _GeminiCliRule({
|
|
7118
7346
|
baseDir,
|
|
@@ -7126,8 +7354,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7126
7354
|
if (!paths.nonRoot) {
|
|
7127
7355
|
throw new Error("nonRoot path is not set");
|
|
7128
7356
|
}
|
|
7129
|
-
const relativePath = (0,
|
|
7130
|
-
const fileContent = await readFileContent((0,
|
|
7357
|
+
const relativePath = (0, import_node_path73.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
7358
|
+
const fileContent = await readFileContent((0, import_node_path73.join)(baseDir, relativePath));
|
|
7131
7359
|
return new _GeminiCliRule({
|
|
7132
7360
|
baseDir,
|
|
7133
7361
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -7169,7 +7397,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
7169
7397
|
};
|
|
7170
7398
|
|
|
7171
7399
|
// src/features/rules/junie-rule.ts
|
|
7172
|
-
var
|
|
7400
|
+
var import_node_path74 = require("path");
|
|
7173
7401
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
7174
7402
|
static getSettablePaths() {
|
|
7175
7403
|
return {
|
|
@@ -7178,7 +7406,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7178
7406
|
relativeFilePath: "guidelines.md"
|
|
7179
7407
|
},
|
|
7180
7408
|
nonRoot: {
|
|
7181
|
-
relativeDirPath: (0,
|
|
7409
|
+
relativeDirPath: (0, import_node_path74.join)(".junie", "memories")
|
|
7182
7410
|
}
|
|
7183
7411
|
};
|
|
7184
7412
|
}
|
|
@@ -7188,8 +7416,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7188
7416
|
validate = true
|
|
7189
7417
|
}) {
|
|
7190
7418
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
7191
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
7192
|
-
const fileContent = await readFileContent((0,
|
|
7419
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path74.join)(".junie", "memories", relativeFilePath);
|
|
7420
|
+
const fileContent = await readFileContent((0, import_node_path74.join)(baseDir, relativePath));
|
|
7193
7421
|
return new _JunieRule({
|
|
7194
7422
|
baseDir,
|
|
7195
7423
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7229,12 +7457,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
7229
7457
|
};
|
|
7230
7458
|
|
|
7231
7459
|
// src/features/rules/kiro-rule.ts
|
|
7232
|
-
var
|
|
7460
|
+
var import_node_path75 = require("path");
|
|
7233
7461
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
7234
7462
|
static getSettablePaths() {
|
|
7235
7463
|
return {
|
|
7236
7464
|
nonRoot: {
|
|
7237
|
-
relativeDirPath: (0,
|
|
7465
|
+
relativeDirPath: (0, import_node_path75.join)(".kiro", "steering")
|
|
7238
7466
|
}
|
|
7239
7467
|
};
|
|
7240
7468
|
}
|
|
@@ -7244,7 +7472,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
7244
7472
|
validate = true
|
|
7245
7473
|
}) {
|
|
7246
7474
|
const fileContent = await readFileContent(
|
|
7247
|
-
(0,
|
|
7475
|
+
(0, import_node_path75.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7248
7476
|
);
|
|
7249
7477
|
return new _KiroRule({
|
|
7250
7478
|
baseDir,
|
|
@@ -7284,7 +7512,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
7284
7512
|
};
|
|
7285
7513
|
|
|
7286
7514
|
// src/features/rules/opencode-rule.ts
|
|
7287
|
-
var
|
|
7515
|
+
var import_node_path76 = require("path");
|
|
7288
7516
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
7289
7517
|
static getSettablePaths() {
|
|
7290
7518
|
return {
|
|
@@ -7293,7 +7521,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7293
7521
|
relativeFilePath: "AGENTS.md"
|
|
7294
7522
|
},
|
|
7295
7523
|
nonRoot: {
|
|
7296
|
-
relativeDirPath: (0,
|
|
7524
|
+
relativeDirPath: (0, import_node_path76.join)(".opencode", "memories")
|
|
7297
7525
|
}
|
|
7298
7526
|
};
|
|
7299
7527
|
}
|
|
@@ -7303,8 +7531,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7303
7531
|
validate = true
|
|
7304
7532
|
}) {
|
|
7305
7533
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
7306
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
7307
|
-
const fileContent = await readFileContent((0,
|
|
7534
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path76.join)(".opencode", "memories", relativeFilePath);
|
|
7535
|
+
const fileContent = await readFileContent((0, import_node_path76.join)(baseDir, relativePath));
|
|
7308
7536
|
return new _OpenCodeRule({
|
|
7309
7537
|
baseDir,
|
|
7310
7538
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7344,7 +7572,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
7344
7572
|
};
|
|
7345
7573
|
|
|
7346
7574
|
// src/features/rules/qwencode-rule.ts
|
|
7347
|
-
var
|
|
7575
|
+
var import_node_path77 = require("path");
|
|
7348
7576
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
7349
7577
|
static getSettablePaths() {
|
|
7350
7578
|
return {
|
|
@@ -7353,7 +7581,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7353
7581
|
relativeFilePath: "QWEN.md"
|
|
7354
7582
|
},
|
|
7355
7583
|
nonRoot: {
|
|
7356
|
-
relativeDirPath: (0,
|
|
7584
|
+
relativeDirPath: (0, import_node_path77.join)(".qwen", "memories")
|
|
7357
7585
|
}
|
|
7358
7586
|
};
|
|
7359
7587
|
}
|
|
@@ -7363,8 +7591,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7363
7591
|
validate = true
|
|
7364
7592
|
}) {
|
|
7365
7593
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
7366
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
7367
|
-
const fileContent = await readFileContent((0,
|
|
7594
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path77.join)(".qwen", "memories", relativeFilePath);
|
|
7595
|
+
const fileContent = await readFileContent((0, import_node_path77.join)(baseDir, relativePath));
|
|
7368
7596
|
return new _QwencodeRule({
|
|
7369
7597
|
baseDir,
|
|
7370
7598
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -7401,12 +7629,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
7401
7629
|
};
|
|
7402
7630
|
|
|
7403
7631
|
// src/features/rules/roo-rule.ts
|
|
7404
|
-
var
|
|
7632
|
+
var import_node_path78 = require("path");
|
|
7405
7633
|
var RooRule = class _RooRule extends ToolRule {
|
|
7406
7634
|
static getSettablePaths() {
|
|
7407
7635
|
return {
|
|
7408
7636
|
nonRoot: {
|
|
7409
|
-
relativeDirPath: (0,
|
|
7637
|
+
relativeDirPath: (0, import_node_path78.join)(".roo", "rules")
|
|
7410
7638
|
}
|
|
7411
7639
|
};
|
|
7412
7640
|
}
|
|
@@ -7416,7 +7644,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
7416
7644
|
validate = true
|
|
7417
7645
|
}) {
|
|
7418
7646
|
const fileContent = await readFileContent(
|
|
7419
|
-
(0,
|
|
7647
|
+
(0, import_node_path78.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7420
7648
|
);
|
|
7421
7649
|
return new _RooRule({
|
|
7422
7650
|
baseDir,
|
|
@@ -7471,7 +7699,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
7471
7699
|
};
|
|
7472
7700
|
|
|
7473
7701
|
// src/features/rules/warp-rule.ts
|
|
7474
|
-
var
|
|
7702
|
+
var import_node_path79 = require("path");
|
|
7475
7703
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
7476
7704
|
constructor({ fileContent, root, ...rest }) {
|
|
7477
7705
|
super({
|
|
@@ -7487,7 +7715,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7487
7715
|
relativeFilePath: "WARP.md"
|
|
7488
7716
|
},
|
|
7489
7717
|
nonRoot: {
|
|
7490
|
-
relativeDirPath: (0,
|
|
7718
|
+
relativeDirPath: (0, import_node_path79.join)(".warp", "memories")
|
|
7491
7719
|
}
|
|
7492
7720
|
};
|
|
7493
7721
|
}
|
|
@@ -7497,8 +7725,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7497
7725
|
validate = true
|
|
7498
7726
|
}) {
|
|
7499
7727
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
7500
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
7501
|
-
const fileContent = await readFileContent((0,
|
|
7728
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path79.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
7729
|
+
const fileContent = await readFileContent((0, import_node_path79.join)(baseDir, relativePath));
|
|
7502
7730
|
return new _WarpRule({
|
|
7503
7731
|
baseDir,
|
|
7504
7732
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -7538,12 +7766,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
7538
7766
|
};
|
|
7539
7767
|
|
|
7540
7768
|
// src/features/rules/windsurf-rule.ts
|
|
7541
|
-
var
|
|
7769
|
+
var import_node_path80 = require("path");
|
|
7542
7770
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
7543
7771
|
static getSettablePaths() {
|
|
7544
7772
|
return {
|
|
7545
7773
|
nonRoot: {
|
|
7546
|
-
relativeDirPath: (0,
|
|
7774
|
+
relativeDirPath: (0, import_node_path80.join)(".windsurf", "rules")
|
|
7547
7775
|
}
|
|
7548
7776
|
};
|
|
7549
7777
|
}
|
|
@@ -7553,7 +7781,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
7553
7781
|
validate = true
|
|
7554
7782
|
}) {
|
|
7555
7783
|
const fileContent = await readFileContent(
|
|
7556
|
-
(0,
|
|
7784
|
+
(0, import_node_path80.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
7557
7785
|
);
|
|
7558
7786
|
return new _WindsurfRule({
|
|
7559
7787
|
baseDir,
|
|
@@ -7595,6 +7823,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
7595
7823
|
var rulesProcessorToolTargets = [
|
|
7596
7824
|
"agentsmd",
|
|
7597
7825
|
"amazonqcli",
|
|
7826
|
+
"antigravity",
|
|
7598
7827
|
"augmentcode",
|
|
7599
7828
|
"augmentcode-legacy",
|
|
7600
7829
|
"claudecode",
|
|
@@ -7611,7 +7840,7 @@ var rulesProcessorToolTargets = [
|
|
|
7611
7840
|
"warp",
|
|
7612
7841
|
"windsurf"
|
|
7613
7842
|
];
|
|
7614
|
-
var RulesProcessorToolTargetSchema =
|
|
7843
|
+
var RulesProcessorToolTargetSchema = import_mini30.z.enum(rulesProcessorToolTargets);
|
|
7615
7844
|
var rulesProcessorToolTargetsGlobal = [
|
|
7616
7845
|
"claudecode",
|
|
7617
7846
|
"codexcli",
|
|
@@ -7668,6 +7897,15 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7668
7897
|
rulesyncRule,
|
|
7669
7898
|
validate: true
|
|
7670
7899
|
});
|
|
7900
|
+
case "antigravity":
|
|
7901
|
+
if (!AntigravityRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
7902
|
+
return null;
|
|
7903
|
+
}
|
|
7904
|
+
return AntigravityRule.fromRulesyncRule({
|
|
7905
|
+
baseDir: this.baseDir,
|
|
7906
|
+
rulesyncRule,
|
|
7907
|
+
validate: true
|
|
7908
|
+
});
|
|
7671
7909
|
case "augmentcode":
|
|
7672
7910
|
if (!AugmentcodeRule.isTargetedByRulesyncRule(rulesyncRule)) {
|
|
7673
7911
|
return null;
|
|
@@ -7965,10 +8203,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7965
8203
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
7966
8204
|
*/
|
|
7967
8205
|
async loadRulesyncFiles() {
|
|
7968
|
-
const files = await findFilesByGlobs((0,
|
|
8206
|
+
const files = await findFilesByGlobs((0, import_node_path81.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
7969
8207
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
7970
8208
|
const rulesyncRules = await Promise.all(
|
|
7971
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
8209
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path81.basename)(file) }))
|
|
7972
8210
|
);
|
|
7973
8211
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
7974
8212
|
if (rootRules.length > 1) {
|
|
@@ -7986,10 +8224,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
7986
8224
|
return rulesyncRules;
|
|
7987
8225
|
}
|
|
7988
8226
|
async loadRulesyncFilesLegacy() {
|
|
7989
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
8227
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path81.join)(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
7990
8228
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
7991
8229
|
return Promise.all(
|
|
7992
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
8230
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path81.basename)(file) }))
|
|
7993
8231
|
);
|
|
7994
8232
|
}
|
|
7995
8233
|
/**
|
|
@@ -8052,13 +8290,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
8052
8290
|
return [];
|
|
8053
8291
|
}
|
|
8054
8292
|
const rootFilePaths = await findFilesByGlobs(
|
|
8055
|
-
(0,
|
|
8293
|
+
(0, import_node_path81.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
8056
8294
|
);
|
|
8057
8295
|
return await Promise.all(
|
|
8058
8296
|
rootFilePaths.map(
|
|
8059
8297
|
(filePath) => root.fromFile({
|
|
8060
8298
|
baseDir: this.baseDir,
|
|
8061
|
-
relativeFilePath: (0,
|
|
8299
|
+
relativeFilePath: (0, import_node_path81.basename)(filePath),
|
|
8062
8300
|
global: this.global
|
|
8063
8301
|
})
|
|
8064
8302
|
)
|
|
@@ -8070,13 +8308,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
8070
8308
|
return [];
|
|
8071
8309
|
}
|
|
8072
8310
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
8073
|
-
(0,
|
|
8311
|
+
(0, import_node_path81.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
8074
8312
|
);
|
|
8075
8313
|
return await Promise.all(
|
|
8076
8314
|
nonRootFilePaths.map(
|
|
8077
8315
|
(filePath) => nonRoot.fromFile({
|
|
8078
8316
|
baseDir: this.baseDir,
|
|
8079
|
-
relativeFilePath: (0,
|
|
8317
|
+
relativeFilePath: (0, import_node_path81.basename)(filePath),
|
|
8080
8318
|
global: this.global
|
|
8081
8319
|
})
|
|
8082
8320
|
)
|
|
@@ -8422,7 +8660,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
8422
8660
|
`@${rule.getRelativePathFromCwd()} description: "${escapedDescription}" globs: "${globsText}"`
|
|
8423
8661
|
);
|
|
8424
8662
|
}
|
|
8425
|
-
return lines.join("\n") + "\n";
|
|
8663
|
+
return lines.join("\n") + "\n\n";
|
|
8426
8664
|
}
|
|
8427
8665
|
generateAdditionalConventionsSection({
|
|
8428
8666
|
commands,
|
|
@@ -8447,21 +8685,21 @@ s/<command> [arguments]
|
|
|
8447
8685
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
8448
8686
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
8449
8687
|
|
|
8450
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
8688
|
+
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.` : "";
|
|
8451
8689
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
8452
8690
|
|
|
8453
8691
|
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.
|
|
8454
8692
|
|
|
8455
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
8693
|
+
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.
|
|
8456
8694
|
|
|
8457
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
8695
|
+
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.` : "";
|
|
8458
8696
|
const skillsSection = skills ? `## Simulated Skills
|
|
8459
8697
|
|
|
8460
8698
|
Simulated skills are specialized capabilities that can be invoked to handle specific types of tasks.
|
|
8461
8699
|
|
|
8462
|
-
When users invoke a simulated skill, look for the corresponding SKILL.md file in \`${(0,
|
|
8700
|
+
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.
|
|
8463
8701
|
|
|
8464
|
-
For example, if the user instructs \`Use the skill example-skill to achieve something\`, look for \`${(0,
|
|
8702
|
+
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.
|
|
8465
8703
|
|
|
8466
8704
|
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.` : "";
|
|
8467
8705
|
const result = [
|
|
@@ -8723,9 +8961,9 @@ async function generateSkills(config) {
|
|
|
8723
8961
|
}
|
|
8724
8962
|
|
|
8725
8963
|
// src/cli/commands/gitignore.ts
|
|
8726
|
-
var
|
|
8964
|
+
var import_node_path82 = require("path");
|
|
8727
8965
|
var gitignoreCommand = async () => {
|
|
8728
|
-
const gitignorePath = (0,
|
|
8966
|
+
const gitignorePath = (0, import_node_path82.join)(process.cwd(), ".gitignore");
|
|
8729
8967
|
const rulesFilesToIgnore = [
|
|
8730
8968
|
"# Generated by rulesync - AI tool configuration files",
|
|
8731
8969
|
// AGENTS.md
|
|
@@ -8998,7 +9236,7 @@ async function importSkills(config, tool) {
|
|
|
8998
9236
|
}
|
|
8999
9237
|
|
|
9000
9238
|
// src/cli/commands/init.ts
|
|
9001
|
-
var
|
|
9239
|
+
var import_node_path83 = require("path");
|
|
9002
9240
|
async function initCommand() {
|
|
9003
9241
|
logger.info("Initializing rulesync...");
|
|
9004
9242
|
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
@@ -9161,14 +9399,14 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9161
9399
|
await ensureDir(commandPaths.relativeDirPath);
|
|
9162
9400
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
9163
9401
|
await ensureDir(ignorePaths.recommended.relativeDirPath);
|
|
9164
|
-
const ruleFilepath = (0,
|
|
9402
|
+
const ruleFilepath = (0, import_node_path83.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
9165
9403
|
if (!await fileExists(ruleFilepath)) {
|
|
9166
9404
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
9167
9405
|
logger.success(`Created ${ruleFilepath}`);
|
|
9168
9406
|
} else {
|
|
9169
9407
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
9170
9408
|
}
|
|
9171
|
-
const mcpFilepath = (0,
|
|
9409
|
+
const mcpFilepath = (0, import_node_path83.join)(
|
|
9172
9410
|
mcpPaths.recommended.relativeDirPath,
|
|
9173
9411
|
mcpPaths.recommended.relativeFilePath
|
|
9174
9412
|
);
|
|
@@ -9178,21 +9416,21 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9178
9416
|
} else {
|
|
9179
9417
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
9180
9418
|
}
|
|
9181
|
-
const commandFilepath = (0,
|
|
9419
|
+
const commandFilepath = (0, import_node_path83.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
9182
9420
|
if (!await fileExists(commandFilepath)) {
|
|
9183
9421
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
9184
9422
|
logger.success(`Created ${commandFilepath}`);
|
|
9185
9423
|
} else {
|
|
9186
9424
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
9187
9425
|
}
|
|
9188
|
-
const subagentFilepath = (0,
|
|
9426
|
+
const subagentFilepath = (0, import_node_path83.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
9189
9427
|
if (!await fileExists(subagentFilepath)) {
|
|
9190
9428
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
9191
9429
|
logger.success(`Created ${subagentFilepath}`);
|
|
9192
9430
|
} else {
|
|
9193
9431
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
9194
9432
|
}
|
|
9195
|
-
const ignoreFilepath = (0,
|
|
9433
|
+
const ignoreFilepath = (0, import_node_path83.join)(
|
|
9196
9434
|
ignorePaths.recommended.relativeDirPath,
|
|
9197
9435
|
ignorePaths.recommended.relativeFilePath
|
|
9198
9436
|
);
|
|
@@ -9208,12 +9446,12 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
9208
9446
|
var import_fastmcp = require("fastmcp");
|
|
9209
9447
|
|
|
9210
9448
|
// src/mcp/commands.ts
|
|
9211
|
-
var
|
|
9212
|
-
var
|
|
9449
|
+
var import_node_path84 = require("path");
|
|
9450
|
+
var import_mini31 = require("zod/mini");
|
|
9213
9451
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
9214
9452
|
var maxCommandsCount = 1e3;
|
|
9215
9453
|
async function listCommands() {
|
|
9216
|
-
const commandsDir = (0,
|
|
9454
|
+
const commandsDir = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
9217
9455
|
try {
|
|
9218
9456
|
const files = await listDirectoryFiles(commandsDir);
|
|
9219
9457
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9225,7 +9463,7 @@ async function listCommands() {
|
|
|
9225
9463
|
});
|
|
9226
9464
|
const frontmatter = command.getFrontmatter();
|
|
9227
9465
|
return {
|
|
9228
|
-
relativePathFromCwd: (0,
|
|
9466
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
9229
9467
|
frontmatter
|
|
9230
9468
|
};
|
|
9231
9469
|
} catch (error) {
|
|
@@ -9245,13 +9483,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
9245
9483
|
relativePath: relativePathFromCwd,
|
|
9246
9484
|
intendedRootDir: process.cwd()
|
|
9247
9485
|
});
|
|
9248
|
-
const filename = (0,
|
|
9486
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9249
9487
|
try {
|
|
9250
9488
|
const command = await RulesyncCommand.fromFile({
|
|
9251
9489
|
relativeFilePath: filename
|
|
9252
9490
|
});
|
|
9253
9491
|
return {
|
|
9254
|
-
relativePathFromCwd: (0,
|
|
9492
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
9255
9493
|
frontmatter: command.getFrontmatter(),
|
|
9256
9494
|
body: command.getBody()
|
|
9257
9495
|
};
|
|
@@ -9270,7 +9508,7 @@ async function putCommand({
|
|
|
9270
9508
|
relativePath: relativePathFromCwd,
|
|
9271
9509
|
intendedRootDir: process.cwd()
|
|
9272
9510
|
});
|
|
9273
|
-
const filename = (0,
|
|
9511
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9274
9512
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9275
9513
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
9276
9514
|
throw new Error(
|
|
@@ -9280,7 +9518,7 @@ async function putCommand({
|
|
|
9280
9518
|
try {
|
|
9281
9519
|
const existingCommands = await listCommands();
|
|
9282
9520
|
const isUpdate = existingCommands.some(
|
|
9283
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
9521
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
9284
9522
|
);
|
|
9285
9523
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
9286
9524
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -9295,11 +9533,11 @@ async function putCommand({
|
|
|
9295
9533
|
fileContent,
|
|
9296
9534
|
validate: true
|
|
9297
9535
|
});
|
|
9298
|
-
const commandsDir = (0,
|
|
9536
|
+
const commandsDir = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
9299
9537
|
await ensureDir(commandsDir);
|
|
9300
9538
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
9301
9539
|
return {
|
|
9302
|
-
relativePathFromCwd: (0,
|
|
9540
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
9303
9541
|
frontmatter: command.getFrontmatter(),
|
|
9304
9542
|
body: command.getBody()
|
|
9305
9543
|
};
|
|
@@ -9314,12 +9552,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
9314
9552
|
relativePath: relativePathFromCwd,
|
|
9315
9553
|
intendedRootDir: process.cwd()
|
|
9316
9554
|
});
|
|
9317
|
-
const filename = (0,
|
|
9318
|
-
const fullPath = (0,
|
|
9555
|
+
const filename = (0, import_node_path84.basename)(relativePathFromCwd);
|
|
9556
|
+
const fullPath = (0, import_node_path84.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
9319
9557
|
try {
|
|
9320
9558
|
await removeFile(fullPath);
|
|
9321
9559
|
return {
|
|
9322
|
-
relativePathFromCwd: (0,
|
|
9560
|
+
relativePathFromCwd: (0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
9323
9561
|
};
|
|
9324
9562
|
} catch (error) {
|
|
9325
9563
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -9328,23 +9566,23 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
9328
9566
|
}
|
|
9329
9567
|
}
|
|
9330
9568
|
var commandToolSchemas = {
|
|
9331
|
-
listCommands:
|
|
9332
|
-
getCommand:
|
|
9333
|
-
relativePathFromCwd:
|
|
9569
|
+
listCommands: import_mini31.z.object({}),
|
|
9570
|
+
getCommand: import_mini31.z.object({
|
|
9571
|
+
relativePathFromCwd: import_mini31.z.string()
|
|
9334
9572
|
}),
|
|
9335
|
-
putCommand:
|
|
9336
|
-
relativePathFromCwd:
|
|
9573
|
+
putCommand: import_mini31.z.object({
|
|
9574
|
+
relativePathFromCwd: import_mini31.z.string(),
|
|
9337
9575
|
frontmatter: RulesyncCommandFrontmatterSchema,
|
|
9338
|
-
body:
|
|
9576
|
+
body: import_mini31.z.string()
|
|
9339
9577
|
}),
|
|
9340
|
-
deleteCommand:
|
|
9341
|
-
relativePathFromCwd:
|
|
9578
|
+
deleteCommand: import_mini31.z.object({
|
|
9579
|
+
relativePathFromCwd: import_mini31.z.string()
|
|
9342
9580
|
})
|
|
9343
9581
|
};
|
|
9344
9582
|
var commandTools = {
|
|
9345
9583
|
listCommands: {
|
|
9346
9584
|
name: "listCommands",
|
|
9347
|
-
description: `List all commands from ${(0,
|
|
9585
|
+
description: `List all commands from ${(0, import_node_path84.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9348
9586
|
parameters: commandToolSchemas.listCommands,
|
|
9349
9587
|
execute: async () => {
|
|
9350
9588
|
const commands = await listCommands();
|
|
@@ -9386,11 +9624,11 @@ var commandTools = {
|
|
|
9386
9624
|
};
|
|
9387
9625
|
|
|
9388
9626
|
// src/mcp/ignore.ts
|
|
9389
|
-
var
|
|
9390
|
-
var
|
|
9627
|
+
var import_node_path85 = require("path");
|
|
9628
|
+
var import_mini32 = require("zod/mini");
|
|
9391
9629
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
9392
9630
|
async function getIgnoreFile() {
|
|
9393
|
-
const ignoreFilePath = (0,
|
|
9631
|
+
const ignoreFilePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9394
9632
|
try {
|
|
9395
9633
|
const content = await readFileContent(ignoreFilePath);
|
|
9396
9634
|
return {
|
|
@@ -9404,7 +9642,7 @@ async function getIgnoreFile() {
|
|
|
9404
9642
|
}
|
|
9405
9643
|
}
|
|
9406
9644
|
async function putIgnoreFile({ content }) {
|
|
9407
|
-
const ignoreFilePath = (0,
|
|
9645
|
+
const ignoreFilePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9408
9646
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
9409
9647
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
9410
9648
|
throw new Error(
|
|
@@ -9425,8 +9663,8 @@ async function putIgnoreFile({ content }) {
|
|
|
9425
9663
|
}
|
|
9426
9664
|
}
|
|
9427
9665
|
async function deleteIgnoreFile() {
|
|
9428
|
-
const aiignorePath = (0,
|
|
9429
|
-
const legacyIgnorePath = (0,
|
|
9666
|
+
const aiignorePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_AIIGNORE_RELATIVE_FILE_PATH);
|
|
9667
|
+
const legacyIgnorePath = (0, import_node_path85.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
9430
9668
|
try {
|
|
9431
9669
|
await Promise.all([removeFile(aiignorePath), removeFile(legacyIgnorePath)]);
|
|
9432
9670
|
return {
|
|
@@ -9444,11 +9682,11 @@ async function deleteIgnoreFile() {
|
|
|
9444
9682
|
}
|
|
9445
9683
|
}
|
|
9446
9684
|
var ignoreToolSchemas = {
|
|
9447
|
-
getIgnoreFile:
|
|
9448
|
-
putIgnoreFile:
|
|
9449
|
-
content:
|
|
9685
|
+
getIgnoreFile: import_mini32.z.object({}),
|
|
9686
|
+
putIgnoreFile: import_mini32.z.object({
|
|
9687
|
+
content: import_mini32.z.string()
|
|
9450
9688
|
}),
|
|
9451
|
-
deleteIgnoreFile:
|
|
9689
|
+
deleteIgnoreFile: import_mini32.z.object({})
|
|
9452
9690
|
};
|
|
9453
9691
|
var ignoreTools = {
|
|
9454
9692
|
getIgnoreFile: {
|
|
@@ -9481,8 +9719,8 @@ var ignoreTools = {
|
|
|
9481
9719
|
};
|
|
9482
9720
|
|
|
9483
9721
|
// src/mcp/mcp.ts
|
|
9484
|
-
var
|
|
9485
|
-
var
|
|
9722
|
+
var import_node_path86 = require("path");
|
|
9723
|
+
var import_mini33 = require("zod/mini");
|
|
9486
9724
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
9487
9725
|
async function getMcpFile() {
|
|
9488
9726
|
const config = await ConfigResolver.resolve({});
|
|
@@ -9491,7 +9729,7 @@ async function getMcpFile() {
|
|
|
9491
9729
|
validate: true,
|
|
9492
9730
|
modularMcp: config.getModularMcp()
|
|
9493
9731
|
});
|
|
9494
|
-
const relativePathFromCwd = (0,
|
|
9732
|
+
const relativePathFromCwd = (0, import_node_path86.join)(
|
|
9495
9733
|
rulesyncMcp.getRelativeDirPath(),
|
|
9496
9734
|
rulesyncMcp.getRelativeFilePath()
|
|
9497
9735
|
);
|
|
@@ -9524,7 +9762,7 @@ async function putMcpFile({ content }) {
|
|
|
9524
9762
|
const paths = RulesyncMcp.getSettablePaths();
|
|
9525
9763
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
9526
9764
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
9527
|
-
const fullPath = (0,
|
|
9765
|
+
const fullPath = (0, import_node_path86.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
9528
9766
|
const rulesyncMcp = new RulesyncMcp({
|
|
9529
9767
|
baseDir,
|
|
9530
9768
|
relativeDirPath,
|
|
@@ -9533,9 +9771,9 @@ async function putMcpFile({ content }) {
|
|
|
9533
9771
|
validate: true,
|
|
9534
9772
|
modularMcp: config.getModularMcp()
|
|
9535
9773
|
});
|
|
9536
|
-
await ensureDir((0,
|
|
9774
|
+
await ensureDir((0, import_node_path86.join)(baseDir, relativeDirPath));
|
|
9537
9775
|
await writeFileContent(fullPath, content);
|
|
9538
|
-
const relativePathFromCwd = (0,
|
|
9776
|
+
const relativePathFromCwd = (0, import_node_path86.join)(relativeDirPath, relativeFilePath);
|
|
9539
9777
|
return {
|
|
9540
9778
|
relativePathFromCwd,
|
|
9541
9779
|
content: rulesyncMcp.getFileContent()
|
|
@@ -9550,15 +9788,15 @@ async function deleteMcpFile() {
|
|
|
9550
9788
|
try {
|
|
9551
9789
|
const baseDir = process.cwd();
|
|
9552
9790
|
const paths = RulesyncMcp.getSettablePaths();
|
|
9553
|
-
const recommendedPath = (0,
|
|
9791
|
+
const recommendedPath = (0, import_node_path86.join)(
|
|
9554
9792
|
baseDir,
|
|
9555
9793
|
paths.recommended.relativeDirPath,
|
|
9556
9794
|
paths.recommended.relativeFilePath
|
|
9557
9795
|
);
|
|
9558
|
-
const legacyPath = (0,
|
|
9796
|
+
const legacyPath = (0, import_node_path86.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
9559
9797
|
await removeFile(recommendedPath);
|
|
9560
9798
|
await removeFile(legacyPath);
|
|
9561
|
-
const relativePathFromCwd = (0,
|
|
9799
|
+
const relativePathFromCwd = (0, import_node_path86.join)(
|
|
9562
9800
|
paths.recommended.relativeDirPath,
|
|
9563
9801
|
paths.recommended.relativeFilePath
|
|
9564
9802
|
);
|
|
@@ -9572,11 +9810,11 @@ async function deleteMcpFile() {
|
|
|
9572
9810
|
}
|
|
9573
9811
|
}
|
|
9574
9812
|
var mcpToolSchemas = {
|
|
9575
|
-
getMcpFile:
|
|
9576
|
-
putMcpFile:
|
|
9577
|
-
content:
|
|
9813
|
+
getMcpFile: import_mini33.z.object({}),
|
|
9814
|
+
putMcpFile: import_mini33.z.object({
|
|
9815
|
+
content: import_mini33.z.string()
|
|
9578
9816
|
}),
|
|
9579
|
-
deleteMcpFile:
|
|
9817
|
+
deleteMcpFile: import_mini33.z.object({})
|
|
9580
9818
|
};
|
|
9581
9819
|
var mcpTools = {
|
|
9582
9820
|
getMcpFile: {
|
|
@@ -9609,12 +9847,12 @@ var mcpTools = {
|
|
|
9609
9847
|
};
|
|
9610
9848
|
|
|
9611
9849
|
// src/mcp/rules.ts
|
|
9612
|
-
var
|
|
9613
|
-
var
|
|
9850
|
+
var import_node_path87 = require("path");
|
|
9851
|
+
var import_mini34 = require("zod/mini");
|
|
9614
9852
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
9615
9853
|
var maxRulesCount = 1e3;
|
|
9616
9854
|
async function listRules() {
|
|
9617
|
-
const rulesDir = (0,
|
|
9855
|
+
const rulesDir = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
9618
9856
|
try {
|
|
9619
9857
|
const files = await listDirectoryFiles(rulesDir);
|
|
9620
9858
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9627,7 +9865,7 @@ async function listRules() {
|
|
|
9627
9865
|
});
|
|
9628
9866
|
const frontmatter = rule.getFrontmatter();
|
|
9629
9867
|
return {
|
|
9630
|
-
relativePathFromCwd: (0,
|
|
9868
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
9631
9869
|
frontmatter
|
|
9632
9870
|
};
|
|
9633
9871
|
} catch (error) {
|
|
@@ -9647,14 +9885,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
9647
9885
|
relativePath: relativePathFromCwd,
|
|
9648
9886
|
intendedRootDir: process.cwd()
|
|
9649
9887
|
});
|
|
9650
|
-
const filename = (0,
|
|
9888
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9651
9889
|
try {
|
|
9652
9890
|
const rule = await RulesyncRule.fromFile({
|
|
9653
9891
|
relativeFilePath: filename,
|
|
9654
9892
|
validate: true
|
|
9655
9893
|
});
|
|
9656
9894
|
return {
|
|
9657
|
-
relativePathFromCwd: (0,
|
|
9895
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
9658
9896
|
frontmatter: rule.getFrontmatter(),
|
|
9659
9897
|
body: rule.getBody()
|
|
9660
9898
|
};
|
|
@@ -9673,7 +9911,7 @@ async function putRule({
|
|
|
9673
9911
|
relativePath: relativePathFromCwd,
|
|
9674
9912
|
intendedRootDir: process.cwd()
|
|
9675
9913
|
});
|
|
9676
|
-
const filename = (0,
|
|
9914
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9677
9915
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9678
9916
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
9679
9917
|
throw new Error(
|
|
@@ -9683,7 +9921,7 @@ async function putRule({
|
|
|
9683
9921
|
try {
|
|
9684
9922
|
const existingRules = await listRules();
|
|
9685
9923
|
const isUpdate = existingRules.some(
|
|
9686
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
9924
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
9687
9925
|
);
|
|
9688
9926
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
9689
9927
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
@@ -9696,11 +9934,11 @@ async function putRule({
|
|
|
9696
9934
|
body,
|
|
9697
9935
|
validate: true
|
|
9698
9936
|
});
|
|
9699
|
-
const rulesDir = (0,
|
|
9937
|
+
const rulesDir = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
9700
9938
|
await ensureDir(rulesDir);
|
|
9701
9939
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
9702
9940
|
return {
|
|
9703
|
-
relativePathFromCwd: (0,
|
|
9941
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
9704
9942
|
frontmatter: rule.getFrontmatter(),
|
|
9705
9943
|
body: rule.getBody()
|
|
9706
9944
|
};
|
|
@@ -9715,12 +9953,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
9715
9953
|
relativePath: relativePathFromCwd,
|
|
9716
9954
|
intendedRootDir: process.cwd()
|
|
9717
9955
|
});
|
|
9718
|
-
const filename = (0,
|
|
9719
|
-
const fullPath = (0,
|
|
9956
|
+
const filename = (0, import_node_path87.basename)(relativePathFromCwd);
|
|
9957
|
+
const fullPath = (0, import_node_path87.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
9720
9958
|
try {
|
|
9721
9959
|
await removeFile(fullPath);
|
|
9722
9960
|
return {
|
|
9723
|
-
relativePathFromCwd: (0,
|
|
9961
|
+
relativePathFromCwd: (0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
9724
9962
|
};
|
|
9725
9963
|
} catch (error) {
|
|
9726
9964
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -9729,23 +9967,23 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
9729
9967
|
}
|
|
9730
9968
|
}
|
|
9731
9969
|
var ruleToolSchemas = {
|
|
9732
|
-
listRules:
|
|
9733
|
-
getRule:
|
|
9734
|
-
relativePathFromCwd:
|
|
9970
|
+
listRules: import_mini34.z.object({}),
|
|
9971
|
+
getRule: import_mini34.z.object({
|
|
9972
|
+
relativePathFromCwd: import_mini34.z.string()
|
|
9735
9973
|
}),
|
|
9736
|
-
putRule:
|
|
9737
|
-
relativePathFromCwd:
|
|
9974
|
+
putRule: import_mini34.z.object({
|
|
9975
|
+
relativePathFromCwd: import_mini34.z.string(),
|
|
9738
9976
|
frontmatter: RulesyncRuleFrontmatterSchema,
|
|
9739
|
-
body:
|
|
9977
|
+
body: import_mini34.z.string()
|
|
9740
9978
|
}),
|
|
9741
|
-
deleteRule:
|
|
9742
|
-
relativePathFromCwd:
|
|
9979
|
+
deleteRule: import_mini34.z.object({
|
|
9980
|
+
relativePathFromCwd: import_mini34.z.string()
|
|
9743
9981
|
})
|
|
9744
9982
|
};
|
|
9745
9983
|
var ruleTools = {
|
|
9746
9984
|
listRules: {
|
|
9747
9985
|
name: "listRules",
|
|
9748
|
-
description: `List all rules from ${(0,
|
|
9986
|
+
description: `List all rules from ${(0, import_node_path87.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9749
9987
|
parameters: ruleToolSchemas.listRules,
|
|
9750
9988
|
execute: async () => {
|
|
9751
9989
|
const rules = await listRules();
|
|
@@ -9787,12 +10025,12 @@ var ruleTools = {
|
|
|
9787
10025
|
};
|
|
9788
10026
|
|
|
9789
10027
|
// src/mcp/subagents.ts
|
|
9790
|
-
var
|
|
9791
|
-
var
|
|
10028
|
+
var import_node_path88 = require("path");
|
|
10029
|
+
var import_mini35 = require("zod/mini");
|
|
9792
10030
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
9793
10031
|
var maxSubagentsCount = 1e3;
|
|
9794
10032
|
async function listSubagents() {
|
|
9795
|
-
const subagentsDir = (0,
|
|
10033
|
+
const subagentsDir = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
9796
10034
|
try {
|
|
9797
10035
|
const files = await listDirectoryFiles(subagentsDir);
|
|
9798
10036
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -9805,7 +10043,7 @@ async function listSubagents() {
|
|
|
9805
10043
|
});
|
|
9806
10044
|
const frontmatter = subagent.getFrontmatter();
|
|
9807
10045
|
return {
|
|
9808
|
-
relativePathFromCwd: (0,
|
|
10046
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
9809
10047
|
frontmatter
|
|
9810
10048
|
};
|
|
9811
10049
|
} catch (error) {
|
|
@@ -9827,14 +10065,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
9827
10065
|
relativePath: relativePathFromCwd,
|
|
9828
10066
|
intendedRootDir: process.cwd()
|
|
9829
10067
|
});
|
|
9830
|
-
const filename = (0,
|
|
10068
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
9831
10069
|
try {
|
|
9832
10070
|
const subagent = await RulesyncSubagent.fromFile({
|
|
9833
10071
|
relativeFilePath: filename,
|
|
9834
10072
|
validate: true
|
|
9835
10073
|
});
|
|
9836
10074
|
return {
|
|
9837
|
-
relativePathFromCwd: (0,
|
|
10075
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
9838
10076
|
frontmatter: subagent.getFrontmatter(),
|
|
9839
10077
|
body: subagent.getBody()
|
|
9840
10078
|
};
|
|
@@ -9853,7 +10091,7 @@ async function putSubagent({
|
|
|
9853
10091
|
relativePath: relativePathFromCwd,
|
|
9854
10092
|
intendedRootDir: process.cwd()
|
|
9855
10093
|
});
|
|
9856
|
-
const filename = (0,
|
|
10094
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
9857
10095
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
9858
10096
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
9859
10097
|
throw new Error(
|
|
@@ -9863,7 +10101,7 @@ async function putSubagent({
|
|
|
9863
10101
|
try {
|
|
9864
10102
|
const existingSubagents = await listSubagents();
|
|
9865
10103
|
const isUpdate = existingSubagents.some(
|
|
9866
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
10104
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
9867
10105
|
);
|
|
9868
10106
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
9869
10107
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
@@ -9876,11 +10114,11 @@ async function putSubagent({
|
|
|
9876
10114
|
body,
|
|
9877
10115
|
validate: true
|
|
9878
10116
|
});
|
|
9879
|
-
const subagentsDir = (0,
|
|
10117
|
+
const subagentsDir = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
9880
10118
|
await ensureDir(subagentsDir);
|
|
9881
10119
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
9882
10120
|
return {
|
|
9883
|
-
relativePathFromCwd: (0,
|
|
10121
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
9884
10122
|
frontmatter: subagent.getFrontmatter(),
|
|
9885
10123
|
body: subagent.getBody()
|
|
9886
10124
|
};
|
|
@@ -9895,12 +10133,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
9895
10133
|
relativePath: relativePathFromCwd,
|
|
9896
10134
|
intendedRootDir: process.cwd()
|
|
9897
10135
|
});
|
|
9898
|
-
const filename = (0,
|
|
9899
|
-
const fullPath = (0,
|
|
10136
|
+
const filename = (0, import_node_path88.basename)(relativePathFromCwd);
|
|
10137
|
+
const fullPath = (0, import_node_path88.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
9900
10138
|
try {
|
|
9901
10139
|
await removeFile(fullPath);
|
|
9902
10140
|
return {
|
|
9903
|
-
relativePathFromCwd: (0,
|
|
10141
|
+
relativePathFromCwd: (0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
9904
10142
|
};
|
|
9905
10143
|
} catch (error) {
|
|
9906
10144
|
throw new Error(
|
|
@@ -9912,23 +10150,23 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
9912
10150
|
}
|
|
9913
10151
|
}
|
|
9914
10152
|
var subagentToolSchemas = {
|
|
9915
|
-
listSubagents:
|
|
9916
|
-
getSubagent:
|
|
9917
|
-
relativePathFromCwd:
|
|
10153
|
+
listSubagents: import_mini35.z.object({}),
|
|
10154
|
+
getSubagent: import_mini35.z.object({
|
|
10155
|
+
relativePathFromCwd: import_mini35.z.string()
|
|
9918
10156
|
}),
|
|
9919
|
-
putSubagent:
|
|
9920
|
-
relativePathFromCwd:
|
|
10157
|
+
putSubagent: import_mini35.z.object({
|
|
10158
|
+
relativePathFromCwd: import_mini35.z.string(),
|
|
9921
10159
|
frontmatter: RulesyncSubagentFrontmatterSchema,
|
|
9922
|
-
body:
|
|
10160
|
+
body: import_mini35.z.string()
|
|
9923
10161
|
}),
|
|
9924
|
-
deleteSubagent:
|
|
9925
|
-
relativePathFromCwd:
|
|
10162
|
+
deleteSubagent: import_mini35.z.object({
|
|
10163
|
+
relativePathFromCwd: import_mini35.z.string()
|
|
9926
10164
|
})
|
|
9927
10165
|
};
|
|
9928
10166
|
var subagentTools = {
|
|
9929
10167
|
listSubagents: {
|
|
9930
10168
|
name: "listSubagents",
|
|
9931
|
-
description: `List all subagents from ${(0,
|
|
10169
|
+
description: `List all subagents from ${(0, import_node_path88.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
9932
10170
|
parameters: subagentToolSchemas.listSubagents,
|
|
9933
10171
|
execute: async () => {
|
|
9934
10172
|
const subagents = await listSubagents();
|
|
@@ -10002,7 +10240,7 @@ async function mcpCommand({ version }) {
|
|
|
10002
10240
|
}
|
|
10003
10241
|
|
|
10004
10242
|
// src/cli/index.ts
|
|
10005
|
-
var getVersion = () => "3.
|
|
10243
|
+
var getVersion = () => "3.28.1";
|
|
10006
10244
|
var main = async () => {
|
|
10007
10245
|
const program = new import_commander.Command();
|
|
10008
10246
|
const version = getVersion();
|