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.js
CHANGED
|
@@ -73,7 +73,7 @@ import { intersection } from "es-toolkit";
|
|
|
73
73
|
|
|
74
74
|
// src/commands/commands-processor.ts
|
|
75
75
|
import { basename as basename11, join as join11 } from "path";
|
|
76
|
-
import { z as
|
|
76
|
+
import { z as z9 } from "zod/mini";
|
|
77
77
|
|
|
78
78
|
// src/utils/file.ts
|
|
79
79
|
import { globSync } from "fs";
|
|
@@ -691,12 +691,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
691
691
|
this.frontmatter = frontmatter;
|
|
692
692
|
this.body = body;
|
|
693
693
|
}
|
|
694
|
-
static getSettablePaths() {
|
|
695
|
-
return {
|
|
696
|
-
relativeDirPath: ".claude/commands"
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
static getSettablePathsGlobal() {
|
|
694
|
+
static getSettablePaths(_options = {}) {
|
|
700
695
|
return {
|
|
701
696
|
relativeDirPath: join5(".claude", "commands")
|
|
702
697
|
};
|
|
@@ -735,7 +730,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
735
730
|
description: rulesyncFrontmatter.description
|
|
736
731
|
};
|
|
737
732
|
const body = rulesyncCommand.getBody();
|
|
738
|
-
const paths =
|
|
733
|
+
const paths = this.getSettablePaths({ global });
|
|
739
734
|
return new _ClaudecodeCommand({
|
|
740
735
|
baseDir,
|
|
741
736
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -773,7 +768,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
773
768
|
validate = true,
|
|
774
769
|
global = false
|
|
775
770
|
}) {
|
|
776
|
-
const paths =
|
|
771
|
+
const paths = this.getSettablePaths({ global });
|
|
777
772
|
const filePath = join5(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
778
773
|
const fileContent = await readFileContent(filePath);
|
|
779
774
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -795,10 +790,10 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
|
|
|
795
790
|
// src/commands/codexcli-command.ts
|
|
796
791
|
import { basename as basename6, join as join6 } from "path";
|
|
797
792
|
var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
798
|
-
static getSettablePaths() {
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
793
|
+
static getSettablePaths({ global } = {}) {
|
|
794
|
+
if (!global) {
|
|
795
|
+
throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
|
|
796
|
+
}
|
|
802
797
|
return {
|
|
803
798
|
relativeDirPath: join6(".codex", "prompts")
|
|
804
799
|
};
|
|
@@ -825,7 +820,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
825
820
|
validate = true,
|
|
826
821
|
global = false
|
|
827
822
|
}) {
|
|
828
|
-
const paths =
|
|
823
|
+
const paths = this.getSettablePaths({ global });
|
|
829
824
|
return new _CodexcliCommand({
|
|
830
825
|
baseDir,
|
|
831
826
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -852,7 +847,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
852
847
|
validate = true,
|
|
853
848
|
global = false
|
|
854
849
|
}) {
|
|
855
|
-
const paths =
|
|
850
|
+
const paths = this.getSettablePaths({ global });
|
|
856
851
|
const filePath = join6(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
857
852
|
const fileContent = await readFileContent(filePath);
|
|
858
853
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -868,40 +863,111 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
|
|
|
868
863
|
|
|
869
864
|
// src/commands/copilot-command.ts
|
|
870
865
|
import { basename as basename7, join as join7 } from "path";
|
|
871
|
-
|
|
866
|
+
import { z as z6 } from "zod/mini";
|
|
867
|
+
var CopilotCommandFrontmatterSchema = z6.object({
|
|
868
|
+
mode: z6.literal("agent"),
|
|
869
|
+
description: z6.string()
|
|
870
|
+
});
|
|
871
|
+
var CopilotCommand = class _CopilotCommand extends ToolCommand {
|
|
872
|
+
frontmatter;
|
|
873
|
+
body;
|
|
874
|
+
constructor({ frontmatter, body, ...rest }) {
|
|
875
|
+
if (rest.validate) {
|
|
876
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
877
|
+
if (!result.success) {
|
|
878
|
+
throw new Error(
|
|
879
|
+
`Invalid frontmatter in ${join7(rest.relativeDirPath, rest.relativeFilePath)}: ${result.error.message}`
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
super({
|
|
884
|
+
...rest,
|
|
885
|
+
fileContent: stringifyFrontmatter(body, frontmatter)
|
|
886
|
+
});
|
|
887
|
+
this.frontmatter = frontmatter;
|
|
888
|
+
this.body = body;
|
|
889
|
+
}
|
|
872
890
|
static getSettablePaths() {
|
|
873
891
|
return {
|
|
874
|
-
relativeDirPath: ".github
|
|
892
|
+
relativeDirPath: join7(".github", "prompts")
|
|
875
893
|
};
|
|
876
894
|
}
|
|
895
|
+
getBody() {
|
|
896
|
+
return this.body;
|
|
897
|
+
}
|
|
898
|
+
getFrontmatter() {
|
|
899
|
+
return this.frontmatter;
|
|
900
|
+
}
|
|
901
|
+
toRulesyncCommand() {
|
|
902
|
+
const rulesyncFrontmatter = {
|
|
903
|
+
targets: ["*"],
|
|
904
|
+
description: this.frontmatter.description
|
|
905
|
+
};
|
|
906
|
+
return new RulesyncCommand({
|
|
907
|
+
baseDir: ".",
|
|
908
|
+
frontmatter: rulesyncFrontmatter,
|
|
909
|
+
body: this.body,
|
|
910
|
+
relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
|
|
911
|
+
relativeFilePath: this.relativeFilePath,
|
|
912
|
+
fileContent: this.getFileContent(),
|
|
913
|
+
validate: true
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
validate() {
|
|
917
|
+
if (!this.frontmatter) {
|
|
918
|
+
return { success: true, error: null };
|
|
919
|
+
}
|
|
920
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(this.frontmatter);
|
|
921
|
+
if (result.success) {
|
|
922
|
+
return { success: true, error: null };
|
|
923
|
+
} else {
|
|
924
|
+
return {
|
|
925
|
+
success: false,
|
|
926
|
+
error: new Error(
|
|
927
|
+
`Invalid frontmatter in ${join7(this.relativeDirPath, this.relativeFilePath)}: ${result.error.message}`
|
|
928
|
+
)
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
}
|
|
877
932
|
static fromRulesyncCommand({
|
|
878
933
|
baseDir = ".",
|
|
879
934
|
rulesyncCommand,
|
|
880
935
|
validate = true
|
|
881
936
|
}) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
937
|
+
const paths = this.getSettablePaths();
|
|
938
|
+
const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
|
|
939
|
+
const copilotFrontmatter = {
|
|
940
|
+
mode: "agent",
|
|
941
|
+
description: rulesyncFrontmatter.description
|
|
942
|
+
};
|
|
943
|
+
const body = rulesyncCommand.getBody();
|
|
944
|
+
const originalFilePath = rulesyncCommand.getRelativeFilePath();
|
|
945
|
+
const relativeFilePath = originalFilePath.replace(/\.md$/, ".prompt.md");
|
|
946
|
+
return new _CopilotCommand({
|
|
947
|
+
baseDir,
|
|
948
|
+
frontmatter: copilotFrontmatter,
|
|
949
|
+
body,
|
|
950
|
+
relativeDirPath: paths.relativeDirPath,
|
|
951
|
+
relativeFilePath,
|
|
952
|
+
validate
|
|
953
|
+
});
|
|
885
954
|
}
|
|
886
955
|
static async fromFile({
|
|
887
956
|
baseDir = ".",
|
|
888
957
|
relativeFilePath,
|
|
889
958
|
validate = true
|
|
890
959
|
}) {
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
_CopilotCommand.getSettablePaths().relativeDirPath,
|
|
894
|
-
relativeFilePath
|
|
895
|
-
);
|
|
960
|
+
const paths = this.getSettablePaths();
|
|
961
|
+
const filePath = join7(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
896
962
|
const fileContent = await readFileContent(filePath);
|
|
897
963
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
898
|
-
const result =
|
|
964
|
+
const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
|
|
899
965
|
if (!result.success) {
|
|
900
966
|
throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
|
|
901
967
|
}
|
|
902
968
|
return new _CopilotCommand({
|
|
903
969
|
baseDir,
|
|
904
|
-
relativeDirPath:
|
|
970
|
+
relativeDirPath: paths.relativeDirPath,
|
|
905
971
|
relativeFilePath: basename7(relativeFilePath),
|
|
906
972
|
frontmatter: result.data,
|
|
907
973
|
body: content.trim(),
|
|
@@ -919,12 +985,7 @@ var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
|
|
|
919
985
|
// src/commands/cursor-command.ts
|
|
920
986
|
import { basename as basename8, join as join8 } from "path";
|
|
921
987
|
var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
922
|
-
static getSettablePaths() {
|
|
923
|
-
return {
|
|
924
|
-
relativeDirPath: join8(".cursor", "commands")
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
|
-
static getSettablePathsGlobal() {
|
|
988
|
+
static getSettablePaths(_options = {}) {
|
|
928
989
|
return {
|
|
929
990
|
relativeDirPath: join8(".cursor", "commands")
|
|
930
991
|
};
|
|
@@ -951,7 +1012,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
951
1012
|
validate = true,
|
|
952
1013
|
global = false
|
|
953
1014
|
}) {
|
|
954
|
-
const paths =
|
|
1015
|
+
const paths = this.getSettablePaths({ global });
|
|
955
1016
|
return new _CursorCommand({
|
|
956
1017
|
baseDir,
|
|
957
1018
|
fileContent: rulesyncCommand.getBody(),
|
|
@@ -978,7 +1039,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
978
1039
|
validate = true,
|
|
979
1040
|
global = false
|
|
980
1041
|
}) {
|
|
981
|
-
const paths =
|
|
1042
|
+
const paths = this.getSettablePaths({ global });
|
|
982
1043
|
const filePath = join8(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
983
1044
|
const fileContent = await readFileContent(filePath);
|
|
984
1045
|
const { body: content } = parseFrontmatter(fileContent);
|
|
@@ -995,10 +1056,10 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
|
|
|
995
1056
|
// src/commands/geminicli-command.ts
|
|
996
1057
|
import { basename as basename9, join as join9 } from "path";
|
|
997
1058
|
import { parse as parseToml } from "smol-toml";
|
|
998
|
-
import { z as
|
|
999
|
-
var GeminiCliCommandFrontmatterSchema =
|
|
1000
|
-
description:
|
|
1001
|
-
prompt:
|
|
1059
|
+
import { z as z7 } from "zod/mini";
|
|
1060
|
+
var GeminiCliCommandFrontmatterSchema = z7.object({
|
|
1061
|
+
description: z7.optional(z7.string()),
|
|
1062
|
+
prompt: z7.string()
|
|
1002
1063
|
});
|
|
1003
1064
|
var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
1004
1065
|
frontmatter;
|
|
@@ -1009,12 +1070,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1009
1070
|
this.frontmatter = parsed;
|
|
1010
1071
|
this.body = parsed.prompt;
|
|
1011
1072
|
}
|
|
1012
|
-
static getSettablePaths() {
|
|
1013
|
-
return {
|
|
1014
|
-
relativeDirPath: ".gemini/commands"
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
static getSettablePathsGlobal() {
|
|
1073
|
+
static getSettablePaths(_options = {}) {
|
|
1018
1074
|
return {
|
|
1019
1075
|
relativeDirPath: join9(".gemini", "commands")
|
|
1020
1076
|
};
|
|
@@ -1075,7 +1131,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
|
|
|
1075
1131
|
prompt = """
|
|
1076
1132
|
${geminiFrontmatter.prompt}
|
|
1077
1133
|
"""`;
|
|
1078
|
-
const paths =
|
|
1134
|
+
const paths = this.getSettablePaths({ global });
|
|
1079
1135
|
return new _GeminiCliCommand({
|
|
1080
1136
|
baseDir,
|
|
1081
1137
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1090,7 +1146,7 @@ ${geminiFrontmatter.prompt}
|
|
|
1090
1146
|
validate = true,
|
|
1091
1147
|
global = false
|
|
1092
1148
|
}) {
|
|
1093
|
-
const paths =
|
|
1149
|
+
const paths = this.getSettablePaths({ global });
|
|
1094
1150
|
const filePath = join9(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
1095
1151
|
const fileContent = await readFileContent(filePath);
|
|
1096
1152
|
return new _GeminiCliCommand({
|
|
@@ -1119,10 +1175,10 @@ ${geminiFrontmatter.prompt}
|
|
|
1119
1175
|
|
|
1120
1176
|
// src/commands/roo-command.ts
|
|
1121
1177
|
import { basename as basename10, join as join10 } from "path";
|
|
1122
|
-
import { optional, z as
|
|
1123
|
-
var RooCommandFrontmatterSchema =
|
|
1124
|
-
description:
|
|
1125
|
-
"argument-hint": optional(
|
|
1178
|
+
import { optional, z as z8 } from "zod/mini";
|
|
1179
|
+
var RooCommandFrontmatterSchema = z8.object({
|
|
1180
|
+
description: z8.string(),
|
|
1181
|
+
"argument-hint": optional(z8.string())
|
|
1126
1182
|
});
|
|
1127
1183
|
var RooCommand = class _RooCommand extends ToolCommand {
|
|
1128
1184
|
frontmatter;
|
|
@@ -1247,11 +1303,11 @@ var commandsProcessorToolTargets = [
|
|
|
1247
1303
|
"copilot",
|
|
1248
1304
|
"cursor"
|
|
1249
1305
|
];
|
|
1250
|
-
var CommandsProcessorToolTargetSchema =
|
|
1306
|
+
var CommandsProcessorToolTargetSchema = z9.enum(
|
|
1251
1307
|
// 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
|
|
1252
1308
|
commandsProcessorToolTargets.concat("codexcli")
|
|
1253
1309
|
);
|
|
1254
|
-
var commandsProcessorToolTargetsSimulated = ["agentsmd"
|
|
1310
|
+
var commandsProcessorToolTargetsSimulated = ["agentsmd"];
|
|
1255
1311
|
var commandsProcessorToolTargetsGlobal = [
|
|
1256
1312
|
"claudecode",
|
|
1257
1313
|
"cursor",
|
|
@@ -1471,20 +1527,20 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1471
1527
|
});
|
|
1472
1528
|
}
|
|
1473
1529
|
/**
|
|
1474
|
-
* Load Copilot command configurations from .github/
|
|
1530
|
+
* Load Copilot command configurations from .github/prompts/ directory
|
|
1475
1531
|
*/
|
|
1476
1532
|
async loadCopilotCommands() {
|
|
1477
1533
|
return await this.loadToolCommandDefault({
|
|
1478
1534
|
toolTarget: "copilot",
|
|
1479
1535
|
relativeDirPath: CopilotCommand.getSettablePaths().relativeDirPath,
|
|
1480
|
-
extension: "md"
|
|
1536
|
+
extension: "prompt.md"
|
|
1481
1537
|
});
|
|
1482
1538
|
}
|
|
1483
1539
|
/**
|
|
1484
1540
|
* Load Claude Code command configurations from .claude/commands/ directory
|
|
1485
1541
|
*/
|
|
1486
1542
|
async loadClaudecodeCommands() {
|
|
1487
|
-
const paths =
|
|
1543
|
+
const paths = ClaudecodeCommand.getSettablePaths({ global: this.global });
|
|
1488
1544
|
return await this.loadToolCommandDefault({
|
|
1489
1545
|
toolTarget: "claudecode",
|
|
1490
1546
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1495,7 +1551,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1495
1551
|
* Load Cursor command configurations from .cursor/commands/ directory
|
|
1496
1552
|
*/
|
|
1497
1553
|
async loadCursorCommands() {
|
|
1498
|
-
const paths =
|
|
1554
|
+
const paths = CursorCommand.getSettablePaths({ global: this.global });
|
|
1499
1555
|
return await this.loadToolCommandDefault({
|
|
1500
1556
|
toolTarget: "cursor",
|
|
1501
1557
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1506,7 +1562,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1506
1562
|
* Load Gemini CLI command configurations from .gemini/commands/ directory
|
|
1507
1563
|
*/
|
|
1508
1564
|
async loadGeminicliCommands() {
|
|
1509
|
-
const paths =
|
|
1565
|
+
const paths = GeminiCliCommand.getSettablePaths({ global: this.global });
|
|
1510
1566
|
return await this.loadToolCommandDefault({
|
|
1511
1567
|
toolTarget: "geminicli",
|
|
1512
1568
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1517,7 +1573,7 @@ var CommandsProcessor = class extends FeatureProcessor {
|
|
|
1517
1573
|
* Load Codex CLI command configurations from .codex/prompts/ directory
|
|
1518
1574
|
*/
|
|
1519
1575
|
async loadCodexcliCommands() {
|
|
1520
|
-
const paths =
|
|
1576
|
+
const paths = CodexcliCommand.getSettablePaths({ global: this.global });
|
|
1521
1577
|
return await this.loadToolCommandDefault({
|
|
1522
1578
|
toolTarget: "codexcli",
|
|
1523
1579
|
relativeDirPath: paths.relativeDirPath,
|
|
@@ -1705,7 +1761,7 @@ function getBaseDirsInLightOfGlobal({
|
|
|
1705
1761
|
}
|
|
1706
1762
|
|
|
1707
1763
|
// src/ignore/ignore-processor.ts
|
|
1708
|
-
import { z as
|
|
1764
|
+
import { z as z10 } from "zod/mini";
|
|
1709
1765
|
|
|
1710
1766
|
// src/ignore/amazonqcli-ignore.ts
|
|
1711
1767
|
import { join as join13 } from "path";
|
|
@@ -2350,7 +2406,7 @@ var ignoreProcessorToolTargets = [
|
|
|
2350
2406
|
"roo",
|
|
2351
2407
|
"windsurf"
|
|
2352
2408
|
];
|
|
2353
|
-
var IgnoreProcessorToolTargetSchema =
|
|
2409
|
+
var IgnoreProcessorToolTargetSchema = z10.enum(ignoreProcessorToolTargets);
|
|
2354
2410
|
var IgnoreProcessor = class extends FeatureProcessor {
|
|
2355
2411
|
toolTarget;
|
|
2356
2412
|
constructor({
|
|
@@ -2525,39 +2581,39 @@ var IgnoreProcessor = class extends FeatureProcessor {
|
|
|
2525
2581
|
};
|
|
2526
2582
|
|
|
2527
2583
|
// src/mcp/mcp-processor.ts
|
|
2528
|
-
import { z as
|
|
2584
|
+
import { z as z12 } from "zod/mini";
|
|
2529
2585
|
|
|
2530
2586
|
// src/mcp/amazonqcli-mcp.ts
|
|
2531
2587
|
import { join as join25 } from "path";
|
|
2532
2588
|
|
|
2533
2589
|
// src/mcp/rulesync-mcp.ts
|
|
2534
2590
|
import { join as join24 } from "path";
|
|
2535
|
-
import { z as
|
|
2536
|
-
var McpTransportTypeSchema =
|
|
2537
|
-
var McpServerBaseSchema =
|
|
2538
|
-
type:
|
|
2539
|
-
command:
|
|
2540
|
-
args:
|
|
2541
|
-
url:
|
|
2542
|
-
httpUrl:
|
|
2543
|
-
env:
|
|
2544
|
-
disabled:
|
|
2545
|
-
networkTimeout:
|
|
2546
|
-
timeout:
|
|
2547
|
-
trust:
|
|
2548
|
-
cwd:
|
|
2549
|
-
transport:
|
|
2550
|
-
alwaysAllow:
|
|
2551
|
-
tools:
|
|
2552
|
-
kiroAutoApprove:
|
|
2553
|
-
kiroAutoBlock:
|
|
2554
|
-
headers:
|
|
2591
|
+
import { z as z11 } from "zod/mini";
|
|
2592
|
+
var McpTransportTypeSchema = z11.enum(["stdio", "sse", "http"]);
|
|
2593
|
+
var McpServerBaseSchema = z11.object({
|
|
2594
|
+
type: z11.optional(z11.enum(["stdio", "sse", "http"])),
|
|
2595
|
+
command: z11.optional(z11.union([z11.string(), z11.array(z11.string())])),
|
|
2596
|
+
args: z11.optional(z11.array(z11.string())),
|
|
2597
|
+
url: z11.optional(z11.string()),
|
|
2598
|
+
httpUrl: z11.optional(z11.string()),
|
|
2599
|
+
env: z11.optional(z11.record(z11.string(), z11.string())),
|
|
2600
|
+
disabled: z11.optional(z11.boolean()),
|
|
2601
|
+
networkTimeout: z11.optional(z11.number()),
|
|
2602
|
+
timeout: z11.optional(z11.number()),
|
|
2603
|
+
trust: z11.optional(z11.boolean()),
|
|
2604
|
+
cwd: z11.optional(z11.string()),
|
|
2605
|
+
transport: z11.optional(McpTransportTypeSchema),
|
|
2606
|
+
alwaysAllow: z11.optional(z11.array(z11.string())),
|
|
2607
|
+
tools: z11.optional(z11.array(z11.string())),
|
|
2608
|
+
kiroAutoApprove: z11.optional(z11.array(z11.string())),
|
|
2609
|
+
kiroAutoBlock: z11.optional(z11.array(z11.string())),
|
|
2610
|
+
headers: z11.optional(z11.record(z11.string(), z11.string()))
|
|
2555
2611
|
});
|
|
2556
|
-
var RulesyncMcpServersSchema =
|
|
2557
|
-
targets:
|
|
2612
|
+
var RulesyncMcpServersSchema = z11.extend(McpServerBaseSchema, {
|
|
2613
|
+
targets: z11.optional(RulesyncTargetsSchema)
|
|
2558
2614
|
});
|
|
2559
|
-
var RulesyncMcpConfigSchema =
|
|
2560
|
-
mcpServers:
|
|
2615
|
+
var RulesyncMcpConfigSchema = z11.object({
|
|
2616
|
+
mcpServers: z11.record(z11.string(), RulesyncMcpServersSchema)
|
|
2561
2617
|
});
|
|
2562
2618
|
var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
|
|
2563
2619
|
json;
|
|
@@ -2703,24 +2759,24 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2703
2759
|
getJson() {
|
|
2704
2760
|
return this.json;
|
|
2705
2761
|
}
|
|
2706
|
-
static getSettablePaths() {
|
|
2762
|
+
static getSettablePaths({ global } = {}) {
|
|
2763
|
+
if (global) {
|
|
2764
|
+
return {
|
|
2765
|
+
relativeDirPath: ".claude",
|
|
2766
|
+
relativeFilePath: ".claude.json"
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2707
2769
|
return {
|
|
2708
2770
|
relativeDirPath: ".",
|
|
2709
2771
|
relativeFilePath: ".mcp.json"
|
|
2710
2772
|
};
|
|
2711
2773
|
}
|
|
2712
|
-
static getSettablePathsGlobal() {
|
|
2713
|
-
return {
|
|
2714
|
-
relativeDirPath: ".claude",
|
|
2715
|
-
relativeFilePath: ".claude.json"
|
|
2716
|
-
};
|
|
2717
|
-
}
|
|
2718
2774
|
static async fromFile({
|
|
2719
2775
|
baseDir = ".",
|
|
2720
2776
|
validate = true,
|
|
2721
2777
|
global = false
|
|
2722
2778
|
}) {
|
|
2723
|
-
const paths =
|
|
2779
|
+
const paths = this.getSettablePaths({ global });
|
|
2724
2780
|
const fileContent = await readOrInitializeFileContent(
|
|
2725
2781
|
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2726
2782
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2741,7 +2797,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
|
|
|
2741
2797
|
validate = true,
|
|
2742
2798
|
global = false
|
|
2743
2799
|
}) {
|
|
2744
|
-
const paths =
|
|
2800
|
+
const paths = this.getSettablePaths({ global });
|
|
2745
2801
|
const fileContent = await readOrInitializeFileContent(
|
|
2746
2802
|
join26(baseDir, paths.relativeDirPath, paths.relativeFilePath),
|
|
2747
2803
|
JSON.stringify({ mcpServers: {} }, null, 2)
|
|
@@ -2844,10 +2900,10 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2844
2900
|
getToml() {
|
|
2845
2901
|
return this.toml;
|
|
2846
2902
|
}
|
|
2847
|
-
static getSettablePaths() {
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2903
|
+
static getSettablePaths({ global } = {}) {
|
|
2904
|
+
if (!global) {
|
|
2905
|
+
throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
|
|
2906
|
+
}
|
|
2851
2907
|
return {
|
|
2852
2908
|
relativeDirPath: ".codex",
|
|
2853
2909
|
relativeFilePath: "config.toml"
|
|
@@ -2858,7 +2914,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2858
2914
|
validate = true,
|
|
2859
2915
|
global = false
|
|
2860
2916
|
}) {
|
|
2861
|
-
const paths =
|
|
2917
|
+
const paths = this.getSettablePaths({ global });
|
|
2862
2918
|
const fileContent = await readFileContent(
|
|
2863
2919
|
join28(baseDir, paths.relativeDirPath, paths.relativeFilePath)
|
|
2864
2920
|
);
|
|
@@ -2876,7 +2932,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
|
|
|
2876
2932
|
validate = true,
|
|
2877
2933
|
global = false
|
|
2878
2934
|
}) {
|
|
2879
|
-
const paths =
|
|
2935
|
+
const paths = this.getSettablePaths({ global });
|
|
2880
2936
|
const configTomlFilePath = join28(baseDir, paths.relativeDirPath, paths.relativeFilePath);
|
|
2881
2937
|
const configTomlFileContent = await readOrInitializeFileContent(
|
|
2882
2938
|
configTomlFilePath,
|
|
@@ -3109,7 +3165,7 @@ var mcpProcessorToolTargets = [
|
|
|
3109
3165
|
"cursor",
|
|
3110
3166
|
"roo"
|
|
3111
3167
|
];
|
|
3112
|
-
var McpProcessorToolTargetSchema =
|
|
3168
|
+
var McpProcessorToolTargetSchema = z12.enum(
|
|
3113
3169
|
// 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
|
|
3114
3170
|
mcpProcessorToolTargets.concat("codexcli")
|
|
3115
3171
|
);
|
|
@@ -3313,11 +3369,11 @@ var McpProcessor = class extends FeatureProcessor {
|
|
|
3313
3369
|
// src/rules/rules-processor.ts
|
|
3314
3370
|
import { basename as basename17, join as join55 } from "path";
|
|
3315
3371
|
import { XMLBuilder } from "fast-xml-parser";
|
|
3316
|
-
import { z as
|
|
3372
|
+
import { z as z21 } from "zod/mini";
|
|
3317
3373
|
|
|
3318
3374
|
// src/subagents/simulated-subagent.ts
|
|
3319
3375
|
import { basename as basename12, join as join32 } from "path";
|
|
3320
|
-
import { z as
|
|
3376
|
+
import { z as z13 } from "zod/mini";
|
|
3321
3377
|
|
|
3322
3378
|
// src/subagents/tool-subagent.ts
|
|
3323
3379
|
var ToolSubagent = class extends ToolFile {
|
|
@@ -3352,9 +3408,9 @@ var ToolSubagent = class extends ToolFile {
|
|
|
3352
3408
|
};
|
|
3353
3409
|
|
|
3354
3410
|
// src/subagents/simulated-subagent.ts
|
|
3355
|
-
var SimulatedSubagentFrontmatterSchema =
|
|
3356
|
-
name:
|
|
3357
|
-
description:
|
|
3411
|
+
var SimulatedSubagentFrontmatterSchema = z13.object({
|
|
3412
|
+
name: z13.string(),
|
|
3413
|
+
description: z13.string()
|
|
3358
3414
|
});
|
|
3359
3415
|
var SimulatedSubagent = class extends ToolSubagent {
|
|
3360
3416
|
frontmatter;
|
|
@@ -3583,22 +3639,22 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
|
|
|
3583
3639
|
|
|
3584
3640
|
// src/subagents/subagents-processor.ts
|
|
3585
3641
|
import { basename as basename14, join as join35 } from "path";
|
|
3586
|
-
import { z as
|
|
3642
|
+
import { z as z16 } from "zod/mini";
|
|
3587
3643
|
|
|
3588
3644
|
// src/subagents/claudecode-subagent.ts
|
|
3589
3645
|
import { join as join34 } from "path";
|
|
3590
|
-
import { z as
|
|
3646
|
+
import { z as z15 } from "zod/mini";
|
|
3591
3647
|
|
|
3592
3648
|
// src/subagents/rulesync-subagent.ts
|
|
3593
3649
|
import { basename as basename13, join as join33 } from "path";
|
|
3594
|
-
import { z as
|
|
3595
|
-
var RulesyncSubagentModelSchema =
|
|
3596
|
-
var RulesyncSubagentFrontmatterSchema =
|
|
3650
|
+
import { z as z14 } from "zod/mini";
|
|
3651
|
+
var RulesyncSubagentModelSchema = z14.enum(["opus", "sonnet", "haiku", "inherit"]);
|
|
3652
|
+
var RulesyncSubagentFrontmatterSchema = z14.object({
|
|
3597
3653
|
targets: RulesyncTargetsSchema,
|
|
3598
|
-
name:
|
|
3599
|
-
description:
|
|
3600
|
-
claudecode:
|
|
3601
|
-
|
|
3654
|
+
name: z14.string(),
|
|
3655
|
+
description: z14.string(),
|
|
3656
|
+
claudecode: z14.optional(
|
|
3657
|
+
z14.object({
|
|
3602
3658
|
model: RulesyncSubagentModelSchema
|
|
3603
3659
|
})
|
|
3604
3660
|
)
|
|
@@ -3670,10 +3726,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
|
|
|
3670
3726
|
};
|
|
3671
3727
|
|
|
3672
3728
|
// src/subagents/claudecode-subagent.ts
|
|
3673
|
-
var ClaudecodeSubagentFrontmatterSchema =
|
|
3674
|
-
name:
|
|
3675
|
-
description:
|
|
3676
|
-
model:
|
|
3729
|
+
var ClaudecodeSubagentFrontmatterSchema = z15.object({
|
|
3730
|
+
name: z15.string(),
|
|
3731
|
+
description: z15.string(),
|
|
3732
|
+
model: z15.optional(z15.enum(["opus", "sonnet", "haiku", "inherit"]))
|
|
3677
3733
|
});
|
|
3678
3734
|
var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
3679
3735
|
frontmatter;
|
|
@@ -3693,12 +3749,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3693
3749
|
this.frontmatter = frontmatter;
|
|
3694
3750
|
this.body = body;
|
|
3695
3751
|
}
|
|
3696
|
-
static getSettablePaths() {
|
|
3697
|
-
return {
|
|
3698
|
-
relativeDirPath: ".claude/agents"
|
|
3699
|
-
};
|
|
3700
|
-
}
|
|
3701
|
-
static getSettablePathsGlobal() {
|
|
3752
|
+
static getSettablePaths(_options = {}) {
|
|
3702
3753
|
return {
|
|
3703
3754
|
relativeDirPath: join34(".claude", "agents")
|
|
3704
3755
|
};
|
|
@@ -3746,7 +3797,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3746
3797
|
};
|
|
3747
3798
|
const body = rulesyncSubagent.getBody();
|
|
3748
3799
|
const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
|
|
3749
|
-
const paths =
|
|
3800
|
+
const paths = this.getSettablePaths({ global });
|
|
3750
3801
|
return new _ClaudecodeSubagent({
|
|
3751
3802
|
baseDir,
|
|
3752
3803
|
frontmatter: claudecodeFrontmatter,
|
|
@@ -3785,7 +3836,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
|
|
|
3785
3836
|
validate = true,
|
|
3786
3837
|
global = false
|
|
3787
3838
|
}) {
|
|
3788
|
-
const paths =
|
|
3839
|
+
const paths = this.getSettablePaths({ global });
|
|
3789
3840
|
const filePath = join34(baseDir, paths.relativeDirPath, relativeFilePath);
|
|
3790
3841
|
const fileContent = await readFileContent(filePath);
|
|
3791
3842
|
const { frontmatter, body: content } = parseFrontmatter(fileContent);
|
|
@@ -3824,7 +3875,7 @@ var subagentsProcessorToolTargetsSimulated = [
|
|
|
3824
3875
|
"roo"
|
|
3825
3876
|
];
|
|
3826
3877
|
var subagentsProcessorToolTargetsGlobal = ["claudecode"];
|
|
3827
|
-
var SubagentsProcessorToolTargetSchema =
|
|
3878
|
+
var SubagentsProcessorToolTargetSchema = z16.enum(subagentsProcessorToolTargets);
|
|
3828
3879
|
var SubagentsProcessor = class extends FeatureProcessor {
|
|
3829
3880
|
toolTarget;
|
|
3830
3881
|
global;
|
|
@@ -4015,7 +4066,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
|
|
|
4015
4066
|
* Load Claude Code subagent configurations from .claude/agents/ directory
|
|
4016
4067
|
*/
|
|
4017
4068
|
async loadClaudecodeSubagents() {
|
|
4018
|
-
const paths =
|
|
4069
|
+
const paths = ClaudecodeSubagent.getSettablePaths({ global: this.global });
|
|
4019
4070
|
return await this.loadToolSubagentsDefault({
|
|
4020
4071
|
relativeDirPath: paths.relativeDirPath,
|
|
4021
4072
|
fromFile: (relativeFilePath) => ClaudecodeSubagent.fromFile({
|
|
@@ -4109,23 +4160,23 @@ import { join as join37 } from "path";
|
|
|
4109
4160
|
|
|
4110
4161
|
// src/rules/rulesync-rule.ts
|
|
4111
4162
|
import { basename as basename15, join as join36 } from "path";
|
|
4112
|
-
import { z as
|
|
4113
|
-
var RulesyncRuleFrontmatterSchema =
|
|
4114
|
-
root:
|
|
4115
|
-
targets:
|
|
4116
|
-
description:
|
|
4117
|
-
globs:
|
|
4118
|
-
agentsmd:
|
|
4119
|
-
|
|
4163
|
+
import { z as z17 } from "zod/mini";
|
|
4164
|
+
var RulesyncRuleFrontmatterSchema = z17.object({
|
|
4165
|
+
root: z17.optional(z17.optional(z17.boolean())),
|
|
4166
|
+
targets: z17.optional(RulesyncTargetsSchema),
|
|
4167
|
+
description: z17.optional(z17.string()),
|
|
4168
|
+
globs: z17.optional(z17.array(z17.string())),
|
|
4169
|
+
agentsmd: z17.optional(
|
|
4170
|
+
z17.object({
|
|
4120
4171
|
// @example "path/to/subproject"
|
|
4121
|
-
subprojectPath:
|
|
4172
|
+
subprojectPath: z17.optional(z17.string())
|
|
4122
4173
|
})
|
|
4123
4174
|
),
|
|
4124
|
-
cursor:
|
|
4125
|
-
|
|
4126
|
-
alwaysApply:
|
|
4127
|
-
description:
|
|
4128
|
-
globs:
|
|
4175
|
+
cursor: z17.optional(
|
|
4176
|
+
z17.object({
|
|
4177
|
+
alwaysApply: z17.optional(z17.boolean()),
|
|
4178
|
+
description: z17.optional(z17.string()),
|
|
4179
|
+
globs: z17.optional(z17.array(z17.string()))
|
|
4129
4180
|
})
|
|
4130
4181
|
)
|
|
4131
4182
|
});
|
|
@@ -4251,10 +4302,7 @@ var ToolRule = class extends ToolFile {
|
|
|
4251
4302
|
this.description = description;
|
|
4252
4303
|
this.globs = globs;
|
|
4253
4304
|
}
|
|
4254
|
-
static getSettablePaths() {
|
|
4255
|
-
throw new Error("Please implement this method in the subclass.");
|
|
4256
|
-
}
|
|
4257
|
-
static getSettablePathsGlobal() {
|
|
4305
|
+
static getSettablePaths(_options = {}) {
|
|
4258
4306
|
throw new Error("Please implement this method in the subclass.");
|
|
4259
4307
|
}
|
|
4260
4308
|
static async fromFile(_params) {
|
|
@@ -4618,7 +4666,17 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
|
|
|
4618
4666
|
// src/rules/claudecode-rule.ts
|
|
4619
4667
|
import { join as join42 } from "path";
|
|
4620
4668
|
var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
4621
|
-
static getSettablePaths(
|
|
4669
|
+
static getSettablePaths({
|
|
4670
|
+
global
|
|
4671
|
+
} = {}) {
|
|
4672
|
+
if (global) {
|
|
4673
|
+
return {
|
|
4674
|
+
root: {
|
|
4675
|
+
relativeDirPath: ".claude",
|
|
4676
|
+
relativeFilePath: "CLAUDE.md"
|
|
4677
|
+
}
|
|
4678
|
+
};
|
|
4679
|
+
}
|
|
4622
4680
|
return {
|
|
4623
4681
|
root: {
|
|
4624
4682
|
relativeDirPath: ".",
|
|
@@ -4629,21 +4687,13 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4629
4687
|
}
|
|
4630
4688
|
};
|
|
4631
4689
|
}
|
|
4632
|
-
static getSettablePathsGlobal() {
|
|
4633
|
-
return {
|
|
4634
|
-
root: {
|
|
4635
|
-
relativeDirPath: ".claude",
|
|
4636
|
-
relativeFilePath: "CLAUDE.md"
|
|
4637
|
-
}
|
|
4638
|
-
};
|
|
4639
|
-
}
|
|
4640
4690
|
static async fromFile({
|
|
4641
4691
|
baseDir = ".",
|
|
4642
4692
|
relativeFilePath,
|
|
4643
4693
|
validate = true,
|
|
4644
4694
|
global = false
|
|
4645
4695
|
}) {
|
|
4646
|
-
const paths =
|
|
4696
|
+
const paths = this.getSettablePaths({ global });
|
|
4647
4697
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4648
4698
|
if (isRoot) {
|
|
4649
4699
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4679,7 +4729,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4679
4729
|
validate = true,
|
|
4680
4730
|
global = false
|
|
4681
4731
|
}) {
|
|
4682
|
-
const paths =
|
|
4732
|
+
const paths = this.getSettablePaths({ global });
|
|
4683
4733
|
return new _ClaudecodeRule(
|
|
4684
4734
|
this.buildToolRuleParamsDefault({
|
|
4685
4735
|
baseDir,
|
|
@@ -4706,9 +4756,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
|
|
|
4706
4756
|
|
|
4707
4757
|
// src/rules/cline-rule.ts
|
|
4708
4758
|
import { join as join43 } from "path";
|
|
4709
|
-
import { z as
|
|
4710
|
-
var ClineRuleFrontmatterSchema =
|
|
4711
|
-
description:
|
|
4759
|
+
import { z as z18 } from "zod/mini";
|
|
4760
|
+
var ClineRuleFrontmatterSchema = z18.object({
|
|
4761
|
+
description: z18.string()
|
|
4712
4762
|
});
|
|
4713
4763
|
var ClineRule = class _ClineRule extends ToolRule {
|
|
4714
4764
|
static getSettablePaths() {
|
|
@@ -4765,7 +4815,17 @@ var ClineRule = class _ClineRule extends ToolRule {
|
|
|
4765
4815
|
// src/rules/codexcli-rule.ts
|
|
4766
4816
|
import { join as join44 } from "path";
|
|
4767
4817
|
var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
4768
|
-
static getSettablePaths(
|
|
4818
|
+
static getSettablePaths({
|
|
4819
|
+
global
|
|
4820
|
+
} = {}) {
|
|
4821
|
+
if (global) {
|
|
4822
|
+
return {
|
|
4823
|
+
root: {
|
|
4824
|
+
relativeDirPath: ".codex",
|
|
4825
|
+
relativeFilePath: "AGENTS.md"
|
|
4826
|
+
}
|
|
4827
|
+
};
|
|
4828
|
+
}
|
|
4769
4829
|
return {
|
|
4770
4830
|
root: {
|
|
4771
4831
|
relativeDirPath: ".",
|
|
@@ -4776,21 +4836,13 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4776
4836
|
}
|
|
4777
4837
|
};
|
|
4778
4838
|
}
|
|
4779
|
-
static getSettablePathsGlobal() {
|
|
4780
|
-
return {
|
|
4781
|
-
root: {
|
|
4782
|
-
relativeDirPath: ".codex",
|
|
4783
|
-
relativeFilePath: "AGENTS.md"
|
|
4784
|
-
}
|
|
4785
|
-
};
|
|
4786
|
-
}
|
|
4787
4839
|
static async fromFile({
|
|
4788
4840
|
baseDir = ".",
|
|
4789
4841
|
relativeFilePath,
|
|
4790
4842
|
validate = true,
|
|
4791
4843
|
global = false
|
|
4792
4844
|
}) {
|
|
4793
|
-
const paths =
|
|
4845
|
+
const paths = this.getSettablePaths({ global });
|
|
4794
4846
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
4795
4847
|
if (isRoot) {
|
|
4796
4848
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -4826,7 +4878,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4826
4878
|
validate = true,
|
|
4827
4879
|
global = false
|
|
4828
4880
|
}) {
|
|
4829
|
-
const paths =
|
|
4881
|
+
const paths = this.getSettablePaths({ global });
|
|
4830
4882
|
return new _CodexcliRule(
|
|
4831
4883
|
this.buildToolRuleParamsAgentsmd({
|
|
4832
4884
|
baseDir,
|
|
@@ -4853,10 +4905,10 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
|
|
|
4853
4905
|
|
|
4854
4906
|
// src/rules/copilot-rule.ts
|
|
4855
4907
|
import { join as join45 } from "path";
|
|
4856
|
-
import { z as
|
|
4857
|
-
var CopilotRuleFrontmatterSchema =
|
|
4858
|
-
description:
|
|
4859
|
-
applyTo:
|
|
4908
|
+
import { z as z19 } from "zod/mini";
|
|
4909
|
+
var CopilotRuleFrontmatterSchema = z19.object({
|
|
4910
|
+
description: z19.optional(z19.string()),
|
|
4911
|
+
applyTo: z19.optional(z19.string())
|
|
4860
4912
|
});
|
|
4861
4913
|
var CopilotRule = class _CopilotRule extends ToolRule {
|
|
4862
4914
|
frontmatter;
|
|
@@ -5015,11 +5067,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
|
|
|
5015
5067
|
|
|
5016
5068
|
// src/rules/cursor-rule.ts
|
|
5017
5069
|
import { basename as basename16, join as join46 } from "path";
|
|
5018
|
-
import { z as
|
|
5019
|
-
var CursorRuleFrontmatterSchema =
|
|
5020
|
-
description:
|
|
5021
|
-
globs:
|
|
5022
|
-
alwaysApply:
|
|
5070
|
+
import { z as z20 } from "zod/mini";
|
|
5071
|
+
var CursorRuleFrontmatterSchema = z20.object({
|
|
5072
|
+
description: z20.optional(z20.string()),
|
|
5073
|
+
globs: z20.optional(z20.string()),
|
|
5074
|
+
alwaysApply: z20.optional(z20.boolean())
|
|
5023
5075
|
});
|
|
5024
5076
|
var CursorRule = class _CursorRule extends ToolRule {
|
|
5025
5077
|
frontmatter;
|
|
@@ -5194,7 +5246,17 @@ var CursorRule = class _CursorRule extends ToolRule {
|
|
|
5194
5246
|
// src/rules/geminicli-rule.ts
|
|
5195
5247
|
import { join as join47 } from "path";
|
|
5196
5248
|
var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
5197
|
-
static getSettablePaths(
|
|
5249
|
+
static getSettablePaths({
|
|
5250
|
+
global
|
|
5251
|
+
} = {}) {
|
|
5252
|
+
if (global) {
|
|
5253
|
+
return {
|
|
5254
|
+
root: {
|
|
5255
|
+
relativeDirPath: ".gemini",
|
|
5256
|
+
relativeFilePath: "GEMINI.md"
|
|
5257
|
+
}
|
|
5258
|
+
};
|
|
5259
|
+
}
|
|
5198
5260
|
return {
|
|
5199
5261
|
root: {
|
|
5200
5262
|
relativeDirPath: ".",
|
|
@@ -5205,21 +5267,13 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5205
5267
|
}
|
|
5206
5268
|
};
|
|
5207
5269
|
}
|
|
5208
|
-
static getSettablePathsGlobal() {
|
|
5209
|
-
return {
|
|
5210
|
-
root: {
|
|
5211
|
-
relativeDirPath: ".gemini",
|
|
5212
|
-
relativeFilePath: "GEMINI.md"
|
|
5213
|
-
}
|
|
5214
|
-
};
|
|
5215
|
-
}
|
|
5216
5270
|
static async fromFile({
|
|
5217
5271
|
baseDir = ".",
|
|
5218
5272
|
relativeFilePath,
|
|
5219
5273
|
validate = true,
|
|
5220
5274
|
global = false
|
|
5221
5275
|
}) {
|
|
5222
|
-
const paths =
|
|
5276
|
+
const paths = this.getSettablePaths({ global });
|
|
5223
5277
|
const isRoot = relativeFilePath === paths.root.relativeFilePath;
|
|
5224
5278
|
if (isRoot) {
|
|
5225
5279
|
const relativePath2 = paths.root.relativeFilePath;
|
|
@@ -5255,7 +5309,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
|
|
|
5255
5309
|
validate = true,
|
|
5256
5310
|
global = false
|
|
5257
5311
|
}) {
|
|
5258
|
-
const paths =
|
|
5312
|
+
const paths = this.getSettablePaths({ global });
|
|
5259
5313
|
return new _GeminiCliRule(
|
|
5260
5314
|
this.buildToolRuleParamsDefault({
|
|
5261
5315
|
baseDir,
|
|
@@ -5723,7 +5777,7 @@ var rulesProcessorToolTargets = [
|
|
|
5723
5777
|
"warp",
|
|
5724
5778
|
"windsurf"
|
|
5725
5779
|
];
|
|
5726
|
-
var RulesProcessorToolTargetSchema =
|
|
5780
|
+
var RulesProcessorToolTargetSchema = z21.enum(rulesProcessorToolTargets);
|
|
5727
5781
|
var rulesProcessorToolTargetsGlobal = [
|
|
5728
5782
|
"claudecode",
|
|
5729
5783
|
"codexcli",
|
|
@@ -6267,7 +6321,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6267
6321
|
* Load Claude Code rule configuration from CLAUDE.md file
|
|
6268
6322
|
*/
|
|
6269
6323
|
async loadClaudecodeRules() {
|
|
6270
|
-
const settablePaths =
|
|
6324
|
+
const settablePaths = ClaudecodeRule.getSettablePaths({ global: this.global });
|
|
6271
6325
|
return this.loadToolRulesDefault({
|
|
6272
6326
|
root: {
|
|
6273
6327
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6300,7 +6354,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6300
6354
|
* Load OpenAI Codex CLI rule configuration from AGENTS.md and .codex/memories/*.md files
|
|
6301
6355
|
*/
|
|
6302
6356
|
async loadCodexcliRules() {
|
|
6303
|
-
const settablePaths =
|
|
6357
|
+
const settablePaths = CodexcliRule.getSettablePaths({ global: this.global });
|
|
6304
6358
|
return await this.loadToolRulesDefault({
|
|
6305
6359
|
root: {
|
|
6306
6360
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6351,7 +6405,7 @@ var RulesProcessor = class extends FeatureProcessor {
|
|
|
6351
6405
|
* Load Gemini CLI rule configuration from GEMINI.md file
|
|
6352
6406
|
*/
|
|
6353
6407
|
async loadGeminicliRules() {
|
|
6354
|
-
const settablePaths =
|
|
6408
|
+
const settablePaths = GeminiCliRule.getSettablePaths({ global: this.global });
|
|
6355
6409
|
return await this.loadToolRulesDefault({
|
|
6356
6410
|
root: {
|
|
6357
6411
|
relativeDirPath: settablePaths.root.relativeDirPath,
|
|
@@ -6772,6 +6826,7 @@ var gitignoreCommand = async () => {
|
|
|
6772
6826
|
"**/.amazonq/",
|
|
6773
6827
|
"**/.github/copilot-instructions.md",
|
|
6774
6828
|
"**/.github/instructions/",
|
|
6829
|
+
"**/.github/prompts/",
|
|
6775
6830
|
"**/.cursor/",
|
|
6776
6831
|
"**/.cursorignore",
|
|
6777
6832
|
"**/.clinerules/",
|
|
@@ -7077,7 +7132,7 @@ globs: ["**/*"]
|
|
|
7077
7132
|
}
|
|
7078
7133
|
|
|
7079
7134
|
// src/cli/index.ts
|
|
7080
|
-
var getVersion = () => "3.
|
|
7135
|
+
var getVersion = () => "3.5.1";
|
|
7081
7136
|
var main = async () => {
|
|
7082
7137
|
const program = new Command();
|
|
7083
7138
|
const version = getVersion();
|