rulesync 7.28.0 → 7.30.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.
@@ -30,10 +30,21 @@ var ALL_FEATURES = [
30
30
  var ALL_FEATURES_WITH_WILDCARD = [...ALL_FEATURES, "*"];
31
31
  var FeatureSchema = z.enum(ALL_FEATURES);
32
32
  var FeaturesSchema = z.array(FeatureSchema);
33
+ var FeatureOptionsSchema = z.record(z.string(), z.unknown());
34
+ var FeatureValueSchema = z.union([z.boolean(), FeatureOptionsSchema]);
35
+ var PerFeatureConfigSchema = z.record(z.string(), FeatureValueSchema);
33
36
  var RulesyncFeaturesSchema = z.union([
34
37
  z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)),
35
- z.record(z.string(), z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)))
38
+ z.record(
39
+ z.string(),
40
+ z.union([z.array(z.enum(ALL_FEATURES_WITH_WILDCARD)), PerFeatureConfigSchema])
41
+ )
36
42
  ]);
43
+ var isFeatureValueEnabled = (value) => {
44
+ if (value === true) return true;
45
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) return true;
46
+ return false;
47
+ };
37
48
 
38
49
  // src/types/tool-targets.ts
39
50
  import { z as z2 } from "zod/mini";
@@ -353,7 +364,7 @@ var CONFLICTING_TARGET_PAIRS = [
353
364
  ["claudecode", "claudecode-legacy"]
354
365
  ];
355
366
  var LEGACY_TARGETS = ["augmentcode-legacy", "claudecode-legacy"];
356
- var Config = class {
367
+ var Config = class _Config {
357
368
  baseDirs;
358
369
  targets;
359
370
  features;
@@ -428,26 +439,23 @@ var Config = class {
428
439
  const perTargetFeatures = this.features;
429
440
  if (target) {
430
441
  const targetFeatures = perTargetFeatures[target];
431
- if (!targetFeatures || targetFeatures.length === 0) {
442
+ if (!targetFeatures) {
432
443
  return [];
433
444
  }
434
- if (targetFeatures.includes("*")) {
435
- return [...ALL_FEATURES];
436
- }
437
- return targetFeatures.filter((feature) => feature !== "*");
445
+ return _Config.normalizeTargetFeatures(targetFeatures);
438
446
  }
439
447
  const allFeatures = [];
440
448
  for (const features of Object.values(perTargetFeatures)) {
441
- if (features && features.length > 0) {
442
- if (features.includes("*")) {
443
- return [...ALL_FEATURES];
444
- }
445
- for (const feature of features) {
446
- if (feature !== "*" && !allFeatures.includes(feature)) {
447
- allFeatures.push(feature);
448
- }
449
+ if (!features) continue;
450
+ const normalized = _Config.normalizeTargetFeatures(features);
451
+ for (const feature of normalized) {
452
+ if (!allFeatures.includes(feature)) {
453
+ allFeatures.push(feature);
449
454
  }
450
455
  }
456
+ if (allFeatures.length === ALL_FEATURES.length) {
457
+ return allFeatures;
458
+ }
451
459
  }
452
460
  return allFeatures;
453
461
  }
@@ -456,6 +464,47 @@ var Config = class {
456
464
  }
457
465
  return this.features.filter((feature) => feature !== "*");
458
466
  }
467
+ /**
468
+ * Normalize a per-target features value (array or per-feature object) into
469
+ * the flat list of enabled features.
470
+ */
471
+ static normalizeTargetFeatures(value) {
472
+ if (Array.isArray(value)) {
473
+ if (value.length === 0) return [];
474
+ if (value.includes("*")) return [...ALL_FEATURES];
475
+ return value.filter((feature) => feature !== "*");
476
+ }
477
+ if (isFeatureValueEnabled(value["*"])) {
478
+ return [...ALL_FEATURES];
479
+ }
480
+ const enabled = [];
481
+ for (const [key, val] of Object.entries(value)) {
482
+ if (key === "*") continue;
483
+ if (!isFeatureValueEnabled(val)) continue;
484
+ enabled.push(key);
485
+ }
486
+ return enabled;
487
+ }
488
+ /**
489
+ * Returns the per-feature options object for a given target/feature, if any.
490
+ * Returns `undefined` when no per-feature options were provided or when the
491
+ * feature is not enabled for the given target.
492
+ */
493
+ getFeatureOptions(target, feature) {
494
+ if (Array.isArray(this.features)) {
495
+ return void 0;
496
+ }
497
+ const targetFeatures = this.features[target];
498
+ if (!targetFeatures || Array.isArray(targetFeatures)) {
499
+ return void 0;
500
+ }
501
+ const perFeature = targetFeatures;
502
+ const value = perFeature[feature];
503
+ if (value && typeof value === "object" && isFeatureValueEnabled(value)) {
504
+ return value;
505
+ }
506
+ return void 0;
507
+ }
459
508
  /**
460
509
  * Check if per-target features configuration is being used.
461
510
  */
@@ -607,7 +656,7 @@ function getBaseDirsInLightOfGlobal({
607
656
  }
608
657
 
609
658
  // src/lib/generate.ts
610
- import { join as join131 } from "path";
659
+ import { join as join134 } from "path";
611
660
  import { intersection } from "es-toolkit";
612
661
 
613
662
  // src/features/commands/commands-processor.ts
@@ -5355,7 +5404,7 @@ var HooksProcessor = class extends FeatureProcessor {
5355
5404
  };
5356
5405
 
5357
5406
  // src/features/ignore/ignore-processor.ts
5358
- import { z as z21 } from "zod/mini";
5407
+ import { z as z22 } from "zod/mini";
5359
5408
 
5360
5409
  // src/features/ignore/augmentcode-ignore.ts
5361
5410
  import { join as join32 } from "path";
@@ -5431,7 +5480,7 @@ var ToolIgnore = class extends ToolFile {
5431
5480
  }
5432
5481
  }
5433
5482
  }
5434
- static getSettablePaths() {
5483
+ static getSettablePaths(_params) {
5435
5484
  throw new Error("Please implement this method in the subclass.");
5436
5485
  }
5437
5486
  getPatterns() {
@@ -5534,21 +5583,47 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
5534
5583
  // src/features/ignore/claudecode-ignore.ts
5535
5584
  import { join as join33 } from "path";
5536
5585
  import { uniq } from "es-toolkit";
5586
+ import { z as z21 } from "zod/mini";
5587
+ var SHARED_SETTINGS_FILE = "settings.json";
5588
+ var LOCAL_SETTINGS_FILE = "settings.local.json";
5589
+ var DEFAULT_FILE_MODE = "shared";
5590
+ var ClaudecodeIgnoreOptionsSchema = z21.looseObject({
5591
+ fileMode: z21.optional(z21.enum(["shared", "local"]))
5592
+ });
5593
+ var resolveFileMode = (options) => {
5594
+ if (!options) return DEFAULT_FILE_MODE;
5595
+ const parsed = ClaudecodeIgnoreOptionsSchema.safeParse(options);
5596
+ if (!parsed.success) {
5597
+ throw new Error(
5598
+ `Invalid options for claudecode ignore feature: ${parsed.error.message}. \`fileMode\` must be either "shared" or "local".`
5599
+ );
5600
+ }
5601
+ return parsed.data.fileMode ?? DEFAULT_FILE_MODE;
5602
+ };
5603
+ var fileNameForMode = (fileMode) => {
5604
+ return fileMode === "local" ? LOCAL_SETTINGS_FILE : SHARED_SETTINGS_FILE;
5605
+ };
5537
5606
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5538
5607
  constructor(params) {
5539
5608
  super(params);
5540
5609
  const jsonValue = JSON.parse(this.fileContent);
5541
5610
  this.patterns = jsonValue.permissions?.deny ?? [];
5542
5611
  }
5543
- static getSettablePaths() {
5612
+ static getSettablePaths(params) {
5613
+ const fileMode = resolveFileMode(params?.options);
5544
5614
  return {
5545
5615
  relativeDirPath: ".claude",
5546
- relativeFilePath: "settings.json"
5616
+ relativeFilePath: fileNameForMode(fileMode)
5547
5617
  };
5548
5618
  }
5549
5619
  /**
5550
- * ClaudecodeIgnore uses settings.json, which can include non-ignore settings.
5551
- * It should not be deleted by rulesync.
5620
+ * ClaudecodeIgnore uses settings.json (or settings.local.json), which can
5621
+ * include non-ignore settings. It should not be deleted by rulesync.
5622
+ *
5623
+ * NOTE: Because this returns `false`, switching `fileMode` (e.g. from
5624
+ * `"local"` to `"shared"`) will not automatically clean up deny patterns
5625
+ * in the previously-used file. Users must manually remove stale deny
5626
+ * entries from the old file when changing `fileMode`.
5552
5627
  */
5553
5628
  isDeletable() {
5554
5629
  return false;
@@ -5570,16 +5645,14 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5570
5645
  }
5571
5646
  static async fromRulesyncIgnore({
5572
5647
  baseDir = process.cwd(),
5573
- rulesyncIgnore
5648
+ rulesyncIgnore,
5649
+ options
5574
5650
  }) {
5575
5651
  const fileContent = rulesyncIgnore.getFileContent();
5576
5652
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5577
5653
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
5578
- const filePath = join33(
5579
- baseDir,
5580
- this.getSettablePaths().relativeDirPath,
5581
- this.getSettablePaths().relativeFilePath
5582
- );
5654
+ const paths = this.getSettablePaths({ options });
5655
+ const filePath = join33(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5583
5656
  const exists = await fileExists(filePath);
5584
5657
  const existingFileContent = exists ? await readFileContent(filePath) : "{}";
5585
5658
  const existingJsonValue = JSON.parse(existingFileContent);
@@ -5600,27 +5673,29 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5600
5673
  };
5601
5674
  return new _ClaudecodeIgnore({
5602
5675
  baseDir,
5603
- relativeDirPath: this.getSettablePaths().relativeDirPath,
5604
- relativeFilePath: this.getSettablePaths().relativeFilePath,
5676
+ relativeDirPath: paths.relativeDirPath,
5677
+ relativeFilePath: paths.relativeFilePath,
5605
5678
  fileContent: JSON.stringify(jsonValue, null, 2),
5606
5679
  validate: true
5607
5680
  });
5608
5681
  }
5609
5682
  static async fromFile({
5610
5683
  baseDir = process.cwd(),
5611
- validate = true
5684
+ validate = true,
5685
+ options
5612
5686
  }) {
5613
- const fileContent = await readFileContent(
5614
- join33(
5615
- baseDir,
5616
- this.getSettablePaths().relativeDirPath,
5617
- this.getSettablePaths().relativeFilePath
5618
- )
5619
- );
5687
+ const fileMode = resolveFileMode(options);
5688
+ const paths = this.getSettablePaths({ options });
5689
+ const filePath = join33(baseDir, paths.relativeDirPath, paths.relativeFilePath);
5690
+ const exists = await fileExists(filePath);
5691
+ if (!exists && fileMode === "shared") {
5692
+ throw new Error(`File not found: ${filePath}`);
5693
+ }
5694
+ const fileContent = exists ? await readFileContent(filePath) : "{}";
5620
5695
  return new _ClaudecodeIgnore({
5621
5696
  baseDir,
5622
- relativeDirPath: this.getSettablePaths().relativeDirPath,
5623
- relativeFilePath: this.getSettablePaths().relativeFilePath,
5697
+ relativeDirPath: paths.relativeDirPath,
5698
+ relativeFilePath: paths.relativeFilePath,
5624
5699
  fileContent,
5625
5700
  validate
5626
5701
  });
@@ -6357,7 +6432,7 @@ var ignoreProcessorToolTargets = [
6357
6432
  "windsurf",
6358
6433
  "zed"
6359
6434
  ];
6360
- var IgnoreProcessorToolTargetSchema = z21.enum(ignoreProcessorToolTargets);
6435
+ var IgnoreProcessorToolTargetSchema = z22.enum(ignoreProcessorToolTargets);
6361
6436
  var toolIgnoreFactories = /* @__PURE__ */ new Map([
6362
6437
  ["augmentcode", { class: AugmentcodeIgnore }],
6363
6438
  ["claudecode", { class: ClaudecodeIgnore }],
@@ -6384,12 +6459,14 @@ var defaultGetFactory2 = (target) => {
6384
6459
  var IgnoreProcessor = class extends FeatureProcessor {
6385
6460
  toolTarget;
6386
6461
  getFactory;
6462
+ featureOptions;
6387
6463
  constructor({
6388
6464
  baseDir = process.cwd(),
6389
6465
  toolTarget,
6390
6466
  getFactory = defaultGetFactory2,
6391
6467
  dryRun = false,
6392
- logger
6468
+ logger,
6469
+ featureOptions
6393
6470
  }) {
6394
6471
  super({ baseDir, dryRun, logger });
6395
6472
  const result = IgnoreProcessorToolTargetSchema.safeParse(toolTarget);
@@ -6400,6 +6477,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
6400
6477
  }
6401
6478
  this.toolTarget = result.data;
6402
6479
  this.getFactory = getFactory;
6480
+ this.featureOptions = featureOptions;
6403
6481
  }
6404
6482
  async writeToolIgnoresFromRulesyncIgnores(rulesyncIgnores) {
6405
6483
  const toolIgnores = await this.convertRulesyncFilesToToolFiles(rulesyncIgnores);
@@ -6428,7 +6506,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
6428
6506
  } = {}) {
6429
6507
  try {
6430
6508
  const factory = this.getFactory(this.toolTarget);
6431
- const paths = factory.class.getSettablePaths();
6509
+ const paths = factory.class.getSettablePaths({ options: this.featureOptions });
6432
6510
  if (forDeletion) {
6433
6511
  const toolIgnore = factory.class.forDeletion({
6434
6512
  baseDir: this.baseDir,
@@ -6452,7 +6530,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
6452
6530
  }
6453
6531
  async loadToolIgnores() {
6454
6532
  const factory = this.getFactory(this.toolTarget);
6455
- return [await factory.class.fromFile({ baseDir: this.baseDir })];
6533
+ return [await factory.class.fromFile({ baseDir: this.baseDir, options: this.featureOptions })];
6456
6534
  }
6457
6535
  /**
6458
6536
  * Implementation of abstract method from FeatureProcessor
@@ -6468,7 +6546,8 @@ var IgnoreProcessor = class extends FeatureProcessor {
6468
6546
  const factory = this.getFactory(this.toolTarget);
6469
6547
  const toolIgnore = await factory.class.fromRulesyncIgnore({
6470
6548
  baseDir: this.baseDir,
6471
- rulesyncIgnore
6549
+ rulesyncIgnore,
6550
+ options: this.featureOptions
6472
6551
  });
6473
6552
  return [toolIgnore];
6474
6553
  }
@@ -6496,7 +6575,7 @@ var IgnoreProcessor = class extends FeatureProcessor {
6496
6575
  };
6497
6576
 
6498
6577
  // src/features/mcp/mcp-processor.ts
6499
- import { z as z26 } from "zod/mini";
6578
+ import { z as z27 } from "zod/mini";
6500
6579
 
6501
6580
  // src/features/mcp/claudecode-mcp.ts
6502
6581
  import { join as join46 } from "path";
@@ -6504,47 +6583,47 @@ import { join as join46 } from "path";
6504
6583
  // src/features/mcp/rulesync-mcp.ts
6505
6584
  import { join as join45 } from "path";
6506
6585
  import { omit } from "es-toolkit/object";
6507
- import { z as z23 } from "zod/mini";
6586
+ import { z as z24 } from "zod/mini";
6508
6587
 
6509
6588
  // src/types/mcp.ts
6510
- import { z as z22 } from "zod/mini";
6511
- var McpServerSchema = z22.looseObject({
6512
- type: z22.optional(z22.enum(["local", "stdio", "sse", "http"])),
6513
- command: z22.optional(z22.union([z22.string(), z22.array(z22.string())])),
6514
- args: z22.optional(z22.array(z22.string())),
6515
- url: z22.optional(z22.string()),
6516
- httpUrl: z22.optional(z22.string()),
6517
- env: z22.optional(z22.record(z22.string(), z22.string())),
6518
- disabled: z22.optional(z22.boolean()),
6519
- networkTimeout: z22.optional(z22.number()),
6520
- timeout: z22.optional(z22.number()),
6521
- trust: z22.optional(z22.boolean()),
6522
- cwd: z22.optional(z22.string()),
6523
- transport: z22.optional(z22.enum(["local", "stdio", "sse", "http"])),
6524
- alwaysAllow: z22.optional(z22.array(z22.string())),
6525
- tools: z22.optional(z22.array(z22.string())),
6526
- kiroAutoApprove: z22.optional(z22.array(z22.string())),
6527
- kiroAutoBlock: z22.optional(z22.array(z22.string())),
6528
- headers: z22.optional(z22.record(z22.string(), z22.string())),
6529
- enabledTools: z22.optional(z22.array(z22.string())),
6530
- disabledTools: z22.optional(z22.array(z22.string()))
6589
+ import { z as z23 } from "zod/mini";
6590
+ var McpServerSchema = z23.looseObject({
6591
+ type: z23.optional(z23.enum(["local", "stdio", "sse", "http"])),
6592
+ command: z23.optional(z23.union([z23.string(), z23.array(z23.string())])),
6593
+ args: z23.optional(z23.array(z23.string())),
6594
+ url: z23.optional(z23.string()),
6595
+ httpUrl: z23.optional(z23.string()),
6596
+ env: z23.optional(z23.record(z23.string(), z23.string())),
6597
+ disabled: z23.optional(z23.boolean()),
6598
+ networkTimeout: z23.optional(z23.number()),
6599
+ timeout: z23.optional(z23.number()),
6600
+ trust: z23.optional(z23.boolean()),
6601
+ cwd: z23.optional(z23.string()),
6602
+ transport: z23.optional(z23.enum(["local", "stdio", "sse", "http"])),
6603
+ alwaysAllow: z23.optional(z23.array(z23.string())),
6604
+ tools: z23.optional(z23.array(z23.string())),
6605
+ kiroAutoApprove: z23.optional(z23.array(z23.string())),
6606
+ kiroAutoBlock: z23.optional(z23.array(z23.string())),
6607
+ headers: z23.optional(z23.record(z23.string(), z23.string())),
6608
+ enabledTools: z23.optional(z23.array(z23.string())),
6609
+ disabledTools: z23.optional(z23.array(z23.string()))
6531
6610
  });
6532
- var McpServersSchema = z22.record(z22.string(), McpServerSchema);
6611
+ var McpServersSchema = z23.record(z23.string(), McpServerSchema);
6533
6612
  function isMcpServers(value) {
6534
6613
  return value !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value);
6535
6614
  }
6536
6615
 
6537
6616
  // src/features/mcp/rulesync-mcp.ts
6538
- var RulesyncMcpServerSchema = z23.extend(McpServerSchema, {
6539
- targets: z23.optional(RulesyncTargetsSchema),
6540
- description: z23.optional(z23.string()),
6541
- exposed: z23.optional(z23.boolean())
6617
+ var RulesyncMcpServerSchema = z24.extend(McpServerSchema, {
6618
+ targets: z24.optional(RulesyncTargetsSchema),
6619
+ description: z24.optional(z24.string()),
6620
+ exposed: z24.optional(z24.boolean())
6542
6621
  });
6543
- var RulesyncMcpConfigSchema = z23.object({
6544
- mcpServers: z23.record(z23.string(), RulesyncMcpServerSchema)
6622
+ var RulesyncMcpConfigSchema = z24.object({
6623
+ mcpServers: z24.record(z24.string(), RulesyncMcpServerSchema)
6545
6624
  });
6546
- var RulesyncMcpFileSchema = z23.looseObject({
6547
- $schema: z23.optional(z23.string()),
6625
+ var RulesyncMcpFileSchema = z24.looseObject({
6626
+ $schema: z24.optional(z24.string()),
6548
6627
  ...RulesyncMcpConfigSchema.shape
6549
6628
  });
6550
6629
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
@@ -7745,25 +7824,25 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
7745
7824
  // src/features/mcp/kilo-mcp.ts
7746
7825
  import { join as join56 } from "path";
7747
7826
  import { parse as parseJsonc3 } from "jsonc-parser";
7748
- import { z as z24 } from "zod/mini";
7749
- var KiloMcpLocalServerSchema = z24.object({
7750
- type: z24.literal("local"),
7751
- command: z24.array(z24.string()),
7752
- environment: z24.optional(z24.record(z24.string(), z24.string())),
7753
- enabled: z24._default(z24.boolean(), true),
7754
- cwd: z24.optional(z24.string())
7827
+ import { z as z25 } from "zod/mini";
7828
+ var KiloMcpLocalServerSchema = z25.object({
7829
+ type: z25.literal("local"),
7830
+ command: z25.array(z25.string()),
7831
+ environment: z25.optional(z25.record(z25.string(), z25.string())),
7832
+ enabled: z25._default(z25.boolean(), true),
7833
+ cwd: z25.optional(z25.string())
7755
7834
  });
7756
- var KiloMcpRemoteServerSchema = z24.object({
7757
- type: z24.literal("remote"),
7758
- url: z24.string(),
7759
- headers: z24.optional(z24.record(z24.string(), z24.string())),
7760
- enabled: z24._default(z24.boolean(), true)
7835
+ var KiloMcpRemoteServerSchema = z25.object({
7836
+ type: z25.literal("remote"),
7837
+ url: z25.string(),
7838
+ headers: z25.optional(z25.record(z25.string(), z25.string())),
7839
+ enabled: z25._default(z25.boolean(), true)
7761
7840
  });
7762
- var KiloMcpServerSchema = z24.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
7763
- var KiloConfigSchema = z24.looseObject({
7764
- $schema: z24.optional(z24.string()),
7765
- mcp: z24.optional(z24.record(z24.string(), KiloMcpServerSchema)),
7766
- tools: z24.optional(z24.record(z24.string(), z24.boolean()))
7841
+ var KiloMcpServerSchema = z25.union([KiloMcpLocalServerSchema, KiloMcpRemoteServerSchema]);
7842
+ var KiloConfigSchema = z25.looseObject({
7843
+ $schema: z25.optional(z25.string()),
7844
+ mcp: z25.optional(z25.record(z25.string(), KiloMcpServerSchema)),
7845
+ tools: z25.optional(z25.record(z25.string(), z25.boolean()))
7767
7846
  });
7768
7847
  function convertFromKiloFormat(kiloMcp, tools) {
7769
7848
  return Object.fromEntries(
@@ -8060,28 +8139,28 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
8060
8139
  // src/features/mcp/opencode-mcp.ts
8061
8140
  import { join as join58 } from "path";
8062
8141
  import { parse as parseJsonc4 } from "jsonc-parser";
8063
- import { z as z25 } from "zod/mini";
8064
- var OpencodeMcpLocalServerSchema = z25.object({
8065
- type: z25.literal("local"),
8066
- command: z25.array(z25.string()),
8067
- environment: z25.optional(z25.record(z25.string(), z25.string())),
8068
- enabled: z25._default(z25.boolean(), true),
8069
- cwd: z25.optional(z25.string())
8142
+ import { z as z26 } from "zod/mini";
8143
+ var OpencodeMcpLocalServerSchema = z26.object({
8144
+ type: z26.literal("local"),
8145
+ command: z26.array(z26.string()),
8146
+ environment: z26.optional(z26.record(z26.string(), z26.string())),
8147
+ enabled: z26._default(z26.boolean(), true),
8148
+ cwd: z26.optional(z26.string())
8070
8149
  });
8071
- var OpencodeMcpRemoteServerSchema = z25.object({
8072
- type: z25.literal("remote"),
8073
- url: z25.string(),
8074
- headers: z25.optional(z25.record(z25.string(), z25.string())),
8075
- enabled: z25._default(z25.boolean(), true)
8150
+ var OpencodeMcpRemoteServerSchema = z26.object({
8151
+ type: z26.literal("remote"),
8152
+ url: z26.string(),
8153
+ headers: z26.optional(z26.record(z26.string(), z26.string())),
8154
+ enabled: z26._default(z26.boolean(), true)
8076
8155
  });
8077
- var OpencodeMcpServerSchema = z25.union([
8156
+ var OpencodeMcpServerSchema = z26.union([
8078
8157
  OpencodeMcpLocalServerSchema,
8079
8158
  OpencodeMcpRemoteServerSchema
8080
8159
  ]);
8081
- var OpencodeConfigSchema = z25.looseObject({
8082
- $schema: z25.optional(z25.string()),
8083
- mcp: z25.optional(z25.record(z25.string(), OpencodeMcpServerSchema)),
8084
- tools: z25.optional(z25.record(z25.string(), z25.boolean()))
8160
+ var OpencodeConfigSchema = z26.looseObject({
8161
+ $schema: z26.optional(z26.string()),
8162
+ mcp: z26.optional(z26.record(z26.string(), OpencodeMcpServerSchema)),
8163
+ tools: z26.optional(z26.record(z26.string(), z26.boolean()))
8085
8164
  });
8086
8165
  function convertFromOpencodeFormat(opencodeMcp, tools) {
8087
8166
  return Object.fromEntries(
@@ -8552,7 +8631,7 @@ var mcpProcessorToolTargetTuple = [
8552
8631
  "roo",
8553
8632
  "rovodev"
8554
8633
  ];
8555
- var McpProcessorToolTargetSchema = z26.enum(mcpProcessorToolTargetTuple);
8634
+ var McpProcessorToolTargetSchema = z27.enum(mcpProcessorToolTargetTuple);
8556
8635
  var toolMcpFactories = /* @__PURE__ */ new Map([
8557
8636
  [
8558
8637
  "claudecode",
@@ -8890,124 +8969,706 @@ var McpProcessor = class extends FeatureProcessor {
8890
8969
  }
8891
8970
  };
8892
8971
 
8893
- // src/features/rules/rules-processor.ts
8894
- import { basename as basename10, dirname as dirname3, join as join130, relative as relative5 } from "path";
8895
- import { encode } from "@toon-format/toon";
8896
- import { z as z65 } from "zod/mini";
8897
-
8898
- // src/constants/general.ts
8899
- var SKILL_FILE_NAME = "SKILL.md";
8972
+ // src/features/permissions/permissions-processor.ts
8973
+ import { z as z30 } from "zod/mini";
8900
8974
 
8901
- // src/features/skills/agentsmd-skill.ts
8902
- import { join as join64 } from "path";
8975
+ // src/features/permissions/claudecode-permissions.ts
8976
+ import { join as join62 } from "path";
8977
+ import { uniq as uniq3 } from "es-toolkit";
8903
8978
 
8904
- // src/features/skills/simulated-skill.ts
8905
- import { join as join63 } from "path";
8906
- import { z as z27 } from "zod/mini";
8979
+ // src/features/permissions/rulesync-permissions.ts
8980
+ import { join as join61 } from "path";
8907
8981
 
8908
- // src/features/skills/tool-skill.ts
8909
- import { join as join62 } from "path";
8982
+ // src/types/permissions.ts
8983
+ import { z as z28 } from "zod/mini";
8984
+ var PermissionActionSchema = z28.enum(["allow", "ask", "deny"]);
8985
+ var PermissionRulesSchema = z28.record(z28.string(), PermissionActionSchema);
8986
+ var PermissionsConfigSchema = z28.looseObject({
8987
+ permission: z28.record(z28.string(), PermissionRulesSchema)
8988
+ });
8989
+ var RulesyncPermissionsFileSchema = z28.looseObject({
8990
+ $schema: z28.optional(z28.string()),
8991
+ ...PermissionsConfigSchema.shape
8992
+ });
8910
8993
 
8911
- // src/types/ai-dir.ts
8912
- import path2, { basename as basename3, join as join61, relative as relative4, resolve as resolve4 } from "path";
8913
- var AiDir = class {
8914
- /**
8915
- * @example "."
8916
- */
8917
- baseDir;
8918
- /**
8919
- * @example ".rulesync/skills"
8920
- */
8921
- relativeDirPath;
8922
- /**
8923
- * @example "my-skill"
8924
- */
8925
- dirName;
8926
- /**
8927
- * Optional main file with frontmatter support
8928
- */
8929
- mainFile;
8930
- /**
8931
- * Additional files in the directory
8932
- */
8933
- otherFiles;
8934
- /**
8935
- * @example false
8936
- */
8937
- global;
8938
- constructor({
8994
+ // src/features/permissions/rulesync-permissions.ts
8995
+ var RulesyncPermissions = class _RulesyncPermissions extends RulesyncFile {
8996
+ json;
8997
+ constructor(params) {
8998
+ super({ ...params });
8999
+ this.json = JSON.parse(this.fileContent);
9000
+ if (params.validate) {
9001
+ const result = this.validate();
9002
+ if (!result.success) {
9003
+ throw result.error;
9004
+ }
9005
+ }
9006
+ }
9007
+ static getSettablePaths() {
9008
+ return {
9009
+ relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
9010
+ relativeFilePath: RULESYNC_PERMISSIONS_FILE_NAME
9011
+ };
9012
+ }
9013
+ validate() {
9014
+ const result = RulesyncPermissionsFileSchema.safeParse(this.json);
9015
+ if (!result.success) {
9016
+ return { success: false, error: result.error };
9017
+ }
9018
+ return { success: true, error: null };
9019
+ }
9020
+ static async fromFile({
8939
9021
  baseDir = process.cwd(),
8940
- relativeDirPath,
8941
- dirName,
8942
- mainFile,
8943
- otherFiles = [],
8944
- global = false
9022
+ validate = true
8945
9023
  }) {
8946
- if (dirName.includes(path2.sep) || dirName.includes("/") || dirName.includes("\\")) {
8947
- throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
9024
+ const paths = _RulesyncPermissions.getSettablePaths();
9025
+ const filePath = join61(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9026
+ if (!await fileExists(filePath)) {
9027
+ throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
8948
9028
  }
8949
- this.baseDir = baseDir;
8950
- this.relativeDirPath = relativeDirPath;
8951
- this.dirName = dirName;
8952
- this.mainFile = mainFile;
8953
- this.otherFiles = otherFiles;
8954
- this.global = global;
9029
+ const fileContent = await readFileContent(filePath);
9030
+ return new _RulesyncPermissions({
9031
+ baseDir,
9032
+ relativeDirPath: paths.relativeDirPath,
9033
+ relativeFilePath: paths.relativeFilePath,
9034
+ fileContent,
9035
+ validate
9036
+ });
8955
9037
  }
8956
- static async fromDir(_params) {
9038
+ getJson() {
9039
+ return this.json;
9040
+ }
9041
+ };
9042
+
9043
+ // src/features/permissions/tool-permissions.ts
9044
+ var ToolPermissions = class extends ToolFile {
9045
+ static getSettablePaths(_options) {
8957
9046
  throw new Error("Please implement this method in the subclass.");
8958
9047
  }
8959
- getBaseDir() {
8960
- return this.baseDir;
9048
+ validate() {
9049
+ return { success: true, error: null };
8961
9050
  }
8962
- getRelativeDirPath() {
8963
- return this.relativeDirPath;
9051
+ static fromRulesyncPermissions(_params) {
9052
+ throw new Error("Please implement this method in the subclass.");
8964
9053
  }
8965
- getDirName() {
8966
- return this.dirName;
9054
+ toRulesyncPermissionsDefault({
9055
+ fileContent
9056
+ }) {
9057
+ return new RulesyncPermissions({
9058
+ baseDir: this.baseDir,
9059
+ relativeDirPath: RULESYNC_RELATIVE_DIR_PATH,
9060
+ relativeFilePath: RULESYNC_PERMISSIONS_FILE_NAME,
9061
+ fileContent
9062
+ });
8967
9063
  }
8968
- getDirPath() {
8969
- const fullPath = path2.join(this.baseDir, this.relativeDirPath, this.dirName);
8970
- const resolvedFull = resolve4(fullPath);
8971
- const resolvedBase = resolve4(this.baseDir);
8972
- const rel = relative4(resolvedBase, resolvedFull);
8973
- if (rel.startsWith("..") || path2.isAbsolute(rel)) {
8974
- throw new Error(
8975
- `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
8976
- );
8977
- }
8978
- return fullPath;
9064
+ static async fromFile(_params) {
9065
+ throw new Error("Please implement this method in the subclass.");
8979
9066
  }
8980
- getMainFile() {
8981
- return this.mainFile;
9067
+ static forDeletion(_params) {
9068
+ throw new Error("Please implement this method in the subclass.");
8982
9069
  }
8983
- getOtherFiles() {
8984
- return this.otherFiles;
9070
+ };
9071
+
9072
+ // src/features/permissions/claudecode-permissions.ts
9073
+ var CANONICAL_TO_CLAUDE_TOOL_NAMES = {
9074
+ bash: "Bash",
9075
+ read: "Read",
9076
+ edit: "Edit",
9077
+ write: "Write",
9078
+ webfetch: "WebFetch",
9079
+ websearch: "WebSearch",
9080
+ grep: "Grep",
9081
+ glob: "Glob",
9082
+ notebookedit: "NotebookEdit",
9083
+ agent: "Agent"
9084
+ };
9085
+ var CLAUDE_TO_CANONICAL_TOOL_NAMES = Object.fromEntries(
9086
+ Object.entries(CANONICAL_TO_CLAUDE_TOOL_NAMES).map(([k, v]) => [v, k])
9087
+ );
9088
+ function toClaudeToolName(canonical) {
9089
+ return CANONICAL_TO_CLAUDE_TOOL_NAMES[canonical] ?? canonical;
9090
+ }
9091
+ function toCanonicalToolName(claudeName) {
9092
+ return CLAUDE_TO_CANONICAL_TOOL_NAMES[claudeName] ?? claudeName;
9093
+ }
9094
+ function parseClaudePermissionEntry(entry) {
9095
+ const parenIndex = entry.indexOf("(");
9096
+ if (parenIndex === -1) {
9097
+ return { toolName: entry, pattern: "*" };
8985
9098
  }
8986
- /**
8987
- * Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
8988
- */
8989
- getRelativePathFromCwd() {
8990
- return toPosixPath(path2.join(this.relativeDirPath, this.dirName));
9099
+ const toolName = entry.slice(0, parenIndex);
9100
+ if (!entry.endsWith(")")) {
9101
+ return { toolName, pattern: "*" };
8991
9102
  }
8992
- getGlobal() {
8993
- return this.global;
9103
+ const pattern = entry.slice(parenIndex + 1, -1);
9104
+ return { toolName, pattern: pattern || "*" };
9105
+ }
9106
+ function buildClaudePermissionEntry(toolName, pattern) {
9107
+ if (pattern === "*") {
9108
+ return toolName;
8994
9109
  }
8995
- setMainFile(name, body, frontmatter) {
8996
- this.mainFile = { name, body, frontmatter };
9110
+ return `${toolName}(${pattern})`;
9111
+ }
9112
+ var ClaudecodePermissions = class _ClaudecodePermissions extends ToolPermissions {
9113
+ constructor(params) {
9114
+ super({
9115
+ ...params,
9116
+ fileContent: params.fileContent ?? "{}"
9117
+ });
8997
9118
  }
8998
- /**
8999
- * Recursively collects all files from a directory, excluding the specified main file.
9000
- * This is a common utility for loading additional files alongside the main file.
9001
- *
9002
- * @param baseDir - The base directory path
9003
- * @param relativeDirPath - The relative path to the directory containing the skill
9004
- * @param dirName - The name of the directory
9005
- * @param excludeFileName - The name of the file to exclude (typically the main file)
9006
- * @returns Array of files with their relative paths and buffers
9119
+ isDeletable() {
9120
+ return false;
9121
+ }
9122
+ static getSettablePaths() {
9123
+ return {
9124
+ relativeDirPath: ".claude",
9125
+ relativeFilePath: "settings.json"
9126
+ };
9127
+ }
9128
+ static async fromFile({
9129
+ baseDir = process.cwd(),
9130
+ validate = true
9131
+ }) {
9132
+ const paths = _ClaudecodePermissions.getSettablePaths();
9133
+ const filePath = join62(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9134
+ const fileContent = await readFileContentOrNull(filePath) ?? '{"permissions":{}}';
9135
+ return new _ClaudecodePermissions({
9136
+ baseDir,
9137
+ relativeDirPath: paths.relativeDirPath,
9138
+ relativeFilePath: paths.relativeFilePath,
9139
+ fileContent,
9140
+ validate
9141
+ });
9142
+ }
9143
+ static async fromRulesyncPermissions({
9144
+ baseDir = process.cwd(),
9145
+ rulesyncPermissions,
9146
+ logger
9147
+ }) {
9148
+ const paths = _ClaudecodePermissions.getSettablePaths();
9149
+ const filePath = join62(baseDir, paths.relativeDirPath, paths.relativeFilePath);
9150
+ const existingContent = await readOrInitializeFileContent(
9151
+ filePath,
9152
+ JSON.stringify({}, null, 2)
9153
+ );
9154
+ let settings;
9155
+ try {
9156
+ settings = JSON.parse(existingContent);
9157
+ } catch (error) {
9158
+ throw new Error(
9159
+ `Failed to parse existing Claude settings at ${filePath}: ${formatError(error)}`,
9160
+ { cause: error }
9161
+ );
9162
+ }
9163
+ const config = rulesyncPermissions.getJson();
9164
+ const { allow, ask, deny } = convertRulesyncToClaudePermissions(config);
9165
+ const managedToolNames = new Set(
9166
+ Object.keys(config.permission).map((category) => toClaudeToolName(category))
9167
+ );
9168
+ const existingPermissions = settings.permissions ?? {};
9169
+ const preservedAllow = (existingPermissions.allow ?? []).filter(
9170
+ (entry) => !managedToolNames.has(parseClaudePermissionEntry(entry).toolName)
9171
+ );
9172
+ const preservedAsk = (existingPermissions.ask ?? []).filter(
9173
+ (entry) => !managedToolNames.has(parseClaudePermissionEntry(entry).toolName)
9174
+ );
9175
+ const preservedDeny = (existingPermissions.deny ?? []).filter(
9176
+ (entry) => !managedToolNames.has(parseClaudePermissionEntry(entry).toolName)
9177
+ );
9178
+ if (logger && managedToolNames.has("Read")) {
9179
+ const droppedReadDenyEntries = (existingPermissions.deny ?? []).filter((entry) => {
9180
+ const { toolName } = parseClaudePermissionEntry(entry);
9181
+ return toolName === "Read";
9182
+ });
9183
+ if (droppedReadDenyEntries.length > 0) {
9184
+ logger.warn(
9185
+ `Permissions feature manages 'Read' tool and will overwrite ${droppedReadDenyEntries.length} existing Read deny entries (possibly from ignore feature). Permissions take precedence.`
9186
+ );
9187
+ }
9188
+ }
9189
+ const mergedPermissions = {
9190
+ ...existingPermissions
9191
+ };
9192
+ const mergedAllow = uniq3([...preservedAllow, ...allow].toSorted());
9193
+ const mergedAsk = uniq3([...preservedAsk, ...ask].toSorted());
9194
+ const mergedDeny = uniq3([...preservedDeny, ...deny].toSorted());
9195
+ if (mergedAllow.length > 0) {
9196
+ mergedPermissions.allow = mergedAllow;
9197
+ } else {
9198
+ delete mergedPermissions.allow;
9199
+ }
9200
+ if (mergedAsk.length > 0) {
9201
+ mergedPermissions.ask = mergedAsk;
9202
+ } else {
9203
+ delete mergedPermissions.ask;
9204
+ }
9205
+ if (mergedDeny.length > 0) {
9206
+ mergedPermissions.deny = mergedDeny;
9207
+ } else {
9208
+ delete mergedPermissions.deny;
9209
+ }
9210
+ const merged = { ...settings, permissions: mergedPermissions };
9211
+ const fileContent = JSON.stringify(merged, null, 2);
9212
+ return new _ClaudecodePermissions({
9213
+ baseDir,
9214
+ relativeDirPath: paths.relativeDirPath,
9215
+ relativeFilePath: paths.relativeFilePath,
9216
+ fileContent,
9217
+ validate: true
9218
+ });
9219
+ }
9220
+ toRulesyncPermissions() {
9221
+ let settings;
9222
+ try {
9223
+ settings = JSON.parse(this.getFileContent());
9224
+ } catch (error) {
9225
+ throw new Error(
9226
+ `Failed to parse Claude permissions content in ${join62(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
9227
+ { cause: error }
9228
+ );
9229
+ }
9230
+ const permissions = settings.permissions ?? {};
9231
+ const config = convertClaudeToRulesyncPermissions({
9232
+ allow: permissions.allow ?? [],
9233
+ ask: permissions.ask ?? [],
9234
+ deny: permissions.deny ?? []
9235
+ });
9236
+ return this.toRulesyncPermissionsDefault({
9237
+ fileContent: JSON.stringify(config, null, 2)
9238
+ });
9239
+ }
9240
+ validate() {
9241
+ return { success: true, error: null };
9242
+ }
9243
+ static forDeletion({
9244
+ baseDir = process.cwd(),
9245
+ relativeDirPath,
9246
+ relativeFilePath
9247
+ }) {
9248
+ return new _ClaudecodePermissions({
9249
+ baseDir,
9250
+ relativeDirPath,
9251
+ relativeFilePath,
9252
+ fileContent: JSON.stringify({ permissions: {} }, null, 2),
9253
+ validate: false
9254
+ });
9255
+ }
9256
+ };
9257
+ function convertRulesyncToClaudePermissions(config) {
9258
+ const allow = [];
9259
+ const ask = [];
9260
+ const deny = [];
9261
+ for (const [category, rules] of Object.entries(config.permission)) {
9262
+ const claudeToolName = toClaudeToolName(category);
9263
+ for (const [pattern, action] of Object.entries(rules)) {
9264
+ const entry = buildClaudePermissionEntry(claudeToolName, pattern);
9265
+ switch (action) {
9266
+ case "allow":
9267
+ allow.push(entry);
9268
+ break;
9269
+ case "ask":
9270
+ ask.push(entry);
9271
+ break;
9272
+ case "deny":
9273
+ deny.push(entry);
9274
+ break;
9275
+ }
9276
+ }
9277
+ }
9278
+ return { allow, ask, deny };
9279
+ }
9280
+ function convertClaudeToRulesyncPermissions(params) {
9281
+ const permission = {};
9282
+ const processEntries = (entries, action) => {
9283
+ for (const entry of entries) {
9284
+ const { toolName, pattern } = parseClaudePermissionEntry(entry);
9285
+ const canonical = toCanonicalToolName(toolName);
9286
+ if (!permission[canonical]) {
9287
+ permission[canonical] = {};
9288
+ }
9289
+ permission[canonical][pattern] = action;
9290
+ }
9291
+ };
9292
+ processEntries(params.allow, "allow");
9293
+ processEntries(params.ask, "ask");
9294
+ processEntries(params.deny, "deny");
9295
+ return { permission };
9296
+ }
9297
+
9298
+ // src/features/permissions/opencode-permissions.ts
9299
+ import { join as join63 } from "path";
9300
+ import { parse as parseJsonc5 } from "jsonc-parser";
9301
+ import { z as z29 } from "zod/mini";
9302
+ var OpencodePermissionSchema = z29.union([
9303
+ z29.enum(["allow", "ask", "deny"]),
9304
+ z29.record(z29.string(), z29.enum(["allow", "ask", "deny"]))
9305
+ ]);
9306
+ var OpencodePermissionsConfigSchema = z29.looseObject({
9307
+ permission: z29.optional(z29.record(z29.string(), OpencodePermissionSchema))
9308
+ });
9309
+ var OpencodePermissions = class _OpencodePermissions extends ToolPermissions {
9310
+ json;
9311
+ constructor(params) {
9312
+ super(params);
9313
+ this.json = OpencodePermissionsConfigSchema.parse(parseJsonc5(this.fileContent || "{}"));
9314
+ }
9315
+ getJson() {
9316
+ return this.json;
9317
+ }
9318
+ isDeletable() {
9319
+ return false;
9320
+ }
9321
+ static getSettablePaths({
9322
+ global = false
9323
+ } = {}) {
9324
+ return global ? { relativeDirPath: join63(".config", "opencode"), relativeFilePath: "opencode.json" } : { relativeDirPath: ".", relativeFilePath: "opencode.json" };
9325
+ }
9326
+ static async fromFile({
9327
+ baseDir = process.cwd(),
9328
+ validate = true,
9329
+ global = false
9330
+ }) {
9331
+ const basePaths = _OpencodePermissions.getSettablePaths({ global });
9332
+ const jsonDir = join63(baseDir, basePaths.relativeDirPath);
9333
+ const jsoncPath = join63(jsonDir, "opencode.jsonc");
9334
+ const jsonPath = join63(jsonDir, "opencode.json");
9335
+ let fileContent = await readFileContentOrNull(jsoncPath);
9336
+ let relativeFilePath = "opencode.jsonc";
9337
+ if (!fileContent) {
9338
+ fileContent = await readFileContentOrNull(jsonPath);
9339
+ if (fileContent) {
9340
+ relativeFilePath = "opencode.json";
9341
+ }
9342
+ }
9343
+ const parsed = parseJsonc5(fileContent ?? "{}");
9344
+ const nextJson = { ...parsed, permission: parsed.permission ?? {} };
9345
+ return new _OpencodePermissions({
9346
+ baseDir,
9347
+ relativeDirPath: basePaths.relativeDirPath,
9348
+ relativeFilePath,
9349
+ fileContent: JSON.stringify(nextJson, null, 2),
9350
+ validate
9351
+ });
9352
+ }
9353
+ static async fromRulesyncPermissions({
9354
+ baseDir = process.cwd(),
9355
+ rulesyncPermissions,
9356
+ global = false
9357
+ }) {
9358
+ const basePaths = _OpencodePermissions.getSettablePaths({ global });
9359
+ const jsonDir = join63(baseDir, basePaths.relativeDirPath);
9360
+ const jsoncPath = join63(jsonDir, "opencode.jsonc");
9361
+ const jsonPath = join63(jsonDir, "opencode.json");
9362
+ let fileContent = await readFileContentOrNull(jsoncPath);
9363
+ let relativeFilePath = "opencode.jsonc";
9364
+ if (!fileContent) {
9365
+ fileContent = await readFileContentOrNull(jsonPath);
9366
+ if (fileContent) {
9367
+ relativeFilePath = "opencode.json";
9368
+ }
9369
+ }
9370
+ const parsed = parseJsonc5(fileContent ?? "{}");
9371
+ const nextJson = {
9372
+ ...parsed,
9373
+ permission: rulesyncPermissions.getJson().permission
9374
+ };
9375
+ return new _OpencodePermissions({
9376
+ baseDir,
9377
+ relativeDirPath: basePaths.relativeDirPath,
9378
+ relativeFilePath,
9379
+ fileContent: JSON.stringify(nextJson, null, 2),
9380
+ validate: true
9381
+ });
9382
+ }
9383
+ toRulesyncPermissions() {
9384
+ const permission = this.normalizePermission(this.json.permission);
9385
+ return this.toRulesyncPermissionsDefault({
9386
+ fileContent: JSON.stringify({ permission }, null, 2)
9387
+ });
9388
+ }
9389
+ validate() {
9390
+ try {
9391
+ const json = JSON.parse(this.fileContent || "{}");
9392
+ const result = OpencodePermissionsConfigSchema.safeParse(json);
9393
+ if (!result.success) {
9394
+ return { success: false, error: result.error };
9395
+ }
9396
+ return { success: true, error: null };
9397
+ } catch (error) {
9398
+ return {
9399
+ success: false,
9400
+ error: new Error(`Failed to parse OpenCode permissions JSON: ${formatError(error)}`)
9401
+ };
9402
+ }
9403
+ }
9404
+ static forDeletion({
9405
+ baseDir = process.cwd(),
9406
+ relativeDirPath,
9407
+ relativeFilePath
9408
+ }) {
9409
+ return new _OpencodePermissions({
9410
+ baseDir,
9411
+ relativeDirPath,
9412
+ relativeFilePath,
9413
+ fileContent: JSON.stringify({ permission: {} }, null, 2),
9414
+ validate: false
9415
+ });
9416
+ }
9417
+ normalizePermission(permission) {
9418
+ if (!permission) {
9419
+ return {};
9420
+ }
9421
+ return Object.fromEntries(
9422
+ Object.entries(permission).map(([tool, value]) => [
9423
+ tool,
9424
+ typeof value === "string" ? { "*": value } : value
9425
+ ])
9426
+ );
9427
+ }
9428
+ };
9429
+
9430
+ // src/features/permissions/permissions-processor.ts
9431
+ var permissionsProcessorToolTargetTuple = ["claudecode", "opencode"];
9432
+ var PermissionsProcessorToolTargetSchema = z30.enum(permissionsProcessorToolTargetTuple);
9433
+ var toolPermissionsFactories = /* @__PURE__ */ new Map([
9434
+ [
9435
+ "claudecode",
9436
+ {
9437
+ class: ClaudecodePermissions,
9438
+ meta: {
9439
+ supportsProject: true,
9440
+ supportsGlobal: false,
9441
+ supportsImport: true
9442
+ }
9443
+ }
9444
+ ],
9445
+ [
9446
+ "opencode",
9447
+ {
9448
+ class: OpencodePermissions,
9449
+ meta: {
9450
+ supportsProject: true,
9451
+ supportsGlobal: true,
9452
+ supportsImport: true
9453
+ }
9454
+ }
9455
+ ]
9456
+ ]);
9457
+ var PermissionsProcessor = class extends FeatureProcessor {
9458
+ toolTarget;
9459
+ global;
9460
+ constructor({
9461
+ baseDir = process.cwd(),
9462
+ toolTarget,
9463
+ global = false,
9464
+ dryRun = false,
9465
+ logger
9466
+ }) {
9467
+ super({ baseDir, dryRun, logger });
9468
+ const result = PermissionsProcessorToolTargetSchema.safeParse(toolTarget);
9469
+ if (!result.success) {
9470
+ throw new Error(
9471
+ `Invalid tool target for PermissionsProcessor: ${toolTarget}. ${formatError(result.error)}`
9472
+ );
9473
+ }
9474
+ this.toolTarget = result.data;
9475
+ this.global = global;
9476
+ }
9477
+ async loadRulesyncFiles() {
9478
+ try {
9479
+ return [
9480
+ await RulesyncPermissions.fromFile({
9481
+ baseDir: process.cwd(),
9482
+ validate: true
9483
+ })
9484
+ ];
9485
+ } catch (error) {
9486
+ this.logger.error(
9487
+ `Failed to load Rulesync permissions file (${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH}): ${formatError(error)}`
9488
+ );
9489
+ return [];
9490
+ }
9491
+ }
9492
+ async loadToolFiles({
9493
+ forDeletion = false
9494
+ } = {}) {
9495
+ try {
9496
+ const factory = toolPermissionsFactories.get(this.toolTarget);
9497
+ if (!factory) throw new Error(`Unsupported tool target: ${this.toolTarget}`);
9498
+ const paths = factory.class.getSettablePaths({ global: this.global });
9499
+ if (forDeletion) {
9500
+ const toolPermissions2 = factory.class.forDeletion({
9501
+ baseDir: this.baseDir,
9502
+ relativeDirPath: paths.relativeDirPath,
9503
+ relativeFilePath: paths.relativeFilePath,
9504
+ global: this.global
9505
+ });
9506
+ const list = toolPermissions2.isDeletable?.() !== false ? [toolPermissions2] : [];
9507
+ return list;
9508
+ }
9509
+ const toolPermissions = await factory.class.fromFile({
9510
+ baseDir: this.baseDir,
9511
+ validate: true,
9512
+ global: this.global
9513
+ });
9514
+ return [toolPermissions];
9515
+ } catch (error) {
9516
+ const msg = `Failed to load permissions files for tool target: ${this.toolTarget}: ${formatError(error)}`;
9517
+ if (error instanceof Error && error.message.includes("no such file or directory")) {
9518
+ this.logger.debug(msg);
9519
+ } else {
9520
+ this.logger.error(msg);
9521
+ }
9522
+ return [];
9523
+ }
9524
+ }
9525
+ async convertRulesyncFilesToToolFiles(rulesyncFiles) {
9526
+ const rulesyncPermissions = rulesyncFiles.find(
9527
+ (f) => f instanceof RulesyncPermissions
9528
+ );
9529
+ if (!rulesyncPermissions) {
9530
+ throw new Error(`No ${RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH} found.`);
9531
+ }
9532
+ const factory = toolPermissionsFactories.get(this.toolTarget);
9533
+ if (!factory) throw new Error(`Unsupported tool target: ${this.toolTarget}`);
9534
+ const toolPermissions = await factory.class.fromRulesyncPermissions({
9535
+ baseDir: this.baseDir,
9536
+ rulesyncPermissions,
9537
+ logger: this.logger,
9538
+ global: this.global
9539
+ });
9540
+ return [toolPermissions];
9541
+ }
9542
+ async convertToolFilesToRulesyncFiles(toolFiles) {
9543
+ const permissions = toolFiles.filter((f) => f instanceof ToolPermissions);
9544
+ return permissions.map((p) => p.toRulesyncPermissions());
9545
+ }
9546
+ static getToolTargets({
9547
+ global = false,
9548
+ importOnly = false
9549
+ } = {}) {
9550
+ return [...toolPermissionsFactories.entries()].filter(([, f]) => global ? f.meta.supportsGlobal : f.meta.supportsProject).filter(([, f]) => importOnly ? f.meta.supportsImport : true).map(([target]) => target);
9551
+ }
9552
+ };
9553
+
9554
+ // src/features/rules/rules-processor.ts
9555
+ import { basename as basename10, dirname as dirname3, join as join133, relative as relative5 } from "path";
9556
+ import { encode } from "@toon-format/toon";
9557
+ import { z as z69 } from "zod/mini";
9558
+
9559
+ // src/constants/general.ts
9560
+ var SKILL_FILE_NAME = "SKILL.md";
9561
+
9562
+ // src/features/skills/agentsmd-skill.ts
9563
+ import { join as join67 } from "path";
9564
+
9565
+ // src/features/skills/simulated-skill.ts
9566
+ import { join as join66 } from "path";
9567
+ import { z as z31 } from "zod/mini";
9568
+
9569
+ // src/features/skills/tool-skill.ts
9570
+ import { join as join65 } from "path";
9571
+
9572
+ // src/types/ai-dir.ts
9573
+ import path2, { basename as basename3, join as join64, relative as relative4, resolve as resolve4 } from "path";
9574
+ var AiDir = class {
9575
+ /**
9576
+ * @example "."
9577
+ */
9578
+ baseDir;
9579
+ /**
9580
+ * @example ".rulesync/skills"
9581
+ */
9582
+ relativeDirPath;
9583
+ /**
9584
+ * @example "my-skill"
9585
+ */
9586
+ dirName;
9587
+ /**
9588
+ * Optional main file with frontmatter support
9589
+ */
9590
+ mainFile;
9591
+ /**
9592
+ * Additional files in the directory
9593
+ */
9594
+ otherFiles;
9595
+ /**
9596
+ * @example false
9597
+ */
9598
+ global;
9599
+ constructor({
9600
+ baseDir = process.cwd(),
9601
+ relativeDirPath,
9602
+ dirName,
9603
+ mainFile,
9604
+ otherFiles = [],
9605
+ global = false
9606
+ }) {
9607
+ if (dirName.includes(path2.sep) || dirName.includes("/") || dirName.includes("\\")) {
9608
+ throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
9609
+ }
9610
+ this.baseDir = baseDir;
9611
+ this.relativeDirPath = relativeDirPath;
9612
+ this.dirName = dirName;
9613
+ this.mainFile = mainFile;
9614
+ this.otherFiles = otherFiles;
9615
+ this.global = global;
9616
+ }
9617
+ static async fromDir(_params) {
9618
+ throw new Error("Please implement this method in the subclass.");
9619
+ }
9620
+ getBaseDir() {
9621
+ return this.baseDir;
9622
+ }
9623
+ getRelativeDirPath() {
9624
+ return this.relativeDirPath;
9625
+ }
9626
+ getDirName() {
9627
+ return this.dirName;
9628
+ }
9629
+ getDirPath() {
9630
+ const fullPath = path2.join(this.baseDir, this.relativeDirPath, this.dirName);
9631
+ const resolvedFull = resolve4(fullPath);
9632
+ const resolvedBase = resolve4(this.baseDir);
9633
+ const rel = relative4(resolvedBase, resolvedFull);
9634
+ if (rel.startsWith("..") || path2.isAbsolute(rel)) {
9635
+ throw new Error(
9636
+ `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
9637
+ );
9638
+ }
9639
+ return fullPath;
9640
+ }
9641
+ getMainFile() {
9642
+ return this.mainFile;
9643
+ }
9644
+ getOtherFiles() {
9645
+ return this.otherFiles;
9646
+ }
9647
+ /**
9648
+ * Returns the relative path from CWD with POSIX separators for consistent cross-platform output.
9649
+ */
9650
+ getRelativePathFromCwd() {
9651
+ return toPosixPath(path2.join(this.relativeDirPath, this.dirName));
9652
+ }
9653
+ getGlobal() {
9654
+ return this.global;
9655
+ }
9656
+ setMainFile(name, body, frontmatter) {
9657
+ this.mainFile = { name, body, frontmatter };
9658
+ }
9659
+ /**
9660
+ * Recursively collects all files from a directory, excluding the specified main file.
9661
+ * This is a common utility for loading additional files alongside the main file.
9662
+ *
9663
+ * @param baseDir - The base directory path
9664
+ * @param relativeDirPath - The relative path to the directory containing the skill
9665
+ * @param dirName - The name of the directory
9666
+ * @param excludeFileName - The name of the file to exclude (typically the main file)
9667
+ * @returns Array of files with their relative paths and buffers
9007
9668
  */
9008
9669
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
9009
- const dirPath = join61(baseDir, relativeDirPath, dirName);
9010
- const glob = join61(dirPath, "**", "*");
9670
+ const dirPath = join64(baseDir, relativeDirPath, dirName);
9671
+ const glob = join64(dirPath, "**", "*");
9011
9672
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
9012
9673
  const filteredPaths = filePaths.filter((filePath) => basename3(filePath) !== excludeFileName);
9013
9674
  const files = await Promise.all(
@@ -9108,8 +9769,8 @@ var ToolSkill = class extends AiDir {
9108
9769
  }) {
9109
9770
  const settablePaths = getSettablePaths({ global });
9110
9771
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9111
- const skillDirPath = join62(baseDir, actualRelativeDirPath, dirName);
9112
- const skillFilePath = join62(skillDirPath, SKILL_FILE_NAME);
9772
+ const skillDirPath = join65(baseDir, actualRelativeDirPath, dirName);
9773
+ const skillFilePath = join65(skillDirPath, SKILL_FILE_NAME);
9113
9774
  if (!await fileExists(skillFilePath)) {
9114
9775
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9115
9776
  }
@@ -9133,16 +9794,16 @@ var ToolSkill = class extends AiDir {
9133
9794
  }
9134
9795
  requireMainFileFrontmatter() {
9135
9796
  if (!this.mainFile?.frontmatter) {
9136
- throw new Error(`Frontmatter is not defined in ${join62(this.relativeDirPath, this.dirName)}`);
9797
+ throw new Error(`Frontmatter is not defined in ${join65(this.relativeDirPath, this.dirName)}`);
9137
9798
  }
9138
9799
  return this.mainFile.frontmatter;
9139
9800
  }
9140
9801
  };
9141
9802
 
9142
9803
  // src/features/skills/simulated-skill.ts
9143
- var SimulatedSkillFrontmatterSchema = z27.looseObject({
9144
- name: z27.string(),
9145
- description: z27.string()
9804
+ var SimulatedSkillFrontmatterSchema = z31.looseObject({
9805
+ name: z31.string(),
9806
+ description: z31.string()
9146
9807
  });
9147
9808
  var SimulatedSkill = class extends ToolSkill {
9148
9809
  frontmatter;
@@ -9173,7 +9834,7 @@ var SimulatedSkill = class extends ToolSkill {
9173
9834
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
9174
9835
  if (!result.success) {
9175
9836
  throw new Error(
9176
- `Invalid frontmatter in ${join63(relativeDirPath, dirName)}: ${formatError(result.error)}`
9837
+ `Invalid frontmatter in ${join66(relativeDirPath, dirName)}: ${formatError(result.error)}`
9177
9838
  );
9178
9839
  }
9179
9840
  }
@@ -9232,8 +9893,8 @@ var SimulatedSkill = class extends ToolSkill {
9232
9893
  }) {
9233
9894
  const settablePaths = this.getSettablePaths();
9234
9895
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
9235
- const skillDirPath = join63(baseDir, actualRelativeDirPath, dirName);
9236
- const skillFilePath = join63(skillDirPath, SKILL_FILE_NAME);
9896
+ const skillDirPath = join66(baseDir, actualRelativeDirPath, dirName);
9897
+ const skillFilePath = join66(skillDirPath, SKILL_FILE_NAME);
9237
9898
  if (!await fileExists(skillFilePath)) {
9238
9899
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9239
9900
  }
@@ -9310,7 +9971,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9310
9971
  throw new Error("AgentsmdSkill does not support global mode.");
9311
9972
  }
9312
9973
  return {
9313
- relativeDirPath: join64(".agents", "skills")
9974
+ relativeDirPath: join67(".agents", "skills")
9314
9975
  };
9315
9976
  }
9316
9977
  static async fromDir(params) {
@@ -9337,11 +9998,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
9337
9998
  };
9338
9999
 
9339
10000
  // src/features/skills/factorydroid-skill.ts
9340
- import { join as join65 } from "path";
10001
+ import { join as join68 } from "path";
9341
10002
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
9342
10003
  static getSettablePaths(_options) {
9343
10004
  return {
9344
- relativeDirPath: join65(".factory", "skills")
10005
+ relativeDirPath: join68(".factory", "skills")
9345
10006
  };
9346
10007
  }
9347
10008
  static async fromDir(params) {
@@ -9368,50 +10029,50 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
9368
10029
  };
9369
10030
 
9370
10031
  // src/features/skills/rovodev-skill.ts
9371
- import { join as join67 } from "path";
9372
- import { z as z29 } from "zod/mini";
10032
+ import { join as join70 } from "path";
10033
+ import { z as z33 } from "zod/mini";
9373
10034
 
9374
10035
  // src/features/skills/rulesync-skill.ts
9375
- import { join as join66 } from "path";
9376
- import { z as z28 } from "zod/mini";
9377
- var RulesyncSkillFrontmatterSchemaInternal = z28.looseObject({
9378
- name: z28.string(),
9379
- description: z28.string(),
9380
- targets: z28._default(RulesyncTargetsSchema, ["*"]),
9381
- claudecode: z28.optional(
9382
- z28.looseObject({
9383
- "allowed-tools": z28.optional(z28.array(z28.string())),
9384
- model: z28.optional(z28.string()),
9385
- "disable-model-invocation": z28.optional(z28.boolean())
10036
+ import { join as join69 } from "path";
10037
+ import { z as z32 } from "zod/mini";
10038
+ var RulesyncSkillFrontmatterSchemaInternal = z32.looseObject({
10039
+ name: z32.string(),
10040
+ description: z32.string(),
10041
+ targets: z32._default(RulesyncTargetsSchema, ["*"]),
10042
+ claudecode: z32.optional(
10043
+ z32.looseObject({
10044
+ "allowed-tools": z32.optional(z32.array(z32.string())),
10045
+ model: z32.optional(z32.string()),
10046
+ "disable-model-invocation": z32.optional(z32.boolean())
9386
10047
  })
9387
10048
  ),
9388
- codexcli: z28.optional(
9389
- z28.looseObject({
9390
- "short-description": z28.optional(z28.string())
10049
+ codexcli: z32.optional(
10050
+ z32.looseObject({
10051
+ "short-description": z32.optional(z32.string())
9391
10052
  })
9392
10053
  ),
9393
- opencode: z28.optional(
9394
- z28.looseObject({
9395
- "allowed-tools": z28.optional(z28.array(z28.string()))
10054
+ opencode: z32.optional(
10055
+ z32.looseObject({
10056
+ "allowed-tools": z32.optional(z32.array(z32.string()))
9396
10057
  })
9397
10058
  ),
9398
- kilo: z28.optional(
9399
- z28.looseObject({
9400
- "allowed-tools": z28.optional(z28.array(z28.string()))
10059
+ kilo: z32.optional(
10060
+ z32.looseObject({
10061
+ "allowed-tools": z32.optional(z32.array(z32.string()))
9401
10062
  })
9402
10063
  ),
9403
- deepagents: z28.optional(
9404
- z28.looseObject({
9405
- "allowed-tools": z28.optional(z28.array(z28.string()))
10064
+ deepagents: z32.optional(
10065
+ z32.looseObject({
10066
+ "allowed-tools": z32.optional(z32.array(z32.string()))
9406
10067
  })
9407
10068
  ),
9408
- copilot: z28.optional(
9409
- z28.looseObject({
9410
- license: z28.optional(z28.string())
10069
+ copilot: z32.optional(
10070
+ z32.looseObject({
10071
+ license: z32.optional(z32.string())
9411
10072
  })
9412
10073
  ),
9413
- cline: z28.optional(z28.looseObject({})),
9414
- roo: z28.optional(z28.looseObject({}))
10074
+ cline: z32.optional(z32.looseObject({})),
10075
+ roo: z32.optional(z32.looseObject({}))
9415
10076
  });
9416
10077
  var RulesyncSkillFrontmatterSchema = RulesyncSkillFrontmatterSchemaInternal;
9417
10078
  var RulesyncSkill = class _RulesyncSkill extends AiDir {
@@ -9451,7 +10112,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9451
10112
  }
9452
10113
  getFrontmatter() {
9453
10114
  if (!this.mainFile?.frontmatter) {
9454
- throw new Error(`Frontmatter is not defined in ${join66(this.relativeDirPath, this.dirName)}`);
10115
+ throw new Error(`Frontmatter is not defined in ${join69(this.relativeDirPath, this.dirName)}`);
9455
10116
  }
9456
10117
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
9457
10118
  return result;
@@ -9477,8 +10138,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9477
10138
  dirName,
9478
10139
  global = false
9479
10140
  }) {
9480
- const skillDirPath = join66(baseDir, relativeDirPath, dirName);
9481
- const skillFilePath = join66(skillDirPath, SKILL_FILE_NAME);
10141
+ const skillDirPath = join69(baseDir, relativeDirPath, dirName);
10142
+ const skillFilePath = join69(skillDirPath, SKILL_FILE_NAME);
9482
10143
  if (!await fileExists(skillFilePath)) {
9483
10144
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
9484
10145
  }
@@ -9508,14 +10169,14 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
9508
10169
  };
9509
10170
 
9510
10171
  // src/features/skills/rovodev-skill.ts
9511
- var RovodevSkillFrontmatterSchema = z29.looseObject({
9512
- name: z29.string(),
9513
- description: z29.string()
10172
+ var RovodevSkillFrontmatterSchema = z33.looseObject({
10173
+ name: z33.string(),
10174
+ description: z33.string()
9514
10175
  });
9515
10176
  var RovodevSkill = class _RovodevSkill extends ToolSkill {
9516
10177
  constructor({
9517
10178
  baseDir = process.cwd(),
9518
- relativeDirPath = join67(".rovodev", "skills"),
10179
+ relativeDirPath = join70(".rovodev", "skills"),
9519
10180
  dirName,
9520
10181
  frontmatter,
9521
10182
  body,
@@ -9544,8 +10205,8 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9544
10205
  }
9545
10206
  static getSettablePaths(_options) {
9546
10207
  return {
9547
- relativeDirPath: join67(".rovodev", "skills"),
9548
- alternativeSkillRoots: [join67(".agents", "skills")]
10208
+ relativeDirPath: join70(".rovodev", "skills"),
10209
+ alternativeSkillRoots: [join70(".agents", "skills")]
9549
10210
  };
9550
10211
  }
9551
10212
  getFrontmatter() {
@@ -9633,13 +10294,13 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9633
10294
  });
9634
10295
  const result = RovodevSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9635
10296
  if (!result.success) {
9636
- const skillDirPath = join67(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10297
+ const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9637
10298
  throw new Error(
9638
- `Invalid frontmatter in ${join67(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10299
+ `Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9639
10300
  );
9640
10301
  }
9641
10302
  if (result.data.name !== loaded.dirName) {
9642
- const skillFilePath = join67(
10303
+ const skillFilePath = join70(
9643
10304
  loaded.baseDir,
9644
10305
  loaded.relativeDirPath,
9645
10306
  loaded.dirName,
@@ -9681,11 +10342,11 @@ var RovodevSkill = class _RovodevSkill extends ToolSkill {
9681
10342
  };
9682
10343
 
9683
10344
  // src/features/skills/skills-processor.ts
9684
- import { basename as basename5, join as join85 } from "path";
9685
- import { z as z45 } from "zod/mini";
10345
+ import { basename as basename5, join as join88 } from "path";
10346
+ import { z as z49 } from "zod/mini";
9686
10347
 
9687
10348
  // src/types/dir-feature-processor.ts
9688
- import { join as join68 } from "path";
10349
+ import { join as join71 } from "path";
9689
10350
  var DirFeatureProcessor = class {
9690
10351
  baseDir;
9691
10352
  dryRun;
@@ -9725,7 +10386,7 @@ var DirFeatureProcessor = class {
9725
10386
  const mainFile = aiDir.getMainFile();
9726
10387
  let mainFileContent;
9727
10388
  if (mainFile) {
9728
- const mainFilePath = join68(dirPath, mainFile.name);
10389
+ const mainFilePath = join71(dirPath, mainFile.name);
9729
10390
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
9730
10391
  avoidBlockScalars: this.avoidBlockScalars
9731
10392
  });
@@ -9745,7 +10406,7 @@ var DirFeatureProcessor = class {
9745
10406
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
9746
10407
  otherFileContents.push(contentWithNewline);
9747
10408
  if (!dirHasChanges) {
9748
- const filePath = join68(dirPath, file.relativeFilePathToDirPath);
10409
+ const filePath = join71(dirPath, file.relativeFilePathToDirPath);
9749
10410
  const existingContent = await readFileContentOrNull(filePath);
9750
10411
  if (!fileContentsEquivalent({
9751
10412
  filePath,
@@ -9763,24 +10424,24 @@ var DirFeatureProcessor = class {
9763
10424
  if (this.dryRun) {
9764
10425
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
9765
10426
  if (mainFile) {
9766
- this.logger.info(`[DRY RUN] Would write: ${join68(dirPath, mainFile.name)}`);
9767
- changedPaths.push(join68(relativeDir, mainFile.name));
10427
+ this.logger.info(`[DRY RUN] Would write: ${join71(dirPath, mainFile.name)}`);
10428
+ changedPaths.push(join71(relativeDir, mainFile.name));
9768
10429
  }
9769
10430
  for (const file of otherFiles) {
9770
10431
  this.logger.info(
9771
- `[DRY RUN] Would write: ${join68(dirPath, file.relativeFilePathToDirPath)}`
10432
+ `[DRY RUN] Would write: ${join71(dirPath, file.relativeFilePathToDirPath)}`
9772
10433
  );
9773
- changedPaths.push(join68(relativeDir, file.relativeFilePathToDirPath));
10434
+ changedPaths.push(join71(relativeDir, file.relativeFilePathToDirPath));
9774
10435
  }
9775
10436
  } else {
9776
10437
  await ensureDir(dirPath);
9777
10438
  if (mainFile && mainFileContent) {
9778
- const mainFilePath = join68(dirPath, mainFile.name);
10439
+ const mainFilePath = join71(dirPath, mainFile.name);
9779
10440
  await writeFileContent(mainFilePath, mainFileContent);
9780
- changedPaths.push(join68(relativeDir, mainFile.name));
10441
+ changedPaths.push(join71(relativeDir, mainFile.name));
9781
10442
  }
9782
10443
  for (const [i, file] of otherFiles.entries()) {
9783
- const filePath = join68(dirPath, file.relativeFilePathToDirPath);
10444
+ const filePath = join71(dirPath, file.relativeFilePathToDirPath);
9784
10445
  const content = otherFileContents[i];
9785
10446
  if (content === void 0) {
9786
10447
  throw new Error(
@@ -9788,7 +10449,7 @@ var DirFeatureProcessor = class {
9788
10449
  );
9789
10450
  }
9790
10451
  await writeFileContent(filePath, content);
9791
- changedPaths.push(join68(relativeDir, file.relativeFilePathToDirPath));
10452
+ changedPaths.push(join71(relativeDir, file.relativeFilePathToDirPath));
9792
10453
  }
9793
10454
  }
9794
10455
  changedCount++;
@@ -9820,16 +10481,16 @@ var DirFeatureProcessor = class {
9820
10481
  };
9821
10482
 
9822
10483
  // src/features/skills/agentsskills-skill.ts
9823
- import { join as join69 } from "path";
9824
- import { z as z30 } from "zod/mini";
9825
- var AgentsSkillsSkillFrontmatterSchema = z30.looseObject({
9826
- name: z30.string(),
9827
- description: z30.string()
10484
+ import { join as join72 } from "path";
10485
+ import { z as z34 } from "zod/mini";
10486
+ var AgentsSkillsSkillFrontmatterSchema = z34.looseObject({
10487
+ name: z34.string(),
10488
+ description: z34.string()
9828
10489
  });
9829
10490
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9830
10491
  constructor({
9831
10492
  baseDir = process.cwd(),
9832
- relativeDirPath = join69(".agents", "skills"),
10493
+ relativeDirPath = join72(".agents", "skills"),
9833
10494
  dirName,
9834
10495
  frontmatter,
9835
10496
  body,
@@ -9861,7 +10522,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9861
10522
  throw new Error("AgentsSkillsSkill does not support global mode.");
9862
10523
  }
9863
10524
  return {
9864
- relativeDirPath: join69(".agents", "skills")
10525
+ relativeDirPath: join72(".agents", "skills")
9865
10526
  };
9866
10527
  }
9867
10528
  getFrontmatter() {
@@ -9941,9 +10602,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9941
10602
  });
9942
10603
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9943
10604
  if (!result.success) {
9944
- const skillDirPath = join69(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10605
+ const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9945
10606
  throw new Error(
9946
- `Invalid frontmatter in ${join69(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10607
+ `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9947
10608
  );
9948
10609
  }
9949
10610
  return new _AgentsSkillsSkill({
@@ -9978,16 +10639,16 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
9978
10639
  };
9979
10640
 
9980
10641
  // src/features/skills/antigravity-skill.ts
9981
- import { join as join70 } from "path";
9982
- import { z as z31 } from "zod/mini";
9983
- var AntigravitySkillFrontmatterSchema = z31.looseObject({
9984
- name: z31.string(),
9985
- description: z31.string()
10642
+ import { join as join73 } from "path";
10643
+ import { z as z35 } from "zod/mini";
10644
+ var AntigravitySkillFrontmatterSchema = z35.looseObject({
10645
+ name: z35.string(),
10646
+ description: z35.string()
9986
10647
  });
9987
10648
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
9988
10649
  constructor({
9989
10650
  baseDir = process.cwd(),
9990
- relativeDirPath = join70(".agent", "skills"),
10651
+ relativeDirPath = join73(".agent", "skills"),
9991
10652
  dirName,
9992
10653
  frontmatter,
9993
10654
  body,
@@ -10019,11 +10680,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10019
10680
  } = {}) {
10020
10681
  if (global) {
10021
10682
  return {
10022
- relativeDirPath: join70(".gemini", "antigravity", "skills")
10683
+ relativeDirPath: join73(".gemini", "antigravity", "skills")
10023
10684
  };
10024
10685
  }
10025
10686
  return {
10026
- relativeDirPath: join70(".agent", "skills")
10687
+ relativeDirPath: join73(".agent", "skills")
10027
10688
  };
10028
10689
  }
10029
10690
  getFrontmatter() {
@@ -10103,9 +10764,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10103
10764
  });
10104
10765
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
10105
10766
  if (!result.success) {
10106
- const skillDirPath = join70(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10767
+ const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10107
10768
  throw new Error(
10108
- `Invalid frontmatter in ${join70(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10769
+ `Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10109
10770
  );
10110
10771
  }
10111
10772
  return new _AntigravitySkill({
@@ -10139,19 +10800,19 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
10139
10800
  };
10140
10801
 
10141
10802
  // src/features/skills/claudecode-skill.ts
10142
- import { join as join71 } from "path";
10143
- import { z as z32 } from "zod/mini";
10144
- var ClaudecodeSkillFrontmatterSchema = z32.looseObject({
10145
- name: z32.string(),
10146
- description: z32.string(),
10147
- "allowed-tools": z32.optional(z32.array(z32.string())),
10148
- model: z32.optional(z32.string()),
10149
- "disable-model-invocation": z32.optional(z32.boolean())
10803
+ import { join as join74 } from "path";
10804
+ import { z as z36 } from "zod/mini";
10805
+ var ClaudecodeSkillFrontmatterSchema = z36.looseObject({
10806
+ name: z36.string(),
10807
+ description: z36.string(),
10808
+ "allowed-tools": z36.optional(z36.array(z36.string())),
10809
+ model: z36.optional(z36.string()),
10810
+ "disable-model-invocation": z36.optional(z36.boolean())
10150
10811
  });
10151
10812
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10152
10813
  constructor({
10153
10814
  baseDir = process.cwd(),
10154
- relativeDirPath = join71(".claude", "skills"),
10815
+ relativeDirPath = join74(".claude", "skills"),
10155
10816
  dirName,
10156
10817
  frontmatter,
10157
10818
  body,
@@ -10182,7 +10843,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10182
10843
  global: _global = false
10183
10844
  } = {}) {
10184
10845
  return {
10185
- relativeDirPath: join71(".claude", "skills")
10846
+ relativeDirPath: join74(".claude", "skills")
10186
10847
  };
10187
10848
  }
10188
10849
  getFrontmatter() {
@@ -10279,9 +10940,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10279
10940
  });
10280
10941
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10281
10942
  if (!result.success) {
10282
- const skillDirPath = join71(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10943
+ const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10283
10944
  throw new Error(
10284
- `Invalid frontmatter in ${join71(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10945
+ `Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10285
10946
  );
10286
10947
  }
10287
10948
  return new _ClaudecodeSkill({
@@ -10315,16 +10976,16 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
10315
10976
  };
10316
10977
 
10317
10978
  // src/features/skills/cline-skill.ts
10318
- import { join as join72 } from "path";
10319
- import { z as z33 } from "zod/mini";
10320
- var ClineSkillFrontmatterSchema = z33.looseObject({
10321
- name: z33.string(),
10322
- description: z33.string()
10979
+ import { join as join75 } from "path";
10980
+ import { z as z37 } from "zod/mini";
10981
+ var ClineSkillFrontmatterSchema = z37.looseObject({
10982
+ name: z37.string(),
10983
+ description: z37.string()
10323
10984
  });
10324
10985
  var ClineSkill = class _ClineSkill extends ToolSkill {
10325
10986
  constructor({
10326
10987
  baseDir = process.cwd(),
10327
- relativeDirPath = join72(".cline", "skills"),
10988
+ relativeDirPath = join75(".cline", "skills"),
10328
10989
  dirName,
10329
10990
  frontmatter,
10330
10991
  body,
@@ -10353,7 +11014,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10353
11014
  }
10354
11015
  static getSettablePaths(_options = {}) {
10355
11016
  return {
10356
- relativeDirPath: join72(".cline", "skills")
11017
+ relativeDirPath: join75(".cline", "skills")
10357
11018
  };
10358
11019
  }
10359
11020
  getFrontmatter() {
@@ -10441,13 +11102,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10441
11102
  });
10442
11103
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10443
11104
  if (!result.success) {
10444
- const skillDirPath = join72(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11105
+ const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10445
11106
  throw new Error(
10446
- `Invalid frontmatter in ${join72(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11107
+ `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10447
11108
  );
10448
11109
  }
10449
11110
  if (result.data.name !== loaded.dirName) {
10450
- const skillFilePath = join72(
11111
+ const skillFilePath = join75(
10451
11112
  loaded.baseDir,
10452
11113
  loaded.relativeDirPath,
10453
11114
  loaded.dirName,
@@ -10488,21 +11149,21 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
10488
11149
  };
10489
11150
 
10490
11151
  // src/features/skills/codexcli-skill.ts
10491
- import { join as join73 } from "path";
10492
- import { z as z34 } from "zod/mini";
10493
- var CodexCliSkillFrontmatterSchema = z34.looseObject({
10494
- name: z34.string(),
10495
- description: z34.string(),
10496
- metadata: z34.optional(
10497
- z34.looseObject({
10498
- "short-description": z34.optional(z34.string())
11152
+ import { join as join76 } from "path";
11153
+ import { z as z38 } from "zod/mini";
11154
+ var CodexCliSkillFrontmatterSchema = z38.looseObject({
11155
+ name: z38.string(),
11156
+ description: z38.string(),
11157
+ metadata: z38.optional(
11158
+ z38.looseObject({
11159
+ "short-description": z38.optional(z38.string())
10499
11160
  })
10500
11161
  )
10501
11162
  });
10502
11163
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10503
11164
  constructor({
10504
11165
  baseDir = process.cwd(),
10505
- relativeDirPath = join73(".codex", "skills"),
11166
+ relativeDirPath = join76(".codex", "skills"),
10506
11167
  dirName,
10507
11168
  frontmatter,
10508
11169
  body,
@@ -10533,7 +11194,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10533
11194
  global: _global = false
10534
11195
  } = {}) {
10535
11196
  return {
10536
- relativeDirPath: join73(".codex", "skills")
11197
+ relativeDirPath: join76(".codex", "skills")
10537
11198
  };
10538
11199
  }
10539
11200
  getFrontmatter() {
@@ -10623,9 +11284,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10623
11284
  });
10624
11285
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10625
11286
  if (!result.success) {
10626
- const skillDirPath = join73(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11287
+ const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10627
11288
  throw new Error(
10628
- `Invalid frontmatter in ${join73(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11289
+ `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10629
11290
  );
10630
11291
  }
10631
11292
  return new _CodexCliSkill({
@@ -10659,17 +11320,17 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
10659
11320
  };
10660
11321
 
10661
11322
  // src/features/skills/copilot-skill.ts
10662
- import { join as join74 } from "path";
10663
- import { z as z35 } from "zod/mini";
10664
- var CopilotSkillFrontmatterSchema = z35.looseObject({
10665
- name: z35.string(),
10666
- description: z35.string(),
10667
- license: z35.optional(z35.string())
11323
+ import { join as join77 } from "path";
11324
+ import { z as z39 } from "zod/mini";
11325
+ var CopilotSkillFrontmatterSchema = z39.looseObject({
11326
+ name: z39.string(),
11327
+ description: z39.string(),
11328
+ license: z39.optional(z39.string())
10668
11329
  });
10669
11330
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
10670
11331
  constructor({
10671
11332
  baseDir = process.cwd(),
10672
- relativeDirPath = join74(".github", "skills"),
11333
+ relativeDirPath = join77(".github", "skills"),
10673
11334
  dirName,
10674
11335
  frontmatter,
10675
11336
  body,
@@ -10701,7 +11362,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10701
11362
  throw new Error("CopilotSkill does not support global mode.");
10702
11363
  }
10703
11364
  return {
10704
- relativeDirPath: join74(".github", "skills")
11365
+ relativeDirPath: join77(".github", "skills")
10705
11366
  };
10706
11367
  }
10707
11368
  getFrontmatter() {
@@ -10787,9 +11448,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10787
11448
  });
10788
11449
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10789
11450
  if (!result.success) {
10790
- const skillDirPath = join74(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11451
+ const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10791
11452
  throw new Error(
10792
- `Invalid frontmatter in ${join74(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11453
+ `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10793
11454
  );
10794
11455
  }
10795
11456
  return new _CopilotSkill({
@@ -10824,16 +11485,16 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
10824
11485
  };
10825
11486
 
10826
11487
  // src/features/skills/cursor-skill.ts
10827
- import { join as join75 } from "path";
10828
- import { z as z36 } from "zod/mini";
10829
- var CursorSkillFrontmatterSchema = z36.looseObject({
10830
- name: z36.string(),
10831
- description: z36.string()
11488
+ import { join as join78 } from "path";
11489
+ import { z as z40 } from "zod/mini";
11490
+ var CursorSkillFrontmatterSchema = z40.looseObject({
11491
+ name: z40.string(),
11492
+ description: z40.string()
10832
11493
  });
10833
11494
  var CursorSkill = class _CursorSkill extends ToolSkill {
10834
11495
  constructor({
10835
11496
  baseDir = process.cwd(),
10836
- relativeDirPath = join75(".cursor", "skills"),
11497
+ relativeDirPath = join78(".cursor", "skills"),
10837
11498
  dirName,
10838
11499
  frontmatter,
10839
11500
  body,
@@ -10862,7 +11523,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10862
11523
  }
10863
11524
  static getSettablePaths(_options) {
10864
11525
  return {
10865
- relativeDirPath: join75(".cursor", "skills")
11526
+ relativeDirPath: join78(".cursor", "skills")
10866
11527
  };
10867
11528
  }
10868
11529
  getFrontmatter() {
@@ -10942,9 +11603,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10942
11603
  });
10943
11604
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10944
11605
  if (!result.success) {
10945
- const skillDirPath = join75(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11606
+ const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10946
11607
  throw new Error(
10947
- `Invalid frontmatter in ${join75(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11608
+ `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10948
11609
  );
10949
11610
  }
10950
11611
  return new _CursorSkill({
@@ -10979,17 +11640,17 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
10979
11640
  };
10980
11641
 
10981
11642
  // src/features/skills/deepagents-skill.ts
10982
- import { join as join76 } from "path";
10983
- import { z as z37 } from "zod/mini";
10984
- var DeepagentsSkillFrontmatterSchema = z37.looseObject({
10985
- name: z37.string(),
10986
- description: z37.string(),
10987
- "allowed-tools": z37.optional(z37.array(z37.string()))
11643
+ import { join as join79 } from "path";
11644
+ import { z as z41 } from "zod/mini";
11645
+ var DeepagentsSkillFrontmatterSchema = z41.looseObject({
11646
+ name: z41.string(),
11647
+ description: z41.string(),
11648
+ "allowed-tools": z41.optional(z41.array(z41.string()))
10988
11649
  });
10989
11650
  var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
10990
11651
  constructor({
10991
11652
  baseDir = process.cwd(),
10992
- relativeDirPath = join76(".deepagents", "skills"),
11653
+ relativeDirPath = join79(".deepagents", "skills"),
10993
11654
  dirName,
10994
11655
  frontmatter,
10995
11656
  body,
@@ -11018,7 +11679,7 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11018
11679
  }
11019
11680
  static getSettablePaths(_options) {
11020
11681
  return {
11021
- relativeDirPath: join76(".deepagents", "skills")
11682
+ relativeDirPath: join79(".deepagents", "skills")
11022
11683
  };
11023
11684
  }
11024
11685
  getFrontmatter() {
@@ -11104,9 +11765,9 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11104
11765
  });
11105
11766
  const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11106
11767
  if (!result.success) {
11107
- const skillDirPath = join76(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11768
+ const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11108
11769
  throw new Error(
11109
- `Invalid frontmatter in ${join76(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11770
+ `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11110
11771
  );
11111
11772
  }
11112
11773
  return new _DeepagentsSkill({
@@ -11141,11 +11802,11 @@ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
11141
11802
  };
11142
11803
 
11143
11804
  // src/features/skills/geminicli-skill.ts
11144
- import { join as join77 } from "path";
11145
- import { z as z38 } from "zod/mini";
11146
- var GeminiCliSkillFrontmatterSchema = z38.looseObject({
11147
- name: z38.string(),
11148
- description: z38.string()
11805
+ import { join as join80 } from "path";
11806
+ import { z as z42 } from "zod/mini";
11807
+ var GeminiCliSkillFrontmatterSchema = z42.looseObject({
11808
+ name: z42.string(),
11809
+ description: z42.string()
11149
11810
  });
11150
11811
  var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11151
11812
  constructor({
@@ -11181,7 +11842,7 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11181
11842
  global: _global = false
11182
11843
  } = {}) {
11183
11844
  return {
11184
- relativeDirPath: join77(".gemini", "skills")
11845
+ relativeDirPath: join80(".gemini", "skills")
11185
11846
  };
11186
11847
  }
11187
11848
  getFrontmatter() {
@@ -11261,9 +11922,9 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11261
11922
  });
11262
11923
  const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11263
11924
  if (!result.success) {
11264
- const skillDirPath = join77(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11925
+ const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11265
11926
  throw new Error(
11266
- `Invalid frontmatter in ${join77(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11927
+ `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11267
11928
  );
11268
11929
  }
11269
11930
  return new _GeminiCliSkill({
@@ -11298,16 +11959,16 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
11298
11959
  };
11299
11960
 
11300
11961
  // src/features/skills/junie-skill.ts
11301
- import { join as join78 } from "path";
11302
- import { z as z39 } from "zod/mini";
11303
- var JunieSkillFrontmatterSchema = z39.looseObject({
11304
- name: z39.string(),
11305
- description: z39.string()
11962
+ import { join as join81 } from "path";
11963
+ import { z as z43 } from "zod/mini";
11964
+ var JunieSkillFrontmatterSchema = z43.looseObject({
11965
+ name: z43.string(),
11966
+ description: z43.string()
11306
11967
  });
11307
11968
  var JunieSkill = class _JunieSkill extends ToolSkill {
11308
11969
  constructor({
11309
11970
  baseDir = process.cwd(),
11310
- relativeDirPath = join78(".junie", "skills"),
11971
+ relativeDirPath = join81(".junie", "skills"),
11311
11972
  dirName,
11312
11973
  frontmatter,
11313
11974
  body,
@@ -11339,7 +12000,7 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11339
12000
  throw new Error("JunieSkill does not support global mode.");
11340
12001
  }
11341
12002
  return {
11342
- relativeDirPath: join78(".junie", "skills")
12003
+ relativeDirPath: join81(".junie", "skills")
11343
12004
  };
11344
12005
  }
11345
12006
  getFrontmatter() {
@@ -11426,13 +12087,13 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11426
12087
  });
11427
12088
  const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11428
12089
  if (!result.success) {
11429
- const skillDirPath = join78(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12090
+ const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11430
12091
  throw new Error(
11431
- `Invalid frontmatter in ${join78(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12092
+ `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11432
12093
  );
11433
12094
  }
11434
12095
  if (result.data.name !== loaded.dirName) {
11435
- const skillFilePath = join78(
12096
+ const skillFilePath = join81(
11436
12097
  loaded.baseDir,
11437
12098
  loaded.relativeDirPath,
11438
12099
  loaded.dirName,
@@ -11474,17 +12135,17 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
11474
12135
  };
11475
12136
 
11476
12137
  // src/features/skills/kilo-skill.ts
11477
- import { join as join79 } from "path";
11478
- import { z as z40 } from "zod/mini";
11479
- var KiloSkillFrontmatterSchema = z40.looseObject({
11480
- name: z40.string(),
11481
- description: z40.string(),
11482
- "allowed-tools": z40.optional(z40.array(z40.string()))
12138
+ import { join as join82 } from "path";
12139
+ import { z as z44 } from "zod/mini";
12140
+ var KiloSkillFrontmatterSchema = z44.looseObject({
12141
+ name: z44.string(),
12142
+ description: z44.string(),
12143
+ "allowed-tools": z44.optional(z44.array(z44.string()))
11483
12144
  });
11484
12145
  var KiloSkill = class _KiloSkill extends ToolSkill {
11485
12146
  constructor({
11486
12147
  baseDir = process.cwd(),
11487
- relativeDirPath = join79(".kilo", "skills"),
12148
+ relativeDirPath = join82(".kilo", "skills"),
11488
12149
  dirName,
11489
12150
  frontmatter,
11490
12151
  body,
@@ -11513,7 +12174,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11513
12174
  }
11514
12175
  static getSettablePaths({ global = false } = {}) {
11515
12176
  return {
11516
- relativeDirPath: global ? join79(".config", "kilo", "skills") : join79(".kilo", "skills")
12177
+ relativeDirPath: global ? join82(".config", "kilo", "skills") : join82(".kilo", "skills")
11517
12178
  };
11518
12179
  }
11519
12180
  getFrontmatter() {
@@ -11599,9 +12260,9 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11599
12260
  });
11600
12261
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11601
12262
  if (!result.success) {
11602
- const skillDirPath = join79(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12263
+ const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11603
12264
  throw new Error(
11604
- `Invalid frontmatter in ${join79(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12265
+ `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11605
12266
  );
11606
12267
  }
11607
12268
  return new _KiloSkill({
@@ -11635,16 +12296,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
11635
12296
  };
11636
12297
 
11637
12298
  // src/features/skills/kiro-skill.ts
11638
- import { join as join80 } from "path";
11639
- import { z as z41 } from "zod/mini";
11640
- var KiroSkillFrontmatterSchema = z41.looseObject({
11641
- name: z41.string(),
11642
- description: z41.string()
12299
+ import { join as join83 } from "path";
12300
+ import { z as z45 } from "zod/mini";
12301
+ var KiroSkillFrontmatterSchema = z45.looseObject({
12302
+ name: z45.string(),
12303
+ description: z45.string()
11643
12304
  });
11644
12305
  var KiroSkill = class _KiroSkill extends ToolSkill {
11645
12306
  constructor({
11646
12307
  baseDir = process.cwd(),
11647
- relativeDirPath = join80(".kiro", "skills"),
12308
+ relativeDirPath = join83(".kiro", "skills"),
11648
12309
  dirName,
11649
12310
  frontmatter,
11650
12311
  body,
@@ -11676,7 +12337,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11676
12337
  throw new Error("KiroSkill does not support global mode.");
11677
12338
  }
11678
12339
  return {
11679
- relativeDirPath: join80(".kiro", "skills")
12340
+ relativeDirPath: join83(".kiro", "skills")
11680
12341
  };
11681
12342
  }
11682
12343
  getFrontmatter() {
@@ -11764,13 +12425,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11764
12425
  });
11765
12426
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11766
12427
  if (!result.success) {
11767
- const skillDirPath = join80(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12428
+ const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11768
12429
  throw new Error(
11769
- `Invalid frontmatter in ${join80(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12430
+ `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11770
12431
  );
11771
12432
  }
11772
12433
  if (result.data.name !== loaded.dirName) {
11773
- const skillFilePath = join80(
12434
+ const skillFilePath = join83(
11774
12435
  loaded.baseDir,
11775
12436
  loaded.relativeDirPath,
11776
12437
  loaded.dirName,
@@ -11812,17 +12473,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
11812
12473
  };
11813
12474
 
11814
12475
  // src/features/skills/opencode-skill.ts
11815
- import { join as join81 } from "path";
11816
- import { z as z42 } from "zod/mini";
11817
- var OpenCodeSkillFrontmatterSchema = z42.looseObject({
11818
- name: z42.string(),
11819
- description: z42.string(),
11820
- "allowed-tools": z42.optional(z42.array(z42.string()))
12476
+ import { join as join84 } from "path";
12477
+ import { z as z46 } from "zod/mini";
12478
+ var OpenCodeSkillFrontmatterSchema = z46.looseObject({
12479
+ name: z46.string(),
12480
+ description: z46.string(),
12481
+ "allowed-tools": z46.optional(z46.array(z46.string()))
11821
12482
  });
11822
12483
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11823
12484
  constructor({
11824
12485
  baseDir = process.cwd(),
11825
- relativeDirPath = join81(".opencode", "skill"),
12486
+ relativeDirPath = join84(".opencode", "skill"),
11826
12487
  dirName,
11827
12488
  frontmatter,
11828
12489
  body,
@@ -11851,7 +12512,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11851
12512
  }
11852
12513
  static getSettablePaths({ global = false } = {}) {
11853
12514
  return {
11854
- relativeDirPath: global ? join81(".config", "opencode", "skill") : join81(".opencode", "skill")
12515
+ relativeDirPath: global ? join84(".config", "opencode", "skill") : join84(".opencode", "skill")
11855
12516
  };
11856
12517
  }
11857
12518
  getFrontmatter() {
@@ -11937,9 +12598,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11937
12598
  });
11938
12599
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
11939
12600
  if (!result.success) {
11940
- const skillDirPath = join81(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12601
+ const skillDirPath = join84(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11941
12602
  throw new Error(
11942
- `Invalid frontmatter in ${join81(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12603
+ `Invalid frontmatter in ${join84(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11943
12604
  );
11944
12605
  }
11945
12606
  return new _OpenCodeSkill({
@@ -11973,16 +12634,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
11973
12634
  };
11974
12635
 
11975
12636
  // src/features/skills/replit-skill.ts
11976
- import { join as join82 } from "path";
11977
- import { z as z43 } from "zod/mini";
11978
- var ReplitSkillFrontmatterSchema = z43.looseObject({
11979
- name: z43.string(),
11980
- description: z43.string()
12637
+ import { join as join85 } from "path";
12638
+ import { z as z47 } from "zod/mini";
12639
+ var ReplitSkillFrontmatterSchema = z47.looseObject({
12640
+ name: z47.string(),
12641
+ description: z47.string()
11981
12642
  });
11982
12643
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
11983
12644
  constructor({
11984
12645
  baseDir = process.cwd(),
11985
- relativeDirPath = join82(".agents", "skills"),
12646
+ relativeDirPath = join85(".agents", "skills"),
11986
12647
  dirName,
11987
12648
  frontmatter,
11988
12649
  body,
@@ -12014,7 +12675,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12014
12675
  throw new Error("ReplitSkill does not support global mode.");
12015
12676
  }
12016
12677
  return {
12017
- relativeDirPath: join82(".agents", "skills")
12678
+ relativeDirPath: join85(".agents", "skills")
12018
12679
  };
12019
12680
  }
12020
12681
  getFrontmatter() {
@@ -12094,9 +12755,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12094
12755
  });
12095
12756
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12096
12757
  if (!result.success) {
12097
- const skillDirPath = join82(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12758
+ const skillDirPath = join85(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12098
12759
  throw new Error(
12099
- `Invalid frontmatter in ${join82(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12760
+ `Invalid frontmatter in ${join85(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12100
12761
  );
12101
12762
  }
12102
12763
  return new _ReplitSkill({
@@ -12131,16 +12792,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
12131
12792
  };
12132
12793
 
12133
12794
  // src/features/skills/roo-skill.ts
12134
- import { join as join83 } from "path";
12135
- import { z as z44 } from "zod/mini";
12136
- var RooSkillFrontmatterSchema = z44.looseObject({
12137
- name: z44.string(),
12138
- description: z44.string()
12795
+ import { join as join86 } from "path";
12796
+ import { z as z48 } from "zod/mini";
12797
+ var RooSkillFrontmatterSchema = z48.looseObject({
12798
+ name: z48.string(),
12799
+ description: z48.string()
12139
12800
  });
12140
12801
  var RooSkill = class _RooSkill extends ToolSkill {
12141
12802
  constructor({
12142
12803
  baseDir = process.cwd(),
12143
- relativeDirPath = join83(".roo", "skills"),
12804
+ relativeDirPath = join86(".roo", "skills"),
12144
12805
  dirName,
12145
12806
  frontmatter,
12146
12807
  body,
@@ -12171,7 +12832,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
12171
12832
  global: _global = false
12172
12833
  } = {}) {
12173
12834
  return {
12174
- relativeDirPath: join83(".roo", "skills")
12835
+ relativeDirPath: join86(".roo", "skills")
12175
12836
  };
12176
12837
  }
12177
12838
  getFrontmatter() {
@@ -12259,13 +12920,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
12259
12920
  });
12260
12921
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
12261
12922
  if (!result.success) {
12262
- const skillDirPath = join83(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12923
+ const skillDirPath = join86(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
12263
12924
  throw new Error(
12264
- `Invalid frontmatter in ${join83(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12925
+ `Invalid frontmatter in ${join86(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
12265
12926
  );
12266
12927
  }
12267
12928
  if (result.data.name !== loaded.dirName) {
12268
- const skillFilePath = join83(
12929
+ const skillFilePath = join86(
12269
12930
  loaded.baseDir,
12270
12931
  loaded.relativeDirPath,
12271
12932
  loaded.dirName,
@@ -12306,14 +12967,14 @@ var RooSkill = class _RooSkill extends ToolSkill {
12306
12967
  };
12307
12968
 
12308
12969
  // src/features/skills/skills-utils.ts
12309
- import { basename as basename4, join as join84 } from "path";
12970
+ import { basename as basename4, join as join87 } from "path";
12310
12971
  async function getLocalSkillDirNames(baseDir) {
12311
- const skillsDir = join84(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12972
+ const skillsDir = join87(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
12312
12973
  const names = /* @__PURE__ */ new Set();
12313
12974
  if (!await directoryExists(skillsDir)) {
12314
12975
  return names;
12315
12976
  }
12316
- const dirPaths = await findFilesByGlobs(join84(skillsDir, "*"), { type: "dir" });
12977
+ const dirPaths = await findFilesByGlobs(join87(skillsDir, "*"), { type: "dir" });
12317
12978
  for (const dirPath of dirPaths) {
12318
12979
  const name = basename4(dirPath);
12319
12980
  if (name === basename4(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
@@ -12344,7 +13005,7 @@ var skillsProcessorToolTargetTuple = [
12344
13005
  "roo",
12345
13006
  "rovodev"
12346
13007
  ];
12347
- var SkillsProcessorToolTargetSchema = z45.enum(skillsProcessorToolTargetTuple);
13008
+ var SkillsProcessorToolTargetSchema = z49.enum(skillsProcessorToolTargetTuple);
12348
13009
  var toolSkillFactories = /* @__PURE__ */ new Map([
12349
13010
  [
12350
13011
  "agentsmd",
@@ -12568,10 +13229,10 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12568
13229
  )
12569
13230
  );
12570
13231
  const localSkillNames = new Set(localDirNames);
12571
- const curatedDirPath = join85(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
13232
+ const curatedDirPath = join88(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
12572
13233
  let curatedSkills = [];
12573
13234
  if (await directoryExists(curatedDirPath)) {
12574
- const curatedDirPaths = await findFilesByGlobs(join85(curatedDirPath, "*"), { type: "dir" });
13235
+ const curatedDirPaths = await findFilesByGlobs(join88(curatedDirPath, "*"), { type: "dir" });
12575
13236
  const curatedDirNames = curatedDirPaths.map((path3) => basename5(path3));
12576
13237
  const nonConflicting = curatedDirNames.filter((name) => {
12577
13238
  if (localSkillNames.has(name)) {
@@ -12609,11 +13270,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12609
13270
  const seenDirNames = /* @__PURE__ */ new Set();
12610
13271
  const loadEntries = [];
12611
13272
  for (const root of roots) {
12612
- const skillsDirPath = join85(this.baseDir, root);
13273
+ const skillsDirPath = join88(this.baseDir, root);
12613
13274
  if (!await directoryExists(skillsDirPath)) {
12614
13275
  continue;
12615
13276
  }
12616
- const dirPaths = await findFilesByGlobs(join85(skillsDirPath, "*"), { type: "dir" });
13277
+ const dirPaths = await findFilesByGlobs(join88(skillsDirPath, "*"), { type: "dir" });
12617
13278
  for (const dirPath of dirPaths) {
12618
13279
  const dirName = basename5(dirPath);
12619
13280
  if (seenDirNames.has(dirName)) {
@@ -12644,11 +13305,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12644
13305
  const roots = toolSkillSearchRoots(paths);
12645
13306
  const toolSkills = [];
12646
13307
  for (const root of roots) {
12647
- const skillsDirPath = join85(this.baseDir, root);
13308
+ const skillsDirPath = join88(this.baseDir, root);
12648
13309
  if (!await directoryExists(skillsDirPath)) {
12649
13310
  continue;
12650
13311
  }
12651
- const dirPaths = await findFilesByGlobs(join85(skillsDirPath, "*"), { type: "dir" });
13312
+ const dirPaths = await findFilesByGlobs(join88(skillsDirPath, "*"), { type: "dir" });
12652
13313
  for (const dirPath of dirPaths) {
12653
13314
  const dirName = basename5(dirPath);
12654
13315
  const toolSkill = factory.class.forDeletion({
@@ -12712,11 +13373,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
12712
13373
  };
12713
13374
 
12714
13375
  // src/features/subagents/agentsmd-subagent.ts
12715
- import { join as join87 } from "path";
13376
+ import { join as join90 } from "path";
12716
13377
 
12717
13378
  // src/features/subagents/simulated-subagent.ts
12718
- import { basename as basename6, join as join86 } from "path";
12719
- import { z as z46 } from "zod/mini";
13379
+ import { basename as basename6, join as join89 } from "path";
13380
+ import { z as z50 } from "zod/mini";
12720
13381
 
12721
13382
  // src/features/subagents/tool-subagent.ts
12722
13383
  var ToolSubagent = class extends ToolFile {
@@ -12768,9 +13429,9 @@ var ToolSubagent = class extends ToolFile {
12768
13429
  };
12769
13430
 
12770
13431
  // src/features/subagents/simulated-subagent.ts
12771
- var SimulatedSubagentFrontmatterSchema = z46.object({
12772
- name: z46.string(),
12773
- description: z46.optional(z46.string())
13432
+ var SimulatedSubagentFrontmatterSchema = z50.object({
13433
+ name: z50.string(),
13434
+ description: z50.optional(z50.string())
12774
13435
  });
12775
13436
  var SimulatedSubagent = class extends ToolSubagent {
12776
13437
  frontmatter;
@@ -12780,7 +13441,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12780
13441
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
12781
13442
  if (!result.success) {
12782
13443
  throw new Error(
12783
- `Invalid frontmatter in ${join86(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13444
+ `Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12784
13445
  );
12785
13446
  }
12786
13447
  }
@@ -12831,7 +13492,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12831
13492
  return {
12832
13493
  success: false,
12833
13494
  error: new Error(
12834
- `Invalid frontmatter in ${join86(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13495
+ `Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12835
13496
  )
12836
13497
  };
12837
13498
  }
@@ -12841,7 +13502,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12841
13502
  relativeFilePath,
12842
13503
  validate = true
12843
13504
  }) {
12844
- const filePath = join86(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
13505
+ const filePath = join89(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
12845
13506
  const fileContent = await readFileContent(filePath);
12846
13507
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12847
13508
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12877,7 +13538,7 @@ var SimulatedSubagent = class extends ToolSubagent {
12877
13538
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
12878
13539
  static getSettablePaths() {
12879
13540
  return {
12880
- relativeDirPath: join87(".agents", "subagents")
13541
+ relativeDirPath: join90(".agents", "subagents")
12881
13542
  };
12882
13543
  }
12883
13544
  static async fromFile(params) {
@@ -12900,11 +13561,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
12900
13561
  };
12901
13562
 
12902
13563
  // src/features/subagents/factorydroid-subagent.ts
12903
- import { join as join88 } from "path";
13564
+ import { join as join91 } from "path";
12904
13565
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
12905
13566
  static getSettablePaths(_options) {
12906
13567
  return {
12907
- relativeDirPath: join88(".factory", "droids")
13568
+ relativeDirPath: join91(".factory", "droids")
12908
13569
  };
12909
13570
  }
12910
13571
  static async fromFile(params) {
@@ -12927,16 +13588,16 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
12927
13588
  };
12928
13589
 
12929
13590
  // src/features/subagents/geminicli-subagent.ts
12930
- import { join as join90 } from "path";
12931
- import { z as z48 } from "zod/mini";
13591
+ import { join as join93 } from "path";
13592
+ import { z as z52 } from "zod/mini";
12932
13593
 
12933
13594
  // src/features/subagents/rulesync-subagent.ts
12934
- import { basename as basename7, join as join89 } from "path";
12935
- import { z as z47 } from "zod/mini";
12936
- var RulesyncSubagentFrontmatterSchema = z47.looseObject({
12937
- targets: z47._default(RulesyncTargetsSchema, ["*"]),
12938
- name: z47.string(),
12939
- description: z47.optional(z47.string())
13595
+ import { basename as basename7, join as join92 } from "path";
13596
+ import { z as z51 } from "zod/mini";
13597
+ var RulesyncSubagentFrontmatterSchema = z51.looseObject({
13598
+ targets: z51._default(RulesyncTargetsSchema, ["*"]),
13599
+ name: z51.string(),
13600
+ description: z51.optional(z51.string())
12940
13601
  });
12941
13602
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12942
13603
  frontmatter;
@@ -12945,7 +13606,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12945
13606
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
12946
13607
  if (!parseResult.success && rest.validate !== false) {
12947
13608
  throw new Error(
12948
- `Invalid frontmatter in ${join89(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
13609
+ `Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
12949
13610
  );
12950
13611
  }
12951
13612
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -12978,7 +13639,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12978
13639
  return {
12979
13640
  success: false,
12980
13641
  error: new Error(
12981
- `Invalid frontmatter in ${join89(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13642
+ `Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12982
13643
  )
12983
13644
  };
12984
13645
  }
@@ -12986,7 +13647,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
12986
13647
  static async fromFile({
12987
13648
  relativeFilePath
12988
13649
  }) {
12989
- const filePath = join89(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
13650
+ const filePath = join92(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
12990
13651
  const fileContent = await readFileContent(filePath);
12991
13652
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12992
13653
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13005,9 +13666,9 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
13005
13666
  };
13006
13667
 
13007
13668
  // src/features/subagents/geminicli-subagent.ts
13008
- var GeminiCliSubagentFrontmatterSchema = z48.looseObject({
13009
- name: z48.string(),
13010
- description: z48.optional(z48.string())
13669
+ var GeminiCliSubagentFrontmatterSchema = z52.looseObject({
13670
+ name: z52.string(),
13671
+ description: z52.optional(z52.string())
13011
13672
  });
13012
13673
  var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13013
13674
  frontmatter;
@@ -13017,7 +13678,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13017
13678
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
13018
13679
  if (!result.success) {
13019
13680
  throw new Error(
13020
- `Invalid frontmatter in ${join90(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13681
+ `Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13021
13682
  );
13022
13683
  }
13023
13684
  }
@@ -13030,7 +13691,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13030
13691
  }
13031
13692
  static getSettablePaths(_options = {}) {
13032
13693
  return {
13033
- relativeDirPath: join90(".gemini", "agents")
13694
+ relativeDirPath: join93(".gemini", "agents")
13034
13695
  };
13035
13696
  }
13036
13697
  getFrontmatter() {
@@ -13098,7 +13759,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13098
13759
  return {
13099
13760
  success: false,
13100
13761
  error: new Error(
13101
- `Invalid frontmatter in ${join90(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13762
+ `Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13102
13763
  )
13103
13764
  };
13104
13765
  }
@@ -13116,7 +13777,7 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13116
13777
  global = false
13117
13778
  }) {
13118
13779
  const paths = this.getSettablePaths({ global });
13119
- const filePath = join90(baseDir, paths.relativeDirPath, relativeFilePath);
13780
+ const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
13120
13781
  const fileContent = await readFileContent(filePath);
13121
13782
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13122
13783
  const result = GeminiCliSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13152,11 +13813,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends ToolSubagent {
13152
13813
  };
13153
13814
 
13154
13815
  // src/features/subagents/roo-subagent.ts
13155
- import { join as join91 } from "path";
13816
+ import { join as join94 } from "path";
13156
13817
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13157
13818
  static getSettablePaths() {
13158
13819
  return {
13159
- relativeDirPath: join91(".roo", "subagents")
13820
+ relativeDirPath: join94(".roo", "subagents")
13160
13821
  };
13161
13822
  }
13162
13823
  static async fromFile(params) {
@@ -13179,11 +13840,11 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
13179
13840
  };
13180
13841
 
13181
13842
  // src/features/subagents/rovodev-subagent.ts
13182
- import { join as join92 } from "path";
13183
- import { z as z49 } from "zod/mini";
13184
- var RovodevSubagentFrontmatterSchema = z49.looseObject({
13185
- name: z49.string(),
13186
- description: z49.optional(z49.string())
13843
+ import { join as join95 } from "path";
13844
+ import { z as z53 } from "zod/mini";
13845
+ var RovodevSubagentFrontmatterSchema = z53.looseObject({
13846
+ name: z53.string(),
13847
+ description: z53.optional(z53.string())
13187
13848
  });
13188
13849
  var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13189
13850
  frontmatter;
@@ -13193,7 +13854,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13193
13854
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
13194
13855
  if (!result.success) {
13195
13856
  throw new Error(
13196
- `Invalid frontmatter in ${join92(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13857
+ `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13197
13858
  );
13198
13859
  }
13199
13860
  }
@@ -13205,7 +13866,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13205
13866
  }
13206
13867
  static getSettablePaths(_options = {}) {
13207
13868
  return {
13208
- relativeDirPath: join92(".rovodev", "subagents")
13869
+ relativeDirPath: join95(".rovodev", "subagents")
13209
13870
  };
13210
13871
  }
13211
13872
  getFrontmatter() {
@@ -13268,7 +13929,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13268
13929
  return {
13269
13930
  success: false,
13270
13931
  error: new Error(
13271
- `Invalid frontmatter in ${join92(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13932
+ `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13272
13933
  )
13273
13934
  };
13274
13935
  }
@@ -13285,7 +13946,7 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13285
13946
  global = false
13286
13947
  }) {
13287
13948
  const paths = this.getSettablePaths({ global });
13288
- const filePath = join92(baseDir, paths.relativeDirPath, relativeFilePath);
13949
+ const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
13289
13950
  const fileContent = await readFileContent(filePath);
13290
13951
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13291
13952
  const result = RovodevSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13324,19 +13985,19 @@ var RovodevSubagent = class _RovodevSubagent extends ToolSubagent {
13324
13985
  };
13325
13986
 
13326
13987
  // src/features/subagents/subagents-processor.ts
13327
- import { basename as basename9, join as join103 } from "path";
13328
- import { z as z58 } from "zod/mini";
13988
+ import { basename as basename9, join as join106 } from "path";
13989
+ import { z as z62 } from "zod/mini";
13329
13990
 
13330
13991
  // src/features/subagents/claudecode-subagent.ts
13331
- import { join as join93 } from "path";
13332
- import { z as z50 } from "zod/mini";
13333
- var ClaudecodeSubagentFrontmatterSchema = z50.looseObject({
13334
- name: z50.string(),
13335
- description: z50.optional(z50.string()),
13336
- model: z50.optional(z50.string()),
13337
- tools: z50.optional(z50.union([z50.string(), z50.array(z50.string())])),
13338
- permissionMode: z50.optional(z50.string()),
13339
- skills: z50.optional(z50.union([z50.string(), z50.array(z50.string())]))
13992
+ import { join as join96 } from "path";
13993
+ import { z as z54 } from "zod/mini";
13994
+ var ClaudecodeSubagentFrontmatterSchema = z54.looseObject({
13995
+ name: z54.string(),
13996
+ description: z54.optional(z54.string()),
13997
+ model: z54.optional(z54.string()),
13998
+ tools: z54.optional(z54.union([z54.string(), z54.array(z54.string())])),
13999
+ permissionMode: z54.optional(z54.string()),
14000
+ skills: z54.optional(z54.union([z54.string(), z54.array(z54.string())]))
13340
14001
  });
13341
14002
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13342
14003
  frontmatter;
@@ -13346,7 +14007,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13346
14007
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
13347
14008
  if (!result.success) {
13348
14009
  throw new Error(
13349
- `Invalid frontmatter in ${join93(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14010
+ `Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13350
14011
  );
13351
14012
  }
13352
14013
  }
@@ -13358,7 +14019,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13358
14019
  }
13359
14020
  static getSettablePaths(_options = {}) {
13360
14021
  return {
13361
- relativeDirPath: join93(".claude", "agents")
14022
+ relativeDirPath: join96(".claude", "agents")
13362
14023
  };
13363
14024
  }
13364
14025
  getFrontmatter() {
@@ -13437,7 +14098,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13437
14098
  return {
13438
14099
  success: false,
13439
14100
  error: new Error(
13440
- `Invalid frontmatter in ${join93(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14101
+ `Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13441
14102
  )
13442
14103
  };
13443
14104
  }
@@ -13455,7 +14116,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13455
14116
  global = false
13456
14117
  }) {
13457
14118
  const paths = this.getSettablePaths({ global });
13458
- const filePath = join93(baseDir, paths.relativeDirPath, relativeFilePath);
14119
+ const filePath = join96(baseDir, paths.relativeDirPath, relativeFilePath);
13459
14120
  const fileContent = await readFileContent(filePath);
13460
14121
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13461
14122
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13490,16 +14151,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
13490
14151
  };
13491
14152
 
13492
14153
  // src/features/subagents/codexcli-subagent.ts
13493
- import { join as join94 } from "path";
14154
+ import { join as join97 } from "path";
13494
14155
  import * as smolToml4 from "smol-toml";
13495
- import { z as z51 } from "zod/mini";
13496
- var CodexCliSubagentTomlSchema = z51.looseObject({
13497
- name: z51.string(),
13498
- description: z51.optional(z51.string()),
13499
- developer_instructions: z51.optional(z51.string()),
13500
- model: z51.optional(z51.string()),
13501
- model_reasoning_effort: z51.optional(z51.string()),
13502
- sandbox_mode: z51.optional(z51.string())
14156
+ import { z as z55 } from "zod/mini";
14157
+ var CodexCliSubagentTomlSchema = z55.looseObject({
14158
+ name: z55.string(),
14159
+ description: z55.optional(z55.string()),
14160
+ developer_instructions: z55.optional(z55.string()),
14161
+ model: z55.optional(z55.string()),
14162
+ model_reasoning_effort: z55.optional(z55.string()),
14163
+ sandbox_mode: z55.optional(z55.string())
13503
14164
  });
13504
14165
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13505
14166
  body;
@@ -13510,7 +14171,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13510
14171
  CodexCliSubagentTomlSchema.parse(parsed);
13511
14172
  } catch (error) {
13512
14173
  throw new Error(
13513
- `Invalid TOML in ${join94(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14174
+ `Invalid TOML in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
13514
14175
  { cause: error }
13515
14176
  );
13516
14177
  }
@@ -13522,7 +14183,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13522
14183
  }
13523
14184
  static getSettablePaths(_options = {}) {
13524
14185
  return {
13525
- relativeDirPath: join94(".codex", "agents")
14186
+ relativeDirPath: join97(".codex", "agents")
13526
14187
  };
13527
14188
  }
13528
14189
  getBody() {
@@ -13534,7 +14195,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13534
14195
  parsed = CodexCliSubagentTomlSchema.parse(smolToml4.parse(this.body));
13535
14196
  } catch (error) {
13536
14197
  throw new Error(
13537
- `Failed to parse TOML in ${join94(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14198
+ `Failed to parse TOML in ${join97(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
13538
14199
  { cause: error }
13539
14200
  );
13540
14201
  }
@@ -13615,7 +14276,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13615
14276
  global = false
13616
14277
  }) {
13617
14278
  const paths = this.getSettablePaths({ global });
13618
- const filePath = join94(baseDir, paths.relativeDirPath, relativeFilePath);
14279
+ const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
13619
14280
  const fileContent = await readFileContent(filePath);
13620
14281
  const subagent = new _CodexCliSubagent({
13621
14282
  baseDir,
@@ -13653,13 +14314,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
13653
14314
  };
13654
14315
 
13655
14316
  // src/features/subagents/copilot-subagent.ts
13656
- import { join as join95 } from "path";
13657
- import { z as z52 } from "zod/mini";
14317
+ import { join as join98 } from "path";
14318
+ import { z as z56 } from "zod/mini";
13658
14319
  var REQUIRED_TOOL = "agent/runSubagent";
13659
- var CopilotSubagentFrontmatterSchema = z52.looseObject({
13660
- name: z52.string(),
13661
- description: z52.optional(z52.string()),
13662
- tools: z52.optional(z52.union([z52.string(), z52.array(z52.string())]))
14320
+ var CopilotSubagentFrontmatterSchema = z56.looseObject({
14321
+ name: z56.string(),
14322
+ description: z56.optional(z56.string()),
14323
+ tools: z56.optional(z56.union([z56.string(), z56.array(z56.string())]))
13663
14324
  });
13664
14325
  var normalizeTools = (tools) => {
13665
14326
  if (!tools) {
@@ -13679,7 +14340,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13679
14340
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
13680
14341
  if (!result.success) {
13681
14342
  throw new Error(
13682
- `Invalid frontmatter in ${join95(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14343
+ `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13683
14344
  );
13684
14345
  }
13685
14346
  }
@@ -13691,7 +14352,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13691
14352
  }
13692
14353
  static getSettablePaths(_options = {}) {
13693
14354
  return {
13694
- relativeDirPath: join95(".github", "agents")
14355
+ relativeDirPath: join98(".github", "agents")
13695
14356
  };
13696
14357
  }
13697
14358
  getFrontmatter() {
@@ -13765,7 +14426,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13765
14426
  return {
13766
14427
  success: false,
13767
14428
  error: new Error(
13768
- `Invalid frontmatter in ${join95(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14429
+ `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13769
14430
  )
13770
14431
  };
13771
14432
  }
@@ -13783,7 +14444,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13783
14444
  global = false
13784
14445
  }) {
13785
14446
  const paths = this.getSettablePaths({ global });
13786
- const filePath = join95(baseDir, paths.relativeDirPath, relativeFilePath);
14447
+ const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
13787
14448
  const fileContent = await readFileContent(filePath);
13788
14449
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13789
14450
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13819,11 +14480,11 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
13819
14480
  };
13820
14481
 
13821
14482
  // src/features/subagents/cursor-subagent.ts
13822
- import { join as join96 } from "path";
13823
- import { z as z53 } from "zod/mini";
13824
- var CursorSubagentFrontmatterSchema = z53.looseObject({
13825
- name: z53.string(),
13826
- description: z53.optional(z53.string())
14483
+ import { join as join99 } from "path";
14484
+ import { z as z57 } from "zod/mini";
14485
+ var CursorSubagentFrontmatterSchema = z57.looseObject({
14486
+ name: z57.string(),
14487
+ description: z57.optional(z57.string())
13827
14488
  });
13828
14489
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13829
14490
  frontmatter;
@@ -13833,7 +14494,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13833
14494
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
13834
14495
  if (!result.success) {
13835
14496
  throw new Error(
13836
- `Invalid frontmatter in ${join96(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14497
+ `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13837
14498
  );
13838
14499
  }
13839
14500
  }
@@ -13845,7 +14506,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13845
14506
  }
13846
14507
  static getSettablePaths(_options = {}) {
13847
14508
  return {
13848
- relativeDirPath: join96(".cursor", "agents")
14509
+ relativeDirPath: join99(".cursor", "agents")
13849
14510
  };
13850
14511
  }
13851
14512
  getFrontmatter() {
@@ -13912,7 +14573,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13912
14573
  return {
13913
14574
  success: false,
13914
14575
  error: new Error(
13915
- `Invalid frontmatter in ${join96(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14576
+ `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13916
14577
  )
13917
14578
  };
13918
14579
  }
@@ -13930,7 +14591,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13930
14591
  global = false
13931
14592
  }) {
13932
14593
  const paths = this.getSettablePaths({ global });
13933
- const filePath = join96(baseDir, paths.relativeDirPath, relativeFilePath);
14594
+ const filePath = join99(baseDir, paths.relativeDirPath, relativeFilePath);
13934
14595
  const fileContent = await readFileContent(filePath);
13935
14596
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
13936
14597
  const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -13966,12 +14627,12 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
13966
14627
  };
13967
14628
 
13968
14629
  // src/features/subagents/deepagents-subagent.ts
13969
- import { join as join97 } from "path";
13970
- import { z as z54 } from "zod/mini";
13971
- var DeepagentsSubagentFrontmatterSchema = z54.looseObject({
13972
- name: z54.string(),
13973
- description: z54.optional(z54.string()),
13974
- model: z54.optional(z54.string())
14630
+ import { join as join100 } from "path";
14631
+ import { z as z58 } from "zod/mini";
14632
+ var DeepagentsSubagentFrontmatterSchema = z58.looseObject({
14633
+ name: z58.string(),
14634
+ description: z58.optional(z58.string()),
14635
+ model: z58.optional(z58.string())
13975
14636
  });
13976
14637
  var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13977
14638
  frontmatter;
@@ -13981,7 +14642,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13981
14642
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
13982
14643
  if (!result.success) {
13983
14644
  throw new Error(
13984
- `Invalid frontmatter in ${join97(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14645
+ `Invalid frontmatter in ${join100(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13985
14646
  );
13986
14647
  }
13987
14648
  }
@@ -13991,7 +14652,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
13991
14652
  }
13992
14653
  static getSettablePaths(_options = {}) {
13993
14654
  return {
13994
- relativeDirPath: join97(".deepagents", "agents")
14655
+ relativeDirPath: join100(".deepagents", "agents")
13995
14656
  };
13996
14657
  }
13997
14658
  getFrontmatter() {
@@ -14066,7 +14727,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14066
14727
  return {
14067
14728
  success: false,
14068
14729
  error: new Error(
14069
- `Invalid frontmatter in ${join97(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14730
+ `Invalid frontmatter in ${join100(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14070
14731
  )
14071
14732
  };
14072
14733
  }
@@ -14084,7 +14745,7 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14084
14745
  global = false
14085
14746
  }) {
14086
14747
  const paths = this.getSettablePaths({ global });
14087
- const filePath = join97(baseDir, paths.relativeDirPath, relativeFilePath);
14748
+ const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
14088
14749
  const fileContent = await readFileContent(filePath);
14089
14750
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14090
14751
  const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14119,11 +14780,11 @@ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
14119
14780
  };
14120
14781
 
14121
14782
  // src/features/subagents/junie-subagent.ts
14122
- import { join as join98 } from "path";
14123
- import { z as z55 } from "zod/mini";
14124
- var JunieSubagentFrontmatterSchema = z55.looseObject({
14125
- name: z55.optional(z55.string()),
14126
- description: z55.string()
14783
+ import { join as join101 } from "path";
14784
+ import { z as z59 } from "zod/mini";
14785
+ var JunieSubagentFrontmatterSchema = z59.looseObject({
14786
+ name: z59.optional(z59.string()),
14787
+ description: z59.string()
14127
14788
  });
14128
14789
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14129
14790
  frontmatter;
@@ -14133,7 +14794,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14133
14794
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
14134
14795
  if (!result.success) {
14135
14796
  throw new Error(
14136
- `Invalid frontmatter in ${join98(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14797
+ `Invalid frontmatter in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14137
14798
  );
14138
14799
  }
14139
14800
  }
@@ -14148,7 +14809,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14148
14809
  throw new Error("JunieSubagent does not support global mode.");
14149
14810
  }
14150
14811
  return {
14151
- relativeDirPath: join98(".junie", "agents")
14812
+ relativeDirPath: join101(".junie", "agents")
14152
14813
  };
14153
14814
  }
14154
14815
  getFrontmatter() {
@@ -14224,7 +14885,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14224
14885
  return {
14225
14886
  success: false,
14226
14887
  error: new Error(
14227
- `Invalid frontmatter in ${join98(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14888
+ `Invalid frontmatter in ${join101(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14228
14889
  )
14229
14890
  };
14230
14891
  }
@@ -14242,7 +14903,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14242
14903
  global = false
14243
14904
  }) {
14244
14905
  const paths = this.getSettablePaths({ global });
14245
- const filePath = join98(baseDir, paths.relativeDirPath, relativeFilePath);
14906
+ const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
14246
14907
  const fileContent = await readFileContent(filePath);
14247
14908
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14248
14909
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14277,15 +14938,15 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
14277
14938
  };
14278
14939
 
14279
14940
  // src/features/subagents/kilo-subagent.ts
14280
- import { join as join100 } from "path";
14941
+ import { join as join103 } from "path";
14281
14942
 
14282
14943
  // src/features/subagents/opencode-style-subagent.ts
14283
- import { basename as basename8, join as join99 } from "path";
14284
- import { z as z56 } from "zod/mini";
14285
- var OpenCodeStyleSubagentFrontmatterSchema = z56.looseObject({
14286
- description: z56.optional(z56.string()),
14287
- mode: z56._default(z56.string(), "subagent"),
14288
- name: z56.optional(z56.string())
14944
+ import { basename as basename8, join as join102 } from "path";
14945
+ import { z as z60 } from "zod/mini";
14946
+ var OpenCodeStyleSubagentFrontmatterSchema = z60.looseObject({
14947
+ description: z60.optional(z60.string()),
14948
+ mode: z60._default(z60.string(), "subagent"),
14949
+ name: z60.optional(z60.string())
14289
14950
  });
14290
14951
  var OpenCodeStyleSubagent = class extends ToolSubagent {
14291
14952
  frontmatter;
@@ -14295,7 +14956,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14295
14956
  const result = OpenCodeStyleSubagentFrontmatterSchema.safeParse(frontmatter);
14296
14957
  if (!result.success) {
14297
14958
  throw new Error(
14298
- `Invalid frontmatter in ${join99(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14959
+ `Invalid frontmatter in ${join102(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14299
14960
  );
14300
14961
  }
14301
14962
  }
@@ -14337,7 +14998,7 @@ var OpenCodeStyleSubagent = class extends ToolSubagent {
14337
14998
  return {
14338
14999
  success: false,
14339
15000
  error: new Error(
14340
- `Invalid frontmatter in ${join99(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15001
+ `Invalid frontmatter in ${join102(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14341
15002
  )
14342
15003
  };
14343
15004
  }
@@ -14353,7 +15014,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14353
15014
  global = false
14354
15015
  } = {}) {
14355
15016
  return {
14356
- relativeDirPath: global ? join100(".config", "kilo", "agent") : join100(".kilo", "agent")
15017
+ relativeDirPath: global ? join103(".config", "kilo", "agent") : join103(".kilo", "agent")
14357
15018
  };
14358
15019
  }
14359
15020
  static fromRulesyncSubagent({
@@ -14397,7 +15058,7 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14397
15058
  global = false
14398
15059
  }) {
14399
15060
  const paths = this.getSettablePaths({ global });
14400
- const filePath = join100(baseDir, paths.relativeDirPath, relativeFilePath);
15061
+ const filePath = join103(baseDir, paths.relativeDirPath, relativeFilePath);
14401
15062
  const fileContent = await readFileContent(filePath);
14402
15063
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14403
15064
  const result = KiloSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14433,23 +15094,23 @@ var KiloSubagent = class _KiloSubagent extends OpenCodeStyleSubagent {
14433
15094
  };
14434
15095
 
14435
15096
  // src/features/subagents/kiro-subagent.ts
14436
- import { join as join101 } from "path";
14437
- import { z as z57 } from "zod/mini";
14438
- var KiroCliSubagentJsonSchema = z57.looseObject({
14439
- name: z57.string(),
14440
- description: z57.optional(z57.nullable(z57.string())),
14441
- prompt: z57.optional(z57.nullable(z57.string())),
14442
- tools: z57.optional(z57.nullable(z57.array(z57.string()))),
14443
- toolAliases: z57.optional(z57.nullable(z57.record(z57.string(), z57.string()))),
14444
- toolSettings: z57.optional(z57.nullable(z57.unknown())),
14445
- toolSchema: z57.optional(z57.nullable(z57.unknown())),
14446
- hooks: z57.optional(z57.nullable(z57.record(z57.string(), z57.array(z57.unknown())))),
14447
- model: z57.optional(z57.nullable(z57.string())),
14448
- mcpServers: z57.optional(z57.nullable(z57.record(z57.string(), z57.unknown()))),
14449
- useLegacyMcpJson: z57.optional(z57.nullable(z57.boolean())),
14450
- resources: z57.optional(z57.nullable(z57.array(z57.string()))),
14451
- allowedTools: z57.optional(z57.nullable(z57.array(z57.string()))),
14452
- includeMcpJson: z57.optional(z57.nullable(z57.boolean()))
15097
+ import { join as join104 } from "path";
15098
+ import { z as z61 } from "zod/mini";
15099
+ var KiroCliSubagentJsonSchema = z61.looseObject({
15100
+ name: z61.string(),
15101
+ description: z61.optional(z61.nullable(z61.string())),
15102
+ prompt: z61.optional(z61.nullable(z61.string())),
15103
+ tools: z61.optional(z61.nullable(z61.array(z61.string()))),
15104
+ toolAliases: z61.optional(z61.nullable(z61.record(z61.string(), z61.string()))),
15105
+ toolSettings: z61.optional(z61.nullable(z61.unknown())),
15106
+ toolSchema: z61.optional(z61.nullable(z61.unknown())),
15107
+ hooks: z61.optional(z61.nullable(z61.record(z61.string(), z61.array(z61.unknown())))),
15108
+ model: z61.optional(z61.nullable(z61.string())),
15109
+ mcpServers: z61.optional(z61.nullable(z61.record(z61.string(), z61.unknown()))),
15110
+ useLegacyMcpJson: z61.optional(z61.nullable(z61.boolean())),
15111
+ resources: z61.optional(z61.nullable(z61.array(z61.string()))),
15112
+ allowedTools: z61.optional(z61.nullable(z61.array(z61.string()))),
15113
+ includeMcpJson: z61.optional(z61.nullable(z61.boolean()))
14453
15114
  });
14454
15115
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14455
15116
  body;
@@ -14460,7 +15121,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14460
15121
  KiroCliSubagentJsonSchema.parse(parsed);
14461
15122
  } catch (error) {
14462
15123
  throw new Error(
14463
- `Invalid JSON in ${join101(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
15124
+ `Invalid JSON in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
14464
15125
  { cause: error }
14465
15126
  );
14466
15127
  }
@@ -14472,7 +15133,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14472
15133
  }
14473
15134
  static getSettablePaths(_options = {}) {
14474
15135
  return {
14475
- relativeDirPath: join101(".kiro", "agents")
15136
+ relativeDirPath: join104(".kiro", "agents")
14476
15137
  };
14477
15138
  }
14478
15139
  getBody() {
@@ -14484,7 +15145,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14484
15145
  parsed = JSON.parse(this.body);
14485
15146
  } catch (error) {
14486
15147
  throw new Error(
14487
- `Failed to parse JSON in ${join101(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
15148
+ `Failed to parse JSON in ${join104(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
14488
15149
  { cause: error }
14489
15150
  );
14490
15151
  }
@@ -14565,7 +15226,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14565
15226
  global = false
14566
15227
  }) {
14567
15228
  const paths = this.getSettablePaths({ global });
14568
- const filePath = join101(baseDir, paths.relativeDirPath, relativeFilePath);
15229
+ const filePath = join104(baseDir, paths.relativeDirPath, relativeFilePath);
14569
15230
  const fileContent = await readFileContent(filePath);
14570
15231
  const subagent = new _KiroSubagent({
14571
15232
  baseDir,
@@ -14603,7 +15264,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
14603
15264
  };
14604
15265
 
14605
15266
  // src/features/subagents/opencode-subagent.ts
14606
- import { join as join102 } from "path";
15267
+ import { join as join105 } from "path";
14607
15268
  var OpenCodeSubagentFrontmatterSchema = OpenCodeStyleSubagentFrontmatterSchema;
14608
15269
  var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14609
15270
  getToolTarget() {
@@ -14613,7 +15274,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14613
15274
  global = false
14614
15275
  } = {}) {
14615
15276
  return {
14616
- relativeDirPath: global ? join102(".config", "opencode", "agent") : join102(".opencode", "agent")
15277
+ relativeDirPath: global ? join105(".config", "opencode", "agent") : join105(".opencode", "agent")
14617
15278
  };
14618
15279
  }
14619
15280
  static fromRulesyncSubagent({
@@ -14657,7 +15318,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends OpenCodeStyleSubagent {
14657
15318
  global = false
14658
15319
  }) {
14659
15320
  const paths = this.getSettablePaths({ global });
14660
- const filePath = join102(baseDir, paths.relativeDirPath, relativeFilePath);
15321
+ const filePath = join105(baseDir, paths.relativeDirPath, relativeFilePath);
14661
15322
  const fileContent = await readFileContent(filePath);
14662
15323
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14663
15324
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -14710,7 +15371,7 @@ var subagentsProcessorToolTargetTuple = [
14710
15371
  "roo",
14711
15372
  "rovodev"
14712
15373
  ];
14713
- var SubagentsProcessorToolTargetSchema = z58.enum(subagentsProcessorToolTargetTuple);
15374
+ var SubagentsProcessorToolTargetSchema = z62.enum(subagentsProcessorToolTargetTuple);
14714
15375
  var toolSubagentFactories = /* @__PURE__ */ new Map([
14715
15376
  [
14716
15377
  "agentsmd",
@@ -14901,7 +15562,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14901
15562
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
14902
15563
  */
14903
15564
  async loadRulesyncFiles() {
14904
- const subagentsDir = join103(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
15565
+ const subagentsDir = join106(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
14905
15566
  const dirExists = await directoryExists(subagentsDir);
14906
15567
  if (!dirExists) {
14907
15568
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -14916,7 +15577,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14916
15577
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
14917
15578
  const rulesyncSubagents = [];
14918
15579
  for (const mdFile of mdFiles) {
14919
- const filepath = join103(subagentsDir, mdFile);
15580
+ const filepath = join106(subagentsDir, mdFile);
14920
15581
  try {
14921
15582
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
14922
15583
  relativeFilePath: mdFile,
@@ -14946,7 +15607,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
14946
15607
  const factory = this.getFactory(this.toolTarget);
14947
15608
  const paths = factory.class.getSettablePaths({ global: this.global });
14948
15609
  const subagentFilePaths = await findFilesByGlobs(
14949
- join103(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
15610
+ join106(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
14950
15611
  );
14951
15612
  if (forDeletion) {
14952
15613
  const toolSubagents2 = subagentFilePaths.map(
@@ -15013,49 +15674,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
15013
15674
  };
15014
15675
 
15015
15676
  // src/features/rules/agentsmd-rule.ts
15016
- import { join as join106 } from "path";
15677
+ import { join as join109 } from "path";
15017
15678
 
15018
15679
  // src/features/rules/tool-rule.ts
15019
- import { join as join105 } from "path";
15680
+ import { join as join108 } from "path";
15020
15681
 
15021
15682
  // src/features/rules/rulesync-rule.ts
15022
- import { join as join104 } from "path";
15023
- import { z as z59 } from "zod/mini";
15024
- var RulesyncRuleFrontmatterSchema = z59.object({
15025
- root: z59.optional(z59.boolean()),
15026
- localRoot: z59.optional(z59.boolean()),
15027
- targets: z59._default(RulesyncTargetsSchema, ["*"]),
15028
- description: z59.optional(z59.string()),
15029
- globs: z59.optional(z59.array(z59.string())),
15030
- agentsmd: z59.optional(
15031
- z59.looseObject({
15683
+ import { join as join107 } from "path";
15684
+ import { z as z63 } from "zod/mini";
15685
+ var RulesyncRuleFrontmatterSchema = z63.object({
15686
+ root: z63.optional(z63.boolean()),
15687
+ localRoot: z63.optional(z63.boolean()),
15688
+ targets: z63._default(RulesyncTargetsSchema, ["*"]),
15689
+ description: z63.optional(z63.string()),
15690
+ globs: z63.optional(z63.array(z63.string())),
15691
+ agentsmd: z63.optional(
15692
+ z63.looseObject({
15032
15693
  // @example "path/to/subproject"
15033
- subprojectPath: z59.optional(z59.string())
15694
+ subprojectPath: z63.optional(z63.string())
15034
15695
  })
15035
15696
  ),
15036
- claudecode: z59.optional(
15037
- z59.looseObject({
15697
+ claudecode: z63.optional(
15698
+ z63.looseObject({
15038
15699
  // Glob patterns for conditional rules (takes precedence over globs)
15039
15700
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
15040
- paths: z59.optional(z59.array(z59.string()))
15701
+ paths: z63.optional(z63.array(z63.string()))
15041
15702
  })
15042
15703
  ),
15043
- cursor: z59.optional(
15044
- z59.looseObject({
15045
- alwaysApply: z59.optional(z59.boolean()),
15046
- description: z59.optional(z59.string()),
15047
- globs: z59.optional(z59.array(z59.string()))
15704
+ cursor: z63.optional(
15705
+ z63.looseObject({
15706
+ alwaysApply: z63.optional(z63.boolean()),
15707
+ description: z63.optional(z63.string()),
15708
+ globs: z63.optional(z63.array(z63.string()))
15048
15709
  })
15049
15710
  ),
15050
- copilot: z59.optional(
15051
- z59.looseObject({
15052
- excludeAgent: z59.optional(z59.union([z59.literal("code-review"), z59.literal("coding-agent")]))
15711
+ copilot: z63.optional(
15712
+ z63.looseObject({
15713
+ excludeAgent: z63.optional(z63.union([z63.literal("code-review"), z63.literal("coding-agent")]))
15053
15714
  })
15054
15715
  ),
15055
- antigravity: z59.optional(
15056
- z59.looseObject({
15057
- trigger: z59.optional(z59.string()),
15058
- globs: z59.optional(z59.array(z59.string()))
15716
+ antigravity: z63.optional(
15717
+ z63.looseObject({
15718
+ trigger: z63.optional(z63.string()),
15719
+ globs: z63.optional(z63.array(z63.string()))
15059
15720
  })
15060
15721
  )
15061
15722
  });
@@ -15066,7 +15727,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15066
15727
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
15067
15728
  if (!parseResult.success && rest.validate !== false) {
15068
15729
  throw new Error(
15069
- `Invalid frontmatter in ${join104(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
15730
+ `Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
15070
15731
  );
15071
15732
  }
15072
15733
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -15101,7 +15762,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15101
15762
  return {
15102
15763
  success: false,
15103
15764
  error: new Error(
15104
- `Invalid frontmatter in ${join104(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15765
+ `Invalid frontmatter in ${join107(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15105
15766
  )
15106
15767
  };
15107
15768
  }
@@ -15110,7 +15771,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
15110
15771
  relativeFilePath,
15111
15772
  validate = true
15112
15773
  }) {
15113
- const filePath = join104(
15774
+ const filePath = join107(
15114
15775
  process.cwd(),
15115
15776
  this.getSettablePaths().recommended.relativeDirPath,
15116
15777
  relativeFilePath
@@ -15209,7 +15870,7 @@ var ToolRule = class extends ToolFile {
15209
15870
  rulesyncRule,
15210
15871
  validate = true,
15211
15872
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
15212
- nonRootPath = { relativeDirPath: join105(".agents", "memories") }
15873
+ nonRootPath = { relativeDirPath: join108(".agents", "memories") }
15213
15874
  }) {
15214
15875
  const params = this.buildToolRuleParamsDefault({
15215
15876
  baseDir,
@@ -15220,7 +15881,7 @@ var ToolRule = class extends ToolFile {
15220
15881
  });
15221
15882
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
15222
15883
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
15223
- params.relativeDirPath = join105(rulesyncFrontmatter.agentsmd.subprojectPath);
15884
+ params.relativeDirPath = join108(rulesyncFrontmatter.agentsmd.subprojectPath);
15224
15885
  params.relativeFilePath = "AGENTS.md";
15225
15886
  }
15226
15887
  return params;
@@ -15269,7 +15930,7 @@ var ToolRule = class extends ToolFile {
15269
15930
  }
15270
15931
  };
15271
15932
  function buildToolPath(toolDir, subDir, excludeToolDir) {
15272
- return excludeToolDir ? subDir : join105(toolDir, subDir);
15933
+ return excludeToolDir ? subDir : join108(toolDir, subDir);
15273
15934
  }
15274
15935
 
15275
15936
  // src/features/rules/agentsmd-rule.ts
@@ -15298,8 +15959,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15298
15959
  validate = true
15299
15960
  }) {
15300
15961
  const isRoot = relativeFilePath === "AGENTS.md";
15301
- const relativePath = isRoot ? "AGENTS.md" : join106(".agents", "memories", relativeFilePath);
15302
- const fileContent = await readFileContent(join106(baseDir, relativePath));
15962
+ const relativePath = isRoot ? "AGENTS.md" : join109(".agents", "memories", relativeFilePath);
15963
+ const fileContent = await readFileContent(join109(baseDir, relativePath));
15303
15964
  return new _AgentsMdRule({
15304
15965
  baseDir,
15305
15966
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -15354,21 +16015,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
15354
16015
  };
15355
16016
 
15356
16017
  // src/features/rules/antigravity-rule.ts
15357
- import { join as join107 } from "path";
15358
- import { z as z60 } from "zod/mini";
15359
- var AntigravityRuleFrontmatterSchema = z60.looseObject({
15360
- trigger: z60.optional(
15361
- z60.union([
15362
- z60.literal("always_on"),
15363
- z60.literal("glob"),
15364
- z60.literal("manual"),
15365
- z60.literal("model_decision"),
15366
- z60.string()
16018
+ import { join as join110 } from "path";
16019
+ import { z as z64 } from "zod/mini";
16020
+ var AntigravityRuleFrontmatterSchema = z64.looseObject({
16021
+ trigger: z64.optional(
16022
+ z64.union([
16023
+ z64.literal("always_on"),
16024
+ z64.literal("glob"),
16025
+ z64.literal("manual"),
16026
+ z64.literal("model_decision"),
16027
+ z64.string()
15367
16028
  // accepts any string for forward compatibility
15368
16029
  ])
15369
16030
  ),
15370
- globs: z60.optional(z60.string()),
15371
- description: z60.optional(z60.string())
16031
+ globs: z64.optional(z64.string()),
16032
+ description: z64.optional(z64.string())
15372
16033
  });
15373
16034
  function parseGlobsString(globs) {
15374
16035
  if (!globs) {
@@ -15513,7 +16174,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15513
16174
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
15514
16175
  if (!result.success) {
15515
16176
  throw new Error(
15516
- `Invalid frontmatter in ${join107(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16177
+ `Invalid frontmatter in ${join110(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15517
16178
  );
15518
16179
  }
15519
16180
  }
@@ -15537,7 +16198,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15537
16198
  relativeFilePath,
15538
16199
  validate = true
15539
16200
  }) {
15540
- const filePath = join107(
16201
+ const filePath = join110(
15541
16202
  baseDir,
15542
16203
  this.getSettablePaths().nonRoot.relativeDirPath,
15543
16204
  relativeFilePath
@@ -15677,7 +16338,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
15677
16338
  };
15678
16339
 
15679
16340
  // src/features/rules/augmentcode-legacy-rule.ts
15680
- import { join as join108 } from "path";
16341
+ import { join as join111 } from "path";
15681
16342
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15682
16343
  toRulesyncRule() {
15683
16344
  const rulesyncFrontmatter = {
@@ -15737,8 +16398,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15737
16398
  }) {
15738
16399
  const settablePaths = this.getSettablePaths();
15739
16400
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
15740
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : join108(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
15741
- const fileContent = await readFileContent(join108(baseDir, relativePath));
16401
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : join111(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
16402
+ const fileContent = await readFileContent(join111(baseDir, relativePath));
15742
16403
  return new _AugmentcodeLegacyRule({
15743
16404
  baseDir,
15744
16405
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -15767,7 +16428,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
15767
16428
  };
15768
16429
 
15769
16430
  // src/features/rules/augmentcode-rule.ts
15770
- import { join as join109 } from "path";
16431
+ import { join as join112 } from "path";
15771
16432
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15772
16433
  toRulesyncRule() {
15773
16434
  return this.toRulesyncRuleDefault();
@@ -15798,7 +16459,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15798
16459
  relativeFilePath,
15799
16460
  validate = true
15800
16461
  }) {
15801
- const filePath = join109(
16462
+ const filePath = join112(
15802
16463
  baseDir,
15803
16464
  this.getSettablePaths().nonRoot.relativeDirPath,
15804
16465
  relativeFilePath
@@ -15838,7 +16499,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
15838
16499
  };
15839
16500
 
15840
16501
  // src/features/rules/claudecode-legacy-rule.ts
15841
- import { join as join110 } from "path";
16502
+ import { join as join113 } from "path";
15842
16503
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15843
16504
  static getSettablePaths({
15844
16505
  global,
@@ -15880,7 +16541,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15880
16541
  if (isRoot) {
15881
16542
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
15882
16543
  const fileContent2 = await readFileContent(
15883
- join110(baseDir, rootDirPath, paths.root.relativeFilePath)
16544
+ join113(baseDir, rootDirPath, paths.root.relativeFilePath)
15884
16545
  );
15885
16546
  return new _ClaudecodeLegacyRule({
15886
16547
  baseDir,
@@ -15894,8 +16555,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15894
16555
  if (!paths.nonRoot) {
15895
16556
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15896
16557
  }
15897
- const relativePath = join110(paths.nonRoot.relativeDirPath, relativeFilePath);
15898
- const fileContent = await readFileContent(join110(baseDir, relativePath));
16558
+ const relativePath = join113(paths.nonRoot.relativeDirPath, relativeFilePath);
16559
+ const fileContent = await readFileContent(join113(baseDir, relativePath));
15899
16560
  return new _ClaudecodeLegacyRule({
15900
16561
  baseDir,
15901
16562
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15954,10 +16615,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
15954
16615
  };
15955
16616
 
15956
16617
  // src/features/rules/claudecode-rule.ts
15957
- import { join as join111 } from "path";
15958
- import { z as z61 } from "zod/mini";
15959
- var ClaudecodeRuleFrontmatterSchema = z61.object({
15960
- paths: z61.optional(z61.array(z61.string()))
16618
+ import { join as join114 } from "path";
16619
+ import { z as z65 } from "zod/mini";
16620
+ var ClaudecodeRuleFrontmatterSchema = z65.object({
16621
+ paths: z65.optional(z65.array(z65.string()))
15961
16622
  });
15962
16623
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15963
16624
  frontmatter;
@@ -15995,7 +16656,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
15995
16656
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
15996
16657
  if (!result.success) {
15997
16658
  throw new Error(
15998
- `Invalid frontmatter in ${join111(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16659
+ `Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15999
16660
  );
16000
16661
  }
16001
16662
  }
@@ -16025,7 +16686,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16025
16686
  if (isRoot) {
16026
16687
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
16027
16688
  const fileContent2 = await readFileContent(
16028
- join111(baseDir, rootDirPath, paths.root.relativeFilePath)
16689
+ join114(baseDir, rootDirPath, paths.root.relativeFilePath)
16029
16690
  );
16030
16691
  return new _ClaudecodeRule({
16031
16692
  baseDir,
@@ -16040,8 +16701,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16040
16701
  if (!paths.nonRoot) {
16041
16702
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16042
16703
  }
16043
- const relativePath = join111(paths.nonRoot.relativeDirPath, relativeFilePath);
16044
- const filePath = join111(baseDir, relativePath);
16704
+ const relativePath = join114(paths.nonRoot.relativeDirPath, relativeFilePath);
16705
+ const filePath = join114(baseDir, relativePath);
16045
16706
  const fileContent = await readFileContent(filePath);
16046
16707
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
16047
16708
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -16152,7 +16813,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16152
16813
  return {
16153
16814
  success: false,
16154
16815
  error: new Error(
16155
- `Invalid frontmatter in ${join111(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16816
+ `Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16156
16817
  )
16157
16818
  };
16158
16819
  }
@@ -16172,10 +16833,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
16172
16833
  };
16173
16834
 
16174
16835
  // src/features/rules/cline-rule.ts
16175
- import { join as join112 } from "path";
16176
- import { z as z62 } from "zod/mini";
16177
- var ClineRuleFrontmatterSchema = z62.object({
16178
- description: z62.string()
16836
+ import { join as join115 } from "path";
16837
+ import { z as z66 } from "zod/mini";
16838
+ var ClineRuleFrontmatterSchema = z66.object({
16839
+ description: z66.string()
16179
16840
  });
16180
16841
  var ClineRule = class _ClineRule extends ToolRule {
16181
16842
  static getSettablePaths(_options = {}) {
@@ -16218,7 +16879,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16218
16879
  validate = true
16219
16880
  }) {
16220
16881
  const fileContent = await readFileContent(
16221
- join112(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16882
+ join115(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16222
16883
  );
16223
16884
  return new _ClineRule({
16224
16885
  baseDir,
@@ -16244,7 +16905,7 @@ var ClineRule = class _ClineRule extends ToolRule {
16244
16905
  };
16245
16906
 
16246
16907
  // src/features/rules/codexcli-rule.ts
16247
- import { join as join113 } from "path";
16908
+ import { join as join116 } from "path";
16248
16909
  var CodexcliRule = class _CodexcliRule extends ToolRule {
16249
16910
  static getSettablePaths({
16250
16911
  global,
@@ -16279,7 +16940,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16279
16940
  if (isRoot) {
16280
16941
  const relativePath2 = paths.root.relativeFilePath;
16281
16942
  const fileContent2 = await readFileContent(
16282
- join113(baseDir, paths.root.relativeDirPath, relativePath2)
16943
+ join116(baseDir, paths.root.relativeDirPath, relativePath2)
16283
16944
  );
16284
16945
  return new _CodexcliRule({
16285
16946
  baseDir,
@@ -16293,8 +16954,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16293
16954
  if (!paths.nonRoot) {
16294
16955
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16295
16956
  }
16296
- const relativePath = join113(paths.nonRoot.relativeDirPath, relativeFilePath);
16297
- const fileContent = await readFileContent(join113(baseDir, relativePath));
16957
+ const relativePath = join116(paths.nonRoot.relativeDirPath, relativeFilePath);
16958
+ const fileContent = await readFileContent(join116(baseDir, relativePath));
16298
16959
  return new _CodexcliRule({
16299
16960
  baseDir,
16300
16961
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -16353,12 +17014,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
16353
17014
  };
16354
17015
 
16355
17016
  // src/features/rules/copilot-rule.ts
16356
- import { join as join114 } from "path";
16357
- import { z as z63 } from "zod/mini";
16358
- var CopilotRuleFrontmatterSchema = z63.object({
16359
- description: z63.optional(z63.string()),
16360
- applyTo: z63.optional(z63.string()),
16361
- excludeAgent: z63.optional(z63.union([z63.literal("code-review"), z63.literal("coding-agent")]))
17017
+ import { join as join117 } from "path";
17018
+ import { z as z67 } from "zod/mini";
17019
+ var CopilotRuleFrontmatterSchema = z67.object({
17020
+ description: z67.optional(z67.string()),
17021
+ applyTo: z67.optional(z67.string()),
17022
+ excludeAgent: z67.optional(z67.union([z67.literal("code-review"), z67.literal("coding-agent")]))
16362
17023
  });
16363
17024
  var CopilotRule = class _CopilotRule extends ToolRule {
16364
17025
  frontmatter;
@@ -16390,7 +17051,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16390
17051
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
16391
17052
  if (!result.success) {
16392
17053
  throw new Error(
16393
- `Invalid frontmatter in ${join114(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17054
+ `Invalid frontmatter in ${join117(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16394
17055
  );
16395
17056
  }
16396
17057
  }
@@ -16480,8 +17141,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16480
17141
  const paths = this.getSettablePaths({ global });
16481
17142
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
16482
17143
  if (isRoot) {
16483
- const relativePath2 = join114(paths.root.relativeDirPath, paths.root.relativeFilePath);
16484
- const filePath2 = join114(baseDir, relativePath2);
17144
+ const relativePath2 = join117(paths.root.relativeDirPath, paths.root.relativeFilePath);
17145
+ const filePath2 = join117(baseDir, relativePath2);
16485
17146
  const fileContent2 = await readFileContent(filePath2);
16486
17147
  return new _CopilotRule({
16487
17148
  baseDir,
@@ -16496,8 +17157,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16496
17157
  if (!paths.nonRoot) {
16497
17158
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16498
17159
  }
16499
- const relativePath = join114(paths.nonRoot.relativeDirPath, relativeFilePath);
16500
- const filePath = join114(baseDir, relativePath);
17160
+ const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
17161
+ const filePath = join117(baseDir, relativePath);
16501
17162
  const fileContent = await readFileContent(filePath);
16502
17163
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
16503
17164
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -16543,7 +17204,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
16543
17204
  return {
16544
17205
  success: false,
16545
17206
  error: new Error(
16546
- `Invalid frontmatter in ${join114(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17207
+ `Invalid frontmatter in ${join117(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16547
17208
  )
16548
17209
  };
16549
17210
  }
@@ -16599,12 +17260,12 @@ var CopilotcliRule = class _CopilotcliRule extends CopilotRule {
16599
17260
  };
16600
17261
 
16601
17262
  // src/features/rules/cursor-rule.ts
16602
- import { join as join115 } from "path";
16603
- import { z as z64 } from "zod/mini";
16604
- var CursorRuleFrontmatterSchema = z64.object({
16605
- description: z64.optional(z64.string()),
16606
- globs: z64.optional(z64.string()),
16607
- alwaysApply: z64.optional(z64.boolean())
17263
+ import { join as join118 } from "path";
17264
+ import { z as z68 } from "zod/mini";
17265
+ var CursorRuleFrontmatterSchema = z68.object({
17266
+ description: z68.optional(z68.string()),
17267
+ globs: z68.optional(z68.string()),
17268
+ alwaysApply: z68.optional(z68.boolean())
16608
17269
  });
16609
17270
  var CursorRule = class _CursorRule extends ToolRule {
16610
17271
  frontmatter;
@@ -16621,7 +17282,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16621
17282
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
16622
17283
  if (!result.success) {
16623
17284
  throw new Error(
16624
- `Invalid frontmatter in ${join115(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
17285
+ `Invalid frontmatter in ${join118(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
16625
17286
  );
16626
17287
  }
16627
17288
  }
@@ -16737,7 +17398,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16737
17398
  relativeFilePath,
16738
17399
  validate = true
16739
17400
  }) {
16740
- const filePath = join115(
17401
+ const filePath = join118(
16741
17402
  baseDir,
16742
17403
  this.getSettablePaths().nonRoot.relativeDirPath,
16743
17404
  relativeFilePath
@@ -16747,7 +17408,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16747
17408
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
16748
17409
  if (!result.success) {
16749
17410
  throw new Error(
16750
- `Invalid frontmatter in ${join115(baseDir, relativeFilePath)}: ${formatError(result.error)}`
17411
+ `Invalid frontmatter in ${join118(baseDir, relativeFilePath)}: ${formatError(result.error)}`
16751
17412
  );
16752
17413
  }
16753
17414
  return new _CursorRule({
@@ -16784,7 +17445,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16784
17445
  return {
16785
17446
  success: false,
16786
17447
  error: new Error(
16787
- `Invalid frontmatter in ${join115(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
17448
+ `Invalid frontmatter in ${join118(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
16788
17449
  )
16789
17450
  };
16790
17451
  }
@@ -16804,7 +17465,7 @@ var CursorRule = class _CursorRule extends ToolRule {
16804
17465
  };
16805
17466
 
16806
17467
  // src/features/rules/deepagents-rule.ts
16807
- import { join as join116 } from "path";
17468
+ import { join as join119 } from "path";
16808
17469
  var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16809
17470
  constructor({ fileContent, root, ...rest }) {
16810
17471
  super({
@@ -16831,8 +17492,8 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16831
17492
  }) {
16832
17493
  const settablePaths = this.getSettablePaths();
16833
17494
  const isRoot = relativeFilePath === "AGENTS.md";
16834
- const relativePath = isRoot ? join116(".deepagents", "AGENTS.md") : join116(".deepagents", "memories", relativeFilePath);
16835
- const fileContent = await readFileContent(join116(baseDir, relativePath));
17495
+ const relativePath = isRoot ? join119(".deepagents", "AGENTS.md") : join119(".deepagents", "memories", relativeFilePath);
17496
+ const fileContent = await readFileContent(join119(baseDir, relativePath));
16836
17497
  return new _DeepagentsRule({
16837
17498
  baseDir,
16838
17499
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -16887,7 +17548,7 @@ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
16887
17548
  };
16888
17549
 
16889
17550
  // src/features/rules/factorydroid-rule.ts
16890
- import { join as join117 } from "path";
17551
+ import { join as join120 } from "path";
16891
17552
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16892
17553
  constructor({ fileContent, root, ...rest }) {
16893
17554
  super({
@@ -16927,8 +17588,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16927
17588
  const paths = this.getSettablePaths({ global });
16928
17589
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
16929
17590
  if (isRoot) {
16930
- const relativePath2 = join117(paths.root.relativeDirPath, paths.root.relativeFilePath);
16931
- const fileContent2 = await readFileContent(join117(baseDir, relativePath2));
17591
+ const relativePath2 = join120(paths.root.relativeDirPath, paths.root.relativeFilePath);
17592
+ const fileContent2 = await readFileContent(join120(baseDir, relativePath2));
16932
17593
  return new _FactorydroidRule({
16933
17594
  baseDir,
16934
17595
  relativeDirPath: paths.root.relativeDirPath,
@@ -16941,8 +17602,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
16941
17602
  if (!paths.nonRoot) {
16942
17603
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
16943
17604
  }
16944
- const relativePath = join117(paths.nonRoot.relativeDirPath, relativeFilePath);
16945
- const fileContent = await readFileContent(join117(baseDir, relativePath));
17605
+ const relativePath = join120(paths.nonRoot.relativeDirPath, relativeFilePath);
17606
+ const fileContent = await readFileContent(join120(baseDir, relativePath));
16946
17607
  return new _FactorydroidRule({
16947
17608
  baseDir,
16948
17609
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17001,7 +17662,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
17001
17662
  };
17002
17663
 
17003
17664
  // src/features/rules/geminicli-rule.ts
17004
- import { join as join118 } from "path";
17665
+ import { join as join121 } from "path";
17005
17666
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17006
17667
  static getSettablePaths({
17007
17668
  global,
@@ -17036,7 +17697,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17036
17697
  if (isRoot) {
17037
17698
  const relativePath2 = paths.root.relativeFilePath;
17038
17699
  const fileContent2 = await readFileContent(
17039
- join118(baseDir, paths.root.relativeDirPath, relativePath2)
17700
+ join121(baseDir, paths.root.relativeDirPath, relativePath2)
17040
17701
  );
17041
17702
  return new _GeminiCliRule({
17042
17703
  baseDir,
@@ -17050,8 +17711,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17050
17711
  if (!paths.nonRoot) {
17051
17712
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17052
17713
  }
17053
- const relativePath = join118(paths.nonRoot.relativeDirPath, relativeFilePath);
17054
- const fileContent = await readFileContent(join118(baseDir, relativePath));
17714
+ const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
17715
+ const fileContent = await readFileContent(join121(baseDir, relativePath));
17055
17716
  return new _GeminiCliRule({
17056
17717
  baseDir,
17057
17718
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17110,7 +17771,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
17110
17771
  };
17111
17772
 
17112
17773
  // src/features/rules/goose-rule.ts
17113
- import { join as join119 } from "path";
17774
+ import { join as join122 } from "path";
17114
17775
  var GooseRule = class _GooseRule extends ToolRule {
17115
17776
  static getSettablePaths({
17116
17777
  global,
@@ -17145,7 +17806,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17145
17806
  if (isRoot) {
17146
17807
  const relativePath2 = paths.root.relativeFilePath;
17147
17808
  const fileContent2 = await readFileContent(
17148
- join119(baseDir, paths.root.relativeDirPath, relativePath2)
17809
+ join122(baseDir, paths.root.relativeDirPath, relativePath2)
17149
17810
  );
17150
17811
  return new _GooseRule({
17151
17812
  baseDir,
@@ -17159,8 +17820,8 @@ var GooseRule = class _GooseRule extends ToolRule {
17159
17820
  if (!paths.nonRoot) {
17160
17821
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17161
17822
  }
17162
- const relativePath = join119(paths.nonRoot.relativeDirPath, relativeFilePath);
17163
- const fileContent = await readFileContent(join119(baseDir, relativePath));
17823
+ const relativePath = join122(paths.nonRoot.relativeDirPath, relativeFilePath);
17824
+ const fileContent = await readFileContent(join122(baseDir, relativePath));
17164
17825
  return new _GooseRule({
17165
17826
  baseDir,
17166
17827
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17219,7 +17880,7 @@ var GooseRule = class _GooseRule extends ToolRule {
17219
17880
  };
17220
17881
 
17221
17882
  // src/features/rules/junie-rule.ts
17222
- import { join as join120 } from "path";
17883
+ import { join as join123 } from "path";
17223
17884
  var JunieRule = class _JunieRule extends ToolRule {
17224
17885
  static getSettablePaths(_options = {}) {
17225
17886
  return {
@@ -17248,8 +17909,8 @@ var JunieRule = class _JunieRule extends ToolRule {
17248
17909
  }) {
17249
17910
  const isRoot = _JunieRule.isRootRelativeFilePath(relativeFilePath);
17250
17911
  const settablePaths = this.getSettablePaths();
17251
- const relativePath = isRoot ? join120(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join120(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17252
- const fileContent = await readFileContent(join120(baseDir, relativePath));
17912
+ const relativePath = isRoot ? join123(settablePaths.root.relativeDirPath, settablePaths.root.relativeFilePath) : join123(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
17913
+ const fileContent = await readFileContent(join123(baseDir, relativePath));
17253
17914
  return new _JunieRule({
17254
17915
  baseDir,
17255
17916
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -17304,7 +17965,7 @@ var JunieRule = class _JunieRule extends ToolRule {
17304
17965
  };
17305
17966
 
17306
17967
  // src/features/rules/kilo-rule.ts
17307
- import { join as join121 } from "path";
17968
+ import { join as join124 } from "path";
17308
17969
  var KiloRule = class _KiloRule extends ToolRule {
17309
17970
  static getSettablePaths({
17310
17971
  global,
@@ -17339,7 +18000,7 @@ var KiloRule = class _KiloRule extends ToolRule {
17339
18000
  if (isRoot) {
17340
18001
  const relativePath2 = paths.root.relativeFilePath;
17341
18002
  const fileContent2 = await readFileContent(
17342
- join121(baseDir, paths.root.relativeDirPath, relativePath2)
18003
+ join124(baseDir, paths.root.relativeDirPath, relativePath2)
17343
18004
  );
17344
18005
  return new _KiloRule({
17345
18006
  baseDir,
@@ -17353,8 +18014,8 @@ var KiloRule = class _KiloRule extends ToolRule {
17353
18014
  if (!paths.nonRoot) {
17354
18015
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17355
18016
  }
17356
- const relativePath = join121(paths.nonRoot.relativeDirPath, relativeFilePath);
17357
- const fileContent = await readFileContent(join121(baseDir, relativePath));
18017
+ const relativePath = join124(paths.nonRoot.relativeDirPath, relativeFilePath);
18018
+ const fileContent = await readFileContent(join124(baseDir, relativePath));
17358
18019
  return new _KiloRule({
17359
18020
  baseDir,
17360
18021
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17413,7 +18074,7 @@ var KiloRule = class _KiloRule extends ToolRule {
17413
18074
  };
17414
18075
 
17415
18076
  // src/features/rules/kiro-rule.ts
17416
- import { join as join122 } from "path";
18077
+ import { join as join125 } from "path";
17417
18078
  var KiroRule = class _KiroRule extends ToolRule {
17418
18079
  static getSettablePaths(_options = {}) {
17419
18080
  return {
@@ -17428,7 +18089,7 @@ var KiroRule = class _KiroRule extends ToolRule {
17428
18089
  validate = true
17429
18090
  }) {
17430
18091
  const fileContent = await readFileContent(
17431
- join122(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18092
+ join125(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17432
18093
  );
17433
18094
  return new _KiroRule({
17434
18095
  baseDir,
@@ -17482,7 +18143,7 @@ var KiroRule = class _KiroRule extends ToolRule {
17482
18143
  };
17483
18144
 
17484
18145
  // src/features/rules/opencode-rule.ts
17485
- import { join as join123 } from "path";
18146
+ import { join as join126 } from "path";
17486
18147
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17487
18148
  static getSettablePaths({
17488
18149
  global,
@@ -17517,7 +18178,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17517
18178
  if (isRoot) {
17518
18179
  const relativePath2 = paths.root.relativeFilePath;
17519
18180
  const fileContent2 = await readFileContent(
17520
- join123(baseDir, paths.root.relativeDirPath, relativePath2)
18181
+ join126(baseDir, paths.root.relativeDirPath, relativePath2)
17521
18182
  );
17522
18183
  return new _OpenCodeRule({
17523
18184
  baseDir,
@@ -17531,8 +18192,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17531
18192
  if (!paths.nonRoot) {
17532
18193
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
17533
18194
  }
17534
- const relativePath = join123(paths.nonRoot.relativeDirPath, relativeFilePath);
17535
- const fileContent = await readFileContent(join123(baseDir, relativePath));
18195
+ const relativePath = join126(paths.nonRoot.relativeDirPath, relativeFilePath);
18196
+ const fileContent = await readFileContent(join126(baseDir, relativePath));
17536
18197
  return new _OpenCodeRule({
17537
18198
  baseDir,
17538
18199
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -17591,7 +18252,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
17591
18252
  };
17592
18253
 
17593
18254
  // src/features/rules/qwencode-rule.ts
17594
- import { join as join124 } from "path";
18255
+ import { join as join127 } from "path";
17595
18256
  var QwencodeRule = class _QwencodeRule extends ToolRule {
17596
18257
  static getSettablePaths(_options = {}) {
17597
18258
  return {
@@ -17610,8 +18271,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
17610
18271
  validate = true
17611
18272
  }) {
17612
18273
  const isRoot = relativeFilePath === "QWEN.md";
17613
- const relativePath = isRoot ? "QWEN.md" : join124(".qwen", "memories", relativeFilePath);
17614
- const fileContent = await readFileContent(join124(baseDir, relativePath));
18274
+ const relativePath = isRoot ? "QWEN.md" : join127(".qwen", "memories", relativeFilePath);
18275
+ const fileContent = await readFileContent(join127(baseDir, relativePath));
17615
18276
  return new _QwencodeRule({
17616
18277
  baseDir,
17617
18278
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -17663,7 +18324,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
17663
18324
  };
17664
18325
 
17665
18326
  // src/features/rules/replit-rule.ts
17666
- import { join as join125 } from "path";
18327
+ import { join as join128 } from "path";
17667
18328
  var ReplitRule = class _ReplitRule extends ToolRule {
17668
18329
  static getSettablePaths(_options = {}) {
17669
18330
  return {
@@ -17685,7 +18346,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
17685
18346
  }
17686
18347
  const relativePath = paths.root.relativeFilePath;
17687
18348
  const fileContent = await readFileContent(
17688
- join125(baseDir, paths.root.relativeDirPath, relativePath)
18349
+ join128(baseDir, paths.root.relativeDirPath, relativePath)
17689
18350
  );
17690
18351
  return new _ReplitRule({
17691
18352
  baseDir,
@@ -17751,7 +18412,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
17751
18412
  };
17752
18413
 
17753
18414
  // src/features/rules/roo-rule.ts
17754
- import { join as join126 } from "path";
18415
+ import { join as join129 } from "path";
17755
18416
  var RooRule = class _RooRule extends ToolRule {
17756
18417
  static getSettablePaths(_options = {}) {
17757
18418
  return {
@@ -17766,7 +18427,7 @@ var RooRule = class _RooRule extends ToolRule {
17766
18427
  validate = true
17767
18428
  }) {
17768
18429
  const fileContent = await readFileContent(
17769
- join126(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18430
+ join129(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
17770
18431
  );
17771
18432
  return new _RooRule({
17772
18433
  baseDir,
@@ -17835,7 +18496,7 @@ var RooRule = class _RooRule extends ToolRule {
17835
18496
  };
17836
18497
 
17837
18498
  // src/features/rules/rovodev-rule.ts
17838
- import { join as join127 } from "path";
18499
+ import { join as join130 } from "path";
17839
18500
  var DISALLOWED_ROVODEV_MODULAR_RULE_BASENAMES = /* @__PURE__ */ new Set(["agents.md", "agents.local.md"]);
17840
18501
  var RovodevRule = class _RovodevRule extends ToolRule {
17841
18502
  /**
@@ -17879,7 +18540,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17879
18540
  root: rovodevAgents,
17880
18541
  alternativeRoots: [{ relativeDirPath: ".", relativeFilePath: "AGENTS.md" }],
17881
18542
  nonRoot: {
17882
- relativeDirPath: join127(".rovodev", ".rulesync", "modular-rules")
18543
+ relativeDirPath: join130(".rovodev", ".rulesync", "modular-rules")
17883
18544
  }
17884
18545
  };
17885
18546
  }
@@ -17918,10 +18579,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17918
18579
  }) {
17919
18580
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) {
17920
18581
  throw new Error(
17921
- `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join127(relativeDirPath, relativeFilePath)}`
18582
+ `Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join130(relativeDirPath, relativeFilePath)}`
17922
18583
  );
17923
18584
  }
17924
- const fileContent = await readFileContent(join127(baseDir, relativeDirPath, relativeFilePath));
18585
+ const fileContent = await readFileContent(join130(baseDir, relativeDirPath, relativeFilePath));
17925
18586
  return new _RovodevRule({
17926
18587
  baseDir,
17927
18588
  relativeDirPath,
@@ -17941,10 +18602,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17941
18602
  paths
17942
18603
  }) {
17943
18604
  const relativeDirPath = overrideDirPath ?? paths.root.relativeDirPath;
17944
- const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join127(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join127(paths.root.relativeDirPath, paths.root.relativeFilePath);
18605
+ const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join130(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join130(paths.root.relativeDirPath, paths.root.relativeFilePath);
17945
18606
  if (relativeFilePath !== "AGENTS.md") {
17946
18607
  throw new Error(
17947
- `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join127(relativeDirPath, relativeFilePath)}`
18608
+ `Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join130(relativeDirPath, relativeFilePath)}`
17948
18609
  );
17949
18610
  }
17950
18611
  const allowed = relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some(
@@ -17952,10 +18613,10 @@ var RovodevRule = class _RovodevRule extends ToolRule {
17952
18613
  );
17953
18614
  if (!allowed) {
17954
18615
  throw new Error(
17955
- `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join127(relativeDirPath, relativeFilePath)}`
18616
+ `Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join130(relativeDirPath, relativeFilePath)}`
17956
18617
  );
17957
18618
  }
17958
- const fileContent = await readFileContent(join127(baseDir, relativeDirPath, relativeFilePath));
18619
+ const fileContent = await readFileContent(join130(baseDir, relativeDirPath, relativeFilePath));
17959
18620
  return new _RovodevRule({
17960
18621
  baseDir,
17961
18622
  relativeDirPath,
@@ -18069,7 +18730,7 @@ var RovodevRule = class _RovodevRule extends ToolRule {
18069
18730
  };
18070
18731
 
18071
18732
  // src/features/rules/warp-rule.ts
18072
- import { join as join128 } from "path";
18733
+ import { join as join131 } from "path";
18073
18734
  var WarpRule = class _WarpRule extends ToolRule {
18074
18735
  constructor({ fileContent, root, ...rest }) {
18075
18736
  super({
@@ -18095,8 +18756,8 @@ var WarpRule = class _WarpRule extends ToolRule {
18095
18756
  validate = true
18096
18757
  }) {
18097
18758
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
18098
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join128(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
18099
- const fileContent = await readFileContent(join128(baseDir, relativePath));
18759
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : join131(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
18760
+ const fileContent = await readFileContent(join131(baseDir, relativePath));
18100
18761
  return new _WarpRule({
18101
18762
  baseDir,
18102
18763
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -18151,7 +18812,7 @@ var WarpRule = class _WarpRule extends ToolRule {
18151
18812
  };
18152
18813
 
18153
18814
  // src/features/rules/windsurf-rule.ts
18154
- import { join as join129 } from "path";
18815
+ import { join as join132 } from "path";
18155
18816
  var WindsurfRule = class _WindsurfRule extends ToolRule {
18156
18817
  static getSettablePaths(_options = {}) {
18157
18818
  return {
@@ -18166,7 +18827,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
18166
18827
  validate = true
18167
18828
  }) {
18168
18829
  const fileContent = await readFileContent(
18169
- join129(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18830
+ join132(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
18170
18831
  );
18171
18832
  return new _WindsurfRule({
18172
18833
  baseDir,
@@ -18245,8 +18906,8 @@ var rulesProcessorToolTargets = [
18245
18906
  "warp",
18246
18907
  "windsurf"
18247
18908
  ];
18248
- var RulesProcessorToolTargetSchema = z65.enum(rulesProcessorToolTargets);
18249
- var formatRulePaths = (rules) => rules.map((r) => join130(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
18909
+ var RulesProcessorToolTargetSchema = z69.enum(rulesProcessorToolTargets);
18910
+ var formatRulePaths = (rules) => rules.map((r) => join133(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
18250
18911
  var toolRuleFactories = /* @__PURE__ */ new Map([
18251
18912
  [
18252
18913
  "agentsmd",
@@ -18674,7 +19335,7 @@ var RulesProcessor = class extends FeatureProcessor {
18674
19335
  }).relativeDirPath;
18675
19336
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
18676
19337
  const frontmatter = skill.getFrontmatter();
18677
- const relativePath = join130(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
19338
+ const relativePath = join133(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
18678
19339
  return {
18679
19340
  name: frontmatter.name,
18680
19341
  description: frontmatter.description,
@@ -18799,8 +19460,8 @@ var RulesProcessor = class extends FeatureProcessor {
18799
19460
  * Load and parse rulesync rule files from .rulesync/rules/ directory
18800
19461
  */
18801
19462
  async loadRulesyncFiles() {
18802
- const rulesyncBaseDir = join130(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
18803
- const files = await findFilesByGlobs(join130(rulesyncBaseDir, "**", "*.md"));
19463
+ const rulesyncBaseDir = join133(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
19464
+ const files = await findFilesByGlobs(join133(rulesyncBaseDir, "**", "*.md"));
18804
19465
  this.logger.debug(`Found ${files.length} rulesync files`);
18805
19466
  const rulesyncRules = await Promise.all(
18806
19467
  files.map((file) => {
@@ -18915,13 +19576,13 @@ var RulesProcessor = class extends FeatureProcessor {
18915
19576
  return [];
18916
19577
  }
18917
19578
  const uniqueRootFilePaths = await findFilesWithFallback(
18918
- join130(
19579
+ join133(
18919
19580
  this.baseDir,
18920
19581
  settablePaths.root.relativeDirPath ?? ".",
18921
19582
  settablePaths.root.relativeFilePath
18922
19583
  ),
18923
19584
  settablePaths.alternativeRoots,
18924
- (alt) => join130(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
19585
+ (alt) => join133(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
18925
19586
  );
18926
19587
  if (forDeletion) {
18927
19588
  return buildDeletionRulesFromPaths(uniqueRootFilePaths);
@@ -18952,7 +19613,7 @@ var RulesProcessor = class extends FeatureProcessor {
18952
19613
  return [];
18953
19614
  }
18954
19615
  const uniqueLocalRootFilePaths2 = await findFilesByGlobs(
18955
- join130(this.baseDir, "AGENTS.local.md")
19616
+ join133(this.baseDir, "AGENTS.local.md")
18956
19617
  );
18957
19618
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths2);
18958
19619
  }
@@ -18963,9 +19624,9 @@ var RulesProcessor = class extends FeatureProcessor {
18963
19624
  return [];
18964
19625
  }
18965
19626
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
18966
- join130(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
19627
+ join133(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
18967
19628
  settablePaths.alternativeRoots,
18968
- (alt) => join130(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
19629
+ (alt) => join133(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
18969
19630
  );
18970
19631
  return buildDeletionRulesFromPaths(uniqueLocalRootFilePaths);
18971
19632
  })();
@@ -18976,20 +19637,20 @@ var RulesProcessor = class extends FeatureProcessor {
18976
19637
  if (!forDeletion || this.toolTarget !== "rovodev" || this.global) {
18977
19638
  return [];
18978
19639
  }
18979
- const primaryPaths = await findFilesByGlobs(join130(this.baseDir, ".rovodev", "AGENTS.md"));
19640
+ const primaryPaths = await findFilesByGlobs(join133(this.baseDir, ".rovodev", "AGENTS.md"));
18980
19641
  if (primaryPaths.length === 0) {
18981
19642
  return [];
18982
19643
  }
18983
- const mirrorPaths = await findFilesByGlobs(join130(this.baseDir, "AGENTS.md"));
19644
+ const mirrorPaths = await findFilesByGlobs(join133(this.baseDir, "AGENTS.md"));
18984
19645
  return buildDeletionRulesFromPaths(mirrorPaths);
18985
19646
  })();
18986
19647
  const nonRootToolRules = await (async () => {
18987
19648
  if (!settablePaths.nonRoot) {
18988
19649
  return [];
18989
19650
  }
18990
- const nonRootBaseDir = join130(this.baseDir, settablePaths.nonRoot.relativeDirPath);
19651
+ const nonRootBaseDir = join133(this.baseDir, settablePaths.nonRoot.relativeDirPath);
18991
19652
  const nonRootFilePaths = await findFilesByGlobs(
18992
- join130(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
19653
+ join133(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
18993
19654
  );
18994
19655
  if (forDeletion) {
18995
19656
  return buildDeletionRulesFromPaths(nonRootFilePaths, {
@@ -19003,7 +19664,7 @@ var RulesProcessor = class extends FeatureProcessor {
19003
19664
  const ok = RovodevRule.isAllowedModularRulesRelativePath(relativeFilePath);
19004
19665
  if (!ok) {
19005
19666
  this.logger.warn(
19006
- `Skipping reserved Rovodev path under modular-rules (import): ${join130(modularRootRelative, relativeFilePath)}`
19667
+ `Skipping reserved Rovodev path under modular-rules (import): ${join133(modularRootRelative, relativeFilePath)}`
19007
19668
  );
19008
19669
  }
19009
19670
  return ok;
@@ -19129,14 +19790,14 @@ s/<command> [arguments]
19129
19790
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
19130
19791
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
19131
19792
 
19132
- When users call a custom slash command, you have to look for the markdown file, \`${join130(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
19793
+ When users call a custom slash command, you have to look for the markdown file, \`${join133(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
19133
19794
  const subagentsSection = subagents ? `## Simulated Subagents
19134
19795
 
19135
19796
  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.
19136
19797
 
19137
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${join130(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
19798
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${join133(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
19138
19799
 
19139
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join130(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
19800
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${join133(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
19140
19801
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
19141
19802
  const result = [
19142
19803
  overview,
@@ -19236,7 +19897,7 @@ function warnUnsupportedTargets(params) {
19236
19897
  }
19237
19898
  }
19238
19899
  async function checkRulesyncDirExists(params) {
19239
- return fileExists(join131(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19900
+ return fileExists(join134(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
19240
19901
  }
19241
19902
  async function generate(params) {
19242
19903
  const { config, logger } = params;
@@ -19246,8 +19907,9 @@ async function generate(params) {
19246
19907
  const subagentsResult = await generateSubagentsCore({ config, logger });
19247
19908
  const skillsResult = await generateSkillsCore({ config, logger });
19248
19909
  const hooksResult = await generateHooksCore({ config, logger });
19910
+ const permissionsResult = await generatePermissionsCore({ config, logger });
19249
19911
  const rulesResult = await generateRulesCore({ config, logger, skills: skillsResult.skills });
19250
- const hasDiff = ignoreResult.hasDiff || mcpResult.hasDiff || commandsResult.hasDiff || subagentsResult.hasDiff || skillsResult.hasDiff || hooksResult.hasDiff || rulesResult.hasDiff;
19912
+ const hasDiff = ignoreResult.hasDiff || mcpResult.hasDiff || commandsResult.hasDiff || subagentsResult.hasDiff || skillsResult.hasDiff || hooksResult.hasDiff || permissionsResult.hasDiff || rulesResult.hasDiff;
19251
19913
  return {
19252
19914
  rulesCount: rulesResult.count,
19253
19915
  rulesPaths: rulesResult.paths,
@@ -19263,6 +19925,8 @@ async function generate(params) {
19263
19925
  skillsPaths: skillsResult.paths,
19264
19926
  hooksCount: hooksResult.count,
19265
19927
  hooksPaths: hooksResult.paths,
19928
+ permissionsCount: permissionsResult.count,
19929
+ permissionsPaths: permissionsResult.paths,
19266
19930
  skills: skillsResult.skills,
19267
19931
  hasDiff
19268
19932
  };
@@ -19325,7 +19989,8 @@ async function generateIgnoreCore(params) {
19325
19989
  baseDir: baseDir === process.cwd() ? "." : baseDir,
19326
19990
  toolTarget,
19327
19991
  dryRun: config.isPreviewMode(),
19328
- logger
19992
+ logger,
19993
+ featureOptions: config.getFeatureOptions(toolTarget, "ignore")
19329
19994
  });
19330
19995
  const rulesyncFiles = await processor.loadRulesyncFiles();
19331
19996
  const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
@@ -19535,6 +20200,48 @@ async function generateHooksCore(params) {
19535
20200
  }
19536
20201
  return { count: totalCount, paths: allPaths, hasDiff };
19537
20202
  }
20203
+ async function generatePermissionsCore(params) {
20204
+ const { config, logger } = params;
20205
+ const supportedPermissionsTargets = PermissionsProcessor.getToolTargets({
20206
+ global: config.getGlobal()
20207
+ });
20208
+ warnUnsupportedTargets({
20209
+ config,
20210
+ supportedTargets: supportedPermissionsTargets,
20211
+ featureName: "permissions",
20212
+ logger
20213
+ });
20214
+ let totalCount = 0;
20215
+ const allPaths = [];
20216
+ let hasDiff = false;
20217
+ for (const baseDir of config.getBaseDirs()) {
20218
+ for (const toolTarget of intersection(config.getTargets(), supportedPermissionsTargets)) {
20219
+ if (!config.getFeatures(toolTarget).includes("permissions")) {
20220
+ continue;
20221
+ }
20222
+ try {
20223
+ const processor = new PermissionsProcessor({
20224
+ baseDir,
20225
+ toolTarget,
20226
+ global: config.getGlobal(),
20227
+ dryRun: config.isPreviewMode(),
20228
+ logger
20229
+ });
20230
+ const rulesyncFiles = await processor.loadRulesyncFiles();
20231
+ const result = await processFeatureWithRulesyncFiles({ config, processor, rulesyncFiles });
20232
+ totalCount += result.count;
20233
+ allPaths.push(...result.paths);
20234
+ if (result.hasDiff) hasDiff = true;
20235
+ } catch (error) {
20236
+ logger.warn(
20237
+ `Failed to generate ${toolTarget} permissions files for ${baseDir}: ${formatError(error)}`
20238
+ );
20239
+ continue;
20240
+ }
20241
+ }
20242
+ }
20243
+ return { count: totalCount, paths: allPaths, hasDiff };
20244
+ }
19538
20245
 
19539
20246
  // src/lib/import.ts
19540
20247
  async function importFromTool(params) {
@@ -19546,6 +20253,7 @@ async function importFromTool(params) {
19546
20253
  const subagentsCount = await importSubagentsCore({ config, tool, logger });
19547
20254
  const skillsCount = await importSkillsCore({ config, tool, logger });
19548
20255
  const hooksCount = await importHooksCore({ config, tool, logger });
20256
+ const permissionsCount = await importPermissionsCore({ config, tool, logger });
19549
20257
  return {
19550
20258
  rulesCount,
19551
20259
  ignoreCount,
@@ -19553,7 +20261,8 @@ async function importFromTool(params) {
19553
20261
  commandsCount,
19554
20262
  subagentsCount,
19555
20263
  skillsCount,
19556
- hooksCount
20264
+ hooksCount,
20265
+ permissionsCount
19557
20266
  };
19558
20267
  }
19559
20268
  async function importRulesCore(params) {
@@ -19599,7 +20308,8 @@ async function importIgnoreCore(params) {
19599
20308
  const ignoreProcessor = new IgnoreProcessor({
19600
20309
  baseDir: config.getBaseDirs()[0] ?? ".",
19601
20310
  toolTarget: tool,
19602
- logger
20311
+ logger,
20312
+ featureOptions: config.getFeatureOptions(tool, "ignore")
19603
20313
  });
19604
20314
  const toolFiles = await ignoreProcessor.loadToolFiles();
19605
20315
  if (toolFiles.length === 0) {
@@ -19761,6 +20471,41 @@ async function importHooksCore(params) {
19761
20471
  }
19762
20472
  return writtenCount;
19763
20473
  }
20474
+ async function importPermissionsCore(params) {
20475
+ const { config, tool, logger } = params;
20476
+ if (!config.getFeatures(tool).includes("permissions")) {
20477
+ return 0;
20478
+ }
20479
+ const allTargets = PermissionsProcessor.getToolTargets({ global: config.getGlobal() });
20480
+ const importableTargets = PermissionsProcessor.getToolTargets({
20481
+ global: config.getGlobal(),
20482
+ importOnly: true
20483
+ });
20484
+ if (!allTargets.includes(tool)) {
20485
+ return 0;
20486
+ }
20487
+ if (!importableTargets.includes(tool)) {
20488
+ logger.warn(`Import is not supported for ${tool} permissions. Skipping.`);
20489
+ return 0;
20490
+ }
20491
+ const permissionsProcessor = new PermissionsProcessor({
20492
+ baseDir: config.getBaseDirs()[0] ?? ".",
20493
+ toolTarget: tool,
20494
+ global: config.getGlobal(),
20495
+ logger
20496
+ });
20497
+ const toolFiles = await permissionsProcessor.loadToolFiles();
20498
+ if (toolFiles.length === 0) {
20499
+ logger.warn(`No permissions files found for ${tool}. Skipping import.`);
20500
+ return 0;
20501
+ }
20502
+ const rulesyncFiles = await permissionsProcessor.convertToolFilesToRulesyncFiles(toolFiles);
20503
+ const { count: writtenCount } = await permissionsProcessor.writeAiFiles(rulesyncFiles);
20504
+ if (config.getVerbose() && writtenCount > 0) {
20505
+ logger.success(`Created ${writtenCount} permissions file(s)`);
20506
+ }
20507
+ return writtenCount;
20508
+ }
19764
20509
 
19765
20510
  // src/types/json-output.ts
19766
20511
  var ErrorCodes = {
@@ -19972,6 +20717,7 @@ export {
19972
20717
  removeTempDirectory,
19973
20718
  ALL_FEATURES,
19974
20719
  ALL_FEATURES_WITH_WILDCARD,
20720
+ isFeatureValueEnabled,
19975
20721
  ALL_TOOL_TARGETS,
19976
20722
  ALL_TOOL_TARGETS_WITH_WILDCARD,
19977
20723
  findControlCharacter,