rulesync 7.12.2 → 7.14.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/dist/index.cjs CHANGED
@@ -38,7 +38,7 @@ __export(index_exports, {
38
38
  module.exports = __toCommonJS(index_exports);
39
39
 
40
40
  // src/config/config-resolver.ts
41
- var import_node_path3 = require("path");
41
+ var import_node_path4 = require("path");
42
42
  var import_jsonc_parser = require("jsonc-parser");
43
43
 
44
44
  // src/constants/rulesync-paths.ts
@@ -288,6 +288,7 @@ function toKebabCaseFilename(filename) {
288
288
  }
289
289
 
290
290
  // src/config/config.ts
291
+ var import_node_path3 = require("path");
291
292
  var import_mini3 = require("zod/mini");
292
293
 
293
294
  // src/types/features.ts
@@ -343,9 +344,30 @@ var ToolTargetsSchema = import_mini2.z.array(ToolTargetSchema);
343
344
  var RulesyncTargetsSchema = import_mini2.z.array(import_mini2.z.enum(ALL_TOOL_TARGETS_WITH_WILDCARD));
344
345
 
345
346
  // src/config/config.ts
347
+ function hasControlCharacters(value) {
348
+ for (let i = 0; i < value.length; i++) {
349
+ const code = value.charCodeAt(i);
350
+ if (code >= 0 && code <= 31 || code === 127) return true;
351
+ }
352
+ return false;
353
+ }
346
354
  var SourceEntrySchema = import_mini3.z.object({
347
355
  source: import_mini3.z.string().check((0, import_mini3.minLength)(1, "source must be a non-empty string")),
348
- skills: (0, import_mini3.optional)(import_mini3.z.array(import_mini3.z.string()))
356
+ skills: (0, import_mini3.optional)(import_mini3.z.array(import_mini3.z.string())),
357
+ transport: (0, import_mini3.optional)(import_mini3.z.enum(["github", "git"])),
358
+ ref: (0, import_mini3.optional)(
359
+ import_mini3.z.string().check(
360
+ (0, import_mini3.refine)((v) => !v.startsWith("-"), 'ref must not start with "-"'),
361
+ (0, import_mini3.refine)((v) => !hasControlCharacters(v), "ref must not contain control characters")
362
+ )
363
+ ),
364
+ path: (0, import_mini3.optional)(
365
+ import_mini3.z.string().check(
366
+ (0, import_mini3.refine)((v) => !v.includes(".."), 'path must not contain ".."'),
367
+ (0, import_mini3.refine)((v) => !(0, import_node_path3.isAbsolute)(v), "path must not be absolute"),
368
+ (0, import_mini3.refine)((v) => !hasControlCharacters(v), "path must not contain control characters")
369
+ )
370
+ )
349
371
  });
350
372
  var ConfigParamsSchema = import_mini3.z.object({
351
373
  baseDirs: import_mini3.z.array(import_mini3.z.string()),
@@ -590,8 +612,8 @@ var ConfigResolver = class {
590
612
  }) {
591
613
  const validatedConfigPath = resolvePath(configPath, process.cwd());
592
614
  const baseConfig = await loadConfigFromFile(validatedConfigPath);
593
- const configDir = (0, import_node_path3.dirname)(validatedConfigPath);
594
- const localConfigPath = (0, import_node_path3.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
615
+ const configDir = (0, import_node_path4.dirname)(validatedConfigPath);
616
+ const localConfigPath = (0, import_node_path4.join)(configDir, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
595
617
  const localConfig = await loadConfigFromFile(localConfigPath);
596
618
  const configByFile = mergeConfigs(baseConfig, localConfig);
597
619
  const resolvedGlobal = global ?? configByFile.global ?? getDefaults().global;
@@ -626,7 +648,7 @@ function getBaseDirsInLightOfGlobal({
626
648
  if (global) {
627
649
  return [getHomeDirectory()];
628
650
  }
629
- const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path3.resolve)(baseDir));
651
+ const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path4.resolve)(baseDir));
630
652
  resolvedBaseDirs.forEach((baseDir) => {
631
653
  validateBaseDir(baseDir);
632
654
  });
@@ -634,11 +656,11 @@ function getBaseDirsInLightOfGlobal({
634
656
  }
635
657
 
636
658
  // src/lib/generate.ts
637
- var import_node_path115 = require("path");
659
+ var import_node_path118 = require("path");
638
660
  var import_es_toolkit4 = require("es-toolkit");
639
661
 
640
662
  // src/features/commands/commands-processor.ts
641
- var import_node_path20 = require("path");
663
+ var import_node_path21 = require("path");
642
664
  var import_mini13 = require("zod/mini");
643
665
 
644
666
  // src/types/feature-processor.ts
@@ -704,7 +726,7 @@ var FeatureProcessor = class {
704
726
  };
705
727
 
706
728
  // src/features/commands/agentsmd-command.ts
707
- var import_node_path6 = require("path");
729
+ var import_node_path7 = require("path");
708
730
 
709
731
  // src/utils/frontmatter.ts
710
732
  var import_gray_matter = __toESM(require("gray-matter"), 1);
@@ -770,11 +792,11 @@ function parseFrontmatter(content, filePath) {
770
792
  }
771
793
 
772
794
  // src/features/commands/simulated-command.ts
773
- var import_node_path5 = require("path");
795
+ var import_node_path6 = require("path");
774
796
  var import_mini4 = require("zod/mini");
775
797
 
776
798
  // src/types/ai-file.ts
777
- var import_node_path4 = __toESM(require("path"), 1);
799
+ var import_node_path5 = __toESM(require("path"), 1);
778
800
  var AiFile = class {
779
801
  /**
780
802
  * @example "."
@@ -822,11 +844,11 @@ var AiFile = class {
822
844
  return this.relativeFilePath;
823
845
  }
824
846
  getFilePath() {
825
- const fullPath = import_node_path4.default.join(this.baseDir, this.relativeDirPath, this.relativeFilePath);
826
- const resolvedFull = (0, import_node_path4.resolve)(fullPath);
827
- const resolvedBase = (0, import_node_path4.resolve)(this.baseDir);
828
- const rel = (0, import_node_path4.relative)(resolvedBase, resolvedFull);
829
- if (rel.startsWith("..") || import_node_path4.default.isAbsolute(rel)) {
847
+ const fullPath = import_node_path5.default.join(this.baseDir, this.relativeDirPath, this.relativeFilePath);
848
+ const resolvedFull = (0, import_node_path5.resolve)(fullPath);
849
+ const resolvedBase = (0, import_node_path5.resolve)(this.baseDir);
850
+ const rel = (0, import_node_path5.relative)(resolvedBase, resolvedFull);
851
+ if (rel.startsWith("..") || import_node_path5.default.isAbsolute(rel)) {
830
852
  throw new Error(
831
853
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", relativeFilePath="${this.relativeFilePath}"`
832
854
  );
@@ -837,7 +859,7 @@ var AiFile = class {
837
859
  return this.fileContent;
838
860
  }
839
861
  getRelativePathFromCwd() {
840
- return import_node_path4.default.join(this.relativeDirPath, this.relativeFilePath);
862
+ return import_node_path5.default.join(this.relativeDirPath, this.relativeFilePath);
841
863
  }
842
864
  setFileContent(newFileContent) {
843
865
  this.fileContent = newFileContent;
@@ -944,7 +966,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
944
966
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
945
967
  if (!result.success) {
946
968
  throw new Error(
947
- `Invalid frontmatter in ${(0, import_node_path5.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
969
+ `Invalid frontmatter in ${(0, import_node_path6.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
948
970
  );
949
971
  }
950
972
  }
@@ -994,7 +1016,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
994
1016
  return {
995
1017
  success: false,
996
1018
  error: new Error(
997
- `Invalid frontmatter in ${(0, import_node_path5.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1019
+ `Invalid frontmatter in ${(0, import_node_path6.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
998
1020
  )
999
1021
  };
1000
1022
  }
@@ -1004,7 +1026,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
1004
1026
  relativeFilePath,
1005
1027
  validate = true
1006
1028
  }) {
1007
- const filePath = (0, import_node_path5.join)(
1029
+ const filePath = (0, import_node_path6.join)(
1008
1030
  baseDir,
1009
1031
  _SimulatedCommand.getSettablePaths().relativeDirPath,
1010
1032
  relativeFilePath
@@ -1044,7 +1066,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
1044
1066
  var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
1045
1067
  static getSettablePaths() {
1046
1068
  return {
1047
- relativeDirPath: (0, import_node_path6.join)(".agents", "commands")
1069
+ relativeDirPath: (0, import_node_path7.join)(".agents", "commands")
1048
1070
  };
1049
1071
  }
1050
1072
  static fromRulesyncCommand({
@@ -1061,7 +1083,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
1061
1083
  relativeFilePath,
1062
1084
  validate = true
1063
1085
  }) {
1064
- const filePath = (0, import_node_path6.join)(
1086
+ const filePath = (0, import_node_path7.join)(
1065
1087
  baseDir,
1066
1088
  _AgentsmdCommand.getSettablePaths().relativeDirPath,
1067
1089
  relativeFilePath
@@ -1099,7 +1121,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
1099
1121
  };
1100
1122
 
1101
1123
  // src/features/commands/antigravity-command.ts
1102
- var import_node_path8 = require("path");
1124
+ var import_node_path9 = require("path");
1103
1125
  var import_mini6 = require("zod/mini");
1104
1126
 
1105
1127
  // src/utils/type-guards.ts
@@ -1108,7 +1130,7 @@ function isRecord(value) {
1108
1130
  }
1109
1131
 
1110
1132
  // src/features/commands/rulesync-command.ts
1111
- var import_node_path7 = require("path");
1133
+ var import_node_path8 = require("path");
1112
1134
  var import_mini5 = require("zod/mini");
1113
1135
 
1114
1136
  // src/types/rulesync-file.ts
@@ -1130,7 +1152,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
1130
1152
  const parseResult = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
1131
1153
  if (!parseResult.success && rest.validate) {
1132
1154
  throw new Error(
1133
- `Invalid frontmatter in ${(0, import_node_path7.join)(rest.baseDir ?? process.cwd(), rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
1155
+ `Invalid frontmatter in ${(0, import_node_path8.join)(rest.baseDir ?? process.cwd(), rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
1134
1156
  );
1135
1157
  }
1136
1158
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -1173,7 +1195,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
1173
1195
  return {
1174
1196
  success: false,
1175
1197
  error: new Error(
1176
- `Invalid frontmatter in ${(0, import_node_path7.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1198
+ `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1177
1199
  )
1178
1200
  };
1179
1201
  }
@@ -1181,7 +1203,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
1181
1203
  static async fromFile({
1182
1204
  relativeFilePath
1183
1205
  }) {
1184
- const filePath = (0, import_node_path7.join)(
1206
+ const filePath = (0, import_node_path8.join)(
1185
1207
  process.cwd(),
1186
1208
  _RulesyncCommand.getSettablePaths().relativeDirPath,
1187
1209
  relativeFilePath
@@ -1218,7 +1240,7 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
1218
1240
  body;
1219
1241
  static getSettablePaths() {
1220
1242
  return {
1221
- relativeDirPath: (0, import_node_path8.join)(".agent", "workflows")
1243
+ relativeDirPath: (0, import_node_path9.join)(".agent", "workflows")
1222
1244
  };
1223
1245
  }
1224
1246
  constructor({ frontmatter, body, ...rest }) {
@@ -1226,7 +1248,7 @@ var AntigravityCommand = class _AntigravityCommand extends ToolCommand {
1226
1248
  const result = AntigravityCommandFrontmatterSchema.safeParse(frontmatter);
1227
1249
  if (!result.success) {
1228
1250
  throw new Error(
1229
- `Invalid frontmatter in ${(0, import_node_path8.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1251
+ `Invalid frontmatter in ${(0, import_node_path9.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1230
1252
  );
1231
1253
  }
1232
1254
  }
@@ -1310,7 +1332,7 @@ ${body}${turboDirective}`;
1310
1332
  const antigravityTrigger = antigravityConfig && typeof antigravityConfig.trigger === "string" ? antigravityConfig.trigger : void 0;
1311
1333
  const rootTrigger = typeof rulesyncFrontmatter.trigger === "string" ? rulesyncFrontmatter.trigger : void 0;
1312
1334
  const bodyTriggerMatch = rulesyncCommand.getBody().match(/trigger:\s*(\/[\w-]+)/);
1313
- const filenameTrigger = `/${(0, import_node_path8.basename)(rulesyncCommand.getRelativeFilePath(), ".md")}`;
1335
+ const filenameTrigger = `/${(0, import_node_path9.basename)(rulesyncCommand.getRelativeFilePath(), ".md")}`;
1314
1336
  return antigravityTrigger || rootTrigger || (bodyTriggerMatch ? bodyTriggerMatch[1] : void 0) || filenameTrigger;
1315
1337
  }
1316
1338
  validate() {
@@ -1324,7 +1346,7 @@ ${body}${turboDirective}`;
1324
1346
  return {
1325
1347
  success: false,
1326
1348
  error: new Error(
1327
- `Invalid frontmatter in ${(0, import_node_path8.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1349
+ `Invalid frontmatter in ${(0, import_node_path9.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1328
1350
  )
1329
1351
  };
1330
1352
  }
@@ -1340,7 +1362,7 @@ ${body}${turboDirective}`;
1340
1362
  relativeFilePath,
1341
1363
  validate = true
1342
1364
  }) {
1343
- const filePath = (0, import_node_path8.join)(
1365
+ const filePath = (0, import_node_path9.join)(
1344
1366
  baseDir,
1345
1367
  _AntigravityCommand.getSettablePaths().relativeDirPath,
1346
1368
  relativeFilePath
@@ -1379,7 +1401,7 @@ ${body}${turboDirective}`;
1379
1401
  };
1380
1402
 
1381
1403
  // src/features/commands/claudecode-command.ts
1382
- var import_node_path9 = require("path");
1404
+ var import_node_path10 = require("path");
1383
1405
  var import_mini7 = require("zod/mini");
1384
1406
  var ClaudecodeCommandFrontmatterSchema = import_mini7.z.looseObject({
1385
1407
  description: import_mini7.z.optional(import_mini7.z.string()),
@@ -1396,7 +1418,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1396
1418
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
1397
1419
  if (!result.success) {
1398
1420
  throw new Error(
1399
- `Invalid frontmatter in ${(0, import_node_path9.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1421
+ `Invalid frontmatter in ${(0, import_node_path10.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1400
1422
  );
1401
1423
  }
1402
1424
  }
@@ -1409,7 +1431,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1409
1431
  }
1410
1432
  static getSettablePaths(_options = {}) {
1411
1433
  return {
1412
- relativeDirPath: (0, import_node_path9.join)(".claude", "commands")
1434
+ relativeDirPath: (0, import_node_path10.join)(".claude", "commands")
1413
1435
  };
1414
1436
  }
1415
1437
  getBody() {
@@ -1472,7 +1494,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1472
1494
  return {
1473
1495
  success: false,
1474
1496
  error: new Error(
1475
- `Invalid frontmatter in ${(0, import_node_path9.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1497
+ `Invalid frontmatter in ${(0, import_node_path10.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1476
1498
  )
1477
1499
  };
1478
1500
  }
@@ -1490,7 +1512,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1490
1512
  global = false
1491
1513
  }) {
1492
1514
  const paths = this.getSettablePaths({ global });
1493
- const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1515
+ const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1494
1516
  const fileContent = await readFileContent(filePath);
1495
1517
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
1496
1518
  const result = ClaudecodeCommandFrontmatterSchema.safeParse(frontmatter);
@@ -1523,16 +1545,16 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
1523
1545
  };
1524
1546
 
1525
1547
  // src/features/commands/cline-command.ts
1526
- var import_node_path10 = require("path");
1548
+ var import_node_path11 = require("path");
1527
1549
  var ClineCommand = class _ClineCommand extends ToolCommand {
1528
1550
  static getSettablePaths({ global } = {}) {
1529
1551
  if (global) {
1530
1552
  return {
1531
- relativeDirPath: (0, import_node_path10.join)("Documents", "Cline", "Workflows")
1553
+ relativeDirPath: (0, import_node_path11.join)("Documents", "Cline", "Workflows")
1532
1554
  };
1533
1555
  }
1534
1556
  return {
1535
- relativeDirPath: (0, import_node_path10.join)(".clinerules", "workflows")
1557
+ relativeDirPath: (0, import_node_path11.join)(".clinerules", "workflows")
1536
1558
  };
1537
1559
  }
1538
1560
  toRulesyncCommand() {
@@ -1583,7 +1605,7 @@ var ClineCommand = class _ClineCommand extends ToolCommand {
1583
1605
  global = false
1584
1606
  }) {
1585
1607
  const paths = this.getSettablePaths({ global });
1586
- const filePath = (0, import_node_path10.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1608
+ const filePath = (0, import_node_path11.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1587
1609
  const fileContent = await readFileContent(filePath);
1588
1610
  const { body: content } = parseFrontmatter(fileContent, filePath);
1589
1611
  return new _ClineCommand({
@@ -1610,14 +1632,14 @@ var ClineCommand = class _ClineCommand extends ToolCommand {
1610
1632
  };
1611
1633
 
1612
1634
  // src/features/commands/codexcli-command.ts
1613
- var import_node_path11 = require("path");
1635
+ var import_node_path12 = require("path");
1614
1636
  var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
1615
1637
  static getSettablePaths({ global } = {}) {
1616
1638
  if (!global) {
1617
1639
  throw new Error("CodexcliCommand only supports global mode. Please pass { global: true }.");
1618
1640
  }
1619
1641
  return {
1620
- relativeDirPath: (0, import_node_path11.join)(".codex", "prompts")
1642
+ relativeDirPath: (0, import_node_path12.join)(".codex", "prompts")
1621
1643
  };
1622
1644
  }
1623
1645
  toRulesyncCommand() {
@@ -1669,7 +1691,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
1669
1691
  global = false
1670
1692
  }) {
1671
1693
  const paths = this.getSettablePaths({ global });
1672
- const filePath = (0, import_node_path11.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1694
+ const filePath = (0, import_node_path12.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1673
1695
  const fileContent = await readFileContent(filePath);
1674
1696
  const { body: content } = parseFrontmatter(fileContent, filePath);
1675
1697
  return new _CodexcliCommand({
@@ -1696,7 +1718,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
1696
1718
  };
1697
1719
 
1698
1720
  // src/features/commands/copilot-command.ts
1699
- var import_node_path12 = require("path");
1721
+ var import_node_path13 = require("path");
1700
1722
  var import_mini8 = require("zod/mini");
1701
1723
  var CopilotCommandFrontmatterSchema = import_mini8.z.looseObject({
1702
1724
  mode: import_mini8.z.optional(import_mini8.z.string()),
@@ -1710,7 +1732,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1710
1732
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
1711
1733
  if (!result.success) {
1712
1734
  throw new Error(
1713
- `Invalid frontmatter in ${(0, import_node_path12.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1735
+ `Invalid frontmatter in ${(0, import_node_path13.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1714
1736
  );
1715
1737
  }
1716
1738
  }
@@ -1723,7 +1745,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1723
1745
  }
1724
1746
  static getSettablePaths() {
1725
1747
  return {
1726
- relativeDirPath: (0, import_node_path12.join)(".github", "prompts")
1748
+ relativeDirPath: (0, import_node_path13.join)(".github", "prompts")
1727
1749
  };
1728
1750
  }
1729
1751
  getBody() {
@@ -1763,7 +1785,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1763
1785
  return {
1764
1786
  success: false,
1765
1787
  error: new Error(
1766
- `Invalid frontmatter in ${(0, import_node_path12.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1788
+ `Invalid frontmatter in ${(0, import_node_path13.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1767
1789
  )
1768
1790
  };
1769
1791
  }
@@ -1798,7 +1820,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1798
1820
  validate = true
1799
1821
  }) {
1800
1822
  const paths = this.getSettablePaths();
1801
- const filePath = (0, import_node_path12.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1823
+ const filePath = (0, import_node_path13.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1802
1824
  const fileContent = await readFileContent(filePath);
1803
1825
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
1804
1826
  const result = CopilotCommandFrontmatterSchema.safeParse(frontmatter);
@@ -1837,7 +1859,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
1837
1859
  };
1838
1860
 
1839
1861
  // src/features/commands/cursor-command.ts
1840
- var import_node_path13 = require("path");
1862
+ var import_node_path14 = require("path");
1841
1863
  var import_mini9 = require("zod/mini");
1842
1864
  var CursorCommandFrontmatterSchema = import_mini9.z.looseObject({
1843
1865
  description: import_mini9.z.optional(import_mini9.z.string()),
@@ -1860,7 +1882,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1860
1882
  const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
1861
1883
  if (!result.success) {
1862
1884
  throw new Error(
1863
- `Invalid frontmatter in ${(0, import_node_path13.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1885
+ `Invalid frontmatter in ${(0, import_node_path14.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
1864
1886
  );
1865
1887
  }
1866
1888
  }
@@ -1873,7 +1895,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1873
1895
  }
1874
1896
  static getSettablePaths(_options = {}) {
1875
1897
  return {
1876
- relativeDirPath: (0, import_node_path13.join)(".cursor", "commands")
1898
+ relativeDirPath: (0, import_node_path14.join)(".cursor", "commands")
1877
1899
  };
1878
1900
  }
1879
1901
  getBody() {
@@ -1936,7 +1958,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1936
1958
  return {
1937
1959
  success: false,
1938
1960
  error: new Error(
1939
- `Invalid frontmatter in ${(0, import_node_path13.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1961
+ `Invalid frontmatter in ${(0, import_node_path14.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
1940
1962
  )
1941
1963
  };
1942
1964
  }
@@ -1954,7 +1976,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1954
1976
  global = false
1955
1977
  }) {
1956
1978
  const paths = this.getSettablePaths({ global });
1957
- const filePath = (0, import_node_path13.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1979
+ const filePath = (0, import_node_path14.join)(baseDir, paths.relativeDirPath, relativeFilePath);
1958
1980
  const fileContent = await readFileContent(filePath);
1959
1981
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
1960
1982
  const result = CursorCommandFrontmatterSchema.safeParse(frontmatter);
@@ -1987,11 +2009,11 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1987
2009
  };
1988
2010
 
1989
2011
  // src/features/commands/factorydroid-command.ts
1990
- var import_node_path14 = require("path");
2012
+ var import_node_path15 = require("path");
1991
2013
  var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
1992
2014
  static getSettablePaths(_options) {
1993
2015
  return {
1994
- relativeDirPath: (0, import_node_path14.join)(".factory", "commands")
2016
+ relativeDirPath: (0, import_node_path15.join)(".factory", "commands")
1995
2017
  };
1996
2018
  }
1997
2019
  static fromRulesyncCommand({
@@ -2011,7 +2033,7 @@ var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
2011
2033
  global = false
2012
2034
  }) {
2013
2035
  const paths = _FactorydroidCommand.getSettablePaths({ global });
2014
- const filePath = (0, import_node_path14.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2036
+ const filePath = (0, import_node_path15.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2015
2037
  const fileContent = await readFileContent(filePath);
2016
2038
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2017
2039
  const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
@@ -2045,7 +2067,7 @@ var FactorydroidCommand = class _FactorydroidCommand extends SimulatedCommand {
2045
2067
  };
2046
2068
 
2047
2069
  // src/features/commands/geminicli-command.ts
2048
- var import_node_path15 = require("path");
2070
+ var import_node_path16 = require("path");
2049
2071
  var import_smol_toml = require("smol-toml");
2050
2072
  var import_mini10 = require("zod/mini");
2051
2073
  var GeminiCliCommandFrontmatterSchema = import_mini10.z.looseObject({
@@ -2063,7 +2085,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
2063
2085
  }
2064
2086
  static getSettablePaths(_options = {}) {
2065
2087
  return {
2066
- relativeDirPath: (0, import_node_path15.join)(".gemini", "commands")
2088
+ relativeDirPath: (0, import_node_path16.join)(".gemini", "commands")
2067
2089
  };
2068
2090
  }
2069
2091
  parseTomlContent(content) {
@@ -2072,7 +2094,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
2072
2094
  const result = GeminiCliCommandFrontmatterSchema.safeParse(parsed);
2073
2095
  if (!result.success) {
2074
2096
  throw new Error(
2075
- `Invalid frontmatter in ${(0, import_node_path15.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2097
+ `Invalid frontmatter in ${(0, import_node_path16.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2076
2098
  );
2077
2099
  }
2078
2100
  return {
@@ -2081,7 +2103,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
2081
2103
  };
2082
2104
  } catch (error) {
2083
2105
  throw new Error(
2084
- `Failed to parse TOML command file (${(0, import_node_path15.join)(this.relativeDirPath, this.relativeFilePath)}): ${formatError(error)}`,
2106
+ `Failed to parse TOML command file (${(0, import_node_path16.join)(this.relativeDirPath, this.relativeFilePath)}): ${formatError(error)}`,
2085
2107
  { cause: error }
2086
2108
  );
2087
2109
  }
@@ -2149,7 +2171,7 @@ ${geminiFrontmatter.prompt}
2149
2171
  global = false
2150
2172
  }) {
2151
2173
  const paths = this.getSettablePaths({ global });
2152
- const filePath = (0, import_node_path15.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2174
+ const filePath = (0, import_node_path16.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2153
2175
  const fileContent = await readFileContent(filePath);
2154
2176
  return new _GeminiCliCommand({
2155
2177
  baseDir,
@@ -2191,11 +2213,11 @@ prompt = ""`;
2191
2213
  };
2192
2214
 
2193
2215
  // src/features/commands/kilo-command.ts
2194
- var import_node_path16 = require("path");
2216
+ var import_node_path17 = require("path");
2195
2217
  var KiloCommand = class _KiloCommand extends ToolCommand {
2196
2218
  static getSettablePaths(_options = {}) {
2197
2219
  return {
2198
- relativeDirPath: (0, import_node_path16.join)(".kilocode", "workflows")
2220
+ relativeDirPath: (0, import_node_path17.join)(".kilocode", "workflows")
2199
2221
  };
2200
2222
  }
2201
2223
  toRulesyncCommand() {
@@ -2244,7 +2266,7 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
2244
2266
  validate = true
2245
2267
  }) {
2246
2268
  const paths = this.getSettablePaths();
2247
- const filePath = (0, import_node_path16.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2269
+ const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2248
2270
  const fileContent = await readFileContent(filePath);
2249
2271
  const { body: content } = parseFrontmatter(fileContent, filePath);
2250
2272
  return new _KiloCommand({
@@ -2271,11 +2293,11 @@ var KiloCommand = class _KiloCommand extends ToolCommand {
2271
2293
  };
2272
2294
 
2273
2295
  // src/features/commands/kiro-command.ts
2274
- var import_node_path17 = require("path");
2296
+ var import_node_path18 = require("path");
2275
2297
  var KiroCommand = class _KiroCommand extends ToolCommand {
2276
2298
  static getSettablePaths(_options = {}) {
2277
2299
  return {
2278
- relativeDirPath: (0, import_node_path17.join)(".kiro", "prompts")
2300
+ relativeDirPath: (0, import_node_path18.join)(".kiro", "prompts")
2279
2301
  };
2280
2302
  }
2281
2303
  toRulesyncCommand() {
@@ -2324,7 +2346,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
2324
2346
  validate = true
2325
2347
  }) {
2326
2348
  const paths = this.getSettablePaths();
2327
- const filePath = (0, import_node_path17.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2349
+ const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2328
2350
  const fileContent = await readFileContent(filePath);
2329
2351
  const { body: content } = parseFrontmatter(fileContent, filePath);
2330
2352
  return new _KiroCommand({
@@ -2351,7 +2373,7 @@ var KiroCommand = class _KiroCommand extends ToolCommand {
2351
2373
  };
2352
2374
 
2353
2375
  // src/features/commands/opencode-command.ts
2354
- var import_node_path18 = require("path");
2376
+ var import_node_path19 = require("path");
2355
2377
  var import_mini11 = require("zod/mini");
2356
2378
  var OpenCodeCommandFrontmatterSchema = import_mini11.z.looseObject({
2357
2379
  description: import_mini11.z.optional(import_mini11.z.string()),
@@ -2367,7 +2389,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2367
2389
  const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
2368
2390
  if (!result.success) {
2369
2391
  throw new Error(
2370
- `Invalid frontmatter in ${(0, import_node_path18.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2392
+ `Invalid frontmatter in ${(0, import_node_path19.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2371
2393
  );
2372
2394
  }
2373
2395
  }
@@ -2380,7 +2402,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2380
2402
  }
2381
2403
  static getSettablePaths({ global } = {}) {
2382
2404
  return {
2383
- relativeDirPath: global ? (0, import_node_path18.join)(".config", "opencode", "command") : (0, import_node_path18.join)(".opencode", "command")
2405
+ relativeDirPath: global ? (0, import_node_path19.join)(".config", "opencode", "command") : (0, import_node_path19.join)(".opencode", "command")
2384
2406
  };
2385
2407
  }
2386
2408
  getBody() {
@@ -2441,7 +2463,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2441
2463
  return {
2442
2464
  success: false,
2443
2465
  error: new Error(
2444
- `Invalid frontmatter in ${(0, import_node_path18.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2466
+ `Invalid frontmatter in ${(0, import_node_path19.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2445
2467
  )
2446
2468
  };
2447
2469
  }
@@ -2452,7 +2474,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2452
2474
  global = false
2453
2475
  }) {
2454
2476
  const paths = this.getSettablePaths({ global });
2455
- const filePath = (0, import_node_path18.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2477
+ const filePath = (0, import_node_path19.join)(baseDir, paths.relativeDirPath, relativeFilePath);
2456
2478
  const fileContent = await readFileContent(filePath);
2457
2479
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2458
2480
  const result = OpenCodeCommandFrontmatterSchema.safeParse(frontmatter);
@@ -2491,7 +2513,7 @@ var OpenCodeCommand = class _OpenCodeCommand extends ToolCommand {
2491
2513
  };
2492
2514
 
2493
2515
  // src/features/commands/roo-command.ts
2494
- var import_node_path19 = require("path");
2516
+ var import_node_path20 = require("path");
2495
2517
  var import_mini12 = require("zod/mini");
2496
2518
  var RooCommandFrontmatterSchema = import_mini12.z.looseObject({
2497
2519
  description: import_mini12.z.optional(import_mini12.z.string()),
@@ -2502,7 +2524,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2502
2524
  body;
2503
2525
  static getSettablePaths() {
2504
2526
  return {
2505
- relativeDirPath: (0, import_node_path19.join)(".roo", "commands")
2527
+ relativeDirPath: (0, import_node_path20.join)(".roo", "commands")
2506
2528
  };
2507
2529
  }
2508
2530
  constructor({ frontmatter, body, ...rest }) {
@@ -2510,7 +2532,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2510
2532
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
2511
2533
  if (!result.success) {
2512
2534
  throw new Error(
2513
- `Invalid frontmatter in ${(0, import_node_path19.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2535
+ `Invalid frontmatter in ${(0, import_node_path20.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
2514
2536
  );
2515
2537
  }
2516
2538
  }
@@ -2581,7 +2603,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2581
2603
  return {
2582
2604
  success: false,
2583
2605
  error: new Error(
2584
- `Invalid frontmatter in ${(0, import_node_path19.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2606
+ `Invalid frontmatter in ${(0, import_node_path20.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
2585
2607
  )
2586
2608
  };
2587
2609
  }
@@ -2597,7 +2619,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
2597
2619
  relativeFilePath,
2598
2620
  validate = true
2599
2621
  }) {
2600
- const filePath = (0, import_node_path19.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
2622
+ const filePath = (0, import_node_path20.join)(baseDir, _RooCommand.getSettablePaths().relativeDirPath, relativeFilePath);
2601
2623
  const fileContent = await readFileContent(filePath);
2602
2624
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
2603
2625
  const result = RooCommandFrontmatterSchema.safeParse(frontmatter);
@@ -2918,12 +2940,12 @@ var CommandsProcessor = class extends FeatureProcessor {
2918
2940
  return rulesyncCommands;
2919
2941
  }
2920
2942
  flattenRelativeFilePath(rulesyncCommand) {
2921
- const flatPath = (0, import_node_path20.basename)(rulesyncCommand.getRelativeFilePath());
2943
+ const flatPath = (0, import_node_path21.basename)(rulesyncCommand.getRelativeFilePath());
2922
2944
  if (flatPath === rulesyncCommand.getRelativeFilePath()) return rulesyncCommand;
2923
2945
  return rulesyncCommand.withRelativeFilePath(flatPath);
2924
2946
  }
2925
2947
  safeRelativePath(basePath, fullPath) {
2926
- const rel = (0, import_node_path20.relative)(basePath, fullPath);
2948
+ const rel = (0, import_node_path21.relative)(basePath, fullPath);
2927
2949
  checkPathTraversal({ relativePath: rel, intendedRootDir: basePath });
2928
2950
  return rel;
2929
2951
  }
@@ -2933,7 +2955,7 @@ var CommandsProcessor = class extends FeatureProcessor {
2933
2955
  */
2934
2956
  async loadRulesyncFiles() {
2935
2957
  const basePath = RulesyncCommand.getSettablePaths().relativeDirPath;
2936
- const rulesyncCommandPaths = await findFilesByGlobs((0, import_node_path20.join)(basePath, "**", "*.md"));
2958
+ const rulesyncCommandPaths = await findFilesByGlobs((0, import_node_path21.join)(basePath, "**", "*.md"));
2937
2959
  const rulesyncCommands = await Promise.all(
2938
2960
  rulesyncCommandPaths.map(
2939
2961
  (path3) => RulesyncCommand.fromFile({ relativeFilePath: this.safeRelativePath(basePath, path3) })
@@ -2951,8 +2973,8 @@ var CommandsProcessor = class extends FeatureProcessor {
2951
2973
  } = {}) {
2952
2974
  const factory = this.getFactory(this.toolTarget);
2953
2975
  const paths = factory.class.getSettablePaths({ global: this.global });
2954
- const baseDirFull = (0, import_node_path20.join)(this.baseDir, paths.relativeDirPath);
2955
- const globPattern = factory.meta.supportsSubdirectory ? (0, import_node_path20.join)(baseDirFull, "**", `*.${factory.meta.extension}`) : (0, import_node_path20.join)(baseDirFull, `*.${factory.meta.extension}`);
2976
+ const baseDirFull = (0, import_node_path21.join)(this.baseDir, paths.relativeDirPath);
2977
+ const globPattern = factory.meta.supportsSubdirectory ? (0, import_node_path21.join)(baseDirFull, "**", `*.${factory.meta.extension}`) : (0, import_node_path21.join)(baseDirFull, `*.${factory.meta.extension}`);
2956
2978
  const commandFilePaths = await findFilesByGlobs(globPattern);
2957
2979
  if (forDeletion) {
2958
2980
  const toolCommands2 = commandFilePaths.map(
@@ -3222,7 +3244,7 @@ var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3222
3244
  );
3223
3245
 
3224
3246
  // src/features/hooks/claudecode-hooks.ts
3225
- var import_node_path22 = require("path");
3247
+ var import_node_path23 = require("path");
3226
3248
 
3227
3249
  // src/features/hooks/tool-hooks-converter.ts
3228
3250
  function isToolMatcherEntry(x) {
@@ -3330,7 +3352,7 @@ var ToolFile = class extends AiFile {
3330
3352
  };
3331
3353
 
3332
3354
  // src/features/hooks/rulesync-hooks.ts
3333
- var import_node_path21 = require("path");
3355
+ var import_node_path22 = require("path");
3334
3356
  var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
3335
3357
  json;
3336
3358
  constructor(params) {
@@ -3361,7 +3383,7 @@ var RulesyncHooks = class _RulesyncHooks extends RulesyncFile {
3361
3383
  validate = true
3362
3384
  }) {
3363
3385
  const paths = _RulesyncHooks.getSettablePaths();
3364
- const filePath = (0, import_node_path21.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3386
+ const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3365
3387
  if (!await fileExists(filePath)) {
3366
3388
  throw new Error(`No ${RULESYNC_HOOKS_RELATIVE_FILE_PATH} found.`);
3367
3389
  }
@@ -3441,7 +3463,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3441
3463
  global = false
3442
3464
  }) {
3443
3465
  const paths = _ClaudecodeHooks.getSettablePaths({ global });
3444
- const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3466
+ const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3445
3467
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3446
3468
  return new _ClaudecodeHooks({
3447
3469
  baseDir,
@@ -3458,7 +3480,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3458
3480
  global = false
3459
3481
  }) {
3460
3482
  const paths = _ClaudecodeHooks.getSettablePaths({ global });
3461
- const filePath = (0, import_node_path22.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3483
+ const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3462
3484
  const existingContent = await readOrInitializeFileContent(
3463
3485
  filePath,
3464
3486
  JSON.stringify({}, null, 2)
@@ -3494,7 +3516,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3494
3516
  settings = JSON.parse(this.getFileContent());
3495
3517
  } catch (error) {
3496
3518
  throw new Error(
3497
- `Failed to parse Claude hooks content in ${(0, import_node_path22.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3519
+ `Failed to parse Claude hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3498
3520
  {
3499
3521
  cause: error
3500
3522
  }
@@ -3527,7 +3549,7 @@ var ClaudecodeHooks = class _ClaudecodeHooks extends ToolHooks {
3527
3549
  };
3528
3550
 
3529
3551
  // src/features/hooks/copilot-hooks.ts
3530
- var import_node_path23 = require("path");
3552
+ var import_node_path24 = require("path");
3531
3553
  var import_mini15 = require("zod/mini");
3532
3554
  var CopilotHookEntrySchema = import_mini15.z.looseObject({
3533
3555
  type: import_mini15.z.string(),
@@ -3630,7 +3652,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3630
3652
  }
3631
3653
  static getSettablePaths(_options = {}) {
3632
3654
  return {
3633
- relativeDirPath: (0, import_node_path23.join)(".github", "hooks"),
3655
+ relativeDirPath: (0, import_node_path24.join)(".github", "hooks"),
3634
3656
  relativeFilePath: "copilot-hooks.json"
3635
3657
  };
3636
3658
  }
@@ -3640,7 +3662,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3640
3662
  global = false
3641
3663
  }) {
3642
3664
  const paths = _CopilotHooks.getSettablePaths({ global });
3643
- const filePath = (0, import_node_path23.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3665
+ const filePath = (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3644
3666
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3645
3667
  return new _CopilotHooks({
3646
3668
  baseDir,
@@ -3673,7 +3695,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3673
3695
  parsed = JSON.parse(this.getFileContent());
3674
3696
  } catch (error) {
3675
3697
  throw new Error(
3676
- `Failed to parse Copilot hooks content in ${(0, import_node_path23.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3698
+ `Failed to parse Copilot hooks content in ${(0, import_node_path24.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3677
3699
  {
3678
3700
  cause: error
3679
3701
  }
@@ -3703,7 +3725,7 @@ var CopilotHooks = class _CopilotHooks extends ToolHooks {
3703
3725
  };
3704
3726
 
3705
3727
  // src/features/hooks/cursor-hooks.ts
3706
- var import_node_path24 = require("path");
3728
+ var import_node_path25 = require("path");
3707
3729
  var CursorHooks = class _CursorHooks extends ToolHooks {
3708
3730
  constructor(params) {
3709
3731
  const { rulesyncHooks: _r, ...rest } = params;
@@ -3724,7 +3746,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3724
3746
  }) {
3725
3747
  const paths = _CursorHooks.getSettablePaths();
3726
3748
  const fileContent = await readFileContent(
3727
- (0, import_node_path24.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3749
+ (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3728
3750
  );
3729
3751
  return new _CursorHooks({
3730
3752
  baseDir,
@@ -3811,7 +3833,7 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
3811
3833
  };
3812
3834
 
3813
3835
  // src/features/hooks/factorydroid-hooks.ts
3814
- var import_node_path25 = require("path");
3836
+ var import_node_path26 = require("path");
3815
3837
  var FACTORYDROID_CONVERTER_CONFIG = {
3816
3838
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
3817
3839
  canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
@@ -3837,7 +3859,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3837
3859
  global = false
3838
3860
  }) {
3839
3861
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3840
- const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3862
+ const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3841
3863
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
3842
3864
  return new _FactorydroidHooks({
3843
3865
  baseDir,
@@ -3854,7 +3876,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3854
3876
  global = false
3855
3877
  }) {
3856
3878
  const paths = _FactorydroidHooks.getSettablePaths({ global });
3857
- const filePath = (0, import_node_path25.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3879
+ const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3858
3880
  const existingContent = await readOrInitializeFileContent(
3859
3881
  filePath,
3860
3882
  JSON.stringify({}, null, 2)
@@ -3890,7 +3912,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3890
3912
  settings = JSON.parse(this.getFileContent());
3891
3913
  } catch (error) {
3892
3914
  throw new Error(
3893
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path25.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3915
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
3894
3916
  {
3895
3917
  cause: error
3896
3918
  }
@@ -3923,7 +3945,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
3923
3945
  };
3924
3946
 
3925
3947
  // src/features/hooks/geminicli-hooks.ts
3926
- var import_node_path26 = require("path");
3948
+ var import_node_path27 = require("path");
3927
3949
  var import_mini16 = require("zod/mini");
3928
3950
  function canonicalToGeminicliHooks(config) {
3929
3951
  const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
@@ -4032,7 +4054,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4032
4054
  global = false
4033
4055
  }) {
4034
4056
  const paths = _GeminicliHooks.getSettablePaths({ global });
4035
- const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4057
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4036
4058
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4037
4059
  return new _GeminicliHooks({
4038
4060
  baseDir,
@@ -4049,7 +4071,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4049
4071
  global = false
4050
4072
  }) {
4051
4073
  const paths = _GeminicliHooks.getSettablePaths({ global });
4052
- const filePath = (0, import_node_path26.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4074
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4053
4075
  const existingContent = await readOrInitializeFileContent(
4054
4076
  filePath,
4055
4077
  JSON.stringify({}, null, 2)
@@ -4081,7 +4103,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4081
4103
  settings = JSON.parse(this.getFileContent());
4082
4104
  } catch (error) {
4083
4105
  throw new Error(
4084
- `Failed to parse Gemini CLI hooks content in ${(0, import_node_path26.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4106
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4085
4107
  {
4086
4108
  cause: error
4087
4109
  }
@@ -4111,7 +4133,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4111
4133
  };
4112
4134
 
4113
4135
  // src/features/hooks/opencode-hooks.ts
4114
- var import_node_path27 = require("path");
4136
+ var import_node_path28 = require("path");
4115
4137
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
4116
4138
  function escapeForTemplateLiteral(command) {
4117
4139
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -4209,7 +4231,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4209
4231
  }
4210
4232
  static getSettablePaths(options) {
4211
4233
  return {
4212
- relativeDirPath: options?.global ? (0, import_node_path27.join)(".config", "opencode", "plugins") : (0, import_node_path27.join)(".opencode", "plugins"),
4234
+ relativeDirPath: options?.global ? (0, import_node_path28.join)(".config", "opencode", "plugins") : (0, import_node_path28.join)(".opencode", "plugins"),
4213
4235
  relativeFilePath: "rulesync-hooks.js"
4214
4236
  };
4215
4237
  }
@@ -4220,7 +4242,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4220
4242
  }) {
4221
4243
  const paths = _OpencodeHooks.getSettablePaths({ global });
4222
4244
  const fileContent = await readFileContent(
4223
- (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4245
+ (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4224
4246
  );
4225
4247
  return new _OpencodeHooks({
4226
4248
  baseDir,
@@ -4515,10 +4537,10 @@ var HooksProcessor = class extends FeatureProcessor {
4515
4537
  var import_mini18 = require("zod/mini");
4516
4538
 
4517
4539
  // src/features/ignore/augmentcode-ignore.ts
4518
- var import_node_path29 = require("path");
4540
+ var import_node_path30 = require("path");
4519
4541
 
4520
4542
  // src/features/ignore/rulesync-ignore.ts
4521
- var import_node_path28 = require("path");
4543
+ var import_node_path29 = require("path");
4522
4544
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4523
4545
  validate() {
4524
4546
  return { success: true, error: null };
@@ -4538,12 +4560,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4538
4560
  static async fromFile() {
4539
4561
  const baseDir = process.cwd();
4540
4562
  const paths = this.getSettablePaths();
4541
- const recommendedPath = (0, import_node_path28.join)(
4563
+ const recommendedPath = (0, import_node_path29.join)(
4542
4564
  baseDir,
4543
4565
  paths.recommended.relativeDirPath,
4544
4566
  paths.recommended.relativeFilePath
4545
4567
  );
4546
- const legacyPath = (0, import_node_path28.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4568
+ const legacyPath = (0, import_node_path29.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4547
4569
  if (await fileExists(recommendedPath)) {
4548
4570
  const fileContent2 = await readFileContent(recommendedPath);
4549
4571
  return new _RulesyncIgnore({
@@ -4659,7 +4681,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4659
4681
  validate = true
4660
4682
  }) {
4661
4683
  const fileContent = await readFileContent(
4662
- (0, import_node_path29.join)(
4684
+ (0, import_node_path30.join)(
4663
4685
  baseDir,
4664
4686
  this.getSettablePaths().relativeDirPath,
4665
4687
  this.getSettablePaths().relativeFilePath
@@ -4689,7 +4711,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4689
4711
  };
4690
4712
 
4691
4713
  // src/features/ignore/claudecode-ignore.ts
4692
- var import_node_path30 = require("path");
4714
+ var import_node_path31 = require("path");
4693
4715
  var import_es_toolkit2 = require("es-toolkit");
4694
4716
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4695
4717
  constructor(params) {
@@ -4732,7 +4754,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4732
4754
  const fileContent = rulesyncIgnore.getFileContent();
4733
4755
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4734
4756
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4735
- const filePath = (0, import_node_path30.join)(
4757
+ const filePath = (0, import_node_path31.join)(
4736
4758
  baseDir,
4737
4759
  this.getSettablePaths().relativeDirPath,
4738
4760
  this.getSettablePaths().relativeFilePath
@@ -4768,7 +4790,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4768
4790
  validate = true
4769
4791
  }) {
4770
4792
  const fileContent = await readFileContent(
4771
- (0, import_node_path30.join)(
4793
+ (0, import_node_path31.join)(
4772
4794
  baseDir,
4773
4795
  this.getSettablePaths().relativeDirPath,
4774
4796
  this.getSettablePaths().relativeFilePath
@@ -4798,7 +4820,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4798
4820
  };
4799
4821
 
4800
4822
  // src/features/ignore/cline-ignore.ts
4801
- var import_node_path31 = require("path");
4823
+ var import_node_path32 = require("path");
4802
4824
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4803
4825
  static getSettablePaths() {
4804
4826
  return {
@@ -4835,7 +4857,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4835
4857
  validate = true
4836
4858
  }) {
4837
4859
  const fileContent = await readFileContent(
4838
- (0, import_node_path31.join)(
4860
+ (0, import_node_path32.join)(
4839
4861
  baseDir,
4840
4862
  this.getSettablePaths().relativeDirPath,
4841
4863
  this.getSettablePaths().relativeFilePath
@@ -4865,7 +4887,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
4865
4887
  };
4866
4888
 
4867
4889
  // src/features/ignore/cursor-ignore.ts
4868
- var import_node_path32 = require("path");
4890
+ var import_node_path33 = require("path");
4869
4891
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4870
4892
  static getSettablePaths() {
4871
4893
  return {
@@ -4898,7 +4920,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4898
4920
  validate = true
4899
4921
  }) {
4900
4922
  const fileContent = await readFileContent(
4901
- (0, import_node_path32.join)(
4923
+ (0, import_node_path33.join)(
4902
4924
  baseDir,
4903
4925
  this.getSettablePaths().relativeDirPath,
4904
4926
  this.getSettablePaths().relativeFilePath
@@ -4928,7 +4950,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
4928
4950
  };
4929
4951
 
4930
4952
  // src/features/ignore/geminicli-ignore.ts
4931
- var import_node_path33 = require("path");
4953
+ var import_node_path34 = require("path");
4932
4954
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4933
4955
  static getSettablePaths() {
4934
4956
  return {
@@ -4955,7 +4977,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4955
4977
  validate = true
4956
4978
  }) {
4957
4979
  const fileContent = await readFileContent(
4958
- (0, import_node_path33.join)(
4980
+ (0, import_node_path34.join)(
4959
4981
  baseDir,
4960
4982
  this.getSettablePaths().relativeDirPath,
4961
4983
  this.getSettablePaths().relativeFilePath
@@ -4985,7 +5007,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
4985
5007
  };
4986
5008
 
4987
5009
  // src/features/ignore/goose-ignore.ts
4988
- var import_node_path34 = require("path");
5010
+ var import_node_path35 = require("path");
4989
5011
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
4990
5012
  static getSettablePaths() {
4991
5013
  return {
@@ -5022,7 +5044,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5022
5044
  validate = true
5023
5045
  }) {
5024
5046
  const fileContent = await readFileContent(
5025
- (0, import_node_path34.join)(
5047
+ (0, import_node_path35.join)(
5026
5048
  baseDir,
5027
5049
  this.getSettablePaths().relativeDirPath,
5028
5050
  this.getSettablePaths().relativeFilePath
@@ -5052,7 +5074,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5052
5074
  };
5053
5075
 
5054
5076
  // src/features/ignore/junie-ignore.ts
5055
- var import_node_path35 = require("path");
5077
+ var import_node_path36 = require("path");
5056
5078
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5057
5079
  static getSettablePaths() {
5058
5080
  return {
@@ -5079,7 +5101,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5079
5101
  validate = true
5080
5102
  }) {
5081
5103
  const fileContent = await readFileContent(
5082
- (0, import_node_path35.join)(
5104
+ (0, import_node_path36.join)(
5083
5105
  baseDir,
5084
5106
  this.getSettablePaths().relativeDirPath,
5085
5107
  this.getSettablePaths().relativeFilePath
@@ -5109,7 +5131,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5109
5131
  };
5110
5132
 
5111
5133
  // src/features/ignore/kilo-ignore.ts
5112
- var import_node_path36 = require("path");
5134
+ var import_node_path37 = require("path");
5113
5135
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5114
5136
  static getSettablePaths() {
5115
5137
  return {
@@ -5146,7 +5168,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5146
5168
  validate = true
5147
5169
  }) {
5148
5170
  const fileContent = await readFileContent(
5149
- (0, import_node_path36.join)(
5171
+ (0, import_node_path37.join)(
5150
5172
  baseDir,
5151
5173
  this.getSettablePaths().relativeDirPath,
5152
5174
  this.getSettablePaths().relativeFilePath
@@ -5176,7 +5198,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5176
5198
  };
5177
5199
 
5178
5200
  // src/features/ignore/kiro-ignore.ts
5179
- var import_node_path37 = require("path");
5201
+ var import_node_path38 = require("path");
5180
5202
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5181
5203
  static getSettablePaths() {
5182
5204
  return {
@@ -5203,7 +5225,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5203
5225
  validate = true
5204
5226
  }) {
5205
5227
  const fileContent = await readFileContent(
5206
- (0, import_node_path37.join)(
5228
+ (0, import_node_path38.join)(
5207
5229
  baseDir,
5208
5230
  this.getSettablePaths().relativeDirPath,
5209
5231
  this.getSettablePaths().relativeFilePath
@@ -5233,7 +5255,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5233
5255
  };
5234
5256
 
5235
5257
  // src/features/ignore/qwencode-ignore.ts
5236
- var import_node_path38 = require("path");
5258
+ var import_node_path39 = require("path");
5237
5259
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5238
5260
  static getSettablePaths() {
5239
5261
  return {
@@ -5260,7 +5282,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5260
5282
  validate = true
5261
5283
  }) {
5262
5284
  const fileContent = await readFileContent(
5263
- (0, import_node_path38.join)(
5285
+ (0, import_node_path39.join)(
5264
5286
  baseDir,
5265
5287
  this.getSettablePaths().relativeDirPath,
5266
5288
  this.getSettablePaths().relativeFilePath
@@ -5290,7 +5312,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5290
5312
  };
5291
5313
 
5292
5314
  // src/features/ignore/roo-ignore.ts
5293
- var import_node_path39 = require("path");
5315
+ var import_node_path40 = require("path");
5294
5316
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5295
5317
  static getSettablePaths() {
5296
5318
  return {
@@ -5317,7 +5339,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5317
5339
  validate = true
5318
5340
  }) {
5319
5341
  const fileContent = await readFileContent(
5320
- (0, import_node_path39.join)(
5342
+ (0, import_node_path40.join)(
5321
5343
  baseDir,
5322
5344
  this.getSettablePaths().relativeDirPath,
5323
5345
  this.getSettablePaths().relativeFilePath
@@ -5347,7 +5369,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5347
5369
  };
5348
5370
 
5349
5371
  // src/features/ignore/windsurf-ignore.ts
5350
- var import_node_path40 = require("path");
5372
+ var import_node_path41 = require("path");
5351
5373
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5352
5374
  static getSettablePaths() {
5353
5375
  return {
@@ -5374,7 +5396,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5374
5396
  validate = true
5375
5397
  }) {
5376
5398
  const fileContent = await readFileContent(
5377
- (0, import_node_path40.join)(
5399
+ (0, import_node_path41.join)(
5378
5400
  baseDir,
5379
5401
  this.getSettablePaths().relativeDirPath,
5380
5402
  this.getSettablePaths().relativeFilePath
@@ -5404,7 +5426,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5404
5426
  };
5405
5427
 
5406
5428
  // src/features/ignore/zed-ignore.ts
5407
- var import_node_path41 = require("path");
5429
+ var import_node_path42 = require("path");
5408
5430
  var import_es_toolkit3 = require("es-toolkit");
5409
5431
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5410
5432
  constructor(params) {
@@ -5441,7 +5463,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5441
5463
  }) {
5442
5464
  const fileContent = rulesyncIgnore.getFileContent();
5443
5465
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5444
- const filePath = (0, import_node_path41.join)(
5466
+ const filePath = (0, import_node_path42.join)(
5445
5467
  baseDir,
5446
5468
  this.getSettablePaths().relativeDirPath,
5447
5469
  this.getSettablePaths().relativeFilePath
@@ -5468,7 +5490,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5468
5490
  validate = true
5469
5491
  }) {
5470
5492
  const fileContent = await readFileContent(
5471
- (0, import_node_path41.join)(
5493
+ (0, import_node_path42.join)(
5472
5494
  baseDir,
5473
5495
  this.getSettablePaths().relativeDirPath,
5474
5496
  this.getSettablePaths().relativeFilePath
@@ -5655,10 +5677,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
5655
5677
  var import_mini22 = require("zod/mini");
5656
5678
 
5657
5679
  // src/features/mcp/claudecode-mcp.ts
5658
- var import_node_path43 = require("path");
5680
+ var import_node_path44 = require("path");
5659
5681
 
5660
5682
  // src/features/mcp/rulesync-mcp.ts
5661
- var import_node_path42 = require("path");
5683
+ var import_node_path43 = require("path");
5662
5684
  var import_object = require("es-toolkit/object");
5663
5685
  var import_mini20 = require("zod/mini");
5664
5686
 
@@ -5730,12 +5752,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5730
5752
  static async fromFile({ validate = true }) {
5731
5753
  const baseDir = process.cwd();
5732
5754
  const paths = this.getSettablePaths();
5733
- const recommendedPath = (0, import_node_path42.join)(
5755
+ const recommendedPath = (0, import_node_path43.join)(
5734
5756
  baseDir,
5735
5757
  paths.recommended.relativeDirPath,
5736
5758
  paths.recommended.relativeFilePath
5737
5759
  );
5738
- const legacyPath = (0, import_node_path42.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5760
+ const legacyPath = (0, import_node_path43.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5739
5761
  if (await fileExists(recommendedPath)) {
5740
5762
  const fileContent2 = await readFileContent(recommendedPath);
5741
5763
  return new _RulesyncMcp({
@@ -5880,7 +5902,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5880
5902
  global = false
5881
5903
  }) {
5882
5904
  const paths = this.getSettablePaths({ global });
5883
- const fileContent = await readFileContentOrNull((0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5905
+ const fileContent = await readFileContentOrNull((0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
5884
5906
  const json = JSON.parse(fileContent);
5885
5907
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
5886
5908
  return new _ClaudecodeMcp({
@@ -5899,7 +5921,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5899
5921
  }) {
5900
5922
  const paths = this.getSettablePaths({ global });
5901
5923
  const fileContent = await readOrInitializeFileContent(
5902
- (0, import_node_path43.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5924
+ (0, import_node_path44.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
5903
5925
  JSON.stringify({ mcpServers: {} }, null, 2)
5904
5926
  );
5905
5927
  const json = JSON.parse(fileContent);
@@ -5938,7 +5960,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
5938
5960
  };
5939
5961
 
5940
5962
  // src/features/mcp/cline-mcp.ts
5941
- var import_node_path44 = require("path");
5963
+ var import_node_path45 = require("path");
5942
5964
  var ClineMcp = class _ClineMcp extends ToolMcp {
5943
5965
  json;
5944
5966
  constructor(params) {
@@ -5959,7 +5981,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
5959
5981
  validate = true
5960
5982
  }) {
5961
5983
  const fileContent = await readFileContent(
5962
- (0, import_node_path44.join)(
5984
+ (0, import_node_path45.join)(
5963
5985
  baseDir,
5964
5986
  this.getSettablePaths().relativeDirPath,
5965
5987
  this.getSettablePaths().relativeFilePath
@@ -6008,7 +6030,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6008
6030
  };
6009
6031
 
6010
6032
  // src/features/mcp/codexcli-mcp.ts
6011
- var import_node_path45 = require("path");
6033
+ var import_node_path46 = require("path");
6012
6034
  var smolToml = __toESM(require("smol-toml"), 1);
6013
6035
  function convertFromCodexFormat(codexMcp) {
6014
6036
  const result = {};
@@ -6091,7 +6113,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6091
6113
  global = false
6092
6114
  }) {
6093
6115
  const paths = this.getSettablePaths({ global });
6094
- const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6116
+ const fileContent = await readFileContentOrNull((0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6095
6117
  return new _CodexcliMcp({
6096
6118
  baseDir,
6097
6119
  relativeDirPath: paths.relativeDirPath,
@@ -6107,7 +6129,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6107
6129
  global = false
6108
6130
  }) {
6109
6131
  const paths = this.getSettablePaths({ global });
6110
- const configTomlFilePath = (0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6132
+ const configTomlFilePath = (0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6111
6133
  const configTomlFileContent = await readOrInitializeFileContent(
6112
6134
  configTomlFilePath,
6113
6135
  smolToml.stringify({})
@@ -6164,7 +6186,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6164
6186
  };
6165
6187
 
6166
6188
  // src/features/mcp/copilot-mcp.ts
6167
- var import_node_path46 = require("path");
6189
+ var import_node_path47 = require("path");
6168
6190
  function convertToCopilotFormat(mcpServers) {
6169
6191
  return { servers: mcpServers };
6170
6192
  }
@@ -6191,7 +6213,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6191
6213
  validate = true
6192
6214
  }) {
6193
6215
  const fileContent = await readFileContent(
6194
- (0, import_node_path46.join)(
6216
+ (0, import_node_path47.join)(
6195
6217
  baseDir,
6196
6218
  this.getSettablePaths().relativeDirPath,
6197
6219
  this.getSettablePaths().relativeFilePath
@@ -6244,7 +6266,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6244
6266
  };
6245
6267
 
6246
6268
  // src/features/mcp/cursor-mcp.ts
6247
- var import_node_path47 = require("path");
6269
+ var import_node_path48 = require("path");
6248
6270
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
6249
6271
  function isMcpServers(value) {
6250
6272
  return value !== void 0 && value !== null && typeof value === "object";
@@ -6305,7 +6327,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6305
6327
  validate = true
6306
6328
  }) {
6307
6329
  const fileContent = await readFileContent(
6308
- (0, import_node_path47.join)(
6330
+ (0, import_node_path48.join)(
6309
6331
  baseDir,
6310
6332
  this.getSettablePaths().relativeDirPath,
6311
6333
  this.getSettablePaths().relativeFilePath
@@ -6373,7 +6395,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6373
6395
  };
6374
6396
 
6375
6397
  // src/features/mcp/factorydroid-mcp.ts
6376
- var import_node_path48 = require("path");
6398
+ var import_node_path49 = require("path");
6377
6399
  var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6378
6400
  json;
6379
6401
  constructor(params) {
@@ -6394,7 +6416,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6394
6416
  validate = true
6395
6417
  }) {
6396
6418
  const fileContent = await readFileContent(
6397
- (0, import_node_path48.join)(
6419
+ (0, import_node_path49.join)(
6398
6420
  baseDir,
6399
6421
  this.getSettablePaths().relativeDirPath,
6400
6422
  this.getSettablePaths().relativeFilePath
@@ -6454,7 +6476,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6454
6476
  };
6455
6477
 
6456
6478
  // src/features/mcp/geminicli-mcp.ts
6457
- var import_node_path49 = require("path");
6479
+ var import_node_path50 = require("path");
6458
6480
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6459
6481
  json;
6460
6482
  constructor(params) {
@@ -6482,7 +6504,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6482
6504
  global = false
6483
6505
  }) {
6484
6506
  const paths = this.getSettablePaths({ global });
6485
- const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6507
+ const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6486
6508
  const json = JSON.parse(fileContent);
6487
6509
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6488
6510
  return new _GeminiCliMcp({
@@ -6501,7 +6523,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6501
6523
  }) {
6502
6524
  const paths = this.getSettablePaths({ global });
6503
6525
  const fileContent = await readOrInitializeFileContent(
6504
- (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6526
+ (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6505
6527
  JSON.stringify({ mcpServers: {} }, null, 2)
6506
6528
  );
6507
6529
  const json = JSON.parse(fileContent);
@@ -6546,7 +6568,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6546
6568
  };
6547
6569
 
6548
6570
  // src/features/mcp/junie-mcp.ts
6549
- var import_node_path50 = require("path");
6571
+ var import_node_path51 = require("path");
6550
6572
  var JunieMcp = class _JunieMcp extends ToolMcp {
6551
6573
  json;
6552
6574
  constructor(params) {
@@ -6558,7 +6580,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6558
6580
  }
6559
6581
  static getSettablePaths() {
6560
6582
  return {
6561
- relativeDirPath: (0, import_node_path50.join)(".junie", "mcp"),
6583
+ relativeDirPath: (0, import_node_path51.join)(".junie", "mcp"),
6562
6584
  relativeFilePath: "mcp.json"
6563
6585
  };
6564
6586
  }
@@ -6567,7 +6589,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6567
6589
  validate = true
6568
6590
  }) {
6569
6591
  const fileContent = await readFileContent(
6570
- (0, import_node_path50.join)(
6592
+ (0, import_node_path51.join)(
6571
6593
  baseDir,
6572
6594
  this.getSettablePaths().relativeDirPath,
6573
6595
  this.getSettablePaths().relativeFilePath
@@ -6616,7 +6638,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6616
6638
  };
6617
6639
 
6618
6640
  // src/features/mcp/kilo-mcp.ts
6619
- var import_node_path51 = require("path");
6641
+ var import_node_path52 = require("path");
6620
6642
  var KiloMcp = class _KiloMcp extends ToolMcp {
6621
6643
  json;
6622
6644
  constructor(params) {
@@ -6637,7 +6659,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6637
6659
  validate = true
6638
6660
  }) {
6639
6661
  const paths = this.getSettablePaths();
6640
- const fileContent = await readFileContentOrNull((0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6662
+ const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6641
6663
  return new _KiloMcp({
6642
6664
  baseDir,
6643
6665
  relativeDirPath: paths.relativeDirPath,
@@ -6685,7 +6707,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
6685
6707
  };
6686
6708
 
6687
6709
  // src/features/mcp/kiro-mcp.ts
6688
- var import_node_path52 = require("path");
6710
+ var import_node_path53 = require("path");
6689
6711
  var KiroMcp = class _KiroMcp extends ToolMcp {
6690
6712
  json;
6691
6713
  constructor(params) {
@@ -6697,7 +6719,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6697
6719
  }
6698
6720
  static getSettablePaths() {
6699
6721
  return {
6700
- relativeDirPath: (0, import_node_path52.join)(".kiro", "settings"),
6722
+ relativeDirPath: (0, import_node_path53.join)(".kiro", "settings"),
6701
6723
  relativeFilePath: "mcp.json"
6702
6724
  };
6703
6725
  }
@@ -6706,7 +6728,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6706
6728
  validate = true
6707
6729
  }) {
6708
6730
  const paths = this.getSettablePaths();
6709
- const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6731
+ const fileContent = await readFileContentOrNull((0, import_node_path53.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6710
6732
  return new _KiroMcp({
6711
6733
  baseDir,
6712
6734
  relativeDirPath: paths.relativeDirPath,
@@ -6754,7 +6776,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
6754
6776
  };
6755
6777
 
6756
6778
  // src/features/mcp/opencode-mcp.ts
6757
- var import_node_path53 = require("path");
6779
+ var import_node_path54 = require("path");
6758
6780
  var import_jsonc_parser2 = require("jsonc-parser");
6759
6781
  var import_mini21 = require("zod/mini");
6760
6782
  var OpencodeMcpLocalServerSchema = import_mini21.z.object({
@@ -6895,7 +6917,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6895
6917
  static getSettablePaths({ global } = {}) {
6896
6918
  if (global) {
6897
6919
  return {
6898
- relativeDirPath: (0, import_node_path53.join)(".config", "opencode"),
6920
+ relativeDirPath: (0, import_node_path54.join)(".config", "opencode"),
6899
6921
  relativeFilePath: "opencode.json"
6900
6922
  };
6901
6923
  }
@@ -6910,11 +6932,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6910
6932
  global = false
6911
6933
  }) {
6912
6934
  const basePaths = this.getSettablePaths({ global });
6913
- const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
6935
+ const jsonDir = (0, import_node_path54.join)(baseDir, basePaths.relativeDirPath);
6914
6936
  let fileContent = null;
6915
6937
  let relativeFilePath = "opencode.jsonc";
6916
- const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
6917
- const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
6938
+ const jsoncPath = (0, import_node_path54.join)(jsonDir, "opencode.jsonc");
6939
+ const jsonPath = (0, import_node_path54.join)(jsonDir, "opencode.json");
6918
6940
  fileContent = await readFileContentOrNull(jsoncPath);
6919
6941
  if (!fileContent) {
6920
6942
  fileContent = await readFileContentOrNull(jsonPath);
@@ -6940,11 +6962,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
6940
6962
  global = false
6941
6963
  }) {
6942
6964
  const basePaths = this.getSettablePaths({ global });
6943
- const jsonDir = (0, import_node_path53.join)(baseDir, basePaths.relativeDirPath);
6965
+ const jsonDir = (0, import_node_path54.join)(baseDir, basePaths.relativeDirPath);
6944
6966
  let fileContent = null;
6945
6967
  let relativeFilePath = "opencode.jsonc";
6946
- const jsoncPath = (0, import_node_path53.join)(jsonDir, "opencode.jsonc");
6947
- const jsonPath = (0, import_node_path53.join)(jsonDir, "opencode.json");
6968
+ const jsoncPath = (0, import_node_path54.join)(jsonDir, "opencode.jsonc");
6969
+ const jsonPath = (0, import_node_path54.join)(jsonDir, "opencode.json");
6948
6970
  fileContent = await readFileContentOrNull(jsoncPath);
6949
6971
  if (!fileContent) {
6950
6972
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7005,7 +7027,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7005
7027
  };
7006
7028
 
7007
7029
  // src/features/mcp/roo-mcp.ts
7008
- var import_node_path54 = require("path");
7030
+ var import_node_path55 = require("path");
7009
7031
  function isRooMcpServers(value) {
7010
7032
  return value !== void 0 && value !== null && typeof value === "object";
7011
7033
  }
@@ -7057,7 +7079,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
7057
7079
  validate = true
7058
7080
  }) {
7059
7081
  const fileContent = await readFileContent(
7060
- (0, import_node_path54.join)(
7082
+ (0, import_node_path55.join)(
7061
7083
  baseDir,
7062
7084
  this.getSettablePaths().relativeDirPath,
7063
7085
  this.getSettablePaths().relativeFilePath
@@ -7430,25 +7452,25 @@ var McpProcessor = class extends FeatureProcessor {
7430
7452
  };
7431
7453
 
7432
7454
  // src/features/rules/rules-processor.ts
7433
- var import_node_path114 = require("path");
7455
+ var import_node_path117 = require("path");
7434
7456
  var import_toon = require("@toon-format/toon");
7435
- var import_mini54 = require("zod/mini");
7457
+ var import_mini56 = require("zod/mini");
7436
7458
 
7437
7459
  // src/constants/general.ts
7438
7460
  var SKILL_FILE_NAME = "SKILL.md";
7439
7461
 
7440
7462
  // src/features/skills/agentsmd-skill.ts
7441
- var import_node_path58 = require("path");
7463
+ var import_node_path59 = require("path");
7442
7464
 
7443
7465
  // src/features/skills/simulated-skill.ts
7444
- var import_node_path57 = require("path");
7466
+ var import_node_path58 = require("path");
7445
7467
  var import_mini23 = require("zod/mini");
7446
7468
 
7447
7469
  // src/features/skills/tool-skill.ts
7448
- var import_node_path56 = require("path");
7470
+ var import_node_path57 = require("path");
7449
7471
 
7450
7472
  // src/types/ai-dir.ts
7451
- var import_node_path55 = __toESM(require("path"), 1);
7473
+ var import_node_path56 = __toESM(require("path"), 1);
7452
7474
  var AiDir = class {
7453
7475
  /**
7454
7476
  * @example "."
@@ -7482,7 +7504,7 @@ var AiDir = class {
7482
7504
  otherFiles = [],
7483
7505
  global = false
7484
7506
  }) {
7485
- if (dirName.includes(import_node_path55.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7507
+ if (dirName.includes(import_node_path56.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7486
7508
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7487
7509
  }
7488
7510
  this.baseDir = baseDir;
@@ -7505,11 +7527,11 @@ var AiDir = class {
7505
7527
  return this.dirName;
7506
7528
  }
7507
7529
  getDirPath() {
7508
- const fullPath = import_node_path55.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7509
- const resolvedFull = (0, import_node_path55.resolve)(fullPath);
7510
- const resolvedBase = (0, import_node_path55.resolve)(this.baseDir);
7511
- const rel = (0, import_node_path55.relative)(resolvedBase, resolvedFull);
7512
- if (rel.startsWith("..") || import_node_path55.default.isAbsolute(rel)) {
7530
+ const fullPath = import_node_path56.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7531
+ const resolvedFull = (0, import_node_path56.resolve)(fullPath);
7532
+ const resolvedBase = (0, import_node_path56.resolve)(this.baseDir);
7533
+ const rel = (0, import_node_path56.relative)(resolvedBase, resolvedFull);
7534
+ if (rel.startsWith("..") || import_node_path56.default.isAbsolute(rel)) {
7513
7535
  throw new Error(
7514
7536
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7515
7537
  );
@@ -7523,7 +7545,7 @@ var AiDir = class {
7523
7545
  return this.otherFiles;
7524
7546
  }
7525
7547
  getRelativePathFromCwd() {
7526
- return import_node_path55.default.join(this.relativeDirPath, this.dirName);
7548
+ return import_node_path56.default.join(this.relativeDirPath, this.dirName);
7527
7549
  }
7528
7550
  getGlobal() {
7529
7551
  return this.global;
@@ -7542,15 +7564,15 @@ var AiDir = class {
7542
7564
  * @returns Array of files with their relative paths and buffers
7543
7565
  */
7544
7566
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7545
- const dirPath = (0, import_node_path55.join)(baseDir, relativeDirPath, dirName);
7546
- const glob = (0, import_node_path55.join)(dirPath, "**", "*");
7567
+ const dirPath = (0, import_node_path56.join)(baseDir, relativeDirPath, dirName);
7568
+ const glob = (0, import_node_path56.join)(dirPath, "**", "*");
7547
7569
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7548
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path55.basename)(filePath) !== excludeFileName);
7570
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path56.basename)(filePath) !== excludeFileName);
7549
7571
  const files = await Promise.all(
7550
7572
  filteredPaths.map(async (filePath) => {
7551
7573
  const fileBuffer = await readFileBuffer(filePath);
7552
7574
  return {
7553
- relativeFilePathToDirPath: (0, import_node_path55.relative)(dirPath, filePath),
7575
+ relativeFilePathToDirPath: (0, import_node_path56.relative)(dirPath, filePath),
7554
7576
  fileBuffer
7555
7577
  };
7556
7578
  })
@@ -7641,8 +7663,8 @@ var ToolSkill = class extends AiDir {
7641
7663
  }) {
7642
7664
  const settablePaths = getSettablePaths({ global });
7643
7665
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7644
- const skillDirPath = (0, import_node_path56.join)(baseDir, actualRelativeDirPath, dirName);
7645
- const skillFilePath = (0, import_node_path56.join)(skillDirPath, SKILL_FILE_NAME);
7666
+ const skillDirPath = (0, import_node_path57.join)(baseDir, actualRelativeDirPath, dirName);
7667
+ const skillFilePath = (0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME);
7646
7668
  if (!await fileExists(skillFilePath)) {
7647
7669
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7648
7670
  }
@@ -7666,7 +7688,7 @@ var ToolSkill = class extends AiDir {
7666
7688
  }
7667
7689
  requireMainFileFrontmatter() {
7668
7690
  if (!this.mainFile?.frontmatter) {
7669
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path56.join)(this.relativeDirPath, this.dirName)}`);
7691
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path57.join)(this.relativeDirPath, this.dirName)}`);
7670
7692
  }
7671
7693
  return this.mainFile.frontmatter;
7672
7694
  }
@@ -7706,7 +7728,7 @@ var SimulatedSkill = class extends ToolSkill {
7706
7728
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
7707
7729
  if (!result.success) {
7708
7730
  throw new Error(
7709
- `Invalid frontmatter in ${(0, import_node_path57.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7731
+ `Invalid frontmatter in ${(0, import_node_path58.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
7710
7732
  );
7711
7733
  }
7712
7734
  }
@@ -7764,8 +7786,8 @@ var SimulatedSkill = class extends ToolSkill {
7764
7786
  }) {
7765
7787
  const settablePaths = this.getSettablePaths();
7766
7788
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
7767
- const skillDirPath = (0, import_node_path57.join)(baseDir, actualRelativeDirPath, dirName);
7768
- const skillFilePath = (0, import_node_path57.join)(skillDirPath, SKILL_FILE_NAME);
7789
+ const skillDirPath = (0, import_node_path58.join)(baseDir, actualRelativeDirPath, dirName);
7790
+ const skillFilePath = (0, import_node_path58.join)(skillDirPath, SKILL_FILE_NAME);
7769
7791
  if (!await fileExists(skillFilePath)) {
7770
7792
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
7771
7793
  }
@@ -7842,7 +7864,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7842
7864
  throw new Error("AgentsmdSkill does not support global mode.");
7843
7865
  }
7844
7866
  return {
7845
- relativeDirPath: (0, import_node_path58.join)(".agents", "skills")
7867
+ relativeDirPath: (0, import_node_path59.join)(".agents", "skills")
7846
7868
  };
7847
7869
  }
7848
7870
  static async fromDir(params) {
@@ -7869,11 +7891,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
7869
7891
  };
7870
7892
 
7871
7893
  // src/features/skills/factorydroid-skill.ts
7872
- var import_node_path59 = require("path");
7894
+ var import_node_path60 = require("path");
7873
7895
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7874
7896
  static getSettablePaths(_options) {
7875
7897
  return {
7876
- relativeDirPath: (0, import_node_path59.join)(".factory", "skills")
7898
+ relativeDirPath: (0, import_node_path60.join)(".factory", "skills")
7877
7899
  };
7878
7900
  }
7879
7901
  static async fromDir(params) {
@@ -7900,11 +7922,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
7900
7922
  };
7901
7923
 
7902
7924
  // src/features/skills/skills-processor.ts
7903
- var import_node_path76 = require("path");
7904
- var import_mini38 = require("zod/mini");
7925
+ var import_node_path78 = require("path");
7926
+ var import_mini39 = require("zod/mini");
7905
7927
 
7906
7928
  // src/types/dir-feature-processor.ts
7907
- var import_node_path60 = require("path");
7929
+ var import_node_path61 = require("path");
7908
7930
  var DirFeatureProcessor = class {
7909
7931
  baseDir;
7910
7932
  dryRun;
@@ -7935,7 +7957,7 @@ var DirFeatureProcessor = class {
7935
7957
  const mainFile = aiDir.getMainFile();
7936
7958
  let mainFileContent;
7937
7959
  if (mainFile) {
7938
- const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
7960
+ const mainFilePath = (0, import_node_path61.join)(dirPath, mainFile.name);
7939
7961
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter);
7940
7962
  mainFileContent = addTrailingNewline(content);
7941
7963
  const existingContent = await readFileContentOrNull(mainFilePath);
@@ -7949,7 +7971,7 @@ var DirFeatureProcessor = class {
7949
7971
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
7950
7972
  otherFileContents.push(contentWithNewline);
7951
7973
  if (!dirHasChanges) {
7952
- const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
7974
+ const filePath = (0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath);
7953
7975
  const existingContent = await readFileContentOrNull(filePath);
7954
7976
  if (existingContent !== contentWithNewline) {
7955
7977
  dirHasChanges = true;
@@ -7963,22 +7985,22 @@ var DirFeatureProcessor = class {
7963
7985
  if (this.dryRun) {
7964
7986
  logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
7965
7987
  if (mainFile) {
7966
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, mainFile.name)}`);
7967
- changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
7988
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path61.join)(dirPath, mainFile.name)}`);
7989
+ changedPaths.push((0, import_node_path61.join)(relativeDir, mainFile.name));
7968
7990
  }
7969
7991
  for (const file of otherFiles) {
7970
- logger.info(`[DRY RUN] Would write: ${(0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath)}`);
7971
- changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
7992
+ logger.info(`[DRY RUN] Would write: ${(0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath)}`);
7993
+ changedPaths.push((0, import_node_path61.join)(relativeDir, file.relativeFilePathToDirPath));
7972
7994
  }
7973
7995
  } else {
7974
7996
  await ensureDir(dirPath);
7975
7997
  if (mainFile && mainFileContent) {
7976
- const mainFilePath = (0, import_node_path60.join)(dirPath, mainFile.name);
7998
+ const mainFilePath = (0, import_node_path61.join)(dirPath, mainFile.name);
7977
7999
  await writeFileContent(mainFilePath, mainFileContent);
7978
- changedPaths.push((0, import_node_path60.join)(relativeDir, mainFile.name));
8000
+ changedPaths.push((0, import_node_path61.join)(relativeDir, mainFile.name));
7979
8001
  }
7980
8002
  for (const [i, file] of otherFiles.entries()) {
7981
- const filePath = (0, import_node_path60.join)(dirPath, file.relativeFilePathToDirPath);
8003
+ const filePath = (0, import_node_path61.join)(dirPath, file.relativeFilePathToDirPath);
7982
8004
  const content = otherFileContents[i];
7983
8005
  if (content === void 0) {
7984
8006
  throw new Error(
@@ -7986,7 +8008,7 @@ var DirFeatureProcessor = class {
7986
8008
  );
7987
8009
  }
7988
8010
  await writeFileContent(filePath, content);
7989
- changedPaths.push((0, import_node_path60.join)(relativeDir, file.relativeFilePathToDirPath));
8011
+ changedPaths.push((0, import_node_path61.join)(relativeDir, file.relativeFilePathToDirPath));
7990
8012
  }
7991
8013
  }
7992
8014
  changedCount++;
@@ -8018,11 +8040,11 @@ var DirFeatureProcessor = class {
8018
8040
  };
8019
8041
 
8020
8042
  // src/features/skills/agentsskills-skill.ts
8021
- var import_node_path62 = require("path");
8043
+ var import_node_path63 = require("path");
8022
8044
  var import_mini25 = require("zod/mini");
8023
8045
 
8024
8046
  // src/features/skills/rulesync-skill.ts
8025
- var import_node_path61 = require("path");
8047
+ var import_node_path62 = require("path");
8026
8048
  var import_mini24 = require("zod/mini");
8027
8049
  var RulesyncSkillFrontmatterSchemaInternal = import_mini24.z.looseObject({
8028
8050
  name: import_mini24.z.string(),
@@ -8031,7 +8053,8 @@ var RulesyncSkillFrontmatterSchemaInternal = import_mini24.z.looseObject({
8031
8053
  claudecode: import_mini24.z.optional(
8032
8054
  import_mini24.z.looseObject({
8033
8055
  "allowed-tools": import_mini24.z.optional(import_mini24.z.array(import_mini24.z.string())),
8034
- model: import_mini24.z.optional(import_mini24.z.string())
8056
+ model: import_mini24.z.optional(import_mini24.z.string()),
8057
+ "disable-model-invocation": import_mini24.z.optional(import_mini24.z.boolean())
8035
8058
  })
8036
8059
  ),
8037
8060
  codexcli: import_mini24.z.optional(
@@ -8090,7 +8113,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8090
8113
  }
8091
8114
  getFrontmatter() {
8092
8115
  if (!this.mainFile?.frontmatter) {
8093
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path61.join)(this.relativeDirPath, this.dirName)}`);
8116
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path62.join)(this.relativeDirPath, this.dirName)}`);
8094
8117
  }
8095
8118
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
8096
8119
  return result;
@@ -8116,8 +8139,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8116
8139
  dirName,
8117
8140
  global = false
8118
8141
  }) {
8119
- const skillDirPath = (0, import_node_path61.join)(baseDir, relativeDirPath, dirName);
8120
- const skillFilePath = (0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME);
8142
+ const skillDirPath = (0, import_node_path62.join)(baseDir, relativeDirPath, dirName);
8143
+ const skillFilePath = (0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME);
8121
8144
  if (!await fileExists(skillFilePath)) {
8122
8145
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8123
8146
  }
@@ -8154,7 +8177,7 @@ var AgentsSkillsSkillFrontmatterSchema = import_mini25.z.looseObject({
8154
8177
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8155
8178
  constructor({
8156
8179
  baseDir = process.cwd(),
8157
- relativeDirPath = (0, import_node_path62.join)(".agents", "skills"),
8180
+ relativeDirPath = (0, import_node_path63.join)(".agents", "skills"),
8158
8181
  dirName,
8159
8182
  frontmatter,
8160
8183
  body,
@@ -8186,7 +8209,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8186
8209
  throw new Error("AgentsSkillsSkill does not support global mode.");
8187
8210
  }
8188
8211
  return {
8189
- relativeDirPath: (0, import_node_path62.join)(".agents", "skills")
8212
+ relativeDirPath: (0, import_node_path63.join)(".agents", "skills")
8190
8213
  };
8191
8214
  }
8192
8215
  getFrontmatter() {
@@ -8265,9 +8288,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8265
8288
  });
8266
8289
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8267
8290
  if (!result.success) {
8268
- const skillDirPath = (0, import_node_path62.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8291
+ const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8269
8292
  throw new Error(
8270
- `Invalid frontmatter in ${(0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8293
+ `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8271
8294
  );
8272
8295
  }
8273
8296
  return new _AgentsSkillsSkill({
@@ -8302,7 +8325,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8302
8325
  };
8303
8326
 
8304
8327
  // src/features/skills/antigravity-skill.ts
8305
- var import_node_path63 = require("path");
8328
+ var import_node_path64 = require("path");
8306
8329
  var import_mini26 = require("zod/mini");
8307
8330
  var AntigravitySkillFrontmatterSchema = import_mini26.z.looseObject({
8308
8331
  name: import_mini26.z.string(),
@@ -8311,7 +8334,7 @@ var AntigravitySkillFrontmatterSchema = import_mini26.z.looseObject({
8311
8334
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8312
8335
  constructor({
8313
8336
  baseDir = process.cwd(),
8314
- relativeDirPath = (0, import_node_path63.join)(".agent", "skills"),
8337
+ relativeDirPath = (0, import_node_path64.join)(".agent", "skills"),
8315
8338
  dirName,
8316
8339
  frontmatter,
8317
8340
  body,
@@ -8343,11 +8366,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8343
8366
  } = {}) {
8344
8367
  if (global) {
8345
8368
  return {
8346
- relativeDirPath: (0, import_node_path63.join)(".gemini", "antigravity", "skills")
8369
+ relativeDirPath: (0, import_node_path64.join)(".gemini", "antigravity", "skills")
8347
8370
  };
8348
8371
  }
8349
8372
  return {
8350
- relativeDirPath: (0, import_node_path63.join)(".agent", "skills")
8373
+ relativeDirPath: (0, import_node_path64.join)(".agent", "skills")
8351
8374
  };
8352
8375
  }
8353
8376
  getFrontmatter() {
@@ -8426,9 +8449,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8426
8449
  });
8427
8450
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
8428
8451
  if (!result.success) {
8429
- const skillDirPath = (0, import_node_path63.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8452
+ const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8430
8453
  throw new Error(
8431
- `Invalid frontmatter in ${(0, import_node_path63.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8454
+ `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8432
8455
  );
8433
8456
  }
8434
8457
  return new _AntigravitySkill({
@@ -8462,18 +8485,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8462
8485
  };
8463
8486
 
8464
8487
  // src/features/skills/claudecode-skill.ts
8465
- var import_node_path64 = require("path");
8488
+ var import_node_path65 = require("path");
8466
8489
  var import_mini27 = require("zod/mini");
8467
8490
  var ClaudecodeSkillFrontmatterSchema = import_mini27.z.looseObject({
8468
8491
  name: import_mini27.z.string(),
8469
8492
  description: import_mini27.z.string(),
8470
8493
  "allowed-tools": import_mini27.z.optional(import_mini27.z.array(import_mini27.z.string())),
8471
- model: import_mini27.z.optional(import_mini27.z.string())
8494
+ model: import_mini27.z.optional(import_mini27.z.string()),
8495
+ "disable-model-invocation": import_mini27.z.optional(import_mini27.z.boolean())
8472
8496
  });
8473
8497
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8474
8498
  constructor({
8475
8499
  baseDir = process.cwd(),
8476
- relativeDirPath = (0, import_node_path64.join)(".claude", "skills"),
8500
+ relativeDirPath = (0, import_node_path65.join)(".claude", "skills"),
8477
8501
  dirName,
8478
8502
  frontmatter,
8479
8503
  body,
@@ -8504,7 +8528,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8504
8528
  global: _global = false
8505
8529
  } = {}) {
8506
8530
  return {
8507
- relativeDirPath: (0, import_node_path64.join)(".claude", "skills")
8531
+ relativeDirPath: (0, import_node_path65.join)(".claude", "skills")
8508
8532
  };
8509
8533
  }
8510
8534
  getFrontmatter() {
@@ -8536,7 +8560,10 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8536
8560
  const frontmatter = this.getFrontmatter();
8537
8561
  const claudecodeSection = {
8538
8562
  ...frontmatter["allowed-tools"] && { "allowed-tools": frontmatter["allowed-tools"] },
8539
- ...frontmatter.model && { model: frontmatter.model }
8563
+ ...frontmatter.model && { model: frontmatter.model },
8564
+ ...frontmatter["disable-model-invocation"] !== void 0 && {
8565
+ "disable-model-invocation": frontmatter["disable-model-invocation"]
8566
+ }
8540
8567
  };
8541
8568
  const rulesyncFrontmatter = {
8542
8569
  name: frontmatter.name,
@@ -8569,6 +8596,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8569
8596
  },
8570
8597
  ...rulesyncFrontmatter.claudecode?.model && {
8571
8598
  model: rulesyncFrontmatter.claudecode.model
8599
+ },
8600
+ ...rulesyncFrontmatter.claudecode?.["disable-model-invocation"] !== void 0 && {
8601
+ "disable-model-invocation": rulesyncFrontmatter.claudecode["disable-model-invocation"]
8572
8602
  }
8573
8603
  };
8574
8604
  const settablePaths = _ClaudecodeSkill.getSettablePaths({ global });
@@ -8594,9 +8624,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8594
8624
  });
8595
8625
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8596
8626
  if (!result.success) {
8597
- const skillDirPath = (0, import_node_path64.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8627
+ const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8598
8628
  throw new Error(
8599
- `Invalid frontmatter in ${(0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8629
+ `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8600
8630
  );
8601
8631
  }
8602
8632
  return new _ClaudecodeSkill({
@@ -8630,7 +8660,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8630
8660
  };
8631
8661
 
8632
8662
  // src/features/skills/cline-skill.ts
8633
- var import_node_path65 = require("path");
8663
+ var import_node_path66 = require("path");
8634
8664
  var import_mini28 = require("zod/mini");
8635
8665
  var ClineSkillFrontmatterSchema = import_mini28.z.looseObject({
8636
8666
  name: import_mini28.z.string(),
@@ -8639,7 +8669,7 @@ var ClineSkillFrontmatterSchema = import_mini28.z.looseObject({
8639
8669
  var ClineSkill = class _ClineSkill extends ToolSkill {
8640
8670
  constructor({
8641
8671
  baseDir = process.cwd(),
8642
- relativeDirPath = (0, import_node_path65.join)(".cline", "skills"),
8672
+ relativeDirPath = (0, import_node_path66.join)(".cline", "skills"),
8643
8673
  dirName,
8644
8674
  frontmatter,
8645
8675
  body,
@@ -8668,7 +8698,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8668
8698
  }
8669
8699
  static getSettablePaths(_options = {}) {
8670
8700
  return {
8671
- relativeDirPath: (0, import_node_path65.join)(".cline", "skills")
8701
+ relativeDirPath: (0, import_node_path66.join)(".cline", "skills")
8672
8702
  };
8673
8703
  }
8674
8704
  getFrontmatter() {
@@ -8755,13 +8785,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8755
8785
  });
8756
8786
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8757
8787
  if (!result.success) {
8758
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8788
+ const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8759
8789
  throw new Error(
8760
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8790
+ `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8761
8791
  );
8762
8792
  }
8763
8793
  if (result.data.name !== loaded.dirName) {
8764
- const skillFilePath = (0, import_node_path65.join)(
8794
+ const skillFilePath = (0, import_node_path66.join)(
8765
8795
  loaded.baseDir,
8766
8796
  loaded.relativeDirPath,
8767
8797
  loaded.dirName,
@@ -8802,7 +8832,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
8802
8832
  };
8803
8833
 
8804
8834
  // src/features/skills/codexcli-skill.ts
8805
- var import_node_path66 = require("path");
8835
+ var import_node_path67 = require("path");
8806
8836
  var import_mini29 = require("zod/mini");
8807
8837
  var CodexCliSkillFrontmatterSchema = import_mini29.z.looseObject({
8808
8838
  name: import_mini29.z.string(),
@@ -8816,7 +8846,7 @@ var CodexCliSkillFrontmatterSchema = import_mini29.z.looseObject({
8816
8846
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8817
8847
  constructor({
8818
8848
  baseDir = process.cwd(),
8819
- relativeDirPath = (0, import_node_path66.join)(".codex", "skills"),
8849
+ relativeDirPath = (0, import_node_path67.join)(".codex", "skills"),
8820
8850
  dirName,
8821
8851
  frontmatter,
8822
8852
  body,
@@ -8847,7 +8877,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8847
8877
  global: _global = false
8848
8878
  } = {}) {
8849
8879
  return {
8850
- relativeDirPath: (0, import_node_path66.join)(".codex", "skills")
8880
+ relativeDirPath: (0, import_node_path67.join)(".codex", "skills")
8851
8881
  };
8852
8882
  }
8853
8883
  getFrontmatter() {
@@ -8936,9 +8966,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8936
8966
  });
8937
8967
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8938
8968
  if (!result.success) {
8939
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8969
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8940
8970
  throw new Error(
8941
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8971
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8942
8972
  );
8943
8973
  }
8944
8974
  return new _CodexCliSkill({
@@ -8972,7 +9002,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
8972
9002
  };
8973
9003
 
8974
9004
  // src/features/skills/copilot-skill.ts
8975
- var import_node_path67 = require("path");
9005
+ var import_node_path68 = require("path");
8976
9006
  var import_mini30 = require("zod/mini");
8977
9007
  var CopilotSkillFrontmatterSchema = import_mini30.z.looseObject({
8978
9008
  name: import_mini30.z.string(),
@@ -8982,7 +9012,7 @@ var CopilotSkillFrontmatterSchema = import_mini30.z.looseObject({
8982
9012
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
8983
9013
  constructor({
8984
9014
  baseDir = process.cwd(),
8985
- relativeDirPath = (0, import_node_path67.join)(".github", "skills"),
9015
+ relativeDirPath = (0, import_node_path68.join)(".github", "skills"),
8986
9016
  dirName,
8987
9017
  frontmatter,
8988
9018
  body,
@@ -9014,7 +9044,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9014
9044
  throw new Error("CopilotSkill does not support global mode.");
9015
9045
  }
9016
9046
  return {
9017
- relativeDirPath: (0, import_node_path67.join)(".github", "skills")
9047
+ relativeDirPath: (0, import_node_path68.join)(".github", "skills")
9018
9048
  };
9019
9049
  }
9020
9050
  getFrontmatter() {
@@ -9099,9 +9129,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9099
9129
  });
9100
9130
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9101
9131
  if (!result.success) {
9102
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9132
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9103
9133
  throw new Error(
9104
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9134
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9105
9135
  );
9106
9136
  }
9107
9137
  return new _CopilotSkill({
@@ -9136,7 +9166,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9136
9166
  };
9137
9167
 
9138
9168
  // src/features/skills/cursor-skill.ts
9139
- var import_node_path68 = require("path");
9169
+ var import_node_path69 = require("path");
9140
9170
  var import_mini31 = require("zod/mini");
9141
9171
  var CursorSkillFrontmatterSchema = import_mini31.z.looseObject({
9142
9172
  name: import_mini31.z.string(),
@@ -9145,7 +9175,7 @@ var CursorSkillFrontmatterSchema = import_mini31.z.looseObject({
9145
9175
  var CursorSkill = class _CursorSkill extends ToolSkill {
9146
9176
  constructor({
9147
9177
  baseDir = process.cwd(),
9148
- relativeDirPath = (0, import_node_path68.join)(".cursor", "skills"),
9178
+ relativeDirPath = (0, import_node_path69.join)(".cursor", "skills"),
9149
9179
  dirName,
9150
9180
  frontmatter,
9151
9181
  body,
@@ -9174,7 +9204,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9174
9204
  }
9175
9205
  static getSettablePaths(_options) {
9176
9206
  return {
9177
- relativeDirPath: (0, import_node_path68.join)(".cursor", "skills")
9207
+ relativeDirPath: (0, import_node_path69.join)(".cursor", "skills")
9178
9208
  };
9179
9209
  }
9180
9210
  getFrontmatter() {
@@ -9253,9 +9283,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9253
9283
  });
9254
9284
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9255
9285
  if (!result.success) {
9256
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9286
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9257
9287
  throw new Error(
9258
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9288
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9259
9289
  );
9260
9290
  }
9261
9291
  return new _CursorSkill({
@@ -9290,7 +9320,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9290
9320
  };
9291
9321
 
9292
9322
  // src/features/skills/geminicli-skill.ts
9293
- var import_node_path69 = require("path");
9323
+ var import_node_path70 = require("path");
9294
9324
  var import_mini32 = require("zod/mini");
9295
9325
  var GeminiCliSkillFrontmatterSchema = import_mini32.z.looseObject({
9296
9326
  name: import_mini32.z.string(),
@@ -9330,7 +9360,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9330
9360
  global: _global = false
9331
9361
  } = {}) {
9332
9362
  return {
9333
- relativeDirPath: (0, import_node_path69.join)(".gemini", "skills")
9363
+ relativeDirPath: (0, import_node_path70.join)(".gemini", "skills")
9334
9364
  };
9335
9365
  }
9336
9366
  getFrontmatter() {
@@ -9409,9 +9439,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9409
9439
  });
9410
9440
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9411
9441
  if (!result.success) {
9412
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9442
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9413
9443
  throw new Error(
9414
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9444
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9415
9445
  );
9416
9446
  }
9417
9447
  return new _GeminiCliSkill({
@@ -9445,17 +9475,193 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9445
9475
  }
9446
9476
  };
9447
9477
 
9448
- // src/features/skills/kilo-skill.ts
9449
- var import_node_path70 = require("path");
9478
+ // src/features/skills/junie-skill.ts
9479
+ var import_node_path71 = require("path");
9450
9480
  var import_mini33 = require("zod/mini");
9451
- var KiloSkillFrontmatterSchema = import_mini33.z.looseObject({
9481
+ var JunieSkillFrontmatterSchema = import_mini33.z.looseObject({
9452
9482
  name: import_mini33.z.string(),
9453
9483
  description: import_mini33.z.string()
9454
9484
  });
9455
- var KiloSkill = class _KiloSkill extends ToolSkill {
9485
+ var JunieSkill = class _JunieSkill extends ToolSkill {
9456
9486
  constructor({
9457
9487
  baseDir = process.cwd(),
9458
- relativeDirPath = (0, import_node_path70.join)(".kilocode", "skills"),
9488
+ relativeDirPath = (0, import_node_path71.join)(".junie", "skills"),
9489
+ dirName,
9490
+ frontmatter,
9491
+ body,
9492
+ otherFiles = [],
9493
+ validate = true,
9494
+ global = false
9495
+ }) {
9496
+ super({
9497
+ baseDir,
9498
+ relativeDirPath,
9499
+ dirName,
9500
+ mainFile: {
9501
+ name: SKILL_FILE_NAME,
9502
+ body,
9503
+ frontmatter: { ...frontmatter }
9504
+ },
9505
+ otherFiles,
9506
+ global
9507
+ });
9508
+ if (validate) {
9509
+ const result = this.validate();
9510
+ if (!result.success) {
9511
+ throw result.error;
9512
+ }
9513
+ }
9514
+ }
9515
+ static getSettablePaths(options) {
9516
+ if (options?.global) {
9517
+ throw new Error("JunieSkill does not support global mode.");
9518
+ }
9519
+ return {
9520
+ relativeDirPath: (0, import_node_path71.join)(".junie", "skills")
9521
+ };
9522
+ }
9523
+ getFrontmatter() {
9524
+ const result = JunieSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
9525
+ return result;
9526
+ }
9527
+ getBody() {
9528
+ return this.mainFile?.body ?? "";
9529
+ }
9530
+ validate() {
9531
+ if (!this.mainFile) {
9532
+ return {
9533
+ success: false,
9534
+ error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
9535
+ };
9536
+ }
9537
+ const result = JunieSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
9538
+ if (!result.success) {
9539
+ return {
9540
+ success: false,
9541
+ error: new Error(
9542
+ `Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
9543
+ )
9544
+ };
9545
+ }
9546
+ if (result.data.name !== this.getDirName()) {
9547
+ return {
9548
+ success: false,
9549
+ error: new Error(
9550
+ `${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
9551
+ )
9552
+ };
9553
+ }
9554
+ return { success: true, error: null };
9555
+ }
9556
+ toRulesyncSkill() {
9557
+ const frontmatter = this.getFrontmatter();
9558
+ const rulesyncFrontmatter = {
9559
+ name: frontmatter.name,
9560
+ description: frontmatter.description,
9561
+ targets: ["*"]
9562
+ };
9563
+ return new RulesyncSkill({
9564
+ baseDir: this.baseDir,
9565
+ relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
9566
+ dirName: this.getDirName(),
9567
+ frontmatter: rulesyncFrontmatter,
9568
+ body: this.getBody(),
9569
+ otherFiles: this.getOtherFiles(),
9570
+ validate: true,
9571
+ global: this.global
9572
+ });
9573
+ }
9574
+ static fromRulesyncSkill({
9575
+ rulesyncSkill,
9576
+ validate = true,
9577
+ global = false
9578
+ }) {
9579
+ const settablePaths = _JunieSkill.getSettablePaths({ global });
9580
+ const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
9581
+ const junieFrontmatter = {
9582
+ name: rulesyncFrontmatter.name,
9583
+ description: rulesyncFrontmatter.description
9584
+ };
9585
+ return new _JunieSkill({
9586
+ baseDir: rulesyncSkill.getBaseDir(),
9587
+ relativeDirPath: settablePaths.relativeDirPath,
9588
+ dirName: junieFrontmatter.name,
9589
+ frontmatter: junieFrontmatter,
9590
+ body: rulesyncSkill.getBody(),
9591
+ otherFiles: rulesyncSkill.getOtherFiles(),
9592
+ validate,
9593
+ global
9594
+ });
9595
+ }
9596
+ static isTargetedByRulesyncSkill(rulesyncSkill) {
9597
+ const targets = rulesyncSkill.getFrontmatter().targets;
9598
+ return targets.includes("*") || targets.includes("junie");
9599
+ }
9600
+ static async fromDir(params) {
9601
+ const loaded = await this.loadSkillDirContent({
9602
+ ...params,
9603
+ getSettablePaths: _JunieSkill.getSettablePaths
9604
+ });
9605
+ const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9606
+ if (!result.success) {
9607
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9608
+ throw new Error(
9609
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9610
+ );
9611
+ }
9612
+ if (result.data.name !== loaded.dirName) {
9613
+ const skillFilePath = (0, import_node_path71.join)(
9614
+ loaded.baseDir,
9615
+ loaded.relativeDirPath,
9616
+ loaded.dirName,
9617
+ SKILL_FILE_NAME
9618
+ );
9619
+ throw new Error(
9620
+ `Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
9621
+ );
9622
+ }
9623
+ return new _JunieSkill({
9624
+ baseDir: loaded.baseDir,
9625
+ relativeDirPath: loaded.relativeDirPath,
9626
+ dirName: loaded.dirName,
9627
+ frontmatter: result.data,
9628
+ body: loaded.body,
9629
+ otherFiles: loaded.otherFiles,
9630
+ validate: true,
9631
+ global: loaded.global
9632
+ });
9633
+ }
9634
+ static forDeletion({
9635
+ baseDir = process.cwd(),
9636
+ relativeDirPath,
9637
+ dirName,
9638
+ global = false
9639
+ }) {
9640
+ const settablePaths = _JunieSkill.getSettablePaths({ global });
9641
+ return new _JunieSkill({
9642
+ baseDir,
9643
+ relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
9644
+ dirName,
9645
+ frontmatter: { name: "", description: "" },
9646
+ body: "",
9647
+ otherFiles: [],
9648
+ validate: false,
9649
+ global
9650
+ });
9651
+ }
9652
+ };
9653
+
9654
+ // src/features/skills/kilo-skill.ts
9655
+ var import_node_path72 = require("path");
9656
+ var import_mini34 = require("zod/mini");
9657
+ var KiloSkillFrontmatterSchema = import_mini34.z.looseObject({
9658
+ name: import_mini34.z.string(),
9659
+ description: import_mini34.z.string()
9660
+ });
9661
+ var KiloSkill = class _KiloSkill extends ToolSkill {
9662
+ constructor({
9663
+ baseDir = process.cwd(),
9664
+ relativeDirPath = (0, import_node_path72.join)(".kilocode", "skills"),
9459
9665
  dirName,
9460
9666
  frontmatter,
9461
9667
  body,
@@ -9486,7 +9692,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9486
9692
  global: _global = false
9487
9693
  } = {}) {
9488
9694
  return {
9489
- relativeDirPath: (0, import_node_path70.join)(".kilocode", "skills")
9695
+ relativeDirPath: (0, import_node_path72.join)(".kilocode", "skills")
9490
9696
  };
9491
9697
  }
9492
9698
  getFrontmatter() {
@@ -9573,13 +9779,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9573
9779
  });
9574
9780
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9575
9781
  if (!result.success) {
9576
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9782
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9577
9783
  throw new Error(
9578
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9784
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9579
9785
  );
9580
9786
  }
9581
9787
  if (result.data.name !== loaded.dirName) {
9582
- const skillFilePath = (0, import_node_path70.join)(
9788
+ const skillFilePath = (0, import_node_path72.join)(
9583
9789
  loaded.baseDir,
9584
9790
  loaded.relativeDirPath,
9585
9791
  loaded.dirName,
@@ -9620,16 +9826,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
9620
9826
  };
9621
9827
 
9622
9828
  // src/features/skills/kiro-skill.ts
9623
- var import_node_path71 = require("path");
9624
- var import_mini34 = require("zod/mini");
9625
- var KiroSkillFrontmatterSchema = import_mini34.z.looseObject({
9626
- name: import_mini34.z.string(),
9627
- description: import_mini34.z.string()
9829
+ var import_node_path73 = require("path");
9830
+ var import_mini35 = require("zod/mini");
9831
+ var KiroSkillFrontmatterSchema = import_mini35.z.looseObject({
9832
+ name: import_mini35.z.string(),
9833
+ description: import_mini35.z.string()
9628
9834
  });
9629
9835
  var KiroSkill = class _KiroSkill extends ToolSkill {
9630
9836
  constructor({
9631
9837
  baseDir = process.cwd(),
9632
- relativeDirPath = (0, import_node_path71.join)(".kiro", "skills"),
9838
+ relativeDirPath = (0, import_node_path73.join)(".kiro", "skills"),
9633
9839
  dirName,
9634
9840
  frontmatter,
9635
9841
  body,
@@ -9661,7 +9867,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9661
9867
  throw new Error("KiroSkill does not support global mode.");
9662
9868
  }
9663
9869
  return {
9664
- relativeDirPath: (0, import_node_path71.join)(".kiro", "skills")
9870
+ relativeDirPath: (0, import_node_path73.join)(".kiro", "skills")
9665
9871
  };
9666
9872
  }
9667
9873
  getFrontmatter() {
@@ -9748,13 +9954,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9748
9954
  });
9749
9955
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9750
9956
  if (!result.success) {
9751
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9957
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9752
9958
  throw new Error(
9753
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9959
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9754
9960
  );
9755
9961
  }
9756
9962
  if (result.data.name !== loaded.dirName) {
9757
- const skillFilePath = (0, import_node_path71.join)(
9963
+ const skillFilePath = (0, import_node_path73.join)(
9758
9964
  loaded.baseDir,
9759
9965
  loaded.relativeDirPath,
9760
9966
  loaded.dirName,
@@ -9796,17 +10002,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
9796
10002
  };
9797
10003
 
9798
10004
  // src/features/skills/opencode-skill.ts
9799
- var import_node_path72 = require("path");
9800
- var import_mini35 = require("zod/mini");
9801
- var OpenCodeSkillFrontmatterSchema = import_mini35.z.looseObject({
9802
- name: import_mini35.z.string(),
9803
- description: import_mini35.z.string(),
9804
- "allowed-tools": import_mini35.z.optional(import_mini35.z.array(import_mini35.z.string()))
10005
+ var import_node_path74 = require("path");
10006
+ var import_mini36 = require("zod/mini");
10007
+ var OpenCodeSkillFrontmatterSchema = import_mini36.z.looseObject({
10008
+ name: import_mini36.z.string(),
10009
+ description: import_mini36.z.string(),
10010
+ "allowed-tools": import_mini36.z.optional(import_mini36.z.array(import_mini36.z.string()))
9805
10011
  });
9806
10012
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9807
10013
  constructor({
9808
10014
  baseDir = process.cwd(),
9809
- relativeDirPath = (0, import_node_path72.join)(".opencode", "skill"),
10015
+ relativeDirPath = (0, import_node_path74.join)(".opencode", "skill"),
9810
10016
  dirName,
9811
10017
  frontmatter,
9812
10018
  body,
@@ -9835,7 +10041,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9835
10041
  }
9836
10042
  static getSettablePaths({ global = false } = {}) {
9837
10043
  return {
9838
- relativeDirPath: global ? (0, import_node_path72.join)(".config", "opencode", "skill") : (0, import_node_path72.join)(".opencode", "skill")
10044
+ relativeDirPath: global ? (0, import_node_path74.join)(".config", "opencode", "skill") : (0, import_node_path74.join)(".opencode", "skill")
9839
10045
  };
9840
10046
  }
9841
10047
  getFrontmatter() {
@@ -9920,9 +10126,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9920
10126
  });
9921
10127
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9922
10128
  if (!result.success) {
9923
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10129
+ const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9924
10130
  throw new Error(
9925
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10131
+ `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9926
10132
  );
9927
10133
  }
9928
10134
  return new _OpenCodeSkill({
@@ -9956,16 +10162,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
9956
10162
  };
9957
10163
 
9958
10164
  // src/features/skills/replit-skill.ts
9959
- var import_node_path73 = require("path");
9960
- var import_mini36 = require("zod/mini");
9961
- var ReplitSkillFrontmatterSchema = import_mini36.z.looseObject({
9962
- name: import_mini36.z.string(),
9963
- description: import_mini36.z.string()
10165
+ var import_node_path75 = require("path");
10166
+ var import_mini37 = require("zod/mini");
10167
+ var ReplitSkillFrontmatterSchema = import_mini37.z.looseObject({
10168
+ name: import_mini37.z.string(),
10169
+ description: import_mini37.z.string()
9964
10170
  });
9965
10171
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
9966
10172
  constructor({
9967
10173
  baseDir = process.cwd(),
9968
- relativeDirPath = (0, import_node_path73.join)(".agents", "skills"),
10174
+ relativeDirPath = (0, import_node_path75.join)(".agents", "skills"),
9969
10175
  dirName,
9970
10176
  frontmatter,
9971
10177
  body,
@@ -9997,7 +10203,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
9997
10203
  throw new Error("ReplitSkill does not support global mode.");
9998
10204
  }
9999
10205
  return {
10000
- relativeDirPath: (0, import_node_path73.join)(".agents", "skills")
10206
+ relativeDirPath: (0, import_node_path75.join)(".agents", "skills")
10001
10207
  };
10002
10208
  }
10003
10209
  getFrontmatter() {
@@ -10076,9 +10282,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10076
10282
  });
10077
10283
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10078
10284
  if (!result.success) {
10079
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10285
+ const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10080
10286
  throw new Error(
10081
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10287
+ `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10082
10288
  );
10083
10289
  }
10084
10290
  return new _ReplitSkill({
@@ -10113,16 +10319,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10113
10319
  };
10114
10320
 
10115
10321
  // src/features/skills/roo-skill.ts
10116
- var import_node_path74 = require("path");
10117
- var import_mini37 = require("zod/mini");
10118
- var RooSkillFrontmatterSchema = import_mini37.z.looseObject({
10119
- name: import_mini37.z.string(),
10120
- description: import_mini37.z.string()
10322
+ var import_node_path76 = require("path");
10323
+ var import_mini38 = require("zod/mini");
10324
+ var RooSkillFrontmatterSchema = import_mini38.z.looseObject({
10325
+ name: import_mini38.z.string(),
10326
+ description: import_mini38.z.string()
10121
10327
  });
10122
10328
  var RooSkill = class _RooSkill extends ToolSkill {
10123
10329
  constructor({
10124
10330
  baseDir = process.cwd(),
10125
- relativeDirPath = (0, import_node_path74.join)(".roo", "skills"),
10331
+ relativeDirPath = (0, import_node_path76.join)(".roo", "skills"),
10126
10332
  dirName,
10127
10333
  frontmatter,
10128
10334
  body,
@@ -10153,7 +10359,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
10153
10359
  global: _global = false
10154
10360
  } = {}) {
10155
10361
  return {
10156
- relativeDirPath: (0, import_node_path74.join)(".roo", "skills")
10362
+ relativeDirPath: (0, import_node_path76.join)(".roo", "skills")
10157
10363
  };
10158
10364
  }
10159
10365
  getFrontmatter() {
@@ -10240,13 +10446,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
10240
10446
  });
10241
10447
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10242
10448
  if (!result.success) {
10243
- const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10449
+ const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10244
10450
  throw new Error(
10245
- `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10451
+ `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10246
10452
  );
10247
10453
  }
10248
10454
  if (result.data.name !== loaded.dirName) {
10249
- const skillFilePath = (0, import_node_path74.join)(
10455
+ const skillFilePath = (0, import_node_path76.join)(
10250
10456
  loaded.baseDir,
10251
10457
  loaded.relativeDirPath,
10252
10458
  loaded.dirName,
@@ -10287,17 +10493,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
10287
10493
  };
10288
10494
 
10289
10495
  // src/features/skills/skills-utils.ts
10290
- var import_node_path75 = require("path");
10496
+ var import_node_path77 = require("path");
10291
10497
  async function getLocalSkillDirNames(baseDir) {
10292
- const skillsDir = (0, import_node_path75.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10498
+ const skillsDir = (0, import_node_path77.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10293
10499
  const names = /* @__PURE__ */ new Set();
10294
10500
  if (!await directoryExists(skillsDir)) {
10295
10501
  return names;
10296
10502
  }
10297
- const dirPaths = await findFilesByGlobs((0, import_node_path75.join)(skillsDir, "*"), { type: "dir" });
10503
+ const dirPaths = await findFilesByGlobs((0, import_node_path77.join)(skillsDir, "*"), { type: "dir" });
10298
10504
  for (const dirPath of dirPaths) {
10299
- const name = (0, import_node_path75.basename)(dirPath);
10300
- if (name === (0, import_node_path75.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10505
+ const name = (0, import_node_path77.basename)(dirPath);
10506
+ if (name === (0, import_node_path77.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10301
10507
  names.add(name);
10302
10508
  }
10303
10509
  return names;
@@ -10316,13 +10522,14 @@ var skillsProcessorToolTargetTuple = [
10316
10522
  "cursor",
10317
10523
  "factorydroid",
10318
10524
  "geminicli",
10525
+ "junie",
10319
10526
  "kilo",
10320
10527
  "kiro",
10321
10528
  "opencode",
10322
10529
  "replit",
10323
10530
  "roo"
10324
10531
  ];
10325
- var SkillsProcessorToolTargetSchema = import_mini38.z.enum(skillsProcessorToolTargetTuple);
10532
+ var SkillsProcessorToolTargetSchema = import_mini39.z.enum(skillsProcessorToolTargetTuple);
10326
10533
  var toolSkillFactories = /* @__PURE__ */ new Map([
10327
10534
  [
10328
10535
  "agentsmd",
@@ -10401,6 +10608,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
10401
10608
  meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
10402
10609
  }
10403
10610
  ],
10611
+ [
10612
+ "junie",
10613
+ {
10614
+ class: JunieSkill,
10615
+ meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: false }
10616
+ }
10617
+ ],
10404
10618
  [
10405
10619
  "kilo",
10406
10620
  {
@@ -10523,11 +10737,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10523
10737
  )
10524
10738
  );
10525
10739
  const localSkillNames = new Set(localDirNames);
10526
- const curatedDirPath = (0, import_node_path76.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10740
+ const curatedDirPath = (0, import_node_path78.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
10527
10741
  let curatedSkills = [];
10528
10742
  if (await directoryExists(curatedDirPath)) {
10529
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path76.join)(curatedDirPath, "*"), { type: "dir" });
10530
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10743
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path78.join)(curatedDirPath, "*"), { type: "dir" });
10744
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path78.basename)(path3));
10531
10745
  const nonConflicting = curatedDirNames.filter((name) => {
10532
10746
  if (localSkillNames.has(name)) {
10533
10747
  logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -10560,9 +10774,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10560
10774
  async loadToolDirs() {
10561
10775
  const factory = this.getFactory(this.toolTarget);
10562
10776
  const paths = factory.class.getSettablePaths({ global: this.global });
10563
- const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
10564
- const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
10565
- const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10777
+ const skillsDirPath = (0, import_node_path78.join)(this.baseDir, paths.relativeDirPath);
10778
+ const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDirPath, "*"), { type: "dir" });
10779
+ const dirNames = dirPaths.map((path3) => (0, import_node_path78.basename)(path3));
10566
10780
  const toolSkills = await Promise.all(
10567
10781
  dirNames.map(
10568
10782
  (dirName) => factory.class.fromDir({
@@ -10578,9 +10792,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10578
10792
  async loadToolDirsToDelete() {
10579
10793
  const factory = this.getFactory(this.toolTarget);
10580
10794
  const paths = factory.class.getSettablePaths({ global: this.global });
10581
- const skillsDirPath = (0, import_node_path76.join)(this.baseDir, paths.relativeDirPath);
10582
- const dirPaths = await findFilesByGlobs((0, import_node_path76.join)(skillsDirPath, "*"), { type: "dir" });
10583
- const dirNames = dirPaths.map((path3) => (0, import_node_path76.basename)(path3));
10795
+ const skillsDirPath = (0, import_node_path78.join)(this.baseDir, paths.relativeDirPath);
10796
+ const dirPaths = await findFilesByGlobs((0, import_node_path78.join)(skillsDirPath, "*"), { type: "dir" });
10797
+ const dirNames = dirPaths.map((path3) => (0, import_node_path78.basename)(path3));
10584
10798
  const toolSkills = dirNames.map(
10585
10799
  (dirName) => factory.class.forDeletion({
10586
10800
  baseDir: this.baseDir,
@@ -10641,11 +10855,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
10641
10855
  };
10642
10856
 
10643
10857
  // src/features/subagents/agentsmd-subagent.ts
10644
- var import_node_path78 = require("path");
10858
+ var import_node_path80 = require("path");
10645
10859
 
10646
10860
  // src/features/subagents/simulated-subagent.ts
10647
- var import_node_path77 = require("path");
10648
- var import_mini39 = require("zod/mini");
10861
+ var import_node_path79 = require("path");
10862
+ var import_mini40 = require("zod/mini");
10649
10863
 
10650
10864
  // src/features/subagents/tool-subagent.ts
10651
10865
  var ToolSubagent = class extends ToolFile {
@@ -10697,9 +10911,9 @@ var ToolSubagent = class extends ToolFile {
10697
10911
  };
10698
10912
 
10699
10913
  // src/features/subagents/simulated-subagent.ts
10700
- var SimulatedSubagentFrontmatterSchema = import_mini39.z.object({
10701
- name: import_mini39.z.string(),
10702
- description: import_mini39.z.optional(import_mini39.z.string())
10914
+ var SimulatedSubagentFrontmatterSchema = import_mini40.z.object({
10915
+ name: import_mini40.z.string(),
10916
+ description: import_mini40.z.optional(import_mini40.z.string())
10703
10917
  });
10704
10918
  var SimulatedSubagent = class extends ToolSubagent {
10705
10919
  frontmatter;
@@ -10709,7 +10923,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10709
10923
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
10710
10924
  if (!result.success) {
10711
10925
  throw new Error(
10712
- `Invalid frontmatter in ${(0, import_node_path77.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10926
+ `Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10713
10927
  );
10714
10928
  }
10715
10929
  }
@@ -10760,7 +10974,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10760
10974
  return {
10761
10975
  success: false,
10762
10976
  error: new Error(
10763
- `Invalid frontmatter in ${(0, import_node_path77.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10977
+ `Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10764
10978
  )
10765
10979
  };
10766
10980
  }
@@ -10770,7 +10984,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10770
10984
  relativeFilePath,
10771
10985
  validate = true
10772
10986
  }) {
10773
- const filePath = (0, import_node_path77.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10987
+ const filePath = (0, import_node_path79.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
10774
10988
  const fileContent = await readFileContent(filePath);
10775
10989
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10776
10990
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10780,7 +10994,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10780
10994
  return {
10781
10995
  baseDir,
10782
10996
  relativeDirPath: this.getSettablePaths().relativeDirPath,
10783
- relativeFilePath: (0, import_node_path77.basename)(relativeFilePath),
10997
+ relativeFilePath: (0, import_node_path79.basename)(relativeFilePath),
10784
10998
  frontmatter: result.data,
10785
10999
  body: content.trim(),
10786
11000
  validate
@@ -10806,7 +11020,7 @@ var SimulatedSubagent = class extends ToolSubagent {
10806
11020
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10807
11021
  static getSettablePaths() {
10808
11022
  return {
10809
- relativeDirPath: (0, import_node_path78.join)(".agents", "subagents")
11023
+ relativeDirPath: (0, import_node_path80.join)(".agents", "subagents")
10810
11024
  };
10811
11025
  }
10812
11026
  static async fromFile(params) {
@@ -10829,11 +11043,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10829
11043
  };
10830
11044
 
10831
11045
  // src/features/subagents/factorydroid-subagent.ts
10832
- var import_node_path79 = require("path");
11046
+ var import_node_path81 = require("path");
10833
11047
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10834
11048
  static getSettablePaths(_options) {
10835
11049
  return {
10836
- relativeDirPath: (0, import_node_path79.join)(".factory", "droids")
11050
+ relativeDirPath: (0, import_node_path81.join)(".factory", "droids")
10837
11051
  };
10838
11052
  }
10839
11053
  static async fromFile(params) {
@@ -10856,11 +11070,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10856
11070
  };
10857
11071
 
10858
11072
  // src/features/subagents/geminicli-subagent.ts
10859
- var import_node_path80 = require("path");
11073
+ var import_node_path82 = require("path");
10860
11074
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10861
11075
  static getSettablePaths() {
10862
11076
  return {
10863
- relativeDirPath: (0, import_node_path80.join)(".gemini", "subagents")
11077
+ relativeDirPath: (0, import_node_path82.join)(".gemini", "subagents")
10864
11078
  };
10865
11079
  }
10866
11080
  static async fromFile(params) {
@@ -10883,11 +11097,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10883
11097
  };
10884
11098
 
10885
11099
  // src/features/subagents/roo-subagent.ts
10886
- var import_node_path81 = require("path");
11100
+ var import_node_path83 = require("path");
10887
11101
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10888
11102
  static getSettablePaths() {
10889
11103
  return {
10890
- relativeDirPath: (0, import_node_path81.join)(".roo", "subagents")
11104
+ relativeDirPath: (0, import_node_path83.join)(".roo", "subagents")
10891
11105
  };
10892
11106
  }
10893
11107
  static async fromFile(params) {
@@ -10910,20 +11124,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10910
11124
  };
10911
11125
 
10912
11126
  // src/features/subagents/subagents-processor.ts
10913
- var import_node_path89 = require("path");
10914
- var import_mini47 = require("zod/mini");
11127
+ var import_node_path92 = require("path");
11128
+ var import_mini49 = require("zod/mini");
10915
11129
 
10916
11130
  // src/features/subagents/claudecode-subagent.ts
10917
- var import_node_path83 = require("path");
10918
- var import_mini41 = require("zod/mini");
11131
+ var import_node_path85 = require("path");
11132
+ var import_mini42 = require("zod/mini");
10919
11133
 
10920
11134
  // src/features/subagents/rulesync-subagent.ts
10921
- var import_node_path82 = require("path");
10922
- var import_mini40 = require("zod/mini");
10923
- var RulesyncSubagentFrontmatterSchema = import_mini40.z.looseObject({
10924
- targets: import_mini40.z._default(RulesyncTargetsSchema, ["*"]),
10925
- name: import_mini40.z.string(),
10926
- description: import_mini40.z.optional(import_mini40.z.string())
11135
+ var import_node_path84 = require("path");
11136
+ var import_mini41 = require("zod/mini");
11137
+ var RulesyncSubagentFrontmatterSchema = import_mini41.z.looseObject({
11138
+ targets: import_mini41.z._default(RulesyncTargetsSchema, ["*"]),
11139
+ name: import_mini41.z.string(),
11140
+ description: import_mini41.z.optional(import_mini41.z.string())
10927
11141
  });
10928
11142
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10929
11143
  frontmatter;
@@ -10932,7 +11146,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10932
11146
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10933
11147
  if (!parseResult.success && rest.validate !== false) {
10934
11148
  throw new Error(
10935
- `Invalid frontmatter in ${(0, import_node_path82.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11149
+ `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10936
11150
  );
10937
11151
  }
10938
11152
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10965,7 +11179,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10965
11179
  return {
10966
11180
  success: false,
10967
11181
  error: new Error(
10968
- `Invalid frontmatter in ${(0, import_node_path82.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11182
+ `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10969
11183
  )
10970
11184
  };
10971
11185
  }
@@ -10973,14 +11187,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10973
11187
  static async fromFile({
10974
11188
  relativeFilePath
10975
11189
  }) {
10976
- const filePath = (0, import_node_path82.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
11190
+ const filePath = (0, import_node_path84.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
10977
11191
  const fileContent = await readFileContent(filePath);
10978
11192
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
10979
11193
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10980
11194
  if (!result.success) {
10981
11195
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10982
11196
  }
10983
- const filename = (0, import_node_path82.basename)(relativeFilePath);
11197
+ const filename = (0, import_node_path84.basename)(relativeFilePath);
10984
11198
  return new _RulesyncSubagent({
10985
11199
  baseDir: process.cwd(),
10986
11200
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10992,13 +11206,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10992
11206
  };
10993
11207
 
10994
11208
  // src/features/subagents/claudecode-subagent.ts
10995
- var ClaudecodeSubagentFrontmatterSchema = import_mini41.z.looseObject({
10996
- name: import_mini41.z.string(),
10997
- description: import_mini41.z.optional(import_mini41.z.string()),
10998
- model: import_mini41.z.optional(import_mini41.z.string()),
10999
- tools: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())])),
11000
- permissionMode: import_mini41.z.optional(import_mini41.z.string()),
11001
- skills: import_mini41.z.optional(import_mini41.z.union([import_mini41.z.string(), import_mini41.z.array(import_mini41.z.string())]))
11209
+ var ClaudecodeSubagentFrontmatterSchema = import_mini42.z.looseObject({
11210
+ name: import_mini42.z.string(),
11211
+ description: import_mini42.z.optional(import_mini42.z.string()),
11212
+ model: import_mini42.z.optional(import_mini42.z.string()),
11213
+ tools: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())])),
11214
+ permissionMode: import_mini42.z.optional(import_mini42.z.string()),
11215
+ skills: import_mini42.z.optional(import_mini42.z.union([import_mini42.z.string(), import_mini42.z.array(import_mini42.z.string())]))
11002
11216
  });
11003
11217
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11004
11218
  frontmatter;
@@ -11008,7 +11222,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11008
11222
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
11009
11223
  if (!result.success) {
11010
11224
  throw new Error(
11011
- `Invalid frontmatter in ${(0, import_node_path83.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11225
+ `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11012
11226
  );
11013
11227
  }
11014
11228
  }
@@ -11020,7 +11234,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11020
11234
  }
11021
11235
  static getSettablePaths(_options = {}) {
11022
11236
  return {
11023
- relativeDirPath: (0, import_node_path83.join)(".claude", "agents")
11237
+ relativeDirPath: (0, import_node_path85.join)(".claude", "agents")
11024
11238
  };
11025
11239
  }
11026
11240
  getFrontmatter() {
@@ -11059,7 +11273,10 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11059
11273
  global = false
11060
11274
  }) {
11061
11275
  const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
11062
- const claudecodeSection = rulesyncFrontmatter.claudecode ?? {};
11276
+ const claudecodeSection = this.filterToolSpecificSection(rulesyncFrontmatter.claudecode ?? {}, [
11277
+ "name",
11278
+ "description"
11279
+ ]);
11063
11280
  const rawClaudecodeFrontmatter = {
11064
11281
  name: rulesyncFrontmatter.name,
11065
11282
  description: rulesyncFrontmatter.description,
@@ -11096,7 +11313,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11096
11313
  return {
11097
11314
  success: false,
11098
11315
  error: new Error(
11099
- `Invalid frontmatter in ${(0, import_node_path83.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11316
+ `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11100
11317
  )
11101
11318
  };
11102
11319
  }
@@ -11114,7 +11331,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11114
11331
  global = false
11115
11332
  }) {
11116
11333
  const paths = this.getSettablePaths({ global });
11117
- const filePath = (0, import_node_path83.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11334
+ const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11118
11335
  const fileContent = await readFileContent(filePath);
11119
11336
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11120
11337
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11149,16 +11366,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11149
11366
  };
11150
11367
 
11151
11368
  // src/features/subagents/codexcli-subagent.ts
11152
- var import_node_path84 = require("path");
11369
+ var import_node_path86 = require("path");
11153
11370
  var smolToml2 = __toESM(require("smol-toml"), 1);
11154
- var import_mini42 = require("zod/mini");
11155
- var CodexCliSubagentTomlSchema = import_mini42.z.looseObject({
11156
- name: import_mini42.z.string(),
11157
- description: import_mini42.z.optional(import_mini42.z.string()),
11158
- developer_instructions: import_mini42.z.optional(import_mini42.z.string()),
11159
- model: import_mini42.z.optional(import_mini42.z.string()),
11160
- model_reasoning_effort: import_mini42.z.optional(import_mini42.z.string()),
11161
- sandbox_mode: import_mini42.z.optional(import_mini42.z.string())
11371
+ var import_mini43 = require("zod/mini");
11372
+ var CodexCliSubagentTomlSchema = import_mini43.z.looseObject({
11373
+ name: import_mini43.z.string(),
11374
+ description: import_mini43.z.optional(import_mini43.z.string()),
11375
+ developer_instructions: import_mini43.z.optional(import_mini43.z.string()),
11376
+ model: import_mini43.z.optional(import_mini43.z.string()),
11377
+ model_reasoning_effort: import_mini43.z.optional(import_mini43.z.string()),
11378
+ sandbox_mode: import_mini43.z.optional(import_mini43.z.string())
11162
11379
  });
11163
11380
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11164
11381
  body;
@@ -11169,7 +11386,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11169
11386
  CodexCliSubagentTomlSchema.parse(parsed);
11170
11387
  } catch (error) {
11171
11388
  throw new Error(
11172
- `Invalid TOML in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11389
+ `Invalid TOML in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11173
11390
  { cause: error }
11174
11391
  );
11175
11392
  }
@@ -11181,7 +11398,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11181
11398
  }
11182
11399
  static getSettablePaths(_options = {}) {
11183
11400
  return {
11184
- relativeDirPath: (0, import_node_path84.join)(".codex", "agents")
11401
+ relativeDirPath: (0, import_node_path86.join)(".codex", "agents")
11185
11402
  };
11186
11403
  }
11187
11404
  getBody() {
@@ -11193,7 +11410,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11193
11410
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
11194
11411
  } catch (error) {
11195
11412
  throw new Error(
11196
- `Failed to parse TOML in ${(0, import_node_path84.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11413
+ `Failed to parse TOML in ${(0, import_node_path86.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11197
11414
  { cause: error }
11198
11415
  );
11199
11416
  }
@@ -11274,7 +11491,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11274
11491
  global = false
11275
11492
  }) {
11276
11493
  const paths = this.getSettablePaths({ global });
11277
- const filePath = (0, import_node_path84.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11494
+ const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11278
11495
  const fileContent = await readFileContent(filePath);
11279
11496
  const subagent = new _CodexCliSubagent({
11280
11497
  baseDir,
@@ -11312,13 +11529,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11312
11529
  };
11313
11530
 
11314
11531
  // src/features/subagents/copilot-subagent.ts
11315
- var import_node_path85 = require("path");
11316
- var import_mini43 = require("zod/mini");
11532
+ var import_node_path87 = require("path");
11533
+ var import_mini44 = require("zod/mini");
11317
11534
  var REQUIRED_TOOL = "agent/runSubagent";
11318
- var CopilotSubagentFrontmatterSchema = import_mini43.z.looseObject({
11319
- name: import_mini43.z.string(),
11320
- description: import_mini43.z.optional(import_mini43.z.string()),
11321
- tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
11535
+ var CopilotSubagentFrontmatterSchema = import_mini44.z.looseObject({
11536
+ name: import_mini44.z.string(),
11537
+ description: import_mini44.z.optional(import_mini44.z.string()),
11538
+ tools: import_mini44.z.optional(import_mini44.z.union([import_mini44.z.string(), import_mini44.z.array(import_mini44.z.string())]))
11322
11539
  });
11323
11540
  var normalizeTools = (tools) => {
11324
11541
  if (!tools) {
@@ -11338,7 +11555,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11338
11555
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
11339
11556
  if (!result.success) {
11340
11557
  throw new Error(
11341
- `Invalid frontmatter in ${(0, import_node_path85.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11558
+ `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11342
11559
  );
11343
11560
  }
11344
11561
  }
@@ -11350,7 +11567,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11350
11567
  }
11351
11568
  static getSettablePaths(_options = {}) {
11352
11569
  return {
11353
- relativeDirPath: (0, import_node_path85.join)(".github", "agents")
11570
+ relativeDirPath: (0, import_node_path87.join)(".github", "agents")
11354
11571
  };
11355
11572
  }
11356
11573
  getFrontmatter() {
@@ -11424,7 +11641,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11424
11641
  return {
11425
11642
  success: false,
11426
11643
  error: new Error(
11427
- `Invalid frontmatter in ${(0, import_node_path85.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11644
+ `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11428
11645
  )
11429
11646
  };
11430
11647
  }
@@ -11442,7 +11659,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11442
11659
  global = false
11443
11660
  }) {
11444
11661
  const paths = this.getSettablePaths({ global });
11445
- const filePath = (0, import_node_path85.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11662
+ const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11446
11663
  const fileContent = await readFileContent(filePath);
11447
11664
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11448
11665
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11478,11 +11695,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11478
11695
  };
11479
11696
 
11480
11697
  // src/features/subagents/cursor-subagent.ts
11481
- var import_node_path86 = require("path");
11482
- var import_mini44 = require("zod/mini");
11483
- var CursorSubagentFrontmatterSchema = import_mini44.z.looseObject({
11484
- name: import_mini44.z.string(),
11485
- description: import_mini44.z.optional(import_mini44.z.string())
11698
+ var import_node_path88 = require("path");
11699
+ var import_mini45 = require("zod/mini");
11700
+ var CursorSubagentFrontmatterSchema = import_mini45.z.looseObject({
11701
+ name: import_mini45.z.string(),
11702
+ description: import_mini45.z.optional(import_mini45.z.string())
11486
11703
  });
11487
11704
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11488
11705
  frontmatter;
@@ -11492,7 +11709,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11492
11709
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
11493
11710
  if (!result.success) {
11494
11711
  throw new Error(
11495
- `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11712
+ `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11496
11713
  );
11497
11714
  }
11498
11715
  }
@@ -11504,7 +11721,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11504
11721
  }
11505
11722
  static getSettablePaths(_options = {}) {
11506
11723
  return {
11507
- relativeDirPath: (0, import_node_path86.join)(".cursor", "agents")
11724
+ relativeDirPath: (0, import_node_path88.join)(".cursor", "agents")
11508
11725
  };
11509
11726
  }
11510
11727
  getFrontmatter() {
@@ -11571,7 +11788,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11571
11788
  return {
11572
11789
  success: false,
11573
11790
  error: new Error(
11574
- `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11791
+ `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11575
11792
  )
11576
11793
  };
11577
11794
  }
@@ -11589,7 +11806,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11589
11806
  global = false
11590
11807
  }) {
11591
11808
  const paths = this.getSettablePaths({ global });
11592
- const filePath = (0, import_node_path86.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11809
+ const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11593
11810
  const fileContent = await readFileContent(filePath);
11594
11811
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11595
11812
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11624,24 +11841,182 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
11624
11841
  }
11625
11842
  };
11626
11843
 
11844
+ // src/features/subagents/junie-subagent.ts
11845
+ var import_node_path89 = require("path");
11846
+ var import_mini46 = require("zod/mini");
11847
+ var JunieSubagentFrontmatterSchema = import_mini46.z.looseObject({
11848
+ name: import_mini46.z.optional(import_mini46.z.string()),
11849
+ description: import_mini46.z.string()
11850
+ });
11851
+ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
11852
+ frontmatter;
11853
+ body;
11854
+ constructor({ frontmatter, body, ...rest }) {
11855
+ if (rest.validate !== false) {
11856
+ const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
11857
+ if (!result.success) {
11858
+ throw new Error(
11859
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11860
+ );
11861
+ }
11862
+ }
11863
+ super({
11864
+ ...rest
11865
+ });
11866
+ this.frontmatter = frontmatter;
11867
+ this.body = body;
11868
+ }
11869
+ static getSettablePaths(options = {}) {
11870
+ if (options?.global) {
11871
+ throw new Error("JunieSubagent does not support global mode.");
11872
+ }
11873
+ return {
11874
+ relativeDirPath: (0, import_node_path89.join)(".junie", "agents")
11875
+ };
11876
+ }
11877
+ getFrontmatter() {
11878
+ return this.frontmatter;
11879
+ }
11880
+ getBody() {
11881
+ return this.body;
11882
+ }
11883
+ toRulesyncSubagent() {
11884
+ const { name, description, ...restFields } = this.frontmatter;
11885
+ const junieSection = {
11886
+ ...restFields
11887
+ };
11888
+ const rulesyncFrontmatter = {
11889
+ targets: ["*"],
11890
+ name: name ?? this.getRelativeFilePath().replace(/\.md$/, ""),
11891
+ description,
11892
+ ...Object.keys(junieSection).length > 0 && { junie: junieSection }
11893
+ };
11894
+ return new RulesyncSubagent({
11895
+ baseDir: ".",
11896
+ frontmatter: rulesyncFrontmatter,
11897
+ body: this.body,
11898
+ relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
11899
+ relativeFilePath: this.getRelativeFilePath(),
11900
+ validate: true
11901
+ });
11902
+ }
11903
+ static fromRulesyncSubagent({
11904
+ baseDir = process.cwd(),
11905
+ rulesyncSubagent,
11906
+ validate = true,
11907
+ global = false
11908
+ }) {
11909
+ const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
11910
+ const junieSection = this.filterToolSpecificSection(rulesyncFrontmatter.junie ?? {}, [
11911
+ "name",
11912
+ "description"
11913
+ ]);
11914
+ const rawJunieFrontmatter = {
11915
+ name: rulesyncFrontmatter.name,
11916
+ description: rulesyncFrontmatter.description,
11917
+ ...junieSection
11918
+ };
11919
+ const result = JunieSubagentFrontmatterSchema.safeParse(rawJunieFrontmatter);
11920
+ if (!result.success) {
11921
+ throw new Error(
11922
+ `Invalid junie subagent frontmatter in ${rulesyncSubagent.getRelativeFilePath()}: ${formatError(result.error)}`
11923
+ );
11924
+ }
11925
+ const junieFrontmatter = result.data;
11926
+ const body = rulesyncSubagent.getBody();
11927
+ const fileContent = stringifyFrontmatter(body, junieFrontmatter);
11928
+ const paths = this.getSettablePaths({ global });
11929
+ return new _JunieSubagent({
11930
+ baseDir,
11931
+ frontmatter: junieFrontmatter,
11932
+ body,
11933
+ relativeDirPath: paths.relativeDirPath,
11934
+ relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
11935
+ fileContent,
11936
+ validate
11937
+ });
11938
+ }
11939
+ validate() {
11940
+ if (!this.frontmatter) {
11941
+ return { success: true, error: null };
11942
+ }
11943
+ const result = JunieSubagentFrontmatterSchema.safeParse(this.frontmatter);
11944
+ if (result.success) {
11945
+ return { success: true, error: null };
11946
+ } else {
11947
+ return {
11948
+ success: false,
11949
+ error: new Error(
11950
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11951
+ )
11952
+ };
11953
+ }
11954
+ }
11955
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
11956
+ return this.isTargetedByRulesyncSubagentDefault({
11957
+ rulesyncSubagent,
11958
+ toolTarget: "junie"
11959
+ });
11960
+ }
11961
+ static async fromFile({
11962
+ baseDir = process.cwd(),
11963
+ relativeFilePath,
11964
+ validate = true,
11965
+ global = false
11966
+ }) {
11967
+ const paths = this.getSettablePaths({ global });
11968
+ const filePath = (0, import_node_path89.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11969
+ const fileContent = await readFileContent(filePath);
11970
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11971
+ const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
11972
+ if (!result.success) {
11973
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
11974
+ }
11975
+ return new _JunieSubagent({
11976
+ baseDir,
11977
+ relativeDirPath: paths.relativeDirPath,
11978
+ relativeFilePath,
11979
+ frontmatter: result.data,
11980
+ body: content.trim(),
11981
+ fileContent,
11982
+ validate
11983
+ });
11984
+ }
11985
+ static forDeletion({
11986
+ baseDir = process.cwd(),
11987
+ relativeDirPath,
11988
+ relativeFilePath
11989
+ }) {
11990
+ return new _JunieSubagent({
11991
+ baseDir,
11992
+ relativeDirPath,
11993
+ relativeFilePath,
11994
+ frontmatter: { name: "", description: "" },
11995
+ body: "",
11996
+ fileContent: "",
11997
+ validate: false
11998
+ });
11999
+ }
12000
+ };
12001
+
11627
12002
  // src/features/subagents/kiro-subagent.ts
11628
- var import_node_path87 = require("path");
11629
- var import_mini45 = require("zod/mini");
11630
- var KiroCliSubagentJsonSchema = import_mini45.z.looseObject({
11631
- name: import_mini45.z.string(),
11632
- description: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11633
- prompt: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11634
- tools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11635
- toolAliases: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.string()))),
11636
- toolSettings: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
11637
- toolSchema: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.unknown())),
11638
- hooks: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.array(import_mini45.z.unknown())))),
11639
- model: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.string())),
11640
- mcpServers: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.record(import_mini45.z.string(), import_mini45.z.unknown()))),
11641
- useLegacyMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean())),
11642
- resources: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11643
- allowedTools: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.array(import_mini45.z.string()))),
11644
- includeMcpJson: import_mini45.z.optional(import_mini45.z.nullable(import_mini45.z.boolean()))
12003
+ var import_node_path90 = require("path");
12004
+ var import_mini47 = require("zod/mini");
12005
+ var KiroCliSubagentJsonSchema = import_mini47.z.looseObject({
12006
+ name: import_mini47.z.string(),
12007
+ description: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12008
+ prompt: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12009
+ tools: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12010
+ toolAliases: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.string()))),
12011
+ toolSettings: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.unknown())),
12012
+ toolSchema: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.unknown())),
12013
+ hooks: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.array(import_mini47.z.unknown())))),
12014
+ model: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.string())),
12015
+ mcpServers: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.record(import_mini47.z.string(), import_mini47.z.unknown()))),
12016
+ useLegacyMcpJson: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.boolean())),
12017
+ resources: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12018
+ allowedTools: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.array(import_mini47.z.string()))),
12019
+ includeMcpJson: import_mini47.z.optional(import_mini47.z.nullable(import_mini47.z.boolean()))
11645
12020
  });
11646
12021
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11647
12022
  body;
@@ -11652,7 +12027,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11652
12027
  KiroCliSubagentJsonSchema.parse(parsed);
11653
12028
  } catch (error) {
11654
12029
  throw new Error(
11655
- `Invalid JSON in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
12030
+ `Invalid JSON in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11656
12031
  { cause: error }
11657
12032
  );
11658
12033
  }
@@ -11664,7 +12039,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11664
12039
  }
11665
12040
  static getSettablePaths(_options = {}) {
11666
12041
  return {
11667
- relativeDirPath: (0, import_node_path87.join)(".kiro", "agents")
12042
+ relativeDirPath: (0, import_node_path90.join)(".kiro", "agents")
11668
12043
  };
11669
12044
  }
11670
12045
  getBody() {
@@ -11676,7 +12051,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11676
12051
  parsed = JSON.parse(this.body);
11677
12052
  } catch (error) {
11678
12053
  throw new Error(
11679
- `Failed to parse JSON in ${(0, import_node_path87.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
12054
+ `Failed to parse JSON in ${(0, import_node_path90.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11680
12055
  { cause: error }
11681
12056
  );
11682
12057
  }
@@ -11757,7 +12132,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11757
12132
  global = false
11758
12133
  }) {
11759
12134
  const paths = this.getSettablePaths({ global });
11760
- const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12135
+ const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11761
12136
  const fileContent = await readFileContent(filePath);
11762
12137
  const subagent = new _KiroSubagent({
11763
12138
  baseDir,
@@ -11795,12 +12170,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
11795
12170
  };
11796
12171
 
11797
12172
  // src/features/subagents/opencode-subagent.ts
11798
- var import_node_path88 = require("path");
11799
- var import_mini46 = require("zod/mini");
11800
- var OpenCodeSubagentFrontmatterSchema = import_mini46.z.looseObject({
11801
- description: import_mini46.z.optional(import_mini46.z.string()),
11802
- mode: import_mini46.z._default(import_mini46.z.string(), "subagent"),
11803
- name: import_mini46.z.optional(import_mini46.z.string())
12173
+ var import_node_path91 = require("path");
12174
+ var import_mini48 = require("zod/mini");
12175
+ var OpenCodeSubagentFrontmatterSchema = import_mini48.z.looseObject({
12176
+ description: import_mini48.z.optional(import_mini48.z.string()),
12177
+ mode: import_mini48.z._default(import_mini48.z.string(), "subagent"),
12178
+ name: import_mini48.z.optional(import_mini48.z.string())
11804
12179
  });
11805
12180
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11806
12181
  frontmatter;
@@ -11810,7 +12185,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11810
12185
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
11811
12186
  if (!result.success) {
11812
12187
  throw new Error(
11813
- `Invalid frontmatter in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12188
+ `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11814
12189
  );
11815
12190
  }
11816
12191
  }
@@ -11824,7 +12199,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11824
12199
  global = false
11825
12200
  } = {}) {
11826
12201
  return {
11827
- relativeDirPath: global ? (0, import_node_path88.join)(".config", "opencode", "agent") : (0, import_node_path88.join)(".opencode", "agent")
12202
+ relativeDirPath: global ? (0, import_node_path91.join)(".config", "opencode", "agent") : (0, import_node_path91.join)(".opencode", "agent")
11828
12203
  };
11829
12204
  }
11830
12205
  getFrontmatter() {
@@ -11837,7 +12212,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11837
12212
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
11838
12213
  const rulesyncFrontmatter = {
11839
12214
  targets: ["*"],
11840
- name: name ?? (0, import_node_path88.basename)(this.getRelativeFilePath(), ".md"),
12215
+ name: name ?? (0, import_node_path91.basename)(this.getRelativeFilePath(), ".md"),
11841
12216
  description,
11842
12217
  opencode: { mode, ...opencodeSection }
11843
12218
  };
@@ -11890,7 +12265,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11890
12265
  return {
11891
12266
  success: false,
11892
12267
  error: new Error(
11893
- `Invalid frontmatter in ${(0, import_node_path88.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12268
+ `Invalid frontmatter in ${(0, import_node_path91.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11894
12269
  )
11895
12270
  };
11896
12271
  }
@@ -11907,7 +12282,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
11907
12282
  global = false
11908
12283
  }) {
11909
12284
  const paths = this.getSettablePaths({ global });
11910
- const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12285
+ const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11911
12286
  const fileContent = await readFileContent(filePath);
11912
12287
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11913
12288
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11952,11 +12327,12 @@ var subagentsProcessorToolTargetTuple = [
11952
12327
  "cursor",
11953
12328
  "factorydroid",
11954
12329
  "geminicli",
12330
+ "junie",
11955
12331
  "kiro",
11956
12332
  "opencode",
11957
12333
  "roo"
11958
12334
  ];
11959
- var SubagentsProcessorToolTargetSchema = import_mini47.z.enum(subagentsProcessorToolTargetTuple);
12335
+ var SubagentsProcessorToolTargetSchema = import_mini49.z.enum(subagentsProcessorToolTargetTuple);
11960
12336
  var toolSubagentFactories = /* @__PURE__ */ new Map([
11961
12337
  [
11962
12338
  "agentsmd",
@@ -12014,6 +12390,13 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
12014
12390
  meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
12015
12391
  }
12016
12392
  ],
12393
+ [
12394
+ "junie",
12395
+ {
12396
+ class: JunieSubagent,
12397
+ meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
12398
+ }
12399
+ ],
12017
12400
  [
12018
12401
  "kiro",
12019
12402
  {
@@ -12118,7 +12501,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12118
12501
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
12119
12502
  */
12120
12503
  async loadRulesyncFiles() {
12121
- const subagentsDir = (0, import_node_path89.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12504
+ const subagentsDir = (0, import_node_path92.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12122
12505
  const dirExists = await directoryExists(subagentsDir);
12123
12506
  if (!dirExists) {
12124
12507
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -12133,7 +12516,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12133
12516
  logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
12134
12517
  const rulesyncSubagents = [];
12135
12518
  for (const mdFile of mdFiles) {
12136
- const filepath = (0, import_node_path89.join)(subagentsDir, mdFile);
12519
+ const filepath = (0, import_node_path92.join)(subagentsDir, mdFile);
12137
12520
  try {
12138
12521
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
12139
12522
  relativeFilePath: mdFile,
@@ -12163,14 +12546,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
12163
12546
  const factory = this.getFactory(this.toolTarget);
12164
12547
  const paths = factory.class.getSettablePaths({ global: this.global });
12165
12548
  const subagentFilePaths = await findFilesByGlobs(
12166
- (0, import_node_path89.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12549
+ (0, import_node_path92.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12167
12550
  );
12168
12551
  if (forDeletion) {
12169
12552
  const toolSubagents2 = subagentFilePaths.map(
12170
12553
  (path3) => factory.class.forDeletion({
12171
12554
  baseDir: this.baseDir,
12172
12555
  relativeDirPath: paths.relativeDirPath,
12173
- relativeFilePath: (0, import_node_path89.basename)(path3),
12556
+ relativeFilePath: (0, import_node_path92.basename)(path3),
12174
12557
  global: this.global
12175
12558
  })
12176
12559
  ).filter((subagent) => subagent.isDeletable());
@@ -12183,7 +12566,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12183
12566
  subagentFilePaths.map(
12184
12567
  (path3) => factory.class.fromFile({
12185
12568
  baseDir: this.baseDir,
12186
- relativeFilePath: (0, import_node_path89.basename)(path3),
12569
+ relativeFilePath: (0, import_node_path92.basename)(path3),
12187
12570
  global: this.global
12188
12571
  })
12189
12572
  )
@@ -12228,49 +12611,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
12228
12611
  };
12229
12612
 
12230
12613
  // src/features/rules/agentsmd-rule.ts
12231
- var import_node_path92 = require("path");
12614
+ var import_node_path95 = require("path");
12232
12615
 
12233
12616
  // src/features/rules/tool-rule.ts
12234
- var import_node_path91 = require("path");
12617
+ var import_node_path94 = require("path");
12235
12618
 
12236
12619
  // src/features/rules/rulesync-rule.ts
12237
- var import_node_path90 = require("path");
12238
- var import_mini48 = require("zod/mini");
12239
- var RulesyncRuleFrontmatterSchema = import_mini48.z.object({
12240
- root: import_mini48.z.optional(import_mini48.z.boolean()),
12241
- localRoot: import_mini48.z.optional(import_mini48.z.boolean()),
12242
- targets: import_mini48.z._default(RulesyncTargetsSchema, ["*"]),
12243
- description: import_mini48.z.optional(import_mini48.z.string()),
12244
- globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string())),
12245
- agentsmd: import_mini48.z.optional(
12246
- import_mini48.z.object({
12620
+ var import_node_path93 = require("path");
12621
+ var import_mini50 = require("zod/mini");
12622
+ var RulesyncRuleFrontmatterSchema = import_mini50.z.object({
12623
+ root: import_mini50.z.optional(import_mini50.z.boolean()),
12624
+ localRoot: import_mini50.z.optional(import_mini50.z.boolean()),
12625
+ targets: import_mini50.z._default(RulesyncTargetsSchema, ["*"]),
12626
+ description: import_mini50.z.optional(import_mini50.z.string()),
12627
+ globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string())),
12628
+ agentsmd: import_mini50.z.optional(
12629
+ import_mini50.z.object({
12247
12630
  // @example "path/to/subproject"
12248
- subprojectPath: import_mini48.z.optional(import_mini48.z.string())
12631
+ subprojectPath: import_mini50.z.optional(import_mini50.z.string())
12249
12632
  })
12250
12633
  ),
12251
- claudecode: import_mini48.z.optional(
12252
- import_mini48.z.object({
12634
+ claudecode: import_mini50.z.optional(
12635
+ import_mini50.z.object({
12253
12636
  // Glob patterns for conditional rules (takes precedence over globs)
12254
12637
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
12255
- paths: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12638
+ paths: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12256
12639
  })
12257
12640
  ),
12258
- cursor: import_mini48.z.optional(
12259
- import_mini48.z.object({
12260
- alwaysApply: import_mini48.z.optional(import_mini48.z.boolean()),
12261
- description: import_mini48.z.optional(import_mini48.z.string()),
12262
- globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12641
+ cursor: import_mini50.z.optional(
12642
+ import_mini50.z.object({
12643
+ alwaysApply: import_mini50.z.optional(import_mini50.z.boolean()),
12644
+ description: import_mini50.z.optional(import_mini50.z.string()),
12645
+ globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12263
12646
  })
12264
12647
  ),
12265
- copilot: import_mini48.z.optional(
12266
- import_mini48.z.object({
12267
- excludeAgent: import_mini48.z.optional(import_mini48.z.union([import_mini48.z.literal("code-review"), import_mini48.z.literal("coding-agent")]))
12648
+ copilot: import_mini50.z.optional(
12649
+ import_mini50.z.object({
12650
+ excludeAgent: import_mini50.z.optional(import_mini50.z.union([import_mini50.z.literal("code-review"), import_mini50.z.literal("coding-agent")]))
12268
12651
  })
12269
12652
  ),
12270
- antigravity: import_mini48.z.optional(
12271
- import_mini48.z.looseObject({
12272
- trigger: import_mini48.z.optional(import_mini48.z.string()),
12273
- globs: import_mini48.z.optional(import_mini48.z.array(import_mini48.z.string()))
12653
+ antigravity: import_mini50.z.optional(
12654
+ import_mini50.z.looseObject({
12655
+ trigger: import_mini50.z.optional(import_mini50.z.string()),
12656
+ globs: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
12274
12657
  })
12275
12658
  )
12276
12659
  });
@@ -12281,7 +12664,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12281
12664
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
12282
12665
  if (!parseResult.success && rest.validate !== false) {
12283
12666
  throw new Error(
12284
- `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12667
+ `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12285
12668
  );
12286
12669
  }
12287
12670
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -12316,7 +12699,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12316
12699
  return {
12317
12700
  success: false,
12318
12701
  error: new Error(
12319
- `Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12702
+ `Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12320
12703
  )
12321
12704
  };
12322
12705
  }
@@ -12325,7 +12708,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
12325
12708
  relativeFilePath,
12326
12709
  validate = true
12327
12710
  }) {
12328
- const filePath = (0, import_node_path90.join)(
12711
+ const filePath = (0, import_node_path93.join)(
12329
12712
  process.cwd(),
12330
12713
  this.getSettablePaths().recommended.relativeDirPath,
12331
12714
  relativeFilePath
@@ -12427,7 +12810,7 @@ var ToolRule = class extends ToolFile {
12427
12810
  rulesyncRule,
12428
12811
  validate = true,
12429
12812
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
12430
- nonRootPath = { relativeDirPath: (0, import_node_path91.join)(".agents", "memories") }
12813
+ nonRootPath = { relativeDirPath: (0, import_node_path94.join)(".agents", "memories") }
12431
12814
  }) {
12432
12815
  const params = this.buildToolRuleParamsDefault({
12433
12816
  baseDir,
@@ -12438,7 +12821,7 @@ var ToolRule = class extends ToolFile {
12438
12821
  });
12439
12822
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
12440
12823
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
12441
- params.relativeDirPath = (0, import_node_path91.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12824
+ params.relativeDirPath = (0, import_node_path94.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
12442
12825
  params.relativeFilePath = "AGENTS.md";
12443
12826
  }
12444
12827
  return params;
@@ -12487,7 +12870,7 @@ var ToolRule = class extends ToolFile {
12487
12870
  }
12488
12871
  };
12489
12872
  function buildToolPath(toolDir, subDir, excludeToolDir) {
12490
- return excludeToolDir ? subDir : (0, import_node_path91.join)(toolDir, subDir);
12873
+ return excludeToolDir ? subDir : (0, import_node_path94.join)(toolDir, subDir);
12491
12874
  }
12492
12875
 
12493
12876
  // src/features/rules/agentsmd-rule.ts
@@ -12516,8 +12899,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12516
12899
  validate = true
12517
12900
  }) {
12518
12901
  const isRoot = relativeFilePath === "AGENTS.md";
12519
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path92.join)(".agents", "memories", relativeFilePath);
12520
- const fileContent = await readFileContent((0, import_node_path92.join)(baseDir, relativePath));
12902
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path95.join)(".agents", "memories", relativeFilePath);
12903
+ const fileContent = await readFileContent((0, import_node_path95.join)(baseDir, relativePath));
12521
12904
  return new _AgentsMdRule({
12522
12905
  baseDir,
12523
12906
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -12572,21 +12955,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
12572
12955
  };
12573
12956
 
12574
12957
  // src/features/rules/antigravity-rule.ts
12575
- var import_node_path93 = require("path");
12576
- var import_mini49 = require("zod/mini");
12577
- var AntigravityRuleFrontmatterSchema = import_mini49.z.looseObject({
12578
- trigger: import_mini49.z.optional(
12579
- import_mini49.z.union([
12580
- import_mini49.z.literal("always_on"),
12581
- import_mini49.z.literal("glob"),
12582
- import_mini49.z.literal("manual"),
12583
- import_mini49.z.literal("model_decision"),
12584
- import_mini49.z.string()
12958
+ var import_node_path96 = require("path");
12959
+ var import_mini51 = require("zod/mini");
12960
+ var AntigravityRuleFrontmatterSchema = import_mini51.z.looseObject({
12961
+ trigger: import_mini51.z.optional(
12962
+ import_mini51.z.union([
12963
+ import_mini51.z.literal("always_on"),
12964
+ import_mini51.z.literal("glob"),
12965
+ import_mini51.z.literal("manual"),
12966
+ import_mini51.z.literal("model_decision"),
12967
+ import_mini51.z.string()
12585
12968
  // accepts any string for forward compatibility
12586
12969
  ])
12587
12970
  ),
12588
- globs: import_mini49.z.optional(import_mini49.z.string()),
12589
- description: import_mini49.z.optional(import_mini49.z.string())
12971
+ globs: import_mini51.z.optional(import_mini51.z.string()),
12972
+ description: import_mini51.z.optional(import_mini51.z.string())
12590
12973
  });
12591
12974
  function parseGlobsString(globs) {
12592
12975
  if (!globs) {
@@ -12731,7 +13114,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12731
13114
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
12732
13115
  if (!result.success) {
12733
13116
  throw new Error(
12734
- `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13117
+ `Invalid frontmatter in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12735
13118
  );
12736
13119
  }
12737
13120
  }
@@ -12755,7 +13138,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12755
13138
  relativeFilePath,
12756
13139
  validate = true
12757
13140
  }) {
12758
- const filePath = (0, import_node_path93.join)(
13141
+ const filePath = (0, import_node_path96.join)(
12759
13142
  baseDir,
12760
13143
  this.getSettablePaths().nonRoot.relativeDirPath,
12761
13144
  relativeFilePath
@@ -12895,7 +13278,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
12895
13278
  };
12896
13279
 
12897
13280
  // src/features/rules/augmentcode-legacy-rule.ts
12898
- var import_node_path94 = require("path");
13281
+ var import_node_path97 = require("path");
12899
13282
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12900
13283
  toRulesyncRule() {
12901
13284
  const rulesyncFrontmatter = {
@@ -12955,8 +13338,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12955
13338
  }) {
12956
13339
  const settablePaths = this.getSettablePaths();
12957
13340
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
12958
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path94.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
12959
- const fileContent = await readFileContent((0, import_node_path94.join)(baseDir, relativePath));
13341
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path97.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
13342
+ const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
12960
13343
  return new _AugmentcodeLegacyRule({
12961
13344
  baseDir,
12962
13345
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -12985,7 +13368,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
12985
13368
  };
12986
13369
 
12987
13370
  // src/features/rules/augmentcode-rule.ts
12988
- var import_node_path95 = require("path");
13371
+ var import_node_path98 = require("path");
12989
13372
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
12990
13373
  toRulesyncRule() {
12991
13374
  return this.toRulesyncRuleDefault();
@@ -13016,7 +13399,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13016
13399
  relativeFilePath,
13017
13400
  validate = true
13018
13401
  }) {
13019
- const filePath = (0, import_node_path95.join)(
13402
+ const filePath = (0, import_node_path98.join)(
13020
13403
  baseDir,
13021
13404
  this.getSettablePaths().nonRoot.relativeDirPath,
13022
13405
  relativeFilePath
@@ -13056,7 +13439,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13056
13439
  };
13057
13440
 
13058
13441
  // src/features/rules/claudecode-legacy-rule.ts
13059
- var import_node_path96 = require("path");
13442
+ var import_node_path99 = require("path");
13060
13443
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13061
13444
  static getSettablePaths({
13062
13445
  global,
@@ -13098,7 +13481,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13098
13481
  if (isRoot) {
13099
13482
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
13100
13483
  const fileContent2 = await readFileContent(
13101
- (0, import_node_path96.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13484
+ (0, import_node_path99.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13102
13485
  );
13103
13486
  return new _ClaudecodeLegacyRule({
13104
13487
  baseDir,
@@ -13112,8 +13495,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13112
13495
  if (!paths.nonRoot) {
13113
13496
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13114
13497
  }
13115
- const relativePath = (0, import_node_path96.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13116
- const fileContent = await readFileContent((0, import_node_path96.join)(baseDir, relativePath));
13498
+ const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13499
+ const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13117
13500
  return new _ClaudecodeLegacyRule({
13118
13501
  baseDir,
13119
13502
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13172,10 +13555,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13172
13555
  };
13173
13556
 
13174
13557
  // src/features/rules/claudecode-rule.ts
13175
- var import_node_path97 = require("path");
13176
- var import_mini50 = require("zod/mini");
13177
- var ClaudecodeRuleFrontmatterSchema = import_mini50.z.object({
13178
- paths: import_mini50.z.optional(import_mini50.z.array(import_mini50.z.string()))
13558
+ var import_node_path100 = require("path");
13559
+ var import_mini52 = require("zod/mini");
13560
+ var ClaudecodeRuleFrontmatterSchema = import_mini52.z.object({
13561
+ paths: import_mini52.z.optional(import_mini52.z.array(import_mini52.z.string()))
13179
13562
  });
13180
13563
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13181
13564
  frontmatter;
@@ -13213,7 +13596,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13213
13596
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
13214
13597
  if (!result.success) {
13215
13598
  throw new Error(
13216
- `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13599
+ `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13217
13600
  );
13218
13601
  }
13219
13602
  }
@@ -13243,7 +13626,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13243
13626
  if (isRoot) {
13244
13627
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
13245
13628
  const fileContent2 = await readFileContent(
13246
- (0, import_node_path97.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13629
+ (0, import_node_path100.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13247
13630
  );
13248
13631
  return new _ClaudecodeRule({
13249
13632
  baseDir,
@@ -13258,8 +13641,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13258
13641
  if (!paths.nonRoot) {
13259
13642
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13260
13643
  }
13261
- const relativePath = (0, import_node_path97.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13262
- const filePath = (0, import_node_path97.join)(baseDir, relativePath);
13644
+ const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13645
+ const filePath = (0, import_node_path100.join)(baseDir, relativePath);
13263
13646
  const fileContent = await readFileContent(filePath);
13264
13647
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13265
13648
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -13370,7 +13753,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13370
13753
  return {
13371
13754
  success: false,
13372
13755
  error: new Error(
13373
- `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13756
+ `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13374
13757
  )
13375
13758
  };
13376
13759
  }
@@ -13390,10 +13773,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13390
13773
  };
13391
13774
 
13392
13775
  // src/features/rules/cline-rule.ts
13393
- var import_node_path98 = require("path");
13394
- var import_mini51 = require("zod/mini");
13395
- var ClineRuleFrontmatterSchema = import_mini51.z.object({
13396
- description: import_mini51.z.string()
13776
+ var import_node_path101 = require("path");
13777
+ var import_mini53 = require("zod/mini");
13778
+ var ClineRuleFrontmatterSchema = import_mini53.z.object({
13779
+ description: import_mini53.z.string()
13397
13780
  });
13398
13781
  var ClineRule = class _ClineRule extends ToolRule {
13399
13782
  static getSettablePaths(_options = {}) {
@@ -13436,7 +13819,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13436
13819
  validate = true
13437
13820
  }) {
13438
13821
  const fileContent = await readFileContent(
13439
- (0, import_node_path98.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13822
+ (0, import_node_path101.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13440
13823
  );
13441
13824
  return new _ClineRule({
13442
13825
  baseDir,
@@ -13462,7 +13845,7 @@ var ClineRule = class _ClineRule extends ToolRule {
13462
13845
  };
13463
13846
 
13464
13847
  // src/features/rules/codexcli-rule.ts
13465
- var import_node_path99 = require("path");
13848
+ var import_node_path102 = require("path");
13466
13849
  var CodexcliRule = class _CodexcliRule extends ToolRule {
13467
13850
  static getSettablePaths({
13468
13851
  global,
@@ -13497,7 +13880,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13497
13880
  if (isRoot) {
13498
13881
  const relativePath2 = paths.root.relativeFilePath;
13499
13882
  const fileContent2 = await readFileContent(
13500
- (0, import_node_path99.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13883
+ (0, import_node_path102.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13501
13884
  );
13502
13885
  return new _CodexcliRule({
13503
13886
  baseDir,
@@ -13511,8 +13894,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13511
13894
  if (!paths.nonRoot) {
13512
13895
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13513
13896
  }
13514
- const relativePath = (0, import_node_path99.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13515
- const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
13897
+ const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13898
+ const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
13516
13899
  return new _CodexcliRule({
13517
13900
  baseDir,
13518
13901
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13571,12 +13954,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
13571
13954
  };
13572
13955
 
13573
13956
  // src/features/rules/copilot-rule.ts
13574
- var import_node_path100 = require("path");
13575
- var import_mini52 = require("zod/mini");
13576
- var CopilotRuleFrontmatterSchema = import_mini52.z.object({
13577
- description: import_mini52.z.optional(import_mini52.z.string()),
13578
- applyTo: import_mini52.z.optional(import_mini52.z.string()),
13579
- excludeAgent: import_mini52.z.optional(import_mini52.z.union([import_mini52.z.literal("code-review"), import_mini52.z.literal("coding-agent")]))
13957
+ var import_node_path103 = require("path");
13958
+ var import_mini54 = require("zod/mini");
13959
+ var CopilotRuleFrontmatterSchema = import_mini54.z.object({
13960
+ description: import_mini54.z.optional(import_mini54.z.string()),
13961
+ applyTo: import_mini54.z.optional(import_mini54.z.string()),
13962
+ excludeAgent: import_mini54.z.optional(import_mini54.z.union([import_mini54.z.literal("code-review"), import_mini54.z.literal("coding-agent")]))
13580
13963
  });
13581
13964
  var CopilotRule = class _CopilotRule extends ToolRule {
13582
13965
  frontmatter;
@@ -13587,6 +13970,9 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13587
13970
  root: {
13588
13971
  relativeDirPath: buildToolPath(".copilot", ".", options.excludeToolDir),
13589
13972
  relativeFilePath: "copilot-instructions.md"
13973
+ },
13974
+ nonRoot: {
13975
+ relativeDirPath: buildToolPath(".copilot", "instructions", options.excludeToolDir)
13590
13976
  }
13591
13977
  };
13592
13978
  }
@@ -13605,7 +13991,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13605
13991
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
13606
13992
  if (!result.success) {
13607
13993
  throw new Error(
13608
- `Invalid frontmatter in ${(0, import_node_path100.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13994
+ `Invalid frontmatter in ${(0, import_node_path103.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13609
13995
  );
13610
13996
  }
13611
13997
  }
@@ -13695,8 +14081,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13695
14081
  const paths = this.getSettablePaths({ global });
13696
14082
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
13697
14083
  if (isRoot) {
13698
- const relativePath2 = (0, import_node_path100.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
13699
- const filePath2 = (0, import_node_path100.join)(baseDir, relativePath2);
14084
+ const relativePath2 = (0, import_node_path103.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14085
+ const filePath2 = (0, import_node_path103.join)(baseDir, relativePath2);
13700
14086
  const fileContent2 = await readFileContent(filePath2);
13701
14087
  return new _CopilotRule({
13702
14088
  baseDir,
@@ -13711,8 +14097,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13711
14097
  if (!paths.nonRoot) {
13712
14098
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13713
14099
  }
13714
- const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13715
- const filePath = (0, import_node_path100.join)(baseDir, relativePath);
14100
+ const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14101
+ const filePath = (0, import_node_path103.join)(baseDir, relativePath);
13716
14102
  const fileContent = await readFileContent(filePath);
13717
14103
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13718
14104
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -13758,7 +14144,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13758
14144
  return {
13759
14145
  success: false,
13760
14146
  error: new Error(
13761
- `Invalid frontmatter in ${(0, import_node_path100.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14147
+ `Invalid frontmatter in ${(0, import_node_path103.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13762
14148
  )
13763
14149
  };
13764
14150
  }
@@ -13778,12 +14164,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
13778
14164
  };
13779
14165
 
13780
14166
  // src/features/rules/cursor-rule.ts
13781
- var import_node_path101 = require("path");
13782
- var import_mini53 = require("zod/mini");
13783
- var CursorRuleFrontmatterSchema = import_mini53.z.object({
13784
- description: import_mini53.z.optional(import_mini53.z.string()),
13785
- globs: import_mini53.z.optional(import_mini53.z.string()),
13786
- alwaysApply: import_mini53.z.optional(import_mini53.z.boolean())
14167
+ var import_node_path104 = require("path");
14168
+ var import_mini55 = require("zod/mini");
14169
+ var CursorRuleFrontmatterSchema = import_mini55.z.object({
14170
+ description: import_mini55.z.optional(import_mini55.z.string()),
14171
+ globs: import_mini55.z.optional(import_mini55.z.string()),
14172
+ alwaysApply: import_mini55.z.optional(import_mini55.z.boolean())
13787
14173
  });
13788
14174
  var CursorRule = class _CursorRule extends ToolRule {
13789
14175
  frontmatter;
@@ -13800,7 +14186,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13800
14186
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13801
14187
  if (!result.success) {
13802
14188
  throw new Error(
13803
- `Invalid frontmatter in ${(0, import_node_path101.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14189
+ `Invalid frontmatter in ${(0, import_node_path104.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13804
14190
  );
13805
14191
  }
13806
14192
  }
@@ -13916,7 +14302,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13916
14302
  relativeFilePath,
13917
14303
  validate = true
13918
14304
  }) {
13919
- const filePath = (0, import_node_path101.join)(
14305
+ const filePath = (0, import_node_path104.join)(
13920
14306
  baseDir,
13921
14307
  this.getSettablePaths().nonRoot.relativeDirPath,
13922
14308
  relativeFilePath
@@ -13926,7 +14312,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13926
14312
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
13927
14313
  if (!result.success) {
13928
14314
  throw new Error(
13929
- `Invalid frontmatter in ${(0, import_node_path101.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
14315
+ `Invalid frontmatter in ${(0, import_node_path104.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
13930
14316
  );
13931
14317
  }
13932
14318
  return new _CursorRule({
@@ -13963,7 +14349,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13963
14349
  return {
13964
14350
  success: false,
13965
14351
  error: new Error(
13966
- `Invalid frontmatter in ${(0, import_node_path101.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14352
+ `Invalid frontmatter in ${(0, import_node_path104.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13967
14353
  )
13968
14354
  };
13969
14355
  }
@@ -13983,7 +14369,7 @@ var CursorRule = class _CursorRule extends ToolRule {
13983
14369
  };
13984
14370
 
13985
14371
  // src/features/rules/factorydroid-rule.ts
13986
- var import_node_path102 = require("path");
14372
+ var import_node_path105 = require("path");
13987
14373
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
13988
14374
  constructor({ fileContent, root, ...rest }) {
13989
14375
  super({
@@ -14023,8 +14409,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14023
14409
  const paths = this.getSettablePaths({ global });
14024
14410
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
14025
14411
  if (isRoot) {
14026
- const relativePath2 = (0, import_node_path102.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14027
- const fileContent2 = await readFileContent((0, import_node_path102.join)(baseDir, relativePath2));
14412
+ const relativePath2 = (0, import_node_path105.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14413
+ const fileContent2 = await readFileContent((0, import_node_path105.join)(baseDir, relativePath2));
14028
14414
  return new _FactorydroidRule({
14029
14415
  baseDir,
14030
14416
  relativeDirPath: paths.root.relativeDirPath,
@@ -14037,8 +14423,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14037
14423
  if (!paths.nonRoot) {
14038
14424
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14039
14425
  }
14040
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14041
- const fileContent = await readFileContent((0, import_node_path102.join)(baseDir, relativePath));
14426
+ const relativePath = (0, import_node_path105.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14427
+ const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
14042
14428
  return new _FactorydroidRule({
14043
14429
  baseDir,
14044
14430
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14097,7 +14483,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14097
14483
  };
14098
14484
 
14099
14485
  // src/features/rules/geminicli-rule.ts
14100
- var import_node_path103 = require("path");
14486
+ var import_node_path106 = require("path");
14101
14487
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14102
14488
  static getSettablePaths({
14103
14489
  global,
@@ -14132,7 +14518,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14132
14518
  if (isRoot) {
14133
14519
  const relativePath2 = paths.root.relativeFilePath;
14134
14520
  const fileContent2 = await readFileContent(
14135
- (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14521
+ (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14136
14522
  );
14137
14523
  return new _GeminiCliRule({
14138
14524
  baseDir,
@@ -14146,8 +14532,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14146
14532
  if (!paths.nonRoot) {
14147
14533
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14148
14534
  }
14149
- const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14150
- const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
14535
+ const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14536
+ const fileContent = await readFileContent((0, import_node_path106.join)(baseDir, relativePath));
14151
14537
  return new _GeminiCliRule({
14152
14538
  baseDir,
14153
14539
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14206,7 +14592,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14206
14592
  };
14207
14593
 
14208
14594
  // src/features/rules/goose-rule.ts
14209
- var import_node_path104 = require("path");
14595
+ var import_node_path107 = require("path");
14210
14596
  var GooseRule = class _GooseRule extends ToolRule {
14211
14597
  static getSettablePaths({
14212
14598
  global,
@@ -14241,7 +14627,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14241
14627
  if (isRoot) {
14242
14628
  const relativePath2 = paths.root.relativeFilePath;
14243
14629
  const fileContent2 = await readFileContent(
14244
- (0, import_node_path104.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14630
+ (0, import_node_path107.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14245
14631
  );
14246
14632
  return new _GooseRule({
14247
14633
  baseDir,
@@ -14255,8 +14641,8 @@ var GooseRule = class _GooseRule extends ToolRule {
14255
14641
  if (!paths.nonRoot) {
14256
14642
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14257
14643
  }
14258
- const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14259
- const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
14644
+ const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14645
+ const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14260
14646
  return new _GooseRule({
14261
14647
  baseDir,
14262
14648
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14315,7 +14701,7 @@ var GooseRule = class _GooseRule extends ToolRule {
14315
14701
  };
14316
14702
 
14317
14703
  // src/features/rules/junie-rule.ts
14318
- var import_node_path105 = require("path");
14704
+ var import_node_path108 = require("path");
14319
14705
  var JunieRule = class _JunieRule extends ToolRule {
14320
14706
  static getSettablePaths(_options = {}) {
14321
14707
  return {
@@ -14334,8 +14720,8 @@ var JunieRule = class _JunieRule extends ToolRule {
14334
14720
  validate = true
14335
14721
  }) {
14336
14722
  const isRoot = relativeFilePath === "guidelines.md";
14337
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path105.join)(".junie", "memories", relativeFilePath);
14338
- const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
14723
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path108.join)(".junie", "memories", relativeFilePath);
14724
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14339
14725
  return new _JunieRule({
14340
14726
  baseDir,
14341
14727
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14390,7 +14776,7 @@ var JunieRule = class _JunieRule extends ToolRule {
14390
14776
  };
14391
14777
 
14392
14778
  // src/features/rules/kilo-rule.ts
14393
- var import_node_path106 = require("path");
14779
+ var import_node_path109 = require("path");
14394
14780
  var KiloRule = class _KiloRule extends ToolRule {
14395
14781
  static getSettablePaths(_options = {}) {
14396
14782
  return {
@@ -14405,7 +14791,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14405
14791
  validate = true
14406
14792
  }) {
14407
14793
  const fileContent = await readFileContent(
14408
- (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14794
+ (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14409
14795
  );
14410
14796
  return new _KiloRule({
14411
14797
  baseDir,
@@ -14457,7 +14843,7 @@ var KiloRule = class _KiloRule extends ToolRule {
14457
14843
  };
14458
14844
 
14459
14845
  // src/features/rules/kiro-rule.ts
14460
- var import_node_path107 = require("path");
14846
+ var import_node_path110 = require("path");
14461
14847
  var KiroRule = class _KiroRule extends ToolRule {
14462
14848
  static getSettablePaths(_options = {}) {
14463
14849
  return {
@@ -14472,7 +14858,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14472
14858
  validate = true
14473
14859
  }) {
14474
14860
  const fileContent = await readFileContent(
14475
- (0, import_node_path107.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14861
+ (0, import_node_path110.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14476
14862
  );
14477
14863
  return new _KiroRule({
14478
14864
  baseDir,
@@ -14526,7 +14912,7 @@ var KiroRule = class _KiroRule extends ToolRule {
14526
14912
  };
14527
14913
 
14528
14914
  // src/features/rules/opencode-rule.ts
14529
- var import_node_path108 = require("path");
14915
+ var import_node_path111 = require("path");
14530
14916
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14531
14917
  static getSettablePaths({
14532
14918
  global,
@@ -14561,7 +14947,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14561
14947
  if (isRoot) {
14562
14948
  const relativePath2 = paths.root.relativeFilePath;
14563
14949
  const fileContent2 = await readFileContent(
14564
- (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14950
+ (0, import_node_path111.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14565
14951
  );
14566
14952
  return new _OpenCodeRule({
14567
14953
  baseDir,
@@ -14575,8 +14961,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14575
14961
  if (!paths.nonRoot) {
14576
14962
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14577
14963
  }
14578
- const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14579
- const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14964
+ const relativePath = (0, import_node_path111.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14965
+ const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
14580
14966
  return new _OpenCodeRule({
14581
14967
  baseDir,
14582
14968
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14635,7 +15021,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
14635
15021
  };
14636
15022
 
14637
15023
  // src/features/rules/qwencode-rule.ts
14638
- var import_node_path109 = require("path");
15024
+ var import_node_path112 = require("path");
14639
15025
  var QwencodeRule = class _QwencodeRule extends ToolRule {
14640
15026
  static getSettablePaths(_options = {}) {
14641
15027
  return {
@@ -14654,8 +15040,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14654
15040
  validate = true
14655
15041
  }) {
14656
15042
  const isRoot = relativeFilePath === "QWEN.md";
14657
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path109.join)(".qwen", "memories", relativeFilePath);
14658
- const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
15043
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path112.join)(".qwen", "memories", relativeFilePath);
15044
+ const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
14659
15045
  return new _QwencodeRule({
14660
15046
  baseDir,
14661
15047
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -14707,7 +15093,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
14707
15093
  };
14708
15094
 
14709
15095
  // src/features/rules/replit-rule.ts
14710
- var import_node_path110 = require("path");
15096
+ var import_node_path113 = require("path");
14711
15097
  var ReplitRule = class _ReplitRule extends ToolRule {
14712
15098
  static getSettablePaths(_options = {}) {
14713
15099
  return {
@@ -14729,7 +15115,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14729
15115
  }
14730
15116
  const relativePath = paths.root.relativeFilePath;
14731
15117
  const fileContent = await readFileContent(
14732
- (0, import_node_path110.join)(baseDir, paths.root.relativeDirPath, relativePath)
15118
+ (0, import_node_path113.join)(baseDir, paths.root.relativeDirPath, relativePath)
14733
15119
  );
14734
15120
  return new _ReplitRule({
14735
15121
  baseDir,
@@ -14795,7 +15181,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
14795
15181
  };
14796
15182
 
14797
15183
  // src/features/rules/roo-rule.ts
14798
- var import_node_path111 = require("path");
15184
+ var import_node_path114 = require("path");
14799
15185
  var RooRule = class _RooRule extends ToolRule {
14800
15186
  static getSettablePaths(_options = {}) {
14801
15187
  return {
@@ -14810,7 +15196,7 @@ var RooRule = class _RooRule extends ToolRule {
14810
15196
  validate = true
14811
15197
  }) {
14812
15198
  const fileContent = await readFileContent(
14813
- (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15199
+ (0, import_node_path114.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14814
15200
  );
14815
15201
  return new _RooRule({
14816
15202
  baseDir,
@@ -14879,7 +15265,7 @@ var RooRule = class _RooRule extends ToolRule {
14879
15265
  };
14880
15266
 
14881
15267
  // src/features/rules/warp-rule.ts
14882
- var import_node_path112 = require("path");
15268
+ var import_node_path115 = require("path");
14883
15269
  var WarpRule = class _WarpRule extends ToolRule {
14884
15270
  constructor({ fileContent, root, ...rest }) {
14885
15271
  super({
@@ -14905,8 +15291,8 @@ var WarpRule = class _WarpRule extends ToolRule {
14905
15291
  validate = true
14906
15292
  }) {
14907
15293
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
14908
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path112.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14909
- const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
15294
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path115.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
15295
+ const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
14910
15296
  return new _WarpRule({
14911
15297
  baseDir,
14912
15298
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -14961,7 +15347,7 @@ var WarpRule = class _WarpRule extends ToolRule {
14961
15347
  };
14962
15348
 
14963
15349
  // src/features/rules/windsurf-rule.ts
14964
- var import_node_path113 = require("path");
15350
+ var import_node_path116 = require("path");
14965
15351
  var WindsurfRule = class _WindsurfRule extends ToolRule {
14966
15352
  static getSettablePaths(_options = {}) {
14967
15353
  return {
@@ -14976,7 +15362,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
14976
15362
  validate = true
14977
15363
  }) {
14978
15364
  const fileContent = await readFileContent(
14979
- (0, import_node_path113.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15365
+ (0, import_node_path116.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14980
15366
  );
14981
15367
  return new _WindsurfRule({
14982
15368
  baseDir,
@@ -15052,8 +15438,8 @@ var rulesProcessorToolTargets = [
15052
15438
  "warp",
15053
15439
  "windsurf"
15054
15440
  ];
15055
- var RulesProcessorToolTargetSchema = import_mini54.z.enum(rulesProcessorToolTargets);
15056
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path114.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15441
+ var RulesProcessorToolTargetSchema = import_mini56.z.enum(rulesProcessorToolTargets);
15442
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path117.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15057
15443
  var toolRuleFactories = /* @__PURE__ */ new Map([
15058
15444
  [
15059
15445
  "agentsmd",
@@ -15428,7 +15814,7 @@ var RulesProcessor = class extends FeatureProcessor {
15428
15814
  }).relativeDirPath;
15429
15815
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
15430
15816
  const frontmatter = skill.getFrontmatter();
15431
- const relativePath = (0, import_node_path114.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15817
+ const relativePath = (0, import_node_path117.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
15432
15818
  return {
15433
15819
  name: frontmatter.name,
15434
15820
  description: frontmatter.description,
@@ -15541,12 +15927,12 @@ var RulesProcessor = class extends FeatureProcessor {
15541
15927
  * Load and parse rulesync rule files from .rulesync/rules/ directory
15542
15928
  */
15543
15929
  async loadRulesyncFiles() {
15544
- const rulesyncBaseDir = (0, import_node_path114.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15545
- const files = await findFilesByGlobs((0, import_node_path114.join)(rulesyncBaseDir, "**", "*.md"));
15930
+ const rulesyncBaseDir = (0, import_node_path117.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
15931
+ const files = await findFilesByGlobs((0, import_node_path117.join)(rulesyncBaseDir, "**", "*.md"));
15546
15932
  logger.debug(`Found ${files.length} rulesync files`);
15547
15933
  const rulesyncRules = await Promise.all(
15548
15934
  files.map((file) => {
15549
- const relativeFilePath = (0, import_node_path114.relative)(rulesyncBaseDir, file);
15935
+ const relativeFilePath = (0, import_node_path117.relative)(rulesyncBaseDir, file);
15550
15936
  checkPathTraversal({
15551
15937
  relativePath: relativeFilePath,
15552
15938
  intendedRootDir: rulesyncBaseDir
@@ -15556,41 +15942,57 @@ var RulesProcessor = class extends FeatureProcessor {
15556
15942
  });
15557
15943
  })
15558
15944
  );
15945
+ const factory = this.getFactory(this.toolTarget);
15559
15946
  const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
15560
- if (rootRules.length > 1) {
15561
- throw new Error(`Multiple root rulesync rules found: ${formatRulePaths(rootRules)}`);
15947
+ const targetedRootRules = rootRules.filter(
15948
+ (rule) => factory.class.isTargetedByRulesyncRule(rule)
15949
+ );
15950
+ if (targetedRootRules.length > 1) {
15951
+ throw new Error(
15952
+ `Multiple root rulesync rules found for target '${this.toolTarget}': ${formatRulePaths(targetedRootRules)}`
15953
+ );
15562
15954
  }
15563
- if (rootRules.length === 0 && rulesyncRules.length > 0) {
15955
+ if (targetedRootRules.length === 0 && rulesyncRules.length > 0) {
15564
15956
  logger.warn(
15565
- `No root rulesync rule file found. Consider adding 'root: true' to one of your rule files in ${RULESYNC_RULES_RELATIVE_DIR_PATH}.`
15957
+ `No root rulesync rule file found for target '${this.toolTarget}'. Consider adding 'root: true' to one of your rule files in ${RULESYNC_RULES_RELATIVE_DIR_PATH}.`
15566
15958
  );
15567
15959
  }
15568
15960
  const localRootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().localRoot);
15569
- if (localRootRules.length > 1) {
15961
+ const targetedLocalRootRules = localRootRules.filter(
15962
+ (rule) => factory.class.isTargetedByRulesyncRule(rule)
15963
+ );
15964
+ if (targetedLocalRootRules.length > 1) {
15570
15965
  throw new Error(
15571
- `Multiple localRoot rules found: ${formatRulePaths(localRootRules)}. Only one rule can have localRoot: true`
15966
+ `Multiple localRoot rules found for target '${this.toolTarget}': ${formatRulePaths(targetedLocalRootRules)}. Only one rule can have localRoot: true`
15572
15967
  );
15573
15968
  }
15574
- if (localRootRules.length > 0 && rootRules.length === 0) {
15969
+ if (targetedLocalRootRules.length > 0 && targetedRootRules.length === 0) {
15575
15970
  throw new Error(
15576
- `localRoot: true requires a root: true rule to exist (found in ${formatRulePaths(localRootRules)})`
15971
+ `localRoot: true requires a root: true rule to exist for target '${this.toolTarget}' (found in ${formatRulePaths(targetedLocalRootRules)})`
15577
15972
  );
15578
15973
  }
15579
15974
  if (this.global) {
15580
- const nonRootRules = rulesyncRules.filter((rule) => !rule.getFrontmatter().root);
15581
- if (nonRootRules.length > 0) {
15975
+ const globalPaths = factory.class.getSettablePaths({ global: true });
15976
+ const supportsGlobalNonRoot = "nonRoot" in globalPaths && globalPaths.nonRoot !== null;
15977
+ const nonRootRules2 = rulesyncRules.filter(
15978
+ (rule) => !rule.getFrontmatter().root && !rule.getFrontmatter().localRoot && factory.class.isTargetedByRulesyncRule(rule)
15979
+ );
15980
+ if (nonRootRules2.length > 0 && !supportsGlobalNonRoot) {
15582
15981
  logger.warn(
15583
- `${nonRootRules.length} non-root rulesync rules found, but it's in global mode, so ignoring them: ${formatRulePaths(nonRootRules)}`
15982
+ `${nonRootRules2.length} non-root rulesync rules found, but it's in global mode, so ignoring them: ${formatRulePaths(nonRootRules2)}`
15584
15983
  );
15585
15984
  }
15586
- if (localRootRules.length > 0) {
15985
+ if (targetedLocalRootRules.length > 0) {
15587
15986
  logger.warn(
15588
- `${localRootRules.length} localRoot rules found, but localRoot is not supported in global mode, ignoring them: ${formatRulePaths(localRootRules)}`
15987
+ `${targetedLocalRootRules.length} localRoot rules found, but localRoot is not supported in global mode, ignoring them: ${formatRulePaths(targetedLocalRootRules)}`
15589
15988
  );
15590
15989
  }
15591
- return rootRules;
15990
+ return supportsGlobalNonRoot ? [...targetedRootRules, ...nonRootRules2] : targetedRootRules;
15592
15991
  }
15593
- return rulesyncRules;
15992
+ const nonRootRules = rulesyncRules.filter(
15993
+ (rule) => !rule.getFrontmatter().root && factory.class.isTargetedByRulesyncRule(rule)
15994
+ );
15995
+ return [...targetedRootRules, ...nonRootRules];
15594
15996
  }
15595
15997
  /**
15596
15998
  * Implementation of abstract method from FeatureProcessor
@@ -15605,7 +16007,7 @@ var RulesProcessor = class extends FeatureProcessor {
15605
16007
  global: this.global
15606
16008
  });
15607
16009
  const resolveRelativeDirPath = (filePath) => {
15608
- const dirName = (0, import_node_path114.dirname)((0, import_node_path114.relative)(this.baseDir, filePath));
16010
+ const dirName = (0, import_node_path117.dirname)((0, import_node_path117.relative)(this.baseDir, filePath));
15609
16011
  return dirName === "" ? "." : dirName;
15610
16012
  };
15611
16013
  const findFilesWithFallback = async (primaryGlob, alternativeRoots, buildAltGlob) => {
@@ -15623,13 +16025,13 @@ var RulesProcessor = class extends FeatureProcessor {
15623
16025
  return [];
15624
16026
  }
15625
16027
  const uniqueRootFilePaths = await findFilesWithFallback(
15626
- (0, import_node_path114.join)(
16028
+ (0, import_node_path117.join)(
15627
16029
  this.baseDir,
15628
16030
  settablePaths.root.relativeDirPath ?? ".",
15629
16031
  settablePaths.root.relativeFilePath
15630
16032
  ),
15631
16033
  settablePaths.alternativeRoots,
15632
- (alt) => (0, import_node_path114.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
16034
+ (alt) => (0, import_node_path117.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
15633
16035
  );
15634
16036
  if (forDeletion) {
15635
16037
  return uniqueRootFilePaths.map((filePath) => {
@@ -15641,7 +16043,7 @@ var RulesProcessor = class extends FeatureProcessor {
15641
16043
  return factory.class.forDeletion({
15642
16044
  baseDir: this.baseDir,
15643
16045
  relativeDirPath,
15644
- relativeFilePath: (0, import_node_path114.basename)(filePath),
16046
+ relativeFilePath: (0, import_node_path117.basename)(filePath),
15645
16047
  global: this.global
15646
16048
  });
15647
16049
  }).filter((rule) => rule.isDeletable());
@@ -15655,7 +16057,7 @@ var RulesProcessor = class extends FeatureProcessor {
15655
16057
  });
15656
16058
  return factory.class.fromFile({
15657
16059
  baseDir: this.baseDir,
15658
- relativeFilePath: (0, import_node_path114.basename)(filePath),
16060
+ relativeFilePath: (0, import_node_path117.basename)(filePath),
15659
16061
  relativeDirPath,
15660
16062
  global: this.global
15661
16063
  });
@@ -15674,9 +16076,9 @@ var RulesProcessor = class extends FeatureProcessor {
15674
16076
  return [];
15675
16077
  }
15676
16078
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
15677
- (0, import_node_path114.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
16079
+ (0, import_node_path117.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
15678
16080
  settablePaths.alternativeRoots,
15679
- (alt) => (0, import_node_path114.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
16081
+ (alt) => (0, import_node_path117.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
15680
16082
  );
15681
16083
  return uniqueLocalRootFilePaths.map((filePath) => {
15682
16084
  const relativeDirPath = resolveRelativeDirPath(filePath);
@@ -15687,7 +16089,7 @@ var RulesProcessor = class extends FeatureProcessor {
15687
16089
  return factory.class.forDeletion({
15688
16090
  baseDir: this.baseDir,
15689
16091
  relativeDirPath,
15690
- relativeFilePath: (0, import_node_path114.basename)(filePath),
16092
+ relativeFilePath: (0, import_node_path117.basename)(filePath),
15691
16093
  global: this.global
15692
16094
  });
15693
16095
  }).filter((rule) => rule.isDeletable());
@@ -15697,13 +16099,13 @@ var RulesProcessor = class extends FeatureProcessor {
15697
16099
  if (!settablePaths.nonRoot) {
15698
16100
  return [];
15699
16101
  }
15700
- const nonRootBaseDir = (0, import_node_path114.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
16102
+ const nonRootBaseDir = (0, import_node_path117.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
15701
16103
  const nonRootFilePaths = await findFilesByGlobs(
15702
- (0, import_node_path114.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
16104
+ (0, import_node_path117.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
15703
16105
  );
15704
16106
  if (forDeletion) {
15705
16107
  return nonRootFilePaths.map((filePath) => {
15706
- const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
16108
+ const relativeFilePath = (0, import_node_path117.relative)(nonRootBaseDir, filePath);
15707
16109
  checkPathTraversal({
15708
16110
  relativePath: relativeFilePath,
15709
16111
  intendedRootDir: nonRootBaseDir
@@ -15718,7 +16120,7 @@ var RulesProcessor = class extends FeatureProcessor {
15718
16120
  }
15719
16121
  return await Promise.all(
15720
16122
  nonRootFilePaths.map((filePath) => {
15721
- const relativeFilePath = (0, import_node_path114.relative)(nonRootBaseDir, filePath);
16123
+ const relativeFilePath = (0, import_node_path117.relative)(nonRootBaseDir, filePath);
15722
16124
  checkPathTraversal({
15723
16125
  relativePath: relativeFilePath,
15724
16126
  intendedRootDir: nonRootBaseDir
@@ -15831,14 +16233,14 @@ s/<command> [arguments]
15831
16233
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
15832
16234
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
15833
16235
 
15834
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
16236
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path117.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
15835
16237
  const subagentsSection = subagents ? `## Simulated Subagents
15836
16238
 
15837
16239
  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.
15838
16240
 
15839
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
16241
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path117.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
15840
16242
 
15841
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path114.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
16243
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path117.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
15842
16244
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
15843
16245
  const result = [
15844
16246
  overview,
@@ -15918,7 +16320,7 @@ function warnUnsupportedTargets(params) {
15918
16320
  }
15919
16321
  }
15920
16322
  async function checkRulesyncDirExists(params) {
15921
- return fileExists((0, import_node_path115.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16323
+ return fileExists((0, import_node_path118.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
15922
16324
  }
15923
16325
  async function generate(params) {
15924
16326
  const { config } = params;