rulesync 3.20.0 → 3.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -15
- package/dist/index.cjs +345 -333
- package/dist/index.js +302 -290
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -454,8 +454,19 @@ function getBaseDirsInLightOfGlobal({
|
|
|
454
454
|
return resolvedBaseDirs;
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
+
// src/constants/rulesync-paths.ts
|
|
458
|
+
var import_node_path3 = require("path");
|
|
459
|
+
var RULESYNC_CONFIG_RELATIVE_FILE_PATH = "rulesync.jsonc";
|
|
460
|
+
var RULESYNC_RELATIVE_DIR_PATH = ".rulesync";
|
|
461
|
+
var RULESYNC_RULES_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "rules");
|
|
462
|
+
var RULESYNC_COMMANDS_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "commands");
|
|
463
|
+
var RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "subagents");
|
|
464
|
+
var RULESYNC_MCP_RELATIVE_FILE_PATH = (0, import_node_path3.join)(RULESYNC_RELATIVE_DIR_PATH, "mcp.json");
|
|
465
|
+
var RULESYNC_IGNORE_RELATIVE_FILE_PATH = ".rulesyncignore";
|
|
466
|
+
var RULESYNC_OVERVIEW_FILE_NAME = "overview.md";
|
|
467
|
+
|
|
457
468
|
// src/features/commands/commands-processor.ts
|
|
458
|
-
var
|
|
469
|
+
var import_node_path14 = require("path");
|
|
459
470
|
var import_mini10 = require("zod/mini");
|
|
460
471
|
|
|
461
472
|
// src/types/feature-processor.ts
|
|
@@ -489,7 +500,7 @@ var FeatureProcessor = class {
|
|
|
489
500
|
};
|
|
490
501
|
|
|
491
502
|
// src/features/commands/agentsmd-command.ts
|
|
492
|
-
var
|
|
503
|
+
var import_node_path6 = require("path");
|
|
493
504
|
|
|
494
505
|
// src/utils/frontmatter.ts
|
|
495
506
|
var import_gray_matter = __toESM(require("gray-matter"), 1);
|
|
@@ -541,11 +552,11 @@ function parseFrontmatter(content) {
|
|
|
541
552
|
}
|
|
542
553
|
|
|
543
554
|
// src/features/commands/simulated-command.ts
|
|
544
|
-
var
|
|
555
|
+
var import_node_path5 = require("path");
|
|
545
556
|
var import_mini4 = require("zod/mini");
|
|
546
557
|
|
|
547
558
|
// src/types/ai-file.ts
|
|
548
|
-
var
|
|
559
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
549
560
|
var AiFile = class {
|
|
550
561
|
/**
|
|
551
562
|
* @example "."
|
|
@@ -600,11 +611,11 @@ var AiFile = class {
|
|
|
600
611
|
return this.relativeFilePath;
|
|
601
612
|
}
|
|
602
613
|
getFilePath() {
|
|
603
|
-
const fullPath =
|
|
604
|
-
const resolvedFull = (0,
|
|
605
|
-
const resolvedBase = (0,
|
|
606
|
-
const rel = (0,
|
|
607
|
-
if (rel.startsWith("..") ||
|
|
614
|
+
const fullPath = import_node_path4.default.join(this.baseDir, this.relativeDirPath, this.relativeFilePath);
|
|
615
|
+
const resolvedFull = (0, import_node_path4.resolve)(fullPath);
|
|
616
|
+
const resolvedBase = (0, import_node_path4.resolve)(this.baseDir);
|
|
617
|
+
const rel = (0, import_node_path4.relative)(resolvedBase, resolvedFull);
|
|
618
|
+
if (rel.startsWith("..") || import_node_path4.default.isAbsolute(rel)) {
|
|
608
619
|
throw new Error(
|
|
609
620
|
`Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", relativeFilePath="${this.relativeFilePath}"`
|
|
610
621
|
);
|
|
@@ -615,7 +626,7 @@ var AiFile = class {
|
|
|
615
626
|
return this.fileContent;
|
|
616
627
|
}
|
|
617
628
|
getRelativePathFromCwd() {
|
|
618
|
-
return
|
|
629
|
+
return import_node_path4.default.join(this.relativeDirPath, this.relativeFilePath);
|
|
619
630
|
}
|
|
620
631
|
setFileContent(newFileContent) {
|
|
621
632
|
this.fileContent = newFileContent;
|
|
@@ -704,7 +715,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
704
715
|
const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
|
|
705
716
|
if (!result.success) {
|
|
706
717
|
throw new Error(
|
|
707
|
-
`Invalid frontmatter in ${(0,
|
|
718
|
+
`Invalid frontmatter in ${(0, import_node_path5.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
708
719
|
);
|
|
709
720
|
}
|
|
710
721
|
}
|
|
@@ -754,7 +765,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
754
765
|
return {
|
|
755
766
|
success: false,
|
|
756
767
|
error: new Error(
|
|
757
|
-
`Invalid frontmatter in ${(0,
|
|
768
|
+
`Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
758
769
|
)
|
|
759
770
|
};
|
|
760
771
|
}
|
|
@@ -764,7 +775,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
764
775
|
relativeFilePath,
|
|
765
776
|
validate = true
|
|
766
777
|
}) {
|
|
767
|
-
const filePath = (0,
|
|
778
|
+
const filePath = (0, import_node_path5.join)(
|
|
768
779
|
baseDir,
|
|
769
780
|
_SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
770
781
|
relativeFilePath
|
|
@@ -778,7 +789,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
778
789
|
return {
|
|
779
790
|
baseDir,
|
|
780
791
|
relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
|
|
781
|
-
relativeFilePath: (0,
|
|
792
|
+
relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
|
|
782
793
|
frontmatter: result.data,
|
|
783
794
|
body: content.trim(),
|
|
784
795
|
validate
|
|
@@ -790,7 +801,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
|
|
|
790
801
|
var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
791
802
|
static getSettablePaths() {
|
|
792
803
|
return {
|
|
793
|
-
relativeDirPath: (0,
|
|
804
|
+
relativeDirPath: (0, import_node_path6.join)(".agents", "commands")
|
|
794
805
|
};
|
|
795
806
|
}
|
|
796
807
|
static fromRulesyncCommand({
|
|
@@ -807,7 +818,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
807
818
|
relativeFilePath,
|
|
808
819
|
validate = true
|
|
809
820
|
}) {
|
|
810
|
-
const filePath = (0,
|
|
821
|
+
const filePath = (0, import_node_path6.join)(
|
|
811
822
|
baseDir,
|
|
812
823
|
_AgentsmdCommand.getSettablePaths().relativeDirPath,
|
|
813
824
|
relativeFilePath
|
|
@@ -821,7 +832,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
821
832
|
return new _AgentsmdCommand({
|
|
822
833
|
baseDir,
|
|
823
834
|
relativeDirPath: _AgentsmdCommand.getSettablePaths().relativeDirPath,
|
|
824
|
-
relativeFilePath: (0,
|
|
835
|
+
relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
|
|
825
836
|
frontmatter: result.data,
|
|
826
837
|
body: content.trim(),
|
|
827
838
|
validate
|
|
@@ -836,11 +847,11 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
|
|
|
836
847
|
};
|
|
837
848
|
|
|
838
849
|
// src/features/commands/claudecode-command.ts
|
|
839
|
-
var
|
|
850
|
+
var import_node_path8 = require("path");
|
|
840
851
|
var import_mini6 = require("zod/mini");
|
|
841
852
|
|
|
842
853
|
// src/features/commands/rulesync-command.ts
|
|
843
|
-
var
|
|
854
|
+
var import_node_path7 = require("path");
|
|
844
855
|
var import_mini5 = require("zod/mini");
|
|
845
856
|
|
|
846
857
|
// src/types/rulesync-file.ts
|
|
@@ -866,7 +877,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
866
877
|
const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
|
|
867
878
|
if (!result.success) {
|
|
868
879
|
throw new Error(
|
|
869
|
-
`Invalid frontmatter in ${(0,
|
|
880
|
+
`Invalid frontmatter in ${(0, import_node_path7.join)(rest.baseDir ?? process.cwd(), rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
870
881
|
);
|
|
871
882
|
}
|
|
872
883
|
}
|
|
@@ -879,7 +890,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
879
890
|
}
|
|
880
891
|
static getSettablePaths() {
|
|
881
892
|
return {
|
|
882
|
-
relativeDirPath:
|
|
893
|
+
relativeDirPath: RULESYNC_COMMANDS_RELATIVE_DIR_PATH
|
|
883
894
|
};
|
|
884
895
|
}
|
|
885
896
|
getFrontmatter() {
|
|
@@ -899,7 +910,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
899
910
|
return {
|
|
900
911
|
success: false,
|
|
901
912
|
error: new Error(
|
|
902
|
-
`Invalid frontmatter in ${(0,
|
|
913
|
+
`Invalid frontmatter in ${(0, import_node_path7.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
903
914
|
)
|
|
904
915
|
};
|
|
905
916
|
}
|
|
@@ -907,7 +918,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
907
918
|
static async fromFile({
|
|
908
919
|
relativeFilePath
|
|
909
920
|
}) {
|
|
910
|
-
const filePath = (0,
|
|
921
|
+
const filePath = (0, import_node_path7.join)(
|
|
911
922
|
process.cwd(),
|
|
912
923
|
_RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
913
924
|
relativeFilePath
|
|
@@ -918,7 +929,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
|
|
|
918
929
|
if (!result.success) {
|
|
919
930
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
920
931
|
}
|
|
921
|
-
const filename = (0,
|
|
932
|
+
const filename = (0, import_node_path7.basename)(relativeFilePath);
|
|
922
933
|
return new _RulesyncCommand({
|
|
923
934
|
baseDir: process.cwd(),
|
|
924
935
|
relativeDirPath: _RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
@@ -942,7 +953,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
942
953
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
943
954
|
if (!result.success) {
|
|
944
955
|
throw new Error(
|
|
945
|
-
`Invalid frontmatter in ${(0,
|
|
956
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
946
957
|
);
|
|
947
958
|
}
|
|
948
959
|
}
|
|
@@ -955,7 +966,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
955
966
|
}
|
|
956
967
|
static getSettablePaths(_options = {}) {
|
|
957
968
|
return {
|
|
958
|
-
relativeDirPath: (0,
|
|
969
|
+
relativeDirPath: (0, import_node_path8.join)(".claude", "commands")
|
|
959
970
|
};
|
|
960
971
|
}
|
|
961
972
|
getBody() {
|
|
@@ -1013,7 +1024,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1013
1024
|
return {
|
|
1014
1025
|
success: false,
|
|
1015
1026
|
error: new Error(
|
|
1016
|
-
`Invalid frontmatter in ${(0,
|
|
1027
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1017
1028
|
)
|
|
1018
1029
|
};
|
|
1019
1030
|
}
|
|
@@ -1031,7 +1042,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1031
1042
|
global = false
|
|
1032
1043
|
}) {
|
|
1033
1044
|
const paths = this.getSettablePaths({ global });
|
|
1034
|
-
const filePath = (0,
|
|
1045
|
+
const filePath = (0, import_node_path8.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1035
1046
|
const fileContent = await readFileContent(filePath);
|
|
1036
1047
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1037
1048
|
const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1041,7 +1052,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1041
1052
|
return new _ClaudecodeCommand({
|
|
1042
1053
|
baseDir,
|
|
1043
1054
|
relativeDirPath: paths.relativeDirPath,
|
|
1044
|
-
relativeFilePath: (0,
|
|
1055
|
+
relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
|
|
1045
1056
|
frontmatter: result.data,
|
|
1046
1057
|
body: content.trim(),
|
|
1047
1058
|
validate
|
|
@@ -1050,14 +1061,14 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
1050
1061
|
};
|
|
1051
1062
|
|
|
1052
1063
|
// src/features/commands/codexcli-command.ts
|
|
1053
|
-
var
|
|
1064
|
+
var import_node_path9 = require("path");
|
|
1054
1065
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
1055
1066
|
static getSettablePaths({ global } = {}) {
|
|
1056
1067
|
if (!global) {
|
|
1057
1068
|
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
1058
1069
|
}
|
|
1059
1070
|
return {
|
|
1060
|
-
relativeDirPath: (0,
|
|
1071
|
+
relativeDirPath: (0, import_node_path9.join)(".codex", "prompts")
|
|
1061
1072
|
};
|
|
1062
1073
|
}
|
|
1063
1074
|
toRulesyncCommand() {
|
|
@@ -1110,13 +1121,13 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1110
1121
|
global = false
|
|
1111
1122
|
}) {
|
|
1112
1123
|
const paths = this.getSettablePaths({ global });
|
|
1113
|
-
const filePath = (0,
|
|
1124
|
+
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1114
1125
|
const fileContent = await readFileContent(filePath);
|
|
1115
1126
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1116
1127
|
return new _CodexcliCommand({
|
|
1117
1128
|
baseDir,
|
|
1118
1129
|
relativeDirPath: paths.relativeDirPath,
|
|
1119
|
-
relativeFilePath: (0,
|
|
1130
|
+
relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
|
|
1120
1131
|
fileContent: content.trim(),
|
|
1121
1132
|
validate
|
|
1122
1133
|
});
|
|
@@ -1124,7 +1135,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
1124
1135
|
};
|
|
1125
1136
|
|
|
1126
1137
|
// src/features/commands/copilot-command.ts
|
|
1127
|
-
var
|
|
1138
|
+
var import_node_path10 = require("path");
|
|
1128
1139
|
var import_mini7 = require("zod/mini");
|
|
1129
1140
|
var CopilotCommandFrontmatterSchema = import_mini7.z.object({
|
|
1130
1141
|
mode: import_mini7.z.literal("agent"),
|
|
@@ -1138,7 +1149,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1138
1149
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1139
1150
|
if (!result.success) {
|
|
1140
1151
|
throw new Error(
|
|
1141
|
-
`Invalid frontmatter in ${(0,
|
|
1152
|
+
`Invalid frontmatter in ${(0, import_node_path10.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1142
1153
|
);
|
|
1143
1154
|
}
|
|
1144
1155
|
}
|
|
@@ -1151,7 +1162,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1151
1162
|
}
|
|
1152
1163
|
static getSettablePaths() {
|
|
1153
1164
|
return {
|
|
1154
|
-
relativeDirPath: (0,
|
|
1165
|
+
relativeDirPath: (0, import_node_path10.join)(".github", "prompts")
|
|
1155
1166
|
};
|
|
1156
1167
|
}
|
|
1157
1168
|
getBody() {
|
|
@@ -1188,7 +1199,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1188
1199
|
return {
|
|
1189
1200
|
success: false,
|
|
1190
1201
|
error: new Error(
|
|
1191
|
-
`Invalid frontmatter in ${(0,
|
|
1202
|
+
`Invalid frontmatter in ${(0, import_node_path10.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1192
1203
|
)
|
|
1193
1204
|
};
|
|
1194
1205
|
}
|
|
@@ -1222,7 +1233,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1222
1233
|
validate = true
|
|
1223
1234
|
}) {
|
|
1224
1235
|
const paths = this.getSettablePaths();
|
|
1225
|
-
const filePath = (0,
|
|
1236
|
+
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1226
1237
|
const fileContent = await readFileContent(filePath);
|
|
1227
1238
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1228
1239
|
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1232,7 +1243,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1232
1243
|
return new _CopilotCommand({
|
|
1233
1244
|
baseDir,
|
|
1234
1245
|
relativeDirPath: paths.relativeDirPath,
|
|
1235
|
-
relativeFilePath: (0,
|
|
1246
|
+
relativeFilePath: (0, import_node_path10.basename)(relativeFilePath),
|
|
1236
1247
|
frontmatter: result.data,
|
|
1237
1248
|
body: content.trim(),
|
|
1238
1249
|
validate
|
|
@@ -1247,11 +1258,11 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
|
1247
1258
|
};
|
|
1248
1259
|
|
|
1249
1260
|
// src/features/commands/cursor-command.ts
|
|
1250
|
-
var
|
|
1261
|
+
var import_node_path11 = require("path");
|
|
1251
1262
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
1252
1263
|
static getSettablePaths(_options = {}) {
|
|
1253
1264
|
return {
|
|
1254
|
-
relativeDirPath: (0,
|
|
1265
|
+
relativeDirPath: (0, import_node_path11.join)(".cursor", "commands")
|
|
1255
1266
|
};
|
|
1256
1267
|
}
|
|
1257
1268
|
toRulesyncCommand() {
|
|
@@ -1304,13 +1315,13 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1304
1315
|
global = false
|
|
1305
1316
|
}) {
|
|
1306
1317
|
const paths = this.getSettablePaths({ global });
|
|
1307
|
-
const filePath = (0,
|
|
1318
|
+
const filePath = (0, import_node_path11.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1308
1319
|
const fileContent = await readFileContent(filePath);
|
|
1309
1320
|
const { body: content } = parseFrontmatter(fileContent);
|
|
1310
1321
|
return new _CursorCommand({
|
|
1311
1322
|
baseDir,
|
|
1312
1323
|
relativeDirPath: paths.relativeDirPath,
|
|
1313
|
-
relativeFilePath: (0,
|
|
1324
|
+
relativeFilePath: (0, import_node_path11.basename)(relativeFilePath),
|
|
1314
1325
|
fileContent: content.trim(),
|
|
1315
1326
|
validate
|
|
1316
1327
|
});
|
|
@@ -1318,7 +1329,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1318
1329
|
};
|
|
1319
1330
|
|
|
1320
1331
|
// src/features/commands/geminicli-command.ts
|
|
1321
|
-
var
|
|
1332
|
+
var import_node_path12 = require("path");
|
|
1322
1333
|
var import_smol_toml = require("smol-toml");
|
|
1323
1334
|
var import_mini8 = require("zod/mini");
|
|
1324
1335
|
var GeminiCliCommandFrontmatterSchema = import_mini8.z.object({
|
|
@@ -1336,7 +1347,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1336
1347
|
}
|
|
1337
1348
|
static getSettablePaths(_options = {}) {
|
|
1338
1349
|
return {
|
|
1339
|
-
relativeDirPath: (0,
|
|
1350
|
+
relativeDirPath: (0, import_node_path12.join)(".gemini", "commands")
|
|
1340
1351
|
};
|
|
1341
1352
|
}
|
|
1342
1353
|
parseTomlContent(content) {
|
|
@@ -1413,12 +1424,12 @@ ${geminiFrontmatter.prompt}
|
|
|
1413
1424
|
global = false
|
|
1414
1425
|
}) {
|
|
1415
1426
|
const paths = this.getSettablePaths({ global });
|
|
1416
|
-
const filePath = (0,
|
|
1427
|
+
const filePath = (0, import_node_path12.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1417
1428
|
const fileContent = await readFileContent(filePath);
|
|
1418
1429
|
return new _GeminiCliCommand({
|
|
1419
1430
|
baseDir,
|
|
1420
1431
|
relativeDirPath: paths.relativeDirPath,
|
|
1421
|
-
relativeFilePath: (0,
|
|
1432
|
+
relativeFilePath: (0, import_node_path12.basename)(relativeFilePath),
|
|
1422
1433
|
fileContent,
|
|
1423
1434
|
validate
|
|
1424
1435
|
});
|
|
@@ -1440,7 +1451,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1440
1451
|
};
|
|
1441
1452
|
|
|
1442
1453
|
// src/features/commands/roo-command.ts
|
|
1443
|
-
var
|
|
1454
|
+
var import_node_path13 = require("path");
|
|
1444
1455
|
var import_mini9 = require("zod/mini");
|
|
1445
1456
|
var RooCommandFrontmatterSchema = import_mini9.z.object({
|
|
1446
1457
|
description: import_mini9.z.string(),
|
|
@@ -1451,7 +1462,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1451
1462
|
body;
|
|
1452
1463
|
static getSettablePaths() {
|
|
1453
1464
|
return {
|
|
1454
|
-
relativeDirPath: (0,
|
|
1465
|
+
relativeDirPath: (0, import_node_path13.join)(".roo", "commands")
|
|
1455
1466
|
};
|
|
1456
1467
|
}
|
|
1457
1468
|
constructor({ frontmatter, body, ...rest }) {
|
|
@@ -1459,7 +1470,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1459
1470
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
1460
1471
|
if (!result.success) {
|
|
1461
1472
|
throw new Error(
|
|
1462
|
-
`Invalid frontmatter in ${(0,
|
|
1473
|
+
`Invalid frontmatter in ${(0, import_node_path13.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
1463
1474
|
);
|
|
1464
1475
|
}
|
|
1465
1476
|
}
|
|
@@ -1525,7 +1536,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1525
1536
|
return {
|
|
1526
1537
|
success: false,
|
|
1527
1538
|
error: new Error(
|
|
1528
|
-
`Invalid frontmatter in ${(0,
|
|
1539
|
+
`Invalid frontmatter in ${(0, import_node_path13.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
1529
1540
|
)
|
|
1530
1541
|
};
|
|
1531
1542
|
}
|
|
@@ -1541,7 +1552,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1541
1552
|
relativeFilePath,
|
|
1542
1553
|
validate = true
|
|
1543
1554
|
}) {
|
|
1544
|
-
const filePath = (0,
|
|
1555
|
+
const filePath = (0, import_node_path13.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
1545
1556
|
const fileContent = await readFileContent(filePath);
|
|
1546
1557
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
1547
1558
|
const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -1551,7 +1562,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
|
|
|
1551
1562
|
return new _RooCommand({
|
|
1552
1563
|
baseDir,
|
|
1553
1564
|
relativeDirPath: _RooCommand.getSettablePaths().relativeDirPath,
|
|
1554
|
-
relativeFilePath: (0,
|
|
1565
|
+
relativeFilePath: (0, import_node_path13.basename)(relativeFilePath),
|
|
1555
1566
|
frontmatter: result.data,
|
|
1556
1567
|
body: content.trim(),
|
|
1557
1568
|
fileContent,
|
|
@@ -1687,11 +1698,11 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1687
1698
|
*/
|
|
1688
1699
|
async loadRulesyncFiles() {
|
|
1689
1700
|
const rulesyncCommandPaths = await findFilesByGlobs(
|
|
1690
|
-
(0,
|
|
1701
|
+
(0, import_node_path14.join)(RulesyncCommand.getSettablePaths().relativeDirPath, "*.md")
|
|
1691
1702
|
);
|
|
1692
1703
|
const rulesyncCommands = (await Promise.allSettled(
|
|
1693
1704
|
rulesyncCommandPaths.map(
|
|
1694
|
-
(path2) => RulesyncCommand.fromFile({ relativeFilePath: (0,
|
|
1705
|
+
(path2) => RulesyncCommand.fromFile({ relativeFilePath: (0, import_node_path14.basename)(path2) })
|
|
1695
1706
|
)
|
|
1696
1707
|
)).filter((result) => result.status === "fulfilled").map((result) => result.value);
|
|
1697
1708
|
logger.info(`Successfully loaded ${rulesyncCommands.length} rulesync commands`);
|
|
@@ -1730,7 +1741,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1730
1741
|
extension
|
|
1731
1742
|
}) {
|
|
1732
1743
|
const commandFilePaths = await findFilesByGlobs(
|
|
1733
|
-
(0,
|
|
1744
|
+
(0, import_node_path14.join)(this.baseDir, relativeDirPath, `*.${extension}`)
|
|
1734
1745
|
);
|
|
1735
1746
|
const toolCommands = (await Promise.allSettled(
|
|
1736
1747
|
commandFilePaths.map((path2) => {
|
|
@@ -1738,40 +1749,40 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1738
1749
|
case "agentsmd":
|
|
1739
1750
|
return AgentsmdCommand.fromFile({
|
|
1740
1751
|
baseDir: this.baseDir,
|
|
1741
|
-
relativeFilePath: (0,
|
|
1752
|
+
relativeFilePath: (0, import_node_path14.basename)(path2)
|
|
1742
1753
|
});
|
|
1743
1754
|
case "claudecode":
|
|
1744
1755
|
return ClaudecodeCommand.fromFile({
|
|
1745
1756
|
baseDir: this.baseDir,
|
|
1746
|
-
relativeFilePath: (0,
|
|
1757
|
+
relativeFilePath: (0, import_node_path14.basename)(path2),
|
|
1747
1758
|
global: this.global
|
|
1748
1759
|
});
|
|
1749
1760
|
case "geminicli":
|
|
1750
1761
|
return GeminiCliCommand.fromFile({
|
|
1751
1762
|
baseDir: this.baseDir,
|
|
1752
|
-
relativeFilePath: (0,
|
|
1763
|
+
relativeFilePath: (0, import_node_path14.basename)(path2),
|
|
1753
1764
|
global: this.global
|
|
1754
1765
|
});
|
|
1755
1766
|
case "roo":
|
|
1756
1767
|
return RooCommand.fromFile({
|
|
1757
1768
|
baseDir: this.baseDir,
|
|
1758
|
-
relativeFilePath: (0,
|
|
1769
|
+
relativeFilePath: (0, import_node_path14.basename)(path2)
|
|
1759
1770
|
});
|
|
1760
1771
|
case "copilot":
|
|
1761
1772
|
return CopilotCommand.fromFile({
|
|
1762
1773
|
baseDir: this.baseDir,
|
|
1763
|
-
relativeFilePath: (0,
|
|
1774
|
+
relativeFilePath: (0, import_node_path14.basename)(path2)
|
|
1764
1775
|
});
|
|
1765
1776
|
case "cursor":
|
|
1766
1777
|
return CursorCommand.fromFile({
|
|
1767
1778
|
baseDir: this.baseDir,
|
|
1768
|
-
relativeFilePath: (0,
|
|
1779
|
+
relativeFilePath: (0, import_node_path14.basename)(path2),
|
|
1769
1780
|
global: this.global
|
|
1770
1781
|
});
|
|
1771
1782
|
case "codexcli":
|
|
1772
1783
|
return CodexcliCommand.fromFile({
|
|
1773
1784
|
baseDir: this.baseDir,
|
|
1774
|
-
relativeFilePath: (0,
|
|
1785
|
+
relativeFilePath: (0, import_node_path14.basename)(path2),
|
|
1775
1786
|
global: this.global
|
|
1776
1787
|
});
|
|
1777
1788
|
default:
|
|
@@ -1882,14 +1893,14 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1882
1893
|
var import_mini11 = require("zod/mini");
|
|
1883
1894
|
|
|
1884
1895
|
// src/features/ignore/amazonqcli-ignore.ts
|
|
1885
|
-
var
|
|
1896
|
+
var import_node_path16 = require("path");
|
|
1886
1897
|
|
|
1887
1898
|
// src/types/tool-file.ts
|
|
1888
1899
|
var ToolFile = class extends AiFile {
|
|
1889
1900
|
};
|
|
1890
1901
|
|
|
1891
1902
|
// src/features/ignore/rulesync-ignore.ts
|
|
1892
|
-
var
|
|
1903
|
+
var import_node_path15 = require("path");
|
|
1893
1904
|
var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
1894
1905
|
validate() {
|
|
1895
1906
|
return { success: true, error: null };
|
|
@@ -1897,12 +1908,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
|
|
|
1897
1908
|
static getSettablePaths() {
|
|
1898
1909
|
return {
|
|
1899
1910
|
relativeDirPath: ".",
|
|
1900
|
-
relativeFilePath:
|
|
1911
|
+
relativeFilePath: RULESYNC_IGNORE_RELATIVE_FILE_PATH
|
|
1901
1912
|
};
|
|
1902
1913
|
}
|
|
1903
1914
|
static async fromFile() {
|
|
1904
1915
|
const baseDir = process.cwd();
|
|
1905
|
-
const filePath = (0,
|
|
1916
|
+
const filePath = (0, import_node_path15.join)(baseDir, this.getSettablePaths().relativeFilePath);
|
|
1906
1917
|
const fileContent = await readFileContent(filePath);
|
|
1907
1918
|
return new _RulesyncIgnore({
|
|
1908
1919
|
baseDir,
|
|
@@ -1945,7 +1956,7 @@ var ToolIgnore = class extends ToolFile {
|
|
|
1945
1956
|
return new RulesyncIgnore({
|
|
1946
1957
|
baseDir: ".",
|
|
1947
1958
|
relativeDirPath: ".",
|
|
1948
|
-
relativeFilePath:
|
|
1959
|
+
relativeFilePath: RULESYNC_IGNORE_RELATIVE_FILE_PATH,
|
|
1949
1960
|
fileContent: this.fileContent
|
|
1950
1961
|
});
|
|
1951
1962
|
}
|
|
@@ -1993,7 +2004,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
1993
2004
|
validate = true
|
|
1994
2005
|
}) {
|
|
1995
2006
|
const fileContent = await readFileContent(
|
|
1996
|
-
(0,
|
|
2007
|
+
(0, import_node_path16.join)(
|
|
1997
2008
|
baseDir,
|
|
1998
2009
|
this.getSettablePaths().relativeDirPath,
|
|
1999
2010
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2010,7 +2021,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
|
|
|
2010
2021
|
};
|
|
2011
2022
|
|
|
2012
2023
|
// src/features/ignore/augmentcode-ignore.ts
|
|
2013
|
-
var
|
|
2024
|
+
var import_node_path17 = require("path");
|
|
2014
2025
|
var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
2015
2026
|
static getSettablePaths() {
|
|
2016
2027
|
return {
|
|
@@ -2048,7 +2059,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2048
2059
|
validate = true
|
|
2049
2060
|
}) {
|
|
2050
2061
|
const fileContent = await readFileContent(
|
|
2051
|
-
(0,
|
|
2062
|
+
(0, import_node_path17.join)(
|
|
2052
2063
|
baseDir,
|
|
2053
2064
|
this.getSettablePaths().relativeDirPath,
|
|
2054
2065
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2065,7 +2076,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
|
|
|
2065
2076
|
};
|
|
2066
2077
|
|
|
2067
2078
|
// src/features/ignore/claudecode-ignore.ts
|
|
2068
|
-
var
|
|
2079
|
+
var import_node_path18 = require("path");
|
|
2069
2080
|
var import_es_toolkit = require("es-toolkit");
|
|
2070
2081
|
var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
2071
2082
|
constructor(params) {
|
|
@@ -2101,7 +2112,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2101
2112
|
const fileContent = rulesyncIgnore.getFileContent();
|
|
2102
2113
|
const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2103
2114
|
const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
|
|
2104
|
-
const filePath = (0,
|
|
2115
|
+
const filePath = (0, import_node_path18.join)(
|
|
2105
2116
|
baseDir,
|
|
2106
2117
|
this.getSettablePaths().relativeDirPath,
|
|
2107
2118
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2129,7 +2140,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2129
2140
|
validate = true
|
|
2130
2141
|
}) {
|
|
2131
2142
|
const fileContent = await readFileContent(
|
|
2132
|
-
(0,
|
|
2143
|
+
(0, import_node_path18.join)(
|
|
2133
2144
|
baseDir,
|
|
2134
2145
|
this.getSettablePaths().relativeDirPath,
|
|
2135
2146
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2146,7 +2157,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
|
|
|
2146
2157
|
};
|
|
2147
2158
|
|
|
2148
2159
|
// src/features/ignore/cline-ignore.ts
|
|
2149
|
-
var
|
|
2160
|
+
var import_node_path19 = require("path");
|
|
2150
2161
|
var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
2151
2162
|
static getSettablePaths() {
|
|
2152
2163
|
return {
|
|
@@ -2183,7 +2194,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2183
2194
|
validate = true
|
|
2184
2195
|
}) {
|
|
2185
2196
|
const fileContent = await readFileContent(
|
|
2186
|
-
(0,
|
|
2197
|
+
(0, import_node_path19.join)(
|
|
2187
2198
|
baseDir,
|
|
2188
2199
|
this.getSettablePaths().relativeDirPath,
|
|
2189
2200
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2200,7 +2211,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
|
|
|
2200
2211
|
};
|
|
2201
2212
|
|
|
2202
2213
|
// src/features/ignore/cursor-ignore.ts
|
|
2203
|
-
var
|
|
2214
|
+
var import_node_path20 = require("path");
|
|
2204
2215
|
var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
2205
2216
|
static getSettablePaths() {
|
|
2206
2217
|
return {
|
|
@@ -2212,7 +2223,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2212
2223
|
return new RulesyncIgnore({
|
|
2213
2224
|
baseDir: ".",
|
|
2214
2225
|
relativeDirPath: ".",
|
|
2215
|
-
relativeFilePath:
|
|
2226
|
+
relativeFilePath: RULESYNC_IGNORE_RELATIVE_FILE_PATH,
|
|
2216
2227
|
fileContent: this.fileContent
|
|
2217
2228
|
});
|
|
2218
2229
|
}
|
|
@@ -2233,7 +2244,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2233
2244
|
validate = true
|
|
2234
2245
|
}) {
|
|
2235
2246
|
const fileContent = await readFileContent(
|
|
2236
|
-
(0,
|
|
2247
|
+
(0, import_node_path20.join)(
|
|
2237
2248
|
baseDir,
|
|
2238
2249
|
this.getSettablePaths().relativeDirPath,
|
|
2239
2250
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2250,7 +2261,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
|
|
|
2250
2261
|
};
|
|
2251
2262
|
|
|
2252
2263
|
// src/features/ignore/geminicli-ignore.ts
|
|
2253
|
-
var
|
|
2264
|
+
var import_node_path21 = require("path");
|
|
2254
2265
|
var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
2255
2266
|
static getSettablePaths() {
|
|
2256
2267
|
return {
|
|
@@ -2277,7 +2288,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2277
2288
|
validate = true
|
|
2278
2289
|
}) {
|
|
2279
2290
|
const fileContent = await readFileContent(
|
|
2280
|
-
(0,
|
|
2291
|
+
(0, import_node_path21.join)(
|
|
2281
2292
|
baseDir,
|
|
2282
2293
|
this.getSettablePaths().relativeDirPath,
|
|
2283
2294
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2294,7 +2305,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
|
|
|
2294
2305
|
};
|
|
2295
2306
|
|
|
2296
2307
|
// src/features/ignore/junie-ignore.ts
|
|
2297
|
-
var
|
|
2308
|
+
var import_node_path22 = require("path");
|
|
2298
2309
|
var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
2299
2310
|
static getSettablePaths() {
|
|
2300
2311
|
return {
|
|
@@ -2321,7 +2332,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2321
2332
|
validate = true
|
|
2322
2333
|
}) {
|
|
2323
2334
|
const fileContent = await readFileContent(
|
|
2324
|
-
(0,
|
|
2335
|
+
(0, import_node_path22.join)(
|
|
2325
2336
|
baseDir,
|
|
2326
2337
|
this.getSettablePaths().relativeDirPath,
|
|
2327
2338
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2338,7 +2349,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
|
|
|
2338
2349
|
};
|
|
2339
2350
|
|
|
2340
2351
|
// src/features/ignore/kiro-ignore.ts
|
|
2341
|
-
var
|
|
2352
|
+
var import_node_path23 = require("path");
|
|
2342
2353
|
var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
2343
2354
|
static getSettablePaths() {
|
|
2344
2355
|
return {
|
|
@@ -2365,7 +2376,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2365
2376
|
validate = true
|
|
2366
2377
|
}) {
|
|
2367
2378
|
const fileContent = await readFileContent(
|
|
2368
|
-
(0,
|
|
2379
|
+
(0, import_node_path23.join)(
|
|
2369
2380
|
baseDir,
|
|
2370
2381
|
this.getSettablePaths().relativeDirPath,
|
|
2371
2382
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2382,7 +2393,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
|
|
|
2382
2393
|
};
|
|
2383
2394
|
|
|
2384
2395
|
// src/features/ignore/qwencode-ignore.ts
|
|
2385
|
-
var
|
|
2396
|
+
var import_node_path24 = require("path");
|
|
2386
2397
|
var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
2387
2398
|
static getSettablePaths() {
|
|
2388
2399
|
return {
|
|
@@ -2409,7 +2420,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2409
2420
|
validate = true
|
|
2410
2421
|
}) {
|
|
2411
2422
|
const fileContent = await readFileContent(
|
|
2412
|
-
(0,
|
|
2423
|
+
(0, import_node_path24.join)(
|
|
2413
2424
|
baseDir,
|
|
2414
2425
|
this.getSettablePaths().relativeDirPath,
|
|
2415
2426
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2426,7 +2437,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
|
|
|
2426
2437
|
};
|
|
2427
2438
|
|
|
2428
2439
|
// src/features/ignore/roo-ignore.ts
|
|
2429
|
-
var
|
|
2440
|
+
var import_node_path25 = require("path");
|
|
2430
2441
|
var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
2431
2442
|
static getSettablePaths() {
|
|
2432
2443
|
return {
|
|
@@ -2453,7 +2464,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2453
2464
|
validate = true
|
|
2454
2465
|
}) {
|
|
2455
2466
|
const fileContent = await readFileContent(
|
|
2456
|
-
(0,
|
|
2467
|
+
(0, import_node_path25.join)(
|
|
2457
2468
|
baseDir,
|
|
2458
2469
|
this.getSettablePaths().relativeDirPath,
|
|
2459
2470
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2470,7 +2481,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
|
|
|
2470
2481
|
};
|
|
2471
2482
|
|
|
2472
2483
|
// src/features/ignore/windsurf-ignore.ts
|
|
2473
|
-
var
|
|
2484
|
+
var import_node_path26 = require("path");
|
|
2474
2485
|
var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
2475
2486
|
static getSettablePaths() {
|
|
2476
2487
|
return {
|
|
@@ -2497,7 +2508,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
|
|
|
2497
2508
|
validate = true
|
|
2498
2509
|
}) {
|
|
2499
2510
|
const fileContent = await readFileContent(
|
|
2500
|
-
(0,
|
|
2511
|
+
(0, import_node_path26.join)(
|
|
2501
2512
|
baseDir,
|
|
2502
2513
|
this.getSettablePaths().relativeDirPath,
|
|
2503
2514
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2614,7 +2625,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2614
2625
|
(file) => file instanceof RulesyncIgnore
|
|
2615
2626
|
);
|
|
2616
2627
|
if (!rulesyncIgnore) {
|
|
2617
|
-
throw new Error(`No
|
|
2628
|
+
throw new Error(`No ${RULESYNC_IGNORE_RELATIVE_FILE_PATH} found.`);
|
|
2618
2629
|
}
|
|
2619
2630
|
const toolIgnores = await Promise.all(
|
|
2620
2631
|
[rulesyncIgnore].map(async (rulesyncIgnore2) => {
|
|
@@ -2705,10 +2716,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2705
2716
|
var import_mini13 = require("zod/mini");
|
|
2706
2717
|
|
|
2707
2718
|
// src/features/mcp/amazonqcli-mcp.ts
|
|
2708
|
-
var
|
|
2719
|
+
var import_node_path28 = require("path");
|
|
2709
2720
|
|
|
2710
2721
|
// src/features/mcp/rulesync-mcp.ts
|
|
2711
|
-
var
|
|
2722
|
+
var import_node_path27 = require("path");
|
|
2712
2723
|
var import_object = require("es-toolkit/object");
|
|
2713
2724
|
var import_mini12 = require("zod/mini");
|
|
2714
2725
|
var McpTransportTypeSchema = import_mini12.z.enum(["stdio", "sse", "http"]);
|
|
@@ -2759,11 +2770,11 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2759
2770
|
static getSettablePaths() {
|
|
2760
2771
|
return {
|
|
2761
2772
|
recommended: {
|
|
2762
|
-
relativeDirPath:
|
|
2773
|
+
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
|
|
2763
2774
|
relativeFilePath: "mcp.json"
|
|
2764
2775
|
},
|
|
2765
2776
|
legacy: {
|
|
2766
|
-
relativeDirPath:
|
|
2777
|
+
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
|
|
2767
2778
|
relativeFilePath: ".mcp.json"
|
|
2768
2779
|
}
|
|
2769
2780
|
};
|
|
@@ -2788,12 +2799,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
|
2788
2799
|
}) {
|
|
2789
2800
|
const baseDir = process.cwd();
|
|
2790
2801
|
const paths = this.getSettablePaths();
|
|
2791
|
-
const recommendedPath = (0,
|
|
2802
|
+
const recommendedPath = (0, import_node_path27.join)(
|
|
2792
2803
|
baseDir,
|
|
2793
2804
|
paths.recommended.relativeDirPath,
|
|
2794
2805
|
paths.recommended.relativeFilePath
|
|
2795
2806
|
);
|
|
2796
|
-
const legacyPath = (0,
|
|
2807
|
+
const legacyPath = (0, import_node_path27.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
2797
2808
|
if (await fileExists(recommendedPath)) {
|
|
2798
2809
|
const fileContent2 = await readFileContent(recommendedPath);
|
|
2799
2810
|
return new _RulesyncMcp({
|
|
@@ -2878,7 +2889,7 @@ var ToolMcp = class extends ToolFile {
|
|
|
2878
2889
|
} = {}) {
|
|
2879
2890
|
return new RulesyncMcp({
|
|
2880
2891
|
baseDir: this.baseDir,
|
|
2881
|
-
relativeDirPath:
|
|
2892
|
+
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
|
|
2882
2893
|
relativeFilePath: ".mcp.json",
|
|
2883
2894
|
fileContent: fileContent ?? this.fileContent
|
|
2884
2895
|
});
|
|
@@ -2912,7 +2923,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2912
2923
|
validate = true
|
|
2913
2924
|
}) {
|
|
2914
2925
|
const fileContent = await readFileContent(
|
|
2915
|
-
(0,
|
|
2926
|
+
(0, import_node_path28.join)(
|
|
2916
2927
|
baseDir,
|
|
2917
2928
|
this.getSettablePaths().relativeDirPath,
|
|
2918
2929
|
this.getSettablePaths().relativeFilePath
|
|
@@ -2948,10 +2959,10 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
|
|
|
2948
2959
|
};
|
|
2949
2960
|
|
|
2950
2961
|
// src/features/mcp/claudecode-mcp.ts
|
|
2951
|
-
var
|
|
2962
|
+
var import_node_path30 = require("path");
|
|
2952
2963
|
|
|
2953
2964
|
// src/features/mcp/modular-mcp.ts
|
|
2954
|
-
var
|
|
2965
|
+
var import_node_path29 = require("path");
|
|
2955
2966
|
var ModularMcp = class _ModularMcp extends AiFile {
|
|
2956
2967
|
json;
|
|
2957
2968
|
constructor(params) {
|
|
@@ -3006,7 +3017,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
|
|
|
3006
3017
|
args: [
|
|
3007
3018
|
"-y",
|
|
3008
3019
|
"@kimuson/modular-mcp",
|
|
3009
|
-
(0,
|
|
3020
|
+
(0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3010
3021
|
],
|
|
3011
3022
|
env: {}
|
|
3012
3023
|
}
|
|
@@ -3067,7 +3078,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3067
3078
|
}) {
|
|
3068
3079
|
const paths = this.getSettablePaths({ global });
|
|
3069
3080
|
const fileContent = await readOrInitializeFileContent(
|
|
3070
|
-
(0,
|
|
3081
|
+
(0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3071
3082
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3072
3083
|
);
|
|
3073
3084
|
const json = JSON.parse(fileContent);
|
|
@@ -3089,7 +3100,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3089
3100
|
}) {
|
|
3090
3101
|
const paths = this.getSettablePaths({ global });
|
|
3091
3102
|
const fileContent = await readOrInitializeFileContent(
|
|
3092
|
-
(0,
|
|
3103
|
+
(0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3093
3104
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3094
3105
|
);
|
|
3095
3106
|
const json = JSON.parse(fileContent);
|
|
@@ -3120,7 +3131,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
3120
3131
|
};
|
|
3121
3132
|
|
|
3122
3133
|
// src/features/mcp/cline-mcp.ts
|
|
3123
|
-
var
|
|
3134
|
+
var import_node_path31 = require("path");
|
|
3124
3135
|
var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
3125
3136
|
json;
|
|
3126
3137
|
constructor(params) {
|
|
@@ -3141,7 +3152,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3141
3152
|
validate = true
|
|
3142
3153
|
}) {
|
|
3143
3154
|
const fileContent = await readFileContent(
|
|
3144
|
-
(0,
|
|
3155
|
+
(0, import_node_path31.join)(
|
|
3145
3156
|
baseDir,
|
|
3146
3157
|
this.getSettablePaths().relativeDirPath,
|
|
3147
3158
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3177,7 +3188,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
|
|
|
3177
3188
|
};
|
|
3178
3189
|
|
|
3179
3190
|
// src/features/mcp/codexcli-mcp.ts
|
|
3180
|
-
var
|
|
3191
|
+
var import_node_path32 = require("path");
|
|
3181
3192
|
var smolToml = __toESM(require("smol-toml"), 1);
|
|
3182
3193
|
var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
3183
3194
|
toml;
|
|
@@ -3213,7 +3224,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3213
3224
|
}) {
|
|
3214
3225
|
const paths = this.getSettablePaths({ global });
|
|
3215
3226
|
const fileContent = await readFileContent(
|
|
3216
|
-
(0,
|
|
3227
|
+
(0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
3217
3228
|
);
|
|
3218
3229
|
return new _CodexcliMcp({
|
|
3219
3230
|
baseDir,
|
|
@@ -3230,7 +3241,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3230
3241
|
global = false
|
|
3231
3242
|
}) {
|
|
3232
3243
|
const paths = this.getSettablePaths({ global });
|
|
3233
|
-
const configTomlFilePath = (0,
|
|
3244
|
+
const configTomlFilePath = (0, import_node_path32.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
3234
3245
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
3235
3246
|
configTomlFilePath,
|
|
3236
3247
|
smolToml.stringify({})
|
|
@@ -3250,7 +3261,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3250
3261
|
toRulesyncMcp() {
|
|
3251
3262
|
return new RulesyncMcp({
|
|
3252
3263
|
baseDir: this.baseDir,
|
|
3253
|
-
relativeDirPath:
|
|
3264
|
+
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
|
|
3254
3265
|
relativeFilePath: ".mcp.json",
|
|
3255
3266
|
fileContent: JSON.stringify({ mcpServers: this.toml.mcp_servers ?? {} }, null, 2)
|
|
3256
3267
|
});
|
|
@@ -3271,7 +3282,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
3271
3282
|
};
|
|
3272
3283
|
|
|
3273
3284
|
// src/features/mcp/copilot-mcp.ts
|
|
3274
|
-
var
|
|
3285
|
+
var import_node_path33 = require("path");
|
|
3275
3286
|
var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
3276
3287
|
json;
|
|
3277
3288
|
constructor(params) {
|
|
@@ -3292,7 +3303,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3292
3303
|
validate = true
|
|
3293
3304
|
}) {
|
|
3294
3305
|
const fileContent = await readFileContent(
|
|
3295
|
-
(0,
|
|
3306
|
+
(0, import_node_path33.join)(
|
|
3296
3307
|
baseDir,
|
|
3297
3308
|
this.getSettablePaths().relativeDirPath,
|
|
3298
3309
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3328,7 +3339,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
|
|
|
3328
3339
|
};
|
|
3329
3340
|
|
|
3330
3341
|
// src/features/mcp/cursor-mcp.ts
|
|
3331
|
-
var
|
|
3342
|
+
var import_node_path34 = require("path");
|
|
3332
3343
|
var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
3333
3344
|
json;
|
|
3334
3345
|
constructor(params) {
|
|
@@ -3349,7 +3360,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3349
3360
|
validate = true
|
|
3350
3361
|
}) {
|
|
3351
3362
|
const fileContent = await readFileContent(
|
|
3352
|
-
(0,
|
|
3363
|
+
(0, import_node_path34.join)(
|
|
3353
3364
|
baseDir,
|
|
3354
3365
|
this.getSettablePaths().relativeDirPath,
|
|
3355
3366
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3396,7 +3407,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
|
|
|
3396
3407
|
};
|
|
3397
3408
|
|
|
3398
3409
|
// src/features/mcp/geminicli-mcp.ts
|
|
3399
|
-
var
|
|
3410
|
+
var import_node_path35 = require("path");
|
|
3400
3411
|
var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
3401
3412
|
json;
|
|
3402
3413
|
constructor(params) {
|
|
@@ -3425,7 +3436,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3425
3436
|
}) {
|
|
3426
3437
|
const paths = this.getSettablePaths({ global });
|
|
3427
3438
|
const fileContent = await readOrInitializeFileContent(
|
|
3428
|
-
(0,
|
|
3439
|
+
(0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3429
3440
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3430
3441
|
);
|
|
3431
3442
|
const json = JSON.parse(fileContent);
|
|
@@ -3446,7 +3457,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3446
3457
|
}) {
|
|
3447
3458
|
const paths = this.getSettablePaths({ global });
|
|
3448
3459
|
const fileContent = await readOrInitializeFileContent(
|
|
3449
|
-
(0,
|
|
3460
|
+
(0, import_node_path35.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
3450
3461
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
3451
3462
|
);
|
|
3452
3463
|
const json = JSON.parse(fileContent);
|
|
@@ -3470,7 +3481,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
|
|
|
3470
3481
|
};
|
|
3471
3482
|
|
|
3472
3483
|
// src/features/mcp/roo-mcp.ts
|
|
3473
|
-
var
|
|
3484
|
+
var import_node_path36 = require("path");
|
|
3474
3485
|
var RooMcp = class _RooMcp extends ToolMcp {
|
|
3475
3486
|
json;
|
|
3476
3487
|
constructor(params) {
|
|
@@ -3491,7 +3502,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
|
|
|
3491
3502
|
validate = true
|
|
3492
3503
|
}) {
|
|
3493
3504
|
const fileContent = await readFileContent(
|
|
3494
|
-
(0,
|
|
3505
|
+
(0, import_node_path36.join)(
|
|
3495
3506
|
baseDir,
|
|
3496
3507
|
this.getSettablePaths().relativeDirPath,
|
|
3497
3508
|
this.getSettablePaths().relativeFilePath
|
|
@@ -3683,7 +3694,7 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3683
3694
|
(file) => file instanceof RulesyncMcp
|
|
3684
3695
|
);
|
|
3685
3696
|
if (!rulesyncMcp) {
|
|
3686
|
-
throw new Error(`No
|
|
3697
|
+
throw new Error(`No ${RULESYNC_MCP_RELATIVE_FILE_PATH} found.`);
|
|
3687
3698
|
}
|
|
3688
3699
|
const toolMcps = await Promise.all(
|
|
3689
3700
|
[rulesyncMcp].map(async (rulesyncMcp2) => {
|
|
@@ -3774,15 +3785,15 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3774
3785
|
};
|
|
3775
3786
|
|
|
3776
3787
|
// src/features/rules/rules-processor.ts
|
|
3777
|
-
var
|
|
3788
|
+
var import_node_path66 = require("path");
|
|
3778
3789
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3779
3790
|
var import_mini22 = require("zod/mini");
|
|
3780
3791
|
|
|
3781
3792
|
// src/features/subagents/agentsmd-subagent.ts
|
|
3782
|
-
var
|
|
3793
|
+
var import_node_path38 = require("path");
|
|
3783
3794
|
|
|
3784
3795
|
// src/features/subagents/simulated-subagent.ts
|
|
3785
|
-
var
|
|
3796
|
+
var import_node_path37 = require("path");
|
|
3786
3797
|
var import_mini14 = require("zod/mini");
|
|
3787
3798
|
|
|
3788
3799
|
// src/features/subagents/tool-subagent.ts
|
|
@@ -3830,7 +3841,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3830
3841
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
3831
3842
|
if (!result.success) {
|
|
3832
3843
|
throw new Error(
|
|
3833
|
-
`Invalid frontmatter in ${(0,
|
|
3844
|
+
`Invalid frontmatter in ${(0, import_node_path37.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
3834
3845
|
);
|
|
3835
3846
|
}
|
|
3836
3847
|
}
|
|
@@ -3881,7 +3892,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3881
3892
|
return {
|
|
3882
3893
|
success: false,
|
|
3883
3894
|
error: new Error(
|
|
3884
|
-
`Invalid frontmatter in ${(0,
|
|
3895
|
+
`Invalid frontmatter in ${(0, import_node_path37.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
3885
3896
|
)
|
|
3886
3897
|
};
|
|
3887
3898
|
}
|
|
@@ -3891,7 +3902,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3891
3902
|
relativeFilePath,
|
|
3892
3903
|
validate = true
|
|
3893
3904
|
}) {
|
|
3894
|
-
const filePath = (0,
|
|
3905
|
+
const filePath = (0, import_node_path37.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
|
|
3895
3906
|
const fileContent = await readFileContent(filePath);
|
|
3896
3907
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
3897
3908
|
const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -3901,7 +3912,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3901
3912
|
return {
|
|
3902
3913
|
baseDir,
|
|
3903
3914
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
3904
|
-
relativeFilePath: (0,
|
|
3915
|
+
relativeFilePath: (0, import_node_path37.basename)(relativeFilePath),
|
|
3905
3916
|
frontmatter: result.data,
|
|
3906
3917
|
body: content.trim(),
|
|
3907
3918
|
validate
|
|
@@ -3913,7 +3924,7 @@ var SimulatedSubagent = class extends ToolSubagent {
|
|
|
3913
3924
|
var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
3914
3925
|
static getSettablePaths() {
|
|
3915
3926
|
return {
|
|
3916
|
-
relativeDirPath: (0,
|
|
3927
|
+
relativeDirPath: (0, import_node_path38.join)(".agents", "subagents")
|
|
3917
3928
|
};
|
|
3918
3929
|
}
|
|
3919
3930
|
static async fromFile(params) {
|
|
@@ -3933,11 +3944,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
|
|
|
3933
3944
|
};
|
|
3934
3945
|
|
|
3935
3946
|
// src/features/subagents/codexcli-subagent.ts
|
|
3936
|
-
var
|
|
3947
|
+
var import_node_path39 = require("path");
|
|
3937
3948
|
var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
3938
3949
|
static getSettablePaths() {
|
|
3939
3950
|
return {
|
|
3940
|
-
relativeDirPath: (0,
|
|
3951
|
+
relativeDirPath: (0, import_node_path39.join)(".codex", "subagents")
|
|
3941
3952
|
};
|
|
3942
3953
|
}
|
|
3943
3954
|
static async fromFile(params) {
|
|
@@ -3957,11 +3968,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
|
|
|
3957
3968
|
};
|
|
3958
3969
|
|
|
3959
3970
|
// src/features/subagents/copilot-subagent.ts
|
|
3960
|
-
var
|
|
3971
|
+
var import_node_path40 = require("path");
|
|
3961
3972
|
var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
3962
3973
|
static getSettablePaths() {
|
|
3963
3974
|
return {
|
|
3964
|
-
relativeDirPath: (0,
|
|
3975
|
+
relativeDirPath: (0, import_node_path40.join)(".github", "subagents")
|
|
3965
3976
|
};
|
|
3966
3977
|
}
|
|
3967
3978
|
static async fromFile(params) {
|
|
@@ -3981,11 +3992,11 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
|
|
|
3981
3992
|
};
|
|
3982
3993
|
|
|
3983
3994
|
// src/features/subagents/cursor-subagent.ts
|
|
3984
|
-
var
|
|
3995
|
+
var import_node_path41 = require("path");
|
|
3985
3996
|
var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
3986
3997
|
static getSettablePaths() {
|
|
3987
3998
|
return {
|
|
3988
|
-
relativeDirPath: (0,
|
|
3999
|
+
relativeDirPath: (0, import_node_path41.join)(".cursor", "subagents")
|
|
3989
4000
|
};
|
|
3990
4001
|
}
|
|
3991
4002
|
static async fromFile(params) {
|
|
@@ -4005,11 +4016,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
|
|
|
4005
4016
|
};
|
|
4006
4017
|
|
|
4007
4018
|
// src/features/subagents/geminicli-subagent.ts
|
|
4008
|
-
var
|
|
4019
|
+
var import_node_path42 = require("path");
|
|
4009
4020
|
var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
4010
4021
|
static getSettablePaths() {
|
|
4011
4022
|
return {
|
|
4012
|
-
relativeDirPath: (0,
|
|
4023
|
+
relativeDirPath: (0, import_node_path42.join)(".gemini", "subagents")
|
|
4013
4024
|
};
|
|
4014
4025
|
}
|
|
4015
4026
|
static async fromFile(params) {
|
|
@@ -4029,11 +4040,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
|
|
|
4029
4040
|
};
|
|
4030
4041
|
|
|
4031
4042
|
// src/features/subagents/roo-subagent.ts
|
|
4032
|
-
var
|
|
4043
|
+
var import_node_path43 = require("path");
|
|
4033
4044
|
var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
4034
4045
|
static getSettablePaths() {
|
|
4035
4046
|
return {
|
|
4036
|
-
relativeDirPath: (0,
|
|
4047
|
+
relativeDirPath: (0, import_node_path43.join)(".roo", "subagents")
|
|
4037
4048
|
};
|
|
4038
4049
|
}
|
|
4039
4050
|
static async fromFile(params) {
|
|
@@ -4053,15 +4064,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
4053
4064
|
};
|
|
4054
4065
|
|
|
4055
4066
|
// src/features/subagents/subagents-processor.ts
|
|
4056
|
-
var
|
|
4067
|
+
var import_node_path46 = require("path");
|
|
4057
4068
|
var import_mini17 = require("zod/mini");
|
|
4058
4069
|
|
|
4059
4070
|
// src/features/subagents/claudecode-subagent.ts
|
|
4060
|
-
var
|
|
4071
|
+
var import_node_path45 = require("path");
|
|
4061
4072
|
var import_mini16 = require("zod/mini");
|
|
4062
4073
|
|
|
4063
4074
|
// src/features/subagents/rulesync-subagent.ts
|
|
4064
|
-
var
|
|
4075
|
+
var import_node_path44 = require("path");
|
|
4065
4076
|
var import_mini15 = require("zod/mini");
|
|
4066
4077
|
var RulesyncSubagentModelSchema = import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
4067
4078
|
var RulesyncSubagentFrontmatterSchema = import_mini15.z.object({
|
|
@@ -4082,7 +4093,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4082
4093
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4083
4094
|
if (!result.success) {
|
|
4084
4095
|
throw new Error(
|
|
4085
|
-
`Invalid frontmatter in ${(0,
|
|
4096
|
+
`Invalid frontmatter in ${(0, import_node_path44.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4086
4097
|
);
|
|
4087
4098
|
}
|
|
4088
4099
|
}
|
|
@@ -4095,7 +4106,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4095
4106
|
}
|
|
4096
4107
|
static getSettablePaths() {
|
|
4097
4108
|
return {
|
|
4098
|
-
relativeDirPath:
|
|
4109
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH
|
|
4099
4110
|
};
|
|
4100
4111
|
}
|
|
4101
4112
|
getFrontmatter() {
|
|
@@ -4115,7 +4126,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4115
4126
|
return {
|
|
4116
4127
|
success: false,
|
|
4117
4128
|
error: new Error(
|
|
4118
|
-
`Invalid frontmatter in ${(0,
|
|
4129
|
+
`Invalid frontmatter in ${(0, import_node_path44.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4119
4130
|
)
|
|
4120
4131
|
};
|
|
4121
4132
|
}
|
|
@@ -4124,14 +4135,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
4124
4135
|
relativeFilePath
|
|
4125
4136
|
}) {
|
|
4126
4137
|
const fileContent = await readFileContent(
|
|
4127
|
-
(0,
|
|
4138
|
+
(0, import_node_path44.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
|
|
4128
4139
|
);
|
|
4129
4140
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4130
4141
|
const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4131
4142
|
if (!result.success) {
|
|
4132
4143
|
throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
|
|
4133
4144
|
}
|
|
4134
|
-
const filename = (0,
|
|
4145
|
+
const filename = (0, import_node_path44.basename)(relativeFilePath);
|
|
4135
4146
|
return new _RulesyncSubagent({
|
|
4136
4147
|
baseDir: process.cwd(),
|
|
4137
4148
|
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
@@ -4156,7 +4167,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4156
4167
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
4157
4168
|
if (!result.success) {
|
|
4158
4169
|
throw new Error(
|
|
4159
|
-
`Invalid frontmatter in ${(0,
|
|
4170
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4160
4171
|
);
|
|
4161
4172
|
}
|
|
4162
4173
|
}
|
|
@@ -4168,7 +4179,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4168
4179
|
}
|
|
4169
4180
|
static getSettablePaths(_options = {}) {
|
|
4170
4181
|
return {
|
|
4171
|
-
relativeDirPath: (0,
|
|
4182
|
+
relativeDirPath: (0, import_node_path45.join)(".claude", "agents")
|
|
4172
4183
|
};
|
|
4173
4184
|
}
|
|
4174
4185
|
getFrontmatter() {
|
|
@@ -4193,7 +4204,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4193
4204
|
// RulesyncCommand baseDir is always the project root directory
|
|
4194
4205
|
frontmatter: rulesyncFrontmatter,
|
|
4195
4206
|
body: this.body,
|
|
4196
|
-
relativeDirPath:
|
|
4207
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
4197
4208
|
relativeFilePath: this.getRelativeFilePath(),
|
|
4198
4209
|
validate: true
|
|
4199
4210
|
});
|
|
@@ -4234,7 +4245,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4234
4245
|
return {
|
|
4235
4246
|
success: false,
|
|
4236
4247
|
error: new Error(
|
|
4237
|
-
`Invalid frontmatter in ${(0,
|
|
4248
|
+
`Invalid frontmatter in ${(0, import_node_path45.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4238
4249
|
)
|
|
4239
4250
|
};
|
|
4240
4251
|
}
|
|
@@ -4252,7 +4263,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
4252
4263
|
global = false
|
|
4253
4264
|
}) {
|
|
4254
4265
|
const paths = this.getSettablePaths({ global });
|
|
4255
|
-
const filePath = (0,
|
|
4266
|
+
const filePath = (0, import_node_path45.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
4256
4267
|
const fileContent = await readFileContent(filePath);
|
|
4257
4268
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
4258
4269
|
const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
|
|
@@ -4406,7 +4417,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4406
4417
|
* Load and parse rulesync subagent files from .rulesync/subagents/ directory
|
|
4407
4418
|
*/
|
|
4408
4419
|
async loadRulesyncFiles() {
|
|
4409
|
-
const subagentsDir = (0,
|
|
4420
|
+
const subagentsDir = (0, import_node_path46.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
|
|
4410
4421
|
const dirExists = await directoryExists(subagentsDir);
|
|
4411
4422
|
if (!dirExists) {
|
|
4412
4423
|
logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
|
|
@@ -4421,7 +4432,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4421
4432
|
logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
|
|
4422
4433
|
const rulesyncSubagents = [];
|
|
4423
4434
|
for (const mdFile of mdFiles) {
|
|
4424
|
-
const filepath = (0,
|
|
4435
|
+
const filepath = (0, import_node_path46.join)(subagentsDir, mdFile);
|
|
4425
4436
|
try {
|
|
4426
4437
|
const rulesyncSubagent = await RulesyncSubagent.fromFile({
|
|
4427
4438
|
relativeFilePath: mdFile,
|
|
@@ -4540,8 +4551,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4540
4551
|
relativeDirPath,
|
|
4541
4552
|
fromFile
|
|
4542
4553
|
}) {
|
|
4543
|
-
const paths = await findFilesByGlobs((0,
|
|
4544
|
-
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0,
|
|
4554
|
+
const paths = await findFilesByGlobs((0, import_node_path46.join)(this.baseDir, relativeDirPath, "*.md"));
|
|
4555
|
+
const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path46.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
4545
4556
|
logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
|
|
4546
4557
|
return subagents;
|
|
4547
4558
|
}
|
|
@@ -4568,13 +4579,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4568
4579
|
};
|
|
4569
4580
|
|
|
4570
4581
|
// src/features/rules/agentsmd-rule.ts
|
|
4571
|
-
var
|
|
4582
|
+
var import_node_path49 = require("path");
|
|
4572
4583
|
|
|
4573
4584
|
// src/features/rules/tool-rule.ts
|
|
4574
|
-
var
|
|
4585
|
+
var import_node_path48 = require("path");
|
|
4575
4586
|
|
|
4576
4587
|
// src/features/rules/rulesync-rule.ts
|
|
4577
|
-
var
|
|
4588
|
+
var import_node_path47 = require("path");
|
|
4578
4589
|
var import_mini18 = require("zod/mini");
|
|
4579
4590
|
var RulesyncRuleFrontmatterSchema = import_mini18.z.object({
|
|
4580
4591
|
root: import_mini18.z.optional(import_mini18.z.optional(import_mini18.z.boolean())),
|
|
@@ -4603,7 +4614,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4603
4614
|
const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
|
|
4604
4615
|
if (!result.success) {
|
|
4605
4616
|
throw new Error(
|
|
4606
|
-
`Invalid frontmatter in ${(0,
|
|
4617
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
4607
4618
|
);
|
|
4608
4619
|
}
|
|
4609
4620
|
}
|
|
@@ -4617,10 +4628,10 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4617
4628
|
static getSettablePaths() {
|
|
4618
4629
|
return {
|
|
4619
4630
|
recommended: {
|
|
4620
|
-
relativeDirPath:
|
|
4631
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH
|
|
4621
4632
|
},
|
|
4622
4633
|
legacy: {
|
|
4623
|
-
relativeDirPath:
|
|
4634
|
+
relativeDirPath: RULESYNC_RELATIVE_DIR_PATH
|
|
4624
4635
|
}
|
|
4625
4636
|
};
|
|
4626
4637
|
}
|
|
@@ -4638,7 +4649,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4638
4649
|
return {
|
|
4639
4650
|
success: false,
|
|
4640
4651
|
error: new Error(
|
|
4641
|
-
`Invalid frontmatter in ${(0,
|
|
4652
|
+
`Invalid frontmatter in ${(0, import_node_path47.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
4642
4653
|
)
|
|
4643
4654
|
};
|
|
4644
4655
|
}
|
|
@@ -4647,12 +4658,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4647
4658
|
relativeFilePath,
|
|
4648
4659
|
validate = true
|
|
4649
4660
|
}) {
|
|
4650
|
-
const legacyPath = (0,
|
|
4661
|
+
const legacyPath = (0, import_node_path47.join)(
|
|
4651
4662
|
process.cwd(),
|
|
4652
4663
|
this.getSettablePaths().legacy.relativeDirPath,
|
|
4653
4664
|
relativeFilePath
|
|
4654
4665
|
);
|
|
4655
|
-
const recommendedPath = (0,
|
|
4666
|
+
const recommendedPath = (0, import_node_path47.join)(
|
|
4656
4667
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
4657
4668
|
relativeFilePath
|
|
4658
4669
|
);
|
|
@@ -4671,7 +4682,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4671
4682
|
agentsmd: result.data.agentsmd,
|
|
4672
4683
|
cursor: result.data.cursor
|
|
4673
4684
|
};
|
|
4674
|
-
const filename = (0,
|
|
4685
|
+
const filename = (0, import_node_path47.basename)(legacyPath);
|
|
4675
4686
|
return new _RulesyncRule({
|
|
4676
4687
|
baseDir: process.cwd(),
|
|
4677
4688
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -4685,7 +4696,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4685
4696
|
relativeFilePath,
|
|
4686
4697
|
validate = true
|
|
4687
4698
|
}) {
|
|
4688
|
-
const filePath = (0,
|
|
4699
|
+
const filePath = (0, import_node_path47.join)(
|
|
4689
4700
|
process.cwd(),
|
|
4690
4701
|
this.getSettablePaths().recommended.relativeDirPath,
|
|
4691
4702
|
relativeFilePath
|
|
@@ -4704,7 +4715,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
|
|
|
4704
4715
|
agentsmd: result.data.agentsmd,
|
|
4705
4716
|
cursor: result.data.cursor
|
|
4706
4717
|
};
|
|
4707
|
-
const filename = (0,
|
|
4718
|
+
const filename = (0, import_node_path47.basename)(filePath);
|
|
4708
4719
|
return new _RulesyncRule({
|
|
4709
4720
|
baseDir: process.cwd(),
|
|
4710
4721
|
relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
|
|
@@ -4779,7 +4790,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4779
4790
|
rulesyncRule,
|
|
4780
4791
|
validate = true,
|
|
4781
4792
|
rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
|
|
4782
|
-
nonRootPath = { relativeDirPath: (0,
|
|
4793
|
+
nonRootPath = { relativeDirPath: (0, import_node_path48.join)(".agents", "memories") }
|
|
4783
4794
|
}) {
|
|
4784
4795
|
const params = this.buildToolRuleParamsDefault({
|
|
4785
4796
|
baseDir,
|
|
@@ -4790,17 +4801,16 @@ var ToolRule = class extends ToolFile {
|
|
|
4790
4801
|
});
|
|
4791
4802
|
const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
|
|
4792
4803
|
if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
|
|
4793
|
-
params.relativeDirPath = (0,
|
|
4804
|
+
params.relativeDirPath = (0, import_node_path48.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
|
|
4794
4805
|
params.relativeFilePath = "AGENTS.md";
|
|
4795
4806
|
}
|
|
4796
4807
|
return params;
|
|
4797
4808
|
}
|
|
4798
4809
|
toRulesyncRuleDefault() {
|
|
4799
4810
|
return new RulesyncRule({
|
|
4800
|
-
baseDir:
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
relativeFilePath: this.getRelativeFilePath(),
|
|
4811
|
+
baseDir: process.cwd(),
|
|
4812
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH,
|
|
4813
|
+
relativeFilePath: this.isRoot() ? RULESYNC_OVERVIEW_FILE_NAME : this.getRelativeFilePath(),
|
|
4804
4814
|
frontmatter: {
|
|
4805
4815
|
root: this.isRoot(),
|
|
4806
4816
|
targets: ["*"],
|
|
@@ -4856,7 +4866,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4856
4866
|
relativeFilePath: "AGENTS.md"
|
|
4857
4867
|
},
|
|
4858
4868
|
nonRoot: {
|
|
4859
|
-
relativeDirPath: (0,
|
|
4869
|
+
relativeDirPath: (0, import_node_path49.join)(".agents", "memories")
|
|
4860
4870
|
}
|
|
4861
4871
|
};
|
|
4862
4872
|
}
|
|
@@ -4866,8 +4876,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4866
4876
|
validate = true
|
|
4867
4877
|
}) {
|
|
4868
4878
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
4869
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
4870
|
-
const fileContent = await readFileContent((0,
|
|
4879
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path49.join)(".agents", "memories", relativeFilePath);
|
|
4880
|
+
const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
|
|
4871
4881
|
return new _AgentsMdRule({
|
|
4872
4882
|
baseDir,
|
|
4873
4883
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -4907,12 +4917,12 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
|
|
|
4907
4917
|
};
|
|
4908
4918
|
|
|
4909
4919
|
// src/features/rules/amazonqcli-rule.ts
|
|
4910
|
-
var
|
|
4920
|
+
var import_node_path50 = require("path");
|
|
4911
4921
|
var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
4912
4922
|
static getSettablePaths() {
|
|
4913
4923
|
return {
|
|
4914
4924
|
nonRoot: {
|
|
4915
|
-
relativeDirPath: (0,
|
|
4925
|
+
relativeDirPath: (0, import_node_path50.join)(".amazonq", "rules")
|
|
4916
4926
|
}
|
|
4917
4927
|
};
|
|
4918
4928
|
}
|
|
@@ -4922,7 +4932,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4922
4932
|
validate = true
|
|
4923
4933
|
}) {
|
|
4924
4934
|
const fileContent = await readFileContent(
|
|
4925
|
-
(0,
|
|
4935
|
+
(0, import_node_path50.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
4926
4936
|
);
|
|
4927
4937
|
return new _AmazonQCliRule({
|
|
4928
4938
|
baseDir,
|
|
@@ -4962,7 +4972,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
|
|
|
4962
4972
|
};
|
|
4963
4973
|
|
|
4964
4974
|
// src/features/rules/augmentcode-legacy-rule.ts
|
|
4965
|
-
var
|
|
4975
|
+
var import_node_path51 = require("path");
|
|
4966
4976
|
var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
4967
4977
|
toRulesyncRule() {
|
|
4968
4978
|
const rulesyncFrontmatter = {
|
|
@@ -4976,7 +4986,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4976
4986
|
// RulesyncRule baseDir is always the project root directory
|
|
4977
4987
|
frontmatter: rulesyncFrontmatter,
|
|
4978
4988
|
body: this.getFileContent(),
|
|
4979
|
-
relativeDirPath:
|
|
4989
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH,
|
|
4980
4990
|
relativeFilePath: this.getRelativeFilePath(),
|
|
4981
4991
|
validate: true
|
|
4982
4992
|
});
|
|
@@ -4988,7 +4998,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
4988
4998
|
relativeFilePath: ".augment-guidelines"
|
|
4989
4999
|
},
|
|
4990
5000
|
nonRoot: {
|
|
4991
|
-
relativeDirPath: (0,
|
|
5001
|
+
relativeDirPath: (0, import_node_path51.join)(".augment", "rules")
|
|
4992
5002
|
}
|
|
4993
5003
|
};
|
|
4994
5004
|
}
|
|
@@ -5023,8 +5033,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
5023
5033
|
}) {
|
|
5024
5034
|
const settablePaths = this.getSettablePaths();
|
|
5025
5035
|
const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
|
|
5026
|
-
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0,
|
|
5027
|
-
const fileContent = await readFileContent((0,
|
|
5036
|
+
const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path51.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5037
|
+
const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
|
|
5028
5038
|
return new _AugmentcodeLegacyRule({
|
|
5029
5039
|
baseDir,
|
|
5030
5040
|
relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
|
|
@@ -5037,7 +5047,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
|
|
|
5037
5047
|
};
|
|
5038
5048
|
|
|
5039
5049
|
// src/features/rules/augmentcode-rule.ts
|
|
5040
|
-
var
|
|
5050
|
+
var import_node_path52 = require("path");
|
|
5041
5051
|
var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
5042
5052
|
toRulesyncRule() {
|
|
5043
5053
|
return this.toRulesyncRuleDefault();
|
|
@@ -5045,7 +5055,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5045
5055
|
static getSettablePaths() {
|
|
5046
5056
|
return {
|
|
5047
5057
|
nonRoot: {
|
|
5048
|
-
relativeDirPath: (0,
|
|
5058
|
+
relativeDirPath: (0, import_node_path52.join)(".augment", "rules")
|
|
5049
5059
|
}
|
|
5050
5060
|
};
|
|
5051
5061
|
}
|
|
@@ -5069,7 +5079,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5069
5079
|
validate = true
|
|
5070
5080
|
}) {
|
|
5071
5081
|
const fileContent = await readFileContent(
|
|
5072
|
-
(0,
|
|
5082
|
+
(0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5073
5083
|
);
|
|
5074
5084
|
const { body: content } = parseFrontmatter(fileContent);
|
|
5075
5085
|
return new _AugmentcodeRule({
|
|
@@ -5092,7 +5102,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
5092
5102
|
};
|
|
5093
5103
|
|
|
5094
5104
|
// src/features/rules/claudecode-rule.ts
|
|
5095
|
-
var
|
|
5105
|
+
var import_node_path53 = require("path");
|
|
5096
5106
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
5097
5107
|
static getSettablePaths({
|
|
5098
5108
|
global
|
|
@@ -5111,7 +5121,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5111
5121
|
relativeFilePath: "CLAUDE.md"
|
|
5112
5122
|
},
|
|
5113
5123
|
nonRoot: {
|
|
5114
|
-
relativeDirPath: (0,
|
|
5124
|
+
relativeDirPath: (0, import_node_path53.join)(".claude", "memories")
|
|
5115
5125
|
}
|
|
5116
5126
|
};
|
|
5117
5127
|
}
|
|
@@ -5126,7 +5136,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5126
5136
|
if (isRoot) {
|
|
5127
5137
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5128
5138
|
const fileContent2 = await readFileContent(
|
|
5129
|
-
(0,
|
|
5139
|
+
(0, import_node_path53.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5130
5140
|
);
|
|
5131
5141
|
return new _ClaudecodeRule({
|
|
5132
5142
|
baseDir,
|
|
@@ -5140,8 +5150,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5140
5150
|
if (!paths.nonRoot) {
|
|
5141
5151
|
throw new Error("nonRoot path is not set");
|
|
5142
5152
|
}
|
|
5143
|
-
const relativePath = (0,
|
|
5144
|
-
const fileContent = await readFileContent((0,
|
|
5153
|
+
const relativePath = (0, import_node_path53.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5154
|
+
const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
|
|
5145
5155
|
return new _ClaudecodeRule({
|
|
5146
5156
|
baseDir,
|
|
5147
5157
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5183,7 +5193,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
5183
5193
|
};
|
|
5184
5194
|
|
|
5185
5195
|
// src/features/rules/cline-rule.ts
|
|
5186
|
-
var
|
|
5196
|
+
var import_node_path54 = require("path");
|
|
5187
5197
|
var import_mini19 = require("zod/mini");
|
|
5188
5198
|
var ClineRuleFrontmatterSchema = import_mini19.z.object({
|
|
5189
5199
|
description: import_mini19.z.string()
|
|
@@ -5228,7 +5238,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
5228
5238
|
validate = true
|
|
5229
5239
|
}) {
|
|
5230
5240
|
const fileContent = await readFileContent(
|
|
5231
|
-
(0,
|
|
5241
|
+
(0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5232
5242
|
);
|
|
5233
5243
|
return new _ClineRule({
|
|
5234
5244
|
baseDir,
|
|
@@ -5241,7 +5251,7 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
5241
5251
|
};
|
|
5242
5252
|
|
|
5243
5253
|
// src/features/rules/codexcli-rule.ts
|
|
5244
|
-
var
|
|
5254
|
+
var import_node_path55 = require("path");
|
|
5245
5255
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
5246
5256
|
static getSettablePaths({
|
|
5247
5257
|
global
|
|
@@ -5260,7 +5270,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5260
5270
|
relativeFilePath: "AGENTS.md"
|
|
5261
5271
|
},
|
|
5262
5272
|
nonRoot: {
|
|
5263
|
-
relativeDirPath: (0,
|
|
5273
|
+
relativeDirPath: (0, import_node_path55.join)(".codex", "memories")
|
|
5264
5274
|
}
|
|
5265
5275
|
};
|
|
5266
5276
|
}
|
|
@@ -5275,7 +5285,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5275
5285
|
if (isRoot) {
|
|
5276
5286
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5277
5287
|
const fileContent2 = await readFileContent(
|
|
5278
|
-
(0,
|
|
5288
|
+
(0, import_node_path55.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5279
5289
|
);
|
|
5280
5290
|
return new _CodexcliRule({
|
|
5281
5291
|
baseDir,
|
|
@@ -5289,8 +5299,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5289
5299
|
if (!paths.nonRoot) {
|
|
5290
5300
|
throw new Error("nonRoot path is not set");
|
|
5291
5301
|
}
|
|
5292
|
-
const relativePath = (0,
|
|
5293
|
-
const fileContent = await readFileContent((0,
|
|
5302
|
+
const relativePath = (0, import_node_path55.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5303
|
+
const fileContent = await readFileContent((0, import_node_path55.join)(baseDir, relativePath));
|
|
5294
5304
|
return new _CodexcliRule({
|
|
5295
5305
|
baseDir,
|
|
5296
5306
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5332,7 +5342,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
5332
5342
|
};
|
|
5333
5343
|
|
|
5334
5344
|
// src/features/rules/copilot-rule.ts
|
|
5335
|
-
var
|
|
5345
|
+
var import_node_path56 = require("path");
|
|
5336
5346
|
var import_mini20 = require("zod/mini");
|
|
5337
5347
|
var CopilotRuleFrontmatterSchema = import_mini20.z.object({
|
|
5338
5348
|
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
@@ -5348,7 +5358,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5348
5358
|
relativeFilePath: "copilot-instructions.md"
|
|
5349
5359
|
},
|
|
5350
5360
|
nonRoot: {
|
|
5351
|
-
relativeDirPath: (0,
|
|
5361
|
+
relativeDirPath: (0, import_node_path56.join)(".github", "instructions")
|
|
5352
5362
|
}
|
|
5353
5363
|
};
|
|
5354
5364
|
}
|
|
@@ -5357,7 +5367,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5357
5367
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5358
5368
|
if (!result.success) {
|
|
5359
5369
|
throw new Error(
|
|
5360
|
-
`Invalid frontmatter in ${(0,
|
|
5370
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5361
5371
|
);
|
|
5362
5372
|
}
|
|
5363
5373
|
}
|
|
@@ -5388,7 +5398,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5388
5398
|
baseDir: this.getBaseDir(),
|
|
5389
5399
|
frontmatter: rulesyncFrontmatter,
|
|
5390
5400
|
body: this.body,
|
|
5391
|
-
relativeDirPath:
|
|
5401
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH,
|
|
5392
5402
|
relativeFilePath,
|
|
5393
5403
|
validate: true
|
|
5394
5404
|
});
|
|
@@ -5435,11 +5445,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5435
5445
|
validate = true
|
|
5436
5446
|
}) {
|
|
5437
5447
|
const isRoot = relativeFilePath === "copilot-instructions.md";
|
|
5438
|
-
const relativePath = isRoot ? (0,
|
|
5448
|
+
const relativePath = isRoot ? (0, import_node_path56.join)(
|
|
5439
5449
|
this.getSettablePaths().root.relativeDirPath,
|
|
5440
5450
|
this.getSettablePaths().root.relativeFilePath
|
|
5441
|
-
) : (0,
|
|
5442
|
-
const fileContent = await readFileContent((0,
|
|
5451
|
+
) : (0, import_node_path56.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
5452
|
+
const fileContent = await readFileContent((0, import_node_path56.join)(baseDir, relativePath));
|
|
5443
5453
|
if (isRoot) {
|
|
5444
5454
|
return new _CopilotRule({
|
|
5445
5455
|
baseDir,
|
|
@@ -5458,7 +5468,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5458
5468
|
const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5459
5469
|
if (!result.success) {
|
|
5460
5470
|
throw new Error(
|
|
5461
|
-
`Invalid frontmatter in ${(0,
|
|
5471
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
5462
5472
|
);
|
|
5463
5473
|
}
|
|
5464
5474
|
return new _CopilotRule({
|
|
@@ -5482,7 +5492,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5482
5492
|
return {
|
|
5483
5493
|
success: false,
|
|
5484
5494
|
error: new Error(
|
|
5485
|
-
`Invalid frontmatter in ${(0,
|
|
5495
|
+
`Invalid frontmatter in ${(0, import_node_path56.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5486
5496
|
)
|
|
5487
5497
|
};
|
|
5488
5498
|
}
|
|
@@ -5502,7 +5512,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5502
5512
|
};
|
|
5503
5513
|
|
|
5504
5514
|
// src/features/rules/cursor-rule.ts
|
|
5505
|
-
var
|
|
5515
|
+
var import_node_path57 = require("path");
|
|
5506
5516
|
var import_mini21 = require("zod/mini");
|
|
5507
5517
|
var CursorRuleFrontmatterSchema = import_mini21.z.object({
|
|
5508
5518
|
description: import_mini21.z.optional(import_mini21.z.string()),
|
|
@@ -5515,7 +5525,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5515
5525
|
static getSettablePaths() {
|
|
5516
5526
|
return {
|
|
5517
5527
|
nonRoot: {
|
|
5518
|
-
relativeDirPath: (0,
|
|
5528
|
+
relativeDirPath: (0, import_node_path57.join)(".cursor", "rules")
|
|
5519
5529
|
}
|
|
5520
5530
|
};
|
|
5521
5531
|
}
|
|
@@ -5524,7 +5534,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5524
5534
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5525
5535
|
if (!result.success) {
|
|
5526
5536
|
throw new Error(
|
|
5527
|
-
`Invalid frontmatter in ${(0,
|
|
5537
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
|
|
5528
5538
|
);
|
|
5529
5539
|
}
|
|
5530
5540
|
}
|
|
@@ -5596,7 +5606,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5596
5606
|
return new RulesyncRule({
|
|
5597
5607
|
frontmatter: rulesyncFrontmatter,
|
|
5598
5608
|
body: this.body,
|
|
5599
|
-
relativeDirPath:
|
|
5609
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH,
|
|
5600
5610
|
relativeFilePath: this.relativeFilePath.replace(/\.mdc$/, ".md"),
|
|
5601
5611
|
validate: true
|
|
5602
5612
|
});
|
|
@@ -5641,19 +5651,19 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5641
5651
|
validate = true
|
|
5642
5652
|
}) {
|
|
5643
5653
|
const fileContent = await readFileContent(
|
|
5644
|
-
(0,
|
|
5654
|
+
(0, import_node_path57.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5645
5655
|
);
|
|
5646
5656
|
const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
|
|
5647
5657
|
const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
|
|
5648
5658
|
if (!result.success) {
|
|
5649
5659
|
throw new Error(
|
|
5650
|
-
`Invalid frontmatter in ${(0,
|
|
5660
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
|
|
5651
5661
|
);
|
|
5652
5662
|
}
|
|
5653
5663
|
return new _CursorRule({
|
|
5654
5664
|
baseDir,
|
|
5655
5665
|
relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
|
|
5656
|
-
relativeFilePath: (0,
|
|
5666
|
+
relativeFilePath: (0, import_node_path57.basename)(relativeFilePath),
|
|
5657
5667
|
frontmatter: result.data,
|
|
5658
5668
|
body: content.trim(),
|
|
5659
5669
|
validate
|
|
@@ -5670,7 +5680,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5670
5680
|
return {
|
|
5671
5681
|
success: false,
|
|
5672
5682
|
error: new Error(
|
|
5673
|
-
`Invalid frontmatter in ${(0,
|
|
5683
|
+
`Invalid frontmatter in ${(0, import_node_path57.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
|
|
5674
5684
|
)
|
|
5675
5685
|
};
|
|
5676
5686
|
}
|
|
@@ -5690,7 +5700,7 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5690
5700
|
};
|
|
5691
5701
|
|
|
5692
5702
|
// src/features/rules/geminicli-rule.ts
|
|
5693
|
-
var
|
|
5703
|
+
var import_node_path58 = require("path");
|
|
5694
5704
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5695
5705
|
static getSettablePaths({
|
|
5696
5706
|
global
|
|
@@ -5709,7 +5719,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5709
5719
|
relativeFilePath: "GEMINI.md"
|
|
5710
5720
|
},
|
|
5711
5721
|
nonRoot: {
|
|
5712
|
-
relativeDirPath: (0,
|
|
5722
|
+
relativeDirPath: (0, import_node_path58.join)(".gemini", "memories")
|
|
5713
5723
|
}
|
|
5714
5724
|
};
|
|
5715
5725
|
}
|
|
@@ -5724,7 +5734,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5724
5734
|
if (isRoot) {
|
|
5725
5735
|
const relativePath2 = paths.root.relativeFilePath;
|
|
5726
5736
|
const fileContent2 = await readFileContent(
|
|
5727
|
-
(0,
|
|
5737
|
+
(0, import_node_path58.join)(baseDir, paths.root.relativeDirPath, relativePath2)
|
|
5728
5738
|
);
|
|
5729
5739
|
return new _GeminiCliRule({
|
|
5730
5740
|
baseDir,
|
|
@@ -5738,8 +5748,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5738
5748
|
if (!paths.nonRoot) {
|
|
5739
5749
|
throw new Error("nonRoot path is not set");
|
|
5740
5750
|
}
|
|
5741
|
-
const relativePath = (0,
|
|
5742
|
-
const fileContent = await readFileContent((0,
|
|
5751
|
+
const relativePath = (0, import_node_path58.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
|
|
5752
|
+
const fileContent = await readFileContent((0, import_node_path58.join)(baseDir, relativePath));
|
|
5743
5753
|
return new _GeminiCliRule({
|
|
5744
5754
|
baseDir,
|
|
5745
5755
|
relativeDirPath: paths.nonRoot.relativeDirPath,
|
|
@@ -5781,7 +5791,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5781
5791
|
};
|
|
5782
5792
|
|
|
5783
5793
|
// src/features/rules/junie-rule.ts
|
|
5784
|
-
var
|
|
5794
|
+
var import_node_path59 = require("path");
|
|
5785
5795
|
var JunieRule = class _JunieRule extends ToolRule {
|
|
5786
5796
|
static getSettablePaths() {
|
|
5787
5797
|
return {
|
|
@@ -5790,7 +5800,7 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5790
5800
|
relativeFilePath: "guidelines.md"
|
|
5791
5801
|
},
|
|
5792
5802
|
nonRoot: {
|
|
5793
|
-
relativeDirPath: (0,
|
|
5803
|
+
relativeDirPath: (0, import_node_path59.join)(".junie", "memories")
|
|
5794
5804
|
}
|
|
5795
5805
|
};
|
|
5796
5806
|
}
|
|
@@ -5800,8 +5810,8 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5800
5810
|
validate = true
|
|
5801
5811
|
}) {
|
|
5802
5812
|
const isRoot = relativeFilePath === "guidelines.md";
|
|
5803
|
-
const relativePath = isRoot ? "guidelines.md" : (0,
|
|
5804
|
-
const fileContent = await readFileContent((0,
|
|
5813
|
+
const relativePath = isRoot ? "guidelines.md" : (0, import_node_path59.join)(".junie", "memories", relativeFilePath);
|
|
5814
|
+
const fileContent = await readFileContent((0, import_node_path59.join)(baseDir, relativePath));
|
|
5805
5815
|
return new _JunieRule({
|
|
5806
5816
|
baseDir,
|
|
5807
5817
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5841,12 +5851,12 @@ var JunieRule = class _JunieRule extends ToolRule {
|
|
|
5841
5851
|
};
|
|
5842
5852
|
|
|
5843
5853
|
// src/features/rules/kiro-rule.ts
|
|
5844
|
-
var
|
|
5854
|
+
var import_node_path60 = require("path");
|
|
5845
5855
|
var KiroRule = class _KiroRule extends ToolRule {
|
|
5846
5856
|
static getSettablePaths() {
|
|
5847
5857
|
return {
|
|
5848
5858
|
nonRoot: {
|
|
5849
|
-
relativeDirPath: (0,
|
|
5859
|
+
relativeDirPath: (0, import_node_path60.join)(".kiro", "steering")
|
|
5850
5860
|
}
|
|
5851
5861
|
};
|
|
5852
5862
|
}
|
|
@@ -5856,7 +5866,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5856
5866
|
validate = true
|
|
5857
5867
|
}) {
|
|
5858
5868
|
const fileContent = await readFileContent(
|
|
5859
|
-
(0,
|
|
5869
|
+
(0, import_node_path60.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
5860
5870
|
);
|
|
5861
5871
|
return new _KiroRule({
|
|
5862
5872
|
baseDir,
|
|
@@ -5896,7 +5906,7 @@ var KiroRule = class _KiroRule extends ToolRule {
|
|
|
5896
5906
|
};
|
|
5897
5907
|
|
|
5898
5908
|
// src/features/rules/opencode-rule.ts
|
|
5899
|
-
var
|
|
5909
|
+
var import_node_path61 = require("path");
|
|
5900
5910
|
var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
5901
5911
|
static getSettablePaths() {
|
|
5902
5912
|
return {
|
|
@@ -5905,7 +5915,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5905
5915
|
relativeFilePath: "AGENTS.md"
|
|
5906
5916
|
},
|
|
5907
5917
|
nonRoot: {
|
|
5908
|
-
relativeDirPath: (0,
|
|
5918
|
+
relativeDirPath: (0, import_node_path61.join)(".opencode", "memories")
|
|
5909
5919
|
}
|
|
5910
5920
|
};
|
|
5911
5921
|
}
|
|
@@ -5915,8 +5925,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5915
5925
|
validate = true
|
|
5916
5926
|
}) {
|
|
5917
5927
|
const isRoot = relativeFilePath === "AGENTS.md";
|
|
5918
|
-
const relativePath = isRoot ? "AGENTS.md" : (0,
|
|
5919
|
-
const fileContent = await readFileContent((0,
|
|
5928
|
+
const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path61.join)(".opencode", "memories", relativeFilePath);
|
|
5929
|
+
const fileContent = await readFileContent((0, import_node_path61.join)(baseDir, relativePath));
|
|
5920
5930
|
return new _OpenCodeRule({
|
|
5921
5931
|
baseDir,
|
|
5922
5932
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -5956,7 +5966,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
|
|
|
5956
5966
|
};
|
|
5957
5967
|
|
|
5958
5968
|
// src/features/rules/qwencode-rule.ts
|
|
5959
|
-
var
|
|
5969
|
+
var import_node_path62 = require("path");
|
|
5960
5970
|
var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
5961
5971
|
static getSettablePaths() {
|
|
5962
5972
|
return {
|
|
@@ -5965,7 +5975,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5965
5975
|
relativeFilePath: "QWEN.md"
|
|
5966
5976
|
},
|
|
5967
5977
|
nonRoot: {
|
|
5968
|
-
relativeDirPath: (0,
|
|
5978
|
+
relativeDirPath: (0, import_node_path62.join)(".qwen", "memories")
|
|
5969
5979
|
}
|
|
5970
5980
|
};
|
|
5971
5981
|
}
|
|
@@ -5975,8 +5985,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
5975
5985
|
validate = true
|
|
5976
5986
|
}) {
|
|
5977
5987
|
const isRoot = relativeFilePath === "QWEN.md";
|
|
5978
|
-
const relativePath = isRoot ? "QWEN.md" : (0,
|
|
5979
|
-
const fileContent = await readFileContent((0,
|
|
5988
|
+
const relativePath = isRoot ? "QWEN.md" : (0, import_node_path62.join)(".qwen", "memories", relativeFilePath);
|
|
5989
|
+
const fileContent = await readFileContent((0, import_node_path62.join)(baseDir, relativePath));
|
|
5980
5990
|
return new _QwencodeRule({
|
|
5981
5991
|
baseDir,
|
|
5982
5992
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
|
|
@@ -6013,12 +6023,12 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
|
|
|
6013
6023
|
};
|
|
6014
6024
|
|
|
6015
6025
|
// src/features/rules/roo-rule.ts
|
|
6016
|
-
var
|
|
6026
|
+
var import_node_path63 = require("path");
|
|
6017
6027
|
var RooRule = class _RooRule extends ToolRule {
|
|
6018
6028
|
static getSettablePaths() {
|
|
6019
6029
|
return {
|
|
6020
6030
|
nonRoot: {
|
|
6021
|
-
relativeDirPath: (0,
|
|
6031
|
+
relativeDirPath: (0, import_node_path63.join)(".roo", "rules")
|
|
6022
6032
|
}
|
|
6023
6033
|
};
|
|
6024
6034
|
}
|
|
@@ -6028,7 +6038,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
6028
6038
|
validate = true
|
|
6029
6039
|
}) {
|
|
6030
6040
|
const fileContent = await readFileContent(
|
|
6031
|
-
(0,
|
|
6041
|
+
(0, import_node_path63.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6032
6042
|
);
|
|
6033
6043
|
return new _RooRule({
|
|
6034
6044
|
baseDir,
|
|
@@ -6083,7 +6093,7 @@ var RooRule = class _RooRule extends ToolRule {
|
|
|
6083
6093
|
};
|
|
6084
6094
|
|
|
6085
6095
|
// src/features/rules/warp-rule.ts
|
|
6086
|
-
var
|
|
6096
|
+
var import_node_path64 = require("path");
|
|
6087
6097
|
var WarpRule = class _WarpRule extends ToolRule {
|
|
6088
6098
|
constructor({ fileContent, root, ...rest }) {
|
|
6089
6099
|
super({
|
|
@@ -6099,7 +6109,7 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6099
6109
|
relativeFilePath: "WARP.md"
|
|
6100
6110
|
},
|
|
6101
6111
|
nonRoot: {
|
|
6102
|
-
relativeDirPath: (0,
|
|
6112
|
+
relativeDirPath: (0, import_node_path64.join)(".warp", "memories")
|
|
6103
6113
|
}
|
|
6104
6114
|
};
|
|
6105
6115
|
}
|
|
@@ -6109,8 +6119,8 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6109
6119
|
validate = true
|
|
6110
6120
|
}) {
|
|
6111
6121
|
const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
|
|
6112
|
-
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0,
|
|
6113
|
-
const fileContent = await readFileContent((0,
|
|
6122
|
+
const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path64.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
|
|
6123
|
+
const fileContent = await readFileContent((0, import_node_path64.join)(baseDir, relativePath));
|
|
6114
6124
|
return new _WarpRule({
|
|
6115
6125
|
baseDir,
|
|
6116
6126
|
relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
|
|
@@ -6150,12 +6160,12 @@ var WarpRule = class _WarpRule extends ToolRule {
|
|
|
6150
6160
|
};
|
|
6151
6161
|
|
|
6152
6162
|
// src/features/rules/windsurf-rule.ts
|
|
6153
|
-
var
|
|
6163
|
+
var import_node_path65 = require("path");
|
|
6154
6164
|
var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
6155
6165
|
static getSettablePaths() {
|
|
6156
6166
|
return {
|
|
6157
6167
|
nonRoot: {
|
|
6158
|
-
relativeDirPath: (0,
|
|
6168
|
+
relativeDirPath: (0, import_node_path65.join)(".windsurf", "rules")
|
|
6159
6169
|
}
|
|
6160
6170
|
};
|
|
6161
6171
|
}
|
|
@@ -6165,7 +6175,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
|
|
|
6165
6175
|
validate = true
|
|
6166
6176
|
}) {
|
|
6167
6177
|
const fileContent = await readFileContent(
|
|
6168
|
-
(0,
|
|
6178
|
+
(0, import_node_path65.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
|
|
6169
6179
|
);
|
|
6170
6180
|
return new _WindsurfRule({
|
|
6171
6181
|
baseDir,
|
|
@@ -6565,10 +6575,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6565
6575
|
* Load and parse rulesync rule files from .rulesync/rules/ directory
|
|
6566
6576
|
*/
|
|
6567
6577
|
async loadRulesyncFiles() {
|
|
6568
|
-
const files = await findFilesByGlobs((0,
|
|
6578
|
+
const files = await findFilesByGlobs((0, import_node_path66.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md"));
|
|
6569
6579
|
logger.debug(`Found ${files.length} rulesync files`);
|
|
6570
6580
|
const rulesyncRules = await Promise.all(
|
|
6571
|
-
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0,
|
|
6581
|
+
files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path66.basename)(file) }))
|
|
6572
6582
|
);
|
|
6573
6583
|
const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
|
|
6574
6584
|
if (rootRules.length > 1) {
|
|
@@ -6586,10 +6596,10 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6586
6596
|
return rulesyncRules;
|
|
6587
6597
|
}
|
|
6588
6598
|
async loadRulesyncFilesLegacy() {
|
|
6589
|
-
const legacyFiles = await findFilesByGlobs((0,
|
|
6599
|
+
const legacyFiles = await findFilesByGlobs((0, import_node_path66.join)(RULESYNC_RELATIVE_DIR_PATH, "*.md"));
|
|
6590
6600
|
logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
|
|
6591
6601
|
return Promise.all(
|
|
6592
|
-
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0,
|
|
6602
|
+
legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path66.basename)(file) }))
|
|
6593
6603
|
);
|
|
6594
6604
|
}
|
|
6595
6605
|
/**
|
|
@@ -6653,13 +6663,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6653
6663
|
return [];
|
|
6654
6664
|
}
|
|
6655
6665
|
const rootFilePaths = await findFilesByGlobs(
|
|
6656
|
-
(0,
|
|
6666
|
+
(0, import_node_path66.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
|
|
6657
6667
|
);
|
|
6658
6668
|
return await Promise.all(
|
|
6659
6669
|
rootFilePaths.map(
|
|
6660
6670
|
(filePath) => root.fromFile({
|
|
6661
6671
|
baseDir: this.baseDir,
|
|
6662
|
-
relativeFilePath: (0,
|
|
6672
|
+
relativeFilePath: (0, import_node_path66.basename)(filePath),
|
|
6663
6673
|
global: this.global
|
|
6664
6674
|
})
|
|
6665
6675
|
)
|
|
@@ -6671,13 +6681,13 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6671
6681
|
return [];
|
|
6672
6682
|
}
|
|
6673
6683
|
const nonRootFilePaths = await findFilesByGlobs(
|
|
6674
|
-
(0,
|
|
6684
|
+
(0, import_node_path66.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
|
|
6675
6685
|
);
|
|
6676
6686
|
return await Promise.all(
|
|
6677
6687
|
nonRootFilePaths.map(
|
|
6678
6688
|
(filePath) => nonRoot.fromFile({
|
|
6679
6689
|
baseDir: this.baseDir,
|
|
6680
|
-
relativeFilePath: (0,
|
|
6690
|
+
relativeFilePath: (0, import_node_path66.basename)(filePath),
|
|
6681
6691
|
global: this.global
|
|
6682
6692
|
})
|
|
6683
6693
|
)
|
|
@@ -7047,14 +7057,14 @@ s/<command> [arguments]
|
|
|
7047
7057
|
This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
|
|
7048
7058
|
The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
|
|
7049
7059
|
|
|
7050
|
-
When users call a custom slash command, you have to look for the markdown file, \`${(0,
|
|
7060
|
+
When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path66.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
|
|
7051
7061
|
const subagentsSection = subagents ? `## Simulated Subagents
|
|
7052
7062
|
|
|
7053
7063
|
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.
|
|
7054
7064
|
|
|
7055
|
-
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0,
|
|
7065
|
+
When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path66.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
|
|
7056
7066
|
|
|
7057
|
-
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0,
|
|
7067
|
+
For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path66.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
|
|
7058
7068
|
const result = [
|
|
7059
7069
|
overview,
|
|
7060
7070
|
...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
|
|
@@ -7069,7 +7079,7 @@ async function generateCommand(options) {
|
|
|
7069
7079
|
const config = await ConfigResolver.resolve(options);
|
|
7070
7080
|
logger.setVerbose(config.getVerbose());
|
|
7071
7081
|
logger.info("Generating files...");
|
|
7072
|
-
if (!await fileExists(
|
|
7082
|
+
if (!await fileExists(RULESYNC_RELATIVE_DIR_PATH)) {
|
|
7073
7083
|
logger.error("\u274C .rulesync directory not found. Run 'rulesync init' first.");
|
|
7074
7084
|
process.exit(1);
|
|
7075
7085
|
}
|
|
@@ -7268,9 +7278,9 @@ async function generateSubagents(config) {
|
|
|
7268
7278
|
}
|
|
7269
7279
|
|
|
7270
7280
|
// src/cli/commands/gitignore.ts
|
|
7271
|
-
var
|
|
7281
|
+
var import_node_path67 = require("path");
|
|
7272
7282
|
var gitignoreCommand = async () => {
|
|
7273
|
-
const gitignorePath = (0,
|
|
7283
|
+
const gitignorePath = (0, import_node_path67.join)(process.cwd(), ".gitignore");
|
|
7274
7284
|
const rulesFilesToIgnore = [
|
|
7275
7285
|
"# Generated by rulesync - AI tool configuration files",
|
|
7276
7286
|
// AGENTS.md
|
|
@@ -7511,24 +7521,26 @@ async function importSubagents(config, tool) {
|
|
|
7511
7521
|
}
|
|
7512
7522
|
|
|
7513
7523
|
// src/cli/commands/init.ts
|
|
7514
|
-
var
|
|
7524
|
+
var import_node_path68 = require("path");
|
|
7515
7525
|
async function initCommand() {
|
|
7516
7526
|
logger.info("Initializing rulesync...");
|
|
7517
|
-
await ensureDir(
|
|
7527
|
+
await ensureDir(RULESYNC_RELATIVE_DIR_PATH);
|
|
7518
7528
|
await createSampleFiles();
|
|
7519
7529
|
await createConfigFile();
|
|
7520
7530
|
logger.success("rulesync initialized successfully!");
|
|
7521
7531
|
logger.info("Next steps:");
|
|
7522
|
-
logger.info(
|
|
7532
|
+
logger.info(
|
|
7533
|
+
`1. Edit ${RULESYNC_RELATIVE_DIR_PATH}/**/*.md, ${RULESYNC_MCP_RELATIVE_FILE_PATH} and ${RULESYNC_IGNORE_RELATIVE_FILE_PATH}`
|
|
7534
|
+
);
|
|
7523
7535
|
logger.info("2. Run 'rulesync generate' to create configuration files");
|
|
7524
7536
|
}
|
|
7525
7537
|
async function createConfigFile() {
|
|
7526
|
-
if (await fileExists(
|
|
7527
|
-
logger.info(
|
|
7538
|
+
if (await fileExists(RULESYNC_CONFIG_RELATIVE_FILE_PATH)) {
|
|
7539
|
+
logger.info(`Skipped ${RULESYNC_CONFIG_RELATIVE_FILE_PATH} (already exists)`);
|
|
7528
7540
|
return;
|
|
7529
7541
|
}
|
|
7530
7542
|
await writeFileContent(
|
|
7531
|
-
|
|
7543
|
+
RULESYNC_CONFIG_RELATIVE_FILE_PATH,
|
|
7532
7544
|
JSON.stringify(
|
|
7533
7545
|
{
|
|
7534
7546
|
targets: ["copilot", "cursor", "claudecode", "codexcli"],
|
|
@@ -7545,11 +7557,11 @@ async function createConfigFile() {
|
|
|
7545
7557
|
2
|
|
7546
7558
|
)
|
|
7547
7559
|
);
|
|
7548
|
-
logger.success(
|
|
7560
|
+
logger.success(`Created ${RULESYNC_CONFIG_RELATIVE_FILE_PATH}`);
|
|
7549
7561
|
}
|
|
7550
7562
|
async function createSampleFiles() {
|
|
7551
7563
|
const sampleRuleFile = {
|
|
7552
|
-
filename:
|
|
7564
|
+
filename: RULESYNC_OVERVIEW_FILE_NAME,
|
|
7553
7565
|
content: `---
|
|
7554
7566
|
root: true
|
|
7555
7567
|
targets: ["*"]
|
|
@@ -7672,14 +7684,14 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7672
7684
|
await ensureDir(commandPaths.relativeDirPath);
|
|
7673
7685
|
await ensureDir(subagentPaths.relativeDirPath);
|
|
7674
7686
|
await ensureDir(ignorePaths.relativeDirPath);
|
|
7675
|
-
const ruleFilepath = (0,
|
|
7687
|
+
const ruleFilepath = (0, import_node_path68.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
|
|
7676
7688
|
if (!await fileExists(ruleFilepath)) {
|
|
7677
7689
|
await writeFileContent(ruleFilepath, sampleRuleFile.content);
|
|
7678
7690
|
logger.success(`Created ${ruleFilepath}`);
|
|
7679
7691
|
} else {
|
|
7680
7692
|
logger.info(`Skipped ${ruleFilepath} (already exists)`);
|
|
7681
7693
|
}
|
|
7682
|
-
const mcpFilepath = (0,
|
|
7694
|
+
const mcpFilepath = (0, import_node_path68.join)(
|
|
7683
7695
|
mcpPaths.recommended.relativeDirPath,
|
|
7684
7696
|
mcpPaths.recommended.relativeFilePath
|
|
7685
7697
|
);
|
|
@@ -7689,21 +7701,21 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7689
7701
|
} else {
|
|
7690
7702
|
logger.info(`Skipped ${mcpFilepath} (already exists)`);
|
|
7691
7703
|
}
|
|
7692
|
-
const commandFilepath = (0,
|
|
7704
|
+
const commandFilepath = (0, import_node_path68.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
|
|
7693
7705
|
if (!await fileExists(commandFilepath)) {
|
|
7694
7706
|
await writeFileContent(commandFilepath, sampleCommandFile.content);
|
|
7695
7707
|
logger.success(`Created ${commandFilepath}`);
|
|
7696
7708
|
} else {
|
|
7697
7709
|
logger.info(`Skipped ${commandFilepath} (already exists)`);
|
|
7698
7710
|
}
|
|
7699
|
-
const subagentFilepath = (0,
|
|
7711
|
+
const subagentFilepath = (0, import_node_path68.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
|
|
7700
7712
|
if (!await fileExists(subagentFilepath)) {
|
|
7701
7713
|
await writeFileContent(subagentFilepath, sampleSubagentFile.content);
|
|
7702
7714
|
logger.success(`Created ${subagentFilepath}`);
|
|
7703
7715
|
} else {
|
|
7704
7716
|
logger.info(`Skipped ${subagentFilepath} (already exists)`);
|
|
7705
7717
|
}
|
|
7706
|
-
const ignoreFilepath = (0,
|
|
7718
|
+
const ignoreFilepath = (0, import_node_path68.join)(ignorePaths.relativeDirPath, ignorePaths.relativeFilePath);
|
|
7707
7719
|
if (!await fileExists(ignoreFilepath)) {
|
|
7708
7720
|
await writeFileContent(ignoreFilepath, sampleIgnoreFile.content);
|
|
7709
7721
|
logger.success(`Created ${ignoreFilepath}`);
|
|
@@ -7716,12 +7728,12 @@ Attention, again, you are just the planner, so though you can read any files and
|
|
|
7716
7728
|
var import_fastmcp = require("fastmcp");
|
|
7717
7729
|
|
|
7718
7730
|
// src/mcp/commands.ts
|
|
7719
|
-
var
|
|
7731
|
+
var import_node_path69 = require("path");
|
|
7720
7732
|
var import_mini23 = require("zod/mini");
|
|
7721
7733
|
var maxCommandSizeBytes = 1024 * 1024;
|
|
7722
7734
|
var maxCommandsCount = 1e3;
|
|
7723
7735
|
async function listCommands() {
|
|
7724
|
-
const commandsDir = (0,
|
|
7736
|
+
const commandsDir = (0, import_node_path69.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
7725
7737
|
try {
|
|
7726
7738
|
const files = await listDirectoryFiles(commandsDir);
|
|
7727
7739
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -7733,7 +7745,7 @@ async function listCommands() {
|
|
|
7733
7745
|
});
|
|
7734
7746
|
const frontmatter = command.getFrontmatter();
|
|
7735
7747
|
return {
|
|
7736
|
-
relativePathFromCwd: (0,
|
|
7748
|
+
relativePathFromCwd: (0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, file),
|
|
7737
7749
|
frontmatter
|
|
7738
7750
|
};
|
|
7739
7751
|
} catch (error) {
|
|
@@ -7753,13 +7765,13 @@ async function getCommand({ relativePathFromCwd }) {
|
|
|
7753
7765
|
relativePath: relativePathFromCwd,
|
|
7754
7766
|
intendedRootDir: process.cwd()
|
|
7755
7767
|
});
|
|
7756
|
-
const filename = (0,
|
|
7768
|
+
const filename = (0, import_node_path69.basename)(relativePathFromCwd);
|
|
7757
7769
|
try {
|
|
7758
7770
|
const command = await RulesyncCommand.fromFile({
|
|
7759
7771
|
relativeFilePath: filename
|
|
7760
7772
|
});
|
|
7761
7773
|
return {
|
|
7762
|
-
relativePathFromCwd: (0,
|
|
7774
|
+
relativePathFromCwd: (0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
7763
7775
|
frontmatter: command.getFrontmatter(),
|
|
7764
7776
|
body: command.getBody()
|
|
7765
7777
|
};
|
|
@@ -7778,7 +7790,7 @@ async function putCommand({
|
|
|
7778
7790
|
relativePath: relativePathFromCwd,
|
|
7779
7791
|
intendedRootDir: process.cwd()
|
|
7780
7792
|
});
|
|
7781
|
-
const filename = (0,
|
|
7793
|
+
const filename = (0, import_node_path69.basename)(relativePathFromCwd);
|
|
7782
7794
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
7783
7795
|
if (estimatedSize > maxCommandSizeBytes) {
|
|
7784
7796
|
throw new Error(
|
|
@@ -7788,7 +7800,7 @@ async function putCommand({
|
|
|
7788
7800
|
try {
|
|
7789
7801
|
const existingCommands = await listCommands();
|
|
7790
7802
|
const isUpdate = existingCommands.some(
|
|
7791
|
-
(command2) => command2.relativePathFromCwd === (0,
|
|
7803
|
+
(command2) => command2.relativePathFromCwd === (0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
7792
7804
|
);
|
|
7793
7805
|
if (!isUpdate && existingCommands.length >= maxCommandsCount) {
|
|
7794
7806
|
throw new Error(`Maximum number of commands (${maxCommandsCount}) reached`);
|
|
@@ -7796,18 +7808,18 @@ async function putCommand({
|
|
|
7796
7808
|
const fileContent = stringifyFrontmatter(body, frontmatter);
|
|
7797
7809
|
const command = new RulesyncCommand({
|
|
7798
7810
|
baseDir: process.cwd(),
|
|
7799
|
-
relativeDirPath:
|
|
7811
|
+
relativeDirPath: RULESYNC_COMMANDS_RELATIVE_DIR_PATH,
|
|
7800
7812
|
relativeFilePath: filename,
|
|
7801
7813
|
frontmatter,
|
|
7802
7814
|
body,
|
|
7803
7815
|
fileContent,
|
|
7804
7816
|
validate: true
|
|
7805
7817
|
});
|
|
7806
|
-
const commandsDir = (0,
|
|
7818
|
+
const commandsDir = (0, import_node_path69.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH);
|
|
7807
7819
|
await ensureDir(commandsDir);
|
|
7808
7820
|
await writeFileContent(command.getFilePath(), command.getFileContent());
|
|
7809
7821
|
return {
|
|
7810
|
-
relativePathFromCwd: (0,
|
|
7822
|
+
relativePathFromCwd: (0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename),
|
|
7811
7823
|
frontmatter: command.getFrontmatter(),
|
|
7812
7824
|
body: command.getBody()
|
|
7813
7825
|
};
|
|
@@ -7822,12 +7834,12 @@ async function deleteCommand({ relativePathFromCwd }) {
|
|
|
7822
7834
|
relativePath: relativePathFromCwd,
|
|
7823
7835
|
intendedRootDir: process.cwd()
|
|
7824
7836
|
});
|
|
7825
|
-
const filename = (0,
|
|
7826
|
-
const fullPath = (0,
|
|
7837
|
+
const filename = (0, import_node_path69.basename)(relativePathFromCwd);
|
|
7838
|
+
const fullPath = (0, import_node_path69.join)(process.cwd(), RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename);
|
|
7827
7839
|
try {
|
|
7828
7840
|
await removeFile(fullPath);
|
|
7829
7841
|
return {
|
|
7830
|
-
relativePathFromCwd: (0,
|
|
7842
|
+
relativePathFromCwd: (0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, filename)
|
|
7831
7843
|
};
|
|
7832
7844
|
} catch (error) {
|
|
7833
7845
|
throw new Error(`Failed to delete command file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -7852,7 +7864,7 @@ var commandToolSchemas = {
|
|
|
7852
7864
|
var commandTools = {
|
|
7853
7865
|
listCommands: {
|
|
7854
7866
|
name: "listCommands",
|
|
7855
|
-
description: `List all commands from ${(0,
|
|
7867
|
+
description: `List all commands from ${(0, import_node_path69.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
7856
7868
|
parameters: commandToolSchemas.listCommands,
|
|
7857
7869
|
execute: async () => {
|
|
7858
7870
|
const commands = await listCommands();
|
|
@@ -7894,15 +7906,15 @@ var commandTools = {
|
|
|
7894
7906
|
};
|
|
7895
7907
|
|
|
7896
7908
|
// src/mcp/ignore.ts
|
|
7897
|
-
var
|
|
7909
|
+
var import_node_path70 = require("path");
|
|
7898
7910
|
var import_mini24 = require("zod/mini");
|
|
7899
7911
|
var maxIgnoreFileSizeBytes = 100 * 1024;
|
|
7900
7912
|
async function getIgnoreFile() {
|
|
7901
|
-
const ignoreFilePath = (0,
|
|
7913
|
+
const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
7902
7914
|
try {
|
|
7903
7915
|
const content = await readFileContent(ignoreFilePath);
|
|
7904
7916
|
return {
|
|
7905
|
-
relativePathFromCwd:
|
|
7917
|
+
relativePathFromCwd: RULESYNC_IGNORE_RELATIVE_FILE_PATH,
|
|
7906
7918
|
content
|
|
7907
7919
|
};
|
|
7908
7920
|
} catch (error) {
|
|
@@ -7912,7 +7924,7 @@ async function getIgnoreFile() {
|
|
|
7912
7924
|
}
|
|
7913
7925
|
}
|
|
7914
7926
|
async function putIgnoreFile({ content }) {
|
|
7915
|
-
const ignoreFilePath = (0,
|
|
7927
|
+
const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
7916
7928
|
const contentSizeBytes = Buffer.byteLength(content, "utf8");
|
|
7917
7929
|
if (contentSizeBytes > maxIgnoreFileSizeBytes) {
|
|
7918
7930
|
throw new Error(
|
|
@@ -7923,7 +7935,7 @@ async function putIgnoreFile({ content }) {
|
|
|
7923
7935
|
await ensureDir(process.cwd());
|
|
7924
7936
|
await writeFileContent(ignoreFilePath, content);
|
|
7925
7937
|
return {
|
|
7926
|
-
relativePathFromCwd:
|
|
7938
|
+
relativePathFromCwd: RULESYNC_IGNORE_RELATIVE_FILE_PATH,
|
|
7927
7939
|
content
|
|
7928
7940
|
};
|
|
7929
7941
|
} catch (error) {
|
|
@@ -7933,11 +7945,11 @@ async function putIgnoreFile({ content }) {
|
|
|
7933
7945
|
}
|
|
7934
7946
|
}
|
|
7935
7947
|
async function deleteIgnoreFile() {
|
|
7936
|
-
const ignoreFilePath = (0,
|
|
7948
|
+
const ignoreFilePath = (0, import_node_path70.join)(process.cwd(), RULESYNC_IGNORE_RELATIVE_FILE_PATH);
|
|
7937
7949
|
try {
|
|
7938
7950
|
await removeFile(ignoreFilePath);
|
|
7939
7951
|
return {
|
|
7940
|
-
relativePathFromCwd:
|
|
7952
|
+
relativePathFromCwd: RULESYNC_IGNORE_RELATIVE_FILE_PATH
|
|
7941
7953
|
};
|
|
7942
7954
|
} catch (error) {
|
|
7943
7955
|
throw new Error(`Failed to delete .rulesyncignore file: ${formatError(error)}`, {
|
|
@@ -7983,7 +7995,7 @@ var ignoreTools = {
|
|
|
7983
7995
|
};
|
|
7984
7996
|
|
|
7985
7997
|
// src/mcp/mcp.ts
|
|
7986
|
-
var
|
|
7998
|
+
var import_node_path71 = require("path");
|
|
7987
7999
|
var import_mini25 = require("zod/mini");
|
|
7988
8000
|
var maxMcpSizeBytes = 1024 * 1024;
|
|
7989
8001
|
async function getMcpFile() {
|
|
@@ -7992,7 +8004,7 @@ async function getMcpFile() {
|
|
|
7992
8004
|
validate: true,
|
|
7993
8005
|
modularMcp: false
|
|
7994
8006
|
});
|
|
7995
|
-
const relativePathFromCwd = (0,
|
|
8007
|
+
const relativePathFromCwd = (0, import_node_path71.join)(
|
|
7996
8008
|
rulesyncMcp.getRelativeDirPath(),
|
|
7997
8009
|
rulesyncMcp.getRelativeFilePath()
|
|
7998
8010
|
);
|
|
@@ -8024,7 +8036,7 @@ async function putMcpFile({ content }) {
|
|
|
8024
8036
|
const paths = RulesyncMcp.getSettablePaths();
|
|
8025
8037
|
const relativeDirPath = paths.recommended.relativeDirPath;
|
|
8026
8038
|
const relativeFilePath = paths.recommended.relativeFilePath;
|
|
8027
|
-
const fullPath = (0,
|
|
8039
|
+
const fullPath = (0, import_node_path71.join)(baseDir, relativeDirPath, relativeFilePath);
|
|
8028
8040
|
const rulesyncMcp = new RulesyncMcp({
|
|
8029
8041
|
baseDir,
|
|
8030
8042
|
relativeDirPath,
|
|
@@ -8033,9 +8045,9 @@ async function putMcpFile({ content }) {
|
|
|
8033
8045
|
validate: true,
|
|
8034
8046
|
modularMcp: false
|
|
8035
8047
|
});
|
|
8036
|
-
await ensureDir((0,
|
|
8048
|
+
await ensureDir((0, import_node_path71.join)(baseDir, relativeDirPath));
|
|
8037
8049
|
await writeFileContent(fullPath, content);
|
|
8038
|
-
const relativePathFromCwd = (0,
|
|
8050
|
+
const relativePathFromCwd = (0, import_node_path71.join)(relativeDirPath, relativeFilePath);
|
|
8039
8051
|
return {
|
|
8040
8052
|
relativePathFromCwd,
|
|
8041
8053
|
content: rulesyncMcp.getFileContent()
|
|
@@ -8050,15 +8062,15 @@ async function deleteMcpFile() {
|
|
|
8050
8062
|
try {
|
|
8051
8063
|
const baseDir = process.cwd();
|
|
8052
8064
|
const paths = RulesyncMcp.getSettablePaths();
|
|
8053
|
-
const recommendedPath = (0,
|
|
8065
|
+
const recommendedPath = (0, import_node_path71.join)(
|
|
8054
8066
|
baseDir,
|
|
8055
8067
|
paths.recommended.relativeDirPath,
|
|
8056
8068
|
paths.recommended.relativeFilePath
|
|
8057
8069
|
);
|
|
8058
|
-
const legacyPath = (0,
|
|
8070
|
+
const legacyPath = (0, import_node_path71.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
|
|
8059
8071
|
await removeFile(recommendedPath);
|
|
8060
8072
|
await removeFile(legacyPath);
|
|
8061
|
-
const relativePathFromCwd = (0,
|
|
8073
|
+
const relativePathFromCwd = (0, import_node_path71.join)(
|
|
8062
8074
|
paths.recommended.relativeDirPath,
|
|
8063
8075
|
paths.recommended.relativeFilePath
|
|
8064
8076
|
);
|
|
@@ -8081,7 +8093,7 @@ var mcpToolSchemas = {
|
|
|
8081
8093
|
var mcpTools = {
|
|
8082
8094
|
getMcpFile: {
|
|
8083
8095
|
name: "getMcpFile",
|
|
8084
|
-
description: `Get the MCP configuration file (${
|
|
8096
|
+
description: `Get the MCP configuration file (${RULESYNC_MCP_RELATIVE_FILE_PATH}).`,
|
|
8085
8097
|
parameters: mcpToolSchemas.getMcpFile,
|
|
8086
8098
|
execute: async () => {
|
|
8087
8099
|
const result = await getMcpFile();
|
|
@@ -8109,12 +8121,12 @@ var mcpTools = {
|
|
|
8109
8121
|
};
|
|
8110
8122
|
|
|
8111
8123
|
// src/mcp/rules.ts
|
|
8112
|
-
var
|
|
8124
|
+
var import_node_path72 = require("path");
|
|
8113
8125
|
var import_mini26 = require("zod/mini");
|
|
8114
8126
|
var maxRuleSizeBytes = 1024 * 1024;
|
|
8115
8127
|
var maxRulesCount = 1e3;
|
|
8116
8128
|
async function listRules() {
|
|
8117
|
-
const rulesDir = (0,
|
|
8129
|
+
const rulesDir = (0, import_node_path72.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
8118
8130
|
try {
|
|
8119
8131
|
const files = await listDirectoryFiles(rulesDir);
|
|
8120
8132
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -8127,7 +8139,7 @@ async function listRules() {
|
|
|
8127
8139
|
});
|
|
8128
8140
|
const frontmatter = rule.getFrontmatter();
|
|
8129
8141
|
return {
|
|
8130
|
-
relativePathFromCwd: (0,
|
|
8142
|
+
relativePathFromCwd: (0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, file),
|
|
8131
8143
|
frontmatter
|
|
8132
8144
|
};
|
|
8133
8145
|
} catch (error) {
|
|
@@ -8147,14 +8159,14 @@ async function getRule({ relativePathFromCwd }) {
|
|
|
8147
8159
|
relativePath: relativePathFromCwd,
|
|
8148
8160
|
intendedRootDir: process.cwd()
|
|
8149
8161
|
});
|
|
8150
|
-
const filename = (0,
|
|
8162
|
+
const filename = (0, import_node_path72.basename)(relativePathFromCwd);
|
|
8151
8163
|
try {
|
|
8152
8164
|
const rule = await RulesyncRule.fromFile({
|
|
8153
8165
|
relativeFilePath: filename,
|
|
8154
8166
|
validate: true
|
|
8155
8167
|
});
|
|
8156
8168
|
return {
|
|
8157
|
-
relativePathFromCwd: (0,
|
|
8169
|
+
relativePathFromCwd: (0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
8158
8170
|
frontmatter: rule.getFrontmatter(),
|
|
8159
8171
|
body: rule.getBody()
|
|
8160
8172
|
};
|
|
@@ -8173,7 +8185,7 @@ async function putRule({
|
|
|
8173
8185
|
relativePath: relativePathFromCwd,
|
|
8174
8186
|
intendedRootDir: process.cwd()
|
|
8175
8187
|
});
|
|
8176
|
-
const filename = (0,
|
|
8188
|
+
const filename = (0, import_node_path72.basename)(relativePathFromCwd);
|
|
8177
8189
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
8178
8190
|
if (estimatedSize > maxRuleSizeBytes) {
|
|
8179
8191
|
throw new Error(
|
|
@@ -8183,24 +8195,24 @@ async function putRule({
|
|
|
8183
8195
|
try {
|
|
8184
8196
|
const existingRules = await listRules();
|
|
8185
8197
|
const isUpdate = existingRules.some(
|
|
8186
|
-
(rule2) => rule2.relativePathFromCwd === (0,
|
|
8198
|
+
(rule2) => rule2.relativePathFromCwd === (0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
8187
8199
|
);
|
|
8188
8200
|
if (!isUpdate && existingRules.length >= maxRulesCount) {
|
|
8189
8201
|
throw new Error(`Maximum number of rules (${maxRulesCount}) reached`);
|
|
8190
8202
|
}
|
|
8191
8203
|
const rule = new RulesyncRule({
|
|
8192
8204
|
baseDir: process.cwd(),
|
|
8193
|
-
relativeDirPath:
|
|
8205
|
+
relativeDirPath: RULESYNC_RULES_RELATIVE_DIR_PATH,
|
|
8194
8206
|
relativeFilePath: filename,
|
|
8195
8207
|
frontmatter,
|
|
8196
8208
|
body,
|
|
8197
8209
|
validate: true
|
|
8198
8210
|
});
|
|
8199
|
-
const rulesDir = (0,
|
|
8211
|
+
const rulesDir = (0, import_node_path72.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
|
|
8200
8212
|
await ensureDir(rulesDir);
|
|
8201
8213
|
await writeFileContent(rule.getFilePath(), rule.getFileContent());
|
|
8202
8214
|
return {
|
|
8203
|
-
relativePathFromCwd: (0,
|
|
8215
|
+
relativePathFromCwd: (0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename),
|
|
8204
8216
|
frontmatter: rule.getFrontmatter(),
|
|
8205
8217
|
body: rule.getBody()
|
|
8206
8218
|
};
|
|
@@ -8215,12 +8227,12 @@ async function deleteRule({ relativePathFromCwd }) {
|
|
|
8215
8227
|
relativePath: relativePathFromCwd,
|
|
8216
8228
|
intendedRootDir: process.cwd()
|
|
8217
8229
|
});
|
|
8218
|
-
const filename = (0,
|
|
8219
|
-
const fullPath = (0,
|
|
8230
|
+
const filename = (0, import_node_path72.basename)(relativePathFromCwd);
|
|
8231
|
+
const fullPath = (0, import_node_path72.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH, filename);
|
|
8220
8232
|
try {
|
|
8221
8233
|
await removeFile(fullPath);
|
|
8222
8234
|
return {
|
|
8223
|
-
relativePathFromCwd: (0,
|
|
8235
|
+
relativePathFromCwd: (0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, filename)
|
|
8224
8236
|
};
|
|
8225
8237
|
} catch (error) {
|
|
8226
8238
|
throw new Error(`Failed to delete rule file ${relativePathFromCwd}: ${formatError(error)}`, {
|
|
@@ -8245,7 +8257,7 @@ var ruleToolSchemas = {
|
|
|
8245
8257
|
var ruleTools = {
|
|
8246
8258
|
listRules: {
|
|
8247
8259
|
name: "listRules",
|
|
8248
|
-
description: `List all rules from ${(0,
|
|
8260
|
+
description: `List all rules from ${(0, import_node_path72.join)(RULESYNC_RULES_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
8249
8261
|
parameters: ruleToolSchemas.listRules,
|
|
8250
8262
|
execute: async () => {
|
|
8251
8263
|
const rules = await listRules();
|
|
@@ -8287,12 +8299,12 @@ var ruleTools = {
|
|
|
8287
8299
|
};
|
|
8288
8300
|
|
|
8289
8301
|
// src/mcp/subagents.ts
|
|
8290
|
-
var
|
|
8302
|
+
var import_node_path73 = require("path");
|
|
8291
8303
|
var import_mini27 = require("zod/mini");
|
|
8292
8304
|
var maxSubagentSizeBytes = 1024 * 1024;
|
|
8293
8305
|
var maxSubagentsCount = 1e3;
|
|
8294
8306
|
async function listSubagents() {
|
|
8295
|
-
const subagentsDir = (0,
|
|
8307
|
+
const subagentsDir = (0, import_node_path73.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
8296
8308
|
try {
|
|
8297
8309
|
const files = await listDirectoryFiles(subagentsDir);
|
|
8298
8310
|
const mdFiles = files.filter((file) => file.endsWith(".md"));
|
|
@@ -8305,7 +8317,7 @@ async function listSubagents() {
|
|
|
8305
8317
|
});
|
|
8306
8318
|
const frontmatter = subagent.getFrontmatter();
|
|
8307
8319
|
return {
|
|
8308
|
-
relativePathFromCwd: (0,
|
|
8320
|
+
relativePathFromCwd: (0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, file),
|
|
8309
8321
|
frontmatter
|
|
8310
8322
|
};
|
|
8311
8323
|
} catch (error) {
|
|
@@ -8327,14 +8339,14 @@ async function getSubagent({ relativePathFromCwd }) {
|
|
|
8327
8339
|
relativePath: relativePathFromCwd,
|
|
8328
8340
|
intendedRootDir: process.cwd()
|
|
8329
8341
|
});
|
|
8330
|
-
const filename = (0,
|
|
8342
|
+
const filename = (0, import_node_path73.basename)(relativePathFromCwd);
|
|
8331
8343
|
try {
|
|
8332
8344
|
const subagent = await RulesyncSubagent.fromFile({
|
|
8333
8345
|
relativeFilePath: filename,
|
|
8334
8346
|
validate: true
|
|
8335
8347
|
});
|
|
8336
8348
|
return {
|
|
8337
|
-
relativePathFromCwd: (0,
|
|
8349
|
+
relativePathFromCwd: (0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
8338
8350
|
frontmatter: subagent.getFrontmatter(),
|
|
8339
8351
|
body: subagent.getBody()
|
|
8340
8352
|
};
|
|
@@ -8353,7 +8365,7 @@ async function putSubagent({
|
|
|
8353
8365
|
relativePath: relativePathFromCwd,
|
|
8354
8366
|
intendedRootDir: process.cwd()
|
|
8355
8367
|
});
|
|
8356
|
-
const filename = (0,
|
|
8368
|
+
const filename = (0, import_node_path73.basename)(relativePathFromCwd);
|
|
8357
8369
|
const estimatedSize = JSON.stringify(frontmatter).length + body.length;
|
|
8358
8370
|
if (estimatedSize > maxSubagentSizeBytes) {
|
|
8359
8371
|
throw new Error(
|
|
@@ -8363,24 +8375,24 @@ async function putSubagent({
|
|
|
8363
8375
|
try {
|
|
8364
8376
|
const existingSubagents = await listSubagents();
|
|
8365
8377
|
const isUpdate = existingSubagents.some(
|
|
8366
|
-
(subagent2) => subagent2.relativePathFromCwd === (0,
|
|
8378
|
+
(subagent2) => subagent2.relativePathFromCwd === (0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
8367
8379
|
);
|
|
8368
8380
|
if (!isUpdate && existingSubagents.length >= maxSubagentsCount) {
|
|
8369
8381
|
throw new Error(`Maximum number of subagents (${maxSubagentsCount}) reached`);
|
|
8370
8382
|
}
|
|
8371
8383
|
const subagent = new RulesyncSubagent({
|
|
8372
8384
|
baseDir: process.cwd(),
|
|
8373
|
-
relativeDirPath:
|
|
8385
|
+
relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
|
|
8374
8386
|
relativeFilePath: filename,
|
|
8375
8387
|
frontmatter,
|
|
8376
8388
|
body,
|
|
8377
8389
|
validate: true
|
|
8378
8390
|
});
|
|
8379
|
-
const subagentsDir = (0,
|
|
8391
|
+
const subagentsDir = (0, import_node_path73.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH);
|
|
8380
8392
|
await ensureDir(subagentsDir);
|
|
8381
8393
|
await writeFileContent(subagent.getFilePath(), subagent.getFileContent());
|
|
8382
8394
|
return {
|
|
8383
|
-
relativePathFromCwd: (0,
|
|
8395
|
+
relativePathFromCwd: (0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename),
|
|
8384
8396
|
frontmatter: subagent.getFrontmatter(),
|
|
8385
8397
|
body: subagent.getBody()
|
|
8386
8398
|
};
|
|
@@ -8395,12 +8407,12 @@ async function deleteSubagent({ relativePathFromCwd }) {
|
|
|
8395
8407
|
relativePath: relativePathFromCwd,
|
|
8396
8408
|
intendedRootDir: process.cwd()
|
|
8397
8409
|
});
|
|
8398
|
-
const filename = (0,
|
|
8399
|
-
const fullPath = (0,
|
|
8410
|
+
const filename = (0, import_node_path73.basename)(relativePathFromCwd);
|
|
8411
|
+
const fullPath = (0, import_node_path73.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename);
|
|
8400
8412
|
try {
|
|
8401
8413
|
await removeFile(fullPath);
|
|
8402
8414
|
return {
|
|
8403
|
-
relativePathFromCwd: (0,
|
|
8415
|
+
relativePathFromCwd: (0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, filename)
|
|
8404
8416
|
};
|
|
8405
8417
|
} catch (error) {
|
|
8406
8418
|
throw new Error(
|
|
@@ -8428,7 +8440,7 @@ var subagentToolSchemas = {
|
|
|
8428
8440
|
var subagentTools = {
|
|
8429
8441
|
listSubagents: {
|
|
8430
8442
|
name: "listSubagents",
|
|
8431
|
-
description: `List all subagents from ${(0,
|
|
8443
|
+
description: `List all subagents from ${(0, import_node_path73.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "*.md")} with their frontmatter.`,
|
|
8432
8444
|
parameters: subagentToolSchemas.listSubagents,
|
|
8433
8445
|
execute: async () => {
|
|
8434
8446
|
const subagents = await listSubagents();
|
|
@@ -8502,7 +8514,7 @@ async function mcpCommand({ version }) {
|
|
|
8502
8514
|
}
|
|
8503
8515
|
|
|
8504
8516
|
// src/cli/index.ts
|
|
8505
|
-
var getVersion = () => "3.
|
|
8517
|
+
var getVersion = () => "3.21.0";
|
|
8506
8518
|
var main = async () => {
|
|
8507
8519
|
const program = new import_commander.Command();
|
|
8508
8520
|
const version = getVersion();
|