rulesync 3.4.3 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +253 -198
- package/dist/index.js +253 -198
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -96,7 +96,7 @@ var import_es_toolkit2 = require("es-toolkit");
|
|
|
96
96
|
|
|
97
97
|
// src/commands/commands-processor.ts
|
|
98
98
|
var import_node_path12 = require("path");
|
|
99
|
-
var
|
|
99
|
+
var import_mini9 = require("zod/mini");
|
|
100
100
|
|
|
101
101
|
// src/utils/file.ts
|
|
102
102
|
var import_node_fs = require("fs");
|
|
@@ -714,12 +714,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
714
714
|
this.frontmatter = frontmatter;
|
|
715
715
|
this.body = body;
|
|
716
716
|
}
|
|
717
|
-
static getSettablePaths() {
|
|
718
|
-
return {
|
|
719
|
-
relativeDirPath: ".claude/commands"
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
static getSettablePathsGlobal() {
|
|
717
|
+
static getSettablePaths(_options = {}) {
|
|
723
718
|
return {
|
|
724
719
|
relativeDirPath: (0, import_node_path6.join)(".claude", "commands")
|
|
725
720
|
};
|
|
@@ -758,7 +753,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
758
753
|
description: rulesyncFrontmatter.description
|
|
759
754
|
};
|
|
760
755
|
const body = rulesyncCommand.getBody();
|
|
761
|
-
const paths =
|
|
756
|
+
const paths = this.getSettablePaths({ global });
|
|
762
757
|
return new _ClaudecodeCommand({
|
|
763
758
|
baseDir,
|
|
764
759
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -796,7 +791,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
796
791
|
validate = true,
|
|
797
792
|
global = false
|
|
798
793
|
}) {
|
|
799
|
-
const paths =
|
|
794
|
+
const paths = this.getSettablePaths({ global });
|
|
800
795
|
const filePath = (0, import_node_path6.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
801
796
|
const fileContent = await readFileContent(filePath);
|
|
802
797
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -818,10 +813,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
818
813
|
// src/commands/codexcli-command.ts
|
|
819
814
|
var import_node_path7 = require("path");
|
|
820
815
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
821
|
-
static getSettablePaths() {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
816
|
+
static getSettablePaths({ global } = {}) {
|
|
817
|
+
if (!global) {
|
|
818
|
+
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
819
|
+
}
|
|
825
820
|
return {
|
|
826
821
|
relativeDirPath: (0, import_node_path7.join)(".codex", "prompts")
|
|
827
822
|
};
|
|
@@ -848,7 +843,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
848
843
|
validate = true,
|
|
849
844
|
global = false
|
|
850
845
|
}) {
|
|
851
|
-
const paths =
|
|
846
|
+
const paths = this.getSettablePaths({ global });
|
|
852
847
|
return new _CodexcliCommand({
|
|
853
848
|
baseDir,
|
|
854
849
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -875,7 +870,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
875
870
|
validate = true,
|
|
876
871
|
global = false
|
|
877
872
|
}) {
|
|
878
|
-
const paths =
|
|
873
|
+
const paths = this.getSettablePaths({ global });
|
|
879
874
|
const filePath = (0, import_node_path7.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
880
875
|
const fileContent = await readFileContent(filePath);
|
|
881
876
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -891,40 +886,111 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
891
886
|
|
|
892
887
|
// src/commands/copilot-command.ts
|
|
893
888
|
var import_node_path8 = require("path");
|
|
894
|
-
var
|
|
889
|
+
var import_mini6 = require("zod/mini");
|
|
890
|
+
var CopilotCommandFrontmatterSchema = import_mini6.z.object({
|
|
891
|
+
mode: import_mini6.z.literal("agent"),
|
|
892
|
+
description: import_mini6.z.string()
|
|
893
|
+
});
|
|
894
|
+
var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
895
|
+
frontmatter;
|
|
896
|
+
body;
|
|
897
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
898
|
+
if (rest.validate) {
|
|
899
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
900
|
+
if (!result.success) {
|
|
901
|
+
throw new Error(
|
|
902
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
903
|
+
);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
super({
|
|
907
|
+
...rest,
|
|
908
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
909
|
+
});
|
|
910
|
+
this.frontmatter = frontmatter;
|
|
911
|
+
this.body = body;
|
|
912
|
+
}
|
|
895
913
|
static getSettablePaths() {
|
|
896
914
|
return {
|
|
897
|
-
relativeDirPath: ".github
|
|
915
|
+
relativeDirPath: (0, import_node_path8.join)(".github", "prompts")
|
|
898
916
|
};
|
|
899
917
|
}
|
|
918
|
+
getBody() {
|
|
919
|
+
return this.body;
|
|
920
|
+
}
|
|
921
|
+
getFrontmatter() {
|
|
922
|
+
return this.frontmatter;
|
|
923
|
+
}
|
|
924
|
+
toRulesyncCommand() {
|
|
925
|
+
const rulesyncFrontmatter = {
|
|
926
|
+
targets: ["*"],
|
|
927
|
+
description: this.frontmatter.description
|
|
928
|
+
};
|
|
929
|
+
return new RulesyncCommand({
|
|
930
|
+
baseDir: ".",
|
|
931
|
+
frontmatter: rulesyncFrontmatter,
|
|
932
|
+
body: this.body,
|
|
933
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
934
|
+
relativeFilePath: this.relativeFilePath,
|
|
935
|
+
fileContent: this.getFileContent(),
|
|
936
|
+
validate: true
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
validate() {
|
|
940
|
+
if (!this.frontmatter) {
|
|
941
|
+
return { success: true, error: null };
|
|
942
|
+
}
|
|
943
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
944
|
+
if (result.success) {
|
|
945
|
+
return { success: true, error: null };
|
|
946
|
+
} else {
|
|
947
|
+
return {
|
|
948
|
+
success: false,
|
|
949
|
+
error: new Error(
|
|
950
|
+
`Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
951
|
+
)
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
}
|
|
900
955
|
static fromRulesyncCommand({
|
|
901
956
|
baseDir = ".",
|
|
902
957
|
rulesyncCommand,
|
|
903
958
|
validate = true
|
|
904
959
|
}) {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
960
|
+
const paths = this.getSettablePaths();
|
|
961
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
962
|
+
const copilotFrontmatter = {
|
|
963
|
+
mode: "agent",
|
|
964
|
+
description: rulesyncFrontmatter.description
|
|
965
|
+
};
|
|
966
|
+
const body = rulesyncCommand.getBody();
|
|
967
|
+
const originalFilePath = rulesyncCommand.getRelativeFilePath();
|
|
968
|
+
const relativeFilePath = originalFilePath.replace(/\.md$/, ".prompt.md");
|
|
969
|
+
return new _CopilotCommand({
|
|
970
|
+
baseDir,
|
|
971
|
+
frontmatter: copilotFrontmatter,
|
|
972
|
+
body,
|
|
973
|
+
relativeDirPath: paths.relativeDirPath,
|
|
974
|
+
relativeFilePath,
|
|
975
|
+
validate
|
|
976
|
+
});
|
|
908
977
|
}
|
|
909
978
|
static async fromFile({
|
|
910
979
|
baseDir = ".",
|
|
911
980
|
relativeFilePath,
|
|
912
981
|
validate = true
|
|
913
982
|
}) {
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
_CopilotCommand.getSettablePaths().relativeDirPath,
|
|
917
|
-
relativeFilePath
|
|
918
|
-
);
|
|
983
|
+
const paths = this.getSettablePaths();
|
|
984
|
+
const filePath = (0, import_node_path8.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
919
985
|
const fileContent = await readFileContent(filePath);
|
|
920
986
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
921
|
-
const result =
|
|
987
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
922
988
|
if (!result.success) {
|
|
923
989
|
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
924
990
|
}
|
|
925
991
|
return new _CopilotCommand({
|
|
926
992
|
baseDir,
|
|
927
|
-
relativeDirPath:
|
|
993
|
+
relativeDirPath: paths.relativeDirPath,
|
|
928
994
|
relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
|
|
929
995
|
frontmatter: result.data,
|
|
930
996
|
body: content.trim(),
|
|
@@ -942,12 +1008,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
942
1008
|
// src/commands/cursor-command.ts
|
|
943
1009
|
var import_node_path9 = require("path");
|
|
944
1010
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
945
|
-
static getSettablePaths() {
|
|
946
|
-
return {
|
|
947
|
-
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
static getSettablePathsGlobal() {
|
|
1011
|
+
static getSettablePaths(_options = {}) {
|
|
951
1012
|
return {
|
|
952
1013
|
relativeDirPath: (0, import_node_path9.join)(".cursor", "commands")
|
|
953
1014
|
};
|
|
@@ -974,7 +1035,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
974
1035
|
validate = true,
|
|
975
1036
|
global = false
|
|
976
1037
|
}) {
|
|
977
|
-
const paths =
|
|
1038
|
+
const paths = this.getSettablePaths({ global });
|
|
978
1039
|
return new _CursorCommand({
|
|
979
1040
|
baseDir,
|
|
980
1041
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -1001,7 +1062,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1001
1062
|
validate = true,
|
|
1002
1063
|
global = false
|
|
1003
1064
|
}) {
|
|
1004
|
-
const paths =
|
|
1065
|
+
const paths = this.getSettablePaths({ global });
|
|
1005
1066
|
const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1006
1067
|
const fileContent = await readFileContent(filePath);
|
|
1007
1068
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -1018,10 +1079,10 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
1018
1079
|
// src/commands/geminicli-command.ts
|
|
1019
1080
|
var import_node_path10 = require("path");
|
|
1020
1081
|
var import_smol_toml = require("smol-toml");
|
|
1021
|
-
var
|
|
1022
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1023
|
-
description:
|
|
1024
|
-
prompt:
|
|
1082
|
+
var import_mini7 = require("zod/mini");
|
|
1083
|
+
var GeminiCliCommandFrontmatterSchema = import_mini7.z.object({
|
|
1084
|
+
description: import_mini7.z.optional(import_mini7.z.string()),
|
|
1085
|
+
prompt: import_mini7.z.string()
|
|
1025
1086
|
});
|
|
1026
1087
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1027
1088
|
frontmatter;
|
|
@@ -1032,12 +1093,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1032
1093
|
this.frontmatter = parsed;
|
|
1033
1094
|
this.body = parsed.prompt;
|
|
1034
1095
|
}
|
|
1035
|
-
static getSettablePaths() {
|
|
1036
|
-
return {
|
|
1037
|
-
relativeDirPath: ".gemini/commands"
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
static getSettablePathsGlobal() {
|
|
1096
|
+
static getSettablePaths(_options = {}) {
|
|
1041
1097
|
return {
|
|
1042
1098
|
relativeDirPath: (0, import_node_path10.join)(".gemini", "commands")
|
|
1043
1099
|
};
|
|
@@ -1098,7 +1154,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1098
1154
|
prompt = """
|
|
1099
1155
|
${geminiFrontmatter.prompt}
|
|
1100
1156
|
"""`;
|
|
1101
|
-
const paths =
|
|
1157
|
+
const paths = this.getSettablePaths({ global });
|
|
1102
1158
|
return new _GeminiCliCommand({
|
|
1103
1159
|
baseDir,
|
|
1104
1160
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1113,7 +1169,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1113
1169
|
validate = true,
|
|
1114
1170
|
global = false
|
|
1115
1171
|
}) {
|
|
1116
|
-
const paths =
|
|
1172
|
+
const paths = this.getSettablePaths({ global });
|
|
1117
1173
|
const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1118
1174
|
const fileContent = await readFileContent(filePath);
|
|
1119
1175
|
return new _GeminiCliCommand({
|
|
@@ -1142,10 +1198,10 @@ ${geminiFrontmatter.prompt}
|
|
|
1142
1198
|
|
|
1143
1199
|
// src/commands/roo-command.ts
|
|
1144
1200
|
var import_node_path11 = require("path");
|
|
1145
|
-
var
|
|
1146
|
-
var RooCommandFrontmatterSchema =
|
|
1147
|
-
description:
|
|
1148
|
-
"argument-hint": (0,
|
|
1201
|
+
var import_mini8 = require("zod/mini");
|
|
1202
|
+
var RooCommandFrontmatterSchema = import_mini8.z.object({
|
|
1203
|
+
description: import_mini8.z.string(),
|
|
1204
|
+
"argument-hint": (0, import_mini8.optional)(import_mini8.z.string())
|
|
1149
1205
|
});
|
|
1150
1206
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
1151
1207
|
frontmatter;
|
|
@@ -1270,11 +1326,11 @@ var commandsProcessorToolTargets = [
|
|
|
1270
1326
|
"copilot",
|
|
1271
1327
|
"cursor"
|
|
1272
1328
|
];
|
|
1273
|
-
var CommandsProcessorToolTargetSchema =
|
|
1329
|
+
var CommandsProcessorToolTargetSchema = import_mini9.z.enum(
|
|
1274
1330
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
1275
1331
|
commandsProcessorToolTargets.concat("codexcli")
|
|
1276
1332
|
);
|
|
1277
|
-
var commandsProcessorToolTargetsSimulated = ["agentsmd"
|
|
1333
|
+
var commandsProcessorToolTargetsSimulated = ["agentsmd"];
|
|
1278
1334
|
var commandsProcessorToolTargetsGlobal = [
|
|
1279
1335
|
"claudecode",
|
|
1280
1336
|
"cursor",
|
|
@@ -1494,20 +1550,20 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1494
1550
|
});
|
|
1495
1551
|
}
|
|
1496
1552
|
/**
|
|
1497
|
-
* Load Copilot command configurations from .github/
|
|
1553
|
+
* Load Copilot command configurations from .github/prompts/ directory
|
|
1498
1554
|
*/
|
|
1499
1555
|
async loadCopilotCommands() {
|
|
1500
1556
|
return await this.loadToolCommandDefault({
|
|
1501
1557
|
toolTarget: "copilot",
|
|
1502
1558
|
relativeDirPath: CopilotCommand.getSettablePaths().relativeDirPath,
|
|
1503
|
-
extension: "md"
|
|
1559
|
+
extension: "prompt.md"
|
|
1504
1560
|
});
|
|
1505
1561
|
}
|
|
1506
1562
|
/**
|
|
1507
1563
|
* Load Claude Code command configurations from .claude/commands/ directory
|
|
1508
1564
|
*/
|
|
1509
1565
|
async loadClaudecodeCommands() {
|
|
1510
|
-
const paths =
|
|
1566
|
+
const paths = ClaudecodeCommand.getSettablePaths({ global: this.global });
|
|
1511
1567
|
return await this.loadToolCommandDefault({
|
|
1512
1568
|
toolTarget: "claudecode",
|
|
1513
1569
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1518,7 +1574,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1518
1574
|
* Load Cursor command configurations from .cursor/commands/ directory
|
|
1519
1575
|
*/
|
|
1520
1576
|
async loadCursorCommands() {
|
|
1521
|
-
const paths =
|
|
1577
|
+
const paths = CursorCommand.getSettablePaths({ global: this.global });
|
|
1522
1578
|
return await this.loadToolCommandDefault({
|
|
1523
1579
|
toolTarget: "cursor",
|
|
1524
1580
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1529,7 +1585,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1529
1585
|
* Load Gemini CLI command configurations from .gemini/commands/ directory
|
|
1530
1586
|
*/
|
|
1531
1587
|
async loadGeminicliCommands() {
|
|
1532
|
-
const paths =
|
|
1588
|
+
const paths = GeminiCliCommand.getSettablePaths({ global: this.global });
|
|
1533
1589
|
return await this.loadToolCommandDefault({
|
|
1534
1590
|
toolTarget: "geminicli",
|
|
1535
1591
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1540,7 +1596,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1540
1596
|
* Load Codex CLI command configurations from .codex/prompts/ directory
|
|
1541
1597
|
*/
|
|
1542
1598
|
async loadCodexcliCommands() {
|
|
1543
|
-
const paths =
|
|
1599
|
+
const paths = CodexcliCommand.getSettablePaths({ global: this.global });
|
|
1544
1600
|
return await this.loadToolCommandDefault({
|
|
1545
1601
|
toolTarget: "codexcli",
|
|
1546
1602
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1728,7 +1784,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
1728
1784
|
}
|
|
1729
1785
|
|
|
1730
1786
|
// src/ignore/ignore-processor.ts
|
|
1731
|
-
var
|
|
1787
|
+
var import_mini10 = require("zod/mini");
|
|
1732
1788
|
|
|
1733
1789
|
// src/ignore/amazonqcli-ignore.ts
|
|
1734
1790
|
var import_node_path14 = require("path");
|
|
@@ -2373,7 +2429,7 @@ var ignoreProcessorToolTargets = [
|
|
|
2373
2429
|
"roo",
|
|
2374
2430
|
"windsurf"
|
|
2375
2431
|
];
|
|
2376
|
-
var IgnoreProcessorToolTargetSchema =
|
|
2432
|
+
var IgnoreProcessorToolTargetSchema = import_mini10.z.enum(ignoreProcessorToolTargets);
|
|
2377
2433
|
var IgnoreProcessor = class extends FeatureProcessor {
|
|
2378
2434
|
toolTarget;
|
|
2379
2435
|
constructor({
|
|
@@ -2548,39 +2604,39 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2548
2604
|
};
|
|
2549
2605
|
|
|
2550
2606
|
// src/mcp/mcp-processor.ts
|
|
2551
|
-
var
|
|
2607
|
+
var import_mini12 = require("zod/mini");
|
|
2552
2608
|
|
|
2553
2609
|
// src/mcp/amazonqcli-mcp.ts
|
|
2554
2610
|
var import_node_path26 = require("path");
|
|
2555
2611
|
|
|
2556
2612
|
// src/mcp/rulesync-mcp.ts
|
|
2557
2613
|
var import_node_path25 = require("path");
|
|
2558
|
-
var
|
|
2559
|
-
var McpTransportTypeSchema =
|
|
2560
|
-
var McpServerBaseSchema =
|
|
2561
|
-
type:
|
|
2562
|
-
command:
|
|
2563
|
-
args:
|
|
2564
|
-
url:
|
|
2565
|
-
httpUrl:
|
|
2566
|
-
env:
|
|
2567
|
-
disabled:
|
|
2568
|
-
networkTimeout:
|
|
2569
|
-
timeout:
|
|
2570
|
-
trust:
|
|
2571
|
-
cwd:
|
|
2572
|
-
transport:
|
|
2573
|
-
alwaysAllow:
|
|
2574
|
-
tools:
|
|
2575
|
-
kiroAutoApprove:
|
|
2576
|
-
kiroAutoBlock:
|
|
2577
|
-
headers:
|
|
2614
|
+
var import_mini11 = require("zod/mini");
|
|
2615
|
+
var McpTransportTypeSchema = import_mini11.z.enum(["stdio", "sse", "http"]);
|
|
2616
|
+
var McpServerBaseSchema = import_mini11.z.object({
|
|
2617
|
+
type: import_mini11.z.optional(import_mini11.z.enum(["stdio", "sse", "http"])),
|
|
2618
|
+
command: import_mini11.z.optional(import_mini11.z.union([import_mini11.z.string(), import_mini11.z.array(import_mini11.z.string())])),
|
|
2619
|
+
args: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
|
|
2620
|
+
url: import_mini11.z.optional(import_mini11.z.string()),
|
|
2621
|
+
httpUrl: import_mini11.z.optional(import_mini11.z.string()),
|
|
2622
|
+
env: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string())),
|
|
2623
|
+
disabled: import_mini11.z.optional(import_mini11.z.boolean()),
|
|
2624
|
+
networkTimeout: import_mini11.z.optional(import_mini11.z.number()),
|
|
2625
|
+
timeout: import_mini11.z.optional(import_mini11.z.number()),
|
|
2626
|
+
trust: import_mini11.z.optional(import_mini11.z.boolean()),
|
|
2627
|
+
cwd: import_mini11.z.optional(import_mini11.z.string()),
|
|
2628
|
+
transport: import_mini11.z.optional(McpTransportTypeSchema),
|
|
2629
|
+
alwaysAllow: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
|
|
2630
|
+
tools: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
|
|
2631
|
+
kiroAutoApprove: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
|
|
2632
|
+
kiroAutoBlock: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
|
|
2633
|
+
headers: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string()))
|
|
2578
2634
|
});
|
|
2579
|
-
var RulesyncMcpServersSchema =
|
|
2580
|
-
targets:
|
|
2635
|
+
var RulesyncMcpServersSchema = import_mini11.z.extend(McpServerBaseSchema, {
|
|
2636
|
+
targets: import_mini11.z.optional(RulesyncTargetsSchema)
|
|
2581
2637
|
});
|
|
2582
|
-
var RulesyncMcpConfigSchema =
|
|
2583
|
-
mcpServers:
|
|
2638
|
+
var RulesyncMcpConfigSchema = import_mini11.z.object({
|
|
2639
|
+
mcpServers: import_mini11.z.record(import_mini11.z.string(), RulesyncMcpServersSchema)
|
|
2584
2640
|
});
|
|
2585
2641
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2586
2642
|
json;
|
|
@@ -2726,24 +2782,24 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2726
2782
|
getJson() {
|
|
2727
2783
|
return this.json;
|
|
2728
2784
|
}
|
|
2729
|
-
static getSettablePaths() {
|
|
2785
|
+
static getSettablePaths({ global } = {}) {
|
|
2786
|
+
if (global) {
|
|
2787
|
+
return {
|
|
2788
|
+
relativeDirPath: ".claude",
|
|
2789
|
+
relativeFilePath: ".claude.json"
|
|
2790
|
+
};
|
|
2791
|
+
}
|
|
2730
2792
|
return {
|
|
2731
2793
|
relativeDirPath: ".",
|
|
2732
2794
|
relativeFilePath: ".mcp.json"
|
|
2733
2795
|
};
|
|
2734
2796
|
}
|
|
2735
|
-
static getSettablePathsGlobal() {
|
|
2736
|
-
return {
|
|
2737
|
-
relativeDirPath: ".claude",
|
|
2738
|
-
relativeFilePath: ".claude.json"
|
|
2739
|
-
};
|
|
2740
|
-
}
|
|
2741
2797
|
static async fromFile({
|
|
2742
2798
|
baseDir = ".",
|
|
2743
2799
|
validate = true,
|
|
2744
2800
|
global = false
|
|
2745
2801
|
}) {
|
|
2746
|
-
const paths =
|
|
2802
|
+
const paths = this.getSettablePaths({ global });
|
|
2747
2803
|
const fileContent = await readOrInitializeFileContent(
|
|
2748
2804
|
(0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2749
2805
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2764,7 +2820,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2764
2820
|
validate = true,
|
|
2765
2821
|
global = false
|
|
2766
2822
|
}) {
|
|
2767
|
-
const paths =
|
|
2823
|
+
const paths = this.getSettablePaths({ global });
|
|
2768
2824
|
const fileContent = await readOrInitializeFileContent(
|
|
2769
2825
|
(0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2770
2826
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2867,10 +2923,10 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2867
2923
|
getToml() {
|
|
2868
2924
|
return this.toml;
|
|
2869
2925
|
}
|
|
2870
|
-
static getSettablePaths() {
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2926
|
+
static getSettablePaths({ global } = {}) {
|
|
2927
|
+
if (!global) {
|
|
2928
|
+
throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
|
|
2929
|
+
}
|
|
2874
2930
|
return {
|
|
2875
2931
|
relativeDirPath: ".codex",
|
|
2876
2932
|
relativeFilePath: "config.toml"
|
|
@@ -2881,7 +2937,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2881
2937
|
validate = true,
|
|
2882
2938
|
global = false
|
|
2883
2939
|
}) {
|
|
2884
|
-
const paths =
|
|
2940
|
+
const paths = this.getSettablePaths({ global });
|
|
2885
2941
|
const fileContent = await readFileContent(
|
|
2886
2942
|
(0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
2887
2943
|
);
|
|
@@ -2899,7 +2955,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2899
2955
|
validate = true,
|
|
2900
2956
|
global = false
|
|
2901
2957
|
}) {
|
|
2902
|
-
const paths =
|
|
2958
|
+
const paths = this.getSettablePaths({ global });
|
|
2903
2959
|
const configTomlFilePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2904
2960
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
2905
2961
|
configTomlFilePath,
|
|
@@ -3132,7 +3188,7 @@ var mcpProcessorToolTargets = [
|
|
|
3132
3188
|
"cursor",
|
|
3133
3189
|
"roo"
|
|
3134
3190
|
];
|
|
3135
|
-
var McpProcessorToolTargetSchema =
|
|
3191
|
+
var McpProcessorToolTargetSchema = import_mini12.z.enum(
|
|
3136
3192
|
// codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
|
|
3137
3193
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3138
3194
|
);
|
|
@@ -3336,11 +3392,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3336
3392
|
// src/rules/rules-processor.ts
|
|
3337
3393
|
var import_node_path56 = require("path");
|
|
3338
3394
|
var import_fast_xml_parser = require("fast-xml-parser");
|
|
3339
|
-
var
|
|
3395
|
+
var import_mini21 = require("zod/mini");
|
|
3340
3396
|
|
|
3341
3397
|
// src/subagents/simulated-subagent.ts
|
|
3342
3398
|
var import_node_path33 = require("path");
|
|
3343
|
-
var
|
|
3399
|
+
var import_mini13 = require("zod/mini");
|
|
3344
3400
|
|
|
3345
3401
|
// src/subagents/tool-subagent.ts
|
|
3346
3402
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -3375,9 +3431,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
3375
3431
|
};
|
|
3376
3432
|
|
|
3377
3433
|
// src/subagents/simulated-subagent.ts
|
|
3378
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
3379
|
-
name:
|
|
3380
|
-
description:
|
|
3434
|
+
var SimulatedSubagentFrontmatterSchema = import_mini13.z.object({
|
|
3435
|
+
name: import_mini13.z.string(),
|
|
3436
|
+
description: import_mini13.z.string()
|
|
3381
3437
|
});
|
|
3382
3438
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
3383
3439
|
frontmatter;
|
|
@@ -3606,22 +3662,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3606
3662
|
|
|
3607
3663
|
// src/subagents/subagents-processor.ts
|
|
3608
3664
|
var import_node_path36 = require("path");
|
|
3609
|
-
var
|
|
3665
|
+
var import_mini16 = require("zod/mini");
|
|
3610
3666
|
|
|
3611
3667
|
// src/subagents/claudecode-subagent.ts
|
|
3612
3668
|
var import_node_path35 = require("path");
|
|
3613
|
-
var
|
|
3669
|
+
var import_mini15 = require("zod/mini");
|
|
3614
3670
|
|
|
3615
3671
|
// src/subagents/rulesync-subagent.ts
|
|
3616
3672
|
var import_node_path34 = require("path");
|
|
3617
|
-
var
|
|
3618
|
-
var RulesyncSubagentModelSchema =
|
|
3619
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
3673
|
+
var import_mini14 = require("zod/mini");
|
|
3674
|
+
var RulesyncSubagentModelSchema = import_mini14.z.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3675
|
+
var RulesyncSubagentFrontmatterSchema = import_mini14.z.object({
|
|
3620
3676
|
targets: RulesyncTargetsSchema,
|
|
3621
|
-
name:
|
|
3622
|
-
description:
|
|
3623
|
-
claudecode:
|
|
3624
|
-
|
|
3677
|
+
name: import_mini14.z.string(),
|
|
3678
|
+
description: import_mini14.z.string(),
|
|
3679
|
+
claudecode: import_mini14.z.optional(
|
|
3680
|
+
import_mini14.z.object({
|
|
3625
3681
|
model: RulesyncSubagentModelSchema
|
|
3626
3682
|
})
|
|
3627
3683
|
)
|
|
@@ -3693,10 +3749,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3693
3749
|
};
|
|
3694
3750
|
|
|
3695
3751
|
// src/subagents/claudecode-subagent.ts
|
|
3696
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
3697
|
-
name:
|
|
3698
|
-
description:
|
|
3699
|
-
model:
|
|
3752
|
+
var ClaudecodeSubagentFrontmatterSchema = import_mini15.z.object({
|
|
3753
|
+
name: import_mini15.z.string(),
|
|
3754
|
+
description: import_mini15.z.string(),
|
|
3755
|
+
model: import_mini15.z.optional(import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
3700
3756
|
});
|
|
3701
3757
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
3702
3758
|
frontmatter;
|
|
@@ -3716,12 +3772,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3716
3772
|
this.frontmatter = frontmatter;
|
|
3717
3773
|
this.body = body;
|
|
3718
3774
|
}
|
|
3719
|
-
static getSettablePaths() {
|
|
3720
|
-
return {
|
|
3721
|
-
relativeDirPath: ".claude/agents"
|
|
3722
|
-
};
|
|
3723
|
-
}
|
|
3724
|
-
static getSettablePathsGlobal() {
|
|
3775
|
+
static getSettablePaths(_options = {}) {
|
|
3725
3776
|
return {
|
|
3726
3777
|
relativeDirPath: (0, import_node_path35.join)(".claude", "agents")
|
|
3727
3778
|
};
|
|
@@ -3769,7 +3820,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3769
3820
|
};
|
|
3770
3821
|
const body = rulesyncSubagent.getBody();
|
|
3771
3822
|
const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
|
|
3772
|
-
const paths =
|
|
3823
|
+
const paths = this.getSettablePaths({ global });
|
|
3773
3824
|
return new _ClaudecodeSubagent({
|
|
3774
3825
|
baseDir,
|
|
3775
3826
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -3808,7 +3859,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3808
3859
|
validate = true,
|
|
3809
3860
|
global = false
|
|
3810
3861
|
}) {
|
|
3811
|
-
const paths =
|
|
3862
|
+
const paths = this.getSettablePaths({ global });
|
|
3812
3863
|
const filePath = (0, import_node_path35.join)(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3813
3864
|
const fileContent = await readFileContent(filePath);
|
|
3814
3865
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -3847,7 +3898,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
3847
3898
|
"roo"
|
|
3848
3899
|
];
|
|
3849
3900
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
3850
|
-
var SubagentsProcessorToolTargetSchema =
|
|
3901
|
+
var SubagentsProcessorToolTargetSchema = import_mini16.z.enum(subagentsProcessorToolTargets);
|
|
3851
3902
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
3852
3903
|
toolTarget;
|
|
3853
3904
|
global;
|
|
@@ -4038,7 +4089,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4038
4089
|
* Load Claude Code subagent configurations from .claude/agents/ directory
|
|
4039
4090
|
*/
|
|
4040
4091
|
async loadClaudecodeSubagents() {
|
|
4041
|
-
const paths =
|
|
4092
|
+
const paths = ClaudecodeSubagent.getSettablePaths({ global: this.global });
|
|
4042
4093
|
return await this.loadToolSubagentsDefault({
|
|
4043
4094
|
relativeDirPath: paths.relativeDirPath,
|
|
4044
4095
|
fromFile: (relativeFilePath) => ClaudecodeSubagent.fromFile({
|
|
@@ -4132,23 +4183,23 @@ var import_node_path38 = require("path");
|
|
|
4132
4183
|
|
|
4133
4184
|
// src/rules/rulesync-rule.ts
|
|
4134
4185
|
var import_node_path37 = require("path");
|
|
4135
|
-
var
|
|
4136
|
-
var RulesyncRuleFrontmatterSchema =
|
|
4137
|
-
root:
|
|
4138
|
-
targets:
|
|
4139
|
-
description:
|
|
4140
|
-
globs:
|
|
4141
|
-
agentsmd:
|
|
4142
|
-
|
|
4186
|
+
var import_mini17 = require("zod/mini");
|
|
4187
|
+
var RulesyncRuleFrontmatterSchema = import_mini17.z.object({
|
|
4188
|
+
root: import_mini17.z.optional(import_mini17.z.optional(import_mini17.z.boolean())),
|
|
4189
|
+
targets: import_mini17.z.optional(RulesyncTargetsSchema),
|
|
4190
|
+
description: import_mini17.z.optional(import_mini17.z.string()),
|
|
4191
|
+
globs: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
|
|
4192
|
+
agentsmd: import_mini17.z.optional(
|
|
4193
|
+
import_mini17.z.object({
|
|
4143
4194
|
// @example "path/to/subproject"
|
|
4144
|
-
subprojectPath:
|
|
4195
|
+
subprojectPath: import_mini17.z.optional(import_mini17.z.string())
|
|
4145
4196
|
})
|
|
4146
4197
|
),
|
|
4147
|
-
cursor:
|
|
4148
|
-
|
|
4149
|
-
alwaysApply:
|
|
4150
|
-
description:
|
|
4151
|
-
globs:
|
|
4198
|
+
cursor: import_mini17.z.optional(
|
|
4199
|
+
import_mini17.z.object({
|
|
4200
|
+
alwaysApply: import_mini17.z.optional(import_mini17.z.boolean()),
|
|
4201
|
+
description: import_mini17.z.optional(import_mini17.z.string()),
|
|
4202
|
+
globs: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
|
|
4152
4203
|
})
|
|
4153
4204
|
)
|
|
4154
4205
|
});
|
|
@@ -4274,10 +4325,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4274
4325
|
this.description = description;
|
|
4275
4326
|
this.globs = globs;
|
|
4276
4327
|
}
|
|
4277
|
-
static getSettablePaths() {
|
|
4278
|
-
throw new Error("Please implement this method in the subclass.");
|
|
4279
|
-
}
|
|
4280
|
-
static getSettablePathsGlobal() {
|
|
4328
|
+
static getSettablePaths(_options = {}) {
|
|
4281
4329
|
throw new Error("Please implement this method in the subclass.");
|
|
4282
4330
|
}
|
|
4283
4331
|
static async fromFile(_params) {
|
|
@@ -4641,7 +4689,17 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4641
4689
|
// src/rules/claudecode-rule.ts
|
|
4642
4690
|
var import_node_path43 = require("path");
|
|
4643
4691
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4644
|
-
static getSettablePaths(
|
|
4692
|
+
static getSettablePaths({
|
|
4693
|
+
global
|
|
4694
|
+
} = {}) {
|
|
4695
|
+
if (global) {
|
|
4696
|
+
return {
|
|
4697
|
+
root: {
|
|
4698
|
+
relativeDirPath: ".claude",
|
|
4699
|
+
relativeFilePath: "CLAUDE.md"
|
|
4700
|
+
}
|
|
4701
|
+
};
|
|
4702
|
+
}
|
|
4645
4703
|
return {
|
|
4646
4704
|
root: {
|
|
4647
4705
|
relativeDirPath: ".",
|
|
@@ -4652,21 +4710,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4652
4710
|
}
|
|
4653
4711
|
};
|
|
4654
4712
|
}
|
|
4655
|
-
static getSettablePathsGlobal() {
|
|
4656
|
-
return {
|
|
4657
|
-
root: {
|
|
4658
|
-
relativeDirPath: ".claude",
|
|
4659
|
-
relativeFilePath: "CLAUDE.md"
|
|
4660
|
-
}
|
|
4661
|
-
};
|
|
4662
|
-
}
|
|
4663
4713
|
static async fromFile({
|
|
4664
4714
|
baseDir = ".",
|
|
4665
4715
|
relativeFilePath,
|
|
4666
4716
|
validate = true,
|
|
4667
4717
|
global = false
|
|
4668
4718
|
}) {
|
|
4669
|
-
const paths =
|
|
4719
|
+
const paths = this.getSettablePaths({ global });
|
|
4670
4720
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4671
4721
|
if (isRoot) {
|
|
4672
4722
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4702,7 +4752,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4702
4752
|
validate = true,
|
|
4703
4753
|
global = false
|
|
4704
4754
|
}) {
|
|
4705
|
-
const paths =
|
|
4755
|
+
const paths = this.getSettablePaths({ global });
|
|
4706
4756
|
return new _ClaudecodeRule(
|
|
4707
4757
|
this.buildToolRuleParamsDefault({
|
|
4708
4758
|
baseDir,
|
|
@@ -4729,9 +4779,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4729
4779
|
|
|
4730
4780
|
// src/rules/cline-rule.ts
|
|
4731
4781
|
var import_node_path44 = require("path");
|
|
4732
|
-
var
|
|
4733
|
-
var ClineRuleFrontmatterSchema =
|
|
4734
|
-
description:
|
|
4782
|
+
var import_mini18 = require("zod/mini");
|
|
4783
|
+
var ClineRuleFrontmatterSchema = import_mini18.z.object({
|
|
4784
|
+
description: import_mini18.z.string()
|
|
4735
4785
|
});
|
|
4736
4786
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
4737
4787
|
static getSettablePaths() {
|
|
@@ -4788,7 +4838,17 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4788
4838
|
// src/rules/codexcli-rule.ts
|
|
4789
4839
|
var import_node_path45 = require("path");
|
|
4790
4840
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4791
|
-
static getSettablePaths(
|
|
4841
|
+
static getSettablePaths({
|
|
4842
|
+
global
|
|
4843
|
+
} = {}) {
|
|
4844
|
+
if (global) {
|
|
4845
|
+
return {
|
|
4846
|
+
root: {
|
|
4847
|
+
relativeDirPath: ".codex",
|
|
4848
|
+
relativeFilePath: "AGENTS.md"
|
|
4849
|
+
}
|
|
4850
|
+
};
|
|
4851
|
+
}
|
|
4792
4852
|
return {
|
|
4793
4853
|
root: {
|
|
4794
4854
|
relativeDirPath: ".",
|
|
@@ -4799,21 +4859,13 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4799
4859
|
}
|
|
4800
4860
|
};
|
|
4801
4861
|
}
|
|
4802
|
-
static getSettablePathsGlobal() {
|
|
4803
|
-
return {
|
|
4804
|
-
root: {
|
|
4805
|
-
relativeDirPath: ".codex",
|
|
4806
|
-
relativeFilePath: "AGENTS.md"
|
|
4807
|
-
}
|
|
4808
|
-
};
|
|
4809
|
-
}
|
|
4810
4862
|
static async fromFile({
|
|
4811
4863
|
baseDir = ".",
|
|
4812
4864
|
relativeFilePath,
|
|
4813
4865
|
validate = true,
|
|
4814
4866
|
global = false
|
|
4815
4867
|
}) {
|
|
4816
|
-
const paths =
|
|
4868
|
+
const paths = this.getSettablePaths({ global });
|
|
4817
4869
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4818
4870
|
if (isRoot) {
|
|
4819
4871
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4849,7 +4901,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4849
4901
|
validate = true,
|
|
4850
4902
|
global = false
|
|
4851
4903
|
}) {
|
|
4852
|
-
const paths =
|
|
4904
|
+
const paths = this.getSettablePaths({ global });
|
|
4853
4905
|
return new _CodexcliRule(
|
|
4854
4906
|
this.buildToolRuleParamsAgentsmd({
|
|
4855
4907
|
baseDir,
|
|
@@ -4876,10 +4928,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4876
4928
|
|
|
4877
4929
|
// src/rules/copilot-rule.ts
|
|
4878
4930
|
var import_node_path46 = require("path");
|
|
4879
|
-
var
|
|
4880
|
-
var CopilotRuleFrontmatterSchema =
|
|
4881
|
-
description:
|
|
4882
|
-
applyTo:
|
|
4931
|
+
var import_mini19 = require("zod/mini");
|
|
4932
|
+
var CopilotRuleFrontmatterSchema = import_mini19.z.object({
|
|
4933
|
+
description: import_mini19.z.optional(import_mini19.z.string()),
|
|
4934
|
+
applyTo: import_mini19.z.optional(import_mini19.z.string())
|
|
4883
4935
|
});
|
|
4884
4936
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
4885
4937
|
frontmatter;
|
|
@@ -5038,11 +5090,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5038
5090
|
|
|
5039
5091
|
// src/rules/cursor-rule.ts
|
|
5040
5092
|
var import_node_path47 = require("path");
|
|
5041
|
-
var
|
|
5042
|
-
var CursorRuleFrontmatterSchema =
|
|
5043
|
-
description:
|
|
5044
|
-
globs:
|
|
5045
|
-
alwaysApply:
|
|
5093
|
+
var import_mini20 = require("zod/mini");
|
|
5094
|
+
var CursorRuleFrontmatterSchema = import_mini20.z.object({
|
|
5095
|
+
description: import_mini20.z.optional(import_mini20.z.string()),
|
|
5096
|
+
globs: import_mini20.z.optional(import_mini20.z.string()),
|
|
5097
|
+
alwaysApply: import_mini20.z.optional(import_mini20.z.boolean())
|
|
5046
5098
|
});
|
|
5047
5099
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
5048
5100
|
frontmatter;
|
|
@@ -5217,7 +5269,17 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5217
5269
|
// src/rules/geminicli-rule.ts
|
|
5218
5270
|
var import_node_path48 = require("path");
|
|
5219
5271
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5220
|
-
static getSettablePaths(
|
|
5272
|
+
static getSettablePaths({
|
|
5273
|
+
global
|
|
5274
|
+
} = {}) {
|
|
5275
|
+
if (global) {
|
|
5276
|
+
return {
|
|
5277
|
+
root: {
|
|
5278
|
+
relativeDirPath: ".gemini",
|
|
5279
|
+
relativeFilePath: "GEMINI.md"
|
|
5280
|
+
}
|
|
5281
|
+
};
|
|
5282
|
+
}
|
|
5221
5283
|
return {
|
|
5222
5284
|
root: {
|
|
5223
5285
|
relativeDirPath: ".",
|
|
@@ -5228,21 +5290,13 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5228
5290
|
}
|
|
5229
5291
|
};
|
|
5230
5292
|
}
|
|
5231
|
-
static getSettablePathsGlobal() {
|
|
5232
|
-
return {
|
|
5233
|
-
root: {
|
|
5234
|
-
relativeDirPath: ".gemini",
|
|
5235
|
-
relativeFilePath: "GEMINI.md"
|
|
5236
|
-
}
|
|
5237
|
-
};
|
|
5238
|
-
}
|
|
5239
5293
|
static async fromFile({
|
|
5240
5294
|
baseDir = ".",
|
|
5241
5295
|
relativeFilePath,
|
|
5242
5296
|
validate = true,
|
|
5243
5297
|
global = false
|
|
5244
5298
|
}) {
|
|
5245
|
-
const paths =
|
|
5299
|
+
const paths = this.getSettablePaths({ global });
|
|
5246
5300
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
5247
5301
|
if (isRoot) {
|
|
5248
5302
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -5278,7 +5332,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5278
5332
|
validate = true,
|
|
5279
5333
|
global = false
|
|
5280
5334
|
}) {
|
|
5281
|
-
const paths =
|
|
5335
|
+
const paths = this.getSettablePaths({ global });
|
|
5282
5336
|
return new _GeminiCliRule(
|
|
5283
5337
|
this.buildToolRuleParamsDefault({
|
|
5284
5338
|
baseDir,
|
|
@@ -5746,7 +5800,7 @@ var rulesProcessorToolTargets = [
|
|
|
5746
5800
|
"warp",
|
|
5747
5801
|
"windsurf"
|
|
5748
5802
|
];
|
|
5749
|
-
var RulesProcessorToolTargetSchema =
|
|
5803
|
+
var RulesProcessorToolTargetSchema = import_mini21.z.enum(rulesProcessorToolTargets);
|
|
5750
5804
|
var rulesProcessorToolTargetsGlobal = [
|
|
5751
5805
|
"claudecode",
|
|
5752
5806
|
"codexcli",
|
|
@@ -6290,7 +6344,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6290
6344
|
* Load Claude Code rule configuration from CLAUDE.md file
|
|
6291
6345
|
*/
|
|
6292
6346
|
async loadClaudecodeRules() {
|
|
6293
|
-
const settablePaths =
|
|
6347
|
+
const settablePaths = ClaudecodeRule.getSettablePaths({ global: this.global });
|
|
6294
6348
|
return this.loadToolRulesDefault({
|
|
6295
6349
|
root: {
|
|
6296
6350
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6323,7 +6377,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6323
6377
|
* Load OpenAI Codex CLI rule configuration from AGENTS.md and .codex/memories/*.md files
|
|
6324
6378
|
*/
|
|
6325
6379
|
async loadCodexcliRules() {
|
|
6326
|
-
const settablePaths =
|
|
6380
|
+
const settablePaths = CodexcliRule.getSettablePaths({ global: this.global });
|
|
6327
6381
|
return await this.loadToolRulesDefault({
|
|
6328
6382
|
root: {
|
|
6329
6383
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6374,7 +6428,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6374
6428
|
* Load Gemini CLI rule configuration from GEMINI.md file
|
|
6375
6429
|
*/
|
|
6376
6430
|
async loadGeminicliRules() {
|
|
6377
|
-
const settablePaths =
|
|
6431
|
+
const settablePaths = GeminiCliRule.getSettablePaths({ global: this.global });
|
|
6378
6432
|
return await this.loadToolRulesDefault({
|
|
6379
6433
|
root: {
|
|
6380
6434
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6795,6 +6849,7 @@ var gitignoreCommand = async () => {
|
|
|
6795
6849
|
"**/.amazonq/",
|
|
6796
6850
|
"**/.github/copilot-instructions.md",
|
|
6797
6851
|
"**/.github/instructions/",
|
|
6852
|
+
"**/.github/prompts/",
|
|
6798
6853
|
"**/.cursor/",
|
|
6799
6854
|
"**/.cursorignore",
|
|
6800
6855
|
"**/.clinerules/",
|
|
@@ -7100,7 +7155,7 @@ globs: ["**/*"]
|
|
|
7100
7155
|
}
|
|
7101
7156
|
|
|
7102
7157
|
// src/cli/index.ts
|
|
7103
|
-
var getVersion = () => "3.
|
|
7158
|
+
var getVersion = () => "3.5.1";
|
|
7104
7159
|
var main = async () => {
|
|
7105
7160
|
const program = new import_commander.Command();
|
|
7106
7161
|
const version = getVersion();
|